@webority/ui-react 0.127.0 → 0.129.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 (186) hide show
  1. package/dist/canvas-kit/kit.js +28735 -24316
  2. package/dist/canvas-kit/manifest.json +3223 -163
  3. package/dist/canvas-kit/release.json +6 -6
  4. package/dist/components/AppAccountSwitcher.js +1 -0
  5. package/dist/components/AppAsyncBlock.js +1 -1
  6. package/dist/components/AppAuthLayout.js +1 -0
  7. package/dist/components/AppAutocomplete.js +1 -1
  8. package/dist/components/AppAvatar.js +1 -1
  9. package/dist/components/AppAvatarGroup.js +1 -1
  10. package/dist/components/AppBanner.js +1 -1
  11. package/dist/components/AppButton.js +1 -1
  12. package/dist/components/AppCalendar.js +1 -1
  13. package/dist/components/AppCard.js +1 -1
  14. package/dist/components/AppCell.js +1 -0
  15. package/dist/components/AppChart.js +1 -1
  16. package/dist/components/AppChartCard.js +1 -1
  17. package/dist/components/AppCheckbox.js +1 -1
  18. package/dist/components/AppChoiceCard.js +1 -1
  19. package/dist/components/AppChoiceChip.js +1 -1
  20. package/dist/components/AppColorField.js +1 -1
  21. package/dist/components/AppCommandPalette.js +1 -1
  22. package/dist/components/AppCommentThread.js +1 -1
  23. package/dist/components/AppCompareTable.js +1 -1
  24. package/dist/components/AppConfirmDialog.js +1 -1
  25. package/dist/components/AppCopyButton.js +1 -1
  26. package/dist/components/AppCountrySelect.js +1 -1
  27. package/dist/components/AppDataTable.js +1 -1
  28. package/dist/components/AppDatePicker.js +1 -1
  29. package/dist/components/AppDateRangePicker.js +1 -1
  30. package/dist/components/AppDescriptions.js +1 -1
  31. package/dist/components/AppDrawer.js +1 -1
  32. package/dist/components/AppDropZone.js +1 -1
  33. package/dist/components/AppDueDate.js +1 -1
  34. package/dist/components/AppErrorBoundary.js +1 -0
  35. package/dist/components/AppFileAttachment.js +1 -1
  36. package/dist/components/AppFilePicker.js +1 -1
  37. package/dist/components/AppFileTiles.js +1 -1
  38. package/dist/components/AppFilterBar.js +1 -1
  39. package/dist/components/AppFloatingButton.js +1 -0
  40. package/dist/components/AppImagePicker.js +1 -1
  41. package/dist/components/AppInlineEdit.js +1 -1
  42. package/dist/components/AppInput.js +1 -1
  43. package/dist/components/AppKanban.js +1 -1
  44. package/dist/components/AppLeadPopup.js +1 -0
  45. package/dist/components/AppLink.js +1 -1
  46. package/dist/components/AppMarkdown.js +1 -1
  47. package/dist/components/AppMentionInput.js +1 -1
  48. package/dist/components/AppMetricStrip.js +1 -1
  49. package/dist/components/AppModal.js +1 -1
  50. package/dist/components/AppMultiSelect.js +1 -1
  51. package/dist/components/AppNotificationCenter.js +1 -1
  52. package/dist/components/AppNumberInput.js +1 -1
  53. package/dist/components/AppOtpInput.js +1 -1
  54. package/dist/components/AppPhoneNumberInput.js +1 -1
  55. package/dist/components/AppPopover.js +1 -1
  56. package/dist/components/AppProgress.js +1 -1
  57. package/dist/components/AppRadio.js +1 -1
  58. package/dist/components/AppRadioGroup.js +1 -1
  59. package/dist/components/AppRating.js +1 -1
  60. package/dist/components/AppRichText.js +1 -1
  61. package/dist/components/AppRouteError.js +1 -1
  62. package/dist/components/AppScoreScale.js +1 -1
  63. package/dist/components/AppSearch.js +1 -1
  64. package/dist/components/AppSectionLeadCapture.js +1 -1
  65. package/dist/components/AppSectionLogos.js +1 -1
  66. package/dist/components/AppSegmented.js +1 -1
  67. package/dist/components/AppSelect.js +1 -1
  68. package/dist/components/AppShell.js +1 -1
  69. package/dist/components/AppSlider.js +1 -1
  70. package/dist/components/AppSortableList.js +1 -1
  71. package/dist/components/AppSparkline.js +1 -1
  72. package/dist/components/AppSplitButton.js +1 -1
  73. package/dist/components/AppSplitView.js +1 -1
  74. package/dist/components/AppStepper.js +1 -1
  75. package/dist/components/AppSwitch.js +1 -1
  76. package/dist/components/AppTablePagination.js +1 -1
  77. package/dist/components/AppTableToolbar.js +1 -1
  78. package/dist/components/AppTagInput.js +1 -1
  79. package/dist/components/AppTextarea.js +1 -1
  80. package/dist/components/AppTimePicker.js +1 -1
  81. package/dist/components/AppTimeline.js +1 -1
  82. package/dist/components/AppToast.js +1 -1
  83. package/dist/components/AppUpdateBar.js +1 -1
  84. package/dist/components/AppWhatsNew.js +1 -1
  85. package/dist/components/AppWorkspaceSwitcher.js +1 -1
  86. package/dist/components/iconCatalogNames.g.js +1 -1
  87. package/dist/components/iconGlyphs.g.js +1 -1
  88. package/dist/components/iconVariants.g.js +1 -1
  89. package/dist/components/useWuiControl.js +1 -1
  90. package/dist/guidance.json +235 -2
  91. package/dist/lib/CheckField.js +1 -1
  92. package/dist/lib/FileItemRow.js +1 -1
  93. package/dist/lib/fieldState.js +1 -0
  94. package/dist/lib/fillLabel.js +1 -0
  95. package/dist/lib/labelWithHelp.js +1 -0
  96. package/dist/lib/linkTarget.js +1 -0
  97. package/dist/markdown-core/dist/links.js +1 -1
  98. package/dist/types/components/AppAccountSwitcher.d.ts +41 -0
  99. package/dist/types/components/AppAsyncBlock.d.ts +24 -0
  100. package/dist/types/components/AppAuthLayout.d.ts +45 -0
  101. package/dist/types/components/AppAutocomplete.d.ts +22 -2
  102. package/dist/types/components/AppAvatar.d.ts +6 -0
  103. package/dist/types/components/AppAvatarGroup.d.ts +6 -0
  104. package/dist/types/components/AppBanner.d.ts +6 -0
  105. package/dist/types/components/AppButton.d.ts +1 -0
  106. package/dist/types/components/AppCalendar.d.ts +3 -1
  107. package/dist/types/components/AppCard.d.ts +13 -1
  108. package/dist/types/components/AppCell.d.ts +36 -0
  109. package/dist/types/components/AppChart.d.ts +7 -0
  110. package/dist/types/components/AppChartCard.d.ts +60 -0
  111. package/dist/types/components/AppCheckbox.d.ts +22 -0
  112. package/dist/types/components/AppChoiceCard.d.ts +21 -0
  113. package/dist/types/components/AppChoiceChip.d.ts +21 -0
  114. package/dist/types/components/AppColorField.d.ts +43 -4
  115. package/dist/types/components/AppCommandPalette.d.ts +6 -0
  116. package/dist/types/components/AppCommentThread.d.ts +102 -3
  117. package/dist/types/components/AppCompareTable.d.ts +24 -0
  118. package/dist/types/components/AppConfirmDialog.d.ts +6 -0
  119. package/dist/types/components/AppCountrySelect.d.ts +5 -0
  120. package/dist/types/components/AppDataTable.d.ts +1 -1
  121. package/dist/types/components/AppDatePicker.d.ts +24 -0
  122. package/dist/types/components/AppDateRangePicker.d.ts +31 -1
  123. package/dist/types/components/AppDescriptions.d.ts +4 -1
  124. package/dist/types/components/AppDrawer.d.ts +6 -0
  125. package/dist/types/components/AppDropZone.d.ts +24 -0
  126. package/dist/types/components/AppDueDate.d.ts +42 -0
  127. package/dist/types/components/AppErrorBoundary.d.ts +39 -0
  128. package/dist/types/components/AppFileAttachment.d.ts +54 -1
  129. package/dist/types/components/AppFilePicker.d.ts +75 -0
  130. package/dist/types/components/AppFileTiles.d.ts +6 -3
  131. package/dist/types/components/AppFilterBar.d.ts +73 -0
  132. package/dist/types/components/AppFloatingButton.d.ts +64 -0
  133. package/dist/types/components/AppImagePicker.d.ts +60 -0
  134. package/dist/types/components/AppInlineEdit.d.ts +6 -0
  135. package/dist/types/components/AppInput.d.ts +37 -2
  136. package/dist/types/components/AppKanban.d.ts +32 -0
  137. package/dist/types/components/AppLeadPopup.d.ts +122 -0
  138. package/dist/types/components/AppLink.d.ts +3 -0
  139. package/dist/types/components/AppMentionInput.d.ts +17 -0
  140. package/dist/types/components/AppMetricStrip.d.ts +2 -0
  141. package/dist/types/components/AppModal.d.ts +6 -0
  142. package/dist/types/components/AppMultiSelect.d.ts +18 -1
  143. package/dist/types/components/AppNotificationCenter.d.ts +2 -0
  144. package/dist/types/components/AppNumberInput.d.ts +24 -2
  145. package/dist/types/components/AppOtpInput.d.ts +29 -0
  146. package/dist/types/components/AppPhoneNumberInput.d.ts +26 -0
  147. package/dist/types/components/AppProgress.d.ts +2 -2
  148. package/dist/types/components/AppRadio.d.ts +22 -0
  149. package/dist/types/components/AppRadioGroup.d.ts +24 -0
  150. package/dist/types/components/AppRating.d.ts +39 -0
  151. package/dist/types/components/AppRichText.d.ts +7 -0
  152. package/dist/types/components/AppRouteError.d.ts +54 -0
  153. package/dist/types/components/AppScoreScale.d.ts +6 -0
  154. package/dist/types/components/AppSearch.d.ts +17 -2
  155. package/dist/types/components/AppSectionLeadCapture.d.ts +48 -0
  156. package/dist/types/components/AppSectionLogos.d.ts +2 -0
  157. package/dist/types/components/AppSegmented.d.ts +27 -3
  158. package/dist/types/components/AppSelect.d.ts +22 -2
  159. package/dist/types/components/AppShell.d.ts +165 -0
  160. package/dist/types/components/AppSlider.d.ts +28 -0
  161. package/dist/types/components/AppSortableList.d.ts +5 -0
  162. package/dist/types/components/AppSparkline.d.ts +24 -0
  163. package/dist/types/components/AppSplitView.d.ts +68 -0
  164. package/dist/types/components/AppStepper.d.ts +6 -0
  165. package/dist/types/components/AppSwitch.d.ts +22 -0
  166. package/dist/types/components/AppTablePagination.d.ts +44 -2
  167. package/dist/types/components/AppTableToolbar.d.ts +30 -0
  168. package/dist/types/components/AppTagInput.d.ts +18 -1
  169. package/dist/types/components/AppTextarea.d.ts +20 -0
  170. package/dist/types/components/AppTimePicker.d.ts +17 -0
  171. package/dist/types/components/AppTimeline.d.ts +8 -0
  172. package/dist/types/components/AppToast.d.ts +6 -0
  173. package/dist/types/components/AppUpdateBar.d.ts +18 -0
  174. package/dist/types/components/AppWhatsNew.d.ts +2 -0
  175. package/dist/types/components/AppWorkspaceSwitcher.d.ts +18 -0
  176. package/dist/types/components/iconGlyphs.g.d.ts +1 -0
  177. package/dist/types/components/iconVariants.g.d.ts +5 -0
  178. package/dist/types/components/useWuiControl.d.ts +3 -1
  179. package/dist/types/index.d.ts +6 -0
  180. package/dist/types/lib/FileItemRow.d.ts +9 -2
  181. package/dist/types/lib/fieldState.d.ts +3 -0
  182. package/dist/types/lib/fillLabel.d.ts +1 -0
  183. package/dist/types/lib/labelWithHelp.d.ts +10 -0
  184. package/dist/types/lib/linkTarget.d.ts +30 -0
  185. package/dist/ui-react.js +1 -1
  186. package/package.json +8 -8
@@ -1 +1 @@
1
- import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import{Fragment as r,jsx as i,jsxs as a}from"react/jsx-runtime";var o=[3,4,5],s=[`sm`,`md`],c=[`neutral`,`success`,`warning`,`danger`,`info`];function l(l){let{marker:u,props:d}=e(`AppMetricStrip`,l),{items:f=[],columns:p=4,size:m=`md`,className:h=``,...g}=d;n(`AppMetricStrip`,g),t(`AppMetricStrip`,`columns`,p,o),t(`AppMetricStrip`,`size`,m,s);let _=[`wui-metric-strip`,`wui-metric-strip-cols-${p}`,m===`sm`?`wui-metric-strip-sm`:``,h].filter(Boolean).join(` `);return/* @__PURE__ */ i(`div`,{className:_,...u,...g,children:f.map((e,n)=>{t(`AppMetricStrip`,`tone`,e.tone,c);let o=`wui-metric${e.tone&&e.tone!==`neutral`?` wui-metric-tone-${e.tone}`:``}`,s=/* @__PURE__ */ a(r,{children:[/* @__PURE__ */ i(`div`,{className:`wui-metric-label`,children:e.label}),/* @__PURE__ */ i(`div`,{className:`wui-metric-value`,children:e.value}),e.note&&/* @__PURE__ */ i(`div`,{className:`wui-metric-note`,children:e.note})]}),l=`${e.label}-${n}`;return e.href?/* @__PURE__ */ i(`a`,{href:e.href,className:o,children:s},l):/* @__PURE__ */ i(`div`,{className:o,children:s},l)})})}export{l as default};
1
+ import{linkTarget as e}from"../lib/linkTarget.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./warnInvalidValue.js";import r from"./warnUnknownProps.js";import{Fragment as i,jsx as a,jsxs as o}from"react/jsx-runtime";var s=[3,4,5],c=[`sm`,`md`],l=[`neutral`,`success`,`warning`,`danger`,`info`];function u(u){let{marker:d,props:f}=t(`AppMetricStrip`,u),{items:p=[],columns:m=4,size:h=`md`,linkComponent:g,className:_=``,...v}=f;r(`AppMetricStrip`,v),n(`AppMetricStrip`,`columns`,m,s),n(`AppMetricStrip`,`size`,h,c);let y=[`wui-metric-strip`,`wui-metric-strip-cols-${m}`,h===`sm`?`wui-metric-strip-sm`:``,_].filter(Boolean).join(` `);return/* @__PURE__ */ a(`div`,{className:y,...d,...v,children:p.map((t,r)=>{n(`AppMetricStrip`,`tone`,t.tone,l);let s=`wui-metric${t.tone&&t.tone!==`neutral`?` wui-metric-tone-${t.tone}`:``}`,c=/* @__PURE__ */ o(i,{children:[/* @__PURE__ */ a(`div`,{className:`wui-metric-label`,children:t.label}),/* @__PURE__ */ a(`div`,{className:`wui-metric-value`,children:t.value}),t.note&&/* @__PURE__ */ a(`div`,{className:`wui-metric-note`,children:t.note})]}),u=`${t.label}-${r}`,{Tag:d,linkProps:f}=e(g,{href:t.href});return t.href?/* @__PURE__ */ a(d,{...f,className:s,children:c},u):/* @__PURE__ */ a(`div`,{className:s,children:c},u)})})}export{u as default};
@@ -1 +1 @@
1
- import e from"../lib/DiscardPrompt.js";import{devWarn as t}from"../lib/devWarn.js";import{lockPageScroll as n}from"../lib/pageScrollLock.js";import{splitMarkerProps as r}from"../lib/wuiMarker.js";import i from"./AppIcon.js";import a from"./warnInvalidValue.js";import o from"./warnUnknownProps.js";import{useCallback as s,useEffect as c,useRef as l,useState as ee}from"react";import{Modal as te}from"react-bootstrap";import{jsx as u,jsxs as d}from"react/jsx-runtime";var ne=[`default`,`danger`,`success`,`warning`],f=[`center`,`top`],p=`a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])`,m={sm:380,md:440,lg:640,xl:880},h=`wui-modal-fullscreen`,g=!1;function re(){let e=!0;try{e=process.env.NODE_ENV!==`production`}catch{e=!0}e&&!g&&(g=!0,t("[@webority/ui-react] <AppModal hideHeader> has no accessible name: pass `ariaLabel` (or a string `title`)."))}function ie(e,t){if(e.key!==`Tab`)return;let n=Array.from(t.querySelectorAll(p));if(!n.length){e.preventDefault(),t.focus();return}let r=n[0],i=n[n.length-1],a=document.activeElement;e.shiftKey&&(a===r||a===t)?(e.preventDefault(),i.focus()):!e.shiftKey&&a===i&&(e.preventDefault(),r.focus())}function _(){let e=[];for(let t of document.body.children)t.hasAttribute(`inert`)||t.matches(`.modal, .modal-backdrop`)||(t.setAttribute(`inert`,``),e.push(t));return e}function ae(){return typeof document<`u`&&document.querySelector(`wui-drawer[open], .offcanvas.show`)!==null}function v(t){let{marker:g,props:v}=r(`AppModal`,t),{open:y,eyebrow:b,title:x,subtitle:S,headerIcon:C,tone:w=`default`,dismissible:T=!0,onClose:E,onBack:D,backLabel:O=`Back`,headerActions:k,footer:A,size:j=`md`,placement:M=`center`,hideHeader:N=!1,staticBackdrop:P=!1,confirmDiscard:F,dirty:oe=!1,ariaLabel:I,className:se=``,children:ce,...L}=v;o(`AppModal`,L),a(`AppModal`,`tone`,w,ne),a(`AppModal`,`placement`,M,f),a(`AppModal`,`size`,typeof j==`string`?j:null,[...Object.keys(m),`fullscreen`]);let{style:R,ref:z,"data-wui":B,"data-wui-props":V,...H}=L,U=B?{"data-wui":B,"data-wui-props":V}:g,W=U[`data-wui`],G=U[`data-wui-props`];N&&!I&&typeof x!=`string`&&re();let K=l(null),q=l(null),[J,Y]=ee(!1);c(()=>{y||Y(!1)},[y]),c(()=>{J&&q.current?.focus()},[J]),c(()=>{if(y)return n()},[y]),c(()=>{let e=K.current?.closest(`.modal`);e&&(F?e.setAttribute(`confirm-discard`,F):e.removeAttribute(`confirm-discard`))},[y,F]);let X=l(null),le=s(e=>{X.current=e,typeof z==`function`?z(e):z&&(z.current=e)},[z]);c(()=>{let e=X.current?.dialog;e&&(e.setAttribute(`data-wui`,W),G===void 0?e.removeAttribute(`data-wui-props`):e.setAttribute(`data-wui-props`,G))},[y,W,G]),c(()=>{if(!y)return;let e=K.current?.closest(`.modal-content`);if(!e)return;let t=()=>Array.from(e.querySelectorAll(p));(e.querySelector(`[data-autofocus]`)||t().find(e=>!e.classList.contains(`wui-modal-close`)&&!e.classList.contains(`wui-modal-back`))||t()[0]||e).focus?.();let n=e.closest(`.modal`),r=_(),i=e=>ie(e,n);return n?.addEventListener(`keydown`,i),()=>{n?.removeEventListener(`keydown`,i);for(let e of r)e.removeAttribute(`inert`);n&&setTimeout(()=>{n.isConnected&&!n.classList.contains(`show`)&&n.dispatchEvent(new Event(`transitionend`,{bubbles:!0}))},500)}},[y]);let Z=()=>{F&&oe?Y(!0):E?.()},ue=()=>{Y(!1),E?.()},de=()=>{Y(!1),(K.current?.querySelector(`input:not([type="hidden"]):not([disabled]),select:not([disabled]),textarea:not([disabled])`))?.focus()},Q=j===`fullscreen`,fe=typeof j==`number`?j:m[j]??m.md,pe=[`wui-modal`,w==="default"?``:`tone-${w}`,se].filter(Boolean).join(` `),$=y&&ae(),me=[`wui-modal-shell`,Q&&h,$&&`wui-modal-stacked`].filter(Boolean).join(` `);return/* @__PURE__ */ d(te,{...H,ref:le,show:y,onHide:Z,backdrop:!P||`static`,keyboard:!P,autoFocus:!1,enforceFocus:!0,restoreFocus:!0,centered:M!==`top`,className:me,style:Q?R:{"--wui-modal-max-width":`${fe}px`,...R},dialogClassName:`wui-rb-dialog`,contentClassName:pe,backdropClassName:$?`wui-modal-dim wui-modal-backdrop-stacked`:`wui-modal-dim`,"aria-label":I||(typeof x==`string`?x:void 0),children:[!N&&/* @__PURE__ */ d(`div`,{className:`wui-modal-header`,children:[D&&/* @__PURE__ */ u(`button`,{type:`button`,className:`wui-modal-back`,onClick:D,"aria-label":O,children:/* @__PURE__ */ u(i,{name:`arrow-left`,size:18})}),/* @__PURE__ */ d(`div`,{className:`wui-modal-heading`,children:[C&&/* @__PURE__ */ u(`span`,{className:`wui-modal-headicon`,children:/* @__PURE__ */ u(i,{name:C,size:18})}),/* @__PURE__ */ d(`div`,{className:`wui-modal-headtext`,children:[b&&/* @__PURE__ */ u(`div`,{className:`wui-modal-eyebrow`,children:b}),/* @__PURE__ */ u(`div`,{className:`wui-modal-title`,children:x}),S&&/* @__PURE__ */ u(`div`,{className:`wui-modal-subtitle`,children:S})]})]}),k&&/* @__PURE__ */ u(`div`,{className:`wui-modal-header-actions`,children:k}),T&&/* @__PURE__ */ u(`button`,{type:`button`,className:`wui-modal-close`,onClick:Z,"aria-label":`Close`,children:/* @__PURE__ */ u(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:/* @__PURE__ */ u(`path`,{d:`M18 6 6 18M6 6l12 12`})})})]}),/* @__PURE__ */ u(`div`,{className:`wui-modal-body`,ref:K,children:ce}),(A||J)&&/* @__PURE__ */ d(`div`,{className:J?`wui-modal-footer wui-drawer-discarding`:`wui-modal-footer`,children:[J&&/* @__PURE__ */ u(e,{text:F,confirmRef:q,onDiscard:ue,onKeep:de}),A]})]})}export{v as default};
1
+ import e from"../lib/DiscardPrompt.js";import{devWarn as t}from"../lib/devWarn.js";import{lockPageScroll as n}from"../lib/pageScrollLock.js";import{splitMarkerProps as r}from"../lib/wuiMarker.js";import i from"./AppIcon.js";import a from"./warnInvalidValue.js";import o from"./warnUnknownProps.js";import{useCallback as s,useEffect as c,useRef as l,useState as u}from"react";import{Modal as ee}from"react-bootstrap";import{jsx as d,jsxs as f}from"react/jsx-runtime";var te=[`default`,`danger`,`success`,`warning`],p=[`center`,`top`],m=`a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])`,h={sm:380,md:440,lg:640,xl:880},ne=`wui-modal-fullscreen`,g=!1;function _(){let e=!0;try{e=process.env.NODE_ENV!==`production`}catch{e=!0}e&&!g&&(g=!0,t("[@webority/ui-react] <AppModal hideHeader> has no accessible name: pass `ariaLabel` (or a string `title`)."))}function re(e,t){if(e.key!==`Tab`)return;let n=Array.from(t.querySelectorAll(m));if(!n.length){e.preventDefault(),t.focus();return}let r=n[0],i=n[n.length-1],a=document.activeElement;e.shiftKey&&(a===r||a===t)?(e.preventDefault(),i.focus()):!e.shiftKey&&a===i&&(e.preventDefault(),r.focus())}function ie(){let e=[];for(let t of document.body.children)t.hasAttribute(`inert`)||t.matches(`.modal, .modal-backdrop`)||(t.setAttribute(`inert`,``),e.push(t));return e}function ae(){return typeof document<`u`&&document.querySelector(`wui-drawer[open], .offcanvas.show`)!==null}function v(t){let{marker:g,props:v}=r(`AppModal`,t),{open:y,eyebrow:b,title:x,subtitle:S,headerIcon:C,tone:w=`default`,dismissible:oe=!0,onClose:T,onBack:E,backLabel:D=`Back`,headerActions:O,footer:k,size:A=`md`,placement:j=`center`,hideHeader:M=!1,staticBackdrop:N=!1,confirmDiscard:P,dirty:se=!1,ariaLabel:F,closeLabel:ce=`Close`,className:le=``,children:I,...L}=v;o(`AppModal`,L),a(`AppModal`,`tone`,w,te),a(`AppModal`,`placement`,j,p),a(`AppModal`,`size`,typeof A==`string`?A:null,[...Object.keys(h),`fullscreen`]);let{style:R,ref:z,"data-wui":B,"data-wui-props":V,...H}=L,U=B?{"data-wui":B,"data-wui-props":V}:g,W=U[`data-wui`],G=U[`data-wui-props`];M&&!F&&typeof x!=`string`&&_();let K=l(null),q=l(null),[J,Y]=u(!1);c(()=>{y||Y(!1)},[y]),c(()=>{J&&q.current?.focus()},[J]),c(()=>{if(y)return n()},[y]),c(()=>{let e=K.current?.closest(`.modal`);e&&(P?e.setAttribute(`confirm-discard`,P):e.removeAttribute(`confirm-discard`))},[y,P]);let X=l(null),ue=s(e=>{X.current=e,typeof z==`function`?z(e):z&&(z.current=e)},[z]);c(()=>{let e=X.current?.dialog;e&&(e.setAttribute(`data-wui`,W),G===void 0?e.removeAttribute(`data-wui-props`):e.setAttribute(`data-wui-props`,G))},[y,W,G]),c(()=>{if(!y)return;let e=K.current?.closest(`.modal-content`);if(!e)return;let t=()=>Array.from(e.querySelectorAll(m));(e.querySelector(`[data-autofocus]`)||t().find(e=>!e.classList.contains(`wui-modal-close`)&&!e.classList.contains(`wui-modal-back`))||t()[0]||e).focus?.();let n=e.closest(`.modal`),r=ie(),i=e=>re(e,n);return n?.addEventListener(`keydown`,i),()=>{n?.removeEventListener(`keydown`,i);for(let e of r)e.removeAttribute(`inert`);n&&setTimeout(()=>{n.isConnected&&!n.classList.contains(`show`)&&n.dispatchEvent(new Event(`transitionend`,{bubbles:!0}))},500)}},[y]);let Z=()=>{P&&se?Y(!0):T?.()},de=()=>{Y(!1),T?.()},fe=()=>{Y(!1),(K.current?.querySelector(`input:not([type="hidden"]):not([disabled]),select:not([disabled]),textarea:not([disabled])`))?.focus()},Q=A===`fullscreen`,pe=typeof A==`number`?A:h[A]??h.md,me=[`wui-modal`,w==="default"?``:`tone-${w}`,le].filter(Boolean).join(` `),$=y&&ae(),he=[`wui-modal-shell`,Q&&ne,$&&`wui-modal-stacked`].filter(Boolean).join(` `);return/* @__PURE__ */ f(ee,{...H,ref:ue,show:y,onHide:Z,backdrop:!N||`static`,keyboard:!N,autoFocus:!1,enforceFocus:!0,restoreFocus:!0,centered:j!==`top`,className:he,style:Q?R:{"--wui-modal-max-width":`${pe}px`,...R},dialogClassName:`wui-rb-dialog`,contentClassName:me,backdropClassName:$?`wui-modal-dim wui-modal-backdrop-stacked`:`wui-modal-dim`,"aria-label":F||(typeof x==`string`?x:void 0),children:[!M&&/* @__PURE__ */ f(`div`,{className:`wui-modal-header`,children:[E&&/* @__PURE__ */ d(`button`,{type:`button`,className:`wui-modal-back`,onClick:E,"aria-label":D,children:/* @__PURE__ */ d(i,{name:`arrow-left`,size:18})}),/* @__PURE__ */ f(`div`,{className:`wui-modal-heading`,children:[C&&/* @__PURE__ */ d(`span`,{className:`wui-modal-headicon`,children:/* @__PURE__ */ d(i,{name:C,size:18})}),/* @__PURE__ */ f(`div`,{className:`wui-modal-headtext`,children:[b&&/* @__PURE__ */ d(`div`,{className:`wui-modal-eyebrow`,children:b}),/* @__PURE__ */ d(`div`,{className:`wui-modal-title`,children:x}),S&&/* @__PURE__ */ d(`div`,{className:`wui-modal-subtitle`,children:S})]})]}),O&&/* @__PURE__ */ d(`div`,{className:`wui-modal-header-actions`,children:O}),oe&&/* @__PURE__ */ d(`button`,{type:`button`,className:`wui-modal-close`,onClick:Z,"aria-label":ce,children:/* @__PURE__ */ d(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:/* @__PURE__ */ d(`path`,{d:`M18 6 6 18M6 6l12 12`})})})]}),/* @__PURE__ */ d(`div`,{className:`wui-modal-body`,ref:K,children:I}),(k||J)&&/* @__PURE__ */ f(`div`,{className:J?`wui-modal-footer wui-drawer-discarding`:`wui-modal-footer`,children:[J&&/* @__PURE__ */ d(e,{text:P,confirmRef:q,onDiscard:de,onKeep:fe}),k]})]})}export{v as default};
@@ -1 +1 @@
1
- import e from"../lib/FieldMessage.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./AppInfoTip.js";import r from"./AppRequiredMark.js";import i from"./useNodeLabels.js";import a,{optionsEqual as o,readValues as s,writeValues as c}from"./useWuiControl.js";import l from"./warnInvalidValue.js";import u from"./warnUnknownProps.js";import{forwardRef as d,useEffect as f,useId as p}from"react";import{jsx as m,jsxs as h}from"react/jsx-runtime";import"@webority/ui-elements/elements/multiselect";var g=[`sm`,`lg`],_=[],v=(e,t)=>({...e,label:t}),y=d(function(d,y){let{marker:b,props:x}=t(`AppMultiSelect`,d),{values:S,onChange:C,options:w,placeholder:T=`Select…`,searchPlaceholder:E=`Search…`,searchable:D=!0,disabled:O=!1,icon:k,size:A,collapseChips:j=!1,allowCustom:M=!1,validateCustom:N,customPattern:P,customInvalidMessage:F,name:I,id:L,label:R,error:z,hint:B,required:V=!1,optional:H=!1,help:U,helpLabel:W=`More information`,fieldClassName:G=``,...K}=x;u(`AppMultiSelect`,K),l(`AppMultiSelect`,`size`,A,g);let q=p(),J=L||q,{setRef:Y,innerRef:X}=a({ref:y,value:S,onChange:C,readValue:s,writeValue:c}),Z=w||_,{portal:Q,toElementOptions:$}=i(Z);return f(()=>{let e=X.current;if(!e)return;let t=$(Z,v);o(t,e.options)||(e.options=t)},[Z,X,$]),f(()=>{let e=X.current;e&&(e.validateCustom=N??null)},[N,X]),/* @__PURE__ */ h(`div`,{...b,className:`field${G?` ${G}`:``}`,children:[R&&/* @__PURE__ */ h(`label`,{className:`label`,htmlFor:J,children:[R,H&&!V&&/* @__PURE__ */ m(`span`,{className:`label-optional`,children:` (optional)`}),V&&/* @__PURE__ */ m(r,{}),U&&/* @__PURE__ */ m(n,{label:W,children:U})]}),/* @__PURE__ */ m(`wui-multiselect`,{"aria-label":typeof R==`string`?R:void 0,"aria-describedby":z?`${J}-error`:B?`${J}-hint`:void 0,"aria-invalid":z?`true`:void 0,id:J,ref:Y,name:I,placeholder:T,"search-placeholder":E,icon:k||void 0,size:A||void 0,"collapse-chips":j?``:void 0,"allow-custom":M?``:void 0,"custom-pattern":P||void 0,"custom-invalid-message":F||void 0,searchable:D?``:void 0,disabled:O?``:void 0,required:V?``:void 0,...K}),Q,/* @__PURE__ */ m(e,{error:z,hint:B,errorId:`${J}-error`,hintId:`${J}-hint`})]})});export{y as default};
1
+ import e from"../lib/FieldMessage.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./AppInfoTip.js";import r from"./AppRequiredMark.js";import i from"./useNodeLabels.js";import a,{optionsEqual as o,readValues as s,writeValues as c}from"./useWuiControl.js";import l from"./warnInvalidValue.js";import ee from"./warnUnknownProps.js";import{forwardRef as u,useEffect as d,useId as f}from"react";import{jsx as p,jsxs as m}from"react/jsx-runtime";import"@webority/ui-elements/elements/multiselect";var h=[`sm`,`md`,`lg`],g=[],_=(e,t)=>({...e,label:t}),v=u(function(u,v){let{marker:te,props:y}=t(`AppMultiSelect`,u),{values:b,defaultValues:x,onChange:S,options:C,placeholder:w=`Select…`,searchPlaceholder:T=`Search…`,searchable:E=!0,disabled:D=!1,readOnly:O=!1,loading:k=!1,icon:A,size:j,collapseChips:M=!1,allowCustom:N=!1,validateCustom:P,customPattern:ne,customInvalidMessage:F,name:I,id:L,label:R,error:z,hint:B,required:V=!1,optional:H=!1,optionalLabel:U=`(optional)`,help:W,helpLabel:G=`More information`,fieldClassName:K=``,...q}=y;ee(`AppMultiSelect`,q),l(`AppMultiSelect`,`size`,j,h);let J=f(),Y=L||J,{setRef:X,innerRef:Z}=a({ref:v,value:b,defaultValue:x,onChange:S,readValue:s,writeValue:c}),Q=C||g,{portal:re,toElementOptions:$}=i(Q);return d(()=>{let e=Z.current;if(!e)return;let t=$(Q,_);o(t,e.options)||(e.options=t)},[Q,Z,$]),d(()=>{let e=Z.current;e&&(e.validateCustom=P??null)},[P,Z]),/* @__PURE__ */ m(`div`,{...te,className:`field${K?` ${K}`:``}`,children:[R&&/* @__PURE__ */ m(`label`,{className:`label`,htmlFor:Y,children:[R,H&&!V&&/* @__PURE__ */ p(`span`,{className:`label-optional`,children:` ${U}`}),V&&/* @__PURE__ */ p(r,{}),W&&/* @__PURE__ */ p(n,{label:G,children:W})]}),/* @__PURE__ */ p(`wui-multiselect`,{"aria-label":typeof R==`string`?R:void 0,"aria-describedby":z?`${Y}-error`:B?`${Y}-hint`:void 0,"aria-invalid":z?`true`:void 0,id:Y,ref:X,name:I,placeholder:w,"search-placeholder":T,icon:A||void 0,size:j===`md`?void 0:j||void 0,"collapse-chips":M?``:void 0,"allow-custom":N?``:void 0,"custom-pattern":ne||void 0,"custom-invalid-message":F||void 0,searchable:E?``:void 0,disabled:D?``:void 0,readonly:O?``:void 0,loading:k?``:void 0,required:V?``:void 0,...q}),re,/* @__PURE__ */ p(e,{error:z,hint:B,errorId:`${Y}-error`,hintId:`${Y}-hint`})]})});export{v as default};
@@ -1 +1 @@
1
- import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./AppIcon.js";import n from"./AppTabs.js";import r from"./warnInvalidValue.js";import i from"./warnUnknownProps.js";import{NOTIFICATION_TEXT as a,groupNotificationsByDay as o,notificationCountText as s,notificationTime as c,notificationTriggerLabel as l,notificationUnreadAnnouncement as u}from"@webority/ui-elements/helpers";import{useEffect as d,useId as f,useLayoutEffect as p,useRef as m,useState as h}from"react";import{Fragment as g,jsx as _,jsxs as v}from"react/jsx-runtime";import"@webority/ui-elements/elements/notification-center";var y=[`all`,`unread`,`archived`],b={all:`All`,unread:`Unread`,archived:`Archived`},x=`a, button, input, select, textarea`;function S(r){let{marker:c,props:g}=e(`AppNotificationCenter`,r),{items:y,unread:b,label:x=a.label,emptyText:S=a.empty,viewAllHref:E,defaultOpen:D=!1,now:O,onMarkAllRead:k,onItemClick:A,renderItem:j,tabs:M,onTabChange:N,onOpenChange:P,className:F=``,...I}=g;if(i(`AppNotificationCenter`,I),!Array.isArray(y))throw Error(`<AppNotificationCenter> items is required: pass the notifications, newest first.`);let L=C(M),[R,z]=h(L[0]?.key),B=L.some(e=>e.key===R)?R:L[0]?.key,V=e=>{e!==B&&(z(e),N?.(e))},H=f(),U=f(),W=m(null),G=m(P);G.current=P,d(()=>{let e=W.current,t=e=>G.current?.(e.detail.open);return e.addEventListener(`wui:notification-center:toggle`,t),()=>e.removeEventListener(`wui:notification-center:toggle`,t)},[]);let K=m(D);p(()=>{if(!K.current)return;let e=W.current;e.setAttribute(`open`,``),e.querySelector(`.wui-notification-center-trigger`)?.setAttribute(`aria-expanded`,`true`)},[]);let q=b??y.filter(e=>!e.read&&!e.archived).length,[J,Y]=h(``),X=m(q);d(()=>{X.current!==q&&(X.current=q,Y(u(q)))},[q]);let Z=o(L.length>0?w(y,B):y,O),Q=[`wui-notification-center`,F].filter(Boolean).join(` `);return/* @__PURE__ */ v(`wui-notification-center`,{ref:W,class:Q,label:x,controlled:``,...c,...I,children:[/* @__PURE__ */ v(`button`,{type:`button`,className:`topbar-icon-btn wui-notification-center-trigger`,"aria-expanded":K.current?`true`:`false`,"aria-controls":H,"aria-haspopup":`dialog`,"aria-label":l(x,q),children:[/* @__PURE__ */ _(t,{name:`notification`,size:20}),/* @__PURE__ */ _(`span`,{className:`wui-notification-center-count`,"aria-hidden":`true`,hidden:q===0,children:s(q)})]}),/* @__PURE__ */ _(`span`,{className:`visually-hidden wui-notification-center-live`,"aria-live":`polite`,children:J}),/* @__PURE__ */ v(`div`,{className:`wui-notification-center-panel`,id:H,role:`dialog`,"aria-labelledby":U,tabIndex:-1,children:[/* @__PURE__ */ v(`div`,{className:`wui-notification-center-head`,children:[/* @__PURE__ */ _(`h2`,{className:`wui-notification-center-title`,id:U,children:x}),k&&/* @__PURE__ */ _(`button`,{type:`button`,className:`wui-notification-center-markall`,disabled:q===0,onClick:k,children:a.markAll})]}),L.length>0&&/* @__PURE__ */ _(`div`,{className:`wui-notification-center-tabs`,children:/* @__PURE__ */ _(n,{tabs:L,value:B,onChange:V,size:`sm`,fitted:!0,ariaLabel:x})}),Z.length===0?/* @__PURE__ */ _(`p`,{className:`wui-notification-center-empty`,children:S}):/* @__PURE__ */ _(`div`,{className:`wui-notification-center-list`,children:Z.map(e=>/* @__PURE__ */ v(`section`,{"aria-labelledby":`${H}-${e.key}`,children:[/* @__PURE__ */ _(`h3`,{className:`wui-notification-center-day`,id:`${H}-${e.key}`,children:e.heading}),/* @__PURE__ */ _(`ul`,{className:`wui-notification-center-items`,children:e.items.map(e=>/* @__PURE__ */ _(`li`,{children:/* @__PURE__ */ _(T,{item:e,onItemClick:A,renderItem:j})},e.id))})]},e.key))}),E&&/* @__PURE__ */ _(`a`,{className:`wui-notification-center-foot`,href:E,children:a.viewAll})]})]})}function C(e){return e===!0?y.map(e=>({key:e,label:b[e]})):Array.isArray(e)?e.map(e=>(r(`AppNotificationCenter`,`tabs[].key`,e.key,y),{key:e.key,label:e.label??b[e.key]})):[]}function w(e,t){if(t===`archived`)return e.filter(e=>e.archived);let n=e.filter(e=>!e.archived);return t===`unread`?n.filter(e=>!e.read):n}function T({item:e,onItemClick:n,renderItem:r}){let i=`wui-notification-center-item${e.read?` wui-notification-center-item-read`:``}`,o=!e.read&&/* @__PURE__ */ _(`span`,{className:`visually-hidden wui-notification-center-unread-label`,children:a.unreadPrefix}),s=/* @__PURE__ */ _(`span`,{className:`wui-notification-center-dot`,"aria-hidden":`true`});if(r){let t=n?t=>{t.target.closest(x)||n(e,t)}:void 0;return/* @__PURE__ */ v(`div`,{className:i,"data-id":e.id,tabIndex:-1,onClick:t,children:[s,/* @__PURE__ */ v(`span`,{className:`wui-notification-center-body`,children:[o,r(e)]})]})}let l=c(e.at),u=/* @__PURE__ */ v(g,{children:[s,e.icon&&/* @__PURE__ */ _(`span`,{className:`wui-notification-center-icon`,children:/* @__PURE__ */ _(t,{name:e.icon,size:18})}),/* @__PURE__ */ v(`span`,{className:`wui-notification-center-body`,children:[o,/* @__PURE__ */ _(`span`,{className:`wui-notification-center-item-title`,children:e.title}),e.text&&/* @__PURE__ */ _(`span`,{className:`wui-notification-center-item-text`,children:e.text}),l&&/* @__PURE__ */ _(`time`,{className:`wui-notification-center-when`,dateTime:String(e.at),children:l})]})]}),d=n?t=>n(e,t):void 0;return e.href?/* @__PURE__ */ _(`a`,{className:i,href:e.href,"data-id":e.id,onClick:d,children:u}):/* @__PURE__ */ _(`button`,{type:`button`,className:i,"data-id":e.id,onClick:d,children:u})}export{S as default};
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"./AppTabs.js";import i from"./warnInvalidValue.js";import a from"./warnUnknownProps.js";import{NOTIFICATION_TEXT as o,groupNotificationsByDay as s,notificationCountText as c,notificationTime as l,notificationTriggerLabel as u,notificationUnreadAnnouncement as d}from"@webority/ui-elements/helpers";import{useEffect as f,useId as p,useLayoutEffect as m,useRef as h,useState as g}from"react";import{Fragment as _,jsx as v,jsxs as y}from"react/jsx-runtime";import"@webority/ui-elements/elements/notification-center";var b=[`all`,`unread`,`archived`],x={all:`All`,unread:`Unread`,archived:`Archived`},S=`a, button, input, select, textarea`;function C(e){let{marker:i,props:l}=t(`AppNotificationCenter`,e),{items:_,unread:b,label:x=o.label,emptyText:S=o.empty,viewAllHref:C,defaultOpen:O=!1,now:k,onMarkAllRead:A,onItemClick:j,renderItem:M,tabs:N,onTabChange:P,onOpenChange:F,linkComponent:I,className:L=``,...R}=l;if(a(`AppNotificationCenter`,R),!Array.isArray(_))throw Error(`<AppNotificationCenter> items is required: pass the notifications, newest first.`);let z=w(N),[B,V]=g(z[0]?.key),H=z.some(e=>e.key===B)?B:z[0]?.key,U=e=>{e!==H&&(V(e),P?.(e))},W=p(),G=p(),K=h(null),q=h(F);q.current=F,f(()=>{let e=K.current,t=e=>q.current?.(e.detail.open);return e.addEventListener(`wui:notification-center:toggle`,t),()=>e.removeEventListener(`wui:notification-center:toggle`,t)},[]);let J=h(O);m(()=>{if(!J.current)return;let e=K.current;e.setAttribute(`open`,``),e.querySelector(`.wui-notification-center-trigger`)?.setAttribute(`aria-expanded`,`true`)},[]);let Y=b??_.filter(e=>!e.read&&!e.archived).length,[X,Z]=g(``),Q=h(Y);f(()=>{Q.current!==Y&&(Q.current=Y,Z(d(Y)))},[Y]);let $=s(z.length>0?T(_,H):_,k),ee=[`wui-notification-center`,L].filter(Boolean).join(` `);return/* @__PURE__ */ y(`wui-notification-center`,{ref:K,class:ee,label:x,controlled:``,...i,...R,children:[/* @__PURE__ */ y(`button`,{type:`button`,className:`topbar-icon-btn wui-notification-center-trigger`,"aria-expanded":J.current?`true`:`false`,"aria-controls":W,"aria-haspopup":`dialog`,"aria-label":u(x,Y),children:[/* @__PURE__ */ v(n,{name:`notification`,size:20}),/* @__PURE__ */ v(`span`,{className:`wui-notification-center-count`,"aria-hidden":`true`,hidden:Y===0,children:c(Y)})]}),/* @__PURE__ */ v(`span`,{className:`visually-hidden wui-notification-center-live`,"aria-live":`polite`,children:X}),/* @__PURE__ */ y(`div`,{className:`wui-notification-center-panel`,id:W,role:`dialog`,"aria-labelledby":G,tabIndex:-1,children:[/* @__PURE__ */ y(`div`,{className:`wui-notification-center-head`,children:[/* @__PURE__ */ v(`h2`,{className:`wui-notification-center-title`,id:G,children:x}),A&&/* @__PURE__ */ v(`button`,{type:`button`,className:`wui-notification-center-markall`,disabled:Y===0,onClick:A,children:o.markAll})]}),z.length>0&&/* @__PURE__ */ v(`div`,{className:`wui-notification-center-tabs`,children:/* @__PURE__ */ v(r,{tabs:z,value:H,onChange:U,size:`sm`,fitted:!0,ariaLabel:x})}),$.length===0?/* @__PURE__ */ v(`p`,{className:`wui-notification-center-empty`,children:S}):/* @__PURE__ */ v(`div`,{className:`wui-notification-center-list`,children:$.map(e=>/* @__PURE__ */ y(`section`,{"aria-labelledby":`${W}-${e.key}`,children:[/* @__PURE__ */ v(`h3`,{className:`wui-notification-center-day`,id:`${W}-${e.key}`,children:e.heading}),/* @__PURE__ */ v(`ul`,{className:`wui-notification-center-items`,children:e.items.map(e=>/* @__PURE__ */ v(`li`,{children:/* @__PURE__ */ v(D,{item:e,onItemClick:j,renderItem:M,linkComponent:I})},e.id))})]},e.key))}),C&&/* @__PURE__ */ v(E,{href:C,linkComponent:I})]})]})}function w(e){return e===!0?b.map(e=>({key:e,label:x[e]})):Array.isArray(e)?e.map(e=>(i(`AppNotificationCenter`,`tabs[].key`,e.key,b),{key:e.key,label:e.label??x[e.key]})):[]}function T(e,t){if(t===`archived`)return e.filter(e=>e.archived);let n=e.filter(e=>!e.archived);return t===`unread`?n.filter(e=>!e.read):n}function E({href:t,linkComponent:n}){let{Tag:r,linkProps:i}=e(n,{href:t}),a=r===`a`?void 0:e=>e.currentTarget.closest(`wui-notification-center`)?.close?.();return/* @__PURE__ */ v(r,{className:`wui-notification-center-foot`,...i,onClick:a,children:o.viewAll})}function D({item:t,onItemClick:r,renderItem:i,linkComponent:a}){let s=`wui-notification-center-item${t.read?` wui-notification-center-item-read`:``}`,c=!t.read&&/* @__PURE__ */ v(`span`,{className:`visually-hidden wui-notification-center-unread-label`,children:o.unreadPrefix}),u=/* @__PURE__ */ v(`span`,{className:`wui-notification-center-dot`,"aria-hidden":`true`});if(i){let e=r?e=>{e.target.closest(S)||r(t,e)}:void 0;return/* @__PURE__ */ y(`div`,{className:s,"data-id":t.id,tabIndex:-1,onClick:e,children:[u,/* @__PURE__ */ y(`span`,{className:`wui-notification-center-body`,children:[c,i(t)]})]})}let d=l(t.at),f=/* @__PURE__ */ y(_,{children:[u,t.icon&&/* @__PURE__ */ v(`span`,{className:`wui-notification-center-icon`,children:/* @__PURE__ */ v(n,{name:t.icon,size:18})}),/* @__PURE__ */ y(`span`,{className:`wui-notification-center-body`,children:[c,/* @__PURE__ */ v(`span`,{className:`wui-notification-center-item-title`,children:t.title}),t.text&&/* @__PURE__ */ v(`span`,{className:`wui-notification-center-item-text`,children:t.text}),d&&/* @__PURE__ */ v(`time`,{className:`wui-notification-center-when`,dateTime:String(t.at),children:d})]})]}),p=r?e=>r(t,e):void 0;if(t.href){let{Tag:n,linkProps:i}=e(a,{href:t.href}),o=e=>{r?.(t,e),n!==`a`&&e.currentTarget.closest(`wui-notification-center`)?.close?.()};return/* @__PURE__ */ v(n,{className:s,...i,"data-id":t.id,onClick:o,children:f})}return/* @__PURE__ */ v(`button`,{type:`button`,className:s,"data-id":t.id,onClick:p,children:f})}export{C as default};
@@ -1 +1 @@
1
- import e from"../lib/FieldMessage.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./AppIcon.js";import r from"./AppInfoTip.js";import i from"./AppRequiredMark.js";import a from"./warnInvalidValue.js";import o from"./warnUnknownProps.js";import{forwardRef as s,useEffect as c,useId as l,useState as u}from"react";import{Form as d}from"react-bootstrap";import{jsx as f,jsxs as p}from"react/jsx-runtime";var m=[`sm`,`md`,`lg`],h=e=>{if(e===``||e===null)return null;let t=parseFloat(e);return Number.isNaN(t)?null:t},g=(e,t)=>t>0&&Number.isFinite(e)?e.toFixed(t):String(e??``),_=s(function(s,_){let{marker:v,props:y}=t(`AppNumberInput`,s),{label:b,required:x=!1,optional:S=!1,error:C,hint:w,help:T,helpLabel:E=`More information`,value:D,onChange:O,min:k,max:A,step:j=1,precision:M=0,unit:N,size:P=`md`,id:F,name:I,className:ee=``,fieldClassName:L=``,disabled:R=!1,readOnly:z=!1,...B}=y;o(`AppNumberInput`,B),a(`AppNumberInput`,`size`,P,m);let V=l(),H=F||V,U=e=>{if(M===0)return Math.round(e);let t=10**M;return Math.round(e*t)/t},W=e=>{let t=e;return typeof k==`number`&&(t=Math.max(t,k)),typeof A==`number`&&(t=Math.min(t,A)),t},G=e=>g(e,M),[K,q]=u(()=>G(D));c(()=>{q(e=>h(e)===(D??null)?e:g(D,M))},[D,M]);let J=e=>{let t=(h(K)??W(0))+e*j,n=W(U(t));q(G(n)),O?.(n)},Y=h(K),X=R||z||Y!==null&&typeof k==`number`&&Y<=k,Z=R||z||Y!==null&&typeof A==`number`&&Y>=A,Q=C&&H?`${H}-error`:void 0,$=w&&H?`${H}-hint`:void 0,te=Q||$,ne=[`input`,P===`sm`?`input-sm`:``,P===`lg`?`input-lg`:``,C?`error`:``,`num-input`,ee].filter(Boolean).join(` `),re=RegExp(`^${typeof k==`number`&&k>=0?``:`-?`}\\d*${M>0?`(\\.\\d*)?`:``}$`),ie=e=>{let t=e.target.value;if(!re.test(t))return;q(t);let n=h(t);n!==null&&O?.(n)},ae=e=>{if(z){B.onBlur?.(e);return}let t=h(e.target.value);if(t===null)q(``),O?.(null);else{let e=W(U(t));q(G(e)),O?.(e)}B.onBlur?.(e)},oe=e=>{z||(e.key===`ArrowUp`?(e.preventDefault(),J(1)):e.key===`ArrowDown`&&(e.preventDefault(),J(-1))),B.onKeyDown?.(e)},se=/* @__PURE__ */ f(d.Control,{...B,id:H,name:I,type:`text`,inputMode:M>0?`decimal`:`numeric`,className:ne,disabled:R,readOnly:z,required:x,"aria-invalid":C?`true`:`false`,"aria-describedby":te,value:K,ref:_,onChange:ie,onBlur:ae,onKeyDown:oe}),ce=[`num-wrap`,P===`sm`?`num-wrap-sm`:``,P===`lg`?`num-wrap-lg`:``].filter(Boolean).join(` `),le=/* @__PURE__ */ p(`div`,{className:ce,children:[/* @__PURE__ */ f(`button`,{type:`button`,className:`num-btn`,"aria-label":`Decrease`,tabIndex:-1,disabled:X,onClick:()=>J(-1),children:/* @__PURE__ */ f(n,{name:`minus`,size:16})}),se,N&&/* @__PURE__ */ f(`span`,{className:`affix`,children:N}),/* @__PURE__ */ f(`button`,{type:`button`,className:`num-btn`,"aria-label":`Increase`,tabIndex:-1,disabled:Z,onClick:()=>J(1),children:/* @__PURE__ */ f(n,{name:`plus`,size:16})})]});return/* @__PURE__ */ p(d.Group,{...v,className:`field${L?` ${L}`:``}`,children:[b&&/* @__PURE__ */ p(d.Label,{className:`label`,htmlFor:H,children:[b,S&&!x&&/* @__PURE__ */ f(`span`,{className:`label-optional`,children:` (optional)`}),x&&/* @__PURE__ */ f(i,{}),T&&/* @__PURE__ */ f(r,{label:E,children:T})]}),le,/* @__PURE__ */ f(e,{error:C,hint:w,errorId:Q,hintId:$})]})});export{_ as default};
1
+ import e from"../lib/FieldMessage.js";import{FIELD_BUSY_CLASS 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 ee from"./AppRequiredMark.js";import a from"./warnInvalidValue.js";import o from"./warnUnknownProps.js";import{forwardRef as s,useEffect as c,useId as l,useState as u}from"react";import{Form as d}from"react-bootstrap";import{jsx as f,jsxs as p}from"react/jsx-runtime";var m=[`sm`,`md`,`lg`],h=e=>{if(e===``||e===null)return null;let t=parseFloat(e);return Number.isNaN(t)?null:t},g=(e,t)=>t>0&&Number.isFinite(e)?e.toFixed(t):String(e??``),_=s(function(s,_){let{marker:v,props:y}=n(`AppNumberInput`,s),{label:b,required:x=!1,optional:S=!1,error:C,hint:w,help:T,helpLabel:te=`More information`,decreaseLabel:ne=`Decrease`,increaseLabel:E=`Increase`,optionalLabel:D=`(optional)`,value:O,onChange:k,min:A,max:j,step:M=1,precision:N=0,unit:P,size:F=`md`,id:re,name:ie,className:ae=``,fieldClassName:I=``,disabled:L=!1,readOnly:R=!1,loading:z=!1,defaultValue:B,...V}=y,H=R||z;o(`AppNumberInput`,V),a(`AppNumberInput`,`size`,F,m);let U=l(),W=re||U,G=e=>{if(N===0)return Math.round(e);let t=10**N;return Math.round(e*t)/t},K=e=>{let t=e;return typeof A==`number`&&(t=Math.max(t,A)),typeof j==`number`&&(t=Math.min(t,j)),t},q=e=>g(e,N),[J,Y]=u(()=>q(O??B));c(()=>{let e=O??B;Y(t=>h(t)===(e??null)?t:g(e,N))},[O,B,N]);let X=e=>{let t=(h(J)??K(0))+e*M,n=K(G(t));Y(q(n)),k?.(n)},Z=h(J),oe=L||R||z||Z!==null&&typeof A==`number`&&Z<=A,se=L||R||z||Z!==null&&typeof j==`number`&&Z>=j,Q=C&&W?`${W}-error`:void 0,$=w&&W?`${W}-hint`:void 0,ce=Q||$,le=[`input`,F===`sm`?`input-sm`:``,F===`lg`?`input-lg`:``,C?`error`:``,`num-input`,ae,z?t:``].filter(Boolean).join(` `),ue=RegExp(`^${typeof A==`number`&&A>=0?``:`-?`}\\d*${N>0?`(\\.\\d*)?`:``}$`),de=e=>{let t=e.target.value;if(!ue.test(t))return;Y(t);let n=h(t);n!==null&&k?.(n)},fe=e=>{if(H){V.onBlur?.(e);return}let t=h(e.target.value);if(t===null)Y(``),k?.(null);else{let e=K(G(t));Y(q(e)),k?.(e)}V.onBlur?.(e)},pe=e=>{H||(e.key===`ArrowUp`?(e.preventDefault(),X(1)):e.key===`ArrowDown`&&(e.preventDefault(),X(-1))),V.onKeyDown?.(e)},me=/* @__PURE__ */ f(d.Control,{...V,id:W,name:ie,type:`text`,inputMode:N>0?`decimal`:`numeric`,className:le,disabled:L,readOnly:H,"aria-busy":z||void 0,required:x,"aria-invalid":C?`true`:`false`,"aria-describedby":ce,value:J,ref:_,onChange:de,onBlur:fe,onKeyDown:pe}),he=[`num-wrap`,F===`sm`?`num-wrap-sm`:``,F===`lg`?`num-wrap-lg`:``].filter(Boolean).join(` `),ge=/* @__PURE__ */ p(`div`,{className:he,children:[/* @__PURE__ */ f(`button`,{type:`button`,className:`num-btn`,"aria-label":ne,tabIndex:-1,disabled:oe,onClick:()=>X(-1),children:/* @__PURE__ */ f(r,{name:`minus`,size:16})}),me,P&&/* @__PURE__ */ f(`span`,{className:`affix`,children:P}),/* @__PURE__ */ f(`button`,{type:`button`,className:`num-btn`,"aria-label":E,tabIndex:-1,disabled:se,onClick:()=>X(1),children:/* @__PURE__ */ f(r,{name:`plus`,size:16})})]});return/* @__PURE__ */ p(d.Group,{...v,className:`field${I?` ${I}`:``}`,children:[b&&/* @__PURE__ */ p(d.Label,{className:`label`,htmlFor:W,children:[b,S&&!x&&/* @__PURE__ */ f(`span`,{className:`label-optional`,children:` ${D}`}),x&&/* @__PURE__ */ f(ee,{}),T&&/* @__PURE__ */ f(i,{label:te,children:T})]}),ge,/* @__PURE__ */ f(e,{error:C,hint:w,errorId:Q,hintId:$})]})});export{_ as default};
@@ -1 +1 @@
1
- import e from"../lib/FieldMessage.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./AppRequiredMark.js";import r from"./useWuiControl.js";import i from"./warnInvalidValue.js";import a from"./warnUnknownProps.js";import{cloneElement as o,forwardRef as s,useId as c}from"react";import{jsx as l,jsxs as u}from"react/jsx-runtime";import"@webority/ui-elements/elements/otp";var d=[`numeric`,`alphanumeric`],f=s(function(s,f){let{marker:p,props:m}=t(`AppOtpInput`,s),{value:h,onChange:g,onComplete:_,length:v=6,mode:y=`numeric`,label:b,required:x=!1,optional:S=!1,hint:C,error:w,disabled:T=!1,name:E,id:D,className:O=``,fieldClassName:k=``,...A}=m;a(`AppOtpInput`,A),i(`AppOtpInput`,`mode`,y,d);let j=c(),M=D||j,N=w?`${M}-error`:void 0,P=C?`${M}-hint`:void 0,F=N||P,{setRef:I}=r({ref:f,value:h??``,onChange:g,on:{complete:e=>_?.(e.detail)}}),L=/* @__PURE__ */ l(`wui-otp`,{"aria-label":typeof b==`string`?b:void 0,ref:I,id:M,name:E,length:String(v),mode:y,"aria-describedby":F,"aria-invalid":w?`true`:void 0,disabled:T?``:void 0,required:x?``:void 0,className:O||void 0,...A});return!b&&!w&&!C?o(L,p):/* @__PURE__ */ u(`div`,{...p,className:`field${k?` ${k}`:``}`,children:[b&&/* @__PURE__ */ u(`label`,{className:`label`,htmlFor:M,children:[b,S&&!x&&/* @__PURE__ */ l(`span`,{className:`label-optional`,children:` (optional)`}),x&&/* @__PURE__ */ l(n,{})]}),L,/* @__PURE__ */ l(e,{error:w,hint:C,errorId:N,hintId:P})]})});export{f as default};
1
+ import e from"../lib/FieldMessage.js";import{FIELD_SIZES as t}from"../lib/fieldState.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./AppInfoTip.js";import i from"./AppRequiredMark.js";import a from"./useWuiControl.js";import o from"./warnInvalidValue.js";import s from"./warnUnknownProps.js";import{cloneElement as c,forwardRef as l,useId as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";import"@webority/ui-elements/elements/otp";var p=[`numeric`,`alphanumeric`],m=l(function(l,m){let{marker:h,props:g}=n(`AppOtpInput`,l),{value:_,defaultValue:v,onChange:y,onComplete:b,length:x=6,mode:S=`numeric`,size:C=`md`,label:w,required:T=!1,optional:E=!1,optionalLabel:D=`(optional)`,hint:O,help:k,helpLabel:A=`More information`,error:j,disabled:M=!1,readOnly:N=!1,loading:P=!1,name:F,id:I,className:L=``,fieldClassName:R=``,...z}=g;s(`AppOtpInput`,z),o(`AppOtpInput`,`mode`,S,p),o(`AppOtpInput`,`size`,C,t);let B=u(),V=I||B,H=j?`${V}-error`:void 0,U=O?`${V}-hint`:void 0,W=H||U,{setRef:G}=a({ref:m,value:_??(v===void 0?``:void 0),onChange:y,on:{complete:e=>b?.(e.detail)}}),K=/* @__PURE__ */ d(`wui-otp`,{"aria-label":typeof w==`string`?w:void 0,ref:G,id:V,name:F,length:String(x),mode:S,size:C===`md`?void 0:C,value:(_??v)||void 0,"aria-describedby":W,"aria-invalid":j?`true`:void 0,disabled:M?``:void 0,readonly:N?``:void 0,loading:P?``:void 0,required:T?``:void 0,className:L||void 0,...z});return!w&&!j&&!O?c(K,h):/* @__PURE__ */ f(`div`,{...h,className:`field${R?` ${R}`:``}`,children:[w&&/* @__PURE__ */ f(`label`,{className:`label`,htmlFor:V,children:[w,E&&!T&&/* @__PURE__ */ d(`span`,{className:`label-optional`,children:` ${D}`}),T&&/* @__PURE__ */ d(i,{}),k&&/* @__PURE__ */ d(r,{label:A,children:k})]}),K,/* @__PURE__ */ d(e,{error:j,hint:O,errorId:H,hintId:U})]})});export{m as default};
@@ -1 +1 @@
1
- import e from"../lib/FieldMessage.js";import{loadFlagStyles as t}from"../lib/flagStyles.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./AppRequiredMark.js";import i from"./useWuiControl.js";import a from"./warnInvalidValue.js";import o from"./warnUnknownProps.js";import{forwardRef as s,useEffect as c,useId as l}from"react";import{jsx as u,jsxs as d}from"react/jsx-runtime";import"@webority/ui-elements/elements/phone";var f=[`sm`,`md`,`lg`],p=s(function(s,p){let{marker:m,props:h}=n(`AppPhoneNumberInput`,s),{value:g,onChange:_,country:v,disabled:y=!1,name:b,id:x,label:S=`Phone number`,placeholder:C,required:w=!1,optional:T=!1,hint:E,error:D,showFlag:O=!0,showDialCode:k=!0,size:A=`md`,fieldClassName:j=``,...M}=h;o(`AppPhoneNumberInput`,M),a(`AppPhoneNumberInput`,`size`,A,f),c(()=>{O&&t()},[O]);let N=l(),P=x||N,F=D&&P?`${P}-error`:void 0,I=!D&&E&&P?`${P}-hint`:void 0,{setRef:L}=i({ref:p,value:g??``,onChange:_,events:[`input`,`change`]});return/* @__PURE__ */ d(`div`,{...m,className:`field app-phone-number-input${A===`sm`?` phone-sm`:``}${A===`lg`?` phone-lg`:``}${j?` ${j}`:``}`,children:[S&&/* @__PURE__ */ d(`label`,{className:`label`,htmlFor:P,children:[S,T&&!w&&/* @__PURE__ */ u(`span`,{className:`label-optional`,children:` (optional)`}),w&&/* @__PURE__ */ u(r,{})]}),/* @__PURE__ */ u(`wui-phone`,{ref:L,id:P,name:b,"aria-label":typeof S==`string`?S:void 0,"aria-describedby":F||I,"aria-invalid":D?`true`:void 0,country:v,placeholder:C,required:w?``:void 0,disabled:y?``:void 0,"hide-flag":O?void 0:``,"hide-dial":k?void 0:``,"external-error":``,...M}),/* @__PURE__ */ u(e,{error:D,hint:E,errorId:F,hintId:I})]})});export{p as default};
1
+ import e from"../lib/FieldMessage.js";import{loadFlagStyles as t}from"../lib/flagStyles.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./AppInfoTip.js";import i from"./AppRequiredMark.js";import a from"./useWuiControl.js";import o from"./warnInvalidValue.js";import s from"./warnUnknownProps.js";import{forwardRef as c,useEffect as l,useId as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";import"@webority/ui-elements/elements/phone";var p=[`sm`,`md`,`lg`],m=c(function(c,m){let{marker:h,props:g}=n(`AppPhoneNumberInput`,c),{value:_,onChange:v,country:y,lockedCountry:b,disabled:x=!1,readOnly:S=!1,loading:C=!1,defaultValue:w,help:T,helpLabel:E=`More information`,name:D,id:O,label:k=`Phone number`,placeholder:A,required:j=!1,optional:M=!1,optionalLabel:N=`(optional)`,hint:P,error:F,showFlag:I=!0,showDialCode:L=!0,size:R=`md`,fieldClassName:z=``,...B}=g;s(`AppPhoneNumberInput`,B),o(`AppPhoneNumberInput`,`size`,R,p),l(()=>{I&&t()},[I]);let V=u(),H=O||V,U=F&&H?`${H}-error`:void 0,W=!F&&P&&H?`${H}-hint`:void 0,{setRef:G}=a({ref:m,value:_??(w===void 0?``:void 0),defaultValue:w,onChange:v,events:[`input`,`change`]});return/* @__PURE__ */ f(`div`,{...h,className:`field app-phone-number-input${R===`sm`?` phone-sm`:``}${R===`lg`?` phone-lg`:``}${z?` ${z}`:``}`,children:[k&&/* @__PURE__ */ f(`label`,{className:`label`,htmlFor:H,children:[k,M&&!j&&/* @__PURE__ */ d(`span`,{className:`label-optional`,children:` ${N}`}),j&&/* @__PURE__ */ d(i,{}),T&&/* @__PURE__ */ d(r,{label:E,children:T})]}),/* @__PURE__ */ d(`wui-phone`,{ref:G,id:H,name:D,"aria-label":typeof k==`string`?k:void 0,"aria-describedby":U||W,"aria-invalid":F?`true`:void 0,country:b||y,"locked-country":b||void 0,placeholder:A,required:j?``:void 0,disabled:x?``:void 0,readonly:S?``:void 0,loading:C?``:void 0,"hide-flag":I?void 0:``,"hide-dial":L?void 0:``,"external-error":``,...B}),/* @__PURE__ */ d(e,{error:F,hint:P,errorId:U,hintId:W})]})});export{m as default};
@@ -1 +1 @@
1
- import e from"../lib/FocusPanel.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import{cloneElement as r,useEffect as i,useId as a,useRef as o,useState as s}from"react";import{OverlayTrigger as c,Popover as l}from"react-bootstrap";import{jsx as u,jsxs as d}from"react/jsx-runtime";var f={start:`left`,end:`right`,top:`top`,bottom:`bottom`,auto:`auto`},p={modifiers:[{name:`computeStyles`,options:{gpuAcceleration:!1}}]},m=[`dialog`];function h({trigger:h,children:g,title:_,placement:v=`bottom`,triggerType:y=`click`,onToggle:b,className:x=``,show:S,role:C,labelledBy:w,autoFocus:T=!1,openDelay:E=80,closeDelay:D=220,...O}){n(`AppPopover`,O),t(`AppPopover`,`role`,C,m);let k=a(),A=`${k}-title`,j=o(null),[M,N]=s(!1),P=S!==void 0,F=P?S:M,I=C===`dialog`,L=y===`hover`||Array.isArray(y)&&y.includes(`hover`),R=L&&!P,z=o(null),B=o(M);B.current=M;let V=()=>{clearTimeout(z.current),z.current=null},H=(e,t)=>{V(),z.current=setTimeout(()=>{z.current=null,e!==B.current&&(N(e),b?.(e))},t)};i(()=>()=>clearTimeout(z.current),[]),i(()=>{if(!R||!M)return;let e=e=>{e.key===`Escape`&&(clearTimeout(z.current),z.current=null,N(!1),b?.(!1))};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[R,M,b]);let U=e=>{R?H(e,e?E:D):(P||N(e),b?.(e))},W=I?{role:`dialog`,"aria-modal":`false`,"aria-labelledby":w??(_?A:void 0)}:{},G=R?{onMouseEnter:V,onMouseLeave:()=>H(!1,D),onFocus:V,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||H(!1,D)}}:{},K=/* @__PURE__ */ d(l,{id:k,className:x||void 0,...W,...G,children:[T&&/* @__PURE__ */ u(e,{triggerRef:j}),_&&/* @__PURE__ */ u(l.Header,{as:`div`,id:A,children:_}),g==null?null:/* @__PURE__ */ u(l.Body,{children:g})]}),{onClick:q,"aria-expanded":J,...Y}=O,X=h.props[`aria-expanded`],Z,Q=y===`click`||Array.isArray(y)&&y.includes(`click`);J===void 0?X===void 0?Q&&(Z=F):Z=X:Z=J;let $=r(h,{...Y,...Z===void 0?{}:{"aria-expanded":Z},onClick:e=>{j.current=e.currentTarget,q?.(e),typeof h.props.onClick==`function`&&h.props.onClick(e)}}),ee=y===`click`;return/* @__PURE__ */ u(c,{trigger:y,placement:f[v]||v,popperConfig:p,overlay:K,rootClose:ee||I,delay:P&&L?{show:E,hide:D}:void 0,onToggle:U,...P||L?{show:F}:{},children:$})}export{h as default};
1
+ import e from"../lib/FocusPanel.js";import t from"./warnInvalidValue.js";import ee from"./warnUnknownProps.js";import{cloneElement as n,useCallback as r,useEffect as i,useId as a,useRef as o,useState as s}from"react";import{OverlayTrigger as te,Popover as c}from"react-bootstrap";import{jsx as l,jsxs as u}from"react/jsx-runtime";var d={start:`left`,end:`right`,top:`top`,bottom:`bottom`,auto:`auto`},f={modifiers:[{name:`computeStyles`,options:{gpuAcceleration:!1}}]},p=[`dialog`];function m({trigger:m,children:h,title:g,placement:_=`bottom`,triggerType:v=`click`,onToggle:y,className:b=``,show:x,role:S,labelledBy:C,autoFocus:w=!1,openDelay:T=80,closeDelay:E=220,...D}){ee(`AppPopover`,D),t(`AppPopover`,`role`,S,p);let O=a(),k=`${O}-title`,A=o(null),[j,M]=s(null),N=m.props.ref,ne=r(e=>{M(e),typeof N==`function`?N(e):N&&(N.current=e)},[N]),[P,F]=s(!1),I=x!==void 0,L=I?x:P,R=S===`dialog`,z=v===`hover`||Array.isArray(v)&&v.includes(`hover`),B=z&&!I,V=L&&j!==null,H=o(null),U=o(P);U.current=P;let W=()=>{clearTimeout(H.current),H.current=null},G=(e,t)=>{W(),H.current=setTimeout(()=>{H.current=null,e!==U.current&&(F(e),y?.(e))},t)};i(()=>()=>clearTimeout(H.current),[]),i(()=>{if(!B||!P)return;let e=e=>{e.key===`Escape`&&(clearTimeout(H.current),H.current=null,F(!1),y?.(!1))};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[B,P,y]);let K=e=>{B?G(e,e?T:E):(I||F(e),y?.(e))},q=R?{role:`dialog`,"aria-modal":`false`,"aria-labelledby":C??(g?k:void 0)}:{},J=B?{onMouseEnter:W,onMouseLeave:()=>G(!1,E),onFocus:W,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||G(!1,E)}}:{},Y=/* @__PURE__ */ u(c,{id:O,className:b||void 0,...q,...J,children:[w&&/* @__PURE__ */ l(e,{triggerRef:A}),g&&/* @__PURE__ */ l(c.Header,{as:`div`,id:k,children:g}),h==null?null:/* @__PURE__ */ l(c.Body,{children:h})]}),{onClick:X,"aria-expanded":Z,...re}=D,Q=m.props[`aria-expanded`],$,ie=v===`click`||Array.isArray(v)&&v.includes(`click`);Z===void 0?Q===void 0?ie&&($=L):$=Q:$=Z;let ae=n(m,{...re,...$===void 0?{}:{"aria-expanded":$},ref:ne,onClick:e=>{A.current=e.currentTarget,X?.(e),typeof m.props.onClick==`function`&&m.props.onClick(e)}}),oe=v===`click`;return/* @__PURE__ */ l(te,{trigger:v,placement:d[_]||_,popperConfig:f,overlay:Y,rootClose:oe||R,delay:I&&z?{show:T,hide:E}:void 0,onToggle:K,...I||z?{show:V}:{},children:ae})}export{m as default};
@@ -1 +1 @@
1
- import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import{cloneElement as r}from"react";import{jsx as i,jsxs as a}from"react/jsx-runtime";var o=[`sm`,`md`],s=[`info`,`success`,`warning`,`danger`,`neutral`];function c(e,t){if(!(t>0))return 0;let n=Math.min(100,Math.max(0,e/t*100));return Number(n.toFixed(2))}function l(l){let{marker:u,props:d}=e(`AppProgress`,l),{value:f=0,max:p=100,tone:m=`info`,size:h=`md`,label:g,showLabel:_=!1,striped:v=!1,animated:y=!1,indeterminate:b=!1,className:x=``,...S}=d;n(`AppProgress`,S),t(`AppProgress`,`tone`,m,s),t(`AppProgress`,`size`,h,o);let C=s.includes(m)?m:`info`,w=c(f,p),T=!b&&_&&!!g,E=`progress${h===`sm`?` progress-sm`:``}${!T&&x?` ${x}`:``}`,D=[`progress-bar`,`wui-progress-${C}`,v||y?`progress-bar-striped`:``,y?`progress-bar-animated`:``,b?`wui-progress-indeterminate`:``].filter(Boolean).join(` `),O=/* @__PURE__ */ i(`div`,{className:E,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":p,...b?{}:{"aria-valuenow":f},"aria-label":g||void 0,...S,children:/* @__PURE__ */ i(`div`,{className:D,style:b?void 0:{width:`${w}%`}})});return T?/* @__PURE__ */ a(`div`,{...u,className:`wui-progress-labelled${x?` ${x}`:``}`,children:[/* @__PURE__ */ i(`div`,{className:`wui-progress-label`,"aria-hidden":`true`,children:g}),O]}):r(O,u)}export{l as default};
1
+ import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import{cloneElement as r}from"react";import{jsx as i,jsxs as a}from"react/jsx-runtime";var o=[`sm`,`md`],s=[`primary`,`info`,`success`,`warning`,`danger`,`neutral`];function c(e,t){if(!(t>0))return 0;let n=Math.min(100,Math.max(0,e/t*100));return Number(n.toFixed(2))}function l(l){let{marker:u,props:d}=e(`AppProgress`,l),{value:f=0,max:p=100,tone:m=`info`,size:h=`md`,label:g,showLabel:_=!1,striped:v=!1,animated:y=!1,indeterminate:b=!1,className:x=``,...S}=d;n(`AppProgress`,S),t(`AppProgress`,`tone`,m,s),t(`AppProgress`,`size`,h,o);let C=s.includes(m)?m:`info`,w=c(f,p),T=!b&&_&&!!g,E=`progress${h===`sm`?` progress-sm`:``}${!T&&x?` ${x}`:``}`,D=[`progress-bar`,`wui-progress-${C}`,v||y?`progress-bar-striped`:``,y?`progress-bar-animated`:``,b?`wui-progress-indeterminate`:``].filter(Boolean).join(` `),O=/* @__PURE__ */ i(`div`,{className:E,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":p,...b?{}:{"aria-valuenow":f},"aria-label":g||void 0,...S,children:/* @__PURE__ */ i(`div`,{className:D,style:b?void 0:{width:`${w}%`}})});return T?/* @__PURE__ */ a(`div`,{...u,className:`wui-progress-labelled${x?` ${x}`:``}`,children:[/* @__PURE__ */ i(`div`,{className:`wui-progress-label`,"aria-hidden":`true`,children:g}),O]}):r(O,u)}export{l as default};
@@ -1 +1 @@
1
- import e from"../lib/CheckField.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./warnUnknownProps.js";import{forwardRef as r}from"react";import{jsx as i}from"react/jsx-runtime";var a=r(function(r,a){let{marker:o,props:s}=t(`AppRadio`,r),{label:c,id:l,name:u,error:d,hint:f,className:p=``,...m}=s;return n(`AppRadio`,m),/* @__PURE__ */ i(e,{rootProps:o,ref:a,label:c,id:l,name:u,error:d,hint:f,className:p,rest:m,inputType:`radio`,wrapperClass:`form-check`})});export{a as default};
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"./warnInvalidValue.js";import a from"./warnUnknownProps.js";import{forwardRef as o}from"react";import{jsx as s}from"react/jsx-runtime";var c=o(function(o,c){let{marker:l,props:u}=r(`AppRadio`,o),{label:d,id:f,name:p,error:m,hint:h,help:g,helpLabel:_=`More information`,className:v=``,readOnly:y=!1,loading:b=!1,size:x=`md`,...S}=u;return a(`AppRadio`,S),i(`AppRadio`,`size`,x,t),/* @__PURE__ */ s(e,{rootProps:l,ref:c,label:n(d,g,_),id:f,name:p,error:m,hint:h,className:v,rest:S,inputType:`radio`,wrapperClass:`form-check`,readOnly:y,loading:b,size:x})});export{c as default};
@@ -1 +1 @@
1
- import e from"../lib/FieldMessage.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./AppInfoTip.js";import r from"./AppRequiredMark.js";import i from"./warnInvalidValue.js";import a from"./warnUnknownProps.js";import{useId as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";var l=[`default`,`card`];function u(u){let{marker:d,props:f}=t(`AppRadioGroup`,u),{label:p,options:m=[],name:h,value:g,defaultValue:_,onChange:v,variant:y=`default`,inline:b=!1,required:x=!1,optional:S=!1,disabled:C=!1,error:w,hint:T,help:E,helpLabel:D=`More information`,id:O,className:k=``,fieldClassName:A=``,style:j,...M}=f;a(`AppRadioGroup`,M),i(`AppRadioGroup`,`variant`,y,l);let N=o(),P=O||N,F=h||P,I=`${P}-error`,L=`${P}-hint`,R=g!==void 0;return/* @__PURE__ */ c(`div`,{...d,className:`field${A?` ${A}`:``}`,children:[p!=null&&/* @__PURE__ */ c(`span`,{className:`label`,id:`${P}-label`,children:[p,S&&!x&&/* @__PURE__ */ s(`span`,{className:`label-optional`,children:` (optional)`}),x&&/* @__PURE__ */ s(r,{}),E&&/* @__PURE__ */ s(n,{label:D,children:E})]}),/* @__PURE__ */ s(`div`,{className:[`wui-radio-group`,y===`card`?`wui-radio-group-card`:``,b?`wui-radio-group-inline`:``,k].filter(Boolean).join(` `),style:j,id:P,role:`radiogroup`,"aria-labelledby":p==null?void 0:`${P}-label`,"aria-required":x?`true`:void 0,"aria-invalid":w?`true`:void 0,"aria-describedby":w?I:T?L:void 0,...M,children:m.map((e,t)=>{let n=`${P}-${t}`,r=e.description==null?void 0:`${n}-desc`;return/* @__PURE__ */ c(`div`,{className:`form-check`,children:[/* @__PURE__ */ s(`input`,{type:`radio`,className:`form-check-input`,id:n,name:F,value:e.value,disabled:C||e.disabled||void 0,required:x||void 0,"aria-describedby":r,...R?{checked:g===e.value,onChange:()=>v?.(e.value)}:{defaultChecked:_===e.value,onChange:()=>v?.(e.value)}}),/* @__PURE__ */ s(`label`,{className:`form-check-label`,htmlFor:n,children:e.label}),r&&/* @__PURE__ */ s(`div`,{className:`wui-radio-option-desc`,id:r,children:e.description})]},e.value)})}),/* @__PURE__ */ s(e,{error:w,hint:T,errorId:I,hintId:L})]})}export{u as default};
1
+ import e from"../lib/FieldMessage.js";import{FIELD_BUSY_CLASS as t,FIELD_SIZES as n,blockWhenReadOnly as r}from"../lib/fieldState.js";import{splitMarkerProps as i}from"../lib/wuiMarker.js";import a from"./AppInfoTip.js";import o from"./AppRequiredMark.js";import s from"./warnInvalidValue.js";import c from"./warnUnknownProps.js";import{useId as l}from"react";import{jsx as u,jsxs as d}from"react/jsx-runtime";var f=[`default`,`card`];function p(p){let{marker:m,props:h}=i(`AppRadioGroup`,p),{label:g,options:_=[],name:v,value:y,defaultValue:b,onChange:x,variant:S=`default`,inline:C=!1,required:w=!1,optional:T=!1,optionalLabel:E=`(optional)`,disabled:D=!1,readOnly:O=!1,loading:k=!1,size:A=`md`,error:j,hint:M,help:N,helpLabel:P=`More information`,id:F,className:I=``,fieldClassName:L=``,style:R,...z}=h;c(`AppRadioGroup`,z),s(`AppRadioGroup`,`variant`,S,f),s(`AppRadioGroup`,`size`,A,n);let B=A===`sm`?` form-check-sm`:A===`lg`?` form-check-lg`:``,V=l(),H=F||V,U=v||H,W=`${H}-error`,G=`${H}-hint`,K=y!==void 0;return/* @__PURE__ */ d(`div`,{...m,className:`field${L?` ${L}`:``}`,children:[g!=null&&/* @__PURE__ */ d(`span`,{className:`label`,id:`${H}-label`,children:[g,T&&!w&&/* @__PURE__ */ u(`span`,{className:`label-optional`,children:` ${E}`}),w&&/* @__PURE__ */ u(o,{}),N&&/* @__PURE__ */ u(a,{label:P,children:N})]}),/* @__PURE__ */ u(`div`,{className:[`wui-radio-group`,S===`card`?`wui-radio-group-card`:``,C?`wui-radio-group-inline`:``,I].filter(Boolean).join(` `),style:R,id:H,role:`radiogroup`,"aria-labelledby":g==null?void 0:`${H}-label`,"aria-required":w?`true`:void 0,"aria-readonly":O||void 0,"aria-busy":k||void 0,"aria-invalid":j?`true`:void 0,"aria-describedby":j?W:M?G:void 0,...z,children:_.map((e,n)=>{let i=`${H}-${n}`,a=e.description==null?void 0:`${i}-desc`;return/* @__PURE__ */ d(`div`,{className:`form-check${B}`,children:[/* @__PURE__ */ u(`input`,{type:`radio`,className:k?`form-check-input ${t}`:`form-check-input`,id:i,name:U,value:e.value,disabled:D||e.disabled||void 0,required:w||void 0,"aria-describedby":a,"aria-readonly":O||void 0,"aria-busy":k||void 0,onClick:r(O||k),...K?{checked:y===e.value,onChange:()=>x?.(e.value)}:{defaultChecked:b===e.value,onChange:()=>x?.(e.value)}}),/* @__PURE__ */ u(`label`,{className:`form-check-label`,htmlFor:i,children:e.label}),a&&/* @__PURE__ */ u(`div`,{className:`wui-radio-option-desc`,id:a,children:e.description})]},e.value)})}),/* @__PURE__ */ u(e,{error:j,hint:M,errorId:W,hintId:G})]})}export{p as default};
@@ -1 +1 @@
1
- import e from"../lib/FieldMessage.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./AppIcon.js";import r from"./AppRequiredMark.js";import i from"./warnInvalidValue.js";import a from"./warnUnknownProps.js";import{useId as o,useState as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";import"@webority/ui-elements/elements/rating";var u={sm:16,md:20,lg:28},d=e=>String(Math.round(e*100)/100),f=(e,t,n)=>e>=t?`full`:n&&e>=t-.5?`half`:`empty`;function p(n){let{marker:p,props:h}=t(`AppRating`,n),{value:g,defaultValue:_,onChange:v,max:y=5,readOnly:b=!1,half:x=!1,showValue:S=!1,size:C=`md`,label:w,name:T,required:E=!1,disabled:D=!1,error:O,hint:k,id:A,className:j=``,fieldClassName:M=``,...N}=h;a(`AppRating`,N),i(`AppRating`,`size`,C,Object.keys(u));let P=o(),[F,I]=s(_),L=u[C]??u.md,R=Array.from({length:y},(e,t)=>t+1),z=(...e)=>[`wui-rating`,`wui-rating-${C}`,...e,j].filter(Boolean).join(` `);if(b){let e=Number.isFinite(Number(g))?Math.min(Math.max(Number(g),0),y):0,t=x?Math.round(e*2)/2:Math.round(e),n=`${typeof w==`string`&&w?`${w}: `:``}${d(e)} out of ${y}`;return/* @__PURE__ */ l(`span`,{className:z(`wui-rating-display`),id:A,role:`img`,"aria-label":n,...p,...N,children:[/* @__PURE__ */ c(`span`,{className:`wui-rating-stars`,"aria-hidden":`true`,children:R.map(e=>/* @__PURE__ */ c(`span`,{className:`wui-rating-star wui-rating-star-${f(t,e,x)}`,children:/* @__PURE__ */ c(m,{px:L})},e))}),S&&/* @__PURE__ */ c(`span`,{className:`wui-rating-value`,"aria-hidden":`true`,children:d(e)})]})}let B=A||P,V=T||B,H=`${B}-error`,U=`${B}-hint`,W=Math.round(Number(g===void 0?F:g))||0,G=e=>{I(e),v?.(e)};return/* @__PURE__ */ l(`div`,{...p,className:`field${M?` ${M}`:``}`,children:[w!=null&&/* @__PURE__ */ l(`span`,{className:`label`,id:`${B}-label`,children:[w,E&&/* @__PURE__ */ c(r,{})]}),/* @__PURE__ */ c(`wui-rating`,{class:z(`wui-rating-input`),id:B,role:`radiogroup`,"aria-labelledby":w==null?void 0:`${B}-label`,"aria-label":w==null?`Rating`:void 0,"aria-required":E?`true`:void 0,"aria-invalid":O?`true`:void 0,"aria-describedby":O?H:k?U:void 0,disabled:D?``:void 0,...N,children:R.map(e=>/* @__PURE__ */ l(`label`,{className:`wui-rating-star wui-rating-star-${W>=e?`full`:`empty`}`,"data-value":e,children:[/* @__PURE__ */ c(`input`,{type:`radio`,className:`visually-hidden`,name:V,value:e,"aria-label":`${e} ${e===1?`star`:`stars`}`,checked:W===e,onChange:()=>G(e),disabled:D||void 0,required:E||void 0}),/* @__PURE__ */ c(m,{px:L})]},e))}),/* @__PURE__ */ c(e,{error:O,hint:k,errorId:H,hintId:U})]})}function m({px:e}){return/* @__PURE__ */ l(`span`,{className:`wui-rating-glyphs`,"aria-hidden":`true`,children:[/* @__PURE__ */ c(n,{name:`star`,size:e}),/* @__PURE__ */ c(`span`,{className:`wui-rating-fill`,children:/* @__PURE__ */ c(n,{name:`star`,variant:`bold`,size:e})})]})}export{p as default};
1
+ import e from"../lib/FieldMessage.js";import{blockWhenReadOnly as t}from"../lib/fieldState.js";import n from"../lib/fillLabel.js";import{splitMarkerProps as r}from"../lib/wuiMarker.js";import i from"./AppIcon.js";import ee from"./AppInfoTip.js";import a from"./AppRequiredMark.js";import o from"./warnInvalidValue.js";import s from"./warnUnknownProps.js";import{useId as c,useState as l}from"react";import{jsx as u,jsxs as d}from"react/jsx-runtime";import"@webority/ui-elements/elements/rating";var f={sm:16,md:20,lg:28},p=e=>String(Math.round(e*100)/100),m=(e,t,n)=>e>=t?`full`:n&&e>=t-.5?`half`:`empty`;function h(i){let{marker:h,props:_}=r(`AppRating`,i),{value:v,defaultValue:y,onChange:b,max:x=5,readOnly:S=!1,half:C=!1,showValue:w=!1,size:T=`md`,label:E,help:D,helpLabel:O=`More information`,ratingLabel:k=`Rating`,starLabel:A=`{count} star`,starsLabel:j=`{count} stars`,valueText:M=`{value} out of {max}`,name:N,required:P=!1,disabled:F=!1,loading:I=!1,error:L,hint:R,id:z,className:B=``,fieldClassName:V=``,...H}=_;s(`AppRating`,H),o(`AppRating`,`size`,T,Object.keys(f));let U=c(),[W,G]=l(y),K=f[T]??f.md,q=Array.from({length:x},(e,t)=>t+1),J=(...e)=>[`wui-rating`,`wui-rating-${T}`,...e,B].filter(Boolean).join(` `);if(S){let e=v===void 0?W:v,t=Number.isFinite(Number(e))?Math.min(Math.max(Number(e),0),x):0,r=C?Math.round(t*2)/2:Math.round(t),i=`${typeof E==`string`&&E?`${E}: `:``}${n(M,{value:p(t),max:x})}`;return/* @__PURE__ */ d(`span`,{className:J(`wui-rating-display`,I&&`wui-field-busy`),id:z,role:`img`,"aria-label":i,"aria-busy":I||void 0,...h,...H,children:[/* @__PURE__ */ u(`span`,{className:`wui-rating-stars`,"aria-hidden":`true`,children:q.map(e=>/* @__PURE__ */ u(`span`,{className:`wui-rating-star wui-rating-star-${m(r,e,C)}`,children:/* @__PURE__ */ u(g,{px:K})},e))}),w&&/* @__PURE__ */ u(`span`,{className:`wui-rating-value`,"aria-hidden":`true`,children:p(t)})]})}let Y=z||U,X=N||Y,Z=`${Y}-error`,Q=`${Y}-hint`,$=Math.round(Number(v===void 0?W:v))||0,te=e=>{I||(G(e),b?.(e))};return/* @__PURE__ */ d(`div`,{...h,className:`field${V?` ${V}`:``}`,children:[E!=null&&/* @__PURE__ */ d(`span`,{className:`label`,id:`${Y}-label`,children:[E,P&&/* @__PURE__ */ u(a,{}),D&&/* @__PURE__ */ u(ee,{label:O,children:D})]}),/* @__PURE__ */ u(`wui-rating`,{class:J(`wui-rating-input`,I&&`wui-field-busy`),id:Y,role:`radiogroup`,"aria-busy":I?`true`:void 0,"aria-labelledby":E==null?void 0:`${Y}-label`,"aria-label":E==null?k:void 0,"aria-required":P?`true`:void 0,"aria-invalid":L?`true`:void 0,"aria-describedby":L?Z:R?Q:void 0,disabled:F?``:void 0,...H,children:q.map(e=>/* @__PURE__ */ d(`label`,{className:`wui-rating-star wui-rating-star-${$>=e?`full`:`empty`}`,"data-value":e,children:[/* @__PURE__ */ u(`input`,{type:`radio`,className:`visually-hidden`,name:X,value:e,"aria-label":n(e===1?A:j,{count:e}),checked:$===e,onChange:()=>te(e),onClick:t(S||I),disabled:F||void 0,required:P||void 0}),/* @__PURE__ */ u(g,{px:K})]},e))}),/* @__PURE__ */ u(e,{error:L,hint:R,errorId:Z,hintId:Q})]})}function g({px:e}){return/* @__PURE__ */ d(`span`,{className:`wui-rating-glyphs`,"aria-hidden":`true`,children:[/* @__PURE__ */ u(i,{name:`star`,size:e}),/* @__PURE__ */ u(`span`,{className:`wui-rating-fill`,children:/* @__PURE__ */ u(i,{name:`star`,variant:`bold`,size:e})})]})}export{h as default};
@@ -1 +1 @@
1
- import{devWarn as e}from"../lib/devWarn.js";import t from"../lib/FieldMessage.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./AppInfoTip.js";import i from"./AppRequiredMark.js";import a from"./useWuiControl.js";import o from"./warnInvalidValue.js";import s from"./warnUnknownProps.js";import{forwardRef as c,useEffect as l,useId as u,useState as d}from"react";import{jsx as f,jsxs as p}from"react/jsx-runtime";var m=[`html`,`markdown`],h=[`input`,`change`],g=`The editor couldn't load. Reload the page and try again.`,_=c(function(c,_){let{marker:v,props:y}=n(`AppRichText`,c),{value:b,onChange:x,format:S,placeholder:C,name:w,label:T,error:E,hint:D,required:O=!1,disabled:k=!1,readOnly:A=!1,id:j,ariaLabel:M,className:N=``,fieldClassName:P=``,help:F,helpLabel:I=`More information`,...L}=y;s(`AppRichText`,L),o(`AppRichText`,`format`,S,m);let R=u(),z=j||R,[B,V]=d(!1),{setRef:H}=a({ref:_,value:b,onChange:x,events:h});return l(()=>{let t=!0;return import(`@webority/ui-elements/rich-text`).catch(n=>{e(`[AppRichText] the editor failed to load:`,n?.message),t&&V(!0)}),()=>{t=!1}},[]),/* @__PURE__ */ p(`div`,{...v,className:`field${P?` ${P}`:``}`,children:[T&&/* @__PURE__ */ p(`label`,{className:`label`,htmlFor:z,children:[T,O&&/* @__PURE__ */ f(i,{}),F&&/* @__PURE__ */ f(r,{label:I,children:F})]}),B?/* @__PURE__ */ f(`div`,{className:`field-error`,role:`status`,children:g}):/* @__PURE__ */ f(`wui-rich-text`,{ref:H,id:z,role:`group`,name:w,format:S||void 0,placeholder:C,"aria-label":M||(typeof T==`string`?T:void 0),"aria-describedby":E?`${z}-error`:D?`${z}-hint`:void 0,"aria-invalid":E?`true`:void 0,required:O?``:void 0,disabled:k?``:void 0,readonly:A?``:void 0,className:N||void 0,...L},S||`html`),/* @__PURE__ */ f(t,{error:E,hint:D,errorId:`${z}-error`,hintId:`${z}-hint`})]})});export{_ as default};
1
+ import{devWarn as e}from"../lib/devWarn.js";import t from"../lib/FieldMessage.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./AppInfoTip.js";import i from"./AppRequiredMark.js";import a from"./useWuiControl.js";import o from"./warnInvalidValue.js";import s from"./warnUnknownProps.js";import{forwardRef as c,useEffect as l,useId as u,useState as d}from"react";import{jsx as f,jsxs as p}from"react/jsx-runtime";var m=[`html`,`markdown`],h=[`input`,`change`],g=`The editor couldn't load. Reload the page and try again.`,_=c(function(c,_){let{marker:v,props:y}=n(`AppRichText`,c),{value:b,onChange:x,format:S,placeholder:C,name:w,label:T,error:E,hint:D,required:O=!1,disabled:k=!1,readOnly:A=!1,loading:j=!1,defaultValue:M,id:N,ariaLabel:P,className:F=``,fieldClassName:I=``,help:L,helpLabel:R=`More information`,...z}=y;s(`AppRichText`,z),o(`AppRichText`,`format`,S,m);let B=u(),V=N||B,[H,U]=d(!1),{setRef:W}=a({ref:_,value:b,defaultValue:M,onChange:x,events:h});return l(()=>{let t=!0;return import(`@webority/ui-elements/rich-text`).catch(n=>{e(`[AppRichText] the editor failed to load:`,n?.message),t&&U(!0)}),()=>{t=!1}},[]),/* @__PURE__ */ p(`div`,{...v,className:`field${I?` ${I}`:``}`,children:[T&&/* @__PURE__ */ p(`label`,{className:`label`,htmlFor:V,children:[T,O&&/* @__PURE__ */ f(i,{}),L&&/* @__PURE__ */ f(r,{label:R,children:L})]}),H?/* @__PURE__ */ f(`div`,{className:`field-error`,role:`status`,children:g}):/* @__PURE__ */ f(`wui-rich-text`,{ref:W,id:V,role:`group`,name:w,format:S||void 0,placeholder:C,"aria-label":P||(typeof T==`string`?T:void 0),"aria-describedby":E?`${V}-error`:D?`${V}-hint`:void 0,"aria-invalid":E?`true`:void 0,required:O?``:void 0,disabled:k?``:void 0,readonly:A?``:void 0,loading:j?``:void 0,className:F||void 0,...z},S||`html`),/* @__PURE__ */ f(t,{error:E,hint:D,errorId:`${V}-error`,hintId:`${V}-hint`})]})});export{_ as default};
@@ -1 +1 @@
1
- import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./AppButton.js";import n from"./AppResult.js";import r from"./warnInvalidValue.js";import i from"./warnUnknownProps.js";import{Fragment as a,jsx as o,jsxs as s}from"react/jsx-runtime";var c=[`error`,`stale-build`,`not-found`],l=()=>window.location.reload();function u(u){let{marker:d,props:f}=e(`AppRouteError`,u),{kind:p=`error`,homeHref:m=`/`,onRetry:h=l,brand:g,fullPage:_=!0,children:v,className:y=``,...b}=f;i(`AppRouteError`,b),r(`AppRouteError`,`kind`,p,c);let x=e=>/* @__PURE__ */ o(t,{variant:e,leftIcon:`home`,href:m,children:`Go to the home page`}),S;return S=p===`stale-build`?/* @__PURE__ */ o(n,{status:`info`,icon:`refresh-cw`,title:`A new version is ready`,subtitle:`This app was updated while you had it open. Reload to get the new version.`,actions:/* @__PURE__ */ o(t,{variant:`primary`,leftIcon:`refresh-cw`,onClick:h,children:`Reload`}),children:v}):p===`not-found`?/* @__PURE__ */ o(n,{status:`404`,title:`We could not find that page`,subtitle:`Check the address, or go to the home page.`,actions:x(`primary`),children:v}):/* @__PURE__ */ o(n,{status:`500`,title:`This page did not load`,subtitle:`Something went wrong on our side. Try again in a moment.`,actions:/* @__PURE__ */ s(a,{children:[/* @__PURE__ */ o(t,{variant:`primary`,leftIcon:`refresh-cw`,onClick:h,children:`Try again`}),x(`outline`)]}),children:v}),/* @__PURE__ */ s(`div`,{className:[_?`d-flex flex-column align-items-center justify-content-center min-vh-100 px-3`:`d-flex flex-column align-items-center py-5 px-3`,y].filter(Boolean).join(` `),...d,...b,children:[g&&/* @__PURE__ */ o(`div`,{className:`mb-4`,children:g}),/* @__PURE__ */ o(`div`,{className:`col-12 col-md-8 col-lg-6`,children:S})]})}export{u as default};
1
+ import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./AppButton.js";import n from"./AppResult.js";import r from"./warnInvalidValue.js";import i from"./warnUnknownProps.js";import{Fragment as a,jsx as o,jsxs as s}from"react/jsx-runtime";var c=[`error`,`stale-build`,`not-found`],l=()=>window.location.reload();function u(u){let{marker:d,props:f}=e(`AppRouteError`,u),{kind:p=`error`,homeHref:m=`/`,onRetry:h=l,brand:g,fullPage:_=!0,homeLabel:v=`Go to the home page`,reloadLabel:y=`Reload`,retryLabel:b=`Try again`,staleTitle:x=`A new version is ready`,staleText:S=`This app was updated while you had it open. Reload to get the new version.`,notFoundTitle:C=`We could not find that page`,notFoundText:w=`Check the address, or go to the home page.`,errorTitle:T=`This page did not load`,errorText:E=`Something went wrong on our side. Try again in a moment.`,children:D,className:O=``,...k}=f;i(`AppRouteError`,k),r(`AppRouteError`,`kind`,p,c);let A=e=>/* @__PURE__ */ o(t,{variant:e,leftIcon:`home`,href:m,children:v}),j;return j=p===`stale-build`?/* @__PURE__ */ o(n,{status:`info`,icon:`refresh-cw`,title:x,subtitle:S,actions:/* @__PURE__ */ o(t,{variant:`primary`,leftIcon:`refresh-cw`,onClick:h,children:y}),children:D}):p===`not-found`?/* @__PURE__ */ o(n,{status:`404`,title:C,subtitle:w,actions:A(`primary`),children:D}):/* @__PURE__ */ o(n,{status:`500`,title:T,subtitle:E,actions:/* @__PURE__ */ s(a,{children:[/* @__PURE__ */ o(t,{variant:`primary`,leftIcon:`refresh-cw`,onClick:h,children:b}),A(`outline`)]}),children:D}),/* @__PURE__ */ s(`div`,{className:[_?`d-flex flex-column align-items-center justify-content-center min-vh-100 px-3`:`d-flex flex-column align-items-center py-5 px-3`,O].filter(Boolean).join(` `),...d,...k,children:[g&&/* @__PURE__ */ o(`div`,{className:`mb-4`,children:g}),/* @__PURE__ */ o(`div`,{className:`col-12 col-md-8 col-lg-6`,children:j})]})}export{u as default};
@@ -1 +1 @@
1
- import e from"../lib/FieldMessage.js";import{wuiMarkerAttributes as t}from"../lib/wuiMarker.js";import{useId as n}from"react";import{jsx as r,jsxs as i}from"react/jsx-runtime";function a(a){let{value:o=null,onChange:s,min:c=0,max:l=10,label:u,lowLabel:d,highLabel:f,name:p,disabled:m=!1,error:h,hint:g,id:_,className:v=``,fieldClassName:y=``}=a,b=n(),x=_||b,S=p||x,C=`${x}-error`,w=`${x}-hint`,T=Array.from({length:Math.max(0,l-c+1)},(e,t)=>c+t),E=d!=null||f!=null;return/* @__PURE__ */ i(`div`,{...t(`AppScoreScale`,a),className:`field${y?` ${y}`:``}`,children:[u!=null&&/* @__PURE__ */ r(`span`,{className:`label`,id:`${x}-label`,children:u}),/* @__PURE__ */ i(`div`,{className:`wui-score-scale${v?` ${v}`:``}`,id:x,role:`radiogroup`,"aria-labelledby":u==null?void 0:`${x}-label`,"aria-label":u==null?`Score`:void 0,"aria-invalid":h?`true`:void 0,"aria-describedby":h?C:g?w:void 0,children:[T.map(e=>/* @__PURE__ */ i(`label`,{className:`wui-score-scale__item${o===e?` wui-score-scale__item--selected`:``}`,children:[/* @__PURE__ */ r(`input`,{type:`radio`,className:`visually-hidden`,name:S,value:e,checked:o===e,disabled:m,onChange:()=>s?.(e)}),e]},e)),E&&/* @__PURE__ */ i(`span`,{className:`wui-score-scale__ends`,children:[/* @__PURE__ */ r(`span`,{children:d}),/* @__PURE__ */ r(`span`,{children:f})]})]}),/* @__PURE__ */ r(e,{error:h,hint:g,errorId:C,hintId:w})]})}export{a as default};
1
+ import e from"../lib/FieldMessage.js";import{wuiMarkerAttributes as t}from"../lib/wuiMarker.js";import{useId as n}from"react";import{jsx as r,jsxs as i}from"react/jsx-runtime";function a(a){let{value:o=null,onChange:s,min:c=0,max:l=10,label:u,lowLabel:d,highLabel:f,name:p,disabled:m=!1,error:h,hint:g,id:_,className:v=``,fieldClassName:y=``,scoreLabel:b=`Score`}=a,x=n(),S=_||x,C=p||S,w=`${S}-error`,T=`${S}-hint`,E=Array.from({length:Math.max(0,l-c+1)},(e,t)=>c+t),D=d!=null||f!=null;return/* @__PURE__ */ i(`div`,{...t(`AppScoreScale`,a),className:`field${y?` ${y}`:``}`,children:[u!=null&&/* @__PURE__ */ r(`span`,{className:`label`,id:`${S}-label`,children:u}),/* @__PURE__ */ i(`div`,{className:`wui-score-scale${v?` ${v}`:``}`,id:S,role:`radiogroup`,"aria-labelledby":u==null?void 0:`${S}-label`,"aria-label":u==null?b:void 0,"aria-invalid":h?`true`:void 0,"aria-describedby":h?w:g?T:void 0,children:[E.map(e=>/* @__PURE__ */ i(`label`,{className:`wui-score-scale__item${o===e?` wui-score-scale__item--selected`:``}`,children:[/* @__PURE__ */ r(`input`,{type:`radio`,className:`visually-hidden`,name:C,value:e,checked:o===e,disabled:m,onChange:()=>s?.(e)}),e]},e)),D&&/* @__PURE__ */ i(`span`,{className:`wui-score-scale__ends`,children:[/* @__PURE__ */ r(`span`,{children:d}),/* @__PURE__ */ r(`span`,{children:f})]})]}),/* @__PURE__ */ r(e,{error:h,hint:g,errorId:w,hintId:T})]})}export{a as default};
@@ -1 +1 @@
1
- import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./AppIcon.js";import n from"./warnInvalidValue.js";import r from"./warnUnknownProps.js";import{isTypingTarget as i}from"@webority/ui-elements/helpers";import{useCallback as a,useEffect as o,useRef as s,useState as c}from"react";import{Form as l}from"react-bootstrap";import{jsx as u,jsxs as d}from"react/jsx-runtime";import{flushSync as f}from"react-dom";var p=[`sm`,`lg`];function m(m){let{marker:h,props:g}=e(`AppSearch`,m),{value:_,onChange:v,placeholder:y=`Search…`,ariaLabel:b,iconSize:x,size:S,loading:C=!1,collapsible:w=!1,disabled:T=!1,className:E=``,form:D,onKeyDown:O,...k}=g;r(`AppSearch`,k),n(`AppSearch`,`size`,S,p);let A=x??18,[j,M]=c(!!_),N=s(null),P=s(null),F=!w||j||!!_,I=a(()=>{M(!0),requestAnimationFrame(()=>N.current?.focus())},[]),L=()=>{f(()=>v?.(``)),N.current?.form?.requestSubmit()};o(()=>{if(!w)return;let e=e=>{e.key!==`/`||e.ctrlKey||e.altKey||e.metaKey||i(e.target)||[...document.querySelectorAll(`.search-wrap.wui-search-collapsible`)].find(e=>e.offsetParent!==null)===P.current&&(e.preventDefault(),I())};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[w,I]);let R=[`search-wrap`,_?`has-value`:``,S===`sm`?`search-sm`:S===`lg`?`search-lg`:``,C?`is-loading`:``,w?`wui-search-collapsible`:``,w&&!F?`is-collapsed`:``,E].filter(Boolean).join(` `);return/* @__PURE__ */ d(`div`,{...h,className:R,style:x==null?void 0:{"--wui-search-icon-size":`${x}px`},ref:P,onBlur:e=>{w&&!e.currentTarget.contains(e.relatedTarget)&&!_&&M(!1)},children:[w&&/* @__PURE__ */ u(`button`,{type:`button`,className:`wui-search-toggle`,"aria-label":b||y,"aria-expanded":F?`true`:`false`,onClick:I,children:/* @__PURE__ */ u(t,{name:`search`,size:A})}),C&&/* @__PURE__ */ u(`span`,{className:`search-spinner`,"aria-hidden":`true`}),/* @__PURE__ */ u(t,{name:`search`,size:A,className:`search-icon`}),/* @__PURE__ */ u(l.Control,{ref:N,type:`search`,className:`input search-input`,placeholder:y,value:_,onChange:e=>v?.(e.target.value),onKeyDown:e=>{O?.(e),w&&e.key===`Escape`&&!_&&M(!1)},"aria-label":b,form:D,disabled:T,...k}),!T&&/* @__PURE__ */ u(`button`,{type:`button`,className:`search-clear`,"aria-label":`Clear search`,onClick:L,hidden:!_,children:/* @__PURE__ */ u(t,{name:`x`,size:16})})]})}export{m as default};
1
+ import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./AppIcon.js";import n from"./warnInvalidValue.js";import r from"./warnUnknownProps.js";import{isTypingTarget as i}from"@webority/ui-elements/helpers";import{useCallback as a,useEffect as o,useRef as s,useState as c}from"react";import{Form as l}from"react-bootstrap";import{jsx as u,jsxs as d}from"react/jsx-runtime";import{flushSync as f}from"react-dom";var p=[`sm`,`md`,`lg`];function m(m){let{marker:h,props:g}=e(`AppSearch`,m),{value:_,defaultValue:v,onChange:y,placeholder:b=`Search…`,ariaLabel:x,clearLabel:S=`Clear search`,searchLabel:C=`Search`,iconSize:w,size:T,loading:E=!1,collapsible:D=!1,disabled:O=!1,className:k=``,form:A,onKeyDown:j,...M}=g;r(`AppSearch`,M),n(`AppSearch`,`size`,T,p);let N=w??18,[P,F]=c(v??``),I=_===void 0?P:_,[L,R]=c(!!I),z=s(null),B=s(null),V=!D||L||!!I,H=a(()=>{R(!0),requestAnimationFrame(()=>z.current?.focus())},[]),U=()=>{F(``),f(()=>y?.(``)),z.current?.form?.requestSubmit()};o(()=>{if(!D)return;let e=e=>{e.key!==`/`||e.ctrlKey||e.altKey||e.metaKey||i(e.target)||[...document.querySelectorAll(`.search-wrap.wui-search-collapsible`)].find(e=>e.offsetParent!==null)===B.current&&(e.preventDefault(),H())};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[D,H]);let W=[`search-wrap`,I?`has-value`:``,T===`sm`?`search-sm`:T===`lg`?`search-lg`:``,E?`is-loading`:``,D?`wui-search-collapsible`:``,D&&!V?`is-collapsed`:``,k].filter(Boolean).join(` `);return/* @__PURE__ */ d(`div`,{...h,className:W,style:w==null?void 0:{"--wui-search-icon-size":`${w}px`},ref:B,onBlur:e=>{D&&!e.currentTarget.contains(e.relatedTarget)&&!I&&R(!1)},children:[D&&/* @__PURE__ */ u(`button`,{type:`button`,className:`wui-search-toggle`,"aria-label":x||b||C,"aria-expanded":V?`true`:`false`,onClick:H,children:/* @__PURE__ */ u(t,{name:`search`,size:N})}),E&&/* @__PURE__ */ u(`span`,{className:`search-spinner`,"aria-hidden":`true`}),/* @__PURE__ */ u(t,{name:`search`,size:N,className:`search-icon`}),/* @__PURE__ */ u(l.Control,{ref:z,type:`search`,className:`input search-input`,placeholder:b,value:I,onChange:e=>{F(e.target.value),y?.(e.target.value)},onKeyDown:e=>{j?.(e),D&&e.key===`Escape`&&!I&&R(!1)},"aria-label":x,form:A,disabled:O,...M}),!O&&/* @__PURE__ */ u(`button`,{type:`button`,className:`search-clear`,"aria-label":S,onClick:U,hidden:!I,children:/* @__PURE__ */ u(t,{name:`x`,size:16})})]})}export{m as default};
@@ -1 +1 @@
1
- import e,{SECTION_ALIGNS as t,SECTION_HEADINGS as n,SECTION_VARIANTS as r,sectionHeading as i}from"../lib/sectionShell.js";import{splitMarkerProps as a}from"../lib/wuiMarker.js";import o from"./AppAlert.js";import s from"./AppButton.js";import c from"./AppInput.js";import l from"./AppPhoneNumberInput.js";import u from"./AppTextarea.js";import d from"./warnInvalidValue.js";import f from"./warnUnknownProps.js";import{useId as p,useState as m}from"react";import{jsx as h,jsxs as g}from"react/jsx-runtime";var _=[`name`,`email`,`phone`,`company`,`message`],v={name:`Name`,email:`Email`,phone:`Phone number`,company:`Company`,message:`Message`},y={name:`name`,email:`email`,company:`organization`},b=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,x=`This field is required.`,S=`Enter an email address such as name@example.com.`,C=`We could not send your message. Please try again.`;function w(e,t){let n={};for(let{name:r,required:i=!1}of e){let e=t[r].trim();i&&e===``?n[r]=x:r===`email`&&e!==``&&!b.test(e)&&(n[r]=S)}return n}function T(b){let{marker:x,props:S}=a(`AppSectionLeadCapture`,b),{title:T,text:E,fields:D,onSubmit:O,submitLabel:k=`Send`,successTitle:A,successText:j,consent:M,as:N=`h2`,eyebrow:P,subtitle:F,align:I=`center`,variant:L=`default`,className:R=``,...z}=S;f(`AppSectionLeadCapture`,z),d(`AppSectionLeadCapture`,`as`,N,n),d(`AppSectionLeadCapture`,`align`,I,t),d(`AppSectionLeadCapture`,`variant`,L,r);for(let e of D)d(`AppSectionLeadCapture`,`fields.name`,e.name,_);let B=p(),[V,H]=m(()=>Object.fromEntries(D.map(e=>[e.name,``]))),[U,W]=m({}),[G,K]=m(null),[q,J]=m(!1),[Y,X]=m(!1),Z=(e,t)=>H(n=>({...n,[e]:t}));async function Q(e){if(e.preventDefault(),q)return;let t=w(D,V);if(W(t),K(null),Object.keys(t).length>0)return;let n=Object.fromEntries(Object.entries(V).map(([e,t])=>[e,t.trim()]));J(!0);try{await O(n),X(!0)}catch(e){K(typeof e?.message==`string`&&e.message!==``?e.message:C)}finally{J(!1)}}function $({name:e,label:t=v[e],required:n=!1}){let r=`${B}-${e}`,i=U[e];return e===`phone`?/* @__PURE__ */ h(l,{id:r,name:e,label:t,required:n,value:V[e],onChange:t=>Z(e,t),error:i},e):e===`message`?/* @__PURE__ */ h(u,{id:r,name:e,label:t,required:n,value:V[e],onChange:t=>Z(e,t.target.value),error:i},e):/* @__PURE__ */ h(c,{id:r,name:e,type:e===`email`?`email`:`text`,autoComplete:y[e],label:t,required:n,value:V[e],onChange:t=>Z(e,t.target.value),error:i},e)}return/* @__PURE__ */ g(e,{component:`AppSectionLeadCapture`,kind:`lead-capture`,title:T,as:i(N,`h2`),eyebrow:P,subtitle:F,align:I,variant:L,className:R,rest:{...x,...z},children:[E!=null&&E!==``&&/* @__PURE__ */ h(`p`,{className:`wui-section-lead-text`,children:E}),Y?/* @__PURE__ */ h(`div`,{className:`wui-section-lead-success`,children:/* @__PURE__ */ h(o,{tone:`success`,title:A,children:j})}):/* @__PURE__ */ g(`form`,{className:`wui-section-lead-form`,noValidate:!0,onSubmit:Q,children:[/* @__PURE__ */ h(`div`,{className:`wui-section-lead-fields`,children:D.map($)}),G!=null&&/* @__PURE__ */ h(o,{tone:`danger`,children:G}),/* @__PURE__ */ h(s,{type:`submit`,variant:`primary`,loading:q,children:k}),M!=null&&M!==``&&/* @__PURE__ */ h(`p`,{className:`wui-section-lead-consent`,children:M})]})]})}export{T as default};
1
+ import e,{SECTION_ALIGNS as t,SECTION_HEADINGS as n,SECTION_VARIANTS as r,sectionHeading as i}from"../lib/sectionShell.js";import{splitMarkerProps as a}from"../lib/wuiMarker.js";import o from"./AppAlert.js";import s from"./AppButton.js";import c from"./AppInput.js";import l from"./AppPhoneNumberInput.js";import u from"./AppTextarea.js";import d from"./warnInvalidValue.js";import f from"./warnUnknownProps.js";import{useId as p,useState as m}from"react";import{jsx as h,jsxs as g}from"react/jsx-runtime";var _=[`name`,`email`,`phone`,`company`,`message`],ee={name:`name`,email:`email`,company:`organization`},v=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function y(e,t,n){let r={};for(let{name:i,required:a=!1}of e){let e=t[i].trim();a&&e===``?r[i]=n.required:i===`email`&&e!==``&&!v.test(e)&&(r[i]=n.invalidEmail)}return r}function b(v){let{marker:b,props:x}=a(`AppSectionLeadCapture`,v),{title:S,text:C,fields:w,onSubmit:te,submitLabel:T=`Send`,nameLabel:E=`Name`,emailLabel:D=`Email`,phoneLabel:O=`Phone number`,companyLabel:k=`Company`,messageLabel:A=`Message`,requiredText:j=`This field is required.`,invalidEmailText:M=`Enter an email address such as name@example.com.`,submitErrorText:N=`We could not send your message. Please try again.`,successTitle:P,successText:F,consent:I,as:L=`h2`,eyebrow:R,subtitle:z,align:B=`center`,variant:V=`default`,className:H=``,...U}=x;f(`AppSectionLeadCapture`,U),d(`AppSectionLeadCapture`,`as`,L,n),d(`AppSectionLeadCapture`,`align`,B,t),d(`AppSectionLeadCapture`,`variant`,V,r);for(let e of w)d(`AppSectionLeadCapture`,`fields.name`,e.name,_);let W=p(),[G,K]=m(()=>Object.fromEntries(w.map(e=>[e.name,``]))),[q,J]=m({}),[Y,X]=m(null),[Z,Q]=m(!1),[ne,re]=m(!1),$=(e,t)=>K(n=>({...n,[e]:t})),ie={name:E,email:D,phone:O,company:k,message:A},ae={required:j,invalidEmail:M};async function oe(e){if(e.preventDefault(),Z)return;let t=y(w,G,ae);if(J(t),X(null),Object.keys(t).length>0)return;let n=Object.fromEntries(Object.entries(G).map(([e,t])=>[e,t.trim()]));Q(!0);try{await te(n),re(!0)}catch(e){X(typeof e?.message==`string`&&e.message!==``?e.message:N)}finally{Q(!1)}}function se({name:e,label:t=ie[e],required:n=!1}){let r=`${W}-${e}`,i=q[e];return e===`phone`?/* @__PURE__ */ h(l,{id:r,name:e,label:t,required:n,value:G[e],onChange:t=>$(e,t),error:i},e):e===`message`?/* @__PURE__ */ h(u,{id:r,name:e,label:t,required:n,value:G[e],onChange:t=>$(e,t.target.value),error:i},e):/* @__PURE__ */ h(c,{id:r,name:e,type:e===`email`?`email`:`text`,autoComplete:ee[e],label:t,required:n,value:G[e],onChange:t=>$(e,t.target.value),error:i},e)}return/* @__PURE__ */ g(e,{component:`AppSectionLeadCapture`,kind:`lead-capture`,title:S,as:i(L,`h2`),eyebrow:R,subtitle:z,align:B,variant:V,className:H,rest:{...b,...U},children:[C!=null&&C!==``&&/* @__PURE__ */ h(`p`,{className:`wui-section-lead-text`,children:C}),ne?/* @__PURE__ */ h(`div`,{className:`wui-section-lead-success`,children:/* @__PURE__ */ h(o,{tone:`success`,title:P,children:F})}):/* @__PURE__ */ g(`form`,{className:`wui-section-lead-form`,noValidate:!0,onSubmit:oe,children:[/* @__PURE__ */ h(`div`,{className:`wui-section-lead-fields`,children:w.map(se)}),Y!=null&&/* @__PURE__ */ h(o,{tone:`danger`,children:Y}),/* @__PURE__ */ h(s,{type:`submit`,variant:`primary`,loading:Z,children:T}),I!=null&&I!==``&&/* @__PURE__ */ h(`p`,{className:`wui-section-lead-consent`,children:I})]})]})}export{b as default};
@@ -1 +1 @@
1
- import e,{SECTION_ALIGNS as t,SECTION_HEADINGS as n,SECTION_VARIANTS as r,SectionImage as i,sectionHeading as a}from"../lib/sectionShell.js";import{splitMarkerProps as o}from"../lib/wuiMarker.js";import s from"./warnInvalidValue.js";import c from"./warnUnknownProps.js";import{jsx as l}from"react/jsx-runtime";var u=e=>typeof e==`string`&&e.trim()!==``?e:void 0;function d(d){let{marker:f,props:p}=o(`AppSectionLogos`,d),{title:m,items:h=[],as:g=`h2`,eyebrow:_,subtitle:v,align:y=`center`,variant:b=`default`,className:x=``,...S}=p;c(`AppSectionLogos`,S),s(`AppSectionLogos`,`as`,g,n),s(`AppSectionLogos`,`align`,y,t),s(`AppSectionLogos`,`variant`,b,r);for(let e of h){let t=u(e.src),n=u(e.name)??u(e.label),r=e.width>0&&e.height>0;if(!(t?(u(e.alt)??n)!==void 0&&r:n!==void 0))throw Error(`AppSectionLogos item "${e.src??``}" needs src, alt (the company's name), width and height: a logo without a size moves the page when it loads.`)}return/* @__PURE__ */ l(e,{component:`AppSectionLogos`,kind:`logos`,title:m,as:a(g,`h2`),eyebrow:_,subtitle:v,align:y,variant:b,className:x,rest:{...f,...S},children:h.length>0&&/* @__PURE__ */ l(`ul`,{className:`wui-section-logos-list`,children:h.map(e=>{let t=u(e.src),n=u(e.name)??u(e.label),r=t?/* @__PURE__ */ l(i,{className:`wui-section-logo-img`,src:e.src,alt:u(e.alt)??n,width:e.width,height:e.height}):/* @__PURE__ */ l(`span`,{className:`wui-section-logo-text`,children:n});return/* @__PURE__ */ l(`li`,{className:`wui-section-logo`,children:e.href?/* @__PURE__ */ l(`a`,{href:e.href,children:r}):r},e.key??t??n)})})})}export{d as default};
1
+ import{linkTarget as e}from"../lib/linkTarget.js";import t,{SECTION_ALIGNS as n,SECTION_HEADINGS as r,SECTION_VARIANTS as i,SectionImage as a,sectionHeading as o}from"../lib/sectionShell.js";import{splitMarkerProps as s}from"../lib/wuiMarker.js";import c from"./warnInvalidValue.js";import l from"./warnUnknownProps.js";import{jsx as u}from"react/jsx-runtime";var d=e=>typeof e==`string`&&e.trim()!==``?e:void 0;function f(f){let{marker:p,props:m}=s(`AppSectionLogos`,f),{title:h,items:g=[],as:_=`h2`,eyebrow:v,subtitle:y,align:b=`center`,variant:x=`default`,className:S=``,linkComponent:C,...w}=m;l(`AppSectionLogos`,w),c(`AppSectionLogos`,`as`,_,r),c(`AppSectionLogos`,`align`,b,n),c(`AppSectionLogos`,`variant`,x,i);for(let e of g){let t=d(e.src),n=d(e.name)??d(e.label),r=e.width>0&&e.height>0;if(!(t?(d(e.alt)??n)!==void 0&&r:n!==void 0))throw Error(`AppSectionLogos item "${e.src??``}" needs src, alt (the company's name), width and height: a logo without a size moves the page when it loads.`)}return/* @__PURE__ */ u(t,{component:`AppSectionLogos`,kind:`logos`,title:h,as:o(_,`h2`),eyebrow:v,subtitle:y,align:b,variant:x,className:S,rest:{...p,...w},children:g.length>0&&/* @__PURE__ */ u(`ul`,{className:`wui-section-logos-list`,children:g.map(t=>{let n=d(t.src),r=d(t.name)??d(t.label),i=n?/* @__PURE__ */ u(a,{className:`wui-section-logo-img`,src:t.src,alt:d(t.alt)??r,width:t.width,height:t.height}):/* @__PURE__ */ u(`span`,{className:`wui-section-logo-text`,children:r}),{Tag:o,linkProps:s}=e(C,{href:t.href});return/* @__PURE__ */ u(`li`,{className:`wui-section-logo`,children:t.href?/* @__PURE__ */ u(o,{...s,children:i}):i},t.key??n??r)})})})}export{f as default};
@@ -1 +1 @@
1
- import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./AppIcon.js";import n from"./warnInvalidValue.js";import r from"./warnUnknownProps.js";import{useEffect as i,useId as a,useLayoutEffect as o,useRef as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";var u={sm:`segmented-sm`,md:``,lg:`segmented-lg`};function d(d){let{marker:f,props:p}=e(`AppSegmented`,d),{options:m=[],value:h,onChange:g,label:_,name:v,size:y=`md`,fullWidth:b=!1,bordered:x=!0,disabled:S=!1,labelVisible:C=!1,className:w=``,...T}=p;r(`AppSegmented`,T),n(`AppSegmented`,`size`,y,Object.keys(u));let E=a(),D=v||E,O=s(null),k=s(null),A=[`segmented`,u[y]??``,b?`segmented-full`:``,x?``:`wui-segmented-borderless`,S?`is-disabled`:``,w].filter(Boolean).join(` `);o(()=>{let e=O.current,t=k.current;if(!e||!t)return;let n=n=>{let r=e.querySelector(`.segmented-option:has(.segmented-input:checked)`);!r||!e.offsetWidth?t.style.opacity=`0`:(n||e.classList.remove(`is-animated`),t.style.width=`${r.offsetWidth}px`,t.style.transform=`translateX(${r.offsetLeft}px)`,t.style.opacity=`1`,n||requestAnimationFrame(()=>O.current?.classList.add(`is-animated`)))};n(!0);let r=typeof ResizeObserver<`u`?new ResizeObserver(()=>n(!1)):null;return r?.observe(e),()=>r?.disconnect()},[h,m,y,b,C]),i(()=>{let e=requestAnimationFrame(()=>O.current?.classList.add(`is-animated`));return()=>cancelAnimationFrame(e)},[]);let j=C&&_,M=/* @__PURE__ */ l(`div`,{ref:O,className:A,role:`radiogroup`,"aria-label":_,"aria-disabled":S||void 0,...j?void 0:f,...T,children:[/* @__PURE__ */ c(`span`,{className:`segmented-thumb`,ref:k,"aria-hidden":`true`}),m.map(e=>/* @__PURE__ */ l(`label`,{className:`segmented-option`,children:[/* @__PURE__ */ c(`input`,{type:`radio`,className:`segmented-input`,name:D,value:e.value,checked:e.value===h,disabled:S||e.disabled,onChange:()=>g?.(e.value)}),e.icon&&/* @__PURE__ */ c(t,{name:e.icon,size:13}),e.note?/* @__PURE__ */ l(`span`,{className:`segmented-option-text`,children:[/* @__PURE__ */ c(`span`,{className:`segmented-option-label`,children:e.label}),/* @__PURE__ */ c(`span`,{className:`segmented-option-note`,children:e.note})]}):e.label,e.count!=null&&/* @__PURE__ */ c(`span`,{className:`wui-segmented-option-count`,children:e.count})]},e.value))]},`group`);return j?/* @__PURE__ */ l(`div`,{className:`field`,...f,children:[/* @__PURE__ */ c(`span`,{className:`label`,"aria-hidden":`true`,children:_}),M]},`field`):M}export{d as default};
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"./warnInvalidValue.js";import o from"./warnUnknownProps.js";import{useEffect as s,useId as c,useLayoutEffect as l,useRef as u,useState as d}from"react";import{jsx as f,jsxs as p}from"react/jsx-runtime";var m={sm:`segmented-sm`,md:``,lg:`segmented-lg`};function h(h){let{marker:g,props:_}=n(`AppSegmented`,h),{options:v=[],value:y,defaultValue:b,onChange:x,label:S,name:C,size:w=`md`,fullWidth:T=!1,bordered:E=!0,disabled:D=!1,readOnly:O=!1,loading:k=!1,labelVisible:A=!1,help:j,helpLabel:M=`More information`,className:N=``,...P}=_;o(`AppSegmented`,P),a(`AppSegmented`,`size`,w,Object.keys(m));let F=c(),I=C||F,L=u(null),R=u(null),[z,B]=d(b),V=y===void 0?z:y,H=[`segmented`,m[w]??``,T?`segmented-full`:``,E?``:`wui-segmented-borderless`,D?`is-disabled`:``,k?e:``,N].filter(Boolean).join(` `);l(()=>{let e=L.current,t=R.current;if(!e||!t)return;let n=n=>{let r=e.querySelector(`.segmented-option:has(.segmented-input:checked)`);!r||!e.offsetWidth?t.style.opacity=`0`:(n||e.classList.remove(`is-animated`),t.style.width=`${r.offsetWidth}px`,t.style.transform=`translateX(${r.offsetLeft}px)`,t.style.opacity=`1`,n||requestAnimationFrame(()=>L.current?.classList.add(`is-animated`)))};n(!0);let r=typeof ResizeObserver<`u`?new ResizeObserver(()=>n(!1)):null;return r?.observe(e),()=>r?.disconnect()},[V,v,w,T,A]),s(()=>{let e=requestAnimationFrame(()=>L.current?.classList.add(`is-animated`));return()=>cancelAnimationFrame(e)},[]);let U=A&&S,W=/* @__PURE__ */ p(`div`,{ref:L,className:H,role:`radiogroup`,"aria-label":S,"aria-disabled":D||void 0,"aria-busy":k||void 0,...U?void 0:g,...P,children:[/* @__PURE__ */ f(`span`,{className:`segmented-thumb`,ref:R,"aria-hidden":`true`}),v.map(e=>/* @__PURE__ */ p(`label`,{className:`segmented-option`,children:[/* @__PURE__ */ f(`input`,{type:`radio`,className:`segmented-input`,name:I,value:e.value,checked:e.value===V,disabled:D||k||e.disabled,"aria-readonly":O||void 0,onClick:t(O||k),onChange:()=>{B(e.value),x?.(e.value)}}),e.icon&&/* @__PURE__ */ f(r,{name:e.icon,size:13}),e.note?/* @__PURE__ */ p(`span`,{className:`segmented-option-text`,children:[/* @__PURE__ */ f(`span`,{className:`segmented-option-label`,children:e.label}),/* @__PURE__ */ f(`span`,{className:`segmented-option-note`,children:e.note})]}):e.label,e.count!=null&&/* @__PURE__ */ f(`span`,{className:`wui-segmented-option-count`,children:e.count})]},e.value))]},`group`);return U?/* @__PURE__ */ p(`div`,{className:`field`,...g,children:[/* @__PURE__ */ f(`span`,{className:`label`,"aria-hidden":`true`,children:S}),j&&/* @__PURE__ */ f(i,{label:M,children:j}),W]},`field`):W}export{h as default};
@@ -1 +1 @@
1
- import e from"../lib/FieldMessage.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import ee from"./AppInfoTip.js";import n from"./AppRequiredMark.js";import te from"./useNodeLabels.js";import r,{optionsEqual as ne}from"./useWuiControl.js";import i from"./warnInvalidValue.js";import a from"./warnUnknownProps.js";import{forwardRef as o,useEffect as s,useId as c,useLayoutEffect as l,useRef as u}from"react";import{Fragment as re,jsx as d,jsxs as f}from"react/jsx-runtime";import"@webority/ui-elements/elements/select";var ie=[`sm`,`lg`,`xl`],ae=[`off`,`border`,`above`],oe=(e,t)=>({value:e.value,label:t,icon:e.icon}),p=o(function(o,p){let{marker:m,props:h}=t(`AppSelect`,o),{value:g,onChange:se,options:_=[],placeholder:v=`Select...`,searchPlaceholder:y=`Search...`,emptyText:b,searchable:x=!1,clearable:ce=!1,size:S,icon:le,compact:ue=!1,valuePrefix:C,prefix:w,suffix:T,floatingLabel:E=`off`,disabled:D,open:O,label:k,required:A=!1,optional:j=!1,error:M,hint:N,help:P,helpLabel:F=`More information`,id:I,name:L,className:R=``,fieldClassName:z=``,"aria-label":de,"aria-labelledby":B,"aria-describedby":V,...H}=h;a(`AppSelect`,H),i(`AppSelect`,`size`,S,ie),i(`AppSelect`,`floatingLabel`,E,ae);let fe=c(),{setRef:pe,innerRef:U}=r({ref:p,value:g??``,onChange:se}),{portal:me,toElementOptions:W}=te(_),G=u({el:null,options:null,map:null});l(()=>{let e=U.current;if(!e||G.current.el===e&&G.current.options===_&&G.current.map===W)return;G.current={el:e,options:_,map:W};let t=W(_,oe);ne(t,e.options)||(e.options=t)});let K=I||fe,q=E!==`off`&&k,J=M&&K?`${K}-error`:void 0,Y=N&&K?`${K}-hint`:void 0,he=J||Y||V;s(()=>{let e=U.current;e&&(C==null||C===``?e.removeAttribute(`prefix`):e.setAttribute(`prefix`,C))},[C,U]);let X=!q&&(w!=null||T!=null),Z=!k&&!M&&!N,ge=/* @__PURE__ */ d(`wui-select`,{"aria-label":de||(typeof k==`string`?k:void 0),"aria-labelledby":B||void 0,"aria-describedby":he||void 0,"aria-invalid":M?`true`:void 0,ref:pe,value:g||void 0,id:K,name:L,placeholder:E!==`off`&&k?` `:v,"search-placeholder":y,"empty-text":b||void 0,searchable:x?``:void 0,clearable:ce?``:void 0,size:S||void 0,icon:le||void 0,compact:ue?``:void 0,disabled:D?``:void 0,open:O?``:void 0,required:A?``:void 0,className:R||void 0,...Z&&!X?m:null,...H}),Q=/* @__PURE__ */ f(re,{children:[ge,me]}),$=X?/* @__PURE__ */ f(`div`,{...Z?m:null,className:`input-affixed`,children:[w!=null&&/* @__PURE__ */ d(`span`,{className:`affix affix-pre`,children:w}),Q,T!=null&&/* @__PURE__ */ d(`span`,{className:`affix affix-suf`,children:T})]}):Q;if(Z)return $;let _e=[`field`,z].filter(Boolean).join(` `);return/* @__PURE__ */ f(`div`,{...m,className:_e,children:[k&&!q&&/* @__PURE__ */ f(`label`,{className:`label`,htmlFor:K,children:[k,j&&!A&&/* @__PURE__ */ d(`span`,{className:`label-optional`,children:` (optional)`}),A&&/* @__PURE__ */ d(n,{}),P&&/* @__PURE__ */ d(ee,{label:F,children:P})]}),q?/* @__PURE__ */ f(`div`,{className:E===`above`?`field-float wui-float-above`:`field-float`,children:[Q,/* @__PURE__ */ f(`label`,{className:`float-label`,htmlFor:K,children:[k,j&&!A&&/* @__PURE__ */ d(`span`,{className:`label-optional`,children:` (optional)`}),A&&/* @__PURE__ */ d(n,{})]})]}):$,/* @__PURE__ */ d(e,{error:M,hint:N,errorId:J,hintId:Y})]})});export{p as default};
1
+ import e from"../lib/FieldMessage.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import ee from"./AppInfoTip.js";import n from"./AppRequiredMark.js";import te from"./useNodeLabels.js";import r,{optionsEqual as ne}from"./useWuiControl.js";import i from"./warnInvalidValue.js";import re from"./warnUnknownProps.js";import{forwardRef as a,useEffect as o,useId as s,useLayoutEffect as c,useRef as l}from"react";import{Fragment as u,jsx as d,jsxs as f}from"react/jsx-runtime";import"@webority/ui-elements/elements/select";var ie=[`sm`,`md`,`lg`],p=[`off`,`border`,`above`],ae=(e,t)=>({value:e.value,label:t,icon:e.icon}),m=a(function(a,m){let{marker:h,props:oe}=t(`AppSelect`,a),{value:g,defaultValue:_,onChange:se,options:v=[],placeholder:y=`Select...`,searchPlaceholder:b=`Search...`,emptyText:x,searchable:ce=!1,clearable:le=!1,size:S,icon:ue,compact:de=!1,valuePrefix:C,prefix:w,suffix:T,floatingLabel:E=`off`,disabled:D,readOnly:O=!1,loading:k=!1,open:A,label:j,required:M=!1,optional:N=!1,optionalLabel:P=`(optional)`,error:F,hint:I,help:L,helpLabel:R=`More information`,id:z,name:B,className:fe=``,fieldClassName:V=``,"aria-label":pe,"aria-labelledby":me,"aria-describedby":he,...H}=oe;re(`AppSelect`,H),i(`AppSelect`,`size`,S,ie),i(`AppSelect`,`floatingLabel`,E,p);let ge=s(),{setRef:_e,innerRef:U}=r({ref:m,value:g??(_===void 0?``:void 0),onChange:se}),{portal:ve,toElementOptions:W}=te(v),G=l({el:null,options:null,map:null});c(()=>{let e=U.current;if(!e||G.current.el===e&&G.current.options===v&&G.current.map===W)return;G.current={el:e,options:v,map:W};let t=W(v,ae);ne(t,e.options)||(e.options=t)});let K=z||ge,q=E!==`off`&&j,J=F&&K?`${K}-error`:void 0,Y=I&&K?`${K}-hint`:void 0,ye=J||Y||he;o(()=>{let e=U.current;e&&(C==null||C===``?e.removeAttribute(`prefix`):e.setAttribute(`prefix`,C))},[C,U]);let X=!q&&(w!=null||T!=null),Z=!j&&!F&&!I,be=/* @__PURE__ */ d(`wui-select`,{"aria-label":pe||(typeof j==`string`?j:void 0),"aria-labelledby":me||void 0,"aria-describedby":ye||void 0,"aria-invalid":F?`true`:void 0,ref:_e,value:(g??_)||void 0,id:K,name:B,placeholder:E!==`off`&&j?` `:y,"search-placeholder":b,"empty-text":x||void 0,searchable:ce?``:void 0,clearable:le?``:void 0,size:S===`md`?void 0:S||void 0,icon:ue||void 0,compact:de?``:void 0,disabled:D?``:void 0,readonly:O?``:void 0,loading:k?``:void 0,open:A?``:void 0,required:M?``:void 0,className:fe||void 0,...Z&&!X?h:null,...H}),Q=/* @__PURE__ */ f(u,{children:[be,ve]}),$=X?/* @__PURE__ */ f(`div`,{...Z?h:null,className:`input-affixed`,children:[w!=null&&/* @__PURE__ */ d(`span`,{className:`affix affix-pre`,children:w}),Q,T!=null&&/* @__PURE__ */ d(`span`,{className:`affix affix-suf`,children:T})]}):Q;if(Z)return $;let xe=[`field`,V].filter(Boolean).join(` `);return/* @__PURE__ */ f(`div`,{...h,className:xe,children:[j&&!q&&/* @__PURE__ */ f(`label`,{className:`label`,htmlFor:K,children:[j,N&&!M&&/* @__PURE__ */ d(`span`,{className:`label-optional`,children:` ${P}`}),M&&/* @__PURE__ */ d(n,{}),L&&/* @__PURE__ */ d(ee,{label:R,children:L})]}),q?/* @__PURE__ */ f(`div`,{className:E===`above`?`field-float wui-float-above`:`field-float`,children:[Q,/* @__PURE__ */ f(`label`,{className:`float-label`,htmlFor:K,children:[j,N&&!M&&/* @__PURE__ */ d(`span`,{className:`label-optional`,children:` ${P}`}),M&&/* @__PURE__ */ d(n,{})]})]}):$,/* @__PURE__ */ d(e,{error:F,hint:I,errorId:J,hintId:Y})]})});export{m as default};
@@ -1 +1 @@
1
- import{devWarn as e}from"../lib/devWarn.js";import{navMatchScore as t}from"../lib/navMatch.js";import{SHELL_FOLDED_COOKIE as n,readNavFolded as r,readShellCollapsed as i,writeNavFolded as a,writeShellCollapsed as o}from"../lib/shellCookie.js";import{splitMarkerProps as s}from"../lib/wuiMarker.js";import c from"./AppAvatar.js";import l from"./AppIcon.js";import u from"./warnInvalidValue.js";import d from"./warnUnknownProps.js";import{initScrollEdges as f}from"@webority/ui-elements/helpers";import{useEffect as p,useId as m,useMemo as h,useRef as g,useState as _}from"react";import{Fragment as v,jsx as y,jsxs as b}from"react/jsx-runtime";var x=99,S=4,C=5,w=/^[a-z0-9-]+$/,T=[`prefix`,`exact`],E=[`comfortable`,`compact`],D=[`default`,`primary`],O=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`],k=/* @__PURE__ */ new Set([`key`,`label`,`icon`,`iconVariant`,`iconSize`,`href`,`badge`,`badgeTone`,`badgeTitle`,`newUntil`,`trailingIcon`,`active`,`match`,`matchAlso`,`tab`,`tabLabel`,`children`]),A=e=>e>x?`${x}+`:String(e),j=new Intl.DateTimeFormat(`en-CA`,{timeZone:`Asia/Kolkata`}),M=e=>{if(typeof e!=`string`||!/^\d{4}-\d{2}-\d{2}$/.test(e))return!1;let t=/* @__PURE__ */ new Date(`${e}T00:00:00Z`);return Number.isNaN(t.getTime())||t.toISOString().slice(0,10)!==e?!1:j.format(/* @__PURE__ */ new Date)<=e};function ee(e){let{marker:t,props:c}=s(`AppShell`,e),{groups:m=[],brand:v,sidebarStart:x,sidebarStartCompact:S,sidebarFooter:C,topbarStart:w,topbarEnd:T,footer:k,launcher:A,children:j,collapsed:M,onCollapsedChange:ee,noSidebar:N=!1,density:P=`comfortable`,itemHeight:F,iconVariant:I,topbarTone:L=`default`,navLabel:z=`Main navigation`,linkComponent:B,currentPath:ce,rememberCollapsed:V=!1,collapsedCookie:H=`wui-shell-collapsed`,foldedCookie:U=n,tabBarLabel:le=`Quick navigation`,moreLabel:ue=`More`,userMenu:W,notifications:G,search:K,className:de=``,style:fe,...q}=c;d(`AppShell`,q),u(`AppShell`,`density`,P,E),u(`AppShell`,`topbarTone`,L,D),u(`AppShell`,`iconVariant`,I,O);let pe=F>0?{...fe,"--wui-nav-item-height":`${F}px`}:fe,[me,he]=_(()=>V&&M===void 0&&typeof document<`u`?i(H)??!1:!1),[J,Y]=_(!1),[ge,_e]=_(!1),[ve,ye]=_(!1),X=g(null),be=g(null),xe=g(null),Z=M??me,Se=()=>{let e=!Z;M===void 0&&he(e),V&&o(e,H),ee?.(e)},Ce=m.some(e=>e.collapsible),[we,Te]=_(()=>Ce&&typeof document<`u`?r(U):/* @__PURE__ */ new Set),Ee=e=>{let t=new Set(we);t.has(e)?t.delete(e):t.add(e),Te(t),a(t,U)},Q=h(()=>te(m,ce),[m,ce]),$=N?null:ne(Q);p(()=>{let e=()=>_e(window.scrollY>4);return e(),window.addEventListener(`scroll`,e,{passive:!0}),()=>window.removeEventListener(`scroll`,e)},[]),p(()=>{f()},[]),p(()=>{let e=X.current,t=e?.querySelector(`.app-nav-item[aria-current="page"]`);if(!e||!t)return;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();n.top<r.top?e.scrollTop-=r.top-n.top:n.bottom>r.bottom&&(e.scrollTop+=n.bottom-r.bottom)},[]),p(()=>{let e=X.current;if(!e)return;let t=()=>ye(e.scrollHeight>e.clientHeight);if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[Q]);let De=!!k;p(()=>{let e=xe.current,t=be.current;if(!De||!e||!t)return;let n=()=>t.style.setProperty(`--app-footer-h`,`${e.offsetHeight}px`);n();let r=typeof ResizeObserver>`u`?null:new ResizeObserver(n);return r?.observe(e),()=>{r?.disconnect(),t.style.removeProperty(`--app-footer-h`)}},[De]),p(()=>{if(!J)return;let e=e=>{e.key===`Escape`&&Y(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[J]);let Oe=[`app-shell`,Z?`collapsed`:``,N?`no-sidebar`:``,J?`mobile-open`:``,de].filter(Boolean).join(` `);return/* @__PURE__ */ b(`div`,{ref:be,className:Oe,"data-density":P===`compact`?`compact`:void 0,"data-wui-folded-cookie":Ce?U:void 0,style:pe,...t,...q,children:[/* @__PURE__ */ y(`a`,{className:`wui-skip-link`,href:`#main-content`,children:`Skip to content`}),/* @__PURE__ */ b(`aside`,{className:`app-sidebar`,children:[v&&/* @__PURE__ */ y(`div`,{className:`app-sidebar-brand`,children:v}),x&&/* @__PURE__ */ y(`div`,{className:`app-sidebar-start`,children:x}),S&&/* @__PURE__ */ y(`div`,{className:`app-sidebar-start-compact`,children:S}),/* @__PURE__ */ y(`nav`,{className:`app-sidebar-scroll`,"aria-label":z,ref:X,tabIndex:ve?0:void 0,children:Q.map((e,t)=>{let n=e.items.map(e=>e.header==null?/* @__PURE__ */ y(ie,{item:e,linkComponent:B,onNavigate:()=>Y(!1),iconVariant:I},e.key??e.href??e.label):/* @__PURE__ */ y(`div`,{className:`wui-nav-header`,children:e.header},e.key??e.header));if(!e.collapsible)return/* @__PURE__ */ b(`div`,{className:`app-nav-group`,children:[e.label&&/* @__PURE__ */ y(`div`,{className:`app-nav-group-label`,children:e.label}),n,e.after&&/* @__PURE__ */ y(`div`,{className:`wui-nav-group-after`,children:e.after})]},e.key??e.label??`group-${t}`);let r=!we.has(e.key)||!!R(e.items),i=`wui-nav-group-${e.key}`;return/* @__PURE__ */ b(`div`,{className:`app-nav-group wui-nav-group-collapsible${r?``:` wui-nav-group-folded`}`,"data-wui-nav-group":e.key,children:[/* @__PURE__ */ b(`button`,{type:`button`,className:`app-nav-group-label wui-nav-group-toggle`,"aria-expanded":r,"aria-controls":i,onClick:()=>Ee(e.key),children:[/* @__PURE__ */ y(`span`,{className:`wui-nav-group-text`,children:e.label}),/* @__PURE__ */ y(`span`,{className:`wui-nav-group-caret`,children:/* @__PURE__ */ y(l,{name:`chevron-down`,size:16})})]}),/* @__PURE__ */ b(`div`,{className:`wui-nav-group-body`,id:i,children:[n,e.after&&/* @__PURE__ */ y(`div`,{className:`wui-nav-group-after`,children:e.after})]})]},e.key??`group-${t}`)})}),C&&/* @__PURE__ */ y(`div`,{className:`app-sidebar-foot`,children:C}),!N&&/* @__PURE__ */ y(`button`,{type:`button`,className:`app-sidebar-toggle`,onClick:Se,"aria-label":Z?`Expand navigation`:`Collapse navigation`,"aria-expanded":!Z,children:/* @__PURE__ */ y(l,{name:`chevrons-left`,size:20})})]}),/* @__PURE__ */ b(`div`,{className:`app-main`,children:[/* @__PURE__ */ b(`header`,{className:`app-topbar${ge?` scrolled`:``}`,"data-tone":L===`primary`?`primary`:void 0,children:[/* @__PURE__ */ b(`div`,{className:`app-topbar-start`,children:[/* @__PURE__ */ y(`button`,{type:`button`,className:`app-topbar-menu`,onClick:()=>Y(!0),"aria-label":`Open navigation`,"aria-expanded":J,children:/* @__PURE__ */ y(l,{name:`menu`,size:18})}),w,K&&/* @__PURE__ */ y(se,{config:K})]}),/* @__PURE__ */ b(`div`,{className:`app-topbar-end`,children:[T,G&&/* @__PURE__ */ y(oe,{config:G}),W&&/* @__PURE__ */ y(ae,{config:W,linkComponent:B})]})]}),/* @__PURE__ */ y(`main`,{className:`app-content`,id:`main-content`,children:j}),k&&/* @__PURE__ */ y(`footer`,{className:`app-footer`,ref:xe,children:k})]}),A&&/* @__PURE__ */ y(`div`,{className:`wui-shell-launcher`,children:A}),$&&/* @__PURE__ */ b(`nav`,{className:`wui-tabbar`,"aria-label":le,children:[$.tabs.map(e=>/* @__PURE__ */ y(re,{tab:e,linkComponent:B,iconVariant:I},e.key??e.href)),$.hasMore&&/* @__PURE__ */ b(`button`,{type:`button`,className:`wui-tabbar-item${$.moreActive?` active`:``}`,onClick:()=>Y(!0),children:[/* @__PURE__ */ y(`span`,{className:`wui-tabbar-icon`,children:/* @__PURE__ */ y(l,{name:`more`,size:24})}),/* @__PURE__ */ y(`span`,{className:`wui-tabbar-label`,children:ue})]})]}),/* @__PURE__ */ y(`button`,{type:`button`,className:`app-scrim`,onClick:()=>Y(!1),"aria-label":`Close navigation`,tabIndex:J?0:-1})]})}function te(e,n){for(let t of e)t.collapsible&&L(t);let r=(e,t=!1)=>(e??[]).map(e=>Array.isArray(e.children)?{...e,children:r(e.children)}:{...e}).filter(e=>P(e)?t:(e.children?.length??0)>0||!!e.href),i=e.map(e=>({...e,items:F(r(e.items,!0))})).filter(e=>e.items.some(e=>!P(e))),a=[],o=e=>{for(let t of e)P(t)||(a.push(t),t.children&&o(t.children))};for(let e of i)o(e.items);for(let e of a)d(`AppShell items`,N(e)),u(`AppShell`,`match`,e.match,T),u(`AppShell`,`iconVariant`,e.iconVariant,O);let s=null;if(n!=null&&!a.some(e=>e.active===!0)){let e=-1;for(let r of a){if(r.active!=null||r.children?.length&&!r.href)continue;let i=t(n,r.href,{exact:r.match===`exact`,also:r.matchAlso});if(i<0)continue;let a=r.match===`exact`&&t(n,r.href,{exact:!0})>=0?1/0:i;a>e&&(e=a,s=r)}}for(let e of a)e.active=e.active??e===s;return i}function N(e){return Object.fromEntries(Object.entries(e).filter(([e])=>!k.has(e)))}var P=e=>e.header!=null;function F(e){return e.filter((t,n)=>{if(!P(t))return!0;let r=e.findIndex((e,t)=>t>n&&P(e));return e.slice(n+1,r<0?void 0:r).length>0})}var I=/* @__PURE__ */ new Set;function L(t){if(t.key!=null&&w.test(t.key))return;let n=t.key==null?`<AppShell> a collapsible group needs a key so its folded state can be remembered.`:`<AppShell> collapsible group key "${t.key}" must use lower-case letters, digits and hyphens.`,r=!0;try{r=process.env.NODE_ENV!==`production`}catch{r=!0}r&&!I.has(n)&&(I.add(n),e(n))}function ne(e){let t=[],n=e=>{for(let r of e)P(r)||(r.children?.length?n(r.children):t.push(r))};for(let t of e)n(t.items);let r=t.filter(e=>e.tab);if(r.length===0)return null;let i=r.length<t.length,a=i?S:C;if(r.length>a)throw Error(`<AppShell>: ${r.length} items carry tab: true, but the phone tab bar holds ${a} (${i?`4 plus More, because other items exist`:`5 when every item is a tab`}). Flag fewer items.`);return{tabs:r,hasMore:i,moreActive:t.some(e=>!e.tab&&e.active)}}function re({tab:e,linkComponent:t,iconVariant:n}){let r=`wui-tabbar-item${e.active?` active`:``}`,i=/* @__PURE__ */ b(v,{children:[e.icon&&/* @__PURE__ */ y(`span`,{className:`wui-tabbar-icon`,children:typeof e.icon==`string`?/* @__PURE__ */ y(l,{name:e.icon,size:24,variant:e.iconVariant??n}):e.icon}),/* @__PURE__ */ y(`span`,{className:`wui-tabbar-label`,children:e.tabLabel??e.label}),e.badge!=null&&/* @__PURE__ */ y(`span`,{className:`wui-tabbar-badge${e.badgeTone?` tone-${e.badgeTone}`:``}`,title:e.badgeTitle||void 0,children:e.badge})]}),a=e.active?`page`:void 0;return t?/* @__PURE__ */ y(t,{className:r,to:e.href,"aria-current":a,children:i}):/* @__PURE__ */ y(`a`,{className:r,href:e.href,"aria-current":a,children:i})}function R(e){for(let t of e){if(t.active)return t;let e=t.children?.length?R(t.children):void 0;if(e)return e}}function ie({item:e,linkComponent:t,onNavigate:n,depth:r=0,iconVariant:i}){let a=r>0,o=r>1?` wui-nav-depth-${Math.min(r,6)}`:``,s=Array.isArray(e.children)&&e.children.length>0,c=s?R(e.children):void 0,u=!!c,d=c?c.key??c.href??c.label:null,[f,m]=_(u);p(()=>{d!=null&&m(!0)},[d]);let h=typeof e.label==`string`?e.label:void 0,g=!a&&e.icon&&/* @__PURE__ */ y(`span`,{className:`app-nav-icon`,children:typeof e.icon==`string`?/* @__PURE__ */ y(l,{name:e.icon,size:e.iconSize??22,variant:e.iconVariant??i}):e.icon}),x=e.badge!=null&&/* @__PURE__ */ y(`span`,{className:`app-nav-badge${e.badgeTone?` tone-${e.badgeTone}`:``}`,title:e.badgeTitle||void 0,children:e.badge}),S=M(e.newUntil)&&/* @__PURE__ */ y(`span`,{className:`wui-nav-new`,children:`New`}),C=/* @__PURE__ */ b(v,{children:[g,/* @__PURE__ */ y(`span`,{className:`app-nav-text`,children:e.label}),S,x,e.trailingIcon&&/* @__PURE__ */ y(`span`,{className:`app-nav-trailing`,children:typeof e.trailingIcon==`string`?/* @__PURE__ */ y(l,{name:e.trailingIcon,size:16}):e.trailingIcon})]}),w=e.active?`page`:void 0;if(s){let s=/* @__PURE__ */ y(`div`,{className:`app-nav-sub${f?` expanded`:``}`,inert:!f,"aria-hidden":!f||void 0,children:/* @__PURE__ */ y(`div`,{className:`app-nav-sub-inner`,children:e.children.map(e=>/* @__PURE__ */ y(ie,{item:e,linkComponent:t,onNavigate:n,depth:r+1,iconVariant:i},e.key??e.href))})});if(e.href){let r=t?/* @__PURE__ */ y(t,{className:`wui-nav-split-link`,to:e.href,"aria-current":w,onClick:n,children:C}):/* @__PURE__ */ y(`a`,{className:`wui-nav-split-link`,href:e.href,"aria-current":w,onClick:n,children:C});return/* @__PURE__ */ b(v,{children:[/* @__PURE__ */ b(`div`,{className:`app-nav-item has-children wui-nav-split${a?` app-nav-subitem`:``}${u||e.active?` active`:``}${o}`,"data-label":h,children:[r,/* @__PURE__ */ y(`button`,{type:`button`,className:`app-nav-caret wui-nav-split-toggle`,"aria-expanded":f,"aria-label":`Show or hide ${h??``} pages`,onClick:()=>m(e=>!e),children:/* @__PURE__ */ y(l,{name:`chevron-right`,size:16})})]}),s]})}return/* @__PURE__ */ b(v,{children:[/* @__PURE__ */ b(`button`,{type:`button`,className:`app-nav-item${a?` app-nav-subitem`:``} has-children${u?` active`:``}${o}`,"aria-expanded":f,"data-label":h,onClick:()=>m(e=>!e),children:[g,/* @__PURE__ */ y(`span`,{className:`app-nav-text`,children:e.label}),S,x,/* @__PURE__ */ y(`span`,{className:`app-nav-caret`,children:/* @__PURE__ */ y(l,{name:`chevron-right`,size:16})})]}),s]})}let T=`app-nav-item${a?` app-nav-subitem`:``}${e.active?` active`:``}${o}`;return t?/* @__PURE__ */ y(t,{className:T,to:e.href,"aria-current":w,"data-label":h,onClick:n,children:C}):/* @__PURE__ */ y(`a`,{className:T,href:e.href,"aria-current":w,"data-label":h,onClick:n,children:C})}function z(){let[e,t]=_(!1),n=g(null);return p(()=>{if(!e)return;let r=e=>{n.current?.contains(e.target)||t(!1)},i=e=>{e.key===`Escape`&&(t(!1),n.current?.querySelector(`button`)?.focus())};return document.addEventListener(`mousedown`,r),document.addEventListener(`keydown`,i),()=>{document.removeEventListener(`mousedown`,r),document.removeEventListener(`keydown`,i)}},[e]),{open:e,setOpen:t,ref:n}}function ae({config:e,linkComponent:t}){let n=m(),{open:r,setOpen:i,ref:a}=z(),{name:o,role:s,roles:u=[],photo:d,profileHref:f,profileLabel:p=`My profile`,onLogout:h,logoutAction:g,logoutLabel:_=`Sign out`,items:x=[]}=e;if(!o)throw Error(`<AppShell> userMenu.name is required; the trigger and the avatar are named from it.`);let S=u.map(e=>(e??``).trim()).filter(Boolean),C=()=>i(!1),w=(e,n,r,i)=>t?/* @__PURE__ */ y(t,{className:`dropdown-item`,to:e,onClick:i,children:n},r):/* @__PURE__ */ y(`a`,{className:`dropdown-item`,href:e,onClick:i,children:n},r),T=/* @__PURE__ */ b(v,{children:[/* @__PURE__ */ y(l,{name:`log-out`,size:18}),_]});return/* @__PURE__ */ b(`div`,{className:`dropdown wui-usermenu`,ref:a,children:[/* @__PURE__ */ b(`button`,{type:`button`,id:n,className:`wui-usermenu-trigger`,"aria-expanded":r,"aria-label":`Account menu for ${o}`,onClick:()=>i(e=>!e),children:[/* @__PURE__ */ y(c,{name:o,src:d,tone:`auto`}),/* @__PURE__ */ b(`span`,{className:`wui-usermenu-text`,children:[/* @__PURE__ */ y(`span`,{className:`wui-usermenu-name`,children:o}),s&&/* @__PURE__ */ y(`span`,{className:`wui-usermenu-role`,children:s})]}),/* @__PURE__ */ y(l,{name:`chevron-down`,size:14,className:`wui-usermenu-caret`})]}),/* @__PURE__ */ b(`div`,{className:`dropdown-menu dropdown-menu-end wui-usermenu-menu${r?` show`:``}`,"aria-labelledby":n,"data-bs-popper":r?`static`:void 0,children:[/* @__PURE__ */ b(`div`,{className:`wui-usermenu-head`,children:[/* @__PURE__ */ y(c,{name:o,src:d,size:`lg`,tone:`auto`}),/* @__PURE__ */ b(`div`,{className:`wui-usermenu-who`,children:[/* @__PURE__ */ y(`div`,{className:`wui-usermenu-name`,children:o}),s&&/* @__PURE__ */ y(`div`,{className:`wui-usermenu-role`,children:s}),S.length>0&&/* @__PURE__ */ b(`div`,{className:`wui-usermenu-roles`,children:[/* @__PURE__ */ y(`span`,{className:`wui-usermenu-roles-label`,children:S.length===1?`Role:`:`Roles:`}),` ${S.join(`, `)}`]})]})]}),f&&w(f,/* @__PURE__ */ b(v,{children:[/* @__PURE__ */ y(l,{name:`user`,size:18}),p]}),void 0,C),x.map(e=>{if(e.divider)return/* @__PURE__ */ y(`hr`,{className:`dropdown-divider`},e.key);let t=/* @__PURE__ */ b(v,{children:[e.icon&&/* @__PURE__ */ y(l,{name:e.icon,size:18}),e.label]}),n=()=>{e.onClick?.(),C()};return e.href?w(e.href,t,e.key,n):/* @__PURE__ */ y(`button`,{type:`button`,className:`dropdown-item`,onClick:n,children:t},e.key)}),g?/* @__PURE__ */ y(`form`,{method:`post`,action:g,className:`wui-usermenu-logout`,children:/* @__PURE__ */ y(`button`,{type:`submit`,className:`dropdown-item danger`,children:T})}):h&&/* @__PURE__ */ y(`button`,{type:`button`,className:`dropdown-item danger`,onClick:()=>{C(),h()},children:T})]})]})}function oe({config:e}){let t=m(),{open:n,setOpen:r,ref:i}=z(),{unread:a=0,items:o,loading:s=!1,onOpen:c,onMarkAllRead:u,viewAllHref:d,label:f=`Notifications`,emptyText:h=`You are all caught up.`}=e,[x,S]=_(``),C=g(a);p(()=>{C.current!==a&&(C.current=a,S(a===0?`No unread notifications`:`${A(a)} unread notifications`))},[a]);let w=null;return o?.length?w=/* @__PURE__ */ y(`div`,{className:`wui-bell-items`,children:o.map((e,t)=>{let n=`wui-bell-item${e.read?` wui-bell-item-read`:``}`,r=/* @__PURE__ */ b(v,{children:[/* @__PURE__ */ y(`span`,{className:`wui-bell-dot`,"aria-hidden":`true`}),e.icon&&/* @__PURE__ */ y(`span`,{className:`wui-bell-icon`,children:/* @__PURE__ */ y(l,{name:e.icon,size:18})}),/* @__PURE__ */ b(`span`,{className:`wui-bell-body`,children:[!e.read&&/* @__PURE__ */ y(`span`,{className:`visually-hidden`,children:`Unread: `}),/* @__PURE__ */ y(`span`,{className:`wui-bell-item-title`,children:e.title}),e.time&&/* @__PURE__ */ y(`span`,{className:`wui-bell-when`,children:e.time})]})]});return e.href?/* @__PURE__ */ y(`a`,{className:n,href:e.href,"data-id":e.id,children:r},e.id??t):/* @__PURE__ */ y(`div`,{className:n,"data-id":e.id,children:r},e.id??t)})}):s?w=/* @__PURE__ */ y(`div`,{className:`wui-bell-state`,children:`Loading…`}):o&&(w=/* @__PURE__ */ y(`div`,{className:`wui-bell-state`,children:h})),/* @__PURE__ */ b(`div`,{className:`dropdown wui-bell`,ref:i,children:[/* @__PURE__ */ b(`button`,{type:`button`,id:t,className:`topbar-icon-btn wui-bell-trigger`,"aria-expanded":n,"aria-label":a===0?f:`${f}, ${A(a)} unread`,onClick:()=>{let e=!n;r(e),e&&c?.()},children:[/* @__PURE__ */ y(l,{name:`notification`,size:20}),/* @__PURE__ */ y(`span`,{className:`wui-bell-count`,"aria-hidden":`true`,hidden:a===0,children:A(a)})]}),/* @__PURE__ */ y(`span`,{className:`visually-hidden`,"aria-live":`polite`,children:x}),/* @__PURE__ */ b(`div`,{className:`dropdown-menu dropdown-menu-end wui-bell-menu${n?` show`:``}`,"aria-labelledby":t,"data-bs-popper":n?`static`:void 0,children:[/* @__PURE__ */ b(`div`,{className:`wui-bell-head`,children:[/* @__PURE__ */ y(`span`,{className:`wui-bell-title`,children:f}),u&&/* @__PURE__ */ y(`button`,{type:`button`,className:`wui-bell-markall`,onClick:u,children:`Mark all read`})]}),/* @__PURE__ */ y(`div`,{className:`wui-bell-list`,"aria-busy":s||void 0,children:w}),d&&/* @__PURE__ */ y(`a`,{className:`wui-bell-foot`,href:d,children:`View all`})]})]})}var B=e=>!!e&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName));function se({config:e}){let t=m(),{value:n=``,onChange:r,results:i=null,loading:a=!1,onSelect:o,onSubmit:s,placeholder:c=`Search`}=e,[u,d]=_(!1),[f,v]=_(!1),[x,S]=_({results:null,index:-1}),C=x.results===i?x.index:-1,w=e=>S({results:i,index:e}),T=g(null),E=g(null),D=g([]),O=h(()=>(i??[]).flatMap(e=>e.hits??[]),[i]),k=i!=null&&!f,A=O.length;p(()=>{let e=e=>{e.key!==`/`||e.ctrlKey||e.metaKey||e.altKey||B(e.target)||(e.preventDefault(),d(!0),E.current?.focus())},t=e=>{T.current?.contains(e.target)||(v(!0),d(!1))};return document.addEventListener(`keydown`,e),document.addEventListener(`pointerdown`,t),()=>{document.removeEventListener(`keydown`,e),document.removeEventListener(`pointerdown`,t)}},[]);let j=e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){if(!k||A===0)return;e.preventDefault(),w((C+(e.key===`ArrowDown`?1:-1)+A)%A)}else e.key===`Enter`?k&&C>=0&&D.current[C]?(e.preventDefault(),D.current[C].click()):s&&n.trim()!==``&&(e.preventDefault(),s(n.trim())):e.key===`Escape`&&(k?(e.preventDefault(),v(!0)):u&&(e.preventDefault(),d(!1)))},M=-1;return D.current=[],/* @__PURE__ */ b(`div`,{className:`wui-topsearch${u?` is-open`:``}${a?` is-loading`:``}`,ref:T,children:[/* @__PURE__ */ y(`button`,{type:`button`,className:`topbar-icon-btn wui-topsearch-open`,"aria-label":c,"aria-expanded":u,"aria-controls":`${t}-panel`,onClick:()=>{let e=!u;d(e),e&&E.current?.focus()},children:/* @__PURE__ */ y(l,{name:`search`,size:20})}),/* @__PURE__ */ b(`div`,{className:`wui-topsearch-panel`,id:`${t}-panel`,children:[/* @__PURE__ */ b(`div`,{className:`search-wrap`,children:[/* @__PURE__ */ y(l,{name:`search`,size:18,className:`search-icon`}),/* @__PURE__ */ y(`input`,{ref:E,type:`search`,className:`form-control input search-input`,id:`${t}-input`,placeholder:c,"aria-label":c,role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":k,"aria-controls":`${t}-list`,"aria-activedescendant":k&&C>=0?`${t}-opt-${C}`:void 0,autoComplete:`off`,value:n,onChange:e=>{v(!1),r?.(e.target.value)},onKeyDown:j})]}),/* @__PURE__ */ y(`div`,{className:`wui-topsearch-results`,id:`${t}-list`,role:`listbox`,"aria-label":`Search results`,hidden:!k,children:k&&/* @__PURE__ */ b(`div`,{className:`wui-topsearch-groups`,role:`presentation`,children:[A===0&&/* @__PURE__ */ b(`div`,{className:`wui-topsearch-empty`,role:`option`,"aria-disabled":`true`,"aria-selected":`false`,children:[`No results for “`,n,`”`]}),i.filter(e=>e.hits?.length).map((e,n)=>/* @__PURE__ */ b(`div`,{className:`wui-topsearch-group`,role:`group`,"aria-label":e.label??``,children:[e.label&&/* @__PURE__ */ y(`div`,{className:`wui-topsearch-group-label`,role:`presentation`,children:e.label}),e.hits.map(e=>{M+=1;let n=M;return/* @__PURE__ */ b(`a`,{className:`wui-topsearch-hit${n===C?` is-active`:``}`,role:`option`,"aria-selected":n===C,id:`${t}-opt-${n}`,href:e.href,ref:e=>{D.current[n]=e},onClick:t=>o?.(e,t),children:[e.icon&&/* @__PURE__ */ y(`span`,{className:`wui-topsearch-hit-icon`,children:/* @__PURE__ */ y(l,{name:e.icon,size:18})}),/* @__PURE__ */ b(`span`,{className:`wui-topsearch-hit-text`,children:[/* @__PURE__ */ y(`span`,{className:`wui-topsearch-hit-title`,children:e.title}),e.subtitle&&/* @__PURE__ */ y(`span`,{className:`wui-topsearch-hit-sub`,children:e.subtitle})]})]},`${e.href}-${n}`)})]},e.label??n))]})})]}),/* @__PURE__ */ y(`span`,{className:`visually-hidden`,"aria-live":`polite`,children:k?A===0?`No results`:`${A} ${A===1?`result`:`results`}`:``})]})}export{ee as default};
1
+ import{devWarn as e}from"../lib/devWarn.js";import t from"../lib/fillLabel.js";import{navMatchScore as n}from"../lib/navMatch.js";import{SHELL_FOLDED_COOKIE as r,readNavFolded as i,readShellCollapsed as a,writeNavFolded as o,writeShellCollapsed as s}from"../lib/shellCookie.js";import{splitMarkerProps as c}from"../lib/wuiMarker.js";import l from"./AppAvatar.js";import u from"./AppButton.js";import d from"./AppIcon.js";import f from"./AppNavigationMenu.js";import p from"./warnInvalidValue.js";import m from"./warnUnknownProps.js";import{initScrollEdges as h}from"@webority/ui-elements/helpers";import{useEffect as g,useId as _,useMemo as v,useRef as y,useState as b}from"react";import{Fragment as x,jsx as S,jsxs as C}from"react/jsx-runtime";var w=99,T=4,E=5,D=/^[a-z0-9-]+$/,O=[`prefix`,`exact`],k=[`comfortable`,`compact`],A=[`default`,`primary`],j=[`side`,`top`],M=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`],N=/* @__PURE__ */ new Set([`key`,`label`,`icon`,`iconVariant`,`iconSize`,`href`,`badge`,`badgeTone`,`badgeTitle`,`newUntil`,`trailingIcon`,`active`,`match`,`matchAlso`,`tab`,`tabLabel`,`children`]),P=e=>e>w?`${w}+`:String(e),F=new Intl.DateTimeFormat(`en-CA`,{timeZone:`Asia/Kolkata`}),I=e=>{if(typeof e!=`string`||!/^\d{4}-\d{2}-\d{2}$/.test(e))return!1;let t=/* @__PURE__ */ new Date(`${e}T00:00:00Z`);return Number.isNaN(t.getTime())||t.toISOString().slice(0,10)!==e?!1:F.format(/* @__PURE__ */ new Date)<=e},ee=({logoLight:e,logoDark:t,markLight:n,markDark:r})=>{let i=!!(n||r);return[`app-sidebar-brand`,i&&`wui-brand-has-mark`,i&&!e&&!t&&`wui-brand-mark-only`,(t||r)&&`wui-brand-themed`].filter(Boolean).join(` `)},L=({logoLight:e,logoDark:t,markLight:n,markDark:r,brandName:i})=>{let a=i??``,o=[e&&/* @__PURE__ */ S(`img`,{className:`wui-brand-logo wui-brand-light`,src:e,alt:a},`logo-light`),t&&/* @__PURE__ */ S(`img`,{className:`wui-brand-logo wui-brand-dark`,src:t,alt:``,"aria-hidden":`true`},`logo-dark`)],s=[n&&[`mark-light`,`wui-brand-mark wui-brand-light`,n],r&&[`mark-dark`,`wui-brand-mark wui-brand-dark`,r]].filter(Boolean).map(([t,n,r],i)=>i===0&&!e?/* @__PURE__ */ S(`img`,{className:n,src:r,alt:a},t):/* @__PURE__ */ S(`img`,{className:n,src:r,alt:``,"aria-hidden":`true`},t));return[...o,...s].filter(Boolean)};function R(e){let{marker:t,props:n}=c(`AppShell`,e),{groups:l=[],brand:u,logoLight:_,logoDark:x,markLight:w,markDark:T,brandName:E,sidebarStart:D,sidebarStartCompact:O,sidebarFooter:N,topbarStart:P,topbarEnd:F,footer:I,launcher:R,children:ne,collapsed:z,onCollapsedChange:re,noSidebar:B=!1,nav:V=`side`,density:U=`comfortable`,itemHeight:W,iconVariant:G,topbarTone:de=`default`,navLabel:fe=`Main navigation`,linkComponent:K,currentPath:pe,rememberCollapsed:me=!1,collapsedCookie:he=`wui-shell-collapsed`,foldedCookie:q=r,tabBarLabel:ge=`Quick navigation`,moreLabel:_e=`More`,skipLabel:ve=`Skip to content`,openNavLabel:ye=`Open navigation`,closeNavLabel:be=`Close navigation`,expandNavLabel:xe=`Expand navigation`,collapseNavLabel:Se=`Collapse navigation`,newLabel:Ce=`New`,togglePagesLabel:we=`Show or hide {name} pages`,accountMenuLabel:Te=`Account menu for {name}`,roleLabel:Ee=`Role:`,rolesLabel:De=`Roles:`,unreadLabel:Oe=`Unread`,markAllReadLabel:ke=`Mark all read`,viewAllLabel:Ae=`View all`,loadingNotificationsText:je=`Loading…`,noUnreadText:Me=`No unread notifications`,unreadNotificationsText:Ne=`{count} unread notifications`,unreadBellLabel:Pe=`{label}, {count} unread`,searchResultsLabel:Fe=`Search results`,noResultsText:Ie=`No results`,noResultsForText:Le=`No results for “{value}”`,resultsCountText:Re=`{count} results`,resultCountText:ze=`{count} result`,userMenu:Be,notifications:Ve,search:He,className:Ue=``,style:We,...Ge}=n;m(`AppShell`,Ge),p(`AppShell`,`density`,U,k),p(`AppShell`,`topbarTone`,de,A),p(`AppShell`,`nav`,V,j),p(`AppShell`,`iconVariant`,G,M);let Ke=W>0?{...We,"--wui-nav-item-height":`${W}px`}:We,[qe,Je]=b(()=>me&&z===void 0&&typeof document<`u`?a(he)??!1:!1),[J,Y]=b(!1),[Ye,Xe]=b(!1),[Ze,Qe]=b(!1),X=y(null),$e=y(null),et=y(null),Z=z??qe,tt=()=>{let e=!Z;z===void 0&&Je(e),me&&s(e,he),re?.(e)},nt=l.some(e=>e.collapsible),[rt,it]=b(()=>nt&&typeof document<`u`?i(q):/* @__PURE__ */ new Set),at=e=>{let t=new Set(rt);t.has(e)?t.delete(e):t.add(e),it(t),o(t,q)},Q=v(()=>te(l,pe),[l,pe]),$=B?null:ie(Q);g(()=>{let e=()=>Xe(window.scrollY>4);return e(),window.addEventListener(`scroll`,e,{passive:!0}),()=>window.removeEventListener(`scroll`,e)},[]),g(()=>{h()},[]),g(()=>{let e=X.current,t=e?.querySelector(`.app-nav-item[aria-current="page"]`);if(!e||!t)return;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();n.top<r.top?e.scrollTop-=r.top-n.top:n.bottom>r.bottom&&(e.scrollTop+=n.bottom-r.bottom)},[]),g(()=>{let e=X.current;if(!e)return;let t=()=>Qe(e.scrollHeight>e.clientHeight);if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[Q]);let ot=!!I;g(()=>{let e=et.current,t=$e.current;if(!ot||!e||!t)return;let n=()=>t.style.setProperty(`--app-footer-h`,`${e.offsetHeight}px`);n();let r=typeof ResizeObserver>`u`?null:new ResizeObserver(n);return r?.observe(e),()=>{r?.disconnect(),t.style.removeProperty(`--app-footer-h`)}},[ot]),g(()=>{if(!J)return;let e=e=>{e.key===`Escape`&&Y(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[J]);let st=[`app-shell`,Z?`collapsed`:``,B?`no-sidebar`:``,V===`top`?`wui-shell-top`:``,J?`mobile-open`:``,Ue].filter(Boolean).join(` `);return/* @__PURE__ */ C(`div`,{ref:$e,className:st,"data-density":U===`compact`?`compact`:void 0,"data-wui-folded-cookie":nt?q:void 0,style:Ke,...t,...Ge,children:[/* @__PURE__ */ S(`a`,{className:`wui-skip-link`,href:`#main-content`,children:ve}),/* @__PURE__ */ C(`aside`,{className:`app-sidebar`,children:[(u||_||x||w||T)&&/* @__PURE__ */ C(`div`,{className:ee({logoLight:_,logoDark:x,markLight:w,markDark:T}),children:[L({logoLight:_,logoDark:x,markLight:w,markDark:T,brandName:E}),u]}),D&&/* @__PURE__ */ S(`div`,{className:`app-sidebar-start`,children:D}),O&&/* @__PURE__ */ S(`div`,{className:`app-sidebar-start-compact`,children:O}),/* @__PURE__ */ S(`nav`,{className:`app-sidebar-scroll`,"aria-label":fe,ref:X,tabIndex:Ze?0:void 0,children:Q.map((e,t)=>{let n=e.items.map(e=>e.header==null?/* @__PURE__ */ S(se,{item:e,linkComponent:K,onNavigate:()=>Y(!1),iconVariant:G,newLabel:Ce,togglePagesLabel:we},e.key??e.href??e.label):/* @__PURE__ */ S(`div`,{className:`wui-nav-header`,children:e.header},e.key??e.header));if(!e.collapsible)return/* @__PURE__ */ C(`div`,{className:`app-nav-group`,children:[e.label&&/* @__PURE__ */ S(`div`,{className:`app-nav-group-label`,children:e.label}),n,e.after&&/* @__PURE__ */ S(`div`,{className:`wui-nav-group-after`,children:e.after})]},e.key??e.label??`group-${t}`);let r=!rt.has(e.key)||!!H(e.items),i=`wui-nav-group-${e.key}`;return/* @__PURE__ */ C(`div`,{className:`app-nav-group wui-nav-group-collapsible${r?``:` wui-nav-group-folded`}`,"data-wui-nav-group":e.key,children:[/* @__PURE__ */ C(`button`,{type:`button`,className:`app-nav-group-label wui-nav-group-toggle`,"aria-expanded":r,"aria-controls":i,onClick:()=>at(e.key),children:[/* @__PURE__ */ S(`span`,{className:`wui-nav-group-text`,children:e.label}),/* @__PURE__ */ S(`span`,{className:`wui-nav-group-caret`,children:/* @__PURE__ */ S(d,{name:`chevron-down`,size:16})})]}),/* @__PURE__ */ C(`div`,{className:`wui-nav-group-body`,id:i,children:[n,e.after&&/* @__PURE__ */ S(`div`,{className:`wui-nav-group-after`,children:e.after})]})]},e.key??`group-${t}`)})}),N&&/* @__PURE__ */ S(`div`,{className:`app-sidebar-foot`,children:N}),!B&&/* @__PURE__ */ S(`button`,{type:`button`,className:`app-sidebar-toggle`,onClick:tt,"aria-label":Z?xe:Se,"aria-expanded":!Z,children:/* @__PURE__ */ S(d,{name:`chevrons-left`,size:20})})]}),/* @__PURE__ */ C(`div`,{className:`app-main`,children:[/* @__PURE__ */ C(`header`,{className:`app-topbar${Ye?` scrolled`:``}`,"data-tone":de===`primary`?`primary`:void 0,children:[/* @__PURE__ */ C(`div`,{className:`app-topbar-start`,children:[/* @__PURE__ */ S(`button`,{type:`button`,className:`app-topbar-menu`,onClick:()=>Y(!0),"aria-label":ye,"aria-expanded":J,children:/* @__PURE__ */ S(d,{name:`menu`,size:18})}),V===`top`&&u&&/* @__PURE__ */ S(`div`,{className:`wui-shell-top-brand`,children:u}),V===`top`&&/* @__PURE__ */ S(`div`,{className:`wui-shell-top-nav`,children:/* @__PURE__ */ S(f,{items:ae(Q),ariaLabel:fe,linkComponent:K})}),P,He&&/* @__PURE__ */ S(ue,{config:He,searchResultsLabel:Fe,noResultsText:Ie,noResultsForText:Le,resultsCountText:Re,resultCountText:ze})]}),/* @__PURE__ */ C(`div`,{className:`app-topbar-end`,children:[F,Ve&&/* @__PURE__ */ S(le,{config:Ve,unreadLabel:Oe,markAllReadLabel:ke,viewAllLabel:Ae,loadingNotificationsText:je,noUnreadText:Me,unreadNotificationsText:Ne,unreadBellLabel:Pe}),Be&&/* @__PURE__ */ S(ce,{config:Be,linkComponent:K,accountMenuLabel:Te,roleLabel:Ee,rolesLabel:De})]})]}),/* @__PURE__ */ S(`main`,{className:`app-content`,id:`main-content`,children:ne}),I&&/* @__PURE__ */ S(`footer`,{className:`app-footer`,ref:et,children:I})]}),R&&/* @__PURE__ */ S(`div`,{className:`wui-shell-launcher`,children:R}),$&&/* @__PURE__ */ C(`nav`,{className:`wui-tabbar`,"aria-label":ge,children:[$.tabs.map(e=>/* @__PURE__ */ S(oe,{tab:e,linkComponent:K,iconVariant:G},e.key??e.href)),$.hasMore&&/* @__PURE__ */ C(`button`,{type:`button`,className:`wui-tabbar-item${$.moreActive?` active`:``}`,onClick:()=>Y(!0),children:[/* @__PURE__ */ S(`span`,{className:`wui-tabbar-icon`,children:/* @__PURE__ */ S(d,{name:`more`,size:24})}),/* @__PURE__ */ S(`span`,{className:`wui-tabbar-label`,children:_e})]})]}),/* @__PURE__ */ S(`button`,{type:`button`,className:`app-scrim`,onClick:()=>Y(!1),"aria-label":be,tabIndex:J?0:-1})]})}function te(e,t){for(let t of e)t.collapsible&&V(t);let r=(e,t=!1)=>(e??[]).map(e=>Array.isArray(e.children)?{...e,children:r(e.children)}:{...e}).filter(e=>z(e)?t:(e.children?.length??0)>0||!!e.href),i=e.map(e=>({...e,items:re(r(e.items,!0))})).filter(e=>e.items.some(e=>!z(e))),a=[],o=e=>{for(let t of e)z(t)||(a.push(t),t.children&&o(t.children))};for(let e of i)o(e.items);for(let e of a)m(`AppShell items`,ne(e)),p(`AppShell`,`match`,e.match,O),p(`AppShell`,`iconVariant`,e.iconVariant,M);let s=null;if(t!=null&&!a.some(e=>e.active===!0)){let e=-1;for(let r of a){if(r.active!=null||r.children?.length&&!r.href)continue;let i=n(t,r.href,{exact:r.match===`exact`,also:r.matchAlso});if(i<0)continue;let a=r.match===`exact`&&n(t,r.href,{exact:!0})>=0?1/0:i;a>e&&(e=a,s=r)}}for(let e of a)e.active=e.active??e===s;return i}function ne(e){return Object.fromEntries(Object.entries(e).filter(([e])=>!N.has(e)))}var z=e=>e.header!=null;function re(e){return e.filter((t,n)=>{if(!z(t))return!0;let r=e.findIndex((e,t)=>t>n&&z(e));return e.slice(n+1,r<0?void 0:r).length>0})}var B=/* @__PURE__ */ new Set;function V(t){if(t.key!=null&&D.test(t.key))return;let n=t.key==null?`<AppShell> a collapsible group needs a key so its folded state can be remembered.`:`<AppShell> collapsible group key "${t.key}" must use lower-case letters, digits and hyphens.`,r=!0;try{r=process.env.NODE_ENV!==`production`}catch{r=!0}r&&!B.has(n)&&(B.add(n),e(n))}function ie(e){let t=[],n=e=>{for(let r of e)z(r)||(r.children?.length?n(r.children):t.push(r))};for(let t of e)n(t.items);let r=t.filter(e=>e.tab);if(r.length===0)return null;let i=r.length<t.length,a=i?T:E;if(r.length>a)throw Error(`<AppShell>: ${r.length} items carry tab: true, but the phone tab bar holds ${a} (${i?`4 plus More, because other items exist`:`5 when every item is a tab`}). Flag fewer items.`);return{tabs:r,hasMore:i,moreActive:t.some(e=>!e.tab&&e.active)}}function ae(e){let t=e=>({key:e.key??e.href??e.label,label:e.label,to:e.href,current:!!e.active}),n=e=>e.flatMap(e=>z(e)?[]:[...e.href?[{...t(e),icon:e.icon}]:[],...n(e.children??[])]),r=[];for(let i of e.flatMap(e=>e.items)){if(z(i))continue;let e=n(i.children??[]);if(e.length>0){let n=i.href?[{...t(i),icon:i.icon}]:[];r.push({key:t(i).key,label:i.label,links:[...n,...e]})}else i.href&&r.push(t(i))}return r}function oe({tab:e,linkComponent:t,iconVariant:n}){let r=`wui-tabbar-item${e.active?` active`:``}`,i=/* @__PURE__ */ C(x,{children:[e.icon&&/* @__PURE__ */ S(`span`,{className:`wui-tabbar-icon`,children:typeof e.icon==`string`?/* @__PURE__ */ S(d,{name:e.icon,size:24,variant:e.iconVariant??n}):e.icon}),/* @__PURE__ */ S(`span`,{className:`wui-tabbar-label`,children:e.tabLabel??e.label}),e.badge!=null&&/* @__PURE__ */ S(`span`,{className:`wui-tabbar-badge${e.badgeTone?` tone-${e.badgeTone}`:``}`,title:e.badgeTitle||void 0,children:e.badge})]}),a=e.active?`page`:void 0;return t?/* @__PURE__ */ S(t,{className:r,to:e.href,"aria-current":a,children:i}):/* @__PURE__ */ S(`a`,{className:r,href:e.href,"aria-current":a,children:i})}function H(e){for(let t of e){if(t.active)return t;let e=t.children?.length?H(t.children):void 0;if(e)return e}}function se({item:e,linkComponent:n,onNavigate:r,depth:i=0,iconVariant:a,newLabel:o,togglePagesLabel:s}){let c=i>0,l=i>1?` wui-nav-depth-${Math.min(i,6)}`:``,u=Array.isArray(e.children)&&e.children.length>0,f=u?H(e.children):void 0,p=!!f,m=f?f.key??f.href??f.label:null,[h,_]=b(p);g(()=>{m!=null&&_(!0)},[m]);let v=typeof e.label==`string`?e.label:void 0,y=!c&&e.icon&&/* @__PURE__ */ S(`span`,{className:`app-nav-icon`,children:typeof e.icon==`string`?/* @__PURE__ */ S(d,{name:e.icon,size:e.iconSize??22,variant:e.iconVariant??a}):e.icon}),w=e.badge!=null&&/* @__PURE__ */ S(`span`,{className:`app-nav-badge${e.badgeTone?` tone-${e.badgeTone}`:``}`,title:e.badgeTitle||void 0,children:e.badge}),T=I(e.newUntil)&&/* @__PURE__ */ S(`span`,{className:`wui-nav-new`,children:o}),E=/* @__PURE__ */ C(x,{children:[y,/* @__PURE__ */ S(`span`,{className:`app-nav-text`,children:e.label}),T,w,e.trailingIcon&&/* @__PURE__ */ S(`span`,{className:`app-nav-trailing`,children:typeof e.trailingIcon==`string`?/* @__PURE__ */ S(d,{name:e.trailingIcon,size:16}):e.trailingIcon})]}),D=e.active?`page`:void 0;if(u){let u=/* @__PURE__ */ S(`div`,{className:`app-nav-sub${h?` expanded`:``}`,inert:!h,"aria-hidden":!h||void 0,children:/* @__PURE__ */ S(`div`,{className:`app-nav-sub-inner`,children:e.children.map(e=>/* @__PURE__ */ S(se,{item:e,linkComponent:n,onNavigate:r,depth:i+1,iconVariant:a,newLabel:o,togglePagesLabel:s},e.key??e.href))})});if(e.href){let i=n?/* @__PURE__ */ S(n,{className:`wui-nav-split-link`,to:e.href,"aria-current":D,onClick:r,children:E}):/* @__PURE__ */ S(`a`,{className:`wui-nav-split-link`,href:e.href,"aria-current":D,onClick:r,children:E});return/* @__PURE__ */ C(x,{children:[/* @__PURE__ */ C(`div`,{className:`app-nav-item has-children wui-nav-split${c?` app-nav-subitem`:``}${p||e.active?` active`:``}${l}`,"data-label":v,children:[i,/* @__PURE__ */ S(`button`,{type:`button`,className:`app-nav-caret wui-nav-split-toggle`,"aria-expanded":h,"aria-label":t(s,{name:v??``}),onClick:()=>_(e=>!e),children:/* @__PURE__ */ S(d,{name:`chevron-right`,size:16})})]}),u]})}return/* @__PURE__ */ C(x,{children:[/* @__PURE__ */ C(`button`,{type:`button`,className:`app-nav-item${c?` app-nav-subitem`:``} has-children${p?` active`:``}${l}`,"aria-expanded":h,"data-label":v,onClick:()=>_(e=>!e),children:[y,/* @__PURE__ */ S(`span`,{className:`app-nav-text`,children:e.label}),T,w,/* @__PURE__ */ S(`span`,{className:`app-nav-caret`,children:/* @__PURE__ */ S(d,{name:`chevron-right`,size:16})})]}),u]})}let O=`app-nav-item${c?` app-nav-subitem`:``}${e.active?` active`:``}${l}`;return n?/* @__PURE__ */ S(n,{className:O,to:e.href,"aria-current":D,"data-label":v,onClick:r,children:E}):/* @__PURE__ */ S(`a`,{className:O,href:e.href,"aria-current":D,"data-label":v,onClick:r,children:E})}function U(){let[e,t]=b(!1),n=y(null);return g(()=>{if(!e)return;let r=e=>{n.current?.contains(e.target)||t(!1)},i=e=>{e.key===`Escape`&&(t(!1),n.current?.querySelector(`button`)?.focus())};return document.addEventListener(`mousedown`,r),document.addEventListener(`keydown`,i),()=>{document.removeEventListener(`mousedown`,r),document.removeEventListener(`keydown`,i)}},[e]),{open:e,setOpen:t,ref:n}}function ce({config:e,linkComponent:n,accountMenuLabel:r,roleLabel:i,rolesLabel:a}){let o=_(),{open:s,setOpen:c,ref:f}=U(),{name:m,role:h,roles:g=[],photo:v,profileHref:y,profileLabel:b=`My profile`,onLogout:w,logoutAction:T,logoutLabel:E=`Sign out`,head:D,section:O,logoutVariant:k=`item`,items:A=[]}=e;if(p(`AppShell`,`userMenu.logoutVariant`,k,[`item`,`button`]),!m)throw Error(`<AppShell> userMenu.name is required; the trigger and the avatar are named from it.`);let j=g.map(e=>(e??``).trim()).filter(Boolean),M=()=>c(!1),N=(e,t,r,i)=>n?/* @__PURE__ */ S(n,{className:`dropdown-item`,to:e,onClick:i,children:t},r):/* @__PURE__ */ S(`a`,{className:`dropdown-item`,href:e,onClick:i,children:t},r),P=/* @__PURE__ */ S(d,{name:`log-out`,size:18}),F=/* @__PURE__ */ C(x,{children:[P,E]});return/* @__PURE__ */ C(`div`,{className:`dropdown wui-usermenu`,ref:f,children:[/* @__PURE__ */ C(`button`,{type:`button`,id:o,className:`wui-usermenu-trigger`,"aria-expanded":s,"aria-label":t(r,{name:m}),onClick:()=>c(e=>!e),children:[/* @__PURE__ */ S(l,{name:m,src:v,tone:`auto`}),/* @__PURE__ */ C(`span`,{className:`wui-usermenu-text`,children:[/* @__PURE__ */ S(`span`,{className:`wui-usermenu-name`,children:m}),h&&/* @__PURE__ */ S(`span`,{className:`wui-usermenu-role`,children:h})]}),/* @__PURE__ */ S(d,{name:`chevron-down`,size:14,className:`wui-usermenu-caret`})]}),/* @__PURE__ */ C(`div`,{className:`dropdown-menu dropdown-menu-end wui-usermenu-menu${s?` show`:``}`,"aria-labelledby":o,"data-bs-popper":s?`static`:void 0,children:[/* @__PURE__ */ C(`div`,{className:`wui-usermenu-head`,children:[/* @__PURE__ */ S(l,{name:m,src:v,size:`lg`,tone:`auto`}),/* @__PURE__ */ C(`div`,{className:`wui-usermenu-who`,children:[/* @__PURE__ */ S(`div`,{className:`wui-usermenu-name`,children:m}),h&&/* @__PURE__ */ S(`div`,{className:`wui-usermenu-role`,children:h}),j.length>0&&/* @__PURE__ */ C(`div`,{className:`wui-usermenu-roles`,children:[/* @__PURE__ */ S(`span`,{className:`wui-usermenu-roles-label`,children:j.length===1?i:a}),` ${j.join(`, `)}`]}),D?/* @__PURE__ */ S(`div`,{className:`wui-usermenu-extra`,children:D}):null]})]}),O?/* @__PURE__ */ S(`div`,{className:`wui-usermenu-section`,children:O}):null,y&&N(y,/* @__PURE__ */ C(x,{children:[/* @__PURE__ */ S(d,{name:`user`,size:18}),b]}),void 0,M),A.map(e=>{if(e.divider)return/* @__PURE__ */ S(`hr`,{className:`dropdown-divider`},e.key);let t=/* @__PURE__ */ C(x,{children:[e.icon&&/* @__PURE__ */ S(d,{name:e.icon,size:18}),e.label]}),n=()=>{e.onClick?.(),M()};return e.href?N(e.href,t,e.key,n):/* @__PURE__ */ S(`button`,{type:`button`,className:`dropdown-item`,onClick:n,children:t},e.key)}),k===`button`?(T||w)&&/* @__PURE__ */ S(`div`,{className:`wui-usermenu-foot`,children:T?/* @__PURE__ */ S(`form`,{method:`post`,action:T,className:`wui-usermenu-logout`,children:/* @__PURE__ */ S(u,{type:`submit`,variant:`secondary-danger`,block:!0,leftIcon:P,children:E})}):/* @__PURE__ */ S(u,{type:`button`,variant:`secondary-danger`,block:!0,leftIcon:P,onClick:()=>{M(),w()},children:E})}):T?/* @__PURE__ */ S(`form`,{method:`post`,action:T,className:`wui-usermenu-logout`,children:/* @__PURE__ */ S(`button`,{type:`submit`,className:`dropdown-item danger`,children:F})}):w&&/* @__PURE__ */ S(`button`,{type:`button`,className:`dropdown-item danger`,onClick:()=>{M(),w()},children:F})]})]})}function le({config:e,unreadLabel:n,markAllReadLabel:r,viewAllLabel:i,loadingNotificationsText:a,noUnreadText:o,unreadNotificationsText:s,unreadBellLabel:c}){let l=_(),{open:u,setOpen:f,ref:p}=U(),{unread:m=0,items:h,loading:v=!1,onOpen:w,onMarkAllRead:T,viewAllHref:E,label:D=`Notifications`,emptyText:O=`You are all caught up.`}=e,[k,A]=b(``),j=y(m);g(()=>{j.current!==m&&(j.current=m,A(m===0?o:t(s,{count:P(m)})))},[m,o,s]);let M=null;return h?.length?M=/* @__PURE__ */ S(`div`,{className:`wui-bell-items`,children:h.map((e,t)=>{let r=`wui-bell-item${e.read?` wui-bell-item-read`:``}`,i=/* @__PURE__ */ C(x,{children:[/* @__PURE__ */ S(`span`,{className:`wui-bell-dot`,"aria-hidden":`true`}),e.icon&&/* @__PURE__ */ S(`span`,{className:`wui-bell-icon`,children:/* @__PURE__ */ S(d,{name:e.icon,size:18})}),/* @__PURE__ */ C(`span`,{className:`wui-bell-body`,children:[!e.read&&/* @__PURE__ */ C(`span`,{className:`visually-hidden`,children:[n,`: `]}),/* @__PURE__ */ S(`span`,{className:`wui-bell-item-title`,children:e.title}),e.time&&/* @__PURE__ */ S(`span`,{className:`wui-bell-when`,children:e.time})]})]});return e.href?/* @__PURE__ */ S(`a`,{className:r,href:e.href,"data-id":e.id,children:i},e.id??t):/* @__PURE__ */ S(`div`,{className:r,"data-id":e.id,children:i},e.id??t)})}):v?M=/* @__PURE__ */ S(`div`,{className:`wui-bell-state`,children:a}):h&&(M=/* @__PURE__ */ S(`div`,{className:`wui-bell-state`,children:O})),/* @__PURE__ */ C(`div`,{className:`dropdown wui-bell`,ref:p,children:[/* @__PURE__ */ C(`button`,{type:`button`,id:l,className:`topbar-icon-btn wui-bell-trigger`,"aria-expanded":u,"aria-label":m===0?D:t(c,{label:D,count:P(m)}),onClick:()=>{let e=!u;f(e),e&&w?.()},children:[/* @__PURE__ */ S(d,{name:`notification`,size:20}),/* @__PURE__ */ S(`span`,{className:`wui-bell-count`,"aria-hidden":`true`,hidden:m===0,children:P(m)})]}),/* @__PURE__ */ S(`span`,{className:`visually-hidden`,"aria-live":`polite`,children:k}),/* @__PURE__ */ C(`div`,{className:`dropdown-menu dropdown-menu-end wui-bell-menu${u?` show`:``}`,"aria-labelledby":l,"data-bs-popper":u?`static`:void 0,children:[/* @__PURE__ */ C(`div`,{className:`wui-bell-head`,children:[/* @__PURE__ */ S(`span`,{className:`wui-bell-title`,children:D}),T&&/* @__PURE__ */ S(`button`,{type:`button`,className:`wui-bell-markall`,onClick:T,children:r})]}),/* @__PURE__ */ S(`div`,{className:`wui-bell-list`,"aria-busy":v||void 0,children:M}),E&&/* @__PURE__ */ S(`a`,{className:`wui-bell-foot`,href:E,children:i})]})]})}var W=e=>!!e&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName));function ue({config:e,searchResultsLabel:n,noResultsText:r,noResultsForText:i,resultsCountText:a,resultCountText:o}){let s=_(),{value:c=``,onChange:l,results:u=null,loading:f=!1,onSelect:p,onSubmit:m,placeholder:h=`Search`}=e,[x,w]=b(!1),[T,E]=b(!1),[D,O]=b({results:null,index:-1}),k=D.results===u?D.index:-1,A=e=>O({results:u,index:e}),j=y(null),M=y(null),N=y([]),P=v(()=>(u??[]).flatMap(e=>e.hits??[]),[u]),F=u!=null&&!T,I=P.length;g(()=>{let e=e=>{e.key!==`/`||e.ctrlKey||e.metaKey||e.altKey||W(e.target)||(e.preventDefault(),w(!0),M.current?.focus())},t=e=>{j.current?.contains(e.target)||(E(!0),w(!1))};return document.addEventListener(`keydown`,e),document.addEventListener(`pointerdown`,t),()=>{document.removeEventListener(`keydown`,e),document.removeEventListener(`pointerdown`,t)}},[]);let ee=e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){if(!F||I===0)return;e.preventDefault(),A((k+(e.key===`ArrowDown`?1:-1)+I)%I)}else e.key===`Enter`?F&&k>=0&&N.current[k]?(e.preventDefault(),N.current[k].click()):m&&c.trim()!==``&&(e.preventDefault(),m(c.trim())):e.key===`Escape`&&(F?(e.preventDefault(),E(!0)):x&&(e.preventDefault(),w(!1)))},L=-1;return N.current=[],/* @__PURE__ */ C(`div`,{className:`wui-topsearch${x?` is-open`:``}${f?` is-loading`:``}`,ref:j,children:[/* @__PURE__ */ S(`button`,{type:`button`,className:`topbar-icon-btn wui-topsearch-open`,"aria-label":h,"aria-expanded":x,"aria-controls":`${s}-panel`,onClick:()=>{let e=!x;w(e),e&&M.current?.focus()},children:/* @__PURE__ */ S(d,{name:`search`,size:20})}),/* @__PURE__ */ C(`div`,{className:`wui-topsearch-panel`,id:`${s}-panel`,children:[/* @__PURE__ */ C(`div`,{className:`search-wrap`,children:[/* @__PURE__ */ S(d,{name:`search`,size:18,className:`search-icon`}),/* @__PURE__ */ S(`input`,{ref:M,type:`search`,className:`form-control input search-input`,id:`${s}-input`,placeholder:h,"aria-label":h,role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":F,"aria-controls":`${s}-list`,"aria-activedescendant":F&&k>=0?`${s}-opt-${k}`:void 0,autoComplete:`off`,value:c,onChange:e=>{E(!1),l?.(e.target.value)},onKeyDown:ee})]}),/* @__PURE__ */ S(`div`,{className:`wui-topsearch-results`,id:`${s}-list`,role:`listbox`,"aria-label":n,hidden:!F,children:F&&/* @__PURE__ */ C(`div`,{className:`wui-topsearch-groups`,role:`presentation`,children:[I===0&&/* @__PURE__ */ S(`div`,{className:`wui-topsearch-empty`,role:`option`,"aria-disabled":`true`,"aria-selected":`false`,children:t(i,{value:c})}),u.filter(e=>e.hits?.length).map((e,t)=>/* @__PURE__ */ C(`div`,{className:`wui-topsearch-group`,role:`group`,"aria-label":e.label??``,children:[e.label&&/* @__PURE__ */ S(`div`,{className:`wui-topsearch-group-label`,role:`presentation`,children:e.label}),e.hits.map(e=>{L+=1;let t=L;return/* @__PURE__ */ C(`a`,{className:`wui-topsearch-hit${t===k?` is-active`:``}`,role:`option`,"aria-selected":t===k,id:`${s}-opt-${t}`,href:e.href,ref:e=>{N.current[t]=e},onClick:t=>p?.(e,t),children:[e.icon&&/* @__PURE__ */ S(`span`,{className:`wui-topsearch-hit-icon`,children:/* @__PURE__ */ S(d,{name:e.icon,size:18})}),/* @__PURE__ */ C(`span`,{className:`wui-topsearch-hit-text`,children:[/* @__PURE__ */ S(`span`,{className:`wui-topsearch-hit-title`,children:e.title}),e.subtitle&&/* @__PURE__ */ S(`span`,{className:`wui-topsearch-hit-sub`,children:e.subtitle})]})]},`${e.href}-${t}`)})]},e.label??t))]})})]}),/* @__PURE__ */ S(`span`,{className:`visually-hidden`,"aria-live":`polite`,children:F?I===0?r:t(I===1?o:a,{count:I}):``})]})}export{R as default};
@@ -1 +1 @@
1
- import e from"../lib/FieldMessage.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./AppRequiredMark.js";import r,{readRange as i,writeNumberValue as a}from"./useWuiControl.js";import o from"./warnInvalidValue.js";import s from"./warnUnknownProps.js";import{forwardRef as c,useEffect as l,useId as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";import"@webority/ui-elements/elements/slider";var p=[`sm`,`md`,`lg`],m=c(function(c,m){let{marker:h,props:g}=t(`AppSlider`,c),{value:_,start:v,end:y,range:b=!1,onChange:x,label:S,required:C=!1,optional:w=!1,hint:T,error:E,name:D,startName:O,endName:k,min:A=0,max:j=100,step:M=1,disabled:N,size:P,showValue:F,unit:I,id:L,ariaLabel:R,className:z=``,fieldClassName:B=``,...V}=g;s(`AppSlider`,V),o(`AppSlider`,`size`,P,p);let H=u(),U=L||H,W=b,{setRef:G,innerRef:K}=r({ref:m,value:W?void 0:_,onChange:x,readValue:W?i:void 0,writeValue:W?void 0:a});l(()=>{if(!W)return;let e=K.current;e&&(v!==void 0&&v>e.end?(y!==void 0&&e.end!==y&&(e.end=y),v!==void 0&&e.start!==v&&(e.start=v)):(v!==void 0&&e.start!==v&&(e.start=v),y!==void 0&&e.end!==y&&(e.end=y)))},[v,y,W,K]);let q=!S&&!E&&!T,J=E?`${U}-error`:void 0,Y=T?`${U}-hint`:void 0,X=/* @__PURE__ */ d(`wui-slider`,{ref:G,id:U,name:D||void 0,"start-name":O||void 0,"end-name":k||void 0,min:A,max:j,step:M,size:P||void 0,"aria-label":R||(typeof S==`string`?S:void 0),"aria-describedby":J||Y,"aria-invalid":E?`true`:void 0,disabled:N?``:void 0,required:C?``:void 0,range:W?``:void 0,"show-value":F?``:void 0,unit:I||void 0,className:z||void 0,...q?h:null,...V});return q?X:/* @__PURE__ */ f(`div`,{...h,className:`field${B?` ${B}`:``}`,children:[S&&/* @__PURE__ */ f(`label`,{className:`label`,htmlFor:U,children:[S,w&&!C&&/* @__PURE__ */ d(`span`,{className:`label-optional`,children:` (optional)`}),C&&/* @__PURE__ */ d(n,{})]}),X,/* @__PURE__ */ d(e,{error:E,hint:T,errorId:J,hintId:Y})]})});export{m as default};
1
+ import e from"../lib/FieldMessage.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./AppInfoTip.js";import r from"./AppRequiredMark.js";import i,{readRange as ee,writeNumberValue as te}from"./useWuiControl.js";import ne from"./warnInvalidValue.js";import a from"./warnUnknownProps.js";import{forwardRef as o,useEffect as s,useId as c,useRef as re}from"react";import{jsx as l,jsxs as u}from"react/jsx-runtime";import"@webority/ui-elements/elements/slider";var d=[`sm`,`md`,`lg`],f=o(function(o,f){let{marker:p,props:m}=t(`AppSlider`,o),{value:h,start:g,end:_,range:v=!1,onChange:y,label:b,required:x=!1,optional:ie=!1,hint:S,error:C,name:ae,startName:oe,endName:w,min:T=0,max:E=100,step:D=1,disabled:O,readOnly:k=!1,loading:A=!1,defaultValue:j,defaultStart:M,defaultEnd:N,size:P,showValue:F,unit:I,id:L,ariaLabel:R,className:z=``,fieldClassName:B=``,help:V,helpLabel:H=`More information`,optionalLabel:U=`(optional)`,...W}=m;a(`AppSlider`,W),ne(`AppSlider`,`size`,P,d);let G=c(),K=L||G,q=v,{setRef:se,innerRef:J}=i({ref:f,value:q?void 0:h,onChange:y,readValue:q?ee:void 0,writeValue:q?void 0:te}),Y=re(!1);s(()=>{if(!q)return;let e=J.current;if(!e)return;let t=g===void 0?Y.current?void 0:M:g,n=_===void 0?Y.current?void 0:N:_;Y.current=!0,t!==void 0&&t>e.end?(n!==void 0&&e.end!==n&&(e.end=n),t!==void 0&&e.start!==t&&(e.start=t)):(t!==void 0&&e.start!==t&&(e.start=t),n!==void 0&&e.end!==n&&(e.end=n))},[g,_,M,N,q,J]);let X=!b&&!C&&!S,Z=C?`${K}-error`:void 0,Q=S?`${K}-hint`:void 0,$=/* @__PURE__ */ l(`wui-slider`,{ref:se,id:K,name:ae||void 0,"start-name":oe||void 0,"end-name":w||void 0,min:T,max:E,step:D,size:P||void 0,value:(h??j)!=null&&!q?String(h??j):void 0,"aria-label":R||(typeof b==`string`?b:void 0),"aria-describedby":Z||Q,"aria-invalid":C?`true`:void 0,disabled:O?``:void 0,readonly:k?``:void 0,loading:A?``:void 0,required:x?``:void 0,range:q?``:void 0,"show-value":F?``:void 0,unit:I||void 0,className:z||void 0,...X?p:null,...W});return X?$:/* @__PURE__ */ u(`div`,{...p,className:`field${B?` ${B}`:``}`,children:[b&&/* @__PURE__ */ u(`label`,{className:`label`,htmlFor:K,children:[b,ie&&!x&&/* @__PURE__ */ l(`span`,{className:`label-optional`,children:` ${U}`}),x&&/* @__PURE__ */ l(r,{}),V&&/* @__PURE__ */ l(n,{label:H,children:V})]}),$,/* @__PURE__ */ l(e,{error:C,hint:S,errorId:Z,hintId:Q})]})});export{f as default};