@ecopages/radiant-ui 0.1.0-beta.8 → 0.1.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/aria.d.ts +11 -0
- package/dist/aria.js +2 -0
- package/dist/aria.js.map +7 -0
- package/dist/components/ui/alert/alert.css +1 -1
- package/dist/components/ui/alert/index.js +1 -1
- package/dist/components/ui/alert/index.js.map +3 -3
- package/dist/components/ui/avatar/index.js +1 -1
- package/dist/components/ui/avatar/index.js.map +4 -4
- package/dist/components/ui/breadcrumb/index.js +1 -1
- package/dist/components/ui/breadcrumb/index.js.map +3 -3
- package/dist/components/ui/button/button.d.ts +2 -2
- package/dist/components/ui/button/index.js +1 -1
- package/dist/components/ui/button/index.js.map +3 -3
- package/dist/components/ui/button-group/index.js +1 -1
- package/dist/components/ui/button-group/index.js.map +3 -3
- package/dist/components/ui/carousel/index.js +1 -1
- package/dist/components/ui/carousel/index.js.map +4 -4
- package/dist/components/ui/chip-list/index.js +1 -1
- package/dist/components/ui/chip-list/index.js.map +3 -3
- 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/index.js +1 -1
- package/dist/components/ui/cycle-toggle/index.js.map +3 -3
- 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-range-picker/index.js +1 -1
- package/dist/components/ui/date-range-picker/index.js.map +4 -4
- package/dist/components/ui/dialog/index.js +1 -1
- package/dist/components/ui/dialog/index.js.map +4 -4
- package/dist/components/ui/feed/index.js +1 -1
- package/dist/components/ui/feed/index.js.map +4 -4
- package/dist/components/ui/field/field.d.ts +3 -2
- package/dist/components/ui/field/index.js +1 -1
- package/dist/components/ui/field/index.js.map +2 -2
- package/dist/components/ui/form/index.js +1 -1
- package/dist/components/ui/form/index.js.map +2 -2
- package/dist/components/ui/heading/index.js +1 -1
- package/dist/components/ui/heading/index.js.map +2 -2
- package/dist/components/ui/headline/index.js +1 -1
- package/dist/components/ui/headline/index.js.map +2 -2
- package/dist/components/ui/input/index.js +1 -1
- package/dist/components/ui/input/index.js.map +3 -3
- package/dist/components/ui/menu-button/index.js +1 -1
- package/dist/components/ui/menu-button/index.js.map +3 -3
- package/dist/components/ui/navigation-menu/index.js +1 -1
- package/dist/components/ui/navigation-menu/index.js.map +3 -3
- 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/radio-group/index.js +1 -1
- package/dist/components/ui/radio-group/index.js.map +3 -3
- package/dist/components/ui/radio-group/radio-group.d.ts +0 -4
- 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.d.ts +1 -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.script.d.ts +26 -5
- package/dist/components/ui/tabs/index.js +1 -1
- package/dist/components/ui/tabs/index.js.map +2 -2
- 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/textarea/index.d.ts +1 -1
- package/dist/components/ui/textarea/index.js +1 -1
- package/dist/components/ui/textarea/index.js.map +3 -3
- package/dist/components/ui/textarea/textarea.css +0 -6
- package/dist/components/ui/textarea/textarea.d.ts +4 -5
- package/dist/components/ui/toast/index.js +1 -1
- package/dist/components/ui/toast/index.js.map +3 -3
- package/dist/components/ui/toc/index.js +1 -1
- package/dist/components/ui/toc/index.js.map +3 -3
- package/dist/index.js +1 -1
- package/dist/index.js.map +4 -4
- package/dist/lib/coalesce-defined.d.ts +6 -0
- package/dist/lib/omit-props.d.ts +4 -0
- package/dist/styles/radiant-ui.css +47 -3
- package/dist/styles/styles.css +1 -7
- package/dist/styles/tailwind.css +47 -3
- package/dist/styles/tokens/colors/aurora.css +1 -4
- package/dist/styles/tokens/colors/basalt.css +22 -1
- package/dist/styles/tokens/colors/glacier.css +25 -1
- package/dist/styles/tokens/system.css +3 -0
- package/package.json +12 -8
package/dist/aria.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { AriaAttributesNormalized } from '@ecopages/jsx';
|
|
2
|
+
/**
|
|
3
|
+
* Adds a fallback `aria-label` to the structured ARIA channel.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* Direct `aria-label` remains separate and wins during JSX normalization.
|
|
7
|
+
* Existing structured ARIA fields are preserved, including `aria.labelledby`.
|
|
8
|
+
*
|
|
9
|
+
* @see https://www.w3.org/TR/wai-aria/#aria-labelledby
|
|
10
|
+
*/
|
|
11
|
+
export declare function withDefaultAriaLabel(aria: Partial<AriaAttributesNormalized> | undefined, fallback?: AriaAttributesNormalized['label']): Partial<AriaAttributesNormalized> | undefined;
|
package/dist/aria.js
ADDED
package/dist/aria.js.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/aria.ts"],
|
|
4
|
+
"sourcesContent": ["export function withDefaultAriaLabel(aria, fallback) {\n if (fallback === void 0 || aria?.label !== void 0) {\n return aria;\n }\n return {\n ...aria,\n label: fallback\n };\n}"],
|
|
5
|
+
"mappings": "AAAO,SAASA,EAAqBC,EAAMC,EAAU,CACnD,OAAIA,IAAa,QAAUD,GAAM,QAAU,OAClCA,EAEF,CACL,GAAGA,EACH,MAAOC,CACT,CACF",
|
|
6
|
+
"names": ["withDefaultAriaLabel", "aria", "fallback"]
|
|
7
|
+
}
|
|
@@ -6,6 +6,7 @@ rui-alert {
|
|
|
6
6
|
@layer components {
|
|
7
7
|
.rui-alert {
|
|
8
8
|
position: relative;
|
|
9
|
+
display: block;
|
|
9
10
|
border-radius: var(--radius-container, var(--radius-container));
|
|
10
11
|
font-size: var(--text-sm, var(--text-sm));
|
|
11
12
|
line-height: var(--tw-leading, var(--text-sm--line-height, calc(1.25 / 0.875)));
|
|
@@ -29,7 +30,6 @@ rui-alert {
|
|
|
29
30
|
justify-content: center;
|
|
30
31
|
}
|
|
31
32
|
.rui-alert--banner {
|
|
32
|
-
margin-top: var(--spacing-stack, var(--space-stack));
|
|
33
33
|
display: flex;
|
|
34
34
|
flex-direction: column;
|
|
35
35
|
padding-block: var(--spacing-control-y, var(--space-control-y));
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{RadiantElement as _t,bound as Rt,customElement as kt,event as St,onEvent as Dt,prop as B}from"@ecopages/radiant";var ot,st,lt,at,ut,ct,ft,dt,pt,ht,mt,vt;function xt(t,e,n,c,y,E){var p,
|
|
1
|
+
import{RadiantElement as _t,bound as Rt,customElement as kt,event as St,onEvent as Dt,prop as B}from"@ecopages/radiant";var ot,st,lt,at,ut,ct,ft,dt,pt,ht,mt,vt;function xt(t,e,n,c,y,E){var p,o,L,O,D,V,R,U=Symbol.metadata||Symbol.for("Symbol.metadata"),W=Object.defineProperty,$=Object.create,X=[$(null),$(null)],Y=e.length;function C(r,h,f){return function(i,s){h&&(s=i,i=t);for(var m=0;m<r.length;m++)s=r[m].apply(i,f?[s]:[]);return f?s:i}}function g(r,h,f,i){if(typeof r!="function"&&(i||r!==void 0))throw new TypeError(h+" must "+(f||"be")+" a function"+(i?"":" or undefined"));return r}function Z(r,h,f,i,s,m,x,d,b,_,P){function K(a){if(!P(a))throw new TypeError("Attempted to access private element on non-instance")}var q=[].concat(h[0]),F=h[3],G=!x,k=s===1,N=s===3,tt=s===4,T=s===2;function M(a,A,it){return function(z,nt){return A&&(nt=z,z=r),it&&it(z),l[a].call(z,nt)}}if(!G){var l={},J=[],w=N?"get":tt||k?"set":"value";if(b?(_||k?l={get:bt(function(){return F(this)},i,"get"),set:function(a){h[4](this,a)}}:l[w]=F,_||bt(l[w],i,T?"":w)):_||(l=Object.getOwnPropertyDescriptor(r,i)),!_&&!b){if((o=X[+d][i])&&(o^s)!==7)throw Error("Decorating two elements with the same name ("+l[w].name+") is not supported yet");X[+d][i]=s<3?1:s}}for(var u=r,I=q.length-1;I>=0;I-=f?2:1){var et=g(q[I],"A decorator","be",!0),rt=f?q[I-1]:void 0,Q={},S={kind:["field","accessor","method","getter","setter","class"][s],name:i,metadata:p,addInitializer:function(a,A){if(a.v)throw new TypeError("attempted to call addInitializer after decoration was finished");g(A,"An initializer","be",!0),m.push(A)}.bind(null,Q)};if(G)o=et.call(rt,u,S),Q.v=1,g(o,"class decorators","return")&&(u=o);else if(S.static=d,S.private=b,o=S.access={has:b?P.bind():function(a){return i in a}},tt||(o.get=b?T?function(a){return K(a),l.value}:M("get",0,K):function(a){return a[i]}),T||N||(o.set=b?M("set",0,K):function(a,A){a[i]=A}),u=et.call(rt,k?{get:l.get,set:l.set}:l[w],S),Q.v=1,k){if(typeof u=="object"&&u)(o=g(u.get,"accessor.get"))&&(l.get=o),(o=g(u.set,"accessor.set"))&&(l.set=o),(o=g(u.init,"accessor.init"))&&J.unshift(o);else if(u!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else g(u,(_?"field":"method")+" decorators","return")&&(_?J.unshift(u):l[w]=u)}return s<2&&x.push(C(J,d,1),C(m,d,0)),_||G||(b?k?x.splice(-1,0,M("get",d),M("set",d)):x.push(T?l[w]:g.call.bind(l[w])):W(r,i,l)),u}function H(r){return W(r,U,{configurable:!0,enumerable:!0,value:p})}return E!==void 0&&(p=E[U]),p=$(p??null),D=[],V=function(r){r&&D.push(C(r))},R=function(r,h){for(var f=0;f<n.length;f++){var i=n[f],s=i[1],m=7&s;if((8&s)==r&&!m==h){var x=i[2],d=!!i[3],b=16&s;Z(r?t:t.prototype,i,b,d?"#"+x:Et(x),m,m<2?[]:r?O=O||[]:L=L||[],D,!!r,d,h,r&&d?function(_){return jt(_)===t}:y)}}},R(8,0),R(0,0),R(8,1),R(0,1),V(L),V(O),o=D,Y||H(t),{e:o,get c(){var r=[];return Y&&[H(t=Z(t,[e],c,t.name,5,r)),C(r,1)]}}}function Et(t){var e=At(t,"string");return typeof e=="symbol"?e:e+""}function At(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var c=n.call(t,e||"default");if(typeof c!="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function bt(t,e,n){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:n?n+" "+e:e})}catch{}return t}function jt(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}var gt,yt=class extends _t{static{({e:[lt,at,ut,ct,ft,dt,pt,ht,mt,vt,ot],c:[gt,st]}=xt(this,[kt("rui-alert")],[[B({type:String,reflect:!0,defaultValue:"info"}),0,"variant"],[B({type:String,reflect:!0,defaultValue:"inline"}),0,"layout"],[B({type:Boolean,reflect:!0,defaultValue:!1}),0,"dismissible"],[B({type:String,attribute:"close-label",defaultValue:"Dismiss"}),0,"closeLabel"],[St({name:"rui-close",bubbles:!0,composed:!0}),0,"closeEvent"],[Rt,2,"dismiss"],[Dt({selector:"[data-alert-close]",type:"click"}),2,"onCloseClick"]],0,void 0,_t))}constructor(...e){super(...e),vt(this)}variant=(ot(this),lt(this));layout=(at(this),ut(this));dismissible=(ct(this),ft(this));closeLabel=(dt(this),pt(this));closeEvent=(ht(this),mt(this));dismiss(){this.isConnected&&(this.closeEvent.emit({reason:"dismiss"}),this.remove())}onCloseClick(e){e.stopPropagation(),this.dismissible&&this.dismiss()}static{st()}};import{jsx as v,jsxs as wt}from"@ecopages/jsx/jsx-runtime";function j(...t){return t.filter(Boolean).join(" ")}var Ct={info:["M12 16v-4","M12 8h.01","M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20z"],success:["M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20z","m9 12 2 2 4-4"],warning:["m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3","M12 9v4","M12 17h.01"],error:["M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20z","m15 9-6 6","m9 9 6 6"]};function Tt({variant:t="info",class:e,children:n,...c}){if(n!=null)return v("span",{...c,class:j("rui-alert__icon",e),children:n});let y=Ct[t],E=Array.isArray(y)?y:[y];return v("span",{...c,class:j("rui-alert__icon",e),"aria-hidden":"true",children:v("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:E.map(p=>v("path",{d:p}))})})}function Mt({children:t,class:e,...n}){return v("p",{...n,class:j("rui-alert__title",e),children:t})}function It({children:t,class:e,...n}){return v("div",{...n,class:j("rui-alert__description",e),children:t})}function zt({children:t,variant:e="info",layout:n="inline",dismissible:c=!1,closeLabel:y="Dismiss",class:E,slot:p,...o}){return v("rui-alert",{slot:p,variant:e,layout:n,dismissible:c,"close-label":y,children:wt("div",{...o,class:j("rui-alert",`rui-alert--${e}`,`rui-alert--${n}`,c&&"rui-alert--dismissible",E),role:"alert",children:[t,c?v("button",{type:"button",class:"rui-alert__close","data-alert-close":!0,"aria-label":y||"Dismiss",children:wt("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",children:[v("path",{d:"M18 6 6 18"}),v("path",{d:"m6 6 12 12"})]})}):null]})})}export{zt as RuiAlert,It as RuiAlertDescription,gt as RuiAlertElement,Tt as RuiAlertIcon,Mt as RuiAlertTitle};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/components/ui/alert/alert.script.tsx", "../../../../src/components/ui/alert/alert.tsx", "../../../../src/lib/cx.ts"],
|
|
4
|
-
"sourcesContent": ["let _initProto, _initClass, _init_variant, _init_extra_variant, _init_layout, _init_extra_layout, _init_dismissible, _init_extra_dismissible, _init_closeLabel, _init_extra_closeLabel, _init_closeEvent, _init_extra_closeEvent;\nfunction _applyDecs(e, t, n, r, o, i) { var a, c, u, s, f, l, p, d = Symbol.metadata || Symbol.for(\"Symbol.metadata\"), m = Object.defineProperty, h = Object.create, y = [h(null), h(null)], v = t.length; function g(t, n, r) { return function (o, i) { n && (i = o, o = e); for (var a = 0; a < t.length; a++) i = t[a].apply(o, r ? [i] : []); return r ? i : o; }; } function b(e, t, n, r) { if (\"function\" != typeof e && (r || void 0 !== e)) throw new TypeError(t + \" must \" + (n || \"be\") + \" a function\" + (r ? \"\" : \" or undefined\")); return e; } function applyDec(e, t, n, r, o, i, u, s, f, l, p) { function d(e) { if (!p(e)) throw new TypeError(\"Attempted to access private element on non-instance\"); } var h = [].concat(t[0]), v = t[3], w = !u, D = 1 === o, S = 3 === o, j = 4 === o, E = 2 === o; function I(t, n, r) { return function (o, i) { return n && (i = o, o = e), r && r(o), P[t].call(o, i); }; } if (!w) { var P = {}, k = [], F = S ? \"get\" : j || D ? \"set\" : \"value\"; if (f ? (l || D ? P = { get: _setFunctionName(function () { return v(this); }, r, \"get\"), set: function (e) { t[4](this, e); } } : P[F] = v, l || _setFunctionName(P[F], r, E ? \"\" : F)) : l || (P = Object.getOwnPropertyDescriptor(e, r)), !l && !f) { if ((c = y[+s][r]) && 7 !== (c ^ o)) throw Error(\"Decorating two elements with the same name (\" + P[F].name + \") is not supported yet\"); y[+s][r] = o < 3 ? 1 : o; } } for (var N = e, O = h.length - 1; O >= 0; O -= n ? 2 : 1) { var T = b(h[O], \"A decorator\", \"be\", !0), z = n ? h[O - 1] : void 0, A = {}, H = { kind: [\"field\", \"accessor\", \"method\", \"getter\", \"setter\", \"class\"][o], name: r, metadata: a, addInitializer: function (e, t) { if (e.v) throw new TypeError(\"attempted to call addInitializer after decoration was finished\"); b(t, \"An initializer\", \"be\", !0), i.push(t); }.bind(null, A) }; if (w) c = T.call(z, N, H), A.v = 1, b(c, \"class decorators\", \"return\") && (N = c);else if (H.static = s, H.private = f, c = H.access = { has: f ? p.bind() : function (e) { return r in e; } }, j || (c.get = f ? E ? function (e) { return d(e), P.value; } : I(\"get\", 0, d) : function (e) { return e[r]; }), E || S || (c.set = f ? I(\"set\", 0, d) : function (e, t) { e[r] = t; }), N = T.call(z, D ? { get: P.get, set: P.set } : P[F], H), A.v = 1, D) { if (\"object\" == typeof N && N) (c = b(N.get, \"accessor.get\")) && (P.get = c), (c = b(N.set, \"accessor.set\")) && (P.set = c), (c = b(N.init, \"accessor.init\")) && k.unshift(c);else if (void 0 !== N) throw new TypeError(\"accessor decorators must return an object with get, set, or init properties or undefined\"); } else b(N, (l ? \"field\" : \"method\") + \" decorators\", \"return\") && (l ? k.unshift(N) : P[F] = N); } return o < 2 && u.push(g(k, s, 1), g(i, s, 0)), l || w || (f ? D ? u.splice(-1, 0, I(\"get\", s), I(\"set\", s)) : u.push(E ? P[F] : b.call.bind(P[F])) : m(e, r, P)), N; } function w(e) { return m(e, d, { configurable: !0, enumerable: !0, value: a }); } return void 0 !== i && (a = i[d]), a = h(null == a ? null : a), f = [], l = function (e) { e && f.push(g(e)); }, p = function (t, r) { for (var i = 0; i < n.length; i++) { var a = n[i], c = a[1], l = 7 & c; if ((8 & c) == t && !l == r) { var p = a[2], d = !!a[3], m = 16 & c; applyDec(t ? e : e.prototype, a, m, d ? \"#\" + p : _toPropertyKey(p), l, l < 2 ? [] : t ? s = s || [] : u = u || [], f, !!t, d, r, t && d ? function (t) { return _checkInRHS(t) === e; } : o); } } }, p(8, 0), p(0, 0), p(8, 1), p(0, 1), l(u), l(s), c = f, v || w(e), { e: c, get c() { var n = []; return v && [w(e = applyDec(e, [t], r, e.name, 5, n)), g(n, 1)]; } }; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == typeof i ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != typeof i) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _setFunctionName(e, t, n) { \"symbol\" == typeof t && (t = (t = t.description) ? \"[\" + t + \"]\" : \"\"); try { Object.defineProperty(e, \"name\", { configurable: !0, value: n ? n + \" \" + t : t }); } catch (e) {} return e; }\nfunction _checkInRHS(e) { if (Object(e) !== e) throw TypeError(\"right-hand side of 'in' should be an object, got \" + (null !== e ? typeof e : \"null\")); return e; }\nimport { RadiantElement, bound, customElement, event, onEvent, prop } from \"@ecopages/radiant\";\nlet _RuiAlert;\nclass RuiAlert extends RadiantElement {\n static {\n ({\n e: [_init_variant, _init_extra_variant, _init_layout, _init_extra_layout, _init_dismissible, _init_extra_dismissible, _init_closeLabel, _init_extra_closeLabel, _init_closeEvent, _init_extra_closeEvent, _initProto],\n c: [_RuiAlert, _initClass]\n } = _applyDecs(this, [customElement(\"rui-alert\")], [[prop({\n type: String,\n reflect: true,\n defaultValue: \"info\"\n }), 0, \"variant\"], [prop({\n type: String,\n reflect: true,\n defaultValue: \"inline\"\n }), 0, \"layout\"], [prop({\n type: Boolean,\n reflect: true,\n defaultValue: false\n }), 0, \"dismissible\"], [prop({\n type: String,\n attribute: \"close-label\",\n defaultValue: \"Dismiss\"\n }), 0, \"closeLabel\"], [event({\n name: \"rui-close\",\n bubbles: true,\n composed: true\n }), 0, \"closeEvent\"], [bound, 2, \"dismiss\"], [onEvent({\n selector: \"[data-alert-close]\",\n type: \"click\"\n }), 2, \"onCloseClick\"]], 0, void 0, RadiantElement));\n }\n constructor(...args) {\n super(...args);\n _init_extra_closeEvent(this);\n }\n variant = (_initProto(this), _init_variant(this));\n layout = (_init_extra_variant(this), _init_layout(this));\n dismissible = (_init_extra_layout(this), _init_dismissible(this));\n closeLabel = (_init_extra_dismissible(this), _init_closeLabel(this));\n closeEvent = (_init_extra_closeLabel(this), _init_closeEvent(this));\n dismiss() {\n if (!this.isConnected) {\n return;\n }\n this.closeEvent.emit({\n reason: \"dismiss\"\n });\n this.remove();\n }\n onCloseClick(event2) {\n event2.stopPropagation();\n if (!this.dismissible) {\n return;\n }\n this.dismiss();\n }\n static {\n _initClass();\n }\n}\nexport { _RuiAlert as RuiAlert };", "import { jsx, jsxs } from \"@ecopages/jsx/jsx-runtime\";\nimport { cx } from \"@/lib/cx\";\nimport \"./alert.script\";\nconst ALERT_ICON_PATHS = {\n info: [\"M12 16v-4\", \"M12 8h.01\", \"M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20z\"],\n success: [\"M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20z\", \"m9 12 2 2 4-4\"],\n warning: [\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\", \"M12 9v4\", \"M12 17h.01\"],\n error: [\"M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20z\", \"m15 9-6 6\", \"m9 9 6 6\"]\n};\nexport function RuiAlertIcon({\n variant = \"info\",\n class: className,\n children,\n ...props\n}) {\n if (children != null) {\n return /* @__PURE__ */jsx(\"span\", {\n ...props,\n class: cx(\"rui-alert__icon\", className),\n children\n });\n }\n const paths = ALERT_ICON_PATHS[variant];\n const d = Array.isArray(paths) ? paths : [paths];\n return /* @__PURE__ */jsx(\"span\", {\n ...props,\n class: cx(\"rui-alert__icon\", className),\n \"aria-hidden\": \"true\",\n children: /* @__PURE__ */jsx(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"20\",\n height: \"20\",\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n stroke: \"currentColor\",\n \"stroke-width\": \"2\",\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n children: d.map(path => /* @__PURE__ */jsx(\"path\", {\n d: path\n }))\n })\n });\n}\nexport function RuiAlertTitle({\n children,\n class: className,\n ...props\n}) {\n return /* @__PURE__ */jsx(\"p\", {\n ...props,\n class: cx(\"rui-alert__title\", className),\n children\n });\n}\nexport function RuiAlertDescription({\n children,\n class: className,\n ...props\n}) {\n return /* @__PURE__ */jsx(\"div\", {\n ...props,\n class: cx(\"rui-alert__description\", className),\n children\n });\n}\nexport function RuiAlert({\n children,\n variant = \"info\",\n layout = \"inline\",\n dismissible = false,\n closeLabel = \"Dismiss\",\n class: className,\n ...props\n}) {\n return /* @__PURE__ */jsx(\"rui-alert\", {\n ...props,\n variant,\n layout,\n dismissible,\n \"close-label\": closeLabel,\n children: /* @__PURE__ */jsxs(\"div\", {\n class: cx(\"rui-alert\", `rui-alert--${variant}`, `rui-alert--${layout}`, dismissible && \"rui-alert--dismissible\", className),\n role: \"alert\",\n children: [children, dismissible ? /* @__PURE__ */jsx(\"button\", {\n type: \"button\",\n class: \"rui-alert__close\",\n \"data-alert-close\": true,\n \"aria-label\": closeLabel || \"Dismiss\",\n children: /* @__PURE__ */jsxs(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"16\",\n height: \"16\",\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n stroke: \"currentColor\",\n \"stroke-width\": \"2\",\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n \"aria-hidden\": \"true\",\n children: [/* @__PURE__ */jsx(\"path\", {\n d: \"M18 6 6 18\"\n }), /* @__PURE__ */jsx(\"path\", {\n d: \"m6 6 12 12\"\n })]\n })\n }) : null]\n })\n });\n}", "export function cx(...parts) {\n return parts.filter(Boolean).join(\" \");\n}"],
|
|
5
|
-
"mappings": "AAMA,OAAS,kBAAAA,GAAgB,SAAAC,GAAO,iBAAAC,GAAe,SAAAC,GAAO,WAAAC,GAAS,QAAAC,MAAY,oBAN3E,IAAIC,GAAYC,GAAYC,GAAeC,GAAqBC,GAAcC,GAAoBC,GAAmBC,GAAyBC,GAAkBC,GAAwBC,GAAkBC,GAC1M,SAASC,GAAWC,EAAGC,EAAG,EAAGC,EAAGC,EAAGC,EAAG,CAAE,IAAIC,EAAGC,EAAGC,EAAGC,EAAGC,EAAGC,EAAGC,EAAGC,EAAI,OAAO,UAAY,OAAO,IAAI,iBAAiB,EAAGC,EAAI,OAAO,eAAgBC,EAAI,OAAO,OAAQC,EAAI,CAACD,EAAE,IAAI,EAAGA,EAAE,IAAI,CAAC,EAAGE,EAAIf,EAAE,OAAQ,SAASgB,EAAEhB,EAAGiB,EAAGhB,EAAG,CAAE,OAAO,SAAUC,EAAGC,EAAG,CAAEc,IAAMd,EAAID,EAAGA,EAAIH,GAAI,QAASK,EAAI,EAAGA,EAAIJ,EAAE,OAAQI,IAAKD,EAAIH,EAAEI,CAAC,EAAE,MAAMF,EAAGD,EAAI,CAACE,CAAC,EAAI,CAAC,CAAC,EAAG,OAAOF,EAAIE,EAAID,CAAG,CAAG,CAAE,SAASgB,EAAEnB,EAAGC,EAAGiB,EAAGhB,EAAG,CAAE,GAAkB,OAAOF,GAArB,aAA2BE,GAAgBF,IAAX,QAAe,MAAM,IAAI,UAAUC,EAAI,UAAYiB,GAAK,MAAQ,eAAiBhB,EAAI,GAAK,gBAAgB,EAAG,OAAOF,CAAG,CAAE,SAASoB,EAASpB,EAAGC,EAAGiB,EAAGhB,
|
|
6
|
-
"names": ["RadiantElement", "bound", "customElement", "event", "onEvent", "prop", "_initProto", "_initClass", "_init_variant", "_init_extra_variant", "_init_layout", "_init_extra_layout", "_init_dismissible", "_init_extra_dismissible", "_init_closeLabel", "_init_extra_closeLabel", "_init_closeEvent", "_init_extra_closeEvent", "_applyDecs", "e", "t", "r", "o", "i", "a", "c", "u", "s", "f", "l", "p", "d", "m", "h", "y", "v", "g", "n", "b", "applyDec", "w", "D", "S", "j", "E", "I", "P", "k", "F", "_setFunctionName", "N", "O", "T", "z", "A", "H", "_toPropertyKey", "_checkInRHS", "_toPrimitive", "_RuiAlert", "RuiAlert", "args", "event2", "jsx", "jsxs", "cx", "parts", "ALERT_ICON_PATHS", "RuiAlertIcon", "variant", "className", "children", "props", "jsx", "cx", "paths", "d", "path", "RuiAlertTitle", "RuiAlertDescription", "RuiAlert", "layout", "dismissible", "closeLabel", "jsxs"]
|
|
4
|
+
"sourcesContent": ["let _initProto, _initClass, _init_variant, _init_extra_variant, _init_layout, _init_extra_layout, _init_dismissible, _init_extra_dismissible, _init_closeLabel, _init_extra_closeLabel, _init_closeEvent, _init_extra_closeEvent;\nfunction _applyDecs(e, t, n, r, o, i) { var a, c, u, s, f, l, p, d = Symbol.metadata || Symbol.for(\"Symbol.metadata\"), m = Object.defineProperty, h = Object.create, y = [h(null), h(null)], v = t.length; function g(t, n, r) { return function (o, i) { n && (i = o, o = e); for (var a = 0; a < t.length; a++) i = t[a].apply(o, r ? [i] : []); return r ? i : o; }; } function b(e, t, n, r) { if (\"function\" != typeof e && (r || void 0 !== e)) throw new TypeError(t + \" must \" + (n || \"be\") + \" a function\" + (r ? \"\" : \" or undefined\")); return e; } function applyDec(e, t, n, r, o, i, u, s, f, l, p) { function d(e) { if (!p(e)) throw new TypeError(\"Attempted to access private element on non-instance\"); } var h = [].concat(t[0]), v = t[3], w = !u, D = 1 === o, S = 3 === o, j = 4 === o, E = 2 === o; function I(t, n, r) { return function (o, i) { return n && (i = o, o = e), r && r(o), P[t].call(o, i); }; } if (!w) { var P = {}, k = [], F = S ? \"get\" : j || D ? \"set\" : \"value\"; if (f ? (l || D ? P = { get: _setFunctionName(function () { return v(this); }, r, \"get\"), set: function (e) { t[4](this, e); } } : P[F] = v, l || _setFunctionName(P[F], r, E ? \"\" : F)) : l || (P = Object.getOwnPropertyDescriptor(e, r)), !l && !f) { if ((c = y[+s][r]) && 7 !== (c ^ o)) throw Error(\"Decorating two elements with the same name (\" + P[F].name + \") is not supported yet\"); y[+s][r] = o < 3 ? 1 : o; } } for (var N = e, O = h.length - 1; O >= 0; O -= n ? 2 : 1) { var T = b(h[O], \"A decorator\", \"be\", !0), z = n ? h[O - 1] : void 0, A = {}, H = { kind: [\"field\", \"accessor\", \"method\", \"getter\", \"setter\", \"class\"][o], name: r, metadata: a, addInitializer: function (e, t) { if (e.v) throw new TypeError(\"attempted to call addInitializer after decoration was finished\"); b(t, \"An initializer\", \"be\", !0), i.push(t); }.bind(null, A) }; if (w) c = T.call(z, N, H), A.v = 1, b(c, \"class decorators\", \"return\") && (N = c);else if (H.static = s, H.private = f, c = H.access = { has: f ? p.bind() : function (e) { return r in e; } }, j || (c.get = f ? E ? function (e) { return d(e), P.value; } : I(\"get\", 0, d) : function (e) { return e[r]; }), E || S || (c.set = f ? I(\"set\", 0, d) : function (e, t) { e[r] = t; }), N = T.call(z, D ? { get: P.get, set: P.set } : P[F], H), A.v = 1, D) { if (\"object\" == typeof N && N) (c = b(N.get, \"accessor.get\")) && (P.get = c), (c = b(N.set, \"accessor.set\")) && (P.set = c), (c = b(N.init, \"accessor.init\")) && k.unshift(c);else if (void 0 !== N) throw new TypeError(\"accessor decorators must return an object with get, set, or init properties or undefined\"); } else b(N, (l ? \"field\" : \"method\") + \" decorators\", \"return\") && (l ? k.unshift(N) : P[F] = N); } return o < 2 && u.push(g(k, s, 1), g(i, s, 0)), l || w || (f ? D ? u.splice(-1, 0, I(\"get\", s), I(\"set\", s)) : u.push(E ? P[F] : b.call.bind(P[F])) : m(e, r, P)), N; } function w(e) { return m(e, d, { configurable: !0, enumerable: !0, value: a }); } return void 0 !== i && (a = i[d]), a = h(null == a ? null : a), f = [], l = function (e) { e && f.push(g(e)); }, p = function (t, r) { for (var i = 0; i < n.length; i++) { var a = n[i], c = a[1], l = 7 & c; if ((8 & c) == t && !l == r) { var p = a[2], d = !!a[3], m = 16 & c; applyDec(t ? e : e.prototype, a, m, d ? \"#\" + p : _toPropertyKey(p), l, l < 2 ? [] : t ? s = s || [] : u = u || [], f, !!t, d, r, t && d ? function (t) { return _checkInRHS(t) === e; } : o); } } }, p(8, 0), p(0, 0), p(8, 1), p(0, 1), l(u), l(s), c = f, v || w(e), { e: c, get c() { var n = []; return v && [w(e = applyDec(e, [t], r, e.name, 5, n)), g(n, 1)]; } }; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == typeof i ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != typeof i) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _setFunctionName(e, t, n) { \"symbol\" == typeof t && (t = (t = t.description) ? \"[\" + t + \"]\" : \"\"); try { Object.defineProperty(e, \"name\", { configurable: !0, value: n ? n + \" \" + t : t }); } catch (e) {} return e; }\nfunction _checkInRHS(e) { if (Object(e) !== e) throw TypeError(\"right-hand side of 'in' should be an object, got \" + (null !== e ? typeof e : \"null\")); return e; }\nimport { RadiantElement, bound, customElement, event, onEvent, prop } from \"@ecopages/radiant\";\nlet _RuiAlert;\nclass RuiAlert extends RadiantElement {\n static {\n ({\n e: [_init_variant, _init_extra_variant, _init_layout, _init_extra_layout, _init_dismissible, _init_extra_dismissible, _init_closeLabel, _init_extra_closeLabel, _init_closeEvent, _init_extra_closeEvent, _initProto],\n c: [_RuiAlert, _initClass]\n } = _applyDecs(this, [customElement(\"rui-alert\")], [[prop({\n type: String,\n reflect: true,\n defaultValue: \"info\"\n }), 0, \"variant\"], [prop({\n type: String,\n reflect: true,\n defaultValue: \"inline\"\n }), 0, \"layout\"], [prop({\n type: Boolean,\n reflect: true,\n defaultValue: false\n }), 0, \"dismissible\"], [prop({\n type: String,\n attribute: \"close-label\",\n defaultValue: \"Dismiss\"\n }), 0, \"closeLabel\"], [event({\n name: \"rui-close\",\n bubbles: true,\n composed: true\n }), 0, \"closeEvent\"], [bound, 2, \"dismiss\"], [onEvent({\n selector: \"[data-alert-close]\",\n type: \"click\"\n }), 2, \"onCloseClick\"]], 0, void 0, RadiantElement));\n }\n constructor(...args) {\n super(...args);\n _init_extra_closeEvent(this);\n }\n variant = (_initProto(this), _init_variant(this));\n layout = (_init_extra_variant(this), _init_layout(this));\n dismissible = (_init_extra_layout(this), _init_dismissible(this));\n closeLabel = (_init_extra_dismissible(this), _init_closeLabel(this));\n closeEvent = (_init_extra_closeLabel(this), _init_closeEvent(this));\n dismiss() {\n if (!this.isConnected) {\n return;\n }\n this.closeEvent.emit({\n reason: \"dismiss\"\n });\n this.remove();\n }\n onCloseClick(event2) {\n event2.stopPropagation();\n if (!this.dismissible) {\n return;\n }\n this.dismiss();\n }\n static {\n _initClass();\n }\n}\nexport { _RuiAlert as RuiAlert };", "import { jsx, jsxs } from \"@ecopages/jsx/jsx-runtime\";\nimport { cx } from \"@/lib/cx\";\nimport \"./alert.script\";\nconst ALERT_ICON_PATHS = {\n info: [\"M12 16v-4\", \"M12 8h.01\", \"M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20z\"],\n success: [\"M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20z\", \"m9 12 2 2 4-4\"],\n warning: [\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\", \"M12 9v4\", \"M12 17h.01\"],\n error: [\"M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20z\", \"m15 9-6 6\", \"m9 9 6 6\"]\n};\nexport function RuiAlertIcon({\n variant = \"info\",\n class: className,\n children,\n ...props\n}) {\n if (children != null) {\n return /* @__PURE__ */jsx(\"span\", {\n ...props,\n class: cx(\"rui-alert__icon\", className),\n children\n });\n }\n const paths = ALERT_ICON_PATHS[variant];\n const d = Array.isArray(paths) ? paths : [paths];\n return /* @__PURE__ */jsx(\"span\", {\n ...props,\n class: cx(\"rui-alert__icon\", className),\n \"aria-hidden\": \"true\",\n children: /* @__PURE__ */jsx(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"20\",\n height: \"20\",\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n stroke: \"currentColor\",\n \"stroke-width\": \"2\",\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n children: d.map(path => /* @__PURE__ */jsx(\"path\", {\n d: path\n }))\n })\n });\n}\nexport function RuiAlertTitle({\n children,\n class: className,\n ...props\n}) {\n return /* @__PURE__ */jsx(\"p\", {\n ...props,\n class: cx(\"rui-alert__title\", className),\n children\n });\n}\nexport function RuiAlertDescription({\n children,\n class: className,\n ...props\n}) {\n return /* @__PURE__ */jsx(\"div\", {\n ...props,\n class: cx(\"rui-alert__description\", className),\n children\n });\n}\nexport function RuiAlert({\n children,\n variant = \"info\",\n layout = \"inline\",\n dismissible = false,\n closeLabel = \"Dismiss\",\n class: className,\n slot,\n ...props\n}) {\n return /* @__PURE__ */jsx(\"rui-alert\", {\n slot,\n variant,\n layout,\n dismissible,\n \"close-label\": closeLabel,\n children: /* @__PURE__ */jsxs(\"div\", {\n ...props,\n class: cx(\"rui-alert\", `rui-alert--${variant}`, `rui-alert--${layout}`, dismissible && \"rui-alert--dismissible\", className),\n role: \"alert\",\n children: [children, dismissible ? /* @__PURE__ */jsx(\"button\", {\n type: \"button\",\n class: \"rui-alert__close\",\n \"data-alert-close\": true,\n \"aria-label\": closeLabel || \"Dismiss\",\n children: /* @__PURE__ */jsxs(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"16\",\n height: \"16\",\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n stroke: \"currentColor\",\n \"stroke-width\": \"2\",\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n \"aria-hidden\": \"true\",\n children: [/* @__PURE__ */jsx(\"path\", {\n d: \"M18 6 6 18\"\n }), /* @__PURE__ */jsx(\"path\", {\n d: \"m6 6 12 12\"\n })]\n })\n }) : null]\n })\n });\n}", "export function cx(...parts) {\n return parts.filter(Boolean).join(\" \");\n}"],
|
|
5
|
+
"mappings": "AAMA,OAAS,kBAAA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,CACH,CAAC,EAAI,IAAI,CACX,CAAC,CACH,CAAC,CACH",
|
|
6
|
+
"names": ["RadiantElement", "bound", "customElement", "event", "onEvent", "prop", "_initProto", "_initClass", "_init_variant", "_init_extra_variant", "_init_layout", "_init_extra_layout", "_init_dismissible", "_init_extra_dismissible", "_init_closeLabel", "_init_extra_closeLabel", "_init_closeEvent", "_init_extra_closeEvent", "_applyDecs", "e", "t", "r", "o", "i", "a", "c", "u", "s", "f", "l", "p", "d", "m", "h", "y", "v", "g", "n", "b", "applyDec", "w", "D", "S", "j", "E", "I", "P", "k", "F", "_setFunctionName", "N", "O", "T", "z", "A", "H", "_toPropertyKey", "_checkInRHS", "_toPrimitive", "_RuiAlert", "RuiAlert", "args", "event2", "jsx", "jsxs", "cx", "parts", "ALERT_ICON_PATHS", "RuiAlertIcon", "variant", "className", "children", "props", "jsx", "cx", "paths", "d", "path", "RuiAlertTitle", "RuiAlertDescription", "RuiAlert", "layout", "dismissible", "closeLabel", "slot", "jsxs"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as o}from"@ecopages/jsx/jsx-runtime";function t(i,r){return r===void 0||i?.label!==void 0?i:{...i,label:r}}function n(...i){for(let r of i)if(r!==void 0)return r}function a(...i){return i.filter(Boolean).join(" ")}function d(i){let r=i.trim().split(/\s+/).filter(Boolean);return r.length===0?"?":r.length===1?r[0].slice(0,2).toUpperCase():`${r[0][0]??""}${r[1][0]??""}`.toUpperCase()}function v({src:i,alt:r="",fallback:e,size:u="md",class:l,children:f,role:s,aria:p,...c}){let m=e??(r?d(r):void 0);return o("span",{...c,aria:t(p,i?void 0:r||e),class:a("rui-avatar",`rui-avatar--${u}`,l),role:n(s,i?void 0:"img"),children:i?o("img",{class:"rui-avatar__image",src:i,alt:r}):o("span",{class:"rui-avatar__fallback","aria-hidden":r||e?"true":void 0,children:f??m??"?"})})}export{v as RuiAvatar};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/components/ui/avatar/avatar.tsx", "../../../../src/lib/cx.ts"],
|
|
4
|
-
"sourcesContent": ["import { jsx } from \"@ecopages/jsx/jsx-runtime\";\nimport { cx } from \"@/lib/cx\";\nfunction initialsFrom(label) {\n const parts = label.trim().split(/\\s+/).filter(Boolean);\n if (parts.length === 0) return \"?\";\n if (parts.length === 1) return parts[0].slice(0, 2).toUpperCase();\n return `${parts[0][0] ?? \"\"}${parts[1][0] ?? \"\"}`.toUpperCase();\n}\nexport function RuiAvatar({\n src,\n alt = \"\",\n fallback,\n size = \"md\",\n class: className,\n children,\n ...props\n}) {\n const label = fallback ?? (alt ? initialsFrom(alt) : void 0);\n return /* @__PURE__ */jsx(\"span\", {\n ...props,\n class: cx(\"rui-avatar\", `rui-avatar--${size}`, className),\n role: src ? void 0 : \"img\",\n
|
|
5
|
-
"mappings": "AAAA,OAAS,OAAAA,MAAW,4BCAb,SAASC,KAAMC,EAAO,CAC3B,OAAOA,EAAM,OAAO,OAAO,EAAE,KAAK,GAAG,CACvC,
|
|
6
|
-
"names": ["jsx", "cx", "parts", "initialsFrom", "label", "parts", "RuiAvatar", "src", "alt", "fallback", "size", "className", "children", "props", "jsx", "cx"]
|
|
3
|
+
"sources": ["../../../../src/components/ui/avatar/avatar.tsx", "../../../../src/aria.ts", "../../../../src/lib/coalesce-defined.ts", "../../../../src/lib/cx.ts"],
|
|
4
|
+
"sourcesContent": ["import { jsx } from \"@ecopages/jsx/jsx-runtime\";\nimport { withDefaultAriaLabel } from \"@/aria\";\nimport { coalesceDefined } from \"@/lib/coalesce-defined\";\nimport { cx } from \"@/lib/cx\";\nfunction initialsFrom(label) {\n const parts = label.trim().split(/\\s+/).filter(Boolean);\n if (parts.length === 0) return \"?\";\n if (parts.length === 1) return parts[0].slice(0, 2).toUpperCase();\n return `${parts[0][0] ?? \"\"}${parts[1][0] ?? \"\"}`.toUpperCase();\n}\nexport function RuiAvatar({\n src,\n alt = \"\",\n fallback,\n size = \"md\",\n class: className,\n children,\n role,\n aria,\n ...props\n}) {\n const label = fallback ?? (alt ? initialsFrom(alt) : void 0);\n return /* @__PURE__ */jsx(\"span\", {\n ...props,\n aria: withDefaultAriaLabel(aria, src ? void 0 : alt || fallback),\n class: cx(\"rui-avatar\", `rui-avatar--${size}`, className),\n role: coalesceDefined(role, src ? void 0 : \"img\"),\n children: src ? /* @__PURE__ */jsx(\"img\", {\n class: \"rui-avatar__image\",\n src,\n alt\n }) : /* @__PURE__ */jsx(\"span\", {\n class: \"rui-avatar__fallback\",\n \"aria-hidden\": alt || fallback ? \"true\" : void 0,\n children: children ?? label ?? \"?\"\n })\n });\n}", "export function withDefaultAriaLabel(aria, fallback) {\n if (fallback === void 0 || aria?.label !== void 0) {\n return aria;\n }\n return {\n ...aria,\n label: fallback\n };\n}", "export function coalesceDefined(...values) {\n for (const value of values) {\n if (value !== void 0) {\n return value;\n }\n }\n}", "export function cx(...parts) {\n return parts.filter(Boolean).join(\" \");\n}"],
|
|
5
|
+
"mappings": "AAAA,OAAS,OAAAA,MAAW,4BCAb,SAASC,EAAqBC,EAAMC,EAAU,CACnD,OAAIA,IAAa,QAAUD,GAAM,QAAU,OAClCA,EAEF,CACL,GAAGA,EACH,MAAOC,CACT,CACF,CCRO,SAASC,KAAmBC,EAAQ,CACzC,QAAWC,KAASD,EAClB,GAAIC,IAAU,OACZ,OAAOA,CAGb,CCNO,SAASC,KAAMC,EAAO,CAC3B,OAAOA,EAAM,OAAO,OAAO,EAAE,KAAK,GAAG,CACvC,CHEA,SAASC,EAAaC,EAAO,CAC3B,IAAMC,EAAQD,EAAM,KAAK,EAAE,MAAM,KAAK,EAAE,OAAO,OAAO,EACtD,OAAIC,EAAM,SAAW,EAAU,IAC3BA,EAAM,SAAW,EAAUA,EAAM,CAAC,EAAE,MAAM,EAAG,CAAC,EAAE,YAAY,EACzD,GAAGA,EAAM,CAAC,EAAE,CAAC,GAAK,EAAE,GAAGA,EAAM,CAAC,EAAE,CAAC,GAAK,EAAE,GAAG,YAAY,CAChE,CACO,SAASC,EAAU,CACxB,IAAAC,EACA,IAAAC,EAAM,GACN,SAAAC,EACA,KAAAC,EAAO,KACP,MAAOC,EACP,SAAAC,EACA,KAAAC,EACA,KAAAC,EACA,GAAGC,CACL,EAAG,CACD,IAAMX,EAAQK,IAAaD,EAAML,EAAaK,CAAG,EAAI,QACrD,OAAsBQ,EAAI,OAAQ,CAChC,GAAGD,EACH,KAAME,EAAqBH,EAAMP,EAAM,OAASC,GAAOC,CAAQ,EAC/D,MAAOS,EAAG,aAAc,eAAeR,CAAI,GAAIC,CAAS,EACxD,KAAMQ,EAAgBN,EAAMN,EAAM,OAAS,KAAK,EAChD,SAAUA,EAAqBS,EAAI,MAAO,CACxC,MAAO,oBACP,IAAAT,EACA,IAAAC,CACF,CAAC,EAAmBQ,EAAI,OAAQ,CAC9B,MAAO,uBACP,cAAeR,GAAOC,EAAW,OAAS,OAC1C,SAAUG,GAAYR,GAAS,GACjC,CAAC,CACH,CAAC,CACH",
|
|
6
|
+
"names": ["jsx", "withDefaultAriaLabel", "aria", "fallback", "coalesceDefined", "values", "value", "cx", "parts", "initialsFrom", "label", "parts", "RuiAvatar", "src", "alt", "fallback", "size", "className", "children", "role", "aria", "props", "jsx", "withDefaultAriaLabel", "cx", "coalesceDefined"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as cr}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as lr,customElement as gr,prop as dr}from"@ecopages/radiant";var ir,nr,ar,ur,or;function fr(r,e,n,g,br,q){var w,u,k,A,E,z,R,G=Symbol.metadata||Symbol.for("Symbol.metadata"),Q=Object.defineProperty,V=Object.create,U=[V(null),V(null)],W=e.length;function I(t,p,l){return function(i,a){p&&(a=i,i=r);for(var m=0;m<t.length;m++)a=t[m].apply(i,l?[a]:[]);return l?a:i}}function h(t,p,l,i){if(typeof t!="function"&&(i||t!==void 0))throw new TypeError(p+" must "+(l||"be")+" a function"+(i?"":" or undefined"));return t}function X(t,p,l,i,a,m,_,d,b,f,Z){function $(s){if(!Z(s))throw new TypeError("Attempted to access private element on non-instance")}var C=[].concat(p[0]),H=p[3],J=!_,j=a===1,F=a===3,P=a===4,L=a===2;function D(s,x,er){return function(O,tr){return x&&(tr=O,O=t),er&&er(O),o[s].call(O,tr)}}if(!J){var o={},K=[],v=F?"get":P||j?"set":"value";if(b?(f||j?o={get:sr(function(){return H(this)},i,"get"),set:function(s){p[4](this,s)}}:o[v]=H,f||sr(o[v],i,L?"":v)):f||(o=Object.getOwnPropertyDescriptor(t,i)),!f&&!b){if((u=U[+d][i])&&(u^a)!==7)throw Error("Decorating two elements with the same name ("+o[v].name+") is not supported yet");U[+d][i]=a<3?1:a}}for(var c=t,T=C.length-1;T>=0;T-=l?2:1){var N=h(C[T],"A decorator","be",!0),rr=l?C[T-1]:void 0,M={},S={kind:["field","accessor","method","getter","setter","class"][a],name:i,metadata:w,addInitializer:function(s,x){if(s.v)throw new TypeError("attempted to call addInitializer after decoration was finished");h(x,"An initializer","be",!0),m.push(x)}.bind(null,M)};if(J)u=N.call(rr,c,S),M.v=1,h(u,"class decorators","return")&&(c=u);else if(S.static=d,S.private=b,u=S.access={has:b?Z.bind():function(s){return i in s}},P||(u.get=b?L?function(s){return $(s),o.value}:D("get",0,$):function(s){return s[i]}),L||F||(u.set=b?D("set",0,$):function(s,x){s[i]=x}),c=N.call(rr,j?{get:o.get,set:o.set}:o[v],S),M.v=1,j){if(typeof c=="object"&&c)(u=h(c.get,"accessor.get"))&&(o.get=u),(u=h(c.set,"accessor.set"))&&(o.set=u),(u=h(c.init,"accessor.init"))&&K.unshift(u);else if(c!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else h(c,(f?"field":"method")+" decorators","return")&&(f?K.unshift(c):o[v]=c)}return a<2&&_.push(I(K,d,1),I(m,d,0)),f||J||(b?j?_.splice(-1,0,D("get",d),D("set",d)):_.push(L?o[v]:h.call.bind(o[v])):Q(t,i,o)),c}function Y(t){return Q(t,G,{configurable:!0,enumerable:!0,value:w})}return q!==void 0&&(w=q[G]),w=V(w??null),E=[],z=function(t){t&&E.push(I(t))},R=function(t,p){for(var l=0;l<n.length;l++){var i=n[l],a=i[1],m=7&a;if((8&a)==t&&!m==p){var _=i[2],d=!!i[3],b=16&a;X(t?r:r.prototype,i,b,d?"#"+_:hr(_),m,m<2?[]:t?A=A||[]:k=k||[],E,!!t,d,p,t&&d?function(f){return yr(f)===r}:br)}}},R(8,0),R(0,0),R(8,1),R(0,1),z(k),z(A),u=E,W||Y(r),{e:u,get c(){var t=[];return W&&[Y(r=X(r,[e],g,r.name,5,t)),I(t,1)]}}}function hr(r){var e=vr(r,"string");return typeof e=="symbol"?e:e+""}function vr(r,e){if(typeof r!="object"||!r)return r;var n=r[Symbol.toPrimitive];if(n!==void 0){var g=n.call(r,e||"default");if(typeof g!="object")return g;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function sr(r,e,n){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(r,"name",{configurable:!0,value:n?n+" "+e:e})}catch{}return r}function yr(r){if(Object(r)!==r)throw TypeError("right-hand side of 'in' should be an object, got "+(r!==null?typeof r:"null"));return r}var mr,pr=class extends lr{static{({e:[nr,ar,ur,or],c:[mr,ir]}=fr(this,[gr("rui-breadcrumb")],[[dr({type:String,defaultValue:"Breadcrumb"}),0,"label"],[dr({type:String,defaultValue:"/"}),0,"separator"]],0,void 0,lr))}label=nr(this);separator=(ar(this),ur(this));resolvedAriaLabel=(or(this),this.$.label.map(e=>e||"Breadcrumb"));separatorStyle=this.$.separator.map(e=>({"--rui-breadcrumb-separator":JSON.stringify(e||"/")}));render(){return cr("nav",{class:"rui-breadcrumb","aria-label":this.resolvedAriaLabel,style:this.separatorStyle,children:cr("slot",{})})}static{ir()}};import{jsx as y,jsxs as _r}from"@ecopages/jsx/jsx-runtime";function B(...r){return r.filter(Boolean).join(" ")}function Br({children:r,...e}){return y("rui-breadcrumb",{...e,children:r})}function wr({children:r,class:e,...n}){return y("ol",{...n,class:B("rui-breadcrumb__list",e),children:r})}function xr({children:r,class:e,...n}){return y("li",{...n,class:B("rui-breadcrumb__item",e),children:r})}function Rr({children:r,href:e,class:n,...g}){return y("a",{...g,class:B("rui-breadcrumb__link",n),href:e,children:r})}function jr({children:r,class:e,...n}){return y("span",{...n,class:B("rui-breadcrumb__page",e),"aria-current":"page",children:r})}function Sr({children:r,class:e,...n}){return y("li",{...n,class:B("rui-breadcrumb__separator",e),role:"presentation","aria-hidden":"true",children:r})}function Er({label:r="More",class:e,...n}){return _r("span",{...n,class:B("rui-breadcrumb__ellipsis",e),role:"presentation","aria-hidden":"true",children:[y("span",{"aria-hidden":"true",children:"\u2026"}),y("span",{class:"rui-breadcrumb__ellipsis-label",children:r})]})}export{Br as RuiBreadcrumb,mr as RuiBreadcrumbElement,Er as RuiBreadcrumbEllipsis,xr as RuiBreadcrumbItem,Rr as RuiBreadcrumbLink,wr as RuiBreadcrumbList,jr as RuiBreadcrumbPage,Sr as RuiBreadcrumbSeparator};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/components/ui/breadcrumb/breadcrumb.script.tsx", "../../../../src/components/ui/breadcrumb/breadcrumb.tsx", "../../../../src/lib/cx.ts"],
|
|
4
|
-
"sourcesContent": ["let _initClass, _init_label, _init_extra_label, _init_separator, _init_extra_separator;\nfunction _applyDecs(e, t, n, r, o, i) { var a, c, u, s, f, l, p, d = Symbol.metadata || Symbol.for(\"Symbol.metadata\"), m = Object.defineProperty, h = Object.create, y = [h(null), h(null)], v = t.length; function g(t, n, r) { return function (o, i) { n && (i = o, o = e); for (var a = 0; a < t.length; a++) i = t[a].apply(o, r ? [i] : []); return r ? i : o; }; } function b(e, t, n, r) { if (\"function\" != typeof e && (r || void 0 !== e)) throw new TypeError(t + \" must \" + (n || \"be\") + \" a function\" + (r ? \"\" : \" or undefined\")); return e; } function applyDec(e, t, n, r, o, i, u, s, f, l, p) { function d(e) { if (!p(e)) throw new TypeError(\"Attempted to access private element on non-instance\"); } var h = [].concat(t[0]), v = t[3], w = !u, D = 1 === o, S = 3 === o, j = 4 === o, E = 2 === o; function I(t, n, r) { return function (o, i) { return n && (i = o, o = e), r && r(o), P[t].call(o, i); }; } if (!w) { var P = {}, k = [], F = S ? \"get\" : j || D ? \"set\" : \"value\"; if (f ? (l || D ? P = { get: _setFunctionName(function () { return v(this); }, r, \"get\"), set: function (e) { t[4](this, e); } } : P[F] = v, l || _setFunctionName(P[F], r, E ? \"\" : F)) : l || (P = Object.getOwnPropertyDescriptor(e, r)), !l && !f) { if ((c = y[+s][r]) && 7 !== (c ^ o)) throw Error(\"Decorating two elements with the same name (\" + P[F].name + \") is not supported yet\"); y[+s][r] = o < 3 ? 1 : o; } } for (var N = e, O = h.length - 1; O >= 0; O -= n ? 2 : 1) { var T = b(h[O], \"A decorator\", \"be\", !0), z = n ? h[O - 1] : void 0, A = {}, H = { kind: [\"field\", \"accessor\", \"method\", \"getter\", \"setter\", \"class\"][o], name: r, metadata: a, addInitializer: function (e, t) { if (e.v) throw new TypeError(\"attempted to call addInitializer after decoration was finished\"); b(t, \"An initializer\", \"be\", !0), i.push(t); }.bind(null, A) }; if (w) c = T.call(z, N, H), A.v = 1, b(c, \"class decorators\", \"return\") && (N = c);else if (H.static = s, H.private = f, c = H.access = { has: f ? p.bind() : function (e) { return r in e; } }, j || (c.get = f ? E ? function (e) { return d(e), P.value; } : I(\"get\", 0, d) : function (e) { return e[r]; }), E || S || (c.set = f ? I(\"set\", 0, d) : function (e, t) { e[r] = t; }), N = T.call(z, D ? { get: P.get, set: P.set } : P[F], H), A.v = 1, D) { if (\"object\" == typeof N && N) (c = b(N.get, \"accessor.get\")) && (P.get = c), (c = b(N.set, \"accessor.set\")) && (P.set = c), (c = b(N.init, \"accessor.init\")) && k.unshift(c);else if (void 0 !== N) throw new TypeError(\"accessor decorators must return an object with get, set, or init properties or undefined\"); } else b(N, (l ? \"field\" : \"method\") + \" decorators\", \"return\") && (l ? k.unshift(N) : P[F] = N); } return o < 2 && u.push(g(k, s, 1), g(i, s, 0)), l || w || (f ? D ? u.splice(-1, 0, I(\"get\", s), I(\"set\", s)) : u.push(E ? P[F] : b.call.bind(P[F])) : m(e, r, P)), N; } function w(e) { return m(e, d, { configurable: !0, enumerable: !0, value: a }); } return void 0 !== i && (a = i[d]), a = h(null == a ? null : a), f = [], l = function (e) { e && f.push(g(e)); }, p = function (t, r) { for (var i = 0; i < n.length; i++) { var a = n[i], c = a[1], l = 7 & c; if ((8 & c) == t && !l == r) { var p = a[2], d = !!a[3], m = 16 & c; applyDec(t ? e : e.prototype, a, m, d ? \"#\" + p : _toPropertyKey(p), l, l < 2 ? [] : t ? s = s || [] : u = u || [], f, !!t, d, r, t && d ? function (t) { return _checkInRHS(t) === e; } : o); } } }, p(8, 0), p(0, 0), p(8, 1), p(0, 1), l(u), l(s), c = f, v || w(e), { e: c, get c() { var n = []; return v && [w(e = applyDec(e, [t], r, e.name, 5, n)), g(n, 1)]; } }; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == typeof i ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != typeof i) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _setFunctionName(e, t, n) { \"symbol\" == typeof t && (t = (t = t.description) ? \"[\" + t + \"]\" : \"\"); try { Object.defineProperty(e, \"name\", { configurable: !0, value: n ? n + \" \" + t : t }); } catch (e) {} return e; }\nfunction _checkInRHS(e) { if (Object(e) !== e) throw TypeError(\"right-hand side of 'in' should be an object, got \" + (null !== e ? typeof e : \"null\")); return e; }\nimport { jsx } from \"@ecopages/jsx/jsx-runtime\";\nimport { RadiantElement, customElement, prop } from \"@ecopages/radiant\";\nlet _RuiBreadcrumb;\nclass RuiBreadcrumb extends RadiantElement {\n static {\n ({\n e: [_init_label, _init_extra_label, _init_separator, _init_extra_separator],\n c: [_RuiBreadcrumb, _initClass]\n } = _applyDecs(this, [customElement(\"rui-breadcrumb\")], [[prop({\n type: String,\n defaultValue: \"Breadcrumb\"\n }), 0, \"label\"], [prop({\n type: String,\n defaultValue: \"/\"\n }), 0, \"separator\"]], 0, void 0, RadiantElement));\n }\n label = _init_label(this);\n separator = (_init_extra_label(this), _init_separator(this));\n resolvedAriaLabel = (_init_extra_separator(this), this.$.label.map(label => label || \"Breadcrumb\"));\n separatorStyle = this.$.separator.map(separator => ({\n \"--rui-breadcrumb-separator\": JSON.stringify(separator || \"/\")\n }));\n render() {\n return /* @__PURE__ */jsx(\"nav\", {\n class: \"rui-breadcrumb\",\n \"aria-label\": this.resolvedAriaLabel,\n style: this.separatorStyle,\n children: /* @__PURE__ */jsx(\"slot\", {})\n });\n }\n static {\n _initClass();\n }\n}\nexport { _RuiBreadcrumb as RuiBreadcrumb };", "import { jsx, jsxs } from \"@ecopages/jsx/jsx-runtime\";\nimport { cx } from \"@/lib/cx\";\nimport \"./breadcrumb.script\";\nexport function RuiBreadcrumb({\n children,\n ...props\n}) {\n return /* @__PURE__ */jsx(\"rui-breadcrumb\", {\n ...props,\n children\n });\n}\nexport function RuiBreadcrumbList({\n children,\n class: className,\n ...props\n}) {\n return /* @__PURE__ */jsx(\"ol\", {\n ...props,\n class: cx(\"rui-breadcrumb__list\", className),\n children\n });\n}\nexport function RuiBreadcrumbItem({\n children,\n class: className,\n ...props\n}) {\n return /* @__PURE__ */jsx(\"li\", {\n ...props,\n class: cx(\"rui-breadcrumb__item\", className),\n children\n });\n}\nexport function RuiBreadcrumbLink({\n children,\n href,\n class: className,\n
|
|
5
|
-
"mappings": "AAMA,OAAS,OAAAA,OAAW,4BACpB,OAAS,kBAAAC,GAAgB,iBAAAC,GAAe,QAAAC,OAAY,oBAPpD,IAAIC,GAAYC,GAAaC,GAAmBC,GAAiBC,GACjE,SAASC,GAAWC,EAAGC,
|
|
6
|
-
"names": ["jsx", "RadiantElement", "customElement", "prop", "_initClass", "_init_label", "_init_extra_label", "_init_separator", "_init_extra_separator", "_applyDecs", "e", "t", "
|
|
4
|
+
"sourcesContent": ["let _initClass, _init_label, _init_extra_label, _init_separator, _init_extra_separator;\nfunction _applyDecs(e, t, n, r, o, i) { var a, c, u, s, f, l, p, d = Symbol.metadata || Symbol.for(\"Symbol.metadata\"), m = Object.defineProperty, h = Object.create, y = [h(null), h(null)], v = t.length; function g(t, n, r) { return function (o, i) { n && (i = o, o = e); for (var a = 0; a < t.length; a++) i = t[a].apply(o, r ? [i] : []); return r ? i : o; }; } function b(e, t, n, r) { if (\"function\" != typeof e && (r || void 0 !== e)) throw new TypeError(t + \" must \" + (n || \"be\") + \" a function\" + (r ? \"\" : \" or undefined\")); return e; } function applyDec(e, t, n, r, o, i, u, s, f, l, p) { function d(e) { if (!p(e)) throw new TypeError(\"Attempted to access private element on non-instance\"); } var h = [].concat(t[0]), v = t[3], w = !u, D = 1 === o, S = 3 === o, j = 4 === o, E = 2 === o; function I(t, n, r) { return function (o, i) { return n && (i = o, o = e), r && r(o), P[t].call(o, i); }; } if (!w) { var P = {}, k = [], F = S ? \"get\" : j || D ? \"set\" : \"value\"; if (f ? (l || D ? P = { get: _setFunctionName(function () { return v(this); }, r, \"get\"), set: function (e) { t[4](this, e); } } : P[F] = v, l || _setFunctionName(P[F], r, E ? \"\" : F)) : l || (P = Object.getOwnPropertyDescriptor(e, r)), !l && !f) { if ((c = y[+s][r]) && 7 !== (c ^ o)) throw Error(\"Decorating two elements with the same name (\" + P[F].name + \") is not supported yet\"); y[+s][r] = o < 3 ? 1 : o; } } for (var N = e, O = h.length - 1; O >= 0; O -= n ? 2 : 1) { var T = b(h[O], \"A decorator\", \"be\", !0), z = n ? h[O - 1] : void 0, A = {}, H = { kind: [\"field\", \"accessor\", \"method\", \"getter\", \"setter\", \"class\"][o], name: r, metadata: a, addInitializer: function (e, t) { if (e.v) throw new TypeError(\"attempted to call addInitializer after decoration was finished\"); b(t, \"An initializer\", \"be\", !0), i.push(t); }.bind(null, A) }; if (w) c = T.call(z, N, H), A.v = 1, b(c, \"class decorators\", \"return\") && (N = c);else if (H.static = s, H.private = f, c = H.access = { has: f ? p.bind() : function (e) { return r in e; } }, j || (c.get = f ? E ? function (e) { return d(e), P.value; } : I(\"get\", 0, d) : function (e) { return e[r]; }), E || S || (c.set = f ? I(\"set\", 0, d) : function (e, t) { e[r] = t; }), N = T.call(z, D ? { get: P.get, set: P.set } : P[F], H), A.v = 1, D) { if (\"object\" == typeof N && N) (c = b(N.get, \"accessor.get\")) && (P.get = c), (c = b(N.set, \"accessor.set\")) && (P.set = c), (c = b(N.init, \"accessor.init\")) && k.unshift(c);else if (void 0 !== N) throw new TypeError(\"accessor decorators must return an object with get, set, or init properties or undefined\"); } else b(N, (l ? \"field\" : \"method\") + \" decorators\", \"return\") && (l ? k.unshift(N) : P[F] = N); } return o < 2 && u.push(g(k, s, 1), g(i, s, 0)), l || w || (f ? D ? u.splice(-1, 0, I(\"get\", s), I(\"set\", s)) : u.push(E ? P[F] : b.call.bind(P[F])) : m(e, r, P)), N; } function w(e) { return m(e, d, { configurable: !0, enumerable: !0, value: a }); } return void 0 !== i && (a = i[d]), a = h(null == a ? null : a), f = [], l = function (e) { e && f.push(g(e)); }, p = function (t, r) { for (var i = 0; i < n.length; i++) { var a = n[i], c = a[1], l = 7 & c; if ((8 & c) == t && !l == r) { var p = a[2], d = !!a[3], m = 16 & c; applyDec(t ? e : e.prototype, a, m, d ? \"#\" + p : _toPropertyKey(p), l, l < 2 ? [] : t ? s = s || [] : u = u || [], f, !!t, d, r, t && d ? function (t) { return _checkInRHS(t) === e; } : o); } } }, p(8, 0), p(0, 0), p(8, 1), p(0, 1), l(u), l(s), c = f, v || w(e), { e: c, get c() { var n = []; return v && [w(e = applyDec(e, [t], r, e.name, 5, n)), g(n, 1)]; } }; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == typeof i ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != typeof i) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _setFunctionName(e, t, n) { \"symbol\" == typeof t && (t = (t = t.description) ? \"[\" + t + \"]\" : \"\"); try { Object.defineProperty(e, \"name\", { configurable: !0, value: n ? n + \" \" + t : t }); } catch (e) {} return e; }\nfunction _checkInRHS(e) { if (Object(e) !== e) throw TypeError(\"right-hand side of 'in' should be an object, got \" + (null !== e ? typeof e : \"null\")); return e; }\nimport { jsx } from \"@ecopages/jsx/jsx-runtime\";\nimport { RadiantElement, customElement, prop } from \"@ecopages/radiant\";\nlet _RuiBreadcrumb;\nclass RuiBreadcrumb extends RadiantElement {\n static {\n ({\n e: [_init_label, _init_extra_label, _init_separator, _init_extra_separator],\n c: [_RuiBreadcrumb, _initClass]\n } = _applyDecs(this, [customElement(\"rui-breadcrumb\")], [[prop({\n type: String,\n defaultValue: \"Breadcrumb\"\n }), 0, \"label\"], [prop({\n type: String,\n defaultValue: \"/\"\n }), 0, \"separator\"]], 0, void 0, RadiantElement));\n }\n label = _init_label(this);\n separator = (_init_extra_label(this), _init_separator(this));\n resolvedAriaLabel = (_init_extra_separator(this), this.$.label.map(label => label || \"Breadcrumb\"));\n separatorStyle = this.$.separator.map(separator => ({\n \"--rui-breadcrumb-separator\": JSON.stringify(separator || \"/\")\n }));\n render() {\n return /* @__PURE__ */jsx(\"nav\", {\n class: \"rui-breadcrumb\",\n \"aria-label\": this.resolvedAriaLabel,\n style: this.separatorStyle,\n children: /* @__PURE__ */jsx(\"slot\", {})\n });\n }\n static {\n _initClass();\n }\n}\nexport { _RuiBreadcrumb as RuiBreadcrumb };", "import { jsx, jsxs } from \"@ecopages/jsx/jsx-runtime\";\nimport { cx } from \"@/lib/cx\";\nimport \"./breadcrumb.script\";\nexport function RuiBreadcrumb({\n children,\n ...props\n}) {\n return /* @__PURE__ */jsx(\"rui-breadcrumb\", {\n ...props,\n children\n });\n}\nexport function RuiBreadcrumbList({\n children,\n class: className,\n ...props\n}) {\n return /* @__PURE__ */jsx(\"ol\", {\n ...props,\n class: cx(\"rui-breadcrumb__list\", className),\n children\n });\n}\nexport function RuiBreadcrumbItem({\n children,\n class: className,\n ...props\n}) {\n return /* @__PURE__ */jsx(\"li\", {\n ...props,\n class: cx(\"rui-breadcrumb__item\", className),\n children\n });\n}\nexport function RuiBreadcrumbLink({\n children,\n href,\n class: className,\n ...props\n}) {\n return /* @__PURE__ */jsx(\"a\", {\n ...props,\n class: cx(\"rui-breadcrumb__link\", className),\n href,\n children\n });\n}\nexport function RuiBreadcrumbPage({\n children,\n class: className,\n ...props\n}) {\n return /* @__PURE__ */jsx(\"span\", {\n ...props,\n class: cx(\"rui-breadcrumb__page\", className),\n \"aria-current\": \"page\",\n children\n });\n}\nexport function RuiBreadcrumbSeparator({\n children,\n class: className,\n ...props\n}) {\n return /* @__PURE__ */jsx(\"li\", {\n ...props,\n class: cx(\"rui-breadcrumb__separator\", className),\n role: \"presentation\",\n \"aria-hidden\": \"true\",\n children\n });\n}\nexport function RuiBreadcrumbEllipsis({\n label = \"More\",\n class: className,\n ...props\n}) {\n return /* @__PURE__ */jsxs(\"span\", {\n ...props,\n class: cx(\"rui-breadcrumb__ellipsis\", className),\n role: \"presentation\",\n \"aria-hidden\": \"true\",\n children: [/* @__PURE__ */jsx(\"span\", {\n \"aria-hidden\": \"true\",\n children: \"\\u2026\"\n }), /* @__PURE__ */jsx(\"span\", {\n class: \"rui-breadcrumb__ellipsis-label\",\n children: label\n })]\n });\n}", "export function cx(...parts) {\n return parts.filter(Boolean).join(\" \");\n}"],
|
|
5
|
+
"mappings": "AAMA,OAAS,OAAAA,OAAW,4BACpB,OAAS,kBAAAC,GAAgB,iBAAAC,GAAe,QAAAC,OAAY,oBAPpD,IAAIC,GAAYC,GAAaC,GAAmBC,GAAiBC,GACjE,SAASC,GAAWC,EAAGC,EAAG,EAAGC,EAAGC,GAAGC,EAAG,CAAE,IAAIC,EAAGC,EAAGC,EAAGC,EAAGC,EAAGC,EAAGC,EAAGC,EAAI,OAAO,UAAY,OAAO,IAAI,iBAAiB,EAAGC,EAAI,OAAO,eAAgBC,EAAI,OAAO,OAAQC,EAAI,CAACD,EAAE,IAAI,EAAGA,EAAE,IAAI,CAAC,EAAGE,EAAIf,EAAE,OAAQ,SAASgB,EAAE,EAAGC,EAAGhB,EAAG,CAAE,OAAO,SAAUC,EAAGC,EAAG,CAAEc,IAAMd,EAAID,EAAGA,EAAIH,GAAI,QAASK,EAAI,EAAGA,EAAI,EAAE,OAAQA,IAAKD,EAAI,EAAEC,CAAC,EAAE,MAAMF,EAAGD,EAAI,CAACE,CAAC,EAAI,CAAC,CAAC,EAAG,OAAOF,EAAIE,EAAID,CAAG,CAAG,CAAE,SAASgB,EAAEnB,EAAGC,EAAGiB,EAAGhB,EAAG,CAAE,GAAkB,OAAOF,GAArB,aAA2BE,GAAgBF,IAAX,QAAe,MAAM,IAAI,UAAUC,EAAI,UAAYiB,GAAK,MAAQ,eAAiBhB,EAAI,GAAK,gBAAgB,EAAG,OAAOF,CAAG,CAAE,SAASoB,EAASpB,EAAGC,EAAGiB,EAAGhB,EAAGC,EAAGC,EAAGG,EAAGC,EAAGC,EAAGC,EAAGC,EAAG,CAAE,SAASC,EAAEZ,EAAG,CAAE,GAAI,CAACW,EAAEX,CAAC,EAAG,MAAM,IAAI,UAAU,qDAAqD,CAAG,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R,MAAOR,EACP,GAAGH,CACL,EAAG,CACD,OAAsBY,GAAK,OAAQ,CACjC,GAAGZ,EACH,MAAOI,EAAG,2BAA4BD,CAAS,EAC/C,KAAM,eACN,cAAe,OACf,SAAU,CAAgBF,EAAI,OAAQ,CACpC,cAAe,OACf,SAAU,QACZ,CAAC,EAAkBA,EAAI,OAAQ,CAC7B,MAAO,iCACP,SAAUU,CACZ,CAAC,CAAC,CACJ,CAAC,CACH",
|
|
6
|
+
"names": ["jsx", "RadiantElement", "customElement", "prop", "_initClass", "_init_label", "_init_extra_label", "_init_separator", "_init_extra_separator", "_applyDecs", "e", "t", "r", "o", "i", "a", "c", "u", "s", "f", "l", "p", "d", "m", "h", "y", "v", "g", "n", "b", "applyDec", "w", "D", "S", "j", "E", "I", "P", "k", "F", "_setFunctionName", "N", "O", "T", "z", "A", "H", "_toPropertyKey", "_checkInRHS", "_toPrimitive", "_RuiBreadcrumb", "RuiBreadcrumb", "label", "separator", "jsx", "jsxs", "cx", "parts", "RuiBreadcrumb", "children", "props", "jsx", "RuiBreadcrumbList", "className", "cx", "RuiBreadcrumbItem", "RuiBreadcrumbLink", "href", "RuiBreadcrumbPage", "RuiBreadcrumbSeparator", "RuiBreadcrumbEllipsis", "label", "jsxs"]
|
|
7
7
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { JsxHtmlPropsWithChildren } from '@ecopages/jsx';
|
|
1
|
+
import type { JsxAriaAttributes, JsxHtmlPropsWithChildren } from '@ecopages/jsx';
|
|
2
2
|
export type RuiButtonVariant = 'filled' | 'outline' | 'destructive' | 'ghost' | 'link';
|
|
3
3
|
export type RuiButtonSize = 'none' | 'sm' | 'md' | 'lg';
|
|
4
4
|
type RuiButtonCommonProps = JsxHtmlPropsWithChildren<{
|
|
@@ -31,7 +31,7 @@ export type RuiButtonLinkProps = RuiButtonCommonProps & {
|
|
|
31
31
|
target?: '_self' | '_blank' | '_parent' | '_top';
|
|
32
32
|
rel?: string;
|
|
33
33
|
download?: boolean | string;
|
|
34
|
-
'aria-current'?:
|
|
34
|
+
'aria-current'?: JsxAriaAttributes['aria-current'];
|
|
35
35
|
'on:click'?: (event: Event) => void;
|
|
36
36
|
};
|
|
37
37
|
export type RuiButtonProps = RuiButtonControlProps | RuiButtonLinkProps;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as l}from"@ecopages/jsx/jsx-runtime";function s(...t){return t.filter(Boolean).join(" ")}function z(t,i,r){if(t!==void 0)return t;if(i)return r}function A(t,i){if(typeof t=="function"){t(i);return}t!=null&&typeof t=="object"&&"handleEvent"in t&&t.handleEvent(i)}function B(t){if(t.href!==void 0){let{href:n,target:o,rel:a,download:p,children:x,class:k,variant:$,size:j,...y}=t;return l("a",{...y,href:n,target:o,rel:a,download:p,class:s("rui-button",`rui-button--${$??"filled"}`,`rui-button--${j??"md"}`,k),children:x})}let{variant:i,size:r,class:d,children:f,type:b="button",disabled:v,pressed:u,defaultPressed:h=!1,toggle:e=!1,"on:click":c,...m}=t,g=n=>{if(e&&u===void 0){let o=n.currentTarget,a=o.getAttribute("aria-pressed")!=="true";o.setAttribute("aria-pressed",String(a))}A(c,n)};return l("button",{...m,type:b,class:s("rui-button",`rui-button--${i??"filled"}`,`rui-button--${r??"md"}`,d),disabled:v,"aria-pressed":z(u,e,h),"data-toggle":e&&u===void 0?"":void 0,"on:click":e||c?g:void 0,children:f})}export{B as RuiButton};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/components/ui/button/button.tsx", "../../../../src/lib/cx.ts"],
|
|
4
|
-
"sourcesContent": ["import { jsx } from \"@ecopages/jsx/jsx-runtime\";\nimport { cx } from \"@/lib/cx\";\nfunction resolveAriaPressed(pressed, toggle, defaultPressed) {\n if (pressed !== void 0) {\n return pressed;\n }\n if (toggle) {\n return defaultPressed;\n }\n return void 0;\n}\nexport function RuiButton(props) {\n if (props.href !== void 0) {\n const {\n href,\n target,\n rel,\n download,\n
|
|
5
|
-
"mappings": "AAAA,OAAS,OAAAA,MAAW,4BCAb,SAASC,KAAMC,EAAO,CAC3B,OAAOA,EAAM,OAAO,OAAO,EAAE,KAAK,GAAG,CACvC,CDAA,SAASC,EAAmBC,EAASC,EAAQC,EAAgB,CAC3D,GAAIF,IAAY,OACd,OAAOA,EAET,GAAIC,EACF,OAAOC,CAGX,CACO,SAASC,EAAUC,EAAO,CAC/B,GAAIA,EAAM,OAAS,OAAQ,CACzB,GAAM,CACJ,KAAAC,EACA,OAAAC,EACA,IAAAC,EACA,SAAAC,EACA,
|
|
6
|
-
"names": ["jsx", "cx", "parts", "resolveAriaPressed", "pressed", "toggle", "defaultPressed", "
|
|
4
|
+
"sourcesContent": ["import { jsx } from \"@ecopages/jsx/jsx-runtime\";\nimport { cx } from \"@/lib/cx\";\nfunction resolveAriaPressed(pressed, toggle, defaultPressed) {\n if (pressed !== void 0) {\n return pressed;\n }\n if (toggle) {\n return defaultPressed;\n }\n return void 0;\n}\nfunction invokeClickListener(listener, event) {\n if (typeof listener === \"function\") {\n listener(event);\n return;\n }\n if (listener != null && typeof listener === \"object\" && \"handleEvent\" in listener) {\n listener.handleEvent(event);\n }\n}\nexport function RuiButton(props) {\n if (props.href !== void 0) {\n const {\n href,\n target,\n rel,\n download,\n children: children2,\n class: className2,\n variant: variant2,\n size: size2,\n ...host2\n } = props;\n return /* @__PURE__ */jsx(\"a\", {\n ...host2,\n href,\n target,\n rel,\n download,\n class: cx(\"rui-button\", `rui-button--${variant2 ?? \"filled\"}`, `rui-button--${size2 ?? \"md\"}`, className2),\n children: children2\n });\n }\n const {\n variant,\n size,\n class: className,\n children,\n type = \"button\",\n disabled,\n pressed,\n defaultPressed = false,\n toggle = false,\n \"on:click\": onClick,\n ...host\n } = props;\n const handleClick = event => {\n if (toggle && pressed === void 0) {\n const button = event.currentTarget;\n const next = button.getAttribute(\"aria-pressed\") !== \"true\";\n button.setAttribute(\"aria-pressed\", String(next));\n }\n invokeClickListener(onClick, event);\n };\n return /* @__PURE__ */jsx(\"button\", {\n ...host,\n type,\n class: cx(\"rui-button\", `rui-button--${variant ?? \"filled\"}`, `rui-button--${size ?? \"md\"}`, className),\n disabled,\n \"aria-pressed\": resolveAriaPressed(pressed, toggle, defaultPressed),\n \"data-toggle\": toggle && pressed === void 0 ? \"\" : void 0,\n \"on:click\": toggle || onClick ? handleClick : void 0,\n children\n });\n}", "export function cx(...parts) {\n return parts.filter(Boolean).join(\" \");\n}"],
|
|
5
|
+
"mappings": "AAAA,OAAS,OAAAA,MAAW,4BCAb,SAASC,KAAMC,EAAO,CAC3B,OAAOA,EAAM,OAAO,OAAO,EAAE,KAAK,GAAG,CACvC,CDAA,SAASC,EAAmBC,EAASC,EAAQC,EAAgB,CAC3D,GAAIF,IAAY,OACd,OAAOA,EAET,GAAIC,EACF,OAAOC,CAGX,CACA,SAASC,EAAoBC,EAAUC,EAAO,CAC5C,GAAI,OAAOD,GAAa,WAAY,CAClCA,EAASC,CAAK,EACd,MACF,CACID,GAAY,MAAQ,OAAOA,GAAa,UAAY,gBAAiBA,GACvEA,EAAS,YAAYC,CAAK,CAE9B,CACO,SAASC,EAAUC,EAAO,CAC/B,GAAIA,EAAM,OAAS,OAAQ,CACzB,GAAM,CACJ,KAAAC,EACA,OAAAC,EACA,IAAAC,EACA,SAAAC,EACA,SAAUC,EACV,MAAOC,EACP,QAASC,EACT,KAAMC,EACN,GAAGC,CACL,EAAIT,EACJ,OAAsBU,EAAI,IAAK,CAC7B,GAAGD,EACH,KAAAR,EACA,OAAAC,EACA,IAAAC,EACA,SAAAC,EACA,MAAOO,EAAG,aAAc,eAAeJ,GAAY,QAAQ,GAAI,eAAeC,GAAS,IAAI,GAAIF,CAAU,EACzG,SAAUD,CACZ,CAAC,CACH,CACA,GAAM,CACJ,QAAAO,EACA,KAAAC,EACA,MAAOC,EACP,SAAAC,EACA,KAAAC,EAAO,SACP,SAAAC,EACA,QAAAxB,EACA,eAAAE,EAAiB,GACjB,OAAAD,EAAS,GACT,WAAYwB,EACZ,GAAGC,CACL,EAAInB,EACEoB,EAActB,GAAS,CAC3B,GAAIJ,GAAUD,IAAY,OAAQ,CAChC,IAAM4B,EAASvB,EAAM,cACfwB,EAAOD,EAAO,aAAa,cAAc,IAAM,OACrDA,EAAO,aAAa,eAAgB,OAAOC,CAAI,CAAC,CAClD,CACA1B,EAAoBsB,EAASpB,CAAK,CACpC,EACA,OAAsBY,EAAI,SAAU,CAClC,GAAGS,EACH,KAAAH,EACA,MAAOL,EAAG,aAAc,eAAeC,GAAW,QAAQ,GAAI,eAAeC,GAAQ,IAAI,GAAIC,CAAS,EACtG,SAAAG,EACA,eAAgBzB,EAAmBC,EAASC,EAAQC,CAAc,EAClE,cAAeD,GAAUD,IAAY,OAAS,GAAK,OACnD,WAAYC,GAAUwB,EAAUE,EAAc,OAC9C,SAAAL,CACF,CAAC,CACH",
|
|
6
|
+
"names": ["jsx", "cx", "parts", "resolveAriaPressed", "pressed", "toggle", "defaultPressed", "invokeClickListener", "listener", "event", "RuiButton", "props", "href", "target", "rel", "download", "children2", "className2", "variant2", "size2", "host2", "jsx", "cx", "variant", "size", "className", "children", "type", "disabled", "onClick", "host", "handleClick", "button", "next"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as n}from"@ecopages/jsx/jsx-runtime";function t(...o){return o.filter(Boolean).join(" ")}function p({children:o,orientation:r="horizontal",class:u,...i}){return n("div",{...i,role:"group","aria-orientation":r,class:t("rui-button-group",`rui-button-group--${r}`,u),children:o})}export{p as RuiButtonGroup};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/components/ui/button-group/button-group.tsx", "../../../../src/lib/cx.ts"],
|
|
4
|
-
"sourcesContent": ["import { jsx } from \"@ecopages/jsx/jsx-runtime\";\nimport { cx } from \"@/lib/cx\";\nexport function RuiButtonGroup({\n children,\n orientation = \"horizontal\",\n class: className,\n
|
|
5
|
-
"mappings": "AAAA,OAAS,OAAAA,MAAW,4BCAb,SAASC,KAAMC,EAAO,CAC3B,OAAOA,EAAM,OAAO,OAAO,EAAE,KAAK,GAAG,CACvC,CDAO,SAASC,EAAe,CAC7B,SAAAC,EACA,YAAAC,EAAc,aACd,MAAOC,EACP,
|
|
6
|
-
"names": ["jsx", "cx", "parts", "RuiButtonGroup", "children", "orientation", "className", "
|
|
4
|
+
"sourcesContent": ["import { jsx } from \"@ecopages/jsx/jsx-runtime\";\nimport { cx } from \"@/lib/cx\";\nexport function RuiButtonGroup({\n children,\n orientation = \"horizontal\",\n class: className,\n ...props\n}) {\n return /* @__PURE__ */jsx(\"div\", {\n ...props,\n role: \"group\",\n \"aria-orientation\": orientation,\n class: cx(\"rui-button-group\", `rui-button-group--${orientation}`, className),\n children\n });\n}", "export function cx(...parts) {\n return parts.filter(Boolean).join(\" \");\n}"],
|
|
5
|
+
"mappings": "AAAA,OAAS,OAAAA,MAAW,4BCAb,SAASC,KAAMC,EAAO,CAC3B,OAAOA,EAAM,OAAO,OAAO,EAAE,KAAK,GAAG,CACvC,CDAO,SAASC,EAAe,CAC7B,SAAAC,EACA,YAAAC,EAAc,aACd,MAAOC,EACP,GAAGC,CACL,EAAG,CACD,OAAsBC,EAAI,MAAO,CAC/B,GAAGD,EACH,KAAM,QACN,mBAAoBF,EACpB,MAAOI,EAAG,mBAAoB,qBAAqBJ,CAAW,GAAIC,CAAS,EAC3E,SAAAF,CACF,CAAC,CACH",
|
|
6
|
+
"names": ["jsx", "cx", "parts", "RuiButtonGroup", "children", "orientation", "className", "props", "jsx", "cx"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as d,jsxs as k}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as jt,customElement as Ut,onEvent as b,onUpdated as H,prop as m}from"@ecopages/radiant";var ut,ct,dt,ht,pt,ft,yt,bt,_t,vt,mt,gt,xt,wt,At,It,St,Ct,Rt,Pt,Vt,Et,kt,Mt;function Nt(o,t,e,r,i,c){var u,a,s,A,V,M,C,q=Symbol.metadata||Symbol.for("Symbol.metadata"),D=Object.defineProperty,B=Object.create,J=[B(null),B(null)],Q=t.length;function N(n,x,_){return function(l,h){x&&(h=l,l=o);for(var w=0;w<n.length;w++)h=n[w].apply(l,_?[h]:[]);return _?h:l}}function R(n,x,_,l){if(typeof n!="function"&&(l||n!==void 0))throw new TypeError(x+" must "+(_||"be")+" a function"+(l?"":" or undefined"));return n}function Z(n,x,_,l,h,w,E,v,I,S,et){function X(f){if(!et(f))throw new TypeError("Attempted to access private element on non-instance")}var Y=[].concat(x[0]),it=x[3],K=!E,j=h===1,rt=h===3,ot=h===4,z=h===2;function W(f,T,st){return function(U,lt){return T&&(lt=U,U=n),st&&st(U),p[f].call(U,lt)}}if(!K){var p={},F=[],P=rt?"get":ot||j?"set":"value";if(I?(S||j?p={get:Tt(function(){return it(this)},l,"get"),set:function(f){x[4](this,f)}}:p[P]=it,S||Tt(p[P],l,z?"":P)):S||(p=Object.getOwnPropertyDescriptor(n,l)),!S&&!I){if((a=J[+v][l])&&(a^h)!==7)throw Error("Decorating two elements with the same name ("+p[P].name+") is not supported yet");J[+v][l]=h<3?1:h}}for(var y=n,O=Y.length-1;O>=0;O-=_?2:1){var at=R(Y[O],"A decorator","be",!0),nt=_?Y[O-1]:void 0,G={},L={kind:["field","accessor","method","getter","setter","class"][h],name:l,metadata:u,addInitializer:function(f,T){if(f.v)throw new TypeError("attempted to call addInitializer after decoration was finished");R(T,"An initializer","be",!0),w.push(T)}.bind(null,G)};if(K)a=at.call(nt,y,L),G.v=1,R(a,"class decorators","return")&&(y=a);else if(L.static=v,L.private=I,a=L.access={has:I?et.bind():function(f){return l in f}},ot||(a.get=I?z?function(f){return X(f),p.value}:W("get",0,X):function(f){return f[l]}),z||rt||(a.set=I?W("set",0,X):function(f,T){f[l]=T}),y=at.call(nt,j?{get:p.get,set:p.set}:p[P],L),G.v=1,j){if(typeof y=="object"&&y)(a=R(y.get,"accessor.get"))&&(p.get=a),(a=R(y.set,"accessor.set"))&&(p.set=a),(a=R(y.init,"accessor.init"))&&F.unshift(a);else if(y!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else R(y,(S?"field":"method")+" decorators","return")&&(S?F.unshift(y):p[P]=y)}return h<2&&E.push(N(F,v,1),N(w,v,0)),S||K||(I?j?E.splice(-1,0,W("get",v),W("set",v)):E.push(z?p[P]:R.call.bind(p[P])):D(n,l,p)),y}function tt(n){return D(n,q,{configurable:!0,enumerable:!0,value:u})}return c!==void 0&&(u=c[q]),u=B(u??null),V=[],M=function(n){n&&V.push(N(n))},C=function(n,x){for(var _=0;_<e.length;_++){var l=e[_],h=l[1],w=7&h;if((8&h)==n&&!w==x){var E=l[2],v=!!l[3],I=16&h;Z(n?o:o.prototype,l,I,v?"#"+E:zt(E),w,w<2?[]:n?A=A||[]:s=s||[],V,!!n,v,x,n&&v?function(S){return Ot(S)===o}:i)}}},C(8,0),C(0,0),C(8,1),C(0,1),M(s),M(A),a=V,Q||tt(o),{e:a,get c(){var n=[];return Q&&[tt(o=Z(o,[t],r,o.name,5,n)),N(n,1)]}}}function zt(o){var t=Wt(o,"string");return typeof t=="symbol"?t:t+""}function Wt(o,t){if(typeof o!="object"||!o)return o;var e=o[Symbol.toPrimitive];if(e!==void 0){var r=e.call(o,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(o)}function Tt(o,t,e){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(o,"name",{configurable:!0,value:e?e+" "+t:t})}catch{}return o}function Ot(o){if(Object(o)!==o)throw TypeError("right-hand side of 'in' should be an object, got "+(o!==null?typeof o:"null"));return o}var Bt=48,$t,Lt=class extends jt{static{({e:[dt,ht,pt,ft,yt,bt,_t,vt,mt,gt,xt,wt,At,It,St,Ct,Rt,Pt,Vt,Et,kt,Mt,ut],c:[$t,ct]}=Nt(this,[Ut("rui-carousel")],[[m({type:String,defaultValue:"Carousel"}),0,"label"],[m({type:Number,reflect:!0,defaultValue:0}),0,"index"],[m({type:Boolean,reflect:!0,defaultValue:!1}),0,"autoplay"],[m({type:Number,defaultValue:4e3}),0,"interval"],[m({type:String,defaultValue:"none"}),0,"transition"],[m({type:String,defaultValue:"toolbar",attribute:"controls-variant"}),0,"controlsVariant"],[m({type:Boolean,defaultValue:!1}),0,"showIndicators"],[m({type:Boolean,defaultValue:!1}),0,"showRotationControl"],[m({type:Boolean,defaultValue:!0}),0,"loop"],[m({type:Boolean,defaultValue:!0}),0,"wrap"],[m({type:Number,defaultValue:0}),0,"slideCount"],[H(["index","transition","loop","wrap","controlsVariant"]),2,"onSlideStateUpdated"],[H(["autoplay","showRotationControl","interval"]),2,"onAutoplayUpdated"],[H(["showIndicators"]),2,"onIndicatorsUpdated"],[b({selector:'[data-carousel-action="prev"]',type:"click"}),2,"prev"],[b({selector:'[data-carousel-action="next"]',type:"click"}),2,"next"],[b({selector:'[data-carousel-action="rotation"]',type:"click"}),2,"toggleRotation"],[b({selector:"[data-carousel-indicator]",type:"click"}),2,"onIndicatorClick"],[b({selector:"[data-carousel-indicator]",type:"keydown"}),2,"onIndicatorKeydown"],[b({ref:"root",type:"pointerenter"}),2,"onRootPointerEnter"],[b({ref:"root",type:"pointerleave"}),2,"onRootPointerLeave"],[b({ref:"root",type:"focusin"}),2,"onRootFocusIn"],[b({ref:"root",type:"focusout"}),2,"onRootFocusOut"],[b({ref:"viewport",type:"pointerdown"}),2,"onViewportPointerDown"],[b({ref:"viewport",type:"pointermove"}),2,"onViewportPointerMove"],[b({ref:"viewport",type:"pointerup"}),2,"onViewportPointerUp"],[b({ref:"viewport",type:"pointercancel"}),2,"onViewportPointerCancel"]],0,void 0,jt))}label=(ut(this),dt(this));index=(ht(this),pt(this));autoplay=(ft(this),yt(this));interval=(bt(this),_t(this));transition=(vt(this),mt(this));controlsVariant=(gt(this),xt(this));showIndicators=(wt(this),At(this));showRotationControl=(It(this),St(this));loop=(Ct(this),Rt(this));wrap=(Pt(this),Vt(this));slideCount=(Et(this),kt(this));timer=(Mt(this),null);paused=!1;userOverrideReducedMotion=!1;swipePointerId=null;swipeStartX=0;swipeStartY=0;connectedCallback(){super.connectedCallback(),queueMicrotask(()=>{this.autoplay&&this.prefersReducedMotion()&&(this.paused=!0),this.sync(),this.syncAutoplay(),this.syncIndicators(),this.syncAriaLive()})}disconnectedCallback(){this.stop(),super.disconnectedCallback()}onSlideStateUpdated(){this.sync(),this.syncIndicators(),this.syncAutoplay()}onAutoplayUpdated(){this.syncAutoplay(),this.syncRotationControl()}onIndicatorsUpdated(){this.syncIndicators()}prefersReducedMotion(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}getCarouselId(){return this.id||"rui-carousel"}slidePanelId(t,e){let r=t.getAttribute("data-slide")??String(e),i=`${this.getCarouselId()}-panel-${r}`;return t.id=i,i}tabId(t){return`${this.getCarouselId()}-tab-${t}`}shouldShowRotationControl(){return this.autoplay||this.showRotationControl}syncSlideAccessibility(t,e){let r=t.length;t.forEach((i,c)=>{let u=c===e,a=`${c+1} of ${r}`;this.showIndicators?(this.slidePanelId(i,c),i.setAttribute("role","tabpanel"),i.setAttribute("aria-labelledby",this.tabId(c)),i.setAttribute("aria-label",a),i.removeAttribute("aria-roledescription")):(i.setAttribute("role","group"),i.setAttribute("aria-roledescription","slide"),i.setAttribute("aria-label",a),i.removeAttribute("aria-labelledby"),i.removeAttribute("tabindex")),this.transition==="none"?i.hidden=!u:i.hidden=!1,i.setAttribute("aria-hidden",String(!u)),i.setAttribute("data-active",u?"true":"false")})}getSlides(){return Array.from(this.querySelectorAll("[data-slide]"))}get shouldWrap(){return this.wrap&&this.loop}normalizeIndex(t,e){return e<=0?0:this.shouldWrap?(t%e+e)%e:Math.min(Math.max(t,0),e-1)}sync(){let t=this.getSlides();if(!t.length)return;let e=this.normalizeIndex(this.index,t.length);e!==this.index&&(this.index=e);let r=this.querySelector(".rui-carousel__track");r&&this.transition==="slide"&&r.style.setProperty("--rui-carousel-index",String(e)),this.syncSlideAccessibility(t,e),this.syncPrevNextDisabled(t.length,e)}syncPrevNextDisabled(t,e){let r=!this.shouldWrap&&t>0&&e<=0,i=!this.shouldWrap&&t>0&&e>=t-1;for(let c of this.querySelectorAll('[data-carousel-action="prev"]'))this.shouldWrap?c.removeAttribute("disabled"):c.disabled=r;for(let c of this.querySelectorAll('[data-carousel-action="next"]'))this.shouldWrap?c.removeAttribute("disabled"):c.disabled=i}syncIndicators(){let t=this.querySelector('[data-ref="indicators"]');if(!t)return;let e=this.getSlides(),r=this.normalizeIndex(this.index,e.length);Array.from(t.querySelectorAll("[data-carousel-indicator]")).length!==e.length&&t.replaceChildren(...e.map((u,a)=>{let s=document.createElement("button");return s.type="button",s.className="rui-carousel__indicator",s.id=this.tabId(a),s.setAttribute("role","tab"),s.setAttribute("data-carousel-indicator",String(a)),s.setAttribute("aria-controls",this.slidePanelId(u,a)),s.setAttribute("aria-label",`Slide ${a+1}`),s})),Array.from(t.querySelectorAll("[data-carousel-indicator]")).forEach((u,a)=>{let s=a===r,A=e[a];A&&(u.id=this.tabId(a),u.setAttribute("aria-controls",this.slidePanelId(A,a))),u.setAttribute("aria-selected",String(s)),u.tabIndex=s?0:-1})}syncRotationControl(){for(let t of this.querySelectorAll('[data-carousel-action="rotation"]')){let e=this.autoplay&&!this.paused;t.setAttribute("aria-pressed",String(e)),t.setAttribute("aria-label",e?"Pause rotation":"Start rotation")}}syncAriaLive(){let t=this.querySelector('[data-ref="viewport"]');if(!t)return;let e=this.autoplay&&!this.paused&&this.timer!==null;t.setAttribute("aria-live",e?"off":"polite"),t.setAttribute("aria-atomic","false")}canAutoplayRotate(){return!(!this.autoplay||this.paused||this.prefersReducedMotion()&&!this.userOverrideReducedMotion)}syncAutoplay(){this.canAutoplayRotate()?this.start():this.stop(),this.syncRotationControl(),this.syncAriaLive()}start(){let t=this.getSlides();if(!t.length)return;if(!this.shouldWrap&&this.index>=t.length-1){this.stop();return}this.stop();let e=Math.max(0,this.interval);this.timer=setInterval(()=>{let r=this.getSlides();if(r.length){if(!this.shouldWrap&&this.index>=r.length-1){this.stop(),this.syncAriaLive();return}this.goTo(this.index+1)}},e),this.syncAriaLive()}stop(){this.timer&&clearInterval(this.timer),this.timer=null,this.syncAriaLive()}goTo(t){let e=this.getSlides();e.length&&(this.index=this.normalizeIndex(t,e.length),this.sync(),this.syncIndicators())}userNavigate(t){this.paused=!0,this.stop(),this.goTo(this.index+t)}isSwipeExcludedTarget(t){return t instanceof Element?!!t.closest("button, a, input, textarea, select, [data-carousel-indicator], [data-carousel-action]"):!1}prev(){this.userNavigate(-1)}next(){this.userNavigate(1)}toggleRotation(){this.autoplay?(this.paused=!this.paused,this.paused||(this.userOverrideReducedMotion=!0)):(this.autoplay=!0,this.paused=!1,this.userOverrideReducedMotion=!0),this.syncAutoplay()}onIndicatorClick(t){let e=t.target.closest("[data-carousel-indicator]");if(!e)return;let r=Number(e.getAttribute("data-carousel-indicator"));Number.isFinite(r)&&(this.paused=!0,this.stop(),this.goTo(r),e.focus())}onIndicatorKeydown(t){let e=this.getSlides();if(!e.length)return;let r=t.target.closest("[data-carousel-indicator]");if(!r)return;let i=Number(r.getAttribute("data-carousel-indicator"));if(!Number.isFinite(i))return;if(t.key==="ArrowRight")i=this.normalizeIndex(i+1,e.length);else if(t.key==="ArrowLeft")i=this.normalizeIndex(i-1,e.length);else if(t.key==="Home")i=0;else if(t.key==="End")i=e.length-1;else if(t.key===" "||t.key==="Enter"){t.preventDefault(),this.paused=!0,this.stop(),this.goTo(i);return}else return;t.preventDefault(),this.paused=!0,this.stop(),this.goTo(i),Array.from(this.querySelectorAll('[data-ref="indicators"] [data-carousel-indicator]'))[i]?.focus()}onRootPointerEnter(t){this.autoplay&&t.pointerType==="mouse"&&this.stop()}onRootPointerLeave(t){this.autoplay&&!this.paused&&t.pointerType==="mouse"&&this.syncAutoplay()}onRootFocusIn(){this.autoplay&&this.stop()}onRootFocusOut(t){let e=t.relatedTarget;e&&this.contains(e)||this.autoplay&&!this.paused&&this.syncAutoplay()}onViewportPointerDown(t){t.button!==0||this.isSwipeExcludedTarget(t.target)||(this.swipePointerId=t.pointerId,this.swipeStartX=t.clientX,this.swipeStartY=t.clientY)}onViewportPointerMove(t){this.swipePointerId,t.pointerId}onViewportPointerUp(t){if(this.swipePointerId!==t.pointerId)return;let e=t.clientX-this.swipeStartX,r=t.clientY-this.swipeStartY;this.swipePointerId=null,!(Math.abs(e)<Bt||Math.abs(e)<=Math.abs(r))&&(e<0?this.next():this.prev())}onViewportPointerCancel(t){this.swipePointerId===t.pointerId&&(this.swipePointerId=null)}render(){let t=this.shouldShowRotationControl(),e=Math.max(this.getSlides().length,this.slideCount),r=this.normalizeIndex(this.index,e||1),i=!this.shouldWrap&&e>0&&r<=0,c=!this.shouldWrap&&e>0&&r>=e-1,u=this.autoplay&&!this.paused,a=u&&this.timer!==null?"off":"polite",s=this.controlsVariant==="overlay";queueMicrotask(()=>{this.sync(),this.syncIndicators(),this.syncRotationControl(),this.syncAriaLive()});let A=d("slot",{name:"prev",children:d("button",{type:"button","data-carousel-action":"prev","data-ref":"prev",class:`rui-carousel__nav rui-button rui-button--outline rui-button--sm${s?" rui-carousel__nav--overlay":" rui-carousel__nav--toolbar"}`,"aria-label":"Previous slide",disabled:i,children:s?d("span",{class:"rui-carousel__nav-icon","aria-hidden":"true",children:"\u2039"}):k("span",{class:"rui-carousel__nav-label",children:[d("span",{class:"rui-carousel__nav-icon","aria-hidden":"true",children:"\u2039"}),"Previous"]})})}),V=d("slot",{name:"next",children:d("button",{type:"button","data-carousel-action":"next","data-ref":"next",class:`rui-carousel__nav rui-button rui-button--outline rui-button--sm${s?" rui-carousel__nav--overlay":" rui-carousel__nav--toolbar"}`,"aria-label":"Next slide",disabled:c,children:s?d("span",{class:"rui-carousel__nav-icon","aria-hidden":"true",children:"\u203A"}):k("span",{class:"rui-carousel__nav-label",children:["Next",d("span",{class:"rui-carousel__nav-icon","aria-hidden":"true",children:"\u203A"})]})})}),M=t?d("slot",{name:"rotation",children:d("button",{type:"button","data-carousel-action":"rotation","data-ref":"rotation",class:`rui-carousel__rotation rui-button rui-button--ghost rui-button--sm${s?" rui-carousel__rotation--overlay":""}`,"aria-pressed":u,"aria-label":u?"Pause rotation":"Start rotation",children:u?"Pause":"Play"})}):null,C=this.showIndicators?d("div",{class:`rui-carousel__indicators${s?" rui-carousel__indicators--overlay":""}`,"data-ref":"indicators",role:"tablist","aria-label":"Choose slide to display"}):null,q=k("div",{class:"rui-carousel__toolbar",children:[t?d("div",{class:"rui-carousel__toolbar-rotation",children:M}):null,d("div",{class:"rui-carousel__toolbar-side rui-carousel__toolbar-side--start",children:A}),d("div",{class:"rui-carousel__toolbar-center",children:C}),d("div",{class:"rui-carousel__toolbar-side rui-carousel__toolbar-side--end",children:V})]}),D=s?k("div",{class:"rui-carousel__overlay-chrome",children:[t?d("div",{class:"rui-carousel__overlay-rotation",children:M}):null,k("div",{class:"rui-carousel__controls rui-carousel__controls--overlay",children:[A,V]}),C]}):null;return k("section",{class:`rui-carousel rui-carousel--${this.transition} rui-carousel--controls-${this.controlsVariant}`,"data-ref":"root","aria-roledescription":"carousel","aria-label":this.$.label,children:[d("div",{class:"rui-carousel__stage",children:k("div",{class:"rui-carousel__viewport","data-ref":"viewport","aria-live":a,"aria-atomic":!1,children:[d("div",{class:"rui-carousel__track",style:this.transition==="slide"?{"--rui-carousel-index":String(this.index)}:void 0,children:d("slot",{})}),D]})}),s?null:d("div",{class:"rui-carousel__footer",children:q})]})}static{ct()}};import{jsx as g,jsxs as qt}from"@ecopages/jsx/jsx-runtime";function $(...o){return o.filter(Boolean).join(" ")}function Dt({id:o,children:t,class:e,...r}){return g("div",{...r,class:$("rui-carousel__slide",e),"data-slide":o,children:t})}function Xt(){return qt("span",{class:"rui-carousel__nav-label",children:[g("span",{class:"rui-carousel__nav-icon","aria-hidden":"true",children:"\u2039"}),"Previous"]})}function Yt(){return qt("span",{class:"rui-carousel__nav-label",children:["Next",g("span",{class:"rui-carousel__nav-icon","aria-hidden":"true",children:"\u203A"})]})}function Kt({children:o,slot:t="prev",class:e,disabled:r,overlay:i,...c}){return g("button",{...c,slot:t,type:"button","data-carousel-action":"prev","data-ref":"prev",class:$("rui-carousel__nav rui-button rui-button--outline rui-button--sm",i?"rui-carousel__nav--overlay":"rui-carousel__nav--toolbar",e),"aria-label":"Previous slide",disabled:r,children:o??(i?g("span",{class:"rui-carousel__nav-icon","aria-hidden":"true",children:"\u2039"}):Xt())})}function Ft({children:o,slot:t="next",class:e,disabled:r,overlay:i,...c}){return g("button",{...c,slot:t,type:"button","data-carousel-action":"next","data-ref":"next",class:$("rui-carousel__nav rui-button rui-button--outline rui-button--sm",i?"rui-carousel__nav--overlay":"rui-carousel__nav--toolbar",e),"aria-label":"Next slide",disabled:r,children:o??(i?g("span",{class:"rui-carousel__nav-icon","aria-hidden":"true",children:"\u203A"}):Yt())})}function Gt({children:o,slot:t="rotation",class:e,overlay:r,...i}){return g("button",{...i,slot:t,type:"button","data-carousel-action":"rotation","data-ref":"rotation",class:$("rui-carousel__rotation rui-button rui-button--ghost rui-button--sm",r&&"rui-carousel__rotation--overlay",e),"aria-pressed":!1,"aria-label":"Start rotation",children:o??"Play"})}function Ht({slides:o,children:t,...e}){if(t!=null)return g("rui-carousel",{...e,children:t});let r=o??[];return g("rui-carousel",{...e,slideCount:r.length,children:r.map(i=>g(Dt,{id:i.id,children:i.children}))})}export{Ht as RuiCarousel,$t as RuiCarouselElement,Ft as RuiCarouselNext,Kt as RuiCarouselPrev,Gt as RuiCarouselRotation,Dt as RuiCarouselSlide};
|
|
1
|
+
import{jsx as d,jsxs as k}from"@ecopages/jsx/jsx-runtime";import{RadiantElement as jt,customElement as Bt,onEvent as b,onUpdated as J,prop as m}from"@ecopages/radiant";var ct,dt,ht,pt,ft,yt,bt,_t,vt,mt,gt,xt,wt,At,It,St,Ct,Rt,Pt,Vt,Et,kt,Mt,Lt;function zt(r,t,e,o,i,u){var n,a,l,A,V,M,C,$=Symbol.metadata||Symbol.for("Symbol.metadata"),q=Object.defineProperty,X=Object.create,Q=[X(null),X(null)],Z=t.length;function N(s,x,_){return function(c,h){x&&(h=c,c=r);for(var w=0;w<s.length;w++)h=s[w].apply(c,_?[h]:[]);return _?h:c}}function R(s,x,_,c){if(typeof s!="function"&&(c||s!==void 0))throw new TypeError(x+" must "+(_||"be")+" a function"+(c?"":" or undefined"));return s}function tt(s,x,_,c,h,w,E,v,I,S,it){function Y(f){if(!it(f))throw new TypeError("Attempted to access private element on non-instance")}var K=[].concat(x[0]),rt=x[3],F=!E,T=h===1,ot=h===3,at=h===4,z=h===2;function W(f,L,lt){return function(U,ut){return L&&(ut=U,U=s),lt&<(U),p[f].call(U,ut)}}if(!F){var p={},G=[],P=ot?"get":at||T?"set":"value";if(I?(S||T?p={get:Tt(function(){return rt(this)},c,"get"),set:function(f){x[4](this,f)}}:p[P]=rt,S||Tt(p[P],c,z?"":P)):S||(p=Object.getOwnPropertyDescriptor(s,c)),!S&&!I){if((a=Q[+v][c])&&(a^h)!==7)throw Error("Decorating two elements with the same name ("+p[P].name+") is not supported yet");Q[+v][c]=h<3?1:h}}for(var y=s,O=K.length-1;O>=0;O-=_?2:1){var nt=R(K[O],"A decorator","be",!0),st=_?K[O-1]:void 0,H={},j={kind:["field","accessor","method","getter","setter","class"][h],name:c,metadata:n,addInitializer:function(f,L){if(f.v)throw new TypeError("attempted to call addInitializer after decoration was finished");R(L,"An initializer","be",!0),w.push(L)}.bind(null,H)};if(F)a=nt.call(st,y,j),H.v=1,R(a,"class decorators","return")&&(y=a);else if(j.static=v,j.private=I,a=j.access={has:I?it.bind():function(f){return c in f}},at||(a.get=I?z?function(f){return Y(f),p.value}:W("get",0,Y):function(f){return f[c]}),z||ot||(a.set=I?W("set",0,Y):function(f,L){f[c]=L}),y=nt.call(st,T?{get:p.get,set:p.set}:p[P],j),H.v=1,T){if(typeof y=="object"&&y)(a=R(y.get,"accessor.get"))&&(p.get=a),(a=R(y.set,"accessor.set"))&&(p.set=a),(a=R(y.init,"accessor.init"))&&G.unshift(a);else if(y!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else R(y,(S?"field":"method")+" decorators","return")&&(S?G.unshift(y):p[P]=y)}return h<2&&E.push(N(G,v,1),N(w,v,0)),S||F||(I?T?E.splice(-1,0,W("get",v),W("set",v)):E.push(z?p[P]:R.call.bind(p[P])):q(s,c,p)),y}function et(s){return q(s,$,{configurable:!0,enumerable:!0,value:n})}return u!==void 0&&(n=u[$]),n=X(n??null),V=[],M=function(s){s&&V.push(N(s))},C=function(s,x){for(var _=0;_<e.length;_++){var c=e[_],h=c[1],w=7&h;if((8&h)==s&&!w==x){var E=c[2],v=!!c[3],I=16&h;tt(s?r:r.prototype,c,I,v?"#"+E:Wt(E),w,w<2?[]:s?A=A||[]:l=l||[],V,!!s,v,x,s&&v?function(S){return Ut(S)===r}:i)}}},C(8,0),C(0,0),C(8,1),C(0,1),M(l),M(A),a=V,Z||et(r),{e:a,get c(){var s=[];return Z&&[et(r=tt(r,[t],o,r.name,5,s)),N(s,1)]}}}function Wt(r){var t=Ot(r,"string");return typeof t=="symbol"?t:t+""}function Ot(r,t){if(typeof r!="object"||!r)return r;var e=r[Symbol.toPrimitive];if(e!==void 0){var o=e.call(r,t||"default");if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(r)}function Tt(r,t,e){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(r,"name",{configurable:!0,value:e?e+" "+t:t})}catch{}return r}function Ut(r){if(Object(r)!==r)throw TypeError("right-hand side of 'in' should be an object, got "+(r!==null?typeof r:"null"));return r}var Xt=48,$t,Dt=class extends jt{static{({e:[ht,pt,ft,yt,bt,_t,vt,mt,gt,xt,wt,At,It,St,Ct,Rt,Pt,Vt,Et,kt,Mt,Lt,ct],c:[$t,dt]}=zt(this,[Bt("rui-carousel")],[[m({type:String,defaultValue:"Carousel"}),0,"label"],[m({type:Number,reflect:!0,defaultValue:0}),0,"index"],[m({type:Boolean,reflect:!0,defaultValue:!1}),0,"autoplay"],[m({type:Number,defaultValue:4e3}),0,"interval"],[m({type:String,defaultValue:"none"}),0,"transition"],[m({type:String,defaultValue:"toolbar",attribute:"controls-variant"}),0,"controlsVariant"],[m({type:Boolean,defaultValue:!1}),0,"showIndicators"],[m({type:Boolean,defaultValue:!1}),0,"showRotationControl"],[m({type:Boolean,defaultValue:!0}),0,"loop"],[m({type:Boolean,defaultValue:!0}),0,"wrap"],[m({type:Number,defaultValue:0}),0,"slideCount"],[J(["index","transition","loop","wrap","controlsVariant"]),2,"onSlideStateUpdated"],[J(["autoplay","showRotationControl","interval"]),2,"onAutoplayUpdated"],[J(["showIndicators"]),2,"onIndicatorsUpdated"],[b({selector:'[data-carousel-action="prev"]',type:"click"}),2,"prev"],[b({selector:'[data-carousel-action="next"]',type:"click"}),2,"next"],[b({selector:'[data-carousel-action="rotation"]',type:"click"}),2,"toggleRotation"],[b({selector:"[data-carousel-indicator]",type:"click"}),2,"onIndicatorClick"],[b({selector:"[data-carousel-indicator]",type:"keydown"}),2,"onIndicatorKeydown"],[b({ref:"root",type:"pointerenter"}),2,"onRootPointerEnter"],[b({ref:"root",type:"pointerleave"}),2,"onRootPointerLeave"],[b({ref:"root",type:"focusin"}),2,"onRootFocusIn"],[b({ref:"root",type:"focusout"}),2,"onRootFocusOut"],[b({ref:"viewport",type:"pointerdown"}),2,"onViewportPointerDown"],[b({ref:"viewport",type:"pointermove"}),2,"onViewportPointerMove"],[b({ref:"viewport",type:"pointerup"}),2,"onViewportPointerUp"],[b({ref:"viewport",type:"pointercancel"}),2,"onViewportPointerCancel"]],0,void 0,jt))}label=(ct(this),ht(this));index=(pt(this),ft(this));autoplay=(yt(this),bt(this));interval=(_t(this),vt(this));transition=(mt(this),gt(this));controlsVariant=(xt(this),wt(this));showIndicators=(At(this),It(this));showRotationControl=(St(this),Ct(this));loop=(Rt(this),Pt(this));wrap=(Vt(this),Et(this));slideCount=(kt(this),Mt(this));timer=(Lt(this),null);paused=!1;userOverrideReducedMotion=!1;swipePointerId=null;swipeStartX=0;swipeStartY=0;connectedCallback(){super.connectedCallback(),queueMicrotask(()=>{this.autoplay&&this.prefersReducedMotion()&&(this.paused=!0),this.sync(),this.syncAutoplay(),this.syncIndicators(),this.syncAriaLive()})}disconnectedCallback(){this.stop(),super.disconnectedCallback()}onSlideStateUpdated(){this.sync(),this.syncIndicators(),this.syncAutoplay()}onAutoplayUpdated(){this.syncAutoplay(),this.syncRotationControl()}onIndicatorsUpdated(){this.syncIndicators()}prefersReducedMotion(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}getCarouselId(){return this.id||"rui-carousel"}slidePanelId(t,e){let o=t.getAttribute("data-slide")??String(e),i=`${this.getCarouselId()}-panel-${o}`;return t.id=i,i}tabId(t){return`${this.getCarouselId()}-tab-${t}`}shouldShowRotationControl(){return this.autoplay||this.showRotationControl}syncSlideAccessibility(t,e){let o=t.length;t.forEach((i,u)=>{let n=u===e,a=`${u+1} of ${o}`;this.showIndicators?(this.slidePanelId(i,u),i.setAttribute("role","tabpanel"),i.setAttribute("aria-labelledby",this.tabId(u)),i.setAttribute("aria-label",a),i.removeAttribute("aria-roledescription")):(i.setAttribute("role","group"),i.setAttribute("aria-roledescription","slide"),i.setAttribute("aria-label",a),i.removeAttribute("aria-labelledby"),i.removeAttribute("tabindex")),this.transition==="none"?i.hidden=!n:i.hidden=!1,i.setAttribute("aria-hidden",String(!n)),i.setAttribute("data-active",n?"true":"false")})}getSlides(){return Array.from(this.querySelectorAll("[data-slide]"))}get shouldWrap(){return this.wrap&&this.loop}normalizeIndex(t,e){return e<=0?0:this.shouldWrap?(t%e+e)%e:Math.min(Math.max(t,0),e-1)}sync(){let t=this.getSlides();if(!t.length)return;let e=this.normalizeIndex(this.index,t.length);e!==this.index&&(this.index=e);let o=this.querySelector(".rui-carousel__track");o&&this.transition==="slide"&&o.style.setProperty("--rui-carousel-index",String(e)),this.syncSlideAccessibility(t,e),this.syncPrevNextDisabled(t.length,e)}syncPrevNextDisabled(t,e){let o=!this.shouldWrap&&t>0&&e<=0,i=!this.shouldWrap&&t>0&&e>=t-1;for(let u of this.querySelectorAll('[data-carousel-action="prev"]'))this.shouldWrap?u.removeAttribute("disabled"):u.disabled=o;for(let u of this.querySelectorAll('[data-carousel-action="next"]'))this.shouldWrap?u.removeAttribute("disabled"):u.disabled=i}syncIndicators(){let t=this.querySelector('[data-ref="indicators"]');if(!t)return;let e=this.getSlides(),o=this.normalizeIndex(this.index,e.length);Array.from(t.querySelectorAll("[data-carousel-indicator]")).length!==e.length&&t.replaceChildren(...e.map((n,a)=>{let l=document.createElement("button");return l.type="button",l.className="rui-carousel__indicator",l.id=this.tabId(a),l.setAttribute("role","tab"),l.setAttribute("data-carousel-indicator",String(a)),l.setAttribute("aria-controls",this.slidePanelId(n,a)),l.setAttribute("aria-label",`Slide ${a+1}`),l})),Array.from(t.querySelectorAll("[data-carousel-indicator]")).forEach((n,a)=>{let l=a===o,A=e[a];A&&(n.id=this.tabId(a),n.setAttribute("aria-controls",this.slidePanelId(A,a))),n.setAttribute("aria-selected",String(l)),n.tabIndex=l?0:-1})}syncRotationControl(){for(let t of this.querySelectorAll('[data-carousel-action="rotation"]')){let e=this.autoplay&&!this.paused;t.setAttribute("aria-pressed",String(e)),t.setAttribute("aria-label",e?"Pause rotation":"Start rotation")}}syncAriaLive(){let t=this.querySelector('[data-ref="viewport"]');if(!t)return;let e=this.autoplay&&!this.paused&&this.timer!==null;t.setAttribute("aria-live",e?"off":"polite"),t.setAttribute("aria-atomic","false")}canAutoplayRotate(){return!(!this.autoplay||this.paused||this.prefersReducedMotion()&&!this.userOverrideReducedMotion)}syncAutoplay(){this.canAutoplayRotate()?this.start():this.stop(),this.syncRotationControl(),this.syncAriaLive()}start(){let t=this.getSlides();if(!t.length)return;if(!this.shouldWrap&&this.index>=t.length-1){this.stop();return}this.stop();let e=Math.max(0,this.interval);this.timer=setInterval(()=>{let o=this.getSlides();if(o.length){if(!this.shouldWrap&&this.index>=o.length-1){this.stop(),this.syncAriaLive();return}this.goTo(this.index+1)}},e),this.syncAriaLive()}stop(){this.timer&&clearInterval(this.timer),this.timer=null,this.syncAriaLive()}goTo(t){let e=this.getSlides();e.length&&(this.index=this.normalizeIndex(t,e.length),this.sync(),this.syncIndicators())}userNavigate(t){this.paused=!0,this.stop(),this.goTo(this.index+t)}isSwipeExcludedTarget(t){return t instanceof Element?!!t.closest("button, a, input, textarea, select, [data-carousel-indicator], [data-carousel-action]"):!1}prev(){this.userNavigate(-1)}next(){this.userNavigate(1)}toggleRotation(){this.autoplay?(this.paused=!this.paused,this.paused||(this.userOverrideReducedMotion=!0)):(this.autoplay=!0,this.paused=!1,this.userOverrideReducedMotion=!0),this.syncAutoplay()}onIndicatorClick(t){let e=t.target.closest("[data-carousel-indicator]");if(!e)return;let o=Number(e.getAttribute("data-carousel-indicator"));Number.isFinite(o)&&(this.paused=!0,this.stop(),this.goTo(o),e.focus())}onIndicatorKeydown(t){let e=this.getSlides();if(!e.length)return;let o=t.target.closest("[data-carousel-indicator]");if(!o)return;let i=Number(o.getAttribute("data-carousel-indicator"));if(!Number.isFinite(i))return;if(t.key==="ArrowRight")i=this.normalizeIndex(i+1,e.length);else if(t.key==="ArrowLeft")i=this.normalizeIndex(i-1,e.length);else if(t.key==="Home")i=0;else if(t.key==="End")i=e.length-1;else if(t.key===" "||t.key==="Enter"){t.preventDefault(),this.paused=!0,this.stop(),this.goTo(i);return}else return;t.preventDefault(),this.paused=!0,this.stop(),this.goTo(i),Array.from(this.querySelectorAll('[data-ref="indicators"] [data-carousel-indicator]'))[i]?.focus()}onRootPointerEnter(t){this.autoplay&&t.pointerType==="mouse"&&this.stop()}onRootPointerLeave(t){this.autoplay&&!this.paused&&t.pointerType==="mouse"&&this.syncAutoplay()}onRootFocusIn(){this.autoplay&&this.stop()}onRootFocusOut(t){let e=t.relatedTarget;e&&this.contains(e)||this.autoplay&&!this.paused&&this.syncAutoplay()}onViewportPointerDown(t){t.button!==0||this.isSwipeExcludedTarget(t.target)||(this.swipePointerId=t.pointerId,this.swipeStartX=t.clientX,this.swipeStartY=t.clientY)}onViewportPointerMove(t){this.swipePointerId,t.pointerId}onViewportPointerUp(t){if(this.swipePointerId!==t.pointerId)return;let e=t.clientX-this.swipeStartX,o=t.clientY-this.swipeStartY;this.swipePointerId=null,!(Math.abs(e)<Xt||Math.abs(e)<=Math.abs(o))&&(e<0?this.next():this.prev())}onViewportPointerCancel(t){this.swipePointerId===t.pointerId&&(this.swipePointerId=null)}render(){let t=this.shouldShowRotationControl(),e=Math.max(this.getSlides().length,this.slideCount),o=this.normalizeIndex(this.index,e||1),i=!this.shouldWrap&&e>0&&o<=0,u=!this.shouldWrap&&e>0&&o>=e-1,n=this.autoplay&&!this.paused,a=n&&this.timer!==null?"off":"polite",l=this.controlsVariant==="overlay";queueMicrotask(()=>{this.sync(),this.syncIndicators(),this.syncRotationControl(),this.syncAriaLive()});let A=d("slot",{name:"prev",children:d("button",{type:"button","data-carousel-action":"prev","data-ref":"prev",class:`rui-carousel__nav rui-button rui-button--outline rui-button--sm${l?" rui-carousel__nav--overlay":" rui-carousel__nav--toolbar"}`,"aria-label":"Previous slide",disabled:i,children:l?d("span",{class:"rui-carousel__nav-icon","aria-hidden":"true",children:"\u2039"}):k("span",{class:"rui-carousel__nav-label",children:[d("span",{class:"rui-carousel__nav-icon","aria-hidden":"true",children:"\u2039"}),"Previous"]})})}),V=d("slot",{name:"next",children:d("button",{type:"button","data-carousel-action":"next","data-ref":"next",class:`rui-carousel__nav rui-button rui-button--outline rui-button--sm${l?" rui-carousel__nav--overlay":" rui-carousel__nav--toolbar"}`,"aria-label":"Next slide",disabled:u,children:l?d("span",{class:"rui-carousel__nav-icon","aria-hidden":"true",children:"\u203A"}):k("span",{class:"rui-carousel__nav-label",children:["Next",d("span",{class:"rui-carousel__nav-icon","aria-hidden":"true",children:"\u203A"})]})})}),M=t?d("slot",{name:"rotation",children:d("button",{type:"button","data-carousel-action":"rotation","data-ref":"rotation",class:`rui-carousel__rotation rui-button rui-button--ghost rui-button--sm${l?" rui-carousel__rotation--overlay":""}`,"aria-pressed":n,"aria-label":n?"Pause rotation":"Start rotation",children:n?"Pause":"Play"})}):null,C=this.showIndicators?d("div",{class:`rui-carousel__indicators${l?" rui-carousel__indicators--overlay":""}`,"data-ref":"indicators",role:"tablist","aria-label":"Choose slide to display"}):null,$=k("div",{class:"rui-carousel__toolbar",children:[t?d("div",{class:"rui-carousel__toolbar-rotation",children:M}):null,d("div",{class:"rui-carousel__toolbar-side rui-carousel__toolbar-side--start",children:A}),d("div",{class:"rui-carousel__toolbar-center",children:C}),d("div",{class:"rui-carousel__toolbar-side rui-carousel__toolbar-side--end",children:V})]}),q=l?k("div",{class:"rui-carousel__overlay-chrome",children:[t?d("div",{class:"rui-carousel__overlay-rotation",children:M}):null,k("div",{class:"rui-carousel__controls rui-carousel__controls--overlay",children:[A,V]}),C]}):null;return k("section",{class:`rui-carousel rui-carousel--${this.transition} rui-carousel--controls-${this.controlsVariant}`,"data-ref":"root","aria-roledescription":"carousel","aria-label":this.$.label,children:[d("div",{class:"rui-carousel__stage",children:k("div",{class:"rui-carousel__viewport","data-ref":"viewport","aria-live":a,"aria-atomic":!1,children:[d("div",{class:"rui-carousel__track",style:this.transition==="slide"?{"--rui-carousel-index":String(this.index)}:void 0,children:d("slot",{})}),q]})}),l?null:d("div",{class:"rui-carousel__footer",children:$})]})}static{dt()}};import{jsx as g,jsxs as qt}from"@ecopages/jsx/jsx-runtime";function B(r,t){return t===void 0||r?.label!==void 0?r:{...r,label:t}}function D(...r){return r.filter(Boolean).join(" ")}function Nt({id:r,children:t,class:e,...o}){return g("div",{...o,class:D("rui-carousel__slide",e),"data-slide":r,children:t})}function Yt(){return qt("span",{class:"rui-carousel__nav-label",children:[g("span",{class:"rui-carousel__nav-icon","aria-hidden":"true",children:"\u2039"}),"Previous"]})}function Kt(){return qt("span",{class:"rui-carousel__nav-label",children:["Next",g("span",{class:"rui-carousel__nav-icon","aria-hidden":"true",children:"\u203A"})]})}function Ft({children:r,slot:t="prev",class:e,disabled:o,overlay:i,aria:u,...n}){return g("button",{...n,aria:B(u,"Previous slide"),slot:t,type:"button","data-carousel-action":"prev","data-ref":"prev",class:D("rui-carousel__nav rui-button rui-button--outline rui-button--sm",i?"rui-carousel__nav--overlay":"rui-carousel__nav--toolbar",e),disabled:o,children:r??(i?g("span",{class:"rui-carousel__nav-icon","aria-hidden":"true",children:"\u2039"}):Yt())})}function Gt({children:r,slot:t="next",class:e,disabled:o,overlay:i,aria:u,...n}){return g("button",{...n,aria:B(u,"Next slide"),slot:t,type:"button","data-carousel-action":"next","data-ref":"next",class:D("rui-carousel__nav rui-button rui-button--outline rui-button--sm",i?"rui-carousel__nav--overlay":"rui-carousel__nav--toolbar",e),disabled:o,children:r??(i?g("span",{class:"rui-carousel__nav-icon","aria-hidden":"true",children:"\u203A"}):Kt())})}function Ht({children:r,slot:t="rotation",class:e,overlay:o,aria:i,...u}){return g("button",{...u,aria:B(i,"Start rotation"),slot:t,type:"button","data-carousel-action":"rotation","data-ref":"rotation",class:D("rui-carousel__rotation rui-button rui-button--ghost rui-button--sm",o&&"rui-carousel__rotation--overlay",e),"aria-pressed":!1,children:r??"Play"})}function Jt({slides:r,children:t,...e}){if(t!=null)return g("rui-carousel",{...e,children:t});let o=r??[];return g("rui-carousel",{...e,slideCount:o.length,children:o.map(i=>g(Nt,{id:i.id,children:i.children}))})}export{Jt as RuiCarousel,$t as RuiCarouselElement,Gt as RuiCarouselNext,Ft as RuiCarouselPrev,Ht as RuiCarouselRotation,Nt as RuiCarouselSlide};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|