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