@webority/ui-react 0.165.0 → 0.167.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.
Files changed (134) hide show
  1. package/dist/canvas-kit/kit.js +217 -215
  2. package/dist/canvas-kit/manifest.json +247 -28
  3. package/dist/canvas-kit/release.json +6 -6
  4. package/dist/components/AppAsyncBlock.js +1 -1
  5. package/dist/components/AppAvatar.js +1 -1
  6. package/dist/components/AppAvatarGroup.js +1 -1
  7. package/dist/components/AppBanner.js +1 -1
  8. package/dist/components/AppBreadcrumbs.js +1 -1
  9. package/dist/components/AppButton.js +1 -1
  10. package/dist/components/AppCalendar.js +1 -1
  11. package/dist/components/AppCard.js +1 -1
  12. package/dist/components/AppCarousel.js +1 -1
  13. package/dist/components/AppCell.js +1 -1
  14. package/dist/components/AppChart.js +1 -1
  15. package/dist/components/AppChartCard.js +1 -1
  16. package/dist/components/AppCheckbox.js +1 -1
  17. package/dist/components/AppChip.js +1 -1
  18. package/dist/components/AppChipGroup.js +1 -1
  19. package/dist/components/AppChoiceCard.js +1 -1
  20. package/dist/components/AppChoiceChip.js +1 -1
  21. package/dist/components/AppColorField.js +1 -1
  22. package/dist/components/AppColumnMenu.js +1 -1
  23. package/dist/components/AppCommandPalette.js +1 -1
  24. package/dist/components/AppCommentThread.js +1 -1
  25. package/dist/components/AppCompareTable.js +1 -1
  26. package/dist/components/AppConfirmDialog.js +1 -1
  27. package/dist/components/AppConfirmProvider.js +1 -1
  28. package/dist/components/AppContextMenu.js +1 -1
  29. package/dist/components/AppCopyButton.js +1 -1
  30. package/dist/components/AppDataTable.js +1 -1
  31. package/dist/components/AppDatePicker.js +1 -1
  32. package/dist/components/AppDateRangePicker.js +1 -1
  33. package/dist/components/AppDescriptions.js +1 -1
  34. package/dist/components/AppDrawer.js +1 -1
  35. package/dist/components/AppDropZone.js +1 -1
  36. package/dist/components/AppDropdown.js +1 -1
  37. package/dist/components/AppDueDate.js +1 -1
  38. package/dist/components/AppEntryGrid.js +1 -1
  39. package/dist/components/AppErrorBoundary.js +1 -1
  40. package/dist/components/AppErrorSummary.js +1 -1
  41. package/dist/components/AppFileAttachment.js +1 -1
  42. package/dist/components/AppFilePicker.js +1 -1
  43. package/dist/components/AppFilterBar.js +1 -1
  44. package/dist/components/AppFloatingDock.js +1 -1
  45. package/dist/components/AppForm.js +1 -1
  46. package/dist/components/AppFormulaSteps.js +1 -1
  47. package/dist/components/AppHoverCard.js +1 -1
  48. package/dist/components/AppImagePicker.js +1 -1
  49. package/dist/components/AppInfoTip.js +1 -1
  50. package/dist/components/AppInlineEdit.js +1 -1
  51. package/dist/components/AppInput.js +1 -1
  52. package/dist/components/AppInputGroup.js +1 -1
  53. package/dist/components/AppKanban.js +1 -1
  54. package/dist/components/AppMentionInput.js +1 -1
  55. package/dist/components/AppModal.js +1 -1
  56. package/dist/components/AppNavigationMenu.js +1 -1
  57. package/dist/components/AppNotificationCenter.js +1 -1
  58. package/dist/components/AppNumberInput.js +1 -1
  59. package/dist/components/AppOnboardingChecklist.js +1 -1
  60. package/dist/components/AppOrgTree.js +1 -1
  61. package/dist/components/AppOtpInput.js +1 -1
  62. package/dist/components/AppPageHeader.js +1 -1
  63. package/dist/components/AppPhoneNumberInput.js +1 -1
  64. package/dist/components/AppPricingCard.js +1 -1
  65. package/dist/components/AppQrCode.js +1 -1
  66. package/dist/components/AppRadio.js +1 -1
  67. package/dist/components/AppRadioGroup.js +1 -1
  68. package/dist/components/AppRating.js +1 -1
  69. package/dist/components/AppRecordPager.js +1 -1
  70. package/dist/components/AppRelativeTime.js +1 -1
  71. package/dist/components/AppRepeater.js +1 -1
  72. package/dist/components/AppRichText.js +1 -1
  73. package/dist/components/AppRouteError.js +1 -1
  74. package/dist/components/AppRowActions.js +1 -1
  75. package/dist/components/AppScoreScale.js +1 -1
  76. package/dist/components/AppSearch.js +1 -1
  77. package/dist/components/AppSectionLeadCapture.js +1 -1
  78. package/dist/components/AppSegmented.js +1 -1
  79. package/dist/components/AppSelect.js +1 -1
  80. package/dist/components/AppShell.js +1 -1
  81. package/dist/components/AppShortcutLegend.js +1 -1
  82. package/dist/components/AppShowMore.js +1 -1
  83. package/dist/components/AppSlider.js +1 -1
  84. package/dist/components/AppSortableList.js +1 -1
  85. package/dist/components/AppSparkline.js +1 -1
  86. package/dist/components/AppSpinner.js +1 -1
  87. package/dist/components/AppSplash.js +1 -1
  88. package/dist/components/AppSplitButton.js +1 -1
  89. package/dist/components/AppSplitView.js +1 -1
  90. package/dist/components/AppStatusBadge.js +1 -1
  91. package/dist/components/AppStepper.js +1 -1
  92. package/dist/components/AppSwitch.js +1 -1
  93. package/dist/components/AppTablePagination.js +1 -1
  94. package/dist/components/AppTableToolbar.js +1 -1
  95. package/dist/components/AppTabs.js +1 -1
  96. package/dist/components/AppTextarea.js +1 -1
  97. package/dist/components/AppThemeToggle.js +1 -1
  98. package/dist/components/AppTimePicker.js +1 -1
  99. package/dist/components/AppTimeline.js +1 -1
  100. package/dist/components/AppToast.js +1 -1
  101. package/dist/components/AppUpdateBar.js +1 -1
  102. package/dist/components/AppWhatsNew.js +1 -1
  103. package/dist/components/AppWizard.js +1 -1
  104. package/dist/components/AppWorkspaceSwitcher.js +1 -1
  105. package/dist/components/toast.js +1 -1
  106. package/dist/guidance.json +10 -5
  107. package/dist/lib/FileItemRow.js +1 -1
  108. package/dist/lib/emptyValue.js +1 -1
  109. package/dist/lib/fieldState.js +1 -1
  110. package/dist/lib/useWuiText.js +1 -0
  111. package/dist/types/components/AppColorField.d.ts +3 -3
  112. package/dist/types/components/AppDatePicker.d.ts +2 -1
  113. package/dist/types/components/AppDateRangePicker.d.ts +1 -1
  114. package/dist/types/components/AppDropdown.d.ts +6 -0
  115. package/dist/types/components/AppEntryGrid.d.ts +43 -1
  116. package/dist/types/components/AppFormulaSteps.d.ts +3 -3
  117. package/dist/types/components/AppInput.d.ts +4 -4
  118. package/dist/types/components/AppInputGroup.d.ts +1 -1
  119. package/dist/types/components/AppMentionInput.d.ts +2 -2
  120. package/dist/types/components/AppNumberInput.d.ts +9 -3
  121. package/dist/types/components/AppPhoneNumberInput.d.ts +1 -1
  122. package/dist/types/components/AppRowActions.d.ts +6 -0
  123. package/dist/types/components/AppSearch.d.ts +1 -1
  124. package/dist/types/components/AppSelect.d.ts +3 -2
  125. package/dist/types/components/AppTextarea.d.ts +2 -2
  126. package/dist/types/components/AppTimePicker.d.ts +1 -1
  127. package/dist/types/index.d.ts +2 -1
  128. package/dist/types/lib/emptyValue.d.ts +2 -2
  129. package/dist/types/lib/fieldState.d.ts +1 -0
  130. package/dist/types/lib/useWuiText.d.ts +3 -0
  131. package/dist/ui-react.js +1 -1
  132. package/package.json +9 -9
  133. package/dist/lib/unsavedText.js +0 -1
  134. package/dist/types/lib/unsavedText.d.ts +0 -5
@@ -1 +1 @@
1
- import{buttonClass as e}from"../lib/buttonClass.js";import{shortcutAria as t,shortcutChip as n}from"../lib/shortcutChip.js";import{FILL_VARIANTS as r,TONES as i}from"../lib/vocabulary.js";import{splitMarkerProps as ee}from"../lib/wuiMarker.js";import{FormSubmitContext as a}from"./AppForm.js";import o from"./AppIcon.js";import s from"./assertValidValue.js";import te from"./warnUnknownProps.js";import c from"./withTooltip.js";import{useContext as l,useRef as u,useState as ne}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{Button as p}from"react-bootstrap";var m={sm:14,md:16,lg:20,xl:20},h=[`sheen`,`fill`,`expand`,`glow`,`roll`,`none`],re=[`rounded`,`pill`,`sharp`],ie=[`button`,`submit`,`reset`],ae=/* @__PURE__ */ new Set([!0,!1,...Array.from({length:100},(e,t)=>t+1)]),oe={variant:null},g=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`],_=e=>e===`pill`||e===`sharp`?`wui-btn-shape-${e}`:``;function v(e){return/* @__PURE__ */ f(`span`,{className:`wui-btn-roll`,children:[/* @__PURE__ */ d(`span`,{className:`wui-btn-roll__a`,children:e}),/* @__PURE__ */ d(`span`,{className:`wui-btn-roll__b`,"aria-hidden":`true`,children:e})]})}function se(e,t,n,r){if(!e)return null;let i=n=>typeof e==`string`?/* @__PURE__ */ d(o,{name:e,size:m[t]??m.md,variant:r,className:n}):/* @__PURE__ */ d(`span`,{className:[`d-inline-flex`,n].filter(Boolean).join(` `),children:e});return/* @__PURE__ */ f(`span`,{className:n?`wui-btn-roll-ico wui-btn-pin-icon`:`wui-btn-roll-ico ms-2`,"aria-hidden":`true`,children:[i(),i(`wui-btn-roll-ico__next`)]})}function y(e,t,n,r){if(!e)return null;let i=t===`left`?`me-2`:`ms-2`;return typeof e==`string`?/* @__PURE__ */ d(o,{name:e,size:m[n]??m.md,variant:r,className:i}):/* @__PURE__ */ d(`span`,{className:`d-inline-flex ${i}`,children:e})}function ce(e,t,n){return e?/* @__PURE__ */ d(`span`,{className:`wui-btn-pin-icon`,"aria-hidden":`true`,children:typeof e==`string`?/* @__PURE__ */ d(o,{name:e,size:m[t]??m.md,variant:n}):e}):null}function b(o){let{marker:b,props:le}=ee(`AppButton`,o),{children:x,tone:S=`primary`,variant:C=`solid`,size:w=`md`,type:T=`button`,loading:E=!1,disabled:D=!1,block:O=!1,leftIcon:k=null,rightIcon:A=null,href:j,static:M=!1,tooltip:N,tooltipPlacement:P,shortcut:F,animation:I,pinRightIcon:L=!1,shape:R=`rounded`,iconVariant:z,className:B=``,onClick:V,onClickCapture:H,vibrate:U,...W}=le,[ue,G]=ne(!1),K=u(!1),q=l(a),de=q!==null&&T===`submit`&&q.submitting,J=E||ue||de;te(`AppButton`,W),s(`AppButton`,`vibrate`,U,ae);let Y=U===!0?10:typeof U==`number`&&Number.isInteger(U)&&U>=1&&U<=100?U:0;I!==void 0&&s(`AppButton`,`animation`,I,h);let X=I===`roll`&&!M,Z=L&&A!=null&&A!==``&&!M&&!J;if(s(`AppButton`,`tone`,S,i),s(`AppButton`,`variant`,C,r),s(`AppButton`,`size`,w,Object.keys(m)),s(`AppButton`,`shape`,R,re),s(`AppButton`,`type`,T,ie),z!==void 0&&s(`AppButton`,`iconVariant`,z,g),M){let t=[`btn`,e(S,C),w===`sm`?`btn-sm`:w===`lg`?`btn-lg`:w===`xl`?`btn-xl`:``,O?`w-100`:``,_(R),`btn-static`,B].filter(Boolean).join(` `);return c(/* @__PURE__ */ f(`span`,{className:t,...b,...W,children:[y(k,`left`,w,z),x,y(A,`right`,w,z)]}),N,P)}let Q=[O?`w-100`:``,J?`is-loading`:``,e(S,C),w===`xl`?`btn-xl`:``,I&&h.includes(I)?`btn-anim-${I}`:``,Z?`wui-btn-pin-end`:``,_(R),B].filter(Boolean).join(` `),$=(W.as===void 0||W.as===`button`)&&j===void 0&&W.to===void 0,fe=$?{}:{role:void 0,tabIndex:D||J?-1:void 0},{as:pe,...me}=W,he={as:pe},ge=N!=null&&N!==``,_e=e=>{if(K.current)return;Y&&!D&&!J&&navigator.vibrate?.(Y);let t=V?.(e);if(!(t instanceof Promise))return;K.current=!0,G(!0);let n=()=>{K.current=!1,G(!1)};t.then(n,e=>{throw n(),e})};return c(/* @__PURE__ */ f(p,{type:$?T:void 0,href:j,...oe,...w===`sm`||w===`lg`?{size:w}:null,disabled:D||J,"aria-busy":J||void 0,"aria-keyshortcuts":t(F),"data-wui-vibrate":Y||void 0,className:Q||void 0,onClick:_e,onClickCapture:D||J?void 0:H,...fe,...b,...he,...me,children:[J&&/* @__PURE__ */ d(`span`,{className:`spinner-border spinner-border-sm me-2`,"aria-hidden":`true`}),!J&&y(k,`left`,w,z),X?v(x):x,!J&&(X?se(A,w,Z,z):Z?ce(A,w,z):y(A,`right`,w,z)),!ge&&n(F)]}),N,P,F)}export{b as default};
1
+ import{buttonClass as e}from"../lib/buttonClass.js";import{shortcutAria as t,shortcutChip as n}from"../lib/shortcutChip.js";import{FILL_VARIANTS as r,TONES as i}from"../lib/vocabulary.js";import{splitMarkerProps as ee}from"../lib/wuiMarker.js";import{FormSubmitContext as a}from"./AppForm.js";import o from"./AppIcon.js";import s from"./assertValidValue.js";import c from"./warnUnknownProps.js";import l from"./withTooltip.js";import{useContext as te,useRef as u,useState as d}from"react";import{jsx as f,jsxs as p}from"react/jsx-runtime";import{Button as ne}from"react-bootstrap";var m={sm:14,md:16,lg:20,xl:20},h=[`sheen`,`fill`,`expand`,`glow`,`roll`,`none`],re=[`rounded`,`pill`,`sharp`],ie=[`button`,`submit`,`reset`],ae=/* @__PURE__ */ new Set([!0,!1,...Array.from({length:100},(e,t)=>t+1)]),g={variant:null},oe=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`],_=e=>e===`pill`||e===`sharp`?`wui-btn-shape-${e}`:``;function se(e){return/* @__PURE__ */ p(`span`,{className:`wui-btn-roll`,children:[/* @__PURE__ */ f(`span`,{className:`wui-btn-roll__a`,children:e}),/* @__PURE__ */ f(`span`,{className:`wui-btn-roll__b`,"aria-hidden":`true`,children:e})]})}function ce(e,t,n,r){if(!e)return null;let i=n=>typeof e==`string`?/* @__PURE__ */ f(o,{name:e,size:m[t]??m.md,variant:r,className:n}):/* @__PURE__ */ f(`span`,{className:[`d-inline-flex`,n].filter(Boolean).join(` `),children:e});return/* @__PURE__ */ p(`span`,{className:n?`wui-btn-roll-ico wui-btn-pin-icon`:`wui-btn-roll-ico ms-2`,"aria-hidden":`true`,children:[i(),i(`wui-btn-roll-ico__next`)]})}function v(e,t,n,r){if(!e)return null;let i=t===`left`?`me-2`:`ms-2`;return typeof e==`string`?/* @__PURE__ */ f(o,{name:e,size:m[n]??m.md,variant:r,className:i}):/* @__PURE__ */ f(`span`,{className:`d-inline-flex ${i}`,children:e})}function y(e,t,n){return e?/* @__PURE__ */ f(`span`,{className:`wui-btn-pin-icon`,"aria-hidden":`true`,children:typeof e==`string`?/* @__PURE__ */ f(o,{name:e,size:m[t]??m.md,variant:n}):e}):null}function b(o){let{marker:b,props:le}=ee(`AppButton`,o),{children:x,tone:S=`primary`,variant:C=`solid`,size:w=`md`,type:T=`button`,loading:ue=!1,disabled:E=!1,block:D=!1,leftIcon:O=null,rightIcon:k=null,href:A,static:j=!1,tooltip:M,tooltipPlacement:N,shortcut:P,animation:F,pinRightIcon:I=!1,shape:L=`rounded`,iconVariant:R,className:z=``,onClick:B,onClickCapture:V,vibrate:H,...U}=le,[de,W]=d(!1),G=u(!1),K=te(a),fe=K!==null&&T===`submit`&&K.submitting,q=ue||de||fe;c(`AppButton`,U),s(`AppButton`,`vibrate`,H,ae);let J=H===!0?10:typeof H==`number`&&Number.isInteger(H)&&H>=1&&H<=100?H:0;F!==void 0&&s(`AppButton`,`animation`,F,h);let Y=F===`roll`&&!j,X=I&&k!=null&&k!==``&&!j&&!q;if(s(`AppButton`,`tone`,S,i),s(`AppButton`,`variant`,C,r),s(`AppButton`,`size`,w,Object.keys(m)),s(`AppButton`,`shape`,L,re),s(`AppButton`,`type`,T,ie),R!==void 0&&s(`AppButton`,`iconVariant`,R,oe),j){let t=[`btn`,e(S,C),w===`sm`?`btn-sm`:w===`lg`?`btn-lg`:w===`xl`?`btn-xl`:``,D?`w-100`:``,_(L),`btn-static`,z].filter(Boolean).join(` `);return l(/* @__PURE__ */ p(`span`,{className:t,...b,...U,children:[v(O,`left`,w,R),x,v(k,`right`,w,R)]}),M,N)}let pe=[D?`w-100`:``,q?`is-loading`:``,e(S,C),w===`xl`?`btn-xl`:``,F&&h.includes(F)?`btn-anim-${F}`:``,X?`wui-btn-pin-end`:``,_(L),z].filter(Boolean).join(` `),Z=(U.as===void 0||U.as===`button`)&&A===void 0&&U.to===void 0,me=Z?{}:{role:void 0,tabIndex:E||q?-1:void 0},{as:he,...ge}=U,_e={as:he},Q=M!=null&&M!==``,ve=e=>{if(G.current)return;J&&!E&&!q&&navigator.vibrate?.(J);let t=B?.(e);if(!(t instanceof Promise))return;G.current=!0,W(!0);let n=()=>{G.current=!1,W(!1)};t.then(n,e=>{throw n(),e})},$=/* @__PURE__ */ p(ne,{type:Z?T:void 0,href:A,...g,...w===`sm`||w===`lg`?{size:w}:null,disabled:E||q,"aria-busy":q||void 0,"aria-keyshortcuts":t(P),"data-wui-vibrate":J||void 0,className:pe||void 0,onClick:ve,onClickCapture:E||q?void 0:V,...me,...b,..._e,...ge,children:[q&&/* @__PURE__ */ f(`span`,{className:`spinner-border spinner-border-sm me-2`,"aria-hidden":`true`}),!q&&v(O,`left`,w,R),Y?se(x):x,!q&&(Y?ce(k,w,X,R):X?y(k,w,R):v(k,`right`,w,R)),!Q&&n(P)]});return l(E&&Q?/* @__PURE__ */ f(`span`,{className:`d-inline-block`,tabIndex:0,children:$}):$,M,N,P)}export{b as default};
@@ -1 +1 @@
1
- import{devWarn as e}from"../lib/devWarn.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./assertValidValue.js";import r from"./warnUnknownProps.js";import{createElement as i,forwardRef as a,useCallback as o,useEffect as s,useLayoutEffect as c,useRef as l,useState as u}from"react";import{jsx as d}from"react/jsx-runtime";var f=`wui-calendar:event-click`,p=`wui-calendar:date-click`,m=`wui-calendar:range-change`,h=[`month`,`week`,`day`,`list`],g=`This calendar couldn't load. Try again in a moment.`,_=a(function(a,_){let{marker:v,props:y}=t(`AppCalendar`,a),{label:b,events:x,eventsUrl:S,view:C,date:w,emptyText:T,errorText:E,firstDay:D,timeZone:O,onEventClick:k,onDateClick:A,onRangeChange:j,className:M=``,style:N,...P}=y;r(`AppCalendar`,P),n(`AppCalendar`,`view`,C,h);let F=l(null),I=l(``),L=l({onEventClick:k,onDateClick:A,onRangeChange:j}),[R,z]=u(!1),B=o(e=>{F.current=e,typeof _==`function`?_(e):_&&(_.current=e)},[_]);return s(()=>{L.current={onEventClick:k,onDateClick:A,onRangeChange:j}}),c(()=>{let e=F.current;if(!e)return;let t=x==null?``:JSON.stringify(x);t!==I.current&&(I.current=t,e.events=x??null)}),s(()=>{let e=F.current;if(!e)throw Error(`AppCalendar: the <wui-calendar> element is not mounted`);let t=[[f,e=>{if(!(e instanceof CustomEvent))throw Error(`${f} arrived without a detail`);let t=e.detail;L.current.onEventClick?.(t)===!1&&e.preventDefault()}],[p,e=>{if(!(e instanceof CustomEvent))throw Error(`${p} arrived without a detail`);let t=e.detail;L.current.onDateClick?.(t)}],[m,e=>{if(!(e instanceof CustomEvent))throw Error(`${m} arrived without a detail`);let t=e.detail;L.current.onRangeChange?.(t)}]];for(let[n,r]of t)e.addEventListener(n,r);return()=>{for(let[n,r]of t)e.removeEventListener(n,r)}},[]),s(()=>{let t=!0;return import(`@webority/ui-elements/calendar`).catch(n=>{e(`[AppCalendar] the calendar failed to load:`,n?.message),t&&z(!0)}),()=>{t=!1}},[]),R?/* @__PURE__ */ d(`div`,{...v,className:M||void 0,style:N,role:`status`,children:/* @__PURE__ */ d(`p`,{className:`wui-calendar-status-text`,children:E||g})}):i(`wui-calendar`,{ref:B,label:b||void 0,"events-url":S||void 0,view:C||void 0,date:w||void 0,"empty-text":T||void 0,"error-text":E||void 0,"first-day":D==null?void 0:String(D),"time-zone":O||void 0,className:M||void 0,style:N,...v,...P})});export{_ as default};
1
+ import{devWarn as e}from"../lib/devWarn.js";import t from"../lib/useWuiText.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./assertValidValue.js";import i from"./warnUnknownProps.js";import{createElement as a,forwardRef as o,useCallback as s,useEffect as c,useLayoutEffect as l,useRef as u,useState as d}from"react";import{jsx as f}from"react/jsx-runtime";import{CALENDAR_TEXT as p}from"@webority/ui-elements/text";var m=`wui-calendar:event-click`,h=`wui-calendar:date-click`,g=`wui-calendar:range-change`,_=[`month`,`week`,`day`,`list`],v=o(function(o,v){let{marker:y,props:b}=n(`AppCalendar`,o),x=t(`calendar`,p),{label:S,events:C,eventsUrl:w,view:T,date:E,emptyText:D,errorText:O,firstDay:k,timeZone:A,onEventClick:j,onDateClick:M,onRangeChange:N,className:P=``,style:F,...I}=b;i(`AppCalendar`,I),r(`AppCalendar`,`view`,T,_);let L=u(null),R=u(``),z=u({onEventClick:j,onDateClick:M,onRangeChange:N}),[B,V]=d(!1),H=s(e=>{L.current=e,typeof v==`function`?v(e):v&&(v.current=e)},[v]);return c(()=>{z.current={onEventClick:j,onDateClick:M,onRangeChange:N}}),l(()=>{let e=L.current;if(!e)return;let t=C==null?``:JSON.stringify(C);t!==R.current&&(R.current=t,e.events=C??null)}),c(()=>{let e=L.current;if(!e)throw Error(`AppCalendar: the <wui-calendar> element is not mounted`);let t=[[m,e=>{if(!(e instanceof CustomEvent))throw Error(`${m} arrived without a detail`);let t=e.detail;z.current.onEventClick?.(t)===!1&&e.preventDefault()}],[h,e=>{if(!(e instanceof CustomEvent))throw Error(`${h} arrived without a detail`);let t=e.detail;z.current.onDateClick?.(t)}],[g,e=>{if(!(e instanceof CustomEvent))throw Error(`${g} arrived without a detail`);let t=e.detail;z.current.onRangeChange?.(t)}]];for(let[n,r]of t)e.addEventListener(n,r);return()=>{for(let[n,r]of t)e.removeEventListener(n,r)}},[]),c(()=>{let t=!0;return import(`@webority/ui-elements/calendar`).catch(n=>{e(`[AppCalendar] the calendar failed to load:`,n?.message),t&&V(!0)}),()=>{t=!1}},[]),B?/* @__PURE__ */ f(`div`,{...y,className:P||void 0,style:F,role:`status`,children:/* @__PURE__ */ f(`p`,{className:`wui-calendar-status-text`,children:O||x.loadFailedText})}):a(`wui-calendar`,{ref:H,label:S||void 0,"events-url":w||void 0,view:T||void 0,date:E||void 0,"empty-text":D||void 0,"error-text":O||void 0,"first-day":k==null?void 0:String(k),"time-zone":A||void 0,className:P||void 0,style:F,...y,...I})});export{v as default};
@@ -1 +1 @@
1
- import{linkTarget as e}from"../lib/linkTarget.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./AppIcon.js";import r from"./assertValidValue.js";import ee from"./warnUnknownProps.js";import{isImeSafeEnter as te}from"@webority/ui-elements/helpers";import{useState as i}from"react";import{Fragment as ne,jsx as a,jsxs as o}from"react/jsx-runtime";import{Card as s}from"react-bootstrap";var c=[`flat`,`elevated`,`outline`,`filled`,`accent`],l={elevated:`card-elevated`,outline:`card-outlined`,filled:`card-muted`,accent:`card-accent`},u=[`primary`,`success`,`warning`,`danger`,`info`],d=[`none`,`sm`,`md`,`lg`],f=[`sans`,`serif`],re={xs:320,sm:420,md:560,lg:720};function p(p){let{marker:ie,props:ae}=t(`AppCard`,p),{title:m,subtitle:h,headerIcon:g,titleClassName:_=``,titleFont:v=`sans`,header:y,headerExtra:b,headerActions:x,footer:S,media:C,children:w,variant:T=`flat`,tone:E=`primary`,padding:D=`md`,maxWidth:O,className:k=``,bodyClassName:A=``,headerClassName:j=``,body:M=!0,lifted:N=!1,flush:P=!1,divided:F=!1,href:I,onClick:L,linkComponent:R,onClose:z,dismissible:B,closeLabel:V=`Close`,...H}=ae,[U,W]=i(!1);ee(`AppCard`,H),r(`AppCard`,`variant`,T,c),r(`AppCard`,`tone`,E,u),r(`AppCard`,`padding`,D,d),r(`AppCard`,`titleFont`,v,f);let{style:G,as:K,...q}=H,oe=I!=null||L!=null,se=[l[T]??``,T===`accent`&&E&&E!==`primary`?`tone-${E}`:``,D&&D!==`md`?`card-pad-${D}`:``,P?`card-flush`:``,F?`card-divided`:``,N?`card-lifted`:``,O==null?``:`card-constrained`,oe?`card-clickable`:``,k].filter(Boolean).join(` `)||void 0,J=O==null?void 0:re[String(O)],Y=O==null?void 0:J==null?typeof O==`number`?`${O}px`:O:`${J}px`,ce=Y?{"--card-max-width":Y,...G}:G,X={};if(I!=null){let t=e(R,{href:I});X=t.Tag===`a`?{as:`a`,href:t.linkProps.href}:{as:t.Tag,to:t.linkProps.to},L&&(X.onClick=L)}else L!=null&&(X={role:`button`,tabIndex:0,onClick:L,onKeyDown:e=>{(te(e.nativeEvent)||e.key===` `)&&(e.preventDefault(),L(e))}});let Z=B??typeof z==`function`,le=Z?/* @__PURE__ */ a(`button`,{type:`button`,className:`card-close`,"aria-label":V,onClick:e=>{e.preventDefault(),e.stopPropagation(),W(!0),z?.()},onKeyDown:e=>e.stopPropagation(),children:/* @__PURE__ */ a(n,{name:`x`,size:16})}):null,Q=m!=null||h!=null||g!=null,ue=y!=null||Q||b!=null||x!=null||Z,$=g==null?null:typeof g==`string`?/* @__PURE__ */ a(n,{name:g,size:18}):g;return U?null:/* @__PURE__ */ o(s,{className:se,style:ce,...ie,...q,...K===void 0?null:{as:K},...X,children:[C!=null&&/* @__PURE__ */ a(`div`,{className:`card-media`,children:C}),ue&&/* @__PURE__ */ o(s.Header,{className:j||void 0,children:[y??/* @__PURE__ */ o(ne,{children:[Q&&/* @__PURE__ */ o(`div`,{className:`card-header-main`,children:[$!=null&&/* @__PURE__ */ a(`span`,{className:`card-header-icon`,children:$}),/* @__PURE__ */ o(`div`,{className:`card-header-titles`,children:[m!=null&&/* @__PURE__ */ a(`div`,{className:[`card-title`,_].filter(Boolean).join(` `),style:v===`serif`?{fontFamily:`var(--wui-font-display)`}:void 0,children:m}),h!=null&&/* @__PURE__ */ a(`div`,{className:`card-subtitle`,children:h})]})]}),b,x!=null&&/* @__PURE__ */ a(`div`,{className:`card-header-actions`,children:x})]}),le]}),M?/* @__PURE__ */ a(s.Body,{className:A||void 0,children:w}):w,S!=null&&/* @__PURE__ */ a(`div`,{className:`card-footer`,children:S})]})}export{p as default};
1
+ import{linkTarget as e}from"../lib/linkTarget.js";import t from"../lib/useWuiText.js";import{splitMarkerProps as ee}from"../lib/wuiMarker.js";import n from"./AppIcon.js";import r from"./assertValidValue.js";import i from"./warnUnknownProps.js";import{isImeSafeEnter as te}from"@webority/ui-elements/helpers";import{useState as ne}from"react";import{Fragment as re,jsx as a,jsxs as o}from"react/jsx-runtime";import{CARD_TEXT as s}from"@webority/ui-elements/text";import{Card as c}from"react-bootstrap";var l=[`flat`,`elevated`,`outline`,`filled`,`accent`],u={elevated:`card-elevated`,outline:`card-outlined`,filled:`card-muted`,accent:`card-accent`},d=[`primary`,`success`,`warning`,`danger`,`info`],ie=[`none`,`sm`,`md`,`lg`],ae=[`sans`,`serif`],f={xs:320,sm:420,md:560,lg:720};function p(p){let{marker:m,props:oe}=ee(`AppCard`,p),h=t(`card`,s),{title:g,subtitle:_,headerIcon:v,titleClassName:se=``,titleFont:y=`sans`,header:b,headerExtra:x,headerActions:S,footer:C,media:w,children:T,variant:E=`flat`,tone:D=`primary`,padding:O=`md`,maxWidth:k,className:A=``,bodyClassName:j=``,headerClassName:M=``,body:N=!0,lifted:P=!1,flush:F=!1,divided:I=!1,href:L,onClick:R,linkComponent:z,onClose:B,dismissible:V,closeLabel:H=h.closeLabel,...U}=oe,[W,G]=ne(!1);i(`AppCard`,U),r(`AppCard`,`variant`,E,l),r(`AppCard`,`tone`,D,d),r(`AppCard`,`padding`,O,ie),r(`AppCard`,`titleFont`,y,ae);let{style:K,as:q,...ce}=U,le=L!=null||R!=null,ue=[u[E]??``,E===`accent`&&D&&D!==`primary`?`tone-${D}`:``,O&&O!==`md`?`card-pad-${O}`:``,F?`card-flush`:``,I?`card-divided`:``,P?`card-lifted`:``,k==null?``:`card-constrained`,le?`card-clickable`:``,A].filter(Boolean).join(` `)||void 0,J=k==null?void 0:f[String(k)],Y=k==null?void 0:J==null?typeof k==`number`?`${k}px`:k:`${J}px`,de=Y?{"--card-max-width":Y,...K}:K,X={};if(L!=null){let t=e(z,{href:L});X=t.Tag===`a`?{as:`a`,href:t.linkProps.href}:{as:t.Tag,to:t.linkProps.to},R&&(X.onClick=R)}else R!=null&&(X={role:`button`,tabIndex:0,onClick:R,onKeyDown:e=>{(te(e.nativeEvent)||e.key===` `)&&(e.preventDefault(),R(e))}});let Z=V??typeof B==`function`,fe=Z?/* @__PURE__ */ a(`button`,{type:`button`,className:`card-close`,"aria-label":H,onClick:e=>{e.preventDefault(),e.stopPropagation(),G(!0),B?.()},onKeyDown:e=>e.stopPropagation(),children:/* @__PURE__ */ a(n,{name:`x`,size:16})}):null,Q=g!=null||_!=null||v!=null,pe=b!=null||Q||x!=null||S!=null||Z,$=v==null?null:typeof v==`string`?/* @__PURE__ */ a(n,{name:v,size:18}):v;return W?null:/* @__PURE__ */ o(c,{className:ue,style:de,...m,...ce,...q===void 0?null:{as:q},...X,children:[w!=null&&/* @__PURE__ */ a(`div`,{className:`card-media`,children:w}),pe&&/* @__PURE__ */ o(c.Header,{className:M||void 0,children:[b??/* @__PURE__ */ o(re,{children:[Q&&/* @__PURE__ */ o(`div`,{className:`card-header-main`,children:[$!=null&&/* @__PURE__ */ a(`span`,{className:`card-header-icon`,children:$}),/* @__PURE__ */ o(`div`,{className:`card-header-titles`,children:[g!=null&&/* @__PURE__ */ a(`div`,{className:[`card-title`,se].filter(Boolean).join(` `),style:y===`serif`?{fontFamily:`var(--wui-font-display)`}:void 0,children:g}),_!=null&&/* @__PURE__ */ a(`div`,{className:`card-subtitle`,children:_})]})]}),x,S!=null&&/* @__PURE__ */ a(`div`,{className:`card-header-actions`,children:S})]}),fe]}),N?/* @__PURE__ */ a(c.Body,{className:j||void 0,children:T}):T,C!=null&&/* @__PURE__ */ a(`div`,{className:`card-footer`,children:C})]})}export{p as default};
@@ -1 +1 @@
1
- import e from"../lib/useElementEntry.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./AppIcon.js";import r from"./warnUnknownProps.js";import{Children as i}from"react";import{jsx as a,jsxs as o}from"react/jsx-runtime";var s=()=>import(`@webority/ui-elements/elements/carousel`);function c(c){let{marker:l,props:u}=t(`AppCarousel`,c),{label:d,autoplay:f,loop:p=!1,perView:m,perViewMd:h,perViewLg:g,arrows:_=!0,dots:v=!0,previousLabel:y=`Previous slide`,nextLabel:b=`Next slide`,dotLabel:x=`Go to slide`,pauseLabel:S=`Pause`,playLabel:C=`Play`,className:w=``,children:T,style:E,...D}=u;r(`AppCarousel`,D),e(`wui-carousel`,s);let O=Number(f)>0?Math.round(Number(f)):0,k={...m!==void 0&&Number(m)>1?{"--wui-carousel-per-view":m}:null,...h!==void 0&&Number(h)>=1?{"--wui-carousel-per-view-md":h}:null,...g!==void 0&&Number(g)>=1?{"--wui-carousel-per-view-lg":g}:null};return/* @__PURE__ */ o(`wui-carousel`,{class:[`wui-carousel`,w].filter(Boolean).join(` `),role:`region`,"aria-roledescription":`carousel`,"aria-label":d,autoplay:O||void 0,loop:p?``:void 0,"dot-label":x===`Go to slide`?void 0:x,"pause-label":S===`Pause`?void 0:S,"play-label":C===`Play`?void 0:C,style:Object.keys(k).length||E?{...k,...E}:void 0,...l,...D,children:[O?/* @__PURE__ */ o(`button`,{type:`button`,className:`wui-carousel-pause`,children:[/* @__PURE__ */ a(`span`,{className:`wui-carousel-pause-icon`,"aria-hidden":`true`}),/* @__PURE__ */ a(`span`,{className:`wui-carousel-pause-text`,children:S})]}):null,/* @__PURE__ */ o(`div`,{className:`wui-carousel-stage`,children:[_?/* @__PURE__ */ a(`button`,{type:`button`,className:`wui-carousel-arrow wui-carousel-prev`,"aria-label":y,children:/* @__PURE__ */ a(n,{name:`chevron-left`,size:20})}):null,/* @__PURE__ */ a(`div`,{className:`wui-carousel-track`,tabIndex:0,role:`group`,"aria-label":d,children:i.map(i.toArray(T),e=>/* @__PURE__ */ a(`div`,{className:`wui-carousel-slide`,role:`group`,"aria-roledescription":`slide`,children:e}))}),_?/* @__PURE__ */ a(`button`,{type:`button`,className:`wui-carousel-arrow wui-carousel-next`,"aria-label":b,children:/* @__PURE__ */ a(n,{name:`chevron-right`,size:20})}):null]}),v?/* @__PURE__ */ a(`div`,{className:`wui-carousel-dots`}):null,/* @__PURE__ */ a(`span`,{className:`visually-hidden`,"data-wui-status":``,"aria-live":`polite`,"aria-atomic":`true`})]})}export{c as default};
1
+ import e from"../lib/useElementEntry.js";import t from"../lib/useWuiText.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./AppIcon.js";import i from"./warnUnknownProps.js";import{Children as a}from"react";import{jsx as o,jsxs as s}from"react/jsx-runtime";import{CAROUSEL_TEXT as c}from"@webority/ui-elements/text";var l=()=>import(`@webority/ui-elements/elements/carousel`);function u(u){let{marker:d,props:f}=n(`AppCarousel`,u),p=t(`carousel`,c),{label:m,autoplay:h,loop:g=!1,perView:_,perViewMd:v,perViewLg:y,arrows:b=!0,dots:x=!0,previousLabel:S=p.previousLabel,nextLabel:C=p.nextLabel,dotLabel:w=p.dotLabel,pauseLabel:T=p.pauseLabel,playLabel:E=p.playLabel,className:D=``,children:O,style:k,...A}=f;i(`AppCarousel`,A),e(`wui-carousel`,l);let j=Number(h)>0?Math.round(Number(h)):0,M={..._!==void 0&&Number(_)>1?{"--wui-carousel-per-view":_}:null,...v!==void 0&&Number(v)>=1?{"--wui-carousel-per-view-md":v}:null,...y!==void 0&&Number(y)>=1?{"--wui-carousel-per-view-lg":y}:null};return/* @__PURE__ */ s(`wui-carousel`,{class:[`wui-carousel`,D].filter(Boolean).join(` `),role:`region`,"aria-roledescription":p.carouselLabel,"aria-label":m,autoplay:j||void 0,loop:g?``:void 0,"dot-label":w===p.dotLabel?void 0:w,"pause-label":T===p.pauseLabel?void 0:T,"play-label":E===p.playLabel?void 0:E,style:Object.keys(M).length||k?{...M,...k}:void 0,...d,...A,children:[j?/* @__PURE__ */ s(`button`,{type:`button`,className:`wui-carousel-pause`,children:[/* @__PURE__ */ o(`span`,{className:`wui-carousel-pause-icon`,"aria-hidden":`true`}),/* @__PURE__ */ o(`span`,{className:`wui-carousel-pause-text`,children:T})]}):null,/* @__PURE__ */ s(`div`,{className:`wui-carousel-stage`,children:[b?/* @__PURE__ */ o(`button`,{type:`button`,className:`wui-carousel-arrow wui-carousel-prev`,"aria-label":S,children:/* @__PURE__ */ o(r,{name:`chevron-left`,size:20})}):null,/* @__PURE__ */ o(`div`,{className:`wui-carousel-track`,tabIndex:0,role:`group`,"aria-label":m,children:a.map(a.toArray(O),e=>/* @__PURE__ */ o(`div`,{className:`wui-carousel-slide`,role:`group`,"aria-roledescription":p.slideLabel,children:e}))}),b?/* @__PURE__ */ o(`button`,{type:`button`,className:`wui-carousel-arrow wui-carousel-next`,"aria-label":C,children:/* @__PURE__ */ o(r,{name:`chevron-right`,size:20})}):null]}),x?/* @__PURE__ */ o(`div`,{className:`wui-carousel-dots`}):null,/* @__PURE__ */ o(`span`,{className:`visually-hidden`,"data-wui-status":``,"aria-live":`polite`,"aria-atomic":`true`})]})}export{u as default};
@@ -1 +1 @@
1
- import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./warnUnknownProps.js";import{jsx as n,jsxs as r}from"react/jsx-runtime";var i=(...e)=>e.filter(Boolean).join(` `),a=e=>e==null||e===``;function o(o){let{marker:s,props:c}=e(`AppCell`,o),{primary:l,secondary:u,href:d,mono:f=!1,numeric:p=!1,className:m=``,...h}=c;t(`AppCell`,h);let g=a(l)?`-`:l;return/* @__PURE__ */ r(`div`,{className:i(`wui-cell`,p&&`wui-cell-numeric`,f&&`wui-cell-mono`,m),...s,...h,children:[d?/* @__PURE__ */ n(`a`,{className:`wui-cell-primary`,href:d,children:g}):/* @__PURE__ */ n(`span`,{className:`wui-cell-primary`,children:g}),a(u)?null:/* @__PURE__ */ n(`span`,{className:`wui-cell-secondary`,children:u})]})}export{o as default};
1
+ import{emptyPlaceholder as e}from"../lib/emptyValue.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./warnUnknownProps.js";import{jsx as r,jsxs as i}from"react/jsx-runtime";var a=(...e)=>e.filter(Boolean).join(` `),o=e=>e==null||e===``;function s(s){let{marker:c,props:l}=t(`AppCell`,s),{primary:u,secondary:d,href:f,mono:p=!1,numeric:m=!1,className:h=``,...g}=l;n(`AppCell`,g);let _=o(u)?e():u;return/* @__PURE__ */ i(`div`,{className:a(`wui-cell`,m&&`wui-cell-numeric`,p&&`wui-cell-mono`,h),...c,...g,children:[f?/* @__PURE__ */ r(`a`,{className:`wui-cell-primary`,href:f,children:_}):/* @__PURE__ */ r(`span`,{className:`wui-cell-primary`,children:_}),o(d)?null:/* @__PURE__ */ r(`span`,{className:`wui-cell-secondary`,children:d})]})}export{s as default};
@@ -1 +1 @@
1
- import{devWarn as e}from"../lib/devWarn.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./assertValidValue.js";import r from"./warnUnknownProps.js";import{forwardRef as i,useCallback as a,useEffect as o,useLayoutEffect as s,useRef as c,useState as l}from"react";import{jsx as u}from"react/jsx-runtime";var d=(e,t)=>{if(!(e instanceof CustomEvent))throw Error(`${t} arrived without a CustomEvent`);return e.detail},f=`wui-chart:select`,p=`wui-chart:legend-change`,m=`wui-chart:ready`,ee=[`line`,`area`,`column`,`bar`,`donut`,`heatmap`,`calendar`,`funnel`,`gauge`,`waterfall`,`treemap`,`sankey`,`scatter`,`bubble`,`multiples`],te=[`none`,`stacked`,`percent`],h=[`ready`,`loading`,`empty`,`error`],g=[`auto`,`svg`,`canvas`],ne=[`chart`,`table`],re=`This chart couldn't load. Try again in a moment.`,_=()=>{try{return process.env.NODE_ENV!==`production`}catch{return!0}},v=!1;function y(){!v&&_()&&(v=!0,e("[@webority/ui-react] <AppChart> has no `title`, which names the chart for assistive tech and its exported files."))}var b=e=>e===``?void 0:e,x=e=>Array.isArray(e)?e.map(x):e==null||Object.getPrototypeOf(e)!==Object.prototype?e:Object.fromEntries(Object.entries(e).filter(([,e])=>e!==``).map(([e,t])=>[e,x(t)])),S=e=>({type:b(e.type),title:b(e.title),description:b(e.description),data:e.data,x:x(e.x),series:x(e.series),group:x(e.group),to:x(e.to),size:x(e.size),trend:e.trend,zoom:e.zoom,bands:x(e.bands),stack:b(e.stack),y:x(e.y),target:x(e.target),centerLabel:b(e.centerLabel),valueLabels:b(e.valueLabels),height:e.height!==void 0&&e.height>0?e.height:void 0,state:b(e.state),emptyText:b(e.emptyText),errorText:b(e.errorText),loadingText:b(e.loadingText),renderer:b(e.renderer),timeZone:b(e.timeZone)}),ie=(e,t)=>t!=null&&Object.keys(e).every(n=>Object.is(e[n],t[n])),ae=e=>{try{return JSON.stringify(e)}catch{return null}},C=i(function(i,v){let{marker:b,props:x}=t(`AppChart`,i),{type:C,title:w,description:oe,data:se,x:ce,series:le,group:ue,to:T,size:E,trend:D,zoom:O,bands:k,stack:A,y:j,target:M,centerLabel:N,valueLabels:P,height:F,state:I,loading:L,error:R,emptyText:z,errorText:B,loadingText:de,renderer:V,timeZone:H,view:U,onSelect:W,onLegendChange:G,onReady:K,className:q=``,style:J,...Y}=x;r(`AppChart`,Y),n(`AppChart`,`type`,C,ee),n(`AppChart`,`stack`,A,te),n(`AppChart`,`state`,I,h),n(`AppChart`,`renderer`,V,g),n(`AppChart`,`view`,U,ne),w||y();let X=!!R;_()&&L&&X&&e("[@webority/ui-react] <AppChart> takes `loading` or `error`, not both; `error` is shown.");let fe=X?`error`:L?`loading`:I,pe=X?R:B,Z=c(null),Q=c({props:null,signature:null}),$=c({onSelect:W,onLegendChange:G,onReady:K}),[me,he]=l(!1),ge=a(e=>{Z.current=e,typeof v==`function`?v(e):v&&(v.current=e)},[v]);return o(()=>{$.current={onSelect:W,onLegendChange:G,onReady:K}}),s(()=>{let e=Z.current;if(!e)return;let t={type:C,title:w,description:oe,data:se,x:ce,series:le,group:ue,to:T,size:E,trend:D,zoom:O,bands:k,stack:A,y:j,target:M,centerLabel:N,valueLabels:P,height:F,state:fe,emptyText:z,errorText:pe,loadingText:de,renderer:V,timeZone:H};if(ie(t,Q.current.props))return;Q.current.props=t;let n=S(t),r=ae(n);(r===null||r!==Q.current.signature)&&(Q.current.signature=r,e.spec=n)}),o(()=>{let e=Z.current;if(!e)throw Error(`AppChart: the <wui-chart> element is not mounted`);let t=[[f,e=>$.current.onSelect?.(d(e,f))],[p,e=>$.current.onLegendChange?.(d(e,p))],[m,e=>$.current.onReady?.(d(e,m))]];for(let[n,r]of t)e.addEventListener(n,r);return()=>{for(let[n,r]of t)e.removeEventListener(n,r)}},[]),o(()=>{let t=!0;return import(`@webority/ui-elements/chart`).catch(n=>{e(`[AppChart] the chart failed to load:`,n?.message),t&&he(!0)}),()=>{t=!1}},[]),me?/* @__PURE__ */ u(`div`,{...b,className:q||void 0,style:J,role:`status`,children:/* @__PURE__ */ u(`p`,{className:`wui-chart-state-text`,children:B||re})}):/* @__PURE__ */ u(`wui-chart`,{ref:ge,view:U||void 0,className:q||void 0,style:J,...b,...Y})});export{C as default};
1
+ import{devWarn as e}from"../lib/devWarn.js";import t from"../lib/useWuiText.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./assertValidValue.js";import ee from"./warnUnknownProps.js";import{forwardRef as i,useCallback as te,useEffect as a,useLayoutEffect as o,useRef as s,useState as c}from"react";import{jsx as l}from"react/jsx-runtime";import{CHART_TEXT as ne}from"@webority/ui-elements/text";var u=(e,t)=>{if(!(e instanceof CustomEvent))throw Error(`${t} arrived without a CustomEvent`);return e.detail},d=`wui-chart:select`,f=`wui-chart:legend-change`,p=`wui-chart:ready`,m=[`line`,`area`,`column`,`bar`,`donut`,`heatmap`,`calendar`,`funnel`,`gauge`,`waterfall`,`treemap`,`sankey`,`scatter`,`bubble`,`multiples`],re=[`none`,`stacked`,`percent`],h=[`ready`,`loading`,`empty`,`error`],ie=[`auto`,`svg`,`canvas`],ae=[`chart`,`table`],g=()=>{try{return process.env.NODE_ENV!==`production`}catch{return!0}},_=!1;function v(){!_&&g()&&(_=!0,e("[@webority/ui-react] <AppChart> has no `title`, which names the chart for assistive tech and its exported files."))}var y=e=>e===``?void 0:e,b=e=>Array.isArray(e)?e.map(b):e==null||Object.getPrototypeOf(e)!==Object.prototype?e:Object.fromEntries(Object.entries(e).filter(([,e])=>e!==``).map(([e,t])=>[e,b(t)])),oe=e=>({type:y(e.type),title:y(e.title),description:y(e.description),data:e.data,x:b(e.x),series:b(e.series),group:b(e.group),to:b(e.to),size:b(e.size),trend:e.trend,zoom:e.zoom,bands:b(e.bands),stack:y(e.stack),y:b(e.y),target:b(e.target),centerLabel:y(e.centerLabel),valueLabels:y(e.valueLabels),height:e.height!==void 0&&e.height>0?e.height:void 0,state:y(e.state),emptyText:y(e.emptyText),errorText:y(e.errorText),loadingText:y(e.loadingText),renderer:y(e.renderer),timeZone:y(e.timeZone)}),se=(e,t)=>t!=null&&Object.keys(e).every(n=>Object.is(e[n],t[n])),ce=e=>{try{return JSON.stringify(e)}catch{return null}},x=i(function(i,_){let{marker:y,props:b}=n(`AppChart`,i),x=t(`chart`,ne),{type:S,title:C,description:le,data:ue,x:de,series:fe,group:pe,to:w,size:T,trend:E,zoom:D,bands:O,stack:k,y:A,target:j,centerLabel:M,valueLabels:N,height:P,state:F,loading:I,error:L,emptyText:R,errorText:z,loadingText:B,renderer:V,timeZone:me,view:H,onSelect:U,onLegendChange:W,onReady:G,className:K=``,style:q,...J}=b;ee(`AppChart`,J),r(`AppChart`,`type`,S,m),r(`AppChart`,`stack`,k,re),r(`AppChart`,`state`,F,h),r(`AppChart`,`renderer`,V,ie),r(`AppChart`,`view`,H,ae),C||v();let Y=!!L;g()&&I&&Y&&e("[@webority/ui-react] <AppChart> takes `loading` or `error`, not both; `error` is shown.");let X=Y?`error`:I?`loading`:F,he=Y?L:z,Z=s(null),Q=s({props:null,signature:null}),$=s({onSelect:U,onLegendChange:W,onReady:G}),[ge,_e]=c(!1),ve=te(e=>{Z.current=e,typeof _==`function`?_(e):_&&(_.current=e)},[_]);return a(()=>{$.current={onSelect:U,onLegendChange:W,onReady:G}}),o(()=>{let e=Z.current;if(!e)return;let t={type:S,title:C,description:le,data:ue,x:de,series:fe,group:pe,to:w,size:T,trend:E,zoom:D,bands:O,stack:k,y:A,target:j,centerLabel:M,valueLabels:N,height:P,state:X,emptyText:R,errorText:he,loadingText:B,renderer:V,timeZone:me};if(se(t,Q.current.props))return;Q.current.props=t;let n=oe(t),r=ce(n);(r===null||r!==Q.current.signature)&&(Q.current.signature=r,e.spec=n)}),a(()=>{let e=Z.current;if(!e)throw Error(`AppChart: the <wui-chart> element is not mounted`);let t=[[d,e=>$.current.onSelect?.(u(e,d))],[f,e=>$.current.onLegendChange?.(u(e,f))],[p,e=>$.current.onReady?.(u(e,p))]];for(let[n,r]of t)e.addEventListener(n,r);return()=>{for(let[n,r]of t)e.removeEventListener(n,r)}},[]),a(()=>{let t=!0;return import(`@webority/ui-elements/chart`).catch(n=>{e(`[AppChart] the chart failed to load:`,n?.message),t&&_e(!0)}),()=>{t=!1}},[]),ge?/* @__PURE__ */ l(`div`,{...y,className:K||void 0,style:q,role:`status`,children:/* @__PURE__ */ l(`p`,{className:`wui-chart-state-text`,children:z||x.errorText})}):/* @__PURE__ */ l(`wui-chart`,{ref:ve,view:H||void 0,className:K||void 0,style:q,...y,...J})});export{x as default};
@@ -1 +1 @@
1
- import{devWarn as e}from"../lib/devWarn.js";import t from"../lib/fillLabel.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./AppButton.js";import i from"./AppCard.js";import a from"./AppDropdown.js";import o from"./AppIcon.js";import s from"./AppSegmented.js";import c from"./assertValidValue.js";import l from"./warnUnknownProps.js";import{useLayoutEffect as u,useMemo as d,useRef as f,useState as p}from"react";import{Fragment as m,jsx as h,jsxs as g}from"react/jsx-runtime";var _=e=>e instanceof HTMLElement,v=e=>{let t=e.querySelector(`wui-chart`);return t&&_(t)?t:null},y=()=>{try{return process.env.NODE_ENV!==`production`}catch{return!0}},b=!1;function x(){!b&&y()&&(b=!0,e("[@webority/ui-react] <AppChartCard> has no `title`, which is the card's heading and names its menu button."))}var S=e=>e.getAttribute(`view`)===`table`?`table`:`chart`,C=e=>e===`chart`||e===`table`;function w(e){let{marker:_,props:y}=n(`AppChartCard`,e),{title:b,subtitle:w,toolbar:T=!0,onRetry:E,footer:D,children:O,className:k=``,legendLabel:A=`Show legend`,legendTitle:j=`Show or hide the legend`,viewLabel:M=`View`,chartViewLabel:N=`Chart`,tableViewLabel:P=`Table`,moreActionsLabel:F=`More actions`,moreActionsForLabel:I=`More actions for {title}`,downloadPngLabel:L=`Download PNG`,downloadCsvLabel:R=`Download CSV`,retryLabel:z=`Try again`,...B}=y;l(`AppChartCard`,B),b||x();let V=f(null),H=f(null),[U,W]=p(`chart`),G=f(U);G.current=U;let[K,q]=p(!0),J=()=>V.current?v(V.current):null;u(()=>{let e=V.current;if(!e)throw Error(`AppChartCard: the chart body is not mounted`);let t=()=>{let t=v(e);t&&(t===H.current?W(S(t)):(H.current=t,t.hasAttribute(`view`)?W(S(t)):G.current!==`chart`&&t.setAttribute(`view`,G.current)))};t();let n=new MutationObserver(t);return n.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`view`]}),()=>n.disconnect()},[]);let Y=e=>{if(c(`AppChartCard`,`view`,e,[`chart`,`table`]),!C(e))throw TypeError(`[@webority/ui-react] <AppChartCard> received no view`);W(e),J()?.setAttribute(`view`,e)},X=d(()=>[{value:`chart`,label:N,icon:`chart`},{value:`table`,label:P,icon:`grid`}],[N,P]),Z=/* @__PURE__ */ g(m,{children:[/* @__PURE__ */ h(`button`,{type:`button`,className:`topbar-icon-btn wui-chart-card-tool wui-chart-card-legend-tool`,"aria-pressed":K,"aria-label":A,title:j,onClick:()=>q(!K),children:/* @__PURE__ */ h(o,{name:`list`,size:16})}),/* @__PURE__ */ h(s,{size:`sm`,label:M,options:X,value:U,onChange:Y}),/* @__PURE__ */ h(a,{icon:`more-horizontal`,label:b?t(I,{title:b}):F,items:[{key:`png`,label:L,icon:`image`,onClick:()=>J()?.exportPng?.()},{key:`csv`,label:R,icon:`download`,onClick:()=>J()?.exportCsv?.()}]})]}),Q=[`wui-chart-card`,K?``:`wui-chart-card-legend-off`,k].filter(Boolean).join(` `);return/* @__PURE__ */ g(i,{title:b,subtitle:w,headerActions:T?Z:void 0,footer:D,className:Q,..._,...B,children:[/* @__PURE__ */ h(`div`,{ref:V,children:O}),E&&/* @__PURE__ */ h(`div`,{className:`wui-chart-card-retry`,children:/* @__PURE__ */ h(r,{variant:`outline`,size:`sm`,onClick:E,children:z})})]})}export{w as default};
1
+ import{devWarn as e}from"../lib/devWarn.js";import t from"../lib/useWuiText.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./AppButton.js";import i from"./AppCard.js";import a from"./AppDropdown.js";import o from"./AppIcon.js";import s from"./AppSegmented.js";import c from"./assertValidValue.js";import l from"./warnUnknownProps.js";import{useLayoutEffect as u,useMemo as d,useRef as f,useState as p}from"react";import{Fragment as m,jsx as h,jsxs as g}from"react/jsx-runtime";import{CHART_CARD_TEXT as _,fillText as v}from"@webority/ui-elements/text";var y=e=>e instanceof HTMLElement,b=e=>{let t=e.querySelector(`wui-chart`);return t&&y(t)?t:null},x=()=>{try{return process.env.NODE_ENV!==`production`}catch{return!0}},S=!1;function C(){!S&&x()&&(S=!0,e("[@webority/ui-react] <AppChartCard> has no `title`, which is the card's heading and names its menu button."))}var w=e=>e.getAttribute(`view`)===`table`?`table`:`chart`,T=e=>e===`chart`||e===`table`;function E(e){let{marker:y,props:x}=n(`AppChartCard`,e),S=t(`chartCard`,_),{title:E,subtitle:D,toolbar:O=!0,onRetry:k,footer:A,children:j,className:M=``,legendLabel:N=S.legendLabel,legendTitle:P=S.legendTitle,viewLabel:F=S.viewLabel,chartViewLabel:I=S.chartViewLabel,tableViewLabel:L=S.tableViewLabel,moreActionsLabel:R=S.moreActionsLabel,moreActionsForLabel:z=S.moreActionsForLabel,downloadPngLabel:B=S.downloadPngLabel,downloadCsvLabel:V=S.downloadCsvLabel,retryLabel:H=S.retryLabel,...U}=x;l(`AppChartCard`,U),E||C();let W=f(null),G=f(null),[K,q]=p(`chart`),J=f(K);J.current=K;let[Y,X]=p(!0),Z=()=>W.current?b(W.current):null;u(()=>{let e=W.current;if(!e)throw Error(`AppChartCard: the chart body is not mounted`);let t=()=>{let t=b(e);t&&(t===G.current?q(w(t)):(G.current=t,t.hasAttribute(`view`)?q(w(t)):J.current!==`chart`&&t.setAttribute(`view`,J.current)))};t();let n=new MutationObserver(t);return n.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`view`]}),()=>n.disconnect()},[]);let Q=e=>{if(c(`AppChartCard`,`view`,e,[`chart`,`table`]),!T(e))throw TypeError(`[@webority/ui-react] <AppChartCard> received no view`);q(e),Z()?.setAttribute(`view`,e)},$=d(()=>[{value:`chart`,label:I,icon:`chart`},{value:`table`,label:L,icon:`grid`}],[I,L]),ee=/* @__PURE__ */ g(m,{children:[/* @__PURE__ */ h(`button`,{type:`button`,className:`topbar-icon-btn wui-chart-card-tool wui-chart-card-legend-tool`,"aria-pressed":Y,"aria-label":N,title:P,onClick:()=>X(!Y),children:/* @__PURE__ */ h(o,{name:`list`,size:16})}),/* @__PURE__ */ h(s,{size:`sm`,label:F,options:$,value:K,onChange:Q}),/* @__PURE__ */ h(a,{icon:`more-horizontal`,label:E?v(z,{title:E}):R,items:[{key:`png`,label:B,icon:`image`,onClick:()=>Z()?.exportPng?.()},{key:`csv`,label:V,icon:`download`,onClick:()=>Z()?.exportCsv?.()}]})]}),te=[`wui-chart-card`,Y?``:`wui-chart-card-legend-off`,M].filter(Boolean).join(` `);return/* @__PURE__ */ g(i,{title:E,subtitle:D,headerActions:O?ee:void 0,footer:A,className:te,...y,...U,children:[/* @__PURE__ */ h(`div`,{ref:W,children:j}),k&&/* @__PURE__ */ h(`div`,{className:`wui-chart-card-retry`,children:/* @__PURE__ */ h(r,{variant:`outline`,size:`sm`,onClick:k,children:H})})]})}export{E as default};
@@ -1 +1 @@
1
- import e from"../lib/CheckField.js";import{FIELD_SIZES as t}from"../lib/fieldState.js";import n from"../lib/labelWithHelp.js";import{splitMarkerProps as r}from"../lib/wuiMarker.js";import i from"./assertValidValue.js";import a from"./warnUnknownProps.js";import{forwardRef as o}from"react";import{jsx as s}from"react/jsx-runtime";var c=[`circle`];function l(e,t){if(t!=null&&t!==``)throw Error(`<AppCheckbox> controlOnly draws no field, so it takes no ${e}; draw the label or message on the page.`)}var u=o(function(o,u){let{marker:d,props:f}=r(`AppCheckbox`,o),{label:p,id:m,name:h,error:g,helperText:_,shape:v,help:y,helpLabel:b=`More information`,readOnly:x=!1,loading:S=!1,size:C=`md`,controlOnly:w=!1,className:T=``,...E}=f;if(a(`AppCheckbox`,E),w&&(l(`label`,p),l(`error`,g),l(`helperText`,_),C!==`md`))throw Error(`<AppCheckbox> controlOnly draws no field, so it takes no size; draw the label or message on the page.`);i(`AppCheckbox`,`shape`,v,c),i(`AppCheckbox`,`size`,C,t);let D=v===`circle`?`form-check form-check-circle`:`form-check`;return/* @__PURE__ */ s(e,{rootProps:d,ref:u,label:n(p,y,b),id:m,name:h,error:g,hint:_,className:T,rest:E,inputType:`checkbox`,wrapperClass:D,readOnly:x,loading:S,size:C,controlOnly:w})});export{u as default};
1
+ import e from"../lib/CheckField.js";import{BOX_SIZES as t}from"../lib/fieldState.js";import n from"../lib/labelWithHelp.js";import r from"../lib/useWuiText.js";import{splitMarkerProps as i}from"../lib/wuiMarker.js";import a from"./assertValidValue.js";import o from"./warnUnknownProps.js";import{forwardRef as s}from"react";import{jsx as c}from"react/jsx-runtime";import{CHECKBOX_TEXT as l}from"@webority/ui-elements/text";var u=[`circle`];function d(e,t){if(t!=null&&t!==``)throw Error(`<AppCheckbox> controlOnly draws no field, so it takes no ${e}; draw the label or message on the page.`)}var f=s(function(s,f){let{marker:p,props:m}=i(`AppCheckbox`,s),h=r(`checkbox`,l),{label:g,id:_,name:v,error:y,helperText:b,shape:x,help:S,helpLabel:C=h.helpLabel,readOnly:w=!1,loading:T=!1,size:E=`md`,controlOnly:D=!1,className:O=``,...k}=m;if(o(`AppCheckbox`,k),D&&(d(`label`,g),d(`error`,y),d(`helperText`,b),E!==`md`))throw Error(`<AppCheckbox> controlOnly draws no field, so it takes no size; draw the label or message on the page.`);a(`AppCheckbox`,`shape`,x,u),a(`AppCheckbox`,`size`,E,t);let A=x===`circle`?`form-check form-check-circle`:`form-check`;return/* @__PURE__ */ c(e,{rootProps:p,ref:f,label:n(g,S,C),id:_,name:v,error:y,hint:b,className:O,rest:k,inputType:`checkbox`,wrapperClass:A,readOnly:w,loading:T,size:E,controlOnly:D})});export{f as default};
@@ -1 +1 @@
1
- import{TONES as e}from"../lib/vocabulary.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./AppIcon.js";import r from"./assertValidValue.js";import i from"./warnUnknownProps.js";import{Fragment as a,jsx as o,jsxs as s}from"react/jsx-runtime";var c=[`soft`,`outline`,`solid`],l=[`sm`,`md`];function u(u){let{marker:d,props:f}=t(`AppChip`,u),{label:p,children:m,tone:h=`neutral`,variant:g=`soft`,size:_=`md`,leadingIcon:v,avatar:y,onRemove:b,onClick:x,selected:S,count:C,disabled:w=!1,removeLabel:T,className:E=``,...D}=f;if(i(`AppChip`,D),r(`AppChip`,`tone`,h,e),r(`AppChip`,`variant`,g,c),r(`AppChip`,`size`,_,l),S!=null&&!x)throw RangeError(`[@webority/ui-react] <AppChip> received selected without onClick. Only a clickable chip can be the chosen filter: pass onClick, or omit selected.`);let O=p??m,k=C==null?null:/* @__PURE__ */ o(`span`,{className:`wui-chip-count`,children:C}),A={},j={};for(let[e,t]of Object.entries(D))x&&(e.startsWith(`aria-`)||e.startsWith(`data-`))?A[e]=t:j[e]=t;let M=[`chip`,h&&h!==`neutral`?h:``,g===`outline`?`chip-outline`:g===`solid`?`chip-solid`:``,_===`sm`?`chip-sm`:``,x?`chip-clickable`:``,b?`chip-removable`:``,w?`is-disabled`:``,E].filter(Boolean).join(` `),N=y?/* @__PURE__ */ o(`span`,{className:`chip-avatar`,children:typeof y==`string`?/* @__PURE__ */ o(`img`,{src:y,alt:``}):y}):v?/* @__PURE__ */ o(`span`,{className:`chip-ic`,children:/* @__PURE__ */ o(n,{name:v,size:_===`sm`?12:14})}):null,P=x?/* @__PURE__ */ s(`button`,{type:`button`,className:`chip-body`,"aria-pressed":S??void 0,...A,onClick:x,disabled:w,children:[N,/* @__PURE__ */ o(`span`,{className:`chip-label`,children:O}),k]}):/* @__PURE__ */ s(a,{children:[N,/* @__PURE__ */ o(`span`,{className:`chip-label`,children:O}),k]});return/* @__PURE__ */ s(`span`,{className:M,...d,...j,children:[P,b&&/* @__PURE__ */ o(`button`,{type:`button`,className:`chip-remove`,onClick:b,disabled:w,"aria-label":T||(typeof O==`string`?`Remove ${O}`:`Remove`),children:/* @__PURE__ */ o(n,{name:`x`,size:_===`sm`?12:14})})]})}export{u as default};
1
+ import e from"../lib/useWuiText.js";import{TONES as t}from"../lib/vocabulary.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./AppIcon.js";import i from"./assertValidValue.js";import a from"./warnUnknownProps.js";import{Fragment as o,jsx as s,jsxs as c}from"react/jsx-runtime";import{CHIP_TEXT as l,fillText as u}from"@webority/ui-elements/text";var d=[`soft`,`outline`,`solid`],f=[`sm`,`md`];function p(p){let{marker:m,props:h}=n(`AppChip`,p),g=e(`chip`,l),{label:_,children:v,tone:y=`neutral`,variant:b=`soft`,size:x=`md`,leadingIcon:S,avatar:C,onRemove:w,onClick:T,selected:E,count:D,disabled:O=!1,removeLabel:k,className:A=``,...j}=h;if(a(`AppChip`,j),i(`AppChip`,`tone`,y,t),i(`AppChip`,`variant`,b,d),i(`AppChip`,`size`,x,f),E!=null&&!T)throw RangeError(`[@webority/ui-react] <AppChip> received selected without onClick. Only a clickable chip can be the chosen filter: pass onClick, or omit selected.`);let M=_??v,N=D==null?null:/* @__PURE__ */ s(`span`,{className:`wui-chip-count`,children:D}),P={},F={};for(let[e,t]of Object.entries(j))T&&(e.startsWith(`aria-`)||e.startsWith(`data-`))?P[e]=t:F[e]=t;let I=[`chip`,y&&y!==`neutral`?y:``,b===`outline`?`chip-outline`:b===`solid`?`chip-solid`:``,x===`sm`?`chip-sm`:``,T?`chip-clickable`:``,w?`chip-removable`:``,O?`is-disabled`:``,A].filter(Boolean).join(` `),L=C?/* @__PURE__ */ s(`span`,{className:`chip-avatar`,children:typeof C==`string`?/* @__PURE__ */ s(`img`,{src:C,alt:``}):C}):S?/* @__PURE__ */ s(`span`,{className:`chip-ic`,children:/* @__PURE__ */ s(r,{name:S,size:x===`sm`?12:14})}):null,R=T?/* @__PURE__ */ c(`button`,{type:`button`,className:`chip-body`,"aria-pressed":E??void 0,...P,onClick:T,disabled:O,children:[L,/* @__PURE__ */ s(`span`,{className:`chip-label`,children:M}),N]}):/* @__PURE__ */ c(o,{children:[L,/* @__PURE__ */ s(`span`,{className:`chip-label`,children:M}),N]});return/* @__PURE__ */ c(`span`,{className:I,...m,...F,children:[R,w&&/* @__PURE__ */ s(`button`,{type:`button`,className:`chip-remove`,onClick:w,disabled:O,"aria-label":k||(typeof M==`string`?u(g.removeText,{content:M}):g.removeLabel),children:/* @__PURE__ */ s(r,{name:`x`,size:x===`sm`?12:14})})]})}export{p as default};
@@ -1 +1 @@
1
- import e from"../lib/useElementEntry.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./assertValidValue.js";import r from"./warnUnknownProps.js";import{jsx as i}from"react/jsx-runtime";var a=[`wrap`,`menu`],o=()=>import(`@webority/ui-elements/elements/overflow`);function s(s){e(`wui-overflow`,o);let{marker:c,props:l}=t(`AppChipGroup`,s),{children:u,overflow:d=`wrap`,moreLabel:f=`More`,label:p,className:m=``,...h}=l;r(`AppChipGroup`,h),n(`AppChipGroup`,`overflow`,d,a);let g=e=>[e,m].filter(Boolean).join(` `);return d===`menu`?/* @__PURE__ */ i(`wui-overflow`,{...c,class:`wui-chip-group-host`,label:f,children:/* @__PURE__ */ i(`div`,{role:`group`,"aria-label":p,className:g(`wui-chip-group wui-chip-group-nowrap`),"data-wui-overflow-list":``,...h,children:u})}):/* @__PURE__ */ i(`div`,{role:`group`,"aria-label":p,className:g(`wui-chip-group`),...c,...h,children:u})}export{s as default};
1
+ import e from"../lib/useElementEntry.js";import t from"../lib/useWuiText.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./assertValidValue.js";import i from"./warnUnknownProps.js";import{jsx as a}from"react/jsx-runtime";import{CHIP_GROUP_TEXT as o}from"@webority/ui-elements/text";var s=[`wrap`,`menu`],c=()=>import(`@webority/ui-elements/elements/overflow`);function l(l){e(`wui-overflow`,c);let{marker:u,props:d}=n(`AppChipGroup`,l),f=t(`chipGroup`,o),{children:p,overflow:m=`wrap`,moreLabel:h=f.moreLabel,label:g,className:_=``,...v}=d;i(`AppChipGroup`,v),r(`AppChipGroup`,`overflow`,m,s);let y=e=>[e,_].filter(Boolean).join(` `);return m===`menu`?/* @__PURE__ */ a(`wui-overflow`,{...u,class:`wui-chip-group-host`,label:h,children:/* @__PURE__ */ a(`div`,{role:`group`,"aria-label":g,className:y(`wui-chip-group wui-chip-group-nowrap`),"data-wui-overflow-list":``,...v,children:p})}):/* @__PURE__ */ a(`div`,{role:`group`,"aria-label":g,className:y(`wui-chip-group`),...u,...v,children:p})}export{l as default};
@@ -1 +1 @@
1
- import{FIELD_BUSY_CLASS as e,blockWhenReadOnly as t}from"../lib/fieldState.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./AppIcon.js";import i from"./AppInfoTip.js";import a from"./assertValidValue.js";import o from"./warnUnknownProps.js";import{Fragment as s,jsx as c,jsxs as l}from"react/jsx-runtime";var u={sm:` wui-struct-card-sm`,md:``,lg:` wui-struct-card-lg`},d={inline:``,stacked:` wui-struct-card-stacked`},f={filled:` wui-struct-card-filled`},p={sm:16,md:18,lg:22};function m(m){let{marker:h,props:g}=n(`AppChoiceCard`,m),{name:_,multiple:v=!1,value:y,checked:b,onChange:x,icon:S,iconNode:C,iconSize:w,image:T,imageAlt:E=``,children:D,title:O,description:k,help:A,helpLabel:j=`More information`,checkIcon:M=`check`,checkSize:N=18,hideCheck:P=!1,disabled:F=!1,readOnly:I=!1,loading:L=!1,size:R=`md`,layout:z=`inline`,selectedStyle:B,className:V=``,...H}=g;o(`AppChoiceCard`,H),a(`AppChoiceCard`,`size`,R,Object.keys(u)),a(`AppChoiceCard`,`layout`,z,Object.keys(d)),a(`AppChoiceCard`,`selectedStyle`,B,Object.keys(f));let U=u[R]??``,W=d[z]??``,G=B?f[B]??``:``,K=w??p[R]??p.md;return/* @__PURE__ */ l(`label`,{className:`struct-card${T?` struct-card-img-card`:``}${U}${W}${G}${P?` wui-struct-card-no-check`:``}${V?` ${V}`:``}${L?` ${e}`:``}`,"aria-disabled":F||void 0,"aria-busy":L||void 0,...h,...H,children:[/* @__PURE__ */ c(`input`,{type:v?`checkbox`:`radio`,name:_,value:y,className:`struct-card-input`,checked:b,onChange:x,onClick:t(I||L),"aria-readonly":I||void 0,disabled:F||L}),T?/* @__PURE__ */ c(`span`,{className:`struct-card-media`,children:/* @__PURE__ */ c(`img`,{className:`struct-card-img`,src:T,alt:E})}):C||S?/* @__PURE__ */ c(`span`,{className:`struct-card-ic`,children:C||S&&/* @__PURE__ */ l(s,{children:[/* @__PURE__ */ c(`span`,{className:`wui-struct-card-glyph`,children:/* @__PURE__ */ c(r,{name:S,size:K})}),/* @__PURE__ */ c(`span`,{className:`wui-struct-card-glyph-on`,children:/* @__PURE__ */ c(r,{name:S,size:K,variant:`bold`})})]})}):null,/* @__PURE__ */ l(`span`,{className:`struct-card-body`,children:[D||/* @__PURE__ */ l(s,{children:[O&&/* @__PURE__ */ c(`span`,{className:`struct-card-title`,children:O}),k&&/* @__PURE__ */ c(`span`,{className:`struct-card-desc`,children:k})]}),A&&/* @__PURE__ */ c(i,{label:j,children:A})]}),!P&&/* @__PURE__ */ c(`span`,{className:`struct-card-check`,children:/* @__PURE__ */ c(r,{name:M,size:N})})]})}export{m as default};
1
+ import{FIELD_BUSY_CLASS as e,blockWhenReadOnly as t}from"../lib/fieldState.js";import n from"../lib/useWuiText.js";import{splitMarkerProps as r}from"../lib/wuiMarker.js";import i from"./AppIcon.js";import a from"./AppInfoTip.js";import o from"./assertValidValue.js";import s from"./warnUnknownProps.js";import{Fragment as c,jsx as l,jsxs as u}from"react/jsx-runtime";import{CHOICE_CARD_TEXT as d}from"@webority/ui-elements/text";var f={sm:` wui-struct-card-sm`,md:``,lg:` wui-struct-card-lg`},p={inline:``,stacked:` wui-struct-card-stacked`},m={filled:` wui-struct-card-filled`},h={sm:16,md:18,lg:22};function g(g){let{marker:_,props:v}=r(`AppChoiceCard`,g),y=n(`choiceCard`,d),{name:b,multiple:x=!1,value:S,checked:C,onChange:w,icon:T,iconNode:E,iconSize:D,image:O,imageAlt:k=``,children:A,title:j,description:M,help:N,helpLabel:P=y.helpLabel,checkIcon:F=`check`,checkSize:I=18,hideCheck:L=!1,disabled:R=!1,readOnly:z=!1,loading:B=!1,size:V=`md`,layout:H=`inline`,selectedStyle:U,className:W=``,...G}=v;s(`AppChoiceCard`,G),o(`AppChoiceCard`,`size`,V,Object.keys(f)),o(`AppChoiceCard`,`layout`,H,Object.keys(p)),o(`AppChoiceCard`,`selectedStyle`,U,Object.keys(m));let K=f[V]??``,q=p[H]??``,J=U?m[U]??``:``,Y=D??h[V]??h.md;return/* @__PURE__ */ u(`label`,{className:`struct-card${O?` struct-card-img-card`:``}${K}${q}${J}${L?` wui-struct-card-no-check`:``}${W?` ${W}`:``}${B?` ${e}`:``}`,"aria-disabled":R||void 0,"aria-busy":B||void 0,..._,...G,children:[/* @__PURE__ */ l(`input`,{type:x?`checkbox`:`radio`,name:b,value:S,className:`struct-card-input`,checked:C,onChange:w,onClick:t(z||B),"aria-readonly":z||void 0,disabled:R||B}),O?/* @__PURE__ */ l(`span`,{className:`struct-card-media`,children:/* @__PURE__ */ l(`img`,{className:`struct-card-img`,src:O,alt:k})}):E||T?/* @__PURE__ */ l(`span`,{className:`struct-card-ic`,children:E||T&&/* @__PURE__ */ u(c,{children:[/* @__PURE__ */ l(`span`,{className:`wui-struct-card-glyph`,children:/* @__PURE__ */ l(i,{name:T,size:Y})}),/* @__PURE__ */ l(`span`,{className:`wui-struct-card-glyph-on`,children:/* @__PURE__ */ l(i,{name:T,size:Y,variant:`bold`})})]})}):null,/* @__PURE__ */ u(`span`,{className:`struct-card-body`,children:[A||/* @__PURE__ */ u(c,{children:[j&&/* @__PURE__ */ l(`span`,{className:`struct-card-title`,children:j}),M&&/* @__PURE__ */ l(`span`,{className:`struct-card-desc`,children:M})]}),N&&/* @__PURE__ */ l(a,{label:P,children:N})]}),!L&&/* @__PURE__ */ l(`span`,{className:`struct-card-check`,children:/* @__PURE__ */ l(i,{name:F,size:I})})]})}export{g as default};
@@ -1 +1 @@
1
- import{FIELD_BUSY_CLASS as e,blockWhenReadOnly as t}from"../lib/fieldState.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./AppInfoTip.js";import i from"./assertValidValue.js";import a from"./warnUnknownProps.js";import{Fragment as o,jsx as s,jsxs as c}from"react/jsx-runtime";var l=[`sm`,`md`,`lg`],u=[`soft`,`solid`];function d(d){let{marker:f,props:p}=n(`AppChoiceChip`,d),{multiple:m=!0,label:h,name:g,value:_,checked:v,onChange:y,children:b,count:x,help:S,helpLabel:C=`More information`,size:w=`md`,variant:T=`soft`,disabled:E=!1,readOnly:D=!1,loading:O=!1,className:k=``,ref:A,...j}=p;return a(`AppChoiceChip`,j),i(`AppChoiceChip`,`size`,w,l),i(`AppChoiceChip`,`variant`,T,u),/* @__PURE__ */ c(o,{children:[/* @__PURE__ */ c(`label`,{className:`choice-chip${w===`sm`?` choice-chip-sm`:w===`lg`?` choice-chip-lg`:``}${T===`solid`?` wui-choice-chip-solid`:``}${k?` ${k}`:``}${O?` ${e}`:``}`,"aria-busy":O||void 0,...f,...j,children:[/* @__PURE__ */ s(`input`,{ref:A,type:m?`checkbox`:`radio`,name:g,value:_,checked:v,disabled:E||O,"aria-readonly":D||void 0,onClick:t(D||O),onChange:y}),/* @__PURE__ */ s(`span`,{children:h??b}),x!=null&&/* @__PURE__ */ s(`span`,{className:`count`,children:x})]}),S&&/* @__PURE__ */ s(r,{label:C,children:S})]})}export{d as default};
1
+ import{FIELD_BUSY_CLASS as e,blockWhenReadOnly as t}from"../lib/fieldState.js";import n from"../lib/useWuiText.js";import{splitMarkerProps as r}from"../lib/wuiMarker.js";import i from"./AppInfoTip.js";import a from"./assertValidValue.js";import o from"./warnUnknownProps.js";import{Fragment as s,jsx as c,jsxs as l}from"react/jsx-runtime";import{CHOICE_CHIP_TEXT as u}from"@webority/ui-elements/text";var d=[`sm`,`md`,`lg`],f=[`soft`,`solid`];function p(p){let{marker:m,props:h}=r(`AppChoiceChip`,p),g=n(`choiceChip`,u),{multiple:_=!0,label:v,name:y,value:b,checked:x,onChange:S,children:C,count:w,help:T,helpLabel:E=g.helpLabel,size:D=`md`,variant:O=`soft`,disabled:k=!1,readOnly:A=!1,loading:j=!1,className:M=``,ref:N,...P}=h;return o(`AppChoiceChip`,P),a(`AppChoiceChip`,`size`,D,d),a(`AppChoiceChip`,`variant`,O,f),/* @__PURE__ */ l(s,{children:[/* @__PURE__ */ l(`label`,{className:`choice-chip${D===`sm`?` choice-chip-sm`:D===`lg`?` choice-chip-lg`:``}${O===`solid`?` wui-choice-chip-solid`:``}${M?` ${M}`:``}${j?` ${e}`:``}`,"aria-busy":j||void 0,...m,...P,children:[/* @__PURE__ */ c(`input`,{ref:N,type:_?`checkbox`:`radio`,name:y,value:b,checked:x,disabled:k||j,"aria-readonly":A||void 0,onClick:t(A||j),onChange:S}),/* @__PURE__ */ c(`span`,{children:v??C}),w!=null&&/* @__PURE__ */ c(`span`,{className:`count`,children:w})]}),T&&/* @__PURE__ */ c(i,{label:E,children:T})]})}export{p as default};
@@ -1 +1 @@
1
- import e from"../lib/FieldMessage.js";import{FIELD_BUSY_CLASS as t}from"../lib/fieldState.js";import n from"../lib/fillLabel.js";import{useFieldError as r}from"../lib/formFields.js";import{splitMarkerProps as i}from"../lib/wuiMarker.js";import a from"./AppInfoTip.js";import o from"./AppRequiredMark.js";import s from"./assertValidValue.js";import c from"./warnUnknownProps.js";import{useId as l,useState as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";var p=[`sm`,`md`,`lg`];function m(m){let{marker:h,props:g}=i(`AppColorField`,m),{value:_,defaultValue:v,onChange:y,label:b,required:x=!1,optional:S=!1,error:C,helperText:w,help:T,helpLabel:E=`More information`,colourLabel:D=`Colour`,colourPickerLabel:O=`{label}, colour picker`,optionalLabel:k=`(optional)`,name:A,id:j,disabled:M=!1,readOnly:N=!1,loading:P=!1,size:F=`md`,className:I=``,fieldClassName:L=``,...R}=g,z=r(A),B=C??z;c(`AppColorField`,R),s(`AppColorField`,`size`,F,p);let[V,H]=u(v??`#000000`),U=_===void 0?V:_,W=e=>{H(e),y?.(e)},G=l(),K=j||G,q=B?`${K}-error`:w?`${K}-hint`:void 0,J=e=>/^#[0-9a-f]{6}$/i.test(e),Y=F===`sm`?` color-field-sm`:F===`lg`?` color-field-lg`:``,X=F===`sm`?` input-sm`:F===`lg`?` input-lg`:``;return/* @__PURE__ */ f(`div`,{...h,className:`field${L?` ${L}`:``}`,children:[b&&/* @__PURE__ */ f(`label`,{className:`label`,htmlFor:K,children:[b,S&&!x&&/* @__PURE__ */ d(`span`,{className:`label-optional`,children:` ${k}`}),x&&/* @__PURE__ */ d(o,{}),T&&/* @__PURE__ */ d(a,{label:E,children:T})]}),/* @__PURE__ */ f(`div`,{className:`color-field${Y}`,children:[/* @__PURE__ */ d(`input`,{type:`color`,className:`color-field-swatch`,value:J(U)?U:`#000000`,onChange:e=>W(e.target.value),disabled:M||N||P,"aria-label":n(O,{label:b||D}),tabIndex:-1}),/* @__PURE__ */ d(`input`,{type:`text`,className:`input color-field-hex${X}${B?` error`:``}${P?` ${t}`:``}${I?` ${I}`:``}`,id:K,name:A,value:U,onChange:e=>W(e.target.value),placeholder:`#4F46E5`,spellCheck:!1,maxLength:7,required:x,disabled:M,readOnly:N||P,"aria-busy":P||void 0,"aria-invalid":B?`true`:`false`,"aria-describedby":q,...R})]}),/* @__PURE__ */ d(e,{error:B,hint:w,errorId:`${K}-error`,hintId:`${K}-hint`})]})}export{m as default};
1
+ import e from"../lib/FieldMessage.js";import{FIELD_BUSY_CLASS as t,FIELD_SIZES as n}from"../lib/fieldState.js";import r from"../lib/fillLabel.js";import{useFieldError as i}from"../lib/formFields.js";import{splitMarkerProps as a}from"../lib/wuiMarker.js";import o from"./AppInfoTip.js";import s from"./AppRequiredMark.js";import c from"./assertValidValue.js";import l from"./warnUnknownProps.js";import{useId as u,useState as d}from"react";import{jsx as f,jsxs as p}from"react/jsx-runtime";function m(m){let{marker:h,props:g}=a(`AppColorField`,m),{value:_,defaultValue:v,onChange:y,label:b,required:x=!1,optional:S=!1,error:C,helperText:w,help:T,helpLabel:E=`More information`,colourLabel:D=`Colour`,colourPickerLabel:O=`{label}, colour picker`,optionalLabel:k=`(optional)`,name:A,id:j,disabled:M=!1,readOnly:N=!1,loading:P=!1,size:F=`md`,className:I=``,fieldClassName:L=``,...R}=g,z=i(A),B=C??z;l(`AppColorField`,R),c(`AppColorField`,`size`,F,n);let[V,H]=d(v??`#000000`),U=_===void 0?V:_,W=e=>{H(e),y?.(e)},G=u(),K=j||G,q=B?`${K}-error`:w?`${K}-hint`:void 0,J=e=>/^#[0-9a-f]{6}$/i.test(e),Y=F===`sm`?` wui-color-field-sm`:F===`lg`?` wui-color-field-lg`:F===`xl`?` wui-color-field-xl`:``,X=F===`sm`?` wui-input-sm`:F===`lg`?` wui-input-lg`:F===`xl`?` wui-input-xl`:``;return/* @__PURE__ */ p(`div`,{...h,className:`field${L?` ${L}`:``}`,children:[b&&/* @__PURE__ */ p(`label`,{className:`label`,htmlFor:K,children:[b,S&&!x&&/* @__PURE__ */ f(`span`,{className:`label-optional`,children:` ${k}`}),x&&/* @__PURE__ */ f(s,{}),T&&/* @__PURE__ */ f(o,{label:E,children:T})]}),/* @__PURE__ */ p(`div`,{className:`color-field${Y}`,children:[/* @__PURE__ */ f(`input`,{type:`color`,className:`color-field-swatch`,value:J(U)?U:`#000000`,onChange:e=>W(e.target.value),disabled:M||N||P,"aria-label":r(O,{label:typeof b==`string`&&b!==``?b:D}),tabIndex:-1}),/* @__PURE__ */ f(`input`,{type:`text`,className:`input color-field-hex${X}${B?` error`:``}${P?` ${t}`:``}${I?` ${I}`:``}`,id:K,name:A,value:U,onChange:e=>W(e.target.value),placeholder:`#4F46E5`,spellCheck:!1,maxLength:7,required:x,disabled:M,readOnly:N||P,"aria-busy":P||void 0,"aria-invalid":B?`true`:`false`,"aria-describedby":q,...R})]}),/* @__PURE__ */ f(e,{error:B,hint:w,errorId:`${K}-error`,hintId:`${K}-hint`})]})}export{m as default};
@@ -1 +1 @@
1
- import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./AppDropdown.js";import{jsx as n,jsxs as r}from"react/jsx-runtime";function i(i){let{marker:a,props:o}=e(`AppColumnMenu`,i),{columns:s,hiddenColumns:c=[],onToggle:l,label:u=`Columns`,className:d=``,...f}=o,p=s.filter(e=>e.hideable);return/* @__PURE__ */ r(t,{icon:`layout-grid`,label:u,menuClassName:`wui-column-menu${d?` ${d}`:``}`,...a,...f,children:[/* @__PURE__ */ n(`div`,{className:`wui-column-menu-title`,children:u}),p.map(e=>/* @__PURE__ */ r(`label`,{className:`wui-column-menu-item`,children:[/* @__PURE__ */ n(`input`,{type:`checkbox`,className:`wui-check`,checked:!c.includes(e.key),onChange:()=>l(e.key)}),e.label]},e.key))]})}export{i as default};
1
+ import e from"../lib/useWuiText.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./AppDropdown.js";import{jsx as r,jsxs as i}from"react/jsx-runtime";import{COLUMN_MENU_TEXT as a}from"@webority/ui-elements/text";function o(o){let{marker:s,props:c}=t(`AppColumnMenu`,o),l=e(`columnMenu`,a),{columns:u,hiddenColumns:d=[],onToggle:f,label:p=l.label,className:m=``,...h}=c,g=u.filter(e=>e.hideable);return/* @__PURE__ */ i(n,{icon:`layout-grid`,label:p,menuClassName:`wui-column-menu${m?` ${m}`:``}`,...s,...h,children:[/* @__PURE__ */ r(`div`,{className:`wui-column-menu-title`,children:p}),g.map(e=>/* @__PURE__ */ i(`label`,{className:`wui-column-menu-item`,children:[/* @__PURE__ */ r(`input`,{type:`checkbox`,className:`wui-check`,checked:!d.includes(e.key),onChange:()=>f(e.key)}),e.label]},e.key))]})}export{o as default};
@@ -1 +1 @@
1
- import{shortcutAria as e,shortcutChip as t}from"../lib/shortcutChip.js";import n from"../lib/useElementEntry.js";import{splitMarkerProps as r}from"../lib/wuiMarker.js";import i from"./AppIcon.js";import a from"./AppModal.js";import o from"./AppSpinner.js";import s from"./renderIconProp.js";import c from"./warnUnknownProps.js";import{matchSegments as l}from"@webority/ui-elements/helpers";import{Fragment as u,useEffect as d,useId as f,useLayoutEffect as p,useRef as m,useState as h}from"react";import{jsx as g,jsxs as _}from"react/jsx-runtime";var v=`lg`,y=()=>import(`@webority/ui-elements/elements/command-palette`);function b(e){n(`wui-command-palette`,y);let{marker:t,props:i}=r(`AppCommandPalette`,e),{open:o,onClose:s,query:l=``,onQueryChange:u,placeholder:d=`Search…`,groups:p=[],path:m=[],onPathChange:h,rootLabel:_,backLabel:b=`Back`,recentsKey:S,recentsLimit:C,recentsLabel:w,loading:T=!1,emptyText:E=`No results`,footer:D,ariaLabel:O=`Search`,resultsLabel:k=`Results`,highlight:A=!0,groupFilter:j=!1,id:M,className:N=``,...P}=i;c(`AppCommandPalette`,P);let F=f(),I=M||F;return/* @__PURE__ */ g(a,{...t,open:o,onClose:s,staticBackdrop:!1,hideHeader:!0,placement:`top`,size:v,ariaLabel:O,className:`wui-cmd-card${N?` ${N}`:``}`,children:/* @__PURE__ */ g(x,{baseId:I,query:l,onQueryChange:u,placeholder:d,groups:p,path:m,onPathChange:h,rootLabel:_,backLabel:b,recentsKey:S,recentsLimit:C,recentsLabel:w,loading:T,emptyText:E,footer:D,ariaLabel:O,resultsLabel:k,highlight:A,groupFilter:j,onClose:s,rest:P})})}function x({baseId:n,query:r,onQueryChange:a,placeholder:c,groups:l,path:u,onPathChange:f,rootLabel:v,backLabel:y,recentsKey:b,recentsLimit:x,recentsLabel:T,loading:E,emptyText:D,footer:O,ariaLabel:k,resultsLabel:A,highlight:j,groupFilter:M,onClose:N,rest:P}){let F=m(null),I=`${n}-list`,L=l.filter(e=>!!e.items?.length),R=!E&&r.trim()!==``&&L.length===0,[z,B]=h({query:r,key:null}),V=z.query===r&&L.some(e=>String(e.key)===z.key)?z.key:null,H=M&&V!=null?L.filter(e=>String(e.key)===V):L,U=M&&L.length>0,W=e=>B({query:r,key:e}),G=e=>{if(!U||e.key!==`Tab`)return;e.preventDefault();let t=[C,...L.map(e=>String(e.key))],n=t[(Math.max(0,t.indexOf(V??C))+(e.shiftKey?-1:1)+t.length)%t.length]??C;W(n===C?null:n)};return p(()=>{F.current?.refresh?.()}),d(()=>{let e=F.current;if(!e)throw Error(`<wui-command-palette> is not mounted`);let t=e=>{if(!(e instanceof CustomEvent))throw Error(`wui-command-palette:select arrived without a detail`);let t=e.detail,n=l.find(e=>String(e.key)===t.groupKey)?.items?.find(e=>String(e.key)===t.key);n&&(e.preventDefault(),n.page?(a?.(``),f?.([...u,{key:n.page.key,label:n.page.label}])):(n.onSelect?.(),N?.()))},n=e=>{if(!(e instanceof CustomEvent))throw Error(`wui-command-palette:navigate arrived without a detail`);e.preventDefault(),a?.(``);let t=e.detail;f?.(t.path)};return e.addEventListener(`wui-command-palette:select`,t),e.addEventListener(`wui-command-palette:navigate`,n),()=>{e.removeEventListener(`wui-command-palette:select`,t),e.removeEventListener(`wui-command-palette:navigate`,n)}},[l,u,N,a,f]),/* @__PURE__ */ _(`wui-command-palette`,{ref:F,path:JSON.stringify(u),"root-label":v,"recents-key":b,"recents-limit":x,"recents-label":T,...P,children:[/* @__PURE__ */ _(`div`,{className:`wui-cmd-search`,children:[/* @__PURE__ */ g(`span`,{className:`wui-cmd-search-icon`,"aria-hidden":`true`,children:/* @__PURE__ */ g(i,{name:`search`,size:18})}),/* @__PURE__ */ g(`input`,{className:`wui-cmd-input`,type:`text`,role:`combobox`,"aria-expanded":`true`,"aria-controls":I,"aria-autocomplete":`list`,"aria-label":k,placeholder:c,autoComplete:`off`,spellCheck:!1,"data-autofocus":``,value:r,onChange:e=>a?.(e.target.value),onKeyDown:G}),E&&/* @__PURE__ */ g(o,{size:`sm`,className:`wui-cmd-spinner`})]}),U&&/* @__PURE__ */ g(`div`,{className:`wui-cmd-tabs app-tabs app-tabs-pills app-tabs-sm`,role:`tablist`,"aria-label":`Result groups`,children:[{key:``,label:`All (${L.reduce((e,t)=>e+t.items.length,0)})`},...L.map(e=>({key:String(e.key),label:`${e.label} (${e.items.length})`}))].map(e=>{let t=(V??``)===e.key;return/* @__PURE__ */ g(`button`,{type:`button`,className:t?`app-tab active`:`app-tab`,role:`tab`,"aria-selected":t?`true`:`false`,tabIndex:-1,"data-group-tab":e.key,onClick:()=>W(e.key===``?null:e.key),children:/* @__PURE__ */ g(`span`,{className:`wui-tab-label`,children:e.label})},e.key||C)})}),/* @__PURE__ */ _(`div`,{className:`wui-cmd-crumbs`,hidden:!0,children:[/* @__PURE__ */ g(`button`,{type:`button`,className:`wui-cmd-back`,"aria-label":y,children:/* @__PURE__ */ g(i,{name:`chevron-left`,size:16})}),/* @__PURE__ */ g(`ol`,{className:`wui-cmd-trail`})]}),/* @__PURE__ */ _(`div`,{className:`wui-cmd-list`,role:`listbox`,id:I,"aria-label":A,"aria-busy":E?`true`:void 0,hidden:L.length===0,children:[/* @__PURE__ */ g(`div`,{className:`wui-cmd-recents`}),H.map(a=>{let o=`${n}-${w(a.key)}`;return/* @__PURE__ */ _(`div`,{className:`wui-cmd-group`,role:`group`,"aria-labelledby":o,children:[/* @__PURE__ */ g(`div`,{className:`wui-cmd-group-label`,role:`presentation`,id:o,children:a.label}),a.items.map(n=>{let c=`${o}-${w(n.key)}`,l=n.description==null?null:`${c}-desc`,u=n.meta==null?null:`${c}-meta`;return/* @__PURE__ */ _(`div`,{className:`wui-cmd-item`,role:`option`,id:c,"data-group-key":String(a.key),"data-key":String(n.key),"data-opens":n.page?String(n.page.key):void 0,"data-keywords":n.keywords?.length?n.keywords.join(` `):void 0,"aria-label":n.ariaLabel||(typeof n.label==`string`?n.label:``)||void 0,"aria-describedby":[l,u].filter(Boolean).join(` `)||void 0,"aria-disabled":n.disabled?`true`:void 0,"aria-keyshortcuts":e(n.shortcut),children:[n.icon!=null&&/* @__PURE__ */ g(`span`,{className:`wui-cmd-item-icon`,"aria-hidden":`true`,children:s(n.icon,{size:18})}),/* @__PURE__ */ _(`span`,{className:`wui-cmd-item-text`,children:[/* @__PURE__ */ g(`span`,{className:`wui-cmd-item-label`,children:j?S(n.label,r):n.label}),l&&/* @__PURE__ */ g(`span`,{className:`wui-cmd-item-desc`,id:l,children:n.description})]}),u&&/* @__PURE__ */ g(`span`,{className:`wui-cmd-item-meta`,id:u,children:n.meta}),t(n.shortcut),n.page&&/* @__PURE__ */ g(`span`,{className:`wui-cmd-item-chevron`,"aria-hidden":`true`,children:/* @__PURE__ */ g(i,{name:`chevron-right`,size:16})})]},n.key)})]},a.key)})]}),/* @__PURE__ */ g(`div`,{className:`wui-cmd-empty`,role:`status`,children:R?D:null}),O!=null&&/* @__PURE__ */ g(`div`,{className:`wui-cmd-footer`,children:O})]})}function S(e,t){if(typeof e!=`string`)return e;let n=l(e,t),[r]=n;if(n.length===1&&r&&!r.match)return e;let i=0;return n.map(e=>{let t=i;return i+=e.text.length,e.match?/* @__PURE__ */ g(`mark`,{className:`wui-cmd-mark`,children:e.text},t):/* @__PURE__ */ g(u,{children:e.text},t)})}var C=`__all__`;function w(e){return String(e).replace(/\s+/g,`_`)}export{b as default};
1
+ import{shortcutAria as e,shortcutChip as t}from"../lib/shortcutChip.js";import n from"../lib/useElementEntry.js";import r from"../lib/useWuiText.js";import{splitMarkerProps as i}from"../lib/wuiMarker.js";import a from"./AppIcon.js";import o from"./AppModal.js";import s from"./AppSpinner.js";import c from"./renderIconProp.js";import l from"./warnUnknownProps.js";import{matchSegments as u}from"@webority/ui-elements/helpers";import{Fragment as d,useEffect as f,useId as p,useLayoutEffect as m,useRef as h,useState as g}from"react";import{jsx as _,jsxs as v}from"react/jsx-runtime";import{COMMAND_PALETTE_TEXT as y,fillText as b}from"@webority/ui-elements/text";var x=`lg`,S=()=>import(`@webority/ui-elements/elements/command-palette`);function C(e){n(`wui-command-palette`,S);let t=r(`commandPalette`,y),{marker:a,props:s}=i(`AppCommandPalette`,e),{open:c,onClose:u,query:d=``,onQueryChange:f,placeholder:m=t.placeholder,groups:h=[],path:g=[],onPathChange:v,rootLabel:b,backLabel:C=t.backLabel,recentsKey:T,recentsLimit:E,recentsLabel:D,loading:O=!1,emptyText:k=t.emptyText,footer:A,ariaLabel:j=t.ariaLabel,resultsLabel:M=t.resultsLabel,highlight:N=!0,groupFilter:P=!1,id:F,className:I=``,...L}=s;l(`AppCommandPalette`,L);let R=p(),z=F||R;return/* @__PURE__ */ _(o,{...a,open:c,onClose:u,staticBackdrop:!1,hideHeader:!0,placement:`top`,size:x,ariaLabel:j,className:`wui-cmd-card${I?` ${I}`:``}`,children:/* @__PURE__ */ _(w,{baseId:z,query:d,onQueryChange:f,placeholder:m,groups:h,path:g,onPathChange:v,rootLabel:b,backLabel:C,recentsKey:T,recentsLimit:E,recentsLabel:D,loading:O,emptyText:k,footer:A,ariaLabel:j,resultsLabel:M,highlight:N,groupFilter:P,onClose:u,rest:L})})}function w({baseId:n,query:i,onQueryChange:o,placeholder:l,groups:u,path:d,onPathChange:p,rootLabel:x,backLabel:S,recentsKey:C,recentsLimit:w,recentsLabel:O,loading:k,emptyText:A,footer:j,ariaLabel:M,resultsLabel:N,highlight:P,groupFilter:F,onClose:I,rest:L}){let R=r(`commandPalette`,y),z=h(null),B=`${n}-list`,V=u.filter(e=>!!e.items?.length),H=!k&&i.trim()!==``&&V.length===0,[U,W]=g({query:i,key:null}),G=U.query===i&&V.some(e=>String(e.key)===U.key)?U.key:null,K=F&&G!=null?V.filter(e=>String(e.key)===G):V,q=F&&V.length>0,J=e=>W({query:i,key:e}),Y=e=>{if(!q||e.key!==`Tab`)return;e.preventDefault();let t=[E,...V.map(e=>String(e.key))],n=t[(Math.max(0,t.indexOf(G??E))+(e.shiftKey?-1:1)+t.length)%t.length]??E;J(n===E?null:n)};return m(()=>{z.current?.refresh?.()}),f(()=>{let e=z.current;if(!e)throw Error(`<wui-command-palette> is not mounted`);let t=e=>{if(!(e instanceof CustomEvent))throw Error(`wui-command-palette:select arrived without a detail`);let t=e.detail,n=u.find(e=>String(e.key)===t.groupKey)?.items?.find(e=>String(e.key)===t.key);n&&(e.preventDefault(),n.page?(o?.(``),p?.([...d,{key:n.page.key,label:n.page.label}])):(n.onSelect?.(),I?.()))},n=e=>{if(!(e instanceof CustomEvent))throw Error(`wui-command-palette:navigate arrived without a detail`);e.preventDefault(),o?.(``);let t=e.detail;p?.(t.path)};return e.addEventListener(`wui-command-palette:select`,t),e.addEventListener(`wui-command-palette:navigate`,n),()=>{e.removeEventListener(`wui-command-palette:select`,t),e.removeEventListener(`wui-command-palette:navigate`,n)}},[u,d,I,o,p]),/* @__PURE__ */ v(`wui-command-palette`,{ref:z,path:JSON.stringify(d),"root-label":x,"recents-key":C,"recents-limit":w,"recents-label":O,...L,children:[/* @__PURE__ */ v(`div`,{className:`wui-cmd-search`,children:[/* @__PURE__ */ _(`span`,{className:`wui-cmd-search-icon`,"aria-hidden":`true`,children:/* @__PURE__ */ _(a,{name:`search`,size:18})}),/* @__PURE__ */ _(`input`,{className:`wui-cmd-input`,type:`text`,role:`combobox`,"aria-expanded":`true`,"aria-controls":B,"aria-autocomplete":`list`,"aria-label":M,placeholder:l,autoComplete:`off`,spellCheck:!1,"data-autofocus":``,value:i,onChange:e=>o?.(e.target.value),onKeyDown:Y}),k&&/* @__PURE__ */ _(s,{size:`sm`,className:`wui-cmd-spinner`})]}),q&&/* @__PURE__ */ _(`div`,{className:`wui-cmd-tabs app-tabs app-tabs-pills app-tabs-sm`,role:`tablist`,"aria-label":R.resultGroupsLabel,children:[{key:``,label:b(R.allCountText,{count:V.reduce((e,t)=>e+t.items.length,0)})},...V.map(e=>({key:String(e.key),label:`${e.label} (${e.items.length})`}))].map(e=>{let t=(G??``)===e.key;return/* @__PURE__ */ _(`button`,{type:`button`,className:t?`app-tab active`:`app-tab`,role:`tab`,"aria-selected":t?`true`:`false`,tabIndex:-1,"data-group-tab":e.key,onClick:()=>J(e.key===``?null:e.key),children:/* @__PURE__ */ _(`span`,{className:`wui-tab-label`,children:e.label})},e.key||E)})}),/* @__PURE__ */ v(`div`,{className:`wui-cmd-crumbs`,hidden:!0,children:[/* @__PURE__ */ _(`button`,{type:`button`,className:`wui-cmd-back`,"aria-label":S,children:/* @__PURE__ */ _(a,{name:`chevron-left`,size:16})}),/* @__PURE__ */ _(`ol`,{className:`wui-cmd-trail`})]}),/* @__PURE__ */ v(`div`,{className:`wui-cmd-list`,role:`listbox`,id:B,"aria-label":N,"aria-busy":k?`true`:void 0,hidden:V.length===0,children:[/* @__PURE__ */ _(`div`,{className:`wui-cmd-recents`}),K.map(r=>{let o=`${n}-${D(r.key)}`;return/* @__PURE__ */ v(`div`,{className:`wui-cmd-group`,role:`group`,"aria-labelledby":o,children:[/* @__PURE__ */ _(`div`,{className:`wui-cmd-group-label`,role:`presentation`,id:o,children:r.label}),r.items.map(n=>{let s=`${o}-${D(n.key)}`,l=n.description==null?null:`${s}-desc`,u=n.meta==null?null:`${s}-meta`;return/* @__PURE__ */ v(`div`,{className:`wui-cmd-item`,role:`option`,id:s,"data-group-key":String(r.key),"data-key":String(n.key),"data-opens":n.page?String(n.page.key):void 0,"data-keywords":n.keywords?.length?n.keywords.join(` `):void 0,"aria-label":n.ariaLabel||(typeof n.label==`string`?n.label:``)||void 0,"aria-describedby":[l,u].filter(Boolean).join(` `)||void 0,"aria-disabled":n.disabled?`true`:void 0,"aria-keyshortcuts":e(n.shortcut),children:[n.icon!=null&&/* @__PURE__ */ _(`span`,{className:`wui-cmd-item-icon`,"aria-hidden":`true`,children:c(n.icon,{size:18})}),/* @__PURE__ */ v(`span`,{className:`wui-cmd-item-text`,children:[/* @__PURE__ */ _(`span`,{className:`wui-cmd-item-label`,children:P?T(n.label,i):n.label}),l&&/* @__PURE__ */ _(`span`,{className:`wui-cmd-item-desc`,id:l,children:n.description})]}),u&&/* @__PURE__ */ _(`span`,{className:`wui-cmd-item-meta`,id:u,children:n.meta}),t(n.shortcut),n.page&&/* @__PURE__ */ _(`span`,{className:`wui-cmd-item-chevron`,"aria-hidden":`true`,children:/* @__PURE__ */ _(a,{name:`chevron-right`,size:16})})]},n.key)})]},r.key)})]}),/* @__PURE__ */ _(`div`,{className:`wui-cmd-empty`,role:`status`,children:H?A:null}),j!=null&&/* @__PURE__ */ _(`div`,{className:`wui-cmd-footer`,children:j})]})}function T(e,t){if(typeof e!=`string`)return e;let n=u(e,t),[r]=n;if(n.length===1&&r&&!r.match)return e;let i=0;return n.map(e=>{let t=i;return i+=e.text.length,e.match?/* @__PURE__ */ _(`mark`,{className:`wui-cmd-mark`,children:e.text},t):/* @__PURE__ */ _(d,{children:e.text},t)})}var E=`__all__`;function D(e){return String(e).replace(/\s+/g,`_`)}export{C as default};
@@ -1 +1 @@
1
- import e from"../lib/fillLabel.js";import{initialsOf as t}from"../lib/initials.js";import{linkTarget as n}from"../lib/linkTarget.js";import{TargetLink as r}from"../lib/TargetLink.js";import i from"../lib/useElementEntry.js";import{splitMarkerProps as a}from"../lib/wuiMarker.js";import o from"./AppAvatar.js";import s from"./AppBadge.js";import c from"./AppButton.js";import l from"./AppIcon.js";import u from"./AppMarkdown.js";import d from"./assertValidValue.js";import f from"./warnUnknownProps.js";import{COMMENT_REACTIONS as p,COMMENT_TEXT as m,formatDate as h,formatFileSize as g,formatNumber as _,mentionTextFromValue as v,parseMentionValue as y,toInstant as b}from"@webority/ui-elements/helpers";import{Fragment as x,useEffect as S,useId as C,useRef as w}from"react";import{jsx as T,jsxs as E}from"react/jsx-runtime";var D=[`stacked`,`inline`],O=[`list`,`conversation`],k=()=>import(`@webority/ui-elements/elements/comment-thread`),A=()=>import(`@webority/ui-elements/elements/mention-input`),j=e=>y(e??``).map((e,t)=>({key:`segment-${t}`,seg:e})),M=e=>e.localName===`wui-mention-input`;function N(e){let{marker:t,props:n}=a(`AppCommentThread`,e),{comments:r=[],onPost:s,onReply:l,onEdit:u,onDelete:h,onReact:g,people:_,loadPeople:v,reactionChoices:y,allowReplies:b=!0,allowReactions:x=!0,composerPlaceholder:j,variant:N=`list`,composer:F=`stacked`,author:I,postLabel:L=m.post,composerRows:R,readOnly:z=!1,markdown:B=!1,linkComponent:V,label:H=m.listName,internalLabel:U=`Internal note`,attachmentsLabel:W=`Attachments`,composerLabel:G=`Add a comment`,noCommentsText:K=`No comments yet.`,reactionsLabel:ee=`Reactions`,repliesToLabel:te=`Replies to {name}`,editedLabel:ne=`Edited`,deletedText:re=`This comment was deleted.`,replyLabel:ie=`Reply`,editLabel:ae=`Edit`,deleteLabel:oe=`Delete`,deleteConfirmText:se=`Delete this comment?`,cancelLabel:ce=`Cancel`,addReactionLabel:le=`Add a reaction`,chooseReactionLabel:ue=`Choose a reaction`,peopleLabel:de=`People`,id:fe,className:pe=``,...q}=n;f(`AppCommentThread`,q),d(`AppCommentThread`,`variant`,N,O),d(`AppCommentThread`,`composer`,F,D);let J=i(`wui-comment-thread`,k);i(`wui-mention-input`,A);let me=C(),Y=fe||`comment-thread-${me.replace(/[^a-zA-Z0-9_-]/g,``)}`,X=w(null),Z=typeof v==`function`,he=y?.length?y:p,Q=F===`inline`,ge=R??(Q?1:3),_e={reactionsLabel:ee,repliesToLabel:te,editedLabel:ne,deletedText:re,replyLabel:ie,editLabel:ae,deleteLabel:oe,deleteConfirmText:se,cancelLabel:ce,addReactionLabel:le},$=w({onPost:s,onReply:l,onEdit:u,onDelete:h,onReact:g,loadPeople:v});return $.current={onPost:s,onReply:l,onEdit:u,onDelete:h,onReact:g,loadPeople:v},S(()=>{let e=X.current;if(e&&J)return e.submit=async e=>{let t=$.current;e.intent===`post`?await t.onPost?.(e.body):e.intent===`reply`?await t.onReply?.(e.parentId,e.body):e.intent===`edit`?await t.onEdit?.(e.commentId,e.body):e.intent===`delete`?await t.onDelete?.(e.commentId):e.intent===`react`&&await t.onReact?.(e.commentId,e.emoji)},()=>{e.submit=void 0}},[J]),S(()=>{let e=X.current;e&&J&&!Z&&(e.people=_||[])},[_,Z,J]),S(()=>{let e=X.current;if(!e||!Z)return;let t=/* @__PURE__ */ new WeakMap,n=async e=>{let n=e.target;if(!(e instanceof CustomEvent)||!(n instanceof HTMLElement)||!M(n))throw TypeError(`<wui-comment-thread> search came from something other than a mention box.`);let r=e.detail;if(typeof r!=`object`||!r||!(`query`in r)||typeof r.query!=`string`)throw TypeError(`<wui-comment-thread> search carried no query.`);let i=r.query,{loadPeople:a}=$.current;if(typeof a!=`function`)throw Error(`<AppCommentThread> is remote but has no loadPeople.`);let o=(t.get(n)??0)+1;t.set(n,o),n.loading=!0;try{let e=await a(i);t.get(n)===o&&(n.people=e||[])}catch(e){t.get(n)===o&&(n.people=[],n.searchFailed=!0,reportError(e))}finally{t.get(n)===o&&(n.loading=!1)}};return e.addEventListener(`search`,n),()=>e.removeEventListener(`search`,n)},[Z]),/* @__PURE__ */ E(`wui-comment-thread`,{ref:X,id:Y,class:[`wui-comment-thread`,N===`conversation`&&`wui-comment-thread--conversation`,pe].filter(Boolean).join(` `),controlled:``,"read-only":z?``:void 0,remote:Z?``:void 0,"reaction-choices":y?.length?y.join(` `):void 0,"no-replies":b?void 0:``,"no-reactions":x?void 0:``,"composer-placeholder":j,...t,...q,children:[/* @__PURE__ */ T(`div`,{className:`wui-comment-items`,"data-wui-items":``,children:r.length?/* @__PURE__ */ T(`ol`,{className:`wui-comment-list`,"aria-label":H,children:r.map(e=>/* @__PURE__ */ T(P,{comment:e,topLevel:!0,readOnly:z,allowReplies:b,allowReactions:x,markdown:B,linkComponent:V,internalLabel:U,attachmentsLabel:W,text:_e},e.id))}):/* @__PURE__ */ T(`p`,{className:`wui-comment-empty`,children:K})}),!z&&x&&/* @__PURE__ */ T(`div`,{className:`wui-reaction-picker`,role:`group`,"aria-label":ue,"data-wui-picker":``,popover:`auto`,children:he.map(e=>/* @__PURE__ */ T(`button`,{type:`button`,className:`wui-reaction-choice`,"data-wui-emoji":e,children:e},e))}),!z&&/* @__PURE__ */ E(`div`,{className:Q?`wui-comment-composer wui-comment-composer-inline`:`wui-comment-composer`,"data-wui-composer":``,children:[Q&&I?/* @__PURE__ */ T(o,{name:I,size:`sm`,tone:`auto`,className:`wui-comment-composer-avatar`}):null,/* @__PURE__ */ T(`wui-mention-input`,{id:`${Y}-new`,class:`wui-mention-input`,label:G,"people-label":de,placeholder:j??m.composerPlaceholder,rows:String(ge),remote:Z?``:void 0}),/* @__PURE__ */ T(`div`,{className:`wui-comment-form-actions`,children:/* @__PURE__ */ T(c,{variant:Q?`outline`:`solid`,size:`sm`,"data-wui-action":`post`,children:L})}),/* @__PURE__ */ T(`div`,{className:`wui-comment-error`,"data-wui-error":``,hidden:!0})]}),/* @__PURE__ */ T(`span`,{className:`visually-hidden`,"data-wui-live":``,"aria-live":`polite`,"aria-atomic":`true`})]})}function P({comment:i,topLevel:a=!1,readOnly:o,allowReplies:d,allowReactions:f,markdown:p,linkComponent:m,internalLabel:y,attachmentsLabel:S,text:C}){let{id:w,author:D,at:O,value:k,edited:A,mine:M,internal:N,attachments:F=[],deleted:I,canEdit:L,canDelete:R,reactions:z=[],replies:B=[]}=i,V=D?.name||``,H=b(O),U=!o&&!I&&L,W=!o&&!I&&R,G=a&&d,K=[`wui-comment`,N&&`wui-comment--internal`,M&&`wui-comment--mine`].filter(Boolean).join(` `);return/* @__PURE__ */ E(`li`,{className:K,"data-wui-comment":w,"data-value":k??``,"data-wui-deleted":I?``:void 0,children:[/* @__PURE__ */ E(`div`,{className:`wui-comment-row`,children:[/* @__PURE__ */ E(`span`,{className:`avatar avatar-sm wui-comment-avatar`,"aria-hidden":`true`,children:[/* @__PURE__ */ T(`span`,{className:`avatar-face`,children:t(V)||`?`}),D?.src&&/* @__PURE__ */ T(`img`,{className:`avatar-img`,src:D.src,alt:``,onError:e=>{e.currentTarget.hidden=!0}})]}),/* @__PURE__ */ E(`div`,{className:`wui-comment-main`,children:[/* @__PURE__ */ E(`div`,{className:`wui-comment-head`,children:[/* @__PURE__ */ T(`span`,{className:`wui-comment-author`,children:V}),/* @__PURE__ */ T(`time`,{className:`wui-comment-time`,dateTime:Number.isFinite(H)?new Date(H).toISOString():void 0,children:h(O,{pattern:`datetime`})}),A&&!I&&/* @__PURE__ */ T(`span`,{className:`wui-comment-edited`,children:C.editedLabel}),N&&/* @__PURE__ */ T(s,{className:`wui-comment-internal-badge`,children:y})]}),I?/* @__PURE__ */ T(`div`,{className:`wui-comment-text wui-comment-text-deleted`,children:C.deletedText}):/* @__PURE__ */ T(`div`,{className:p?`wui-comment-text wui-comment-text--markdown`:`wui-comment-text`,"data-wui-text":``,children:p?/* @__PURE__ */ T(u,{value:v(k??``).text,headings:`text`}):j(k).map(({key:e,seg:t})=>`text`in t?/* @__PURE__ */ T(x,{children:t.text},e):/* @__PURE__ */ E(`span`,{className:`wui-mention`,"data-mention-id":t.id,children:[`@`,t.label]},e))}),!I&&F.length>0&&/* @__PURE__ */ T(`ul`,{className:`wui-comment-attachments`,"aria-label":S,children:F.map(e=>{let t=n(m,{to:e.to,href:e.href,routeHref:!1});return/* @__PURE__ */ E(`li`,{children:[/* @__PURE__ */ E(r,{link:t,className:`wui-comment-attachment`,...e.to?{}:{download:!0},children:[/* @__PURE__ */ T(l,{name:`paperclip`,size:14}),e.name]}),typeof e.sizeBytes==`number`&&/* @__PURE__ */ T(`span`,{className:`wui-comment-attachment-size`,children:g(e.sizeBytes)})]},e.to??e.href)})}),U&&/* @__PURE__ */ T(`div`,{className:`wui-comment-editor`,"data-wui-editor":``,hidden:!0}),f&&!I&&(z.length>0||!o)&&/* @__PURE__ */ E(`div`,{className:`wui-comment-reactions`,role:`group`,"aria-label":C.reactionsLabel,children:[z.map(e=>o?/* @__PURE__ */ E(`span`,{className:e.mine?`wui-reaction wui-reaction-mine`:`wui-reaction`,children:[/* @__PURE__ */ T(`span`,{className:`wui-reaction-emoji`,children:e.emoji}),/* @__PURE__ */ T(`span`,{className:`wui-reaction-count`,children:_(e.count,{decimals:0})})]},e.emoji):/* @__PURE__ */ E(`button`,{type:`button`,className:e.mine?`wui-reaction wui-reaction-mine`:`wui-reaction`,"data-wui-emoji":e.emoji,"aria-pressed":e.mine?`true`:`false`,children:[/* @__PURE__ */ T(`span`,{className:`wui-reaction-emoji`,children:e.emoji}),/* @__PURE__ */ T(`span`,{className:`wui-reaction-count`,children:_(e.count,{decimals:0})})]},e.emoji)),!o&&/* @__PURE__ */ T(`button`,{type:`button`,className:`wui-reaction-add`,"data-wui-action":`react-menu`,"aria-label":C.addReactionLabel,"aria-haspopup":`true`,"aria-expanded":`false`,children:/* @__PURE__ */ T(l,{name:`emoji-smile`,size:16})})]}),!o&&!I&&(G||U||W)&&/* @__PURE__ */ E(`div`,{className:`wui-comment-actions`,"data-wui-actions":``,children:[G&&/* @__PURE__ */ T(`button`,{type:`button`,className:`wui-comment-action`,"data-wui-action":`reply`,children:C.replyLabel}),U&&/* @__PURE__ */ T(`button`,{type:`button`,className:`wui-comment-action`,"data-wui-action":`edit`,children:C.editLabel}),W&&/* @__PURE__ */ T(`button`,{type:`button`,className:`wui-comment-action`,"data-wui-action":`delete`,children:C.deleteLabel})]}),W&&/* @__PURE__ */ E(`div`,{className:`wui-comment-confirm`,"data-wui-confirm":``,hidden:!0,children:[/* @__PURE__ */ T(`span`,{className:`wui-comment-confirm-text`,children:C.deleteConfirmText}),/* @__PURE__ */ T(c,{tone:`danger`,size:`sm`,"data-wui-action":`confirm-delete`,children:C.deleteLabel}),/* @__PURE__ */ T(c,{variant:`ghost`,size:`sm`,"data-wui-action":`cancel-delete`,children:C.cancelLabel})]}),!o&&/* @__PURE__ */ T(`div`,{className:`wui-comment-error`,"data-wui-error":``,hidden:!0})]})]}),a&&B.length>0&&/* @__PURE__ */ T(`ol`,{className:`wui-comment-list wui-comment-replies`,"aria-label":e(C.repliesToLabel,{name:V}),children:B.map(e=>/* @__PURE__ */ T(P,{comment:e,readOnly:o,allowReactions:f,markdown:p,linkComponent:m,internalLabel:y,attachmentsLabel:S,text:C},e.id))}),G&&!o&&!I&&/* @__PURE__ */ T(`div`,{className:`wui-comment-reply`,"data-wui-reply":``,hidden:!0})]})}export{N as default};
1
+ import{initialsOf as e}from"../lib/initials.js";import{linkTarget as t}from"../lib/linkTarget.js";import{TargetLink as n}from"../lib/TargetLink.js";import r from"../lib/useElementEntry.js";import i from"../lib/useWuiText.js";import{splitMarkerProps as a}from"../lib/wuiMarker.js";import o from"./AppAvatar.js";import s from"./AppBadge.js";import c from"./AppButton.js";import l from"./AppIcon.js";import u from"./AppMarkdown.js";import d from"./assertValidValue.js";import f from"./warnUnknownProps.js";import{COMMENT_REACTIONS as p,formatDate as m,formatFileSize as h,formatNumber as g,mentionTextFromValue as _,parseMentionValue as v,toInstant as y}from"@webority/ui-elements/helpers";import{Fragment as b,useEffect as x,useId as S,useRef as C}from"react";import{jsx as w,jsxs as T}from"react/jsx-runtime";import{COMMENT_THREAD_TEXT as E,fillText as D}from"@webority/ui-elements/text";var O=[`stacked`,`inline`],k=[`list`,`conversation`],A=()=>import(`@webority/ui-elements/elements/comment-thread`),j=()=>import(`@webority/ui-elements/elements/mention-input`),M=e=>v(e??``).map((e,t)=>({key:`segment-${t}`,seg:e})),N=e=>e.localName===`wui-mention-input`;function P(e){let{marker:t,props:n}=a(`AppCommentThread`,e),s=i(`commentThread`,E),{comments:l=[],onPost:u,onReply:m,onEdit:h,onDelete:g,onReact:_,people:v,loadPeople:y,reactionChoices:b,allowReplies:D=!0,allowReactions:M=!0,composerPlaceholder:P,variant:I=`list`,composer:L=`stacked`,author:R,postLabel:z=s.postLabel,composerRows:B,readOnly:V=!1,markdown:H=!1,linkComponent:U,label:W=s.label,internalLabel:G=s.internalLabel,attachmentsLabel:K=s.attachmentsLabel,composerLabel:ee=s.composerLabel,noCommentsText:te=s.noCommentsText,reactionsLabel:ne=s.reactionsLabel,repliesToLabel:re=s.repliesToLabel,editedLabel:ie=s.editedLabel,deletedText:ae=s.deletedText,replyLabel:oe=s.replyLabel,editLabel:se=s.editLabel,deleteLabel:ce=s.deleteLabel,deleteConfirmText:le=s.deleteConfirmText,cancelLabel:ue=s.cancelLabel,addReactionLabel:de=s.addReactionLabel,chooseReactionLabel:fe=s.chooseReactionLabel,peopleLabel:pe=s.peopleLabel,id:me,className:he=``,...q}=n;f(`AppCommentThread`,q),d(`AppCommentThread`,`variant`,I,k),d(`AppCommentThread`,`composer`,L,O);let J=r(`wui-comment-thread`,A);r(`wui-mention-input`,j);let ge=S(),Y=me||`comment-thread-${ge.replace(/[^a-zA-Z0-9_-]/g,``)}`,X=C(null),Z=typeof y==`function`,_e=b?.length?b:p,Q=L===`inline`,ve=B??(Q?1:3),ye={reactionsLabel:ne,repliesToLabel:re,editedLabel:ie,deletedText:ae,replyLabel:oe,editLabel:se,deleteLabel:ce,deleteConfirmText:le,cancelLabel:ue,addReactionLabel:de},$=C({onPost:u,onReply:m,onEdit:h,onDelete:g,onReact:_,loadPeople:y});return $.current={onPost:u,onReply:m,onEdit:h,onDelete:g,onReact:_,loadPeople:y},x(()=>{let e=X.current;if(e&&J)return e.submit=async e=>{let t=$.current;e.intent===`post`?await t.onPost?.(e.body):e.intent===`reply`?await t.onReply?.(e.parentId,e.body):e.intent===`edit`?await t.onEdit?.(e.commentId,e.body):e.intent===`delete`?await t.onDelete?.(e.commentId):e.intent===`react`&&await t.onReact?.(e.commentId,e.emoji)},()=>{e.submit=void 0}},[J]),x(()=>{let e=X.current;e&&J&&!Z&&(e.people=v||[])},[v,Z,J]),x(()=>{let e=X.current;if(!e||!Z)return;let t=/* @__PURE__ */ new WeakMap,n=async e=>{let n=e.target;if(!(e instanceof CustomEvent)||!(n instanceof HTMLElement)||!N(n))throw TypeError(`<wui-comment-thread> search came from something other than a mention box.`);let r=e.detail;if(typeof r!=`object`||!r||!(`query`in r)||typeof r.query!=`string`)throw TypeError(`<wui-comment-thread> search carried no query.`);let i=r.query,{loadPeople:a}=$.current;if(typeof a!=`function`)throw Error(`<AppCommentThread> is remote but has no loadPeople.`);let o=(t.get(n)??0)+1;t.set(n,o),n.loading=!0;try{let e=await a(i);t.get(n)===o&&(n.people=e||[])}catch(e){t.get(n)===o&&(n.people=[],n.searchFailed=!0,reportError(e))}finally{t.get(n)===o&&(n.loading=!1)}};return e.addEventListener(`search`,n),()=>e.removeEventListener(`search`,n)},[Z]),/* @__PURE__ */ T(`wui-comment-thread`,{ref:X,id:Y,class:[`wui-comment-thread`,I===`conversation`&&`wui-comment-thread--conversation`,he].filter(Boolean).join(` `),controlled:``,"read-only":V?``:void 0,remote:Z?``:void 0,"reaction-choices":b?.length?b.join(` `):void 0,"no-replies":D?void 0:``,"no-reactions":M?void 0:``,"composer-placeholder":P,...t,...q,children:[/* @__PURE__ */ w(`div`,{className:`wui-comment-items`,"data-wui-items":``,children:l.length?/* @__PURE__ */ w(`ol`,{className:`wui-comment-list`,"aria-label":W,children:l.map(e=>/* @__PURE__ */ w(F,{comment:e,topLevel:!0,readOnly:V,allowReplies:D,allowReactions:M,markdown:H,linkComponent:U,internalLabel:G,attachmentsLabel:K,text:ye},e.id))}):/* @__PURE__ */ w(`p`,{className:`wui-comment-empty`,children:te})}),!V&&M&&/* @__PURE__ */ w(`div`,{className:`wui-reaction-picker`,role:`group`,"aria-label":fe,"data-wui-picker":``,popover:`auto`,children:_e.map(e=>/* @__PURE__ */ w(`button`,{type:`button`,className:`wui-reaction-choice`,"data-wui-emoji":e,children:e},e))}),!V&&/* @__PURE__ */ T(`div`,{className:Q?`wui-comment-composer wui-comment-composer-inline`:`wui-comment-composer`,"data-wui-composer":``,children:[Q&&R?/* @__PURE__ */ w(o,{name:R,size:`sm`,tone:`auto`,className:`wui-comment-composer-avatar`}):null,/* @__PURE__ */ w(`wui-mention-input`,{id:`${Y}-new`,class:`wui-mention-input`,label:ee,"people-label":pe,placeholder:P??s.composerPlaceholder,rows:String(ve),remote:Z?``:void 0}),/* @__PURE__ */ w(`div`,{className:`wui-comment-form-actions`,children:/* @__PURE__ */ w(c,{variant:Q?`outline`:`solid`,size:`sm`,"data-wui-action":`post`,children:z})}),/* @__PURE__ */ w(`div`,{className:`wui-comment-error`,"data-wui-error":``,hidden:!0})]}),/* @__PURE__ */ w(`span`,{className:`visually-hidden`,"data-wui-live":``,"aria-live":`polite`,"aria-atomic":`true`})]})}function F({comment:r,topLevel:i=!1,readOnly:a,allowReplies:o,allowReactions:d,markdown:f,linkComponent:p,internalLabel:v,attachmentsLabel:x,text:S}){let{id:C,author:E,at:O,value:k,edited:A,mine:j,internal:N,attachments:P=[],deleted:I,canEdit:L,canDelete:R,reactions:z=[],replies:B=[]}=r,V=E?.name||``,H=y(O),U=!a&&!I&&L,W=!a&&!I&&R,G=i&&o,K=[`wui-comment`,N&&`wui-comment--internal`,j&&`wui-comment--mine`].filter(Boolean).join(` `);return/* @__PURE__ */ T(`li`,{className:K,"data-wui-comment":C,"data-value":k??``,"data-wui-deleted":I?``:void 0,children:[/* @__PURE__ */ T(`div`,{className:`wui-comment-row`,children:[/* @__PURE__ */ T(`span`,{className:`avatar avatar-sm wui-comment-avatar`,"aria-hidden":`true`,children:[/* @__PURE__ */ w(`span`,{className:`avatar-face`,children:e(V)||`?`}),E?.src&&/* @__PURE__ */ w(`img`,{className:`avatar-img`,src:E.src,alt:``,onError:e=>{e.currentTarget.hidden=!0}})]}),/* @__PURE__ */ T(`div`,{className:`wui-comment-main`,children:[/* @__PURE__ */ T(`div`,{className:`wui-comment-head`,children:[/* @__PURE__ */ w(`span`,{className:`wui-comment-author`,children:V}),/* @__PURE__ */ w(`time`,{className:`wui-comment-time`,dateTime:Number.isFinite(H)?new Date(H).toISOString():void 0,children:m(O,{pattern:`datetime`})}),A&&!I&&/* @__PURE__ */ w(`span`,{className:`wui-comment-edited`,children:S.editedLabel}),N&&/* @__PURE__ */ w(s,{className:`wui-comment-internal-badge`,children:v})]}),I?/* @__PURE__ */ w(`div`,{className:`wui-comment-text wui-comment-text-deleted`,children:S.deletedText}):/* @__PURE__ */ w(`div`,{className:f?`wui-comment-text wui-comment-text--markdown`:`wui-comment-text`,"data-wui-text":``,children:f?/* @__PURE__ */ w(u,{value:_(k??``).text,headings:`text`}):M(k).map(({key:e,seg:t})=>`text`in t?/* @__PURE__ */ w(b,{children:t.text},e):/* @__PURE__ */ T(`span`,{className:`wui-mention`,"data-mention-id":t.id,children:[`@`,t.label]},e))}),!I&&P.length>0&&/* @__PURE__ */ w(`ul`,{className:`wui-comment-attachments`,"aria-label":x,children:P.map(e=>{let r=t(p,{to:e.to,href:e.href,routeHref:!1});return/* @__PURE__ */ T(`li`,{children:[/* @__PURE__ */ T(n,{link:r,className:`wui-comment-attachment`,...e.to?{}:{download:!0},children:[/* @__PURE__ */ w(l,{name:`paperclip`,size:14}),e.name]}),typeof e.sizeBytes==`number`&&/* @__PURE__ */ w(`span`,{className:`wui-comment-attachment-size`,children:h(e.sizeBytes)})]},e.to??e.href)})}),U&&/* @__PURE__ */ w(`div`,{className:`wui-comment-editor`,"data-wui-editor":``,hidden:!0}),d&&!I&&(z.length>0||!a)&&/* @__PURE__ */ T(`div`,{className:`wui-comment-reactions`,role:`group`,"aria-label":S.reactionsLabel,children:[z.map(e=>a?/* @__PURE__ */ T(`span`,{className:e.mine?`wui-reaction wui-reaction-mine`:`wui-reaction`,children:[/* @__PURE__ */ w(`span`,{className:`wui-reaction-emoji`,children:e.emoji}),/* @__PURE__ */ w(`span`,{className:`wui-reaction-count`,children:g(e.count,{decimals:0})})]},e.emoji):/* @__PURE__ */ T(`button`,{type:`button`,className:e.mine?`wui-reaction wui-reaction-mine`:`wui-reaction`,"data-wui-emoji":e.emoji,"aria-pressed":e.mine?`true`:`false`,children:[/* @__PURE__ */ w(`span`,{className:`wui-reaction-emoji`,children:e.emoji}),/* @__PURE__ */ w(`span`,{className:`wui-reaction-count`,children:g(e.count,{decimals:0})})]},e.emoji)),!a&&/* @__PURE__ */ w(`button`,{type:`button`,className:`wui-reaction-add`,"data-wui-action":`react-menu`,"aria-label":S.addReactionLabel,"aria-haspopup":`true`,"aria-expanded":`false`,children:/* @__PURE__ */ w(l,{name:`emoji-smile`,size:16})})]}),!a&&!I&&(G||U||W)&&/* @__PURE__ */ T(`div`,{className:`wui-comment-actions`,"data-wui-actions":``,children:[G&&/* @__PURE__ */ w(`button`,{type:`button`,className:`wui-comment-action`,"data-wui-action":`reply`,children:S.replyLabel}),U&&/* @__PURE__ */ w(`button`,{type:`button`,className:`wui-comment-action`,"data-wui-action":`edit`,children:S.editLabel}),W&&/* @__PURE__ */ w(`button`,{type:`button`,className:`wui-comment-action`,"data-wui-action":`delete`,children:S.deleteLabel})]}),W&&/* @__PURE__ */ T(`div`,{className:`wui-comment-confirm`,"data-wui-confirm":``,hidden:!0,children:[/* @__PURE__ */ w(`span`,{className:`wui-comment-confirm-text`,children:S.deleteConfirmText}),/* @__PURE__ */ w(c,{tone:`danger`,size:`sm`,"data-wui-action":`confirm-delete`,children:S.deleteLabel}),/* @__PURE__ */ w(c,{variant:`ghost`,size:`sm`,"data-wui-action":`cancel-delete`,children:S.cancelLabel})]}),!a&&/* @__PURE__ */ w(`div`,{className:`wui-comment-error`,"data-wui-error":``,hidden:!0})]})]}),i&&B.length>0&&/* @__PURE__ */ w(`ol`,{className:`wui-comment-list wui-comment-replies`,"aria-label":D(S.repliesToLabel,{name:V}),children:B.map(e=>/* @__PURE__ */ w(F,{comment:e,readOnly:a,allowReactions:d,markdown:f,linkComponent:p,internalLabel:v,attachmentsLabel:x,text:S},e.id))}),G&&!a&&!I&&/* @__PURE__ */ w(`div`,{className:`wui-comment-reply`,"data-wui-reply":``,hidden:!0})]})}export{P as default};
@@ -1 +1 @@
1
- import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./AppIcon.js";import n from"./assertValidValue.js";import r from"./warnUnknownProps.js";import{isValidElement as i,useEffect as a,useRef as o,useState as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";var u=[`stack`,`scroll`],d=[`comfortable`,`relaxed`],f=[`boxed`,`plain`],p=[`start`,`center`],m={yes:{icon:`tick-circle`},no:{icon:`close-circle`},warn:{icon:`danger`},partial:{icon:`minus-circle`}};function h(e){return typeof e==`object`&&!!e&&!i(e)}function g(e){return h(e)&&`state`in e}function _(e){return h(e)&&`code`in e}function v(e){return e.scrollLeft+e.clientWidth<e.scrollWidth-1}function y(...e){return e.filter(Boolean).join(` `)||void 0}function b(e){return y(e.highlight&&`is-highlight`,e.align===`center`&&`wui-compare-center`,e.nowrap&&`wui-compare-nowrap`)}function x(e,r){if(e===!0)return/* @__PURE__ */ l(`span`,{className:`compare-yes`,children:[/* @__PURE__ */ c(t,{name:`check`,size:16}),/* @__PURE__ */ c(`span`,{className:`visually-hidden`,children:r.yesLabel})]});if(e===!1)return/* @__PURE__ */ l(`span`,{className:`compare-no`,children:[/* @__PURE__ */ c(`span`,{"aria-hidden":`true`,children:`-`}),/* @__PURE__ */ c(`span`,{className:`visually-hidden`,children:r.noLabel})]});if(g(e)){let i=m[e.state],a={yes:r.yesLabel,no:r.noLabel,warn:r.warningLabel,partial:r.partialLabel};return n(`AppCompareTable`,`state`,e.state,Object.keys(m)),/* @__PURE__ */ l(`span`,{className:`wui-compare-state wui-compare-state-${e.state}`,children:[i&&/* @__PURE__ */ c(t,{name:i.icon,size:16,variant:`bulk`}),i&&/* @__PURE__ */ c(`span`,{className:`visually-hidden`,children:`${a[e.state]}: `}),e.text]})}return _(e)?/* @__PURE__ */ c(`span`,{className:`wui-compare-code`,children:e.code}):e}function S(e,t,n){let r=[],i=null;return t.forEach((t,a)=>{t.group!=null&&t.group!==i&&r.push(/* @__PURE__ */ c(`tr`,{className:`wui-compare-group-row`,children:/* @__PURE__ */ c(`th`,{colSpan:e.length,scope:`rowgroup`,className:`wui-compare-group`,children:t.group})},`group:${t.group}:${t.key??t.label}`)),i=t.group??null,r.push(/* @__PURE__ */ l(`tr`,{children:[/* @__PURE__ */ c(`th`,{scope:`row`,children:t.label}),t.values.map((t,r)=>{let i=e[r+1];return/* @__PURE__ */ c(`td`,{className:b(i??{}),"data-label":i?.label,children:x(t,n)},i?.label??r)})]},t.key??`${t.label}-${a}`))}),r}function C(t){let{marker:i,props:m}=e(`AppCompareTable`,t),{columns:h,rows:g,caption:_,mobile:x=`stack`,stickyFirstColumn:C=!1,stickyHeader:w=!1,density:T=`comfortable`,variant:E=`boxed`,yesLabel:D=`Yes`,noLabel:O=`No`,warningLabel:k=`Warning`,partialLabel:A=`Partial`,className:j=``,...M}=m,N={yesLabel:D,noLabel:O,warningLabel:k,partialLabel:A},P=o(null),[F,I]=s(!1);if(a(()=>{let e=()=>{let e=P.current;e&&I(v(e))};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),!Array.isArray(h))throw Error(`<AppCompareTable> columns is required: pass the feature-name column, then one per option.`);if(!Array.isArray(g))throw Error(`<AppCompareTable> rows is required: pass one row per capability.`);r(`AppCompareTable`,M),n(`AppCompareTable`,`mobile`,x,u),n(`AppCompareTable`,`density`,T,d),n(`AppCompareTable`,`variant`,E,f);for(let e of h)n(`AppCompareTable`,`align`,e.align,p);let L=x===`scroll`,R=/* @__PURE__ */ l(`table`,{className:y(L&&`wui-compare-scroll-table`,L&&C&&`wui-compare-sticky-first`),children:[_&&/* @__PURE__ */ c(`caption`,{className:`visually-hidden`,children:_}),/* @__PURE__ */ c(`thead`,{children:/* @__PURE__ */ c(`tr`,{children:h.map((e,t)=>/* @__PURE__ */ c(`th`,{scope:`col`,className:b(e),children:e.label},e.label?`col-${t}-${e.label}`:`col-${t}`))})}),/* @__PURE__ */ c(`tbody`,{children:S(h,g,N)})]});return/* @__PURE__ */ c(`div`,{className:y(`compare-table`,T===`relaxed`&&`wui-compare-relaxed`,E===`plain`&&`wui-compare-plain`,w&&`wui-compare-sticky-head`,j),"data-mobile":x,...i,...M,children:L?/* @__PURE__ */ c(`div`,{className:`wui-compare-scroll`,ref:P,tabIndex:0,role:_?`region`:void 0,"aria-label":_||void 0,"data-more":F?`end`:void 0,onScroll:e=>I(v(e.currentTarget)),children:R}):R})}export{C as default};
1
+ import{emptyPlaceholder as e}from"../lib/emptyValue.js";import t from"../lib/useWuiText.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./AppIcon.js";import i from"./assertValidValue.js";import a from"./warnUnknownProps.js";import{isValidElement as o,useEffect as s,useRef as c,useState as l}from"react";import{jsx as u,jsxs as d}from"react/jsx-runtime";import{COMPARE_TABLE_TEXT as f}from"@webority/ui-elements/text";var p=[`stack`,`scroll`],m=[`comfortable`,`relaxed`],h=[`boxed`,`plain`],g=[`start`,`center`],_={yes:{icon:`tick-circle`},no:{icon:`close-circle`},warn:{icon:`danger`},partial:{icon:`minus-circle`}};function v(e){return typeof e==`object`&&!!e&&!o(e)}function y(e){return v(e)&&`state`in e}function b(e){return v(e)&&`code`in e}function x(e){return e.scrollLeft+e.clientWidth<e.scrollWidth-1}function S(...e){return e.filter(Boolean).join(` `)||void 0}function C(e){return S(e.highlight&&`is-highlight`,e.align===`center`&&`wui-compare-center`,e.nowrap&&`wui-compare-nowrap`)}function w(t,n){if(t===!0)return/* @__PURE__ */ d(`span`,{className:`compare-yes`,children:[/* @__PURE__ */ u(r,{name:`check`,size:16}),/* @__PURE__ */ u(`span`,{className:`visually-hidden`,children:n.yesLabel})]});if(t===!1)return/* @__PURE__ */ d(`span`,{className:`compare-no`,children:[/* @__PURE__ */ u(`span`,{"aria-hidden":`true`,children:e()}),/* @__PURE__ */ u(`span`,{className:`visually-hidden`,children:n.noLabel})]});if(y(t)){let e=_[t.state],a={yes:n.yesLabel,no:n.noLabel,warn:n.warningLabel,partial:n.partialLabel};return i(`AppCompareTable`,`state`,t.state,Object.keys(_)),/* @__PURE__ */ d(`span`,{className:`wui-compare-state wui-compare-state-${t.state}`,children:[e&&/* @__PURE__ */ u(r,{name:e.icon,size:16,variant:`bulk`}),e&&/* @__PURE__ */ u(`span`,{className:`visually-hidden`,children:`${a[t.state]}: `}),t.text]})}return b(t)?/* @__PURE__ */ u(`span`,{className:`wui-compare-code`,children:t.code}):t}function T(e,t,n){let r=[],i=null;return t.forEach((t,a)=>{t.group!=null&&t.group!==i&&r.push(/* @__PURE__ */ u(`tr`,{className:`wui-compare-group-row`,children:/* @__PURE__ */ u(`th`,{colSpan:e.length,scope:`rowgroup`,className:`wui-compare-group`,children:t.group})},`group:${t.group}:${t.key??t.label}`)),i=t.group??null,r.push(/* @__PURE__ */ d(`tr`,{children:[/* @__PURE__ */ u(`th`,{scope:`row`,children:t.label}),t.values.map((t,r)=>{let i=e[r+1];return/* @__PURE__ */ u(`td`,{className:C(i??{}),"data-label":i?.label,children:w(t,n)},i?.label??r)})]},t.key??`${t.label}-${a}`))}),r}function E(e){let{marker:r,props:o}=n(`AppCompareTable`,e),_=t(`compareTable`,f),{columns:v,rows:y,caption:b,mobile:w=`stack`,stickyFirstColumn:E=!1,stickyHeader:D=!1,density:O=`comfortable`,variant:k=`boxed`,yesLabel:A=_.yesLabel,noLabel:j=_.noLabel,warningLabel:M=_.warningLabel,partialLabel:N=_.partialLabel,className:P=``,...F}=o,I={yesLabel:A,noLabel:j,warningLabel:M,partialLabel:N},L=c(null),[R,z]=l(!1);if(s(()=>{let e=()=>{let e=L.current;e&&z(x(e))};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),!Array.isArray(v))throw Error(`<AppCompareTable> columns is required: pass the feature-name column, then one per option.`);if(!Array.isArray(y))throw Error(`<AppCompareTable> rows is required: pass one row per capability.`);a(`AppCompareTable`,F),i(`AppCompareTable`,`mobile`,w,p),i(`AppCompareTable`,`density`,O,m),i(`AppCompareTable`,`variant`,k,h);for(let e of v)i(`AppCompareTable`,`align`,e.align,g);let B=w===`scroll`,V=/* @__PURE__ */ d(`table`,{className:S(B&&`wui-compare-scroll-table`,B&&E&&`wui-compare-sticky-first`),children:[b&&/* @__PURE__ */ u(`caption`,{className:`visually-hidden`,children:b}),/* @__PURE__ */ u(`thead`,{children:/* @__PURE__ */ u(`tr`,{children:v.map((e,t)=>/* @__PURE__ */ u(`th`,{scope:`col`,className:C(e),children:e.label},e.label?`col-${t}-${e.label}`:`col-${t}`))})}),/* @__PURE__ */ u(`tbody`,{children:T(v,y,I)})]});return/* @__PURE__ */ u(`div`,{className:S(`compare-table`,O===`relaxed`&&`wui-compare-relaxed`,k===`plain`&&`wui-compare-plain`,D&&`wui-compare-sticky-head`,P),"data-mobile":w,...r,...F,children:B?/* @__PURE__ */ u(`div`,{className:`wui-compare-scroll`,ref:L,tabIndex:0,role:b?`region`:void 0,"aria-label":b||void 0,"data-more":R?`end`:void 0,onScroll:e=>z(x(e.currentTarget)),children:V}):V})}export{E as default};
@@ -1 +1 @@
1
- import e from"../lib/fillLabel.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./AppButton.js";import r from"./AppIcon.js";import i from"./AppInput.js";import a from"./AppModal.js";import o from"./assertValidValue.js";import{MODAL_ICONS as s}from"./ModalIcons.js";import c from"./warnUnknownProps.js";import{useEffect as l,useState as u}from"react";import{Fragment as d,jsx as f,jsxs as p}from"react/jsx-runtime";var m=[`sm`,`md`,`lg`,`xl`],h=[`default`,`plain`],g=[`success`,`danger`,`warning`,`info`,`primary`];function _(_){let{marker:v,props:y}=t(`AppConfirmDialog`,_),{open:b,title:x,variant:S=`default`,description:C,confirmLabel:w=`Confirm`,cancelLabel:T=`Cancel`,typePhraseLabel:E=`Type {phrase} to confirm`,tone:D,image:O,icon:k,iconSize:A,confirmPhrase:j,onConfirm:M,onClose:N,loading:P=!1,staticBackdrop:F=!0,placement:I=`center`,size:L=`md`,className:R=``,children:z,...B}=y;c(`AppConfirmDialog`,B),o(`AppConfirmDialog`,`tone`,D,g),o(`AppConfirmDialog`,`size`,typeof L==`string`?L:null,m),o(`AppConfirmDialog`,`variant`,S,h);let[V,H]=u(``);if(l(()=>{b||H(``)},[b]),!b)return null;let U=!!j&&V.trim()!==j,[W,...G]=E.split(`{phrase}`),K=G.join(j??`,`),q=S===`plain`,J=q?`sm`:`md`,Y=q||O||k?null:s[D===`danger`?`delete`:D??`info`],X=A!==void 0&&A>0?{"--wui-confirm-icon-size":`${A}px`}:void 0,Z=()=>{P||N?.()};return/* @__PURE__ */ f(a,{...v,...B,open:b,hideHeader:!0,title:x,onClose:Z,staticBackdrop:F,closeOnEscape:!F,placement:I,size:L,className:[`wui-confirm`,q&&`wui-confirm-plain`,R].filter(Boolean).join(` `),footer:/* @__PURE__ */ p(`div`,{className:`wui-confirm-actions`,children:[/* @__PURE__ */ f(n,{tone:`neutral`,...q?{}:{variant:`soft`},size:J,disabled:P,onClick:Z,children:T}),/* @__PURE__ */ f(n,{tone:D===`danger`?`danger`:void 0,size:J,disabled:U,loading:P,onClick:M,children:w})]}),children:/* @__PURE__ */ p(`div`,{className:`wui-confirm-content`,children:[!q&&O?/* @__PURE__ */ f(`span`,{className:`wui-confirm-icon`,style:X,children:/* @__PURE__ */ f(`img`,{src:O,alt:``,"aria-hidden":`true`})}):!q&&k?/* @__PURE__ */ f(`span`,{className:`wui-confirm-icon`,style:X,children:typeof k==`string`?/* @__PURE__ */ f(r,{name:k,size:80}):k}):Y&&/* @__PURE__ */ f(`span`,{className:`wui-confirm-icon`,style:X,children:/* @__PURE__ */ f(Y,{size:120})}),/* @__PURE__ */ f(`h3`,{className:`wui-confirm-title`,tabIndex:-1,"data-autofocus":``,children:x}),C&&/* @__PURE__ */ f(`p`,{className:`wui-confirm-msg`,children:C}),z!=null&&z!==!1&&/* @__PURE__ */ f(`div`,{className:`wui-confirm-body`,children:z}),j&&/* @__PURE__ */ f(i,{fieldClassName:`mt-3 mb-0 w-100 text-start`,label:/* @__PURE__ */ p(d,{children:[W,/* @__PURE__ */ f(`strong`,{children:j}),K]}),value:V,onChange:e=>H(e.target.value),"aria-label":e(E,{phrase:j}),disabled:P})]})})}export{_ as default};
1
+ import e from"../lib/useWuiText.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./AppButton.js";import r from"./AppIcon.js";import i from"./AppInput.js";import a from"./AppModal.js";import o from"./assertValidValue.js";import{MODAL_ICONS as ee}from"./ModalIcons.js";import s from"./warnUnknownProps.js";import{useEffect as c,useState as l}from"react";import{Fragment as u,jsx as d,jsxs as f}from"react/jsx-runtime";import{CONFIRM_DIALOG_TEXT as p,fillText as m}from"@webority/ui-elements/text";var h=[`sm`,`md`,`lg`,`xl`],g=[`default`,`plain`],_=[`success`,`danger`,`warning`,`info`,`primary`];function v(v){let{marker:y,props:b}=t(`AppConfirmDialog`,v),x=e(`confirmDialog`,p),{open:S,title:C,variant:w=`default`,description:T,confirmLabel:E=x.confirmLabel,cancelLabel:D=x.cancelLabel,typePhraseLabel:O=x.typePhraseLabel,tone:k,image:A,icon:j,iconSize:M,confirmPhrase:N,onConfirm:P,onClose:F,loading:I=!1,staticBackdrop:L=!0,placement:R=`center`,size:z=`md`,className:B=``,children:V,...H}=b;s(`AppConfirmDialog`,H),o(`AppConfirmDialog`,`tone`,k,_),o(`AppConfirmDialog`,`size`,typeof z==`string`?z:null,h),o(`AppConfirmDialog`,`variant`,w,g);let[U,W]=l(``);if(c(()=>{S||W(``)},[S]),!S)return null;let G=!!N&&U.trim()!==N,[K,...q]=O.split(`{phrase}`),J=q.join(N??`,`),Y=w===`plain`,X=Y?`sm`:`md`,Z=Y||A||j?null:ee[k===`danger`?`delete`:k??`info`],Q=M!==void 0&&M>0?{"--wui-confirm-icon-size":`${M}px`}:void 0,$=()=>{I||F?.()};return/* @__PURE__ */ d(a,{...y,...H,open:S,hideHeader:!0,title:C,onClose:$,staticBackdrop:L,closeOnEscape:!L,placement:R,size:z,className:[`wui-confirm`,Y&&`wui-confirm-plain`,B].filter(Boolean).join(` `),footer:/* @__PURE__ */ f(`div`,{className:`wui-confirm-actions`,children:[/* @__PURE__ */ d(n,{tone:`neutral`,...Y?{}:{variant:`soft`},size:X,disabled:I,onClick:$,children:D}),/* @__PURE__ */ d(n,{tone:k===`danger`?`danger`:void 0,size:X,disabled:G,loading:I,onClick:P,children:E})]}),children:/* @__PURE__ */ f(`div`,{className:`wui-confirm-content`,children:[!Y&&A?/* @__PURE__ */ d(`span`,{className:`wui-confirm-icon`,style:Q,children:/* @__PURE__ */ d(`img`,{src:A,alt:``,"aria-hidden":`true`})}):!Y&&j?/* @__PURE__ */ d(`span`,{className:`wui-confirm-icon`,style:Q,children:typeof j==`string`?/* @__PURE__ */ d(r,{name:j,size:80}):j}):Z&&/* @__PURE__ */ d(`span`,{className:`wui-confirm-icon`,style:Q,children:/* @__PURE__ */ d(Z,{size:120})}),/* @__PURE__ */ d(`h3`,{className:`wui-confirm-title`,tabIndex:-1,"data-autofocus":``,children:C}),T&&/* @__PURE__ */ d(`p`,{className:`wui-confirm-msg`,children:T}),V!=null&&V!==!1&&/* @__PURE__ */ d(`div`,{className:`wui-confirm-body`,children:V}),N&&/* @__PURE__ */ d(i,{fieldClassName:`mt-3 mb-0 w-100 text-start`,label:/* @__PURE__ */ f(u,{children:[K,/* @__PURE__ */ d(`strong`,{children:N}),J]}),value:U,onChange:e=>W(e.target.value),"aria-label":m(O,{phrase:N}),disabled:I})]})})}export{v as default};
@@ -1 +1 @@
1
- import e from"./AppConfirmDialog.js";import{createContext as t,useCallback as n,useContext as r,useEffect as i,useRef as a,useState as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";var l=t(null);function u(t){let{children:r}=t,[u,d]=o(null),[f,p]=o(!1),m=a(null),h=n((e={})=>new Promise(t=>{m.current?.(!1),m.current=t,d({...e,title:e.title||`Are you sure?`})}),[]),g=e=>{m.current?.(e),m.current=null,p(!1),d(null)};return i(()=>()=>m.current?.(!1),[]),/* @__PURE__ */ c(l.Provider,{value:h,children:[r,/* @__PURE__ */ s(e,{open:!!u,title:u?.title,description:u?.description,confirmLabel:u?.confirmLabel,cancelLabel:u?.cancelLabel,tone:u?.tone,icon:u?.icon,confirmPhrase:u?.confirmPhrase,loading:f,onConfirm:async()=>{let e=u?.onRun;if(typeof e!=`function`)g(!0);else{p(!0);try{await e(),g(!0)}catch{p(!1)}}},onClose:()=>g(!1)})]})}function d(){let e=r(l);if(!e)throw Error(`useConfirm needs an <AppConfirmProvider> above it.`);return e}export{u as default,d as useConfirm};
1
+ import e from"../lib/useWuiText.js";import t from"./AppConfirmDialog.js";import{createContext as n,useCallback as r,useContext as i,useEffect as a,useRef as o,useState as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";import{CONFIRM_PROVIDER_TEXT as u}from"@webority/ui-elements/text";var d=n(null);function f(n){let{children:i}=n,f=e(`confirmProvider`,u),[p,m]=s(null),[h,g]=s(!1),_=o(null),v=r((e={})=>new Promise(t=>{_.current?.(!1),_.current=t,m({...e,title:e.title||f.title})}),[f.title]),y=e=>{_.current?.(e),_.current=null,g(!1),m(null)};return a(()=>()=>_.current?.(!1),[]),/* @__PURE__ */ l(d.Provider,{value:v,children:[i,/* @__PURE__ */ c(t,{open:!!p,title:p?.title,description:p?.description,confirmLabel:p?.confirmLabel,cancelLabel:p?.cancelLabel,tone:p?.tone,icon:p?.icon,confirmPhrase:p?.confirmPhrase,loading:h,onConfirm:async()=>{let e=p?.onRun;if(typeof e!=`function`)y(!0);else{g(!0);try{await e(),y(!0)}catch{g(!1)}}},onClose:()=>y(!1)})]})}function p(){let e=i(d);if(!e)throw Error(`useConfirm needs an <AppConfirmProvider> above it.`);return e}export{f as default,p as useConfirm};
@@ -1 +1 @@
1
- import{linkTarget as e}from"../lib/linkTarget.js";import{shortcutAria as t,shortcutChip as n}from"../lib/shortcutChip.js";import{TargetLink as r}from"../lib/TargetLink.js";import i from"../lib/useElementEntry.js";import{splitMarkerProps as a}from"../lib/wuiMarker.js";import o from"./renderIconProp.js";import s from"./warnUnknownProps.js";import{useEffect as c,useLayoutEffect as l,useRef as u}from"react";import{Fragment as d,jsx as f,jsxs as p}from"react/jsx-runtime";var m=()=>import(`@webority/ui-elements/elements/context-menu`);function h(e){i(`wui-context-menu`,m);let{marker:t,props:n}=a(`AppContextMenu`,e),{items:r=[],target:o,trigger:d,children:h,ariaLabel:_=`Context menu`,disabled:y=!1,open:b,onOpen:x,onBeforeOpen:S,menuClassName:C=``,linkComponent:w,...T}=n;s(`AppContextMenu`,T);let E=u(null);return c(()=>{let e=E.current;if(!e||!x)return;let t=e=>{if(!g(e))throw TypeError(`<wui-context-menu> dispatched wui-context-menu:open without a CustomEvent.`);x(e.detail)};return e.addEventListener(`wui-context-menu:open`,t),()=>e.removeEventListener(`wui-context-menu:open`,t)},[x]),c(()=>{let e=E.current;if(!e||!S)return;let t=e=>{if(!g(e))throw TypeError(`<wui-context-menu> dispatched wui-context-menu:beforeopen without a CustomEvent.`);S(e)};return e.addEventListener(`wui-context-menu:beforeopen`,t),()=>e.removeEventListener(`wui-context-menu:beforeopen`,t)},[S]),l(()=>{let e=E.current;if(!e)throw Error(`<AppContextMenu> has no menu element to open.`);e.toggleAttribute(`open`,!!b)},[b]),/* @__PURE__ */ p(`wui-context-menu`,{ref:E,target:o,trigger:d,disabled:y,...t,...T,children:[h,/* @__PURE__ */ f(`div`,{className:`dropdown-menu wui-context-menu-panel${C?` ${C}`:``}`,popover:`auto`,role:`menu`,"aria-label":_,tabIndex:-1,children:v(r,w)})]})}function g(e){return e instanceof CustomEvent}var _=e=>`dropdown-item${e.tone===`danger`?` danger`:``}${e.disabled?` disabled`:``}`;function v(i,a){return i.map(i=>{if(i.divider)return/* @__PURE__ */ f(`hr`,{className:`dropdown-divider`},i.key);if(i.items!=null){let e=i.searchPlaceholder||`Search`;return/* @__PURE__ */ p(`div`,{className:`wui-context-menu-sub`,role:`none`,"data-searchable":i.searchable?``:void 0,children:[/* @__PURE__ */ p(`button`,{type:`button`,className:_(i),role:`menuitem`,"aria-haspopup":`menu`,"aria-expanded":`false`,tabIndex:-1,"data-key":i.key,"aria-disabled":i.disabled?`true`:void 0,children:[o(i.icon,{size:16}),i.label,o(`chevron-right`,{size:14,className:`wui-context-menu-chevron`})]}),/* @__PURE__ */ p(`div`,{className:`dropdown-menu wui-context-menu-subpanel`,popover:`auto`,role:`menu`,"aria-label":i.label,tabIndex:-1,children:[i.searchable?/* @__PURE__ */ f(`input`,{type:`search`,className:`wui-context-menu-search`,autoComplete:`off`,placeholder:e,"aria-label":e}):null,v(i.items,a)]})]},i.key)}let s=!!i.to&&!i.disabled,c=/* @__PURE__ */ p(d,{children:[i.image?/* @__PURE__ */ f(`img`,{src:i.image,alt:``}):o(i.icon,{size:16}),i.label,n(i.shortcut)]}),l={className:_(i),role:`menuitem`,tabIndex:-1,"data-key":i.key,"aria-checked":i.checked||void 0,"data-hint":i.hint||void 0,"aria-keyshortcuts":t(i.shortcut),"aria-disabled":i.disabled||void 0,onClick:i.disabled?void 0:i.onClick,children:c};return s?/* @__PURE__ */ f(r,{link:e(a,{to:i.to}),...l},i.key):/* @__PURE__ */ f(`button`,{type:`button`,...l},i.key)})}export{h as default};
1
+ import{linkTarget as e}from"../lib/linkTarget.js";import{shortcutAria as t,shortcutChip as n}from"../lib/shortcutChip.js";import{TargetLink as r}from"../lib/TargetLink.js";import i from"../lib/useElementEntry.js";import a from"../lib/useWuiText.js";import{splitMarkerProps as o}from"../lib/wuiMarker.js";import s from"./renderIconProp.js";import c from"./warnUnknownProps.js";import{useEffect as l,useLayoutEffect as u,useRef as d}from"react";import{Fragment as f,jsx as p,jsxs as m}from"react/jsx-runtime";import{CONTEXT_MENU_TEXT as h}from"@webority/ui-elements/text";var g=()=>import(`@webority/ui-elements/elements/context-menu`);function _(e){i(`wui-context-menu`,g);let{marker:t,props:n}=o(`AppContextMenu`,e),r=a(`contextMenu`,h),{items:s=[],target:f,trigger:_,children:y,ariaLabel:x=r.ariaLabel,disabled:S=!1,open:C,onOpen:w,onBeforeOpen:T,menuClassName:E=``,linkComponent:D,...O}=n;c(`AppContextMenu`,O);let k=d(null);return l(()=>{let e=k.current;if(!e||!w)return;let t=e=>{if(!v(e))throw TypeError(`<wui-context-menu> dispatched wui-context-menu:open without a CustomEvent.`);w(e.detail)};return e.addEventListener(`wui-context-menu:open`,t),()=>e.removeEventListener(`wui-context-menu:open`,t)},[w]),l(()=>{let e=k.current;if(!e||!T)return;let t=e=>{if(!v(e))throw TypeError(`<wui-context-menu> dispatched wui-context-menu:beforeopen without a CustomEvent.`);T(e)};return e.addEventListener(`wui-context-menu:beforeopen`,t),()=>e.removeEventListener(`wui-context-menu:beforeopen`,t)},[T]),u(()=>{let e=k.current;if(!e)throw Error(`<AppContextMenu> has no menu element to open.`);e.toggleAttribute(`open`,!!C)},[C]),/* @__PURE__ */ m(`wui-context-menu`,{ref:k,target:f,trigger:_,disabled:S,...t,...O,children:[y,/* @__PURE__ */ p(`div`,{className:`dropdown-menu wui-context-menu-panel${E?` ${E}`:``}`,popover:`auto`,role:`menu`,"aria-label":x,tabIndex:-1,children:b(s,D,r.searchPlaceholder)})]})}function v(e){return e instanceof CustomEvent}var y=e=>`dropdown-item${e.tone===`danger`?` danger`:``}${e.disabled?` disabled`:``}`;function b(i,a,o){return i.map(i=>{if(i.divider)return/* @__PURE__ */ p(`hr`,{className:`dropdown-divider`},i.key);if(i.items!=null){let e=i.searchPlaceholder||o;return/* @__PURE__ */ m(`div`,{className:`wui-context-menu-sub`,role:`none`,"data-searchable":i.searchable?``:void 0,children:[/* @__PURE__ */ m(`button`,{type:`button`,className:y(i),role:`menuitem`,"aria-haspopup":`menu`,"aria-expanded":`false`,tabIndex:-1,"data-key":i.key,"aria-disabled":i.disabled?`true`:void 0,children:[s(i.icon,{size:16}),i.label,s(`chevron-right`,{size:14,className:`wui-context-menu-chevron`})]}),/* @__PURE__ */ m(`div`,{className:`dropdown-menu wui-context-menu-subpanel`,popover:`auto`,role:`menu`,"aria-label":i.label,tabIndex:-1,children:[i.searchable?/* @__PURE__ */ p(`input`,{type:`search`,className:`wui-context-menu-search`,autoComplete:`off`,placeholder:e,"aria-label":e}):null,b(i.items,a,o)]})]},i.key)}let c=!!i.to&&!i.disabled,l=/* @__PURE__ */ m(f,{children:[i.image?/* @__PURE__ */ p(`img`,{src:i.image,alt:``}):s(i.icon,{size:16}),i.label,n(i.shortcut)]}),u={className:y(i),role:`menuitem`,tabIndex:-1,"data-key":i.key,"aria-checked":i.checked||void 0,"data-hint":i.hint||void 0,"aria-keyshortcuts":t(i.shortcut),"aria-disabled":i.disabled||void 0,onClick:i.disabled?void 0:i.onClick,children:l};return c?/* @__PURE__ */ p(r,{link:e(a,{to:i.to}),...u},i.key):/* @__PURE__ */ p(`button`,{type:`button`,...u},i.key)})}export{_ as default};
@@ -1 +1 @@
1
- import{FILL_VARIANTS as e,TONES as t}from"../lib/vocabulary.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./AppActionIcon.js";import i from"./AppButton.js";import a from"./assertValidValue.js";import o from"./warnUnknownProps.js";import s from"./withTooltip.js";import{COPY_FEEDBACK_MS as c,copyTextToClipboard as l}from"@webority/ui-elements/helpers";import{useCallback as u,useEffect as d,useRef as f,useState as p}from"react";import{jsx as m}from"react/jsx-runtime";var h={sm:14,md:16,lg:20};function g(g){let{marker:_,props:v}=n(`AppCopyButton`,g),{text:y,label:b=`Copy`,copiedLabel:x=`Copied`,iconOnly:S=!1,size:C=`md`,tone:w=`primary`,variant:T=`ghost`,onCopied:E,className:D=``,tooltip:O,tooltipPlacement:k,...A}=v;o(`AppCopyButton`,A),a(`AppCopyButton`,`size`,C,Object.keys(h)),a(`AppCopyButton`,`tone`,w,t),a(`AppCopyButton`,`variant`,T,e);let[j,M]=p(!1),N=f(void 0);d(()=>()=>clearTimeout(N.current),[]);let P=u(async()=>{await l(y)&&(M(!0),clearTimeout(N.current),N.current=setTimeout(()=>M(!1),c),E?.())},[y,E]),F=j?x:b,I=j?`check`:`files`;return s(S?/* @__PURE__ */ m(r,{icon:I,label:F,size:h[C]??h.md,onClick:P,className:D,...A,..._}):/* @__PURE__ */ m(i,{leftIcon:I,tone:w,variant:T,size:C,onClick:P,className:D,"aria-live":`polite`,...A,..._,children:F}),O,k)}export{g as default};
1
+ import e from"../lib/useWuiText.js";import{FILL_VARIANTS as t,TONES as n}from"../lib/vocabulary.js";import{splitMarkerProps as r}from"../lib/wuiMarker.js";import i from"./AppActionIcon.js";import a from"./AppButton.js";import o from"./assertValidValue.js";import s from"./warnUnknownProps.js";import c from"./withTooltip.js";import{COPY_FEEDBACK_MS as l,copyTextToClipboard as u}from"@webority/ui-elements/helpers";import{useCallback as d,useEffect as f,useRef as p,useState as m}from"react";import{jsx as h}from"react/jsx-runtime";import{COPY_BUTTON_TEXT as g}from"@webority/ui-elements/text";var _={sm:14,md:16,lg:20};function v(v){let{marker:y,props:b}=r(`AppCopyButton`,v),x=e(`copyButton`,g),{text:S,label:C=x.label,copiedLabel:w=x.copiedLabel,iconOnly:T=!1,size:E=`md`,tone:D=`primary`,variant:O=`ghost`,onCopied:k,className:A=``,tooltip:j,tooltipPlacement:M,...N}=b;s(`AppCopyButton`,N),o(`AppCopyButton`,`size`,E,Object.keys(_)),o(`AppCopyButton`,`tone`,D,n),o(`AppCopyButton`,`variant`,O,t);let[P,F]=m(!1),I=p(void 0);f(()=>()=>clearTimeout(I.current),[]);let L=d(async()=>{await u(S)&&(F(!0),clearTimeout(I.current),I.current=setTimeout(()=>F(!1),l),k?.())},[S,k]),R=P?w:C,z=P?`check`:`files`;return c(T?/* @__PURE__ */ h(i,{icon:z,label:R,size:_[E]??_.md,onClick:L,className:A,...N,...y}):/* @__PURE__ */ h(a,{leftIcon:z,tone:D,variant:O,size:E,onClick:L,className:A,"aria-live":`polite`,...N,...y,children:R}),j,M)}export{v as default};