@ecopages/radiant-ui 0.1.0-rc.7 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -3
- package/dist/components/ui/alert/alert.d.ts +2 -4
- package/dist/components/ui/alert/alert.script.d.ts +25 -15
- package/dist/components/ui/autocomplete/autocomplete.css +1 -2
- package/dist/components/ui/autocomplete/autocomplete.d.ts +8 -3
- package/dist/components/ui/autocomplete/autocomplete.script.d.ts +29 -4
- package/dist/components/ui/avatar/avatar.css +10 -8
- package/dist/components/ui/avatar/avatar.d.ts +3 -1
- package/dist/components/ui/breadcrumb/breadcrumb.d.ts +11 -11
- package/dist/components/ui/breadcrumb/breadcrumb.script.d.ts +10 -10
- package/dist/components/ui/calendar/calendar.css +10 -5
- package/dist/components/ui/calendar/calendar.script.d.ts +24 -21
- package/dist/components/ui/calendar/index.js +1 -1
- package/dist/components/ui/calendar/index.js.map +3 -3
- package/dist/components/ui/carousel/carousel-autoplay.d.ts +22 -0
- package/dist/components/ui/carousel/carousel-swipe.d.ts +17 -0
- package/dist/components/ui/carousel/carousel-window.d.ts +63 -0
- package/dist/components/ui/carousel/carousel.css +71 -18
- package/dist/components/ui/carousel/carousel.d.ts +8 -4
- package/dist/components/ui/carousel/carousel.script.d.ts +73 -40
- package/dist/components/ui/carousel/index.js +1 -1
- package/dist/components/ui/carousel/index.js.map +4 -4
- package/dist/components/ui/checkbox/checkbox.d.ts +11 -0
- package/dist/components/ui/checkbox/checkbox.script.d.ts +31 -8
- package/dist/components/ui/checkbox/index.js +1 -1
- package/dist/components/ui/checkbox/index.js.map +4 -4
- package/dist/components/ui/checkbox-group/checkbox-group.d.ts +4 -2
- package/dist/components/ui/checkbox-group/checkbox-group.script.d.ts +39 -20
- package/dist/components/ui/checkbox-group/index.js +1 -1
- package/dist/components/ui/checkbox-group/index.js.map +4 -4
- package/dist/components/ui/combobox/combobox.css +9 -1
- package/dist/components/ui/combobox/combobox.d.ts +12 -4
- package/dist/components/ui/combobox/combobox.script.d.ts +74 -25
- package/dist/components/ui/combobox/index.d.ts +2 -2
- package/dist/components/ui/combobox/index.js +1 -1
- package/dist/components/ui/combobox/index.js.map +4 -4
- package/dist/components/ui/cycle-toggle/cycle-toggle.d.ts +6 -2
- package/dist/components/ui/cycle-toggle/cycle-toggle.script.d.ts +35 -4
- package/dist/components/ui/cycle-toggle/index.js +1 -1
- package/dist/components/ui/cycle-toggle/index.js.map +3 -3
- package/dist/components/ui/date-field/date-field.css +13 -17
- package/dist/components/ui/date-field/date-field.d.ts +10 -8
- package/dist/components/ui/date-field/date-field.script.d.ts +35 -52
- package/dist/components/ui/date-field/index.js +1 -1
- package/dist/components/ui/date-field/index.js.map +4 -4
- package/dist/components/ui/date-input/date-input-segment-dom.d.ts +24 -0
- package/dist/components/ui/date-input/date-input.css +50 -0
- package/dist/components/ui/date-input/date-input.d.ts +8 -0
- package/dist/components/ui/date-input/date-input.script.d.ts +137 -0
- package/dist/components/ui/date-input/index.d.ts +2 -0
- package/dist/components/ui/date-input/index.js +2 -0
- package/dist/components/ui/date-input/index.js.map +7 -0
- package/dist/components/ui/date-range-picker/date-range-picker.css +18 -19
- package/dist/components/ui/date-range-picker/date-range-picker.d.ts +11 -9
- package/dist/components/ui/date-range-picker/date-range-picker.script.d.ts +42 -51
- package/dist/components/ui/date-range-picker/index.js +1 -1
- package/dist/components/ui/date-range-picker/index.js.map +4 -4
- package/dist/components/ui/dialog/dialog.css +18 -14
- package/dist/components/ui/dialog/dialog.d.ts +6 -0
- package/dist/components/ui/dialog/dialog.script.d.ts +43 -10
- package/dist/components/ui/dialog/index.js +1 -1
- package/dist/components/ui/dialog/index.js.map +4 -4
- package/dist/components/ui/disclosure/disclosure-group.script.d.ts +19 -3
- package/dist/components/ui/disclosure/disclosure.css +3 -6
- package/dist/components/ui/disclosure/disclosure.d.ts +23 -7
- package/dist/components/ui/disclosure/disclosure.script.d.ts +31 -7
- package/dist/components/ui/disclosure/index.d.ts +1 -1
- package/dist/components/ui/disclosure/index.js +1 -1
- package/dist/components/ui/disclosure/index.js.map +4 -4
- package/dist/components/ui/field/field-description.d.ts +1 -0
- package/dist/components/ui/field/field-error.d.ts +2 -2
- package/dist/components/ui/field/field.d.ts +4 -4
- package/dist/components/ui/field/field.script.d.ts +54 -24
- package/dist/components/ui/field/index.js +1 -1
- package/dist/components/ui/field/index.js.map +4 -4
- package/dist/components/ui/form/control-protocol.d.ts +38 -1
- package/dist/components/ui/form/form-context.d.ts +3 -0
- package/dist/components/ui/form/form.d.ts +6 -0
- package/dist/components/ui/form/form.script.d.ts +29 -12
- package/dist/components/ui/form/index.d.ts +2 -1
- package/dist/components/ui/form/index.js +1 -1
- package/dist/components/ui/form/index.js.map +4 -4
- package/dist/components/ui/grid/grid.d.ts +4 -3
- package/dist/components/ui/grid/grid.script.d.ts +19 -11
- package/dist/components/ui/hover-card/hover-card.css +12 -101
- package/dist/components/ui/hover-card/hover-card.d.ts +7 -2
- package/dist/components/ui/hover-card/hover-card.script.d.ts +36 -5
- package/dist/components/ui/hover-card/index.js +1 -1
- package/dist/components/ui/hover-card/index.js.map +4 -4
- package/dist/components/ui/input/index.js +1 -1
- package/dist/components/ui/input/index.js.map +4 -4
- package/dist/components/ui/input/input.css +1 -1
- package/dist/components/ui/knob/index.js +1 -1
- package/dist/components/ui/knob/index.js.map +3 -3
- package/dist/components/ui/knob/knob.css +6 -1
- package/dist/components/ui/knob/knob.d.ts +4 -4
- package/dist/components/ui/knob/knob.script.d.ts +55 -20
- package/dist/components/ui/label/index.js +1 -1
- package/dist/components/ui/label/index.js.map +4 -4
- package/dist/components/ui/label/label.d.ts +2 -1
- package/dist/components/ui/listbox/index.d.ts +2 -2
- package/dist/components/ui/listbox/index.js +1 -1
- package/dist/components/ui/listbox/index.js.map +4 -4
- package/dist/components/ui/listbox/listbox.css +14 -0
- package/dist/components/ui/listbox/listbox.d.ts +16 -2
- package/dist/components/ui/listbox/listbox.script.d.ts +55 -12
- package/dist/components/ui/menu-button/index.js +1 -1
- package/dist/components/ui/menu-button/index.js.map +4 -4
- package/dist/components/ui/menu-button/menu-button.d.ts +2 -2
- package/dist/components/ui/menu-button/menu-button.script.d.ts +30 -27
- package/dist/components/ui/menubar/index.js +1 -1
- package/dist/components/ui/menubar/index.js.map +4 -4
- package/dist/components/ui/menubar/menubar.script.d.ts +41 -15
- package/dist/components/ui/meter/index.js +1 -1
- package/dist/components/ui/meter/index.js.map +3 -3
- package/dist/components/ui/meter/meter.css +27 -2
- package/dist/components/ui/meter/meter.script.d.ts +19 -14
- package/dist/components/ui/navigation-menu/index.d.ts +1 -1
- package/dist/components/ui/navigation-menu/index.js +1 -1
- package/dist/components/ui/navigation-menu/index.js.map +4 -4
- package/dist/components/ui/navigation-menu/navigation-menu.css +32 -34
- package/dist/components/ui/navigation-menu/navigation-menu.d.ts +34 -5
- package/dist/components/ui/navigation-menu/navigation-menu.script.d.ts +93 -12
- package/dist/components/ui/number-field/index.js +1 -1
- package/dist/components/ui/number-field/index.js.map +4 -4
- package/dist/components/ui/number-field/number-field.css +1 -1
- package/dist/components/ui/number-field/number-field.d.ts +8 -19
- package/dist/components/ui/number-field/number-field.script.d.ts +30 -9
- package/dist/components/ui/pagination/index.d.ts +1 -1
- package/dist/components/ui/pagination/index.js +1 -1
- package/dist/components/ui/pagination/index.js.map +3 -3
- package/dist/components/ui/pagination/pagination.css +50 -13
- package/dist/components/ui/pagination/pagination.d.ts +33 -9
- package/dist/components/ui/pagination/pagination.script.d.ts +29 -9
- package/dist/components/ui/popover/index.js +1 -1
- package/dist/components/ui/popover/index.js.map +4 -4
- package/dist/components/ui/popover/popover.d.ts +17 -1
- package/dist/components/ui/popover/popover.script.d.ts +57 -9
- package/dist/components/ui/radio-group/index.js +1 -1
- package/dist/components/ui/radio-group/index.js.map +4 -4
- package/dist/components/ui/radio-group/radio-group.d.ts +2 -2
- package/dist/components/ui/radio-group/radio-group.script.d.ts +35 -16
- package/dist/components/ui/select/index.d.ts +2 -2
- package/dist/components/ui/select/index.js +1 -1
- package/dist/components/ui/select/index.js.map +4 -4
- package/dist/components/ui/select/select.css +8 -6
- package/dist/components/ui/select/select.d.ts +18 -9
- package/dist/components/ui/select/select.script.d.ts +74 -26
- package/dist/components/ui/shared/calendar-popover-behavior.d.ts +27 -0
- package/dist/components/ui/shared/control-toggle.css +8 -4
- package/dist/components/ui/shared/field-label.d.ts +5 -0
- package/dist/components/ui/shared/listbox-host-controller.d.ts +41 -0
- package/dist/components/ui/shared/listbox-option.d.ts +4 -0
- package/dist/components/ui/shared/multi-value.d.ts +23 -1
- package/dist/components/ui/shared/numeric-range.d.ts +8 -0
- package/dist/components/ui/shared/popover.css +10 -99
- package/dist/components/ui/sidebar/index.d.ts +2 -1
- package/dist/components/ui/sidebar/index.js +1 -1
- package/dist/components/ui/sidebar/index.js.map +4 -4
- package/dist/components/ui/sidebar/sidebar-trigger.d.ts +12 -0
- package/dist/components/ui/sidebar/sidebar-trigger.script.d.ts +52 -31
- package/dist/components/ui/sidebar/sidebar.css +67 -61
- package/dist/components/ui/sidebar/sidebar.d.ts +9 -4
- package/dist/components/ui/sidebar/sidebar.script.d.ts +42 -20
- package/dist/components/ui/slider/index.js +1 -1
- package/dist/components/ui/slider/index.js.map +4 -4
- package/dist/components/ui/slider/slider.css +5 -5
- package/dist/components/ui/slider/slider.d.ts +20 -10
- package/dist/components/ui/slider/slider.script.d.ts +103 -27
- package/dist/components/ui/switch/index.js +1 -1
- package/dist/components/ui/switch/index.js.map +4 -4
- package/dist/components/ui/switch/switch.css +28 -22
- package/dist/components/ui/switch/switch.d.ts +13 -0
- package/dist/components/ui/switch/switch.script.d.ts +34 -8
- package/dist/components/ui/table/index.js +1 -1
- package/dist/components/ui/table/index.js.map +4 -4
- package/dist/components/ui/table/table.d.ts +9 -7
- package/dist/components/ui/table/table.script.d.ts +55 -12
- package/dist/components/ui/tabs/tabs.css +18 -12
- package/dist/components/ui/tabs/tabs.d.ts +7 -4
- package/dist/components/ui/tabs/tabs.script.d.ts +39 -9
- package/dist/components/ui/tag-group/index.js +1 -1
- package/dist/components/ui/tag-group/index.js.map +4 -4
- package/dist/components/ui/tag-group/tag-group.d.ts +19 -7
- package/dist/components/ui/tag-group/tag-group.script.d.ts +58 -10
- package/dist/components/ui/textarea/index.js +1 -1
- package/dist/components/ui/textarea/index.js.map +4 -4
- package/dist/components/ui/textarea/textarea.css +1 -1
- package/dist/components/ui/toast/index.js +1 -1
- package/dist/components/ui/toast/index.js.map +4 -4
- package/dist/components/ui/toast/toast.css +35 -32
- package/dist/components/ui/toast/toast.script.d.ts +17 -31
- package/dist/components/ui/toast/toaster.script.d.ts +24 -12
- package/dist/components/ui/toc/toc.script.d.ts +19 -8
- package/dist/components/ui/toolbar/toolbar.d.ts +5 -0
- package/dist/components/ui/toolbar/toolbar.script.d.ts +24 -4
- package/dist/components/ui/tooltip/index.js +1 -1
- package/dist/components/ui/tooltip/index.js.map +4 -4
- package/dist/components/ui/tooltip/tooltip.css +14 -94
- package/dist/components/ui/tooltip/tooltip.d.ts +7 -0
- package/dist/components/ui/tooltip/tooltip.script.d.ts +36 -6
- package/dist/components/ui/tree/tree.d.ts +4 -3
- package/dist/components/ui/tree/tree.script.d.ts +28 -15
- package/dist/components/ui/treegrid/treegrid.d.ts +5 -3
- package/dist/components/ui/treegrid/treegrid.script.d.ts +33 -14
- package/dist/components/ui/window-splitter/index.d.ts +1 -1
- package/dist/components/ui/window-splitter/index.js +1 -1
- package/dist/components/ui/window-splitter/index.js.map +3 -3
- package/dist/components/ui/window-splitter/window-splitter.d.ts +10 -1
- package/dist/components/ui/window-splitter/window-splitter.script.d.ts +26 -8
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +4 -4
- package/dist/lib/icons/check.d.ts +3 -0
- package/dist/lib/icons/chevron-down.d.ts +0 -1
- package/dist/lib/icons/index.d.ts +2 -0
- package/dist/lib/icons/x.d.ts +5 -0
- package/dist/lib/intl-date/index.d.ts +4 -2
- package/dist/lib/intl-date/segment-editing.d.ts +34 -0
- package/dist/lib/intl-date/segments.d.ts +26 -4
- package/dist/lib/non-empty.d.ts +6 -0
- package/dist/lib/unique-id.d.ts +11 -0
- package/dist/lib/viewport/breakpoints.d.ts +6 -0
- package/dist/lib/viewport/mobile-layout.d.ts +15 -0
- package/dist/styles/primitives.css +14 -11
- package/dist/styles/radiant-ui-core.css +10 -0
- package/dist/styles/radiant-ui.css +40 -11
- package/dist/styles/style-dependencies.json +38 -13
- package/dist/styles/styles.css +485 -252
- package/dist/styles/tailwind.css +40 -101
- package/dist/styles/tokens/presets/colors/aurora.css +2 -0
- package/dist/styles/tokens/presets/colors/basalt.css +2 -0
- package/dist/styles/tokens/presets/colors/ember.css +2 -0
- package/dist/styles/tokens/presets/colors/glacier.css +2 -0
- package/dist/styles/tokens/semantic.css +1 -0
- package/dist/styles/tokens/system.css +11 -3
- package/dist/styles/tokens/typography/default.css +8 -0
- package/package.json +27 -13
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{RadiantElement as fe,bound as me,customElement as Ye,event as ct,onEvent as st,onUpdated as ht,prop as x,query as lt,state as Xe}from"@ecopages/radiant";import{isServer as Je}from"@ecopages/radiant/is-server";function ft(i){return i.split(",").map(t=>t.trim()).filter(t=>t.length>0)}var mt,gt,_t,vt,yt,St,wt,At,Mt,xt,Et,kt,Lt,Tt,Rt,Ct,Wt,Ot,Dt,zt,Bt,Pt,It,jt,Ut,Vt,Kt,Ht,Qt,$t,qt,Gt,Ft,Yt,Xt,Jt,Nt,Zt,te,ee,ie,re,ne,ae,se,oe,le,de,ue,ce,he,pe;function $e(i,t,e,r,c,m){var f,n,R,E,v,B,L,V=Symbol.metadata||Symbol.for("Symbol.metadata"),H=Object.defineProperty,D=Object.create,Q=[D(null),D(null)],K=t.length;function C(a,g,p){return function(s,o){g&&(o=s,s=i);for(var _=0;_<a.length;_++)o=a[_].apply(s,p?[o]:[]);return p?o:s}}function y(a,g,p,s){if(typeof a!="function"&&(s||a!==void 0))throw new TypeError(g+" must "+(p||"be")+" a function"+(s?"":" or undefined"));return a}function $(a,g,p,s,o,_,k,b,S,w,N){function G(u){if(!N(u))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),Z=g[3],Y=!k,W=o===1,tt=o===3,et=o===4,P=o===2;function I(u,T,nt){return function(U,at){return T&&(at=U,U=a),nt&&nt(U),d[u].call(U,at)}}if(!Y){var d={},X=[],M=tt?"get":et||W?"set":"value";if(S?(w||W?d={get:be(function(){return Z(this)},s,"get"),set:function(u){g[4](this,u)}}:d[M]=Z,w||be(d[M],s,P?"":M)):w||(d=Object.getOwnPropertyDescriptor(a,s)),!w&&!S){if((n=Q[+b][s])&&(n^o)!==7)throw Error("Decorating two elements with the same name ("+d[M].name+") is not supported yet");Q[+b][s]=o<3?1:o}}for(var h=a,j=F.length-1;j>=0;j-=p?2:1){var it=y(F[j],"A decorator","be",!0),rt=p?F[j-1]:void 0,J={},O={kind:["field","accessor","method","getter","setter","class"][o],name:s,metadata:f,addInitializer:function(u,T){if(u.v)throw new TypeError("attempted to call addInitializer after decoration was finished");y(T,"An initializer","be",!0),_.push(T)}.bind(null,J)};if(Y)n=it.call(rt,h,O),J.v=1,y(n,"class decorators","return")&&(h=n);else if(O.static=b,O.private=S,n=O.access={has:S?N.bind():function(u){return s in u}},et||(n.get=S?P?function(u){return G(u),d.value}:I("get",0,G):function(u){return u[s]}),P||tt||(n.set=S?I("set",0,G):function(u,T){u[s]=T}),h=it.call(rt,W?{get:d.get,set:d.set}:d[M],O),J.v=1,W){if(typeof h=="object"&&h)(n=y(h.get,"accessor.get"))&&(d.get=n),(n=y(h.set,"accessor.set"))&&(d.set=n),(n=y(h.init,"accessor.init"))&&X.unshift(n);else if(h!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else y(h,(w?"field":"method")+" decorators","return")&&(w?X.unshift(h):d[M]=h)}return o<2&&k.push(C(X,b,1),C(_,b,0)),w||Y||(S?W?k.splice(-1,0,I("get",b),I("set",b)):k.push(P?d[M]:y.call.bind(d[M])):H(a,s,d)),h}function q(a){return H(a,V,{configurable:!0,enumerable:!0,value:f})}return m!==void 0&&(f=m[V]),f=D(f??null),v=[],B=function(a){a&&v.push(C(a))},L=function(a,g){for(var p=0;p<e.length;p++){var s=e[p],o=s[1],_=7&o;if((8&o)==a&&!_==g){var k=s[2],b=!!s[3],S=16&o;$(a?i:i.prototype,s,S,b?"#"+k:qe(k),_,_<2?[]:a?E=E||[]:R=R||[],v,!!a,b,g,a&&b?function(w){return Fe(w)===i}:c)}}},L(8,0),L(0,0),L(8,1),L(0,1),B(R),B(E),n=v,K||q(i),{e:n,get c(){var a=[];return K&&[q(i=$(i,[t],r,i.name,5,a)),C(a,1)]}}}function qe(i){var t=Ge(i,"string");return typeof t=="symbol"?t:t+""}function Ge(i,t){if(typeof i!="object"||!i)return i;var e=i[Symbol.toPrimitive];if(e!==void 0){var r=e.call(i,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(i)}function be(i,t,e){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(i,"name",{configurable:!0,value:e?e+" "+t:t})}catch{}return i}function Fe(i){if(Object(i)!==i)throw TypeError("right-hand side of 'in' should be an object, got "+(i!==null?typeof i:"null"));return i}var Ne=256,Ze=48,ti=200,ei=480,ii=768,ri="b",ge=8,_e=32,ve="a.rui-sidebar__menu-button";function ni(i){return i.metaKey||i.ctrlKey}function ai(){return typeof window<"u"&&typeof window.matchMedia=="function"}function dt(i){return i==="left"||i==="right"}var Se,ye=class extends fe{static{({e:[_t,vt,yt,St,wt,At,Mt,xt,Et,kt,Lt,Tt,Rt,Ct,Wt,Ot,Dt,zt,Bt,Pt,It,jt,Ut,Vt,Kt,Ht,Qt,$t,qt,Gt,Ft,Yt,Xt,Jt,Nt,Zt,te,ee,ie,re,ne,ae,se,oe,le,de,ue,ce,he,pe,mt],c:[Se,gt]}=$e(this,[Ye("rui-sidebar")],[[x({type:String,reflect:!0,defaultValue:"sidebar"}),0,"variant"],[x({type:String,reflect:!0,defaultValue:"left"}),0,"side"],[x({type:String,reflect:!0,defaultValue:"off"}),0,"collapsible"],[x({type:Number,defaultValue:Ne}),0,"defaultWidth"],[x({type:Number,reflect:!0,attribute:"width"}),0,"width"],[x({type:Number,defaultValue:ti}),0,"minWidth"],[x({type:Number,defaultValue:ei}),0,"maxWidth"],[x({type:Boolean,defaultValue:!1}),0,"resizable"],[x({type:Boolean,defaultValue:!0}),0,"defaultOpen"],[x({type:Boolean,defaultValue:!1}),0,"mobileDefaultOpen"],[x({type:Boolean,attribute:"open"}),0,"open"],[x({type:Number,defaultValue:ii}),0,"mobileBreakpoint"],[x({type:String,defaultValue:"Sidebar"}),0,"label"],[x({type:Boolean,reflect:!0,attribute:"match-active"}),0,"matchActive"],[x({type:String,defaultValue:"pathname"}),0,"matchMode"],[x({type:Boolean,attribute:"scroll-active-on-mount"}),0,"scrollActiveOnMount"],[x({type:String,attribute:"navigation-events",defaultValue:""}),0,"navigationEvents"],[lt({ref:"root"}),0,"rootTarget"],[lt({ref:"pane"}),0,"paneTarget"],[lt({ref:"handle"}),0,"handleTarget"],[lt({ref:"scrim"}),0,"scrimTarget"],[ct({name:"rui-sidebar-toggle",bubbles:!0,composed:!0}),0,"toggleEvent"],[ct({name:"rui-sidebar-resize",bubbles:!0,composed:!0}),0,"resizeEvent"],[ct({name:"rui-sidebar-mobile-change",bubbles:!0,composed:!0}),0,"mobileChangeEvent"],[Xe,0,"isMobile"],[ht(["open","collapsible","variant","side","width","defaultWidth","defaultOpen","minWidth","maxWidth","isMobile","resizable","label"]),2,"onStateUpdated"],[ht(["mobileBreakpoint"]),2,"onMobileBreakpointUpdated"],[ht(["matchActive","matchMode","navigationEvents"]),2,"onMatchSettingsUpdated"],[me,2,"onPointerMove"],[me,2,"onPointerUp"],[st({ref:"handle",type:"pointerdown"}),2,"onHandlePointerDown"],[st({ref:"handle",type:"keydown"}),2,"onHandleKeydown"],[st({ref:"scrim",type:"click"}),2,"onScrimClick"],[st({selector:ve,type:"click"}),2,"onMenuLinkClick"],[st({document:!0,type:"keydown"}),2,"onHostKeydown"]],0,void 0,fe))}variant=(mt(this),_t(this));side=(vt(this),yt(this));collapsible=(St(this),wt(this));defaultWidth=(At(this),Mt(this));width=(xt(this),Et(this));minWidth=(kt(this),Lt(this));maxWidth=(Tt(this),Rt(this));resizable=(Ct(this),Wt(this));defaultOpen=(Ot(this),Dt(this));mobileDefaultOpen=(zt(this),Bt(this));open=(Pt(this),It(this));mobileBreakpoint=(jt(this),Ut(this));label=(Vt(this),Kt(this));matchActive=(Ht(this),Qt(this,!1));matchMode=($t(this),qt(this));scrollActiveOnMount=(Gt(this),Ft(this,!1));navigationEvents=(Yt(this),Xt(this,""));rootTarget=(Jt(this),Nt(this));paneTarget=(Zt(this),te(this));handleTarget=(ee(this),ie(this));scrimTarget=(re(this),ne(this));toggleEvent=(ae(this),se(this));resizeEvent=(oe(this),le(this));mobileChangeEvent=(de(this),ue(this));isMobile=(ce(this),he(this,!1));mediaQuery=(pe(this),null);mediaListener=t=>this.setMobile(t.matches);dragging=!1;dragStartCoord=0;dragStartSize=0;navigationCleanups=[];didScrollActiveOnMount=!1;openControlled=!1;mobileReady=!1;connectedCallback(){super.connectedCallback(),this.ensureWidthInitialized(),this.setAttribute("role","complementary"),this.setAttribute("aria-label",this.label),this.syncPresentation(),this.attachNavigationListeners()}onConnected(){this.ensureWidthInitialized(),this.openControlled=this.open!==void 0,this.bindMobileMediaQuery(),this.openControlled||(this.open=this.isMobile?this.mobileDefaultOpen:this.defaultOpen),this.syncPresentation(),this.syncPaneWidthVar(),this.syncActiveLinksAfterRender(!0),this.mobileReady=!0}hydrate(){super.hydrate(),this.syncActiveLinksAfterRender(!0)}update(){super.update(),this.syncActiveLinksAfterRender(!1)}requestUpdate(){super.requestUpdate(),queueMicrotask(()=>{this.syncActiveLinksAfterRender(!1)})}disconnectedCallback(){this.endDrag(),this.unbindMobileMediaQuery(),this.detachNavigationListeners(),this.mobileReady=!1,super.disconnectedCallback()}syncActiveLinksAfterRender(t){let e=t&&this.scrollActiveOnMount&&!this.didScrollActiveOnMount;this.syncActiveLinks(e),e&&(this.didScrollActiveOnMount=!0)}syncPresentation(){let t=dt(this.side),e=this.isOpen(),r=e?"expanded":"collapsed",c=this.resizable&&this.collapsible==="off"&&e&&!this.isMobile,m=!(e||!this.isMobile&&this.collapsible==="icon"),f=this.paneWidth();this.setAttribute("data-state",r),this.setAttribute("data-collapsible",this.collapsible),this.setAttribute("data-variant",this.variant),this.setAttribute("data-side",this.side),this.setAttribute("data-mobile",String(this.isMobile)),this.setAttribute("data-pane-width",String(f));let n=this.rootTarget;n&&(n.dataset.state=r,n.dataset.collapsible=this.collapsible,n.dataset.variant=this.variant,n.dataset.side=this.side,n.dataset.mobile=String(this.isMobile));let R=this.scrimTarget;R&&R.toggleAttribute("hidden",!(this.isMobile&&e));let E=this.paneTarget;E&&(E.dataset.side=this.side,E.dataset.variant=this.variant,E.setAttribute("aria-label",this.label),m?E.setAttribute("inert",""):E.removeAttribute("inert"));let v=this.handleTarget;v&&(v.toggleAttribute("hidden",!c),c&&(v.setAttribute("aria-orientation",t?"vertical":"horizontal"),v.setAttribute("aria-valuenow",String(f)),v.setAttribute("aria-valuemin",String(this.minWidth)),v.setAttribute("aria-valuemax",String(this.maxWidth)),v.setAttribute("aria-label",`${this.label} resize handle`)))}isOpen(){return this.open!==void 0?this.open:this.defaultOpen}ensureWidthInitialized(){this.hasAttribute("width")||(this.width===void 0||this.width===0)&&(this.width=this.defaultWidth)}onStateUpdated(){this.syncPresentation(),this.syncPaneWidthVar()}onMobileBreakpointUpdated(){this.bindMobileMediaQuery()}onMatchSettingsUpdated(){this.detachNavigationListeners(),this.attachNavigationListeners(),this.syncActiveLinks(!1)}syncActiveLinks(t=!1){if(!this.matchActive||typeof window>"u"||typeof window.location>"u")return!1;let e=window.location.pathname,r=!1;for(let c of this.querySelectorAll(ve)){let m=this.isLinkActive(c,e);c.classList.toggle("rui-sidebar__menu-button--active",m),m?(c.setAttribute("aria-current","page"),t&&!r&&(c.scrollIntoView({block:"nearest"}),r=!0)):c.removeAttribute("aria-current")}return r}isLinkActive(t,e){let r=t.pathname;return this.matchMode==="prefix"?e===r||e.startsWith(`${r}/`):r===e}attachNavigationListeners(){if(Je||!this.isConnected||!this.matchActive||typeof window>"u"||typeof window.addEventListener!="function")return;let t=()=>this.syncActiveLinks(!1);if(window.addEventListener("popstate",t),this.navigationCleanups.push(()=>window.removeEventListener("popstate",t)),typeof document<"u"&&typeof document.addEventListener=="function")for(let e of ft(this.navigationEvents))document.addEventListener(e,t),this.navigationCleanups.push(()=>document.removeEventListener(e,t))}detachNavigationListeners(){for(let t of this.navigationCleanups)t();this.navigationCleanups=[]}unbindMobileMediaQuery(){this.mediaQuery?.removeEventListener("change",this.mediaListener),this.mediaQuery=null}bindMobileMediaQuery(){if(this.unbindMobileMediaQuery(),this.mobileBreakpoint<=0||!ai()){this.setMobile(!1);return}this.mediaQuery=window.matchMedia(`(max-width: ${this.mobileBreakpoint-1}px)`),this.mediaQuery.addEventListener("change",this.mediaListener),this.setMobile(this.mediaQuery.matches)}setMobile(t){if(t===this.isMobile)return;let e=this.isMobile&&!t,r=!this.isMobile&&t;this.isMobile=t;let c=this.mobileReady&&!this.openControlled;c&&e&&this.collapsible==="off"&&!this.isOpen()?this.setOpen(!0):c&&r?this.setOpen(this.mobileDefaultOpen):this.syncPaneWidthVar(),this.mobileChangeEvent.emit({mobile:t})}clampWidth(t){return Math.min(this.maxWidth,Math.max(this.minWidth,t))}paneWidth(){return this.isOpen()?this.width&&this.width>0?this.width:this.defaultWidth:this.isMobile?0:this.collapsible==="icon"?Ze:0}syncPaneWidthVar(t=this.paneWidth()){let e=this.rootTarget;e&&e.style.setProperty("--rui-sidebar-pane-width",`${t}px`),this.paneTarget&&(this.paneTarget.style.removeProperty("width"),this.paneTarget.style.removeProperty("height")),this.setAttribute("data-pane-width",String(t))}applyWidth(t,e){let r=this.clampWidth(t);this.width=r,this.syncPaneWidthVar(r),e&&this.resizeEvent.emit({width:r})}toggle(){this.setOpen(!this.isOpen())}setOpen(t){let e=this.isOpen();if(t===e){this.syncPresentation(),this.syncPaneWidthVar();return}this.open=t;let r=t?"expanded":"collapsed";this.syncPresentation(),this.syncPaneWidthVar(),this.toggleEvent.emit({open:t,state:r})}beginDrag(t){if(t.button!==0||this.collapsible!=="off")return;this.dragging=!0;let e=dt(this.side);this.dragStartCoord=e?t.clientX:t.clientY,this.dragStartSize=this.paneWidth(),this.handleTarget?.setPointerCapture(t.pointerId),document.addEventListener("pointermove",this.onPointerMove),document.addEventListener("pointerup",this.onPointerUp),document.addEventListener("pointercancel",this.onPointerUp)}endDrag(){this.dragging&&(this.dragging=!1,document.removeEventListener("pointermove",this.onPointerMove),document.removeEventListener("pointerup",this.onPointerUp),document.removeEventListener("pointercancel",this.onPointerUp))}onPointerMove(t){if(!this.dragging)return;let r=dt(this.side)?t.clientX:t.clientY,c=this.side==="right"?this.dragStartCoord-r:r-this.dragStartCoord;this.applyWidth(this.dragStartSize+c,!0)}onPointerUp(){this.endDrag()}onHandlePointerDown(t){t.preventDefault(),this.beginDrag(t)}onHandleKeydown(t){let e=t,r=this.paneWidth(),c=dt(this.side),m=c?"ArrowLeft":"ArrowUp",f=c?"ArrowRight":"ArrowDown",n=r;if(e.key===m)n=r-(e.shiftKey?_e:ge);else if(e.key===f)n=r+(e.shiftKey?_e:ge);else if(e.key==="Home")n=this.minWidth;else if(e.key==="End")n=this.maxWidth;else return;t.preventDefault(),this.applyWidth(n,!0)}onScrimClick(){this.isMobile&&this.setOpen(!1)}onMenuLinkClick(){this.isMobile&&this.setOpen(!1)}onHostKeydown(t){let e=t;if(e.key==="Escape"&&this.isMobile&&this.isOpen()){e.preventDefault(),this.setOpen(!1);return}ni(e)&&e.key.toLowerCase()===ri&&(e.preventDefault(),this.toggle())}static{gt()}};import{RadiantElement as je,customElement as ui,onEvent as ci,onUpdated as Ue,prop as ot,query as hi,state as pi}from"@ecopages/radiant";var we,Ae,Me,xe,Ee,ke,Le,Te,Re,Ce,We,Oe,De,ze,Be,Pe;function si(i,t,e,r,c,m){var f,n,R,E,v,B,L,V=Symbol.metadata||Symbol.for("Symbol.metadata"),H=Object.defineProperty,D=Object.create,Q=[D(null),D(null)],K=t.length;function C(a,g,p){return function(s,o){g&&(o=s,s=i);for(var _=0;_<a.length;_++)o=a[_].apply(s,p?[o]:[]);return p?o:s}}function y(a,g,p,s){if(typeof a!="function"&&(s||a!==void 0))throw new TypeError(g+" must "+(p||"be")+" a function"+(s?"":" or undefined"));return a}function $(a,g,p,s,o,_,k,b,S,w,N){function G(u){if(!N(u))throw new TypeError("Attempted to access private element on non-instance")}var F=[].concat(g[0]),Z=g[3],Y=!k,W=o===1,tt=o===3,et=o===4,P=o===2;function I(u,T,nt){return function(U,at){return T&&(at=U,U=a),nt&&nt(U),d[u].call(U,at)}}if(!Y){var d={},X=[],M=tt?"get":et||W?"set":"value";if(S?(w||W?d={get:Ie(function(){return Z(this)},s,"get"),set:function(u){g[4](this,u)}}:d[M]=Z,w||Ie(d[M],s,P?"":M)):w||(d=Object.getOwnPropertyDescriptor(a,s)),!w&&!S){if((n=Q[+b][s])&&(n^o)!==7)throw Error("Decorating two elements with the same name ("+d[M].name+") is not supported yet");Q[+b][s]=o<3?1:o}}for(var h=a,j=F.length-1;j>=0;j-=p?2:1){var it=y(F[j],"A decorator","be",!0),rt=p?F[j-1]:void 0,J={},O={kind:["field","accessor","method","getter","setter","class"][o],name:s,metadata:f,addInitializer:function(u,T){if(u.v)throw new TypeError("attempted to call addInitializer after decoration was finished");y(T,"An initializer","be",!0),_.push(T)}.bind(null,J)};if(Y)n=it.call(rt,h,O),J.v=1,y(n,"class decorators","return")&&(h=n);else if(O.static=b,O.private=S,n=O.access={has:S?N.bind():function(u){return s in u}},et||(n.get=S?P?function(u){return G(u),d.value}:I("get",0,G):function(u){return u[s]}),P||tt||(n.set=S?I("set",0,G):function(u,T){u[s]=T}),h=it.call(rt,W?{get:d.get,set:d.set}:d[M],O),J.v=1,W){if(typeof h=="object"&&h)(n=y(h.get,"accessor.get"))&&(d.get=n),(n=y(h.set,"accessor.set"))&&(d.set=n),(n=y(h.init,"accessor.init"))&&X.unshift(n);else if(h!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else y(h,(w?"field":"method")+" decorators","return")&&(w?X.unshift(h):d[M]=h)}return o<2&&k.push(C(X,b,1),C(_,b,0)),w||Y||(S?W?k.splice(-1,0,I("get",b),I("set",b)):k.push(P?d[M]:y.call.bind(d[M])):H(a,s,d)),h}function q(a){return H(a,V,{configurable:!0,enumerable:!0,value:f})}return m!==void 0&&(f=m[V]),f=D(f??null),v=[],B=function(a){a&&v.push(C(a))},L=function(a,g){for(var p=0;p<e.length;p++){var s=e[p],o=s[1],_=7&o;if((8&o)==a&&!_==g){var k=s[2],b=!!s[3],S=16&o;$(a?i:i.prototype,s,S,b?"#"+k:oi(k),_,_<2?[]:a?E=E||[]:R=R||[],v,!!a,b,g,a&&b?function(w){return di(w)===i}:c)}}},L(8,0),L(0,0),L(8,1),L(0,1),B(R),B(E),n=v,K||q(i),{e:n,get c(){var a=[];return K&&[q(i=$(i,[t],r,i.name,5,a)),C(a,1)]}}}function oi(i){var t=li(i,"string");return typeof t=="symbol"?t:t+""}function li(i,t){if(typeof i!="object"||!i)return i;var e=i[Symbol.toPrimitive];if(e!==void 0){var r=e.call(i,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(i)}function Ie(i,t,e){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(i,"name",{configurable:!0,value:e?e+" "+t:t})}catch{}return i}function di(i){if(Object(i)!==i)throw TypeError("right-hand side of 'in' should be an object, got "+(i!==null?typeof i:"null"));return i}var Ke,Ve=class extends je{static{({e:[Me,xe,Ee,ke,Le,Te,Re,Ce,We,Oe,De,ze,Be,Pe,we],c:[Ke,Ae]}=si(this,[ui("rui-sidebar-trigger")],[[ot({type:String,defaultValue:""}),0,"controls"],[ot({type:String,attribute:"button-label",defaultValue:"Toggle sidebar"}),0,"buttonLabel"],[ot({type:String,reflect:!0,defaultValue:""}),0,"placement"],[ot({type:String,defaultValue:"ghost"}),0,"variant"],[ot({type:String,defaultValue:"md"}),0,"size"],[hi({ref:"button"}),0,"buttonTarget"],[pi,0,"sidebarState"],[Ue(["controls","buttonLabel","placement"]),2,"onBindingUpdated"],[Ue(["variant","size"]),2,"onPresentationUpdated"],[ci({selector:'[data-ref="button"]',type:"click"}),2,"onButtonClick"]],0,void 0,je))}controls=(we(this),Me(this));buttonLabel=(xe(this),Ee(this));placement=(ke(this),Le(this));variant=(Te(this),Re(this));size=(Ce(this),We(this));buttonTarget=(Oe(this),De(this));sidebarState=(ze(this),Be(this,"expanded"));sidebarListener=(Pe(this),null);attachedSidebar=null;initialSyncFrame=null;connectedCallback(){super.connectedCallback(),this.syncWithSidebar(),queueMicrotask(()=>queueMicrotask(()=>this.syncWithSidebar())),this.initialSyncFrame=requestAnimationFrame(()=>{this.initialSyncFrame=null,this.syncWithSidebar()})}disconnectedCallback(){this.initialSyncFrame!=null&&(cancelAnimationFrame(this.initialSyncFrame),this.initialSyncFrame=null),this.detachFromSidebar(),super.disconnectedCallback()}onBindingUpdated(){this.detachFromSidebar(),this.syncWithSidebar(),this.applyState(this.attachedSidebar?this.readState(this.attachedSidebar):"expanded")}onPresentationUpdated(){this.syncButtonPresentation()}resolveSidebar(){let t=this.controls?.trim();if(t){let r=document.getElementById(t);if(r)return r}let e=this.closest("rui-sidebar");return e?.id?e:null}syncWithSidebar(){let t=this.resolveSidebar();if(t===this.attachedSidebar){t&&this.applyState(this.readState(t));return}this.detachFromSidebar(),t&&(this.attachedSidebar=t,this.sidebarListener=e=>{let r=e.detail;this.applyState(r.state)},t.addEventListener("rui-sidebar-toggle",this.sidebarListener),this.applyState(this.readState(t)))}detachFromSidebar(){this.attachedSidebar&&this.sidebarListener&&this.attachedSidebar.removeEventListener("rui-sidebar-toggle",this.sidebarListener),this.attachedSidebar=null,this.sidebarListener=null}readState(t){return t.getAttribute("data-state")??"expanded"}resolvedPlacement(){if(this.classList.contains("rui-sidebar-trigger-placement--header"))return"header";if(this.classList.contains("rui-sidebar-trigger-placement--inset"))return"inset";let t=this.getAttribute("data-placement");return t==="header"||t==="inset"?t:this.placement}resolvedButtonLabel(t=this.sidebarState){if(this.resolvedPlacement()==="inset")return t==="expanded"?"Close navigation":"Open navigation";let e=this.getAttribute("data-button-label")?.trim();if(e)return e;let r=this.getAttribute("button-label")?.trim();return r||this.buttonLabel||"Toggle sidebar"}applyState(t){this.sidebarState=t;let e=this.buttonTarget;if(!e)return;let r=this.resolveSidebar(),c=this.resolvedButtonLabel(t);e.setAttribute("aria-expanded",String(t==="expanded")),e.setAttribute("data-sidebar-state",t),e.setAttribute("aria-label",c),r?.id?e.setAttribute("aria-controls",r.id):this.controls&&e.setAttribute("aria-controls",this.controls),this.syncButtonPresentation()}syncButtonPresentation(){let t=this.buttonTarget;t&&(t.className=`rui-button rui-button--${this.variant} rui-button--${this.size} rui-sidebar__trigger ${this.placementClass()}`.trim())}onButtonClick(t){t.preventDefault(),t.stopPropagation();let e=this.resolveSidebar();e&&typeof e.toggle=="function"&&e.toggle()}placementClass(){return this.resolvedPlacement()==="header"?"rui-sidebar__trigger--header":this.resolvedPlacement()==="inset"?"rui-sidebar__trigger--inset":""}static{Ae()}};import{jsx as l,jsxs as z}from"@ecopages/jsx/jsx-runtime";function pt(i,t){return t===void 0||i?.label!==void 0?i:{...i,label:t}}function ut(...i){for(let t of i)if(t!==void 0)return t}function A(...i){return i.filter(Boolean).join(" ")}function bt(i,...t){let e={...i};for(let r of t)delete e[r];return e}function bi({layout:i="default",siteHeader:t,sidebar:e,children:r,class:c,...m}){return i==="docs"?z("div",{...m,class:A("rui-sidebar-provider",c),"data-layout":i,children:[t?l("div",{class:"rui-sidebar-provider__site-header",children:t}):null,z("div",{class:"rui-sidebar-provider__body",children:[e,r]})]}):z("div",{...m,class:A("rui-sidebar-provider",c),"data-layout":i,children:[e,r]})}function fi({children:i,class:t,...e}){return l("div",{...e,class:A("rui-sidebar__header",t),children:i})}function mi({children:i,class:t,...e}){return l("div",{...e,class:A("rui-sidebar__content",t),children:i})}function gi({children:i,class:t,...e}){return l("div",{...e,class:A("rui-sidebar__footer",t),children:i})}function _i({class:i,...t}){return l("hr",{...t,role:"separator","aria-orientation":"horizontal",class:A("rui-sidebar__separator",i)})}function vi({children:i,class:t,...e}){return l("section",{...e,class:A("rui-sidebar__group",t),children:i})}function He({children:i,class:t,...e}){return l("h2",{...e,class:A("rui-sidebar__group-label",t),children:i})}function yi({children:i,class:t,...e}){return l("button",{...e,type:"button",class:A("rui-sidebar__group-action",t),children:i})}function Si({label:i,action:t,class:e,...r}){return z("div",{...r,class:A("rui-sidebar__group-header",e),children:[l(He,{children:i}),t]})}function wi({children:i,class:t,...e}){return l("ul",{...e,role:"list",class:A("rui-sidebar__menu",t),children:i})}function Ai({children:i,class:t,...e}){return l("li",{...e,class:A("rui-sidebar__menu-item",t),children:i})}function Qe(i){if(i.href!==void 0){let{children:V,class:H,isActive:D,href:Q,tooltip:K,aria:C,title:y,"aria-current":$,...q}=i;return l("a",{...bt(q,"as"),aria:pt(C,typeof V=="string"?void 0:K),href:Q,class:A("rui-sidebar__menu-button",D&&"rui-sidebar__menu-button--active",H),"aria-current":D?"page":$,title:ut(y,K),children:V})}let{children:t,class:e,isActive:r,type:c="button",tooltip:m,disabled:f,onClick:n,aria:R,title:E,"aria-current":v,"on:click":B,...L}=i;return l("button",{...bt(L,"as","href"),aria:pt(R,typeof t=="string"?void 0:m),type:c,class:A("rui-sidebar__menu-button",r&&"rui-sidebar__menu-button--active",e),"aria-current":r?"page":v,disabled:f,title:ut(E,m),"on:click":ut(B,n),children:t})}function Mi(i){let{class:t,...e}=i;return l(Qe,{class:A("rui-sidebar__menu-action",t),...e})}function xi({children:i,class:t,...e}){return l("main",{...e,class:A("rui-sidebar__inset",t),children:i})}function Ei({children:i,open:t,label:e,...r}){return l("rui-sidebar",{...r,"prop:open":t,label:e,children:z("div",{class:"rui-sidebar","data-ref":"root",children:[l("button",{"data-ref":"scrim",type:"button",class:"rui-sidebar__scrim",tabindex:-1,"aria-label":"Close sidebar",hidden:!0}),l("div",{"data-ref":"pane",class:"rui-sidebar__pane","aria-label":e,children:i}),l("div",{"data-ref":"handle",class:"rui-sidebar__handle",role:"separator",tabindex:0,hidden:!0,children:l("span",{class:"rui-sidebar__handle-grip","aria-hidden":"true"})})]})})}function ki(){return z("span",{class:"rui-sidebar__trigger-icon","aria-hidden":"true",children:[z("svg",{class:"rui-sidebar__trigger-glyph rui-sidebar__trigger-glyph--collapse",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[l("path",{d:"M3 5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}),l("path",{d:"M9 3v18"}),l("path",{d:"m14 15 3-3-3-3"})]}),z("svg",{class:"rui-sidebar__trigger-glyph rui-sidebar__trigger-glyph--expand",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[l("path",{d:"M3 5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}),l("path",{d:"M9 3v18"}),l("path",{d:"m14 9-3 3 3 3"})]}),z("svg",{class:"rui-sidebar__trigger-glyph rui-sidebar__trigger-glyph--close",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[l("path",{d:"M18 6 6 18"}),l("path",{d:"m6 6 12 12"})]}),z("svg",{class:"rui-sidebar__trigger-glyph rui-sidebar__trigger-glyph--menu",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[l("path",{d:"M4 6h16"}),l("path",{d:"M4 12h16"}),l("path",{d:"M4 18h16"})]})]})}function Li({children:i,class:t,triggerLabel:e,placement:r,variant:c="ghost",size:m="md",...f}){let n=e??"Toggle sidebar";return l("rui-sidebar-trigger",{...f,class:A(t,r&&`rui-sidebar-trigger-placement--${r}`),"prop:buttonLabel":n,data:{buttonLabel:n},placement:r,variant:c,size:m,children:l("button",{"data-ref":"button",type:"button",class:A("rui-button",`rui-button--${c}`,`rui-button--${m}`,"rui-sidebar__trigger"),children:i??l(ki,{})})})}export{Ei as RuiSidebar,mi as RuiSidebarContent,Se as RuiSidebarElement,gi as RuiSidebarFooter,vi as RuiSidebarGroup,yi as RuiSidebarGroupAction,Si as RuiSidebarGroupHeader,He as RuiSidebarGroupLabel,fi as RuiSidebarHeader,xi as RuiSidebarInset,wi as RuiSidebarMenu,Mi as RuiSidebarMenuAction,Qe as RuiSidebarMenuButton,Ai as RuiSidebarMenuItem,bi as RuiSidebarProvider,_i as RuiSidebarSeparator,Li as RuiSidebarTrigger,Ke as RuiSidebarTriggerElement};
|
|
1
|
+
import{RadiantElement as ye,bindTo as ot,bound as Se,customElement as oi,event as ft,onEvent as st,onUpdated as mt,prop as x,query as ct,state as si}from"@ecopages/radiant";import{isServer as li}from"@ecopages/radiant/is-server";function yt(e){return e.split(",").map(t=>t.trim()).filter(t=>t.length>0)}var St,wt,xt,Mt,Et,Tt,At,kt,Rt,Ct,Ot,Lt,Wt,Dt,zt,It,Bt,jt,Pt,Vt,Ut,Kt,Gt,Ht,Qt,$t,Yt,Xt,qt,Nt,Zt,Jt,Ft,te,ee,ie,re,ne,ae,oe,se,le,de,ue,ce,he,pe,be,fe,me,ge,_e;function ii(e,t,i,r,u,f){var b,o,A,z,C,I,k,U=Symbol.metadata||Symbol.for("Symbol.metadata"),G=Object.defineProperty,D=Object.create,H=[D(null),D(null)],K=t.length;function O(n,m,h){return function(a,s){m&&(s=a,a=e);for(var g=0;g<n.length;g++)s=n[g].apply(a,h?[s]:[]);return h?s:a}}function v(n,m,h,a){if(typeof n!="function"&&(a||n!==void 0))throw new TypeError(m+" must "+(h||"be")+" a function"+(a?"":" or undefined"));return n}function Q(n,m,h,a,s,g,E,p,y,S,J){function Y(d){if(!J(d))throw new TypeError("Attempted to access private element on non-instance")}var X=[].concat(m[0]),F=m[3],q=!E,L=s===1,tt=s===3,et=s===4,B=s===2;function j(d,R,nt){return function(V,at){return R&&(at=V,V=n),nt&&nt(V),l[d].call(V,at)}}if(!q){var l={},N=[],w=tt?"get":et||L?"set":"value";if(y?(S||L?l={get:ve(function(){return F(this)},a,"get"),set:function(d){m[4](this,d)}}:l[w]=F,S||ve(l[w],a,B?"":w)):S||(l=Object.getOwnPropertyDescriptor(n,a)),!S&&!y){if((o=H[+p][a])&&(o^s)!==7)throw Error("Decorating two elements with the same name ("+l[w].name+") is not supported yet");H[+p][a]=s<3?1:s}}for(var c=n,P=X.length-1;P>=0;P-=h?2:1){var it=v(X[P],"A decorator","be",!0),rt=h?X[P-1]:void 0,Z={},W={kind:["field","accessor","method","getter","setter","class"][s],name:a,metadata:b,addInitializer:function(d,R){if(d.v)throw new TypeError("attempted to call addInitializer after decoration was finished");v(R,"An initializer","be",!0),g.push(R)}.bind(null,Z)};if(q)o=it.call(rt,c,W),Z.v=1,v(o,"class decorators","return")&&(c=o);else if(W.static=p,W.private=y,o=W.access={has:y?J.bind():function(d){return a in d}},et||(o.get=y?B?function(d){return Y(d),l.value}:j("get",0,Y):function(d){return d[a]}),B||tt||(o.set=y?j("set",0,Y):function(d,R){d[a]=R}),c=it.call(rt,L?{get:l.get,set:l.set}:l[w],W),Z.v=1,L){if(typeof c=="object"&&c)(o=v(c.get,"accessor.get"))&&(l.get=o),(o=v(c.set,"accessor.set"))&&(l.set=o),(o=v(c.init,"accessor.init"))&&N.unshift(o);else if(c!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else v(c,(S?"field":"method")+" decorators","return")&&(S?N.unshift(c):l[w]=c)}return s<2&&E.push(O(N,p,1),O(g,p,0)),S||q||(y?L?E.splice(-1,0,j("get",p),j("set",p)):E.push(B?l[w]:v.call.bind(l[w])):G(n,a,l)),c}function $(n){return G(n,U,{configurable:!0,enumerable:!0,value:b})}return f!==void 0&&(b=f[U]),b=D(b??null),C=[],I=function(n){n&&C.push(O(n))},k=function(n,m){for(var h=0;h<i.length;h++){var a=i[h],s=a[1],g=7&s;if((8&s)==n&&!g==m){var E=a[2],p=!!a[3],y=16&s;Q(n?e:e.prototype,a,y,p?"#"+E:ri(E),g,g<2?[]:n?z=z||[]:A=A||[],C,!!n,p,m,n&&p?function(S){return ai(S)===e}:u)}}},k(8,0),k(0,0),k(8,1),k(0,1),I(A),I(z),o=C,K||$(e),{e:o,get c(){var n=[];return K&&[$(e=Q(e,[t],r,e.name,5,n)),O(n,1)]}}}function ri(e){var t=ni(e,"string");return typeof t=="symbol"?t:t+""}function ni(e,t){if(typeof e!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var r=i.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ve(e,t,i){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:i?i+" "+t:t})}catch{}return e}function ai(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}var di=256,ui=48,ci=200,hi=480,pi="b",we=8,xe=32,Me='[data-ref="menu-button"]';function bi(e){return e.metaKey||e.ctrlKey}function fi(){return typeof window<"u"&&typeof window.matchMedia=="function"}function ht(e){return e==="left"||e==="right"}var Te,Ee=class extends ye{static{({e:[xt,Mt,Et,Tt,At,kt,Rt,Ct,Ot,Lt,Wt,Dt,zt,It,Bt,jt,Pt,Vt,Ut,Kt,Gt,Ht,Qt,$t,Yt,Xt,qt,Nt,Zt,Jt,Ft,te,ee,ie,re,ne,ae,oe,se,le,de,ue,ce,he,pe,be,fe,me,ge,_e,St],c:[Te,wt]}=ii(this,[oi("rui-sidebar")],[[[x({type:String,reflect:!0,defaultValue:"sidebar"}),ot([{attr:"data-variant"},{ref:"root",attr:"data-variant"},{ref:"pane",attr:"data-variant"}])],0,"variant"],[[x({type:String,reflect:!0,defaultValue:"left"}),ot([{attr:"data-side"},{ref:"root",attr:"data-side"},{ref:"pane",attr:"data-side"}])],0,"side"],[[x({type:String,reflect:!0,defaultValue:"off"}),ot([{attr:"data-collapsible"},{ref:"root",attr:"data-collapsible"}])],0,"collapsible"],[x({type:Number,defaultValue:di}),0,"defaultWidth"],[x({type:Number,reflect:!0,attribute:"width"}),0,"width"],[x({type:Number,defaultValue:ci}),0,"minWidth"],[x({type:Number,defaultValue:hi}),0,"maxWidth"],[x({type:Boolean,defaultValue:!1}),0,"resizable"],[x({type:Boolean,defaultValue:!0}),0,"defaultOpen"],[x({type:Boolean,defaultValue:!1}),0,"mobileDefaultOpen"],[x({type:Boolean,attribute:"open"}),0,"open"],[x({type:Number,defaultValue:768}),0,"mobileBreakpoint"],[[x({type:String,defaultValue:"Sidebar"}),ot([{attr:"aria-label"},{ref:"pane",attr:"aria-label"}])],0,"label"],[x({type:Boolean,reflect:!0,attribute:"match-active"}),0,"matchActive"],[x({type:String,defaultValue:"pathname"}),0,"matchMode"],[x({type:Boolean,attribute:"scroll-active-on-mount"}),0,"scrollActiveOnMount"],[x({type:String,attribute:"navigation-events",defaultValue:""}),0,"navigationEvents"],[ct({ref:"root"}),0,"rootTarget"],[ct({ref:"pane"}),0,"paneTarget"],[ct({ref:"handle"}),0,"handleTarget"],[ct({ref:"scrim"}),0,"scrimTarget"],[ft({name:"rui-sidebar-toggle",bubbles:!0,composed:!0}),0,"toggleEvent"],[ft({name:"rui-sidebar-resize",bubbles:!0,composed:!0}),0,"resizeEvent"],[ft({name:"rui-sidebar-mobile-change",bubbles:!0,composed:!0}),0,"mobileChangeEvent"],[[si,ot([{attr:"data-mobile"},{ref:"root",attr:"data-mobile"}])],0,"isMobile"],[mt(["open","collapsible","variant","side","width","defaultWidth","defaultOpen","minWidth","maxWidth","isMobile","resizable","label"]),2,"onStateUpdated"],[mt(["mobileBreakpoint"]),2,"onMobileBreakpointUpdated"],[mt(["matchActive","matchMode","navigationEvents"]),2,"onMatchSettingsUpdated"],[Se,2,"onPointerMove"],[Se,2,"onPointerUp"],[st({ref:"handle",type:"pointerdown"}),2,"onHandlePointerDown"],[st({ref:"handle",type:"keydown"}),2,"onHandleKeydown"],[st({ref:"scrim",type:"click"}),2,"onScrimClick"],[st({selector:Me,type:"click"}),2,"onMenuLinkClick"],[st({document:!0,type:"keydown"}),2,"onHostKeydown"]],0,void 0,ye))}variant=(St(this),xt(this));side=(Mt(this),Et(this));collapsible=(Tt(this),At(this));defaultWidth=(kt(this),Rt(this));width=(Ct(this),Ot(this));minWidth=(Lt(this),Wt(this));maxWidth=(Dt(this),zt(this));resizable=(It(this),Bt(this));defaultOpen=(jt(this),Pt(this));mobileDefaultOpen=(Vt(this),Ut(this));open=(Kt(this),Gt(this));mobileBreakpoint=(Ht(this),Qt(this));label=($t(this),Yt(this));matchActive=(Xt(this),qt(this,!1));matchMode=(Nt(this),Zt(this));scrollActiveOnMount=(Jt(this),Ft(this,!1));navigationEvents=(te(this),ee(this,""));rootTarget=(ie(this),re(this));paneTarget=(ne(this),ae(this));handleTarget=(oe(this),se(this));scrimTarget=(le(this),de(this));toggleEvent=(ue(this),ce(this));resizeEvent=(he(this),pe(this));mobileChangeEvent=(be(this),fe(this));isMobile=(me(this),ge(this,!1));mediaQuery=(_e(this),null);mediaListener=t=>this.setMobile(t.matches);dragging=!1;dragStartCoord=0;dragStartSize=0;navigationCleanups=[];didScrollActiveOnMount=!1;openControlled=!1;mobileReady=!1;connectedCallback(){super.connectedCallback(),this.ensureWidthInitialized(),this.setAttribute("role","complementary"),this.attachNavigationListeners()}onConnected(){this.ensureWidthInitialized(),this.openControlled=this.open!==void 0,this.bindMobileMediaQuery(),this.openControlled||(this.open=this.isMobile?this.mobileDefaultOpen:this.defaultOpen),this.syncPresentation(),this.syncPaneWidthVar(),this.mobileReady=!0}updated(t){super.updated(t);let i=this.scrollActiveOnMount&&!this.didScrollActiveOnMount;this.syncActiveLinks(i),i&&(this.didScrollActiveOnMount=!0)}disconnectedCallback(){this.endDrag(),this.unbindMobileMediaQuery(),this.detachNavigationListeners(),this.mobileReady=!1,super.disconnectedCallback()}syncPresentation(){let t=this.isOpen(),i=t?"expanded":"collapsed",r=this.resizable&&this.collapsible==="off"&&t&&!this.isMobile,u=!(t||!this.isMobile&&this.collapsible==="icon"),f=this.paneWidth();this.setAttribute("data-state",i),this.setAttribute("data-pane-width",String(f));let b=this.rootTarget;b&&(b.dataset.state=i);let o=this.scrimTarget;o&&o.toggleAttribute("hidden",!(this.isMobile&&t));let A=this.paneTarget;A&&(u?A.setAttribute("inert",""):A.removeAttribute("inert")),this.syncHandlePresentation(r,f)}syncHandlePresentation(t,i){let r=this.handleTarget;r&&(r.toggleAttribute("hidden",!t),t&&(r.setAttribute("aria-orientation",ht(this.side)?"vertical":"horizontal"),r.setAttribute("aria-valuenow",String(i)),r.setAttribute("aria-valuemin",String(this.minWidth)),r.setAttribute("aria-valuemax",String(this.maxWidth)),r.setAttribute("aria-label",`${this.label} resize handle`)))}isOpen(){return this.open!==void 0?this.open:this.defaultOpen}ensureWidthInitialized(){this.hasAttribute("width")||(this.width===void 0||this.width===0)&&(this.width=this.defaultWidth)}onStateUpdated(){this.syncPresentation(),this.syncPaneWidthVar()}onMobileBreakpointUpdated(){this.bindMobileMediaQuery()}onMatchSettingsUpdated(){this.detachNavigationListeners(),this.attachNavigationListeners()}syncActiveLinks(t=!1){if(!this.matchActive||typeof window>"u"||typeof window.location>"u")return!1;let i=window.location.pathname,r=!1;for(let u of this.querySelectorAll(Me)){let f=this.isLinkActive(u,i);u.classList.toggle("rui-sidebar__menu-button--active",f),f?(u.setAttribute("aria-current","page"),t&&!r&&(u.scrollIntoView({block:"nearest"}),r=!0)):u.removeAttribute("aria-current")}return r}isLinkActive(t,i){let r=t.pathname;return this.matchMode==="prefix"?i===r||i.startsWith(`${r}/`):r===i}attachNavigationListeners(){if(li||!this.isConnected||!this.matchActive||typeof window>"u"||typeof window.addEventListener!="function")return;let t=()=>this.syncActiveLinks(!1);if(window.addEventListener("popstate",t),this.navigationCleanups.push(()=>window.removeEventListener("popstate",t)),typeof document<"u"&&typeof document.addEventListener=="function")for(let i of yt(this.navigationEvents))document.addEventListener(i,t),this.navigationCleanups.push(()=>document.removeEventListener(i,t))}detachNavigationListeners(){for(let t of this.navigationCleanups)t();this.navigationCleanups=[]}unbindMobileMediaQuery(){this.mediaQuery?.removeEventListener("change",this.mediaListener),this.mediaQuery=null}bindMobileMediaQuery(){if(this.unbindMobileMediaQuery(),this.mobileBreakpoint<=0||!fi()){this.setMobile(!1);return}this.mediaQuery=window.matchMedia(`(max-width: ${this.mobileBreakpoint-1}px)`),this.mediaQuery.addEventListener("change",this.mediaListener),this.setMobile(this.mediaQuery.matches)}setMobile(t){if(t===this.isMobile)return;let i=this.isMobile&&!t,r=!this.isMobile&&t;this.isMobile=t;let u=this.mobileReady&&!this.openControlled;u&&i&&this.collapsible==="off"&&!this.isOpen()?this.setOpen(!0):u&&r?this.setOpen(this.mobileDefaultOpen):this.syncPaneWidthVar(),this.mobileChangeEvent.emit({mobile:t})}clampWidth(t){return Math.min(this.maxWidth,Math.max(this.minWidth,t))}paneWidth(){return this.isOpen()?this.width&&this.width>0?this.width:this.defaultWidth:this.isMobile?0:this.collapsible==="icon"?ui:0}syncPaneWidthVar(t=this.paneWidth()){let i=this.rootTarget;i&&i.style.setProperty("--rui-sidebar-pane-width",`${t}px`),this.paneTarget&&(this.paneTarget.style.removeProperty("width"),this.paneTarget.style.removeProperty("height")),this.setAttribute("data-pane-width",String(t))}applyWidth(t,i){let r=this.clampWidth(t);this.width=r,this.syncPaneWidthVar(r),i&&this.resizeEvent.emit({width:r})}toggle(){this.setOpen(!this.isOpen())}setOpen(t){let i=this.isOpen();if(t===i){this.syncPresentation(),this.syncPaneWidthVar();return}this.open=t;let r=t?"expanded":"collapsed";this.syncPresentation(),this.syncPaneWidthVar(),this.toggleEvent.emit({open:t,state:r})}beginDrag(t){if(t.button!==0||this.collapsible!=="off")return;this.dragging=!0;let i=ht(this.side);this.dragStartCoord=i?t.clientX:t.clientY,this.dragStartSize=this.paneWidth(),this.handleTarget?.setPointerCapture(t.pointerId),document.addEventListener("pointermove",this.onPointerMove),document.addEventListener("pointerup",this.onPointerUp),document.addEventListener("pointercancel",this.onPointerUp)}endDrag(){this.dragging&&(this.dragging=!1,document.removeEventListener("pointermove",this.onPointerMove),document.removeEventListener("pointerup",this.onPointerUp),document.removeEventListener("pointercancel",this.onPointerUp))}onPointerMove(t){if(!this.dragging)return;let r=ht(this.side)?t.clientX:t.clientY,u=this.side==="right"?this.dragStartCoord-r:r-this.dragStartCoord;this.applyWidth(this.dragStartSize+u,!0)}onPointerUp(){this.endDrag()}onHandlePointerDown(t){t.preventDefault(),this.beginDrag(t)}onHandleKeydown(t){let i=t,r=this.paneWidth(),u=ht(this.side),f=u?"ArrowLeft":"ArrowUp",b=u?"ArrowRight":"ArrowDown",o=r;if(i.key===f)o=r-(i.shiftKey?xe:we);else if(i.key===b)o=r+(i.shiftKey?xe:we);else if(i.key==="Home")o=this.minWidth;else if(i.key==="End")o=this.maxWidth;else return;t.preventDefault(),this.applyWidth(o,!0)}onScrimClick(){this.isMobile&&this.setOpen(!1)}onMenuLinkClick(){this.isMobile&&this.setOpen(!1)}onHostKeydown(t){let i=t;if(i.key==="Escape"&&this.isMobile&&this.isOpen()){i.preventDefault(),this.setOpen(!1);return}bi(i)&&i.key.toLowerCase()===pi&&(i.preventDefault(),this.toggle())}static{wt()}};import{RadiantElement as Xe,bindTo as pt,customElement as yi,onEvent as Si,onUpdated as qe,prop as lt,query as wi,state as gt}from"@ecopages/radiant";var Ae,ke,Re,Ce,Oe,Le,We,De,ze,Ie,Be,je,Pe,Ve,Ue,Ke,Ge,He,Qe,$e;function mi(e,t,i,r,u,f){var b,o,A,z,C,I,k,U=Symbol.metadata||Symbol.for("Symbol.metadata"),G=Object.defineProperty,D=Object.create,H=[D(null),D(null)],K=t.length;function O(n,m,h){return function(a,s){m&&(s=a,a=e);for(var g=0;g<n.length;g++)s=n[g].apply(a,h?[s]:[]);return h?s:a}}function v(n,m,h,a){if(typeof n!="function"&&(a||n!==void 0))throw new TypeError(m+" must "+(h||"be")+" a function"+(a?"":" or undefined"));return n}function Q(n,m,h,a,s,g,E,p,y,S,J){function Y(d){if(!J(d))throw new TypeError("Attempted to access private element on non-instance")}var X=[].concat(m[0]),F=m[3],q=!E,L=s===1,tt=s===3,et=s===4,B=s===2;function j(d,R,nt){return function(V,at){return R&&(at=V,V=n),nt&&nt(V),l[d].call(V,at)}}if(!q){var l={},N=[],w=tt?"get":et||L?"set":"value";if(y?(S||L?l={get:Ye(function(){return F(this)},a,"get"),set:function(d){m[4](this,d)}}:l[w]=F,S||Ye(l[w],a,B?"":w)):S||(l=Object.getOwnPropertyDescriptor(n,a)),!S&&!y){if((o=H[+p][a])&&(o^s)!==7)throw Error("Decorating two elements with the same name ("+l[w].name+") is not supported yet");H[+p][a]=s<3?1:s}}for(var c=n,P=X.length-1;P>=0;P-=h?2:1){var it=v(X[P],"A decorator","be",!0),rt=h?X[P-1]:void 0,Z={},W={kind:["field","accessor","method","getter","setter","class"][s],name:a,metadata:b,addInitializer:function(d,R){if(d.v)throw new TypeError("attempted to call addInitializer after decoration was finished");v(R,"An initializer","be",!0),g.push(R)}.bind(null,Z)};if(q)o=it.call(rt,c,W),Z.v=1,v(o,"class decorators","return")&&(c=o);else if(W.static=p,W.private=y,o=W.access={has:y?J.bind():function(d){return a in d}},et||(o.get=y?B?function(d){return Y(d),l.value}:j("get",0,Y):function(d){return d[a]}),B||tt||(o.set=y?j("set",0,Y):function(d,R){d[a]=R}),c=it.call(rt,L?{get:l.get,set:l.set}:l[w],W),Z.v=1,L){if(typeof c=="object"&&c)(o=v(c.get,"accessor.get"))&&(l.get=o),(o=v(c.set,"accessor.set"))&&(l.set=o),(o=v(c.init,"accessor.init"))&&N.unshift(o);else if(c!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else v(c,(S?"field":"method")+" decorators","return")&&(S?N.unshift(c):l[w]=c)}return s<2&&E.push(O(N,p,1),O(g,p,0)),S||q||(y?L?E.splice(-1,0,j("get",p),j("set",p)):E.push(B?l[w]:v.call.bind(l[w])):G(n,a,l)),c}function $(n){return G(n,U,{configurable:!0,enumerable:!0,value:b})}return f!==void 0&&(b=f[U]),b=D(b??null),C=[],I=function(n){n&&C.push(O(n))},k=function(n,m){for(var h=0;h<i.length;h++){var a=i[h],s=a[1],g=7&s;if((8&s)==n&&!g==m){var E=a[2],p=!!a[3],y=16&s;Q(n?e:e.prototype,a,y,p?"#"+E:gi(E),g,g<2?[]:n?z=z||[]:A=A||[],C,!!n,p,m,n&&p?function(S){return vi(S)===e}:u)}}},k(8,0),k(0,0),k(8,1),k(0,1),I(A),I(z),o=C,K||$(e),{e:o,get c(){var n=[];return K&&[$(e=Q(e,[t],r,e.name,5,n)),O(n,1)]}}}function gi(e){var t=_i(e,"string");return typeof t=="symbol"?t:t+""}function _i(e,t){if(typeof e!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var r=i.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ye(e,t,i){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:i?i+" "+t:t})}catch{}return e}function vi(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}var Ne="Toggle sidebar",xi=["filled","outline","ghost"],Mi=["sm","md","lg"];function Je({variant:e,size:t}){return`rui-button rui-button--${e} rui-button--${t} rui-sidebar__trigger`}function Ei(e){return e==="inset"?"collapsed":"expanded"}var Fe,Ze=class extends Xe{static{({e:[Re,Ce,Oe,Le,We,De,ze,Ie,Be,je,Pe,Ve,Ue,Ke,Ge,He,Qe,$e,Ae],c:[Fe,ke]}=mi(this,[yi("rui-sidebar-trigger")],[[lt({type:String,defaultValue:""}),0,"controls"],[[lt({type:String,attribute:"button-label",defaultValue:Ne}),pt({ref:"button",attr:"aria-label",map:t=>t?.trim()||Ne})],0,"buttonLabel"],[lt({type:String,reflect:!0,defaultValue:""}),0,"placement"],[lt({type:String,defaultValue:"ghost"}),0,"variant"],[lt({type:String,defaultValue:"md"}),0,"size"],[wi({ref:"button"}),0,"buttonTarget"],[[gt,pt([{attr:"data-sidebar-state"},{ref:"button",attr:"aria-expanded",map:t=>String(t==="expanded")}])],0,"sidebarState"],[[gt,pt({attr:"data-sidebar-mobile"})],0,"sidebarMobile"],[[gt,pt({attr:"data-sidebar-collapsible"})],0,"sidebarCollapsible"],[qe(["controls","placement"]),2,"onTargetUpdated"],[qe(["variant","size"]),2,"onPresentationUpdated"],[Si({ref:"button",type:"click"}),2,"onButtonClick"]],0,void 0,Xe))}controls=(Ae(this),Re(this));buttonLabel=(Ce(this),Oe(this));placement=(Le(this),We(this));variant=(De(this),ze(this));size=(Ie(this),Be(this));buttonTarget=(je(this),Pe(this));sidebarState=(Ve(this),Ue(this,"expanded"));sidebarMobile=(Ke(this),Ge(this,null));sidebarCollapsible=(He(this),Qe(this,null));sidebarObserver=($e(this),null);attachedSidebar=null;onConnected(){this.syncWithSidebar()}disconnectedCallback(){this.detachFromSidebar(),super.disconnectedCallback()}onTargetUpdated(){this.syncWithSidebar()}onPresentationUpdated(){let t=this.buttonTarget?.classList;if(t){for(let i of xi)t.toggle(`rui-button--${i}`,i===this.variant);for(let i of Mi)t.toggle(`rui-button--${i}`,i===this.size)}}resolveSidebar(){let t=this.controls?.trim();if(t){let r=document.getElementById(t);return r?.localName==="rui-sidebar"?r:null}let i=this.closest("rui-sidebar");return i?.id?i:null}syncWithSidebar(){let t=this.resolveSidebar();t!==this.attachedSidebar&&(this.detachFromSidebar(),t&&(this.attachedSidebar=t,typeof MutationObserver=="function"&&(this.sidebarObserver=new MutationObserver(()=>this.applyState()),this.sidebarObserver.observe(t,{attributes:!0,attributeFilter:["data-state","data-mobile","data-collapsible"]}))));let i=t?.id||this.controls;i?this.buttonTarget?.setAttribute("aria-controls",i):this.buttonTarget?.removeAttribute("aria-controls"),this.applyState()}detachFromSidebar(){this.sidebarObserver?.disconnect(),this.attachedSidebar=null,this.sidebarObserver=null}applyState(){let t=this.attachedSidebar;if(!t){this.sidebarState=Ei(this.placement),this.sidebarMobile=null,this.sidebarCollapsible=null;return}this.sidebarState=t.getAttribute("data-state")==="collapsed"?"collapsed":"expanded",this.sidebarMobile=t.getAttribute("data-mobile")==="true",this.sidebarCollapsible=t.getAttribute("data-collapsible")??"off"}onButtonClick(t){t.preventDefault(),t.stopPropagation();let i=this.resolveSidebar();i&&typeof i.toggle=="function"&&i.toggle()}static{ke()}};import{jsx as T,jsxs as dt}from"@ecopages/jsx/jsx-runtime";function Ti(){return dt("span",{class:"rui-sidebar__trigger-icon","aria-hidden":"true",children:[dt("svg",{class:"rui-sidebar__trigger-glyph rui-sidebar__trigger-glyph--collapse",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[T("path",{d:"M3 5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}),T("path",{d:"M9 3v18"}),T("path",{d:"m14 15 3-3-3-3"})]}),dt("svg",{class:"rui-sidebar__trigger-glyph rui-sidebar__trigger-glyph--expand",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[T("path",{d:"M3 5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}),T("path",{d:"M9 3v18"}),T("path",{d:"m14 9-3 3 3 3"})]}),dt("svg",{class:"rui-sidebar__trigger-glyph rui-sidebar__trigger-glyph--close",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[T("path",{d:"M18 6 6 18"}),T("path",{d:"m6 6 12 12"})]}),dt("svg",{class:"rui-sidebar__trigger-glyph rui-sidebar__trigger-glyph--menu",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[T("path",{d:"M4 6h16"}),T("path",{d:"M4 12h16"}),T("path",{d:"M4 18h16"})]})]})}function Ai({children:e,triggerLabel:t,placement:i,variant:r="ghost",size:u="md",controls:f,...b}){return T("rui-sidebar-trigger",{...b,"prop:buttonLabel":t,placement:i,variant:r,size:u,controls:f,children:T("button",{"data-ref":"button",type:"button",class:Je({variant:r,size:u}),children:e??T(Ti,{})})})}import{jsx as _,jsxs as ut}from"@ecopages/jsx/jsx-runtime";function _t(e,t){return t===void 0||e?.label!==void 0?e:{...e,label:t}}function bt(...e){for(let t of e)if(t!==void 0)return t}function M(...e){return e.filter(Boolean).join(" ")}function vt(e,...t){let i={...e};for(let r of t)delete i[r];return i}function ki({layout:e="default",siteHeader:t,sidebar:i,children:r,class:u,...f}){return e==="docs"?ut("div",{...f,class:M("rui-sidebar-provider",u),"data-layout":e,children:[t?_("div",{class:"rui-sidebar-provider__site-header",children:t}):null,ut("div",{class:"rui-sidebar-provider__body",children:[i,r]})]}):ut("div",{...f,class:M("rui-sidebar-provider",u),"data-layout":e,children:[i,r]})}function Ri({children:e,class:t,...i}){return _("div",{...i,class:M("rui-sidebar__header",t),children:e})}function Ci({children:e,class:t,...i}){return _("div",{...i,class:M("rui-sidebar__content",t),children:e})}function Oi({children:e,class:t,...i}){return _("div",{...i,class:M("rui-sidebar__footer",t),children:e})}function Li({class:e,...t}){return _("hr",{...t,role:"separator","aria-orientation":"horizontal",class:M("rui-sidebar__separator",e)})}function Wi({children:e,class:t,...i}){return _("section",{...i,class:M("rui-sidebar__group",t),children:e})}function ti({children:e,class:t,...i}){return _("h2",{...i,class:M("rui-sidebar__group-label",t),children:e})}function Di({children:e,class:t,...i}){return _("button",{...i,type:"button",class:M("rui-sidebar__group-action",t),children:e})}function zi({label:e,action:t,class:i,...r}){return ut("div",{...r,class:M("rui-sidebar__group-header",i),children:[_(ti,{children:e}),t]})}function Ii({children:e,class:t,...i}){return _("ul",{...i,role:"list",class:M("rui-sidebar__menu",t),children:e})}function Bi({children:e,class:t,...i}){return _("li",{...i,class:M("rui-sidebar__menu-item",t),children:e})}function ei(e){if(e.href!==void 0){let{children:U,class:G,isActive:D,href:H,tooltip:K,aria:O,title:v,"aria-current":Q,...$}=e;return _("a",{...vt($,"as"),aria:_t(O,typeof U=="string"?void 0:K),href:H,"data-ref":"menu-button",class:M("rui-sidebar__menu-button",D&&"rui-sidebar__menu-button--active",G),"aria-current":D?"page":Q,title:bt(v,K),children:U})}let{children:t,class:i,isActive:r,type:u="button",tooltip:f,disabled:b,onClick:o,aria:A,title:z,"aria-current":C,"on:click":I,...k}=e;return _("button",{...vt(k,"as","href"),aria:_t(A,typeof t=="string"?void 0:f),type:u,"data-ref":"menu-button",class:M("rui-sidebar__menu-button",r&&"rui-sidebar__menu-button--active",i),"aria-current":r?"page":C,disabled:b,title:bt(z,f),"on:click":bt(I,o),children:t})}function ji(e){let{class:t,...i}=e;return _(ei,{class:M("rui-sidebar__menu-action",t),...i})}function Pi({children:e,class:t,...i}){return _("main",{...i,class:M("rui-sidebar__inset",t),children:e})}function Vi({children:e,open:t,label:i,...r}){return _("rui-sidebar",{...r,"prop:open":t,label:i,children:ut("div",{class:"rui-sidebar","data-ref":"root",children:[_("button",{"data-ref":"scrim",type:"button",class:"rui-sidebar__scrim",tabindex:-1,"aria-label":"Close sidebar",hidden:!0}),_("div",{"data-ref":"pane",class:"rui-sidebar__pane","aria-label":i,children:e}),_("div",{"data-ref":"handle",class:"rui-sidebar__handle",role:"separator",tabindex:0,hidden:!0,children:_("span",{class:"rui-sidebar__handle-grip","aria-hidden":"true"})})]})})}export{Vi as RuiSidebar,Ci as RuiSidebarContent,Te as RuiSidebarElement,Oi as RuiSidebarFooter,Wi as RuiSidebarGroup,Di as RuiSidebarGroupAction,zi as RuiSidebarGroupHeader,ti as RuiSidebarGroupLabel,Ri as RuiSidebarHeader,Pi as RuiSidebarInset,Ii as RuiSidebarMenu,ji as RuiSidebarMenuAction,ei as RuiSidebarMenuButton,Bi as RuiSidebarMenuItem,ki as RuiSidebarProvider,Li as RuiSidebarSeparator,Ai as RuiSidebarTrigger,Fe as RuiSidebarTriggerElement};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|