@uibot/blocks-base 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/catalog.d.ts +2 -0
- package/dist/components.d.ts +19 -0
- package/dist/focus.d.ts +21 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +77 -0
- package/dist/interact.d.ts +15 -0
- package/dist/tokens.d.ts +15 -0
- package/package.json +41 -4
- package/README.md +0 -3
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { RendererComponentContext } from "@uibot/renderer-react";
|
|
3
|
+
type Props = Record<string, unknown>;
|
|
4
|
+
export declare function Box(props: Props, ctx?: RendererComponentContext): React.ReactElement;
|
|
5
|
+
export declare function Button(props: Props, ctx?: RendererComponentContext): React.ReactElement;
|
|
6
|
+
export declare function TextInput(props: Props, ctx?: RendererComponentContext): React.ReactElement;
|
|
7
|
+
export declare function SearchInput(props: Props, ctx?: RendererComponentContext): React.ReactElement;
|
|
8
|
+
export declare function Select(props: Props, ctx?: RendererComponentContext): React.ReactElement;
|
|
9
|
+
export declare function SegmentedControl(props: Props, ctx?: RendererComponentContext): React.ReactElement;
|
|
10
|
+
export declare function FilterBar(props: Props, ctx?: RendererComponentContext): React.ReactElement;
|
|
11
|
+
export declare function Switch(props: Props, ctx?: RendererComponentContext): React.ReactElement;
|
|
12
|
+
export declare function Drawer(props: Props, ctx?: RendererComponentContext): React.ReactElement | null;
|
|
13
|
+
export declare function Popover(props: Props, ctx?: RendererComponentContext): React.ReactElement | null;
|
|
14
|
+
export declare function SectionHeader(props: Props): React.ReactElement;
|
|
15
|
+
export declare function EmptyState(props: Props, ctx?: RendererComponentContext): React.ReactElement;
|
|
16
|
+
export declare function FactList(props: Props): React.ReactElement;
|
|
17
|
+
export declare function List(props: Props, ctx?: RendererComponentContext): React.ReactElement;
|
|
18
|
+
export declare function ListRow(props: Props, ctx?: RendererComponentContext): React.ReactElement;
|
|
19
|
+
export {};
|
package/dist/focus.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare const DRAWER_MODAL_MAX_WIDTH = 768;
|
|
2
|
+
/** Elements that participate in a modal focus trap. Disabled controls are skipped. */
|
|
3
|
+
export declare const FOCUSABLE_SELECTOR = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), summary, [tabindex]:not([tabindex=\"-1\"])";
|
|
4
|
+
export interface Focusable {
|
|
5
|
+
focus(): void;
|
|
6
|
+
}
|
|
7
|
+
/** Width of the nearest `[data-uibot-ui]` host, else the viewport. */
|
|
8
|
+
export declare function readHostWidth(): number | undefined;
|
|
9
|
+
/** Narrow viewport or container is modal. An explicit `modal` flag wins. */
|
|
10
|
+
export declare function drawerIsModal(input: {
|
|
11
|
+
modal?: boolean;
|
|
12
|
+
viewportWidth?: number;
|
|
13
|
+
containerWidth?: number;
|
|
14
|
+
}): boolean;
|
|
15
|
+
export declare function restoreFocus(previous: Focusable | null): void;
|
|
16
|
+
/** Move focus inside `elements`. Returns true when the key was handled. */
|
|
17
|
+
export declare function handleFocusTrapKey(event: {
|
|
18
|
+
key: string;
|
|
19
|
+
shiftKey: boolean;
|
|
20
|
+
preventDefault(): void;
|
|
21
|
+
}, elements: readonly Focusable[], activeIndex: number): boolean;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { UIBotPlugin } from "@uibot/contracts";
|
|
2
|
+
export { uibotBaseCss, UIBOT_TOKEN_MAP } from "./tokens.js";
|
|
3
|
+
export { handleFocusTrapKey } from "./focus.js";
|
|
4
|
+
export { BASE_CATALOG_ENTRIES } from "./catalog.js";
|
|
5
|
+
export { Box, Button, Drawer, EmptyState, FactList, FilterBar, List, ListRow, Popover, SearchInput, SectionHeader, SegmentedControl, Select, Switch, TextInput, } from "./components.js";
|
|
6
|
+
export declare function createUIBotBlocksBasePlugin(): UIBotPlugin;
|
|
7
|
+
export declare const UIBotBlocksBasePlugin: UIBotPlugin;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
var Vr=Object.create;var{getPrototypeOf:Wr,defineProperty:je,getOwnPropertyNames:Yr}=Object;var Me=Object.prototype.hasOwnProperty;function zr(e){return this[e]}var Kr,Qr,Zr=(e,t,r)=>{var n=e!=null&&typeof e==="object";if(n){var i=t?Kr??=new WeakMap:Qr??=new WeakMap,s=i.get(e);if(s)return s}r=e!=null?Vr(Wr(e)):{};let o=t||!e||!e.__esModule||!Me.call(e,"default")?je(r,"default",{value:e,enumerable:!0}):r;if(e&&typeof e==="object"||typeof e==="function"){for(let l of Yr(e))if(!Me.call(o,l))je(o,l,{get:zr.bind(e,l),enumerable:!0})}if(n)i.set(e,o);return o};var h=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var q=h(function(Eo,Xe){var Jr=Number.MAX_SAFE_INTEGER||9007199254740991,en=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Xe.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Jr,RELEASE_TYPES:en,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var D=h(function(bo,He){var tn=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};He.exports=tn});var k=h(function(T,Ve){var{MAX_SAFE_COMPONENT_LENGTH:oe,MAX_SAFE_BUILD_LENGTH:rn,MAX_LENGTH:nn}=q(),sn=D();T=Ve.exports={};var on=T.re=[],an=T.safeRe=[],a=T.src=[],cn=T.safeSrc=[],c=T.t={},ln=0,ae="[a-zA-Z0-9-]",un=[["\\s",1],["\\d",nn],[ae,rn]],pn=(e)=>{for(let[t,r]of un)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},m=(e,t,r)=>{let n=pn(t),i=ln++;sn(e,i,t),c[e]=i,a[i]=t,cn[i]=n,on[i]=new RegExp(t,r?"g":void 0),an[i]=new RegExp(n,r?"g":void 0)};m("NUMERICIDENTIFIER","0|[1-9]\\d*");m("NUMERICIDENTIFIERLOOSE","\\d+");m("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${ae}*`);m("MAINVERSION",`(${a[c.NUMERICIDENTIFIER]})\\.(${a[c.NUMERICIDENTIFIER]})\\.(${a[c.NUMERICIDENTIFIER]})`);m("MAINVERSIONLOOSE",`(${a[c.NUMERICIDENTIFIERLOOSE]})\\.(${a[c.NUMERICIDENTIFIERLOOSE]})\\.(${a[c.NUMERICIDENTIFIERLOOSE]})`);m("PRERELEASEIDENTIFIER",`(?:${a[c.NONNUMERICIDENTIFIER]}|${a[c.NUMERICIDENTIFIER]})`);m("PRERELEASEIDENTIFIERLOOSE",`(?:${a[c.NONNUMERICIDENTIFIER]}|${a[c.NUMERICIDENTIFIERLOOSE]})`);m("PRERELEASE",`(?:-(${a[c.PRERELEASEIDENTIFIER]}(?:\\.${a[c.PRERELEASEIDENTIFIER]})*))`);m("PRERELEASELOOSE",`(?:-?(${a[c.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${a[c.PRERELEASEIDENTIFIERLOOSE]})*))`);m("BUILDIDENTIFIER",`${ae}+`);m("BUILD",`(?:\\+(${a[c.BUILDIDENTIFIER]}(?:\\.${a[c.BUILDIDENTIFIER]})*))`);m("FULLPLAIN",`v?${a[c.MAINVERSION]}${a[c.PRERELEASE]}?${a[c.BUILD]}?`);m("FULL",`^${a[c.FULLPLAIN]}$`);m("LOOSEPLAIN",`[v=\\s]*${a[c.MAINVERSIONLOOSE]}${a[c.PRERELEASELOOSE]}?${a[c.BUILD]}?`);m("LOOSE",`^${a[c.LOOSEPLAIN]}$`);m("GTLT","((?:<|>)?=?)");m("XRANGEIDENTIFIERLOOSE",`${a[c.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);m("XRANGEIDENTIFIER",`${a[c.NUMERICIDENTIFIER]}|x|X|\\*`);m("XRANGEPLAIN",`[v=\\s]*(${a[c.XRANGEIDENTIFIER]})(?:\\.(${a[c.XRANGEIDENTIFIER]})(?:\\.(${a[c.XRANGEIDENTIFIER]})(?:${a[c.PRERELEASE]})?${a[c.BUILD]}?)?)?`);m("XRANGEPLAINLOOSE",`[v=\\s]*(${a[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[c.XRANGEIDENTIFIERLOOSE]})(?:${a[c.PRERELEASELOOSE]})?${a[c.BUILD]}?)?)?`);m("XRANGE",`^${a[c.GTLT]}\\s*${a[c.XRANGEPLAIN]}$`);m("XRANGELOOSE",`^${a[c.GTLT]}\\s*${a[c.XRANGEPLAINLOOSE]}$`);m("COERCEPLAIN",`(^|[^\\d])(\\d{1,${oe}})(?:\\.(\\d{1,${oe}}))?(?:\\.(\\d{1,${oe}}))?`);m("COERCE",`${a[c.COERCEPLAIN]}(?:$|[^\\d])`);m("COERCEFULL",a[c.COERCEPLAIN]+`(?:${a[c.PRERELEASE]})?(?:${a[c.BUILD]})?(?:$|[^\\d])`);m("COERCERTL",a[c.COERCE],!0);m("COERCERTLFULL",a[c.COERCEFULL],!0);m("LONETILDE","(?:~>?)");m("TILDETRIM",`(\\s*)${a[c.LONETILDE]}\\s+`,!0);T.tildeTrimReplace="$1~";m("TILDE",`^${a[c.LONETILDE]}${a[c.XRANGEPLAIN]}$`);m("TILDELOOSE",`^${a[c.LONETILDE]}${a[c.XRANGEPLAINLOOSE]}$`);m("LONECARET","(?:\\^)");m("CARETTRIM",`(\\s*)${a[c.LONECARET]}\\s+`,!0);T.caretTrimReplace="$1^";m("CARET",`^${a[c.LONECARET]}${a[c.XRANGEPLAIN]}$`);m("CARETLOOSE",`^${a[c.LONECARET]}${a[c.XRANGEPLAINLOOSE]}$`);m("COMPARATORLOOSE",`^${a[c.GTLT]}\\s*(${a[c.LOOSEPLAIN]})$|^$`);m("COMPARATOR",`^${a[c.GTLT]}\\s*(${a[c.FULLPLAIN]})$|^$`);m("COMPARATORTRIM",`(\\s*)${a[c.GTLT]}\\s*(${a[c.LOOSEPLAIN]}|${a[c.XRANGEPLAIN]})`,!0);T.comparatorTrimReplace="$1$2$3";m("HYPHENRANGE",`^\\s*(${a[c.XRANGEPLAIN]})\\s+-\\s+(${a[c.XRANGEPLAIN]})\\s*$`);m("HYPHENRANGELOOSE",`^\\s*(${a[c.XRANGEPLAINLOOSE]})\\s+-\\s+(${a[c.XRANGEPLAINLOOSE]})\\s*$`);m("STAR","(<|>)?=?\\s*\\*");m("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");m("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var X=h(function(go,We){var dn=Object.freeze({loose:!0}),fn=Object.freeze({}),hn=(e)=>{if(!e)return fn;if(typeof e!=="object")return dn;return e};We.exports=hn});var ce=h(function(Ro,Ke){var Ye=/^[0-9]+$/,ze=(e,t)=>{if(typeof e==="number"&&typeof t==="number")return e===t?0:e<t?-1:1;let r=Ye.test(e),n=Ye.test(t);if(r&&n)e=+e,t=+t;return e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},mn=(e,t)=>ze(t,e);Ke.exports={compareIdentifiers:ze,rcompareIdentifiers:mn}});var v=h(function(yo,Ze){var H=D(),{MAX_LENGTH:Qe,MAX_SAFE_INTEGER:V}=q(),{safeRe:W,t:Y}=k(),En=X(),{compareIdentifiers:le}=ce(),bn=(e,t)=>{let r=t.split(".");if(r.length>e.length)return!1;for(let n=0;n<r.length;n++)if(le(e[n],r[n])!==0)return!1;return!0};class N{constructor(e,t){if(t=En(t),e instanceof N)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else e=e.version;else if(typeof e!=="string")throw TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>Qe)throw TypeError(`version is longer than ${Qe} characters`);H("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?W[Y.LOOSE]:W[Y.FULL]);if(!r)throw TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>V||this.major<0)throw TypeError("Invalid major version");if(this.minor>V||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>V||this.patch<0)throw TypeError("Invalid patch version");if(!r[4])this.prerelease=[];else this.prerelease=r[4].split(".").map((n)=>{if(/^[0-9]+$/.test(n)){let i=+n;if(i>=0&&i<V)return i}return n});this.build=r[5]?r[5].split("."):[],this.format()}format(){if(this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length)this.version+=`-${this.prerelease.join(".")}`;return this.version}toString(){return this.version}compare(e){if(H("SemVer.compare",this.version,this.options,e),!(e instanceof N)){if(typeof e==="string"&&e===this.version)return 0;e=new N(e,this.options)}if(e.version===this.version)return 0;return this.compareMain(e)||this.comparePre(e)}compareMain(e){if(!(e instanceof N))e=new N(e,this.options);if(this.major<e.major)return-1;if(this.major>e.major)return 1;if(this.minor<e.minor)return-1;if(this.minor>e.minor)return 1;if(this.patch<e.patch)return-1;if(this.patch>e.patch)return 1;return 0}comparePre(e){if(!(e instanceof N))e=new N(e,this.options);if(this.prerelease.length&&!e.prerelease.length)return-1;else if(!this.prerelease.length&&e.prerelease.length)return 1;else if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],n=e.prerelease[t];if(H("prerelease compare",t,r,n),r===void 0&&n===void 0)return 0;else if(n===void 0)return 1;else if(r===void 0)return-1;else if(r===n)continue;else return le(r,n)}while(++t)}compareBuild(e){if(!(e instanceof N))e=new N(e,this.options);let t=0;do{let r=this.build[t],n=e.build[t];if(H("build compare",t,r,n),r===void 0&&n===void 0)return 0;else if(n===void 0)return 1;else if(r===void 0)return-1;else if(r===n)continue;else return le(r,n)}while(++t)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&r===!1)throw Error("invalid increment argument: identifier is empty");if(t){let n=`-${t}`.match(this.options.loose?W[Y.PRERELEASELOOSE]:W[Y.PRERELEASE]);if(!n||n[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",t,r);this.inc("pre",t,r);break;case"release":if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0,this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":{let n=Number(r)?1:0;if(this.prerelease.length===0)this.prerelease=[n];else{let i=this.prerelease.length;while(--i>=0)if(typeof this.prerelease[i]==="number")this.prerelease[i]++,i=-2;if(i===-1){if(t===this.prerelease.join(".")&&r===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(n)}}if(t){let i=[t,n];if(r===!1)i=[t];if(bn(this.prerelease,t)){let s=this.prerelease[t.split(".").length];if(isNaN(s))this.prerelease=i}else this.prerelease=i}break}default:throw Error(`invalid increment argument: ${e}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}Ze.exports=N});var A=h(function($o,et){var Je=v(),gn=(e,t,r=!1)=>{if(e instanceof Je)return e;try{return new Je(e,t)}catch(n){if(!r)return null;throw n}};et.exports=gn});var rt=h(function(Io,tt){var Rn=A(),yn=(e,t)=>{let r=Rn(e,t);return r?r.version:null};tt.exports=yn});var it=h(function(vo,nt){var $n=A(),In=(e,t)=>{let r=$n(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};nt.exports=In});var at=h(function(So,ot){var st=v(),vn=(e,t,r,n,i)=>{if(typeof r==="string")i=n,n=r,r=void 0;try{return new st(e instanceof st?e.version:e,r).inc(t,n,i).version}catch(s){return null}};ot.exports=vn});var ut=h(function(Lo,lt){var ct=A(),Sn=(e,t)=>{let r=ct(e,null,!0),n=ct(t,null,!0),i=r.compare(n);if(i===0)return null;let s=i>0,o=s?r:n,l=s?n:r,p=!!o.prerelease.length;if(!!l.prerelease.length&&!p){if(!l.patch&&!l.minor)return"major";if(l.compareMain(o)===0){if(l.minor&&!l.patch)return"minor";return"patch"}}let d=p?"pre":"";if(r.major!==n.major)return d+"major";if(r.minor!==n.minor)return d+"minor";if(r.patch!==n.patch)return d+"patch";return"prerelease"};lt.exports=Sn});var dt=h(function(Co,pt){var Ln=v(),Cn=(e,t)=>new Ln(e,t).major;pt.exports=Cn});var ht=h(function(xo,ft){var xn=v(),wn=(e,t)=>new xn(e,t).minor;ft.exports=wn});var Et=h(function(wo,mt){var Nn=v(),Tn=(e,t)=>new Nn(e,t).patch;mt.exports=Tn});var gt=h(function(No,bt){var An=A(),On=(e,t)=>{let r=An(e,t);return r&&r.prerelease.length?r.prerelease:null};bt.exports=On});var x=h(function(To,yt){var Rt=v(),Pn=(e,t,r)=>new Rt(e,r).compare(new Rt(t,r));yt.exports=Pn});var It=h(function(Ao,$t){var qn=x(),kn=(e,t,r)=>qn(t,e,r);$t.exports=kn});var St=h(function(Oo,vt){var Dn=x(),Fn=(e,t)=>Dn(e,t,!0);vt.exports=Fn});var z=h(function(Po,Ct){var Lt=v(),_n=(e,t,r)=>{let n=new Lt(e,r),i=new Lt(t,r);return n.compare(i)||n.compareBuild(i)};Ct.exports=_n});var wt=h(function(qo,xt){var Gn=z(),Un=(e,t)=>e.sort((r,n)=>Gn(r,n,t));xt.exports=Un});var Tt=h(function(ko,Nt){var Bn=z(),jn=(e,t)=>e.sort((r,n)=>Bn(n,r,t));Nt.exports=jn});var F=h(function(Do,At){var Mn=x(),Xn=(e,t,r)=>Mn(e,t,r)>0;At.exports=Xn});var K=h(function(Fo,Ot){var Hn=x(),Vn=(e,t,r)=>Hn(e,t,r)<0;Ot.exports=Vn});var ue=h(function(_o,Pt){var Wn=x(),Yn=(e,t,r)=>Wn(e,t,r)===0;Pt.exports=Yn});var pe=h(function(Go,qt){var zn=x(),Kn=(e,t,r)=>zn(e,t,r)!==0;qt.exports=Kn});var Q=h(function(Uo,kt){var Qn=x(),Zn=(e,t,r)=>Qn(e,t,r)>=0;kt.exports=Zn});var Z=h(function(Bo,Dt){var Jn=x(),ei=(e,t,r)=>Jn(e,t,r)<=0;Dt.exports=ei});var de=h(function(jo,Ft){var ti=ue(),ri=pe(),ni=F(),ii=Q(),si=K(),oi=Z(),ai=(e,t,r,n)=>{switch(t){case"===":if(typeof e==="object")e=e.version;if(typeof r==="object")r=r.version;return e===r;case"!==":if(typeof e==="object")e=e.version;if(typeof r==="object")r=r.version;return e!==r;case"":case"=":case"==":return ti(e,r,n);case"!=":return ri(e,r,n);case">":return ni(e,r,n);case">=":return ii(e,r,n);case"<":return si(e,r,n);case"<=":return oi(e,r,n);default:throw TypeError(`Invalid operator: ${t}`)}};Ft.exports=ai});var Gt=h(function(Mo,_t){var ci=v(),li=A(),{safeRe:J,t:ee}=k(),ui=(e,t)=>{if(e instanceof ci)return e;if(typeof e==="number")e=String(e);if(typeof e!=="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?J[ee.COERCEFULL]:J[ee.COERCE]);else{let p=t.includePrerelease?J[ee.COERCERTLFULL]:J[ee.COERCERTL],u;while((u=p.exec(e))&&(!r||r.index+r[0].length!==e.length)){if(!r||u.index+u[0].length!==r.index+r[0].length)r=u;p.lastIndex=u.index+u[1].length+u[2].length}p.lastIndex=-1}if(r===null)return null;let n=r[2],i=r[3]||"0",s=r[4]||"0",o=t.includePrerelease&&r[5]?`-${r[5]}`:"",l=t.includePrerelease&&r[6]?`+${r[6]}`:"";return li(`${n}.${i}.${s}${o}${l}`,t)};_t.exports=ui});var Bt=h(function(Xo,Ut){var pi=A(),di=q(),fi=v(),hi=(e,t,r)=>{if(!di.RELEASE_TYPES.includes(t))return null;let n=mi(e,r);return n&&Ei(n,t)},mi=(e,t)=>{let r=e instanceof fi?e.version:e;return pi(r,t)},Ei=(e,t)=>{if(bi(t))return e.version;switch(e.prerelease=[],t){case"major":e.minor=0,e.patch=0;break;case"minor":e.patch=0;break}return e.format()},bi=(e)=>e.startsWith("pre");Ut.exports=hi});var Xt=h(function(Ho,Mt){class jt{constructor(){this.max=1000,this.map=new Map}get(e){let t=this.map.get(e);if(t===void 0)return;else return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let n=this.map.keys().next().value;this.delete(n)}this.map.set(e,t)}return this}}Mt.exports=jt});var w=h(function(Vo,Yt){var gi=/\s+/g;class _{constructor(e,t){if(t=yi(t),e instanceof _)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else return new _(e.raw,t);if(e instanceof fe)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(gi," "),this.set=this.raw.split("||").map((r)=>this.parseRange(r.trim())).filter((r)=>r.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let r=this.set[0];if(this.set=this.set.filter((n)=>!Vt(n[0])),this.set.length===0)this.set=[r];else if(this.set.length>1){for(let n of this.set)if(n.length===1&&Ni(n[0])){this.set=[n];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){if(e>0)this.formatted+="||";let t=this.set[e];for(let r=0;r<t.length;r++){if(r>0)this.formatted+=" ";this.formatted+=t[r].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(wi,"");let r=((this.options.includePrerelease&&Ci)|(this.options.loose&&xi))+":"+e,n=Ht.get(r);if(n)return n;let i=this.options.loose,s=i?L[S.HYPHENRANGELOOSE]:L[S.HYPHENRANGE];e=e.replace(s,Ui(this.options.includePrerelease)),R("hyphen replace",e),e=e.replace(L[S.COMPARATORTRIM],vi),R("comparator trim",e),e=e.replace(L[S.TILDETRIM],Si),R("tilde trim",e),e=e.replace(L[S.CARETTRIM],Li),R("caret trim",e);let o=e.split(" ").map((d)=>Ti(d,this.options)).join(" ").split(/\s+/).map((d)=>Gi(d,this.options));if(i)o=o.filter((d)=>(R("loose invalid filter",d,this.options),!!d.match(L[S.COMPARATORLOOSE])));R("range list",o);let l=new Map,p=o.map((d)=>new fe(d,this.options));for(let d of p){if(Vt(d))return[d];l.set(d.value,d)}if(l.size>1&&l.has(""))l.delete("");let u=[...l.values()];return Ht.set(r,u),u}intersects(e,t){if(!(e instanceof _))throw TypeError("a Range is required");return this.set.some((r)=>Wt(r,t)&&e.set.some((n)=>Wt(n,t)&&r.every((i)=>n.every((s)=>i.intersects(s,t)))))}test(e){if(!e)return!1;if(typeof e==="string")try{e=new $i(e,this.options)}catch(t){return!1}for(let t=0;t<this.set.length;t++)if(Bi(this.set[t],e,this.options))return!0;return!1}}Yt.exports=_;var Ri=Xt(),Ht=new Ri,yi=X(),fe=G(),R=D(),$i=v(),{safeRe:L,src:Ii,t:S,comparatorTrimReplace:vi,tildeTrimReplace:Si,caretTrimReplace:Li}=k(),{FLAG_INCLUDE_PRERELEASE:Ci,FLAG_LOOSE:xi}=q(),wi=new RegExp(Ii[S.BUILD],"g"),Vt=(e)=>e.value==="<0.0.0-0",Ni=(e)=>e.value==="",Wt=(e,t)=>{let r=!0,n=e.slice(),i=n.pop();while(r&&n.length)r=n.every((s)=>i.intersects(s,t)),i=n.pop();return r},Ti=(e,t)=>(e=e.replace(L[S.BUILD],""),R("comp",e,t),e=qi(e,t),R("caret",e),e=Oi(e,t),R("tildes",e),e=Di(e,t),R("xrange",e),e=_i(e,t),R("stars",e),e),I=(e)=>!e||e.toLowerCase()==="x"||e==="*",Ai=(e,t,r)=>I(e)&&!I(t)||I(t)&&r&&!I(r),Oi=(e,t)=>e.trim().split(/\s+/).map((r)=>Pi(r,t)).join(" "),Pi=(e,t)=>{let r=t.loose?L[S.TILDELOOSE]:L[S.TILDE],n=t.includePrerelease?"-0":"";return e.replace(r,(i,s,o,l,p)=>{R("tilde",e,i,s,o,l,p);let u;if(I(s))u="";else if(I(o))u=`>=${s}.0.0${n} <${+s+1}.0.0-0`;else if(I(l))u=`>=${s}.${o}.0${n} <${s}.${+o+1}.0-0`;else if(p)R("replaceTilde pr",p),u=`>=${s}.${o}.${l}-${p} <${s}.${+o+1}.0-0`;else u=`>=${s}.${o}.${l} <${s}.${+o+1}.0-0`;return R("tilde return",u),u})},qi=(e,t)=>e.trim().split(/\s+/).map((r)=>ki(r,t)).join(" "),ki=(e,t)=>{R("caret",e,t);let r=t.loose?L[S.CARETLOOSE]:L[S.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(i,s,o,l,p)=>{R("caret",e,i,s,o,l,p);let u;if(I(s))u="";else if(I(o))u=`>=${s}.0.0${n} <${+s+1}.0.0-0`;else if(I(l))if(s==="0")u=`>=${s}.${o}.0${n} <${s}.${+o+1}.0-0`;else u=`>=${s}.${o}.0${n} <${+s+1}.0.0-0`;else if(p)if(R("replaceCaret pr",p),s==="0")if(o==="0")u=`>=${s}.${o}.${l}-${p} <${s}.${o}.${+l+1}-0`;else u=`>=${s}.${o}.${l}-${p} <${s}.${+o+1}.0-0`;else u=`>=${s}.${o}.${l}-${p} <${+s+1}.0.0-0`;else if(R("no pr"),s==="0")if(o==="0")u=`>=${s}.${o}.${l} <${s}.${o}.${+l+1}-0`;else u=`>=${s}.${o}.${l} <${s}.${+o+1}.0-0`;else u=`>=${s}.${o}.${l} <${+s+1}.0.0-0`;return R("caret return",u),u})},Di=(e,t)=>(R("replaceXRanges",e,t),e.split(/\s+/).map((r)=>Fi(r,t)).join(" ")),Fi=(e,t)=>{e=e.trim();let r=t.loose?L[S.XRANGELOOSE]:L[S.XRANGE];return e.replace(r,(n,i,s,o,l,p)=>{if(R("xRange",e,n,i,s,o,l,p),Ai(s,o,l))return e;let u=I(s),d=u||I(o),b=d||I(l),y=b;if(i==="="&&y)i="";if(p=t.includePrerelease?"-0":"",u)if(i===">"||i==="<")n="<0.0.0-0";else n="*";else if(i&&y){if(d)o=0;if(l=0,i===">")if(i=">=",d)s=+s+1,o=0,l=0;else o=+o+1,l=0;else if(i==="<=")if(i="<",d)s=+s+1;else o=+o+1;if(i==="<")p="-0";n=`${i+s}.${o}.${l}${p}`}else if(d)n=`>=${s}.0.0${p} <${+s+1}.0.0-0`;else if(b)n=`>=${s}.${o}.0${p} <${s}.${+o+1}.0-0`;return R("xRange return",n),n})},_i=(e,t)=>(R("replaceStars",e,t),e.trim().replace(L[S.STAR],"")),Gi=(e,t)=>(R("replaceGTE0",e,t),e.trim().replace(L[t.includePrerelease?S.GTE0PRE:S.GTE0],"")),Ui=(e)=>(t,r,n,i,s,o,l,p,u,d,b,y)=>{if(I(n))r="";else if(I(i))r=`>=${n}.0.0${e?"-0":""}`;else if(I(s))r=`>=${n}.${i}.0${e?"-0":""}`;else if(o)r=`>=${r}`;else r=`>=${r}${e?"-0":""}`;if(I(u))p="";else if(I(d))p=`<${+u+1}.0.0-0`;else if(I(b))p=`<${u}.${+d+1}.0-0`;else if(y)p=`<=${u}.${d}.${b}-${y}`;else if(e)p=`<${u}.${d}.${+b+1}-0`;else p=`<=${p}`;return`${r} ${p}`.trim()},Bi=(e,t,r)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let n=0;n<e.length;n++){if(R(e[n].semver),e[n].semver===fe.ANY)continue;if(e[n].semver.prerelease.length>0){let i=e[n].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}}return!1}return!0}});var G=h(function(Wo,er){var U=Symbol("SemVer ANY");class te{static get ANY(){return U}constructor(e,t){if(t=zt(t),e instanceof te)if(e.loose===!!t.loose)return e;else e=e.value;if(e=e.trim().split(/\s+/).join(" "),me("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===U)this.value="";else this.value=this.operator+this.semver.version;me("comp",this)}parse(e){let t=this.options.loose?Kt[Qt.COMPARATORLOOSE]:Kt[Qt.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);if(this.operator=r[1]!==void 0?r[1]:"",this.operator==="=")this.operator="";if(!r[2])this.semver=U;else this.semver=new Zt(r[2],this.options.loose)}toString(){return this.value}test(e){if(me("Comparator.test",e,this.options.loose),this.semver===U||e===U)return!0;if(typeof e==="string")try{e=new Zt(e,this.options)}catch(t){return!1}return he(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof te))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new Jt(e.value,t).test(this.value)}else if(e.operator===""){if(e.value==="")return!0;return new Jt(this.value,t).test(e.semver)}if(t=zt(t),t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0"))return!1;if(!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))return!1;if(this.operator.startsWith(">")&&e.operator.startsWith(">"))return!0;if(this.operator.startsWith("<")&&e.operator.startsWith("<"))return!0;if(this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("="))return!0;if(he(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))return!0;if(he(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">"))return!0;return!1}}er.exports=te;var zt=X(),{safeRe:Kt,t:Qt}=k(),he=de(),me=D(),Zt=v(),Jt=w()});var B=h(function(Yo,tr){var ji=w(),Mi=(e,t,r)=>{try{t=new ji(t,r)}catch(n){return!1}return t.test(e)};tr.exports=Mi});var nr=h(function(zo,rr){var Xi=w(),Hi=(e,t)=>new Xi(e,t).set.map((r)=>r.map((n)=>n.value).join(" ").trim().split(" "));rr.exports=Hi});var sr=h(function(Ko,ir){var Vi=v(),Wi=w(),Yi=(e,t,r)=>{let n=null,i=null,s=null;try{s=new Wi(t,r)}catch(o){return null}return e.forEach((o)=>{if(s.test(o)){if(!n||i.compare(o)===-1)n=o,i=new Vi(n,r)}}),n};ir.exports=Yi});var ar=h(function(Qo,or){var zi=v(),Ki=w(),Qi=(e,t,r)=>{let n=null,i=null,s=null;try{s=new Ki(t,r)}catch(o){return null}return e.forEach((o)=>{if(s.test(o)){if(!n||i.compare(o)===1)n=o,i=new zi(n,r)}}),n};or.exports=Qi});var ur=h(function(Zo,lr){var Ee=v(),Zi=w(),cr=F(),Ji=(e,t)=>{e=new Zi(e,t);let r=new Ee("0.0.0");if(e.test(r))return r;if(r=new Ee("0.0.0-0"),e.test(r))return r;r=null;for(let n=0;n<e.set.length;++n){let i=e.set[n],s=null;if(i.forEach((o)=>{let l=new Ee(o.semver.version);switch(o.operator){case">":if(l.prerelease.length===0)l.patch++;else l.prerelease.push(0);l.raw=l.format();case"":case">=":if(!s||cr(l,s))s=l;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${o.operator}`)}}),s&&(!r||cr(r,s)))r=s}if(r&&e.test(r))return r;return null};lr.exports=Ji});var dr=h(function(Jo,pr){var es=w(),ts=(e,t)=>{try{return new es(e,t).range||"*"}catch(r){return null}};pr.exports=ts});var re=h(function(ea,Er){var rs=v(),mr=G(),{ANY:ns}=mr,is=w(),ss=B(),fr=F(),hr=K(),os=Z(),as=Q(),cs=(e,t,r,n)=>{e=new rs(e,n),t=new is(t,n);let i,s,o,l,p;switch(r){case">":i=fr,s=os,o=hr,l=">",p=">=";break;case"<":i=hr,s=as,o=fr,l="<",p="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(ss(e,t,n))return!1;for(let u=0;u<t.set.length;++u){let d=t.set[u],b=null,y=null;if(d.forEach((f)=>{if(f.semver===ns)f=new mr(">=0.0.0");if(b=b||f,y=y||f,i(f.semver,b.semver,n))b=f;else if(o(f.semver,y.semver,n))y=f}),b.operator===l||b.operator===p)return!1;if((!y.operator||y.operator===l)&&s(e,y.semver))return!1;else if(y.operator===p&&o(e,y.semver))return!1}return!0};Er.exports=cs});var gr=h(function(ta,br){var ls=re(),us=(e,t,r)=>ls(e,t,">",r);br.exports=us});var yr=h(function(ra,Rr){var ps=re(),ds=(e,t,r)=>ps(e,t,"<",r);Rr.exports=ds});var vr=h(function(na,Ir){var $r=w(),fs=(e,t,r)=>(e=new $r(e,r),t=new $r(t,r),e.intersects(t,r));Ir.exports=fs});var Lr=h(function(ia,Sr){var hs=B(),ms=x();Sr.exports=(e,t,r)=>{let n=[],i=null,s=null,o=e.sort((d,b)=>ms(d,b,r));for(let d of o)if(hs(d,t,r)){if(s=d,!i)i=d}else{if(s)n.push([i,s]);s=null,i=null}if(i)n.push([i,null]);let l=[];for(let[d,b]of n)if(d===b)l.push(d);else if(!b&&d===o[0])l.push("*");else if(!b)l.push(`>=${d}`);else if(d===o[0])l.push(`<=${b}`);else l.push(`${d} - ${b}`);let p=l.join(" || "),u=typeof t.raw==="string"?t.raw:String(t);return p.length<u.length?p:t}});var Ar=h(function(sa,Tr){var Cr=w(),Re=G(),{ANY:be}=Re,ge=B(),ye=x(),Es=(e,t,r={})=>{if(e===t)return!0;e=new Cr(e,r),t=new Cr(t,r);let n=!1;e:for(let i of e.set){for(let s of t.set){let o=gs(i,s,r);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},bs=[new Re(">=0.0.0-0")],xr=[new Re(">=0.0.0")],gs=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===be)if(t.length===1&&t[0].semver===be)return!0;else if(r.includePrerelease)e=bs;else e=xr;if(t.length===1&&t[0].semver===be)if(r.includePrerelease)return!0;else t=xr;let n=new Set,i,s;for(let f of e)if(f.operator===">"||f.operator===">=")i=wr(i,f,r);else if(f.operator==="<"||f.operator==="<=")s=Nr(s,f,r);else n.add(f.semver);if(n.size>1)return null;let o;if(i&&s){if(o=ye(i.semver,s.semver,r),o>0)return null;else if(o===0&&(i.operator!==">="||s.operator!=="<="))return null}for(let f of n){if(i&&!ge(f,String(i),r))return null;if(s&&!ge(f,String(s),r))return null;for(let Hr of t)if(!ge(f,String(Hr),r))return!1;return!0}let l,p,u,d,b=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,y=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;if(b&&b.prerelease.length===1&&s.operator==="<"&&b.prerelease[0]===0)b=!1;for(let f of t){if(d=d||f.operator===">"||f.operator===">=",u=u||f.operator==="<"||f.operator==="<=",i){if(y){if(f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===y.major&&f.semver.minor===y.minor&&f.semver.patch===y.patch)y=!1}if(f.operator===">"||f.operator===">="){if(l=wr(i,f,r),l===f&&l!==i)return!1}else if(i.operator===">="&&!f.test(i.semver))return!1}if(s){if(b){if(f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===b.major&&f.semver.minor===b.minor&&f.semver.patch===b.patch)b=!1}if(f.operator==="<"||f.operator==="<="){if(p=Nr(s,f,r),p===f&&p!==s)return!1}else if(s.operator==="<="&&!f.test(s.semver))return!1}if(!f.operator&&(s||i)&&o!==0)return!1}if(i&&u&&!s&&o!==0)return!1;if(s&&d&&!i&&o!==0)return!1;if(y||b)return!1;return!0},wr=(e,t,r)=>{if(!e)return t;let n=ye(e.semver,t.semver,r);return n>0?e:n<0?t:t.operator===">"&&e.operator===">="?t:e},Nr=(e,t,r)=>{if(!e)return t;let n=ye(e.semver,t.semver,r);return n<0?e:n>0?t:t.operator==="<"&&e.operator==="<="?t:e};Tr.exports=Es});var kr=h(function(oa,qr){var $e=k(),Or=q(),Rs=v(),Pr=ce(),ys=A(),$s=rt(),Is=it(),vs=at(),Ss=ut(),Ls=dt(),Cs=ht(),xs=Et(),ws=gt(),Ns=x(),Ts=It(),As=St(),Os=z(),Ps=wt(),qs=Tt(),ks=F(),Ds=K(),Fs=ue(),_s=pe(),Gs=Q(),Us=Z(),Bs=de(),js=Gt(),Ms=Bt(),Xs=G(),Hs=w(),Vs=B(),Ws=nr(),Ys=sr(),zs=ar(),Ks=ur(),Qs=dr(),Zs=re(),Js=gr(),eo=yr(),to=vr(),ro=Lr(),no=Ar();qr.exports={parse:ys,valid:$s,clean:Is,inc:vs,diff:Ss,major:Ls,minor:Cs,patch:xs,prerelease:ws,compare:Ns,rcompare:Ts,compareLoose:As,compareBuild:Os,sort:Ps,rsort:qs,gt:ks,lt:Ds,eq:Fs,neq:_s,gte:Gs,lte:Us,cmp:Bs,coerce:js,truncate:Ms,Comparator:Xs,Range:Hs,satisfies:Vs,toComparators:Ws,maxSatisfying:Ys,minSatisfying:zs,minVersion:Ks,validRange:Qs,outside:Zs,gtr:Js,ltr:eo,intersects:to,simplifyRange:ro,subset:no,SemVer:Rs,re:$e.re,src:$e.src,tokens:$e.t,SEMVER_SPEC_VERSION:Or.SEMVER_SPEC_VERSION,RELEASE_TYPES:Or.RELEASE_TYPES,compareIdentifiers:Pr.compareIdentifiers,rcompareIdentifiers:Pr.rcompareIdentifiers}});var io=Zr(kr(),1);function Dr(e){return e}function Fr(e){return e}function Ie(e){return e}import{defineRendererCapabilityContribution as fo}from"@uibot/renderer-react";var C={category:"primitive",level:"L1"},ne={Box:{...C,name:"Box",description:"Token-scoped container",props:{text:{type:"string"}}},Button:{...C,name:"Button",description:"Token-scoped button",props:{label:{type:"string"}},events:{onClick:{description:"click"}}},TextInput:{...C,name:"TextInput",description:"Single-line text field",props:{label:{type:"string"},value:{type:"string"},placeholder:{type:"string"}},events:{onChange:{description:"change"}}},SearchInput:{...C,name:"SearchInput",description:"Search field",props:{label:{type:"string"},value:{type:"string"},placeholder:{type:"string"}},events:{onChange:{description:"change"}}},Select:{...C,name:"Select",description:"Select",props:{label:{type:"string"},value:{type:"string"},options:{type:"array"}},events:{onChange:{description:"change"}}},SegmentedControl:{...C,name:"SegmentedControl",description:"Radio-group segment control. Options may include label and count.",props:{label:{type:"string"},value:{type:"string"},options:{type:"array"},hideEmpty:{type:"boolean"}},events:{onChange:{description:"change"}}},FilterBar:{...C,name:"FilterBar",description:"Search, segment, and option filters with a live result summary.",category:"composite",level:"L2",props:{label:{type:"string"},query:{type:"string"},segment:{type:"string"},option:{type:"string"},segments:{type:"array"},options:{type:"array"},placeholder:{type:"string"},queryLabel:{type:"string"},segmentLabel:{type:"string"},optionLabel:{type:"string"},visibleCount:{type:"number"},totalCount:{type:"number"},summary:{type:"string"}},events:{onQuery:{description:"Search text changed"},onSegment:{description:"Segment changed"},onOption:{description:"Option changed"}}},Switch:{...C,name:"Switch",description:"Switch",props:{label:{type:"string"},checked:{type:"boolean"}},events:{onChange:{description:"change"}}},Drawer:{...C,name:"Drawer",description:"Dialog drawer. Below 768px it traps focus; Escape dispatches onClose.",props:{label:{type:"string"},open:{type:"boolean"},modal:{type:"boolean"},text:{type:"string"},portalContainer:{type:"string"}},events:{onClose:{description:"Escape or dismiss"}}},Popover:{...C,name:"Popover",description:"Popover dialog",props:{open:{type:"boolean"},text:{type:"string"},portalContainer:{type:"string"}},events:{onClose:{description:"Escape or dismiss"}}},List:{...C,name:"List",description:"List",props:{}},ListRow:{...C,name:"ListRow",description:"Row with a separate action button",props:{label:{type:"string"},actionLabel:{type:"string"}},events:{onClick:{description:"row"},onAction:{description:"row action"}}},SectionHeader:{...C,name:"SectionHeader",description:"Section title with an optional eyebrow and description.",props:{eyebrow:{type:"string"},title:{type:"string"},description:{type:"string"}}},EmptyState:{...C,name:"EmptyState",description:"Empty or error status with an optional action.",props:{title:{type:"string"},description:{type:"string"},message:{type:"string"},actionLabel:{type:"string"}},events:{onAction:{description:"Primary recovery action"}}},FactList:{...C,name:"FactList",description:"Label and value list",props:{items:{type:"array",items:{type:"object",properties:{label:{type:"string"},value:{type:"string"}}}}}}};import se from"react";import{createPortal as oo}from"react-dom";var ve='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), summary, [tabindex]:not([tabindex="-1"])';function Se(){if(typeof document<"u"){let e=document.querySelector("[data-uibot-ui]");if(e instanceof HTMLElement&&e.clientWidth>0)return e.clientWidth}if(typeof window>"u")return;return window.innerWidth}function _r(e){if(e.modal===!0)return!0;if(e.modal===!1)return!1;let t=e.containerWidth??e.viewportWidth;if(t===void 0)return!0;return t<768}function Gr(e){e?.focus()}function Le(e,t,r){if(e.key!=="Tab"||t.length===0)return!1;e.preventDefault();let n=e.shiftKey?(r-1+t.length)%t.length:(r+1)%t.length;return t[n]?.focus(),!0}function Ur(e,t){return e?.events?.[t]??[]}function so(e,t){let r=e?.props?.[t];if(!r||typeof r!=="object"||Array.isArray(r))return;let n=r._bindState;return typeof n==="string"?n:void 0}function Br(e,t,r){if(!e?.dispatch||t.length===0)return;e.dispatch(t,{event:r})}function j(e,t,r,n){let i=so(e?.element,t),s=n.checked??n.value??"";Br(e,[...i?[{action:"SetState",params:{path:i,value:s}}]:[],...Ur(e?.element,r)],n)}function M(e,t,r){j(e,t,"onChange",r)}function ie(e){if(!Array.isArray(e))return[];return e.flatMap((t)=>{if(typeof t==="string"||typeof t==="number"){let o=String(t);return[{value:o,label:o}]}if(!t||typeof t!=="object")return[];let r=t,n=r.value??r.id;if(typeof n!=="string"&&typeof n!=="number")return[];let i=r.label??n,s={value:String(n),label:typeof i==="string"||typeof i==="number"?String(i):String(n)};if(typeof r.count==="number")s.count=r.count;return[s]})}function O(e,t,r){Br(e,Ur(e?.element,t),r)}import{jsx as g,jsxs as P}from"react/jsx-runtime";function E(e){return e==null?"":String(e)}function Ce(e,t){if(e&&e.children.length>0)return e.children;return E(t)}function xe(e,t){return g("div",{className:"uibot-box","data-uibot-block":"Box",children:Ce(t,e.children??e.text)})}function we(e,t){return g("button",{type:"button",className:"uibot-button","data-uibot-block":"Button",onClick:()=>O(t,"onClick",{type:"click"}),children:E(e.label)})}function jr(e,t,r,n){return g("input",{className:"uibot-input","data-uibot-block":e,type:t,value:E(r.value),placeholder:E(r.placeholder),"aria-label":E(r.label||r.placeholder||e),onChange:(i)=>M(n,"value",{type:"change",value:i.currentTarget.value})})}function Ne(e,t){return jr("TextInput","text",e,t)}function Te(e,t){return jr("SearchInput","search",e,t)}function Ae(e,t){let r=Array.isArray(e.options)?e.options:[];return g("select",{className:"uibot-select","data-uibot-block":"Select","aria-label":E(e.label||"Select"),value:E(e.value),onChange:(n)=>M(t,"value",{type:"change",value:n.currentTarget.value}),children:r.map((n)=>{let i=n&&typeof n==="object"?n:{},s=E(i.value??n);return g("option",{value:s,children:E(i.label??s)},s)})})}function Oe(e,t){let r=E(e.value),n=ie(e.options).filter((i)=>i.count!==0||i.value===r||e.hideEmpty!==!0);return g("div",{role:"radiogroup",className:"uibot-segment","aria-label":E(e.label||"Segment"),"data-uibot-block":"SegmentedControl",children:n.map((i)=>P("label",{children:[g("input",{type:"radio",name:E(e.name||e.label||"segment"),value:i.value,checked:i.value===r,onChange:()=>M(t,"value",{type:"change",value:i.value})}),g("span",{children:i.label}),i.count===void 0?null:g("span",{className:"uibot-segment-count",children:i.count})]},i.value))})}function ao(e){if(typeof e.summary==="string")return e.summary;let t=typeof e.visibleCount==="number"?e.visibleCount:void 0,r=typeof e.totalCount==="number"?e.totalCount:void 0;if(t!==void 0&&r!==void 0&&t!==r)return`${t} / ${r}`;if(r!==void 0)return String(r);return""}function Pe(e,t){let r=E(e.segment),n=ie(e.segments).filter((o)=>o.count!==0||o.value===r),i=ie(e.options),s=ao(e);return P("search",{className:"uibot-filter","data-uibot-block":"FilterBar","aria-label":E(e.label||"Filter"),children:[g("input",{className:"uibot-input",type:"search",value:E(e.query),placeholder:E(e.placeholder),"aria-label":E(e.queryLabel||"Search"),onChange:(o)=>j(t,"query","onQuery",{type:"change",value:o.currentTarget.value})}),i.length>0?g("select",{className:"uibot-select","aria-label":E(e.optionLabel||"Option"),value:E(e.option),onChange:(o)=>j(t,"option","onOption",{type:"change",value:o.currentTarget.value}),children:i.map((o)=>g("option",{value:o.value,children:o.label},o.value))}):null,g("div",{role:"radiogroup","aria-label":E(e.segmentLabel||"Segment"),children:n.map((o)=>P("label",{children:[g("input",{type:"radio",name:E(e.label||"filter-segment"),value:o.value,checked:o.value===r,onChange:()=>j(t,"segment","onSegment",{type:"change",value:o.value})}),g("span",{children:o.label}),o.count===void 0?null:g("span",{className:"uibot-segment-count",children:o.count})]},o.value))}),s?g("p",{className:"uibot-muted","aria-live":"polite",children:s}):null]})}function qe(e,t){let r=e.checked===!0;return g("button",{type:"button",role:"switch","aria-checked":r,"aria-label":E(e.label||"Switch"),"data-uibot-block":"Switch",onClick:()=>M(t,"checked",{type:"change",checked:!r}),children:E(e.label)})}function Mr(e,t){let r=E(t);if(!r||typeof document>"u")return e;let n=document.getElementById(r);if(!n)return e;return oo(e,n)}function co(){let[e,t]=se.useState(()=>Se());return se.useEffect(()=>{if(typeof window>"u")return;let r=()=>t(Se());r();let n=window.matchMedia("(max-width: 767px)");n.addEventListener("change",r),window.addEventListener("resize",r);let i=typeof document>"u"?null:document.querySelector("[data-uibot-ui]"),s=i&&typeof ResizeObserver<"u"?new ResizeObserver(r):null;if(i)s?.observe(i);return()=>{n.removeEventListener("change",r),window.removeEventListener("resize",r),s?.disconnect()}},[]),_r(e===void 0?{}:{containerWidth:e})}function lo(e){let t=co(),r=e.forcedModal??t,n=se.useRef(null);return se.useEffect(()=>{if(!r)return;let i=typeof document>"u"?null:document.activeElement;return n.current?.querySelector(ve)?.focus(),()=>Gr(i)},[r]),g("div",{ref:n,role:"dialog","aria-modal":r,"aria-label":e.label,className:"uibot-drawer","data-uibot-block":"Drawer","data-modal":e.modalMode,onKeyDown:(i)=>{if(i.key==="Escape")e.onEscape();let s=Array.from(i.currentTarget.querySelectorAll(ve)),o=s.indexOf(document.activeElement);Le(i,s,o)},children:e.text})}function ke(e,t){if(e.open===!1)return null;let r=g(lo,{label:E(e.label||"Drawer"),text:E(e.children??e.text),modalMode:typeof e.modal==="boolean"?String(e.modal):"auto",onEscape:()=>O(t,"onClose",{type:"keydown",name:"Escape"}),...typeof e.modal==="boolean"?{forcedModal:e.modal}:{}});return Mr(r,e.portalContainer)}function De(e,t){if(e.open===!1)return null;return Mr(g("div",{role:"dialog","data-uibot-block":"Popover","aria-label":E(e.label||"Popover"),onKeyDown:(r)=>{if(r.key==="Escape")O(t,"onClose",{type:"keydown",name:"Escape"})},children:Ce(t,e.children??e.text)}),e.portalContainer)}function Fe(e){return P("header",{className:"uibot-section","data-uibot-block":"SectionHeader",children:[e.eyebrow?g("div",{className:"uibot-muted",children:E(e.eyebrow)}):null,g("h2",{children:E(e.title)}),e.description?g("p",{className:"uibot-muted",children:E(e.description)}):null]})}function _e(e,t){let r=E(e.message??e.description);return P("div",{role:"status","data-uibot-block":"EmptyState",children:[g("h3",{children:E(e.title)}),r?g("p",{className:"uibot-muted",children:r}):null,e.actionLabel?g("button",{type:"button",className:"uibot-button",onClick:()=>O(t,"onAction",{type:"click"}),children:E(e.actionLabel)}):null]})}function Ge(e){let t=Array.isArray(e.items)?e.items:[];return g("dl",{"data-uibot-block":"FactList",children:t.map((r)=>{let n=r&&typeof r==="object"?r:{},i=E(n.label);return P("div",{children:[g("dt",{children:i}),g("dd",{children:E(n.value)})]},i)})})}function Ue(e,t){return g("ul",{className:"uibot-list","data-uibot-block":"List",children:Ce(t,e.children??"")})}function Be(e,t){return P("li",{className:"uibot-row","data-uibot-block":"ListRow",children:[g("button",{type:"button",onClick:()=>O(t,"onClick",{type:"click"}),children:E(e.label)}),e.actionLabel?g("button",{type:"button",onClick:(r)=>{r.stopPropagation(),O(t,"onAction",{type:"click",name:"action"})},children:E(e.actionLabel)}):null]})}var uo=`
|
|
3
|
+
:where([data-uibot-ui]) {
|
|
4
|
+
--uibot-surface: #ffffff;
|
|
5
|
+
--uibot-text: #1c1917;
|
|
6
|
+
--uibot-muted: #57534e;
|
|
7
|
+
--uibot-border: #d6d3d1;
|
|
8
|
+
--uibot-accent: #1c1917;
|
|
9
|
+
--uibot-accent-text: #ffffff;
|
|
10
|
+
--uibot-radius: 8px;
|
|
11
|
+
--uibot-font: inherit;
|
|
12
|
+
color: var(--uibot-text);
|
|
13
|
+
font-family: var(--uibot-font);
|
|
14
|
+
background: transparent;
|
|
15
|
+
}
|
|
16
|
+
:where([data-uibot-ui][data-theme="dark"]) {
|
|
17
|
+
--uibot-surface: #1c1917;
|
|
18
|
+
--uibot-text: #fafaf9;
|
|
19
|
+
--uibot-muted: #a8a29e;
|
|
20
|
+
--uibot-border: #44403c;
|
|
21
|
+
--uibot-accent: #fafaf9;
|
|
22
|
+
--uibot-accent-text: #1c1917;
|
|
23
|
+
}
|
|
24
|
+
@media (prefers-color-scheme: dark) {
|
|
25
|
+
:where([data-uibot-ui]:not([data-theme="light"])) {
|
|
26
|
+
--uibot-surface: #1c1917;
|
|
27
|
+
--uibot-text: #fafaf9;
|
|
28
|
+
--uibot-muted: #a8a29e;
|
|
29
|
+
--uibot-border: #44403c;
|
|
30
|
+
--uibot-accent: #fafaf9;
|
|
31
|
+
--uibot-accent-text: #1c1917;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
[data-uibot-ui] .uibot-box { display: block; }
|
|
35
|
+
[data-uibot-ui] .uibot-button,
|
|
36
|
+
[data-uibot-ui] .uibot-input,
|
|
37
|
+
[data-uibot-ui] .uibot-select {
|
|
38
|
+
font: inherit;
|
|
39
|
+
color: var(--uibot-text);
|
|
40
|
+
background: var(--uibot-surface);
|
|
41
|
+
border: 1px solid var(--uibot-border);
|
|
42
|
+
border-radius: var(--uibot-radius);
|
|
43
|
+
}
|
|
44
|
+
[data-uibot-ui] .uibot-button {
|
|
45
|
+
background: var(--uibot-accent);
|
|
46
|
+
color: var(--uibot-accent-text);
|
|
47
|
+
padding: 0.4rem 0.8rem;
|
|
48
|
+
}
|
|
49
|
+
[data-uibot-ui] .uibot-input,
|
|
50
|
+
[data-uibot-ui] .uibot-select { padding: 0.4rem 0.6rem; width: 100%; }
|
|
51
|
+
[data-uibot-ui] .uibot-segment { display: inline-flex; gap: 0; }
|
|
52
|
+
[data-uibot-ui] .uibot-muted { color: var(--uibot-muted); }
|
|
53
|
+
[data-uibot-ui] .uibot-drawer {
|
|
54
|
+
background: var(--uibot-surface);
|
|
55
|
+
color: var(--uibot-text);
|
|
56
|
+
border: 1px solid var(--uibot-border);
|
|
57
|
+
}
|
|
58
|
+
@container (max-width: 767px) {
|
|
59
|
+
[data-uibot-ui] .uibot-drawer[data-modal="auto"] {
|
|
60
|
+
position: fixed;
|
|
61
|
+
inset: 0;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
@media (max-width: 767px) {
|
|
65
|
+
[data-uibot-ui] .uibot-drawer[data-modal="auto"] {
|
|
66
|
+
position: fixed;
|
|
67
|
+
inset: 0;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
[data-uibot-ui] .uibot-filter { display: grid; gap: 0.5rem; }
|
|
71
|
+
[data-uibot-ui] .uibot-segment-count { color: var(--uibot-muted); }
|
|
72
|
+
[data-uibot-ui] .uibot-row { display: flex; gap: 0.5rem; align-items: center; }
|
|
73
|
+
[data-uibot-ui] .uibot-list { list-style: none; margin: 0; padding: 0; }
|
|
74
|
+
[data-uibot-ui] .uibot-section { display: grid; gap: 0.25rem; }
|
|
75
|
+
[data-uibot-ui] .uibot-section h2,
|
|
76
|
+
[data-uibot-ui] [data-uibot-block="EmptyState"] h3 { margin: 0; font: inherit; }
|
|
77
|
+
`.trim(),po={surface:"--uibot-surface",text:"--uibot-text",muted:"--uibot-muted",border:"--uibot-border",accent:"--uibot-accent",accentText:"--uibot-accent-text",radius:"--uibot-radius",font:"--uibot-font"};var Xr={Box:xe,Button:we,TextInput:Ne,SearchInput:Te,Select:Ae,SectionHeader:Fe,SegmentedControl:Oe,Switch:qe,FilterBar:Pe,Drawer:ke,Popover:De,List:Ue,ListRow:Be,EmptyState:_e,FactList:Ge};function ho(){return Fr({manifest:Dr({pluginId:"uibot.blocks-base",version:"0.1.0",displayName:"UIBot Blocks (base)",description:"CSS-variable blocks scoped to [data-uibot-ui]. No Tailwind.",sdkRange:"^0.1.0",engineRange:"^0.1.0",capabilities:[...Object.keys(Xr).map((e)=>({id:`uibot.blocks-base.catalog.${e.toLowerCase()}`,type:"catalog:component",description:ne[e]?.description??e})),{id:"uibot.blocks-base.renderer",type:"renderer:target",description:"React render targets for token-scoped base blocks"}],permissions:[]}),register(e){for(let[t,r]of Object.entries(ne))e.addCapability(Ie({id:`uibot.blocks-base.catalog.${t.toLowerCase()}`,type:"catalog:component",description:r.description,contribution:{name:t,entry:r}}));e.addCapability(Ie({id:"uibot.blocks-base.renderer",type:"renderer:target",description:"React render targets for token-scoped base blocks",contribution:fo({entries:Object.fromEntries(Object.entries(Xr).map(([t,r])=>[t,{component:r,category:"primitive"}]))})}))}})}var Ia=ho();export{ne as BASE_CATALOG_ENTRIES,xe as Box,we as Button,ke as Drawer,_e as EmptyState,Ge as FactList,Pe as FilterBar,Ue as List,Be as ListRow,De as Popover,Te as SearchInput,Fe as SectionHeader,Oe as SegmentedControl,Ae as Select,qe as Switch,Ne as TextInput,po as UIBOT_TOKEN_MAP,Ia as UIBotBlocksBasePlugin,ho as createUIBotBlocksBasePlugin,Le as handleFocusTrapKey,uo as uibotBaseCss};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ActionChain, ActionEventScope, UIElement } from "@uibot/contracts";
|
|
2
|
+
import type { RendererComponentContext } from "@uibot/renderer-react";
|
|
3
|
+
export declare function eventChain(element: UIElement | undefined, name: string): ActionChain;
|
|
4
|
+
/** Path declared as `{ _bindState: "query" }` on a prop, if any. */
|
|
5
|
+
export declare function bindStatePath(element: UIElement | undefined, propName: string): string | undefined;
|
|
6
|
+
export declare function dispatchChain(ctx: RendererComponentContext | undefined, chain: ActionChain, event: ActionEventScope): void;
|
|
7
|
+
export declare function dispatchField(ctx: RendererComponentContext | undefined, propName: string, eventName: string, event: ActionEventScope): void;
|
|
8
|
+
export declare function dispatchChange(ctx: RendererComponentContext | undefined, propName: string, event: ActionEventScope): void;
|
|
9
|
+
export interface Choice {
|
|
10
|
+
value: string;
|
|
11
|
+
label: string;
|
|
12
|
+
count?: number;
|
|
13
|
+
}
|
|
14
|
+
export declare function readChoices(value: unknown): Choice[];
|
|
15
|
+
export declare function dispatchClick(ctx: RendererComponentContext | undefined, name: string, event: ActionEventScope): void;
|
package/dist/tokens.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Token stylesheet. Defaults use `:where` so a host rule such as
|
|
3
|
+
* `[data-uibot-ui] { --uibot-surface: var(--llmbase-surface) }` always wins.
|
|
4
|
+
*/
|
|
5
|
+
export declare const uibotBaseCss: string;
|
|
6
|
+
export declare const UIBOT_TOKEN_MAP: {
|
|
7
|
+
readonly surface: "--uibot-surface";
|
|
8
|
+
readonly text: "--uibot-text";
|
|
9
|
+
readonly muted: "--uibot-muted";
|
|
10
|
+
readonly border: "--uibot-border";
|
|
11
|
+
readonly accent: "--uibot-accent";
|
|
12
|
+
readonly accentText: "--uibot-accent-text";
|
|
13
|
+
readonly radius: "--uibot-radius";
|
|
14
|
+
readonly font: "--uibot-font";
|
|
15
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,43 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uibot/blocks-base",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/Foundj/uibot.git",
|
|
8
|
+
"directory": "packages/blocks-base"
|
|
9
|
+
},
|
|
10
|
+
"type": "module",
|
|
11
|
+
"main": "./dist/index.js",
|
|
12
|
+
"module": "./dist/index.js",
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"default": "./dist/index.js"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist",
|
|
22
|
+
"!dist/**/*.map",
|
|
23
|
+
"!dist/**/*.test.d.ts",
|
|
24
|
+
"!dist/**/*.spec.d.ts"
|
|
25
|
+
],
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
|
+
},
|
|
29
|
+
"peerDependencies": {
|
|
30
|
+
"react": ">=18",
|
|
31
|
+
"react-dom": ">=18"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@uibot/contracts": "^0.2.0",
|
|
35
|
+
"@uibot/plugin-sdk": "^0.2.0",
|
|
36
|
+
"@uibot/renderer-react": "^0.2.0"
|
|
37
|
+
},
|
|
38
|
+
"scripts": {
|
|
39
|
+
"build": "rm -rf dist && bun build --minify ./src/index.ts --outdir ./dist --format esm --target bun --external react --external react/* --external react-dom --external @uibot/renderer-react && bun x tsc -p tsconfig.json",
|
|
40
|
+
"typecheck": "bun x tsc -p tsconfig.json --noEmit",
|
|
41
|
+
"test": "bun test"
|
|
42
|
+
}
|
|
43
|
+
}
|
package/README.md
DELETED