@webority/ui-react 0.164.0 → 0.167.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. package/LICENSE +1 -1
  2. package/dist/canvas-kit/kit.js +225 -223
  3. package/dist/canvas-kit/manifest.json +1334 -435
  4. package/dist/canvas-kit/release.json +6 -6
  5. package/dist/components/AppAsyncBlock.js +1 -1
  6. package/dist/components/AppAvatar.js +1 -1
  7. package/dist/components/AppAvatarGroup.js +1 -1
  8. package/dist/components/AppBanner.js +1 -1
  9. package/dist/components/AppBreadcrumbs.js +1 -1
  10. package/dist/components/AppButton.js +1 -1
  11. package/dist/components/AppCalendar.js +1 -1
  12. package/dist/components/AppCard.js +1 -1
  13. package/dist/components/AppCarousel.js +1 -1
  14. package/dist/components/AppCell.js +1 -1
  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/AppChip.js +1 -1
  19. package/dist/components/AppChipGroup.js +1 -1
  20. package/dist/components/AppChoiceCard.js +1 -1
  21. package/dist/components/AppChoiceChip.js +1 -1
  22. package/dist/components/AppColorField.js +1 -1
  23. package/dist/components/AppColumnMenu.js +1 -1
  24. package/dist/components/AppCommandPalette.js +1 -1
  25. package/dist/components/AppCommentThread.js +1 -1
  26. package/dist/components/AppCompareTable.js +1 -1
  27. package/dist/components/AppConfirmDialog.js +1 -1
  28. package/dist/components/AppConfirmProvider.js +1 -1
  29. package/dist/components/AppContextMenu.js +1 -1
  30. package/dist/components/AppCopyButton.js +1 -1
  31. package/dist/components/AppDataTable.js +1 -1
  32. package/dist/components/AppDatePicker.js +1 -1
  33. package/dist/components/AppDateRangePicker.js +1 -1
  34. package/dist/components/AppDescriptions.js +1 -1
  35. package/dist/components/AppDrawer.js +1 -1
  36. package/dist/components/AppDropZone.js +1 -1
  37. package/dist/components/AppDropdown.js +1 -1
  38. package/dist/components/AppDueDate.js +1 -1
  39. package/dist/components/AppEntryGrid.js +1 -0
  40. package/dist/components/AppErrorBoundary.js +1 -1
  41. package/dist/components/AppErrorSummary.js +1 -1
  42. package/dist/components/AppFileAttachment.js +1 -1
  43. package/dist/components/AppFilePicker.js +1 -1
  44. package/dist/components/AppFilterBar.js +1 -1
  45. package/dist/components/AppFloatingDock.js +1 -1
  46. package/dist/components/AppForm.js +1 -1
  47. package/dist/components/AppFormulaSteps.js +1 -0
  48. package/dist/components/AppHoverCard.js +1 -1
  49. package/dist/components/AppImagePicker.js +1 -1
  50. package/dist/components/AppInfoTip.js +1 -1
  51. package/dist/components/AppInlineEdit.js +1 -1
  52. package/dist/components/AppInput.js +1 -1
  53. package/dist/components/AppInputGroup.js +1 -1
  54. package/dist/components/AppKanban.js +1 -1
  55. package/dist/components/AppMentionInput.js +1 -1
  56. package/dist/components/AppMetricStrip.js +1 -1
  57. package/dist/components/AppModal.js +1 -1
  58. package/dist/components/AppNavigationMenu.js +1 -1
  59. package/dist/components/AppNotificationCenter.js +1 -1
  60. package/dist/components/AppNumberInput.js +1 -1
  61. package/dist/components/AppOnboardingChecklist.js +1 -1
  62. package/dist/components/AppOrgTree.js +1 -1
  63. package/dist/components/AppOtpInput.js +1 -1
  64. package/dist/components/AppPageHeader.js +1 -1
  65. package/dist/components/AppPhoneNumberInput.js +1 -1
  66. package/dist/components/AppPopover.js +1 -1
  67. package/dist/components/AppPricingCard.js +1 -1
  68. package/dist/components/AppQrCode.js +1 -1
  69. package/dist/components/AppRadio.js +1 -1
  70. package/dist/components/AppRadioGroup.js +1 -1
  71. package/dist/components/AppRating.js +1 -1
  72. package/dist/components/AppRecordPager.js +1 -1
  73. package/dist/components/AppRelativeTime.js +1 -1
  74. package/dist/components/AppRepeater.js +1 -1
  75. package/dist/components/AppRichText.js +1 -1
  76. package/dist/components/AppRouteError.js +1 -1
  77. package/dist/components/AppRowActions.js +1 -0
  78. package/dist/components/AppScoreScale.js +1 -1
  79. package/dist/components/AppSearch.js +1 -1
  80. package/dist/components/AppSectionFeatures.js +1 -1
  81. package/dist/components/AppSectionLeadCapture.js +1 -1
  82. package/dist/components/AppSectionLogos.js +1 -1
  83. package/dist/components/AppSegmented.js +1 -1
  84. package/dist/components/AppSelect.js +1 -1
  85. package/dist/components/AppShell.js +1 -1
  86. package/dist/components/AppShortcutLegend.js +1 -1
  87. package/dist/components/AppShowMore.js +1 -1
  88. package/dist/components/AppSlider.js +1 -1
  89. package/dist/components/AppSortableList.js +1 -1
  90. package/dist/components/AppSparkline.js +1 -1
  91. package/dist/components/AppSpinner.js +1 -1
  92. package/dist/components/AppSplash.js +1 -1
  93. package/dist/components/AppSplitButton.js +1 -1
  94. package/dist/components/AppSplitView.js +1 -1
  95. package/dist/components/AppStatusBadge.js +1 -1
  96. package/dist/components/AppStepper.js +1 -1
  97. package/dist/components/AppSwitch.js +1 -1
  98. package/dist/components/AppTablePagination.js +1 -1
  99. package/dist/components/AppTableToolbar.js +1 -1
  100. package/dist/components/AppTabs.js +1 -1
  101. package/dist/components/AppTextarea.js +1 -1
  102. package/dist/components/AppThemeToggle.js +1 -1
  103. package/dist/components/AppTimePicker.js +1 -1
  104. package/dist/components/AppTimeline.js +1 -1
  105. package/dist/components/AppToast.js +1 -1
  106. package/dist/components/AppUpdateBar.js +1 -1
  107. package/dist/components/AppWhatsNew.js +1 -1
  108. package/dist/components/AppWizard.js +1 -1
  109. package/dist/components/AppWorkspaceSwitcher.js +1 -1
  110. package/dist/components/toast.js +1 -1
  111. package/dist/guidance.json +220 -140
  112. package/dist/hookForm/index.js +1 -0
  113. package/dist/lib/CheckField.js +1 -1
  114. package/dist/lib/FileItemRow.js +1 -1
  115. package/dist/lib/emptyValue.js +1 -1
  116. package/dist/lib/fieldState.js +1 -1
  117. package/dist/lib/formFields.js +1 -0
  118. package/dist/lib/useWuiText.js +1 -0
  119. package/dist/types/components/AppAsyncBlock.d.ts +3 -3
  120. package/dist/types/components/AppChart.d.ts +12 -4
  121. package/dist/types/components/AppColorField.d.ts +3 -3
  122. package/dist/types/components/AppDataTable.d.ts +29 -2
  123. package/dist/types/components/AppDatePicker.d.ts +2 -1
  124. package/dist/types/components/AppDateRangePicker.d.ts +5 -1
  125. package/dist/types/components/AppDescriptions.d.ts +6 -0
  126. package/dist/types/components/AppDropdown.d.ts +6 -0
  127. package/dist/types/components/AppEntryGrid.d.ts +164 -0
  128. package/dist/types/components/AppFilterBar.d.ts +12 -1
  129. package/dist/types/components/AppForm.d.ts +18 -0
  130. package/dist/types/components/AppFormulaSteps.d.ts +64 -0
  131. package/dist/types/components/AppInput.d.ts +4 -4
  132. package/dist/types/components/AppInputGroup.d.ts +1 -1
  133. package/dist/types/components/AppMentionInput.d.ts +2 -2
  134. package/dist/types/components/AppMetricStrip.d.ts +5 -0
  135. package/dist/types/components/AppModal.d.ts +5 -0
  136. package/dist/types/components/AppNumberInput.d.ts +9 -3
  137. package/dist/types/components/AppPhoneNumberInput.d.ts +1 -1
  138. package/dist/types/components/AppRowActions.d.ts +46 -0
  139. package/dist/types/components/AppSearch.d.ts +1 -1
  140. package/dist/types/components/AppSectionFeatures.d.ts +5 -1
  141. package/dist/types/components/AppSectionLogos.d.ts +1 -0
  142. package/dist/types/components/AppSelect.d.ts +3 -2
  143. package/dist/types/components/AppShell.d.ts +2 -0
  144. package/dist/types/components/AppSlider.d.ts +5 -0
  145. package/dist/types/components/AppTextarea.d.ts +2 -2
  146. package/dist/types/components/AppTimePicker.d.ts +1 -1
  147. package/dist/types/components/AppToast.d.ts +5 -0
  148. package/dist/types/hookForm/index.d.ts +14 -0
  149. package/dist/types/index.d.ts +8 -5
  150. package/dist/types/lib/emptyValue.d.ts +2 -2
  151. package/dist/types/lib/fieldState.d.ts +1 -0
  152. package/dist/types/lib/formFields.d.ts +12 -0
  153. package/dist/types/lib/useWuiText.d.ts +3 -0
  154. package/dist/ui-react.js +1 -1
  155. package/dist/web-core/dist/errors/extractApiError.js +2 -0
  156. package/dist/web-core/dist/errors/requestPlatform.js +1 -0
  157. package/package.json +21 -10
  158. package/dist/components/AppResizable.js +0 -1
  159. package/dist/components/AppResizableHandle.js +0 -1
  160. package/dist/components/AppResizablePanel.js +0 -1
  161. package/dist/components/AppRollingNumber.js +0 -1
  162. package/dist/components/AppRowSwitch.js +0 -1
  163. package/dist/types/components/AppResizable.d.ts +0 -37
  164. package/dist/types/components/AppResizableHandle.d.ts +0 -14
  165. package/dist/types/components/AppResizablePanel.d.ts +0 -14
  166. package/dist/types/components/AppRollingNumber.d.ts +0 -30
  167. package/dist/types/components/AppRowSwitch.d.ts +0 -18
@@ -1 +1 @@
1
- import e from"../lib/FieldMessage.js";import{loadFlagStyles as t}from"../lib/flagStyles.js";import n from"../lib/useElementEntry.js";import{splitMarkerProps as r}from"../lib/wuiMarker.js";import i from"./AppInfoTip.js";import a from"./AppRequiredMark.js";import o from"./assertValidValue.js";import s from"./useWuiControl.js";import c from"./warnUnknownProps.js";import{forwardRef as l,useEffect as u,useId as d}from"react";import{jsx as f,jsxs as p}from"react/jsx-runtime";var m=[`sm`,`md`,`lg`],h=()=>import(`@webority/ui-elements/elements/phone`),g=l(function(l,g){let _=n(`wui-phone`,h),{marker:v,props:y}=r(`AppPhoneNumberInput`,l),{value:b,onChange:x,country:S,lockedCountry:C,disabled:w=!1,readOnly:T=!1,loading:E=!1,defaultValue:D,help:O,helpLabel:k=`More information`,name:A,id:j,label:M=`Phone number`,placeholder:N,required:P=!1,optional:F=!1,optionalLabel:I=`(optional)`,helperText:L,error:R,showFlag:z=!0,showDialCode:B=!0,size:V=`md`,fieldClassName:H=``,...U}=y;c(`AppPhoneNumberInput`,U),o(`AppPhoneNumberInput`,`size`,V,m),u(()=>{z&&t()},[z]);let W=d(),G=j||W,K=R&&G?`${G}-error`:void 0,q=!R&&L&&G?`${G}-hint`:void 0,{setRef:J}=s({ready:_,ref:g,value:b??(D===void 0?``:void 0),defaultValue:D,onChange:x,events:[`input`,`change`]});return/* @__PURE__ */ p(`div`,{...v,className:`field app-phone-number-input${V===`sm`?` phone-sm`:``}${V===`lg`?` phone-lg`:``}${H?` ${H}`:``}`,children:[M&&/* @__PURE__ */ p(`label`,{className:`label`,htmlFor:G,children:[M,F&&!P&&/* @__PURE__ */ f(`span`,{className:`label-optional`,children:` ${I}`}),P&&/* @__PURE__ */ f(a,{}),O&&/* @__PURE__ */ f(i,{label:k,children:O})]}),/* @__PURE__ */ f(`wui-phone`,{ref:J,id:G,name:A,"aria-label":typeof M==`string`?M:void 0,"aria-describedby":K||q,"aria-invalid":R?`true`:void 0,country:C||S,"locked-country":C||void 0,placeholder:N,required:P?``:void 0,disabled:w?``:void 0,readonly:T?``:void 0,loading:E?``:void 0,"hide-flag":z?void 0:``,"hide-dial":B?void 0:``,"external-error":``,...U}),/* @__PURE__ */ f(e,{error:R,hint:L,errorId:K,hintId:q})]})});export{g as default};
1
+ import e from"../lib/FieldMessage.js";import{FIELD_SIZES as t}from"../lib/fieldState.js";import{loadFlagStyles as n}from"../lib/flagStyles.js";import{useFieldError as r}from"../lib/formFields.js";import i from"../lib/useElementEntry.js";import a from"../lib/useWuiText.js";import{splitMarkerProps as o}from"../lib/wuiMarker.js";import s from"./AppInfoTip.js";import c from"./AppRequiredMark.js";import l from"./assertValidValue.js";import u from"./useWuiControl.js";import d from"./warnUnknownProps.js";import{forwardRef as f,useEffect as p,useId as m}from"react";import{jsx as h,jsxs as g}from"react/jsx-runtime";import{PHONE_NUMBER_INPUT_TEXT as _}from"@webority/ui-elements/text";var v=()=>import(`@webority/ui-elements/elements/phone`),y=f(function(f,y){let b=i(`wui-phone`,v),{marker:x,props:S}=o(`AppPhoneNumberInput`,f),C=a(`phoneNumberInput`,_),{value:w,onChange:T,country:E,lockedCountry:D,disabled:O=!1,readOnly:k=!1,loading:A=!1,defaultValue:j,help:M,helpLabel:N=C.helpLabel,name:P,id:F,label:I=C.label,placeholder:ee,required:L=!1,optional:R=!1,optionalLabel:z=C.optionalLabel,helperText:B,error:V,showFlag:H=!0,showDialCode:U=!0,size:W=`md`,fieldClassName:G=``,...K}=S,q=r(P),J=V??q;d(`AppPhoneNumberInput`,K),l(`AppPhoneNumberInput`,`size`,W,t),p(()=>{H&&n()},[H]);let Y=m(),X=F||Y,Z=J&&X?`${X}-error`:void 0,Q=!J&&B&&X?`${X}-hint`:void 0,{setRef:$}=u({ready:b,ref:y,value:w??(j===void 0?``:void 0),defaultValue:j,onChange:T,events:[`input`,`change`]});return/* @__PURE__ */ g(`div`,{...x,className:`field app-phone-number-input${W===`sm`?` wui-phone-sm`:``}${W===`lg`?` wui-phone-lg`:``}${W===`xl`?` wui-phone-xl`:``}${G?` ${G}`:``}`,children:[I&&/* @__PURE__ */ g(`label`,{className:`label`,htmlFor:X,children:[I,R&&!L&&/* @__PURE__ */ h(`span`,{className:`label-optional`,children:` ${z}`}),L&&/* @__PURE__ */ h(c,{}),M&&/* @__PURE__ */ h(s,{label:N,children:M})]}),/* @__PURE__ */ h(`wui-phone`,{ref:$,id:X,name:P,"aria-label":typeof I==`string`?I:void 0,"aria-describedby":Z||Q,"aria-invalid":J?`true`:void 0,country:D||E,"locked-country":D||void 0,placeholder:ee,required:L?``:void 0,disabled:O?``:void 0,readonly:k?``:void 0,loading:A?``:void 0,"hide-flag":H?void 0:``,"hide-dial":U?void 0:``,"external-error":``,...K}),/* @__PURE__ */ h(e,{error:J,hint:B,errorId:Z,hintId:Q})]})});export{y as default};
@@ -1 +1 @@
1
- import e from"../lib/useElementEntry.js";import t from"./assertValidValue.js";import n from"./warnUnknownProps.js";import{cloneElement as r,useEffect as i,useId as a,useRef as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";var l=()=>import(`@webority/ui-elements/elements/popover`),u=[`dialog`];function d({trigger:d,children:f,title:p,placement:m=`bottom`,triggerType:h=`click`,onOpenChange:g,className:_=``,open:v,role:y,labelledBy:b,autoFocus:x=!1,openDelay:S=80,closeDelay:C=220,...w}){e(`wui-popover`,l),n(`AppPopover`,w),t(`AppPopover`,`role`,y,u);let T=`${a()}-title`,E=o(null),D=o(g);D.current=g;let O=v!==void 0,k=y===`dialog`,A=Array.isArray(h)?h:[h],j=A.includes(`click`);i(()=>{let e=E.current;if(!e)return;let t=t=>{if(t.target!==e)return;if(!(t instanceof CustomEvent))throw TypeError(`wui-popover-toggle arrived without a detail`);O&&t.preventDefault();let n=t.detail;D.current?.(n.open)};return e.addEventListener(`wui-popover-toggle`,t),()=>e.removeEventListener(`wui-popover-toggle`,t)},[O]);let{onClick:M,"aria-expanded":N,...P}=w,F=d.props[`aria-expanded`],I;N===void 0?F===void 0?j&&(I=v===!0):I=F:I=N;let L=r(d,{...P,...I===void 0?{}:{"aria-expanded":I},"data-wui-popover-trigger":``,onClick:e=>{M?.(e),typeof d.props.onClick==`function`&&d.props.onClick(e)}});return/* @__PURE__ */ c(`wui-popover`,{ref:E,trigger:A.join(` `),placement:m,open:v?``:void 0,"open-delay":S,"close-delay":C,"role-dialog":k?``:void 0,"auto-focus":x?``:void 0,"labelled-by":k?b:void 0,children:[L,/* @__PURE__ */ c(`div`,{"data-wui-popover-panel":!0,popover:``,className:`popover bs-popover-auto${_?` ${_}`:``}`,role:`tooltip`,children:[/* @__PURE__ */ s(`div`,{className:`popover-arrow`}),p&&/* @__PURE__ */ s(`div`,{className:`popover-header`,id:T,children:p}),f==null?null:/* @__PURE__ */ s(`div`,{className:`popover-body`,children:f})]})]})}export{d as default};
1
+ import e from"../lib/useElementEntry.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./assertValidValue.js";import r from"./warnUnknownProps.js";import{cloneElement as i,useEffect as a,useId as o,useRef as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";var u=()=>import(`@webority/ui-elements/elements/popover`),d=[`dialog`];function f({trigger:f,children:p,title:m,placement:h=`bottom`,triggerType:g=`click`,onOpenChange:_,className:v=``,open:y,role:b,labelledBy:x,autoFocus:S=!1,openDelay:C=80,closeDelay:w=220,...T}){e(`wui-popover`,u);let{marker:E,props:D}=t(`AppPopover`,T);r(`AppPopover`,D),n(`AppPopover`,`role`,b,d);let O=`${o()}-title`,k=s(null),A=s(_);A.current=_;let j=y!==void 0,M=b===`dialog`,N=Array.isArray(g)?g:[g],P=N.includes(`click`);a(()=>{let e=k.current;if(!e)return;let t=t=>{if(t.target!==e)return;if(!(t instanceof CustomEvent))throw TypeError(`wui-popover-toggle arrived without a detail`);j&&t.preventDefault();let n=t.detail;A.current?.(n.open)};return e.addEventListener(`wui-popover-toggle`,t),()=>e.removeEventListener(`wui-popover-toggle`,t)},[j]);let{onClick:F,"aria-expanded":I,...L}=D,R=f.props[`aria-expanded`],z;I===void 0?R===void 0?P&&(z=y===!0):z=R:z=I;let B=i(f,{...L,...z===void 0?{}:{"aria-expanded":z},"data-wui-popover-trigger":``,onClick:e=>{F?.(e),typeof f.props.onClick==`function`&&f.props.onClick(e)}});return/* @__PURE__ */ l(`wui-popover`,{ref:k,trigger:N.join(` `),placement:h,open:y?``:void 0,"open-delay":C,"close-delay":w,"role-dialog":M?``:void 0,"auto-focus":S?``:void 0,"labelled-by":M?x:void 0,...E,children:[B,/* @__PURE__ */ l(`div`,{"data-wui-popover-panel":!0,popover:``,className:`popover bs-popover-auto${v?` ${v}`:``}`,role:`tooltip`,children:[/* @__PURE__ */ c(`div`,{className:`popover-arrow`}),m&&/* @__PURE__ */ c(`div`,{className:`popover-header`,id:O,children:m}),p==null?null:/* @__PURE__ */ c(`div`,{className:`popover-body`,children:p})]})]})}export{f as default};
@@ -1 +1 @@
1
- import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./AppIcon.js";import n from"./warnUnknownProps.js";import{jsx as r,jsxs as i}from"react/jsx-runtime";function a(a){let{marker:o,props:s}=e(`AppPricingCard`,a),{name:c,price:l,unit:u,tagline:d,features:f=[],cta:p,featured:m=!1,current:h=!1,badge:g=`Most popular`,className:_=``,...v}=s;n(`AppPricingCard`,v);let y=[`plan-card`,m?`featured`:``,h?`current`:``,_].filter(Boolean).join(` `);return/* @__PURE__ */ i(`div`,{className:y,...o,...v,children:[m&&g&&/* @__PURE__ */ r(`span`,{className:`plan-badge`,children:g}),/* @__PURE__ */ r(`div`,{className:`plan-name`,children:c}),/* @__PURE__ */ i(`div`,{className:`plan-price`,children:[l,u&&/* @__PURE__ */ r(`span`,{className:`plan-price-unit`,children:u})]}),d&&/* @__PURE__ */ r(`div`,{className:`plan-tagline`,children:d}),f.length>0&&/* @__PURE__ */ r(`ul`,{className:`plan-features`,children:f.map((e,n)=>{let a=e.included!==!1;return/* @__PURE__ */ i(`li`,{className:a?void 0:`excluded`,children:[/* @__PURE__ */ r(`span`,{className:`plan-feature-icon`,children:/* @__PURE__ */ r(t,{name:a?`check`:`x`,size:16})}),e.text]},e.text?`feat-${n}-${e.text}`:`feat-${n}`)})}),p&&/* @__PURE__ */ r(`div`,{className:`plan-cta`,children:p})]})}export{a as default};
1
+ import e from"../lib/useWuiText.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./AppIcon.js";import r from"./warnUnknownProps.js";import{jsx as i,jsxs as a}from"react/jsx-runtime";import{PRICING_CARD_TEXT as o}from"@webority/ui-elements/text";function s(s){let{marker:c,props:l}=t(`AppPricingCard`,s),u=e(`pricingCard`,o),{name:d,price:f,unit:p,tagline:m,features:h=[],cta:g,featured:_=!1,current:v=!1,badge:y=u.badge,className:b=``,...x}=l;r(`AppPricingCard`,x);let S=[`plan-card`,_?`featured`:``,v?`current`:``,b].filter(Boolean).join(` `);return/* @__PURE__ */ a(`div`,{className:S,...c,...x,children:[_&&y&&/* @__PURE__ */ i(`span`,{className:`plan-badge`,children:y}),/* @__PURE__ */ i(`div`,{className:`plan-name`,children:d}),/* @__PURE__ */ a(`div`,{className:`plan-price`,children:[f,p&&/* @__PURE__ */ i(`span`,{className:`plan-price-unit`,children:p})]}),m&&/* @__PURE__ */ i(`div`,{className:`plan-tagline`,children:m}),h.length>0&&/* @__PURE__ */ i(`ul`,{className:`plan-features`,children:h.map((e,t)=>{let r=e.included!==!1;return/* @__PURE__ */ a(`li`,{className:r?void 0:`excluded`,children:[/* @__PURE__ */ i(`span`,{className:`plan-feature-icon`,children:/* @__PURE__ */ i(n,{name:r?`check`:`x`,size:16})}),e.text]},e.text?`feat-${t}-${e.text}`:`feat-${t}`)})}),g&&/* @__PURE__ */ i(`div`,{className:`plan-cta`,children:g})]})}export{s as default};
@@ -1 +1 @@
1
- import{encodeQr as e,qrSvgPath as t}from"../lib/qrCode.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./warnUnknownProps.js";import{useMemo as i}from"react";import{jsx as a,jsxs as o}from"react/jsx-runtime";var s=4;function c(c){let{marker:l,props:u}=n(`AppQrCode`,c),{value:d,size:f=240,title:p=`QR code`,className:m,style:h,...g}=u;if(r(`AppQrCode`,g),!Number.isFinite(f)||f<=0)throw RangeError(`<AppQrCode> received size=${String(f)}; size is a positive number of pixels.`);let _=i(()=>{if(!d)return null;let n=e(String(d));return{modules:n.size+8,path:t(n,s)}},[d]);if(!_)return null;let{modules:v,path:y}=_,b=Math.max(1,Math.floor(f/v))*v;return/* @__PURE__ */ o(`svg`,{viewBox:`0 0 ${v} ${v}`,width:b,height:b,role:`img`,"aria-label":p,shapeRendering:`crispEdges`,className:m||void 0,style:h,...l,...g,children:[/* @__PURE__ */ a(`rect`,{width:v,height:v,fill:`#ffffff`}),/* @__PURE__ */ a(`path`,{d:y,fill:`#000000`})]})}export{c as default};
1
+ import{encodeQr as e,qrSvgPath as t}from"../lib/qrCode.js";import n from"../lib/useWuiText.js";import{splitMarkerProps as r}from"../lib/wuiMarker.js";import i from"./warnUnknownProps.js";import{useMemo as a}from"react";import{jsx as o,jsxs as s}from"react/jsx-runtime";import{QR_CODE_TEXT as c}from"@webority/ui-elements/text";var l=4;function u(u){let{marker:d,props:f}=r(`AppQrCode`,u),p=n(`qrCode`,c),{value:m,size:h=240,title:g=p.title,className:_,style:v,...y}=f;if(i(`AppQrCode`,y),!Number.isFinite(h)||h<=0)throw RangeError(`<AppQrCode> received size=${String(h)}; size is a positive number of pixels.`);let b=a(()=>{if(!m)return null;let n=e(String(m));return{modules:n.size+8,path:t(n,l)}},[m]);if(!b)return null;let{modules:x,path:S}=b,C=Math.max(1,Math.floor(h/x))*x;return/* @__PURE__ */ s(`svg`,{viewBox:`0 0 ${x} ${x}`,width:C,height:C,role:`img`,"aria-label":g,shapeRendering:`crispEdges`,className:_||void 0,style:v,...d,...y,children:[/* @__PURE__ */ o(`rect`,{width:x,height:x,fill:`#ffffff`}),/* @__PURE__ */ o(`path`,{d:S,fill:`#000000`})]})}export{u as default};
@@ -1 +1 @@
1
- import e from"../lib/CheckField.js";import{FIELD_SIZES as t}from"../lib/fieldState.js";import n from"../lib/labelWithHelp.js";import{splitMarkerProps as r}from"../lib/wuiMarker.js";import i from"./assertValidValue.js";import a from"./warnUnknownProps.js";import{forwardRef as o}from"react";import{jsx as s}from"react/jsx-runtime";var c=e=>/* @__PURE__ */ Error(`<AppRadio> controlOnly draws no field, so it takes no ${e}; draw the label or message on the page.`),l=o(function(o,l){let{marker:u,props:d}=r(`AppRadio`,o),{label:f,id:p,name:m,error:h,helperText:g,help:_,helpLabel:v=`More information`,className:y=``,readOnly:b=!1,loading:x=!1,size:S=`md`,controlOnly:C=!1,...w}=d;if(a(`AppRadio`,w),i(`AppRadio`,`size`,S,t),C){if(f!=null&&f!==``)throw c(`label`);if(h!=null&&h!==``)throw c(`error`);if(g!=null&&g!==``)throw c(`helperText`);if(S!==`md`)throw c(`size`)}return/* @__PURE__ */ s(e,{rootProps:u,ref:l,label:n(f,_,v),id:p,name:m,error:h,hint:g,className:y,rest:w,inputType:`radio`,wrapperClass:`form-check`,readOnly:b,loading:x,size:S,controlOnly:C})});export{l as default};
1
+ import e from"../lib/CheckField.js";import{BOX_SIZES as t}from"../lib/fieldState.js";import n from"../lib/labelWithHelp.js";import r from"../lib/useWuiText.js";import{splitMarkerProps as i}from"../lib/wuiMarker.js";import a from"./assertValidValue.js";import o from"./warnUnknownProps.js";import{forwardRef as s}from"react";import{jsx as c}from"react/jsx-runtime";import{RADIO_TEXT as l}from"@webority/ui-elements/text";var u=e=>/* @__PURE__ */ Error(`<AppRadio> controlOnly draws no field, so it takes no ${e}; draw the label or message on the page.`),d=s(function(s,d){let{marker:f,props:p}=i(`AppRadio`,s),m=r(`radio`,l),{label:h,id:g,name:_,error:v,helperText:y,help:b,helpLabel:x=m.helpLabel,className:S=``,readOnly:C=!1,loading:w=!1,size:T=`md`,controlOnly:E=!1,...D}=p;if(o(`AppRadio`,D),a(`AppRadio`,`size`,T,t),E){if(h!=null&&h!==``)throw u(`label`);if(v!=null&&v!==``)throw u(`error`);if(y!=null&&y!==``)throw u(`helperText`);if(T!==`md`)throw u(`size`)}return/* @__PURE__ */ c(e,{rootProps:f,ref:d,label:n(h,b,x),id:g,name:_,error:v,hint:y,className:S,rest:D,inputType:`radio`,wrapperClass:`form-check`,readOnly:C,loading:w,size:T,controlOnly:E})});export{d as default};
@@ -1 +1 @@
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"./assertValidValue.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,helperText: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
+ import e from"../lib/FieldMessage.js";import{BOX_SIZES as t,FIELD_BUSY_CLASS as n,blockWhenReadOnly as r}from"../lib/fieldState.js";import{useFieldError as i}from"../lib/formFields.js";import a from"../lib/useWuiText.js";import{splitMarkerProps as o}from"../lib/wuiMarker.js";import s from"./AppInfoTip.js";import c from"./AppRequiredMark.js";import l from"./assertValidValue.js";import u from"./warnUnknownProps.js";import{useId as d}from"react";import{jsx as f,jsxs as p}from"react/jsx-runtime";import{RADIO_GROUP_TEXT as m}from"@webority/ui-elements/text";var h=[`default`,`card`];function g(g){let{marker:_,props:v}=o(`AppRadioGroup`,g),y=a(`radioGroup`,m),{label:b,options:x=[],name:S,value:C,defaultValue:w,onChange:T,variant:E=`default`,inline:D=!1,required:O=!1,optional:k=!1,optionalLabel:A=y.optionalLabel,disabled:j=!1,readOnly:M=!1,loading:N=!1,size:P=`md`,error:F,helperText:I,help:L,helpLabel:R=y.helpLabel,id:z,className:B=``,fieldClassName:V=``,style:H,...U}=v,W=i(S),G=F??W;u(`AppRadioGroup`,U),l(`AppRadioGroup`,`variant`,E,h),l(`AppRadioGroup`,`size`,P,t);let K=P===`sm`?` form-check-sm`:P===`lg`?` form-check-lg`:``,q=d(),J=z||q,Y=S||J,X=`${J}-error`,Z=`${J}-hint`,Q=C!==void 0;return/* @__PURE__ */ p(`div`,{..._,className:`field${V?` ${V}`:``}`,children:[b!=null&&/* @__PURE__ */ p(`span`,{className:`label`,id:`${J}-label`,children:[b,k&&!O&&/* @__PURE__ */ f(`span`,{className:`label-optional`,children:` ${A}`}),O&&/* @__PURE__ */ f(c,{}),L&&/* @__PURE__ */ f(s,{label:R,children:L})]}),/* @__PURE__ */ f(`div`,{className:[`wui-radio-group`,E===`card`?`wui-radio-group-card`:``,D?`wui-radio-group-inline`:``,B].filter(Boolean).join(` `),style:H,id:J,role:`radiogroup`,"aria-labelledby":b==null?void 0:`${J}-label`,"aria-required":O?`true`:void 0,"aria-readonly":M||void 0,"aria-busy":N||void 0,"aria-invalid":G?`true`:void 0,"aria-describedby":G?X:I?Z:void 0,...U,children:x.map((e,t)=>{let i=`${J}-${t}`,a=e.description==null?void 0:`${i}-desc`;return/* @__PURE__ */ p(`div`,{className:`form-check${K}`,children:[/* @__PURE__ */ f(`input`,{type:`radio`,className:N?`form-check-input ${n}`:`form-check-input`,id:i,name:Y,value:e.value,disabled:j||e.disabled||void 0,required:O||void 0,"aria-describedby":a,"aria-readonly":M||void 0,"aria-busy":N||void 0,onClick:r(M||N),...Q?{checked:C===e.value,onChange:()=>T?.(e.value)}:{defaultChecked:w===e.value,onChange:()=>T?.(e.value)}}),/* @__PURE__ */ f(`label`,{className:`form-check-label`,htmlFor:i,children:e.label}),a&&/* @__PURE__ */ f(`div`,{className:`wui-radio-option-desc`,id:a,children:e.description})]},e.value)})}),/* @__PURE__ */ f(e,{error:G,hint:I,errorId:X,hintId:Z})]})}export{g as default};
@@ -1 +1 @@
1
- import e from"../lib/FieldMessage.js";import{blockWhenReadOnly as t}from"../lib/fieldState.js";import n from"../lib/fillLabel.js";import r from"../lib/useElementEntry.js";import{splitMarkerProps as i}from"../lib/wuiMarker.js";import a from"./AppIcon.js";import o from"./AppInfoTip.js";import s from"./AppRequiredMark.js";import c from"./assertValidValue.js";import l from"./warnUnknownProps.js";import{useId as u,useState as d}from"react";import{jsx as f,jsxs as p}from"react/jsx-runtime";var m=()=>import(`@webority/ui-elements/elements/rating`),h={sm:16,md:20,lg:28},g=e=>String(Math.round(e*100)/100),_=(e,t,n)=>e>=t?`full`:n&&e>=t-.5?`half`:`empty`;function v(a){r(`wui-rating`,m);let{marker:v,props:b}=i(`AppRating`,a),{value:x,defaultValue:S,onChange:C,max:w=5,readOnly:T=!1,half:E=!1,showValue:D=!1,size:O=`md`,label:k,help:A,helpLabel:j=`More information`,ratingLabel:M=`Rating`,starLabel:N=`{count} star`,starsLabel:ee=`{count} stars`,valueText:te=`{value} out of {max}`,name:ne,required:P=!1,disabled:F=!1,loading:I=!1,error:L,helperText:R,id:z,className:B=``,fieldClassName:V=``,...H}=b;l(`AppRating`,H),c(`AppRating`,`size`,O,Object.keys(h));let U=u(),[W,G]=d(S),K=h[O]??h.md,q=Array.from({length:w},(e,t)=>t+1),J=(...e)=>[`wui-rating`,`wui-rating-${O}`,...e,B].filter(Boolean).join(` `);if(T){let e=x===void 0?W:x,t=Number.isFinite(Number(e))?Math.min(Math.max(Number(e),0),w):0,r=E?Math.round(t*2)/2:Math.round(t),i=`${typeof k==`string`&&k?`${k}: `:``}${n(te,{value:g(t),max:w})}`;return/* @__PURE__ */ p(`span`,{className:J(`wui-rating-display`,I&&`wui-field-busy`),id:z,role:`img`,"aria-label":i,"aria-busy":I||void 0,...v,...H,children:[/* @__PURE__ */ f(`span`,{className:`wui-rating-stars`,"aria-hidden":`true`,children:q.map(e=>/* @__PURE__ */ f(`span`,{className:`wui-rating-star wui-rating-star-${_(r,e,E)}`,children:/* @__PURE__ */ f(y,{px:K})},e))}),D&&/* @__PURE__ */ f(`span`,{className:`wui-rating-value`,"aria-hidden":`true`,children:g(t)})]})}let Y=z||U,X=ne||Y,Z=`${Y}-error`,Q=`${Y}-hint`,$=Math.round(Number(x===void 0?W:x))||0,re=e=>{I||(G(e),C?.(e))};return/* @__PURE__ */ p(`div`,{...v,className:`field${V?` ${V}`:``}`,children:[k!=null&&/* @__PURE__ */ p(`span`,{className:`label`,id:`${Y}-label`,children:[k,P&&/* @__PURE__ */ f(s,{}),A&&/* @__PURE__ */ f(o,{label:j,children:A})]}),/* @__PURE__ */ f(`wui-rating`,{class:J(`wui-rating-input`,I&&`wui-field-busy`),id:Y,role:`radiogroup`,"aria-busy":I?`true`:void 0,"aria-labelledby":k==null?void 0:`${Y}-label`,"aria-label":k==null?M: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__ */ p(`label`,{className:`wui-rating-star wui-rating-star-${$>=e?`full`:`empty`}`,"data-value":e,children:[/* @__PURE__ */ f(`input`,{type:`radio`,className:`visually-hidden`,name:X,value:e,"aria-label":n(e===1?N:ee,{count:e}),checked:$===e,onChange:()=>re(e),onClick:t(T||I),disabled:F||void 0,required:P||void 0}),/* @__PURE__ */ f(y,{px:K})]},e))}),/* @__PURE__ */ f(e,{error:L,hint:R,errorId:Z,hintId:Q})]})}function y({px:e}){return/* @__PURE__ */ p(`span`,{className:`wui-rating-glyphs`,"aria-hidden":`true`,children:[/* @__PURE__ */ f(a,{name:`star`,size:e}),/* @__PURE__ */ f(`span`,{className:`wui-rating-fill`,children:/* @__PURE__ */ f(a,{name:`star`,variant:`bold`,size:e})})]})}export{v as default};
1
+ import e from"../lib/FieldMessage.js";import{blockWhenReadOnly as t}from"../lib/fieldState.js";import{useFieldError as n}from"../lib/formFields.js";import r from"../lib/useElementEntry.js";import i from"../lib/useWuiText.js";import{splitMarkerProps as a}from"../lib/wuiMarker.js";import o from"./AppIcon.js";import s from"./AppInfoTip.js";import ee from"./AppRequiredMark.js";import te from"./assertValidValue.js";import c from"./warnUnknownProps.js";import{useId as l,useState as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{RATING_TEXT as p,fillText as m}from"@webority/ui-elements/text";var ne=()=>import(`@webority/ui-elements/elements/rating`),h={sm:16,md:20,lg:28},g=e=>String(Math.round(e*100)/100),_=(e,t,n)=>e>=t?`full`:n&&e>=t-.5?`half`:`empty`;function v(o){r(`wui-rating`,ne);let{marker:v,props:b}=a(`AppRating`,o),x=i(`rating`,p),{value:S,defaultValue:C,onChange:w,max:T=5,readOnly:E=!1,half:D=!1,showValue:re=!1,size:O=`md`,label:k,help:A,helpLabel:ie=x.helpLabel,ratingLabel:ae=x.ratingLabel,starLabel:oe=x.starLabel,starsLabel:j=x.starsLabel,valueText:M=x.valueText,name:N,required:P=!1,disabled:F=!1,loading:I=!1,error:L,helperText:R,id:z,className:B=``,fieldClassName:V=``,...H}=b,U=n(N),W=L??U;c(`AppRating`,H),te(`AppRating`,`size`,O,Object.keys(h));let G=l(),[K,se]=u(C),q=h[O]??h.md,J=Array.from({length:T},(e,t)=>t+1),Y=(...e)=>[`wui-rating`,`wui-rating-${O}`,...e,B].filter(Boolean).join(` `);if(E){let e=S===void 0?K:S,t=Number.isFinite(Number(e))?Math.min(Math.max(Number(e),0),T):0,n=D?Math.round(t*2)/2:Math.round(t),r=`${typeof k==`string`&&k?`${k}: `:``}${m(M,{value:g(t),max:T})}`;return/* @__PURE__ */ f(`span`,{className:Y(`wui-rating-display`,I&&`wui-field-busy`),id:z,role:`img`,"aria-label":r,"aria-busy":I||void 0,...v,...H,children:[/* @__PURE__ */ d(`span`,{className:`wui-rating-stars`,"aria-hidden":`true`,children:J.map(e=>/* @__PURE__ */ d(`span`,{className:`wui-rating-star wui-rating-star-${_(n,e,D)}`,children:/* @__PURE__ */ d(y,{px:q})},e))}),re&&/* @__PURE__ */ d(`span`,{className:`wui-rating-value`,"aria-hidden":`true`,children:g(t)})]})}let X=z||G,ce=N||X,Z=`${X}-error`,Q=`${X}-hint`,$=Math.round(Number(S===void 0?K:S))||0,le=e=>{I||(se(e),w?.(e))};return/* @__PURE__ */ f(`div`,{...v,className:`field${V?` ${V}`:``}`,children:[k!=null&&/* @__PURE__ */ f(`span`,{className:`label`,id:`${X}-label`,children:[k,P&&/* @__PURE__ */ d(ee,{}),A&&/* @__PURE__ */ d(s,{label:ie,children:A})]}),/* @__PURE__ */ d(`wui-rating`,{class:Y(`wui-rating-input`,I&&`wui-field-busy`),id:X,role:`radiogroup`,"aria-busy":I?`true`:void 0,"aria-labelledby":k==null?void 0:`${X}-label`,"aria-label":k==null?ae:void 0,"aria-required":P?`true`:void 0,"aria-invalid":W?`true`:void 0,"aria-describedby":W?Z:R?Q:void 0,disabled:F?``:void 0,...H,children:J.map(e=>/* @__PURE__ */ f(`label`,{className:`wui-rating-star wui-rating-star-${$>=e?`full`:`empty`}`,"data-value":e,children:[/* @__PURE__ */ d(`input`,{type:`radio`,className:`visually-hidden`,name:ce,value:e,"aria-label":m(e===1?oe:j,{count:e}),checked:$===e,onChange:()=>le(e),onClick:t(E||I),disabled:F||void 0,required:P||void 0}),/* @__PURE__ */ d(y,{px:q})]},e))}),/* @__PURE__ */ d(e,{error:W,hint:R,errorId:Z,hintId:Q})]})}function y({px:e}){return/* @__PURE__ */ f(`span`,{className:`wui-rating-glyphs`,"aria-hidden":`true`,children:[/* @__PURE__ */ d(o,{name:`star`,size:e}),/* @__PURE__ */ d(`span`,{className:`wui-rating-fill`,children:/* @__PURE__ */ d(o,{name:`star`,variant:`bold`,size:e})})]})}export{v as default};
@@ -1 +1 @@
1
- import e from"../lib/useElementEntry.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./AppActionIcon.js";import r from"./warnUnknownProps.js";import{formatNumber as i}from"@webority/ui-elements/helpers";import{jsx as a,jsxs as o}from"react/jsx-runtime";var s=e=>i(e,{decimals:0}),c=()=>import(`@webority/ui-elements/elements/record-pager`);function l(i){e(`wui-record-pager`,c);let{marker:l,props:u}=t(`AppRecordPager`,i),{index:d,total:f,prevHref:p,onPrev:m,nextHref:h,onNext:g,prevLabel:_=`Previous`,nextLabel:v=`Next`,keys:y=!1,className:b=``,...x}=u;r(`AppRecordPager`,x);let S=Number(d),C=Number(f),w=Number.isInteger(S)&&Number.isInteger(C)&&S>=1&&S<=C,T=w&&S>1&&!!(p||m),E=w&&S<C&&!!(h||g);return/* @__PURE__ */ o(`wui-record-pager`,{class:[`wui-record-pager`,b].filter(Boolean).join(` `),keys:y?``:void 0,...l,...x,children:[/* @__PURE__ */ a(`span`,{className:`wui-record-pager-position`,"aria-live":`polite`,children:w?`${s(S)} of ${s(C)}`:``}),/* @__PURE__ */ a(n,{icon:`chevron-left`,label:_,size:18,className:`wui-record-pager-prev`,href:p||void 0,onClick:m,disabled:!T,shortcut:y?`K`:void 0}),/* @__PURE__ */ a(n,{icon:`chevron-right`,label:v,size:18,className:`wui-record-pager-next`,href:h||void 0,onClick:g,disabled:!E,shortcut:y?`J`:void 0})]})}export{l as default};
1
+ import e from"../lib/useElementEntry.js";import t from"../lib/useWuiText.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./AppActionIcon.js";import i from"./warnUnknownProps.js";import{formatNumber as a}from"@webority/ui-elements/helpers";import{jsx as o,jsxs as s}from"react/jsx-runtime";import{RECORD_PAGER_TEXT as c,fillText as l}from"@webority/ui-elements/text";var u=e=>a(e,{decimals:0}),d=()=>import(`@webority/ui-elements/elements/record-pager`);function f(a){e(`wui-record-pager`,d);let{marker:f,props:p}=n(`AppRecordPager`,a),m=t(`recordPager`,c),{index:h,total:g,prevHref:_,onPrev:v,nextHref:y,onNext:b,prevLabel:x=m.prevLabel,nextLabel:S=m.nextLabel,keys:C=!1,className:w=``,...T}=p;i(`AppRecordPager`,T);let E=Number(h),D=Number(g),O=Number.isInteger(E)&&Number.isInteger(D)&&E>=1&&E<=D,k=O&&E>1&&!!(_||v),A=O&&E<D&&!!(y||b);return/* @__PURE__ */ s(`wui-record-pager`,{class:[`wui-record-pager`,w].filter(Boolean).join(` `),keys:C?``:void 0,...f,...T,children:[/* @__PURE__ */ o(`span`,{className:`wui-record-pager-position`,"aria-live":`polite`,children:O?l(m.positionText,{position:u(E),total:u(D)}):``}),/* @__PURE__ */ o(r,{icon:`chevron-left`,label:x,size:18,className:`wui-record-pager-prev`,href:_||void 0,onClick:v,disabled:!k,shortcut:C?`K`:void 0}),/* @__PURE__ */ o(r,{icon:`chevron-right`,label:S,size:18,className:`wui-record-pager-next`,href:y||void 0,onClick:b,disabled:!A,shortcut:C?`J`:void 0})]})}export{f as default};
@@ -1 +1 @@
1
- import e from"../lib/useElementEntry.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./warnUnknownProps.js";import r from"./withTooltip.js";import{EMPTY_VALUE as i,formatDate as a,relativeTimeTitle as o,toInstant as s}from"@webority/ui-elements/helpers";import{jsx as c}from"react/jsx-runtime";var l=()=>import(`@webority/ui-elements/elements/relative-time`);function u(u){e(`wui-relative-time`,l);let{marker:d,props:f}=t(`AppRelativeTime`,u),{value:p,tooltipPlacement:m=`auto`,className:h=``,...g}=f;n(`AppRelativeTime`,g);let _=s(p),v=Number.isFinite(_),y=v?typeof p==`string`?p.trim():new Date(_).toISOString():void 0;return r(/* @__PURE__ */ c(`wui-relative-time`,{class:[`wui-relative-time`,h].filter(Boolean).join(` `),...d,...g,children:/* @__PURE__ */ c(`time`,{dateTime:y,children:v?a(_):i})}),v?o(_):void 0,m)}export{u as default};
1
+ import e from"../lib/useElementEntry.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./warnUnknownProps.js";import r from"./withTooltip.js";import{emptyValueLabel as i,formatDate as a,relativeTimeTitle as o,toInstant as s}from"@webority/ui-elements/helpers";import{jsx as c}from"react/jsx-runtime";var l=()=>import(`@webority/ui-elements/elements/relative-time`);function u(u){e(`wui-relative-time`,l);let{marker:d,props:f}=t(`AppRelativeTime`,u),{value:p,tooltipPlacement:m=`auto`,className:h=``,...g}=f;n(`AppRelativeTime`,g);let _=s(p),v=Number.isFinite(_),y=v?typeof p==`string`?p.trim():new Date(_).toISOString():void 0;return r(/* @__PURE__ */ c(`wui-relative-time`,{class:[`wui-relative-time`,h].filter(Boolean).join(` `),...d,...g,children:/* @__PURE__ */ c(`time`,{dateTime:y,children:v?a(_):i()})}),v?o(_):void 0,m)}export{u as default};
@@ -1 +1 @@
1
- import{FILL_VARIANTS as e}from"../lib/vocabulary.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./AppActionIcon.js";import r from"./AppButton.js";import i from"./AppLink.js";import a from"./assertValidValue.js";import o from"./warnUnknownProps.js";import{jsx as s,jsxs as c}from"react/jsx-runtime";function l(e,t){return`id`in e&&(typeof e.id==`string`||typeof e.id==`number`)?e.id:t}function u(u){let{marker:d,props:f}=t(`AppRepeater`,u),{rows:p=[],renderRow:m,rowLabel:h,onAdd:g,onRemove:_,addLabel:v=`Add another`,addVariant:y=`soft`,removeLabel:b=`Remove row`,emptyText:x,min:S=0,max:C,numbered:w=!0,className:T=``,...E}=f;o(`AppRepeater`,E),a(`AppRepeater`,`addVariant`,y,e);let D=typeof C==`number`&&p.length>=C,O=!!_&&p.length>S;return/* @__PURE__ */ c(`div`,{className:`repeater${T?` ${T}`:``}`,...d,...E,children:[p.length===0&&x&&/* @__PURE__ */ s(`div`,{className:`repeater-empty`,children:x}),p.map((e,t)=>{let r=h?h(e,t):null;return/* @__PURE__ */ c(`div`,{className:`repeater-row`,children:[(!!r||O)&&/* @__PURE__ */ s(`span`,{className:`repeater-row-label`,children:r}),w&&/* @__PURE__ */ s(`span`,{className:`repeater-index`,children:t+1}),/* @__PURE__ */ s(`div`,{className:`repeater-body`,children:m(e,t)}),O&&/* @__PURE__ */ s(n,{icon:`trash-2`,label:`${b} ${t+1}`,tone:`danger`,className:`repeater-remove`,onClick:()=>_?.(t)})]},l(e,t))}),y===`link`?/* @__PURE__ */ s(i,{animation:`static`,size:`sm`,linkComponent:`button`,type:`button`,leftIcon:`plus`,className:`repeater-add`,disabled:D,onClick:g,children:v}):/* @__PURE__ */ s(r,{variant:y,size:`sm`,leftIcon:`plus`,className:`repeater-add`,disabled:D,onClick:g,children:v})]})}export{u as default};
1
+ import e from"../lib/useWuiText.js";import{FILL_VARIANTS as t}from"../lib/vocabulary.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./AppActionIcon.js";import i from"./AppButton.js";import a from"./AppLink.js";import o from"./assertValidValue.js";import s from"./warnUnknownProps.js";import{jsx as c,jsxs as l}from"react/jsx-runtime";import{REPEATER_TEXT as u}from"@webority/ui-elements/text";function d(e,t){return`id`in e&&(typeof e.id==`string`||typeof e.id==`number`)?e.id:t}function f(f){let{marker:p,props:m}=n(`AppRepeater`,f),h=e(`repeater`,u),{rows:g=[],renderRow:_,rowLabel:v,onAdd:y,onRemove:b,addLabel:x=h.addLabel,addVariant:S=`soft`,removeLabel:C=h.removeLabel,emptyText:w,min:T=0,max:E,numbered:D=!0,className:O=``,...k}=m;s(`AppRepeater`,k),o(`AppRepeater`,`addVariant`,S,t);let A=typeof E==`number`&&g.length>=E,j=!!b&&g.length>T;return/* @__PURE__ */ l(`div`,{className:`repeater${O?` ${O}`:``}`,...p,...k,children:[g.length===0&&w&&/* @__PURE__ */ c(`div`,{className:`repeater-empty`,children:w}),g.map((e,t)=>{let n=v?v(e,t):null;return/* @__PURE__ */ l(`div`,{className:`repeater-row`,children:[(!!n||j)&&/* @__PURE__ */ c(`span`,{className:`repeater-row-label`,children:n}),D&&/* @__PURE__ */ c(`span`,{className:`repeater-index`,children:t+1}),/* @__PURE__ */ c(`div`,{className:`repeater-body`,children:_(e,t)}),j&&/* @__PURE__ */ c(r,{icon:`trash-2`,label:`${C} ${t+1}`,tone:`danger`,className:`repeater-remove`,onClick:()=>b?.(t)})]},d(e,t))}),S===`link`?/* @__PURE__ */ c(a,{animation:`static`,size:`sm`,linkComponent:`button`,type:`button`,leftIcon:`plus`,className:`repeater-add`,disabled:A,onClick:y,children:x}):/* @__PURE__ */ c(i,{variant:S,size:`sm`,leftIcon:`plus`,className:`repeater-add`,disabled:A,onClick:y,children:x})]})}export{f 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"./assertValidValue.js";import o from"./useWuiControl.js";import s from"./warnUnknownProps.js";import{isElementDefined as c,whenElementDefined as l}from"@webority/ui-elements/helpers";import{forwardRef as u,useEffect as d,useId as f,useState as p}from"react";import{jsx as m,jsxs as h}from"react/jsx-runtime";var g=[`html`,`markdown`],_=[`input`,`change`],v=`The editor couldn't load. Reload the page and try again.`,y=u(function(u,y){let{marker:b,props:x}=n(`AppRichText`,u),{value:S,onChange:C,format:w,placeholder:T,name:E,label:D,error:O,helperText:k,required:A=!1,disabled:j=!1,readOnly:M=!1,loading:N=!1,defaultValue:P,id:F,ariaLabel:I,className:L=``,fieldClassName:R=``,help:z,helpLabel:B=`More information`,...V}=x;s(`AppRichText`,V),a(`AppRichText`,`format`,w,g);let H=f(),U=F||H,[W,G]=p(!1),[K,q]=p(()=>c(`wui-rich-text`)),{setRef:J}=o({ready:K,ref:y,value:S,defaultValue:P,onChange:C,events:_});return d(()=>{if(K)return;let t=!0;return import(`@webority/ui-elements/rich-text`).then(()=>l(`wui-rich-text`)).then(()=>{t&&q(!0)},n=>{let r=typeof n==`object`&&n&&`message`in n?n.message:void 0;e(`[AppRichText] the editor failed to load:`,r),t&&G(!0)}),()=>{t=!1}},[K]),/* @__PURE__ */ h(`div`,{...b,className:`field${R?` ${R}`:``}`,children:[D&&/* @__PURE__ */ h(`label`,{className:`label`,htmlFor:U,children:[D,A&&/* @__PURE__ */ m(i,{}),z&&/* @__PURE__ */ m(r,{label:B,children:z})]}),W?/* @__PURE__ */ m(`div`,{className:`field-error`,role:`status`,children:v}):/* @__PURE__ */ m(`wui-rich-text`,{ref:J,id:U,role:`group`,name:E,format:w||void 0,placeholder:T,"aria-label":I||(typeof D==`string`?D:void 0),"aria-describedby":O?`${U}-error`:k?`${U}-hint`:void 0,"aria-invalid":O?`true`:void 0,required:A?``:void 0,disabled:j?``:void 0,readonly:M?``:void 0,loading:N?``:void 0,className:L||void 0,...V},w||`html`),/* @__PURE__ */ m(t,{error:O,hint:k,errorId:`${U}-error`,hintId:`${U}-hint`})]})});export{y as default};
1
+ import{devWarn as e}from"../lib/devWarn.js";import t from"../lib/FieldMessage.js";import{useFieldError as n}from"../lib/formFields.js";import r from"../lib/useWuiText.js";import{splitMarkerProps as i}from"../lib/wuiMarker.js";import a from"./AppInfoTip.js";import o from"./AppRequiredMark.js";import s from"./assertValidValue.js";import c from"./useWuiControl.js";import l from"./warnUnknownProps.js";import{isElementDefined as u,whenElementDefined as d}from"@webority/ui-elements/helpers";import{forwardRef as f,useEffect as p,useId as m,useState as h}from"react";import{jsx as g,jsxs as _}from"react/jsx-runtime";import{RICH_TEXT_TEXT as v}from"@webority/ui-elements/text";var y=[`html`,`markdown`],b=[`input`,`change`],x=f(function(f,x){let{marker:S,props:C}=i(`AppRichText`,f),w=r(`richText`,v),{value:T,onChange:E,format:D,placeholder:O,name:k,label:A,error:j,helperText:M,required:N=!1,disabled:P=!1,readOnly:F=!1,loading:I=!1,defaultValue:L,id:R,ariaLabel:z,className:B=``,fieldClassName:V=``,help:H,helpLabel:U=w.helpLabel,...W}=C,G=n(k),K=j??G;l(`AppRichText`,W),s(`AppRichText`,`format`,D,y);let q=m(),J=R||q,[Y,X]=h(!1),[Z,Q]=h(()=>u(`wui-rich-text`)),{setRef:$}=c({ready:Z,ref:x,value:T,defaultValue:L,onChange:E,events:b});return p(()=>{if(Z)return;let t=!0;return import(`@webority/ui-elements/rich-text`).then(()=>d(`wui-rich-text`)).then(()=>{t&&Q(!0)},n=>{let r=typeof n==`object`&&n&&`message`in n?n.message:void 0;e(`[AppRichText] the editor failed to load:`,r),t&&X(!0)}),()=>{t=!1}},[Z]),/* @__PURE__ */ _(`div`,{...S,className:`field${V?` ${V}`:``}`,children:[A&&/* @__PURE__ */ _(`label`,{className:`label`,htmlFor:J,children:[A,N&&/* @__PURE__ */ g(o,{}),H&&/* @__PURE__ */ g(a,{label:U,children:H})]}),Y?/* @__PURE__ */ g(`div`,{className:`field-error`,role:`status`,children:w.loadFailedText}):/* @__PURE__ */ g(`wui-rich-text`,{ref:$,id:J,role:`group`,name:k,format:D||void 0,placeholder:O,"aria-label":z||(typeof A==`string`?A:void 0),"aria-describedby":K?`${J}-error`:M?`${J}-hint`:void 0,"aria-invalid":K?`true`:void 0,required:N?``:void 0,disabled:P?``:void 0,readonly:F?``:void 0,loading:I?``:void 0,className:B||void 0,...W},D||`html`),/* @__PURE__ */ g(t,{error:K,hint:M,errorId:`${J}-error`,hintId:`${J}-hint`})]})});export{x 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"./assertValidValue.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,{leftIcon:`refresh-cw`,onClick:h,children:y}),children:D}):p===`not-found`?/* @__PURE__ */ o(n,{status:`404`,title:C,subtitle:w,actions:A(`solid`),children:D}):/* @__PURE__ */ o(n,{status:`500`,title:T,subtitle:E,actions:/* @__PURE__ */ s(a,{children:[/* @__PURE__ */ o(t,{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
+ import e from"../lib/useWuiText.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./AppButton.js";import r from"./AppResult.js";import i from"./assertValidValue.js";import a from"./warnUnknownProps.js";import{Fragment as o,jsx as s,jsxs as c}from"react/jsx-runtime";import{ROUTE_ERROR_TEXT as l}from"@webority/ui-elements/text";var u=[`error`,`stale-build`,`not-found`],d=()=>window.location.reload();function f(f){let{marker:p,props:m}=t(`AppRouteError`,f),h=e(`routeError`,l),{kind:g=`error`,homeHref:_=`/`,onRetry:v=d,brand:y,fullPage:b=!0,homeLabel:x=h.homeLabel,reloadLabel:S=h.reloadLabel,retryLabel:C=h.retryLabel,staleTitle:w=h.staleTitle,staleText:T=h.staleText,notFoundTitle:E=h.notFoundTitle,notFoundText:D=h.notFoundText,errorTitle:O=h.errorTitle,errorText:k=h.errorText,children:A,className:j=``,...M}=m;a(`AppRouteError`,M),i(`AppRouteError`,`kind`,g,u);let N=e=>/* @__PURE__ */ s(n,{variant:e,leftIcon:`home`,href:_,children:x}),P;return P=g===`stale-build`?/* @__PURE__ */ s(r,{status:`info`,icon:`refresh-cw`,title:w,subtitle:T,actions:/* @__PURE__ */ s(n,{leftIcon:`refresh-cw`,onClick:v,children:S}),children:A}):g===`not-found`?/* @__PURE__ */ s(r,{status:`404`,title:E,subtitle:D,actions:N(`solid`),children:A}):/* @__PURE__ */ s(r,{status:`500`,title:O,subtitle:k,actions:/* @__PURE__ */ c(o,{children:[/* @__PURE__ */ s(n,{leftIcon:`refresh-cw`,onClick:v,children:C}),N(`outline`)]}),children:A}),/* @__PURE__ */ c(`div`,{className:[b?`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`,j].filter(Boolean).join(` `),...p,...M,children:[y&&/* @__PURE__ */ s(`div`,{className:`mb-4`,children:y}),/* @__PURE__ */ s(`div`,{className:`col-12 col-md-8 col-lg-6`,children:P})]})}export{f as default};
@@ -0,0 +1 @@
1
+ import{linkTarget as e}from"../lib/linkTarget.js";import t from"../lib/useWuiText.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./AppActionIcon.js";import i from"./AppButton.js";import a from"./AppDropdown.js";import o from"./assertValidValue.js";import s from"./warnUnknownProps.js";import{jsx as c,jsxs as l}from"react/jsx-runtime";import{ROW_ACTIONS_TEXT as u}from"@webority/ui-elements/text";var d=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`],f=[`danger`],p=[`_blank`,`_self`],m=/^data-[a-z0-9]+(?:-[a-z0-9]+)*$/,h=e=>!!e,g=e=>!e.menuOnly&&(!!e.icon||e.showLabel===!0);function _(e){if(e.label.trim()===``)throw RangeError(`<AppRowActions> an action needs a label.`);if(e.to&&e.href)throw RangeError(`<AppRowActions> action "${e.key}" takes to or href, not both.`);if(!e.disabled&&!e.onClick&&!e.href&&!e.to)throw RangeError(`<AppRowActions> action "${e.key}" needs onClick, href or to unless it is disabled.`);if(e.disabledReason&&!e.disabled)throw RangeError(`<AppRowActions> action "${e.key}" has disabledReason without disabled.`);if(e.menuOnly&&e.showLabel)throw RangeError(`<AppRowActions> action "${e.key}" takes menuOnly or showLabel, not both.`);if((e.target||e.rel)&&!e.href&&!e.to)throw RangeError(`<AppRowActions> action "${e.key}" takes target and rel only with href or to.`);for(let t of Object.keys(e.data??{}))if(!m.test(t))throw RangeError(`<AppRowActions> action "${e.key}" has a data key "${t}" that is not data-<name> in lowercase.`);o(`AppRowActions`,`items[].tone`,e.tone,f),o(`AppRowActions`,`items[].target`,e.target,p),o(`AppRowActions`,`items[].iconVariant`,e.iconVariant,d)}function v(t,n){if(!n.to)return{href:n.href};let r=e(t,{to:n.to});return r.Tag===`a`?{href:r.linkProps.href}:{as:r.Tag,to:r.linkProps.to}}function y(e,t){let n=v(t,e),a={target:e.target,rel:e.rel,...e.data};if(e.showLabel||!e.icon)return/* @__PURE__ */ c(i,{size:`sm`,variant:`outline`,tone:e.tone,leftIcon:e.icon,iconVariant:e.iconVariant,tooltip:e.disabled?e.disabledReason:void 0,className:`wui-row-action-inline`,disabled:e.disabled,onClick:e.onClick,...n,...a,children:e.label},e.key);let o=e.disabled&&e.disabledReason?`${e.label}: ${e.disabledReason}`:e.label;return/* @__PURE__ */ c(r,{icon:e.icon,iconVariant:e.iconVariant,label:o,tone:e.tone,className:`wui-row-action-inline`,disabled:e.disabled,onClick:e.onClick,...n,...a},e.key)}function b(e){let{marker:r,props:i}=n(`AppRowActions`,e),o=t(`rowActions`,u),{items:d,menuLabel:f=o.menuLabel,linkComponent:p,className:m=``,...v}=i;s(`AppRowActions`,v);let b=d.filter(h);for(let e of b)_(e);let x=b.length>0&&b.every(g),S=b.map(e=>({key:e.key,label:e.label,icon:e.icon,to:e.to,href:e.href,target:e.target,rel:e.rel,data:e.data,onClick:e.onClick,tone:e.tone,disabled:e.disabled,disabledReason:e.disabledReason,hiddenFrom:g(e)?`sm`:void 0}));return/* @__PURE__ */ l(`div`,{className:[`u-row-actions`,m].filter(Boolean).join(` `),...r,...v,children:[b.filter(g).map(e=>y(e,p)),b.length>0?/* @__PURE__ */ c(a,{className:[`wui-row-actions-menu`,x?`wui-hidden-from-sm`:``].filter(Boolean).join(` `),icon:`more-horizontal`,label:f,align:`end`,toggleClassName:`u-action`,linkComponent:p,items:S}):null]})}export{b 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,helperText: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
+ import e from"../lib/FieldMessage.js";import{useFieldError as t}from"../lib/formFields.js";import n from"../lib/useWuiText.js";import{wuiMarkerAttributes as r}from"../lib/wuiMarker.js";import{useId as i}from"react";import{jsx as a,jsxs as o}from"react/jsx-runtime";import{SCORE_SCALE_TEXT as s}from"@webority/ui-elements/text";function c(c){let l=n(`scoreScale`,s),{value:u=null,onChange:d,min:f=0,max:p=10,label:m,lowLabel:h,highLabel:g,name:_,disabled:v=!1,error:y,helperText:b,id:x,className:S=``,fieldClassName:C=``,scoreLabel:w=l.scoreLabel}=c,T=t(_),E=y??T,D=i(),O=x||D,k=_||O,A=`${O}-error`,j=`${O}-hint`,M=Array.from({length:Math.max(0,p-f+1)},(e,t)=>f+t),N=h!=null||g!=null;return/* @__PURE__ */ o(`div`,{...r(`AppScoreScale`,c),className:`field${C?` ${C}`:``}`,children:[m!=null&&/* @__PURE__ */ a(`span`,{className:`label`,id:`${O}-label`,children:m}),/* @__PURE__ */ o(`div`,{className:`wui-score-scale${S?` ${S}`:``}`,id:O,role:`radiogroup`,"aria-labelledby":m==null?void 0:`${O}-label`,"aria-label":m==null?w:void 0,"aria-invalid":E?`true`:void 0,"aria-describedby":E?A:b?j:void 0,children:[M.map(e=>/* @__PURE__ */ o(`label`,{className:`wui-score-scale__item${u===e?` wui-score-scale__item--selected`:``}`,children:[/* @__PURE__ */ a(`input`,{type:`radio`,className:`visually-hidden`,name:k,value:e,checked:u===e,disabled:v,onChange:()=>d?.(e)}),e]},e)),N&&/* @__PURE__ */ o(`span`,{className:`wui-score-scale__ends`,children:[/* @__PURE__ */ a(`span`,{children:h}),/* @__PURE__ */ a(`span`,{children:g})]})]}),/* @__PURE__ */ a(e,{error:E,hint:b,errorId:A,hintId:j})]})}export{c as default};
@@ -1 +1 @@
1
- import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./AppIcon.js";import n from"./assertValidValue.js";import r from"./warnUnknownProps.js";import{isTypingTarget as i}from"@webority/ui-elements/helpers";import{useCallback as a,useEffect as o,useRef as s,useState as c}from"react";import{flushSync as l}from"react-dom";import{jsx as u,jsxs as d}from"react/jsx-runtime";import{Form as f}from"react-bootstrap";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);let{readOnly:N,...P}=M;n(`AppSearch`,`size`,T,p);let F=w??18,[I,L]=c(v??``),R=_===void 0?I:_,[z,B]=c(!!R),V=s(null),H=s(null),U=!D||z||!!R,W=a(()=>{B(!0),requestAnimationFrame(()=>V.current?.focus())},[]),G=()=>{L(``),l(()=>y?.(``)),V.current?.form?.requestSubmit()};o(()=>{if(!D)return;let e=e=>{e.key!==`/`||e.ctrlKey||e.altKey||e.metaKey||i(e.target instanceof Node?e.target:null)||[...document.querySelectorAll(`.search-wrap.wui-search-collapsible`)].find(e=>e.offsetParent!==null)===H.current&&(e.preventDefault(),W())};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[D,W]);let K=[`search-wrap`,R?`has-value`:``,T===`sm`?`search-sm`:T===`lg`?`search-lg`:``,E?`is-loading`:``,D?`wui-search-collapsible`:``,D&&!U?`is-collapsed`:``,k].filter(Boolean).join(` `),q=w==null?void 0:{"--wui-search-icon-size":`${w}px`};return/* @__PURE__ */ d(`div`,{...h,className:K,style:q,ref:H,onBlur:e=>{D&&!e.currentTarget.contains(e.relatedTarget)&&!R&&B(!1)},children:[D&&/* @__PURE__ */ u(`button`,{type:`button`,className:`wui-search-toggle`,"aria-label":x||b||C,"aria-expanded":U?`true`:`false`,onClick:W,children:/* @__PURE__ */ u(t,{name:`search`,size:F})}),E&&/* @__PURE__ */ u(`span`,{className:`search-spinner`,"aria-hidden":`true`}),/* @__PURE__ */ u(t,{name:`search`,size:F,className:`search-icon`}),/* @__PURE__ */ u(f.Control,{ref:V,type:`search`,className:`input search-input`,placeholder:b,value:R,onChange:e=>{L(e.target.value),y?.(e.target.value)},onKeyDown:e=>{j?.(e),D&&e.key===`Escape`&&!R&&B(!1)},"aria-label":x,form:A,disabled:O,...N===void 0?null:{readOnly:N},...P}),!O&&/* @__PURE__ */ u(`button`,{type:`button`,className:`search-clear`,"aria-label":S,onClick:G,hidden:!R,children:/* @__PURE__ */ u(t,{name:`x`,size:16})})]})}export{m as default};
1
+ import{FIELD_SIZES as e}from"../lib/fieldState.js";import t from"../lib/useWuiText.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./AppIcon.js";import i from"./assertValidValue.js";import a from"./warnUnknownProps.js";import{isTypingTarget as o}from"@webority/ui-elements/helpers";import{useCallback as s,useEffect as c,useRef as l,useState as u}from"react";import{flushSync as d}from"react-dom";import{jsx as f,jsxs as p}from"react/jsx-runtime";import{SEARCH_TEXT as m}from"@webority/ui-elements/text";import{Form as h}from"react-bootstrap";function g(g){let{marker:_,props:v}=n(`AppSearch`,g),y=t(`search`,m),{value:b,defaultValue:x,onChange:S,placeholder:C=y.placeholder,ariaLabel:w,clearLabel:T=y.clearLabel,searchLabel:E=y.searchLabel,iconSize:D,size:O,loading:k=!1,collapsible:A=!1,disabled:j=!1,className:M=``,form:N,onKeyDown:P,...F}=v;a(`AppSearch`,F);let{readOnly:I,...L}=F;i(`AppSearch`,`size`,O,e);let R=D??18,[z,B]=u(x??``),V=b===void 0?z:b,[H,U]=u(!!V),W=l(null),G=l(null),K=!A||H||!!V,q=s(()=>{U(!0),requestAnimationFrame(()=>W.current?.focus())},[]),J=()=>{B(``),d(()=>S?.(``)),W.current?.form?.requestSubmit()};c(()=>{if(!A)return;let e=e=>{e.key!==`/`||e.ctrlKey||e.altKey||e.metaKey||o(e.target instanceof Node?e.target:null)||[...document.querySelectorAll(`.search-wrap.wui-search-collapsible`)].find(e=>e.offsetParent!==null)===G.current&&(e.preventDefault(),q())};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[A,q]);let Y=[`search-wrap`,V?`has-value`:``,O===`sm`?`wui-search-sm`:O===`lg`?`wui-search-lg`:O===`xl`?`wui-search-xl`:``,k?`is-loading`:``,A?`wui-search-collapsible`:``,A&&!K?`is-collapsed`:``,M].filter(Boolean).join(` `),X=D==null?void 0:{"--wui-search-icon-size":`${D}px`};return/* @__PURE__ */ p(`div`,{..._,className:Y,style:X,ref:G,onBlur:e=>{A&&!e.currentTarget.contains(e.relatedTarget)&&!V&&U(!1)},children:[A&&/* @__PURE__ */ f(`button`,{type:`button`,className:`wui-search-toggle`,"aria-label":w||C||E,"aria-expanded":K?`true`:`false`,onClick:q,children:/* @__PURE__ */ f(r,{name:`search`,size:R})}),k&&/* @__PURE__ */ f(`span`,{className:`search-spinner`,"aria-hidden":`true`}),/* @__PURE__ */ f(r,{name:`search`,size:R,className:`search-icon`}),/* @__PURE__ */ f(h.Control,{ref:W,type:`search`,className:`input search-input`,placeholder:C,value:V,onChange:e=>{B(e.target.value),S?.(e.target.value)},onKeyDown:e=>{P?.(e),A&&e.key===`Escape`&&!V&&U(!1)},"aria-label":w,form:N,disabled:j,...I===void 0?null:{readOnly:I},...L}),!j&&/* @__PURE__ */ f(`button`,{type:`button`,className:`search-clear`,"aria-label":T,onClick:J,hidden:!V,children:/* @__PURE__ */ f(r,{name:`x`,size:16})})]})}export{g as default};
@@ -1 +1 @@
1
- import e,{SECTION_ALIGNS as t,SECTION_HEADINGS as n,SECTION_TITLE_FONTS as r,SECTION_VARIANTS as i,itemHeading as a,sectionHeading as o}from"../lib/sectionShell.js";import{splitMarkerProps as s}from"../lib/wuiMarker.js";import c from"./AppIcon.js";import l from"./assertValidValue.js";import u from"./warnUnknownProps.js";import{jsx as d,jsxs as f}from"react/jsx-runtime";var p=[`grid`,`rows`];function m(m){let{marker:h,props:g}=s(`AppSectionFeatures`,m),{title:_,items:v=[],layout:y=`grid`,as:b=`h2`,eyebrow:x,subtitle:S,align:C=`center`,variant:w=`default`,titleFont:T=`display`,inset:E,className:D=``,...O}=g;u(`AppSectionFeatures`,O),l(`AppSectionFeatures`,`layout`,y,p),l(`AppSectionFeatures`,`as`,b,n),l(`AppSectionFeatures`,`align`,C,t),l(`AppSectionFeatures`,`variant`,w,i),l(`AppSectionFeatures`,`titleFont`,T,r);let k=o(b,`h2`),A=a(k);return/* @__PURE__ */ d(e,{component:`AppSectionFeatures`,kind:`features`,title:_,as:k,eyebrow:x,subtitle:S,align:C,variant:w,titleFont:T,inset:E,extraClass:y===`rows`?`wui-section-features-rows`:``,className:D,rest:{...h,...O},children:v.length>0&&/* @__PURE__ */ d(`ul`,{className:`wui-section-features-list`,children:v.map(e=>/* @__PURE__ */ f(`li`,{className:`wui-section-feature`,children:[e.media!=null&&/* @__PURE__ */ d(`div`,{className:`wui-section-media`,children:e.media}),/* @__PURE__ */ f(`div`,{className:`wui-section-feature-body`,children:[e.icon&&/* @__PURE__ */ d(`span`,{className:`wui-section-feature-icon`,children:/* @__PURE__ */ d(c,{name:e.icon,size:24})}),/* @__PURE__ */ d(A,{className:`wui-section-feature-title`,children:e.title}),e.description!=null&&e.description!==``&&/* @__PURE__ */ d(`div`,{className:`wui-section-feature-text`,children:e.description})]})]},e.key??e.title))})})}export{m as default};
1
+ import e,{SECTION_ALIGNS as t,SECTION_HEADINGS as n,SECTION_TITLE_FONTS as r,SECTION_VARIANTS as i,SectionImage as a,itemHeading as o,sectionHeading as s}from"../lib/sectionShell.js";import{splitMarkerProps as c}from"../lib/wuiMarker.js";import l from"./AppIcon.js";import u from"./assertValidValue.js";import d from"./warnUnknownProps.js";import{jsx as f,jsxs as p}from"react/jsx-runtime";var m=[`grid`,`rows`];function h(h){let{marker:g,props:_}=c(`AppSectionFeatures`,h),{title:v,items:y=[],layout:b=`grid`,as:x=`h2`,eyebrow:S,subtitle:C,align:w=`center`,variant:T=`default`,titleFont:E=`display`,inset:D,className:O=``,...k}=_;d(`AppSectionFeatures`,k),u(`AppSectionFeatures`,`layout`,b,m),u(`AppSectionFeatures`,`as`,x,n),u(`AppSectionFeatures`,`align`,w,t),u(`AppSectionFeatures`,`variant`,T,i),u(`AppSectionFeatures`,`titleFont`,E,r);for(let e of y)if(e.imageSrc!==void 0){if(e.icon)throw Error(`AppSectionFeatures item "${e.title}" sets both icon and imageSrc: pick one.`);if(!e.imageAlt?.trim()||(e.imageWidth??0)<=0||(e.imageHeight??0)<=0)throw Error(`AppSectionFeatures item "${e.title}" needs imageAlt, imageWidth and imageHeight with imageSrc: an image without a size moves the page when it loads.`)}let A=s(x,`h2`),j=o(A);return/* @__PURE__ */ f(e,{component:`AppSectionFeatures`,kind:`features`,title:v,as:A,eyebrow:S,subtitle:C,align:w,variant:T,titleFont:E,inset:D,extraClass:b===`rows`?`wui-section-features-rows`:``,className:O,rest:{...g,...k},children:y.length>0&&/* @__PURE__ */ f(`ul`,{className:`wui-section-features-list`,children:y.map(e=>/* @__PURE__ */ p(`li`,{className:`wui-section-feature`,children:[e.media!=null&&/* @__PURE__ */ f(`div`,{className:`wui-section-media`,children:e.media}),/* @__PURE__ */ p(`div`,{className:`wui-section-feature-body`,children:[e.imageSrc!==void 0&&/* @__PURE__ */ f(`span`,{className:`wui-section-feature-icon wui-section-feature-icon-image`,children:/* @__PURE__ */ f(a,{className:`wui-section-feature-img`,src:e.imageSrc,alt:e.imageAlt??``,width:e.imageWidth??0,height:e.imageHeight??0})}),e.icon&&/* @__PURE__ */ f(`span`,{className:`wui-section-feature-icon`,children:/* @__PURE__ */ f(l,{name:e.icon,size:24})}),/* @__PURE__ */ f(j,{className:`wui-section-feature-title`,children:e.title}),e.description!=null&&e.description!==``&&/* @__PURE__ */ f(`div`,{className:`wui-section-feature-text`,children:e.description})]})]},e.key??e.title))})})}export{h 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"./AppForm.js";import l from"./AppInput.js";import ee from"./AppPhoneNumberInput.js";import u from"./AppTextarea.js";import d from"./assertValidValue.js";import te from"./warnUnknownProps.js";import{useId as ne,useState as f}from"react";import{jsx as p,jsxs as m}from"react/jsx-runtime";var h=[`name`,`email`,`phone`,`company`,`message`],g={name:`name`,email:`email`,company:`organization`},_=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function v(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!==``&&!_.test(e)&&(r[i]=n.invalidEmail)}return r}function y(_){let{marker:y,props:b}=a(`AppSectionLeadCapture`,_),{title:x,description:S,fields:C,onSubmit:w,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}=b;te(`AppSectionLeadCapture`,U),d(`AppSectionLeadCapture`,`as`,L,n),d(`AppSectionLeadCapture`,`align`,B,t),d(`AppSectionLeadCapture`,`variant`,V,r);for(let e of C)d(`AppSectionLeadCapture`,`fields.name`,e.name,h);let W=ne(),[G,K]=f(()=>Object.fromEntries(C.map(e=>[e.name,``]))),[q,J]=f({}),[Y,X]=f(null),[Z,Q]=f(!1),[re,ie]=f(!1),$=(e,t)=>K(n=>({...n,[e]:t})),ae={name:E,email:D,phone:O,company:k,message:A},oe={required:j,invalidEmail:M};async function se(){if(Z)return!1;let e=v(C,G,oe);if(J(e),X(null),Object.keys(e).length>0)return!1;let t=Object.fromEntries(Object.entries(G).map(([e,t])=>[e,(t??``).trim()]));Q(!0);try{return await w(t),ie(!0),!0}catch(e){let t=typeof e==`object`&&e&&`message`in e?e.message:void 0;return X(typeof t==`string`&&t!==``?t:N),!1}finally{Q(!1)}}function ce({name:e,label:t=ae[e],required:n=!1}){let r=`${W}-${e}`,i=q[e];return e===`phone`?/* @__PURE__ */ p(ee,{id:r,name:e,label:t,required:n,value:G[e],onChange:t=>$(e,t),error:i},e):e===`message`?/* @__PURE__ */ p(u,{id:r,name:e,label:t,required:n,value:G[e],onChange:t=>$(e,t.target.value),error:i},e):/* @__PURE__ */ p(l,{id:r,name:e,type:e===`email`?`email`:`text`,autoComplete:g[e],label:t,required:n,value:G[e],onChange:t=>$(e,t.target.value),error:i},e)}return/* @__PURE__ */ m(e,{component:`AppSectionLeadCapture`,kind:`lead-capture`,title:x,as:i(L,`h2`),eyebrow:R,subtitle:z,align:B,variant:V,className:H,rest:{...y,...U},children:[S!=null&&S!==``&&/* @__PURE__ */ p(`p`,{className:`wui-section-lead-text`,children:S}),re?/* @__PURE__ */ p(`div`,{className:`wui-section-lead-success`,children:/* @__PURE__ */ p(o,{tone:`success`,title:P,children:F})}):/* @__PURE__ */ m(c,{className:`wui-section-lead-form`,noValidate:!0,onSubmit:se,children:[/* @__PURE__ */ p(`div`,{className:`wui-section-lead-fields`,children:C.map(ce)}),Y!=null&&/* @__PURE__ */ p(o,{tone:`danger`,children:Y}),/* @__PURE__ */ p(s,{type:`submit`,loading:Z,children:T}),I!=null&&I!==``&&/* @__PURE__ */ p(`p`,{className:`wui-section-lead-consent`,children:I})]})]})}export{y 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 a from"../lib/useWuiText.js";import{splitMarkerProps as ee}from"../lib/wuiMarker.js";import o from"./AppAlert.js";import s from"./AppButton.js";import c from"./AppForm.js";import l from"./AppInput.js";import te from"./AppPhoneNumberInput.js";import ne from"./AppTextarea.js";import u from"./assertValidValue.js";import d from"./warnUnknownProps.js";import{useId as f,useState as p}from"react";import{jsx as m,jsxs as h}from"react/jsx-runtime";import{SECTION_LEAD_CAPTURE_TEXT as g}from"@webority/ui-elements/text";var _=[`name`,`email`,`phone`,`company`,`message`],v={name:`name`,email:`email`,company:`organization`},y=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function re(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!==``&&!y.test(e)&&(r[i]=n.invalidEmail)}return r}function b(y){let{marker:b,props:ie}=ee(`AppSectionLeadCapture`,y),x=a(`sectionLeadCapture`,g),{title:ae,description:S,fields:C,onSubmit:w,submitLabel:T=x.submitLabel,nameLabel:E=x.nameLabel,emailLabel:D=x.emailLabel,phoneLabel:O=x.phoneLabel,companyLabel:k=x.companyLabel,messageLabel:A=x.messageLabel,requiredText:j=x.requiredText,invalidEmailText:M=x.invalidEmailText,submitErrorText:N=x.submitErrorText,successTitle:P,successText:F,consent:I,as:L=`h2`,eyebrow:oe,subtitle:R,align:z=`center`,variant:B=`default`,className:V=``,...H}=ie;d(`AppSectionLeadCapture`,H),u(`AppSectionLeadCapture`,`as`,L,n),u(`AppSectionLeadCapture`,`align`,z,t),u(`AppSectionLeadCapture`,`variant`,B,r);for(let e of C)u(`AppSectionLeadCapture`,`fields.name`,e.name,_);let U=f(),[W,G]=p(()=>Object.fromEntries(C.map(e=>[e.name,``]))),[K,q]=p({}),[J,Y]=p(null),[X,Z]=p(!1),[se,ce]=p(!1),Q=(e,t)=>G(n=>({...n,[e]:t})),le={name:E,email:D,phone:O,company:k,message:A},$={required:j,invalidEmail:M};async function ue(){if(X)return!1;let e=re(C,W,$);if(q(e),Y(null),Object.keys(e).length>0)return!1;let t=Object.fromEntries(Object.entries(W).map(([e,t])=>[e,(t??``).trim()]));Z(!0);try{return await w(t),ce(!0),!0}catch(e){let t=typeof e==`object`&&e&&`message`in e?e.message:void 0;return Y(typeof t==`string`&&t!==``?t:N),!1}finally{Z(!1)}}function de({name:e,label:t=le[e],required:n=!1}){let r=`${U}-${e}`,i=K[e];return e===`phone`?/* @__PURE__ */ m(te,{id:r,name:e,label:t,required:n,value:W[e],onChange:t=>Q(e,t),error:i},e):e===`message`?/* @__PURE__ */ m(ne,{id:r,name:e,label:t,required:n,value:W[e],onChange:t=>Q(e,t.target.value),error:i},e):/* @__PURE__ */ m(l,{id:r,name:e,type:e===`email`?`email`:`text`,autoComplete:v[e],label:t,required:n,value:W[e],onChange:t=>Q(e,t.target.value),error:i},e)}return/* @__PURE__ */ h(e,{component:`AppSectionLeadCapture`,kind:`lead-capture`,title:ae,as:i(L,`h2`),eyebrow:oe,subtitle:R,align:z,variant:B,className:V,rest:{...b,...H},children:[S!=null&&S!==``&&/* @__PURE__ */ m(`p`,{className:`wui-section-lead-text`,children:S}),se?/* @__PURE__ */ m(`div`,{className:`wui-section-lead-success`,children:/* @__PURE__ */ m(o,{tone:`success`,title:P,children:F})}):/* @__PURE__ */ h(c,{className:`wui-section-lead-form`,noValidate:!0,onSubmit:ue,children:[/* @__PURE__ */ m(`div`,{className:`wui-section-lead-fields`,children:C.map(de)}),J!=null&&/* @__PURE__ */ m(o,{tone:`danger`,children:J}),/* @__PURE__ */ m(s,{type:`submit`,loading:X,children:T}),I!=null&&I!==``&&/* @__PURE__ */ m(`p`,{className:`wui-section-lead-consent`,children:I})]})]})}export{b as default};
@@ -1 +1 @@
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{TargetLink as s}from"../lib/TargetLink.js";import{splitMarkerProps as c}from"../lib/wuiMarker.js";import l from"./assertValidValue.js";import u from"./warnUnknownProps.js";import{jsx as d}from"react/jsx-runtime";var f=e=>typeof e==`string`&&e.trim()!==``?e:void 0;function p(e,t){let n=f(e.alt)??f(e.name)??f(e.label);if(n===void 0||e.width===void 0||e.height===void 0)throw Error(`AppSectionLogos item "${t}" needs alt, width and height.`);return/* @__PURE__ */ d(a,{className:`wui-section-logo-img`,src:t,alt:n,width:e.width,height:e.height})}function m(a){let{marker:m,props:h}=c(`AppSectionLogos`,a),{title:g,items:_=[],as:v=`h2`,eyebrow:y,subtitle:b,align:x=`center`,variant:S=`default`,className:C=``,linkComponent:w,...T}=h;u(`AppSectionLogos`,T),l(`AppSectionLogos`,`as`,v,r),l(`AppSectionLogos`,`align`,x,n),l(`AppSectionLogos`,`variant`,S,i);for(let e of _){let t=f(e.src),n=f(e.name)??f(e.label),r=(e.width??0)>0&&(e.height??0)>0;if(!(t?(f(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__ */ d(t,{component:`AppSectionLogos`,kind:`logos`,title:g,as:o(v,`h2`),eyebrow:y,subtitle:b,align:x,variant:S,className:C,rest:{...m,...T},children:_.length>0&&/* @__PURE__ */ d(`ul`,{className:`wui-section-logos-list`,children:_.map(t=>{let n=f(t.src),r=f(t.name)??f(t.label),i=n?p(t,n):/* @__PURE__ */ d(`span`,{className:`wui-section-logo-text`,children:r}),a=e(w,{href:t.href});return/* @__PURE__ */ d(`li`,{className:`wui-section-logo`,children:t.href?/* @__PURE__ */ d(s,{link:a,children:i}):i},t.key??n??r)})})})}export{m 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{TargetLink as s}from"../lib/TargetLink.js";import{splitMarkerProps as c}from"../lib/wuiMarker.js";import l from"./assertValidValue.js";import u from"./warnUnknownProps.js";import{jsx as d,jsxs as f}from"react/jsx-runtime";var p=e=>typeof e==`string`&&e.trim()!==``?e:void 0;function m(e,t){let n=p(e.alt)??p(e.name)??p(e.label);if(n===void 0||e.width===void 0||e.height===void 0)throw Error(`AppSectionLogos item "${t}" needs alt, width and height.`);return/* @__PURE__ */ d(a,{className:`wui-section-logo-img`,src:t,alt:n,width:e.width,height:e.height})}function h(a){let{marker:h,props:g}=c(`AppSectionLogos`,a),{title:_,items:v=[],as:y=`h2`,eyebrow:b,subtitle:x,align:S=`center`,variant:C=`default`,className:w=``,linkComponent:T,...E}=g;u(`AppSectionLogos`,E),l(`AppSectionLogos`,`as`,y,r),l(`AppSectionLogos`,`align`,S,n),l(`AppSectionLogos`,`variant`,C,i);for(let e of v){let t=p(e.src),n=p(e.name)??p(e.label),r=(e.width??0)>0&&(e.height??0)>0;if(!(t?(p(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__ */ d(t,{component:`AppSectionLogos`,kind:`logos`,title:_,as:o(y,`h2`),eyebrow:b,subtitle:x,align:S,variant:C,className:w,rest:{...h,...E},children:v.length>0&&/* @__PURE__ */ d(`ul`,{className:`wui-section-logos-list`,children:v.map(t=>{let n=p(t.src),r=p(t.name)??p(t.label),i=n?m(t,n):/* @__PURE__ */ d(`span`,{className:`wui-section-logo-text`,children:r}),a=p(t.caption),o=a?/* @__PURE__ */ f(`span`,{className:`wui-section-logo-stack`,children:[i,/* @__PURE__ */ d(`span`,{className:`wui-section-logo-caption`,children:a})]}):i,c=e(T,{href:t.href});return/* @__PURE__ */ d(`li`,{className:`wui-section-logo`,children:t.href?/* @__PURE__ */ d(s,{link:c,children:o}):o},t.key??n??r)})})})}export{h as default};
@@ -1 +1 @@
1
- import{FIELD_BUSY_CLASS as e,blockWhenReadOnly as t}from"../lib/fieldState.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./AppIcon.js";import i from"./AppInfoTip.js";import a from"./assertValidValue.js";import o from"./warnUnknownProps.js";import{useCallback as s,useEffect as c,useId as l,useLayoutEffect as u,useRef as d,useState as f}from"react";import{jsx as p,jsxs as m}from"react/jsx-runtime";var h={sm:`segmented-sm`,md:``,lg:`segmented-lg`};function g(g){let{marker:_,props:v}=n(`AppSegmented`,g),{options:y=[],value:b,defaultValue:x,onChange:S,label:C,name:w,size:T=`md`,fullWidth:E=!1,bordered:D=!0,disabled:O=!1,readOnly:k=!1,loading:A=!1,labelVisible:j=!1,help:M,helpLabel:N=`More information`,className:P=``,...F}=v;o(`AppSegmented`,F),a(`AppSegmented`,`size`,T,Object.keys(h));let I=l(),L=w||I,R=d(null),z=d(null),[B,V]=f(x),H=b===void 0?B:b,U=[`segmented`,h[T]??``,E?`segmented-full`:``,D?``:`wui-segmented-borderless`,O?`is-disabled`:``,A?e:``,P].filter(Boolean).join(` `),W=d(null),G=s(e=>{let t=R.current,n=z.current;if(!t||!n)return;let r=t.querySelector(`.segmented-option:has(.segmented-input:checked)`);if(!r||!t.offsetWidth){n.style.opacity=`0`,W.current=null;return}let i=r.offsetLeft,a=r.offsetWidth,o=W.current;if(o&&o.thumb===n&&o.left===i&&o.width===a)return;let s=e||!o||o.thumb!==n;s&&t.classList.remove(`is-animated`),n.style.width=`${a}px`,n.style.transform=`translateX(${i}px)`,n.style.opacity=`1`,W.current={thumb:n,left:i,width:a},s&&requestAnimationFrame(()=>R.current?.classList.add(`is-animated`))},[]);u(()=>{G(!1)});let K=s(e=>{if(R.current=e,!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(()=>G(!0));return t.observe(e),()=>{t.disconnect(),R.current=null}},[G]);c(()=>{let e=requestAnimationFrame(()=>R.current?.classList.add(`is-animated`));return()=>cancelAnimationFrame(e)},[]);let q=j&&C,J=/* @__PURE__ */ m(`div`,{ref:K,className:U,role:`radiogroup`,"aria-label":C,"aria-disabled":O||void 0,"aria-busy":A||void 0,...q?void 0:_,...F,children:[/* @__PURE__ */ p(`span`,{className:`segmented-thumb`,ref:z,"aria-hidden":`true`}),y.map(e=>/* @__PURE__ */ m(`label`,{className:`segmented-option`,children:[/* @__PURE__ */ p(`input`,{type:`radio`,className:`segmented-input`,name:L,value:e.value,checked:e.value===H,disabled:O||A||e.disabled,"aria-readonly":k||void 0,onClick:t(k||A),onChange:()=>{V(e.value),S?.(e.value)}}),e.icon&&/* @__PURE__ */ p(r,{name:e.icon,size:13}),e.note?/* @__PURE__ */ m(`span`,{className:`segmented-option-text`,children:[/* @__PURE__ */ p(`span`,{className:`segmented-option-label`,children:e.label}),/* @__PURE__ */ p(`span`,{className:`segmented-option-note`,children:e.note})]}):e.label,e.count!=null&&/* @__PURE__ */ p(`span`,{className:`wui-segmented-option-count`,children:e.count})]},e.value))]},`group`);return q?/* @__PURE__ */ m(`div`,{className:`field`,..._,children:[/* @__PURE__ */ p(`span`,{className:`label`,"aria-hidden":`true`,children:C}),M&&/* @__PURE__ */ p(i,{label:N,children:M}),J]},`field`):J}export{g as default};
1
+ import{FIELD_BUSY_CLASS as e,blockWhenReadOnly as t}from"../lib/fieldState.js";import n from"../lib/useWuiText.js";import{splitMarkerProps as r}from"../lib/wuiMarker.js";import i from"./AppIcon.js";import a from"./AppInfoTip.js";import o from"./assertValidValue.js";import s from"./warnUnknownProps.js";import{useCallback as c,useEffect as l,useId as u,useLayoutEffect as d,useRef as f,useState as p}from"react";import{jsx as m,jsxs as h}from"react/jsx-runtime";import{SEGMENTED_TEXT as g}from"@webority/ui-elements/text";var _={sm:`segmented-sm`,md:``,lg:`segmented-lg`};function v(v){let{marker:y,props:b}=r(`AppSegmented`,v),x=n(`segmented`,g),{options:S=[],value:C,defaultValue:w,onChange:T,label:E,name:D,size:O=`md`,fullWidth:k=!1,bordered:A=!0,disabled:j=!1,readOnly:M=!1,loading:N=!1,labelVisible:P=!1,help:F,helpLabel:I=x.helpLabel,className:L=``,...R}=b;s(`AppSegmented`,R),o(`AppSegmented`,`size`,O,Object.keys(_));let z=u(),B=D||z,V=f(null),H=f(null),[U,W]=p(w),G=C===void 0?U:C,K=[`segmented`,_[O]??``,k?`segmented-full`:``,A?``:`wui-segmented-borderless`,j?`is-disabled`:``,N?e:``,L].filter(Boolean).join(` `),q=f(null),J=c(e=>{let t=V.current,n=H.current;if(!t||!n)return;let r=t.querySelector(`.segmented-option:has(.segmented-input:checked)`);if(!r||!t.offsetWidth){n.style.opacity=`0`,q.current=null;return}let i=r.offsetLeft,a=r.offsetWidth,o=q.current;if(o&&o.thumb===n&&o.left===i&&o.width===a)return;let s=e||!o||o.thumb!==n;s&&t.classList.remove(`is-animated`),n.style.width=`${a}px`,n.style.transform=`translateX(${i}px)`,n.style.opacity=`1`,q.current={thumb:n,left:i,width:a},s&&requestAnimationFrame(()=>V.current?.classList.add(`is-animated`))},[]);d(()=>{J(!1)});let Y=c(e=>{if(V.current=e,!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(()=>J(!0));return t.observe(e),()=>{t.disconnect(),V.current=null}},[J]);l(()=>{let e=requestAnimationFrame(()=>V.current?.classList.add(`is-animated`));return()=>cancelAnimationFrame(e)},[]);let X=P&&E,Z=/* @__PURE__ */ h(`div`,{ref:Y,className:K,role:`radiogroup`,"aria-label":E,"aria-disabled":j||void 0,"aria-busy":N||void 0,...X?void 0:y,...R,children:[/* @__PURE__ */ m(`span`,{className:`segmented-thumb`,ref:H,"aria-hidden":`true`}),S.map(e=>/* @__PURE__ */ h(`label`,{className:`segmented-option`,children:[/* @__PURE__ */ m(`input`,{type:`radio`,className:`segmented-input`,name:B,value:e.value,checked:e.value===G,disabled:j||N||e.disabled,"aria-readonly":M||void 0,onClick:t(M||N),onChange:()=>{W(e.value),T?.(e.value)}}),e.icon&&/* @__PURE__ */ m(i,{name:e.icon,size:13}),e.note?/* @__PURE__ */ h(`span`,{className:`segmented-option-text`,children:[/* @__PURE__ */ m(`span`,{className:`segmented-option-label`,children:e.label}),/* @__PURE__ */ m(`span`,{className:`segmented-option-note`,children:e.note})]}):e.label,e.count!=null&&/* @__PURE__ */ m(`span`,{className:`wui-segmented-option-count`,children:e.count})]},e.value))]},`group`);return X?/* @__PURE__ */ h(`div`,{className:`field`,...y,children:[/* @__PURE__ */ m(`span`,{className:`label`,"aria-hidden":`true`,children:E}),F&&/* @__PURE__ */ m(a,{label:I,children:F}),Z]},`field`):Z}export{v as default};
@@ -1 +1 @@
1
- import{devWarn as e}from"../lib/devWarn.js";import t from"../lib/FieldMessage.js";import{loadFlagStyles as n}from"../lib/flagStyles.js";import r from"../lib/useElementEntry.js";import{splitMarkerProps as ee}from"../lib/wuiMarker.js";import te from"./AppInfoTip.js";import ne from"./AppRequiredMark.js";import i from"./assertValidValue.js";import a from"./textOf.js";import re from"./useNodeLabels.js";import ie,{optionsEqual as ae}from"./useWuiControl.js";import oe from"./warnUnknownProps.js";import{forwardRef as o,useEffect as s,useId as se,useLayoutEffect as c,useMemo as ce,useRef as l}from"react";import{Fragment as le,jsx as u,jsxs as d}from"react/jsx-runtime";var ue=[`single`,`multiple`,`search`,`tag`,`country`],de=[`comfortable`,`compact`],f=[`sm`,`md`,`lg`],fe=[`off`,`border`,`above`],pe=[],p=[],me=()=>import(`@webority/ui-elements/elements/select`),he=e=>e===`multiple`||e===`tag`,m=e=>e!=null&&e!==``,h=e=>{throw Error(`<AppSelect> controlOnly draws no field, so it takes no ${e}; draw the label or message on the page.`)},ge=(e,t)=>{let n=t??``;String(e.value??``)!==String(n)&&(e.value=n)},_e=(e,t)=>{let n=Array.isArray(t)?t:p,r=Array.isArray(e.value)?e.value:p;n.length===r.length&&n.every((e,t)=>e===r[t])||(e.value=n)},ve=(e,t)=>({...e,label:t}),ye=e=>Array.isArray(e)?e.join(`,`):e,be=o(function(o,be){let g=r(`wui-select`,me),{marker:_,props:xe}=ee(`AppSelect`,o),{mode:v=`single`,density:y=`comfortable`,size:b,value:Se,defaultValue:x,onChange:Ce,options:S=pe,loadOptions:C,remote:w=!1,onSearch:we,validate:T,placeholder:Te,searchPlaceholder:Ee,emptyText:De,searchable:E,clearable:Oe=!1,openOnHover:ke=!1,icon:Ae,valuePrefix:D,prefix:O,suffix:k,floatingLabel:A=`off`,disabled:je,readOnly:Me=!1,loading:Ne=!1,open:Pe,label:j,required:M=!1,optional:N=!1,optionalLabel:P=`(optional)`,error:F,helperText:I,help:L,helpLabel:Fe=`More information`,id:Ie,name:Le,minChars:R,debounce:z,allowCustom:Re=!1,addLabel:ze,searchingText:Be,hintText:Ve,valueLabel:He,valueAvatar:Ue,valueInitials:We,maxTags:B,allowDuplicates:Ge=!1,separators:Ke,pattern:qe,invalidMessage:Je,createLabel:Ye,collapseChips:Xe=!1,selectedText:Ze,clearAllLabel:Qe,countries:$e,suggested:et,suggestedLabel:tt,allCountriesLabel:nt,recentsKey:rt,recentsLimit:V,recentsLabel:it,className:at=``,fieldClassName:H=``,controlOnly:U=!1,"aria-label":ot,"aria-labelledby":st,"aria-describedby":ct,...lt}=xe;oe(`AppSelect`,lt),i(`AppSelect`,`mode`,v,ue),i(`AppSelect`,`density`,y,de),i(`AppSelect`,`size`,b,f);let W=he(v);i(`AppSelect`,`floatingLabel`,A,W?[`off`]:fe);let ut=l(!1);W&&(O!=null||k!=null)&&!ut.current&&(ut.current=!0,e(`AppSelect: prefix and suffix are not drawn in mode="${v}"; they are ignored.`));let dt=se(),G=l(!1);s(()=>{v===`country`&&n()},[v]);let{setRef:ft,innerRef:K}=ie({ready:g,ref:be,value:Se??(x===void 0?W?p:``:void 0),defaultValue:x,writeValue:W?_e:ge,on:{change:e=>{let t=e.currentTarget.value,n={isCustom:!!e.detail?.isCustom};switch(o.mode){case`multiple`:Array.isArray(t)&&o.onChange?.(t);break;case`tag`:Array.isArray(t)&&o.onChange?.(t,n);break;case`search`:typeof t==`string`&&o.onChange?.(t,n);break;default:typeof t==`string`&&o.onChange?.(t)}},search:e=>{w&&typeof C!=`function`&&we?.(e.detail.query,{seq:e.detail.seq})}}}),pt=ce(()=>typeof C==`function`?(e,t)=>new Promise(n=>n(C(e,t))).then(e=>(G.current=!0,e),e=>{throw G.current=!0,e}):null,[C]),{portal:mt,toElementOptions:q}=re(S),J=l({el:null,options:null,map:null});c(()=>{let e=K.current;if(!e||!g||J.current.el===e&&J.current.options===S&&J.current.map===q||(J.current={el:e,options:S,map:q},C&&G.current))return;let t=q(S,ve);ae(t,e.options)||(e.options=t)}),c(()=>{let e=K.current;if(!e||!g)return;e.loadOptions!==pt&&(e.loadOptions=pt);let t=typeof T==`function`?T:null;e.validate!==t&&(e.validate=t)}),c(()=>{K.current?.toggleAttribute(`loading`,!!Ne)});let Y=Ie||dt,X=!W&&A!==`off`&&j,ht=F&&Y?`${Y}-error`:void 0,gt=I&&Y?`${Y}-hint`:void 0,_t=ht||gt||ct;s(()=>{let e=K.current;e&&(D==null||D===``?e.removeAttribute(`prefix`):e.setAttribute(`prefix`,D))},[D,K]);let vt=!W&&!X&&(O!=null||k!=null),yt=v===`multiple`||v===`tag`||v===`country`;if(U&&(m(j)&&h(`label`),m(F)&&h(`error`),m(I)&&h(`helperText`),m(H)&&h(`fieldClassName`),yt))throw Error(`<AppSelect> controlOnly draws no field, so it takes no mode="${v}"; that mode always draws its field.`);let Z=U||!yt&&!j&&!F&&!I&&!H,bt=a(j).trim(),xt=bt&&(v===`single`||v===`multiple`||v===`search`)?`Search ${bt}…`:void 0,St=/* @__PURE__ */ u(`wui-select`,{"aria-label":ot||a(j)||void 0,"aria-labelledby":st||void 0,"aria-describedby":_t||void 0,"aria-invalid":F?`true`:void 0,ref:ft,id:Y,name:Le,mode:v,density:y===`compact`?`compact`:void 0,placeholder:X?` `:Te||void 0,"search-placeholder":Ee||xt,"empty-text":De||void 0,searchable:E===void 0?void 0:E?`true`:`false`,clearable:Oe?``:void 0,"open-on-hover":ke?``:void 0,size:b!==`md`&&f.includes(b??``)?b:void 0,icon:Ae||void 0,disabled:je?``:void 0,readonly:Me?``:void 0,open:Pe?``:void 0,required:M?``:void 0,"min-chars":R==null?void 0:String(R),debounce:z==null?void 0:String(z),remote:w?``:void 0,"allow-custom":Re?``:void 0,"add-label":ze||void 0,"searching-text":Be||void 0,"hint-text":Ve||void 0,"value-label":He||void 0,"value-avatar":Ue||void 0,"value-initials":We||void 0,"max-tags":B==null?void 0:String(B),"allow-duplicates":Ge?``:void 0,separators:Ke||void 0,pattern:qe||void 0,"invalid-message":Je||void 0,"create-label":Ye||void 0,"collapse-chips":Xe?``:void 0,"selected-text":Ze||void 0,"clear-all-label":Qe||void 0,countries:ye($e)||void 0,suggested:ye(et)||void 0,"suggested-label":tt||void 0,"all-countries-label":nt||void 0,"recents-key":rt||void 0,"recents-limit":V==null?void 0:String(V),"recents-label":it||void 0,className:at||void 0,...Z&&!vt?_:null,...lt}),Q=/* @__PURE__ */ d(le,{children:[St,mt]}),$=vt?/* @__PURE__ */ d(`div`,{...Z?_:null,className:`input-affixed`,children:[O!=null&&/* @__PURE__ */ u(`span`,{className:`affix affix-pre`,children:O}),Q,k!=null&&/* @__PURE__ */ u(`span`,{className:`affix affix-suf`,children:k})]}):Q;if(Z)return $;let Ct=[`field`,H].filter(Boolean).join(` `);return/* @__PURE__ */ d(`div`,{..._,className:Ct,children:[j&&!X&&/* @__PURE__ */ d(`label`,{className:`label`,htmlFor:Y,children:[j,N&&!M&&/* @__PURE__ */ u(`span`,{className:`label-optional`,children:` ${P}`}),M&&/* @__PURE__ */ u(ne,{}),L&&/* @__PURE__ */ u(te,{label:Fe,children:L})]}),X?/* @__PURE__ */ d(`div`,{className:A===`above`?`field-float wui-float-above`:`field-float`,children:[Q,/* @__PURE__ */ d(`label`,{className:`float-label`,htmlFor:Y,children:[j,N&&!M&&/* @__PURE__ */ u(`span`,{className:`label-optional`,children:` ${P}`}),M&&/* @__PURE__ */ u(ne,{})]})]}):$,/* @__PURE__ */ u(t,{error:F,hint:I,errorId:ht,hintId:gt})]})});export{be as default};
1
+ import{devWarn as e}from"../lib/devWarn.js";import t from"../lib/FieldMessage.js";import{FIELD_SIZES as n}from"../lib/fieldState.js";import{loadFlagStyles as r}from"../lib/flagStyles.js";import{useFieldError as ee}from"../lib/formFields.js";import te from"../lib/useElementEntry.js";import ne from"../lib/useWuiText.js";import{splitMarkerProps as re}from"../lib/wuiMarker.js";import ie from"./AppInfoTip.js";import i from"./AppRequiredMark.js";import a from"./assertValidValue.js";import ae from"./textOf.js";import oe from"./useNodeLabels.js";import se,{optionsEqual as ce}from"./useWuiControl.js";import le from"./warnUnknownProps.js";import{forwardRef as o,useEffect as s,useId as ue,useLayoutEffect as c,useMemo as de,useRef as l}from"react";import{Fragment as fe,jsx as u,jsxs as d}from"react/jsx-runtime";import{SELECT_TEXT as pe,fillText as me}from"@webority/ui-elements/text";var he=[`single`,`multiple`,`search`,`tag`,`country`],ge=[`comfortable`,`compact`],_e=[`off`,`border`,`above`],ve=[],f=[],ye=()=>import(`@webority/ui-elements/elements/select`),be=e=>e===`multiple`||e===`tag`,p=e=>e!=null&&e!==``,m=e=>{throw Error(`<AppSelect> controlOnly draws no field, so it takes no ${e}; draw the label or message on the page.`)},xe=(e,t)=>{let n=t??``;String(e.value??``)!==String(n)&&(e.value=n)},Se=(e,t)=>{let n=Array.isArray(t)?t:f,r=Array.isArray(e.value)?e.value:f;n.length===r.length&&n.every((e,t)=>e===r[t])||(e.value=n)},Ce=(e,t)=>({...e,label:t}),we=e=>Array.isArray(e)?e.join(`,`):e,h=o(function(o,h){let g=te(`wui-select`,ye),{marker:_,props:Te}=re(`AppSelect`,o),v=ne(`select`,pe),{mode:y=`single`,density:b=`comfortable`,size:x,value:Ee,defaultValue:S,onChange:De,options:C=ve,loadOptions:w,remote:T=!1,onSearch:Oe,validate:E,placeholder:ke,searchPlaceholder:Ae,emptyText:je,searchable:D,clearable:Me=!1,openOnHover:Ne=!1,icon:Pe,valuePrefix:O,prefix:k,suffix:A,floatingLabel:j=`off`,disabled:Fe,readOnly:Ie=!1,loading:Le=!1,open:Re,label:M,required:N=!1,optional:P=!1,optionalLabel:F=v.optionalLabel,error:ze,helperText:I,help:L,helpLabel:Be=v.helpLabel,id:Ve,name:R,minChars:z,debounce:B,allowCustom:He=!1,addLabel:Ue,searchingText:We,hintText:Ge,valueLabel:Ke,valueAvatar:qe,valueInitials:Je,maxTags:V,allowDuplicates:Ye=!1,separators:Xe,pattern:Ze,invalidMessage:Qe,createLabel:$e,collapseChips:et=!1,selectedText:tt,clearAllLabel:nt,countries:rt,suggested:it,suggestedLabel:at,allCountriesLabel:ot,recentsKey:st,recentsLimit:H,recentsLabel:ct,className:lt=``,fieldClassName:U=``,controlOnly:ut=!1,"aria-label":dt,"aria-labelledby":ft,"aria-describedby":pt,"aria-invalid":mt,...ht}=Te,gt=ee(R),W=ze??gt;le(`AppSelect`,ht),a(`AppSelect`,`mode`,y,he),a(`AppSelect`,`density`,b,ge),a(`AppSelect`,`size`,x,n);let G=be(y);a(`AppSelect`,`floatingLabel`,j,G?[`off`]:_e);let _t=l(!1);G&&(k!=null||A!=null)&&!_t.current&&(_t.current=!0,e(`AppSelect: prefix and suffix are not drawn in mode="${y}"; they are ignored.`));let vt=ue(),K=l(!1);s(()=>{y===`country`&&r()},[y]);let{setRef:yt,innerRef:q}=se({ready:g,ref:h,value:Ee??(S===void 0?G?f:``:void 0),defaultValue:S,writeValue:G?Se:xe,on:{change:e=>{let t=e.currentTarget.value,n={isCustom:!!e.detail?.isCustom};switch(o.mode){case`multiple`:Array.isArray(t)&&o.onChange?.(t);break;case`tag`:Array.isArray(t)&&o.onChange?.(t,n);break;case`search`:typeof t==`string`&&o.onChange?.(t,n);break;default:typeof t==`string`&&o.onChange?.(t)}},search:e=>{T&&typeof w!=`function`&&Oe?.(e.detail.query,{seq:e.detail.seq})}}}),bt=de(()=>typeof w==`function`?(e,t)=>new Promise(n=>n(w(e,t))).then(e=>(K.current=!0,e),e=>{throw K.current=!0,e}):null,[w]),{portal:xt,toElementOptions:J}=oe(C),Y=l({el:null,options:null,map:null});c(()=>{let e=q.current;if(!e||!g||Y.current.el===e&&Y.current.options===C&&Y.current.map===J||(Y.current={el:e,options:C,map:J},w&&K.current))return;let t=J(C,Ce);ce(t,e.options)||(e.options=t)}),c(()=>{let e=q.current;if(!e||!g)return;e.loadOptions!==bt&&(e.loadOptions=bt);let t=typeof E==`function`?E:null;e.validate!==t&&(e.validate=t)}),c(()=>{q.current?.toggleAttribute(`loading`,!!Le)});let X=Ve||vt,Z=!G&&j!==`off`&&M,St=W&&X?`${X}-error`:void 0,Ct=I&&X?`${X}-hint`:void 0,wt=St||Ct||pt;s(()=>{let e=q.current;e&&(O==null||O===``?e.removeAttribute(`prefix`):e.setAttribute(`prefix`,O))},[O,q]);let Tt=!G&&!Z&&(k!=null||A!=null),Et=y===`multiple`||y===`tag`||y===`country`;if(ut&&(p(M)&&m(`label`),p(W)&&m(`error`),p(I)&&m(`helperText`),p(U)&&m(`fieldClassName`),Et))throw Error(`<AppSelect> controlOnly draws no field, so it takes no mode="${y}"; that mode always draws its field.`);let Q=ut||!Et&&!M&&!W&&!I&&!U,Dt=ae(M).trim(),Ot=Dt&&(y===`single`||y===`multiple`||y===`search`)?me(v.defaultSearchPlaceholder,{labelText:Dt}):void 0,kt=/* @__PURE__ */ u(`wui-select`,{"aria-label":dt||ae(M)||void 0,"aria-labelledby":ft||void 0,"aria-describedby":wt||void 0,"aria-invalid":mt??(W?`true`:void 0),ref:yt,id:X,name:R,mode:y,density:b===`compact`?`compact`:void 0,placeholder:Z?` `:ke||void 0,"search-placeholder":Ae||Ot,"empty-text":je||void 0,searchable:D===void 0?void 0:D?`true`:`false`,clearable:Me?``:void 0,"open-on-hover":Ne?``:void 0,size:x!==`md`&&n.includes(x??``)?x:void 0,icon:Pe||void 0,disabled:Fe?``:void 0,readonly:Ie?``:void 0,open:Re?``:void 0,required:N?``:void 0,"min-chars":z==null?void 0:String(z),debounce:B==null?void 0:String(B),remote:T?``:void 0,"allow-custom":He?``:void 0,"add-label":Ue||void 0,"searching-text":We||void 0,"hint-text":Ge||void 0,"value-label":Ke||void 0,"value-avatar":qe||void 0,"value-initials":Je||void 0,"max-tags":V==null?void 0:String(V),"allow-duplicates":Ye?``:void 0,separators:Xe||void 0,pattern:Ze||void 0,"invalid-message":Qe||void 0,"create-label":$e||void 0,"collapse-chips":et?``:void 0,"selected-text":tt||void 0,"clear-all-label":nt||void 0,countries:we(rt)||void 0,suggested:we(it)||void 0,"suggested-label":at||void 0,"all-countries-label":ot||void 0,"recents-key":st||void 0,"recents-limit":H==null?void 0:String(H),"recents-label":ct||void 0,className:lt||void 0,...Q&&!Tt?_:null,...ht}),$=/* @__PURE__ */ d(fe,{children:[kt,xt]}),At=Tt?/* @__PURE__ */ d(`div`,{...Q?_:null,className:`input-affixed`,children:[k!=null&&/* @__PURE__ */ u(`span`,{className:`affix affix-pre`,children:k}),$,A!=null&&/* @__PURE__ */ u(`span`,{className:`affix affix-suf`,children:A})]}):$;if(Q)return At;let jt=[`field`,U].filter(Boolean).join(` `);return/* @__PURE__ */ d(`div`,{..._,className:jt,children:[M&&!Z&&/* @__PURE__ */ d(`label`,{className:`label`,htmlFor:X,children:[M,P&&!N&&/* @__PURE__ */ u(`span`,{className:`label-optional`,children:` ${F}`}),N&&/* @__PURE__ */ u(i,{}),L&&/* @__PURE__ */ u(ie,{label:Be,children:L})]}),Z?/* @__PURE__ */ d(`div`,{className:j===`above`?`field-float wui-float-above`:`field-float`,children:[$,/* @__PURE__ */ d(`label`,{className:`float-label`,htmlFor:X,children:[M,P&&!N&&/* @__PURE__ */ u(`span`,{className:`label-optional`,children:` ${F}`}),N&&/* @__PURE__ */ u(i,{})]})]}):At,/* @__PURE__ */ u(t,{error:W,hint:I,errorId:St,hintId:Ct})]})});export{h as default};
@@ -1 +1 @@
1
- import{devWarn as e}from"../lib/devWarn.js";import t from"../lib/fillLabel.js";import{linkTarget as n}from"../lib/linkTarget.js";import{navMatchScore as r}from"../lib/navMatch.js";import{SHELL_FOLDED_COOKIE as i,readNavFolded as a,readShellCollapsed as o,writeNavFolded as s,writeShellCollapsed as c}from"../lib/shellCookie.js";import{TargetLink as l}from"../lib/TargetLink.js";import u from"../lib/useElementEntry.js";import{TONES as d}from"../lib/vocabulary.js";import{splitMarkerProps as f}from"../lib/wuiMarker.js";import p from"./AppAvatar.js";import m from"./AppButton.js";import h from"./AppIcon.js";import g from"./AppNavigationMenu.js";import _ from"./assertValidValue.js";import v from"./warnUnknownProps.js";import{initScrollEdges as y,isImeSafeEnter as b,revealActiveNavItem as x,setPopoverOpen as S}from"@webority/ui-elements/helpers";import{useEffect as C,useId as w,useMemo as T,useRef as E,useState as D}from"react";import{Fragment as O,jsx as k,jsxs as A}from"react/jsx-runtime";var j=()=>import(`@webority/ui-elements/elements/overflow`),M=()=>import(`@webority/ui-elements/elements/dropdown`),N=99,P=4,F=5,I=/^[a-z0-9-]+$/,L=`wui-sidebar-footer`,R=[],z=[`prefix`,`exact`],B=[`comfortable`,`compact`],V=[`neutral`,`primary`],ee=[`default`,`brand`],te=[`side`,`top`],ne=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`],re=/* @__PURE__ */ new Set([`key`,`label`,`icon`,`iconVariant`,`iconSize`,`href`,`badge`,`badgeTone`,`badgeTitle`,`newUntil`,`trailingIcon`,`active`,`match`,`matchAlso`,`tab`,`tabLabel`,`children`]),H=e=>e>N?`${N}+`:String(e),U=new Intl.DateTimeFormat(`en-CA`,{timeZone:`Asia/Kolkata`}),ie=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:U.format(/* @__PURE__ */ new Date)<=e},ae=({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(` `)},oe=({logoLight:e,logoDark:t,markLight:n,markDark:r,brandName:i})=>{let a=i??``,o=[e&&/* @__PURE__ */ k(`img`,{className:`wui-brand-logo wui-brand-light`,src:e,alt:a},`logo-light`),t&&/* @__PURE__ */ k(`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(e=>!!e).map(([t,n,r],i)=>i===0&&!e?/* @__PURE__ */ k(`img`,{className:n,src:r,alt:a},t):/* @__PURE__ */ k(`img`,{className:n,src:r,alt:``,"aria-hidden":`true`},t));return[...o,...s].filter(Boolean)};function W(e){let{marker:t,props:n}=f(`AppShell`,e),{groups:r=[],brand:l,logoLight:u,logoDark:d,markLight:p,markDark:m,brandName:b,brandHref:w,brandLabel:j,sidebarStart:M,sidebarStartCompact:N,sidebarFooter:P,sidebarFooterItems:F=R,topbarStart:I,topbarEnd:L,footer:z,launcher:re,children:H,collapsed:U,onCollapsedChange:ie,noSidebar:W=!1,nav:G=`side`,density:K=`comfortable`,itemHeight:ce,iconVariant:q=`twotone`,topbarTone:le=`neutral`,tone:J=`default`,navLabel:ve=`Main navigation`,linkComponent:Y,currentPath:be,rememberCollapsed:xe=!1,collapsedCookie:Se=`wui-shell-collapsed`,foldedCookie:Ce=i,tabBarLabel:we=`Quick navigation`,moreLabel:Te=`More`,skipLabel:Ee=`Skip to content`,openNavLabel:De=`Open navigation`,expandNavLabel:Oe=`Expand navigation`,collapseNavLabel:ke=`Collapse navigation`,newLabel:Ae=`New`,togglePagesLabel:je=`Show or hide {name} pages`,accountMenuLabel:Me=`Account menu for {name}`,roleLabel:Ne=`Role:`,rolesLabel:Pe=`Roles:`,unreadLabel:Fe=`Unread`,markAllReadLabel:Ie=`Mark all read`,viewAllLabel:Le=`View all`,loadingNotificationsText:Re=`Loading…`,noUnreadText:ze=`No unread notifications`,unreadNotificationsText:Be=`{count} unread notifications`,unreadBellLabel:Ve=`{label}, {count} unread`,searchResultsLabel:He=`Search results`,noResultsText:Ue=`No results`,noResultsForText:We=`No results for “{value}”`,resultsCountText:Ge=`{count} results`,resultCountText:Ke=`{count} result`,userMenu:qe,notifications:Je,search:Ye,className:Xe=``,style:Ze,...Qe}=n;if(v(`AppShell`,Qe),_(`AppShell`,`density`,K,B),_(`AppShell`,`topbarTone`,le,V),_(`AppShell`,`tone`,J,ee),_(`AppShell`,`nav`,G,te),_(`AppShell`,`iconVariant`,q,ne),j!==void 0&&!w)throw Error(`<AppShell> brandLabel names the brand link, so it needs brandHref.`);if(w){if(!j&&!b)throw Error(`<AppShell> brandHref needs brandLabel or brandName: the collapsed rail hides the logo, so the link would have no accessible name.`);if(!(l||u||d||p||m))throw Error(`<AppShell> brandHref has no brand, logo or mark to link.`)}let $e=(ce??0)>0?{...Ze,"--wui-nav-item-height":`${ce}px`}:Ze,[et,tt]=D(()=>xe&&U===void 0&&typeof document<`u`?o(Se)??!1:!1),[X,Z]=D(!1),nt=E(null),[rt,it]=D(!1),[at,ot]=D(!1),st=E(null),Q=U??et,ct=e=>w?/* @__PURE__ */ k(fe,{href:w,label:j||b,linkComponent:Y,onNavigate:()=>Z(!1),children:e}):e,lt=()=>{let e=!Q;U===void 0&&tt(e),xe&&c(e,Se),ie?.(e)},ut=r.some(e=>e.collapsible),[dt,ft]=D(()=>ut&&typeof document<`u`?a(Ce):/* @__PURE__ */ new Set),pt=e=>{let t=new Set(dt);t.has(e)?t.delete(e):t.add(e),ft(t),s(t,Ce)},mt=T(()=>se(r,F,be),[r,F,be]),$=mt.groups,ht=mt.footer,gt=W?null:ue($,ht.some(e=>e.active));C(()=>{let e=()=>it(window.scrollY>4);return e(),window.addEventListener(`scroll`,e,{passive:!0}),()=>window.removeEventListener(`scroll`,e)},[]),C(()=>{y()},[]),C(()=>{x(st.current)},[]),C(()=>{let e=st.current;if(!e)return;let t=()=>ot($.length>0&&e.scrollHeight>e.clientHeight);if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[$]),C(()=>{let e=nt.current;if(!e)return;let t=window.matchMedia(`(max-width: 991.98px)`),n=()=>{t.matches?e.setAttribute(`popover`,`auto`):(e.removeAttribute(`popover`),Z(!1))},r=e=>Z(`newState`in e&&e.newState===`open`);return n(),t.addEventListener(`change`,n),e.addEventListener(`toggle`,r),()=>{t.removeEventListener(`change`,n),e.removeEventListener(`toggle`,r)}},[]),C(()=>{let e=nt.current;e?.hasAttribute(`popover`)&&S(e,X)},[X]);let _t=[`app-shell`,Q?`collapsed`:``,W?`no-sidebar`:``,G===`top`?`wui-shell-top`:``,X?`mobile-open`:``,Xe].filter(Boolean).join(` `);return/* @__PURE__ */ A(`div`,{className:_t,"data-density":K===`compact`?`compact`:void 0,"data-shell-tone":J===`brand`?`brand`:void 0,"data-wui-folded-cookie":ut?Ce:void 0,style:$e,...t,...Qe,children:[/* @__PURE__ */ k(`a`,{className:`wui-skip-link`,href:`#main-content`,children:Ee}),/* @__PURE__ */ A(`aside`,{className:`app-sidebar`,ref:nt,children:[(l||u||d||p||m)&&/* @__PURE__ */ k(`div`,{className:ae({logoLight:u,logoDark:d,markLight:p,markDark:m}),children:ct(/* @__PURE__ */ A(O,{children:[oe({logoLight:u,logoDark:d,markLight:p,markDark:m,brandName:b}),l]}))}),M&&/* @__PURE__ */ k(`div`,{className:`app-sidebar-start`,children:M}),N&&/* @__PURE__ */ k(`div`,{className:`app-sidebar-start-compact`,children:N}),/* @__PURE__ */ k(`nav`,{className:`app-sidebar-scroll`,"aria-label":ve,ref:st,tabIndex:at?0:void 0,children:$.map((e,t)=>{let n=e.items.map(e=>e.header==null?/* @__PURE__ */ k(he,{item:e,linkComponent:Y,onNavigate:()=>Z(!1),iconVariant:q,newLabel:Ae,togglePagesLabel:je},e.key??e.href??e.label):/* @__PURE__ */ k(`div`,{className:`wui-nav-header`,children:e.header},e.key??e.header));if(!e.collapsible)return/* @__PURE__ */ A(`div`,{className:`app-nav-group`,children:[e.label&&/* @__PURE__ */ k(`div`,{className:`app-nav-group-label`,children:e.label}),n,e.after&&/* @__PURE__ */ k(`div`,{className:`wui-nav-group-after`,children:e.after})]},e.key??e.label??`group-${t}`);let r=!dt.has(e.key??``)||!!me(e.items),i=`wui-nav-group-${e.key}`;return/* @__PURE__ */ A(`div`,{className:`app-nav-group wui-nav-group-collapsible${r?``:` wui-nav-group-folded`}`,"data-wui-nav-group":e.key,children:[/* @__PURE__ */ A(`button`,{type:`button`,className:`app-nav-group-label wui-nav-group-toggle`,"aria-expanded":r,"aria-controls":i,onClick:()=>pt(e.key??``),children:[/* @__PURE__ */ k(`span`,{className:`wui-nav-group-text`,children:e.label}),/* @__PURE__ */ k(`span`,{className:`wui-nav-group-caret`,children:/* @__PURE__ */ k(h,{name:`chevron-down`,size:16})})]}),/* @__PURE__ */ A(`div`,{className:`wui-nav-group-body`,id:i,children:[n,e.after&&/* @__PURE__ */ k(`div`,{className:`wui-nav-group-after`,children:e.after})]})]},e.key??`group-${t}`)})}),(P||ht.length>0)&&/* @__PURE__ */ A(`div`,{className:`app-sidebar-foot`,children:[ht.length>0&&/* @__PURE__ */ k(`div`,{className:`wui-sidebar-foot-links`,children:ht.map(e=>/* @__PURE__ */ k(he,{item:e,linkComponent:Y,onNavigate:()=>Z(!1),iconVariant:q,newLabel:Ae,togglePagesLabel:je},e.key??e.href??e.label))}),P]}),!W&&/* @__PURE__ */ k(`button`,{type:`button`,className:`app-sidebar-toggle`,onClick:lt,"aria-label":Q?Oe:ke,"aria-expanded":!Q,children:/* @__PURE__ */ k(h,{name:`chevrons-left`,size:20})})]}),/* @__PURE__ */ A(`div`,{className:`app-main`,children:[/* @__PURE__ */ A(`header`,{className:`app-topbar${rt?` wui-scrolled`:``}`,"data-tone":le===`primary`?`primary`:void 0,children:[/* @__PURE__ */ A(`div`,{className:`app-topbar-start`,children:[/* @__PURE__ */ k(`button`,{type:`button`,className:`app-topbar-menu`,onClick:()=>Z(!0),"aria-label":De,"aria-expanded":X,children:/* @__PURE__ */ k(h,{name:`menu`,size:18})}),G===`top`&&l&&/* @__PURE__ */ k(`div`,{className:`wui-shell-top-brand`,children:ct(l)}),G===`top`&&/* @__PURE__ */ k(`div`,{className:`wui-shell-top-nav`,children:/* @__PURE__ */ k(g,{items:de($),ariaLabel:ve,linkComponent:Y})}),I,Ye&&/* @__PURE__ */ k(ye,{config:Ye,searchResultsLabel:He,noResultsText:Ue,noResultsForText:We,resultsCountText:Ge,resultCountText:Ke,moreLabel:Te})]}),/* @__PURE__ */ A(`div`,{className:`app-topbar-end`,children:[L,Je&&/* @__PURE__ */ k(_e,{config:Je,unreadLabel:Fe,markAllReadLabel:Ie,viewAllLabel:Le,loadingNotificationsText:Re,noUnreadText:ze,unreadNotificationsText:Be,unreadBellLabel:Ve}),qe&&/* @__PURE__ */ k(ge,{config:qe,linkComponent:Y,accountMenuLabel:Me,roleLabel:Ne,rolesLabel:Pe})]})]}),/* @__PURE__ */ k(`main`,{className:`app-content`,id:`main-content`,children:H}),z&&/* @__PURE__ */ k(`footer`,{className:`app-footer`,children:z})]}),re&&/* @__PURE__ */ k(`div`,{className:`wui-shell-launcher`,children:re}),gt&&/* @__PURE__ */ A(`nav`,{className:`wui-tabbar`,"aria-label":we,children:[gt.tabs.map(e=>/* @__PURE__ */ k(pe,{tab:e,linkComponent:Y,iconVariant:q},e.key??e.href)),gt.hasMore&&/* @__PURE__ */ A(`button`,{type:`button`,className:`wui-tabbar-item${gt.moreActive?` active`:``}`,onClick:()=>Z(!0),children:[/* @__PURE__ */ k(`span`,{className:`wui-tabbar-icon`,children:/* @__PURE__ */ k(h,{name:`more`,size:24})}),/* @__PURE__ */ k(`span`,{className:`wui-tabbar-label`,children:Te})]})]})]})}function se(e,t,n){let i=t;for(let e of i){if(e.children?.length)throw Error(`<AppShell> sidebarFooterItems cannot hold children; keep footer links flat.`);if(e.tab)throw Error(`<AppShell> sidebarFooterItems cannot carry tab: true; the phone tab bar is built from groups.`);if(e.header!=null)throw Error(`<AppShell> sidebarFooterItems cannot hold a header row.`)}for(let t of e)t.collapsible&&le(t);let a=(e,t=!1)=>(e??[]).map(e=>Array.isArray(e.children)?{...e,children:a(e.children)}:{...e}).filter(e=>K(e)?t:(e.children?.length??0)>0||!!e.href),o=[...e,{key:L,items:t}].map(e=>({...e,items:ce(a(e.items,!0))})).filter(e=>e.items.some(e=>!K(e))),s=[],c=e=>{for(let t of e)K(t)||(s.push(t),t.children&&c(t.children))};for(let e of o)c(e.items);for(let e of s)v(`AppShell items`,G(e)),_(`AppShell`,`match`,e.match,z),_(`AppShell`,`iconVariant`,e.iconVariant,ne),_(`AppShell`,`badgeTone`,e.badgeTone,d);let l=null;if(n!=null&&!s.some(e=>e.active===!0)){let e=-1;for(let t of s){if(t.active!=null||t.children?.length&&!t.href)continue;let i=r(n,t.href,{exact:t.match===`exact`,also:t.matchAlso});if(i<0)continue;let a=t.match===`exact`&&r(n,t.href,{exact:!0})>=0?1/0:i;a>e&&(e=a,l=t)}}for(let e of s)e.active=e.active??e===l;return{groups:o.filter(e=>e.key!==L),footer:o.find(e=>e.key===L)?.items??[]}}function G(e){return Object.fromEntries(Object.entries(e).filter(([e])=>!re.has(e)))}var K=e=>e.header!=null;function ce(e){return e.filter((t,n)=>{if(!K(t))return!0;let r=e.findIndex((e,t)=>t>n&&K(e));return e.slice(n+1,r<0?void 0:r).length>0})}var q=/* @__PURE__ */ new Set;function le(t){if(t.key!=null&&I.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.`;typeof process<`u`&&process.env.NODE_ENV===`production`||q.has(n)||(q.add(n),e(n))}function ue(e,t){let n=[],r=e=>{for(let t of e)K(t)||(t.children?.length?r(t.children):n.push(t))};for(let t of e)r(t.items);let i=n.filter(e=>e.tab);if(i.length===0)return null;let a=i.length<n.length,o=a?P:F;if(i.length>o)throw Error(`<AppShell>: ${i.length} items carry tab: true, but the phone tab bar holds ${o} (${a?`4 plus More, because other items exist`:`5 when every item is a tab`}). Flag fewer items.`);return{tabs:i,hasMore:a,moreActive:t||n.some(e=>!e.tab&&e.active)}}function de(e){let t=e=>{if(e.label===void 0)throw Error(`<AppShell> a navigation row has no label; every row but a header needs one.`);return e.label},n=e=>e.key??e.href??t(e),r=(e,r)=>({key:n(e),label:t(e),to:r,current:!!e.active}),i=e=>e.flatMap(e=>K(e)?[]:[...e.href?[{...r(e,e.href),icon:e.icon}]:[],...i(e.children??[])]),a=[];for(let o of e.flatMap(e=>e.items)){if(K(o))continue;let e=i(o.children??[]);if(e.length>0){let i=o.href?[{...r(o,o.href),icon:o.icon}]:[];a.push({key:n(o),label:t(o),links:[...i,...e]})}else o.href&&a.push(r(o,o.href))}return a}function fe({href:e,label:t,linkComponent:r,onNavigate:i,children:a}){return/* @__PURE__ */ k(l,{link:n(r,{to:e}),className:`wui-brand-link`,"aria-label":t,onClick:i,children:a})}function pe({tab:e,linkComponent:t,iconVariant:r}){let i=`wui-tabbar-item${e.active?` active`:``}`,a=/* @__PURE__ */ A(O,{children:[e.icon&&/* @__PURE__ */ k(`span`,{className:`wui-tabbar-icon`,children:typeof e.icon==`string`?/* @__PURE__ */ k(h,{name:e.icon,size:24,variant:e.iconVariant??r}):e.icon}),/* @__PURE__ */ k(`span`,{className:`wui-tabbar-label`,children:e.tabLabel??e.label}),e.badge!=null&&/* @__PURE__ */ k(`span`,{className:`wui-tabbar-badge${e.badgeTone?` tone-${e.badgeTone}`:``}`,title:e.badgeTitle||void 0,children:e.badge})]}),o=e.active?`page`:void 0;return/* @__PURE__ */ k(l,{link:n(t,{to:e.href}),className:i,"aria-current":o,children:a})}function me(e){for(let t of e){if(t.active)return t;let e=t.children?.length?me(t.children):void 0;if(e)return e}}function he({item:e,linkComponent:r,onNavigate:i,depth:a=0,iconVariant:o,newLabel:s,togglePagesLabel:c}){let u=a>0,d=a>1?` wui-nav-depth-${Math.min(a,6)}`:``,f=Array.isArray(e.children)&&e.children.length>0,p=f?me(e.children??[]):void 0,m=!!p,g=p?p.key??p.href??p.label:null,[_,v]=D(m);C(()=>{g!=null&&v(!0)},[g]);let y=typeof e.label==`string`?e.label:void 0,b=!u&&e.icon&&/* @__PURE__ */ k(`span`,{className:`app-nav-icon`,children:typeof e.icon==`string`?/* @__PURE__ */ k(h,{name:e.icon,size:e.iconSize??22,variant:e.iconVariant??o}):e.icon}),x=e.badge!=null&&/* @__PURE__ */ k(`span`,{className:`app-nav-badge${e.badgeTone?` tone-${e.badgeTone}`:``}`,title:e.badgeTitle||void 0,children:e.badge}),S=ie(e.newUntil)&&/* @__PURE__ */ k(`span`,{className:`wui-nav-new`,children:s}),w=/* @__PURE__ */ A(O,{children:[b,/* @__PURE__ */ k(`span`,{className:`app-nav-text`,children:e.label}),S,x,e.trailingIcon&&/* @__PURE__ */ k(`span`,{className:`app-nav-trailing`,children:typeof e.trailingIcon==`string`?/* @__PURE__ */ k(h,{name:e.trailingIcon,size:16}):e.trailingIcon})]}),T=e.active?`page`:void 0;if(f){let f=/* @__PURE__ */ k(`div`,{className:`app-nav-sub${_?` expanded`:``}`,inert:!_,"aria-hidden":!_||void 0,children:/* @__PURE__ */ k(`div`,{className:`app-nav-sub-inner`,children:(e.children??[]).map(e=>/* @__PURE__ */ k(he,{item:e,linkComponent:r,onNavigate:i,depth:a+1,iconVariant:o,newLabel:s,togglePagesLabel:c},e.key??e.href))})});if(e.href){let a=/* @__PURE__ */ k(l,{link:n(r,{to:e.href}),className:`wui-nav-split-link`,"aria-current":T,onClick:i,children:w});return/* @__PURE__ */ A(O,{children:[/* @__PURE__ */ A(`div`,{className:`app-nav-item has-children wui-nav-split${u?` app-nav-subitem`:``}${m||e.active?` active`:``}${d}`,"data-label":y,children:[a,/* @__PURE__ */ k(`button`,{type:`button`,className:`app-nav-caret wui-nav-split-toggle`,"aria-expanded":_,"aria-label":t(c,{name:y??``}),onClick:()=>v(e=>!e),children:/* @__PURE__ */ k(h,{name:`chevron-right`,size:16})})]}),f]})}return/* @__PURE__ */ A(O,{children:[/* @__PURE__ */ A(`button`,{type:`button`,className:`app-nav-item${u?` app-nav-subitem`:``} has-children${m?` active`:``}${d}`,"aria-expanded":_,"data-label":y,onClick:()=>v(e=>!e),children:[b,/* @__PURE__ */ k(`span`,{className:`app-nav-text`,children:e.label}),S,x,/* @__PURE__ */ k(`span`,{className:`app-nav-caret`,children:/* @__PURE__ */ k(h,{name:`chevron-right`,size:16})})]}),f]})}let E=`app-nav-item${u?` app-nav-subitem`:``}${e.active?` active`:``}${d}`;return/* @__PURE__ */ k(l,{link:n(r,{to:e.href}),className:E,"aria-current":T,"data-label":y,onClick:i,children:w})}function J(e){u(`wui-dropdown`,M);let[t,n]=D(!1),r=E(null);return C(()=>{r.current?.toggleAttribute(`open`,t)},[t]),C(()=>{let t=r.current;if(!t)return;let i=r=>{if(r.target!==t||!(`detail`in r)||!r.detail||typeof r.detail!=`object`)return;let i=`open`in r.detail&&r.detail.open===!0;n(i),i&&e?.()};return t.addEventListener(`wui-dropdown-toggle`,i),()=>t.removeEventListener(`wui-dropdown-toggle`,i)},[e]),{open:t,setOpen:n,ref:r}}function ge({config:e,linkComponent:r,accountMenuLabel:i,roleLabel:a,rolesLabel:o}){let s=w(),{open:c,setOpen:u,ref:d}=J(),{name:f,role:g,roles:v=[],noTriggerRole:y=!1,photo:b,profileHref:x,profileLabel:S=`My profile`,onLogout:C,logoutAction:T,logoutLabel:E=`Sign out`,head:D,section:j,logoutVariant:M=`item`,items:N=[]}=e;if(_(`AppShell`,`userMenu.logoutVariant`,M,[`item`,`button`]),!f)throw Error(`<AppShell> userMenu.name is required; the trigger and the avatar are named from it.`);let P=v.map(e=>(e??``).trim()).filter(Boolean),F=()=>u(!1),I=(e,t,i,a)=>/* @__PURE__ */ k(l,{link:n(r,{to:e}),className:`dropdown-item`,onClick:a,children:t},i),L=/* @__PURE__ */ k(h,{name:`log-out`,size:18}),R=/* @__PURE__ */ A(O,{children:[L,E]});return/* @__PURE__ */ A(`wui-dropdown`,{class:`dropdown wui-usermenu`,align:`end`,ref:d,children:[/* @__PURE__ */ A(`button`,{type:`button`,id:s,className:`wui-usermenu-trigger`,"data-wui-dropdown-trigger":!0,"aria-expanded":c,"aria-label":t(i,{name:f}),children:[/* @__PURE__ */ k(p,{name:f,src:b,tone:`auto`}),/* @__PURE__ */ A(`span`,{className:`wui-usermenu-text`,children:[/* @__PURE__ */ k(`span`,{className:`wui-usermenu-name`,children:f}),g&&!y&&/* @__PURE__ */ k(`span`,{className:`wui-usermenu-role`,children:g})]}),/* @__PURE__ */ k(h,{name:`chevron-down`,size:14,className:`wui-usermenu-caret`})]}),/* @__PURE__ */ A(`div`,{"data-wui-dropdown-menu":!0,popover:`auto`,className:`dropdown-menu dropdown-menu-end wui-usermenu-menu${c?` show`:``}`,"aria-labelledby":s,children:[/* @__PURE__ */ A(`div`,{className:`wui-usermenu-head`,children:[/* @__PURE__ */ k(p,{name:f,src:b,size:`lg`,tone:`auto`}),/* @__PURE__ */ A(`div`,{className:`wui-usermenu-who`,children:[/* @__PURE__ */ k(`div`,{className:`wui-usermenu-name`,children:f}),g&&/* @__PURE__ */ k(`div`,{className:`wui-usermenu-role`,children:g}),P.length>0&&/* @__PURE__ */ A(`div`,{className:`wui-usermenu-roles`,children:[/* @__PURE__ */ k(`span`,{className:`wui-usermenu-roles-label`,children:P.length===1?a:o}),` ${P.join(`, `)}`]}),D?/* @__PURE__ */ k(`div`,{className:`wui-usermenu-extra`,children:D}):null]})]}),j?/* @__PURE__ */ k(`div`,{className:`wui-usermenu-section`,children:j}):null,x&&I(x,/* @__PURE__ */ A(O,{children:[/* @__PURE__ */ k(h,{name:`user`,size:18}),S]}),void 0,F),N.map(e=>{if(e.divider)return/* @__PURE__ */ k(`hr`,{className:`dropdown-divider`},e.key);let t=/* @__PURE__ */ A(O,{children:[e.icon&&/* @__PURE__ */ k(h,{name:e.icon,size:18}),e.label]}),n=()=>{e.onClick?.(),F()};return e.href?I(e.href,t,e.key,n):/* @__PURE__ */ k(`button`,{type:`button`,className:`dropdown-item`,onClick:n,children:t},e.key)}),M===`button`?(T||C)&&/* @__PURE__ */ k(`div`,{className:`wui-usermenu-foot`,children:T?/* @__PURE__ */ k(`form`,{method:`post`,action:T,className:`wui-usermenu-logout`,children:/* @__PURE__ */ k(m,{type:`submit`,tone:`danger`,variant:`soft`,block:!0,leftIcon:L,children:E})}):/* @__PURE__ */ k(m,{type:`button`,tone:`danger`,variant:`soft`,block:!0,leftIcon:L,onClick:()=>{F(),C?.()},children:E})}):T?/* @__PURE__ */ k(`form`,{method:`post`,action:T,className:`wui-usermenu-logout`,children:/* @__PURE__ */ k(`button`,{type:`submit`,className:`dropdown-item danger`,children:R})}):C&&/* @__PURE__ */ k(`button`,{type:`button`,className:`dropdown-item danger`,onClick:()=>{F(),C()},children:R})]})]})}function _e({config:e,unreadLabel:n,markAllReadLabel:r,viewAllLabel:i,loadingNotificationsText:a,noUnreadText:o,unreadNotificationsText:s,unreadBellLabel:c}){let l=w(),{open:u,ref:d}=J(e.onOpen),{unread:f=0,items:p,loading:m=!1,onMarkAllRead:g,viewAllHref:_,label:v=`Notifications`,emptyText:y=`You are all caught up.`}=e,[b,x]=D(``),S=E(f);C(()=>{S.current!==f&&(S.current=f,x(f===0?o:t(s,{count:H(f)})))},[f,o,s]);let T=null;return p?.length?T=/* @__PURE__ */ k(`div`,{className:`wui-bell-items`,children:p.map((e,t)=>{let r=`wui-bell-item${e.read?` wui-bell-item-read`:``}`,i=/* @__PURE__ */ A(O,{children:[/* @__PURE__ */ k(`span`,{className:`wui-bell-dot`,"aria-hidden":`true`}),e.icon&&/* @__PURE__ */ k(`span`,{className:`wui-bell-icon`,children:/* @__PURE__ */ k(h,{name:e.icon,size:18})}),/* @__PURE__ */ A(`span`,{className:`wui-bell-body`,children:[!e.read&&/* @__PURE__ */ A(`span`,{className:`visually-hidden`,children:[n,`: `]}),/* @__PURE__ */ k(`span`,{className:`wui-bell-item-title`,children:e.title}),e.time&&/* @__PURE__ */ k(`span`,{className:`wui-bell-when`,children:e.time})]})]});return e.href?/* @__PURE__ */ k(`a`,{className:r,href:e.href,"data-id":e.id,children:i},e.id??t):/* @__PURE__ */ k(`div`,{className:r,"data-id":e.id,children:i},e.id??t)})}):m?T=/* @__PURE__ */ k(`div`,{className:`wui-bell-state`,children:a}):p&&(T=/* @__PURE__ */ k(`div`,{className:`wui-bell-state`,children:y})),/* @__PURE__ */ A(`wui-dropdown`,{class:`dropdown wui-bell`,align:`end`,ref:d,children:[/* @__PURE__ */ A(`button`,{type:`button`,id:l,className:`topbar-icon-btn wui-bell-trigger`,"data-wui-dropdown-trigger":!0,"aria-expanded":u,"aria-label":f===0?v:t(c,{label:v,count:H(f)}),children:[/* @__PURE__ */ k(h,{name:`notification`,size:20}),/* @__PURE__ */ k(`span`,{className:`wui-bell-count`,"aria-hidden":`true`,hidden:f===0,children:H(f)})]}),/* @__PURE__ */ k(`span`,{className:`visually-hidden`,"aria-live":`polite`,children:b}),/* @__PURE__ */ A(`div`,{"data-wui-dropdown-menu":!0,popover:`auto`,className:`dropdown-menu dropdown-menu-end wui-bell-menu${u?` show`:``}`,"aria-labelledby":l,children:[/* @__PURE__ */ A(`div`,{className:`wui-bell-head`,children:[/* @__PURE__ */ k(`span`,{className:`wui-bell-title`,children:v}),g&&/* @__PURE__ */ k(`button`,{type:`button`,className:`wui-bell-markall`,onClick:g,children:r})]}),/* @__PURE__ */ k(`div`,{className:`wui-bell-list`,"aria-busy":m||void 0,children:T}),_&&/* @__PURE__ */ k(`a`,{className:`wui-bell-foot`,href:_,children:i})]})]})}var ve=e=>!!e&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName));function ye({config:e,searchResultsLabel:n,noResultsText:r,noResultsForText:i,resultsCountText:a,resultCountText:o,moreLabel:s}){u(`wui-overflow`,j);let c=w(),{value:l=``,onChange:d,results:f=null,loading:p=!1,onSelect:m,onSubmit:g,onFocus:_,placeholder:v=`Search`}=e,[y,x]=D(!1),[S,O]=D(!1),[M,N]=D({results:null,index:-1}),P=M.results===f?M.index:-1,F=e=>N({results:f,index:e}),I=E(null),L=E(null),R=E([]),z=T(()=>(f??[]).flatMap(e=>e.hits??[]),[f]),B=f!=null&&!S,V=z.length;C(()=>{let e=e=>{e.key!==`/`||e.ctrlKey||e.metaKey||e.altKey||ve(e.target instanceof HTMLElement?e.target:null)||(e.preventDefault(),x(!0),L.current?.focus())},t=e=>{I.current?.contains(e.target instanceof Node?e.target:null)||(O(!0),x(!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(!B||V===0)return;e.preventDefault(),F((P+(e.key===`ArrowDown`?1:-1)+V)%V)}else b(e.nativeEvent)?B&&P>=0&&R.current[P]?(e.preventDefault(),R.current[P].click()):g&&l.trim()!==``&&(e.preventDefault(),g(l.trim())):e.key===`Escape`&&(B?(e.preventDefault(),O(!0)):y&&(e.preventDefault(),x(!1)))},te=-1;return R.current=[],/* @__PURE__ */ k(`wui-overflow`,{class:`wui-topsearch-host`,label:s,children:/* @__PURE__ */ k(`div`,{"data-wui-overflow-list":!0,className:`wui-topsearch-row`,children:/* @__PURE__ */ A(`div`,{className:`wui-topsearch${y?` is-open`:``}${p?` is-loading`:``}`,ref:I,"data-overflow-label":v,children:[/* @__PURE__ */ k(`button`,{type:`button`,className:`topbar-icon-btn wui-topsearch-open`,"aria-label":v,"aria-expanded":y,"aria-controls":`${c}-panel`,onClick:()=>{let e=!y;x(e),e&&L.current?.focus()},children:/* @__PURE__ */ k(h,{name:`search`,size:20})}),/* @__PURE__ */ A(`div`,{className:`wui-topsearch-panel`,id:`${c}-panel`,children:[/* @__PURE__ */ A(`div`,{className:`search-wrap`,children:[/* @__PURE__ */ k(h,{name:`search`,size:18,className:`search-icon`}),/* @__PURE__ */ k(`input`,{ref:L,type:`search`,className:`form-control input search-input`,id:`${c}-input`,placeholder:v,"aria-label":v,role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":B,"aria-controls":`${c}-list`,"aria-activedescendant":B&&P>=0?`${c}-opt-${P}`:void 0,autoComplete:`off`,value:l,onChange:e=>{O(!1),d?.(e.target.value)},onKeyDown:ee,onFocus:_})]}),/* @__PURE__ */ k(`div`,{className:`wui-topsearch-results`,id:`${c}-list`,role:`listbox`,"aria-label":n,hidden:!B,children:B&&/* @__PURE__ */ A(`div`,{className:`wui-topsearch-groups`,role:`presentation`,children:[V===0&&/* @__PURE__ */ k(`div`,{className:`wui-topsearch-empty`,role:`option`,"aria-disabled":`true`,"aria-selected":`false`,children:t(i,{value:l})}),f.filter(e=>e.hits?.length).map((e,t)=>/* @__PURE__ */ A(`div`,{className:`wui-topsearch-group`,role:`group`,"aria-label":e.label??``,children:[e.label&&/* @__PURE__ */ k(`div`,{className:`wui-topsearch-group-label`,role:`presentation`,children:e.label}),e.hits.map(e=>{te+=1;let t=te;return/* @__PURE__ */ A(`a`,{className:`wui-topsearch-hit${t===P?` is-active`:``}`,role:`option`,"aria-selected":t===P,id:`${c}-opt-${t}`,href:e.href,ref:e=>{R.current[t]=e},onClick:t=>m?.(e,t),children:[e.icon&&/* @__PURE__ */ k(`span`,{className:`wui-topsearch-hit-icon`,children:/* @__PURE__ */ k(h,{name:e.icon,size:18})}),/* @__PURE__ */ A(`span`,{className:`wui-topsearch-hit-text`,children:[/* @__PURE__ */ k(`span`,{className:`wui-topsearch-hit-title`,children:e.title}),e.subtitle&&/* @__PURE__ */ k(`span`,{className:`wui-topsearch-hit-sub`,children:e.subtitle})]})]},`${e.href}-${t}`)})]},e.label??t))]})})]}),/* @__PURE__ */ k(`span`,{className:`visually-hidden`,"aria-live":`polite`,children:B?V===0?r:t(V===1?o:a,{count:V}):``})]})})})}export{W as default};
1
+ import{devWarn as e}from"../lib/devWarn.js";import{linkTarget as t}from"../lib/linkTarget.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{TargetLink as c}from"../lib/TargetLink.js";import l from"../lib/useElementEntry.js";import u from"../lib/useWuiText.js";import{TONES as d}from"../lib/vocabulary.js";import{splitMarkerProps as f}from"../lib/wuiMarker.js";import p from"./AppAvatar.js";import m from"./AppButton.js";import h from"./AppIcon.js";import g from"./AppNavigationMenu.js";import _ from"./assertValidValue.js";import v from"./warnUnknownProps.js";import{initScrollEdges as y,isImeSafeEnter as b,revealActiveNavItem as x,setPopoverOpen as S}from"@webority/ui-elements/helpers";import{useEffect as C,useId as w,useMemo as T,useRef as E,useState as D}from"react";import{Fragment as O,jsx as k,jsxs as A}from"react/jsx-runtime";import{SHELL_TEXT as j,fillText as M}from"@webority/ui-elements/text";var N=()=>import(`@webority/ui-elements/elements/overflow`),P=()=>import(`@webority/ui-elements/elements/dropdown`),F=99,I=4,L=5,R=/^[a-z0-9-]+$/,z=`wui-sidebar-footer`,B=[],V=[`prefix`,`exact`],H=[`comfortable`,`compact`],U=[`neutral`,`primary`],W=[`default`,`brand`],ee=[`side`,`top`],G=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`],te=/* @__PURE__ */ new Set([`key`,`label`,`icon`,`iconVariant`,`iconSize`,`href`,`badge`,`badgeTone`,`badgeTitle`,`newUntil`,`trailingIcon`,`active`,`match`,`matchAlso`,`tab`,`tabLabel`,`children`]),K=e=>e>F?`${F}+`:String(e),ne=new Intl.DateTimeFormat(`en-CA`,{timeZone:`Asia/Kolkata`}),q=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:ne.format(/* @__PURE__ */ new Date)<=e},re=({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(` `)},ie=({logoLight:e,logoDark:t,markLight:n,markDark:r,brandName:i})=>{let a=i??``,o=[e&&/* @__PURE__ */ k(`img`,{className:`wui-brand-logo wui-brand-light`,src:e,alt:a},`logo-light`),t&&/* @__PURE__ */ k(`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(e=>!!e).map(([t,n,r],i)=>i===0&&!e?/* @__PURE__ */ k(`img`,{className:n,src:r,alt:a},t):/* @__PURE__ */ k(`img`,{className:n,src:r,alt:``,"aria-hidden":`true`},t));return[...o,...s].filter(Boolean)};function ae(e){let{marker:t,props:n}=f(`AppShell`,e),c=u(`shell`,j),{groups:l=[],brand:d,logoLight:p,logoDark:m,markLight:b,markDark:w,brandName:M,brandHref:N,brandLabel:P,sidebarStart:F,sidebarStartCompact:I,sidebarFooter:L,sidebarFooterItems:R=B,topbarStart:z,topbarEnd:V,footer:te,launcher:K,children:ne,collapsed:q,onCollapsedChange:ae,noSidebar:J=!1,nav:Y=`side`,density:se=`comfortable`,itemHeight:ce,iconVariant:X=`twotone`,topbarTone:he=`neutral`,tone:ve=`default`,navLabel:be=c.navLabel,linkComponent:Z,currentPath:xe,rememberCollapsed:Se=!1,collapsedCookie:Ce=`wui-shell-collapsed`,foldedCookie:we=r,tabBarLabel:Te=c.tabBarLabel,moreLabel:Ee=c.moreLabel,skipLabel:De=c.skipLabel,openNavLabel:Oe=c.openNavLabel,expandNavLabel:ke=c.expandNavLabel,collapseNavLabel:Ae=c.collapseNavLabel,newLabel:je=c.newLabel,togglePagesLabel:Me=c.togglePagesLabel,accountMenuLabel:Ne=c.accountMenuLabel,roleLabel:Pe=c.roleLabel,rolesLabel:Fe=c.rolesLabel,unreadLabel:Ie=c.unreadLabel,markAllReadLabel:Le=c.markAllReadLabel,viewAllLabel:Re=c.viewAllLabel,loadingNotificationsText:ze=c.loadingNotificationsText,noUnreadText:Be=c.noUnreadText,unreadNotificationsText:Ve=c.unreadNotificationsText,unreadBellLabel:He=c.unreadBellLabel,searchResultsLabel:Ue=c.searchResultsLabel,noResultsText:We=c.noResultsText,noResultsForText:Ge=c.noResultsForText,resultsCountText:Ke=c.resultsCountText,resultCountText:qe=c.resultCountText,userMenu:Je,notifications:Ye,search:Xe,className:Ze=``,style:Qe,...$e}=n;if(v(`AppShell`,$e),_(`AppShell`,`density`,se,H),_(`AppShell`,`topbarTone`,he,U),_(`AppShell`,`tone`,ve,W),_(`AppShell`,`nav`,Y,ee),_(`AppShell`,`iconVariant`,X,G),P!==void 0&&!N)throw Error(`<AppShell> brandLabel names the brand link, so it needs brandHref.`);if(N){if(!P&&!M)throw Error(`<AppShell> brandHref needs brandLabel or brandName: the collapsed rail hides the logo, so the link would have no accessible name.`);if(!(d||p||m||b||w))throw Error(`<AppShell> brandHref has no brand, logo or mark to link.`)}let et=(ce??0)>0?{...Qe,"--wui-nav-item-height":`${ce}px`}:Qe,[tt,nt]=D(()=>Se&&q===void 0&&typeof document<`u`?a(Ce)??!1:!1),[rt,Q]=D(!1),it=E(null),[at,ot]=D(!1),[st,ct]=D(!1),lt=E(null),ut=q??tt,dt=e=>N?/* @__PURE__ */ k(de,{href:N,label:P||M,linkComponent:Z,onNavigate:()=>Q(!1),children:e}):e,ft=()=>{let e=!ut;q===void 0&&nt(e),Se&&s(e,Ce),ae?.(e)},pt=l.some(e=>e.collapsible),[mt,ht]=D(()=>pt&&typeof document<`u`?i(we):/* @__PURE__ */ new Set),gt=e=>{let t=new Set(mt);t.has(e)?t.delete(e):t.add(e),ht(t),o(t,we)},_t=T(()=>oe(l,R,xe),[l,R,xe]),$=_t.groups,vt=_t.footer,yt=J?null:le($,vt.some(e=>e.active));C(()=>{let e=()=>ot(window.scrollY>4);return e(),window.addEventListener(`scroll`,e,{passive:!0}),()=>window.removeEventListener(`scroll`,e)},[]),C(()=>{y()},[]),C(()=>{x(lt.current)},[]),C(()=>{let e=lt.current;if(!e)return;let t=()=>ct($.length>0&&e.scrollHeight>e.clientHeight);if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[$]),C(()=>{let e=it.current;if(!e)return;let t=window.matchMedia(`(max-width: 991.98px)`),n=()=>{t.matches?e.setAttribute(`popover`,`auto`):(e.removeAttribute(`popover`),Q(!1))},r=e=>Q(`newState`in e&&e.newState===`open`);return n(),t.addEventListener(`change`,n),e.addEventListener(`toggle`,r),()=>{t.removeEventListener(`change`,n),e.removeEventListener(`toggle`,r)}},[]),C(()=>{let e=it.current;e?.hasAttribute(`popover`)&&S(e,rt)},[rt]);let bt=[`app-shell`,ut?`collapsed`:``,J?`no-sidebar`:``,Y===`top`?`wui-shell-top`:``,rt?`mobile-open`:``,Ze].filter(Boolean).join(` `);return/* @__PURE__ */ A(`div`,{className:bt,"data-density":se===`compact`?`compact`:void 0,"data-shell-tone":ve===`brand`?`brand`:void 0,"data-wui-folded-cookie":pt?we:void 0,style:et,...t,...$e,children:[/* @__PURE__ */ k(`a`,{className:`wui-skip-link`,href:`#main-content`,children:De}),/* @__PURE__ */ A(`aside`,{className:`app-sidebar`,ref:it,children:[(d||p||m||b||w)&&/* @__PURE__ */ k(`div`,{className:re({logoLight:p,logoDark:m,markLight:b,markDark:w}),children:dt(/* @__PURE__ */ A(O,{children:[ie({logoLight:p,logoDark:m,markLight:b,markDark:w,brandName:M}),d]}))}),F&&/* @__PURE__ */ k(`div`,{className:`app-sidebar-start`,children:F}),I&&/* @__PURE__ */ k(`div`,{className:`app-sidebar-start-compact`,children:I}),/* @__PURE__ */ k(`nav`,{className:`app-sidebar-scroll`,"aria-label":be,ref:lt,tabIndex:st?0:void 0,children:$.map((e,t)=>{let n=e.items.map(e=>e.header==null?/* @__PURE__ */ k(me,{item:e,linkComponent:Z,onNavigate:()=>Q(!1),iconVariant:X,newLabel:je,togglePagesLabel:Me},e.key??e.href??e.label):/* @__PURE__ */ k(`div`,{className:`wui-nav-header`,children:e.header},e.key??e.header));if(!e.collapsible)return/* @__PURE__ */ A(`div`,{className:`app-nav-group`,children:[e.label&&/* @__PURE__ */ k(`div`,{className:`app-nav-group-label`,children:e.label}),n,e.after&&/* @__PURE__ */ k(`div`,{className:`wui-nav-group-after`,children:e.after})]},e.key??e.label??`group-${t}`);let r=!mt.has(e.key??``)||!!pe(e.items),i=`wui-nav-group-${e.key}`;return/* @__PURE__ */ A(`div`,{className:`app-nav-group wui-nav-group-collapsible${r?``:` wui-nav-group-folded`}`,"data-wui-nav-group":e.key,children:[/* @__PURE__ */ A(`button`,{type:`button`,className:`app-nav-group-label wui-nav-group-toggle`,"aria-expanded":r,"aria-controls":i,onClick:()=>gt(e.key??``),children:[/* @__PURE__ */ k(`span`,{className:`wui-nav-group-text`,children:e.label}),/* @__PURE__ */ k(`span`,{className:`wui-nav-group-caret`,children:/* @__PURE__ */ k(h,{name:`chevron-down`,size:16})})]}),/* @__PURE__ */ A(`div`,{className:`wui-nav-group-body`,id:i,children:[n,e.after&&/* @__PURE__ */ k(`div`,{className:`wui-nav-group-after`,children:e.after})]})]},e.key??`group-${t}`)})}),(L||vt.length>0)&&/* @__PURE__ */ A(`div`,{className:`app-sidebar-foot`,children:[vt.length>0&&/* @__PURE__ */ k(`div`,{className:`wui-sidebar-foot-links`,children:vt.map(e=>/* @__PURE__ */ k(me,{item:e,linkComponent:Z,onNavigate:()=>Q(!1),iconVariant:X,newLabel:je,togglePagesLabel:Me},e.key??e.href??e.label))}),L]}),!J&&/* @__PURE__ */ k(`button`,{type:`button`,className:`app-sidebar-toggle`,onClick:ft,"aria-label":ut?ke:Ae,"aria-expanded":!ut,children:/* @__PURE__ */ k(h,{name:`chevrons-left`,size:20})})]}),/* @__PURE__ */ A(`div`,{className:`app-main`,children:[/* @__PURE__ */ A(`header`,{className:`app-topbar${at?` wui-scrolled`:``}`,"data-tone":he===`primary`?`primary`:void 0,children:[/* @__PURE__ */ A(`div`,{className:`app-topbar-start`,children:[/* @__PURE__ */ k(`button`,{type:`button`,className:`app-topbar-menu`,onClick:()=>Q(!0),"aria-label":Oe,"aria-expanded":rt,children:/* @__PURE__ */ k(h,{name:`menu`,size:18})}),Y===`top`&&d&&/* @__PURE__ */ k(`div`,{className:`wui-shell-top-brand`,children:dt(d)}),Y===`top`&&/* @__PURE__ */ k(`div`,{className:`wui-shell-top-nav`,children:/* @__PURE__ */ k(g,{items:ue($),ariaLabel:be,linkComponent:Z})}),z,Xe&&/* @__PURE__ */ k(ye,{config:Xe,searchResultsLabel:Ue,noResultsText:We,noResultsForText:Ge,resultsCountText:Ke,resultCountText:qe,moreLabel:Ee})]}),/* @__PURE__ */ A(`div`,{className:`app-topbar-end`,children:[V,Ye&&/* @__PURE__ */ k(_e,{config:Ye,unreadLabel:Ie,markAllReadLabel:Le,viewAllLabel:Re,loadingNotificationsText:ze,noUnreadText:Be,unreadNotificationsText:Ve,unreadBellLabel:He}),Je&&/* @__PURE__ */ k(ge,{config:Je,linkComponent:Z,accountMenuLabel:Ne,roleLabel:Pe,rolesLabel:Fe})]})]}),/* @__PURE__ */ k(`main`,{className:`app-content`,id:`main-content`,children:ne}),te&&/* @__PURE__ */ k(`footer`,{className:`app-footer`,children:te})]}),K&&/* @__PURE__ */ k(`div`,{className:`wui-shell-launcher`,children:K}),yt&&/* @__PURE__ */ A(`nav`,{className:`wui-tabbar`,"aria-label":Te,children:[yt.tabs.map(e=>/* @__PURE__ */ k(fe,{tab:e,linkComponent:Z,iconVariant:X},e.key??e.href)),yt.hasMore&&/* @__PURE__ */ A(`button`,{type:`button`,className:`wui-tabbar-item${yt.moreActive?` active`:``}`,onClick:()=>Q(!0),children:[/* @__PURE__ */ k(`span`,{className:`wui-tabbar-icon`,children:/* @__PURE__ */ k(h,{name:`more`,size:24})}),/* @__PURE__ */ k(`span`,{className:`wui-tabbar-label`,children:Ee})]})]})]})}function oe(e,t,r){let i=t;for(let e of i){if(e.children?.length)throw Error(`<AppShell> sidebarFooterItems cannot hold children; keep footer links flat.`);if(e.tab)throw Error(`<AppShell> sidebarFooterItems cannot carry tab: true; the phone tab bar is built from groups.`);if(e.header!=null)throw Error(`<AppShell> sidebarFooterItems cannot hold a header row.`)}for(let t of e)t.collapsible&&X(t);let a=(e,t=!1)=>(e??[]).map(e=>Array.isArray(e.children)?{...e,children:a(e.children)}:{...e}).filter(e=>Y(e)?t:(e.children?.length??0)>0||!!e.href),o=[...e,{key:z,items:t}].map(e=>({...e,items:se(a(e.items,!0))})).filter(e=>e.items.some(e=>!Y(e))),s=[],c=e=>{for(let t of e)Y(t)||(s.push(t),t.children&&c(t.children))};for(let e of o)c(e.items);for(let e of s)v(`AppShell items`,J(e)),_(`AppShell`,`match`,e.match,V),_(`AppShell`,`iconVariant`,e.iconVariant,G),_(`AppShell`,`badgeTone`,e.badgeTone,d);let l=null;if(r!=null&&!s.some(e=>e.active===!0)){let e=-1;for(let t of s){if(t.active!=null||t.children?.length&&!t.href)continue;let i=n(r,t.href,{exact:t.match===`exact`,also:t.matchAlso});if(i<0)continue;let a=t.match===`exact`&&n(r,t.href,{exact:!0})>=0?1/0:i;a>e&&(e=a,l=t)}}for(let e of s)e.active=e.active??e===l;return{groups:o.filter(e=>e.key!==z),footer:o.find(e=>e.key===z)?.items??[]}}function J(e){return Object.fromEntries(Object.entries(e).filter(([e])=>!te.has(e)))}var Y=e=>e.header!=null;function se(e){return e.filter((t,n)=>{if(!Y(t))return!0;let r=e.findIndex((e,t)=>t>n&&Y(e));return e.slice(n+1,r<0?void 0:r).length>0})}var ce=/* @__PURE__ */ new Set;function X(t){if(t.key!=null&&R.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.`;typeof process<`u`&&process.env.NODE_ENV===`production`||ce.has(n)||(ce.add(n),e(n))}function le(e,t){let n=[],r=e=>{for(let t of e)Y(t)||(t.children?.length?r(t.children):n.push(t))};for(let t of e)r(t.items);let i=n.filter(e=>e.tab);if(i.length===0)return null;let a=i.length<n.length,o=a?I:L;if(i.length>o)throw Error(`<AppShell>: ${i.length} items carry tab: true, but the phone tab bar holds ${o} (${a?`4 plus More, because other items exist`:`5 when every item is a tab`}). Flag fewer items.`);return{tabs:i,hasMore:a,moreActive:t||n.some(e=>!e.tab&&e.active)}}function ue(e){let t=e=>{if(e.label===void 0)throw Error(`<AppShell> a navigation row has no label; every row but a header needs one.`);return e.label},n=e=>e.key??e.href??t(e),r=(e,r)=>({key:n(e),label:t(e),to:r,current:!!e.active}),i=e=>e.flatMap(e=>Y(e)?[]:[...e.href?[{...r(e,e.href),icon:e.icon}]:[],...i(e.children??[])]),a=[];for(let o of e.flatMap(e=>e.items)){if(Y(o))continue;let e=i(o.children??[]);if(e.length>0){let i=o.href?[{...r(o,o.href),icon:o.icon}]:[];a.push({key:n(o),label:t(o),links:[...i,...e]})}else o.href&&a.push(r(o,o.href))}return a}function de({href:e,label:n,linkComponent:r,onNavigate:i,children:a}){return/* @__PURE__ */ k(c,{link:t(r,{to:e}),className:`wui-brand-link`,"aria-label":n,onClick:i,children:a})}function fe({tab:e,linkComponent:n,iconVariant:r}){let i=`wui-tabbar-item${e.active?` active`:``}`,a=/* @__PURE__ */ A(O,{children:[e.icon&&/* @__PURE__ */ k(`span`,{className:`wui-tabbar-icon`,children:typeof e.icon==`string`?/* @__PURE__ */ k(h,{name:e.icon,size:24,variant:e.iconVariant??r}):e.icon}),/* @__PURE__ */ k(`span`,{className:`wui-tabbar-label`,children:e.tabLabel??e.label}),e.badge!=null&&/* @__PURE__ */ k(`span`,{className:`wui-tabbar-badge${e.badgeTone?` tone-${e.badgeTone}`:``}`,title:e.badgeTitle||void 0,children:e.badge})]}),o=e.active?`page`:void 0;return/* @__PURE__ */ k(c,{link:t(n,{to:e.href}),className:i,"aria-current":o,children:a})}function pe(e){for(let t of e){if(t.active)return t;let e=t.children?.length?pe(t.children):void 0;if(e)return e}}function me({item:e,linkComponent:n,onNavigate:r,depth:i=0,iconVariant:a,newLabel:o,togglePagesLabel:s}){let l=i>0,u=i>1?` wui-nav-depth-${Math.min(i,6)}`:``,d=Array.isArray(e.children)&&e.children.length>0,f=d?pe(e.children??[]):void 0,p=!!f,m=f?f.key??f.href??f.label:null,[g,_]=D(p);C(()=>{m!=null&&_(!0)},[m]);let v=typeof e.label==`string`?e.label:void 0,y=!l&&e.icon&&/* @__PURE__ */ k(`span`,{className:`app-nav-icon`,children:typeof e.icon==`string`?/* @__PURE__ */ k(h,{name:e.icon,size:e.iconSize??22,variant:e.iconVariant??a}):e.icon}),b=e.badge!=null&&/* @__PURE__ */ k(`span`,{className:`app-nav-badge${e.badgeTone?` tone-${e.badgeTone}`:``}`,title:e.badgeTitle||void 0,children:e.badge}),x=q(e.newUntil)&&/* @__PURE__ */ k(`span`,{className:`wui-nav-new`,children:o}),S=/* @__PURE__ */ A(O,{children:[y,/* @__PURE__ */ k(`span`,{className:`app-nav-text`,children:e.label}),x,b,e.trailingIcon&&/* @__PURE__ */ k(`span`,{className:`app-nav-trailing`,children:typeof e.trailingIcon==`string`?/* @__PURE__ */ k(h,{name:e.trailingIcon,size:16}):e.trailingIcon})]}),w=e.active?`page`:void 0;if(d){let d=/* @__PURE__ */ k(`div`,{className:`app-nav-sub${g?` expanded`:``}`,inert:!g,"aria-hidden":!g||void 0,children:/* @__PURE__ */ k(`div`,{className:`app-nav-sub-inner`,children:(e.children??[]).map(e=>/* @__PURE__ */ k(me,{item:e,linkComponent:n,onNavigate:r,depth:i+1,iconVariant:a,newLabel:o,togglePagesLabel:s},e.key??e.href))})});if(e.href){let i=/* @__PURE__ */ k(c,{link:t(n,{to:e.href}),className:`wui-nav-split-link`,"aria-current":w,onClick:r,children:S});return/* @__PURE__ */ A(O,{children:[/* @__PURE__ */ A(`div`,{className:`app-nav-item has-children wui-nav-split${l?` app-nav-subitem`:``}${p||e.active?` active`:``}${u}`,"data-label":v,children:[i,/* @__PURE__ */ k(`button`,{type:`button`,className:`app-nav-caret wui-nav-split-toggle`,"aria-expanded":g,"aria-label":M(s,{name:v??``}),onClick:()=>_(e=>!e),children:/* @__PURE__ */ k(h,{name:`chevron-right`,size:16})})]}),d]})}return/* @__PURE__ */ A(O,{children:[/* @__PURE__ */ A(`button`,{type:`button`,className:`app-nav-item${l?` app-nav-subitem`:``} has-children${p?` active`:``}${u}`,"aria-expanded":g,"data-label":v,onClick:()=>_(e=>!e),children:[y,/* @__PURE__ */ k(`span`,{className:`app-nav-text`,children:e.label}),x,b,/* @__PURE__ */ k(`span`,{className:`app-nav-caret`,children:/* @__PURE__ */ k(h,{name:`chevron-right`,size:16})})]}),d]})}let T=`app-nav-item${l?` app-nav-subitem`:``}${e.active?` active`:``}${u}`;return/* @__PURE__ */ k(c,{link:t(n,{to:e.href}),className:T,"aria-current":w,"data-label":v,onClick:r,children:S})}function he(e){l(`wui-dropdown`,P);let[t,n]=D(!1),r=E(null);return C(()=>{r.current?.toggleAttribute(`open`,t)},[t]),C(()=>{let t=r.current;if(!t)return;let i=r=>{if(r.target!==t||!(`detail`in r)||!r.detail||typeof r.detail!=`object`)return;let i=`open`in r.detail&&r.detail.open===!0;n(i),i&&e?.()};return t.addEventListener(`wui-dropdown-toggle`,i),()=>t.removeEventListener(`wui-dropdown-toggle`,i)},[e]),{open:t,setOpen:n,ref:r}}function ge({config:e,linkComponent:n,accountMenuLabel:r,roleLabel:i,rolesLabel:a}){let o=u(`shell`,j),s=w(),{open:l,setOpen:d,ref:f}=he(),{name:g,role:v,roles:y=[],noTriggerRole:b=!1,outlined:x=!1,photo:S,profileHref:C,profileLabel:T=o.profileLabel,onLogout:E,logoutAction:D,logoutLabel:N=o.logoutLabel,head:P,section:F,logoutVariant:I=`item`,items:L=[]}=e;if(_(`AppShell`,`userMenu.logoutVariant`,I,[`item`,`button`]),!g)throw Error(`<AppShell> userMenu.name is required; the trigger and the avatar are named from it.`);let R=y.map(e=>(e??``).trim()).filter(Boolean),z=()=>d(!1),B=(e,r,i,a)=>/* @__PURE__ */ k(c,{link:t(n,{to:e}),className:`dropdown-item`,onClick:a,children:r},i),V=/* @__PURE__ */ k(h,{name:`log-out`,size:18}),H=/* @__PURE__ */ A(O,{children:[V,N]});return/* @__PURE__ */ A(`wui-dropdown`,{class:`dropdown wui-usermenu`,align:`end`,ref:f,children:[/* @__PURE__ */ A(`button`,{type:`button`,id:s,className:x?`wui-usermenu-trigger wui-usermenu-trigger-outlined`:`wui-usermenu-trigger`,"data-wui-dropdown-trigger":!0,"aria-expanded":l,"aria-label":M(r,{name:g}),children:[/* @__PURE__ */ k(p,{name:g,src:S,tone:`auto`}),/* @__PURE__ */ A(`span`,{className:`wui-usermenu-text`,children:[/* @__PURE__ */ k(`span`,{className:`wui-usermenu-name`,children:g}),v&&!b&&/* @__PURE__ */ k(`span`,{className:`wui-usermenu-role`,children:v})]}),/* @__PURE__ */ k(h,{name:`chevron-down`,size:14,className:`wui-usermenu-caret`})]}),/* @__PURE__ */ A(`div`,{"data-wui-dropdown-menu":!0,popover:`auto`,className:`dropdown-menu dropdown-menu-end wui-usermenu-menu${l?` show`:``}`,"aria-labelledby":s,children:[/* @__PURE__ */ A(`div`,{className:`wui-usermenu-head`,children:[/* @__PURE__ */ k(p,{name:g,src:S,size:`lg`,tone:`auto`}),/* @__PURE__ */ A(`div`,{className:`wui-usermenu-who`,children:[/* @__PURE__ */ k(`div`,{className:`wui-usermenu-name`,children:g}),v&&/* @__PURE__ */ k(`div`,{className:`wui-usermenu-role`,children:v}),R.length>0&&/* @__PURE__ */ A(`div`,{className:`wui-usermenu-roles`,children:[/* @__PURE__ */ k(`span`,{className:`wui-usermenu-roles-label`,children:R.length===1?i:a}),` ${R.join(`, `)}`]}),P?/* @__PURE__ */ k(`div`,{className:`wui-usermenu-extra`,children:P}):null]})]}),F?/* @__PURE__ */ k(`div`,{className:`wui-usermenu-section`,children:F}):null,C&&B(C,/* @__PURE__ */ A(O,{children:[/* @__PURE__ */ k(h,{name:`user`,size:18}),T]}),void 0,z),L.map(e=>{if(e.divider)return/* @__PURE__ */ k(`hr`,{className:`dropdown-divider`},e.key);let t=/* @__PURE__ */ A(O,{children:[e.icon&&/* @__PURE__ */ k(h,{name:e.icon,size:18}),e.label]}),n=()=>{e.onClick?.(),z()};return e.href?B(e.href,t,e.key,n):/* @__PURE__ */ k(`button`,{type:`button`,className:`dropdown-item`,onClick:n,children:t},e.key)}),I===`button`?(D||E)&&/* @__PURE__ */ k(`div`,{className:`wui-usermenu-foot`,children:D?/* @__PURE__ */ k(`form`,{method:`post`,action:D,className:`wui-usermenu-logout`,children:/* @__PURE__ */ k(m,{type:`submit`,tone:`danger`,variant:`soft`,block:!0,leftIcon:V,children:N})}):/* @__PURE__ */ k(m,{type:`button`,tone:`danger`,variant:`soft`,block:!0,leftIcon:V,onClick:()=>{z(),E?.()},children:N})}):D?/* @__PURE__ */ k(`form`,{method:`post`,action:D,className:`wui-usermenu-logout`,children:/* @__PURE__ */ k(`button`,{type:`submit`,className:`dropdown-item danger`,children:H})}):E&&/* @__PURE__ */ k(`button`,{type:`button`,className:`dropdown-item danger`,onClick:()=>{z(),E()},children:H})]})]})}function _e({config:e,unreadLabel:t,markAllReadLabel:n,viewAllLabel:r,loadingNotificationsText:i,noUnreadText:a,unreadNotificationsText:o,unreadBellLabel:s}){let c=u(`shell`,j),l=w(),{open:d,ref:f}=he(e.onOpen),{unread:p=0,items:m,loading:g=!1,onMarkAllRead:_,viewAllHref:v,label:y=c.label,emptyText:b=c.emptyText}=e,[x,S]=D(``),T=E(p);C(()=>{T.current!==p&&(T.current=p,S(p===0?a:M(o,{count:K(p)})))},[p,a,o]);let N=null;return m?.length?N=/* @__PURE__ */ k(`div`,{className:`wui-bell-items`,children:m.map((e,n)=>{let r=`wui-bell-item${e.read?` wui-bell-item-read`:``}`,i=/* @__PURE__ */ A(O,{children:[/* @__PURE__ */ k(`span`,{className:`wui-bell-dot`,"aria-hidden":`true`}),e.icon&&/* @__PURE__ */ k(`span`,{className:`wui-bell-icon`,children:/* @__PURE__ */ k(h,{name:e.icon,size:18})}),/* @__PURE__ */ A(`span`,{className:`wui-bell-body`,children:[!e.read&&/* @__PURE__ */ A(`span`,{className:`visually-hidden`,children:[t,`: `]}),/* @__PURE__ */ k(`span`,{className:`wui-bell-item-title`,children:e.title}),e.time&&/* @__PURE__ */ k(`span`,{className:`wui-bell-when`,children:e.time})]})]});return e.href?/* @__PURE__ */ k(`a`,{className:r,href:e.href,"data-id":e.id,children:i},e.id??n):/* @__PURE__ */ k(`div`,{className:r,"data-id":e.id,children:i},e.id??n)})}):g?N=/* @__PURE__ */ k(`div`,{className:`wui-bell-state`,children:i}):m&&(N=/* @__PURE__ */ k(`div`,{className:`wui-bell-state`,children:b})),/* @__PURE__ */ A(`wui-dropdown`,{class:`dropdown wui-bell`,align:`end`,ref:f,children:[/* @__PURE__ */ A(`button`,{type:`button`,id:l,className:`topbar-icon-btn wui-bell-trigger`,"data-wui-dropdown-trigger":!0,"aria-expanded":d,"aria-label":p===0?y:M(s,{label:y,count:K(p)}),children:[/* @__PURE__ */ k(h,{name:`notification`,size:20}),/* @__PURE__ */ k(`span`,{className:`wui-bell-count`,"aria-hidden":`true`,hidden:p===0,children:K(p)})]}),/* @__PURE__ */ k(`span`,{className:`visually-hidden`,"aria-live":`polite`,children:x}),/* @__PURE__ */ A(`div`,{"data-wui-dropdown-menu":!0,popover:`auto`,className:`dropdown-menu dropdown-menu-end wui-bell-menu${d?` show`:``}`,"aria-labelledby":l,children:[/* @__PURE__ */ A(`div`,{className:`wui-bell-head`,children:[/* @__PURE__ */ k(`span`,{className:`wui-bell-title`,children:y}),_&&/* @__PURE__ */ k(`button`,{type:`button`,className:`wui-bell-markall`,onClick:_,children:n})]}),/* @__PURE__ */ k(`div`,{className:`wui-bell-list`,"aria-busy":g||void 0,children:N}),v&&/* @__PURE__ */ k(`a`,{className:`wui-bell-foot`,href:v,children:r})]})]})}var ve=e=>!!e&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName));function ye({config:e,searchResultsLabel:t,noResultsText:n,noResultsForText:r,resultsCountText:i,resultCountText:a,moreLabel:o}){l(`wui-overflow`,N);let s=u(`shell`,j),c=w(),{value:d=``,onChange:f,results:p=null,loading:m=!1,onSelect:g,onSubmit:_,onFocus:v,placeholder:y=s.placeholder}=e,[x,S]=D(!1),[O,P]=D(!1),[F,I]=D({results:null,index:-1}),L=F.results===p?F.index:-1,R=e=>I({results:p,index:e}),z=E(null),B=E(null),V=E([]),H=T(()=>(p??[]).flatMap(e=>e.hits??[]),[p]),U=p!=null&&!O,W=H.length;C(()=>{let e=e=>{e.key!==`/`||e.ctrlKey||e.metaKey||e.altKey||ve(e.target instanceof HTMLElement?e.target:null)||(e.preventDefault(),S(!0),B.current?.focus())},t=e=>{z.current?.contains(e.target instanceof Node?e.target:null)||(P(!0),S(!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(!U||W===0)return;e.preventDefault(),R((L+(e.key===`ArrowDown`?1:-1)+W)%W)}else b(e.nativeEvent)?U&&L>=0&&V.current[L]?(e.preventDefault(),V.current[L].click()):_&&d.trim()!==``&&(e.preventDefault(),_(d.trim())):e.key===`Escape`&&(U?(e.preventDefault(),P(!0)):x&&(e.preventDefault(),S(!1)))},G=-1;return V.current=[],/* @__PURE__ */ k(`wui-overflow`,{class:`wui-topsearch-host`,label:o,children:/* @__PURE__ */ k(`div`,{"data-wui-overflow-list":!0,className:`wui-topsearch-row`,children:/* @__PURE__ */ A(`div`,{className:`wui-topsearch${x?` is-open`:``}${m?` is-loading`:``}`,ref:z,"data-overflow-label":y,children:[/* @__PURE__ */ k(`button`,{type:`button`,className:`topbar-icon-btn wui-topsearch-open`,"aria-label":y,"aria-expanded":x,"aria-controls":`${c}-panel`,onClick:()=>{let e=!x;S(e),e&&B.current?.focus()},children:/* @__PURE__ */ k(h,{name:`search`,size:20})}),/* @__PURE__ */ A(`div`,{className:`wui-topsearch-panel`,id:`${c}-panel`,children:[/* @__PURE__ */ A(`div`,{className:`search-wrap`,children:[/* @__PURE__ */ k(h,{name:`search`,size:18,className:`search-icon`}),/* @__PURE__ */ k(`input`,{ref:B,type:`search`,className:`form-control input search-input`,id:`${c}-input`,placeholder:y,"aria-label":y,role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":U,"aria-controls":`${c}-list`,"aria-activedescendant":U&&L>=0?`${c}-opt-${L}`:void 0,autoComplete:`off`,value:d,onChange:e=>{P(!1),f?.(e.target.value)},onKeyDown:ee,onFocus:v})]}),/* @__PURE__ */ k(`div`,{className:`wui-topsearch-results`,id:`${c}-list`,role:`listbox`,"aria-label":t,hidden:!U,children:U&&/* @__PURE__ */ A(`div`,{className:`wui-topsearch-groups`,role:`presentation`,children:[W===0&&/* @__PURE__ */ k(`div`,{className:`wui-topsearch-empty`,role:`option`,"aria-disabled":`true`,"aria-selected":`false`,children:M(r,{value:d})}),p.filter(e=>e.hits?.length).map((e,t)=>/* @__PURE__ */ A(`div`,{className:`wui-topsearch-group`,role:`group`,"aria-label":e.label??``,children:[e.label&&/* @__PURE__ */ k(`div`,{className:`wui-topsearch-group-label`,role:`presentation`,children:e.label}),e.hits.map(e=>{G+=1;let t=G;return/* @__PURE__ */ A(`a`,{className:`wui-topsearch-hit${t===L?` is-active`:``}`,role:`option`,"aria-selected":t===L,id:`${c}-opt-${t}`,href:e.href,ref:e=>{V.current[t]=e},onClick:t=>g?.(e,t),children:[e.icon&&/* @__PURE__ */ k(`span`,{className:`wui-topsearch-hit-icon`,children:/* @__PURE__ */ k(h,{name:e.icon,size:18})}),/* @__PURE__ */ A(`span`,{className:`wui-topsearch-hit-text`,children:[/* @__PURE__ */ k(`span`,{className:`wui-topsearch-hit-title`,children:e.title}),e.subtitle&&/* @__PURE__ */ k(`span`,{className:`wui-topsearch-hit-sub`,children:e.subtitle})]})]},`${e.href}-${t}`)})]},e.label??t))]})})]}),/* @__PURE__ */ k(`span`,{className:`visually-hidden`,"aria-live":`polite`,children:U?W===0?n:M(W===1?a:i,{count:W}):``})]})})})}export{ae as default};
@@ -1 +1 @@
1
- import{shortcutChip as e}from"../lib/shortcutChip.js";import t from"../lib/useElementEntry.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./AppIcon.js";import i from"./warnUnknownProps.js";import{SHORTCUT_EVENT as a,SHORTCUT_TEXT as o,shortcutKey as s}from"@webority/ui-elements/helpers";import{useEffect as c,useId as l,useRef as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";var p=`wui-shortcuts-open-change`,m=()=>import(`@webority/ui-elements/elements/shortcuts`);function h(e){let t=[],n=/* @__PURE__ */ new Map;for(let r of e){let e=r.group?.trim(),i=e?n.get(e):void 0;e?i?i.rows.push(r):n.set(e,{title:e,rows:[r]}):t.push(r)}return[{title:null,rows:t},...n.values()].filter(e=>e.rows.length>0)}function g(e){return/* @__PURE__ */ d(`dl`,{className:`wui-shortcut-keys`,children:e.map(e=>/* @__PURE__ */ f(`div`,{"data-shortcut":s(e.key),children:[/* @__PURE__ */ d(`dt`,{children:/* @__PURE__ */ d(`kbd`,{className:`wui-kbd`,children:s(e.key)})}),/* @__PURE__ */ d(`dd`,{children:e.label})]},s(e.key)))})}function _(_){t(`wui-shortcuts`,m);let{marker:v,props:y}=n(`AppShortcutLegend`,{..._}),{shortcuts:b=[],items:x,search:S,open:C,onOpenChange:w,trigger:T=!0,className:E=``,...D}=y;i(`AppShortcutLegend`,D);let O=l(),k=u(null),A=b.filter(e=>s(e.key)!==`?`),j=h(A),M={key:`?`,label:o.help},N=j.at(-1);N?N.rows.push(M):j.push({title:null,rows:[M]});let P=j.find(e=>!e.title),F=j.filter(e=>e.title),I=u(A);I.current=A,c(()=>{let e=k.current;if(!e)return;let t=e=>{if(!(e instanceof CustomEvent))throw Error(`wui:shortcut arrived without a detail`);let t=e.detail,n=I.current.find(e=>s(e.key)===t.key&&typeof e.onPress==`function`);n?.onPress&&(e.preventDefault(),n.onPress(t.itemKey))};return e.addEventListener(a,t),()=>e.removeEventListener(a,t)},[]);let L=u(w);return L.current=w,c(()=>{let e=k.current;if(!e)return;let t=t=>{if(!(t instanceof CustomEvent)||t.target!==e)return;let n=t.detail;L.current?.(n.open)};return e.addEventListener(p,t),()=>e.removeEventListener(p,t)},[]),/* @__PURE__ */ f(`wui-shortcuts`,{ref:k,class:[`wui-shortcut-legend`,E].filter(Boolean).join(` `),items:x||void 0,search:S||void 0,open:C,"no-trigger":T?void 0:``,...v,...D,children:[T&&/* @__PURE__ */ f(`button`,{type:`button`,className:`wui-shortcut-toggle`,"aria-haspopup":`dialog`,"aria-expanded":`false`,"aria-controls":O,"aria-keyshortcuts":`?`,children:[e(`?`),` ${o.title}`]}),/* @__PURE__ */ f(`div`,{className:`wui-shortcut-sheet`,id:O,role:`dialog`,"aria-label":o.title,hidden:!0,children:[/* @__PURE__ */ f(`div`,{className:`wui-shortcut-sheet-head`,children:[/* @__PURE__ */ d(`span`,{className:`wui-shortcut-sheet-title`,children:o.title}),/* @__PURE__ */ d(`button`,{type:`button`,className:`wui-shortcut-close`,"aria-label":o.close,children:/* @__PURE__ */ d(r,{name:`x`,size:16})})]}),P&&g(P.rows),F.map(e=>/* @__PURE__ */ f(`section`,{className:`wui-shortcut-group`,children:[/* @__PURE__ */ d(`h3`,{className:`wui-shortcut-group-title`,children:e.title}),g(e.rows)]},e.title))]})]})}export{_ as default};
1
+ import{shortcutChip as e}from"../lib/shortcutChip.js";import t from"../lib/useElementEntry.js";import n from"../lib/useWuiText.js";import{splitMarkerProps as r}from"../lib/wuiMarker.js";import i from"./AppIcon.js";import a from"./warnUnknownProps.js";import{SHORTCUT_EVENT as o,shortcutKey as s}from"@webority/ui-elements/helpers";import{useEffect as c,useId as l,useRef as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{SHORTCUT_KEYS_TEXT as p}from"@webority/ui-elements/text";var m=`wui-shortcuts-open-change`,h=()=>import(`@webority/ui-elements/elements/shortcuts`);function g(e){let t=[],n=/* @__PURE__ */ new Map;for(let r of e){let e=r.group?.trim(),i=e?n.get(e):void 0;e?i?i.rows.push(r):n.set(e,{title:e,rows:[r]}):t.push(r)}return[{title:null,rows:t},...n.values()].filter(e=>e.rows.length>0)}function _(e){return/* @__PURE__ */ d(`dl`,{className:`wui-shortcut-keys`,children:e.map(e=>/* @__PURE__ */ f(`div`,{"data-shortcut":s(e.key),children:[/* @__PURE__ */ d(`dt`,{children:/* @__PURE__ */ d(`kbd`,{className:`wui-kbd`,children:s(e.key)})}),/* @__PURE__ */ d(`dd`,{children:e.label})]},s(e.key)))})}function v(v){t(`wui-shortcuts`,h);let{marker:y,props:b}=r(`AppShortcutLegend`,{...v}),x=n(`shortcutKeys`,p),{shortcuts:S=[],items:C,search:w,open:T,onOpenChange:E,trigger:D=!0,className:O=``,...k}=b;a(`AppShortcutLegend`,k);let A=l(),j=u(null),M=S.filter(e=>s(e.key)!==`?`),N=g(M),P={key:`?`,label:x.helpLabel},F=N.at(-1);F?F.rows.push(P):N.push({title:null,rows:[P]});let I=N.find(e=>!e.title),L=N.filter(e=>e.title),R=u(M);R.current=M,c(()=>{let e=j.current;if(!e)return;let t=e=>{if(!(e instanceof CustomEvent))throw Error(`wui:shortcut arrived without a detail`);let t=e.detail,n=R.current.find(e=>s(e.key)===t.key&&typeof e.onPress==`function`);n?.onPress&&(e.preventDefault(),n.onPress(t.itemKey))};return e.addEventListener(o,t),()=>e.removeEventListener(o,t)},[]);let z=u(E);return z.current=E,c(()=>{let e=j.current;if(!e)return;let t=t=>{if(!(t instanceof CustomEvent)||t.target!==e)return;let n=t.detail;z.current?.(n.open)};return e.addEventListener(m,t),()=>e.removeEventListener(m,t)},[]),/* @__PURE__ */ f(`wui-shortcuts`,{ref:j,class:[`wui-shortcut-legend`,O].filter(Boolean).join(` `),items:C||void 0,search:w||void 0,open:T,"no-trigger":D?void 0:``,...y,...k,children:[D&&/* @__PURE__ */ f(`button`,{type:`button`,className:`wui-shortcut-toggle`,"aria-haspopup":`dialog`,"aria-expanded":`false`,"aria-controls":A,"aria-keyshortcuts":`?`,children:[e(`?`),` ${x.sheetTitle}`]}),/* @__PURE__ */ f(`div`,{className:`wui-shortcut-sheet`,id:A,role:`dialog`,"aria-label":x.sheetTitle,hidden:!0,children:[/* @__PURE__ */ f(`div`,{className:`wui-shortcut-sheet-head`,children:[/* @__PURE__ */ d(`span`,{className:`wui-shortcut-sheet-title`,children:x.sheetTitle}),/* @__PURE__ */ d(`button`,{type:`button`,className:`wui-shortcut-close`,"aria-label":x.closeLabel,children:/* @__PURE__ */ d(i,{name:`x`,size:16})})]}),I&&_(I.rows),L.map(e=>/* @__PURE__ */ f(`section`,{className:`wui-shortcut-group`,children:[/* @__PURE__ */ d(`h3`,{className:`wui-shortcut-group-title`,children:e.title}),_(e.rows)]},e.title))]})]})}export{v as default};