efficient-shell 13.23.1 → 13.24.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/{Browser-I2UVUUVV.js → Browser-NZ32TN3O.js} +14 -14
- package/dist/{Files-KA5Y6G4P.js → Files-BKNIV43J.js} +61 -61
- package/dist/{Notepad-RSEI2F3I.js → Notepad-XJTIS3J5.js} +8 -8
- package/dist/{Preview-EPATSSFI.js → Preview-FXOWT52M.js} +1 -1
- package/dist/ai/index.js +51 -51
- package/dist/apps/index.js +1 -1
- package/dist/bin/browser-check.js +1 -1
- package/dist/bin/media-host-check.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/{chunk-NF5HSFZ3.js → chunk-23YQNCZ4.js} +16 -16
- package/dist/chunk-3ZX5DC2S.js +1 -0
- package/dist/{chunk-VP2IQJUD.js → chunk-6CFI4YGI.js} +4 -4
- package/dist/{chunk-3WUVYXCF.js → chunk-7G5HKAGV.js} +5 -5
- package/dist/{chunk-P6H2B635.js → chunk-7N6CVTWO.js} +1 -1
- package/dist/{chunk-UU42O5ON.js → chunk-AFYLMXOJ.js} +5 -5
- package/dist/{chunk-DAUE6ULT.js → chunk-DUEEAP4Y.js} +1 -1
- package/dist/{chunk-S5MTTJ3F.js → chunk-F3EBYHIE.js} +10 -10
- package/dist/{chunk-7PYJEJDT.js → chunk-FMBUR4EU.js} +1 -1
- package/dist/{chunk-2L4IOLOT.js → chunk-GPU7LLTJ.js} +1 -1
- package/dist/{chunk-TJBHFUWV.js → chunk-J5OAQAAD.js} +4 -4
- package/dist/{chunk-CCZHSISF.js → chunk-JJYTN72U.js} +3 -3
- package/dist/{chunk-VMAIZU5S.js → chunk-L744YF4X.js} +1 -1
- package/dist/{chunk-JVENCUUG.js → chunk-LRMDLZMM.js} +4 -4
- package/dist/{chunk-TJG76Y7I.js → chunk-LUARJHUK.js} +8 -8
- package/dist/chunk-MCLVTQSF.js +16 -0
- package/dist/{chunk-UR3J4WP6.js → chunk-OFMZ6JM6.js} +12 -12
- package/dist/{chunk-VT5HWPE2.js → chunk-ONWFKCMB.js} +9 -9
- package/dist/{chunk-MRFFOJCS.js → chunk-QKVPKLDN.js} +22 -22
- package/dist/{chunk-VLBLDSA6.js → chunk-QPVYBN4J.js} +1 -1
- package/dist/{chunk-T7A3Y64S.js → chunk-SAHRIE35.js} +1 -1
- package/dist/{chunk-ZMBGMEN5.js → chunk-TSCJG6UM.js} +1 -1
- package/dist/{chunk-6AETKYCP.js → chunk-UJY5RUZ5.js} +1 -1
- package/dist/{chunk-L4W5X3Q4.js → chunk-VLIXI42G.js} +2 -2
- package/dist/{chunk-CZS5UHOU.js → chunk-WNX6EVJ4.js} +1 -1
- package/dist/{chunk-PWOVSR7N.js → chunk-Z6J4KXY3.js} +6 -6
- package/dist/{chunk-N4LMFGRI.js → chunk-ZBGPAUOH.js} +5 -5
- package/dist/{chunk-LM6MSGDW.js → chunk-ZL654Y6H.js} +1 -1
- package/dist/data/EntityList.js +1 -1
- package/dist/data/ResizableTable.js +1 -1
- package/dist/format/index.js +1 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/ColorPicker.js +1 -1
- package/dist/forms/ComposerAttachments.js +1 -1
- package/dist/forms/CornersInput.js +1 -1
- package/dist/forms/DateRangePicker.js +1 -1
- package/dist/forms/Input.js +1 -1
- package/dist/forms/InputNumber.js +1 -1
- package/dist/forms/LinkPicker.js +1 -1
- package/dist/forms/MediaLibrary.js +1 -1
- package/dist/forms/PositionInput.js +1 -1
- package/dist/forms/RenameField.js +1 -1
- package/dist/forms/SidesInput.js +1 -1
- package/dist/forms/Slider.js +1 -1
- package/dist/forms/WidthsBar.js +1 -1
- package/dist/icons/index.js +1 -1
- package/dist/index.js +70 -70
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/SearchableSelect.js +1 -1
- package/dist/shell/SettingRow.js +1 -1
- package/dist/shell/SidebarLayout.d.ts +12 -1
- package/dist/shell/SidebarLayout.js +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/templates/AuthScreen.js +1 -1
- package/dist/templates/ChatTemplate.js +1 -1
- package/dist/templates/CheckoutTemplate.js +1 -1
- package/dist/templates/DataTablePage.js +1 -1
- package/dist/templates/EmailTemplate.js +1 -1
- package/dist/templates/FormLayoutPage.js +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-KH4AMHSI.js +0 -1
- package/dist/chunk-W24THMLI.js +0 -15
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{InputNumber_default as e,stepRounding as r}from"./chunk-
|
|
2
|
-
return s("div",{id:
|
|
3
|
-
/* @__PURE__ */d("div",{className:"w-30 shrink-0",children:/* @__PURE__ */d(e,{value:v,onChange:b,min:g,max:x,step:w,...r(w),placeholder:y,prefix:/* @__PURE__ */d("span",{"data-radius-mark":"","aria-hidden":"true",children:D.corners.radiusMark}),suffix:
|
|
4
|
-
/* @__PURE__ */d("div",{ref:
|
|
1
|
+
import{InputNumber_default as e,stepRounding as r}from"./chunk-QPVYBN4J.js";import{IconButton_default as a}from"./chunk-NWS5G7FE.js";import{Icon as i}from"./chunk-ISVODSRP.js";import{Tooltip as n}from"./chunk-F2RAIGCG.js";import{useShellStrings as l}from"./chunk-NRHG4R2Q.js";import{useState as t,useRef as o}from"react";import{jsxs as s,jsx as d}from"react/jsx-runtime";var u={tl:"",tr:"rotate-90",br:"rotate-180",bl:"-rotate-90"},c=["tl","tr","bl","br"];function m({label:m,value:f,corners:p,onChange:h,radius:v=null,onRadiusChange:b,radiusLabel:k,radiusMin:g=0,radiusMax:x,radiusStep:w=1,radiusPlaceholder:y,radiusUnit:N,units:R,disabled:j=!1,disabledReason:A,id:C,className:S=""}){const D=l(),G=function(e){const r=c.map(r=>e.find(e=>e.value===r));for(const a of e){if(c.includes(a.value))continue;const e=r.findIndex(e=>void 0===e);-1===e?r.push(a):r[e]=a}return r.filter(e=>void 0!==e)}(p),[I,K]=t(0),M=o(null);/* @__PURE__ */
|
|
2
|
+
return s("div",{id:C,role:"group","aria-label":m,className:`flex min-w-0 flex-wrap items-center gap-2 ${S}`.trim(),children:[b&&
|
|
3
|
+
/* @__PURE__ */d("div",{className:"w-30 shrink-0",children:/* @__PURE__ */d(e,{value:v,onChange:b,min:g,max:x,step:w,...r(w),placeholder:y,prefix:/* @__PURE__ */d("span",{"data-radius-mark":"","aria-hidden":"true",children:D.corners.radiusMark}),suffix:N??D.corners.unit,units:R,steppers:"compact",disabled:j,"aria-label":k??D.corners.radius})}),
|
|
4
|
+
/* @__PURE__ */d("div",{ref:M,"data-corners-grid":"",className:"grid shrink-0 grid-cols-2 gap-1",onKeyDown:e=>{if(e.altKey||e.ctrlKey||e.metaKey)return;const r=Array.from(M.current?.querySelectorAll("button[data-corner]")??[]),a=r.indexOf(document.activeElement);if(-1===a)return;const i=a%2,n=Math.floor(a/2),l="ArrowRight"===e.key?2*n+1:"ArrowLeft"===e.key?2*n:"ArrowDown"===e.key?2+i:"ArrowUp"===e.key?i:null;null!==l&&(e.preventDefault(),l<r.length&&r[l].focus())},children:G.map((e,r)=>{const l=f.includes(e.value),t=j||!0===e.disabled,o=t&&(!0===e.disabled&&e.title||(j?A:void 0))||void 0,s=/* @__PURE__ */d(a,{"aria-pressed":l,"aria-label":e.label,"aria-disabled":t||void 0,disabledReason:o,"data-corner":e.value,size:"sm",tabIndex:r===I?0:-1,onFocus:()=>K(r),onClick:()=>{t||h(l?f.filter(r=>r!==e.value):[...f,e.value])},children:/* @__PURE__ */d(i,{name:"corner",strokeWidth:2,className:["h-4 w-4",u[e.value]??""].filter(Boolean).join(" ")})},e.value);return o?s:/* @__PURE__ */d(n,{content:e.title??e.label,children:s},e.value)})})]})}export{m as CornersInput};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{resolveColumnShares as e,COLUMN_SHARES_EQUAL as r,COLUMN_SHARE_MIN as t,COLUMN_COUNT_MAX as n}from"./chunk-PLGJOHEG.js";import{InputNumber_default as o}from"./chunk-
|
|
2
|
-
return f("div",{role:"group","aria-label":N?void 0:C,"aria-labelledby":N,"aria-describedby":
|
|
1
|
+
import{resolveColumnShares as e,COLUMN_SHARES_EQUAL as r,COLUMN_SHARE_MIN as t,COLUMN_COUNT_MAX as n}from"./chunk-PLGJOHEG.js";import{InputNumber_default as o}from"./chunk-QPVYBN4J.js";import{textWidth as l}from"./chunk-UVCMV2TL.js";import{Tooltip as i}from"./chunk-F2RAIGCG.js";import{useShellStrings as a}from"./chunk-NRHG4R2Q.js";import{useId as s,useRef as c,useState as u,useEffect as d,Fragment as h}from"react";import{jsxs as f,jsx as m}from"react/jsx-runtime";var p=(e,r,t)=>Math.min(t,Math.max(r,e)),g=e=>e.reduce((e,r)=>e+r,0),v=(e,r)=>e.length===r.length&&e.every((e,t)=>e===r[t]);var b="w-0.5",y=`${b} group-hover/widths:w-1 group-focus-visible/widths:w-1`;var w=["text-blue-700","text-gray-600"];function x({count:x,value:$,onChange:k,label:C,"aria-labelledby":N,readOnly:P=!1,disabled:R=!1,className:M=""}){const j=a().widths,z=s(),A=p(Math.round(x)||1,1,n),B=e($,A),S=B??[...r[A]??[]],D=[...S,100-g(S)],G=P||R,K=c(null),O=c({onChange:k,shown:S,locked:G,n:A,stored:B});O.current={onChange:k,shown:S,locked:G,n:A,stored:B};const T=r=>{const{onChange:t,shown:n,locked:o,n:l}=O.current;if(o)return!1;const i=e(r,l);return!(!i||v(i,n))&&(t(i),!0)},H=(e,r,n)=>{const o=e[r]+e[r+1],l=[...e];l[r]=p(Math.round(n),t,o-t),l[r+1]=o-l[r],T(l.slice(0,-1))&&(ne.current=null)},I=e=>r=>{if(r.altKey||r.ctrlKey||r.metaKey)return;const n=r.shiftKey?10:1,o=D[e]+D[e+1],l="ArrowRight"===r.key?D[e]+n:"ArrowLeft"===r.key?D[e]-n:"PageUp"===r.key?D[e]+10:"PageDown"===r.key?D[e]-10:"Home"===r.key?t:"End"===r.key?o-t:null;null!==l&&(r.preventDefault(),H(D,e,l))},L=c(null),[V,E]=u(null),F=()=>{L.current=null,E(null),document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")};d(()=>F,[]);const U=e=>r=>{if(0!==r.button||G)return;r.preventDefault();const t=K.current?.getBoundingClientRect().width??0;t<=0||(L.current={i:e,x:r.clientX,width:t,from:D,moved:!1,pointer:r.pointerId},E(e),r.currentTarget.setPointerCapture?.(r.pointerId),document.body.style.cursor="col-resize",document.body.style.userSelect="none")},J=e=>{const r=L.current;if(!r)return;if(0===e.buttons)return void F();const t=e.clientX-r.x;if(!r.moved){if(Math.abs(t)<3)return;r.moved=!0}H(r.from,r.i,r.from[r.i]+t/r.width*100)},Q=e=>{const r=L.current;r&&(e.currentTarget.hasPointerCapture?.(r.pointer)&&e.currentTarget.releasePointerCapture(r.pointer),F())},W=(e,r)=>{const{shown:n}=O.current,o=function(e,r,n){const o=e.length,l=[...e];if(o<2)return l;const i=p(Math.round(n),t,100-(o-1)*t);let a=i-l[r];l[r]=i;const s=[...Array.from({length:o-1-r},(e,t)=>r+1+t),...Array.from({length:r},(e,t)=>r-1-t)];if(a<0)return l[s[0]]-=a,l;for(const e of s){if(a<=0)break;const r=Math.min(a,l[e]-t);l[e]-=r,a-=r}return l}([...n,100-g(n)],e,r);return T(o.slice(0,-1))?o:null},[X,q]=u(0);d(()=>{const e=K.current;if(!e||"undefined"==typeof ResizeObserver)return;const r=new ResizeObserver(()=>q(e.getBoundingClientRect().width));return r.observe(e),()=>r.disconnect()},[]);const Y=c(null),[Z,_]=u(null),[ee,re]=u([]),te=(e,r)=>_(t=>r?e:t===e?null:t),ne=c(null),oe=(e,r)=>{const t=ne.current;if(!t||t.column!==e||t.share!==r)return!1;const{onChange:n,locked:o,stored:l}=O.current;var i,a;return o||(i=l,a=t.stored,void 0===i||void 0===a?i===a:v(i,a))||n(t.stored),!0},le=D.join(",");d(()=>{const e=null===Z?[]:function(e,r){if(!e)return[];const t=Array.from(e.querySelectorAll("input[data-widths-label]")),n=t[r]?.getBoundingClientRect();return n&&0!==n.width?null===l("","12px sans-serif")?[]:t.flatMap((e,t)=>{if(t===r)return[];const o=e.getBoundingClientRect(),i=getComputedStyle(e),a=(l(e.value,`${i.fontWeight} ${i.fontSize} ${i.fontFamily}`)??0)/2,s=(o.left+o.right)/2;return s+a>n.left&&s-a<n.right?[t]:[]}):[]}(Y.current,Z);re(r=>v(r,e)?r:e)},[Z,le,X]);const ie=j.hint(A,t),ae=D.slice(0,-1).map((e,r)=>g(D.slice(0,r+1)));/* @__PURE__ */
|
|
2
|
+
return f("div",{role:"group","aria-label":N?void 0:C,"aria-labelledby":N,"aria-describedby":A>1?z:void 0,className:`flex w-full min-w-0 flex-col gap-2 ${R?"opacity-60":""} ${M}`.trim(),children:[
|
|
3
3
|
/* @__PURE__ */f("div",{ref:Y,"data-widths-bar":"",className:"relative h-8",children:[
|
|
4
|
-
/* @__PURE__ */m("div",{ref:
|
|
5
|
-
/* @__PURE__ */m("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 rounded-(--radius-control) border border-line-strong"}),
|
|
6
|
-
return m("div",{"data-widths-tip":"",className:"absolute inset-y-0 "+(n?"z-20":""),style:{left:`clamp(0px, calc(${l+e/2}% - ${a} / 2), calc(100% - ${a}))`,width:a},children:/* @__PURE__ */m(i,{content:ie,delay:600,describe:!1,className:"absolute inset-0",children:/* @__PURE__ */m(o,{appearance:"bare",value:e,display:()=>(e=>
|
|
4
|
+
/* @__PURE__ */m("div",{ref:K,"data-widths-track":"",className:"flex h-full w-full overflow-hidden rounded-(--radius-control) bg-surface",children:D.map((e,r)=>/* @__PURE__ */m("div",{"data-widths-segment":"",style:{flexBasis:`${e}%`},className:`flex min-w-0 shrink-0 grow-0 items-center justify-center overflow-hidden whitespace-nowrap text-xs font-medium tabular-nums ${w[r%2]} ${r%2==0?"bg-accent-tint":""}`,children:1===A&&/* @__PURE__ */m("span",{"data-widths-label":"",children:`${e}%`})},r))}),
|
|
5
|
+
/* @__PURE__ */m("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 rounded-(--radius-control) border border-line-strong"}),A>1&&D.map((e,r)=>/* @__PURE__ */f(h,{children:[(()=>{const n=Z===r,l=g(D.slice(0,r)),a=n?`max(${e}%, 40px)`:`${e}%`;/* @__PURE__ */
|
|
6
|
+
return m("div",{"data-widths-tip":"",className:"absolute inset-y-0 "+(n?"z-20":""),style:{left:`clamp(0px, calc(${l+e/2}% - ${a} / 2), calc(100% - ${a}))`,width:a},children:/* @__PURE__ */m(i,{content:ie,delay:600,describe:!1,className:"absolute inset-0",children:/* @__PURE__ */m(o,{appearance:"bare",value:e,display:()=>(e=>X>0&&X*e/100<36?String(e):`${e}%`)(e),suffix:"%",min:t,max:100-(A-1)*t,step:1,shiftStep:10,precision:0,allowEmpty:!1,reportWhileTyping:!1,readOnly:P,disabled:R,"aria-label":j.column(r+1),"aria-describedby":z,"data-widths-label":"",onChange:e=>{null===e||oe(r,e)||W(r,e)},onRevert:e=>((e,r)=>{O.current.locked||null===r||oe(e,r)||W(e,r)})(r,e),onFocus:()=>{ne.current={column:r,share:e,stored:O.current.stored},te(r,!0)},onBlur:()=>te(r,!1),className:`absolute inset-0 text-xs font-medium ${w[r%2]} ${ee.includes(r)&&!n?"opacity-0":""}`})})})})(),r<A-1&&/* @__PURE__ */m("div",{className:"absolute inset-y-0 z-10 w-3 -translate-x-1/2",style:{left:`${ae[r]}%`},children:/* @__PURE__ */m(i,{content:j.dragHint,delay:600,className:"relative flex h-full w-full",children:/* @__PURE__ */m("div",{role:"separator",tabIndex:R?-1:0,"aria-orientation":"vertical","aria-label":j.divider(r+1,r+2),"aria-valuenow":D[r],"aria-valuemin":t,"aria-valuemax":D[r]+D[r+1]-t,"aria-valuetext":j.dividerValue(r+1,D[r],r+2,D[r+1]),"aria-disabled":G||void 0,onKeyDown:G?void 0:I(r),onPointerDown:U(r),onPointerMove:J,onPointerUp:Q,onPointerCancel:Q,onLostPointerCapture:()=>{L.current&&F()},className:"group/widths flex h-full w-full touch-none justify-center rounded-(--radius-control) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(G?"cursor-default":"cursor-col-resize"),children:/* @__PURE__ */m("span",{"aria-hidden":"true","data-widths-line":"",className:"h-full rounded-full "+(G?`${b} bg-gray-300`:`bg-accent-fill transition-[width,background-color] duration-(--motion-fast) group-hover/widths:bg-blue-700 ${V===r?"w-1":y}`)})})})})]},r))]}),A>1&&/* @__PURE__ */m("span",{id:z,className:"sr-only",children:ie})]})}export{x as WidthsBar};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{useColumnConfig as e}from"./chunk-C5OPAULN.js";import{useClickOutside as t}from"./chunk-SI26KESU.js";import{useShellAuth as r}from"./chunk-2QY5BJLA.js";import{useIsMobile as o}from"./chunk-UGTRSRIW.js";import{Icon as l}from"./chunk-ISVODSRP.js";import{TH_ONE_LINE as n}from"./chunk-TD3ZQD5R.js";import{shellHttp as a}from"./chunk-STKJA4PV.js";import{glassStyle as s}from"./chunk-5FYDNH4Y.js";import{useShellStrings as i}from"./chunk-NRHG4R2Q.js";import{useState as c,useMemo as d,useRef as m,useCallback as h}from"react";import{jsxs as u,jsx as p}from"react/jsx-runtime";function f({tableId:f,columns:g,sort:x,onSort:y,footer:b,afterBody:v,saveDefaultPerms:k=["change_numberingconfig"],children:N}){const w=o(),[D,j]=c(!1),S=d(()=>w&&!D?g.filter(e=>"_select"!==e.key):g,[g,w,D]),{orderedColumns:C,allColumns:R,onResizeStart:_,onDragStart:z,onDragOver:P,onDrop:$,onDragEnd:I,toggleColumn:L,resetColumns:T,draggedIdx:A,dropGap:O}=e(f,S),{hasAnyPerm:E}=r(),G=i().columns,[Q,U]=c(!1),[W,Y]=c(!1),[B,F]=c(!1),H=m(null),J=k.length>0&&E(k);t(H,h(()=>{Q&&U(!1)},[Q]));const K=C.reduce((e,t)=>e+t.width,0),V=C.map(e=>`${e.width}px`),M={tableLayout:"fixed",width:K,minWidth:"100%"},Z=m(null),q=h(e=>{const t=Z.current;t&&(t.scrollLeft=e.currentTarget.scrollLeft)},[]),X=d(()=>g.some(e=>"_select"===e.key),[g]);/* @__PURE__ */
|
|
2
2
|
return u("div",{className:"flex flex-col flex-1 min-h-0 "+(w?"-mx-4":""),children:[
|
|
3
3
|
/* @__PURE__ */p("div",{ref:Z,className:"shrink-0 overflow-x-hidden",children:/* @__PURE__ */u("table",{className:"divide-y divide-gray-200",style:M,children:[
|
|
4
4
|
/* @__PURE__ */p("colgroup",{children:C.map((e,t)=>/* @__PURE__ */p("col",{style:{width:V[t]}},e.key))}),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{InputNumber_default as e,stepRounding as a}from"./chunk-
|
|
2
|
-
return n("div",{"data-side":r.join("-"),className:"min-w-0",onKeyDownCapture:p,onWheelCapture:c,children:/* @__PURE__ */n(e,{value:null,onChange:e=>C(r,e),min:g,max:f,step:
|
|
3
|
-
return n("div",{"data-side":r.join("-"),className:"min-w-0",children:/* @__PURE__ */n(e,{value:"mixed"===s?null:s,onChange:e=>C(r,e),min:g,max:f,step:
|
|
4
|
-
return n("div",{role:"group","aria-label":r,"data-sides":l?"each":"pairs",className:"grid min-w-0 grid-cols-2 gap-2",children:/* @__PURE__ */o(d,l?{children:[j(["left"],h.sides.left,x.left),j(["top"],h.sides.top,x.top),j(["right"],h.sides.right,x.right),j(["bottom"],h.sides.bottom,x.bottom)]}:{children:[j(["left","right"],h.horizontal,x.horizontal),j(["top","bottom"],h.vertical,x.vertical)]})})}function
|
|
5
|
-
return n(t,{content:i,children:/* @__PURE__ */n(r,{size:"md","aria-label":i,"aria-pressed":e,disabled:o,onClick:()=>a(!e),children:h})})}export{
|
|
1
|
+
import{InputNumber_default as e,stepRounding as a}from"./chunk-QPVYBN4J.js";import{IconButton_default as r}from"./chunk-NWS5G7FE.js";import{Icon as i}from"./chunk-ISVODSRP.js";import{Tooltip as t}from"./chunk-F2RAIGCG.js";import{jsx as n,jsxs as o,Fragment as d}from"react/jsx-runtime";var l="h-3.5 w-3.5",s={padding:{top:/* @__PURE__ */n(i,{name:"padding-top","aria-hidden":"true",className:l}),right:/* @__PURE__ */n(i,{name:"padding-right","aria-hidden":"true",className:l}),bottom:/* @__PURE__ */n(i,{name:"padding-bottom","aria-hidden":"true",className:l}),left:/* @__PURE__ */n(i,{name:"padding-left","aria-hidden":"true",className:l}),vertical:/* @__PURE__ */n(i,{name:"padding-y","aria-hidden":"true",className:l}),horizontal:/* @__PURE__ */n(i,{name:"padding-left-right","aria-hidden":"true",className:l})},crop:{top:/* @__PURE__ */n(i,{name:"crop-top","aria-hidden":"true",className:l}),right:/* @__PURE__ */n(i,{name:"crop-right","aria-hidden":"true",className:l}),bottom:/* @__PURE__ */n(i,{name:"crop-bottom","aria-hidden":"true",className:l}),left:/* @__PURE__ */n(i,{name:"crop-left","aria-hidden":"true",className:l}),vertical:/* @__PURE__ */n(i,{name:"crop-y","aria-hidden":"true",className:l}),horizontal:/* @__PURE__ */n(i,{name:"crop-left-right","aria-hidden":"true",className:l})}},m=/* @__PURE__ */new Set(["ArrowUp","ArrowDown","PageUp","PageDown"]),p=e=>{m.has(e.key)&&(e.preventDefault(),e.stopPropagation())},c=e=>e.stopPropagation(),h=/* @__PURE__ */n(i,{name:"sides-each","aria-hidden":"true",className:"h-4 w-4"});var u=(e,a,r)=>null===e[r]?a[r]:String(e[r]);function g(e,a){const r=r=>u(e,a,r);return r("left")!==r("right")||r("top")!==r("bottom")}function f({label:r,value:i,onChange:t,each:l,placeholder:m,words:h,min:g=0,max:f=200,step:N=4,readOnly:b,glyphs:v="padding",units:y,sideDisplay:w}){const x=s[v],C=(e,a)=>{const r={...i};for(const i of e)r[i]=a;t(r)},j=(r,t,o)=>{const d=r.map(e=>w?.[e]?.word),l=d[0]&&d.every(e=>e===d[0])?d[0]:void 0;if(l)/* @__PURE__ */
|
|
2
|
+
return n("div",{"data-side":r.join("-"),className:"min-w-0",onKeyDownCapture:p,onWheelCapture:c,children:/* @__PURE__ */n(e,{value:null,onChange:e=>C(r,e),min:g,max:f,step:N,snap:!0,...a(N),readOnly:b,placeholder:l,display:()=>l,reportWhileTyping:!1,prefix:o,"aria-label":t})});const s=d.some(Boolean)?"mixed":function(e,a){const r=a.map(a=>e[a]);return r.every(e=>e===r[0])?r[0]:"mixed"}(i,r),v=r.map(e=>u(i,m,e)),x="mixed"!==s&&v.every(e=>e===v[0])?v[0]:"–";/* @__PURE__ */
|
|
3
|
+
return n("div",{"data-side":r.join("-"),className:"min-w-0",children:/* @__PURE__ */n(e,{value:"mixed"===s?null:s,onChange:e=>C(r,e),min:g,max:f,step:N,snap:!0,...a(N),steppers:"compact",readOnly:b,placeholder:x,prefix:o,suffix:h.unit,units:y,"aria-label":t})})};/* @__PURE__ */
|
|
4
|
+
return n("div",{role:"group","aria-label":r,"data-sides":l?"each":"pairs",className:"grid min-w-0 grid-cols-2 gap-2",children:/* @__PURE__ */o(d,l?{children:[j(["left"],h.sides.left,x.left),j(["top"],h.sides.top,x.top),j(["right"],h.sides.right,x.right),j(["bottom"],h.sides.bottom,x.bottom)]}:{children:[j(["left","right"],h.horizontal,x.horizontal),j(["top","bottom"],h.vertical,x.vertical)]})})}function N({each:e,onChange:a,label:i,disabled:o}){/* @__PURE__ */
|
|
5
|
+
return n(t,{content:i,children:/* @__PURE__ */n(r,{size:"md","aria-label":i,"aria-pressed":e,disabled:o,onClick:()=>a(!e),children:h})})}export{N as SidesEachToggle,f as SidesInput,g as sidesStartEach};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{SidebarLayout as e}from"./chunk-
|
|
1
|
+
import{SidebarLayout as e}from"./chunk-MCLVTQSF.js";import{Avatar as t}from"./chunk-SCNQK5NF.js";import{ItemCount as r}from"./chunk-LC2UF3AA.js";import{Button_default as a}from"./chunk-UTISUEO4.js";import{useState as i}from"react";import{jsx as l,jsxs as n}from"react/jsx-runtime";var s=[{id:"inbox",label:"Inbox",count:12},{id:"starred",label:"Starred",count:3},{id:"sent",label:"Sent"},{id:"drafts",label:"Drafts",count:1},{id:"archive",label:"Archive"},{id:"trash",label:"Trash"}],d=[{id:1,from:"Marco Reyes",subject:"Q3 roadmap review",preview:"Sharing the deck ahead of Thursday — let me know what you think before the review.",time:"9:14",unread:!0},{id:2,from:"Priya Patel",subject:"Design handoff",preview:"The Figma file is ready for engineering. I exported every icon at 1x and 2x.",time:"8:02",unread:!0},{id:3,from:"GitHub",subject:"[acme/web] PR #482 merged",preview:"Your pull request was merged into main by the release bot after all checks passed.",time:"Yest"},{id:4,from:"Sara Lind",subject:"Lunch Friday?",preview:"A few of us are heading to the new place on 5th at noon if you want to join.",time:"Yest"}];function c(){const[c,o]=i(1),m=d.find(e=>e.id===c)??d[0];/* @__PURE__ */
|
|
2
2
|
return l("div",{className:"h-full",children:/* @__PURE__ */l(e,{side:"left",defaultWidth:200,sidebar:/* @__PURE__ */n("div",{className:"flex h-full flex-col p-2",children:[
|
|
3
3
|
/* @__PURE__ */l(a,{block:!0,className:"mb-2",children:"Compose"}),s.map((e,t)=>/* @__PURE__ */n("button",{className:"flex items-center justify-between rounded-md px-3 py-2 text-left text-sm "+(0===t?"bg-blue-50 font-medium text-blue-700":"text-gray-700 hover:bg-gray-100"),children:[
|
|
4
4
|
/* @__PURE__ */l("span",{children:e.label}),null!=e.count&&/* @__PURE__ */l(r,{count:e.count,active:0===t})]},e.id))]}),children:/* @__PURE__ */n("div",{className:"flex h-full",children:[
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import{Popover as e}from"./chunk-RJVIKGHJ.js";import{InputNumber_default as r}from"./chunk-
|
|
2
|
-
return v("button",{ref:l,type:o,"aria-pressed":a,className:N({size:r,selected:a,className:n}),...t,children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"absolute inset-0",style:C(e)})})}),z=(e,r,a)=>Math.min(a,Math.max(r,e)),D=e=>"string"==typeof e?{value:e}:e;function
|
|
3
|
-
return w("div",{id:
|
|
1
|
+
import{Popover as e}from"./chunk-RJVIKGHJ.js";import{InputNumber_default as r}from"./chunk-QPVYBN4J.js";import{parseHexColor as a,hexToHsv as n,hsvToHex as o,hexReadout as t,HUE_GRADIENT as l,HEX_MAX_LENGTH as i,svFromPoint as s,hueFromPoint as c}from"./chunk-S6OB6HJB.js";import{inputClasses as u}from"./chunk-AYZY3YNC.js";import{Tooltip as d}from"./chunk-F2RAIGCG.js";import{useShellStrings as h}from"./chunk-NRHG4R2Q.js";import{forwardRef as g,useState as p,useRef as b,useEffect as m,useId as f}from"react";import{jsx as v,jsxs as w}from"react/jsx-runtime";var x={sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10"},y={backgroundImage:"conic-gradient(var(--line-strong) 25%, var(--surface) 0 50%, var(--line-strong) 0 75%, var(--surface) 0)",backgroundSize:"8px 8px"};function k(e){return null==e||Number.isNaN(e)?100:Math.round(Math.min(100,Math.max(0,e)))}function C(e,r){if(!e)return y;const a=k(r);if(a>=100)return{background:e};const n=`color-mix(in srgb, ${e} ${a}%, transparent)`;return{backgroundImage:`linear-gradient(${n}, ${n}), ${y.backgroundImage}`,backgroundSize:`auto, ${y.backgroundSize}`}}function N({size:e="md",selected:r=!1,className:a=""}={}){return["relative inline-flex shrink-0 overflow-hidden rounded-md p-0 transition-shadow","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]","disabled:cursor-not-allowed disabled:opacity-60",r?"border-2 border-blue-500":"border border-gray-300 hover:shadow-sm",x[e],a].filter(Boolean).join(" ")}var $=g(function({color:e,size:r="md",selected:a,className:n,type:o="button",...t},l){/* @__PURE__ */
|
|
2
|
+
return v("button",{ref:l,type:o,"aria-pressed":a,className:N({size:r,selected:a,className:n}),...t,children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"absolute inset-0",style:C(e)})})}),z=(e,r,a)=>Math.min(a,Math.max(r,e)),D=e=>"string"==typeof e?{value:e}:e;function I(e,r,a){const n=a?.1:.01,o={ArrowLeft:[-n,0],ArrowRight:[n,0],ArrowDown:[0,-n],ArrowUp:[0,n]}[r];return o?{...e,s:z(e.s+o[0],0,1),v:z(e.v+o[1],0,1)}:null}function A(e,r,a){const n=a?10:1;switch(r){case"ArrowLeft":case"ArrowDown":return z(e-n,0,359);case"ArrowRight":case"ArrowUp":return z(e+n,0,359);case"PageDown":return z(e-10,0,359);case"PageUp":return z(e+10,0,359);case"Home":return 0;case"End":return 359;default:return null}}var P={boxShadow:"0 0 0 2px white, 0 0 0 3px color-mix(in srgb, black 35%, transparent)"};function M(e,r,a){const n=a?10:1;switch(r){case"ArrowLeft":case"ArrowDown":return z(e-n,0,100);case"ArrowRight":case"ArrowUp":return z(e+n,0,100);case"PageDown":return z(e-10,0,100);case"PageUp":return z(e+10,0,100);case"Home":return 0;case"End":return 100;default:return null}}function j({value:e,onChange:r,label:i,presets:u,clearable:g=!1,fallback:f,dragWrites:x="live",disabled:N=!1,opacity:z,onOpacityChange:j,onClose:R,id:K,className:S=""}){const H=h().color,O=k(z),U=e=>{const r=k(e);N||r===O||j?.(r)},L=e=>{const r=e.currentTarget.getBoundingClientRect();return r.width>0?(e.clientX-r.left)/r.width*100:O},Y=a(f??""),[E,G]=p(()=>n(e||Y||"")),J=b(e);m(()=>{e!==J.current&&(J.current=e,e?G(n(e)):Y&&G(n(Y)))},[e]);const q=a=>{N||a===e||(J.current=a,r(a))},V=e=>{const r=a(e);r&&(G(n(r)),q(r))},W=e=>{G(e),q(o(e))},[X,F]=p(!1),Q=b(E);Q.current=E;const Z=e=>({onPointerDown:r=>{if(N||0!==r.button)return;r.currentTarget.setPointerCapture?.(r.pointerId),r.currentTarget.focus({preventScroll:!0});const a=e(r,Q.current);"end"===x?(F(!0),G(a)):W(a)},onPointerMove:r=>{if(N||!(1&r.buttons))return;const a=e(r,Q.current);"end"===x?G(a):W(a)},onPointerUp:r=>{"end"===x&&X&&(F(!1),W(e(r,Q.current)))}}),_=Z((e,r)=>({...r,...s(e.clientX,e.clientY,e.currentTarget.getBoundingClientRect())})),ee=Z((e,r)=>({...r,h:c(e.clientX,e.currentTarget.getBoundingClientRect())})),re=X?o(E):e,ae=e=>`${Math.round(100*e)}%`,ne=(u??[]).map(D),oe=a(e),te=re||Y||"";/* @__PURE__ */
|
|
3
|
+
return w("div",{id:K,className:`flex w-56 flex-col gap-3 ${N?"opacity-60":""} ${S}`.trim(),onKeyDown:e=>{"Escape"===e.key&&R&&(e.preventDefault(),e.stopPropagation(),R())},children:[(ne.length>0||g)&&/* @__PURE__ */w("div",{role:"group","aria-label":H.presets,className:"flex flex-wrap gap-2",children:[g&&/* @__PURE__ */v(d,{content:H.clear,children:/* @__PURE__ */v($,{color:"",size:"sm","aria-label":H.clear,selected:""===e,disabled:N,onClick:()=>{N||""===e||(J.current="",r(""))}})}),ne.map(e=>{const r=a(e.value),n=e.label?`${e.label} · ${t(r??e.value)}`:t(r??e.value);/* @__PURE__ */
|
|
4
4
|
return v(d,{content:n,children:/* @__PURE__ */v($,{color:r??e.value,size:"sm","aria-label":n,selected:null!==r&&r===oe,disabled:N,onClick:()=>V(e.value)})},`${e.label??""}:${e.value}`)})]}),
|
|
5
|
-
/* @__PURE__ */v("div",{role:"slider",tabIndex:N?-1:0,"aria-label":
|
|
6
|
-
/* @__PURE__ */v("div",{role:"slider",tabIndex:N?-1:0,"aria-label":
|
|
5
|
+
/* @__PURE__ */v("div",{role:"slider",tabIndex:N?-1:0,"aria-label":H.square,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(100*E.v),"aria-valuetext":H.squareValue(Math.round(100*E.s),Math.round(100*E.v)),"aria-disabled":N||void 0,"data-color-square":"",onKeyDown:e=>{if(N)return;const r=I(E,e.key,e.shiftKey);r&&(e.preventDefault(),W(r))},..._,className:"relative h-36 w-full cursor-crosshair touch-none rounded-md rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundColor:o({h:E.h,s:1,v:1}),backgroundImage:"linear-gradient(to top, black, transparent), linear-gradient(to right, white, transparent)"},children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"pointer-events-none absolute h-3 w-3 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:ae(E.s),top:ae(1-E.v),...P}})}),
|
|
6
|
+
/* @__PURE__ */v("div",{role:"slider",tabIndex:N?-1:0,"aria-label":H.hue,"aria-valuemin":0,"aria-valuemax":359,"aria-valuenow":Math.round(E.h),"aria-orientation":"horizontal","aria-disabled":N||void 0,"data-color-hue":"",onKeyDown:e=>{if(N)return;const r=A(E.h,e.key,e.shiftKey);null!==r&&(e.preventDefault(),W({...E,h:r}))},...ee,className:"relative h-3 w-full cursor-pointer touch-none rounded-full rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundImage:l},children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:E.h/360*100+"%",background:o({h:E.h,s:1,v:1}),...P}})}),j&&/* @__PURE__ */v("div",{role:"slider",tabIndex:N?-1:0,"aria-label":H.opacity(i),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":O,"aria-valuetext":`${O}%`,"aria-orientation":"horizontal","aria-disabled":N||void 0,"data-color-opacity":"",onKeyDown:e=>{if(N)return;const r=M(O,e.key,e.shiftKey);null!==r&&(e.preventDefault(),U(r))},onPointerDown:e=>{N||0!==e.button||(e.currentTarget.setPointerCapture?.(e.pointerId),e.currentTarget.focus({preventScroll:!0}),U(L(e)))},onPointerMove:e=>{!N&&1&e.buttons&&U(L(e))},className:"relative h-3 w-full cursor-pointer touch-none rounded-full rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundImage:`linear-gradient(to right, transparent, ${te||"black"}), ${y.backgroundImage}`,backgroundSize:`auto, ${y.backgroundSize}`},children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:`${O}%`,...C(te||"black",O),...P}})}),
|
|
7
7
|
/* @__PURE__ */w("div",{className:"flex items-center gap-2",children:[
|
|
8
|
-
/* @__PURE__ */v("span",{"aria-hidden":"true",className:"relative h-8 w-8 shrink-0 overflow-hidden rounded-md border border-line-strong",style:C(te,j?
|
|
9
|
-
/* @__PURE__ */v(B,{value:re,placeholder:!e&&
|
|
8
|
+
/* @__PURE__ */v("span",{"aria-hidden":"true",className:"relative h-8 w-8 shrink-0 overflow-hidden rounded-md border border-line-strong",style:C(te,j?O:null)}),
|
|
9
|
+
/* @__PURE__ */v(B,{value:re,placeholder:!e&&Y?t(Y):void 0,onChange:V,label:H.hex(i),disabled:N}),j&&/* @__PURE__ */v(T,{value:O,onChange:U,label:H.opacity(i),disabled:N})]})]})}var R={sm:"w-[calc(7ch+1rem+4px)] min-w-[calc(7ch+1rem+4px)]",md:"w-[calc(7ch+1.5rem+4px)] min-w-[calc(7ch+1.5rem+4px)]",lg:"w-[calc(7ch+2rem+4px)] min-w-[calc(7ch+2rem+4px)]"},K={sm:"h-6",md:"h-8",lg:"h-10"},S=["block w-[calc(7ch+0.5rem+4px)] min-w-[calc(7ch+0.5rem+4px)] flex-none rounded-(--radius-control)","border border-transparent bg-transparent px-1 text-2xs font-mono uppercase","text-ink-strong placeholder:text-[color:var(--ink-placeholder)] hover:border-gray-300","focus:border-blue-400 focus:bg-(--surface) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)]","disabled:cursor-not-allowed disabled:opacity-60"].join(" ");function B({value:e,onChange:r,label:n,placeholder:o,disabled:l,id:s,size:c="md",look:d="box",className:h=""}){const[g,b]=p(null),m="text"===d?`${S} ${K[c]} ${h}`.trim():u({size:c,className:`${R[c]} flex-1 font-mono uppercase ${h}`.trim()}).replace(/(^| )w-full( |$)/," ");/* @__PURE__ */
|
|
10
10
|
return v("input",{id:s,type:"text",value:g??(e?t(e):""),"aria-label":n,placeholder:o,maxLength:i,spellCheck:!1,autoComplete:"off",disabled:l,onChange:n=>{b(n.target.value);const o=a(n.target.value);null!==o&&o!==e&&r(o)},onFocus:e=>e.currentTarget.select(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),b(null))},onBlur:()=>b(null),"data-hex-look":d,className:m})}function T({value:e,onChange:a,label:n,disabled:o,size:t="md"}){/* @__PURE__ */
|
|
11
|
-
return v("div",{"data-color-opacity-box":"",className:"w-20 shrink-0",children:/* @__PURE__ */v(r,{value:e,onChange:e=>{null!==e&&a(e)},min:0,max:100,precision:0,suffix:"%",size:t,"aria-label":n,disabled:o})})}function
|
|
11
|
+
return v("div",{"data-color-opacity-box":"",className:"w-20 shrink-0",children:/* @__PURE__ */v(r,{value:e,onChange:e=>{null!==e&&a(e)},min:0,max:100,precision:0,suffix:"%",size:t,"aria-label":n,disabled:o})})}function H({value:r,onChange:n,label:o,presets:l,clearable:i,fallback:s,dragWrites:c,disabled:u,id:d,showHexInput:g=!1,opacity:p,onOpacityChange:b,size:m="md",align:x="start",open:y,onOpenChange:$,className:z=""}){const D=h().color,I=k(p),A=f(),P=a(s??""),M=r||P||"",R=r?t(r):P?t(P):D.none;
|
|
12
12
|
/* @__PURE__ */
|
|
13
13
|
return w("div",{className:`inline-flex items-center ${b?"flex-wrap justify-end gap-1":g?"gap-1":"gap-2"} ${z}`.trim(),children:[
|
|
14
|
-
/* @__PURE__ */v(e,{id:d,trigger:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"absolute inset-0",style:C(
|
|
15
|
-
/* @__PURE__ */v(B,{value:r,placeholder:!r&&
|
|
14
|
+
/* @__PURE__ */v(e,{id:d,trigger:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"absolute inset-0",style:C(M,b?I:null)}),triggerLabel:D.swatch(o,R),triggerClassName:N({size:m}),"aria-label":D.panel(o),align:x,open:y,onOpenChange:$,disabled:u,children:/* @__PURE__ */v(j,{id:A,value:r,onChange:n,label:o,presets:l,clearable:i,fallback:s,dragWrites:c,disabled:u,opacity:p,onOpacityChange:b})}),g&&
|
|
15
|
+
/* @__PURE__ */v(B,{value:r,placeholder:!r&&P?t(P):void 0,onChange:e=>{u||e===r||n(e)},label:D.hex(o),disabled:u,size:m,look:"text"}),b&&/* @__PURE__ */v(T,{value:I,onChange:e=>{u||e===I||b(e)},label:D.opacity(o),disabled:u,size:m})]})}export{H as ColorPicker,j as ColorPickerPanel,$ as ColorSwatch,B as HexInput,y as NO_COLOR_FILL,k as clampOpacity,C as colorFill,N as colorSwatchClasses,A as stepHue,M as stepOpacity,I as stepSquare};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Card as e}from"./chunk-RKSCB5BJ.js";import{Select_default as a}from"./chunk-D5PXRJHA.js";import{Pagination as r}from"./chunk-Q2RNFBYS.js";import{Input_default as t}from"./chunk-
|
|
1
|
+
import{Card as e}from"./chunk-RKSCB5BJ.js";import{Select_default as a}from"./chunk-D5PXRJHA.js";import{Pagination as r}from"./chunk-Q2RNFBYS.js";import{Input_default as t}from"./chunk-J5OAQAAD.js";import{StatusBadgeProvider as i,StatusBadge as s}from"./chunk-YDJ5IZOU.js";import{Button_default as l}from"./chunk-UTISUEO4.js";import{Icon as c}from"./chunk-ISVODSRP.js";import{TH_ONE_LINE as m}from"./chunk-TD3ZQD5R.js";import{useState as n}from"react";import{jsx as d,jsxs as o}from"react/jsx-runtime";var h={active:"success",invited:"queued",suspended:"danger",pending:"pending"},p=[{name:"Alice Nguyen",email:"alice@acme.co",role:"Admin",status:"active"},{name:"Marco Reyes",email:"marco@acme.co",role:"Editor",status:"invited"},{name:"Priya Patel",email:"priya@acme.co",role:"Editor",status:"active"},{name:"Tom Becker",email:"tom@acme.co",role:"Viewer",status:"suspended"},{name:"Sara Lind",email:"sara@acme.co",role:"Viewer",status:"pending"},{name:"Yuki Tanaka",email:"yuki@acme.co",role:"Editor",status:"active"}];function u(){const[c,u]=n(1),[g,f]=n(""),[y,v]=n("");/* @__PURE__ */
|
|
2
2
|
return d(i,{groups:h,children:/* @__PURE__ */d("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */o("div",{className:"mx-auto max-w-5xl space-y-4",children:[
|
|
3
3
|
/* @__PURE__ */o("div",{className:"flex items-center justify-between gap-4",children:[
|
|
4
4
|
/* @__PURE__ */d("h1",{className:"text-xl font-semibold text-gray-900",children:"Members"}),
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Input_default as e}from"./chunk-
|
|
1
|
+
import{Input_default as e}from"./chunk-J5OAQAAD.js";import{useState as r,useRef as t}from"react";import{jsx as o}from"react/jsx-runtime";function n({value:n,label:a,onDone:u}){const[l,c]=r(n),i=t(!1),p=e=>{i.current||(i.current=!0,u(e))};/* @__PURE__ */
|
|
2
2
|
return o(e,{size:"sm",autoFocus:!0,"aria-label":a,value:l,onChange:e=>c(e.target.value),onFocus:e=>e.currentTarget.select(),onKeyDown:e=>{e.stopPropagation(),"Enter"===e.key?(e.preventDefault(),p(l.trim()||n)):"Escape"===e.key&&(e.preventDefault(),p(null))},onBlur:()=>p(l.trim()||n),onClick:e=>e.stopPropagation()})}export{n as RenameField};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{IconButton_default as e}from"./chunk-NWS5G7FE.js";import{inputClasses as r,PLACEHOLDER_INK as n}from"./chunk-AYZY3YNC.js";import{DropdownMenu as t}from"./chunk-EX3DARI3.js";import{Tooltip as i}from"./chunk-F2RAIGCG.js";import{iconButtonClasses as a}from"./chunk-UQYNPYF4.js";import{forwardRef as s}from"react";import{jsx as o,jsxs as l}from"react/jsx-runtime";var c={sm:"sm",md:"sm",lg:"md",touch:"touch-sm"},m={sm:"pr-8",md:"pr-8",lg:"pr-10",touch:"pr-12"};function p({children:e}){/* @__PURE__ */
|
|
2
2
|
return o("span",{className:"absolute right-1 top-1/2 flex -translate-y-1/2 items-center gap-1",children:e})}function d({action:e,size:r="md"}){/* @__PURE__ */
|
|
3
|
-
return o(h,{action:e,size:c[r]})}var u=["","pr-8","pr-16"];function h({action:
|
|
4
|
-
return o(i,{content:s,describe:!1,children:m?/* @__PURE__ */o(t,{"aria-label":s,trigger:l,items:m,triggerClassName:a({size:
|
|
5
|
-
/* @__PURE__ */o("input",{ref:f,"aria-invalid":
|
|
3
|
+
return o(h,{action:e,size:c[r]})}var u=["","pr-8","pr-16"];function h({action:r,size:n}){const{label:s,icon:l,onClick:c,menu:m}=r;/* @__PURE__ */
|
|
4
|
+
return o(i,{content:s,describe:!1,children:m?/* @__PURE__ */o(t,{"aria-label":s,trigger:l,items:m,triggerClassName:a({size:n})}):/* @__PURE__ */o(e,{"aria-label":s,size:n,onClick:c,children:l})})}var f=s(function({invalid:e,leftIcon:t,rightAdornment:i,endAction:a,size:s,className:c="",readOnly:u,...h},f){const g=s??"md",N=`${t?"pl-10":""} ${a?m[g]:i?"pr-10":""}`.trim(),v=
|
|
5
|
+
/* @__PURE__ */o("input",{ref:f,"aria-invalid":e||void 0,readOnly:u,className:r({invalid:e,size:s,readOnly:u,className:[N,c].filter(Boolean).join(" ")}),...h});return t||i||a?/* @__PURE__ */l("div",{className:"relative",children:[t&&/* @__PURE__ */o("span",{className:`pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 ${n}`,children:t}),v,a?/* @__PURE__ */o(p,{children:/* @__PURE__ */o(d,{action:a,size:g})}):i&&/* @__PURE__ */o("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400",children:i})]}):v});export{u as END_ACTIONS_PAD,c as INPUT_END_ACTION_SIZE,d as InputEndActionButton,p as InputEndActionSlot,f as Input_default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{IconPicker as e}from"./chunk-GZRNOIEE.js";import{ColorPicker as t}from"./chunk-
|
|
2
|
-
return i("div",{role:"group","aria-label":a,"data-border":c?"each":"all",className:"grid w-full min-w-0 grid-cols-2 gap-2",children:[g?c?/* @__PURE__ */i(s,{children:[
|
|
3
|
-
/* @__PURE__ */n("div",{"data-border-color":"",className:"col-span-2 flex min-w-0 items-center",children:/* @__PURE__ */n(t,{value:m.color??"",onChange:e=>{
|
|
1
|
+
import{IconPicker as e}from"./chunk-GZRNOIEE.js";import{ColorPicker as t}from"./chunk-F3EBYHIE.js";import{InputNumber_default as r,stepRounding as l}from"./chunk-QPVYBN4J.js";import{BORDER_LINE_STYLES as o}from"./chunk-NOMWJTN2.js";import{Icon as a}from"./chunk-ISVODSRP.js";import{jsxs as i,Fragment as s,jsx as n}from"react/jsx-runtime";var d=["top","right","bottom","left"];function m(e){const t=e??{},r="number"==typeof t.width?t.width:0;return Object.fromEntries(d.map(e=>[e,"number"==typeof t[e]?t[e]:r]))}function h(e,t){const r=e??{},l=m(t),o=d.some(e=>"number"==typeof r[e]),a=d.map(e=>"number"==typeof r[e]?r[e]:"number"==typeof r.width?r.width:o?0:l[e]);return!a.every(e=>e===a[0])}var c="h-3.5 w-3.5",u={all:/* @__PURE__ */n(a,{name:"border-all","aria-hidden":"true",className:c}),top:/* @__PURE__ */n(a,{name:"border-top","aria-hidden":"true",className:c}),right:/* @__PURE__ */n(a,{name:"border-right","aria-hidden":"true",className:c}),bottom:/* @__PURE__ */n(a,{name:"border-bottom","aria-hidden":"true",className:c}),left:/* @__PURE__ */n(a,{name:"border-left","aria-hidden":"true",className:c})},p={solid:/* @__PURE__ */n(a,{name:"line-solid","aria-hidden":"true",className:c}),dashed:/* @__PURE__ */n(a,{name:"line-dashed","aria-hidden":"true",className:c}),dotted:/* @__PURE__ */n(a,{name:"line-dotted","aria-hidden":"true",className:c})};function f({label:a,value:m,onChange:h,each:c,placeholder:f,presets:b,words:w,widths:g=!0,styles:y=!0,min:N=0,max:v=20,step:x=1,readOnly:j,units:S}){const k=e=>"number"==typeof m[e]?m[e]:null,O=(e,t)=>{const r={...m};if("number"==typeof m.width)for(const e of d)null===k(e)&&(r[e]=m.width);r[e]=t,delete r.width,h(r)},E=(e,t,o,a,i,s)=>/* @__PURE__ */n("div",{"data-side":e,className:"all"===e?"col-span-2 min-w-0":"min-w-0",children:/* @__PURE__ */n(r,{value:a,onChange:s,min:N,max:v,step:x,...l(x),steppers:"compact",readOnly:j,placeholder:i,prefix:o,suffix:w.unit,units:S,"aria-label":t})}),C=d.map(k),I="number"==typeof m.width?m.width:C.every(e=>null!==e&&e===C[0])?C[0]:null,B=null===I&&C.some(e=>null!==e),H=d.every(e=>f.sides[e]===f.sides.top)?String(f.sides.top):"–",J=e=>k(e)??("number"==typeof m.width?m.width:null),P=m.style??f.style;/* @__PURE__ */
|
|
2
|
+
return i("div",{role:"group","aria-label":a,"data-border":c?"each":"all",className:"grid w-full min-w-0 grid-cols-2 gap-2",children:[g?c?/* @__PURE__ */i(s,{children:[E("left",w.sides.left,u.left,J("left"),String(f.sides.left),e=>O("left",e)),E("top",w.sides.top,u.top,J("top"),String(f.sides.top),e=>O("top",e)),E("right",w.sides.right,u.right,J("right"),String(f.sides.right),e=>O("right",e)),E("bottom",w.sides.bottom,u.bottom,J("bottom"),String(f.sides.bottom),e=>O("bottom",e))]}):E("all",w.width,u.all,I,B?"–":H,e=>{const t={...m,width:e};for(const e of d)delete t[e];h(t)}):null,y&&/* @__PURE__ */n("div",{"data-border-style":"",className:"col-span-2 min-w-0",children:/* @__PURE__ */n(e,{label:w.style,value:P,disabled:j,onChange:e=>{j||h({...m,style:e})},options:o.map(e=>({value:e,label:w.styles[e],icon:p[e]}))})}),
|
|
3
|
+
/* @__PURE__ */n("div",{"data-border-color":"",className:"col-span-2 flex min-w-0 items-center",children:/* @__PURE__ */n(t,{value:m.color??"",onChange:e=>{j||h({...m,color:e})},label:w.color,presets:b,fallback:f.color,showHexInput:!0,size:"md",disabled:j})})]})}export{f as BorderInput,m as borderSides,h as borderStartEach};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{InputNumber_default as a,stepRounding as e}from"./chunk-
|
|
1
|
+
import{InputNumber_default as a,stepRounding as e}from"./chunk-QPVYBN4J.js";import{Icon as r}from"./chunk-ISVODSRP.js";import{jsxs as n,jsx as i}from"react/jsx-runtime";var l="h-3.5 w-3.5",s={x:/* @__PURE__ */i(r,{name:"nudge-x","aria-hidden":"true",className:l}),y:/* @__PURE__ */i(r,{name:"nudge-y","aria-hidden":"true",className:l})};function m({label:r,value:l,onChange:m,words:t,placeholder:d,min:o=-200,max:c=200,step:u=1,readOnly:p,units:h}){const x=r=>/* @__PURE__ */i("div",{"data-axis":r,className:"min-w-0",children:/* @__PURE__ */i(a,{value:l[r],onChange:a=>m({...l,[r]:a}),min:o,max:c,step:u,...e(u),steppers:"compact",readOnly:p,placeholder:d[r],prefix:s[r],suffix:t.unit,units:h,"aria-label":t[r]})});/* @__PURE__ */
|
|
2
2
|
return n("div",{role:"group","aria-label":r,className:"grid min-w-0 grid-cols-2 gap-2",children:[x("x"),x("y")]})}export{m as PositionInput};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{CountBadge as e}from"./chunk-PFOTEDSQ.js";import{
|
|
1
|
+
import{CountBadge as e}from"./chunk-PFOTEDSQ.js";import{SettingRowNameContext as i,SettingAutoContext as n}from"./chunk-2NMW66P5.js";import{isShown as a}from"./chunk-HCP7WOAL.js";import{useShellStrings as t}from"./chunk-NRHG4R2Q.js";import{isValidElement as l}from"react";import{jsx as s,jsxs as r,Fragment as d}from"react/jsx-runtime";var c={pad:"p-4",gap:"gap-4",text:"text-sm",bodyTop:"mt-4",bodyPad:"pt-3"},m=e=>Array.isArray(e)?e.some(m):l(e);function o({label:l,icon:o,action:h,value:u,readout:f,changed:p=!1,description:x,children:N,controlId:v,labelId:g,unknownText:b="—",quiet:y=!1,size:k="default",viewState:w,divider:$=!0,showWhen:j,values:P,context:T,className:A=""}){const F=t();if(!a(j,P,T))return null;const W="auto"===w?/* @__PURE__ */s("span",{"data-setting-auto":"","aria-hidden":"true",className:"shrink-0 rounded-sm border border-line px-1 text-2xs font-normal leading-4 text-ink-faint",children:F.settingView.auto}):"edited"===w?/* @__PURE__ */r("span",{"data-setting-edited":"",className:"inline-flex shrink-0 items-center",children:[
|
|
2
2
|
/* @__PURE__ */s("span",{"aria-hidden":"true",className:"inline-flex",children:/* @__PURE__ */s(e,{dot:!0,tone:"accent"})}),
|
|
3
|
-
/* @__PURE__ */s("span",{className:"sr-only",children:F.settingView.edited})]}):null,H=null!=f&&!1!==f;if("compact"===k){const e=m(u),
|
|
4
|
-
/* @__PURE__ */s("span",{className:"es-field-label",id:t,children:l}),W]}),y=e=>/* @__PURE__ */s(
|
|
3
|
+
/* @__PURE__ */s("span",{className:"sr-only",children:F.settingView.edited})]}):null,H=null!=f&&!1!==f;if("compact"===k){const e=m(u),a=m(h);if(!e&&!a)return null;const t=g,c=["es-field"];e||c.push("is-inline"),p&&c.push("is-changed"),A&&c.push(A);const b=/* @__PURE__ */r(d,{children:[null!=o&&/* @__PURE__ */s("span",{className:"es-field-icon","aria-hidden":"true",children:o}),
|
|
4
|
+
/* @__PURE__ */s("span",{className:"es-field-label",id:t,children:l}),W]}),y=e=>/* @__PURE__ */s(i.Provider,{value:t,children:/* @__PURE__ */s(n.Provider,{value:"auto"===w,children:e})});/* @__PURE__ */
|
|
5
5
|
return r("div",{className:c.join(" "),children:[
|
|
6
|
-
/* @__PURE__ */r("div",{className:"es-field-head",children:[v?/* @__PURE__ */s("label",{className:"es-field-name",htmlFor:v,children:b}):/* @__PURE__ */s("span",{className:"es-field-name",children:b}),H&&/* @__PURE__ */s("span",{className:"es-field-value",children:f}),
|
|
6
|
+
/* @__PURE__ */r("div",{className:"es-field-head",children:[v?/* @__PURE__ */s("label",{className:"es-field-name",htmlFor:v,children:b}):/* @__PURE__ */s("span",{className:"es-field-name",children:b}),H&&/* @__PURE__ */s("span",{className:"es-field-value",children:f}),a&&y(h)]}),e&&/* @__PURE__ */s("div",{className:"es-field-ctl",children:y(u)}),x?/* @__PURE__ */s("p",{className:"es-field-hint",children:x}):null,N]})}const I=c,O=void 0!==u||void 0===N&&null==h,Q=null==u||""===u,R=y?"text-gray-500":"text-gray-800",S=Q?"text-gray-400":y?"text-gray-500":"text-gray-900",V=`${I.text} font-medium ${R}`,q=v?/* @__PURE__ */s("label",{htmlFor:v,id:g,className:V,children:l}):/* @__PURE__ */s("span",{id:g,className:V,children:l}),z=/* @__PURE__ */s(i.Provider,{value:g,children:/* @__PURE__ */s(n.Provider,{value:"auto"===w,children:Q?b:u})}),B=[$?"border-t border-line-subtle first:border-t-0":"",I.pad,A].filter(Boolean).join(" "),C=null!=N&&!1!==N&&/* @__PURE__ */s("div",{className:`${I.bodyTop} border-t border-line-subtle ${I.bodyPad}`,children:N});/* @__PURE__ */
|
|
7
7
|
return r("div",H?{className:B,children:[
|
|
8
8
|
/* @__PURE__ */r("div",{"data-setting-line":"",className:"flex flex-wrap items-center justify-between gap-x-2 gap-y-2",children:[
|
|
9
9
|
/* @__PURE__ */s("div",{className:"flex-1 basis-0",children:/* @__PURE__ */r("div",{className:`flex min-w-0 items-center gap-2 ${R}`,children:[null!=o&&/* @__PURE__ */s("span",{"aria-hidden":"true",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:o}),q,W]})}),
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import{copyToClipboard as e,selectionAt as t}from"./chunk-XYVFJLAU.js";import{useTableNav as n}from"./chunk-ATMJ5ZPK.js";import{escapeHtml as r}from"./chunk-G6DKCCWH.js";import{ListFooter as o}from"./chunk-U73K3ICC.js";import{ListLoadError as l}from"./chunk-2YHS5E27.js";import{ResizableTable as i}from"./chunk-
|
|
2
|
-
return x(l,{title:
|
|
3
|
-
/* @__PURE__ */x("div",{ref:Q}),Y&&/* @__PURE__ */x(p,{size:"sm",padding:"py-3",label:re.list.loadingMore})]}):void 0;let ke=null;if(ee){const{x:t,y:n,item:r,text:o,firstColumn:l}=ee,i=q?q(ce):[],a=ce.length,c=()=>te(null),u=void 0
|
|
1
|
+
import{copyToClipboard as e,selectionAt as t}from"./chunk-XYVFJLAU.js";import{useTableNav as n}from"./chunk-ATMJ5ZPK.js";import{escapeHtml as r}from"./chunk-G6DKCCWH.js";import{ListFooter as o}from"./chunk-U73K3ICC.js";import{ListLoadError as l}from"./chunk-2YHS5E27.js";import{ResizableTable as i}from"./chunk-7N6CVTWO.js";import{Checkbox_default as a}from"./chunk-CGZBDI6C.js";import{LoadingSpinner as c}from"./chunk-4PJFL26P.js";import{PopupMenu as d,PopupMenuLabel as s,PopupMenuItem as h,PopupMenuDivider as m}from"./chunk-THAPVKEJ.js";import{keepsNativeMenu as u}from"./chunk-5QFPTDQF.js";import{LoadingSpinner as p}from"./chunk-R2VKEMZH.js";import{shellHttp as f}from"./chunk-STKJA4PV.js";import{toast_default as g}from"./chunk-I2NVBDKH.js";import{useShellStrings as y}from"./chunk-NRHG4R2Q.js";import{useState as k,useRef as b}from"react";import{jsx as x,Fragment as w,jsxs as C}from"react/jsx-runtime";function j(e){return Array.from(e.children).filter(e=>void 0!==e.dataset?.colKey&&"_select"!==e.dataset.colKey)}function v(e){return("string"==typeof e.innerText?e.innerText:e.textContent??"").replace(/\s+/g," ").trim()}function S(S){const{items:R,isLoading:N,emptyState:L,totalCount:T,isError:$,onRetry:A,errorTitle:K,errorMessage:E,tableId:P,columns:F,renderCell:M,getRowId:H=e=>e.id,sort:I,onSort:U,selected:D,setSelected:J,onRowClick:V,onRowHover:O,getRowClassName:W,footerLabel:B,footerExtra:_,footerExtraAfter:G,sentinelRef:Q,isFetchingNextPage:Y,saveDefaultPerms:Z,exportEndpoint:z,exportFilename:X="export.csv",contextActions:q}=S,[ee,te]=k(null),ne=b(null),re=y(),oe=re.entityList,le=e=>{J(t=>{const n=new Set(t),r=H(e);return n.has(r)?n.delete(r):n.add(r),n})},ie=()=>{J(e=>{const t=R.map(H),n=new Set(e);return t.every(t=>e.has(t))?t.forEach(e=>n.delete(e)):t.forEach(e=>n.add(e)),n})},ae=n(R,V,le,ie,(e,t)=>{J(n=>{const r=new Set(n);for(let n=e;n<=t;n++)r.add(H(R[n]));return r})},ne),ce=R.filter(e=>D.has(H(e))),de=()=>{const e=[...ne.current?.querySelectorAll("tr[data-row-idx]")??[]].filter(e=>{const t=R[Number(e.dataset.rowIdx)];return void 0!==t&&D.has(H(t))}),t=e.length?j(e[0]).map(e=>e.dataset.colKey??""):[],n=new Map(F.map(e=>[e.key,e.label]));return{keys:t,header:t.map(e=>n.get(e)??e),body:e.map(e=>j(e).map(v))}},se=()=>{te(null);const{header:t,body:n}=de();if(!n.length)return;const o=[t,...n].map(e=>e.join("\t")).join("\n"),l="<table><thead><tr>"+t.map(e=>`<th>${r(e)}</th>`).join("")+"</tr></thead><tbody>"+n.map(e=>`<tr>${e.map(e=>`<td>${r(e)}</td>`).join("")}</tr>`).join("")+"</tbody></table>";e(oe.copiedRows(n.length),o,l)},he=async()=>{te(null);const e=ce.map(H);if(!e.length||!z)return;const t=new URLSearchParams({ids:e.join(",")}),n=(()=>{const e=new Map(F.map(e=>[e.key,e.exportLabel??e.label]));try{const t=localStorage.getItem(`col-config-${P}`);if(t){const n=JSON.parse(t).filter(t=>!t.hidden&&"_select"!==t.key&&e.has(t.key)).map(t=>`${t.key}|${e.get(t.key)}`);if(n.length)return n.join(",")}}catch{}return F.filter(e=>!e.defaultHidden).map(e=>`${e.key}|${e.exportLabel??e.label}`).join(",")})();n&&t.set("cols",n);const r=z.includes("?")?"&":"?";try{const n=await f.get(`${z}${r}${t}`,{responseType:"blob"}),o=window.URL.createObjectURL(new Blob([n.data],{type:"text/csv"})),l=document.createElement("a");l.href=o,l.download=X,l.click(),window.URL.revokeObjectURL(o);const i=n.headers??{},a=Number(i["x-row-count"]);if("true"===String(i["x-truncated"]))return void g.notify(Number.isFinite(a)?oe.exportTruncated(a,e.length):oe.exportTruncatedUnknown(e.length));g.success(oe.exported(e.length))}catch{g.error(oe.exportFailed)}};if(N)/* @__PURE__ */return x(c,{});if($&&0===R.length)/* @__PURE__ */
|
|
2
|
+
return x(l,{title:K,message:E,onRetry:A});if(0===R.length)/* @__PURE__ */return x(w,{children:L});const me=R.length>0&&ce.length===R.length,ue=ce.length>0&&!me,pe=D.size-ce.length,fe=[{key:"_select",label:"",defaultWidth:52,minWidth:52,headerNode:/* @__PURE__ */x(a,{"aria-label":re.table.selectAll,checked:me,indeterminate:ue,onChange:ie,style:{height:14,width:14}})},...F],ge=/* @__PURE__ */x(o,{selectedCount:ce.length,hiddenSelectedCount:pe,loadedCount:R.length,totalCount:T,label:B,isFetchingMore:Y,extra:_,extraAfter:G}),ye=Q?/* @__PURE__ */C(w,{children:[
|
|
3
|
+
/* @__PURE__ */x("div",{ref:Q}),Y&&/* @__PURE__ */x(p,{size:"sm",padding:"py-3",label:re.list.loadingMore})]}):void 0;let ke=null;if(ee){const{x:t,y:n,item:r,text:o,firstColumn:l}=ee,i=q?q(ce):[],a=ce.length,c=()=>te(null),u=void 0!==T&&T>R.length;ke=/* @__PURE__ */C(d,{portal:!0,style:{left:t,top:n},onClose:c,minWidth:210,children:[
|
|
4
4
|
/* @__PURE__ */x(s,{children:pe>0?re.list.selectedNotShown(a,pe):re.list.selected(a)}),
|
|
5
|
-
/* @__PURE__ */x(h,{className:"font-medium",onClick:()=>{c(),
|
|
5
|
+
/* @__PURE__ */x(h,{className:"font-medium",onClick:()=>{c(),V(r)},children:oe.open}),
|
|
6
6
|
/* @__PURE__ */x(m,{}),o&&/* @__PURE__ */x(h,{onClick:()=>{c(),e(oe.copiedText,o.text,o.html)},children:oe.copy}),l&&/* @__PURE__ */x(h,{onClick:()=>(t=>{te(null);const{keys:n,body:r}=de(),o=n.indexOf(t.key);o<0||!r.length||e(t.label,r.map(e=>e[o]).join("\n"))})(l),children:oe.copyColumn(l.label)}),
|
|
7
7
|
/* @__PURE__ */x(h,{disabled:0===a,onClick:se,children:oe.copyRows(a)}),z&&/* @__PURE__ */x(h,{onClick:he,children:oe.exportSelected}),i.map((e,t)=>/* @__PURE__ */C("div",{children:[(e.divider||0===t)&&/* @__PURE__ */x(m,{}),
|
|
8
8
|
/* @__PURE__ */x(h,{danger:e.danger,disabled:e.disabled,onClick:()=>{c(),e.onClick(ce)},children:e.label})]},t)),
|
|
9
|
-
/* @__PURE__ */x(m,{}),!me&&/* @__PURE__ */x(h,{onClick:()=>{c(),J(e=>/* @__PURE__ */new Set([...e,...R.map(
|
|
10
|
-
/* @__PURE__ */x(h,{onClick:()=>{c(),J(/* @__PURE__ */new Set)},children:oe.clearSelection}),
|
|
9
|
+
/* @__PURE__ */x(m,{}),!me&&/* @__PURE__ */x(h,{onClick:()=>{c(),J(e=>/* @__PURE__ */new Set([...e,...R.map(H)]))},children:u?oe.selectAllLoaded(R.length):oe.selectAll}),
|
|
10
|
+
/* @__PURE__ */x(h,{onClick:()=>{c(),J(/* @__PURE__ */new Set)},children:oe.clearSelection}),A&&/* @__PURE__ */x(h,{onClick:()=>{c(),A()},children:oe.refresh})]})}/* @__PURE__ */
|
|
11
11
|
return C("div",{className:"flex-1 flex flex-col mb-1 bg-white rounded-lg shadow overflow-hidden",children:[
|
|
12
|
-
/* @__PURE__ */x("div",{className:"flex-1 min-h-0 flex flex-col",children:/* @__PURE__ */x(i,{tableId:
|
|
13
|
-
return x("tr",{"data-row-idx":r,className:`cursor-pointer ${ae===r?"bg-blue-50 ring-1 ring-inset ring-blue-300":D.has(o)?"bg-blue-50 hover:bg-blue-100":"hover:bg-gray-50"} ${
|
|
12
|
+
/* @__PURE__ */x("div",{className:"flex-1 min-h-0 flex flex-col",children:/* @__PURE__ */x(i,{tableId:P,columns:fe,sort:I,onSort:U,footer:ge,afterBody:ye,saveDefaultPerms:Z,children:e=>/* @__PURE__ */x("tbody",{ref:ne,className:"divide-y divide-gray-100",children:R.map((n,r)=>{const o=H(n);/* @__PURE__ */
|
|
13
|
+
return x("tr",{"data-row-idx":r,className:`cursor-pointer ${ae===r?"bg-blue-50 ring-1 ring-inset ring-blue-300":D.has(o)?"bg-blue-50 hover:bg-blue-100":"hover:bg-gray-50"} ${W?.(n)??""}`,onClick:()=>V(n),onContextMenu:e=>((e,n)=>{if(e.shiftKey||u(e.target))return;e.preventDefault();const r=H(n);D.has(r)||J(/* @__PURE__ */new Set([r]));const o=j(e.currentTarget)[0]?.dataset.colKey,l=o?F.find(e=>e.key===o)?.label:void 0;te({x:e.clientX,y:e.clientY,item:n,text:t(e.target),firstColumn:o&&l?{key:o,label:l}:null})})(e,n),onMouseEnter:O?()=>O(n):void 0,children:e.map(e=>/* @__PURE__ */x("td",{"data-col-key":e.key,className:"px-4 py-3 whitespace-nowrap text-sm overflow-hidden",children:"_select"===e.key?/* @__PURE__ */x(a,{"aria-label":re.table.selectRow,checked:D.has(o),onChange:()=>le(n),onClick:e=>e.stopPropagation(),style:{height:14,width:14}}):M(n,e.key)},e.key))},o)})})})}),ke]})}export{S as EntityList};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import{SidebarBarContext as e,SidebarSheetContext as r}from"./chunk-QWK6DRSN.js";import{readStoredWidth as l,ResizeHandle as a}from"./chunk-JLSXDYS4.js";import{WindowInsetContext as n}from"./chunk-YI4T5I5D.js";import{useIsPhone as t}from"./chunk-UGTRSRIW.js";import{Icon as i}from"./chunk-ISVODSRP.js";import{PANEL_SURFACE as o}from"./chunk-BWJZTHZ6.js";import{useBrowserState as s}from"./chunk-WCCS4VFE.js";import{useBrowserLayoutEffect as c}from"./chunk-ZDXRSY2Y.js";import{useShellStrings as d}from"./chunk-NRHG4R2Q.js";import{useContext as h,useRef as u,useState as m,useReducer as f,useMemo as p,Fragment as b,useEffect as x}from"react";import{jsxs as g,jsx as v,Fragment as w}from"react/jsx-runtime";var N=(e,r,l)=>Math.min(Math.max(e,r),l);function k({sidebar:e,sidebarTop:r,sidebarBottom:i,rail:o,railClassName:b="border-r border-line px-1 pb-2",children:x,side:k="left",storageKey:C,defaultWidth:S=256,minWidth:$=180,maxWidth:D=480,className:R="",sidebarClassName:W=("right"===k?"border-l border-gray-200 bg-gray-50":"border-r border-gray-200 bg-gray-50"),contentClassName:I="bg-white"}){const z="right"===k,O=d().sidebar,P=t(),E=function(){const[e,r]=m(!1),l=u(null),a=u(/* @__PURE__ */new Map),[,n]=f(e=>e+1,0),t=p(()=>({report(e,r,l){const t={label:r,el:l};return a.current.set(e,t),n(),()=>{a.current.get(e)===t&&(a.current.delete(e),n())}}}),[]);return{api:t,open:e,setOpen:r,current:()=>[...a.current.values()].sort((e,r)=>e.el&&r.el&&e.el.compareDocumentPosition(r.el)&Node.DOCUMENT_POSITION_PRECEDING?1:-1).map(e=>e.label()),trigger:l}}(),[T,K]=s(()=>(C?l(C,$,D):null)??N(S,$,D),N(S,$,D)),M=null!=r||null!=i,Y=h(n),G=u(null),[L,Z]=m(!1),B=Y?.claim;c(()=>{if(!B||z||P||!G.current)return;const e=B(G.current);return e?(Z(!0),()=>{Z(!1),e()}):void 0},[B,z,P]);const F=L&&!!Y?.over,H=M||F,J="shrink-0 "+(Y?.compact?"h-(--row-height-compact-bar)":"h-(--row-height-window-bar)"),Q=/* @__PURE__ */g("div",{className:"relative flex h-full shrink-0 flex-col",style:{width:T},children:[
|
|
2
|
+
/* @__PURE__ */g("div",{className:`flex h-full flex-col ${H?"overflow-hidden":"overflow-y-auto"} ${W}`,children:[F&&/* @__PURE__ */v("div",{"data-window-strip":"","aria-hidden":"true",className:J}),null!=r&&/* @__PURE__ */v("div",{className:"flex shrink-0 flex-col gap-2 px-2 pb-2 "+(F?"pt-1":"pt-3"),children:r}),H?/* @__PURE__ */v("div",{className:"min-h-0 flex-1 overflow-y-auto",children:e}):e,null!=i&&/* @__PURE__ */v("div",{className:"mt-auto flex shrink-0 flex-col gap-2 border-t border-gray-200 px-2 py-3",children:i})]}),
|
|
3
|
+
/* @__PURE__ */v(a,{side:k,width:T,onResize:K,min:$,max:D,defaultWidth:N(S,$,D),storageKey:C,hint:O.resize})]}),U=null==o||z?null:/* @__PURE__ */g("div",{"data-sidebar-rail":"",className:`flex h-full shrink-0 flex-col ${b}`,children:[/* @__PURE__ */v("div",F?{"data-window-strip":"","aria-hidden":"true",className:J}:{"aria-hidden":"true",className:"h-2 shrink-0"}),o]}),V=
|
|
4
|
+
/* @__PURE__ */v("div",{className:`flex min-w-0 flex-1 flex-col ${I}${L?" pr-1":""}`,children:x});if(!P)/* @__PURE__ */
|
|
5
|
+
return v("div",{ref:G,className:`flex h-full w-full overflow-hidden ${R}`,children:/* @__PURE__ */g(w,U?{children:[U,
|
|
6
|
+
/* @__PURE__ */g("div",{className:"flex h-full min-w-0 flex-1 overflow-hidden",children:[Q,V,null]})]}:{children:[z?null:Q,V,z?Q:null]})});const X=/* @__PURE__ */g("div",{className:"relative flex h-full min-w-0 flex-col overflow-hidden "+(U?"flex-1":`w-full ${R}`),children:[
|
|
7
|
+
/* @__PURE__ */v(y,{phone:E,top:r,fallback:O.sections}),V,
|
|
8
|
+
/* @__PURE__ */v(j,{phone:E,bottom:i,label:O.sections,closeLabel:O.closeSections,children:e})]});return U?/* @__PURE__ */v("div",{className:`flex h-full w-full overflow-hidden ${R}`,children:/* @__PURE__ */g(w,{children:[U,X]})}):X}function y({phone:r,top:l,fallback:a}){const n=r.current();/* @__PURE__ */
|
|
9
|
+
return g("div",{"data-sidebar-section-bar":!0,className:"flex h-11 shrink-0 items-center gap-2 border-b border-gray-200 bg-white px-3",children:[
|
|
10
|
+
/* @__PURE__ */g("button",{ref:r.trigger,type:"button","aria-haspopup":"dialog","aria-expanded":r.open,onClick:()=>r.setOpen(!0),className:"flex h-8 min-w-0 flex-1 items-center gap-1 text-left text-sm font-semibold text-gray-900",children:[
|
|
11
|
+
/* @__PURE__ */v("span",{className:"min-w-0 truncate",children:0===n.length?a:n.map((e,r)=>/* @__PURE__ */g(b,{children:[r>0&&" · ",e]},r))}),
|
|
12
|
+
/* @__PURE__ */v(i,{name:"chevron-down",className:"size-4 shrink-0",strokeWidth:2,"aria-hidden":"true"})]}),null!=l&&/* @__PURE__ */v(e.Provider,{value:!0,children:/* @__PURE__ */v("div",{className:"flex min-w-0 max-w-[60%] shrink-0 items-center gap-2",children:l})})]})}function j({phone:e,bottom:l,label:a,closeLabel:n,children:t}){const i=u(null),{open:s,setOpen:c,trigger:d}=e,h=()=>{c(!1),i.current?.contains(document.activeElement)&&d.current?.focus()};return x(()=>{s&&i.current?.focus()},[s]),
|
|
13
|
+
/* @__PURE__ */g(r.Provider,{value:e.api,children:[s&&/* @__PURE__ */v("button",{type:"button","aria-label":n,onClick:h,className:"absolute inset-0 z-(--z-in-box) cursor-default bg-gray-900/40"}),
|
|
14
|
+
/* @__PURE__ */g("div",{ref:i,role:"dialog","aria-modal":"true","aria-label":a,tabIndex:-1,"data-sidebar-section-sheet":!0,onKeyDown:e=>{"Escape"===e.key&&(e.stopPropagation(),h())},onClick:e=>{const r=e.target.closest("button, a");!r||r.hasAttribute("aria-expanded")||r.closest("[data-sheet-keep-open]")||h()},className:`${s?"flex":"hidden"} absolute inset-x-0 bottom-0 z-(--z-in-box) max-h-[75%] flex-col rounded-t-2xl pt-2 ${o}`,children:[
|
|
15
|
+
/* @__PURE__ */v("div",{className:"mx-auto mb-2 h-1 w-9 shrink-0 rounded-full bg-gray-300","aria-hidden":"true"}),
|
|
16
|
+
/* @__PURE__ */v("div",{className:"min-h-0 flex-1 overflow-y-auto px-2 pb-3",children:t}),null!=l&&/* @__PURE__ */v("div",{className:"flex shrink-0 flex-col gap-2 border-t border-gray-200 px-2 py-3",children:l})]})]})}export{k as SidebarLayout};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import{nextEnabledIndex as e}from"./chunk-EO5RLFRX.js";import{flattenOptionItems as t,filterOptionItems as n,optionMatches as r,groupedRows as l,OptionCheck as o,OptionSublabel as i}from"./chunk-K5YT5PMJ.js";import{END_ACTIONS_PAD as a,InputEndActionSlot as s,InputEndActionButton as c}from"./chunk-
|
|
2
|
-
return
|
|
3
|
-
/* @__PURE__ */M("div",{"aria-hidden":"true",className:"pointer-events-none invisible absolute left-0 top-0 h-0 w-0 overflow-hidden",children:/* @__PURE__ */M("span",{ref:
|
|
4
|
-
/* @__PURE__ */
|
|
5
|
-
/* @__PURE__ */M("span",{onMouseDown:e=>e.preventDefault(),className:"flex opacity-0 transition-opacity group-hover:opacity-100 focus-within:opacity-100",children:/* @__PURE__ */M(c,{action:{label:ke.select.clear,icon:/* @__PURE__ */M(p,{name:"close"}),onClick:()=>{ie([]),
|
|
6
|
-
/* @__PURE__ */
|
|
1
|
+
import{nextEnabledIndex as e}from"./chunk-EO5RLFRX.js";import{flattenOptionItems as t,filterOptionItems as n,optionMatches as r,groupedRows as l,OptionCheck as o,OptionSublabel as i}from"./chunk-K5YT5PMJ.js";import{END_ACTIONS_PAD as a,InputEndActionSlot as s,InputEndActionButton as c}from"./chunk-J5OAQAAD.js";import{INPUT_BASE_ON as u,INPUT_BASE as d}from"./chunk-AYZY3YNC.js";import{Button_default as h}from"./chunk-UTISUEO4.js";import{Icon as p}from"./chunk-ISVODSRP.js";import{LoadingSpinner as m}from"./chunk-R2VKEMZH.js";import{Tooltip as f}from"./chunk-F2RAIGCG.js";import{onOverlayOpen as b}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as g}from"./chunk-62LW225J.js";import{useDropdownPosition as v,MENU_MAX_HEIGHT as w}from"./chunk-VY3UA6AR.js";import{useBrowserLayoutEffect as y}from"./chunk-ZDXRSY2Y.js";import{registerModalEscapeInterceptor as x}from"./chunk-TWVUQUUD.js";import{GLASS_DIVIDER as k,glassStyle as j}from"./chunk-5FYDNH4Y.js";import{useShellStrings as $}from"./chunk-NRHG4R2Q.js";import{useState as N,useId as D,useRef as C,useMemo as S,useEffect as R}from"react";import{createPortal as A}from"react-dom";import{jsxs as W,jsx as M}from"react/jsx-runtime";function E(e,t){const n=e.length;if(0===n||t(e.join(", ")))return{shown:n,cut:!1};if(1===n)return{shown:1,cut:!0};let r=0;for(let l=1;l<n&&t(`${e.slice(0,l).join(", ")} +${n-l}`);l+=1)r=l;return{shown:r,cut:!1}}var F=["right-2","right-8","right-16"],O=[8,32,64];function T(T){const{options:Y,placeholder:z,emptyOptionLabel:I,className:L="",disabled:U,id:H,filter:G=!1,allowFreeText:V=!1,freeTextOption:B,onSearchChange:J,loading:K=!1,error:P,onRetry:Q,rightAdornment:Z,endAction:X,renderOption:q,clearable:_=!0,"aria-label":ee,"aria-labelledby":te,"aria-describedby":ne}=T,re=!0===T.multiple,le=T.multiple?T.value:T.value?[T.value]:[],oe=T.multiple?"":T.value,ie=e=>{T.multiple?T.onChange(e):T.onChange(e[0]??"")},ae=le.length>0,se=G&&ae&&!U,ce=re||G,ue=null!=B,de=V||ue,[he,pe]=N(!1),[me,fe]=N(-1),be=D(),ge=H??`${be}-input`,ve=`${be}-listbox`,we=e=>`${be}-opt-${e}`,[ye,xe]=N(""),ke=$(),je=I??ke.select.none,$e=e=>{xe(e),fe(-1),J?.(e)},Ne=C(null),De=C(null),Ce=C(null),Se=C(null),Re=C(he);Re.current=he;const Ae=C(!1),We=e=>{Re.current&&(Re.current=!1,e&&V&&!ue&&et&&(re?le.includes(et)||ie([...le,et]):et!==oe&&ie([et])),pe(!1),$e(""))},Me=(e,t)=>{if(!e.disabled){if(re)return ie(le.includes(e.value)?le.filter(t=>t!==e.value):[...le,e.value]),void(e===tt?$e(""):fe(t));ie([e.value]),We(!1)}},[Ee,Fe]=N(null);y(()=>{if(!Z||he)return void Fe(null);const e=Se.current?.offsetWidth??0;Fe(e?e+O[Ue]+6:null)});const Oe=v(De,he,ce?{popupRef:Ce}:{matchTriggerWidth:!0}),Te=S(()=>t(Y),[Y]),Ye=le.join("\0"),ze=S(()=>{const e=[],t=/* @__PURE__ */new Set;for(const n of Te)le.includes(n.value)&&!t.has(n.value)&&(t.add(n.value),e.push(n.label));if(de)for(const n of le)t.has(n)||e.push(n);return e},[Te,Ye,de]),Ie=ze.join(", "),Le=_&&ae&&!U,Ue=(Le?1:0)+(X?1:0),[He,Ge]=N(null),Ve=C(null),Be=C(""),Je=C(()=>{});Je.current=()=>{const e=De.current,t=Ve.current;if(!re||!e||!t)return;const n=getComputedStyle(e),r=e.clientWidth-(parseFloat(n.paddingLeft)||0)-(parseFloat(n.paddingRight)||0),l=[n.fontStyle,n.fontWeight,n.fontSize,n.fontFamily,n.letterSpacing].join("|"),o=`${r}|${l}|${ze.join("\0")}`;if(o===Be.current)return;Be.current=o;let i=null;r>0&&ze.length>0&&(t.style.fontStyle=n.fontStyle,t.style.fontWeight=n.fontWeight,t.style.fontSize=n.fontSize,t.style.fontFamily=n.fontFamily,t.style.letterSpacing=n.letterSpacing,i=E(ze,e=>(t.textContent=e,t.getBoundingClientRect().width<=r)),t.textContent=""),Ge(e=>e?.shown===i?.shown&&e?.cut===i?.cut?e:i)},y(()=>{Je.current()}),R(()=>{const e=De.current;if(!re||!e||"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(()=>Je.current());return t.observe(e),()=>t.disconnect()},[re]);const Ke=ze.length,Pe=!re||!He||He.shown>=Ke?Ie:0===He.shown?ke.select.selectedCount(Ke):`${ze.slice(0,He.shown).join(", ")} +${Ke-He.shown}`,Qe=re&&null!==He&&(He.shown<Ke||He.cut),Ze=he&&ae&&ce;R(()=>{if(!he)return;const e=e=>{const t=e.target;Ne.current?.contains(t)||Ce.current?.contains(t)||We(!0)};document.addEventListener("mousedown",e);const t=b(()=>We(!0));return()=>{document.removeEventListener("mousedown",e),t()}},[he,V,ye,Ye,T.onChange]),R(()=>{if(he)return x(e=>!("Escape"!==e.key||!Re.current)&&(We(!1),De.current?.blur(),!0),()=>Ce.current)},[he]);const Xe=S(()=>{const e=/* @__PURE__ */new Set;return n(Y,t=>!e.has(t.value)&&(e.add(t.value),!0))},[Y]),qe=S(()=>{if(J)return Xe;const e=ye.trim().toLowerCase();return e?n(Xe,t=>r(t,e)):Xe},[Xe,ye,J]),_e=S(()=>t(qe),[qe]),et=ye.trim(),tt=S(()=>ue&&et?Te.some(e=>e.label===et)||le.includes(et)?null:{value:et,label:et}:null,[ue,et,Te,Ye]),nt=S(()=>tt?[..._e,tt]:_e,[_e,tt]);/* @__PURE__ */
|
|
2
|
+
return W("div",{ref:Ne,className:"relative group",onBlur:e=>{const t=e.relatedTarget;t&&(Ne.current?.contains(t)||Ce.current?.contains(t))||Ae.current||document.activeElement!==De.current&&We(!0)},children:[(rt=/* @__PURE__ */M("input",{id:ge,ref:De,type:"text",autoComplete:"off",role:"combobox","aria-expanded":he,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-controls":he?ve:void 0,"aria-activedescendant":he&&me>=0&&me<nt.length?we(me):void 0,"aria-label":te?void 0:ee,"aria-labelledby":te,"aria-describedby":ne,value:he?ye:Pe,onChange:e=>{$e(e.target.value),pe(!0)},onFocus:()=>{U||($e(""),pe(!0))},onKeyDown:t=>{if("ArrowDown"===t.key||"ArrowUp"===t.key){if(U)return;if(t.preventDefault(),!he)return void pe(!0);if(0===nt.length)return;const n="ArrowDown"===t.key?1:-1;return void fe(t=>e(nt,t,n))}"Enter"===t.key?(t.preventDefault(),he&&me>=0&&me<nt.length?Me(nt[me],me):1!==_e.length||_e[0].disabled?V&&!ue&&et&&(re?(le.includes(et)||ie([...le,et]),$e("")):(ie([et]),We(!1),De.current?.blur())):Me(_e[0],0)):"Escape"===t.key?(We(!1),De.current?.blur()):"Tab"===t.key&&We(!0)},placeholder:Ze?Pe:z||je,className:`${se?u:d} ${L} ${a[Ue]}${U?"bg-surface-sunken text-ink-faintest cursor-not-allowed":""} truncate${Ze?" rosh-field-shows-choice":""}`,style:Ee?{paddingRight:Ee}:void 0,disabled:U}),re?/* @__PURE__ */M(f,{content:!he&&Qe?Ie:null,className:"block",children:rt}):rt),re&&
|
|
3
|
+
/* @__PURE__ */M("div",{"aria-hidden":"true",className:"pointer-events-none invisible absolute left-0 top-0 h-0 w-0 overflow-hidden",children:/* @__PURE__ */M("span",{ref:Ve,className:"whitespace-pre"})}),Ue>0&&
|
|
4
|
+
/* @__PURE__ */W(s,{children:[Le&&
|
|
5
|
+
/* @__PURE__ */M("span",{onMouseDown:e=>e.preventDefault(),className:"flex opacity-0 transition-opacity group-hover:opacity-100 focus-within:opacity-100",children:/* @__PURE__ */M(c,{action:{label:ke.select.clear,icon:/* @__PURE__ */M(p,{name:"close"}),onClick:()=>{ie([]),We(!1)}}})}),X&&/* @__PURE__ */M("span",{onMouseDown:e=>e.preventDefault(),className:"flex",children:/* @__PURE__ */M(c,{action:X})})]}),Z&&!he&&/* @__PURE__ */M("div",{ref:Se,className:`absolute top-1/2 -translate-y-1/2 ${F[Ue]} flex items-center gap-1 flex-nowrap justify-end pointer-events-none`,children:Z}),he&&A(
|
|
6
|
+
/* @__PURE__ */W("div",{ref:Ce,onMouseDownCapture:()=>{Ae.current=!0,setTimeout(()=>{Ae.current=!1},0)},className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:g.popup,left:Oe?.left,right:Oe?.right,top:Oe?.top,bottom:Oe?.bottom,minWidth:Oe?.minWidth,width:Oe?.width,...ce&&{maxWidth:Oe?.maxWidth},visibility:Oe?void 0:"hidden",...j()},children:[re&&ae&&_&&!U&&
|
|
7
7
|
/* @__PURE__ */M("button",{type:"button",tabIndex:-1,onMouseDown:e=>{e.preventDefault(),ie([])},className:`block w-full text-left px-3 min-h-(--row-height-menu) py-2 leading-5 text-sm text-gray-600 hover:bg-row-hover border-b ${k}`,children:ke.select.clearAll}),K?
|
|
8
|
-
/* @__PURE__ */M(m,{size:"sm",padding:"py-2",label:ke.search.searching}):P?/* @__PURE__ */
|
|
9
|
-
/* @__PURE__ */M("span",{className:"min-w-0 flex-1",children:P}),
|
|
10
|
-
/* @__PURE__ */
|
|
11
|
-
return
|
|
12
|
-
/* @__PURE__ */M("span",{className:`min-w-0 ${ce?"flex-auto":"flex-1"} truncate`,children:q?q(e,{selected:n,active:t===me}):e.label}),e.sublabel&&/* @__PURE__ */M(i,{grows:ce,children:e.sublabel})]},e.value)},be),tt&&
|
|
13
|
-
/* @__PURE__ */M("button",{id:we(_e.length),type:"button",role:"option","aria-selected":!1,tabIndex:-1,onMouseDown:e=>{re&&e.preventDefault(),Me(tt,_e.length)},className:`w-full overflow-hidden text-left px-3 min-h-(--row-height-menu) py-2 text-sm flex items-center gap-2 whitespace-nowrap text-ink hover:bg-row-hover ${_e.length?`border-t ${k}`:""} ${me===_e.length?"bg-gray-100":""}`,children:/* @__PURE__ */M("span",{className:"min-w-0 flex-1 truncate",children:
|
|
8
|
+
/* @__PURE__ */M(m,{size:"sm",padding:"py-2",label:ke.search.searching}):P?/* @__PURE__ */W("div",{role:"alert",className:"flex items-center gap-2 px-3 py-2 text-sm text-red-600",children:[
|
|
9
|
+
/* @__PURE__ */M("span",{className:"min-w-0 flex-1",children:P}),Q&&/* @__PURE__ */M(h,{variant:"link",size:"sm",onMouseDown:e=>e.preventDefault(),onClick:Q,className:"shrink-0",children:ke.list.retry})]}):null,
|
|
10
|
+
/* @__PURE__ */W("div",{id:ve,role:nt.length?"listbox":void 0,"aria-labelledby":nt.length?te??(ee?void 0:ge):void 0,"aria-label":nt.length&&!te?ee:void 0,"aria-multiselectable":!(!nt.length||!re)||void 0,className:"overflow-y-auto",style:{maxHeight:Oe?.maxHeight??w},children:[0===nt.length?K||P?null:/* @__PURE__ */M("p",{className:"px-3 py-3 text-sm text-ink-faintest text-center",children:ke.select.noMatches}):0===_e.length?null:l(qe,(e,t)=>{const n=le.includes(e.value);/* @__PURE__ */
|
|
11
|
+
return W("button",{id:we(t),type:"button",role:"option","aria-selected":n,"aria-disabled":e.disabled||void 0,tabIndex:-1,onMouseDown:n=>{(e.disabled||re)&&n.preventDefault(),Me(e,t)},className:"w-full overflow-hidden text-left px-3 min-h-(--row-height-menu) py-2 text-sm flex items-center justify-between gap-2 whitespace-nowrap "+(e.disabled?"cursor-not-allowed text-gray-400":`hover:bg-gray-50 ${n?"text-blue-600 font-medium":"text-gray-700"} ${t===me?"bg-gray-100":n?"bg-blue-50/50":""}`),children:[re&&/* @__PURE__ */M(o,{selected:n}),
|
|
12
|
+
/* @__PURE__ */M("span",{className:`min-w-0 ${ce?"flex-auto":"flex-1"} truncate`,children:q?q(e,{selected:n,active:t===me}):e.label}),e.sublabel&&/* @__PURE__ */M(i,{grows:ce,children:e.sublabel})]},e.value)},be),tt&&B&&
|
|
13
|
+
/* @__PURE__ */M("button",{id:we(_e.length),type:"button",role:"option","aria-selected":!1,tabIndex:-1,onMouseDown:e=>{re&&e.preventDefault(),Me(tt,_e.length)},className:`w-full overflow-hidden text-left px-3 min-h-(--row-height-menu) py-2 text-sm flex items-center gap-2 whitespace-nowrap text-ink hover:bg-row-hover ${_e.length?`border-t ${k}`:""} ${me===_e.length?"bg-gray-100":""}`,children:/* @__PURE__ */M("span",{className:"min-w-0 flex-1 truncate",children:B(tt.value)})},`${be}-typed`)]})]}),document.body)]});var rt}export{T as SearchableSelect,E as fitChoice};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import{SearchableSelect as e}from"./chunk-
|
|
1
|
+
import{SearchableSelect as e}from"./chunk-OFMZ6JM6.js";import{labelClasses as a}from"./chunk-EQKUFYX6.js";import{Select_default as l}from"./chunk-D5PXRJHA.js";import{isSafeLinkHref as t}from"./chunk-Z5TE3MEG.js";import{Input_default as r}from"./chunk-J5OAQAAD.js";import{INPUT_SIZES as n}from"./chunk-AYZY3YNC.js";import{Button_default as i}from"./chunk-UTISUEO4.js";import{Icon as o}from"./chunk-ISVODSRP.js";import{registerModalEscapeInterceptor as s}from"./chunk-TWVUQUUD.js";import{useShellStrings as u}from"./chunk-NRHG4R2Q.js";import{useId as d,useRef as c,useState as p,useEffect as m}from"react";import{jsx as f,jsxs as v,Fragment as g}from"react/jsx-runtime";function h(e){return"select"===e.type?e.options:"groups"===e.type?e.groups.flatMap(e=>e.options):[]}var b="address",x={kindOf:()=>b,targetOf:e=>e,readFilter:()=>null,withFilter:e=>e},k=e=>t(e.trim());function y(t){const{value:n,kinds:o,rules:y=x,filtersFor:w,label:N,readOnly:C,placeholder:O,className:F="",tidyAddress:j,addressAddon:A}=t,E=void 0!==t.onApply,$=u().link,D=y.isSafe??k,T=d(),z=c(null),R=c(null),[U,M]=p({url:n}),P=E?U.url:n,[S,Q]=p(!1),[Y,H]=p(null),[J,K]=p(null),[W,Z]=p(!1),B=c(null),G=c(()=>{});G.current=E?t.onCancel:()=>{},m(()=>{if(E)return s(e=>{const a=z.current;return!!("Escape"===e.key&&a&&e.target instanceof Node&&a.contains(e.target))&&(G.current(),!0)},()=>z.current)},[E]),m(()=>{if(!E)return;const e=R.current;e?(e.focus(),e.select()):z.current?.querySelector("button, input")?.focus()},[]);const I=o??[{value:b,label:$.address,target:{type:"text"}}],L=Y&&Y.against===P?Y.kind:y.kindOf(P),V=I.filter(e=>!e.hideWhenEmpty||h(e.target).length>0||e.value===L),X=V.find(e=>"text"===e.target.type),q=V.find(e=>e.value===L)??X??V[0];if(!q)return null;const _="text"!==q.target.type,ee=_?y.targetOf(P):P,ae=h(q.target),le=ae.find(e=>e.value===ee),te=e=>({value:e,label:$.unavailable(e)}),re="select"===q.target.type&&ee&&w?w(ee):null,ne=re?y.readFilter(P):null,ie=ne?re?.find(e=>e.param===ne.param):void 0,oe=J&&J.against===P?J.text:P,se=_?P:j?j(oe.trim()).trim():oe.trim(),ue=E&&j?se:oe,de=!_&&""!==ue.trim()&&!D(ue),ce=de&&(!E||S);_&&W&&Z(!1);const pe=(e,a)=>{E?M({url:e,name:a}):void 0===a?t.onChange(e):t.onChange(e,a)},me=(e,a)=>{H(a=>a?{...a,against:e}:a),pe(e,a)},fe=e=>{if(!e)return me("");const a=ae.find(a=>a.value===e);me(e,a?.label)},ve=e=>{Q(!1);const a=e.trim();a?D(e)?(K({text:e,against:a}),me(a)):K({text:e,against:P}):(K({text:e,against:""}),me(""))},ge=e=>{const a=e.relatedTarget;if(a&&(a===R.current||B.current?.contains(a)))return;if(Z(!1),E||!j||C)return;const l=j(oe.trim());l.trim()!==oe.trim()&&ve(l)},he=()=>{if(!E||!se)return;if(!_&&de)return void Q(!0);const e=_&&U.url===se?U.name:void 0,a=t.onApply;void 0===e?a(se):a(se,e)},be=(e,a)=>a&&!e.some(e=>e.value===a)?[te(a),...e]:[...e],xe=(a,t,r,n,i)=>{const o=[];for(const e of r){const a=o[o.length-1],l={value:e.value,label:e.label};e.group?a&&"options"in a&&a.label===e.group?a.options.push(l):o.push({label:e.group,options:[l]}):o.push(l)}if(i){const l=r.some(e=>""===e.value);/* @__PURE__ */
|
|
2
2
|
return f(e,{"aria-label":a,value:t,options:o,disabled:C,clearable:l,placeholder:r.find(e=>""===e.value)?.label,onChange:n})}/* @__PURE__ */
|
|
3
|
-
return f(l,{size:"sm","aria-label":a,value:t,options:o,readOnly:C,onChange:n})};let ke;if("text"===q.target.type)ke=/* @__PURE__ */f(r,{ref:
|
|
4
|
-
return f("div",{ref:
|
|
5
|
-
return v("div",{ref:
|
|
6
|
-
/* @__PURE__ */v("div",{className:"flex items-center justify-between gap-2",children:[we?/* @__PURE__ */f(i,{variant:"ghost-danger",size:"sm","data-window-action":"remove",onClick:we,children
|
|
3
|
+
return f(l,{size:"sm","aria-label":a,value:t,options:o,readOnly:C,onChange:n})};let ke;if("text"===q.target.type)ke=/* @__PURE__ */f(r,{ref:R,id:`${T}-address`,size:"sm",type:"text",invalid:ce,"aria-label":$.address,"aria-describedby":ce?`${T}-why`:void 0,placeholder:O??$.addressPlaceholder,spellCheck:!1,autoComplete:"off",value:oe,readOnly:C,onChange:e=>ve(e.target.value),onFocus:()=>Z(!0),onBlur:ge,onKeyDown:j&&!E?e=>{"Enter"===e.key&&e.currentTarget.blur()}:void 0});else{const e="groups"===q.target.type?q.target.groups.flatMap(e=>e.options.map(a=>({value:a.value,label:a.label,group:e.label}))):q.target.options.map(e=>({value:e.value,label:e.label})),a=[{value:"",label:q.target.placeholder},...be(e,ee)];ke=xe(q.label,ee,a,fe,e.length>10)}const ye=/* @__PURE__ */v(g,{children:[o&&xe($.linkType,q.value,V.map(e=>({value:e.value,label:e.label})),e=>{K(null),Q(!1);const a=V.find(a=>a.value===e);if(!a||"text"===a.target.type)return void H({kind:e,against:P});const l=h(a.target)[0];H({kind:e,against:l?l.value:""}),l?pe(l.value,l.label):pe("")},!1),ke,A&&W&&!C&&"text"===q.target.type&&/* @__PURE__ */f("div",{ref:B,onBlur:ge,children:A({url:oe,onChange:ve})}),re&&xe($.filter,ne?.param??"",[{value:"",label:$.noFilter},...ne&&!ie?[te(ne.param)]:[],...re.map(e=>({value:e.param,label:e.label}))],e=>{if(!e)return me(ee,le?.label);const a=re?.find(a=>a.param===e),l=a?.values[0];l&&me(y.withFilter(ee,{param:e,value:l.value}),l.label)},!1),re&&ne&&xe($.value,ne.value,be((ie?.values??[]).map(e=>({value:e.value,label:e.label})),ne.value),e=>{if(!ne)return;const a=ie?.values.find(a=>a.value===e);me(y.withFilter(ee,{param:ne.param,value:e}),a?.label)},(ie?.values.length??0)>10),ce&&/* @__PURE__ */f("p",{id:`${T}-why`,role:"alert",className:"text-2xs leading-4 text-red-600",children:$.unsafe}),q.hint&&/* @__PURE__ */f("p",{className:"text-2xs leading-4 text-ink-faintest",children:q.hint}),re&&/* @__PURE__ */f("p",{className:"text-2xs leading-4 text-ink-faintest",children:$.filterHint})]});if(!E)/* @__PURE__ */
|
|
4
|
+
return f("div",{ref:z,className:`flex min-w-0 flex-auto flex-col gap-2 ${F}`.trim(),role:N?"group":void 0,"aria-label":N,children:ye});const we=t.onRemove;/* @__PURE__ */
|
|
5
|
+
return v("div",{ref:z,role:"dialog","aria-label":N??$.title,className:`flex min-w-0 flex-col gap-2 rounded-xl border border-line bg-surface p-3 shadow-lg ${F}`.trim(),onKeyDown:e=>{"Enter"!==e.key||e.defaultPrevented||e.target instanceof Element&&e.target.closest("button")||(e.preventDefault(),he())},children:[_?/* @__PURE__ */f("span",{className:a({inline:!0}),children:$.title}):/* @__PURE__ */f("label",{htmlFor:`${T}-address`,className:a({inline:!0}),children:$.title}),ye,
|
|
6
|
+
/* @__PURE__ */v("div",{className:"flex items-center justify-between gap-2",children:[we?/* @__PURE__ */f(i,{variant:"ghost-danger",size:"sm","data-window-action":"remove",onClick:we,children:$.remove}):null,
|
|
7
7
|
/* @__PURE__ */v("span",{className:"ml-auto flex gap-1",children:[
|
|
8
|
-
/* @__PURE__ */f(i,{variant:"secondary",size:"sm","data-window-action":"cancel",onClick:()=>G.current(),children
|
|
9
|
-
/* @__PURE__ */f(i,{variant:"primary",size:"sm","data-window-action":"apply",onClick:he,disabled:C||""===se,children
|
|
8
|
+
/* @__PURE__ */f(i,{variant:"secondary",size:"sm","data-window-action":"cancel",onClick:()=>G.current(),children:$.cancel}),
|
|
9
|
+
/* @__PURE__ */f(i,{variant:"primary",size:"sm","data-window-action":"apply",onClick:he,disabled:C||""===se,children:$.apply})]})]})]})}function w({label:e,text:a,onTextChange:l,link:t,onLinkChange:i,kinds:s,rules:m,filtersFor:g,textPlaceholder:h,readOnly:b,className:x=""}){const k=u().link,[w,N]=p(!1),C=c(null),O=d(),F=()=>{N(!1),C.current?.focus()};/* @__PURE__ */
|
|
10
10
|
return v("div",{className:`flex min-w-0 flex-auto flex-col ${x}`.trim(),children:[
|
|
11
11
|
/* @__PURE__ */f(r,{size:"md",type:"text",className:"rounded-b-none","aria-label":k.text(e),placeholder:h,value:a,readOnly:b,onChange:e=>l(e.target.value)}),
|
|
12
|
-
/* @__PURE__ */v("button",{ref:C,type:"button","aria-label":k.linkOf(e,t),"aria-expanded":w,"aria-controls":w?
|
|
12
|
+
/* @__PURE__ */v("button",{ref:C,type:"button","aria-label":k.linkOf(e,t),"aria-expanded":w,"aria-controls":w?O:void 0,disabled:b,onClick:()=>N(e=>!e),className:`flex w-full min-w-0 items-center gap-2 rounded-b-(--radius-control) border border-t-0 border-line-strong bg-surface-sunken ${n.md} text-left hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)] disabled:cursor-not-allowed disabled:opacity-60`,children:[
|
|
13
13
|
/* @__PURE__ */f(o,{name:"link",strokeWidth:1.5,className:"h-4 w-4 shrink-0 "+(t?"text-blue-600":"text-ink-faintest")}),
|
|
14
|
-
/* @__PURE__ */f("span",{className:"min-w-0 truncate "+(t?"text-blue-600":"text-ink-faintest"),children:t||k.addLink})]}),w&&/* @__PURE__ */f("div",{id:
|
|
14
|
+
/* @__PURE__ */f("span",{className:"min-w-0 truncate "+(t?"text-blue-600":"text-ink-faintest"),children:t||k.addLink})]}),w&&/* @__PURE__ */f("div",{id:O,className:"mt-2",children:/* @__PURE__ */f(y,{value:t,label:k.linkOf(e,t),kinds:s,rules:m,filtersFor:g,onApply:(e,a)=>{void 0===a?i(e):i(e,a),F()},onRemove:t?()=>{i(""),F()}:void 0,onCancel:F})})]})}export{y as LinkPicker,w as TextLinkField};
|