@webority/ui-react 0.83.6 → 0.85.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/AppAccordion.js +1 -1
- package/dist/components/AppActionIcon.js +1 -1
- package/dist/components/AppAlert.js +1 -1
- package/dist/components/AppAsyncBlock.js +1 -1
- package/dist/components/AppAutocomplete.js +1 -1
- package/dist/components/AppAvatar.js +1 -1
- package/dist/components/AppAvatarGroup.js +1 -1
- package/dist/components/AppAvatarPicker.js +1 -1
- package/dist/components/AppBadge.js +1 -1
- package/dist/components/AppBanner.js +1 -1
- package/dist/components/AppBreadcrumbs.js +1 -1
- package/dist/components/AppButton.js +1 -1
- package/dist/components/AppButtonGroup.js +1 -1
- package/dist/components/AppCalendar.js +1 -1
- package/dist/components/AppCard.js +1 -1
- package/dist/components/AppCarousel.js +1 -1
- 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/AppChipGroup.js +1 -1
- package/dist/components/AppChoiceCard.js +1 -1
- package/dist/components/AppChoiceChip.js +1 -1
- package/dist/components/AppCodeBlock.js +1 -1
- package/dist/components/AppColorField.js +1 -1
- package/dist/components/AppColumnMenu.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/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/AppDashboardCell.js +1 -1
- package/dist/components/AppDashboardGrid.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/AppErrorSummary.js +1 -1
- package/dist/components/AppFileAttachment.js +1 -1
- package/dist/components/AppFilePicker.js +1 -1
- package/dist/components/AppFileViewer.js +1 -1
- package/dist/components/AppFilterBar.js +1 -1
- package/dist/components/AppFloatingDock.js +1 -1
- package/dist/components/AppFormActions.js +1 -1
- package/dist/components/AppFormRow.js +1 -1
- package/dist/components/AppFormSection.js +1 -1
- package/dist/components/AppHoverCard.js +1 -1
- package/dist/components/AppIcon.js +1 -1
- package/dist/components/AppInfoList.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/AppInputGroup.js +1 -1
- package/dist/components/AppKanban.js +1 -1
- package/dist/components/AppKbd.js +1 -1
- package/dist/components/AppKpiTile.js +1 -1
- package/dist/components/AppLightbox.js +1 -1
- package/dist/components/AppLink.js +1 -1
- package/dist/components/AppLogoPicker.js +1 -1
- package/dist/components/AppMarkdown.js +1 -1
- package/dist/components/AppMentionInput.js +1 -1
- package/dist/components/AppMenubar.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/AppNavigationMenu.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/AppPagination.js +1 -1
- package/dist/components/AppPhoneNumberInput.js +1 -1
- package/dist/components/AppPricingCard.js +1 -1
- package/dist/components/AppProgress.js +1 -1
- package/dist/components/AppQrCode.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/AppRecordPager.js +1 -1
- package/dist/components/AppRelativeTime.js +1 -1
- package/dist/components/AppRepeater.js +1 -1
- package/dist/components/AppRequiredMark.js +1 -1
- package/dist/components/AppResizable.js +1 -1
- package/dist/components/AppResizableHandle.js +1 -1
- package/dist/components/AppResizablePanel.js +1 -1
- package/dist/components/AppResourceCard.js +1 -1
- package/dist/components/AppResult.js +1 -1
- package/dist/components/AppRichText.js +1 -1
- package/dist/components/AppRollingNumber.js +1 -1
- package/dist/components/AppRouteError.js +1 -1
- package/dist/components/AppScoreScale.js +1 -1
- package/dist/components/AppScrollbar.js +1 -1
- package/dist/components/AppSearch.js +1 -1
- package/dist/components/AppSectionCallToAction.js +1 -1
- package/dist/components/AppSectionFaq.js +1 -1
- package/dist/components/AppSectionFeatures.js +1 -1
- package/dist/components/AppSectionHero.js +1 -1
- package/dist/components/AppSectionLogos.js +1 -1
- package/dist/components/AppSectionPricing.js +1 -1
- package/dist/components/AppSectionTestimonials.js +1 -1
- package/dist/components/AppSegmented.js +1 -1
- package/dist/components/AppSelect.js +1 -1
- package/dist/components/AppSelectMini.js +1 -1
- package/dist/components/AppShell.js +1 -1
- package/dist/components/AppShortcutLegend.js +1 -1
- package/dist/components/AppShowMore.js +1 -1
- package/dist/components/AppSidebarMenu.js +1 -1
- package/dist/components/AppSkeleton.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/AppSpinner.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/AppTableEmptyState.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/AppThemeToggle.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/AppTour.js +1 -1
- package/dist/components/AppTreeView.js +1 -1
- package/dist/components/AppTruncate.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/lib/CheckField.js +1 -1
- package/dist/lib/wuiMarker.js +1 -0
- package/dist/types/components/AppAccordion.d.ts +1 -1
- package/dist/types/components/AppActionIcon.d.ts +1 -1
- package/dist/types/components/AppAlert.d.ts +1 -1
- package/dist/types/components/AppAsyncBlock.d.ts +1 -1
- package/dist/types/components/AppAvatar.d.ts +1 -1
- package/dist/types/components/AppAvatarGroup.d.ts +1 -8
- package/dist/types/components/AppAvatarPicker.d.ts +1 -1
- package/dist/types/components/AppBadge.d.ts +1 -1
- package/dist/types/components/AppBanner.d.ts +1 -1
- package/dist/types/components/AppBreadcrumbs.d.ts +1 -1
- package/dist/types/components/AppButton.d.ts +1 -1
- package/dist/types/components/AppButtonGroup.d.ts +1 -1
- package/dist/types/components/AppCard.d.ts +1 -1
- package/dist/types/components/AppCarousel.d.ts +1 -1
- package/dist/types/components/AppChartCard.d.ts +1 -1
- package/dist/types/components/AppChip.d.ts +1 -1
- package/dist/types/components/AppChipGroup.d.ts +1 -1
- package/dist/types/components/AppChoiceCard.d.ts +1 -4
- package/dist/types/components/AppChoiceChip.d.ts +1 -1
- package/dist/types/components/AppCodeBlock.d.ts +1 -1
- package/dist/types/components/AppColorField.d.ts +1 -1
- package/dist/types/components/AppColumnMenu.d.ts +1 -1
- package/dist/types/components/AppCommandPalette.d.ts +1 -1
- package/dist/types/components/AppCommentThread.d.ts +1 -1
- package/dist/types/components/AppCompareTable.d.ts +1 -1
- package/dist/types/components/AppConfirmDialog.d.ts +1 -20
- package/dist/types/components/AppConsentBanner.d.ts +1 -1
- package/dist/types/components/AppContextMenu.d.ts +1 -1
- package/dist/types/components/AppCopyButton.d.ts +1 -1
- package/dist/types/components/AppDashboardCell.d.ts +1 -1
- package/dist/types/components/AppDashboardGrid.d.ts +1 -1
- package/dist/types/components/AppDataTable.d.ts +1 -1
- package/dist/types/components/AppDescriptions.d.ts +1 -1
- package/dist/types/components/AppDrawer.d.ts +1 -1
- package/dist/types/components/AppDropZone.d.ts +1 -1
- package/dist/types/components/AppDropdown.d.ts +1 -1
- package/dist/types/components/AppDueDate.d.ts +1 -1
- package/dist/types/components/AppEmptyState.d.ts +1 -1
- package/dist/types/components/AppErrorSummary.d.ts +1 -1
- package/dist/types/components/AppFileAttachment.d.ts +1 -3
- package/dist/types/components/AppFilePicker.d.ts +1 -1
- package/dist/types/components/AppFilterBar.d.ts +1 -1
- package/dist/types/components/AppFloatingDock.d.ts +1 -1
- package/dist/types/components/AppFormActions.d.ts +1 -1
- package/dist/types/components/AppFormRow.d.ts +1 -1
- package/dist/types/components/AppFormSection.d.ts +1 -1
- package/dist/types/components/AppHoverCard.d.ts +1 -1
- package/dist/types/components/AppIcon.d.ts +1 -1
- package/dist/types/components/AppInfoList.d.ts +1 -1
- package/dist/types/components/AppInfoTip.d.ts +1 -8
- package/dist/types/components/AppInlineEdit.d.ts +1 -1
- package/dist/types/components/AppInputGroup.d.ts +1 -1
- package/dist/types/components/AppKanban.d.ts +1 -1
- package/dist/types/components/AppKbd.d.ts +1 -1
- package/dist/types/components/AppKpiTile.d.ts +1 -1
- package/dist/types/components/AppLightbox.d.ts +1 -1
- package/dist/types/components/AppLink.d.ts +1 -15
- package/dist/types/components/AppLogoPicker.d.ts +1 -33
- package/dist/types/components/AppMarkdown.d.ts +1 -1
- package/dist/types/components/AppMenubar.d.ts +1 -1
- package/dist/types/components/AppMeter.d.ts +1 -1
- package/dist/types/components/AppMetricStrip.d.ts +1 -1
- package/dist/types/components/AppModal.d.ts +1 -1
- package/dist/types/components/AppNavigationMenu.d.ts +1 -1
- package/dist/types/components/AppNotificationCenter.d.ts +1 -1
- package/dist/types/components/AppOnboardingChecklist.d.ts +1 -1
- package/dist/types/components/AppPageHeader.d.ts +1 -1
- package/dist/types/components/AppPagination.d.ts +1 -1
- package/dist/types/components/AppPricingCard.d.ts +1 -1
- package/dist/types/components/AppProgress.d.ts +1 -1
- package/dist/types/components/AppQrCode.d.ts +1 -1
- package/dist/types/components/AppRadioGroup.d.ts +1 -1
- package/dist/types/components/AppRating.d.ts +1 -1
- package/dist/types/components/AppRecordPager.d.ts +1 -1
- package/dist/types/components/AppRelativeTime.d.ts +1 -1
- package/dist/types/components/AppRepeater.d.ts +1 -1
- package/dist/types/components/AppRequiredMark.d.ts +1 -1
- package/dist/types/components/AppResizable.d.ts +1 -1
- package/dist/types/components/AppResizableHandle.d.ts +1 -1
- package/dist/types/components/AppResizablePanel.d.ts +1 -1
- package/dist/types/components/AppResourceCard.d.ts +1 -1
- package/dist/types/components/AppResult.d.ts +1 -1
- package/dist/types/components/AppRollingNumber.d.ts +1 -1
- package/dist/types/components/AppRouteError.d.ts +1 -1
- package/dist/types/components/AppScoreScale.d.ts +1 -1
- package/dist/types/components/AppScrollbar.d.ts +1 -1
- package/dist/types/components/AppSearch.d.ts +1 -2
- package/dist/types/components/AppSectionCallToAction.d.ts +1 -1
- package/dist/types/components/AppSectionFaq.d.ts +1 -1
- package/dist/types/components/AppSectionFeatures.d.ts +1 -1
- package/dist/types/components/AppSectionHero.d.ts +1 -1
- package/dist/types/components/AppSectionLogos.d.ts +1 -1
- package/dist/types/components/AppSectionPricing.d.ts +1 -1
- package/dist/types/components/AppSectionTestimonials.d.ts +1 -1
- package/dist/types/components/AppSegmented.d.ts +1 -1
- package/dist/types/components/AppSelectMini.d.ts +1 -15
- package/dist/types/components/AppShell.d.ts +10 -1
- package/dist/types/components/AppShortcutLegend.d.ts +1 -1
- package/dist/types/components/AppShowMore.d.ts +1 -1
- package/dist/types/components/AppSidebarMenu.d.ts +1 -22
- package/dist/types/components/AppSkeleton.d.ts +1 -1
- package/dist/types/components/AppSparkline.d.ts +1 -1
- package/dist/types/components/AppSpinner.d.ts +1 -1
- package/dist/types/components/AppSplash.d.ts +1 -1
- package/dist/types/components/AppSplitButton.d.ts +1 -1
- package/dist/types/components/AppSplitView.d.ts +1 -1
- package/dist/types/components/AppStatusBadge.d.ts +1 -1
- package/dist/types/components/AppStepper.d.ts +1 -1
- package/dist/types/components/AppTableEmptyState.d.ts +1 -1
- package/dist/types/components/AppTablePagination.d.ts +1 -1
- package/dist/types/components/AppTableToolbar.d.ts +1 -1
- package/dist/types/components/AppTabs.d.ts +1 -1
- package/dist/types/components/AppThemeToggle.d.ts +1 -1
- package/dist/types/components/AppTimeline.d.ts +1 -1
- package/dist/types/components/AppToast.d.ts +1 -1
- package/dist/types/components/AppToolbar.d.ts +1 -1
- package/dist/types/components/AppTruncate.d.ts +1 -1
- package/dist/types/components/AppUpdateBar.d.ts +1 -1
- package/dist/types/components/AppWhatsNew.d.ts +1 -1
- package/dist/types/components/AppWorkspaceSwitcher.d.ts +1 -1
- package/dist/types/lib/wuiMarker.d.ts +26 -0
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./warnUnknownProps.js";import
|
|
1
|
+
import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnUnknownProps.js";import n from"./AppIcon.js";import{useId as r,useState as i}from"react";import{jsx as a,jsxs as o}from"react/jsx-runtime";function s(s){let{items:c=[],multiple:l=!1,id:u,className:d=``,...f}=s;t(`AppAccordion`,f);let p=r(),m=u||p,[h,g]=i(()=>{let e=c.map((e,t)=>({item:e,key:e.key??String(t)})).filter(({item:e})=>e.open).map(({key:e})=>e);return new Set(l?e:e.slice(0,1))}),_=(e,t)=>e.key??String(t),v=e=>{g(t=>{let n=new Set(l?t:[]);return t.has(e)?n.delete(e):n.add(e),n})};return a(`div`,{className:`faq-list${d?` ${d}`:``}`,...e(`AppAccordion`,s),...f,children:c.map((e,t)=>{let r=_(e,t),i=h.has(r),s=`${m}-${t}`,c=`${s}-q`;return o(`div`,{className:`faq-item${i?` open`:``}`,children:[o(`button`,{type:`button`,className:`faq-q`,id:c,"aria-expanded":i,"aria-controls":s,onClick:()=>v(r),children:[e.title,a(`span`,{className:`faq-q-icon`,children:a(n,{name:`chevron-down`,size:18})})]}),a(`section`,{className:`faq-a-wrap`,id:s,"aria-labelledby":c,inert:!i,"aria-hidden":!i||void 0,children:a(`div`,{className:`faq-a-inner`,children:e.content})})]},r)})})}export{s as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import{devWarn as t}from"../lib/devWarn.js";import n from"./warnInvalidValue.js";import r from"./warnUnknownProps.js";import{shortcutAria as i}from"../lib/shortcutChip.js";import a from"./withTooltip.js";import o from"./renderIconProp.js";import{useRef as s}from"react";import{Fragment as c,jsx as l,jsxs as u}from"react/jsx-runtime";var d=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`];function f(f){let{icon:p,iconVariant:m,label:h,tooltipPlacement:g=`auto`,shortcut:_,danger:v=!1,disabled:y=!1,size:b=20,onClick:x,className:S=``,as:C,href:w,accept:T,multiple:E=!1,onFiles:D,...O}=f;r(`AppActionIcon`,C===void 0?O:{...O,as:C}),n(`AppActionIcon`,`iconVariant`,m,d);let k=typeof D==`function`;k&&(C!==void 0||w!==void 0)&&t(`AppActionIcon: file mode renders a button; href and as are ignored.`),!k&&(T!==void 0||E)&&t(`AppActionIcon: accept and multiple apply only in file mode (pass onFiles).`);let A=s(null),j=e=>{let t=[...e.target.files];e.target.value=``,t.length>0&&D(t)},M=[`u-action`,v?`danger`:``,S].filter(Boolean).join(` `),{style:N,...P}=O,F={"--wui-action-size":`${b+16}px`,...N},I=k?`button`:C??(w?`a`:`button`),L=I===`button`,R=a(l(I,{type:L?`button`:void 0,href:L||y?void 0:w,className:M,style:F,"aria-label":h,"aria-keyshortcuts":i(_),disabled:L?y:void 0,"aria-disabled":!L&&y?`true`:void 0,role:!L&&y?`link`:void 0,tabIndex:!L&&y?-1:void 0,onClick:e=>{if(y){e.preventDefault(),e.stopPropagation();return}x?.(e),k&&!e.defaultPrevented&&A.current?.click()},...e(`AppActionIcon`,f),...P,children:o(p,{size:b,variant:m})}),h,g,_);return k?u(c,{children:[R,l(`input`,{type:`file`,ref:A,className:`wui-action-icon-file`,hidden:!0,tabIndex:-1,"aria-hidden":`true`,accept:T,multiple:E,onChange:j,onClick:e=>e.stopPropagation()})]}):R}export{f as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./warnInvalidValue.js";import
|
|
1
|
+
import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"./AppIcon.js";import{Alert as i}from"react-bootstrap";import{Fragment as a,jsx as o,jsxs as s}from"react/jsx-runtime";var c={info:`info`,success:`check`,warning:`alert-triangle`,danger:`x`},l=[`info`,`success`,`warning`,`danger`],u=[`sm`,`md`,`lg`],d=[`alert`,`status`,`none`],f=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`];function p(e,t,n,i,a,s){return i?o(`span`,{className:`alert-icon alert-icon-image`,style:s>0?{width:s,height:s}:void 0,children:o(`img`,{src:i,alt:a})}):e?typeof e==`string`?o(`span`,{className:`alert-icon`,children:o(r,{name:e,size:t,variant:n})}):o(`span`,{className:`alert-icon`,children:e}):null}function m(r){let{variant:m=`info`,children:h,title:g,icon:_,iconVariant:v,iconSize:y,image:b,imageAlt:x=``,imageSize:S,className:C=``,onClose:w,dismissible:T,bordered:E=!0,accent:D=!1,size:O=`md`,action:k,role:A=`alert`,...j}=r;n(`AppAlert`,j),t(`AppAlert`,`variant`,m,l),t(`AppAlert`,`size`,O,u),t(`AppAlert`,`role`,A,d),t(`AppAlert`,`iconVariant`,v,f);let M=_===void 0?c[m]:_===`none`?null:_,N=!!b||!!M,P=k!=null&&k!==!1,F=g?o(`div`,{className:`alert-heading`,children:g}):null,I=N&&!!F&&!!h,L=y>0?y:O===`lg`?I?17:15:I?13:11;return o(i,{variant:m,className:[N?`alert-has-icon`:``,P?`alert-has-action`:``,I?`alert-stack`:``,E?``:`alert-borderless`,D?`alert-accent`:``,O===`sm`?`alert-sm`:``,O===`lg`?`alert-lg`:``,C].filter(Boolean).join(` `)||void 0,onClose:w,dismissible:T??typeof w==`function`,transition:!1,role:A===`none`?void 0:A,...e(`AppAlert`,r),...j,children:N||P?s(a,{children:[N&&p(M,L,v,b,x,S),s(`div`,{className:`alert-content`,children:[F,h]}),P&&o(`div`,{className:`alert-action`,children:k})]}):s(a,{children:[F,h]})})}export{m as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./warnUnknownProps.js";import
|
|
1
|
+
import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnUnknownProps.js";import n from"./AppButton.js";import r from"./AppEmptyState.js";import i from"./AppProgress.js";import{jsx as a}from"react/jsx-runtime";function o(o){let{loading:s=!1,error:c=null,empty:l=!1,children:u,onRetry:d,skeleton:f,className:p=``,...m}=o;t(`AppAsyncBlock`,m);let h=`async-block${p?` ${p}`:``}`;return s?a(`div`,{className:h,"data-state":`loading`,...e(`AppAsyncBlock`,o),...m,children:f??a(i,{value:0,indeterminate:!0,size:`sm`,label:`Loading`})}):c?a(`div`,{className:h,"data-state":`error`,...e(`AppAsyncBlock`,o),...m,children:a(r,{icon:`alert-circle`,title:`Something went wrong`,text:c,action:d?a(n,{variant:`secondary`,onClick:d,children:`Retry`}):null})}):l?a(`div`,{className:h,"data-state":`empty`,...e(`AppAsyncBlock`,o),...m,children:a(r,{icon:`inbox`,title:`Nothing to show yet`})}):a(`div`,{className:h,"data-state":`content`,...e(`AppAsyncBlock`,o),...m,children:u})}export{o as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./warnInvalidValue.js";import
|
|
1
|
+
import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"../lib/FieldMessage.js";import i from"./AppInfoTip.js";import a from"./AppRequiredMark.js";import o from"./useNodeLabels.js";import s,{optionsEqual as c}from"./useWuiControl.js";import{forwardRef as l,useEffect as u,useId as d,useRef as f}from"react";import{jsx as p,jsxs as m}from"react/jsx-runtime";import"@webority/ui-elements/elements/autocomplete";var h=[`sm`,`lg`],g=[],_=(e,t)=>({...e,label:t}),v=(e,t,n)=>{if(n==null||t==null||t===``)return e;let r=String(t);return e.some(e=>String(e.value)===r)?e:[...e,{value:r,label:n}]},y=l(function(l,y){let{value:b,onChange:x,options:S,valueLabel:C,loadOptions:w,placeholder:T=`Search…`,minChars:E,debounce:D,disabled:O=!1,size:k,allowCustom:A=!1,name:j,id:M,label:N,error:P,hint:F,required:I=!1,help:L,helpLabel:R=`More information`,fieldClassName:z=``,...B}=l;n(`AppAutocomplete`,B),t(`AppAutocomplete`,`size`,k,h);let V=typeof w==`function`,H=d(),U=M||H,{setRef:W,innerRef:G}=s({ref:y,value:b??``,on:{change:e=>x?.(e.currentTarget.value,{isCustom:!!e.detail?.isCustom})}}),K=S||g,{portal:q,toElementOptions:J}=o(K),Y=f(!1);return u(()=>{let e=G.current;if(!e||V&&Y.current)return;let t=J(v(K,b,C),_);c(t,e.options)||(e.options=t)},[K,V,G,J,b,C]),u(()=>{let e=G.current;if(!e||!V||!Y.current)return;let t=e.options,n=v(t,b,C);n!==t&&(e.options=n)},[b,C,V,G]),u(()=>{let e=G.current;if(!e||!V)return;let t=0,n=null,r=async r=>{let i=++t;n?.abort(),n=typeof AbortController==`function`?new AbortController:null,e.loading=!0;try{let a=await w(r.detail.query,{signal:n?.signal});i===t&&(Y.current=!0,e.options=a||[])}catch{i===t&&(Y.current=!0,e.options=[])}finally{i===t&&(e.loading=!1)}};return e.addEventListener(`search`,r),()=>{t=-1,n?.abort(),e.removeEventListener(`search`,r),e.loading=!1}},[V,w,G]),m(`div`,{...e(`AppAutocomplete`,l),className:`field${z?` ${z}`:``}`,children:[N&&m(`label`,{className:`label`,htmlFor:U,children:[N,I&&p(a,{}),L&&p(i,{label:R,children:L})]}),p(`wui-autocomplete`,{"aria-label":typeof N==`string`?N:void 0,"aria-describedby":P?`${U}-error`:F?`${U}-hint`:void 0,"aria-invalid":P?`true`:void 0,id:U,ref:W,name:j,placeholder:T,remote:V?``:void 0,"min-chars":E==null?void 0:String(E),debounce:D==null?void 0:String(D),size:k||void 0,"allow-custom":A?``:void 0,disabled:O?``:void 0,required:I?``:void 0,...B}),q,p(r,{error:P,hint:F,errorId:`${U}-error`,hintId:`${U}-hint`})]})});export{y as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./warnInvalidValue.js";import
|
|
1
|
+
import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"./withTooltip.js";import i from"./renderIconProp.js";import{initialsOf as a}from"../lib/initials.js";import{useEffect as o,useState as s}from"react";import{Fragment as c,jsx as l,jsxs as u}from"react/jsx-runtime";var d=[`circle`,`rounded`,`square`],f=[`primary`,`neutral`,`success`,`warning`,`danger`,`info`,`auto`],p=[`none`,`online`,`offline`,`away`,`busy`],m=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`],h=new Set([`xs`,`sm`,`md`,`lg`,`xl`,`2xl`]),g={xs:20,sm:24,md:32,lg:48,xl:64,"2xl":96};function _(e){return a(e)||`?`}function v(e){let t=e||``,n=0;for(let e=0;e<t.length;e+=1)n=Math.imul(n,31)+t.charCodeAt(e)>>>0;return n%360}function y(e){if(typeof e==`number`)return e;if(g[e]!=null)return g[e];let t=Number.parseInt(e,10);return Number.isNaN(t)?32:t}function b(a){let{name:g,src:b,size:x=`md`,shape:S=`circle`,tone:C=`primary`,status:w=`none`,ring:T=!1,label:E,icon:D,iconVariant:O,badge:k,href:A,onClick:j,linkComponent:M,tooltip:N,tooltipPlacement:P,className:F=``,...I}=a;n(`AppAvatar`,I),t(`AppAvatar`,`shape`,S,d),t(`AppAvatar`,`tone`,C,f),t(`AppAvatar`,`status`,w,p),t(`AppAvatar`,`iconVariant`,O,m);let{style:L,...R}=I,[z,B]=s(!1);o(()=>{B(!1)},[b]);let V=typeof x==`string`&&h.has(x),H=V?null:typeof x==`number`||/^\d+$/.test(x)?`${x}px`:x,U=A!=null||j!=null,W=b!=null&&b!==``&&!z,G=[`avatar`,V&&x!==`md`?`avatar-${x}`:``,S===`circle`?``:`avatar-${S}`,C===`primary`?``:`avatar-${C}`,T?`avatar-ring`:``,U?`avatar-clickable`:``,F].filter(Boolean).join(` `),K={};H&&(K[`--avatar-size`]=H),C===`auto`&&(K[`--avatar-hue`]=v(g));let q=Object.keys(K).length||L?{...K,...L}:void 0,J=l(`span`,{className:`avatar-face`,"aria-hidden":`true`,children:D!=null&&D!==!1&&D!==``?i(D,{size:Math.round(y(x)*.55),variant:O}):_(g)}),Y=u(c,{children:[w!==`none`&&l(`span`,{className:`avatar-status avatar-status-${w}`,"aria-hidden":`true`}),k!=null&&l(`span`,{className:`avatar-badge`,children:k}),E!=null&&l(`span`,{className:`avatar-label`,"aria-hidden":`true`,children:E})]}),X=u(c,{children:[J,W&&l(`img`,{className:`avatar-img`,src:b,alt:U?``:g||`Profile photo`,onError:()=>B(!0)}),Y]});if(A!=null){let t=M||`a`,n=M?{to:A}:{href:A};return r(l(t,{className:G,style:q,...e(`AppAvatar`,a),...R,"aria-label":E||g,...n,onClick:j,children:X}),N,P)}if(j!=null)return r(l(`button`,{type:`button`,className:G,style:q,...e(`AppAvatar`,a),...R,"aria-label":E||g,onClick:j,children:X}),N,P);if(W)return r(l(`span`,{className:G,style:q,...e(`AppAvatar`,a),...R,children:X}),N,P);let Z=E?.trim()||g?.trim();return r(Z?l(`span`,{className:G,style:q,...e(`AppAvatar`,a),...R,role:`img`,"aria-label":Z,children:X}):l(`span`,{className:G,style:q,...e(`AppAvatar`,a),...R,"aria-hidden":`true`,children:X}),N,P)}export{b as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./warnInvalidValue.js";import
|
|
1
|
+
import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import{jsxs as r}from"react/jsx-runtime";var i=[`tight`,`normal`,`loose`],a={xs:20,sm:24,md:32,lg:48,xl:64,"2xl":96};function o(e){return e==null?null:typeof e==`number`?`${e}px`:a[e]==null?/^\d+$/.test(e)?`${e}px`:e:`${a[e]}px`}function s(a){let{children:s,size:c,spacing:l=`normal`,overflow:u,className:d=``,...f}=a;n(`AppAvatarGroup`,f),t(`AppAvatarGroup`,`spacing`,l,i);let{style:p,...m}=f,h=[`avatar-group`,l===`normal`?``:`avatar-group-${l}`,d].filter(Boolean).join(` `),g=o(c),_=g?{"--avatar-size":g,...p}:p,v=typeof u==`string`?Number.parseInt(u,10):u;return r(`div`,{className:h,style:_,...e(`AppAvatarGroup`,a),...m,children:[s,v>0&&r(`span`,{className:`avatar avatar-more`,role:`img`,"aria-label":`${v} more`,children:[`+`,v]})]})}export{s as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./warnInvalidValue.js";import
|
|
1
|
+
import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"./AppIcon.js";import i from"./AppAlert.js";import a from"./AppButton.js";import ee from"../lib/FieldMessage.js";import te from"./AppRequiredMark.js";import ne from"./AppModal.js";import{AVATAR_ACCEPT as re,AVATAR_MAX_SIZE_MB as ie,AVATAR_OUTPUT_SIZE as ae,AVATAR_PREVIEW_SIZES as o,AVATAR_TEXT as s,avatarCropOptions as oe,avatarUnreadableMessage as se,validateFile as ce}from"@webority/ui-elements/helpers";import{useCallback as le,useEffect as c,useId as ue,useRef as l,useState as u}from"react";import{Fragment as de,jsx as d,jsxs as f}from"react/jsx-runtime";import"@webority/ui-elements/elements/image-crop";var p={sm:64,md:96,lg:128},fe=o.join(` `);function m(o){let{value:m,initials:pe,onPick:me,onRemove:h,name:g,removeName:_,accept:v=re,maxSizeMb:he=ie,outputSize:ge=ae,size:y=`md`,label:b,hint:x,error:_e,required:ve=!1,loading:S=!1,disabled:ye=!1,ariaLabel:be,className:C=``,fieldClassName:w=``,style:xe,...T}=o;n(`AppAvatarPicker`,T),t(`AppAvatarPicker`,`size`,typeof y==`string`?y:null,Object.keys(p));let E=ue(),D=l(null),O=l(null),k=l(null),[A,j]=u(null),[M,N]=u(!1),[Se,P]=u(!1),[Ce,F]=u(``),[I,L]=u(!1),[R,z]=u(null),[B,V]=u(`loading`),[H,U]=u(``),[W,G]=u(!1),we=le(e=>{if(k.current=e,!e)return;let t=()=>{V(`ready`),e.querySelector(`.wui-crop-stage`)?.focus()},n=()=>V(`error`);return e.addEventListener(`load`,t),e.addEventListener(`error`,n),()=>{e.removeEventListener(`load`,t),e.removeEventListener(`error`,n),k.current=null}},[]);c(()=>()=>R&&URL.revokeObjectURL(R.url),[R]),c(()=>()=>A&&URL.revokeObjectURL(A),[A]),c(()=>{j(null),N(!1),P(!1)},[m]);let K=S||ye,q=M?null:A||(m&&!Se?m:null),J=!!q,Te=!K&&J&&!!(h||_),Y=_e||Ce,X=x&&!Y?`${E}-hint`:void 0,Z=Y?`${E}-error`:void 0,Ee=Z||X,De=J?s.change:s.choose,Oe=typeof y==`number`?y:p[y]??p.md,Q=()=>{K||D.current?.click()},ke=()=>{K||O.current?.click()},Ae=e=>{let t=ce(e,{accept:v,maxSizeMb:he});if(t){F(t);return}F(``),V(`loading`),U(``),z({file:e,url:URL.createObjectURL(e)})},je=e=>{let t=e.target.files?.[0];e.target.value=``,t&&Ae(t)},Me=e=>{if(e.preventDefault(),L(!1),K)return;let t=e.dataTransfer?.files?.[0];t&&Ae(t)},Ne=e=>{if(g&&D.current&&typeof DataTransfer==`function`){let t=new DataTransfer;t.items.add(e),D.current.files=t.files}N(!1),P(!1),j(URL.createObjectURL(e)),me(e)},Pe=async()=>{let{file:e}=R;G(!0),U(``);let t=null;try{t=await k.current?.toFile(oe(e,ge))}catch{t=null}if(G(!1),!t){U(s.cropFailed);return}z(null),Ne(t)},$=()=>{W||z(null)},Fe=()=>{j(null),N(!0),F(``),D.current&&(D.current.value=``),h?.()};return f(`div`,{...e(`AppAvatarPicker`,o),className:`field wui-avatar-picker-field${w?` ${w}`:``}`,children:[b&&f(`label`,{className:`label`,htmlFor:E,children:[b,ve&&d(te,{})]}),f(`div`,{className:`wui-avatar-picker${I?` is-dragging`:``}${C?` ${C}`:``}`,style:{"--wui-avatar-size":`${Oe}px`,...xe},onDragOver:e=>{e.preventDefault(),!K&&!I&&L(!0)},onDragLeave:()=>L(!1),onDrop:Me,children:[f(`button`,{type:`button`,className:`wui-avatar-picker-face`,tabIndex:-1,"aria-label":be||De,"aria-describedby":Ee,"aria-busy":S||void 0,disabled:K,onClick:Q,...T,children:[q?d(`img`,{className:`wui-avatar-picker-img`,src:q,alt:``,onError:()=>P(!0)}):d(`span`,{className:`wui-avatar-picker-placeholder`,"aria-hidden":`true`,children:pe||d(r,{name:`user`,size:Math.round(Oe*.5)})}),d(`span`,{className:`wui-avatar-picker-badge`,"aria-hidden":`true`,children:S?d(r,{name:`refresh-cw`,size:14,className:`wui-spin`}):d(r,{name:`camera`,size:14})})]}),f(`div`,{className:`wui-avatar-picker-actions`,children:[d(`button`,{type:`button`,className:`btn btn-secondary btn-sm`,disabled:K,"aria-describedby":Ee,onClick:Q,children:De}),f(`button`,{type:`button`,className:`btn btn-secondary btn-sm wui-avatar-picker-camera`,disabled:K,onClick:ke,children:[d(r,{name:`camera`,size:16}),s.camera]}),d(`button`,{type:`button`,className:`btn btn-secondary-danger btn-sm`,hidden:!Te,onClick:Fe,children:s.remove})]}),d(`input`,{id:E,ref:D,type:`file`,name:g,hidden:!0,accept:v,disabled:K,onChange:je}),d(`input`,{ref:O,type:`file`,hidden:!0,accept:`image/*`,capture:`user`,disabled:K,onChange:je}),_&&d(`input`,{type:`hidden`,name:_,value:`true`,disabled:!M})]}),d(ee,{error:Y,hint:x,errorId:Z,hintId:X}),f(ne,{open:!!R,title:s.dialogTitle,subtitle:s.dialogSubtitle,dismissible:!W,staticBackdrop:W,onClose:$,footer:f(de,{children:[d(a,{type:`button`,variant:`secondary`,disabled:W,onClick:$,children:s.cancel}),d(a,{type:`button`,variant:`primary`,loading:W,disabled:B!==`ready`,onClick:Pe,children:s.save})]}),children:[B===`error`&&R&&d(i,{variant:`danger`,children:se(R.file)}),H&&d(i,{variant:`danger`,children:H}),R&&B!==`error`&&d(`wui-image-crop`,{ref:we,src:R.url,aspect:`1`,round:!0,rotatable:!0,previews:fe})]})]})}export{m as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./warnInvalidValue.js";import
|
|
1
|
+
import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"./withTooltip.js";import{Badge as i}from"react-bootstrap";import{jsx as a}from"react/jsx-runtime";var o=[`neutral`,`primary`,`success`,`warning`,`danger`,`info`];function s(s){let{children:c,tone:l,dot:u=!1,tooltip:d,tooltipPlacement:f,className:p=``,...m}=s;return n(`AppBadge`,m),t(`AppBadge`,`tone`,l,o),r(a(i,{bg:!1,className:[l&&l!==`neutral`?`badge-${l}`:``,u?`badge-dot`:``,p].filter(Boolean).join(` `)||void 0,...e(`AppBadge`,s),...m,children:c}),d,f)}export{s as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./warnInvalidValue.js";import
|
|
1
|
+
import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"./AppIcon.js";import i from"./renderIconProp.js";import{useState as a}from"react";import{jsx as o,jsxs as s}from"react/jsx-runtime";var c=[`info`,`success`,`warning`,`danger`,`neutral`];function l(l){let{tone:u=`info`,icon:d,children:f,dismissible:p=!1,onDismiss:m,className:h=``,...g}=l;n(`AppBanner`,g),t(`AppBanner`,`tone`,u,c);let[_,v]=a(!0);if(!_)return null;let y=c.includes(u)?u:`info`,b=()=>{v(!1),m?.()};return s(`div`,{className:`wui-banner wui-banner-${y}${h?` ${h}`:``}`,role:`status`,...e(`AppBanner`,l),...g,children:[d&&o(`span`,{className:`wui-banner-icon`,children:i(d,{size:18})}),o(`div`,{className:`wui-banner-body`,children:f}),p&&o(`button`,{type:`button`,className:`wui-banner-dismiss`,"aria-label":`Dismiss`,onClick:b,children:o(r,{name:`x`,size:18})})]})}export{l as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./warnUnknownProps.js";import
|
|
1
|
+
import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnUnknownProps.js";import n from"./renderIconProp.js";import{createContext as r,useContext as i}from"react";import{Breadcrumb as a}from"react-bootstrap";import{jsx as o,jsxs as s}from"react/jsx-runtime";var c=r(!1);function l(r){let{items:l=[],linkComponent:u,className:d=``,...f}=r;t(`AppBreadcrumbs`,f);let p=i(c);return o(a,{className:d||void 0,...e(`AppBreadcrumbs`,r),...f,children:l.map((e,t)=>{let r=!p&&t===l.length-1,i=e.icon?n(e.icon,{size:14}):null,o={};return r||(o=e.to&&u?{linkAs:u,linkProps:{to:e.to}}:e.to||e.href?{href:e.to||e.href}:{linkAs:`span`}),s(a.Item,{active:r,...o,children:[i,e.label]},e.key??`${e.label}-${t}`)})})}export{c as BreadcrumbTrailContext,l as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./warnInvalidValue.js";import
|
|
1
|
+
import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import{shortcutAria as r,shortcutChip as i}from"../lib/shortcutChip.js";import a from"./withTooltip.js";import o from"./AppIcon.js";import s from"./warnDeprecatedValue.js";import{Button as c}from"react-bootstrap";import{jsx as l,jsxs as u}from"react/jsx-runtime";var d={primary:`primary`,secondary:`secondary`,outline:`outline-primary`,ghost:`ghost`,text:`text`,danger:`danger`,success:`success`,"secondary-danger":`secondary-danger`,"outline-danger":`outline-danger`,light:`light`,warning:`warning`,neutral:`neutral`,"outline-light":`outline-light`,"outline-secondary":`outline-secondary`},f={subtle:{use:`neutral`,removeIn:`0.79.0`}};function p(e){return`btn-${d[f[e]?.use??e]??`primary`}`}var m={sm:14,md:16,lg:20},h=[`sheen`,`fill`,`expand`,`glow`,`roll`,`none`],g=[`rounded`,`pill`,`sharp`],_=[`button`,`submit`,`reset`],v=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`],y=e=>e===`pill`||e===`sharp`?`wui-btn-shape-${e}`:``;function b(e){return u(`span`,{className:`wui-btn-roll`,children:[l(`span`,{className:`wui-btn-roll__a`,children:e}),l(`span`,{className:`wui-btn-roll__b`,"aria-hidden":`true`,children:e})]})}function x(e,t,n,r){if(!e)return null;let i=n=>typeof e==`string`?l(o,{name:e,size:m[t]??m.md,variant:r,className:n}):l(`span`,{className:[`d-inline-flex`,n].filter(Boolean).join(` `),children:e});return u(`span`,{className:n?`wui-btn-roll-ico wui-btn-pin-icon`:`wui-btn-roll-ico ms-2`,"aria-hidden":`true`,children:[i(),i(`wui-btn-roll-ico__next`)]})}function S(e,t,n,r){if(!e)return null;let i=t===`left`?`me-2`:`ms-2`;return typeof e==`string`?l(o,{name:e,size:m[n]??m.md,variant:r,className:i}):l(`span`,{className:`d-inline-flex ${i}`,children:e})}function C(e,t,n){return e?l(`span`,{className:`wui-btn-pin-icon`,"aria-hidden":`true`,children:typeof e==`string`?l(o,{name:e,size:m[t]??m.md,variant:n}):e}):null}function w(o){let{children:p,variant:w=`primary`,size:T=`md`,type:E=`button`,loading:D=!1,disabled:O=!1,block:k=!1,leftIcon:A=null,rightIcon:j=null,href:M,static:N=!1,tooltip:P,tooltipPlacement:F,shortcut:I,animation:L,pinRightIcon:R=!1,shape:z=`rounded`,iconVariant:B,className:V=``,...H}=o;n(`AppButton`,H),L!==void 0&&t(`AppButton`,`animation`,L,h);let U=L===`roll`&&!N,W=R&&j!=null&&j!==``&&!N&&!D;s(`AppButton`,`variant`,w,f);let G=f[w]?.use??w;if(t(`AppButton`,`variant`,G,Object.keys(d)),t(`AppButton`,`size`,T,Object.keys(m)),t(`AppButton`,`shape`,z,g),t(`AppButton`,`type`,E,_),B!==void 0&&t(`AppButton`,`iconVariant`,B,v),N){let t=[`btn`,`btn-${d[G]??`primary`}`,T===`sm`?`btn-sm`:T===`lg`?`btn-lg`:``,k?`w-100`:``,y(z),`btn-static`,V].filter(Boolean).join(` `),{onClick:n,...r}=H;return a(u(`span`,{className:t,...e(`AppButton`,o),...r,children:[S(A,`left`,T,B),p,S(j,`right`,T,B)]}),P,F)}let K=[k?`w-100`:``,D?`is-loading`:``,L&&h.includes(L)?`btn-anim-${L}`:``,W?`wui-btn-pin-end`:``,y(z),V].filter(Boolean).join(` `),q=(H.as===void 0||H.as===`button`)&&M===void 0&&H.to===void 0,J=q?{}:{role:void 0,tabIndex:O||D?-1:void 0},Y=P!=null&&P!==``;return a(u(c,{type:q?E:void 0,href:M,variant:d[G]??`primary`,size:T===`md`?void 0:T,disabled:O||D,"aria-busy":D||void 0,"aria-keyshortcuts":r(I),className:K||void 0,...J,...e(`AppButton`,o),...H,children:[D&&l(`span`,{className:`spinner-border spinner-border-sm me-2`,"aria-hidden":`true`}),!D&&S(A,`left`,T,B),U?b(p):p,!D&&(U?x(j,T,W,B):W?C(j,T,B):S(j,`right`,T,B)),!Y&&i(I)]}),P,F,I)}export{p as buttonVariantClass,w as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./warnInvalidValue.js";import
|
|
1
|
+
import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import{jsx as r}from"react/jsx-runtime";var i={sm:`btn-group-sm`,md:``,lg:`btn-group-lg`};function a(a){let{label:o,children:s,size:c=`md`,vertical:l=!1,fullWidth:u=!1,className:d=``,...f}=a;return n(`AppButtonGroup`,f),t(`AppButtonGroup`,`size`,c,Object.keys(i)),r(`div`,{role:`group`,"aria-label":o,className:[l?`btn-group-vertical`:`btn-group`,`wui-btn-group`,i[c]??``,u?`wui-btn-group-full`:``,d].filter(Boolean).join(` `),...e(`AppButtonGroup`,a),...f,children:s})}export{a as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import{devWarn as t}from"../lib/devWarn.js";import n from"./warnInvalidValue.js";import r from"./warnUnknownProps.js";import{forwardRef as i,useCallback as a,useEffect as o,useLayoutEffect as s,useRef as c,useState as l}from"react";import{jsx as u}from"react/jsx-runtime";var d=`wui-calendar:event-click`,f=`wui-calendar:date-click`,p=`wui-calendar:range-change`,m=[`month`,`week`,`day`,`list`],h=`This calendar couldn't load. Try again in a moment.`,g=i(function(i,g){let{label:_,events:v,eventsUrl:y,view:b,date:x,emptyText:S,errorText:C,firstDay:w,onEventClick:T,onDateClick:E,onRangeChange:D,className:O=``,style:k,...A}=i;r(`AppCalendar`,A),n(`AppCalendar`,`view`,b,m);let j=c(null),M=c(``),N=c({onEventClick:T,onDateClick:E,onRangeChange:D}),[P,F]=l(!1),I=a(e=>{j.current=e,typeof g==`function`?g(e):g&&(g.current=e)},[g]);return o(()=>{N.current={onEventClick:T,onDateClick:E,onRangeChange:D}}),s(()=>{let e=j.current;if(!e)return;let t=v==null?``:JSON.stringify(v);t!==M.current&&(M.current=t,e.events=v??null)}),o(()=>{let e=j.current,t=[[d,e=>{N.current.onEventClick?.(e.detail)===!1&&e.preventDefault()}],[f,e=>N.current.onDateClick?.(e.detail)],[p,e=>N.current.onRangeChange?.(e.detail)]];for(let[n,r]of t)e.addEventListener(n,r);return()=>{for(let[n,r]of t)e.removeEventListener(n,r)}},[]),o(()=>{let e=!0;return import(`@webority/ui-elements/calendar`).catch(n=>{t(`[AppCalendar] the calendar failed to load:`,n?.message),e&&F(!0)}),()=>{e=!1}},[]),P?u(`div`,{...e(`AppCalendar`,i),className:O||void 0,style:k,role:`status`,children:u(`p`,{className:`wui-calendar-status-text`,children:C||h})}):u(`wui-calendar`,{ref:I,label:_||void 0,"events-url":y||void 0,view:b||void 0,date:x||void 0,"empty-text":S||void 0,"error-text":C||void 0,"first-day":w==null?void 0:String(w),className:O||void 0,style:k,...e(`AppCalendar`,i),...A})});export{g as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./warnInvalidValue.js";import
|
|
1
|
+
import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"./AppIcon.js";import{useState as i}from"react";import{Card as a}from"react-bootstrap";import{Fragment as o,jsx as s,jsxs as c}from"react/jsx-runtime";var l=[`default`,`elevated`,`outlined`,`muted`,`accent`],u=[`primary`,`success`,`warning`,`danger`,`info`],d=[`none`,`sm`,`md`,`lg`],f={xs:320,sm:420,md:560,lg:720};function p(p){let{title:m,subtitle:h,headerIcon:g,titleClassName:_=``,header:v,headerExtra:y,headerActions:b,footer:x,media:S,children:C,variant:w=`default`,tone:T=`primary`,padding:E=`md`,maxWidth:D,className:O=``,bodyClassName:k=``,headerClassName:A=``,body:j=!0,lifted:M=!1,href:N,onClick:P,linkComponent:F,onClose:I,dismissible:L,closeLabel:R=`Close`,...z}=p,[B,V]=i(!1);n(`AppCard`,z),t(`AppCard`,`variant`,w,l),t(`AppCard`,`tone`,T,u),t(`AppCard`,`padding`,E,d);let{style:H,...U}=z,W=N!=null||P!=null,G=[w&&w!=="default"?`card-${w}`:``,w===`accent`&&T&&T!==`primary`?`tone-${T}`:``,E&&E!==`md`?`card-pad-${E}`:``,M?`card-lifted`:``,D==null?``:`card-constrained`,W?`card-clickable`:``,O].filter(Boolean).join(` `)||void 0,K=D==null?void 0:f[D]==null?typeof D==`number`?`${D}px`:D:`${f[D]}px`,q=K?{"--card-max-width":K,...H}:H,J={};N==null?P!=null&&(J={role:`button`,tabIndex:0,onClick:P,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),P(e))}}):(J=F?{as:F,to:N}:{as:`a`,href:N},P&&(J.onClick=P));let Y=L??typeof I==`function`,X=Y?s(`button`,{type:`button`,className:`card-close`,"aria-label":R,onClick:e=>{e.preventDefault(),e.stopPropagation(),V(!0),I?.()},onKeyDown:e=>e.stopPropagation(),children:s(r,{name:`x`,size:16})}):null,Z=m!=null||h!=null||g!=null,Q=v!=null||Z||y!=null||b!=null||Y,$=g==null?null:typeof g==`string`?s(r,{name:g,size:18}):g;return B?null:c(a,{className:G,style:q,...e(`AppCard`,p),...U,...J,children:[S!=null&&s(`div`,{className:`card-media`,children:S}),Q&&c(a.Header,{className:A||void 0,children:[v??c(o,{children:[Z&&c(`div`,{className:`card-header-main`,children:[$!=null&&s(`span`,{className:`card-header-icon`,children:$}),c(`div`,{className:`card-header-titles`,children:[m!=null&&s(`div`,{className:[`card-title`,_].filter(Boolean).join(` `),children:m}),h!=null&&s(`div`,{className:`card-subtitle`,children:h})]})]}),y,b!=null&&s(`div`,{className:`card-header-actions`,children:b})]}),X]}),j?s(a.Body,{className:k||void 0,children:C}):C,x!=null&&s(`div`,{className:`card-footer`,children:x})]})}export{p as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./warnUnknownProps.js";import
|
|
1
|
+
import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnUnknownProps.js";import n from"./AppIcon.js";import{Children as r}from"react";import{jsx as i,jsxs as a}from"react/jsx-runtime";import"@webority/ui-elements/elements/carousel";function o(o){let{label:s,autoplay:c,loop:l=!1,perView:u,perViewMd:d,perViewLg:f,arrows:p=!0,dots:m=!0,previousLabel:h=`Previous slide`,nextLabel:g=`Next slide`,dotLabel:_=`Go to slide`,pauseLabel:v=`Pause`,playLabel:y=`Play`,className:b=``,children:x,style:S,...C}=o;t(`AppCarousel`,C);let w=Number(c)>0?Math.round(Number(c)):0,T={...u>1?{"--wui-carousel-per-view":u}:null,...d>=1?{"--wui-carousel-per-view-md":d}:null,...f>=1?{"--wui-carousel-per-view-lg":f}:null};return a(`wui-carousel`,{class:[`wui-carousel`,b].filter(Boolean).join(` `),role:`region`,"aria-roledescription":`carousel`,"aria-label":s,autoplay:w||void 0,loop:l?``:void 0,"dot-label":_===`Go to slide`?void 0:_,"pause-label":v===`Pause`?void 0:v,"play-label":y===`Play`?void 0:y,style:Object.keys(T).length||S?{...T,...S}:void 0,...e(`AppCarousel`,o),...C,children:[w?a(`button`,{type:`button`,className:`wui-carousel-pause`,children:[i(`span`,{className:`wui-carousel-pause-icon`,"aria-hidden":`true`}),i(`span`,{className:`wui-carousel-pause-text`,children:v})]}):null,a(`div`,{className:`wui-carousel-stage`,children:[p?i(`button`,{type:`button`,className:`wui-carousel-arrow wui-carousel-prev`,"aria-label":h,children:i(n,{name:`chevron-left`,size:20})}):null,i(`div`,{className:`wui-carousel-track`,tabIndex:0,role:`group`,"aria-label":s,children:r.map(r.toArray(x),e=>i(`div`,{className:`wui-carousel-slide`,role:`group`,"aria-roledescription":`slide`,children:e}))}),p?i(`button`,{type:`button`,className:`wui-carousel-arrow wui-carousel-next`,"aria-label":g,children:i(n,{name:`chevron-right`,size:20})}):null]}),m?i(`div`,{className:`wui-carousel-dots`}):null,i(`span`,{className:`visually-hidden`,"data-wui-status":``,"aria-live":`polite`,"aria-atomic":`true`})]})}export{o as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import{devWarn as t}from"../lib/devWarn.js";import n from"./warnInvalidValue.js";import r from"./warnUnknownProps.js";import{forwardRef as i,useCallback as a,useEffect as o,useLayoutEffect as s,useRef as c,useState as l}from"react";import{jsx as u}from"react/jsx-runtime";var d=`wui-chart:select`,f=`wui-chart:legend-change`,p=`wui-chart:ready`,m=[`line`,`area`,`column`,`bar`,`donut`,`heatmap`,`calendar`,`funnel`,`gauge`,`waterfall`,`treemap`,`sankey`,`scatter`,`bubble`,`multiples`],h=[`none`,`stacked`,`percent`],g=[`ready`,`loading`,`empty`,`error`],ee=[`auto`,`svg`,`canvas`],_=[`chart`,`table`],v=`This chart couldn't load. Try again in a moment.`,y=()=>{try{return process.env.NODE_ENV!==`production`}catch{return!0}},b=!1;function x(){b||!y()||(b=!0,t("[@webority/ui-react] <AppChart> has no `title`, which names the chart for assistive tech and its exported files."))}var S=e=>e===``?void 0:e,C=e=>Array.isArray(e)?e.map(C):e==null||Object.getPrototypeOf(e)!==Object.prototype?e:Object.fromEntries(Object.entries(e).filter(([,e])=>e!==``).map(([e,t])=>[e,C(t)])),w=e=>({type:S(e.type),title:S(e.title),description:S(e.description),data:e.data,x:C(e.x),series:C(e.series),group:C(e.group),to:C(e.to),size:C(e.size),trend:e.trend,zoom:e.zoom,bands:C(e.bands),stack:S(e.stack),y:C(e.y),target:C(e.target),height:e.height>0?e.height:void 0,state:S(e.state),emptyText:S(e.emptyText),errorText:S(e.errorText),renderer:S(e.renderer)}),T=(e,t)=>t!=null&&Object.keys(e).every(n=>Object.is(e[n],t[n])),E=e=>{try{return JSON.stringify(e)}catch{return null}},D=i(function(i,y){let{type:b,title:S,description:C,data:D,x:O,series:k,group:A,to:j,size:M,trend:N,zoom:P,bands:F,stack:I,y:L,target:R,height:z,state:B,emptyText:V,errorText:H,renderer:U,view:W,onSelect:G,onLegendChange:K,onReady:q,className:J=``,style:Y,...X}=i;r(`AppChart`,X),n(`AppChart`,`type`,b,m),n(`AppChart`,`stack`,I,h),n(`AppChart`,`state`,B,g),n(`AppChart`,`renderer`,U,ee),n(`AppChart`,`view`,W,_),S||x();let Z=c(null),Q=c({props:null,signature:null}),$=c({onSelect:G,onLegendChange:K,onReady:q}),[te,ne]=l(!1),re=a(e=>{Z.current=e,typeof y==`function`?y(e):y&&(y.current=e)},[y]);return o(()=>{$.current={onSelect:G,onLegendChange:K,onReady:q}}),s(()=>{let e=Z.current;if(!e)return;let t={type:b,title:S,description:C,data:D,x:O,series:k,group:A,to:j,size:M,trend:N,zoom:P,bands:F,stack:I,y:L,target:R,height:z,state:B,emptyText:V,errorText:H,renderer:U};if(T(t,Q.current.props))return;Q.current.props=t;let n=w(t),r=E(n);r!==null&&r===Q.current.signature||(Q.current.signature=r,e.spec=n)}),o(()=>{let e=Z.current,t=e=>t=>$.current[e]?.(t.detail),n=[[d,t(`onSelect`)],[f,t(`onLegendChange`)],[p,t(`onReady`)]];for(let[t,r]of n)e.addEventListener(t,r);return()=>{for(let[t,r]of n)e.removeEventListener(t,r)}},[]),o(()=>{let e=!0;return import(`@webority/ui-elements/chart`).catch(n=>{t(`[AppChart] the chart failed to load:`,n?.message),e&&ne(!0)}),()=>{e=!1}},[]),te?u(`div`,{...e(`AppChart`,i),className:J||void 0,style:Y,role:`status`,children:u(`p`,{className:`wui-chart-state-text`,children:H||v})}):u(`wui-chart`,{ref:re,view:W||void 0,className:J||void 0,style:Y,...e(`AppChart`,i),...X})});export{D as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import{devWarn as t}from"../lib/devWarn.js";import n from"./warnUnknownProps.js";import r from"./AppIcon.js";import i from"./AppButton.js";import a from"./AppCard.js";import o from"./AppDropdown.js";import s from"./AppSegmented.js";import{useLayoutEffect as c,useRef as l,useState as u}from"react";import{Dropdown as d}from"react-bootstrap";import{Fragment as f,jsx as p,jsxs as m}from"react/jsx-runtime";var h=[{value:`chart`,label:`Chart`,icon:`chart`},{value:`table`,label:`Table`,icon:`grid`}],g=()=>{try{return process.env.NODE_ENV!==`production`}catch{return!0}},_=!1;function v(){_||!g()||(_=!0,t("[@webority/ui-react] <AppChartCard> has no `title`, which is the card's heading and names its menu button."))}var y=e=>e.getAttribute(`view`)===`table`?`table`:`chart`;function b(t){let{title:g,subtitle:_,toolbar:b=!0,onRetry:x,footer:S,children:C,className:w=``,...T}=t;n(`AppChartCard`,T),g||v();let E=l(null),D=l(null),[O,k]=u(`chart`),A=l(O);A.current=O;let[j,M]=u(!0),N=()=>E.current?.querySelector(`wui-chart`);c(()=>{let e=E.current,t=()=>{let t=e.querySelector(`wui-chart`);if(t){if(t===D.current){k(y(t));return}D.current=t,t.hasAttribute(`view`)?k(y(t)):A.current!==`chart`&&t.setAttribute(`view`,A.current)}};t();let n=new MutationObserver(t);return n.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`view`]}),()=>n.disconnect()},[]);let P=m(f,{children:[p(`button`,{type:`button`,className:`topbar-icon-btn wui-chart-card-tool wui-chart-card-legend-tool`,"aria-pressed":j,"aria-label":`Show legend`,title:`Show or hide the legend`,onClick:()=>M(!j),children:p(r,{name:`list`,size:16})}),p(s,{size:`sm`,label:`View`,options:h,value:O,onChange:e=>{k(e),N()?.setAttribute(`view`,e)}}),m(o,{icon:`more-horizontal`,label:g?`More actions for ${g}`:`More actions`,children:[m(d.Item,{as:`button`,type:`button`,onClick:()=>N()?.exportPng?.(),children:[p(r,{name:`image`,size:16}),`Download PNG`]}),m(d.Item,{as:`button`,type:`button`,onClick:()=>N()?.exportCsv?.(),children:[p(r,{name:`download`,size:16}),`Download CSV`]})]})]}),F=[`wui-chart-card`,j?``:`wui-chart-card-legend-off`,w].filter(Boolean).join(` `);return m(a,{title:g,subtitle:_,headerActions:b?P:void 0,footer:S,className:F,...e(`AppChartCard`,t),...T,children:[p(`div`,{ref:E,children:C}),x&&p(`div`,{className:`wui-chart-card-retry`,children:p(i,{variant:`outline`,size:`sm`,onClick:x,children:`Try again`})})]})}export{b as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./warnUnknownProps.js";import
|
|
1
|
+
import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnUnknownProps.js";import n from"../lib/CheckField.js";import{forwardRef as r}from"react";import{jsx as i}from"react/jsx-runtime";var a=r(function(r,a){let{label:o,id:s,name:c,error:l,hint:u,className:d=``,...f}=r;return t(`AppCheckbox`,f),i(n,{rootProps:e(`AppCheckbox`,r),ref:a,label:o,id:s,name:c,error:l,hint:u,className:d,rest:f,inputType:`checkbox`,wrapperClass:`form-check`})});export{a as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./warnInvalidValue.js";import
|
|
1
|
+
import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"./AppIcon.js";import{Fragment as i,jsx as a,jsxs as o}from"react/jsx-runtime";var s=[`neutral`,`primary`,`success`,`warning`,`danger`,`info`],c=[`soft`,`outline`,`solid`],l=[`sm`,`md`];function u(u){let{label:d,children:f,tone:p=`neutral`,variant:m=`soft`,size:h=`md`,leadingIcon:g,avatar:_,onRemove:v,onClick:y,disabled:b=!1,removeLabel:x,className:S=``,...C}=u;n(`AppChip`,C),t(`AppChip`,`tone`,p,s),t(`AppChip`,`variant`,m,c),t(`AppChip`,`size`,h,l);let w=d??f,T={},E={};for(let[e,t]of Object.entries(C))y&&(e.startsWith(`aria-`)||e.startsWith(`data-`))?T[e]=t:E[e]=t;let D=[`chip`,p&&p!==`neutral`?p:``,m===`outline`?`chip-outline`:m===`solid`?`chip-solid`:``,h===`sm`?`chip-sm`:``,y?`chip-clickable`:``,v?`chip-removable`:``,b?`is-disabled`:``,S].filter(Boolean).join(` `),O=_?a(`span`,{className:`chip-avatar`,children:typeof _==`string`?a(`img`,{src:_,alt:``}):_}):g?a(`span`,{className:`chip-ic`,children:a(r,{name:g,size:h===`sm`?12:14})}):null,k=y?o(`button`,{type:`button`,className:`chip-body`,...T,onClick:y,disabled:b,children:[O,a(`span`,{className:`chip-label`,children:w})]}):o(i,{children:[O,a(`span`,{className:`chip-label`,children:w})]});return o(`span`,{className:D,...e(`AppChip`,u),...E,children:[k,v&&a(`button`,{type:`button`,className:`chip-remove`,onClick:v,disabled:b,"aria-label":x||(typeof w==`string`?`Remove ${w}`:`Remove`),children:a(r,{name:`x`,size:h===`sm`?12:14})})]})}export{u as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./warnInvalidValue.js";import
|
|
1
|
+
import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import{jsx as r}from"react/jsx-runtime";import"@webority/ui-elements/elements/overflow";var i=[`wrap`,`menu`];function a(a){let{children:o,overflow:s=`wrap`,moreLabel:c=`More`,label:l,className:u=``,...d}=a;n(`AppChipGroup`,d),t(`AppChipGroup`,`overflow`,s,i);let f=e=>[e,u].filter(Boolean).join(` `);return s===`menu`?r(`wui-overflow`,{...e(`AppChipGroup`,a),class:`wui-chip-group-host`,label:c,children:r(`div`,{role:`group`,"aria-label":l,className:f(`wui-chip-group wui-chip-group-nowrap`),"data-wui-overflow-list":``,...d,children:o})}):r(`div`,{role:`group`,"aria-label":l,className:f(`wui-chip-group`),...e(`AppChipGroup`,a),...d,children:o})}export{a as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./warnInvalidValue.js";import
|
|
1
|
+
import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"./AppIcon.js";import{Fragment as i,jsx as a,jsxs as o}from"react/jsx-runtime";var s={sm:` wui-struct-card-sm`,md:``,lg:` wui-struct-card-lg`},c={inline:``,stacked:` wui-struct-card-stacked`},l={sm:16,md:18,lg:22};function u(u){let{name:d,multiple:f=!1,value:p,checked:m,onChange:h,icon:g,iconNode:_,iconSize:v,image:y,imageAlt:b=``,children:x,title:S,description:C,checkIcon:w=`check`,checkSize:T=18,hideCheck:E=!1,disabled:D=!1,size:O=`md`,layout:k=`inline`,className:A=``,...j}=u;n(`AppChoiceCard`,j),t(`AppChoiceCard`,`size`,O,Object.keys(s)),t(`AppChoiceCard`,`layout`,k,Object.keys(c));let M=s[O]??``,N=c[k]??``,P=v??l[O]??l.md;return o(`label`,{className:`struct-card${y?` struct-card-img-card`:``}${M}${N}${E?` wui-struct-card-no-check`:``}${m?` checked`:``}${A?` ${A}`:``}`,"aria-disabled":D||void 0,...e(`AppChoiceCard`,u),...j,children:[a(`input`,{type:f?`checkbox`:`radio`,name:d,value:p,className:`struct-card-input`,checked:m,onChange:h,disabled:D}),y?a(`span`,{className:`struct-card-media`,children:a(`img`,{className:`struct-card-img`,src:y,alt:b})}):_||g?a(`span`,{className:`struct-card-ic`,children:_||a(r,{name:g,size:P,variant:m?`bold`:void 0})}):null,a(`span`,{className:`struct-card-body`,children:x||o(i,{children:[S&&a(`span`,{className:`struct-card-title`,children:S}),C&&a(`span`,{className:`struct-card-desc`,children:C})]})}),!E&&a(`span`,{className:`struct-card-check`,children:a(r,{name:w,size:T})})]})}export{u as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./warnInvalidValue.js";import
|
|
1
|
+
import{wuiMarkerAttributes 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=[`sm`,`md`,`lg`];function o(o){let{multiple:s=!0,label:c,name:l,value:u,checked:d,onChange:f,children:p,count:m,size:h=`md`,disabled:g=!1,className:_=``,...v}=o;return n(`AppChoiceChip`,v),t(`AppChoiceChip`,`size`,h,a),i(`label`,{className:`choice-chip${d?` checked`:``}${h===`sm`?` choice-chip-sm`:h===`lg`?` choice-chip-lg`:``}${_?` ${_}`:``}`,...e(`AppChoiceChip`,o),...v,children:[r(`input`,{type:s?`checkbox`:`radio`,name:l,value:u,checked:d,disabled:g,onChange:f}),r(`span`,{children:c??p}),m!=null&&r(`span`,{className:`count`,children:m})]})}export{o as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./warnInvalidValue.js";import
|
|
1
|
+
import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import{jsx as r}from"react/jsx-runtime";import"@webority/ui-elements/elements/code-block";var i=[`text`,`json`,`js`,`cs`,`sql`,`bash`,`http`,`html`,`css`];function a(a){let{code:o,language:s=`text`,lineNumbers:c=!1,wrap:l=!1,label:u,copyLabel:d,copiedLabel:f,className:p=``,...m}=a;return n(`AppCodeBlock`,m),t(`AppCodeBlock`,`language`,s,i),r(`wui-code-block`,{class:[`wui-code-block`,p].filter(Boolean).join(` `),language:s===`text`?void 0:s,"line-numbers":c?``:void 0,wrap:l?``:void 0,label:u||void 0,"copy-label":d||void 0,"copied-label":f||void 0,...e(`AppCodeBlock`,a),...m,children:r(`pre`,{className:`wui-code-source`,children:r(`code`,{children:o??``})})})}export{a as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./warnInvalidValue.js";import
|
|
1
|
+
import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"../lib/FieldMessage.js";import i from"./AppRequiredMark.js";import{useId as a}from"react";import{jsx as o,jsxs as s}from"react/jsx-runtime";var c=[`sm`,`md`,`lg`];function l(l){let{value:u=`#000000`,onChange:d,label:f,required:p=!1,error:m,hint:h,name:g,id:_,disabled:v=!1,size:y=`md`,className:b=``,fieldClassName:x=``,...S}=l;n(`AppColorField`,S),t(`AppColorField`,`size`,y,c);let C=a(),w=_||C,T=m?`${w}-error`:h?`${w}-hint`:void 0,E=e=>/^#[0-9a-f]{6}$/i.test(e),D=y===`sm`?` color-field-sm`:y===`lg`?` color-field-lg`:``,O=y===`sm`?` input-sm`:y===`lg`?` input-lg`:``;return s(`div`,{...e(`AppColorField`,l),className:`field${x?` ${x}`:``}`,children:[f&&s(`label`,{className:`label`,htmlFor:w,children:[f,p&&o(i,{})]}),s(`div`,{className:`color-field${D}`,children:[o(`input`,{type:`color`,className:`color-field-swatch`,value:E(u)?u:`#000000`,onChange:e=>d?.(e.target.value),disabled:v,"aria-label":`${f||`Colour`}, colour picker`,tabIndex:-1}),o(`input`,{type:`text`,className:`input color-field-hex${O}${m?` error`:``}${b?` ${b}`:``}`,id:w,name:g,value:u,onChange:e=>d?.(e.target.value),placeholder:`#4F46E5`,spellCheck:!1,maxLength:7,required:p,disabled:v,"aria-invalid":m?`true`:`false`,"aria-describedby":T,...S})]}),o(r,{error:m,hint:h,errorId:`${w}-error`,hintId:`${w}-hint`})]})}export{l as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./warnUnknownProps.js";import
|
|
1
|
+
import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnUnknownProps.js";import n from"./AppDropdown.js";import{jsx as r,jsxs as i}from"react/jsx-runtime";function a(a){let{columns:o,hiddenColumns:s=[],onToggle:c,label:l=`Columns`,className:u=``,...d}=a;t(`AppColumnMenu`,d);let f=o.filter(e=>e.hideable);return i(n,{icon:`layout-grid`,label:l,menuClassName:`wui-column-menu${u?` ${u}`:``}`,...e(`AppColumnMenu`,a),children:[r(`div`,{className:`wui-column-menu-title`,children:l}),f.map(e=>i(`label`,{className:`wui-column-menu-item`,children:[r(`input`,{type:`checkbox`,className:`wui-check`,checked:!s.includes(e.key),onChange:()=>c(e.key)}),e.label]},e.key))]})}export{a as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./warnUnknownProps.js";import{shortcutAria as
|
|
1
|
+
import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnUnknownProps.js";import{shortcutAria as n,shortcutChip as r}from"../lib/shortcutChip.js";import i from"./AppIcon.js";import a from"./renderIconProp.js";import o from"./AppModal.js";import s from"./AppSpinner.js";import{matchSegments as c}from"@webority/ui-elements/helpers";import{Fragment as l,useEffect as u,useId as d,useLayoutEffect as f,useRef as p}from"react";import{jsx as m,jsxs as h}from"react/jsx-runtime";import"@webority/ui-elements/elements/command-palette";var g=`lg`;function _(n){let{open:r,onClose:i,query:a=``,onQueryChange:s,placeholder:c=`Search…`,groups:l=[],path:u=[],onPathChange:f,rootLabel:p,backLabel:h=`Back`,recentsKey:_,recentsLimit:y,recentsLabel:b,loading:x=!1,emptyText:S=`No results`,footer:C,ariaLabel:w=`Search`,highlight:T=!0,id:E,className:D=``,...O}=n;t(`AppCommandPalette`,O);let k=d(),A=E||k;return m(o,{...e(`AppCommandPalette`,n),open:r,onClose:i,hideHeader:!0,placement:`top`,size:g,ariaLabel:w,className:`wui-cmd-card${D?` ${D}`:``}`,children:m(v,{baseId:A,query:a,onQueryChange:s,placeholder:c,groups:l,path:u,onPathChange:f,rootLabel:p,backLabel:h,recentsKey:_,recentsLimit:y,recentsLabel:b,loading:x,emptyText:S,footer:C,ariaLabel:w,highlight:T,onClose:i,rest:O})})}function v({baseId:e,query:t,onQueryChange:o,placeholder:c,groups:l,path:d,onPathChange:g,rootLabel:_,backLabel:v,recentsKey:x,recentsLimit:S,recentsLabel:C,loading:w,emptyText:T,footer:E,ariaLabel:D,highlight:O,onClose:k,rest:A}){let j=p(null),M=`${e}-list`,N=l.filter(e=>e.items?.length),P=!w&&t.trim()!==``&&N.length===0;return f(()=>{j.current?.refresh?.()}),u(()=>{let e=j.current,t=e=>{let t=l.find(t=>String(t.key)===e.detail.groupKey)?.items?.find(t=>String(t.key)===e.detail.key);if(t){if(e.preventDefault(),t.page){o?.(``),g?.([...d,{key:t.page.key,label:t.page.label}]);return}t.onSelect?.(),k?.()}},n=e=>{e.preventDefault(),o?.(``),g?.(e.detail.path)};return e.addEventListener(`wui-command-palette:select`,t),e.addEventListener(`wui-command-palette:navigate`,n),()=>{e.removeEventListener(`wui-command-palette:select`,t),e.removeEventListener(`wui-command-palette:navigate`,n)}},[l,d,k,o,g]),h(`wui-command-palette`,{ref:j,path:JSON.stringify(d),"root-label":_,"recents-key":x,"recents-limit":S,"recents-label":C,...A,children:[h(`div`,{className:`wui-cmd-search`,children:[m(`span`,{className:`wui-cmd-search-icon`,"aria-hidden":`true`,children:m(i,{name:`search`,size:18})}),m(`input`,{className:`wui-cmd-input`,type:`text`,role:`combobox`,"aria-expanded":`true`,"aria-controls":M,"aria-autocomplete":`list`,"aria-label":D,placeholder:c,autoComplete:`off`,spellCheck:!1,"data-autofocus":``,value:t,onChange:e=>o?.(e.target.value)}),w&&m(s,{size:`sm`,className:`wui-cmd-spinner`})]}),h(`div`,{className:`wui-cmd-crumbs`,hidden:!0,children:[m(`button`,{type:`button`,className:`wui-cmd-back`,"aria-label":v,children:m(i,{name:`chevron-left`,size:16})}),m(`ol`,{className:`wui-cmd-trail`})]}),h(`div`,{className:`wui-cmd-list`,role:`listbox`,id:M,"aria-label":`Results`,"aria-busy":w?`true`:void 0,hidden:N.length===0,children:[m(`div`,{className:`wui-cmd-recents`}),N.map(o=>{let s=`${e}-${b(o.key)}`;return h(`div`,{className:`wui-cmd-group`,role:`group`,"aria-labelledby":s,children:[m(`div`,{className:`wui-cmd-group-label`,role:`presentation`,id:s,children:o.label}),o.items.map(e=>{let c=`${s}-${b(e.key)}`,l=e.description==null?null:`${c}-desc`,u=e.meta==null?null:`${c}-meta`;return h(`div`,{className:`wui-cmd-item`,role:`option`,id:c,"data-group-key":String(o.key),"data-key":String(e.key),"data-opens":e.page?String(e.page.key):void 0,"aria-label":e.ariaLabel||(typeof e.label==`string`?e.label:``)||void 0,"aria-describedby":[l,u].filter(Boolean).join(` `)||void 0,"aria-disabled":e.disabled?`true`:void 0,"aria-keyshortcuts":n(e.shortcut),children:[e.icon!=null&&m(`span`,{className:`wui-cmd-item-icon`,"aria-hidden":`true`,children:a(e.icon,{size:18})}),h(`span`,{className:`wui-cmd-item-text`,children:[m(`span`,{className:`wui-cmd-item-label`,children:O?y(e.label,t):e.label}),l&&m(`span`,{className:`wui-cmd-item-desc`,id:l,children:e.description})]}),u&&m(`span`,{className:`wui-cmd-item-meta`,id:u,children:e.meta}),r(e.shortcut),e.page&&m(`span`,{className:`wui-cmd-item-chevron`,"aria-hidden":`true`,children:m(i,{name:`chevron-right`,size:16})})]},e.key)})]},o.key)})]}),m(`div`,{className:`wui-cmd-empty`,role:`status`,children:P?T:null}),E!=null&&m(`div`,{className:`wui-cmd-footer`,children:E})]})}function y(e,t){if(typeof e!=`string`)return e;let n=c(e,t);if(n.length===1&&!n[0].match)return e;let r=0;return n.map(e=>{let t=r;return r+=e.text.length,e.match?m(`mark`,{className:`wui-cmd-mark`,children:e.text},t):m(l,{children:e.text},t)})}function b(e){return String(e).replace(/\s+/g,`_`)}export{_ as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./warnUnknownProps.js";import
|
|
1
|
+
import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnUnknownProps.js";import n from"./AppIcon.js";import{initialsOf as r}from"../lib/initials.js";import{formatDate as i,formatNumber as a,toInstant as o}from"@webority/ui-elements/helpers";import{Fragment as s,useEffect as c,useId as l,useRef as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{COMMENT_REACTIONS as p,COMMENT_TEXT as m}from"@webority/ui-elements/elements/comment-thread";import{parseMentionValue as h}from"@webority/ui-elements/elements/mention-input";function g(n){let{comments:r=[],onPost:i,onReply:a,onEdit:o,onDelete:s,onReact:h,people:g,loadPeople:v,reactionChoices:y,readOnly:b=!1,label:x=m.listName,id:S,className:C=``,...w}=n;t(`AppCommentThread`,w);let T=l(),E=S||`comment-thread-${T.replace(/[^a-zA-Z0-9_-]/g,``)}`,D=u(null),O=typeof v==`function`,k=y?.length?y:p,A=u(null);return A.current={onPost:i,onReply:a,onEdit:o,onDelete:s,onReact:h,loadPeople:v},c(()=>{let e=D.current;if(e)return e.submit=async({intent:e,commentId:t,parentId:n,body:r,emoji:i})=>{let a=A.current;e===`post`?await a.onPost?.(r):e===`reply`?await a.onReply?.(n,r):e===`edit`?await a.onEdit?.(t,r):e===`delete`?await a.onDelete?.(t):e===`react`&&await a.onReact?.(t,i)},()=>{e.submit=void 0}},[]),c(()=>{let e=D.current;!e||O||(e.people=g||[])},[g,O]),c(()=>{let e=D.current;if(!e||!O)return;let t=new WeakMap,n=async e=>{let n=e.target,r=(t.get(n)??0)+1;t.set(n,r),n.loading=!0;try{let i=await A.current.loadPeople(e.detail.query);t.get(n)===r&&(n.people=i||[])}catch{t.get(n)===r&&(n.people=[])}finally{t.get(n)===r&&(n.loading=!1)}};return e.addEventListener(`search`,n),()=>e.removeEventListener(`search`,n)},[O]),f(`wui-comment-thread`,{ref:D,id:E,class:C?`wui-comment-thread ${C}`:`wui-comment-thread`,controlled:``,"read-only":b?``:void 0,remote:O?``:void 0,"reaction-choices":y?.length?y.join(` `):void 0,...e(`AppCommentThread`,n),...w,children:[d(`div`,{className:`wui-comment-items`,"data-wui-items":``,children:r.length?d(`ol`,{className:`wui-comment-list`,"aria-label":x,children:r.map(e=>d(_,{comment:e,topLevel:!0,readOnly:b},e.id))}):d(`p`,{className:`wui-comment-empty`,children:m.empty})}),!b&&d(`div`,{className:`wui-reaction-picker`,role:`group`,"aria-label":m.pickerName,"data-wui-picker":``,hidden:!0,children:k.map(e=>d(`button`,{type:`button`,className:`wui-reaction-choice`,"data-wui-emoji":e,children:e},e))}),!b&&f(`div`,{className:`wui-comment-composer`,"data-wui-composer":``,children:[d(`wui-mention-input`,{id:`${E}-new`,class:`wui-mention-input`,label:m.composerLabel,placeholder:m.composerPlaceholder,rows:`3`,remote:O?``:void 0}),d(`div`,{className:`wui-comment-form-actions`,children:d(`button`,{type:`button`,className:`btn btn-primary btn-sm`,"data-wui-action":`post`,children:m.post})}),d(`div`,{className:`wui-comment-error`,"data-wui-error":``,hidden:!0})]}),d(`span`,{className:`visually-hidden`,"data-wui-live":``,"aria-live":`polite`,"aria-atomic":`true`})]})}function _({comment:e,topLevel:t=!1,readOnly:c}){let{id:l,author:u,at:p,value:g,edited:v,deleted:y,canEdit:b,canDelete:x,reactions:S=[],replies:C=[]}=e,w=u?.name||``,T=o(p),E=!c&&!y&&b,D=!c&&!y&&x;return f(`li`,{className:`wui-comment`,"data-wui-comment":l,"data-value":g??``,"data-wui-deleted":y?``:void 0,children:[f(`div`,{className:`wui-comment-row`,children:[f(`span`,{className:`avatar avatar-sm wui-comment-avatar`,"aria-hidden":`true`,children:[d(`span`,{className:`avatar-face`,children:r(w)||`?`}),u?.src&&d(`img`,{className:`avatar-img`,src:u.src,alt:``,onError:e=>{e.currentTarget.hidden=!0}})]}),f(`div`,{className:`wui-comment-main`,children:[f(`div`,{className:`wui-comment-head`,children:[d(`span`,{className:`wui-comment-author`,children:w}),d(`time`,{className:`wui-comment-time`,dateTime:Number.isFinite(T)?new Date(T).toISOString():void 0,children:i(p,{pattern:`datetime`})}),v&&!y&&d(`span`,{className:`wui-comment-edited`,children:m.edited})]}),y?d(`div`,{className:`wui-comment-text wui-comment-text-deleted`,children:m.deleted}):d(`div`,{className:`wui-comment-text`,"data-wui-text":``,children:h(g).map((e,t)=>`text`in e?d(s,{children:e.text},t):f(`span`,{className:`wui-mention`,"data-mention-id":e.id,children:[`@`,e.label]},t))}),E&&d(`div`,{className:`wui-comment-editor`,"data-wui-editor":``,hidden:!0}),!y&&(S.length>0||!c)&&f(`div`,{className:`wui-comment-reactions`,role:`group`,"aria-label":m.reactions,children:[S.map(e=>c?f(`span`,{className:e.mine?`wui-reaction wui-reaction-mine`:`wui-reaction`,children:[d(`span`,{className:`wui-reaction-emoji`,children:e.emoji}),d(`span`,{className:`wui-reaction-count`,children:a(e.count,{decimals:0})})]},e.emoji):f(`button`,{type:`button`,className:e.mine?`wui-reaction wui-reaction-mine`:`wui-reaction`,"data-wui-emoji":e.emoji,"aria-pressed":e.mine?`true`:`false`,children:[d(`span`,{className:`wui-reaction-emoji`,children:e.emoji}),d(`span`,{className:`wui-reaction-count`,children:a(e.count,{decimals:0})})]},e.emoji)),!c&&d(`button`,{type:`button`,className:`wui-reaction-add`,"data-wui-action":`react-menu`,"aria-label":m.addReaction,"aria-haspopup":`true`,"aria-expanded":`false`,children:d(n,{name:`emoji-smile`,size:16})})]}),!c&&!y&&(t||E||D)&&f(`div`,{className:`wui-comment-actions`,"data-wui-actions":``,children:[t&&d(`button`,{type:`button`,className:`wui-comment-action`,"data-wui-action":`reply`,children:m.reply}),E&&d(`button`,{type:`button`,className:`wui-comment-action`,"data-wui-action":`edit`,children:m.edit}),D&&d(`button`,{type:`button`,className:`wui-comment-action`,"data-wui-action":`delete`,children:m.delete})]}),D&&f(`div`,{className:`wui-comment-confirm`,"data-wui-confirm":``,hidden:!0,children:[d(`span`,{className:`wui-comment-confirm-text`,children:m.confirmDelete}),d(`button`,{type:`button`,className:`btn btn-danger btn-sm`,"data-wui-action":`confirm-delete`,children:m.delete}),d(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,"data-wui-action":`cancel-delete`,children:m.cancel})]}),!c&&d(`div`,{className:`wui-comment-error`,"data-wui-error":``,hidden:!0})]})]}),t&&C.length>0&&d(`ol`,{className:`wui-comment-list wui-comment-replies`,"aria-label":m.repliesName(w),children:C.map(e=>d(_,{comment:e,readOnly:c},e.id))}),t&&!c&&!y&&d(`div`,{className:`wui-comment-reply`,"data-wui-reply":``,hidden:!0})]})}export{g as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./warnUnknownProps.js";import
|
|
1
|
+
import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnUnknownProps.js";import n from"./AppIcon.js";import{jsx as r,jsxs as i}from"react/jsx-runtime";function a(a){let{columns:o=[],rows:s=[],caption:c,className:l=``,...u}=a;t(`AppCompareTable`,u);let d=e=>e===!0?r(`span`,{className:`compare-yes`,children:r(n,{name:`check`,size:16})}):e===!1?r(`span`,{className:`compare-no`,children:`-`}):e;return r(`div`,{className:`compare-table${l?` ${l}`:``}`,...e(`AppCompareTable`,a),...u,children:i(`table`,{children:[c&&r(`caption`,{className:`visually-hidden`,children:c}),r(`thead`,{children:r(`tr`,{children:o.map((e,t)=>r(`th`,{scope:`col`,className:e.highlight?`is-highlight`:void 0,children:e.label},e.label?`col-${t}-${e.label}`:`col-${t}`))})}),r(`tbody`,{children:s.map((e,t)=>i(`tr`,{children:[r(`th`,{scope:`row`,children:e.label}),e.values.map((e,t)=>r(`td`,{className:o[t+1]?.highlight?`is-highlight`:void 0,children:d(e)},o[t+1]?.label??t))]},e.key??`${e.label}-${t}`))})]})})}export{a as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./warnInvalidValue.js";import
|
|
1
|
+
import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"./AppButton.js";import i from"./AppModal.js";import a from"./AppInput.js";import{MODAL_ICONS as o}from"./ModalIcons.js";import{useEffect as s,useState as c}from"react";import{Fragment as l,jsx as u,jsxs as d}from"react/jsx-runtime";var f=[`sm`,`md`,`lg`,`xl`];function p(p){let{open:m,title:h,message:g,confirmLabel:_=`Confirm`,cancelLabel:v=`Cancel`,danger:y=!1,tone:b,image:x,iconSize:S,confirmPhrase:C,onConfirm:w,onClose:T,loading:E=!1,staticBackdrop:D=!1,placement:O=`center`,size:k=`md`,className:A=``,...j}=p;n(`AppConfirmDialog`,j),t(`AppConfirmDialog`,`tone`,b,Object.keys(o)),t(`AppConfirmDialog`,`size`,typeof k==`string`?k:null,f);let[M,N]=c(``);if(s(()=>{m||N(``)},[m]),!m)return null;let P=!!C&&M.trim()!==C,F=x?null:o[b||(y?`delete`:`info`)],I=S>0?{"--wui-confirm-icon-size":`${S}px`}:void 0,L=()=>{E||T?.()};return u(i,{...e(`AppConfirmDialog`,p),...j,open:m,hideHeader:!0,title:h,onClose:L,staticBackdrop:D,placement:O,size:k,className:[`wui-confirm`,A].filter(Boolean).join(` `),footer:d(`div`,{className:`wui-confirm-actions`,children:[u(r,{variant:`secondary`,disabled:E,onClick:L,children:v}),u(r,{variant:y?`danger`:`primary`,disabled:P,loading:E,onClick:w,children:_})]}),children:d(`div`,{className:`wui-confirm-content`,children:[x?u(`span`,{className:`wui-confirm-icon`,style:I,children:u(`img`,{src:x,alt:``,"aria-hidden":`true`})}):F&&u(`span`,{className:`wui-confirm-icon`,style:I,children:u(F,{size:120})}),u(`h3`,{className:`wui-confirm-title`,tabIndex:-1,"data-autofocus":``,children:h}),g&&u(`p`,{className:`wui-confirm-msg`,children:g}),C&&u(a,{fieldClassName:`mt-3 mb-0 w-100 text-start`,label:d(l,{children:[`Type `,u(`strong`,{children:C}),` to confirm`]}),value:M,onChange:e=>N(e.target.value),"aria-label":`Type ${C} to confirm`,disabled:E})]})})}export{p as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./warnInvalidValue.js";import
|
|
1
|
+
import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"./useWuiControl.js";import{useEffect as i}from"react";import{jsx as a}from"react/jsx-runtime";import"@webority/ui-elements/elements/consent-banner";import{getConsent as o,saveConsent as s}from"@webority/analytics/site";var c=[`bottom-left`,`bottom-right`,`bar`],l=[`analytics`,`functional`,`marketing`];function u(u){let{heading:d,description:f,policyHref:p,policyLabel:m,analyticsDescription:h,functionalDescription:g,marketingDescription:_,categories:v,position:y=`bottom-left`,standalone:b=!1,className:x=``,style:S,...C}=u;n(`AppConsentBanner`,C),t(`AppConsentBanner`,`position`,y,c);for(let e of v??[])t(`AppConsentBanner`,`categories`,e,l);let{setRef:w,innerRef:T}=r({on:{"wui-consent-save":e=>{s(e.detail),T.current&&(T.current.preferences=o())}}});return i(()=>{let e=T.current;if(!e)return;let t=o();e.preferences=t,t.decided||e.open()},[T]),a(`wui-consent-banner`,{ref:w,position:y,heading:d||void 0,description:f||void 0,"policy-href":p||void 0,"policy-label":m||void 0,"analytics-description":h||void 0,"functional-description":g||void 0,"marketing-description":_||void 0,categories:v?.length?v.join(` `):void 0,standalone:b||void 0,class:x||void 0,style:S,...e(`AppConsentBanner`,u),...C})}export{u as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./warnUnknownProps.js";import
|
|
1
|
+
import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnUnknownProps.js";import n from"./renderIconProp.js";import{useEffect as r,useRef as i}from"react";import{jsx as a,jsxs as o}from"react/jsx-runtime";import"@webority/ui-elements/elements/context-menu";function s(s){let{items:c=[],target:l,children:u,ariaLabel:d=`Context menu`,disabled:f=!1,onOpen:p,menuClassName:m=``,linkComponent:h,...g}=s;t(`AppContextMenu`,g);let _=i(null);return r(()=>{let e=_.current;if(!p)return;let t=e=>p(e.detail);return e.addEventListener(`wui-context-menu:open`,t),()=>e.removeEventListener(`wui-context-menu:open`,t)},[p]),o(`wui-context-menu`,{ref:_,target:l,disabled:f,...e(`AppContextMenu`,s),...g,children:[u,a(`div`,{className:`dropdown-menu wui-context-menu-panel${m?` ${m}`:``}`,role:`menu`,"aria-label":d,tabIndex:-1,children:c.map(e=>{if(e.divider)return a(`hr`,{className:`dropdown-divider`},e.key);let t=!!e.to&&!e.disabled;return o(t?h??`a`:`button`,{...t?h?{to:e.to}:{href:e.to}:{type:`button`},className:`dropdown-item${e.danger?` danger`:``}${e.disabled?` disabled`:``}`,role:`menuitem`,tabIndex:-1,"data-key":e.key,"aria-disabled":e.disabled?`true`:void 0,onClick:e.disabled?void 0:e.onClick,children:[e.image?a(`img`,{src:e.image,alt:``}):n(e.icon,{size:16}),e.label]},e.key)})})]})}export{s as default};
|