@webority/ui-react 0.128.0 → 0.130.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/README.md +1 -1
- package/dist/canvas-kit/kit.js +29757 -25503
- package/dist/canvas-kit/manifest.json +3343 -275
- package/dist/canvas-kit/release.json +6 -6
- package/dist/components/AppAccountSwitcher.js +1 -0
- package/dist/components/AppActionIcon.js +1 -1
- package/dist/components/AppAlert.js +1 -1
- 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/AppBadge.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/AppChip.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/AppConfirmProvider.js +1 -1
- package/dist/components/AppConsentBanner.js +1 -1
- package/dist/components/AppContextMenu.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/AppDropdown.js +1 -1
- package/dist/components/AppDueDate.js +1 -1
- package/dist/components/AppEmptyState.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/AppInfoTip.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/AppKpiTile.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/AppMeter.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/AppNavList.js +1 -1
- package/dist/components/AppNotificationCenter.js +1 -1
- package/dist/components/AppNumberInput.js +1 -1
- package/dist/components/AppOnboardingChecklist.js +1 -1
- package/dist/components/AppOtpInput.js +1 -1
- package/dist/components/AppPageHeader.js +1 -1
- package/dist/components/AppPhoneNumberInput.js +1 -1
- package/dist/components/AppPopover.js +1 -1
- package/dist/components/AppProgress.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/AppRepeater.js +1 -1
- package/dist/components/AppResourceCard.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/AppSectionHero.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/AppSplash.js +1 -1
- package/dist/components/AppSplitButton.js +1 -1
- package/dist/components/AppSplitView.js +1 -1
- package/dist/components/AppStatusBadge.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/AppTabs.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/AppToolbar.js +1 -1
- package/dist/components/AppTooltip.js +1 -1
- package/dist/components/AppUpdateBar.js +1 -1
- package/dist/components/AppWhatsNew.js +1 -1
- package/dist/components/AppWizard.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 +273 -47
- package/dist/lib/CheckField.js +1 -1
- package/dist/lib/DiscardPrompt.js +1 -1
- package/dist/lib/FileItemRow.js +1 -1
- package/dist/lib/buttonClass.js +1 -0
- 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/lib/sectionShell.js +1 -1
- package/dist/lib/vocabulary.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/AppActionIcon.d.ts +3 -12
- 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 +23 -3
- 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 +8 -2
- package/dist/types/components/AppButton.d.ts +9 -4
- package/dist/types/components/AppCalendar.d.ts +3 -1
- package/dist/types/components/AppCard.d.ts +16 -4
- package/dist/types/components/AppCell.d.ts +36 -0
- package/dist/types/components/AppChart.d.ts +14 -0
- package/dist/types/components/AppChartCard.d.ts +60 -0
- package/dist/types/components/AppCheckbox.d.ts +23 -1
- 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 +45 -6
- 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 +10 -10
- package/dist/types/components/AppConfirmProvider.d.ts +5 -6
- package/dist/types/components/AppConsentBanner.d.ts +3 -3
- package/dist/types/components/AppContextMenu.d.ts +2 -2
- package/dist/types/components/AppCopyButton.d.ts +8 -2
- package/dist/types/components/AppCountrySelect.d.ts +6 -1
- package/dist/types/components/AppDataTable.d.ts +1 -1
- package/dist/types/components/AppDatePicker.d.ts +26 -2
- package/dist/types/components/AppDateRangePicker.d.ts +32 -2
- 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 +26 -2
- package/dist/types/components/AppDropdown.d.ts +7 -7
- package/dist/types/components/AppDueDate.d.ts +42 -0
- package/dist/types/components/AppEmptyState.d.ts +3 -3
- 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 +80 -5
- 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 +70 -0
- package/dist/types/components/AppImagePicker.d.ts +64 -4
- package/dist/types/components/AppInlineEdit.d.ts +6 -0
- package/dist/types/components/AppInput.d.ts +38 -3
- 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 +18 -1
- package/dist/types/components/AppMetricStrip.d.ts +2 -0
- package/dist/types/components/AppModal.d.ts +9 -3
- package/dist/types/components/AppMultiSelect.d.ts +20 -3
- package/dist/types/components/AppNotificationCenter.d.ts +2 -0
- package/dist/types/components/AppNumberInput.d.ts +25 -3
- package/dist/types/components/AppOnboardingChecklist.d.ts +3 -3
- package/dist/types/components/AppOtpInput.d.ts +31 -2
- package/dist/types/components/AppPhoneNumberInput.d.ts +25 -1
- package/dist/types/components/AppPopover.d.ts +5 -5
- package/dist/types/components/AppRadio.d.ts +23 -1
- package/dist/types/components/AppRadioGroup.d.ts +26 -2
- package/dist/types/components/AppRating.d.ts +42 -3
- package/dist/types/components/AppRepeater.d.ts +3 -3
- package/dist/types/components/AppResourceCard.d.ts +2 -2
- package/dist/types/components/AppRichText.d.ts +10 -3
- package/dist/types/components/AppRouteError.d.ts +54 -0
- package/dist/types/components/AppScoreScale.d.ts +9 -3
- package/dist/types/components/AppSearch.d.ts +17 -2
- package/dist/types/components/AppSectionLeadCapture.d.ts +50 -2
- 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 +23 -3
- package/dist/types/components/AppShell.d.ts +151 -4
- package/dist/types/components/AppSlider.d.ts +29 -1
- package/dist/types/components/AppSortableList.d.ts +5 -0
- package/dist/types/components/AppSparkline.d.ts +24 -0
- package/dist/types/components/AppSplash.d.ts +2 -2
- package/dist/types/components/AppSplitButton.d.ts +10 -4
- 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 +24 -2
- 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 +20 -3
- package/dist/types/components/AppTextarea.d.ts +21 -1
- package/dist/types/components/AppTimePicker.d.ts +19 -2
- package/dist/types/components/AppTimeline.d.ts +8 -0
- package/dist/types/components/AppToast.d.ts +6 -0
- package/dist/types/components/AppToolbar.d.ts +3 -3
- package/dist/types/components/AppTooltip.d.ts +7 -4
- package/dist/types/components/AppUpdateBar.d.ts +20 -2
- 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/buttonClass.d.ts +9 -0
- 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/types/lib/sectionShell.d.ts +0 -1
- package/dist/types/lib/vocabulary.d.ts +3 -0
- package/dist/ui-react.js +1 -1
- package/dist/web-core/dist/query/listQuery.js +1 -0
- package/package.json +8 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./AppActionIcon.js";import n from"./AppButton.js";import r from"./AppLink.js";import i from"./warnUnknownProps.js";import{jsx as a,jsxs as o}from"react/jsx-runtime";function s(s){let{marker:c,props:l}=e(`AppRepeater`,s),{rows:u=[],renderRow:d,rowLabel:f,onAdd:p,onRemove:m,addLabel:h=`Add another`,addVariant:g=`
|
|
1
|
+
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./AppActionIcon.js";import n from"./AppButton.js";import r from"./AppLink.js";import i from"./warnUnknownProps.js";import{jsx as a,jsxs as o}from"react/jsx-runtime";function s(s){let{marker:c,props:l}=e(`AppRepeater`,s),{rows:u=[],renderRow:d,rowLabel:f,onAdd:p,onRemove:m,addLabel:h=`Add another`,addVariant:g=`soft`,removeLabel:_=`Remove row`,emptyText:v,min:y=0,max:b,numbered:x=!0,className:S=``,...C}=l;i(`AppRepeater`,C);let w=typeof b==`number`&&u.length>=b,T=!!m&&u.length>y;return/* @__PURE__ */ o(`div`,{className:`repeater${S?` ${S}`:``}`,...c,...C,children:[u.length===0&&v&&/* @__PURE__ */ a(`div`,{className:`repeater-empty`,children:v}),u.map((e,n)=>{let r=f?f(e,n):null;return/* @__PURE__ */ o(`div`,{className:`repeater-row`,children:[(!!r||T)&&/* @__PURE__ */ a(`span`,{className:`repeater-row-label`,children:r}),x&&/* @__PURE__ */ a(`span`,{className:`repeater-index`,children:n+1}),/* @__PURE__ */ a(`div`,{className:`repeater-body`,children:d(e,n)}),T&&/* @__PURE__ */ a(t,{icon:`trash-2`,label:`${_} ${n+1}`,tone:`danger`,className:`repeater-remove`,onClick:()=>m(n)})]},e.id??n)}),g===`link`?/* @__PURE__ */ a(r,{animation:`static`,size:`sm`,linkComponent:`button`,type:`button`,leftIcon:`plus`,className:`repeater-add`,disabled:w,onClick:p,children:h}):/* @__PURE__ */ a(n,{variant:g,size:`sm`,leftIcon:`plus`,className:`repeater-add`,disabled:w,onClick:p,children:h})]})}export{s as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./AppIcon.js";import n from"./warnUnknownProps.js";import{Fragment as r,jsx as i,jsxs as a}from"react/jsx-runtime";function o(o){let{marker:s,props:c}=e(`AppResourceCard`,o),{icon:l,title:u,
|
|
1
|
+
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./AppIcon.js";import n from"./warnUnknownProps.js";import{Fragment as r,jsx as i,jsxs as a}from"react/jsx-runtime";function o(o){let{marker:s,props:c}=e(`AppResourceCard`,o),{icon:l,title:u,description:d,href:f,external:p=!1,linkComponent:m,className:h=``,...g}=c;n(`AppResourceCard`,g);let _=/* @__PURE__ */ a(r,{children:[/* @__PURE__ */ i(`span`,{className:`res-card-icon`,children:/* @__PURE__ */ i(t,{name:l,size:18})}),/* @__PURE__ */ a(`span`,{className:`res-card-body`,children:[/* @__PURE__ */ i(`span`,{className:`res-card-title`,children:u}),d&&/* @__PURE__ */ i(`span`,{className:`res-card-text`,children:d})]})]}),v=`res-card${h?` ${h}`:``}`;return m&&!p?/* @__PURE__ */ i(m,{className:v,to:f,...s,...g,children:_}):/* @__PURE__ */ i(`a`,{className:v,href:f,target:p?`_blank`:void 0,rel:p?`noopener noreferrer`:void 0,...s,...g,children:_})}export{o 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,
|
|
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,helperText: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,{leftIcon:`refresh-cw`,onClick:h,children:y}),children:D}):p===`not-found`?/* @__PURE__ */ o(n,{status:`404`,title:C,subtitle:w,actions:A(`solid`),children:D}):/* @__PURE__ */ o(n,{status:`500`,title:T,subtitle:E,actions:/* @__PURE__ */ s(a,{children:[/* @__PURE__ */ o(t,{leftIcon:`refresh-cw`,onClick:h,children:b}),A(`outline`)]}),children:D}),/* @__PURE__ */ s(`div`,{className:[_?`d-flex flex-column align-items-center justify-content-center min-vh-100 px-3`:`d-flex flex-column align-items-center py-5 px-3`,O].filter(Boolean).join(` `),...d,...k,children:[g&&/* @__PURE__ */ o(`div`,{className:`mb-4`,children:g}),/* @__PURE__ */ o(`div`,{className:`col-12 col-md-8 col-lg-6`,children:j})]})}export{u as default};
|
|
@@ -1 +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,
|
|
1
|
+
import e from"../lib/FieldMessage.js";import{wuiMarkerAttributes as t}from"../lib/wuiMarker.js";import{useId as n}from"react";import{jsx as r,jsxs as i}from"react/jsx-runtime";function a(a){let{value:o=null,onChange:s,min:c=0,max:l=10,label:u,lowLabel:d,highLabel:f,name:p,disabled:m=!1,error:h,helperText:g,id:_,className:v=``,fieldClassName:y=``,scoreLabel:b=`Score`}=a,x=n(),S=_||x,C=p||S,w=`${S}-error`,T=`${S}-hint`,E=Array.from({length:Math.max(0,l-c+1)},(e,t)=>c+t),D=d!=null||f!=null;return/* @__PURE__ */ i(`div`,{...t(`AppScoreScale`,a),className:`field${y?` ${y}`:``}`,children:[u!=null&&/* @__PURE__ */ r(`span`,{className:`label`,id:`${S}-label`,children:u}),/* @__PURE__ */ i(`div`,{className:`wui-score-scale${v?` ${v}`:``}`,id:S,role:`radiogroup`,"aria-labelledby":u==null?void 0:`${S}-label`,"aria-label":u==null?b:void 0,"aria-invalid":h?`true`:void 0,"aria-describedby":h?w:g?T:void 0,children:[E.map(e=>/* @__PURE__ */ i(`label`,{className:`wui-score-scale__item${o===e?` wui-score-scale__item--selected`:``}`,children:[/* @__PURE__ */ r(`input`,{type:`radio`,className:`visually-hidden`,name:C,value:e,checked:o===e,disabled:m,onChange:()=>s?.(e)}),e]},e)),D&&/* @__PURE__ */ i(`span`,{className:`wui-score-scale__ends`,children:[/* @__PURE__ */ r(`span`,{children:d}),/* @__PURE__ */ r(`span`,{children:f})]})]}),/* @__PURE__ */ r(e,{error:h,hint:g,errorId:w,hintId:T})]})}export{a as default};
|
|
@@ -1 +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,
|
|
1
|
+
import e,{SECTION_ALIGNS as t,SECTION_HEADINGS as n,SECTION_VARIANTS as r,sectionHeading as i}from"../lib/sectionShell.js";import{TONES as a}from"../lib/vocabulary.js";import{splitMarkerProps as o}from"../lib/wuiMarker.js";import s from"./warnInvalidValue.js";import c from"./warnUnknownProps.js";import{jsx as l}from"react/jsx-runtime";function u(u){let{marker:d,props:f}=o(`AppSectionHero`,u),{title:p,as:m=`h1`,eyebrow:h,subtitle:g,align:_=`start`,variant:v=`default`,eyebrowTone:y,actions:b,media:x,className:S=``,...C}=f;return c(`AppSectionHero`,C),s(`AppSectionHero`,`as`,m,n),s(`AppSectionHero`,`align`,_,t),s(`AppSectionHero`,`variant`,v,r),y!==void 0&&s(`AppSectionHero`,`eyebrowTone`,y,a),/* @__PURE__ */ l(e,{component:`AppSectionHero`,kind:`hero`,title:p,as:i(m,`h1`),eyebrow:h,subtitle:g,align:_,variant:v,eyebrowTone:y,actions:b,className:S,rest:{...d,...C},children:x!=null&&x!==!1&&/* @__PURE__ */ l(`div`,{className:`wui-section-media`,children:x})})}export{u 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,description: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`,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,helperText: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=[`neutral`,`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=`neutral`,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`,tone:`danger`,variant:`soft`,block:!0,leftIcon:P,children:E})}):/* @__PURE__ */ S(u,{type:`button`,tone:`danger`,variant:`soft`,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,helperText: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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{splitMarkerProps as
|
|
1
|
+
import e from"../lib/fillLabel.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./AppIcon.js";import r from"./useWuiControl.js";import i from"./warnInvalidValue.js";import a from"./warnUnknownProps.js";import{forwardRef as o,useEffect as s,useRef as c}from"react";import{jsx as l,jsxs as u}from"react/jsx-runtime";import"@webority/ui-elements/elements/sortable";var d=[`vertical`,`horizontal`],f=[`always`,`hover`],p=(e,t)=>{e.controlled=!0;let n=e.order;(n.length!==t.length||t.some((e,t)=>e!==n[t]))&&(e.order=t)},m=o(function(o,m){let{marker:h,props:g}=t(`AppSortableList`,o),{items:_=[],onReorder:v,ariaLabel:y,handle:b=!1,group:x,name:S,disabled:C=!1,orientation:w=`vertical`,handleDisplay:T=`always`,bordered:E=!0,className:D=``,reorderLabel:O=`Reorder {name}`,...k}=g;a(`AppSortableList`,k),i(`AppSortableList`,`orientation`,w,d),i(`AppSortableList`,`handleDisplay`,T,f);let A=T===`hover`,j=_.map(e=>e.id),M=c(j);s(()=>{M.current=j});let{setRef:N,innerRef:P}=r({ref:m,value:j,writeValue:p,on:{"wui-sortable:change":e=>{e.target===e.currentTarget&&(v?.(e.detail.ids,e.detail),requestAnimationFrame(()=>{P.current&&p(P.current,M.current)}))}}});return/* @__PURE__ */ l(`wui-sortable`,{ref:N,role:`list`,"aria-label":y,name:S||void 0,group:x||void 0,orientation:w===`horizontal`?`horizontal`:void 0,"handle-display":A?`hover`:void 0,handle:b||A?``:void 0,disabled:C?``:void 0,borderless:E?void 0:``,className:`wui-sortable${D?` ${D}`:``}`,...h,...k,children:_.map(t=>/* @__PURE__ */ u(`div`,{role:`listitem`,className:`wui-sortable-item`,"data-id":t.id,"data-label":t.label,"data-disabled":t.disabled?``:void 0,children:[/* @__PURE__ */ l(`button`,{type:`button`,className:`wui-sortable-handle`,"aria-label":e(O,{name:t.label}),disabled:C||t.disabled?!0:void 0,children:/* @__PURE__ */ l(n,{name:`menu`,size:18})}),/* @__PURE__ */ l(`div`,{className:`wui-sortable-body`,children:t.content??t.label})]},t.id))})});export{m as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{devWarn as e}from"../lib/devWarn.js";import{splitMarkerProps as
|
|
1
|
+
import{devWarn as e}from"../lib/devWarn.js";import t from"../lib/fillLabel.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./warnUnknownProps.js";import{jsx as i}from"react/jsx-runtime";var a=()=>{try{return process.env.NODE_ENV!==`production`}catch{return!0}},o=!1;function s(t){!o&&a()&&(o=!0,e(`[@webority/ui-react] <AppSparkline> left out ${t} value(s) in \`data\` that are not finite numbers.`))}var c=e=>typeof e==`number`&&Number.isFinite(e);function l(e,t,n){if(e.length<2)return`0,${n/2} ${t},${n/2}`;let r=Math.min(...e),i=Math.max(...e)-r,a=t/(e.length-1);return e.map((e,t)=>{let o=i===0?n/2:n-(e-r)/i*n;return`${t*a},${o}`}).join(` `)}var u=e=>String(Number(e.toFixed(2)));function d(e,n,r){let i=n?t(r.namedTrendLabel,{label:n}):r.trendLabel;return e.length===1?t(r.oneValueText,{name:i,value:u(e[0])}):t(r.rangeText,{name:i,from:u(e[0]),to:u(e[e.length-1]),count:e.length})}function f(e){let{marker:t,props:a}=n(`AppSparkline`,e),{data:o,label:u,width:f=48,height:p=16,className:m=``,trendLabel:h=`Trend`,namedTrendLabel:g=`{label} trend`,oneValueText:_=`{name} has one value, {value}.`,rangeText:v=`{name} from {from} to {to} across {count} points.`,...y}=a;r(`AppSparkline`,y);let b=Array.isArray(o)?o.filter(c):[];if(Array.isArray(o)&&b.length<o.length&&s(o.length-b.length),b.length===0)return null;let x={trendLabel:h,namedTrendLabel:g,oneValueText:_,rangeText:v};return/* @__PURE__ */ i(`svg`,{className:`wui-sparkline${m?` ${m}`:``}`,width:f,height:p,viewBox:`0 0 ${f} ${p}`,role:`img`,"aria-label":d(b,u,x),...t,...y,children:/* @__PURE__ */ i(`polyline`,{points:l(b,f,p),stroke:`currentColor`,fill:`none`})})}export{f as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import{jsx as r,jsxs as i}from"react/jsx-runtime";var a=[`bar`,`ring`,`dots`],o={sm:44,md:56,lg:72};function s(s){let{marker:c,props:l}=e(`AppSplash`,s),{logo:u,initials:d,
|
|
1
|
+
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import{jsx as r,jsxs as i}from"react/jsx-runtime";var a=[`bar`,`ring`,`dots`],o={sm:44,md:56,lg:72};function s(s){let{marker:c,props:l}=e(`AppSplash`,s),{logo:u,initials:d,description:f,subtext:p,variant:m=`bar`,size:h=`md`,label:g=`Loading`,className:_=``,...v}=l;n(`AppSplash`,v),t(`AppSplash`,`variant`,m,a),t(`AppSplash`,`size`,typeof h==`string`?h:null,Object.keys(o));let{style:y,...b}=v,x=typeof h==`number`?h:o[h]??o.md,S=m===`ring`?/* @__PURE__ */ r(`span`,{className:`splash-ring`,"aria-hidden":`true`}):m===`dots`?/* @__PURE__ */ i(`span`,{className:`splash-dots`,"aria-hidden":`true`,children:[/* @__PURE__ */ r(`i`,{}),/* @__PURE__ */ r(`i`,{}),/* @__PURE__ */ r(`i`,{})]}):/* @__PURE__ */ r(`span`,{className:`splash-bar`,"aria-hidden":`true`});return/* @__PURE__ */ r(`div`,{className:`splash${_?` ${_}`:``}`,role:`status`,"aria-live":`polite`,"aria-label":g,style:{"--wui-splash-size":`${x}px`,...y},...c,...b,children:/* @__PURE__ */ i(`div`,{className:`splash-inner`,children:[u||d&&/* @__PURE__ */ r(`span`,{className:`splash-mark`,children:d}),S,f&&/* @__PURE__ */ r(`span`,{className:`splash-text`,children:f}),p&&/* @__PURE__ */ r(`span`,{className:`splash-subtext`,children:p})]})})}export{s as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{buttonClass as e}from"../lib/buttonClass.js";import{FILL_VARIANTS as t,TONES as n}from"../lib/vocabulary.js";import{splitMarkerProps as r}from"../lib/wuiMarker.js";import i from"./AppButton.js";import a from"./AppDropdown.js";import o from"./AppIcon.js";import s from"./warnInvalidValue.js";import c from"./warnUnknownProps.js";import{jsx as l,jsxs as u}from"react/jsx-runtime";var d=[`sm`,`md`,`lg`],f=[`button`,`submit`,`reset`],p={sm:14,md:16,lg:20},m={sm:`btn-sm`,md:``,lg:`btn-lg`};function h(h){let{marker:g,props:_}=r(`AppSplitButton`,h),{label:v,items:y=[],onClick:b,href:x,type:S=`button`,tone:C=`primary`,variant:w=`solid`,size:T=`md`,disabled:E=!1,loading:D=!1,leftIcon:O,shortcut:k,menuLabel:A=`More actions`,align:j=`end`,linkComponent:M,className:N=``,...P}=_;c(`AppSplitButton`,P),s(`AppSplitButton`,`size`,T,d),s(`AppSplitButton`,`tone`,C,n),s(`AppSplitButton`,`variant`,w,t),s(`AppSplitButton`,`type`,S,f);let F=[`btn`,e(C,w),m[T]??``,`wui-split-toggle`].filter(Boolean).join(` `),I=/* @__PURE__ */ l(o,{name:`chevron-down`,size:p[T]??p.md}),L=E||D;return/* @__PURE__ */ u(`div`,{role:`group`,"aria-label":v,className:[`wui-split-button`,N].filter(Boolean).join(` `),...g,...P,children:[/* @__PURE__ */ l(i,{tone:C,variant:w,size:T,type:S,href:x,onClick:b,disabled:E,loading:D,leftIcon:O,shortcut:k,children:v}),L?/* @__PURE__ */ l(`div`,{className:`wui-split-menu`,children:/* @__PURE__ */ l(`button`,{type:`button`,className:F,disabled:!0,"aria-label":A,children:I})}):/* @__PURE__ */ l(a,{className:`wui-split-menu`,trigger:I,toggleClassName:F,label:A,ariaLabel:A,align:j,items:y,linkComponent:M})]})}export{h as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{splitMarkerProps as
|
|
1
|
+
import e from"../lib/fillLabel.js";import{linkTarget as t}from"../lib/linkTarget.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./AppRecordPager.js";import i from"./AppShortcutLegend.js";import a from"./warnInvalidValue.js";import o from"./warnUnknownProps.js";import{LIST_KEYS as s,SELECT_KEY as c,shortcutKey as l}from"@webority/ui-elements/helpers";import{useEffect as ee,useMemo as te,useRef as u}from"react";import{Fragment as ne,jsx as d,jsxs as f}from"react/jsx-runtime";var p={sm:576,md:768,lg:992,xl:1200,xxl:1400},re=Object.keys(p),m=[3,4,5,6,7,8],h=6,g=`.wui-split-items > .wui-split-item > .wui-split-link`,_=(e,t)=>e!=null&&String(e)===String(t),ie=e=>{let t=window.matchMedia?.(`(min-width: ${p[e]}px)`);return!t||t.matches},ae=(e,t)=>typeof e==`string`||typeof e==`number`?String(e):t;function v(v){let{marker:y,props:oe}=n(`AppSplitView`,v),{items:b=[],currentKey:x,onSelect:S,selectable:C=!1,selectedKeys:w,onToggle:se,onToggleAll:ce,bulkActions:le,header:T,chips:E,pane:ue,paneHeader:D,pager:de=!0,shortcuts:fe,shortcutsEnabled:O=!0,empty:pe=`Nothing here yet.`,loading:k=!1,listWidth:A=5,stackBelow:j=`xl`,linkComponent:M,loadingLabel:N=`Loading`,itemsLabel:P=`Items`,selectItemLabel:F=`Select {title}`,selectAllLabel:I=`Select all items`,readingPaneLabel:L=`Reading pane`,previousItemLabel:R=`Previous item`,nextItemLabel:z=`Next item`,openLabel:B=`Open`,moveLabel:me=`Move`,selectedLabel:he=`{count} selected`,untitledItemLabel:ge=`item`,className:_e=``,...V}=oe,H=te(()=>new Set(w),[w]);o(`AppSplitView`,V),a(`AppSplitView`,`stackBelow`,j,re),a(`AppSplitView`,`listWidth`,A,m);let U=p[j]?j:`xl`,ve=m.includes(A)?A:5,W=u(null),ye=x!=null,G=C?H?.size??0:0,K=G>0,q=C&&b.length>0&&b.every(e=>H?.has(e.key)),be=C&&!q&&b.some(e=>H?.has(e.key)),xe=e=>{e&&(e.indeterminate=be)},J=u(!1);ee(()=>{J.current?x!=null&&W.current?.querySelector(`.wui-split-link[aria-current="true"]`)?.scrollIntoView?.({block:`nearest`}):J.current=!0},[x]);let Y=(e,t)=>{t.button>0||t.ctrlKey||t.metaKey||t.shiftKey||t.altKey||S&&(!e.href||ie(U))&&(t.preventDefault(),S(e.key))},X=e=>{let t=[...W.current?.querySelectorAll(g)??[]];t[t.findIndex(e=>e.getAttribute(`aria-current`)===`true`)+e]?.click()},Se=[`wui-split-view`,ye?`wui-split-reading`:``,_e].filter(Boolean).join(` `),Ce=C?[...s,c]:s,we=/* @__PURE__ */ new Set([`J`,`K`,`Enter`,`?`,...C?[`X`]:[]]),Te=[...Ce,...(fe??[]).filter(e=>!we.has(l(e.key))).map(e=>({key:e.key,label:e.label,onPress:()=>e.onPress?.(x)}))],Z=b.findIndex(e=>_(x,e.key)),Q=de&&!k&&b.length>0?/* @__PURE__ */ d(r,{"data-split-pager":``,index:Z>=0?Z+1:void 0,total:b.length,onPrev:()=>X(-1),onNext:()=>X(1),prevLabel:R,nextLabel:z}):null,Ee=n=>{let r=_(x,n.key),i=C&&!!H?.has(n.key),a=n.badge!==void 0&&n.badge!==null&&n.badge!==``,{Tag:o,linkProps:s}=t(M,{href:n.href}),c=/* @__PURE__ */ f(ne,{children:[/* @__PURE__ */ f(`span`,{className:`wui-split-item-main`,children:[/* @__PURE__ */ d(`span`,{className:`wui-split-item-title`,children:n.title}),n.meta!==void 0&&n.meta!==null&&/* @__PURE__ */ d(`span`,{className:`wui-split-item-meta`,children:n.meta})]}),(n.trailing||a)&&/* @__PURE__ */ f(`span`,{className:`wui-split-item-end`,children:[n.trailing,a&&/* @__PURE__ */ d(`span`,{className:`wui-split-badge`,children:n.badge})]})]});return/* @__PURE__ */ f(`li`,{className:[`wui-split-item`,r?`is-active`:``,i?`is-selected`:``].filter(Boolean).join(` `),"data-key":n.key,children:[C&&/* @__PURE__ */ d(`input`,{type:`checkbox`,className:`wui-check wui-split-check`,checked:i,onChange:()=>se?.(n.key),"aria-label":e(F,{title:ae(n.title,ge)})}),n.href?/* @__PURE__ */ d(o,{className:`wui-split-link`,...s,"aria-current":r?`true`:void 0,onClick:e=>Y(n,e),children:c}):/* @__PURE__ */ d(`button`,{type:`button`,className:`wui-split-link`,"aria-current":r?`true`:void 0,onClick:e=>Y(n,e),children:c})]},n.key)},$;return $=k?/* @__PURE__ */ f(`div`,{className:`wui-split-items`,"aria-busy":`true`,tabIndex:0,children:[/* @__PURE__ */ d(`span`,{className:`visually-hidden`,children:N}),Array.from({length:h},(e,t)=>/* @__PURE__ */ f(`div`,{className:`wui-split-skeleton`,"aria-hidden":`true`,children:[/* @__PURE__ */ d(`span`,{className:`skeleton wui-split-skeleton-title`}),/* @__PURE__ */ d(`span`,{className:`skeleton wui-split-skeleton-meta`})]},t))]}):b.length?/* @__PURE__ */ d(`ul`,{className:`wui-split-items`,"aria-label":P,children:b.map(Ee)}):/* @__PURE__ */ d(`div`,{className:`wui-split-empty`,children:pe}),/* @__PURE__ */ f(`div`,{ref:W,className:Se,"data-stack-below":U,"data-list-width":ve,"data-shortcut-scope":O?``:void 0,...y,...V,children:[/* @__PURE__ */ f(`div`,{className:`wui-split-list`,children:[(T||C)&&/* @__PURE__ */ f(`div`,{className:`wui-split-head`,children:[C&&/* @__PURE__ */ d(`input`,{ref:xe,type:`checkbox`,className:`wui-check wui-split-all`,checked:q,onChange:e=>ce?.(e.target.checked),"aria-label":I}),/* @__PURE__ */ d(`div`,{className:`wui-split-head-main`,hidden:K,children:T}),C&&/* @__PURE__ */ f(`div`,{className:`wui-split-head-bulk`,hidden:!K,children:[/* @__PURE__ */ d(`span`,{className:`wui-split-count`,"aria-live":`polite`,children:e(he,{count:G})}),le]})]}),E&&/* @__PURE__ */ d(`div`,{className:`wui-split-chips`,children:E}),$,O&&/* @__PURE__ */ f(`div`,{className:`wui-split-legend`,children:[/* @__PURE__ */ f(`span`,{children:[/* @__PURE__ */ d(`kbd`,{className:`wui-kbd`,children:`J`}),` `,/* @__PURE__ */ d(`kbd`,{className:`wui-kbd`,children:`K`}),` ${me}`]}),/* @__PURE__ */ f(`span`,{children:[/* @__PURE__ */ d(`kbd`,{className:`wui-kbd`,children:`Enter`}),` ${B}`]}),/* @__PURE__ */ d(i,{items:g,shortcuts:Te})]})]}),/* @__PURE__ */ f(`div`,{className:`wui-split-pane`,children:[(D||Q)&&/* @__PURE__ */ f(`div`,{className:`wui-split-pane-head`,children:[D,Q]}),/* @__PURE__ */ d(`section`,{className:`wui-split-pane-body`,"aria-label":L,tabIndex:0,children:ue})]})]})}export{v as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{TONES as e}from"../lib/vocabulary.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./warnInvalidValue.js";import r from"./warnUnknownProps.js";import i from"./withTooltip.js";import{jsx as a}from"react/jsx-runtime";function o(o){let{marker:s,props:c}=t(`AppStatusBadge`,o),{label:l,tone:u=`neutral`,className:d=``,tooltip:f,tooltipPlacement:p,...m}=c;return r(`AppStatusBadge`,m),n(`AppStatusBadge`,`tone`,u,e),l==null||l===``?`-`:i(/* @__PURE__ */ a(`span`,{className:`status-label ${u}${d?` ${d}`:``}`,...s,...m,children:l}),f,p)}export{o as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{splitMarkerProps as
|
|
1
|
+
import e from"../lib/fillLabel.js";import{TONES as t}from"../lib/vocabulary.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./AppIcon.js";import i from"./warnInvalidValue.js";import a from"./warnUnknownProps.js";import{deriveStepStatus as o,stepperHeaderItems as s}from"@webority/ui-elements/helpers";import{Fragment as c,jsx as l,jsxs as u}from"react/jsx-runtime";var d=[`steps`,`journey`],f=[`horizontal`,`vertical`],p=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`],m=[`sm`,`md`,`lg`],h=t.filter(e=>e===`primary`||e===`info`),g={sm:12,md:14,lg:18},_=[`done`,`active`,`pending`,`error`];function v(t){let{marker:v,props:y}=n(`AppStepper`,t),{steps:b=[],variant:x=`steps`,orientation:S=`horizontal`,iconVariant:C,size:w=`md`,iconSize:T,active:E,onStepClick:D,label:O=`Progress`,stepLabel:k=`Step {number}`,tone:A=`primary`,linkComponent:j,className:M=``,...N}=y;a(`AppStepper`,N),i(`AppStepper`,`variant`,x,d),i(`AppStepper`,`orientation`,S,f),i(`AppStepper`,`iconVariant`,C,p),i(`AppStepper`,`size`,w,m),i(`AppStepper`,`tone`,A,h);let P=T>0?T:g[w]??g.md;for(let e of b)i(`AppStepper`,`steps[].status`,e.status,_);let F=x===`journey`,I=[`stepper`,F&&`stepper-journey`,S===`vertical`&&`stepper-vertical`,w!==`md`&&m.includes(w)&&`wui-step-size-${w}`,A!==`primary`&&h.includes(A)&&`wui-step-tone-${A}`,M].filter(Boolean).join(` `),L=s(b,{statusOf:e=>b[e].status||o(e,E),journey:F,connectors:!0});return/* @__PURE__ */ l(`nav`,{className:I,"aria-label":O,...v,...N,children:L.map(t=>{let n=t.index,i=b[n],a=t.className,o=t.glyph.number;t.glyph.icon&&(o=/* @__PURE__ */ l(r,{name:t.glyph.icon,size:P,variant:C}));let s=/* @__PURE__ */ u(c,{children:[/* @__PURE__ */ l(`span`,{className:`step-circle`,children:o}),F?/* @__PURE__ */ u(`span`,{className:`step-text`,children:[/* @__PURE__ */ l(`span`,{className:`step-index`,children:e(k,{number:n+1})}),/* @__PURE__ */ l(`span`,{className:`step-label`,children:i.label}),i.description?/* @__PURE__ */ l(`span`,{className:`step-desc`,children:i.description}):null]}):/* @__PURE__ */ u(c,{children:[/* @__PURE__ */ l(`span`,{className:`step-label`,children:i.label}),i.description?/* @__PURE__ */ l(`span`,{className:`step-desc`,children:i.description}):null]})]}),d=t.current?`step`:void 0,f=i.key??`${i.label}-${n}`,p;return p=D?/* @__PURE__ */ l(`button`,{type:`button`,className:a,"aria-current":d,onClick:()=>D(i,n),children:s},f):i.href?j?/* @__PURE__ */ l(j,{className:a,to:i.href,"aria-current":d,children:s},f):/* @__PURE__ */ l(`a`,{className:a,href:i.href,"aria-current":d,children:s},f):/* @__PURE__ */ l(`div`,{className:a,"aria-current":d,children:s},f),t.line?[p,/* @__PURE__ */ l(`span`,{className:`step-line${t.line.done?` done`:``}`,"aria-hidden":`true`},`${f}-line`)]:p})})}export{v 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=[`round`,`pill`,`circle`],l=o(function(o,l){let{marker:u,props:d}=r(`AppSwitch`,o),{label:f,id:p,name:m,error:h,helperText:g,help:_,helpLabel:v=`More information`,shape:y=`round`,className:b=``,checked:x,defaultChecked:S,onChange:C,readOnly:w=!1,loading:T=!1,size:E=`md`,...D}=d;a(`AppSwitch`,D),i(`AppSwitch`,`shape`,y,c),i(`AppSwitch`,`size`,E,t);let O=`form-check form-switch${y===`circle`?` form-switch-circle`:y===`pill`?` form-switch-pill`:``}`,k={...D};return x!==void 0&&(k.checked=x),S!==void 0&&(k.defaultChecked=S),C!==void 0&&(k.onChange=C),x!==void 0&&C===void 0&&(k.readOnly=!0),/* @__PURE__ */ s(e,{rootProps:u,ref:l,label:n(f,_,v),id:p,name:m,error:h,hint:g,className:b,rest:k,inputType:`checkbox`,wrapperClass:O,readOnly:w,loading:T,size:E})});export{l as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{pageWindow as
|
|
1
|
+
import e from"../lib/fillLabel.js";import{pageWindow as t}from"../lib/pageWindow.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./AppIcon.js";import i from"./AppSelect.js";import a from"./warnInvalidValue.js";import o from"./warnUnknownProps.js";import{jsx as s,jsxs as c}from"react/jsx-runtime";var l=[`numbered`,`prev-next`],u=[`sm`,`md`],d=[`footer`,`standalone`],f=[5,10,25,50];function p(e,t,n){return`Showing ${Math.min((e-1)*t+1,n)} to ${Math.min(e*t,n)} of ${n}`}function m(m){let{marker:h,props:g}=n(`AppTablePagination`,m),{page:_,totalPages:v,total:y,pageSize:b,onPageChange:x,onPageSizeChange:S,pageSizes:C=f,mode:w=`numbered`,showPageSize:T=!0,siblings:E=2,summary:D=!1,size:O=`md`,variant:k=`footer`,ariaLabel:A=`Pagination`,rowsPerPageLabel:j=`Rows per page`,pageSizeLabel:M=`{count} per page`,previousLabel:N=`Previous page`,nextLabel:P=`Next page`,pageLabel:F=`Page {page}`,rangeText:I=`Page {page} of {pages}`,className:L=``,...R}=g;o(`AppTablePagination`,R),a(`AppTablePagination`,`mode`,w,l),a(`AppTablePagination`,`size`,O,u),a(`AppTablePagination`,`variant`,k,d);let z=Number(b)||0,B=Number(y)||0,V=v===void 0?B<=0:v<=0,H=Math.max(1,v??Math.ceil(B/(z>0?z:10))),U=Math.min(Math.max(1,Number(_)||1),H),W=z>0&&!!S&&T!==!1,G=D===!0&&B>0&&z>0;if(V||H<=1&&!W)return null;let K=z>0&&!C.includes(z)?[...C,z].sort((e,t)=>e-t):C,q=w===`numbered`,J=q?t(U,H,{siblingCount:E}):null,Y=[`table-pagination`,k===`standalone`&&`wui-table-pagination-standalone`,O===`sm`&&`wui-table-pagination-sm`,L].filter(Boolean).join(` `);return/* @__PURE__ */ c(`nav`,{className:Y,"aria-label":A,...h,...R,children:[G&&/* @__PURE__ */ s(`span`,{className:`wui-pager-summary`,children:p(U,z,B)}),W&&/* @__PURE__ */ s(`span`,{className:`tpg-rows`,children:/* @__PURE__ */ s(i,{compact:!0,"aria-label":j,value:String(z),onChange:e=>S(Number(e)),options:K.map(t=>({value:String(t),label:e(M,{count:t})}))})}),!q&&/* @__PURE__ */ s(`span`,{className:`tpg-range`,children:e(I,{page:U,pages:H})}),/* @__PURE__ */ c(`div`,{className:`tpg-nav`,children:[/* @__PURE__ */ s(`button`,{type:`button`,className:`tpg-arrow`,onClick:()=>x?.(Math.max(1,U-1)),disabled:U<=1,"aria-label":N,children:/* @__PURE__ */ s(r,{name:`arrow-left`,size:18})}),q&&J.map(t=>typeof t==`number`?/* @__PURE__ */ s(`button`,{type:`button`,className:`tpg-page${t===U?` is-active`:``}`,onClick:()=>x?.(t),"aria-current":t===U?`page`:void 0,"aria-label":e(F,{page:t}),children:t},t):/* @__PURE__ */ s(`span`,{className:`tpg-ellipsis`,"aria-hidden":`true`,children:`…`},t)),/* @__PURE__ */ s(`button`,{type:`button`,className:`tpg-arrow`,onClick:()=>x?.(Math.min(H,U+1)),disabled:U>=H,"aria-label":P,children:/* @__PURE__ */ s(r,{name:`arrow-right`,size:18})})]})]})}export{m as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{splitMarkerProps as
|
|
1
|
+
import e from"../lib/fillLabel.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./AppButton.js";import r from"./warnUnknownProps.js";import{formatNumber as i}from"@webority/ui-elements/helpers";import{jsx as a,jsxs as o}from"react/jsx-runtime";function s(s){let{marker:c,props:l}=t(`AppTableToolbar`,s),{filters:u,actions:d,selectedCount:f=0,bulkActions:p,onClearSelection:m,totalCount:h,pageCount:g,onSelectAllMatching:_,allMatchingSelected:v=!1,selectAllMatchingLabel:y=`Select all {count} matching`,selectedLabel:b=`{count} selected`,allSelectedLabel:x=`All {count} selected`,clearLabel:S=`Clear`,clearSelectionLabel:C=`Clear selection`,className:w=``,...T}=l;r(`AppTableToolbar`,T);let E=f>0,D=typeof _==`function`&&typeof h==`number`,O=D&&v,k=e=>i(e,{decimals:0}),A=D&&!O&&E&&f>=(g??1)&&h>(g??f);return/* @__PURE__ */ o(`div`,{className:`wui-table-toolbar${w?` ${w}`:``}`,...c,...T,children:[/* @__PURE__ */ o(`div`,{className:`wui-table-toolbar-main`,hidden:E,children:[/* @__PURE__ */ a(`div`,{className:`wui-table-toolbar-filters`,children:u}),/* @__PURE__ */ a(`div`,{className:`wui-table-toolbar-actions`,children:d})]}),/* @__PURE__ */ o(`div`,{className:`wui-table-toolbar-bulk`,hidden:!E,children:[/* @__PURE__ */ a(`span`,{className:`wui-table-toolbar-count`,"aria-live":`polite`,children:e(O?x:b,{count:k(O?h:f)})}),D&&/* @__PURE__ */ a(`button`,{type:`button`,className:`btn btn-link btn-sm wui-table-toolbar-all`,hidden:!A,onClick:_,children:e(y,{count:k(h)})}),p,m&&/* @__PURE__ */ a(n,{variant:`ghost`,size:`sm`,className:`wui-table-toolbar-clear`,onClick:m,children:O?C:S})]})]})}export{s as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{TONES as e}from"../lib/vocabulary.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./AppIcon.js";import r from"./AppTooltip.js";import i from"./renderIconProp.js";import a from"./warnInvalidValue.js";import o from"./warnUnknownProps.js";import{formatNumber as s}from"@webority/ui-elements/helpers";import{cloneElement as c,useCallback as l,useEffect as u,useLayoutEffect as d,useRef as f,useState as p}from"react";import{Fragment as m,jsx as h,jsxs as g}from"react/jsx-runtime";import"@webority/ui-elements/elements/overflow";var _=[`underline`,`pills`],v=[`horizontal`,`vertical`],ee=[`sm`,`md`,`lg`],te=[`automatic`,`manual`],ne=[`scroll`,`menu`],y=e.filter(e=>e!==`primary`&&e!==`neutral`),b=1,x=28,re=.7;function S(e){let{marker:S,props:C}=t(`AppTabs`,e),{tabs:w,value:T,onChange:E,linkComponent:D,variant:O=`underline`,orientation:k=`horizontal`,size:A=`md`,fitted:j=!1,overflow:M=`scroll`,moreLabel:ie=`More`,maxVisible:ae,activation:N=`automatic`,ariaLabel:oe,className:P=``,style:F,...I}=C;o(`AppTabs`,I),a(`AppTabs`,`variant`,O,_),a(`AppTabs`,`orientation`,k,v),a(`AppTabs`,`size`,A,ee),a(`AppTabs`,`activation`,N,te),a(`AppTabs`,`overflow`,M,ne);for(let e of w)a(`AppTabs`,`tabs[].tone`,e.tone,y);let L=f(null),R=f(null),z=k===`vertical`,B=(M===`menu`||ae!=null)&&!z,[V,H]=p(T);u(()=>{H(T)},[T]);let U=w.find(e=>!e.disabled)?.key,W=w.some(e=>e.key===V&&!e.disabled)?V:void 0,G=w.some(e=>e.key===T&&!e.disabled)?T:void 0,K=W??G??U,se=e=>{L.current?.querySelector(`[data-key="${CSS.escape(String(e))}"]`)?.focus()},q=l(()=>{let e=L.current,t=R.current;if(!e||!t||z||B)return;let n=e.scrollWidth-e.clientWidth;t.classList.toggle(`is-overflow-start`,e.scrollLeft>b),t.classList.toggle(`is-overflow-end`,n>b&&e.scrollLeft<n-b)},[z,B]),J=l(()=>{let e=L.current;if(!e)return;let t=e.querySelector(`.app-tab.active`);t?(z?(e.style.setProperty(`--wui-tab-y`,`${t.offsetTop}px`),e.style.setProperty(`--wui-tab-h`,`${t.offsetHeight}px`)):(e.style.setProperty(`--wui-tab-x`,`${t.offsetLeft}px`),e.style.setProperty(`--wui-tab-w`,`${t.offsetWidth}px`)),e.toggleAttribute(`data-active-danger`,!!w.find(e=>e.key===T)?.danger)):e.style.setProperty(z?`--wui-tab-h`:`--wui-tab-w`,`0px`),e.setAttribute(`data-wui-tabs`,``),q()},[z,w,T,q]),Y=e=>!B||!L.current?.querySelector(`[data-key="${CSS.escape(String(e))}"][data-wui-overflow-hidden]`),X=l(()=>{let e=L.current;if(!e||z)return;let t=e.querySelector(`.app-tab.active`);if(!t)return;let n=x,r=t.offsetLeft,i=r+t.offsetWidth;r-n<e.scrollLeft?e.scrollLeft=Math.max(0,r-n):i+n>e.scrollLeft+e.clientWidth&&(e.scrollLeft=i+n-e.clientWidth)},[z]);d(()=>{J()},[J]),d(()=>{X()},[T,X]);let Z=f(J);u(()=>{Z.current=J},[J]),u(()=>{if(!document.fonts)return;let e=!0;return document.fonts.ready.then(()=>{e&&Z.current()}),()=>{e=!1}},[]),u(()=>{if(typeof ResizeObserver>`u`)return;let e=new ResizeObserver(()=>Z.current());return L.current&&e.observe(L.current),R.current&&e.observe(R.current),()=>e.disconnect()},[z,B]),u(()=>{let e=R.current;if(!B||!e)return;let t=()=>Z.current();return e.addEventListener(`wui-overflow-change`,t),()=>e.removeEventListener(`wui-overflow-change`,t)},[B]);function ce(e){let t=e.target?.dataset?.key;if(t==null)return;let n=w.findIndex(e=>e.key===t);if(n<0)return;let r=w.length,i=(e,t)=>{for(let n=1;n<=r;n++){let i=w[((e+t*n)%r+r)%r];if(!i.disabled&&Y(i.key))return i}return null},a=z?`ArrowDown`:`ArrowRight`,o=z?`ArrowUp`:`ArrowLeft`,s=null;if(e.key===a?s=i(n,1):e.key===o?s=i(n,-1):e.key===`Home`?s=w.find(e=>!e.disabled&&Y(e.key))??null:e.key===`End`&&(s=[...w].reverse().find(e=>!e.disabled&&Y(e.key))??null),!s)return;e.preventDefault(),H(s.key),se(s.key);let c=s.href!=null||s.to!=null;N===`automatic`&&!c&&E?.(s.key)}let Q=e=>{let t=L.current;t&&t.scrollBy({left:e*t.clientWidth*re})},le=[`app-tabs`,O===`pills`?`app-tabs-pills`:``,z?`app-tabs-vertical`:``,A===`sm`?`app-tabs-sm`:``,A===`lg`?`app-tabs-lg`:``,j?`app-tabs-fitted`:``,P].filter(Boolean).join(` `),$=/* @__PURE__ */ g(`div`,{ref:L,role:`tablist`,"aria-orientation":z?`vertical`:void 0,"aria-label":oe,className:le,style:F,"data-wui-overflow-list":B?``:void 0,...I,onKeyDown:ce,onScroll:q,children:[w.map(e=>{let t=e.key===T,n=e.href!=null||e.to!=null,a={role:`tab`,"data-key":e.key,"aria-selected":t,tabIndex:e.key===K?0:-1,className:`app-tab${t?` active`:``}${e.danger?` danger`:``}${n&&e.disabled?` disabled`:``}`},o=/* @__PURE__ */ g(m,{children:[e.image?/* @__PURE__ */ h(`img`,{className:`app-tab-img`,src:e.image,alt:e.imageAlt??``}):i(e.icon,{size:16,className:`app-tab-icon`}),/* @__PURE__ */ h(`span`,{className:`wui-tab-label`,children:e.label}),(e.countLabel||e.count!=null)&&/* @__PURE__ */ h(`span`,{className:`app-tab-count${e.tone?` ${e.tone}`:``}`,children:e.countLabel||s(e.count,{decimals:0})})]}),c;if(n){let t=e.to!=null&&D?D:`a`,n=e.rel??(e.target===`_blank`?`noopener noreferrer`:void 0),r=e.disabled?{"aria-disabled":!0}:t===`a`?{href:e.href??e.to,target:e.target,rel:n}:{to:e.to,target:e.target,rel:n},i=t=>{e.disabled?t.preventDefault():t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||(H(e.key),E?.(e.key))};c=/* @__PURE__ */ h(t,{...a,...r,onClick:i,children:o},e.key)}else c=/* @__PURE__ */ h(`button`,{type:`button`,...a,disabled:e.disabled,onClick:()=>{e.disabled||(H(e.key),E?.(e.key))},children:o},e.key);return e.tooltip?/* @__PURE__ */ h(r,{content:e.tooltip,children:c},e.key):c}),/* @__PURE__ */ h(`span`,{className:`app-tab-indicator`,"aria-hidden":`true`,"data-wui-overflow-skip":``})]});return z?c($,S):B?/* @__PURE__ */ h(`wui-overflow`,{...S,ref:R,class:`app-tabs-wrap`,label:ie,children:$}):/* @__PURE__ */ g(`div`,{...S,ref:R,className:`app-tabs-wrap`,children:[/* @__PURE__ */ h(`button`,{type:`button`,className:`app-tabs-scroll-btn prev`,"aria-label":`Scroll tabs backward`,tabIndex:-1,onClick:()=>Q(-1),children:/* @__PURE__ */ h(n,{name:`chevron-left`,size:16})}),$,/* @__PURE__ */ h(`button`,{type:`button`,className:`app-tabs-scroll-btn next`,"aria-label":`Scroll tabs forward`,tabIndex:-1,onClick:()=>Q(1),children:/* @__PURE__ */ h(n,{name:`chevron-right`,size:16})})]})}export{S as default};
|