@webority/ui-react 0.122.0 → 0.125.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/canvas-kit/kit.js +31039 -32190
- package/dist/canvas-kit/manifest.json +115 -2
- package/dist/canvas-kit/release.json +6 -6
- 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/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/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/AppCountryFlag.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/AppDetailPane.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/AppFileTiles.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/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/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/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/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/AppPhoneNumberInput.js +1 -1
- package/dist/components/AppPopover.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/AppRowSwitch.js +1 -0
- 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/AppSectionLeadCapture.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/AppSeoHead.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/AppSkeleton.js +1 -1
- package/dist/components/AppSkeletonLines.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/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/AppTooltip.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/components/ModalIcons.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/toast.js +1 -1
- package/dist/components/toastStore.js +1 -1
- package/dist/components/useWuiControl.js +1 -1
- package/dist/components/warnInvalidValue.js +1 -1
- package/dist/components/warnUnknownProps.js +1 -1
- package/dist/components/withTooltip.js +1 -1
- package/dist/guidance.json +60 -1
- package/dist/lib/CheckField.js +1 -1
- package/dist/lib/DiscardPrompt.js +1 -1
- package/dist/lib/FieldMessage.js +1 -1
- package/dist/lib/FileItemRow.js +1 -1
- package/dist/lib/FocusPanel.js +1 -1
- package/dist/lib/emptyIllustration.js +1 -1
- package/dist/lib/fileItem.js +1 -1
- package/dist/lib/initials.js +1 -1
- package/dist/lib/pageScrollLock.js +1 -1
- package/dist/lib/qrCode.js +1 -1
- package/dist/lib/sectionShell.js +1 -1
- package/dist/lib/shellCookie.js +1 -1
- package/dist/lib/shortcutChip.js +1 -1
- package/dist/lib/useFileDrop.js +1 -1
- package/dist/lib/useFloatingStack.js +1 -1
- package/dist/lib/useListQuery.js +1 -1
- package/dist/lib/wuiMarker.js +1 -1
- package/dist/markdown-core/dist/citations.js +1 -0
- package/dist/markdown-core/dist/inline.js +1 -1
- package/dist/types/components/AppAutocomplete.d.ts +7 -1
- package/dist/types/components/AppMarkdown.d.ts +4 -0
- package/dist/types/components/AppRowSwitch.d.ts +23 -0
- package/dist/types/components/iconGlyphs.g.d.ts +8 -0
- package/dist/types/components/iconVariants.g.d.ts +40 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/ui-react.js +1 -1
- package/package.json +6 -6
|
@@ -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}from"react/jsx-runtime";var i=[1,2,3,4,5,6,7,8,9,10,11,12];function a(a){let{marker:o,props:s}=e(`AppFormRow`,a),{children:c,columns:l=2,collapse:u=!0,className:d=``,...f}=s;n(`AppFormRow`,f),t(`AppFormRow`,`columns`,l,i);let{style:p,...m}=f
|
|
1
|
+
import{splitMarkerProps 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=[1,2,3,4,5,6,7,8,9,10,11,12];function a(a){let{marker:o,props:s}=e(`AppFormRow`,a),{children:c,columns:l=2,collapse:u=!0,className:d=``,...f}=s;n(`AppFormRow`,f),t(`AppFormRow`,`columns`,l,i);let{style:p,...m}=f,h=[`form-row-grid`,`wui-form-cols-${Math.min(12,Math.max(1,Number(l)||2))}`,u===!1&&`wui-form-row-keep`,d].filter(Boolean).join(` `);return/* @__PURE__ */ r(`div`,{className:h,style:p,...o,...m,children:c})}export{a 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=[`stacked`,`side`],o=[`top`,`start`],s=[`comfortable`,`compact`],c=[2,3,4],l=[`body`,`display`],u=[`line`,`none`];function d(d){let{marker:f,props:p}=e(`AppFormSection`,d),{children:m,title:h,description:g,layout:_=`stacked`,labels:v=`top`,density:y=`comfortable`,headingLevel:b=3,titleFont:x=`body`,titleSize:S,rule:C=`line`,className:w=``,...T}=p;n(`AppFormSection`,T);let{style:E,...D}=T;t(`AppFormSection`,`layout`,_,a),t(`AppFormSection`,`labels`,v,o),t(`AppFormSection`,`density`,y,s),t(`AppFormSection`,`headingLevel`,b,c),t(`AppFormSection`,`titleFont`,x,l),t(`AppFormSection`,`rule`,C,u);let O=c.includes(b)?`h${b}`:`h3
|
|
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=[`stacked`,`side`],o=[`top`,`start`],s=[`comfortable`,`compact`],c=[2,3,4],l=[`body`,`display`],u=[`line`,`none`];function d(d){let{marker:f,props:p}=e(`AppFormSection`,d),{children:m,title:h,description:g,layout:_=`stacked`,labels:v=`top`,density:y=`comfortable`,headingLevel:b=3,titleFont:x=`body`,titleSize:S,rule:C=`line`,className:w=``,...T}=p;n(`AppFormSection`,T);let{style:E,...D}=T;t(`AppFormSection`,`layout`,_,a),t(`AppFormSection`,`labels`,v,o),t(`AppFormSection`,`density`,y,s),t(`AppFormSection`,`headingLevel`,b,c),t(`AppFormSection`,`titleFont`,x,l),t(`AppFormSection`,`rule`,C,u);let O=c.includes(b)?`h${b}`:`h3`,k=[`form-section`,_===`side`?`wui-form-side`:``,v===`start`?`wui-form-labels-start`:``,y===`compact`?`wui-form-compact`:``,x===`display`?`wui-form-title-display`:``,C===`none`?`wui-form-rule-none`:``,w].filter(Boolean).join(` `),A=S==null&&E===void 0?void 0:{"--wui-form-title-size":S==null?void 0:`${S}px`,...E};return/* @__PURE__ */ i(`section`,{className:k,style:A,...f,...D,children:[(h!=null||g!=null)&&/* @__PURE__ */ i(`div`,{className:`form-section-head`,children:[h!=null&&/* @__PURE__ */ r(O,{className:`form-section-title`,children:h}),g!=null&&/* @__PURE__ */ r(`p`,{className:`form-section-desc`,children:g})]}),/* @__PURE__ */ r(`div`,{className:`form-section-body`,children:m})]})}export{d as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./warnUnknownProps.js";import{useEffect as n,useRef as r}from"react";import{jsx as i,jsxs as a}from"react/jsx-runtime";import"@webority/ui-elements/elements/hover-card";function o(o){let{marker:s,props:c}=e(`AppHoverCard`,o),{trigger:l,children:u,open:d,loading:f=!1,loadingLabel:p=`Loading`,label:m,openDelay:h,closeDelay:g,onOpenChange:_,className:v=``,...y}=c;t(`AppHoverCard`,y);let b=r(null),x=r(_);return x.current=_,n(()=>{let e=b.current;if(!e)return;let t=()=>x.current?.(!0),n=()=>x.current?.(!1);return e.addEventListener(`wui:hover-card:open`,t),e.addEventListener(`wui:hover-card:close`,n),()=>{e.removeEventListener(`wui:hover-card:open`,t),e.removeEventListener(`wui:hover-card:close`,n)}},[])
|
|
1
|
+
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./warnUnknownProps.js";import{useEffect as n,useRef as r}from"react";import{jsx as i,jsxs as a}from"react/jsx-runtime";import"@webority/ui-elements/elements/hover-card";function o(o){let{marker:s,props:c}=e(`AppHoverCard`,o),{trigger:l,children:u,open:d,loading:f=!1,loadingLabel:p=`Loading`,label:m,openDelay:h,closeDelay:g,onOpenChange:_,className:v=``,...y}=c;t(`AppHoverCard`,y);let b=r(null),x=r(_);return x.current=_,n(()=>{let e=b.current;if(!e)return;let t=()=>x.current?.(!0),n=()=>x.current?.(!1);return e.addEventListener(`wui:hover-card:open`,t),e.addEventListener(`wui:hover-card:close`,n),()=>{e.removeEventListener(`wui:hover-card:open`,t),e.removeEventListener(`wui:hover-card:close`,n)}},[]),/* @__PURE__ */ a(`wui-hover-card`,{ref:b,class:[`wui-hover-card`,v].filter(Boolean).join(` `),open:d?``:void 0,"open-delay":Number.isFinite(h)?h:void 0,"close-delay":Number.isFinite(g)?g:void 0,...s,...y,children:[/* @__PURE__ */ i(`span`,{className:`wui-hover-card-trigger`,children:l}),/* @__PURE__ */ i(`span`,{className:`wui-hover-card-panel`,role:`group`,"aria-label":m||void 0,"aria-busy":f?`true`:void 0,children:f?/* @__PURE__ */ a(`span`,{className:`wui-hover-card-loading`,role:`status`,children:[/* @__PURE__ */ i(`span`,{className:`wui-spinner wui-spinner-sm`,"aria-hidden":`true`}),/* @__PURE__ */ i(`span`,{children:p})]}):u})]})}export{o as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{devWarn as e}from"../lib/devWarn.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import{FULL_LINEAR_LOADERS as n,FULL_VARIANT_LOADERS as r,shardKey as i}from"./iconCatalogLoaders.g.js";import{ICON_NAMES as a}from"./iconCatalogNames.g.js";import{GLYPHS as o}from"./iconGlyphs.g.js";import s from"./warnInvalidValue.js";import c from"./warnUnknownProps.js";import l from"./withTooltip.js";import{useEffect as u,useState as d}from"react";import{jsx as f,jsxs as p}from"react/jsx-runtime";var m=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`],h=/* @__PURE__ */ new Set;function g(t,n){h.has(t)||(h.add(t),e(`[@webority/ui-react] The ${t} failed to load (${n?.message??n}); icons fall back to the linear default until a later render retries it.`))}var _=null,v=null,y=!1,b=/* @__PURE__ */ new Set;function x(){return v||=import(`./iconVariants.g.js`).then(e=>{_=e.VARIANT_GLYPHS,y=!1;for(let e of b)e();b.clear()}).catch(e=>{v=null,g(`curated icon variants chunk`,e),y?b.clear():(y=!0,setTimeout(()=>{for(let e of[...b])e()},1e3))}),v}var S=new Set(a),C=Object.create(null),w=Object.create(null),T=Object.create(null),E=Object.create(null);function D(e){let t=i(e),r=n[t];return r?(w[t]||=r().then(e=>{Object.assign(C,e.FULL_GLYPHS),E[t]=!1;let n=T[t];if(n){for(let e of n)e();n.clear()}}).catch(e=>{w[t]=null,g(`full icon catalogue '${t}' shard`,e),E[t]?T[t]?.clear():(E[t]=!0,setTimeout(()=>{for(let e of[...T[t]||[]])e()},1e3))}),w[t]):null}var O=Object.create(null),k=Object.create(null),A=Object.create(null),j=Object.create(null);function M(e,t){let n=r[e];if(!n)return null;let a=i(t),o=n[a];if(!o)return null;let s=`${e}:${a}`;return k[s]||=o().then(t=>{O[e]||(O[e]=Object.create(null)),Object.assign(O[e],t.FULL_VARIANT_GLYPHS),j[s]=!1;let n=A[s];if(n){for(let e of n)e();n.clear()}}).catch(t=>{k[s]=null,g(`${e} icon catalogue '${a}' shard`,t),j[s]?A[s]?.clear():(j[s]=!0,setTimeout(()=>{for(let e of[...A[s]||[]])e()},1e3))}),k[s]}var N=a,P=/* @__PURE__ */ new Map;function F(e){for(let[t,n]of Object.entries(e))P.set(t,n)}function I(e){let{marker:n,props:r}=t(`AppIcon`,e),{name:a,size:h=16,variant:g,tooltip:v,tooltipPlacement:y,className:w,color:E,style:k,...j}=r;c(`AppIcon`,j),s(`AppIcon`,`variant`,g,m);let N=!!g&&g!==`linear`,F=v!=null&&v!==``,I=(e,t=!0)=>F?l(/* @__PURE__ */ f(`span`,{className:`wui-icon-tip`,role:`img`,"aria-label":v,...t?n:void 0,children:e}),v,y):e,L=o[a]!==void 0,R=!L&&S.has(a),[,z]=d(0);u(()=>{let e=()=>z(e=>e+1);N&&L&&!_&&(b.add(e),x());let t=R?i(a):null;R&&C[a]===void 0&&(T[t]||=/* @__PURE__ */ new Set,T[t].add(e),D(a));let n=N&&R?`${g}:${i(a)}`:null;return N&&R&&O[g]?.[a]===void 0&&(A[n]||=/* @__PURE__ */ new Set,A[n].add(e),M(g,a)),()=>{b.delete(e),t&&T[t]?.delete(e),n&&A[n]?.delete(e)}},[a,N,L,R,g]);let B=P.get(a);if(B)return I(B({size:h,color:E,className:w,style:k}),!1);if(a===`hard-hat`)return I(/* @__PURE__ */ f(`svg`,{width:h,height:h,viewBox:`0 0 24 24`,fill:`none`,className:w?`wui-icon ${w}`:`wui-icon`,"data-icon":a,"aria-hidden":`true`,style:{color:E,...k},...F?void 0:n,...j,children:/* @__PURE__ */ p(`g`,{fill:`currentColor`,children:[/* @__PURE__ */ f(`circle`,{cx:`12`,cy:`7.5`,r:`4.2`}),/* @__PURE__ */ f(`path`,{d:`M3.2 22.5C3.2 17.4 7.5 14.9 11 14.7L12 17.4l1-2.7C16.5 14.9 20.8 17.4 20.8 22.5z`})]})}));let V=N&&(_?.[g]?.[a]||R&&O?.[g]?.[a])||o[a]||C[a];return V?I(/* @__PURE__ */ f(`svg`,{width:h,height:h,viewBox:`0 0 24 24`,fill:`none`,className:w?`wui-icon ${w}`:`wui-icon`,"data-icon":a,"aria-hidden":`true`,style:{color:E,...k},dangerouslySetInnerHTML:{__html:V},...F?void 0:n,...j})):null}export{I as default,N as iconNames,F as registerIcons};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"../lib/FieldMessage.js";import t from"../lib/useFileDrop.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import ee from"./AppAlert.js";import r from"./AppButton.js";import i from"./AppIcon.js";import te from"./AppModal.js";import ne from"./AppRequiredMark.js";import a from"./warnInvalidValue.js";import re from"./warnUnknownProps.js";import ie from"./withTooltip.js";import{AVATAR_ACCEPT as ae,AVATAR_MAX_SIZE_MB as o,AVATAR_OUTPUT_SIZE as oe,AVATAR_OUTPUT_TYPE as s,AVATAR_PREVIEW_SIZES as se,AVATAR_TEXT as c,DEFAULT_IMAGE_ACCEPT as l,DEFAULT_MAX_SIZE_MB as ce,avatarUnreadableMessage as u,validateFile as le}from"@webority/ui-elements/helpers";import{useCallback as ue,useEffect as de,useId as fe,useRef as pe,useState as d}from"react";import{Fragment as me,jsx as f,jsxs as p}from"react/jsx-runtime";import"@webority/ui-elements/elements/image-crop";var he=[`logo`,`avatar`],ge=[`overlay`,`buttons`],_e=[`stacked`,`inline`,`profile`],ve=[`initials`,`avatar`],ye=[`circle`,`rounded`,`square`],be=[`keep`,`image/webp`],xe=se.join(` `),Se={logo:{controls:`overlay`,accept:l,maxSizeMb:ce,crop:void 0,rotatable:!1,previews:!1,camera:!1,outputSize:void 0,outputType:`keep`,variant:`initials`,sizes:{sm:72,md:120,lg:160}},avatar:{controls:`buttons`,accept:ae,maxSizeMb:o,crop:1,rotatable:!0,previews:!0,camera:!0,outputSize:oe,outputType:s,variant:`avatar`,sizes:{sm:64,md:96,lg:128}}},Ce=`That image could not be cropped. Choose another one.`,we=`That image could not be opened. Choose another one.`,Te={dialogSize:`lg`,dialogTitle:`Crop photo`,dialogSubtitle:`Drag the frame and zoom to choose what to keep.`,save:`Apply`,cancel:`Cancel`,cropFailed:Ce,unreadable:()=>we},Ee={dialogSize:void 0,dialogTitle:c.dialogTitle,dialogSubtitle:c.dialogSubtitle,save:c.save,cancel:c.cancel,cropFailed:c.cropFailed,unreadable:u};function m(ae){let{marker:o,props:oe}=n(`AppImagePicker`,ae),{kind:s=`logo`,controls:se,value:l,fallback:ce,variant:u,name:Ce,onPick:we,onRemove:m,removeName:h,loading:g=!1,disabled:De=!1,accept:Oe,maxSizeMb:ke,shape:_=`circle`,size:v=`md`,crop:Ae,rotatable:je,previews:Me,camera:Ne,outputSize:Pe,outputType:Fe,layout:y=`stacked`,title:Ie,subtitle:Le,overlayIcon:Re=`image`,overlayLabel:ze=`Update photo`,removeLabel:b=`Remove photo`,ariaLabel:Be,label:Ve,hint:x,error:He,required:Ue=!1,optional:We=!1,className:Ge=``,fieldClassName:S=``,style:C,...w}=oe;re(`AppImagePicker`,w),a(`AppImagePicker`,`kind`,s,he),a(`AppImagePicker`,`controls`,se,ge),a(`AppImagePicker`,`variant`,u,ve),a(`AppImagePicker`,`layout`,y,_e),a(`AppImagePicker`,`shape`,_,ye),a(`AppImagePicker`,`outputType`,Fe,be);let T=Se[s]??Se.logo,E=s===`avatar`?Ee:Te,D=T.sizes;a(`AppImagePicker`,`size`,typeof v==`string`?v:null,Object.keys(D));let Ke=(se??T.controls)===`overlay`,qe=u??T.variant,O=Oe??T.accept,k=ke??T.maxSizeMb,Je=Pe??T.outputSize,Ye=Fe??T.outputType,Xe=je??T.rotatable,Ze=Me??T.previews,Qe=Ne??T.camera,A=Ae??T.crop,j=A===`free`?null:typeof A==`number`&&Number.isFinite(A)&&A>0?A:void 0;A!=null&&j===void 0&&a(`AppImagePicker`,`crop`,String(A),[`free`,`a positive number`]);let M=j!==void 0&&Je===void 0,N=pe(null),$e=pe(null),P=pe(null),F=fe(),[I,L]=d(null),[et,R]=d(!1),[tt,z]=d(!1),[nt,B]=d(``),[V,H]=d(null),[U,rt]=d(!1),[W,G]=d(`loading`),[it,K]=d(``),at=ue(e=>{if(P.current=e,!e)return;let t=()=>{G(`ready`),e.querySelector(`.wui-crop-stage`)?.focus()},n=()=>G(`error`);return e.addEventListener(`load`,t),e.addEventListener(`error`,n),()=>{e.removeEventListener(`load`,t),e.removeEventListener(`error`,n),P.current=null}},[]);de(()=>()=>V&&URL.revokeObjectURL(V.url),[V]),de(()=>()=>I&&URL.revokeObjectURL(I),[I]);let[ot,st]=d(l);l!==ot&&(st(l),L(null),R(!1),z(!1));let q=g||De,J=et?null:I||(l&&!tt?l:null),ct=!!J,Y=He||nt,X=x&&!Y?`${F}-hint`:void 0,Z=Y?`${F}-error`:void 0,lt=Z||X,ut=!q&&ct&&(!!I||!!m||!!h),dt=ct?c.change:c.choose,ft=typeof v==`number`?v:D[v]??D.md,pt=()=>{q||N.current?.click()},mt=()=>{q||$e.current?.click()},ht=e=>{if(Ce&&N.current&&typeof DataTransfer==`function`){let t=new DataTransfer;t.items.add(e),N.current.files=t.files}R(!1),z(!1),L(URL.createObjectURL(e)),we(e)},gt=e=>{let t=j!==void 0&&e.type!==`image/svg+xml`,n=le(e,{accept:O,maxSizeMb:t&&M?0:k});n?B(n):(B(``),t?(G(`loading`),K(``),H({file:e,url:URL.createObjectURL(e)})):ht(e))},{dragOver:_t,dropProps:vt}=t({accept:O,maxSizeMb:M?0:k,disabled:q,onFiles:e=>gt(e[0]),onReject:({message:e})=>B(e)}),yt=e=>{let t=Ye===`keep`?e.type:Ye;return Je===void 0?{name:e.name,type:t,maxBytes:k>0?k*1024*1024:0}:{name:e.name||`photo`,type:t,size:Je}},bt=async()=>{let{file:e}=V;rt(!0),K(``);let t=null;try{t=await P.current?.toFile(yt(e))}catch{t=null}if(rt(!1),!t)K(E.cropFailed);else if(H(null),M){let e=le(t,{accept:O,maxSizeMb:k});e?B(e):ht(t)}else ht(t)},xt=()=>{U||H(null)},St=e=>{let t=e.target.files?.[0];e.target.value=``,t&>(t)},Ct=()=>{L(null),R(!0),B(``),N.current&&(N.current.value=``),m?.()},Q=j!==void 0&&/* @__PURE__ */ p(te,{open:!!V,title:E.dialogTitle,subtitle:E.dialogSubtitle,size:E.dialogSize,staticBackdrop:!0,dismissible:!U,onClose:xt,footer:/* @__PURE__ */ p(me,{children:[/* @__PURE__ */ f(r,{type:`button`,variant:`secondary`,disabled:U,onClick:xt,children:E.cancel}),/* @__PURE__ */ f(r,{type:`button`,variant:`primary`,loading:U,disabled:W!==`ready`,onClick:bt,children:E.save})]}),children:[W===`error`&&V&&/* @__PURE__ */ f(ee,{tone:`danger`,children:E.unreadable(V.file)}),it&&/* @__PURE__ */ f(ee,{tone:`danger`,children:it}),V&&W!==`error`&&/* @__PURE__ */ f(`wui-image-crop`,{ref:at,src:V.url,aspect:j??`free`,round:j===1&&_===`circle`,rotatable:Xe,previews:Ze?xe:void 0})]}),wt=h&&/* @__PURE__ */ f(`input`,{type:`hidden`,name:h,value:`true`,disabled:!et}),$=Ve&&/* @__PURE__ */ p(`label`,{className:`label`,htmlFor:F,children:[Ve,We&&!Ue&&/* @__PURE__ */ f(`span`,{className:`label-optional`,children:` (optional)`}),Ue&&/* @__PURE__ */ f(ne,{})]}),Tt=/* @__PURE__ */ f(`input`,{id:F,ref:N,type:`file`,name:Ce,hidden:!0,accept:O,disabled:q,onChange:St});if(!Ke){let t=ft,n=Qe&&/* @__PURE__ */ p(`button`,{type:`button`,className:`btn btn-secondary btn-sm wui-image-picker-buttons-camera`,disabled:q,onClick:mt,children:[/* @__PURE__ */ f(i,{name:`camera`,size:16}),c.camera]});return/* @__PURE__ */ p(`div`,{...o,className:`field wui-image-picker-field${S?` ${S}`:``}`,children:[$,/* @__PURE__ */ p(`div`,{className:`wui-image-picker-buttons${_t?` is-dragging`:``}${Ge?` ${Ge}`:``}`,style:{"--wui-avatar-size":`${t}px`,...C},...vt,children:[/* @__PURE__ */ p(`button`,{type:`button`,className:`wui-image-picker-buttons-face`,tabIndex:-1,"aria-label":Be??dt,"aria-describedby":lt,"aria-busy":g||void 0,disabled:q,onClick:pt,...w,children:[J?/* @__PURE__ */ f(`img`,{className:`wui-image-picker-buttons-img`,src:J,alt:``,onError:()=>z(!0)}):/* @__PURE__ */ f(`span`,{className:`wui-image-picker-buttons-placeholder`,"aria-hidden":`true`,children:ce||/* @__PURE__ */ f(i,{name:`user`,size:Math.round(t*.5)})}),/* @__PURE__ */ f(`span`,{className:`wui-image-picker-buttons-badge`,"aria-hidden":`true`,children:g?/* @__PURE__ */ f(i,{name:`refresh-cw`,size:14,className:`wui-spin`}):/* @__PURE__ */ f(i,{name:`camera`,size:14})})]}),/* @__PURE__ */ p(`div`,{className:`wui-image-picker-buttons-actions`,children:[/* @__PURE__ */ f(r,{variant:`secondary`,size:`sm`,disabled:q,"aria-describedby":lt,onClick:pt,children:dt}),n,/* @__PURE__ */ f(r,{variant:`secondary-danger`,size:`sm`,"data-wui-image-picker-remove":!0,hidden:!ut,onClick:Ct,children:b})]}),Tt,Qe&&/* @__PURE__ */ f(`input`,{ref:$e,type:`file`,hidden:!0,accept:`image/*`,capture:`user`,disabled:q,onChange:St}),wt]}),/* @__PURE__ */ f(e,{error:Y,hint:x,errorId:Z,hintId:X}),Q]})}let Et=ft,Dt=Math.max(14,Math.round(Et*.18)),Ot=Math.round(Et*.5),kt=`wui-image-picker${qe===`avatar`?` wui-image-picker-avatar`:``}${_===`rounded`?` wui-image-picker-rounded`:_===`square`?` wui-image-picker-square`:``}${_t?` is-dragging`:``}`,At=y===`inline`,jt=y===`profile`,Mt=[`field`,`wui-image-picker-field`,At&&`wui-image-picker-field-inline`,jt&&`wui-image-picker-field-profile`,Ge,S].filter(Boolean).join(` `),Nt=/* @__PURE__ */ p(`div`,{className:`wui-image-picker-shell`,style:{"--wui-logo-size":`${Et}px`},children:[/* @__PURE__ */ f(`button`,{type:`button`,className:kt,onClick:pt,disabled:q,"aria-busy":g||void 0,"aria-label":Be??`Upload photo`,"aria-describedby":Z||X,...vt,...w,children:/* @__PURE__ */ p(`span`,{className:`wui-image-picker-ring`,"data-overlay-label":ze,children:[J?/* @__PURE__ */ f(`img`,{className:`wui-image-picker-img`,src:J,alt:``,onError:()=>z(!0)}):/* @__PURE__ */ f(`span`,{className:`wui-image-picker-logo`,children:ce||qe===`avatar`&&/* @__PURE__ */ f(i,{name:`user`,size:Ot})}),g?/* @__PURE__ */ f(`span`,{className:`wui-image-picker-overlay is-loading`,"aria-hidden":`true`,children:/* @__PURE__ */ f(i,{name:`refresh-cw`,size:Dt,className:`wui-spin`})}):!De&&/* @__PURE__ */ p(`span`,{className:`wui-image-picker-overlay`,children:[/* @__PURE__ */ f(i,{name:Re,size:Dt}),/* @__PURE__ */ f(`span`,{children:ze})]})]})}),ie(/* @__PURE__ */ f(`button`,{type:`button`,className:`wui-image-picker-remove`,hidden:!ut,"aria-label":b,"data-wui-image-picker-remove":!0,onClick:Ct,children:/* @__PURE__ */ f(i,{name:`x`,size:14})}),ut?b:null),Tt,wt]}),Pt=x&&!Y?/* @__PURE__ */ f(`div`,{className:`wui-image-picker-hint`,id:X,children:x}):null,Ft=Y?/* @__PURE__ */ f(e,{error:Y,errorId:Z}):null,It=/* @__PURE__ */ p(`div`,{className:`wui-image-picker-meta`,children:[Ie&&/* @__PURE__ */ f(`div`,{className:`wui-image-picker-title`,children:Ie}),Le&&/* @__PURE__ */ f(`div`,{className:`wui-image-picker-subtitle`,children:Le}),Pt,Ft]});return At?/* @__PURE__ */ p(`div`,{...o,className:Mt,style:C,children:[$,/* @__PURE__ */ p(`div`,{className:`wui-image-picker-row`,children:[Nt,It]}),Q]}):jt?/* @__PURE__ */ p(`div`,{...o,className:Mt,style:C,children:[$,Nt,It,Q]}):/* @__PURE__ */ p(`div`,{...o,className:Mt,style:C,children:[$,Nt,Pt,Ft,Q]})}export{m as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./
|
|
1
|
+
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./AppIcon.js";import n from"./AppPopover.js";import r from"./warnInvalidValue.js";import i from"./warnUnknownProps.js";import{useState as a}from"react";import{jsx as o}from"react/jsx-runtime";var s={sm:` infotip-popover-sm`,md:``,lg:` infotip-popover-lg`,xl:` infotip-popover-xl`};function c(c){let{marker:l,props:u}=e(`AppInfoTip`,c),{label:d,children:f,placement:p=`auto`,width:m=`md`,className:h=``,...g}=u;i(`AppInfoTip`,g),r(`AppInfoTip`,`width`,m,Object.keys(s));let[_,v]=a(!1),y=!!d;return!y&&!f?null:/* @__PURE__ */ o(`span`,{className:`infotip${h?` ${h}`:``}`,...l,...g,children:/* @__PURE__ */ o(n,{trigger:/* @__PURE__ */ o(`button`,{type:`button`,className:`infotip-btn`,"aria-label":d||`More information`,children:/* @__PURE__ */ o(t,{name:`info`,size:16})}),title:y?d:void 0,placement:p,triggerType:[`hover`,`focus`],className:`infotip-popover${s[m]??``}`,onToggle:v,"aria-expanded":_,children:f})})}export{c as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./
|
|
1
|
+
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./AppIcon.js";import n from"./AppSelect.js";import r from"./warnInvalidValue.js";import i from"./warnUnknownProps.js";import{useEffect as a,useId as o,useRef as s,useState as c}from"react";import{jsx as l,jsxs as u}from"react/jsx-runtime";import"@webority/ui-elements/elements/datepicker";import{INLINE_EDIT_TEXT as d,INLINE_EDIT_TYPES as f,inlineEditText as p}from"@webority/ui-elements/elements/inline-edit";var m=e=>e==null?``:String(e),h=(e,t)=>t===`number`?e===``?null:Number(e):e;function g(g){let{marker:_,props:v}=e(`AppInlineEdit`,g),{value:y,onSave:b,type:x,options:S=[],label:C,placeholder:w,validate:T,renderValue:E,disabled:D=!1,className:O=``,id:k,...A}=v;i(`AppInlineEdit`,A),r(`AppInlineEdit`,`type`,x,f);let j=f.includes(x)?x:`text`,M=o(),N=k||`inline-edit-${M.replace(/[^a-zA-Z0-9_-]/g,``)}`,P=`${N}-error`,F=`${N}-control`,I=s(null),L=m(y),[R,z]=c(L),[B,V]=c(L);R!==L&&(z(L),V(L));let[H,U]=c(null),W=s(null);W.current={onSave:b,validate:T,kind:j},a(()=>{let e=I.current;if(e)return e.save=async e=>{U(e);try{await W.current.onSave?.(h(e,W.current.kind)),V(e)}finally{U(null)}},e.validate=e=>W.current.validate?.(h(e,W.current.kind))||null,()=>{e.save=void 0,e.validate=void 0}},[]);let G=H??B,K=p(G,{type:j,options:S,placeholder:w}),q=E&&!K.empty?E(h(G,j)):K.text,J={id:F,"data-wui-control":``,"aria-label":C},Y;if(j===`select`){let e=S.map(e=>({value:String(e.value),label:m(e.label??e.value)}));Y=/* @__PURE__ */ l(n,{id:F,"data-wui-control":``,"aria-label":C,size:`sm`,placeholder:w||void 0,options:e})}else Y=j===`date`?/* @__PURE__ */ l(`wui-datepicker`,{...J,size:`sm`,"aria-describedby":P,placeholder:w||void 0}):j===`textarea`?/* @__PURE__ */ l(`textarea`,{...J,className:`form-control textarea`,rows:3,"aria-describedby":P,placeholder:w||void 0}):/* @__PURE__ */ l(`input`,{...J,type:j===`number`?`number`:`text`,inputMode:j===`number`?`decimal`:void 0,className:`form-control input input-sm`,"aria-describedby":P,placeholder:w||void 0});return/* @__PURE__ */ u(`wui-inline-edit`,{ref:I,id:N,class:O?`wui-inline-edit ${O}`:`wui-inline-edit`,type:j,label:C,value:B,placeholder:w||void 0,disabled:D?``:void 0,controlled:``,..._,...A,children:[/* @__PURE__ */ u(`button`,{type:`button`,className:`wui-inline-edit-display`,"data-wui-display":``,"aria-describedby":P,disabled:D,children:[/* @__PURE__ */ l(`span`,{className:`visually-hidden`,children:D?d.readOnly(C):d.edit(C)}),/* @__PURE__ */ l(`span`,{className:`wui-inline-edit-value`,"data-wui-value":``,"data-wui-empty":K.empty?``:void 0,children:q}),/* @__PURE__ */ l(`span`,{className:`wui-inline-edit-icon`,"aria-hidden":`true`,children:/* @__PURE__ */ l(t,{name:`edit`,size:14})})]}),/* @__PURE__ */ l(`span`,{className:`wui-inline-edit-editor`,"data-wui-editor":``,hidden:!0,children:Y}),/* @__PURE__ */ u(`span`,{className:`wui-inline-edit-status`,"aria-hidden":`true`,children:[/* @__PURE__ */ l(`span`,{className:`wui-inline-edit-spinner spinner-border spinner-border-sm`}),/* @__PURE__ */ l(`span`,{className:`wui-inline-edit-saved`,children:/* @__PURE__ */ l(t,{name:`tick-circle`,size:16})})]}),/* @__PURE__ */ l(`span`,{className:`wui-inline-edit-error`,id:P,"data-wui-error":``,hidden:!0}),/* @__PURE__ */ l(`span`,{className:`visually-hidden`,"data-wui-live":``,"aria-live":`polite`,"aria-atomic":`true`})]})}export{g as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
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"./AppIcon.js";import ee from"./AppInfoTip.js";import te from"./AppPopover.js";import i from"./AppRequiredMark.js";import a from"./warnInvalidValue.js";import ne from"./warnUnknownProps.js";import{MASK_INPUT_TYPES as re,MASK_NAMES as ie,attachInputMask as ae,evaluatePassword as oe,formatMasked as o,isMaskPattern as se,postedMasked as ce}from"@webority/ui-elements/helpers";import{forwardRef as le,useEffect as s,useId as ue,useRef as c,useState as l}from"react";import{Form as u}from"react-bootstrap";import{jsx as d,jsxs as f}from"react/jsx-runtime";var de=[`sm`,`md`,`lg`,`xl`],fe=[`bare`],pe=[`off`,`border`,`above`],me=[`off`,`shown`],p=le(function(le,p){let{marker:he,props:ge}=n(`AppInput`,le),{label:m,required:h=!1,optional:g=!1,error:_e,hint:ve,help:ye,helpLabel:be=`More information`,type:_=`text`,size:v=`md`,leftIcon:y,rightIcon:b,onRightIconClick:xe,rightIconLabel:Se,unit:x,id:Ce,name:we,className:Te=``,fieldClassName:S=``,disabled:C=!1,readOnly:w=!1,clearable:T=!1,showCount:E=!1,maxLength:D,prefix:O,suffix:k,action:A,floatingLabel:j=`off`,variant:M,passwordRequirements:N=`off`,passwordPolicy:Ee,requirementsPlacement:P=`auto`,mask:F,postFormatted:I=!1,onMaskChange:L,...R}=ge;ne(`AppInput`,R),a(`AppInput`,`size`,v,de),a(`AppInput`,`variant`,M,fe),a(`AppInput`,`floatingLabel`,j,pe),a(`AppInput`,`passwordRequirements`,N,me),s(()=>{g&&h&&typeof process<`u`&&process.env.NODE_ENV!==`production`&&e(`AppInput: optional and required together; optional ignored`)},[g,h]),F!=null&&!se(F)&&a(`AppInput`,`mask`,F,ie),F!=null&&a(`AppInput`,`type`,_,re);let[z,De]=l(!1),[Oe,ke]=l(``),B=_e||Oe,Ae=ue(),V=Ce||Ae,H=_===`password`,je=H&&z?`text`:_,U=c(null),Me=e=>{U.current=e,typeof p==`function`?p(e):p&&(p.current=e)},W=String(R.value??R.defaultValue??``),[Ne,G]=l(()=>!!W),[Pe,Fe]=l(()=>W.length),Ie=T&&!C&&!w,K=T||E,q=H&&N===`shown`,[Le,Re]=l(W);s(()=>{q&&R.value!==void 0&&Re(String(R.value??``))},[R.value,q]),s(()=>{if(!K||R.value===void 0)return;let e=String(R.value??``);G(!!e),Fe(e.length)},[R.value,K]);let ze=e=>{G(!!e.target.value),Fe(e.target.value.length),R.onInput?.(e)},Be=e=>{q&&Re(e.target.value),K?ze(e):R.onInput?.(e)},Ve=F?{...R.value!==void 0&&{value:o(F,R.value)},...R.defaultValue!==void 0&&{defaultValue:o(F,R.defaultValue)}}:null,He=c(L);He.current=L,s(()=>{let e=U.current;if(F&&e)return ae(e,{mask:F,postFormatted:I,onChange:(e,t)=>He.current?.(e,t),onInvalidChange:ke})},[F,I]);let J=e=>F&&!I&&e?t=>{let n=t.target,r=new Proxy(n,{get:(e,t)=>{if(t===`value`)return ce(F,e.value);let n=Reflect.get(e,t,e);return typeof n==`function`?n.bind(e):n}});e(Object.create(t,{target:{value:r}}))}:e,Ue=Ie?/* @__PURE__ */ d(`button`,{type:`button`,className:`input-clear`,onClick:()=>{let e=U.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,`value`)?.set;t?t.call(e,``):e.value=``,e.dispatchEvent(new Event(`input`,{bubbles:!0})),G(!1),e.focus()},"aria-label":`Clear`,tabIndex:-1,hidden:!Ne,children:/* @__PURE__ */ d(r,{name:`x`,size:16})}):null,We=B&&V?`${V}-error`:void 0,Ge=ve&&V?`${V}-hint`:void 0,Y=q&&P===`inline`,Ke=Y&&V?`${V}-requirements`:void 0,qe=We||(Y?Ke:Ge),Je=[`input`,v===`sm`?`input-sm`:``,v===`lg`?`input-lg`:``,v===`xl`?`wui-input-xl`:``,B?`error`:``,H?`pw`:``,x?`num-input`:``,!(j!==`off`&&m||O||k||x||H||b)&&T&&Ie?`has-clear`:``,M===`bare`?`input-bare`:``,Te].filter(Boolean).join(` `),X=/* @__PURE__ */ d(u.Control,{id:V,name:we,type:je,className:Je,disabled:C,readOnly:w,required:h,"aria-invalid":B?`true`:`false`,"aria-describedby":qe,maxLength:D,...R,onChange:J(R.onChange),onBlur:J(R.onBlur),...Ve,placeholder:j===`off`?R.placeholder:` `,ref:Me,onInput:K||q?Be:R.onInput}),Z=Ee??!0,Ye=Z&&typeof Z==`object`&&Z.title||`Password requirements`,Xe=q?oe(Le,Z):null,Q=q?/* @__PURE__ */ d(`ul`,{className:`pw-criteria`,"aria-live":`polite`,id:Ke,"aria-label":Y?Ye:void 0,children:Xe.map(e=>/* @__PURE__ */ f(`li`,{className:`pw-rule ${e.met?`met`:`unmet`}`,children:[/* @__PURE__ */ d(`span`,{className:`pw-mark`,"aria-hidden":`true`}),/* @__PURE__ */ d(`span`,{className:`pw-rule-text`,children:e.label}),/* @__PURE__ */ d(`span`,{className:`visually-hidden`,children:e.met?`: met`:`: not met`})]},e.key))}):null,$;if(j!==`off`&&m&&!H)$=/* @__PURE__ */ f(`div`,{className:j===`above`?`field-float wui-float-above`:`field-float`,children:[X,/* @__PURE__ */ f(`label`,{className:`float-label`,htmlFor:V,children:[m,h&&/* @__PURE__ */ d(i,{})]})]});else if(A)$=/* @__PURE__ */ f(`div`,{className:`input-action-row`,children:[/* @__PURE__ */ f(`div`,{className:y?`input-icon`:`input-wrap`,children:[y&&/* @__PURE__ */ d(`span`,{className:`ic`,children:/* @__PURE__ */ d(r,{name:y,size:16})}),X]}),/* @__PURE__ */ d(`div`,{className:`input-action`,children:A})]});else if(O||k)$=/* @__PURE__ */ f(`div`,{className:`input-affixed`,children:[O!=null&&/* @__PURE__ */ d(`span`,{className:`affix affix-pre`,children:O}),X,k!=null&&/* @__PURE__ */ d(`span`,{className:`affix affix-suf`,children:k})]});else if(x)$=/* @__PURE__ */ f(`div`,{className:`input-with-unit`,children:[X,/* @__PURE__ */ d(`span`,{className:`unit`,children:x})]});else if(H){let e=/* @__PURE__ */ f(`button`,{type:`button`,className:`pw-toggle${z?` pw-revealed`:``}`,onClick:()=>De(e=>!e),"aria-label":z?`Hide password`:`Show password`,tabIndex:-1,children:[/* @__PURE__ */ d(r,{name:`eye`,size:18,className:`pw-eye`}),/* @__PURE__ */ d(r,{name:`eye-off`,size:18,className:`pw-eye-off`})]}),t=j!==`off`&&m?/* @__PURE__ */ d(`div`,{className:j===`above`?`field-float wui-float-above`:`field-float`,children:/* @__PURE__ */ f(`div`,{className:`input-wrap`,children:[X,e,/* @__PURE__ */ f(`label`,{className:`float-label`,htmlFor:V,children:[m,h&&/* @__PURE__ */ d(i,{})]})]})}):/* @__PURE__ */ f(`div`,{className:y?`input-icon`:`input-wrap`,children:[y&&/* @__PURE__ */ d(`span`,{className:`ic`,children:/* @__PURE__ */ d(r,{name:y,size:16})}),X,e]});$=q&&!Y?/* @__PURE__ */ d(te,{trigger:t,triggerType:`focus`,placement:P,title:Ye,className:`pw-popover`,children:Q}):t}else $=b?/* @__PURE__ */ f(`div`,{className:`input-wrap`,children:[X,/* @__PURE__ */ d(`button`,{type:`button`,className:`pw-toggle`,onClick:xe,disabled:!xe,tabIndex:-1,"aria-label":Se||b,children:/* @__PURE__ */ d(r,{name:b,size:18})})]}):T?/* @__PURE__ */ f(`div`,{className:y?`input-icon`:`input-wrap`,children:[y&&/* @__PURE__ */ d(`span`,{className:`ic`,children:/* @__PURE__ */ d(r,{name:y,size:16})}),X,Ue]}):y?/* @__PURE__ */ f(`div`,{className:`input-icon`,children:[/* @__PURE__ */ d(`span`,{className:`ic`,children:/* @__PURE__ */ d(r,{name:y,size:16})}),X]}):X;return/* @__PURE__ */ f(u.Group,{...he,className:`field${S?` ${S}`:``}`,children:[m&&j===`off`&&/* @__PURE__ */ f(u.Label,{className:`label`,htmlFor:V,children:[m,g&&!h&&/* @__PURE__ */ d(`span`,{className:`label-optional`,children:` (optional)`}),h&&/* @__PURE__ */ d(i,{}),ye&&/* @__PURE__ */ d(ee,{label:be,children:ye})]}),$,Y&&/* @__PURE__ */ d(`div`,{className:`wui-pw-inline`,children:Q}),/* @__PURE__ */ d(t,{error:B,hint:Y?null:ve,errorId:We,hintId:Ge}),E&&/* @__PURE__ */ f(`div`,{className:`field-count${D&&Pe>=D?` at-limit`:``}`,children:[Pe,D?` / ${D}`:``]})]})});export{p as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./
|
|
1
|
+
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./AppRequiredMark.js";import n from"./warnInvalidValue.js";import r from"./warnUnknownProps.js";import{cloneElement as i}from"react";import{jsx as a,jsxs as o}from"react/jsx-runtime";var s={sm:`wui-addon-group-sm`,md:``,lg:`wui-addon-group-lg`},c=e=>typeof e==`string`||typeof e==`number`?/* @__PURE__ */ a(`span`,{className:`wui-addon`,children:e}):e;function l(l){let{marker:u,props:d}=e(`AppInputGroup`,l),{children:f,leading:p,trailing:m,label:h,htmlFor:g,required:_=!1,size:v=`md`,className:y=``,...b}=d;r(`AppInputGroup`,b),n(`AppInputGroup`,`size`,v,Object.keys(s));let x=/* @__PURE__ */ o(`div`,{className:[`wui-addon-group`,s[v]??``,h?``:y].filter(Boolean).join(` `),...h?{}:b,children:[c(p),f,c(m)]});return h?/* @__PURE__ */ o(`div`,{className:[`field`,y].filter(Boolean).join(` `),...u,...b,children:[/* @__PURE__ */ o(`label`,{className:`label`,htmlFor:g,children:[h,_&&/* @__PURE__ */ a(t,{})]}),x]}):i(x,u)}export{l as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./
|
|
1
|
+
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./AppIcon.js";import{errorToast as n}from"./toast.js";import r from"./warnInvalidValue.js";import i from"./warnUnknownProps.js";import{formatValue as a}from"@webority/ui-elements/helpers";import{useEffect as o,useId as s,useMemo as c,useRef as l,useState as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{KANBAN_SUMMARY_FORMATS as p,KANBAN_TEXT as m,KANBAN_TONES as h,kanbanOverflow as g,kanbanSummaryFormat as _,kanbanVisibleLimit as v,sumKanbanValues as ee}from"@webority/ui-elements/elements/kanban";var te=e=>e.key??e.id,y=e=>e.column,b=[`rupees`,`paise`],ne=[`inline`,`stacked`];function x(x){let{marker:S,props:C}=e(`AppKanban`,x),{columns:w,cards:T,renderCard:E,renderColumnActions:D,getCardKey:O=te,getCardColumn:k=y,getCardValue:A,cardLabel:j,isCardLocked:re,onLocked:ie,onMove:ae,accept:oe,filter:se,boardId:ce,ariaLabel:le=`Board`,emptyText:ue=m.empty,readOnly:de=!1,swipeHint:M=!1,fill:N=!1,columnWidth:P,fillOffset:F,activeCardKey:I,headLayout:L=`inline`,summaryFormat:R,summaryUnit:z,className:B=``,id:V,...H}=C;if(!Array.isArray(w))throw Error(`<AppKanban> columns is required: pass the board's stage columns.`);if(!Array.isArray(T))throw Error(`<AppKanban> cards is required: pass the cards, an empty array for an empty board.`);i(`AppKanban`,H),r(`AppKanban`,`summaryFormat`,R,p),r(`AppKanban`,`summaryUnit`,z,b),r(`AppKanban`,`headLayout`,L,ne);for(let e of w)r(`AppKanban`,`columns[].tone`,e.tone,h);let fe=s(),U=V||`kanban-${fe.replace(/[^a-zA-Z0-9_-]/g,``)}`,W=l(null),[G,K]=u(()=>/* @__PURE__ */ new Map),[q,pe]=u(()=>/* @__PURE__ */ new Set),[me,J]=u(()=>/* @__PURE__ */ new Set),he=c(()=>new Map(T.map(e=>[String(O(e)),e])),[T,O]),Y=l(null);Y.current={accept:oe,onMove:ae,onLocked:ie,byKey:he,columns:w};let X=R&&p.includes(R)&&(z==null||b.includes(z))?_(R,z):null,Z=c(()=>{let e=new Map(w.map(e=>[e.key,[]])),t=[];for(let n of T){let r=String(O(n)),i=G.get(r);i?t.push([n,i]):e.get(k(n))?.push(n)}for(let[n,r]of t){let t=e.get(r.to);t&&t.splice(Math.min(r.index,t.length),0,n)}return e},[w,T,G,O,k]);o(()=>{let e=W.current;if(!e)return;e.accept=(e,t,n)=>{let r=Y.current.accept;return!r||r(Y.current.byKey.get(e.getAttribute(`data-wui-card`)),t,n)};let t=e=>{let{key:t,from:r,to:i,index:a}=e.detail,o=Y.current.onMove,s=Y.current.byKey.get(t);if(!o||!s)return;let c=Y.current.columns.find(e=>e.key===i)?.visibleLimit!=null;c&&J(e=>new Set(e).add(t)),K(e=>new Map(e).set(t,{to:i,index:a}));let l=()=>K(e=>{let n=new Map(e);return n.delete(t),n}),u;try{u=o({card:s,key:t,from:r,to:i,index:a})}catch(e){u=Promise.reject(e)}Promise.resolve(u).then(l,e=>{l(),c&&J(e=>{let n=new Set(e);return n.delete(t),n}),n(e?.message||m.failed.server)})},r=e=>{let{key:t,reason:n}=e.detail,r=Y.current.byKey.get(t);r&&Y.current.onLocked?.({card:r,key:t,reason:n})};return e.addEventListener(`wui:kanban:move`,t),e.addEventListener(`wui:kanban:locked`,r),()=>{e.removeEventListener(`wui:kanban:move`,t),e.removeEventListener(`wui:kanban:locked`,r),e.accept=void 0}},[]);let Q=e=>se?.(e)!==!1,ge=(e,t)=>{q.has(e)&&J(e=>{let n=new Set(e);for(let e of t)n.delete(String(O(e)));return n}),pe(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n})},$={};return P!=null&&($[`--wui-kanban-column-width`]=`${P}px`),F!=null&&($[`--wui-kanban-fill-offset`]=`${F}px`),/* @__PURE__ */ f(`wui-kanban`,{ref:W,id:U,class:B?`wui-kanban ${B}`:`wui-kanban`,role:`region`,"aria-label":le,"board-id":ce||void 0,"summary-format":X?R:void 0,"summary-unit":X&&z?z:void 0,readonly:de?``:void 0,fill:N?``:void 0,"data-head-layout":L===`stacked`?`stacked`:void 0,style:$,controlled:``,...S,...H,children:[/* @__PURE__ */ d(`nav`,{className:`wui-kanban-switcher`,"aria-label":`Board columns`,children:w.map((e,t)=>/* @__PURE__ */ f(`button`,{type:`button`,className:`wui-kanban-switch`,"data-wui-switch":e.key,"aria-controls":`${U}-${e.key}`,"aria-current":t===0?`true`:void 0,children:[/* @__PURE__ */ d(`span`,{className:`wui-kanban-switch-title`,children:e.title}),/* @__PURE__ */ d(`span`,{className:`wui-kanban-count`,"data-wui-count":``,children:(Z.get(e.key)||[]).filter(Q).length})]},e.key))}),M&&/* @__PURE__ */ f(`p`,{className:`wui-kanban-hint`,"aria-hidden":`true`,children:[/* @__PURE__ */ d(t,{name:`arrow-swap-horizontal`,size:14}),m.swipeHint]}),/* @__PURE__ */ d(`div`,{className:`wui-kanban-board`,"data-wui-scroller":``,children:w.map(e=>{let n=`${U}-${e.key}`,r=Z.get(e.key)||[],i=r.filter(Q),o=!!(e.collapsible&&e.collapsed),s=v(e.visibleLimit),c=q.has(e.key),l=g(i.map(e=>String(O(e))),s,c,me),u=typeof e.summary==`function`?e.summary(i):e.summary;X&&(u=a(ee(i.map(e=>A?.(e))),X));let p=D?.(e,i);return/* @__PURE__ */ f(`section`,{className:`wui-kanban-column`,id:n,"data-wui-column":e.key,"data-tone":e.tone&&h.includes(e.tone)?e.tone:`neutral`,"aria-labelledby":`${n}-title`,"data-accept-from":e.acceptFrom?e.acceptFrom.join(` `):void 0,"data-collapsible":e.collapsible?``:void 0,"data-collapsed":o?``:void 0,children:[/* @__PURE__ */ f(`header`,{className:`wui-kanban-head`,children:[/* @__PURE__ */ d(`span`,{className:`wui-kanban-dot`,"aria-hidden":`true`}),/* @__PURE__ */ d(`h2`,{className:`wui-kanban-title`,id:`${n}-title`,children:e.href?/* @__PURE__ */ d(`a`,{href:e.href,children:e.title}):e.title}),/* @__PURE__ */ d(`span`,{className:`wui-kanban-count`,"data-wui-count":``,children:i.length}),e.collapsible&&/* @__PURE__ */ d(`span`,{className:`wui-kanban-lock`,"aria-hidden":`true`,children:/* @__PURE__ */ d(t,{name:`lock`,size:14})}),p!=null&&p!==!1&&/* @__PURE__ */ d(`div`,{className:`wui-kanban-actions`,"data-wui-no-drag":``,children:p}),e.collapsible&&/* @__PURE__ */ d(`button`,{type:`button`,className:`wui-kanban-collapse`,"data-wui-collapse":``,"aria-expanded":o?`false`:`true`,"aria-controls":`${n}-body`,"aria-label":o?m.expand(e.title):m.collapse(e.title),children:/* @__PURE__ */ d(t,{name:`chevron-left`,size:16})}),u!=null&&/* @__PURE__ */ d(`div`,{className:`wui-kanban-summary`,"data-wui-summary":``,children:u})]}),/* @__PURE__ */ d(`p`,{className:`wui-kanban-drop-note`,"data-wui-drop-note":``,hidden:!0}),/* @__PURE__ */ d(`div`,{className:`wui-kanban-body`,id:`${n}-body`,"data-wui-body":``,children:r.map(e=>{let t=String(O(e)),n=G.has(t);return/* @__PURE__ */ d(`article`,{className:`wui-kanban-card`,"data-wui-card":t,tabIndex:0,"aria-label":j?j(e):void 0,"data-wui-locked":re?.(e)?``:void 0,"data-wui-value":A?A(e)??void 0:void 0,"aria-current":I!=null&&t===String(I)?`true`:void 0,"aria-busy":n?`true`:void 0,"data-wui-saving":n?``:void 0,"data-wui-overflow":l.has(t)?``:void 0,hidden:!Q(e),children:E?.(e)},t)})}),s!=null&&/* @__PURE__ */ d(`button`,{type:`button`,className:`wui-kanban-more`,"data-wui-more":``,"aria-controls":`${n}-body`,"aria-expanded":c?`true`:`false`,hidden:c?i.length<=s:l.size===0,onClick:()=>ge(e.key,r),children:c?m.fewer:m.more(l.size)}),/* @__PURE__ */ d(`p`,{className:`wui-kanban-empty`,"data-wui-empty":``,hidden:i.length>0,children:e.emptyText??ue})]},e.key)})}),/* @__PURE__ */ d(`p`,{className:`visually-hidden`,id:`${U}-help`,"data-wui-help":``,children:m.help}),/* @__PURE__ */ d(`div`,{className:`visually-hidden`,"data-wui-live":``,"aria-live":`polite`,"aria-atomic":`true`})]})}export{x as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./warnUnknownProps.js";import{shortcutKey as n}from"@webority/ui-elements/helpers";import{jsx as r}from"react/jsx-runtime";function i(i){let{marker:a,props:o}=e(`AppKbd`,i),{children:s,className:c=``,...l}=o;t(`AppKbd`,l);let u=typeof s==`string`||typeof s==`number`?n(s):s;return r(`kbd`,{className:[`wui-kbd`,c].filter(Boolean).join(` `),...a,...l,children:u})}export{i as default};
|
|
1
|
+
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./warnUnknownProps.js";import{shortcutKey as n}from"@webority/ui-elements/helpers";import{jsx as r}from"react/jsx-runtime";function i(i){let{marker:a,props:o}=e(`AppKbd`,i),{children:s,className:c=``,...l}=o;t(`AppKbd`,l);let u=typeof s==`string`||typeof s==`number`?n(s):s;return/* @__PURE__ */ r(`kbd`,{className:[`wui-kbd`,c].filter(Boolean).join(` `),...a,...l,children:u})}export{i as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./
|
|
1
|
+
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./AppIcon.js";import n from"./AppSparkline.js";import r from"./renderIconProp.js";import i from"./warnInvalidValue.js";import a from"./warnUnknownProps.js";import{isValidElement as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";var l=[`plain`,`filled`,`accent`,`spotlight`],u=[`sm`,`md`,`lg`],d=[`primary`,`success`,`warning`,`danger`,`info`,`neutral`],f=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`],p=[`up`,`down`,`flat`],m=[`success`,`danger`,`neutral`],h={success:` wui-kpi-delta--success`,danger:` wui-kpi-delta--danger`,neutral:` wui-kpi-delta--neutral`};function g(e){return e==null||typeof e==`boolean`?``:typeof e==`string`||typeof e==`number`?String(e):Array.isArray(e)?e.map(g).join(``):o(e)?g(e.props?.children):``}function _(e){let t=g(e).trim();return t.startsWith(`+`)?`up`:t.startsWith(`-`)||t.startsWith(`−`)?`down`:`flat`}function v(o){let{marker:g,props:v}=e(`AppKpiTile`,o),{label:y,value:b,caption:x,icon:S,iconTone:C,iconVariant:w,delta:T,deltaDirection:E,deltaTone:D,sparkline:O,variant:k=`plain`,size:A=`md`,valueSize:j,inline:M=!1,attention:N=!1,href:P,linkComponent:F,className:I=``,style:L,iconClassName:R=``,labelClassName:z=``,valueClassName:B=``,captionClassName:V=``,deltaClassName:H=``,sparklineClassName:U=``,...W}=v;a(`AppKpiTile`,W),i(`AppKpiTile`,`variant`,k,l),i(`AppKpiTile`,`size`,A,u),i(`AppKpiTile`,`iconTone`,C,d),i(`AppKpiTile`,`iconVariant`,w,f),i(`AppKpiTile`,`deltaDirection`,E,p),i(`AppKpiTile`,`deltaTone`,D,m);let G=`kpi${M?` kpi-inline`:``}${k===`filled`?` kpi-filled`:k===`accent`?` kpi-accent`:k===`spotlight`?` kpi-spotlight`:``}${A===`lg`?` kpi-lg`:A===`sm`?` kpi-sm`:``}${N?` kpi-attention`:``}${I?` ${I}`:``}`,K=typeof j==`number`&&j>0?{...L,"--wui-kpi-value-size":`${j}px`}:L,q=E??_(T),J=q===`up`?`arrow-up`:q===`down`?`arrow-down`:null,Y=Object.hasOwn(h,D??``)?h[D]:``,X=P==null?`div`:F||`a`,Z=P==null?{}:F?{to:P}:{href:P};return/* @__PURE__ */ c(X,{className:G,style:K,...g,...W,...Z,children:[S&&/* @__PURE__ */ s(`span`,{className:`kpi-icon${C?` kpi-icon-${C}`:``}${R?` ${R}`:``}`,children:r(S,{size:20,variant:w})}),/* @__PURE__ */ s(`div`,{className:`kpi-label${z?` ${z}`:``}`,children:y}),/* @__PURE__ */ s(`div`,{className:`kpi-value${B?` ${B}`:``}`,children:b}),x&&/* @__PURE__ */ s(`div`,{className:`kpi-caption${V?` ${V}`:``}`,children:x}),T&&/* @__PURE__ */ c(`div`,{className:`kpi-delta${q===`flat`?``:` ${q}`}${Y}${H?` ${H}`:``}`,children:[J&&/* @__PURE__ */ s(t,{name:J,size:13}),T]}),O&&O.length>0&&/* @__PURE__ */ s(n,{data:O,className:`kpi-sparkline${U?` ${U}`:``}`})]})}export{v as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./warnUnknownProps.js";import{useEffect as n,useRef as r}from"react";import{jsx as i}from"react/jsx-runtime";import"@webority/ui-elements/elements/lightbox";function a(a){let{marker:o,props:s}=e(`AppLightbox`,a),{items:c=[],download:l=!1,label:u,openIndex:d,onChange:f,onClose:p,className:m=``,...h}=s;t(`AppLightbox`,h);let g=r(null),_=r({onChange:f,onClose:p});return n(()=>{_.current={onChange:f,onClose:p}}),n(()=>{let e=g.current,t=e=>_.current.onChange?.(e.detail.index),n=()=>_.current.onClose?.();return e.addEventListener(`wui-lightbox:change`,t),e.addEventListener(`wui-lightbox:close`,n),()=>{e.removeEventListener(`wui-lightbox:change`,t),e.removeEventListener(`wui-lightbox:close`,n)}},[])
|
|
1
|
+
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./warnUnknownProps.js";import{useEffect as n,useRef as r}from"react";import{jsx as i}from"react/jsx-runtime";import"@webority/ui-elements/elements/lightbox";function a(a){let{marker:o,props:s}=e(`AppLightbox`,a),{items:c=[],download:l=!1,label:u,openIndex:d,onChange:f,onClose:p,className:m=``,...h}=s;t(`AppLightbox`,h);let g=r(null),_=r({onChange:f,onClose:p});return n(()=>{_.current={onChange:f,onClose:p}}),n(()=>{let e=g.current,t=e=>_.current.onChange?.(e.detail.index),n=()=>_.current.onClose?.();return e.addEventListener(`wui-lightbox:change`,t),e.addEventListener(`wui-lightbox:close`,n),()=>{e.removeEventListener(`wui-lightbox:change`,t),e.removeEventListener(`wui-lightbox:close`,n)}},[]),/* @__PURE__ */ i(`wui-lightbox`,{ref:g,class:[`wui-lightbox`,m].filter(Boolean).join(` `),download:l?``:void 0,label:u||void 0,"open-index":Number.isInteger(d)?d:void 0,...o,...h,children:c.map(e=>/* @__PURE__ */ i(`a`,{className:`wui-lightbox-item`,href:e.src,"data-caption":e.caption||void 0,"data-name":e.name||void 0,children:/* @__PURE__ */ i(`img`,{src:e.thumb||e.src,alt:e.alt??e.caption??``,loading:`lazy`})},e.key??e.src))})}export{a as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{devWarn as e}from"../lib/devWarn.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./AppIcon.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={sm:13,md:15,lg:18},l=[`underline`,`underline-center`,`static`,`slide`,`icon`,`highlight`,`bracket`,`fade`,`grow`,`glow`,`shine`,`none`];function u(e,t,r){if(!e)return null;let i=`wui-link__ic wui-link__ic--${t}`;return typeof e==`string`?/* @__PURE__ */ o(`span`,{className:i,children:/* @__PURE__ */ o(n,{name:e,size:c[r]??c.md})}):/* @__PURE__ */ o(`span`,{className:i,children:e})}function d(n){let{marker:d,props:f}=t(`AppLink`,n),{children:p,label:m,href:h,animation:g=`underline`,leftIcon:_=null,rightIcon:v=null,size:y=`md`,surface:b=`default`,external:x=!1,disabled:S=!1,linkComponent:C,className:w=``,...T}=f;i(`AppLink`,T),r(`AppLink`,`animation`,g,l),r(`AppLink`,`size`,y,Object.keys(c)),r(`AppLink`,`surface`,b,[`default`,`dark`]),!h&&T.onClick&&!C&&e(`[@webority/ui-react] AppLink has onClick but no href, so it renders an anchor that keyboards cannot reach. Use AppButton for an action, or pass href.`);let E=l.includes(g)?g:`underline`,D=E===`icon`&&!v&&!_?`arrow-right`:v,O=[`wui-link`,`wui-link--${E}`,y===`md`?``:`wui-link--${y}`,S?`is-disabled`:``,b===`dark`?`wui-link--surface-dark`:``,w].filter(Boolean).join(` `),k=/* @__PURE__ */ s(a,{children:[u(_,`left`,y),/* @__PURE__ */ o(`span`,{className:`wui-link__label`,children:p??m}),u(D,`right`,y)]});if(S){let e={...T};return delete e.onClick,delete e.type,/* @__PURE__ */ o(`span`,{className:O,"aria-disabled":`true`,...d,...e,children:k})}return C&&!x?/* @__PURE__ */ o(C,{className:O,to:h,...d,...T,children:k}):/* @__PURE__ */ o(`a`,{className:O,href:h,target:x?`_blank`:void 0,rel:x?`noopener noreferrer`:void 0,...d,...T,children:k})}export{d as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{linkTarget as e,webRoute as t}from"../markdown-core/dist/links.js";import{parseInline as n}from"../markdown-core/dist/inline.js";import{parseMarkdown as r}from"../markdown-core/dist/parse.js";import{splitMarkerProps as i}from"../lib/wuiMarker.js";import a from"./AppChip.js";import o from"./AppCodeBlock.js";import s from"./AppLink.js";import c from"./warnInvalidValue.js";import l from"./warnUnknownProps.js";import{Fragment as u,useMemo as d}from"react";import{jsx as f,jsxs as p}from"react/jsx-runtime";import"@webority/ui-elements/elements/markdown";var m=[`text`,`json`,`js`,`cs`,`sql`,`bash`,`http`,`html`,`css`];function h(e){let{marker:t,props:n}=i(`AppMarkdown`,e),{value:a,className:o=``,linkComponent:s,resolveLink:u,isCitation:p,onOpenCitation:m,links:h=`web`,headings:g=`outline`,..._}=n;l(`AppMarkdown`,_),c(`AppMarkdown`,`links`,h,[`app`,`web`]),c(`AppMarkdown`,`headings`,g,[`outline`,`text`]);let v=d(()=>r(a),[a]),y={links:h,headings:g,resolveLink:u,linkComponent:s,isCitation:p,onOpenCitation:m};return/* @__PURE__ */ f(`wui-markdown`,{class:[`wui-markdown`,o].filter(Boolean).join(` `),...t,..._,children:v.map(e=>/* @__PURE__ */ f(C,{block:e,options:y},e.key))})}function g({token:n,options:r}){let i=/* @__PURE__ */ f(_,{tokens:n.children,options:r}),a=e(n.href,r.links,r.resolveLink);if(a?.kind===`app`){let e=t(a.target);return e?/* @__PURE__ */ f(s,{href:e,linkComponent:r.linkComponent,animation:`static`,children:i}):i}return a?.kind===`web`?/* @__PURE__ */ f(s,{href:a.href,external:!0,animation:`static`,children:i}):a?.kind===`contact`?/* @__PURE__ */ f(s,{href:a.href,animation:`static`,children:i}):i}function _({tokens:e,options:t}){return e.map(e=>{switch(e.type){case`code`:return/* @__PURE__ */ f(`code`,{children:e.text},e.key);case`strong`:return/* @__PURE__ */ f(`strong`,{children:/* @__PURE__ */ f(_,{tokens:e.children,options:t})},e.key);case`em`:return/* @__PURE__ */ f(`em`,{children:/* @__PURE__ */ f(_,{tokens:e.children,options:t})},e.key);case`strike`:return/* @__PURE__ */ f(`del`,{children:/* @__PURE__ */ f(_,{tokens:e.children,options:t})},e.key);case`image`:return/* @__PURE__ */ p(u,{children:[`[`,/* @__PURE__ */ f(_,{tokens:e.children,options:t}),`]`]},e.key);case`link`:return/* @__PURE__ */ f(g,{token:e,options:t},e.key);case`citation`:return/* @__PURE__ */ f(a,{label:e.text,size:`sm`,tone:`primary`,variant:`outline`,"aria-label":e.text,className:`wui-markdown-citation`,onClick:t.onOpenCitation?()=>t.onOpenCitation(e.text):void 0},e.key);default:return/* @__PURE__ */ f(u,{children:e.text},e.key)}})}function v({text:e,options:t}){return/* @__PURE__ */ f(_,{tokens:n(e,{isCitation:t.isCitation}),options:t})}function y({lines:e,options:t}){return e.map((e,n)=>/* @__PURE__ */ p(u,{children:[n>0&&/* @__PURE__ */ f(`br`,{}),/* @__PURE__ */ f(v,{text:e,options:t})]},n))}function b({block:e,options:t}){let n=e=>/* @__PURE__ */ f(v,{text:e,options:t});return/* @__PURE__ */ f(`div`,{className:`table-responsive`,children:/* @__PURE__ */ p(`table`,{className:`table`,children:[/* @__PURE__ */ f(`thead`,{children:/* @__PURE__ */ f(`tr`,{children:e.header.map((e,t)=>/* @__PURE__ */ f(`th`,{scope:`col`,children:n(e)},t))})}),/* @__PURE__ */ f(`tbody`,{children:e.rows.map((t,r)=>/* @__PURE__ */ f(`tr`,{children:e.header.map((e,r)=>/* @__PURE__ */ f(`td`,{children:n(t[r]??``)},r))},r))})]})})}function x(e,t,n){let{items:r}=e,{depth:i,ordered:a,number:o}=r[t],s=[],c=t;for(;c<r.length&&r[c].depth>=i;)if(r[c].depth>i){let t=x(e,c,n);s[s.length-1].nested=t.node,c=t.next}else s.push({item:r[c],index:c,nested:null}),c+=1;let l=s.map(({item:t,index:r,nested:i})=>/* @__PURE__ */ p(`li`,{children:[/* @__PURE__ */ f(v,{text:t.text,options:n}),i]},`${e.key}-${r}`));return{node:a?/* @__PURE__ */ f(`ol`,{start:a&&o!==1?o:void 0,children:l},`${e.key}-${t}`):/* @__PURE__ */ f(`ul`,{children:l},`${e.key}-${t}`),next:c}}function S(e,t){let n=[],r=0;for(;r<e.items.length;){let i=x(e,r,t);n.push(i.node),r=i.next}return n}function C({block:e,options:t}){switch(e.type){case`paragraph`:return/* @__PURE__ */ f(`p`,{children:/* @__PURE__ */ f(y,{lines:e.lines,options:t})});case`quote`:return/* @__PURE__ */ f(`blockquote`,{children:/* @__PURE__ */ f(y,{lines:e.lines,options:t})});case`heading`:{let n=/* @__PURE__ */ f(v,{text:e.text,options:t});return t.headings===`text`?/* @__PURE__ */ f(`p`,{className:`fw-semibold`,children:n}):/* @__PURE__ */ f(`h2`,{children:n})}case`list`:return S(e,t);case`table`:return/* @__PURE__ */ f(b,{block:e,options:t});case`code`:return/* @__PURE__ */ f(o,{code:e.text,language:m.includes(e.language)?e.language:`text`});case`rule`:return/* @__PURE__ */ f(`hr`,{});default:return null}}export{h as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"../lib/FieldMessage.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./AppInfoTip.js";import r from"./AppRequiredMark.js";import i from"./useWuiControl.js";import a from"./warnUnknownProps.js";import"@webority/ui-elements/elements/mention-input";import{forwardRef as o,useEffect as s,useId as c}from"react";import{jsx as l,jsxs as u}from"react/jsx-runtime";var d=o(function(o,d){let{marker:f,props:p}=t(`AppMentionInput`,o),{value:m,onChange:h,people:g,loadPeople:_,minChars:v,debounce:y,onSubmit:b,rows:x=3,placeholder:S,disabled:C=!1,name:w,id:T,label:E,error:D,hint:O,required:k=!1,help:A,helpLabel:j=`More information`,className:M=``,fieldClassName:N=``,...P}=p;a(`AppMentionInput`,P);let F=typeof _==`function`,I=c(),L=T||`mention-${I.replace(/[^a-zA-Z0-9_-]/g,``)}`,R=D?`${L}-error`:O?`${L}-hint`:void 0,{setRef:z,innerRef:B}=i({ref:d,value:m??``,on:{change:e=>{e.target===e.currentTarget&&h?.(e.currentTarget.value,{mentions:e.currentTarget.mentions})},"wui:mention-input:submit":()=>b?.()}});return s(()=>{let e=B.current;e&&!F&&(e.people=g||[])},[g,F,B]),s(()=>{let e=B.current;if(!e||!F)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 _(r.detail.query,{signal:n?.signal});i===t&&(e.people=a||[])}catch{i===t&&(e.people=[])}finally{i===t&&(e.loading=!1)}};return e.addEventListener(`search`,r),()=>{t=-1,n?.abort(),e.removeEventListener(`search`,r),e.loading=!1}},[F,_,B]),/* @__PURE__ */ u(`div`,{...f,className:`field${N?` ${N}`:``}`,children:[E&&/* @__PURE__ */ u(`label`,{className:`label`,htmlFor:`${L}-text`,children:[E,k&&/* @__PURE__ */ l(r,{}),A&&/* @__PURE__ */ l(n,{label:j,children:A})]}),/* @__PURE__ */ l(`wui-mention-input`,{ref:z,id:L,class:M?`wui-mention-input ${M}`:`wui-mention-input`,label:typeof E==`string`?E:void 0,placeholder:S||void 0,rows:String(x),name:w||void 0,remote:F?``:void 0,"min-chars":v==null?void 0:String(v),debounce:y==null?void 0:String(y),disabled:C?``:void 0,"aria-describedby":R,"aria-invalid":D?`true`:void 0,...P}),/* @__PURE__ */ l(e,{error:D,hint:O,errorId:`${L}-error`,hintId:`${L}-hint`})]})});export{d as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import{cloneElement as r}from"react";import{jsx as i,jsxs as a}from"react/jsx-runtime";var o=[`high`,`low`],s=[`sm`,`md`],c=[`info`,`success`,`warning`,`danger`,`neutral`];function l(e,t,n){let r=n-t;if(!(r>0))return 0;let i=Math.min(100,Math.max(0,(e-t)/r*100));return Number(i.toFixed(2))}function u(e,t,n,r,i){if(t==null&&n==null)return i;let a=`mid`;return t!=null&&e<=t?a=`low`:n!=null&&e>=n&&(a=`high`),r===`low`?a===`low`?`success`:a===`high`?`danger`:`warning`:a===`high`?`success`:a===`low`?`danger`:`warning`}function d(d){let{marker:f,props:p}=e(`AppMeter`,d),{value:m=0,min:h=0,max:g=100,tone:_=`info`,optimum:v=`high`,low:y,high:b,size:x=`md`,label:S,showLabel:C=!1,className:w=``,...T}=p;n(`AppMeter`,T),t(`AppMeter`,`tone`,_,c),t(`AppMeter`,`optimum`,v,o),t(`AppMeter`,`size`,x,s);let E=u(m,y,b,v,c.includes(_)?_:`info`),D=l(m,h,g),O=C&&!!S,k
|
|
1
|
+
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import{cloneElement as r}from"react";import{jsx as i,jsxs as a}from"react/jsx-runtime";var o=[`high`,`low`],s=[`sm`,`md`],c=[`info`,`success`,`warning`,`danger`,`neutral`];function l(e,t,n){let r=n-t;if(!(r>0))return 0;let i=Math.min(100,Math.max(0,(e-t)/r*100));return Number(i.toFixed(2))}function u(e,t,n,r,i){if(t==null&&n==null)return i;let a=`mid`;return t!=null&&e<=t?a=`low`:n!=null&&e>=n&&(a=`high`),r===`low`?a===`low`?`success`:a===`high`?`danger`:`warning`:a===`high`?`success`:a===`low`?`danger`:`warning`}function d(d){let{marker:f,props:p}=e(`AppMeter`,d),{value:m=0,min:h=0,max:g=100,tone:_=`info`,optimum:v=`high`,low:y,high:b,size:x=`md`,label:S,showLabel:C=!1,className:w=``,...T}=p;n(`AppMeter`,T),t(`AppMeter`,`tone`,_,c),t(`AppMeter`,`optimum`,v,o),t(`AppMeter`,`size`,x,s);let E=u(m,y,b,v,c.includes(_)?_:`info`),D=l(m,h,g),O=C&&!!S,k=`progress${x===`sm`?` progress-sm`:``}${!O&&w?` ${w}`:``}`,A=/* @__PURE__ */ i(`div`,{className:k,role:`meter`,"aria-valuenow":m,"aria-valuemin":h,"aria-valuemax":g,"aria-label":S||void 0,...T,children:/* @__PURE__ */ i(`div`,{className:`progress-bar wui-progress-${E}`,style:{width:`${D}%`}})});return O?/* @__PURE__ */ a(`div`,{...f,className:`wui-progress-labelled${w?` ${w}`:``}`,children:[/* @__PURE__ */ i(`div`,{className:`wui-progress-label`,"aria-hidden":`true`,children:S}),A]}):r(A,f)}export{d as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import{Fragment as r,jsx as i,jsxs as a}from"react/jsx-runtime";var o=[3,4,5],s=[`sm`,`md`],c=[`neutral`,`success`,`warning`,`danger`,`info`];function l(l){let{marker:u,props:d}=e(`AppMetricStrip`,l),{items:f=[],columns:p=4,size:m=`md`,className:h=``,...g}=d;
|
|
1
|
+
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import{Fragment as r,jsx as i,jsxs as a}from"react/jsx-runtime";var o=[3,4,5],s=[`sm`,`md`],c=[`neutral`,`success`,`warning`,`danger`,`info`];function l(l){let{marker:u,props:d}=e(`AppMetricStrip`,l),{items:f=[],columns:p=4,size:m=`md`,className:h=``,...g}=d;n(`AppMetricStrip`,g),t(`AppMetricStrip`,`columns`,p,o),t(`AppMetricStrip`,`size`,m,s);let _=[`wui-metric-strip`,`wui-metric-strip-cols-${p}`,m===`sm`?`wui-metric-strip-sm`:``,h].filter(Boolean).join(` `);return/* @__PURE__ */ i(`div`,{className:_,...u,...g,children:f.map((e,n)=>{t(`AppMetricStrip`,`tone`,e.tone,c);let o=`wui-metric${e.tone&&e.tone!==`neutral`?` wui-metric-tone-${e.tone}`:``}`,s=/* @__PURE__ */ a(r,{children:[/* @__PURE__ */ i(`div`,{className:`wui-metric-label`,children:e.label}),/* @__PURE__ */ i(`div`,{className:`wui-metric-value`,children:e.value}),e.note&&/* @__PURE__ */ i(`div`,{className:`wui-metric-note`,children:e.note})]}),l=`${e.label}-${n}`;return e.href?/* @__PURE__ */ i(`a`,{href:e.href,className:o,children:s},l):/* @__PURE__ */ i(`div`,{className:o,children:s},l)})})}export{l as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"../lib/DiscardPrompt.js";import{devWarn as t}from"../lib/devWarn.js";import{lockPageScroll as n}from"../lib/pageScrollLock.js";import{splitMarkerProps as r}from"../lib/wuiMarker.js";import i from"./AppIcon.js";import a from"./warnInvalidValue.js";import o from"./warnUnknownProps.js";import{useCallback as s,useEffect as c,useRef as l,useState as ee}from"react";import{Modal as te}from"react-bootstrap";import{jsx as u,jsxs as d}from"react/jsx-runtime";var ne=[`default`,`danger`,`success`,`warning`],f=[`center`,`top`],p=`a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])`,m={sm:380,md:440,lg:640,xl:880},h=`wui-modal-fullscreen`,g=!1;function re(){let e=!0;try{e=process.env.NODE_ENV!==`production`}catch{e=!0}e&&!g&&(g=!0,t("[@webority/ui-react] <AppModal hideHeader> has no accessible name: pass `ariaLabel` (or a string `title`)."))}function ie(e,t){if(e.key!==`Tab`)return;let n=Array.from(t.querySelectorAll(p));if(!n.length){e.preventDefault(),t.focus();return}let r=n[0],i=n[n.length-1],a=document.activeElement;e.shiftKey&&(a===r||a===t)?(e.preventDefault(),i.focus()):!e.shiftKey&&a===i&&(e.preventDefault(),r.focus())}function _(){let e=[];for(let t of document.body.children)t.hasAttribute(`inert`)||t.matches(`.modal, .modal-backdrop`)||(t.setAttribute(`inert`,``),e.push(t));return e}function ae(){return typeof document<`u`&&document.querySelector(`wui-drawer[open], .offcanvas.show`)!==null}function v(t){let{marker:g,props:v}=r(`AppModal`,t),{open:y,eyebrow:b,title:x,subtitle:S,headerIcon:C,tone:w=`default`,dismissible:T=!0,onClose:E,onBack:D,backLabel:O=`Back`,headerActions:k,footer:A,size:j=`md`,placement:M=`center`,hideHeader:N=!1,staticBackdrop:P=!1,confirmDiscard:F,dirty:oe=!1,ariaLabel:I,className:se=``,children:ce,...L}=v;o(`AppModal`,L),a(`AppModal`,`tone`,w,ne),a(`AppModal`,`placement`,M,f),a(`AppModal`,`size`,typeof j==`string`?j:null,[...Object.keys(m),`fullscreen`]);let{style:R,ref:z,"data-wui":B,"data-wui-props":V,...H}=L,U=B?{"data-wui":B,"data-wui-props":V}:g,W=U[`data-wui`],G=U[`data-wui-props`];N&&!I&&typeof x!=`string`&&re();let K=l(null),q=l(null),[J,Y]=ee(!1);c(()=>{y||Y(!1)},[y]),c(()=>{J&&q.current?.focus()},[J]),c(()=>{if(y)return n()},[y]),c(()=>{let e=K.current?.closest(`.modal`);e&&(F?e.setAttribute(`confirm-discard`,F):e.removeAttribute(`confirm-discard`))},[y,F]);let X=l(null),le=s(e=>{X.current=e,typeof z==`function`?z(e):z&&(z.current=e)},[z]);c(()=>{let e=X.current?.dialog;e&&(e.setAttribute(`data-wui`,W),G===void 0?e.removeAttribute(`data-wui-props`):e.setAttribute(`data-wui-props`,G))},[y,W,G]),c(()=>{if(!y)return;let e=K.current?.closest(`.modal-content`);if(!e)return;let t=()=>Array.from(e.querySelectorAll(p));(e.querySelector(`[data-autofocus]`)||t().find(e=>!e.classList.contains(`wui-modal-close`)&&!e.classList.contains(`wui-modal-back`))||t()[0]||e).focus?.();let n=e.closest(`.modal`),r=_(),i=e=>ie(e,n);return n?.addEventListener(`keydown`,i),()=>{n?.removeEventListener(`keydown`,i);for(let e of r)e.removeAttribute(`inert`);n&&setTimeout(()=>{n.isConnected&&!n.classList.contains(`show`)&&n.dispatchEvent(new Event(`transitionend`,{bubbles:!0}))},500)}},[y]);let Z=()=>{F&&oe?Y(!0):E?.()},ue=()=>{Y(!1),E?.()},de=()=>{Y(!1),(K.current?.querySelector(`input:not([type="hidden"]):not([disabled]),select:not([disabled]),textarea:not([disabled])`))?.focus()},Q=j===`fullscreen`,fe=typeof j==`number`?j:m[j]??m.md,pe=[`wui-modal`,w==="default"?``:`tone-${w}`,se].filter(Boolean).join(` `),$=y&&ae(),me=[`wui-modal-shell`,Q&&h,$&&`wui-modal-stacked`].filter(Boolean).join(` `);return/* @__PURE__ */ d(te,{...H,ref:le,show:y,onHide:Z,backdrop:!P||`static`,keyboard:!P,autoFocus:!1,enforceFocus:!0,restoreFocus:!0,centered:M!==`top`,className:me,style:Q?R:{"--wui-modal-max-width":`${fe}px`,...R},dialogClassName:`wui-rb-dialog`,contentClassName:pe,backdropClassName:$?`wui-modal-dim wui-modal-backdrop-stacked`:`wui-modal-dim`,"aria-label":I||(typeof x==`string`?x:void 0),children:[!N&&/* @__PURE__ */ d(`div`,{className:`wui-modal-header`,children:[D&&/* @__PURE__ */ u(`button`,{type:`button`,className:`wui-modal-back`,onClick:D,"aria-label":O,children:/* @__PURE__ */ u(i,{name:`arrow-left`,size:18})}),/* @__PURE__ */ d(`div`,{className:`wui-modal-heading`,children:[C&&/* @__PURE__ */ u(`span`,{className:`wui-modal-headicon`,children:/* @__PURE__ */ u(i,{name:C,size:18})}),/* @__PURE__ */ d(`div`,{className:`wui-modal-headtext`,children:[b&&/* @__PURE__ */ u(`div`,{className:`wui-modal-eyebrow`,children:b}),/* @__PURE__ */ u(`div`,{className:`wui-modal-title`,children:x}),S&&/* @__PURE__ */ u(`div`,{className:`wui-modal-subtitle`,children:S})]})]}),k&&/* @__PURE__ */ u(`div`,{className:`wui-modal-header-actions`,children:k}),T&&/* @__PURE__ */ u(`button`,{type:`button`,className:`wui-modal-close`,onClick:Z,"aria-label":`Close`,children:/* @__PURE__ */ u(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:/* @__PURE__ */ u(`path`,{d:`M18 6 6 18M6 6l12 12`})})})]}),/* @__PURE__ */ u(`div`,{className:`wui-modal-body`,ref:K,children:ce}),(A||J)&&/* @__PURE__ */ d(`div`,{className:J?`wui-modal-footer wui-drawer-discarding`:`wui-modal-footer`,children:[J&&/* @__PURE__ */ u(e,{text:F,confirmRef:q,onDiscard:ue,onKeep:de}),A]})]})}export{v as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"../lib/FieldMessage.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./AppInfoTip.js";import r from"./AppRequiredMark.js";import i from"./useNodeLabels.js";import a,{optionsEqual as o,readValues as s,writeValues as c}from"./useWuiControl.js";import l from"./warnInvalidValue.js";import u from"./warnUnknownProps.js";import{forwardRef as d,useEffect as f,useId as p}from"react";import{jsx as m,jsxs as h}from"react/jsx-runtime";import"@webority/ui-elements/elements/multiselect";var g=[`sm`,`lg`],_=[],v=(e,t)=>({...e,label:t}),y=d(function(d,y){let{marker:b,props:x}=t(`AppMultiSelect`,d),{values:S,onChange:C,options:w,placeholder:T=`Select…`,searchPlaceholder:E=`Search…`,searchable:D=!0,disabled:O=!1,icon:k,size:A,collapseChips:j=!1,allowCustom:M=!1,validateCustom:N,customPattern:P,customInvalidMessage:F,name:I,id:L,label:R,error:z,hint:B,required:V=!1,optional:H=!1,help:U,helpLabel:W=`More information`,fieldClassName:G=``,...K}=x;u(`AppMultiSelect`,K),l(`AppMultiSelect`,`size`,A,g);let q=p(),J=L||q,{setRef:Y,innerRef:X}=a({ref:y,value:S,onChange:C,readValue:s,writeValue:c}),Z=w||_,{portal:Q,toElementOptions:$}=i(Z);return f(()=>{let e=X.current;if(!e)return;let t=$(Z,v);o(t,e.options)||(e.options=t)},[Z,X,$]),f(()=>{let e=X.current;e&&(e.validateCustom=N??null)},[N,X]),/* @__PURE__ */ h(`div`,{...b,className:`field${G?` ${G}`:``}`,children:[R&&/* @__PURE__ */ h(`label`,{className:`label`,htmlFor:J,children:[R,H&&!V&&/* @__PURE__ */ m(`span`,{className:`label-optional`,children:` (optional)`}),V&&/* @__PURE__ */ m(r,{}),U&&/* @__PURE__ */ m(n,{label:W,children:U})]}),/* @__PURE__ */ m(`wui-multiselect`,{"aria-label":typeof R==`string`?R:void 0,"aria-describedby":z?`${J}-error`:B?`${J}-hint`:void 0,"aria-invalid":z?`true`:void 0,id:J,ref:Y,name:I,placeholder:T,"search-placeholder":E,icon:k||void 0,size:A||void 0,"collapse-chips":j?``:void 0,"allow-custom":M?``:void 0,"custom-pattern":P||void 0,"custom-invalid-message":F||void 0,searchable:D?``:void 0,disabled:O?``:void 0,required:V?``:void 0,...K}),Q,/* @__PURE__ */ m(e,{error:z,hint:B,errorId:`${J}-error`,hintId:`${J}-hint`})]})});export{y as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./
|
|
1
|
+
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./renderIconProp.js";import n from"./warnInvalidValue.js";import r from"./warnUnknownProps.js";import{Fragment as i,jsx as a,jsxs as o}from"react/jsx-runtime";var s=[`primary`,`info`,`success`,`warning`,`danger`,`neutral`];function c(t){let{marker:i,props:o}=e(`AppNavList`,t),{label:c,items:u=[],linkComponent:d,className:f=``,...p}=o;r(`AppNavList`,p);let m=d??`a`,h=e=>d?{to:e}:{href:e};return/* @__PURE__ */ a(`nav`,{className:[`wui-nav-list`,f].filter(Boolean).join(` `),"aria-label":c,...i,...p,children:u.map(e=>{if(e.divider)return/* @__PURE__ */ a(`hr`,{className:`wui-nav-list-divider`},e.key);if(n(`AppNavList`,`dotTone`,e.dotTone,s),e.icon&&e.dotTone)throw Error(`<AppNavList> item takes icon or dotTone, not both.`);let t=!!e.active,r=t?`wui-nav-list-item is-active`:`wui-nav-list-item`,i=t?`page`:void 0,o=l(e);return e.to?/* @__PURE__ */ a(m,{...h(e.to),className:r,"aria-current":i,children:o},e.key):/* @__PURE__ */ a(`button`,{type:`button`,className:r,"aria-current":i,children:o},e.key)})})}function l(e){return/* @__PURE__ */ o(i,{children:[u(e),/* @__PURE__ */ a(`span`,{className:`wui-nav-list-label`,children:e.label}),e.count>0?/* @__PURE__ */ a(`span`,{className:`wui-nav-list-count`,children:e.count}):null]})}function u(e){if(!e.dotTone)return t(e.icon,{size:18,className:`wui-nav-list-icon`});let n=s.includes(e.dotTone)?e.dotTone:`neutral`;return/* @__PURE__ */ a(`span`,{className:`wui-nav-list-dot tone-${n}`,"aria-hidden":`true`})}export{c as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./
|
|
1
|
+
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./renderIconProp.js";import n from"./warnUnknownProps.js";import{useId as r}from"react";import{jsx as i,jsxs as a}from"react/jsx-runtime";import"@webority/ui-elements/elements/navigation-menu";function o(o){let{marker:s,props:c}=e(`AppNavigationMenu`,o),{items:l=[],ariaLabel:u=`Main`,linkComponent:d,className:f=``,...p}=c;n(`AppNavigationMenu`,p);let m=r(),h=d??`a`,g=e=>d?{to:e}:{href:e};return/* @__PURE__ */ i(`wui-navigation-menu`,{class:[`wui-nav-menu`,f].filter(Boolean).join(` `),...s,...p,children:/* @__PURE__ */ i(`nav`,{"aria-label":u,children:/* @__PURE__ */ i(`ul`,{className:`wui-nav-menu-list`,children:l.map(e=>{if(!e.links?.length)return/* @__PURE__ */ i(`li`,{className:`wui-nav-menu-item`,children:/* @__PURE__ */ i(h,{...g(e.to),className:`wui-nav-menu-toplink`,"aria-current":e.current?`page`:void 0,children:e.label})},e.key);let n=`${m}-${e.key}`;return/* @__PURE__ */ a(`li`,{className:`wui-nav-menu-item`,children:[/* @__PURE__ */ a(`button`,{type:`button`,className:`wui-nav-menu-trigger`,"aria-expanded":`false`,"aria-controls":n,"data-key":e.key,children:[e.label,t(`chevron-down`,{size:14,className:`wui-nav-menu-chevron`})]}),/* @__PURE__ */ i(`div`,{className:`wui-nav-menu-panel`,id:n,children:/* @__PURE__ */ i(`ul`,{className:`wui-nav-menu-links`,children:e.links.map(e=>/* @__PURE__ */ i(`li`,{children:/* @__PURE__ */ a(h,{...g(e.to),className:`wui-nav-menu-link`,"aria-current":e.current?`page`:void 0,children:[t(e.icon,{size:18}),/* @__PURE__ */ a(`span`,{className:`wui-nav-menu-link-text`,children:[/* @__PURE__ */ i(`span`,{className:`wui-nav-menu-link-label`,children:e.label}),e.description?/* @__PURE__ */ i(`span`,{className:`wui-nav-menu-link-desc`,children:e.description}):null]})]})},e.key))})})]},e.key)})})})})}export{o as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./
|
|
1
|
+
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./AppIcon.js";import n from"./AppTabs.js";import r from"./warnInvalidValue.js";import i from"./warnUnknownProps.js";import{NOTIFICATION_TEXT as a,groupNotificationsByDay as o,notificationCountText as s,notificationTime as c,notificationTriggerLabel as l,notificationUnreadAnnouncement as u}from"@webority/ui-elements/helpers";import{useEffect as d,useId as f,useLayoutEffect as p,useRef as m,useState as h}from"react";import{Fragment as g,jsx as _,jsxs as v}from"react/jsx-runtime";import"@webority/ui-elements/elements/notification-center";var y=[`all`,`unread`,`archived`],b={all:`All`,unread:`Unread`,archived:`Archived`},x=`a, button, input, select, textarea`;function S(r){let{marker:c,props:g}=e(`AppNotificationCenter`,r),{items:y,unread:b,label:x=a.label,emptyText:S=a.empty,viewAllHref:E,defaultOpen:D=!1,now:O,onMarkAllRead:k,onItemClick:A,renderItem:j,tabs:M,onTabChange:N,onOpenChange:P,className:F=``,...I}=g;if(i(`AppNotificationCenter`,I),!Array.isArray(y))throw Error(`<AppNotificationCenter> items is required: pass the notifications, newest first.`);let L=C(M),[R,z]=h(L[0]?.key),B=L.some(e=>e.key===R)?R:L[0]?.key,V=e=>{e!==B&&(z(e),N?.(e))},H=f(),U=f(),W=m(null),G=m(P);G.current=P,d(()=>{let e=W.current,t=e=>G.current?.(e.detail.open);return e.addEventListener(`wui:notification-center:toggle`,t),()=>e.removeEventListener(`wui:notification-center:toggle`,t)},[]);let K=m(D);p(()=>{if(!K.current)return;let e=W.current;e.setAttribute(`open`,``),e.querySelector(`.wui-notification-center-trigger`)?.setAttribute(`aria-expanded`,`true`)},[]);let q=b??y.filter(e=>!e.read&&!e.archived).length,[J,Y]=h(``),X=m(q);d(()=>{X.current!==q&&(X.current=q,Y(u(q)))},[q]);let Z=o(L.length>0?w(y,B):y,O),Q=[`wui-notification-center`,F].filter(Boolean).join(` `);return/* @__PURE__ */ v(`wui-notification-center`,{ref:W,class:Q,label:x,controlled:``,...c,...I,children:[/* @__PURE__ */ v(`button`,{type:`button`,className:`topbar-icon-btn wui-notification-center-trigger`,"aria-expanded":K.current?`true`:`false`,"aria-controls":H,"aria-haspopup":`dialog`,"aria-label":l(x,q),children:[/* @__PURE__ */ _(t,{name:`notification`,size:20}),/* @__PURE__ */ _(`span`,{className:`wui-notification-center-count`,"aria-hidden":`true`,hidden:q===0,children:s(q)})]}),/* @__PURE__ */ _(`span`,{className:`visually-hidden wui-notification-center-live`,"aria-live":`polite`,children:J}),/* @__PURE__ */ v(`div`,{className:`wui-notification-center-panel`,id:H,role:`dialog`,"aria-labelledby":U,tabIndex:-1,children:[/* @__PURE__ */ v(`div`,{className:`wui-notification-center-head`,children:[/* @__PURE__ */ _(`h2`,{className:`wui-notification-center-title`,id:U,children:x}),k&&/* @__PURE__ */ _(`button`,{type:`button`,className:`wui-notification-center-markall`,disabled:q===0,onClick:k,children:a.markAll})]}),L.length>0&&/* @__PURE__ */ _(`div`,{className:`wui-notification-center-tabs`,children:/* @__PURE__ */ _(n,{tabs:L,value:B,onChange:V,size:`sm`,fitted:!0,ariaLabel:x})}),Z.length===0?/* @__PURE__ */ _(`p`,{className:`wui-notification-center-empty`,children:S}):/* @__PURE__ */ _(`div`,{className:`wui-notification-center-list`,children:Z.map(e=>/* @__PURE__ */ v(`section`,{"aria-labelledby":`${H}-${e.key}`,children:[/* @__PURE__ */ _(`h3`,{className:`wui-notification-center-day`,id:`${H}-${e.key}`,children:e.heading}),/* @__PURE__ */ _(`ul`,{className:`wui-notification-center-items`,children:e.items.map(e=>/* @__PURE__ */ _(`li`,{children:/* @__PURE__ */ _(T,{item:e,onItemClick:A,renderItem:j})},e.id))})]},e.key))}),E&&/* @__PURE__ */ _(`a`,{className:`wui-notification-center-foot`,href:E,children:a.viewAll})]})]})}function C(e){return e===!0?y.map(e=>({key:e,label:b[e]})):Array.isArray(e)?e.map(e=>(r(`AppNotificationCenter`,`tabs[].key`,e.key,y),{key:e.key,label:e.label??b[e.key]})):[]}function w(e,t){if(t===`archived`)return e.filter(e=>e.archived);let n=e.filter(e=>!e.archived);return t===`unread`?n.filter(e=>!e.read):n}function T({item:e,onItemClick:n,renderItem:r}){let i=`wui-notification-center-item${e.read?` wui-notification-center-item-read`:``}`,o=!e.read&&/* @__PURE__ */ _(`span`,{className:`visually-hidden wui-notification-center-unread-label`,children:a.unreadPrefix}),s=/* @__PURE__ */ _(`span`,{className:`wui-notification-center-dot`,"aria-hidden":`true`});if(r){let t=n?t=>{t.target.closest(x)||n(e,t)}:void 0;return/* @__PURE__ */ v(`div`,{className:i,"data-id":e.id,tabIndex:-1,onClick:t,children:[s,/* @__PURE__ */ v(`span`,{className:`wui-notification-center-body`,children:[o,r(e)]})]})}let l=c(e.at),u=/* @__PURE__ */ v(g,{children:[s,e.icon&&/* @__PURE__ */ _(`span`,{className:`wui-notification-center-icon`,children:/* @__PURE__ */ _(t,{name:e.icon,size:18})}),/* @__PURE__ */ v(`span`,{className:`wui-notification-center-body`,children:[o,/* @__PURE__ */ _(`span`,{className:`wui-notification-center-item-title`,children:e.title}),e.text&&/* @__PURE__ */ _(`span`,{className:`wui-notification-center-item-text`,children:e.text}),l&&/* @__PURE__ */ _(`time`,{className:`wui-notification-center-when`,dateTime:String(e.at),children:l})]})]}),d=n?t=>n(e,t):void 0;return e.href?/* @__PURE__ */ _(`a`,{className:i,href:e.href,"data-id":e.id,onClick:d,children:u}):/* @__PURE__ */ _(`button`,{type:`button`,className:i,"data-id":e.id,onClick:d,children:u})}export{S as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"../lib/FieldMessage.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./AppIcon.js";import r from"./AppInfoTip.js";import i from"./AppRequiredMark.js";import a from"./warnInvalidValue.js";import o from"./warnUnknownProps.js";import{forwardRef as s,useEffect as c,useId as l,useState as u}from"react";import{Form as d}from"react-bootstrap";import{jsx as f,jsxs as p}from"react/jsx-runtime";var m=[`sm`,`md`,`lg`],h=e=>{if(e===``||e===null)return null;let t=parseFloat(e);return Number.isNaN(t)?null:t},g=(e,t)=>t>0&&Number.isFinite(e)?e.toFixed(t):String(e??``),_=s(function(s,_){let{marker:v,props:y}=t(`AppNumberInput`,s),{label:b,required:x=!1,optional:S=!1,error:C,hint:w,help:T,helpLabel:E=`More information`,value:D,onChange:O,min:k,max:A,step:j=1,precision:M=0,unit:N,size:P=`md`,id:F,name:I,className:ee=``,fieldClassName:L=``,disabled:R=!1,readOnly:z=!1,...B}=y;o(`AppNumberInput`,B),a(`AppNumberInput`,`size`,P,m);let V=l(),H=F||V,U=e=>{if(M===0)return Math.round(e);let t=10**M;return Math.round(e*t)/t},W=e=>{let t=e;return typeof k==`number`&&(t=Math.max(t,k)),typeof A==`number`&&(t=Math.min(t,A)),t},G=e=>g(e,M),[K,q]=u(()=>G(D));c(()=>{q(e=>h(e)===(D??null)?e:g(D,M))},[D,M]);let J=e=>{let t=(h(K)??W(0))+e*j,n=W(U(t));q(G(n)),O?.(n)},Y=h(K),X=R||z||Y!==null&&typeof k==`number`&&Y<=k,Z=R||z||Y!==null&&typeof A==`number`&&Y>=A,Q=C&&H?`${H}-error`:void 0,$=w&&H?`${H}-hint`:void 0,te=Q||$,ne=[`input`,P===`sm`?`input-sm`:``,P===`lg`?`input-lg`:``,C?`error`:``,`num-input`,ee].filter(Boolean).join(` `),re=RegExp(`^${typeof k==`number`&&k>=0?``:`-?`}\\d*${M>0?`(\\.\\d*)?`:``}$`),ie=e=>{let t=e.target.value;if(!re.test(t))return;q(t);let n=h(t);n!==null&&O?.(n)},ae=e=>{if(z){B.onBlur?.(e);return}let t=h(e.target.value);if(t===null)q(``),O?.(null);else{let e=W(U(t));q(G(e)),O?.(e)}B.onBlur?.(e)},oe=e=>{z||(e.key===`ArrowUp`?(e.preventDefault(),J(1)):e.key===`ArrowDown`&&(e.preventDefault(),J(-1))),B.onKeyDown?.(e)},se=/* @__PURE__ */ f(d.Control,{...B,id:H,name:I,type:`text`,inputMode:M>0?`decimal`:`numeric`,className:ne,disabled:R,readOnly:z,required:x,"aria-invalid":C?`true`:`false`,"aria-describedby":te,value:K,ref:_,onChange:ie,onBlur:ae,onKeyDown:oe}),ce=[`num-wrap`,P===`sm`?`num-wrap-sm`:``,P===`lg`?`num-wrap-lg`:``].filter(Boolean).join(` `),le=/* @__PURE__ */ p(`div`,{className:ce,children:[/* @__PURE__ */ f(`button`,{type:`button`,className:`num-btn`,"aria-label":`Decrease`,tabIndex:-1,disabled:X,onClick:()=>J(-1),children:/* @__PURE__ */ f(n,{name:`minus`,size:16})}),se,N&&/* @__PURE__ */ f(`span`,{className:`affix`,children:N}),/* @__PURE__ */ f(`button`,{type:`button`,className:`num-btn`,"aria-label":`Increase`,tabIndex:-1,disabled:Z,onClick:()=>J(1),children:/* @__PURE__ */ f(n,{name:`plus`,size:16})})]});return/* @__PURE__ */ p(d.Group,{...v,className:`field${L?` ${L}`:``}`,children:[b&&/* @__PURE__ */ p(d.Label,{className:`label`,htmlFor:H,children:[b,S&&!x&&/* @__PURE__ */ f(`span`,{className:`label-optional`,children:` (optional)`}),x&&/* @__PURE__ */ f(i,{}),T&&/* @__PURE__ */ f(r,{label:E,children:T})]}),le,/* @__PURE__ */ f(e,{error:C,hint:w,errorId:Q,hintId:$})]})});export{_ as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./
|
|
1
|
+
import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./AppActionIcon.js";import n from"./AppIcon.js";import r from"./warnInvalidValue.js";import i from"./warnUnknownProps.js";import{useCallback as a,useId as o,useRef as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";import"@webority/ui-elements/elements/onboarding-checklist";var u=[`done`,`current`,`skipped`,`todo`],d={done:`Done: `,skipped:`Skipped: `};function f(e){let t=e.map(e=>u.includes(e.status)?e.status:`todo`);if(!t.includes(`current`)){let e=t.indexOf(`todo`);e>=0&&(t[e]=`current`)}return t}function p(e,t){return e===`done`?/* @__PURE__ */ c(n,{name:`check`,size:14}):e===`skipped`?/* @__PURE__ */ c(n,{name:`minus`,size:14}):t+1}function m(e,t){return e.href?t?/* @__PURE__ */ c(t,{className:`wui-onboarding-label`,to:e.href,children:e.label}):/* @__PURE__ */ c(`a`,{className:`wui-onboarding-label`,href:e.href,children:e.label}):/* @__PURE__ */ c(`span`,{className:`wui-onboarding-label`,children:e.label})}function h(h){let{marker:g,props:_}=e(`AppOnboardingChecklist`,h),{steps:v=[],title:y=`Get started`,defaultCollapsed:b,defaultDismissed:x=!1,storageKey:S,dismissLabel:C=`Dismiss checklist`,restoreLabel:w=`Show setup checklist`,onDismiss:T,onRestore:E,onCollapsedChange:D,linkComponent:O,className:k=``,...A}=_;i(`AppOnboardingChecklist`,A);for(let e of v)r(`AppOnboardingChecklist`,`steps[].status`,e.status,u);let j=o().replace(/[^a-zA-Z0-9_-]/g,``),M=`wui-onboarding-${j}-title`,N=`wui-onboarding-${j}-steps`,P=v.length===0,F=s(null);F.current={onDismiss:T,onRestore:E,onCollapsedChange:D};let I=a(e=>{if(!e)return;let t=()=>F.current.onDismiss?.(),n=()=>F.current.onRestore?.(),r=e=>F.current.onCollapsedChange?.(e.detail.collapsed);return e.addEventListener(`wui:onboarding:dismiss`,t),e.addEventListener(`wui:onboarding:restore`,n),e.addEventListener(`wui:onboarding:collapse`,r),()=>{e.removeEventListener(`wui:onboarding:dismiss`,t),e.removeEventListener(`wui:onboarding:restore`,n),e.removeEventListener(`wui:onboarding:collapse`,r)}},[]);if(P)return null;let L=f(v),R=L.filter(e=>e===`done`).length,z=L.filter(e=>e===`skipped`).length,B=R+z===v.length,V=b??B,H=`${R} of ${v.length} done${z?`, ${z} skipped`:``}`;return/* @__PURE__ */ l(`wui-onboarding-checklist`,{ref:I,class:[`wui-onboarding`,B?`is-complete`:``,k].filter(Boolean).join(` `),"storage-key":S||void 0,...g,...A,children:[/* @__PURE__ */ l(`section`,{className:`wui-onboarding-card`,"aria-labelledby":M,hidden:x||void 0,children:[/* @__PURE__ */ l(`header`,{className:`wui-onboarding-head`,children:[/* @__PURE__ */ l(`button`,{type:`button`,className:`wui-onboarding-toggle`,"aria-expanded":!V,"aria-controls":N,children:[/* @__PURE__ */ c(`span`,{className:`wui-onboarding-title`,id:M,children:y}),/* @__PURE__ */ c(`span`,{className:`wui-onboarding-count`,children:H}),/* @__PURE__ */ c(`span`,{className:`wui-onboarding-chevron`,"aria-hidden":`true`,children:/* @__PURE__ */ c(n,{name:`chevron-down`,size:16})})]}),/* @__PURE__ */ c(t,{icon:`x`,label:C,size:16,className:`wui-onboarding-dismiss`})]}),/* @__PURE__ */ c(`div`,{className:`wui-onboarding-bar`,role:`progressbar`,"aria-labelledby":M,"aria-valuemin":0,"aria-valuemax":v.length,"aria-valuenow":R,"aria-valuetext":H,children:L.map((e,t)=>/* @__PURE__ */ c(`span`,{className:`wui-onboarding-seg is-${e}`},v[t].key??`${v[t].label}-${t}`))}),/* @__PURE__ */ c(`ol`,{className:`wui-onboarding-steps`,id:N,hidden:V||void 0,children:v.map((e,t)=>{let n=L[t];return/* @__PURE__ */ l(`li`,{className:`wui-onboarding-step is-${n}`,"aria-current":n===`current`?`step`:void 0,children:[/* @__PURE__ */ c(`span`,{className:`wui-onboarding-mark`,"aria-hidden":`true`,children:p(n,t)}),/* @__PURE__ */ l(`span`,{className:`wui-onboarding-body`,children:[d[n]?/* @__PURE__ */ c(`span`,{className:`visually-hidden`,children:d[n]}):null,m(e,O),e.description?/* @__PURE__ */ c(`span`,{className:`wui-onboarding-desc`,children:e.description}):null]})]},e.key??`${e.label}-${t}`)})})]}),/* @__PURE__ */ l(`button`,{type:`button`,className:`wui-onboarding-restore`,hidden:!x||void 0,children:[/* @__PURE__ */ c(n,{name:`task-square`,size:16}),/* @__PURE__ */ c(`span`,{children:w}),/* @__PURE__ */ c(`span`,{className:`wui-onboarding-count`,children:H})]})]})}export{h as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"../lib/FieldMessage.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./AppRequiredMark.js";import r from"./useWuiControl.js";import i from"./warnInvalidValue.js";import a from"./warnUnknownProps.js";import{cloneElement as o,forwardRef as s,useId as c}from"react";import{jsx as l,jsxs as u}from"react/jsx-runtime";import"@webority/ui-elements/elements/otp";var d=[`numeric`,`alphanumeric`],f=s(function(s,f){let{marker:p,props:m}=t(`AppOtpInput`,s),{value:h,onChange:g,onComplete:_,length:v=6,mode:y=`numeric`,label:b,required:x=!1,optional:S=!1,hint:C,error:w,disabled:T=!1,name:E,id:D,className:O=``,fieldClassName:k=``,...A}=m;a(`AppOtpInput`,A),i(`AppOtpInput`,`mode`,y,d);let j=c(),M=D||j,N=w?`${M}-error`:void 0,P=C?`${M}-hint`:void 0,F=N||P,{setRef:I}=r({ref:f,value:h??``,onChange:g,on:{complete:e=>_?.(e.detail)}}),L=/* @__PURE__ */ l(`wui-otp`,{"aria-label":typeof b==`string`?b:void 0,ref:I,id:M,name:E,length:String(v),mode:y,"aria-describedby":F,"aria-invalid":w?`true`:void 0,disabled:T?``:void 0,required:x?``:void 0,className:O||void 0,...A});return!b&&!w&&!C?o(L,p):/* @__PURE__ */ u(`div`,{...p,className:`field${k?` ${k}`:``}`,children:[b&&/* @__PURE__ */ u(`label`,{className:`label`,htmlFor:M,children:[b,S&&!x&&/* @__PURE__ */ l(`span`,{className:`label-optional`,children:` (optional)`}),x&&/* @__PURE__ */ l(n,{})]}),L,/* @__PURE__ */ l(e,{error:w,hint:C,errorId:N,hintId:P})]})});export{f as default};
|