@webority/ui-react 0.144.1 → 0.145.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/dist/canvas-kit/kit.js +19397 -19371
  2. package/dist/canvas-kit/manifest.json +1 -1
  3. package/dist/canvas-kit/release.json +5 -5
  4. package/dist/components/AppAccordion.js +1 -1
  5. package/dist/components/AppActionIcon.js +1 -1
  6. package/dist/components/AppAlert.js +1 -1
  7. package/dist/components/AppAuthLayout.js +1 -1
  8. package/dist/components/AppAvatar.js +1 -1
  9. package/dist/components/AppAvatarGroup.js +1 -1
  10. package/dist/components/AppBadge.js +1 -1
  11. package/dist/components/AppBanner.js +1 -1
  12. package/dist/components/AppButton.js +1 -1
  13. package/dist/components/AppButtonGroup.js +1 -1
  14. package/dist/components/AppCalendar.js +1 -1
  15. package/dist/components/AppCard.js +1 -1
  16. package/dist/components/AppChart.js +1 -1
  17. package/dist/components/AppCheckbox.js +1 -1
  18. package/dist/components/AppChip.js +1 -1
  19. package/dist/components/AppChipGroup.js +1 -1
  20. package/dist/components/AppChoiceCard.js +1 -1
  21. package/dist/components/AppChoiceChip.js +1 -1
  22. package/dist/components/AppCodeBlock.js +1 -1
  23. package/dist/components/AppColorField.js +1 -1
  24. package/dist/components/AppCommentThread.js +1 -1
  25. package/dist/components/AppCompareTable.js +1 -1
  26. package/dist/components/AppConfirmDialog.js +1 -1
  27. package/dist/components/AppConsentBanner.js +1 -1
  28. package/dist/components/AppCopyButton.js +1 -1
  29. package/dist/components/AppDashboardCell.js +1 -1
  30. package/dist/components/AppDataTable.js +1 -1
  31. package/dist/components/AppDatePicker.js +1 -1
  32. package/dist/components/AppDateRangePicker.js +1 -1
  33. package/dist/components/AppDescriptions.js +1 -1
  34. package/dist/components/AppDrawer.js +1 -1
  35. package/dist/components/AppDropdown.js +1 -1
  36. package/dist/components/AppDueDate.js +1 -1
  37. package/dist/components/AppEmptyState.js +1 -1
  38. package/dist/components/AppFilePicker.js +1 -1
  39. package/dist/components/AppFilterBar.js +1 -1
  40. package/dist/components/AppFloatingButton.js +1 -1
  41. package/dist/components/AppFormActions.js +1 -1
  42. package/dist/components/AppFormRow.js +1 -1
  43. package/dist/components/AppFormSection.js +1 -1
  44. package/dist/components/AppIcon.js +1 -1
  45. package/dist/components/AppImagePicker.js +1 -1
  46. package/dist/components/AppInfoTip.js +1 -1
  47. package/dist/components/AppInlineEdit.js +1 -1
  48. package/dist/components/AppInput.js +1 -1
  49. package/dist/components/AppInputGroup.js +1 -1
  50. package/dist/components/AppKanban.js +1 -1
  51. package/dist/components/AppKpiTile.js +1 -1
  52. package/dist/components/AppLeadPopup.js +1 -1
  53. package/dist/components/AppLightbox.js +1 -1
  54. package/dist/components/AppLink.js +1 -1
  55. package/dist/components/AppMarkdown.js +1 -1
  56. package/dist/components/AppMentionInput.js +1 -1
  57. package/dist/components/AppMeter.js +1 -1
  58. package/dist/components/AppMetricStrip.js +1 -1
  59. package/dist/components/AppModal.js +1 -1
  60. package/dist/components/AppNavList.js +1 -1
  61. package/dist/components/AppNotificationCenter.js +1 -1
  62. package/dist/components/AppNumberInput.js +1 -1
  63. package/dist/components/AppOnboardingChecklist.js +1 -1
  64. package/dist/components/AppOtpInput.js +1 -1
  65. package/dist/components/AppPageHeader.js +1 -1
  66. package/dist/components/AppPhoneNumberInput.js +1 -1
  67. package/dist/components/AppPopover.js +1 -1
  68. package/dist/components/AppProgress.js +1 -1
  69. package/dist/components/AppRadio.js +1 -1
  70. package/dist/components/AppRadioGroup.js +1 -1
  71. package/dist/components/AppRating.js +1 -1
  72. package/dist/components/AppResizable.js +1 -1
  73. package/dist/components/AppResult.js +1 -1
  74. package/dist/components/AppRichText.js +1 -1
  75. package/dist/components/AppRollingNumber.js +1 -1
  76. package/dist/components/AppRouteError.js +1 -1
  77. package/dist/components/AppSearch.js +1 -1
  78. package/dist/components/AppSectionCallToAction.js +1 -1
  79. package/dist/components/AppSectionFaq.js +1 -1
  80. package/dist/components/AppSectionFeatures.js +1 -1
  81. package/dist/components/AppSectionHero.js +1 -1
  82. package/dist/components/AppSectionLeadCapture.js +1 -1
  83. package/dist/components/AppSectionLogos.js +1 -1
  84. package/dist/components/AppSectionPricing.js +1 -1
  85. package/dist/components/AppSectionTestimonials.js +1 -1
  86. package/dist/components/AppSegmented.js +1 -1
  87. package/dist/components/AppSelect.js +1 -1
  88. package/dist/components/AppSeoHead.js +1 -1
  89. package/dist/components/AppShell.js +1 -1
  90. package/dist/components/AppSkeletonLines.js +1 -1
  91. package/dist/components/AppSlider.js +1 -1
  92. package/dist/components/AppSortableList.js +1 -1
  93. package/dist/components/AppSpinner.js +1 -1
  94. package/dist/components/AppSplash.js +1 -1
  95. package/dist/components/AppSplitButton.js +1 -1
  96. package/dist/components/AppSplitView.js +1 -1
  97. package/dist/components/AppStatusBadge.js +1 -1
  98. package/dist/components/AppStepper.js +1 -1
  99. package/dist/components/AppSwitch.js +1 -1
  100. package/dist/components/AppTablePagination.js +1 -1
  101. package/dist/components/AppTabs.js +1 -1
  102. package/dist/components/AppTextarea.js +1 -1
  103. package/dist/components/AppThemeToggle.js +1 -1
  104. package/dist/components/AppTimePicker.js +1 -1
  105. package/dist/components/AppTimeline.js +1 -1
  106. package/dist/components/AppToast.js +1 -1
  107. package/dist/components/AppTooltip.js +1 -1
  108. package/dist/components/AppTour.js +1 -1
  109. package/dist/components/AppTreeView.js +1 -1
  110. package/dist/components/AppWhatsNew.js +1 -1
  111. package/dist/components/AppWizard.js +1 -1
  112. package/dist/components/AppWorkspaceSwitcher.js +1 -1
  113. package/dist/components/assertValidValue.js +1 -0
  114. package/dist/components/toast.js +1 -1
  115. package/dist/components/toastStore.js +1 -1
  116. package/dist/guidance.json +1 -1
  117. package/dist/lib/buttonClass.js +1 -1
  118. package/dist/lib/devWarn.js +1 -1
  119. package/dist/lib/useFloatingStack.js +1 -1
  120. package/dist/types/components/assertValidValue.d.ts +15 -0
  121. package/dist/types/components/toastStore.d.ts +3 -0
  122. package/dist/types/index.d.ts +1 -1
  123. package/dist/types/lib/buttonClass.d.ts +1 -2
  124. package/dist/ui-react.js +1 -1
  125. package/package.json +7 -7
  126. package/dist/components/warnInvalidValue.js +0 -1
  127. package/dist/types/components/warnInvalidValue.d.ts +0 -18
@@ -2,7 +2,7 @@
2
2
  "kind": "WeborityWeb",
3
3
  "library": {
4
4
  "name": "@webority/ui-react",
5
- "version": "0.144.1"
5
+ "version": "0.145.0"
6
6
  },
7
7
  "rendererProtocolVersion": 13,
8
8
  "platform": "Web",
@@ -1,21 +1,21 @@
1
1
  {
2
2
  "name": "webority-web",
3
- "version": "0.144.1",
3
+ "version": "0.145.0",
4
4
  "platform": "Web",
5
5
  "kitModuleVersion": 2,
6
6
  "rendererProtocolVersion": 13,
7
7
  "library": {
8
8
  "name": "@webority/ui-react",
9
- "version": "0.144.1"
9
+ "version": "0.145.0"
10
10
  },
11
11
  "files": {
12
12
  "manifest.json": {
13
- "sha256": "601720b5976c7e3294668bd46e46b3465499bc74df386958eae1bf6a32d37af9",
13
+ "sha256": "aabb79f47bb058c38c60c32d6aec80f640255afa3af964be9acc5a373954c0bf",
14
14
  "bytes": 983587
15
15
  },
16
16
  "kit.js": {
17
- "sha256": "088b014b68e92d2c2b2276fec87116ad3ecd95fdd1b01feed99a9cdb11fd22b7",
18
- "bytes": 11175319
17
+ "sha256": "4c93d36ab5f68fd20201d8cc420304fa657c5bea45fd7454a315479ac37dcaf6",
18
+ "bytes": 11176304
19
19
  },
20
20
  "kit.css": {
21
21
  "sha256": "13b14f71fb6ea024945f95cba617b4f1d49f44a65ba7c7ed05d2354805539ef6",
@@ -1 +1 @@
1
- import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./AppIcon.js";import n from"./warnInvalidValue.js";import r from"./warnUnknownProps.js";import{useEffect as i,useId as a,useState as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";var l=[`bordered`,`flat`];function u(e,t,n){if(Array.isArray(n)){let e=n.map(String);return new Set(t?e:e.slice(0,1))}let r=e.map((e,t)=>({item:e,key:e.key??String(t)})).filter(({item:e})=>e.open).map(({key:e})=>e);return new Set(t?r:r.slice(0,1))}function d(d){let{marker:f,props:p}=e(`AppAccordion`,d),{items:m=[],multiple:h=!1,openItems:g,variant:_=`bordered`,id:v,closeLabel:y,className:b=``,...x}=p;r(`AppAccordion`,x),n(`AppAccordion`,`variant`,_,l);let S=_===`flat`,C=/* @__PURE__ */ s(`span`,{className:`wui-accordion-icon`,children:/* @__PURE__ */ s(t,{name:`chevron-down`,size:18})}),w=a(),T=v||w,[E,D]=o(()=>u(m,h,g)),O=Array.isArray(g)?g.map(String).join(`\0`):null;i(()=>{O!==null&&D(u(m,h,g))},[O,h]);let k=(e,t)=>e.key??String(t),A=e=>{D(t=>{let n=new Set(h?t:[]);return t.has(e)?n.delete(e):n.add(e),n})};return/* @__PURE__ */ s(`div`,{className:`wui-accordion${S?` wui-accordion-flat`:``}${b?` ${b}`:``}`,...f,...x,children:m.map((e,t)=>{let n=k(e,t),r=E.has(n),i=`${T}-${t}`,a=`${i}-q`;return/* @__PURE__ */ c(`div`,{className:`wui-accordion-item${r?` open`:``}`,children:[/* @__PURE__ */ c(`button`,{type:`button`,className:`wui-accordion-trigger`,id:a,"aria-expanded":r,"aria-controls":i,"data-close-label":y,onClick:()=>A(n),children:[S?C:null,e.title,e.count==null?null:/* @__PURE__ */ s(`span`,{className:`wui-accordion-count`,children:e.count}),S?null:C]}),/* @__PURE__ */ s(`section`,{className:`wui-accordion-panel`,id:i,"aria-labelledby":a,inert:!r,"aria-hidden":!r||void 0,children:/* @__PURE__ */ s(`div`,{className:`wui-accordion-body`,children:e.content})})]},n)})})}export{d as default};
1
+ import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./AppIcon.js";import n from"./assertValidValue.js";import r from"./warnUnknownProps.js";import{useEffect as i,useId as a,useState as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";var l=[`bordered`,`flat`];function u(e,t,n){if(Array.isArray(n)){let e=n.map(String);return new Set(t?e:e.slice(0,1))}let r=e.map((e,t)=>({item:e,key:e.key??String(t)})).filter(({item:e})=>e.open).map(({key:e})=>e);return new Set(t?r:r.slice(0,1))}function d(d){let{marker:f,props:p}=e(`AppAccordion`,d),{items:m=[],multiple:h=!1,openItems:g,variant:_=`bordered`,id:v,closeLabel:y,className:b=``,...x}=p;r(`AppAccordion`,x),n(`AppAccordion`,`variant`,_,l);let S=_===`flat`,C=/* @__PURE__ */ s(`span`,{className:`wui-accordion-icon`,children:/* @__PURE__ */ s(t,{name:`chevron-down`,size:18})}),w=a(),T=v||w,[E,D]=o(()=>u(m,h,g)),O=Array.isArray(g)?g.map(String).join(`\0`):null;i(()=>{O!==null&&D(u(m,h,g))},[O,h]);let k=(e,t)=>e.key??String(t),A=e=>{D(t=>{let n=new Set(h?t:[]);return t.has(e)?n.delete(e):n.add(e),n})};return/* @__PURE__ */ s(`div`,{className:`wui-accordion${S?` wui-accordion-flat`:``}${b?` ${b}`:``}`,...f,...x,children:m.map((e,t)=>{let n=k(e,t),r=E.has(n),i=`${T}-${t}`,a=`${i}-q`;return/* @__PURE__ */ c(`div`,{className:`wui-accordion-item${r?` open`:``}`,children:[/* @__PURE__ */ c(`button`,{type:`button`,className:`wui-accordion-trigger`,id:a,"aria-expanded":r,"aria-controls":i,"data-close-label":y,onClick:()=>A(n),children:[S?C:null,e.title,e.count==null?null:/* @__PURE__ */ s(`span`,{className:`wui-accordion-count`,children:e.count}),S?null:C]}),/* @__PURE__ */ s(`section`,{className:`wui-accordion-panel`,id:i,"aria-labelledby":a,inert:!r,"aria-hidden":!r||void 0,children:/* @__PURE__ */ s(`div`,{className:`wui-accordion-body`,children:e.content})})]},n)})})}export{d as default};
@@ -1 +1 @@
1
- import{devWarn as e}from"../lib/devWarn.js";import{shortcutAria as t}from"../lib/shortcutChip.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./renderIconProp.js";import i from"./warnInvalidValue.js";import a from"./warnUnknownProps.js";import o from"./withTooltip.js";import{useRef as s}from"react";import{Fragment as c,jsx as l,jsxs as u}from"react/jsx-runtime";var d=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`],f=[`comfortable`,`compact`],p=[`danger`,`neutral`];function m(m){let{marker:h,props:g}=n(`AppActionIcon`,m),{icon:_,iconVariant:v,label:y,tooltipPlacement:b=`auto`,shortcut:x,tone:S,density:C=`comfortable`,disabled:w=!1,size:T=20,onClick:E,className:D=``,as:O,href:k,accept:A,multiple:j=!1,onFiles:M,...N}=g,P=Number(T),F=Number.isFinite(P)&&P>0?P:20;T!==void 0&&!(Number.isFinite(P)&&P>0)&&e(`AppActionIcon: size must be a positive number of px.`),a(`AppActionIcon`,O===void 0?N:{...N,as:O}),i(`AppActionIcon`,`iconVariant`,v,d),i(`AppActionIcon`,`density`,C,f),i(`AppActionIcon`,`tone`,S,p);let I=typeof M==`function`;I&&(O!==void 0||k!==void 0)&&e(`AppActionIcon: file mode renders a button; href and as are ignored.`),!I&&(A!==void 0||j)&&e(`AppActionIcon: accept and multiple apply only in file mode (pass onFiles).`);let L=s(null),R=e=>{let t=[...e.target.files];e.target.value=``,t.length>0&&M(t)},z=[`u-action`,S===`danger`?`danger`:``,S===`neutral`?`neutral`:``,D].filter(Boolean).join(` `),{style:B,...V}=N,H={"--wui-action-size":`${F+(C===`compact`?8:16)}px`,...B},U=I?`button`:O??(k?`a`:`button`),W=U===`button`,G=/* @__PURE__ */ l(U,{type:W?`button`:void 0,href:W||w?void 0:k,className:z,style:H,"aria-label":y,"aria-keyshortcuts":t(x),disabled:W?w:void 0,"aria-disabled":!W&&w?`true`:void 0,role:!W&&w?`link`:void 0,tabIndex:!W&&w?-1:void 0,onClick:e=>{w?(e.preventDefault(),e.stopPropagation()):(E?.(e),I&&!e.defaultPrevented&&L.current?.click())},...h,...V,children:r(_,{size:F,variant:v})}),K=o(G,y,b,x);return I?/* @__PURE__ */ u(c,{children:[K,/* @__PURE__ */ l(`input`,{type:`file`,ref:L,className:`wui-action-icon-file`,hidden:!0,tabIndex:-1,"aria-hidden":`true`,accept:A,multiple:j,onChange:R,onClick:e=>e.stopPropagation()})]}):K}export{m as default};
1
+ import{devWarn as e}from"../lib/devWarn.js";import{shortcutAria as t}from"../lib/shortcutChip.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./assertValidValue.js";import i from"./renderIconProp.js";import a from"./warnUnknownProps.js";import o from"./withTooltip.js";import{useRef as s}from"react";import{Fragment as c,jsx as l,jsxs as u}from"react/jsx-runtime";var d=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`],f=[`comfortable`,`compact`],p=[`danger`,`neutral`];function m(m){let{marker:h,props:g}=n(`AppActionIcon`,m),{icon:_,iconVariant:v,label:y,tooltipPlacement:b=`auto`,shortcut:x,tone:S,density:C=`comfortable`,disabled:w=!1,size:T=20,onClick:E,className:D=``,as:O,href:k,accept:A,multiple:j=!1,onFiles:M,...N}=g,P=Number(T),F=Number.isFinite(P)&&P>0?P:20;T!==void 0&&!(Number.isFinite(P)&&P>0)&&e(`AppActionIcon: size must be a positive number of px.`),a(`AppActionIcon`,O===void 0?N:{...N,as:O}),r(`AppActionIcon`,`iconVariant`,v,d),r(`AppActionIcon`,`density`,C,f),r(`AppActionIcon`,`tone`,S,p);let I=typeof M==`function`;I&&(O!==void 0||k!==void 0)&&e(`AppActionIcon: file mode renders a button; href and as are ignored.`),!I&&(A!==void 0||j)&&e(`AppActionIcon: accept and multiple apply only in file mode (pass onFiles).`);let L=s(null),R=e=>{let t=[...e.target.files];e.target.value=``,t.length>0&&M(t)},z=[`u-action`,S===`danger`?`danger`:``,S===`neutral`?`neutral`:``,D].filter(Boolean).join(` `),{style:B,...V}=N,H={"--wui-action-size":`${F+(C===`compact`?8:16)}px`,...B},U=I?`button`:O??(k?`a`:`button`),W=U===`button`,G=/* @__PURE__ */ l(U,{type:W?`button`:void 0,href:W||w?void 0:k,className:z,style:H,"aria-label":y,"aria-keyshortcuts":t(x),disabled:W?w:void 0,"aria-disabled":!W&&w?`true`:void 0,role:!W&&w?`link`:void 0,tabIndex:!W&&w?-1:void 0,onClick:e=>{w?(e.preventDefault(),e.stopPropagation()):(E?.(e),I&&!e.defaultPrevented&&L.current?.click())},...h,...V,children:i(_,{size:F,variant:v})}),K=o(G,y,b,x);return I?/* @__PURE__ */ u(c,{children:[K,/* @__PURE__ */ l(`input`,{type:`file`,ref:L,className:`wui-action-icon-file`,hidden:!0,tabIndex:-1,"aria-hidden":`true`,accept:A,multiple:j,onChange:R,onClick:e=>e.stopPropagation()})]}):K}export{m as default};
@@ -1 +1 @@
1
- import{TONES as e}from"../lib/vocabulary.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./AppIcon.js";import r from"./warnInvalidValue.js";import i from"./warnUnknownProps.js";import{Alert as a}from"react-bootstrap";import{Fragment as o,jsx as s,jsxs as c}from"react/jsx-runtime";var l={info:`info`,success:`check`,warning:`alert-triangle`,danger:`x`},u=e.filter(e=>e!==`primary`),d=[`sm`,`md`,`lg`],f=[`alert`,`status`,`none`],p=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`];function m(e,t,r,i,a,o){return i?/* @__PURE__ */ s(`span`,{className:`alert-icon alert-icon-image`,style:o>0?{width:o,height:o}:void 0,children:/* @__PURE__ */ s(`img`,{src:i,alt:a})}):e?typeof e==`string`?/* @__PURE__ */ s(`span`,{className:`alert-icon`,children:/* @__PURE__ */ s(n,{name:e,size:t,variant:r})}):/* @__PURE__ */ s(`span`,{className:`alert-icon`,children:e}):null}function h(e){let{marker:n,props:h}=t(`AppAlert`,e),{tone:g=`info`,children:_,title:v,icon:y,iconVariant:b,iconSize:x,image:S,imageAlt:C=``,imageSize:w,className:T=``,onClose:E,dismissible:D,bordered:O=!0,accent:k=!1,size:A=`md`,action:j,role:M=`alert`,...N}=h;i(`AppAlert`,N),r(`AppAlert`,`tone`,g,u),r(`AppAlert`,`size`,A,d),r(`AppAlert`,`role`,M,f),r(`AppAlert`,`iconVariant`,b,p);let P=y===void 0?l[g]:y===`none`?null:y,F=!!S||!!P,I=j!=null&&j!==!1,L=v?/* @__PURE__ */ s(`div`,{className:`alert-heading`,children:v}):null,R=F&&!!L&&!!_,z=x>0?x:A===`lg`?R?17:15:R?13:11,B=[F?`alert-has-icon`:``,I?`alert-has-action`:``,R?`alert-stack`:``,O?``:`alert-borderless`,k?`alert-accent`:``,A===`sm`?`alert-sm`:``,A===`lg`?`alert-lg`:``,T].filter(Boolean).join(` `);return/* @__PURE__ */ s(a,{className:B||void 0,onClose:E,dismissible:D??typeof E==`function`,transition:!1,role:M===`none`?void 0:M,...n,...N,variant:g,children:F||I?/* @__PURE__ */ c(o,{children:[F&&m(P,z,b,S,C,w),/* @__PURE__ */ c(`div`,{className:`alert-content`,children:[L,_]}),I&&/* @__PURE__ */ s(`div`,{className:`alert-action`,children:j})]}):/* @__PURE__ */ c(o,{children:[L,_]})})}export{h as default};
1
+ import{TONES as e}from"../lib/vocabulary.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./AppIcon.js";import r from"./assertValidValue.js";import i from"./warnUnknownProps.js";import{Alert as a}from"react-bootstrap";import{Fragment as o,jsx as s,jsxs as c}from"react/jsx-runtime";var l={info:`info`,success:`check`,warning:`alert-triangle`,danger:`x`},u=e.filter(e=>e!==`primary`),d=[`sm`,`md`,`lg`],f=[`alert`,`status`,`none`],p=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`];function m(e,t,r,i,a,o){return i?/* @__PURE__ */ s(`span`,{className:`alert-icon alert-icon-image`,style:o>0?{width:o,height:o}:void 0,children:/* @__PURE__ */ s(`img`,{src:i,alt:a})}):e?typeof e==`string`?/* @__PURE__ */ s(`span`,{className:`alert-icon`,children:/* @__PURE__ */ s(n,{name:e,size:t,variant:r})}):/* @__PURE__ */ s(`span`,{className:`alert-icon`,children:e}):null}function h(e){let{marker:n,props:h}=t(`AppAlert`,e),{tone:g=`info`,children:_,title:v,icon:y,iconVariant:b,iconSize:x,image:S,imageAlt:C=``,imageSize:w,className:T=``,onClose:E,dismissible:D,bordered:O=!0,accent:k=!1,size:A=`md`,action:j,role:M=`alert`,...N}=h;i(`AppAlert`,N),r(`AppAlert`,`tone`,g,u),r(`AppAlert`,`size`,A,d),r(`AppAlert`,`role`,M,f),r(`AppAlert`,`iconVariant`,b,p);let P=y===void 0?l[g]:y===`none`?null:y,F=!!S||!!P,I=j!=null&&j!==!1,L=v?/* @__PURE__ */ s(`div`,{className:`alert-heading`,children:v}):null,R=F&&!!L&&!!_,z=x>0?x:A===`lg`?R?17:15:R?13:11,B=[F?`alert-has-icon`:``,I?`alert-has-action`:``,R?`alert-stack`:``,O?``:`alert-borderless`,k?`alert-accent`:``,A===`sm`?`alert-sm`:``,A===`lg`?`alert-lg`:``,T].filter(Boolean).join(` `);return/* @__PURE__ */ s(a,{className:B||void 0,onClose:E,dismissible:D??typeof E==`function`,transition:!1,role:M===`none`?void 0:M,...n,...N,variant:g,children:F||I?/* @__PURE__ */ c(o,{children:[F&&m(P,z,b,S,C,w),/* @__PURE__ */ c(`div`,{className:`alert-content`,children:[L,_]}),I&&/* @__PURE__ */ s(`div`,{className:`alert-action`,children:j})]}):/* @__PURE__ */ c(o,{children:[L,_]})})}export{h 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=[`centred`,`split`],o={sm:360,md:420,lg:520},s=e=>e!=null&&e!==!1;function c(c){let{marker:l,props:u}=e(`AppAuthLayout`,c),{logo:d,variant:f=`centred`,maxWidth:p=`md`,aside:m,footer:h,children:g,className:_=``,...v}=u;n(`AppAuthLayout`,v),t(`AppAuthLayout`,`variant`,f,a),t(`AppAuthLayout`,`maxWidth`,typeof p==`string`?p:null,Object.keys(o));let{style:y,...b}=v,x=typeof p==`number`&&p>0?p:o[p]??o.md,S=f===`split`&&s(m);return/* @__PURE__ */ i(`div`,{className:`wui-auth ${S?`wui-auth-split`:`wui-auth-centred`}${_?` ${_}`:``}`,style:{"--wui-auth-width":`${x}px`,...y},...l,...b,children:[/* @__PURE__ */ r(`div`,{className:`wui-auth-main`,children:/* @__PURE__ */ i(`div`,{className:`wui-auth-panel`,children:[s(d)&&/* @__PURE__ */ r(`div`,{className:`wui-auth-logo`,children:d}),/* @__PURE__ */ r(`div`,{className:`wui-auth-body`,children:g}),s(h)&&/* @__PURE__ */ r(`div`,{className:`wui-auth-footer`,children:h})]})}),S&&/* @__PURE__ */ r(`aside`,{className:`wui-auth-aside`,children:m})]})}export{c as default};
1
+ import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./assertValidValue.js";import n from"./warnUnknownProps.js";import{jsx as r,jsxs as i}from"react/jsx-runtime";var a=[`centred`,`split`],o={sm:360,md:420,lg:520},s=e=>e!=null&&e!==!1;function c(c){let{marker:l,props:u}=e(`AppAuthLayout`,c),{logo:d,variant:f=`centred`,maxWidth:p=`md`,aside:m,footer:h,children:g,className:_=``,...v}=u;n(`AppAuthLayout`,v),t(`AppAuthLayout`,`variant`,f,a),t(`AppAuthLayout`,`maxWidth`,typeof p==`string`?p:null,Object.keys(o));let{style:y,...b}=v,x=typeof p==`number`&&p>0?p:o[p]??o.md,S=f===`split`&&s(m);return/* @__PURE__ */ i(`div`,{className:`wui-auth ${S?`wui-auth-split`:`wui-auth-centred`}${_?` ${_}`:``}`,style:{"--wui-auth-width":`${x}px`,...y},...l,...b,children:[/* @__PURE__ */ r(`div`,{className:`wui-auth-main`,children:/* @__PURE__ */ i(`div`,{className:`wui-auth-panel`,children:[s(d)&&/* @__PURE__ */ r(`div`,{className:`wui-auth-logo`,children:d}),/* @__PURE__ */ r(`div`,{className:`wui-auth-body`,children:g}),s(h)&&/* @__PURE__ */ r(`div`,{className:`wui-auth-footer`,children:h})]})}),S&&/* @__PURE__ */ r(`aside`,{className:`wui-auth-aside`,children:m})]})}export{c as default};
@@ -1 +1 @@
1
- import{initialsOf as e}from"../lib/initials.js";import{TONES as t}from"../lib/vocabulary.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./renderIconProp.js";import i from"./warnInvalidValue.js";import a from"./warnUnknownProps.js";import o from"./withTooltip.js";import{useState as s}from"react";import{Fragment as c,jsx as l,jsxs as u}from"react/jsx-runtime";var d=[`circle`,`rounded`,`square`],ee=[...t,`auto`],f=[`none`,`online`,`offline`,`away`,`busy`],p=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`],m=/* @__PURE__ */ new Set([`xs`,`sm`,`md`,`lg`,`xl`,`2xl`]),h={xs:20,sm:24,md:32,lg:48,xl:64,"2xl":96};function g(t){return e(t)||`?`}function _(e){let t=e||``,n=0;for(let e=0;e<t.length;e+=1)n=Math.imul(n,31)+t.charCodeAt(e)>>>0;return n%360}function v(e){if(typeof e==`number`)return e;if(h[e]!=null)return h[e];let t=Number.parseInt(e,10);return Number.isNaN(t)?32:t}function y(e){let{marker:t,props:h}=n(`AppAvatar`,e),{name:y,src:b,size:x=`md`,shape:S=`circle`,tone:C=`primary`,status:w=`none`,ring:T=!1,label:E,icon:D,iconVariant:O,badge:k,href:A,onClick:j,linkComponent:M,tooltip:N,tooltipPlacement:P,className:F=``,photoLabel:I=`Profile photo`,...L}=h;a(`AppAvatar`,L),i(`AppAvatar`,`shape`,S,d),i(`AppAvatar`,`tone`,C,ee),i(`AppAvatar`,`status`,w,f),i(`AppAvatar`,`iconVariant`,O,p);let{style:R,...z}=L,[B,V]=s(null),H=B!=null&&B===b,U=typeof x==`string`&&m.has(x),W=U?null:typeof x==`number`||/^\d+$/.test(x)?`${x}px`:x,G=A!=null||j!=null,K=b!=null&&b!==``&&!H,q=[`avatar`,U&&x!==`md`?`avatar-${x}`:``,S===`circle`?``:`avatar-${S}`,C===`primary`?``:`avatar-${C}`,T?`avatar-ring`:``,G?`avatar-clickable`:``,F].filter(Boolean).join(` `),J={};W&&(J[`--avatar-size`]=W),C===`auto`&&(J[`--avatar-hue`]=_(y));let Y=Object.keys(J).length||R?{...J,...R}:void 0,X=/* @__PURE__ */ l(`span`,{className:`avatar-face`,"aria-hidden":`true`,children:D!=null&&D!==!1&&D!==``?r(D,{size:Math.round(v(x)*.55),variant:O}):g(y)}),Z=/* @__PURE__ */ u(c,{children:[w!==`none`&&/* @__PURE__ */ l(`span`,{className:`avatar-status avatar-status-${w}`,"aria-hidden":`true`}),k!=null&&/* @__PURE__ */ l(`span`,{className:`avatar-badge`,children:k}),E!=null&&/* @__PURE__ */ l(`span`,{className:`avatar-label`,"aria-hidden":`true`,children:E})]}),Q=/* @__PURE__ */ u(c,{children:[X,K&&/* @__PURE__ */ l(`img`,{className:`avatar-img`,src:b,alt:G?``:y||I,onError:()=>V(b)}),Z]});if(A!=null){let e=M||`a`,n=M?{to:A}:{href:A};return o(/* @__PURE__ */ l(e,{className:q,style:Y,...t,...z,"aria-label":E||y,...n,onClick:j,children:Q}),N,P)}if(j!=null)return o(/* @__PURE__ */ l(`button`,{type:`button`,className:q,style:Y,...t,...z,"aria-label":E||y,onClick:j,children:Q}),N,P);if(K)return o(/* @__PURE__ */ l(`span`,{className:q,style:Y,...t,...z,children:Q}),N,P);let $=E?.trim()||y?.trim();return o($?/* @__PURE__ */ l(`span`,{className:q,style:Y,...t,...z,role:`img`,"aria-label":$,children:Q}):/* @__PURE__ */ l(`span`,{className:q,style:Y,...t,...z,"aria-hidden":`true`,children:Q}),N,P)}export{y as default};
1
+ import{initialsOf as e}from"../lib/initials.js";import{TONES as t}from"../lib/vocabulary.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./assertValidValue.js";import i from"./renderIconProp.js";import a from"./warnUnknownProps.js";import o from"./withTooltip.js";import{useState as s}from"react";import{Fragment as c,jsx as l,jsxs as u}from"react/jsx-runtime";var d=[`circle`,`rounded`,`square`],ee=[...t,`auto`],f=[`none`,`online`,`offline`,`away`,`busy`],p=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`],m=/* @__PURE__ */ new Set([`xs`,`sm`,`md`,`lg`,`xl`,`2xl`]),h={xs:20,sm:24,md:32,lg:48,xl:64,"2xl":96};function g(t){return e(t)||`?`}function _(e){let t=e||``,n=0;for(let e=0;e<t.length;e+=1)n=Math.imul(n,31)+t.charCodeAt(e)>>>0;return n%360}function v(e){if(typeof e==`number`)return e;if(h[e]!=null)return h[e];let t=Number.parseInt(e,10);return Number.isNaN(t)?32:t}function y(e){let{marker:t,props:h}=n(`AppAvatar`,e),{name:y,src:b,size:x=`md`,shape:S=`circle`,tone:C=`primary`,status:w=`none`,ring:T=!1,label:E,icon:D,iconVariant:O,badge:k,href:A,onClick:j,linkComponent:M,tooltip:N,tooltipPlacement:P,className:F=``,photoLabel:I=`Profile photo`,...L}=h;a(`AppAvatar`,L),r(`AppAvatar`,`shape`,S,d),r(`AppAvatar`,`tone`,C,ee),r(`AppAvatar`,`status`,w,f),r(`AppAvatar`,`iconVariant`,O,p);let{style:R,...z}=L,[B,V]=s(null),H=B!=null&&B===b,U=typeof x==`string`&&m.has(x),W=U?null:typeof x==`number`||/^\d+$/.test(x)?`${x}px`:x,G=A!=null||j!=null,K=b!=null&&b!==``&&!H,q=[`avatar`,U&&x!==`md`?`avatar-${x}`:``,S===`circle`?``:`avatar-${S}`,C===`primary`?``:`avatar-${C}`,T?`avatar-ring`:``,G?`avatar-clickable`:``,F].filter(Boolean).join(` `),J={};W&&(J[`--avatar-size`]=W),C===`auto`&&(J[`--avatar-hue`]=_(y));let Y=Object.keys(J).length||R?{...J,...R}:void 0,X=/* @__PURE__ */ l(`span`,{className:`avatar-face`,"aria-hidden":`true`,children:D!=null&&D!==!1&&D!==``?i(D,{size:Math.round(v(x)*.55),variant:O}):g(y)}),Z=/* @__PURE__ */ u(c,{children:[w!==`none`&&/* @__PURE__ */ l(`span`,{className:`avatar-status avatar-status-${w}`,"aria-hidden":`true`}),k!=null&&/* @__PURE__ */ l(`span`,{className:`avatar-badge`,children:k}),E!=null&&/* @__PURE__ */ l(`span`,{className:`avatar-label`,"aria-hidden":`true`,children:E})]}),Q=/* @__PURE__ */ u(c,{children:[X,K&&/* @__PURE__ */ l(`img`,{className:`avatar-img`,src:b,alt:G?``:y||I,onError:()=>V(b)}),Z]});if(A!=null){let e=M||`a`,n=M?{to:A}:{href:A};return o(/* @__PURE__ */ l(e,{className:q,style:Y,...t,...z,"aria-label":E||y,...n,onClick:j,children:Q}),N,P)}if(j!=null)return o(/* @__PURE__ */ l(`button`,{type:`button`,className:q,style:Y,...t,...z,"aria-label":E||y,onClick:j,children:Q}),N,P);if(K)return o(/* @__PURE__ */ l(`span`,{className:q,style:Y,...t,...z,children:Q}),N,P);let $=E?.trim()||y?.trim();return o($?/* @__PURE__ */ l(`span`,{className:q,style:Y,...t,...z,role:`img`,"aria-label":$,children:Q}):/* @__PURE__ */ l(`span`,{className:q,style:Y,...t,...z,"aria-hidden":`true`,children:Q}),N,P)}export{y as default};
@@ -1 +1 @@
1
- import e from"../lib/fillLabel.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./warnInvalidValue.js";import r from"./warnUnknownProps.js";import{jsx as i,jsxs as a}from"react/jsx-runtime";var o=[`tight`,`normal`,`loose`],s={xs:20,sm:24,md:32,lg:48,xl:64,"2xl":96};function c(e){return e==null?null:typeof e==`number`?`${e}px`:s[e]==null?/^\d+$/.test(e)?`${e}px`:e:`${s[e]}px`}function l(s){let{marker:l,props:u}=t(`AppAvatarGroup`,s),{children:d,size:f,spacing:p=`normal`,overflow:m,moreLabel:h=`{count} more`,className:g=``,..._}=u;r(`AppAvatarGroup`,_),n(`AppAvatarGroup`,`spacing`,p,o);let{style:v,...y}=_,b=[`avatar-group`,p===`normal`?``:`avatar-group-${p}`,g].filter(Boolean).join(` `),x=c(f),S=x?{"--avatar-size":x,...v}:v,C=typeof m==`string`?Number.parseInt(m,10):m,w=typeof m==`string`&&!/^\d+$/.test(m)?m:`+${C}`;return/* @__PURE__ */ a(`div`,{className:b,style:S,...l,...y,children:[d,C>0&&/* @__PURE__ */ i(`span`,{className:`avatar avatar-more`,role:`img`,"aria-label":e(h,{count:C}),children:w})]})}export{l as default};
1
+ import e from"../lib/fillLabel.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./assertValidValue.js";import r from"./warnUnknownProps.js";import{jsx as i,jsxs as a}from"react/jsx-runtime";var o=[`tight`,`normal`,`loose`],s={xs:20,sm:24,md:32,lg:48,xl:64,"2xl":96};function c(e){return e==null?null:typeof e==`number`?`${e}px`:s[e]==null?/^\d+$/.test(e)?`${e}px`:e:`${s[e]}px`}function l(s){let{marker:l,props:u}=t(`AppAvatarGroup`,s),{children:d,size:f,spacing:p=`normal`,overflow:m,moreLabel:h=`{count} more`,className:g=``,..._}=u;r(`AppAvatarGroup`,_),n(`AppAvatarGroup`,`spacing`,p,o);let{style:v,...y}=_,b=[`avatar-group`,p===`normal`?``:`avatar-group-${p}`,g].filter(Boolean).join(` `),x=c(f),S=x?{"--avatar-size":x,...v}:v,C=typeof m==`string`?Number.parseInt(m,10):m,w=typeof m==`string`&&!/^\d+$/.test(m)?m:`+${C}`;return/* @__PURE__ */ a(`div`,{className:b,style:S,...l,...y,children:[d,C>0&&/* @__PURE__ */ i(`span`,{className:`avatar avatar-more`,role:`img`,"aria-label":e(h,{count:C}),children:w})]})}export{l as default};
@@ -1 +1 @@
1
- import{TONES as e}from"../lib/vocabulary.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./warnInvalidValue.js";import r from"./warnUnknownProps.js";import i from"./withTooltip.js";import{Badge as a}from"react-bootstrap";import{jsx as o}from"react/jsx-runtime";function s(s){let{marker:c,props:l}=t(`AppBadge`,s),{children:u,tone:d,dot:f=!1,tooltip:p,tooltipPlacement:m,className:h=``,...g}=l;r(`AppBadge`,g),n(`AppBadge`,`tone`,d,e);let _=[d&&d!==`neutral`?`badge-${d}`:``,f?`badge-dot`:``,h].filter(Boolean).join(` `);return i(/* @__PURE__ */ o(a,{bg:!1,className:_||void 0,...c,...g,children:u}),p,m)}export{s as default};
1
+ import{TONES as e}from"../lib/vocabulary.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./assertValidValue.js";import r from"./warnUnknownProps.js";import i from"./withTooltip.js";import{Badge as a}from"react-bootstrap";import{jsx as o}from"react/jsx-runtime";function s(s){let{marker:c,props:l}=t(`AppBadge`,s),{children:u,tone:d,dot:f=!1,tooltip:p,tooltipPlacement:m,className:h=``,...g}=l;r(`AppBadge`,g),n(`AppBadge`,`tone`,d,e);let _=[d&&d!==`neutral`?`badge-${d}`:``,f?`badge-dot`:``,h].filter(Boolean).join(` `);return i(/* @__PURE__ */ o(a,{bg:!1,className:_||void 0,...c,...g,children:u}),p,m)}export{s as default};
@@ -1 +1 @@
1
- import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./AppIcon.js";import n from"./renderIconProp.js";import r from"./warnInvalidValue.js";import i from"./warnUnknownProps.js";import{useState as a}from"react";import{jsx as o,jsxs as s}from"react/jsx-runtime";var c=[`info`,`success`,`warning`,`danger`,`neutral`];function l(l){let{marker:u,props:d}=e(`AppBanner`,l),{tone:f=`info`,icon:p,children:m,dismissible:h=!1,onClose:g,action:_,className:v=``,dismissLabel:y=`Dismiss`,...b}=d;i(`AppBanner`,b),r(`AppBanner`,`tone`,f,c);let[x,S]=a(!0);if(!x)return null;let C=c.includes(f)?f:`info`,w=_!=null&&_!==!1,T=()=>{S(!1),g?.()};return/* @__PURE__ */ s(`div`,{className:`wui-banner wui-banner-${C}${w?` wui-banner-has-action`:``}${v?` ${v}`:``}`,role:`status`,...u,...b,children:[p&&/* @__PURE__ */ o(`span`,{className:`wui-banner-icon`,children:n(p,{size:18})}),/* @__PURE__ */ o(`div`,{className:`wui-banner-body`,children:m}),w&&/* @__PURE__ */ o(`div`,{className:`wui-banner-action`,children:_}),h&&/* @__PURE__ */ o(`button`,{type:`button`,className:`wui-banner-dismiss`,"aria-label":y,onClick:T,children:/* @__PURE__ */ o(t,{name:`x`,size:18})})]})}export{l as default};
1
+ import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./AppIcon.js";import n from"./assertValidValue.js";import r from"./renderIconProp.js";import i from"./warnUnknownProps.js";import{useState as a}from"react";import{jsx as o,jsxs as s}from"react/jsx-runtime";var c=[`info`,`success`,`warning`,`danger`,`neutral`];function l(l){let{marker:u,props:d}=e(`AppBanner`,l),{tone:f=`info`,icon:p,children:m,dismissible:h=!1,onClose:g,action:_,className:v=``,dismissLabel:y=`Dismiss`,...b}=d;i(`AppBanner`,b),n(`AppBanner`,`tone`,f,c);let[x,S]=a(!0);if(!x)return null;let C=c.includes(f)?f:`info`,w=_!=null&&_!==!1,T=()=>{S(!1),g?.()};return/* @__PURE__ */ s(`div`,{className:`wui-banner wui-banner-${C}${w?` wui-banner-has-action`:``}${v?` ${v}`:``}`,role:`status`,...u,...b,children:[p&&/* @__PURE__ */ o(`span`,{className:`wui-banner-icon`,children:r(p,{size:18})}),/* @__PURE__ */ o(`div`,{className:`wui-banner-body`,children:m}),w&&/* @__PURE__ */ o(`div`,{className:`wui-banner-action`,children:_}),h&&/* @__PURE__ */ o(`button`,{type:`button`,className:`wui-banner-dismiss`,"aria-label":y,onClick:T,children:/* @__PURE__ */ o(t,{name:`x`,size:18})})]})}export{l as default};
@@ -1 +1 @@
1
- import{buttonClass as e}from"../lib/buttonClass.js";import{shortcutAria as t,shortcutChip as n}from"../lib/shortcutChip.js";import{FILL_VARIANTS as r,TONES as i}from"../lib/vocabulary.js";import{splitMarkerProps as a}from"../lib/wuiMarker.js";import o from"./AppIcon.js";import s from"./warnInvalidValue.js";import c from"./warnUnknownProps.js";import l from"./withTooltip.js";import{Button as u}from"react-bootstrap";import{jsx as d,jsxs as f}from"react/jsx-runtime";var p={sm:14,md:16,lg:20},m=[`sheen`,`fill`,`expand`,`glow`,`roll`,`none`],h=[`rounded`,`pill`,`sharp`],g=[`button`,`submit`,`reset`],_=/* @__PURE__ */ new Set([!0,!1,...Array.from({length:100},(e,t)=>t+1)]),v=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`],y=e=>e===`pill`||e===`sharp`?`wui-btn-shape-${e}`:``;function b(e){return/* @__PURE__ */ f(`span`,{className:`wui-btn-roll`,children:[/* @__PURE__ */ d(`span`,{className:`wui-btn-roll__a`,children:e}),/* @__PURE__ */ d(`span`,{className:`wui-btn-roll__b`,"aria-hidden":`true`,children:e})]})}function x(e,t,n,r){if(!e)return null;let i=n=>typeof e==`string`?/* @__PURE__ */ d(o,{name:e,size:p[t]??p.md,variant:r,className:n}):/* @__PURE__ */ d(`span`,{className:[`d-inline-flex`,n].filter(Boolean).join(` `),children:e});return/* @__PURE__ */ f(`span`,{className:n?`wui-btn-roll-ico wui-btn-pin-icon`:`wui-btn-roll-ico ms-2`,"aria-hidden":`true`,children:[i(),i(`wui-btn-roll-ico__next`)]})}function S(e,t,n,r){if(!e)return null;let i=t===`left`?`me-2`:`ms-2`;return typeof e==`string`?/* @__PURE__ */ d(o,{name:e,size:p[n]??p.md,variant:r,className:i}):/* @__PURE__ */ d(`span`,{className:`d-inline-flex ${i}`,children:e})}function C(e,t,n){return e?/* @__PURE__ */ d(`span`,{className:`wui-btn-pin-icon`,"aria-hidden":`true`,children:typeof e==`string`?/* @__PURE__ */ d(o,{name:e,size:p[t]??p.md,variant:n}):e}):null}function w(o){let{marker:w,props:T}=a(`AppButton`,o),{children:E,tone:D=`primary`,variant:O=`solid`,size:k=`md`,type:A=`button`,loading:j=!1,disabled:M=!1,block:N=!1,leftIcon:P=null,rightIcon:F=null,href:I,static:L=!1,tooltip:R,tooltipPlacement:z,shortcut:B,animation:V,pinRightIcon:H=!1,shape:U=`rounded`,iconVariant:W,className:G=``,onClick:K,vibrate:q,...J}=T;c(`AppButton`,J),s(`AppButton`,`vibrate`,q,_);let Y=q===!0?10:Number.isInteger(q)&&q>=1&&q<=100?q:0;V!==void 0&&s(`AppButton`,`animation`,V,m);let X=V===`roll`&&!L,Z=H&&F!=null&&F!==``&&!L&&!j;if(s(`AppButton`,`tone`,D,i),s(`AppButton`,`variant`,O,r),s(`AppButton`,`size`,k,Object.keys(p)),s(`AppButton`,`shape`,U,h),s(`AppButton`,`type`,A,g),W!==void 0&&s(`AppButton`,`iconVariant`,W,v),L){let t=[`btn`,e(D,O),k===`sm`?`btn-sm`:k===`lg`?`btn-lg`:``,N?`w-100`:``,y(U),`btn-static`,G].filter(Boolean).join(` `);return l(/* @__PURE__ */ f(`span`,{className:t,...w,...J,children:[S(P,`left`,k,W),E,S(F,`right`,k,W)]}),R,z)}let Q=[N?`w-100`:``,j?`is-loading`:``,e(D,O),V&&m.includes(V)?`btn-anim-${V}`:``,Z?`wui-btn-pin-end`:``,y(U),G].filter(Boolean).join(` `),$=(J.as===void 0||J.as===`button`)&&I===void 0&&J.to===void 0,ee=$?{}:{role:void 0,tabIndex:M||j?-1:void 0},te=R!=null&&R!==``,ne=Y?e=>{!M&&!j&&navigator.vibrate?.(Y),K?.(e)}:K;return l(/* @__PURE__ */ f(u,{type:$?A:void 0,href:I,variant:null,size:k===`md`?void 0:k,disabled:M||j,"aria-busy":j||void 0,"aria-keyshortcuts":t(B),"data-wui-vibrate":Y||void 0,className:Q||void 0,onClick:ne,...ee,...w,...J,children:[j&&/* @__PURE__ */ d(`span`,{className:`spinner-border spinner-border-sm me-2`,"aria-hidden":`true`}),!j&&S(P,`left`,k,W),X?b(E):E,!j&&(X?x(F,k,Z,W):Z?C(F,k,W):S(F,`right`,k,W)),!te&&n(B)]}),R,z,B)}export{w as default};
1
+ import{buttonClass as e}from"../lib/buttonClass.js";import{shortcutAria as t,shortcutChip as n}from"../lib/shortcutChip.js";import{FILL_VARIANTS as r,TONES as i}from"../lib/vocabulary.js";import{splitMarkerProps as a}from"../lib/wuiMarker.js";import o from"./AppIcon.js";import s from"./assertValidValue.js";import c from"./warnUnknownProps.js";import l from"./withTooltip.js";import{Button as u}from"react-bootstrap";import{jsx as d,jsxs as f}from"react/jsx-runtime";var p={sm:14,md:16,lg:20},m=[`sheen`,`fill`,`expand`,`glow`,`roll`,`none`],h=[`rounded`,`pill`,`sharp`],g=[`button`,`submit`,`reset`],_=/* @__PURE__ */ new Set([!0,!1,...Array.from({length:100},(e,t)=>t+1)]),v=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`],y=e=>e===`pill`||e===`sharp`?`wui-btn-shape-${e}`:``;function b(e){return/* @__PURE__ */ f(`span`,{className:`wui-btn-roll`,children:[/* @__PURE__ */ d(`span`,{className:`wui-btn-roll__a`,children:e}),/* @__PURE__ */ d(`span`,{className:`wui-btn-roll__b`,"aria-hidden":`true`,children:e})]})}function x(e,t,n,r){if(!e)return null;let i=n=>typeof e==`string`?/* @__PURE__ */ d(o,{name:e,size:p[t]??p.md,variant:r,className:n}):/* @__PURE__ */ d(`span`,{className:[`d-inline-flex`,n].filter(Boolean).join(` `),children:e});return/* @__PURE__ */ f(`span`,{className:n?`wui-btn-roll-ico wui-btn-pin-icon`:`wui-btn-roll-ico ms-2`,"aria-hidden":`true`,children:[i(),i(`wui-btn-roll-ico__next`)]})}function S(e,t,n,r){if(!e)return null;let i=t===`left`?`me-2`:`ms-2`;return typeof e==`string`?/* @__PURE__ */ d(o,{name:e,size:p[n]??p.md,variant:r,className:i}):/* @__PURE__ */ d(`span`,{className:`d-inline-flex ${i}`,children:e})}function C(e,t,n){return e?/* @__PURE__ */ d(`span`,{className:`wui-btn-pin-icon`,"aria-hidden":`true`,children:typeof e==`string`?/* @__PURE__ */ d(o,{name:e,size:p[t]??p.md,variant:n}):e}):null}function w(o){let{marker:w,props:T}=a(`AppButton`,o),{children:E,tone:D=`primary`,variant:O=`solid`,size:k=`md`,type:A=`button`,loading:j=!1,disabled:M=!1,block:N=!1,leftIcon:P=null,rightIcon:F=null,href:I,static:L=!1,tooltip:R,tooltipPlacement:z,shortcut:B,animation:V,pinRightIcon:H=!1,shape:U=`rounded`,iconVariant:W,className:G=``,onClick:K,vibrate:q,...J}=T;c(`AppButton`,J),s(`AppButton`,`vibrate`,q,_);let Y=q===!0?10:Number.isInteger(q)&&q>=1&&q<=100?q:0;V!==void 0&&s(`AppButton`,`animation`,V,m);let X=V===`roll`&&!L,Z=H&&F!=null&&F!==``&&!L&&!j;if(s(`AppButton`,`tone`,D,i),s(`AppButton`,`variant`,O,r),s(`AppButton`,`size`,k,Object.keys(p)),s(`AppButton`,`shape`,U,h),s(`AppButton`,`type`,A,g),W!==void 0&&s(`AppButton`,`iconVariant`,W,v),L){let t=[`btn`,e(D,O),k===`sm`?`btn-sm`:k===`lg`?`btn-lg`:``,N?`w-100`:``,y(U),`btn-static`,G].filter(Boolean).join(` `);return l(/* @__PURE__ */ f(`span`,{className:t,...w,...J,children:[S(P,`left`,k,W),E,S(F,`right`,k,W)]}),R,z)}let Q=[N?`w-100`:``,j?`is-loading`:``,e(D,O),V&&m.includes(V)?`btn-anim-${V}`:``,Z?`wui-btn-pin-end`:``,y(U),G].filter(Boolean).join(` `),$=(J.as===void 0||J.as===`button`)&&I===void 0&&J.to===void 0,ee=$?{}:{role:void 0,tabIndex:M||j?-1:void 0},te=R!=null&&R!==``,ne=Y?e=>{!M&&!j&&navigator.vibrate?.(Y),K?.(e)}:K;return l(/* @__PURE__ */ f(u,{type:$?A:void 0,href:I,variant:null,size:k===`md`?void 0:k,disabled:M||j,"aria-busy":j||void 0,"aria-keyshortcuts":t(B),"data-wui-vibrate":Y||void 0,className:Q||void 0,onClick:ne,...ee,...w,...J,children:[j&&/* @__PURE__ */ d(`span`,{className:`spinner-border spinner-border-sm me-2`,"aria-hidden":`true`}),!j&&S(P,`left`,k,W),X?b(E):E,!j&&(X?x(F,k,Z,W):Z?C(F,k,W):S(F,`right`,k,W)),!te&&n(B)]}),R,z,B)}export{w 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}from"react/jsx-runtime";var i={sm:`btn-group-sm`,md:``,lg:`btn-group-lg`};function a(a){let{marker:o,props:s}=e(`AppButtonGroup`,a),{label:c,children:l,size:u=`md`,vertical:d=!1,fullWidth:f=!1,className:p=``,...m}=s;n(`AppButtonGroup`,m),t(`AppButtonGroup`,`size`,u,Object.keys(i));let h=[d?`btn-group-vertical`:`btn-group`,`wui-btn-group`,i[u]??``,f?`wui-btn-group-full`:``,p].filter(Boolean).join(` `);return/* @__PURE__ */ r(`div`,{role:`group`,"aria-label":c,className:h,...o,...m,children:l})}export{a as default};
1
+ import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./assertValidValue.js";import n from"./warnUnknownProps.js";import{jsx as r}from"react/jsx-runtime";var i={sm:`btn-group-sm`,md:``,lg:`btn-group-lg`};function a(a){let{marker:o,props:s}=e(`AppButtonGroup`,a),{label:c,children:l,size:u=`md`,vertical:d=!1,fullWidth:f=!1,className:p=``,...m}=s;n(`AppButtonGroup`,m),t(`AppButtonGroup`,`size`,u,Object.keys(i));let h=[d?`btn-group-vertical`:`btn-group`,`wui-btn-group`,i[u]??``,f?`wui-btn-group-full`:``,p].filter(Boolean).join(` `);return/* @__PURE__ */ r(`div`,{role:`group`,"aria-label":c,className:h,...o,...m,children:l})}export{a as default};
@@ -1 +1 @@
1
- import{devWarn as e}from"../lib/devWarn.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./warnInvalidValue.js";import r from"./warnUnknownProps.js";import{forwardRef as i,useCallback as a,useEffect as o,useLayoutEffect as s,useRef as c,useState as l}from"react";import{jsx as u}from"react/jsx-runtime";var d=`wui-calendar:event-click`,f=`wui-calendar:date-click`,p=`wui-calendar:range-change`,m=[`month`,`week`,`day`,`list`],h=`This calendar couldn't load. Try again in a moment.`,g=i(function(i,g){let{marker:_,props:v}=t(`AppCalendar`,i),{label:y,events:b,eventsUrl:x,view:S,date:C,emptyText:w,errorText:T,firstDay:E,timeZone:D,onEventClick:O,onDateClick:k,onRangeChange:A,className:j=``,style:M,...N}=v;r(`AppCalendar`,N),n(`AppCalendar`,`view`,S,m);let P=c(null),F=c(``),I=c({onEventClick:O,onDateClick:k,onRangeChange:A}),[L,R]=l(!1),z=a(e=>{P.current=e,typeof g==`function`?g(e):g&&(g.current=e)},[g]);return o(()=>{I.current={onEventClick:O,onDateClick:k,onRangeChange:A}}),s(()=>{let e=P.current;if(!e)return;let t=b==null?``:JSON.stringify(b);t!==F.current&&(F.current=t,e.events=b??null)}),o(()=>{let e=P.current,t=[[d,e=>{I.current.onEventClick?.(e.detail)===!1&&e.preventDefault()}],[f,e=>I.current.onDateClick?.(e.detail)],[p,e=>I.current.onRangeChange?.(e.detail)]];for(let[n,r]of t)e.addEventListener(n,r);return()=>{for(let[n,r]of t)e.removeEventListener(n,r)}},[]),o(()=>{let t=!0;return import(`@webority/ui-elements/calendar`).catch(n=>{e(`[AppCalendar] the calendar failed to load:`,n?.message),t&&R(!0)}),()=>{t=!1}},[]),L?/* @__PURE__ */ u(`div`,{..._,className:j||void 0,style:M,role:`status`,children:/* @__PURE__ */ u(`p`,{className:`wui-calendar-status-text`,children:T||h})}):/* @__PURE__ */ u(`wui-calendar`,{ref:z,label:y||void 0,"events-url":x||void 0,view:S||void 0,date:C||void 0,"empty-text":w||void 0,"error-text":T||void 0,"first-day":E==null?void 0:String(E),"time-zone":D||void 0,className:j||void 0,style:M,..._,...N})});export{g as default};
1
+ import{devWarn as e}from"../lib/devWarn.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./assertValidValue.js";import r from"./warnUnknownProps.js";import{forwardRef as i,useCallback as a,useEffect as o,useLayoutEffect as s,useRef as c,useState as l}from"react";import{jsx as u}from"react/jsx-runtime";var d=`wui-calendar:event-click`,f=`wui-calendar:date-click`,p=`wui-calendar:range-change`,m=[`month`,`week`,`day`,`list`],h=`This calendar couldn't load. Try again in a moment.`,g=i(function(i,g){let{marker:_,props:v}=t(`AppCalendar`,i),{label:y,events:b,eventsUrl:x,view:S,date:C,emptyText:w,errorText:T,firstDay:E,timeZone:D,onEventClick:O,onDateClick:k,onRangeChange:A,className:j=``,style:M,...N}=v;r(`AppCalendar`,N),n(`AppCalendar`,`view`,S,m);let P=c(null),F=c(``),I=c({onEventClick:O,onDateClick:k,onRangeChange:A}),[L,R]=l(!1),z=a(e=>{P.current=e,typeof g==`function`?g(e):g&&(g.current=e)},[g]);return o(()=>{I.current={onEventClick:O,onDateClick:k,onRangeChange:A}}),s(()=>{let e=P.current;if(!e)return;let t=b==null?``:JSON.stringify(b);t!==F.current&&(F.current=t,e.events=b??null)}),o(()=>{let e=P.current,t=[[d,e=>{I.current.onEventClick?.(e.detail)===!1&&e.preventDefault()}],[f,e=>I.current.onDateClick?.(e.detail)],[p,e=>I.current.onRangeChange?.(e.detail)]];for(let[n,r]of t)e.addEventListener(n,r);return()=>{for(let[n,r]of t)e.removeEventListener(n,r)}},[]),o(()=>{let t=!0;return import(`@webority/ui-elements/calendar`).catch(n=>{e(`[AppCalendar] the calendar failed to load:`,n?.message),t&&R(!0)}),()=>{t=!1}},[]),L?/* @__PURE__ */ u(`div`,{..._,className:j||void 0,style:M,role:`status`,children:/* @__PURE__ */ u(`p`,{className:`wui-calendar-status-text`,children:T||h})}):/* @__PURE__ */ u(`wui-calendar`,{ref:z,label:y||void 0,"events-url":x||void 0,view:S||void 0,date:C||void 0,"empty-text":w||void 0,"error-text":T||void 0,"first-day":E==null?void 0:String(E),"time-zone":D||void 0,className:j||void 0,style:M,..._,...N})});export{g as default};
@@ -1 +1 @@
1
- import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./AppIcon.js";import n from"./warnInvalidValue.js";import r from"./warnUnknownProps.js";import{useState as i}from"react";import{Card as a}from"react-bootstrap";import{Fragment as o,jsx as s,jsxs as c}from"react/jsx-runtime";var l=[`flat`,`elevated`,`outline`,`filled`,`accent`],u={elevated:`card-elevated`,outline:`card-outlined`,filled:`card-muted`,accent:`card-accent`},d=[`primary`,`success`,`warning`,`danger`,`info`],f=[`none`,`sm`,`md`,`lg`],ee=[`sans`,`serif`],p={xs:320,sm:420,md:560,lg:720};function m(m){let{marker:h,props:te}=e(`AppCard`,m),{title:g,subtitle:_,headerIcon:v,titleClassName:y=``,titleFont:b=`sans`,header:x,headerExtra:S,headerActions:C,footer:w,media:T,children:E,variant:D=`flat`,tone:O=`primary`,padding:k=`md`,maxWidth:A,className:ne=``,bodyClassName:re=``,headerClassName:j=``,body:M=!0,lifted:N=!1,flush:P=!1,divided:F=!1,href:I,onClick:L,linkComponent:R,onClose:z,dismissible:B,closeLabel:V=`Close`,...H}=te,[U,W]=i(!1);r(`AppCard`,H),n(`AppCard`,`variant`,D,l),n(`AppCard`,`tone`,O,d),n(`AppCard`,`padding`,k,f),n(`AppCard`,`titleFont`,b,ee);let{style:G,...K}=H,q=I!=null||L!=null,J=[u[D]??``,D===`accent`&&O&&O!==`primary`?`tone-${O}`:``,k&&k!==`md`?`card-pad-${k}`:``,P?`card-flush`:``,F?`card-divided`:``,N?`card-lifted`:``,A==null?``:`card-constrained`,q?`card-clickable`:``,ne].filter(Boolean).join(` `)||void 0,Y=A==null?void 0:p[A]==null?typeof A==`number`?`${A}px`:A:`${p[A]}px`,ie=Y?{"--card-max-width":Y,...G}:G,X={};I==null?L!=null&&(X={role:`button`,tabIndex:0,onClick:L,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),L(e))}}):(X=R?{as:R,to:I}:{as:`a`,href:I},L&&(X.onClick=L));let Z=B??typeof z==`function`,ae=Z?/* @__PURE__ */ s(`button`,{type:`button`,className:`card-close`,"aria-label":V,onClick:e=>{e.preventDefault(),e.stopPropagation(),W(!0),z?.()},onKeyDown:e=>e.stopPropagation(),children:/* @__PURE__ */ s(t,{name:`x`,size:16})}):null,Q=g!=null||_!=null||v!=null,oe=x!=null||Q||S!=null||C!=null||Z,$=v==null?null:typeof v==`string`?/* @__PURE__ */ s(t,{name:v,size:18}):v;return U?null:/* @__PURE__ */ c(a,{className:J,style:ie,...h,...K,...X,children:[T!=null&&/* @__PURE__ */ s(`div`,{className:`card-media`,children:T}),oe&&/* @__PURE__ */ c(a.Header,{className:j||void 0,children:[x??/* @__PURE__ */ c(o,{children:[Q&&/* @__PURE__ */ c(`div`,{className:`card-header-main`,children:[$!=null&&/* @__PURE__ */ s(`span`,{className:`card-header-icon`,children:$}),/* @__PURE__ */ c(`div`,{className:`card-header-titles`,children:[g!=null&&/* @__PURE__ */ s(`div`,{className:[`card-title`,y].filter(Boolean).join(` `),style:b===`serif`?{fontFamily:`var(--wui-font-display)`}:void 0,children:g}),_!=null&&/* @__PURE__ */ s(`div`,{className:`card-subtitle`,children:_})]})]}),S,C!=null&&/* @__PURE__ */ s(`div`,{className:`card-header-actions`,children:C})]}),ae]}),M?/* @__PURE__ */ s(a.Body,{className:re||void 0,children:E}):E,w!=null&&/* @__PURE__ */ s(`div`,{className:`card-footer`,children:w})]})}export{m as default};
1
+ import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./AppIcon.js";import n from"./assertValidValue.js";import r from"./warnUnknownProps.js";import{useState as i}from"react";import{Card as a}from"react-bootstrap";import{Fragment as o,jsx as s,jsxs as c}from"react/jsx-runtime";var l=[`flat`,`elevated`,`outline`,`filled`,`accent`],u={elevated:`card-elevated`,outline:`card-outlined`,filled:`card-muted`,accent:`card-accent`},d=[`primary`,`success`,`warning`,`danger`,`info`],f=[`none`,`sm`,`md`,`lg`],ee=[`sans`,`serif`],p={xs:320,sm:420,md:560,lg:720};function m(m){let{marker:h,props:te}=e(`AppCard`,m),{title:g,subtitle:_,headerIcon:v,titleClassName:y=``,titleFont:b=`sans`,header:x,headerExtra:S,headerActions:C,footer:w,media:T,children:E,variant:D=`flat`,tone:O=`primary`,padding:k=`md`,maxWidth:A,className:ne=``,bodyClassName:re=``,headerClassName:j=``,body:M=!0,lifted:N=!1,flush:P=!1,divided:F=!1,href:I,onClick:L,linkComponent:R,onClose:z,dismissible:B,closeLabel:V=`Close`,...H}=te,[U,W]=i(!1);r(`AppCard`,H),n(`AppCard`,`variant`,D,l),n(`AppCard`,`tone`,O,d),n(`AppCard`,`padding`,k,f),n(`AppCard`,`titleFont`,b,ee);let{style:G,...K}=H,q=I!=null||L!=null,J=[u[D]??``,D===`accent`&&O&&O!==`primary`?`tone-${O}`:``,k&&k!==`md`?`card-pad-${k}`:``,P?`card-flush`:``,F?`card-divided`:``,N?`card-lifted`:``,A==null?``:`card-constrained`,q?`card-clickable`:``,ne].filter(Boolean).join(` `)||void 0,Y=A==null?void 0:p[A]==null?typeof A==`number`?`${A}px`:A:`${p[A]}px`,ie=Y?{"--card-max-width":Y,...G}:G,X={};I==null?L!=null&&(X={role:`button`,tabIndex:0,onClick:L,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),L(e))}}):(X=R?{as:R,to:I}:{as:`a`,href:I},L&&(X.onClick=L));let Z=B??typeof z==`function`,ae=Z?/* @__PURE__ */ s(`button`,{type:`button`,className:`card-close`,"aria-label":V,onClick:e=>{e.preventDefault(),e.stopPropagation(),W(!0),z?.()},onKeyDown:e=>e.stopPropagation(),children:/* @__PURE__ */ s(t,{name:`x`,size:16})}):null,Q=g!=null||_!=null||v!=null,oe=x!=null||Q||S!=null||C!=null||Z,$=v==null?null:typeof v==`string`?/* @__PURE__ */ s(t,{name:v,size:18}):v;return U?null:/* @__PURE__ */ c(a,{className:J,style:ie,...h,...K,...X,children:[T!=null&&/* @__PURE__ */ s(`div`,{className:`card-media`,children:T}),oe&&/* @__PURE__ */ c(a.Header,{className:j||void 0,children:[x??/* @__PURE__ */ c(o,{children:[Q&&/* @__PURE__ */ c(`div`,{className:`card-header-main`,children:[$!=null&&/* @__PURE__ */ s(`span`,{className:`card-header-icon`,children:$}),/* @__PURE__ */ c(`div`,{className:`card-header-titles`,children:[g!=null&&/* @__PURE__ */ s(`div`,{className:[`card-title`,y].filter(Boolean).join(` `),style:b===`serif`?{fontFamily:`var(--wui-font-display)`}:void 0,children:g}),_!=null&&/* @__PURE__ */ s(`div`,{className:`card-subtitle`,children:_})]})]}),S,C!=null&&/* @__PURE__ */ s(`div`,{className:`card-header-actions`,children:C})]}),ae]}),M?/* @__PURE__ */ s(a.Body,{className:re||void 0,children:E}):E,w!=null&&/* @__PURE__ */ s(`div`,{className:`card-footer`,children:w})]})}export{m as default};
@@ -1 +1 @@
1
- import{devWarn as e}from"../lib/devWarn.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./warnInvalidValue.js";import r from"./warnUnknownProps.js";import{forwardRef as i,useCallback as a,useEffect as o,useLayoutEffect as s,useRef as c,useState as l}from"react";import{jsx as u}from"react/jsx-runtime";var ee=`wui-chart:select`,te=`wui-chart:legend-change`,ne=`wui-chart:ready`,re=[`line`,`area`,`column`,`bar`,`donut`,`heatmap`,`calendar`,`funnel`,`gauge`,`waterfall`,`treemap`,`sankey`,`scatter`,`bubble`,`multiples`],d=[`none`,`stacked`,`percent`],f=[`ready`,`loading`,`empty`,`error`],p=[`auto`,`svg`,`canvas`],ie=[`chart`,`table`],m=`This chart couldn't load. Try again in a moment.`,h=()=>{try{return process.env.NODE_ENV!==`production`}catch{return!0}},g=!1;function ae(){!g&&h()&&(g=!0,e("[@webority/ui-react] <AppChart> has no `title`, which names the chart for assistive tech and its exported files."))}var _=e=>e===``?void 0:e,v=e=>Array.isArray(e)?e.map(v):e==null||Object.getPrototypeOf(e)!==Object.prototype?e:Object.fromEntries(Object.entries(e).filter(([,e])=>e!==``).map(([e,t])=>[e,v(t)])),y=e=>({type:_(e.type),title:_(e.title),description:_(e.description),data:e.data,x:v(e.x),series:v(e.series),group:v(e.group),to:v(e.to),size:v(e.size),trend:e.trend,zoom:e.zoom,bands:v(e.bands),stack:_(e.stack),y:v(e.y),target:v(e.target),centerLabel:_(e.centerLabel),valueLabels:_(e.valueLabels),height:e.height>0?e.height:void 0,state:_(e.state),emptyText:_(e.emptyText),errorText:_(e.errorText),loadingText:_(e.loadingText),renderer:_(e.renderer),timeZone:_(e.timeZone)}),oe=(e,t)=>t!=null&&Object.keys(e).every(n=>Object.is(e[n],t[n])),se=e=>{try{return JSON.stringify(e)}catch{return null}},b=i(function(i,g){let{marker:_,props:v}=t(`AppChart`,i),{type:b,title:x,description:ce,data:le,x:ue,series:S,group:C,to:w,size:T,trend:E,zoom:D,bands:O,stack:k,y:A,target:j,centerLabel:M,valueLabels:N,height:P,state:F,loading:I,error:L,emptyText:R,errorText:z,loadingText:B,renderer:V,timeZone:H,view:U,onSelect:W,onLegendChange:G,onReady:K,className:q=``,style:J,...Y}=v;r(`AppChart`,Y),n(`AppChart`,`type`,b,re),n(`AppChart`,`stack`,k,d),n(`AppChart`,`state`,F,f),n(`AppChart`,`renderer`,V,p),n(`AppChart`,`view`,U,ie),x||ae();let X=!!L;h()&&I&&X&&e("[@webority/ui-react] <AppChart> takes `loading` or `error`, not both; `error` is shown.");let de=X?`error`:I?`loading`:F,fe=X?L:z,Z=c(null),Q=c({props:null,signature:null}),$=c({onSelect:W,onLegendChange:G,onReady:K}),[pe,me]=l(!1),he=a(e=>{Z.current=e,typeof g==`function`?g(e):g&&(g.current=e)},[g]);return o(()=>{$.current={onSelect:W,onLegendChange:G,onReady:K}}),s(()=>{let e=Z.current;if(!e)return;let t={type:b,title:x,description:ce,data:le,x:ue,series:S,group:C,to:w,size:T,trend:E,zoom:D,bands:O,stack:k,y:A,target:j,centerLabel:M,valueLabels:N,height:P,state:de,emptyText:R,errorText:fe,loadingText:B,renderer:V,timeZone:H};if(oe(t,Q.current.props))return;Q.current.props=t;let n=y(t),r=se(n);(r===null||r!==Q.current.signature)&&(Q.current.signature=r,e.spec=n)}),o(()=>{let e=Z.current,t=e=>t=>$.current[e]?.(t.detail),n=[[ee,t(`onSelect`)],[te,t(`onLegendChange`)],[ne,t(`onReady`)]];for(let[t,r]of n)e.addEventListener(t,r);return()=>{for(let[t,r]of n)e.removeEventListener(t,r)}},[]),o(()=>{let t=!0;return import(`@webority/ui-elements/chart`).catch(n=>{e(`[AppChart] the chart failed to load:`,n?.message),t&&me(!0)}),()=>{t=!1}},[]),pe?/* @__PURE__ */ u(`div`,{..._,className:q||void 0,style:J,role:`status`,children:/* @__PURE__ */ u(`p`,{className:`wui-chart-state-text`,children:z||m})}):/* @__PURE__ */ u(`wui-chart`,{ref:he,view:U||void 0,className:q||void 0,style:J,..._,...Y})});export{b as default};
1
+ import{devWarn as e}from"../lib/devWarn.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./assertValidValue.js";import r from"./warnUnknownProps.js";import{forwardRef as i,useCallback as a,useEffect as o,useLayoutEffect as s,useRef as c,useState as l}from"react";import{jsx as u}from"react/jsx-runtime";var ee=`wui-chart:select`,te=`wui-chart:legend-change`,ne=`wui-chart:ready`,re=[`line`,`area`,`column`,`bar`,`donut`,`heatmap`,`calendar`,`funnel`,`gauge`,`waterfall`,`treemap`,`sankey`,`scatter`,`bubble`,`multiples`],d=[`none`,`stacked`,`percent`],f=[`ready`,`loading`,`empty`,`error`],p=[`auto`,`svg`,`canvas`],ie=[`chart`,`table`],m=`This chart couldn't load. Try again in a moment.`,h=()=>{try{return process.env.NODE_ENV!==`production`}catch{return!0}},g=!1;function ae(){!g&&h()&&(g=!0,e("[@webority/ui-react] <AppChart> has no `title`, which names the chart for assistive tech and its exported files."))}var _=e=>e===``?void 0:e,v=e=>Array.isArray(e)?e.map(v):e==null||Object.getPrototypeOf(e)!==Object.prototype?e:Object.fromEntries(Object.entries(e).filter(([,e])=>e!==``).map(([e,t])=>[e,v(t)])),y=e=>({type:_(e.type),title:_(e.title),description:_(e.description),data:e.data,x:v(e.x),series:v(e.series),group:v(e.group),to:v(e.to),size:v(e.size),trend:e.trend,zoom:e.zoom,bands:v(e.bands),stack:_(e.stack),y:v(e.y),target:v(e.target),centerLabel:_(e.centerLabel),valueLabels:_(e.valueLabels),height:e.height>0?e.height:void 0,state:_(e.state),emptyText:_(e.emptyText),errorText:_(e.errorText),loadingText:_(e.loadingText),renderer:_(e.renderer),timeZone:_(e.timeZone)}),oe=(e,t)=>t!=null&&Object.keys(e).every(n=>Object.is(e[n],t[n])),se=e=>{try{return JSON.stringify(e)}catch{return null}},b=i(function(i,g){let{marker:_,props:v}=t(`AppChart`,i),{type:b,title:x,description:ce,data:le,x:ue,series:S,group:C,to:w,size:T,trend:E,zoom:D,bands:O,stack:k,y:A,target:j,centerLabel:M,valueLabels:N,height:P,state:F,loading:I,error:L,emptyText:R,errorText:z,loadingText:B,renderer:V,timeZone:H,view:U,onSelect:W,onLegendChange:G,onReady:K,className:q=``,style:J,...Y}=v;r(`AppChart`,Y),n(`AppChart`,`type`,b,re),n(`AppChart`,`stack`,k,d),n(`AppChart`,`state`,F,f),n(`AppChart`,`renderer`,V,p),n(`AppChart`,`view`,U,ie),x||ae();let X=!!L;h()&&I&&X&&e("[@webority/ui-react] <AppChart> takes `loading` or `error`, not both; `error` is shown.");let de=X?`error`:I?`loading`:F,fe=X?L:z,Z=c(null),Q=c({props:null,signature:null}),$=c({onSelect:W,onLegendChange:G,onReady:K}),[pe,me]=l(!1),he=a(e=>{Z.current=e,typeof g==`function`?g(e):g&&(g.current=e)},[g]);return o(()=>{$.current={onSelect:W,onLegendChange:G,onReady:K}}),s(()=>{let e=Z.current;if(!e)return;let t={type:b,title:x,description:ce,data:le,x:ue,series:S,group:C,to:w,size:T,trend:E,zoom:D,bands:O,stack:k,y:A,target:j,centerLabel:M,valueLabels:N,height:P,state:de,emptyText:R,errorText:fe,loadingText:B,renderer:V,timeZone:H};if(oe(t,Q.current.props))return;Q.current.props=t;let n=y(t),r=se(n);(r===null||r!==Q.current.signature)&&(Q.current.signature=r,e.spec=n)}),o(()=>{let e=Z.current,t=e=>t=>$.current[e]?.(t.detail),n=[[ee,t(`onSelect`)],[te,t(`onLegendChange`)],[ne,t(`onReady`)]];for(let[t,r]of n)e.addEventListener(t,r);return()=>{for(let[t,r]of n)e.removeEventListener(t,r)}},[]),o(()=>{let t=!0;return import(`@webority/ui-elements/chart`).catch(n=>{e(`[AppChart] the chart failed to load:`,n?.message),t&&me(!0)}),()=>{t=!1}},[]),pe?/* @__PURE__ */ u(`div`,{..._,className:q||void 0,style:J,role:`status`,children:/* @__PURE__ */ u(`p`,{className:`wui-chart-state-text`,children:z||m})}):/* @__PURE__ */ u(`wui-chart`,{ref:he,view:U||void 0,className:q||void 0,style:J,..._,...Y})});export{b as default};
@@ -1 +1 @@
1
- import e from"../lib/CheckField.js";import{FIELD_SIZES as t}from"../lib/fieldState.js";import n from"../lib/labelWithHelp.js";import{splitMarkerProps as r}from"../lib/wuiMarker.js";import i from"./warnInvalidValue.js";import a from"./warnUnknownProps.js";import{forwardRef as o}from"react";import{jsx as s}from"react/jsx-runtime";var c=[`circle`],l=o(function(o,l){let{marker:u,props:d}=r(`AppCheckbox`,o),{label:f,id:p,name:m,error:h,helperText:g,shape:_,help:v,helpLabel:y=`More information`,readOnly:b=!1,loading:x=!1,size:S=`md`,className:C=``,...w}=d;a(`AppCheckbox`,w),i(`AppCheckbox`,`shape`,_,c),i(`AppCheckbox`,`size`,S,t);let T=_===`circle`?`form-check form-check-circle`:`form-check`;return/* @__PURE__ */ s(e,{rootProps:u,ref:l,label:n(f,v,y),id:p,name:m,error:h,hint:g,className:C,rest:w,inputType:`checkbox`,wrapperClass:T,readOnly:b,loading:x,size:S})});export{l as default};
1
+ import e from"../lib/CheckField.js";import{FIELD_SIZES as t}from"../lib/fieldState.js";import n from"../lib/labelWithHelp.js";import{splitMarkerProps as r}from"../lib/wuiMarker.js";import i from"./assertValidValue.js";import a from"./warnUnknownProps.js";import{forwardRef as o}from"react";import{jsx as s}from"react/jsx-runtime";var c=[`circle`],l=o(function(o,l){let{marker:u,props:d}=r(`AppCheckbox`,o),{label:f,id:p,name:m,error:h,helperText:g,shape:_,help:v,helpLabel:y=`More information`,readOnly:b=!1,loading:x=!1,size:S=`md`,className:C=``,...w}=d;a(`AppCheckbox`,w),i(`AppCheckbox`,`shape`,_,c),i(`AppCheckbox`,`size`,S,t);let T=_===`circle`?`form-check form-check-circle`:`form-check`;return/* @__PURE__ */ s(e,{rootProps:u,ref:l,label:n(f,v,y),id:p,name:m,error:h,hint:g,className:C,rest:w,inputType:`checkbox`,wrapperClass:T,readOnly:b,loading:x,size:S})});export{l as default};
@@ -1 +1 @@
1
- import{TONES as e}from"../lib/vocabulary.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./AppIcon.js";import r from"./warnInvalidValue.js";import i from"./warnUnknownProps.js";import{Fragment as a,jsx as o,jsxs as s}from"react/jsx-runtime";var c=[`soft`,`outline`,`solid`],l=[`sm`,`md`];function u(u){let{marker:d,props:f}=t(`AppChip`,u),{label:p,children:m,tone:h=`neutral`,variant:g=`soft`,size:_=`md`,leadingIcon:v,avatar:y,onRemove:b,onClick:x,disabled:S=!1,removeLabel:C,className:w=``,...T}=f;i(`AppChip`,T),r(`AppChip`,`tone`,h,e),r(`AppChip`,`variant`,g,c),r(`AppChip`,`size`,_,l);let E=p??m,D={},O={};for(let[e,t]of Object.entries(T))x&&(e.startsWith(`aria-`)||e.startsWith(`data-`))?D[e]=t:O[e]=t;let k=[`chip`,h&&h!==`neutral`?h:``,g===`outline`?`chip-outline`:g===`solid`?`chip-solid`:``,_===`sm`?`chip-sm`:``,x?`chip-clickable`:``,b?`chip-removable`:``,S?`is-disabled`:``,w].filter(Boolean).join(` `),A=y?/* @__PURE__ */ o(`span`,{className:`chip-avatar`,children:typeof y==`string`?/* @__PURE__ */ o(`img`,{src:y,alt:``}):y}):v?/* @__PURE__ */ o(`span`,{className:`chip-ic`,children:/* @__PURE__ */ o(n,{name:v,size:_===`sm`?12:14})}):null,j=x?/* @__PURE__ */ s(`button`,{type:`button`,className:`chip-body`,...D,onClick:x,disabled:S,children:[A,/* @__PURE__ */ o(`span`,{className:`chip-label`,children:E})]}):/* @__PURE__ */ s(a,{children:[A,/* @__PURE__ */ o(`span`,{className:`chip-label`,children:E})]});return/* @__PURE__ */ s(`span`,{className:k,...d,...O,children:[j,b&&/* @__PURE__ */ o(`button`,{type:`button`,className:`chip-remove`,onClick:b,disabled:S,"aria-label":C||(typeof E==`string`?`Remove ${E}`:`Remove`),children:/* @__PURE__ */ o(n,{name:`x`,size:_===`sm`?12:14})})]})}export{u as default};
1
+ import{TONES as e}from"../lib/vocabulary.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./AppIcon.js";import r from"./assertValidValue.js";import i from"./warnUnknownProps.js";import{Fragment as a,jsx as o,jsxs as s}from"react/jsx-runtime";var c=[`soft`,`outline`,`solid`],l=[`sm`,`md`];function u(u){let{marker:d,props:f}=t(`AppChip`,u),{label:p,children:m,tone:h=`neutral`,variant:g=`soft`,size:_=`md`,leadingIcon:v,avatar:y,onRemove:b,onClick:x,disabled:S=!1,removeLabel:C,className:w=``,...T}=f;i(`AppChip`,T),r(`AppChip`,`tone`,h,e),r(`AppChip`,`variant`,g,c),r(`AppChip`,`size`,_,l);let E=p??m,D={},O={};for(let[e,t]of Object.entries(T))x&&(e.startsWith(`aria-`)||e.startsWith(`data-`))?D[e]=t:O[e]=t;let k=[`chip`,h&&h!==`neutral`?h:``,g===`outline`?`chip-outline`:g===`solid`?`chip-solid`:``,_===`sm`?`chip-sm`:``,x?`chip-clickable`:``,b?`chip-removable`:``,S?`is-disabled`:``,w].filter(Boolean).join(` `),A=y?/* @__PURE__ */ o(`span`,{className:`chip-avatar`,children:typeof y==`string`?/* @__PURE__ */ o(`img`,{src:y,alt:``}):y}):v?/* @__PURE__ */ o(`span`,{className:`chip-ic`,children:/* @__PURE__ */ o(n,{name:v,size:_===`sm`?12:14})}):null,j=x?/* @__PURE__ */ s(`button`,{type:`button`,className:`chip-body`,...D,onClick:x,disabled:S,children:[A,/* @__PURE__ */ o(`span`,{className:`chip-label`,children:E})]}):/* @__PURE__ */ s(a,{children:[A,/* @__PURE__ */ o(`span`,{className:`chip-label`,children:E})]});return/* @__PURE__ */ s(`span`,{className:k,...d,...O,children:[j,b&&/* @__PURE__ */ o(`button`,{type:`button`,className:`chip-remove`,onClick:b,disabled:S,"aria-label":C||(typeof E==`string`?`Remove ${E}`:`Remove`),children:/* @__PURE__ */ o(n,{name:`x`,size:_===`sm`?12:14})})]})}export{u 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}from"react/jsx-runtime";import"@webority/ui-elements/elements/overflow";var i=[`wrap`,`menu`];function a(a){let{marker:o,props:s}=e(`AppChipGroup`,a),{children:c,overflow:l=`wrap`,moreLabel:u=`More`,label:d,className:f=``,...p}=s;n(`AppChipGroup`,p),t(`AppChipGroup`,`overflow`,l,i);let m=e=>[e,f].filter(Boolean).join(` `);return l===`menu`?/* @__PURE__ */ r(`wui-overflow`,{...o,class:`wui-chip-group-host`,label:u,children:/* @__PURE__ */ r(`div`,{role:`group`,"aria-label":d,className:m(`wui-chip-group wui-chip-group-nowrap`),"data-wui-overflow-list":``,...p,children:c})}):/* @__PURE__ */ r(`div`,{role:`group`,"aria-label":d,className:m(`wui-chip-group`),...o,...p,children:c})}export{a as default};
1
+ import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./assertValidValue.js";import n from"./warnUnknownProps.js";import{jsx as r}from"react/jsx-runtime";import"@webority/ui-elements/elements/overflow";var i=[`wrap`,`menu`];function a(a){let{marker:o,props:s}=e(`AppChipGroup`,a),{children:c,overflow:l=`wrap`,moreLabel:u=`More`,label:d,className:f=``,...p}=s;n(`AppChipGroup`,p),t(`AppChipGroup`,`overflow`,l,i);let m=e=>[e,f].filter(Boolean).join(` `);return l===`menu`?/* @__PURE__ */ r(`wui-overflow`,{...o,class:`wui-chip-group-host`,label:u,children:/* @__PURE__ */ r(`div`,{role:`group`,"aria-label":d,className:m(`wui-chip-group wui-chip-group-nowrap`),"data-wui-overflow-list":``,...p,children:c})}):/* @__PURE__ */ r(`div`,{role:`group`,"aria-label":d,className:m(`wui-chip-group`),...o,...p,children:c})}export{a as default};
@@ -1 +1 @@
1
- import{FIELD_BUSY_CLASS as e,blockWhenReadOnly as t}from"../lib/fieldState.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./AppIcon.js";import i from"./AppInfoTip.js";import a from"./warnInvalidValue.js";import o from"./warnUnknownProps.js";import{Fragment as s,jsx as c,jsxs as l}from"react/jsx-runtime";var u={sm:` wui-struct-card-sm`,md:``,lg:` wui-struct-card-lg`},d={inline:``,stacked:` wui-struct-card-stacked`},f={filled:` wui-struct-card-filled`},p={sm:16,md:18,lg:22};function m(m){let{marker:h,props:g}=n(`AppChoiceCard`,m),{name:_,multiple:v=!1,value:y,checked:b,onChange:x,icon:S,iconNode:C,iconSize:w,image:T,imageAlt:E=``,children:D,title:O,description:k,help:A,helpLabel:j=`More information`,checkIcon:M=`check`,checkSize:N=18,hideCheck:P=!1,disabled:F=!1,readOnly:I=!1,loading:L=!1,size:R=`md`,layout:z=`inline`,selectedStyle:B,className:V=``,...H}=g;o(`AppChoiceCard`,H),a(`AppChoiceCard`,`size`,R,Object.keys(u)),a(`AppChoiceCard`,`layout`,z,Object.keys(d)),a(`AppChoiceCard`,`selectedStyle`,B,Object.keys(f));let U=u[R]??``,W=d[z]??``,G=f[B]??``,K=w??p[R]??p.md;return/* @__PURE__ */ l(`label`,{className:`struct-card${T?` struct-card-img-card`:``}${U}${W}${G}${P?` wui-struct-card-no-check`:``}${V?` ${V}`:``}${L?` ${e}`:``}`,"aria-disabled":F||void 0,"aria-busy":L||void 0,...h,...H,children:[/* @__PURE__ */ c(`input`,{type:v?`checkbox`:`radio`,name:_,value:y,className:`struct-card-input`,checked:b,onChange:x,onClick:t(I||L),"aria-readonly":I||void 0,disabled:F||L}),T?/* @__PURE__ */ c(`span`,{className:`struct-card-media`,children:/* @__PURE__ */ c(`img`,{className:`struct-card-img`,src:T,alt:E})}):C||S?/* @__PURE__ */ c(`span`,{className:`struct-card-ic`,children:C||/* @__PURE__ */ l(s,{children:[/* @__PURE__ */ c(`span`,{className:`wui-struct-card-glyph`,children:/* @__PURE__ */ c(r,{name:S,size:K})}),/* @__PURE__ */ c(`span`,{className:`wui-struct-card-glyph-on`,children:/* @__PURE__ */ c(r,{name:S,size:K,variant:`bold`})})]})}):null,/* @__PURE__ */ l(`span`,{className:`struct-card-body`,children:[D||/* @__PURE__ */ l(s,{children:[O&&/* @__PURE__ */ c(`span`,{className:`struct-card-title`,children:O}),k&&/* @__PURE__ */ c(`span`,{className:`struct-card-desc`,children:k})]}),A&&/* @__PURE__ */ c(i,{label:j,children:A})]}),!P&&/* @__PURE__ */ c(`span`,{className:`struct-card-check`,children:/* @__PURE__ */ c(r,{name:M,size:N})})]})}export{m as default};
1
+ import{FIELD_BUSY_CLASS as e,blockWhenReadOnly as t}from"../lib/fieldState.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./AppIcon.js";import i from"./AppInfoTip.js";import a from"./assertValidValue.js";import o from"./warnUnknownProps.js";import{Fragment as s,jsx as c,jsxs as l}from"react/jsx-runtime";var u={sm:` wui-struct-card-sm`,md:``,lg:` wui-struct-card-lg`},d={inline:``,stacked:` wui-struct-card-stacked`},f={filled:` wui-struct-card-filled`},p={sm:16,md:18,lg:22};function m(m){let{marker:h,props:g}=n(`AppChoiceCard`,m),{name:_,multiple:v=!1,value:y,checked:b,onChange:x,icon:S,iconNode:C,iconSize:w,image:T,imageAlt:E=``,children:D,title:O,description:k,help:A,helpLabel:j=`More information`,checkIcon:M=`check`,checkSize:N=18,hideCheck:P=!1,disabled:F=!1,readOnly:I=!1,loading:L=!1,size:R=`md`,layout:z=`inline`,selectedStyle:B,className:V=``,...H}=g;o(`AppChoiceCard`,H),a(`AppChoiceCard`,`size`,R,Object.keys(u)),a(`AppChoiceCard`,`layout`,z,Object.keys(d)),a(`AppChoiceCard`,`selectedStyle`,B,Object.keys(f));let U=u[R]??``,W=d[z]??``,G=f[B]??``,K=w??p[R]??p.md;return/* @__PURE__ */ l(`label`,{className:`struct-card${T?` struct-card-img-card`:``}${U}${W}${G}${P?` wui-struct-card-no-check`:``}${V?` ${V}`:``}${L?` ${e}`:``}`,"aria-disabled":F||void 0,"aria-busy":L||void 0,...h,...H,children:[/* @__PURE__ */ c(`input`,{type:v?`checkbox`:`radio`,name:_,value:y,className:`struct-card-input`,checked:b,onChange:x,onClick:t(I||L),"aria-readonly":I||void 0,disabled:F||L}),T?/* @__PURE__ */ c(`span`,{className:`struct-card-media`,children:/* @__PURE__ */ c(`img`,{className:`struct-card-img`,src:T,alt:E})}):C||S?/* @__PURE__ */ c(`span`,{className:`struct-card-ic`,children:C||/* @__PURE__ */ l(s,{children:[/* @__PURE__ */ c(`span`,{className:`wui-struct-card-glyph`,children:/* @__PURE__ */ c(r,{name:S,size:K})}),/* @__PURE__ */ c(`span`,{className:`wui-struct-card-glyph-on`,children:/* @__PURE__ */ c(r,{name:S,size:K,variant:`bold`})})]})}):null,/* @__PURE__ */ l(`span`,{className:`struct-card-body`,children:[D||/* @__PURE__ */ l(s,{children:[O&&/* @__PURE__ */ c(`span`,{className:`struct-card-title`,children:O}),k&&/* @__PURE__ */ c(`span`,{className:`struct-card-desc`,children:k})]}),A&&/* @__PURE__ */ c(i,{label:j,children:A})]}),!P&&/* @__PURE__ */ c(`span`,{className:`struct-card-check`,children:/* @__PURE__ */ c(r,{name:M,size:N})})]})}export{m as default};
@@ -1 +1 @@
1
- import{FIELD_BUSY_CLASS as e,blockWhenReadOnly as t}from"../lib/fieldState.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./AppInfoTip.js";import i from"./warnInvalidValue.js";import a from"./warnUnknownProps.js";import{Fragment as o,jsx as s,jsxs as c}from"react/jsx-runtime";var l=[`sm`,`md`,`lg`],u=[`soft`,`solid`];function d(d){let{marker:f,props:p}=n(`AppChoiceChip`,d),{multiple:m=!0,label:h,name:g,value:_,checked:v,onChange:y,children:b,count:x,help:S,helpLabel:C=`More information`,size:w=`md`,variant:T=`soft`,disabled:E=!1,readOnly:D=!1,loading:O=!1,className:k=``,...A}=p;return a(`AppChoiceChip`,A),i(`AppChoiceChip`,`size`,w,l),i(`AppChoiceChip`,`variant`,T,u),/* @__PURE__ */ c(o,{children:[/* @__PURE__ */ c(`label`,{className:`choice-chip${v?` checked`:``}${w===`sm`?` choice-chip-sm`:w===`lg`?` choice-chip-lg`:``}${T===`solid`?` wui-choice-chip-solid`:``}${k?` ${k}`:``}${O?` ${e}`:``}`,"aria-busy":O||void 0,...f,...A,children:[/* @__PURE__ */ s(`input`,{type:m?`checkbox`:`radio`,name:g,value:_,checked:v,disabled:E||O,"aria-readonly":D||void 0,onClick:t(D||O),onChange:y}),/* @__PURE__ */ s(`span`,{children:h??b}),x!=null&&/* @__PURE__ */ s(`span`,{className:`count`,children:x})]}),S&&/* @__PURE__ */ s(r,{label:C,children:S})]})}export{d as default};
1
+ import{FIELD_BUSY_CLASS as e,blockWhenReadOnly as t}from"../lib/fieldState.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./AppInfoTip.js";import i from"./assertValidValue.js";import a from"./warnUnknownProps.js";import{Fragment as o,jsx as s,jsxs as c}from"react/jsx-runtime";var l=[`sm`,`md`,`lg`],u=[`soft`,`solid`];function d(d){let{marker:f,props:p}=n(`AppChoiceChip`,d),{multiple:m=!0,label:h,name:g,value:_,checked:v,onChange:y,children:b,count:x,help:S,helpLabel:C=`More information`,size:w=`md`,variant:T=`soft`,disabled:E=!1,readOnly:D=!1,loading:O=!1,className:k=``,...A}=p;return a(`AppChoiceChip`,A),i(`AppChoiceChip`,`size`,w,l),i(`AppChoiceChip`,`variant`,T,u),/* @__PURE__ */ c(o,{children:[/* @__PURE__ */ c(`label`,{className:`choice-chip${v?` checked`:``}${w===`sm`?` choice-chip-sm`:w===`lg`?` choice-chip-lg`:``}${T===`solid`?` wui-choice-chip-solid`:``}${k?` ${k}`:``}${O?` ${e}`:``}`,"aria-busy":O||void 0,...f,...A,children:[/* @__PURE__ */ s(`input`,{type:m?`checkbox`:`radio`,name:g,value:_,checked:v,disabled:E||O,"aria-readonly":D||void 0,onClick:t(D||O),onChange:y}),/* @__PURE__ */ s(`span`,{children:h??b}),x!=null&&/* @__PURE__ */ s(`span`,{className:`count`,children:x})]}),S&&/* @__PURE__ */ s(r,{label:C,children:S})]})}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{jsx as r}from"react/jsx-runtime";import"@webority/ui-elements/elements/code-block";var i=[`text`,`json`,`js`,`cs`,`sql`,`bash`,`http`,`html`,`css`];function a(a){let{marker:o,props:s}=e(`AppCodeBlock`,a),{code:c,language:l=`text`,lineNumbers:u=!1,wrap:d=!1,label:f,copyLabel:p,copiedLabel:m,className:h=``,...g}=s;return n(`AppCodeBlock`,g),t(`AppCodeBlock`,`language`,l,i),/* @__PURE__ */ r(`wui-code-block`,{class:[`wui-code-block`,h].filter(Boolean).join(` `),language:l===`text`?void 0:l,"line-numbers":u?``:void 0,wrap:d?``:void 0,label:f||void 0,"copy-label":p||void 0,"copied-label":m||void 0,...o,...g,children:/* @__PURE__ */ r(`pre`,{className:`wui-code-source`,children:/* @__PURE__ */ r(`code`,{children:c??``})})})}export{a as default};
1
+ import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./assertValidValue.js";import n from"./warnUnknownProps.js";import{jsx as r}from"react/jsx-runtime";import"@webority/ui-elements/elements/code-block";var i=[`text`,`json`,`js`,`cs`,`sql`,`bash`,`http`,`html`,`css`];function a(a){let{marker:o,props:s}=e(`AppCodeBlock`,a),{code:c,language:l=`text`,lineNumbers:u=!1,wrap:d=!1,label:f,copyLabel:p,copiedLabel:m,className:h=``,...g}=s;return n(`AppCodeBlock`,g),t(`AppCodeBlock`,`language`,l,i),/* @__PURE__ */ r(`wui-code-block`,{class:[`wui-code-block`,h].filter(Boolean).join(` `),language:l===`text`?void 0:l,"line-numbers":u?``:void 0,wrap:d?``:void 0,label:f||void 0,"copy-label":p||void 0,"copied-label":m||void 0,...o,...g,children:/* @__PURE__ */ r(`pre`,{className:`wui-code-source`,children:/* @__PURE__ */ r(`code`,{children:c??``})})})}export{a as default};
@@ -1 +1 @@
1
- import e from"../lib/FieldMessage.js";import{FIELD_BUSY_CLASS as t}from"../lib/fieldState.js";import n from"../lib/fillLabel.js";import{splitMarkerProps as r}from"../lib/wuiMarker.js";import i from"./AppInfoTip.js";import a from"./AppRequiredMark.js";import o from"./warnInvalidValue.js";import s from"./warnUnknownProps.js";import{useId as c,useState as l}from"react";import{jsx as u,jsxs as d}from"react/jsx-runtime";var f=[`sm`,`md`,`lg`];function p(p){let{marker:m,props:h}=r(`AppColorField`,p),{value:g,defaultValue:_,onChange:v,label:y,required:b=!1,optional:x=!1,error:S,helperText:C,help:w,helpLabel:T=`More information`,colourLabel:E=`Colour`,colourPickerLabel:D=`{label}, colour picker`,optionalLabel:O=`(optional)`,name:k,id:A,disabled:j=!1,readOnly:M=!1,loading:N=!1,size:P=`md`,className:F=``,fieldClassName:I=``,...L}=h;s(`AppColorField`,L),o(`AppColorField`,`size`,P,f);let[R,z]=l(_??`#000000`),B=g===void 0?R:g,V=e=>{z(e),v?.(e)},H=c(),U=A||H,W=S?`${U}-error`:C?`${U}-hint`:void 0,G=e=>/^#[0-9a-f]{6}$/i.test(e),K=P===`sm`?` color-field-sm`:P===`lg`?` color-field-lg`:``,q=P===`sm`?` input-sm`:P===`lg`?` input-lg`:``;return/* @__PURE__ */ d(`div`,{...m,className:`field${I?` ${I}`:``}`,children:[y&&/* @__PURE__ */ d(`label`,{className:`label`,htmlFor:U,children:[y,x&&!b&&/* @__PURE__ */ u(`span`,{className:`label-optional`,children:` ${O}`}),b&&/* @__PURE__ */ u(a,{}),w&&/* @__PURE__ */ u(i,{label:T,children:w})]}),/* @__PURE__ */ d(`div`,{className:`color-field${K}`,children:[/* @__PURE__ */ u(`input`,{type:`color`,className:`color-field-swatch`,value:G(B)?B:`#000000`,onChange:e=>V(e.target.value),disabled:j||M||N,"aria-label":n(D,{label:y||E}),tabIndex:-1}),/* @__PURE__ */ u(`input`,{type:`text`,className:`input color-field-hex${q}${S?` error`:``}${N?` ${t}`:``}${F?` ${F}`:``}`,id:U,name:k,value:B,onChange:e=>V(e.target.value),placeholder:`#4F46E5`,spellCheck:!1,maxLength:7,required:b,disabled:j,readOnly:M||N,"aria-busy":N||void 0,"aria-invalid":S?`true`:`false`,"aria-describedby":W,...L})]}),/* @__PURE__ */ u(e,{error:S,hint:C,errorId:`${U}-error`,hintId:`${U}-hint`})]})}export{p as default};
1
+ import e from"../lib/FieldMessage.js";import{FIELD_BUSY_CLASS as t}from"../lib/fieldState.js";import n from"../lib/fillLabel.js";import{splitMarkerProps as r}from"../lib/wuiMarker.js";import i from"./AppInfoTip.js";import a from"./AppRequiredMark.js";import o from"./assertValidValue.js";import s from"./warnUnknownProps.js";import{useId as c,useState as l}from"react";import{jsx as u,jsxs as d}from"react/jsx-runtime";var f=[`sm`,`md`,`lg`];function p(p){let{marker:m,props:h}=r(`AppColorField`,p),{value:g,defaultValue:_,onChange:v,label:y,required:b=!1,optional:x=!1,error:S,helperText:C,help:w,helpLabel:T=`More information`,colourLabel:E=`Colour`,colourPickerLabel:D=`{label}, colour picker`,optionalLabel:O=`(optional)`,name:k,id:A,disabled:j=!1,readOnly:M=!1,loading:N=!1,size:P=`md`,className:F=``,fieldClassName:I=``,...L}=h;s(`AppColorField`,L),o(`AppColorField`,`size`,P,f);let[R,z]=l(_??`#000000`),B=g===void 0?R:g,V=e=>{z(e),v?.(e)},H=c(),U=A||H,W=S?`${U}-error`:C?`${U}-hint`:void 0,G=e=>/^#[0-9a-f]{6}$/i.test(e),K=P===`sm`?` color-field-sm`:P===`lg`?` color-field-lg`:``,q=P===`sm`?` input-sm`:P===`lg`?` input-lg`:``;return/* @__PURE__ */ d(`div`,{...m,className:`field${I?` ${I}`:``}`,children:[y&&/* @__PURE__ */ d(`label`,{className:`label`,htmlFor:U,children:[y,x&&!b&&/* @__PURE__ */ u(`span`,{className:`label-optional`,children:` ${O}`}),b&&/* @__PURE__ */ u(a,{}),w&&/* @__PURE__ */ u(i,{label:T,children:w})]}),/* @__PURE__ */ d(`div`,{className:`color-field${K}`,children:[/* @__PURE__ */ u(`input`,{type:`color`,className:`color-field-swatch`,value:G(B)?B:`#000000`,onChange:e=>V(e.target.value),disabled:j||M||N,"aria-label":n(D,{label:y||E}),tabIndex:-1}),/* @__PURE__ */ u(`input`,{type:`text`,className:`input color-field-hex${q}${S?` error`:``}${N?` ${t}`:``}${F?` ${F}`:``}`,id:U,name:k,value:B,onChange:e=>V(e.target.value),placeholder:`#4F46E5`,spellCheck:!1,maxLength:7,required:b,disabled:j,readOnly:M||N,"aria-busy":N||void 0,"aria-invalid":S?`true`:`false`,"aria-describedby":W,...L})]}),/* @__PURE__ */ u(e,{error:S,hint:C,errorId:`${U}-error`,hintId:`${U}-hint`})]})}export{p as default};
@@ -1 +1 @@
1
- import e from"../lib/fillLabel.js";import{initialsOf as t}from"../lib/initials.js";import{linkTarget as n}from"../lib/linkTarget.js";import{splitMarkerProps as r}from"../lib/wuiMarker.js";import i from"./AppAvatar.js";import a from"./AppBadge.js";import o from"./AppButton.js";import s from"./AppIcon.js";import c from"./warnInvalidValue.js";import l from"./warnUnknownProps.js";import{parseMentionValue as u}from"@webority/ui-elements/elements/mention-input";import{formatDate as d,formatFileSize as f,formatNumber as p,toInstant as m}from"@webority/ui-elements/helpers";import{Fragment as h,useEffect as g,useId as _,useRef as v}from"react";import{jsx as y,jsxs as b}from"react/jsx-runtime";import{COMMENT_REACTIONS as x,COMMENT_TEXT as S}from"@webority/ui-elements/elements/comment-thread";var C=[`stacked`,`inline`],w=[`list`,`conversation`];function T(e){let{marker:t,props:n}=r(`AppCommentThread`,e),{comments:a=[],onPost:s,onReply:u,onEdit:d,onDelete:f,onReact:p,people:m,loadPeople:h,reactionChoices:T,allowReplies:D=!0,allowReactions:O=!0,composerPlaceholder:k,variant:A=`list`,composer:j=`stacked`,author:M,postLabel:N=S.post,composerRows:P,readOnly:F=!1,linkComponent:I,label:L=S.listName,internalLabel:R=`Internal note`,attachmentsLabel:z=`Attachments`,composerLabel:B=`Add a comment`,noCommentsText:V=`No comments yet.`,reactionsLabel:H=`Reactions`,repliesToLabel:U=`Replies to {name}`,editedLabel:W=`Edited`,deletedText:G=`This comment was deleted.`,replyLabel:K=`Reply`,editLabel:q=`Edit`,deleteLabel:ee=`Delete`,deleteConfirmText:te=`Delete this comment?`,cancelLabel:ne=`Cancel`,addReactionLabel:re=`Add a reaction`,chooseReactionLabel:ie=`Choose a reaction`,peopleLabel:ae=`People`,id:oe,className:se=``,...J}=n;l(`AppCommentThread`,J),c(`AppCommentThread`,`variant`,A,w),c(`AppCommentThread`,`composer`,j,C);let ce=_(),Y=oe||`comment-thread-${ce.replace(/[^a-zA-Z0-9_-]/g,``)}`,X=v(null),Z=typeof h==`function`,le=T?.length?T:x,Q=j===`inline`,ue=P??(Q?1:3),de={reactionsLabel:H,repliesToLabel:U,editedLabel:W,deletedText:G,replyLabel:K,editLabel:q,deleteLabel:ee,deleteConfirmText:te,cancelLabel:ne,addReactionLabel:re},$=v(null);return $.current={onPost:s,onReply:u,onEdit:d,onDelete:f,onReact:p,loadPeople:h},g(()=>{let e=X.current;if(e)return e.submit=async({intent:e,commentId:t,parentId:n,body:r,emoji:i})=>{let a=$.current;e===`post`?await a.onPost?.(r):e===`reply`?await a.onReply?.(n,r):e===`edit`?await a.onEdit?.(t,r):e===`delete`?await a.onDelete?.(t):e===`react`&&await a.onReact?.(t,i)},()=>{e.submit=void 0}},[]),g(()=>{let e=X.current;e&&!Z&&(e.people=m||[])},[m,Z]),g(()=>{let e=X.current;if(!e||!Z)return;let t=/* @__PURE__ */ new WeakMap,n=async e=>{let n=e.target,r=(t.get(n)??0)+1;t.set(n,r),n.loading=!0;try{let i=await $.current.loadPeople(e.detail.query);t.get(n)===r&&(n.people=i||[])}catch{t.get(n)===r&&(n.people=[])}finally{t.get(n)===r&&(n.loading=!1)}};return e.addEventListener(`search`,n),()=>e.removeEventListener(`search`,n)},[Z]),/* @__PURE__ */ b(`wui-comment-thread`,{ref:X,id:Y,class:[`wui-comment-thread`,A===`conversation`&&`wui-comment-thread--conversation`,se].filter(Boolean).join(` `),controlled:``,"read-only":F?``:void 0,remote:Z?``:void 0,"reaction-choices":T?.length?T.join(` `):void 0,"no-replies":D?void 0:``,"no-reactions":O?void 0:``,"composer-placeholder":k,...t,...J,children:[/* @__PURE__ */ y(`div`,{className:`wui-comment-items`,"data-wui-items":``,children:a.length?/* @__PURE__ */ y(`ol`,{className:`wui-comment-list`,"aria-label":L,children:a.map(e=>/* @__PURE__ */ y(E,{comment:e,topLevel:!0,readOnly:F,allowReplies:D,allowReactions:O,linkComponent:I,internalLabel:R,attachmentsLabel:z,text:de},e.id))}):/* @__PURE__ */ y(`p`,{className:`wui-comment-empty`,children:V})}),!F&&O&&/* @__PURE__ */ y(`div`,{className:`wui-reaction-picker`,role:`group`,"aria-label":ie,"data-wui-picker":``,hidden:!0,children:le.map(e=>/* @__PURE__ */ y(`button`,{type:`button`,className:`wui-reaction-choice`,"data-wui-emoji":e,children:e},e))}),!F&&/* @__PURE__ */ b(`div`,{className:Q?`wui-comment-composer wui-comment-composer-inline`:`wui-comment-composer`,"data-wui-composer":``,children:[Q&&M?/* @__PURE__ */ y(i,{name:M,size:`sm`,tone:`auto`,className:`wui-comment-composer-avatar`}):null,/* @__PURE__ */ y(`wui-mention-input`,{id:`${Y}-new`,class:`wui-mention-input`,label:B,"people-label":ae,placeholder:k??S.composerPlaceholder,rows:String(ue),remote:Z?``:void 0}),/* @__PURE__ */ y(`div`,{className:`wui-comment-form-actions`,children:/* @__PURE__ */ y(o,{variant:Q?`outline`:`solid`,size:`sm`,"data-wui-action":`post`,children:N})}),/* @__PURE__ */ y(`div`,{className:`wui-comment-error`,"data-wui-error":``,hidden:!0})]}),/* @__PURE__ */ y(`span`,{className:`visually-hidden`,"data-wui-live":``,"aria-live":`polite`,"aria-atomic":`true`})]})}function E({comment:r,topLevel:i=!1,readOnly:c,allowReplies:l,allowReactions:g,linkComponent:_,internalLabel:v,attachmentsLabel:x,text:S}){let{id:C,author:w,at:T,value:D,edited:O,mine:k,internal:A,attachments:j=[],deleted:M,canEdit:N,canDelete:P,reactions:F=[],replies:I=[]}=r,L=w?.name||``,R=m(T),z=!c&&!M&&N,B=!c&&!M&&P,V=i&&l,H=[`wui-comment`,A&&`wui-comment--internal`,k&&`wui-comment--mine`].filter(Boolean).join(` `);return/* @__PURE__ */ b(`li`,{className:H,"data-wui-comment":C,"data-value":D??``,"data-wui-deleted":M?``:void 0,children:[/* @__PURE__ */ b(`div`,{className:`wui-comment-row`,children:[/* @__PURE__ */ b(`span`,{className:`avatar avatar-sm wui-comment-avatar`,"aria-hidden":`true`,children:[/* @__PURE__ */ y(`span`,{className:`avatar-face`,children:t(L)||`?`}),w?.src&&/* @__PURE__ */ y(`img`,{className:`avatar-img`,src:w.src,alt:``,onError:e=>{e.currentTarget.hidden=!0}})]}),/* @__PURE__ */ b(`div`,{className:`wui-comment-main`,children:[/* @__PURE__ */ b(`div`,{className:`wui-comment-head`,children:[/* @__PURE__ */ y(`span`,{className:`wui-comment-author`,children:L}),/* @__PURE__ */ y(`time`,{className:`wui-comment-time`,dateTime:Number.isFinite(R)?new Date(R).toISOString():void 0,children:d(T,{pattern:`datetime`})}),O&&!M&&/* @__PURE__ */ y(`span`,{className:`wui-comment-edited`,children:S.editedLabel}),A&&/* @__PURE__ */ y(a,{className:`wui-comment-internal-badge`,children:v})]}),M?/* @__PURE__ */ y(`div`,{className:`wui-comment-text wui-comment-text-deleted`,children:S.deletedText}):/* @__PURE__ */ y(`div`,{className:`wui-comment-text`,"data-wui-text":``,children:u(D).map((e,t)=>`text`in e?/* @__PURE__ */ y(h,{children:e.text},t):/* @__PURE__ */ b(`span`,{className:`wui-mention`,"data-mention-id":e.id,children:[`@`,e.label]},t))}),!M&&j.length>0&&/* @__PURE__ */ y(`ul`,{className:`wui-comment-attachments`,"aria-label":x,children:j.map(e=>{let{Tag:t,linkProps:r}=n(_,{to:e.to,href:e.href,routeHref:!1});return/* @__PURE__ */ b(`li`,{children:[/* @__PURE__ */ b(t,{className:`wui-comment-attachment`,...r,...e.to?{}:{download:!0},children:[/* @__PURE__ */ y(s,{name:`paperclip`,size:14}),e.name]}),typeof e.sizeBytes==`number`&&/* @__PURE__ */ y(`span`,{className:`wui-comment-attachment-size`,children:f(e.sizeBytes)})]},e.to??e.href)})}),z&&/* @__PURE__ */ y(`div`,{className:`wui-comment-editor`,"data-wui-editor":``,hidden:!0}),g&&!M&&(F.length>0||!c)&&/* @__PURE__ */ b(`div`,{className:`wui-comment-reactions`,role:`group`,"aria-label":S.reactionsLabel,children:[F.map(e=>c?/* @__PURE__ */ b(`span`,{className:e.mine?`wui-reaction wui-reaction-mine`:`wui-reaction`,children:[/* @__PURE__ */ y(`span`,{className:`wui-reaction-emoji`,children:e.emoji}),/* @__PURE__ */ y(`span`,{className:`wui-reaction-count`,children:p(e.count,{decimals:0})})]},e.emoji):/* @__PURE__ */ b(`button`,{type:`button`,className:e.mine?`wui-reaction wui-reaction-mine`:`wui-reaction`,"data-wui-emoji":e.emoji,"aria-pressed":e.mine?`true`:`false`,children:[/* @__PURE__ */ y(`span`,{className:`wui-reaction-emoji`,children:e.emoji}),/* @__PURE__ */ y(`span`,{className:`wui-reaction-count`,children:p(e.count,{decimals:0})})]},e.emoji)),!c&&/* @__PURE__ */ y(`button`,{type:`button`,className:`wui-reaction-add`,"data-wui-action":`react-menu`,"aria-label":S.addReactionLabel,"aria-haspopup":`true`,"aria-expanded":`false`,children:/* @__PURE__ */ y(s,{name:`emoji-smile`,size:16})})]}),!c&&!M&&(V||z||B)&&/* @__PURE__ */ b(`div`,{className:`wui-comment-actions`,"data-wui-actions":``,children:[V&&/* @__PURE__ */ y(`button`,{type:`button`,className:`wui-comment-action`,"data-wui-action":`reply`,children:S.replyLabel}),z&&/* @__PURE__ */ y(`button`,{type:`button`,className:`wui-comment-action`,"data-wui-action":`edit`,children:S.editLabel}),B&&/* @__PURE__ */ y(`button`,{type:`button`,className:`wui-comment-action`,"data-wui-action":`delete`,children:S.deleteLabel})]}),B&&/* @__PURE__ */ b(`div`,{className:`wui-comment-confirm`,"data-wui-confirm":``,hidden:!0,children:[/* @__PURE__ */ y(`span`,{className:`wui-comment-confirm-text`,children:S.deleteConfirmText}),/* @__PURE__ */ y(o,{tone:`danger`,size:`sm`,"data-wui-action":`confirm-delete`,children:S.deleteLabel}),/* @__PURE__ */ y(o,{variant:`ghost`,size:`sm`,"data-wui-action":`cancel-delete`,children:S.cancelLabel})]}),!c&&/* @__PURE__ */ y(`div`,{className:`wui-comment-error`,"data-wui-error":``,hidden:!0})]})]}),i&&I.length>0&&/* @__PURE__ */ y(`ol`,{className:`wui-comment-list wui-comment-replies`,"aria-label":e(S.repliesToLabel,{name:L}),children:I.map(e=>/* @__PURE__ */ y(E,{comment:e,readOnly:c,allowReactions:g,linkComponent:_,internalLabel:v,attachmentsLabel:x,text:S},e.id))}),V&&!c&&!M&&/* @__PURE__ */ y(`div`,{className:`wui-comment-reply`,"data-wui-reply":``,hidden:!0})]})}export{T as default};
1
+ import e from"../lib/fillLabel.js";import{initialsOf as t}from"../lib/initials.js";import{linkTarget as n}from"../lib/linkTarget.js";import{splitMarkerProps as r}from"../lib/wuiMarker.js";import i from"./AppAvatar.js";import a from"./AppBadge.js";import o from"./AppButton.js";import s from"./AppIcon.js";import c from"./assertValidValue.js";import l from"./warnUnknownProps.js";import{parseMentionValue as u}from"@webority/ui-elements/elements/mention-input";import{formatDate as d,formatFileSize as f,formatNumber as p,toInstant as m}from"@webority/ui-elements/helpers";import{Fragment as h,useEffect as g,useId as _,useRef as v}from"react";import{jsx as y,jsxs as b}from"react/jsx-runtime";import{COMMENT_REACTIONS as x,COMMENT_TEXT as S}from"@webority/ui-elements/elements/comment-thread";var C=[`stacked`,`inline`],w=[`list`,`conversation`];function T(e){let{marker:t,props:n}=r(`AppCommentThread`,e),{comments:a=[],onPost:s,onReply:u,onEdit:d,onDelete:f,onReact:p,people:m,loadPeople:h,reactionChoices:T,allowReplies:D=!0,allowReactions:O=!0,composerPlaceholder:k,variant:A=`list`,composer:j=`stacked`,author:M,postLabel:N=S.post,composerRows:P,readOnly:F=!1,linkComponent:I,label:L=S.listName,internalLabel:R=`Internal note`,attachmentsLabel:z=`Attachments`,composerLabel:B=`Add a comment`,noCommentsText:V=`No comments yet.`,reactionsLabel:H=`Reactions`,repliesToLabel:U=`Replies to {name}`,editedLabel:W=`Edited`,deletedText:G=`This comment was deleted.`,replyLabel:K=`Reply`,editLabel:q=`Edit`,deleteLabel:ee=`Delete`,deleteConfirmText:te=`Delete this comment?`,cancelLabel:ne=`Cancel`,addReactionLabel:re=`Add a reaction`,chooseReactionLabel:ie=`Choose a reaction`,peopleLabel:ae=`People`,id:oe,className:se=``,...J}=n;l(`AppCommentThread`,J),c(`AppCommentThread`,`variant`,A,w),c(`AppCommentThread`,`composer`,j,C);let ce=_(),Y=oe||`comment-thread-${ce.replace(/[^a-zA-Z0-9_-]/g,``)}`,X=v(null),Z=typeof h==`function`,le=T?.length?T:x,Q=j===`inline`,ue=P??(Q?1:3),de={reactionsLabel:H,repliesToLabel:U,editedLabel:W,deletedText:G,replyLabel:K,editLabel:q,deleteLabel:ee,deleteConfirmText:te,cancelLabel:ne,addReactionLabel:re},$=v(null);return $.current={onPost:s,onReply:u,onEdit:d,onDelete:f,onReact:p,loadPeople:h},g(()=>{let e=X.current;if(e)return e.submit=async({intent:e,commentId:t,parentId:n,body:r,emoji:i})=>{let a=$.current;e===`post`?await a.onPost?.(r):e===`reply`?await a.onReply?.(n,r):e===`edit`?await a.onEdit?.(t,r):e===`delete`?await a.onDelete?.(t):e===`react`&&await a.onReact?.(t,i)},()=>{e.submit=void 0}},[]),g(()=>{let e=X.current;e&&!Z&&(e.people=m||[])},[m,Z]),g(()=>{let e=X.current;if(!e||!Z)return;let t=/* @__PURE__ */ new WeakMap,n=async e=>{let n=e.target,r=(t.get(n)??0)+1;t.set(n,r),n.loading=!0;try{let i=await $.current.loadPeople(e.detail.query);t.get(n)===r&&(n.people=i||[])}catch{t.get(n)===r&&(n.people=[])}finally{t.get(n)===r&&(n.loading=!1)}};return e.addEventListener(`search`,n),()=>e.removeEventListener(`search`,n)},[Z]),/* @__PURE__ */ b(`wui-comment-thread`,{ref:X,id:Y,class:[`wui-comment-thread`,A===`conversation`&&`wui-comment-thread--conversation`,se].filter(Boolean).join(` `),controlled:``,"read-only":F?``:void 0,remote:Z?``:void 0,"reaction-choices":T?.length?T.join(` `):void 0,"no-replies":D?void 0:``,"no-reactions":O?void 0:``,"composer-placeholder":k,...t,...J,children:[/* @__PURE__ */ y(`div`,{className:`wui-comment-items`,"data-wui-items":``,children:a.length?/* @__PURE__ */ y(`ol`,{className:`wui-comment-list`,"aria-label":L,children:a.map(e=>/* @__PURE__ */ y(E,{comment:e,topLevel:!0,readOnly:F,allowReplies:D,allowReactions:O,linkComponent:I,internalLabel:R,attachmentsLabel:z,text:de},e.id))}):/* @__PURE__ */ y(`p`,{className:`wui-comment-empty`,children:V})}),!F&&O&&/* @__PURE__ */ y(`div`,{className:`wui-reaction-picker`,role:`group`,"aria-label":ie,"data-wui-picker":``,hidden:!0,children:le.map(e=>/* @__PURE__ */ y(`button`,{type:`button`,className:`wui-reaction-choice`,"data-wui-emoji":e,children:e},e))}),!F&&/* @__PURE__ */ b(`div`,{className:Q?`wui-comment-composer wui-comment-composer-inline`:`wui-comment-composer`,"data-wui-composer":``,children:[Q&&M?/* @__PURE__ */ y(i,{name:M,size:`sm`,tone:`auto`,className:`wui-comment-composer-avatar`}):null,/* @__PURE__ */ y(`wui-mention-input`,{id:`${Y}-new`,class:`wui-mention-input`,label:B,"people-label":ae,placeholder:k??S.composerPlaceholder,rows:String(ue),remote:Z?``:void 0}),/* @__PURE__ */ y(`div`,{className:`wui-comment-form-actions`,children:/* @__PURE__ */ y(o,{variant:Q?`outline`:`solid`,size:`sm`,"data-wui-action":`post`,children:N})}),/* @__PURE__ */ y(`div`,{className:`wui-comment-error`,"data-wui-error":``,hidden:!0})]}),/* @__PURE__ */ y(`span`,{className:`visually-hidden`,"data-wui-live":``,"aria-live":`polite`,"aria-atomic":`true`})]})}function E({comment:r,topLevel:i=!1,readOnly:c,allowReplies:l,allowReactions:g,linkComponent:_,internalLabel:v,attachmentsLabel:x,text:S}){let{id:C,author:w,at:T,value:D,edited:O,mine:k,internal:A,attachments:j=[],deleted:M,canEdit:N,canDelete:P,reactions:F=[],replies:I=[]}=r,L=w?.name||``,R=m(T),z=!c&&!M&&N,B=!c&&!M&&P,V=i&&l,H=[`wui-comment`,A&&`wui-comment--internal`,k&&`wui-comment--mine`].filter(Boolean).join(` `);return/* @__PURE__ */ b(`li`,{className:H,"data-wui-comment":C,"data-value":D??``,"data-wui-deleted":M?``:void 0,children:[/* @__PURE__ */ b(`div`,{className:`wui-comment-row`,children:[/* @__PURE__ */ b(`span`,{className:`avatar avatar-sm wui-comment-avatar`,"aria-hidden":`true`,children:[/* @__PURE__ */ y(`span`,{className:`avatar-face`,children:t(L)||`?`}),w?.src&&/* @__PURE__ */ y(`img`,{className:`avatar-img`,src:w.src,alt:``,onError:e=>{e.currentTarget.hidden=!0}})]}),/* @__PURE__ */ b(`div`,{className:`wui-comment-main`,children:[/* @__PURE__ */ b(`div`,{className:`wui-comment-head`,children:[/* @__PURE__ */ y(`span`,{className:`wui-comment-author`,children:L}),/* @__PURE__ */ y(`time`,{className:`wui-comment-time`,dateTime:Number.isFinite(R)?new Date(R).toISOString():void 0,children:d(T,{pattern:`datetime`})}),O&&!M&&/* @__PURE__ */ y(`span`,{className:`wui-comment-edited`,children:S.editedLabel}),A&&/* @__PURE__ */ y(a,{className:`wui-comment-internal-badge`,children:v})]}),M?/* @__PURE__ */ y(`div`,{className:`wui-comment-text wui-comment-text-deleted`,children:S.deletedText}):/* @__PURE__ */ y(`div`,{className:`wui-comment-text`,"data-wui-text":``,children:u(D).map((e,t)=>`text`in e?/* @__PURE__ */ y(h,{children:e.text},t):/* @__PURE__ */ b(`span`,{className:`wui-mention`,"data-mention-id":e.id,children:[`@`,e.label]},t))}),!M&&j.length>0&&/* @__PURE__ */ y(`ul`,{className:`wui-comment-attachments`,"aria-label":x,children:j.map(e=>{let{Tag:t,linkProps:r}=n(_,{to:e.to,href:e.href,routeHref:!1});return/* @__PURE__ */ b(`li`,{children:[/* @__PURE__ */ b(t,{className:`wui-comment-attachment`,...r,...e.to?{}:{download:!0},children:[/* @__PURE__ */ y(s,{name:`paperclip`,size:14}),e.name]}),typeof e.sizeBytes==`number`&&/* @__PURE__ */ y(`span`,{className:`wui-comment-attachment-size`,children:f(e.sizeBytes)})]},e.to??e.href)})}),z&&/* @__PURE__ */ y(`div`,{className:`wui-comment-editor`,"data-wui-editor":``,hidden:!0}),g&&!M&&(F.length>0||!c)&&/* @__PURE__ */ b(`div`,{className:`wui-comment-reactions`,role:`group`,"aria-label":S.reactionsLabel,children:[F.map(e=>c?/* @__PURE__ */ b(`span`,{className:e.mine?`wui-reaction wui-reaction-mine`:`wui-reaction`,children:[/* @__PURE__ */ y(`span`,{className:`wui-reaction-emoji`,children:e.emoji}),/* @__PURE__ */ y(`span`,{className:`wui-reaction-count`,children:p(e.count,{decimals:0})})]},e.emoji):/* @__PURE__ */ b(`button`,{type:`button`,className:e.mine?`wui-reaction wui-reaction-mine`:`wui-reaction`,"data-wui-emoji":e.emoji,"aria-pressed":e.mine?`true`:`false`,children:[/* @__PURE__ */ y(`span`,{className:`wui-reaction-emoji`,children:e.emoji}),/* @__PURE__ */ y(`span`,{className:`wui-reaction-count`,children:p(e.count,{decimals:0})})]},e.emoji)),!c&&/* @__PURE__ */ y(`button`,{type:`button`,className:`wui-reaction-add`,"data-wui-action":`react-menu`,"aria-label":S.addReactionLabel,"aria-haspopup":`true`,"aria-expanded":`false`,children:/* @__PURE__ */ y(s,{name:`emoji-smile`,size:16})})]}),!c&&!M&&(V||z||B)&&/* @__PURE__ */ b(`div`,{className:`wui-comment-actions`,"data-wui-actions":``,children:[V&&/* @__PURE__ */ y(`button`,{type:`button`,className:`wui-comment-action`,"data-wui-action":`reply`,children:S.replyLabel}),z&&/* @__PURE__ */ y(`button`,{type:`button`,className:`wui-comment-action`,"data-wui-action":`edit`,children:S.editLabel}),B&&/* @__PURE__ */ y(`button`,{type:`button`,className:`wui-comment-action`,"data-wui-action":`delete`,children:S.deleteLabel})]}),B&&/* @__PURE__ */ b(`div`,{className:`wui-comment-confirm`,"data-wui-confirm":``,hidden:!0,children:[/* @__PURE__ */ y(`span`,{className:`wui-comment-confirm-text`,children:S.deleteConfirmText}),/* @__PURE__ */ y(o,{tone:`danger`,size:`sm`,"data-wui-action":`confirm-delete`,children:S.deleteLabel}),/* @__PURE__ */ y(o,{variant:`ghost`,size:`sm`,"data-wui-action":`cancel-delete`,children:S.cancelLabel})]}),!c&&/* @__PURE__ */ y(`div`,{className:`wui-comment-error`,"data-wui-error":``,hidden:!0})]})]}),i&&I.length>0&&/* @__PURE__ */ y(`ol`,{className:`wui-comment-list wui-comment-replies`,"aria-label":e(S.repliesToLabel,{name:L}),children:I.map(e=>/* @__PURE__ */ y(E,{comment:e,readOnly:c,allowReactions:g,linkComponent:_,internalLabel:v,attachmentsLabel:x,text:S},e.id))}),V&&!c&&!M&&/* @__PURE__ */ y(`div`,{className:`wui-comment-reply`,"data-wui-reply":``,hidden:!0})]})}export{T as default};
@@ -1 +1 @@
1
- import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./AppIcon.js";import n from"./warnInvalidValue.js";import r from"./warnUnknownProps.js";import{isValidElement as i,useEffect as a,useRef as o,useState as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";var u=[`stack`,`scroll`],d=[`comfortable`,`relaxed`],f=[`start`,`center`],p={yes:{icon:`tick-circle`},no:{icon:`close-circle`},warn:{icon:`danger`},partial:{icon:`minus-circle`}};function m(e){return typeof e==`object`&&!!e&&!i(e)}function h(e){return e.scrollLeft+e.clientWidth<e.scrollWidth-1}function g(...e){return e.filter(Boolean).join(` `)||void 0}function _(e){return g(e.highlight&&`is-highlight`,e.align===`center`&&`wui-compare-center`,e.nowrap&&`wui-compare-nowrap`)}function v(e,r){if(e===!0)return/* @__PURE__ */ l(`span`,{className:`compare-yes`,children:[/* @__PURE__ */ c(t,{name:`check`,size:16}),/* @__PURE__ */ c(`span`,{className:`visually-hidden`,children:r.yesLabel})]});if(e===!1)return/* @__PURE__ */ l(`span`,{className:`compare-no`,children:[/* @__PURE__ */ c(`span`,{"aria-hidden":`true`,children:`-`}),/* @__PURE__ */ c(`span`,{className:`visually-hidden`,children:r.noLabel})]});if(m(e)&&`state`in e){let i=p[e.state],a={yes:r.yesLabel,no:r.noLabel,warn:r.warningLabel,partial:r.partialLabel};return n(`AppCompareTable`,`state`,e.state,Object.keys(p)),/* @__PURE__ */ l(`span`,{className:`wui-compare-state wui-compare-state-${e.state}`,children:[i&&/* @__PURE__ */ c(t,{name:i.icon,size:16,variant:`bulk`}),i&&/* @__PURE__ */ c(`span`,{className:`visually-hidden`,children:`${a[e.state]}: `}),e.text]})}return m(e)&&`code`in e?/* @__PURE__ */ c(`span`,{className:`wui-compare-code`,children:e.code}):e}function y(e,t,n){let r=[],i=null;return t.forEach((t,a)=>{t.group!=null&&t.group!==i&&r.push(/* @__PURE__ */ c(`tr`,{className:`wui-compare-group-row`,children:/* @__PURE__ */ c(`th`,{colSpan:e.length,scope:`rowgroup`,className:`wui-compare-group`,children:t.group})},`group:${t.group}:${t.key??t.label}`)),i=t.group??null,r.push(/* @__PURE__ */ l(`tr`,{children:[/* @__PURE__ */ c(`th`,{scope:`row`,children:t.label}),t.values.map((t,r)=>{let i=e[r+1];return/* @__PURE__ */ c(`td`,{className:_(i??{}),"data-label":i?.label,children:v(t,n)},i?.label??r)})]},t.key??`${t.label}-${a}`))}),r}function b(t){let{marker:i,props:p}=e(`AppCompareTable`,t),{columns:m,rows:v,caption:b,mobile:x=`stack`,stickyFirstColumn:S=!1,stickyHeader:C=!1,density:w=`comfortable`,yesLabel:T=`Yes`,noLabel:E=`No`,warningLabel:D=`Warning`,partialLabel:O=`Partial`,className:k=``,...A}=p,j={yesLabel:T,noLabel:E,warningLabel:D,partialLabel:O},M=o(null),[N,P]=s(!1);if(a(()=>{let e=()=>{let e=M.current;e&&P(h(e))};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),!Array.isArray(m))throw Error(`<AppCompareTable> columns is required: pass the feature-name column, then one per option.`);if(!Array.isArray(v))throw Error(`<AppCompareTable> rows is required: pass one row per capability.`);r(`AppCompareTable`,A),n(`AppCompareTable`,`mobile`,x,u),n(`AppCompareTable`,`density`,w,d);for(let e of m)n(`AppCompareTable`,`align`,e.align,f);let F=x===`scroll`,I=/* @__PURE__ */ l(`table`,{className:g(F&&`wui-compare-scroll-table`,F&&S&&`wui-compare-sticky-first`),children:[b&&/* @__PURE__ */ c(`caption`,{className:`visually-hidden`,children:b}),/* @__PURE__ */ c(`thead`,{children:/* @__PURE__ */ c(`tr`,{children:m.map((e,t)=>/* @__PURE__ */ c(`th`,{scope:`col`,className:_(e),children:e.label},e.label?`col-${t}-${e.label}`:`col-${t}`))})}),/* @__PURE__ */ c(`tbody`,{children:y(m,v,j)})]});return/* @__PURE__ */ c(`div`,{className:g(`compare-table`,w===`relaxed`&&`wui-compare-relaxed`,C&&`wui-compare-sticky-head`,k),"data-mobile":x,...i,...A,children:F?/* @__PURE__ */ c(`div`,{className:`wui-compare-scroll`,ref:M,tabIndex:0,role:b?`region`:void 0,"aria-label":b||void 0,"data-more":N?`end`:void 0,onScroll:e=>P(h(e.currentTarget)),children:I}):I})}export{b as default};
1
+ import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./AppIcon.js";import n from"./assertValidValue.js";import r from"./warnUnknownProps.js";import{isValidElement as i,useEffect as a,useRef as o,useState as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";var u=[`stack`,`scroll`],d=[`comfortable`,`relaxed`],f=[`start`,`center`],p={yes:{icon:`tick-circle`},no:{icon:`close-circle`},warn:{icon:`danger`},partial:{icon:`minus-circle`}};function m(e){return typeof e==`object`&&!!e&&!i(e)}function h(e){return e.scrollLeft+e.clientWidth<e.scrollWidth-1}function g(...e){return e.filter(Boolean).join(` `)||void 0}function _(e){return g(e.highlight&&`is-highlight`,e.align===`center`&&`wui-compare-center`,e.nowrap&&`wui-compare-nowrap`)}function v(e,r){if(e===!0)return/* @__PURE__ */ l(`span`,{className:`compare-yes`,children:[/* @__PURE__ */ c(t,{name:`check`,size:16}),/* @__PURE__ */ c(`span`,{className:`visually-hidden`,children:r.yesLabel})]});if(e===!1)return/* @__PURE__ */ l(`span`,{className:`compare-no`,children:[/* @__PURE__ */ c(`span`,{"aria-hidden":`true`,children:`-`}),/* @__PURE__ */ c(`span`,{className:`visually-hidden`,children:r.noLabel})]});if(m(e)&&`state`in e){let i=p[e.state],a={yes:r.yesLabel,no:r.noLabel,warn:r.warningLabel,partial:r.partialLabel};return n(`AppCompareTable`,`state`,e.state,Object.keys(p)),/* @__PURE__ */ l(`span`,{className:`wui-compare-state wui-compare-state-${e.state}`,children:[i&&/* @__PURE__ */ c(t,{name:i.icon,size:16,variant:`bulk`}),i&&/* @__PURE__ */ c(`span`,{className:`visually-hidden`,children:`${a[e.state]}: `}),e.text]})}return m(e)&&`code`in e?/* @__PURE__ */ c(`span`,{className:`wui-compare-code`,children:e.code}):e}function y(e,t,n){let r=[],i=null;return t.forEach((t,a)=>{t.group!=null&&t.group!==i&&r.push(/* @__PURE__ */ c(`tr`,{className:`wui-compare-group-row`,children:/* @__PURE__ */ c(`th`,{colSpan:e.length,scope:`rowgroup`,className:`wui-compare-group`,children:t.group})},`group:${t.group}:${t.key??t.label}`)),i=t.group??null,r.push(/* @__PURE__ */ l(`tr`,{children:[/* @__PURE__ */ c(`th`,{scope:`row`,children:t.label}),t.values.map((t,r)=>{let i=e[r+1];return/* @__PURE__ */ c(`td`,{className:_(i??{}),"data-label":i?.label,children:v(t,n)},i?.label??r)})]},t.key??`${t.label}-${a}`))}),r}function b(t){let{marker:i,props:p}=e(`AppCompareTable`,t),{columns:m,rows:v,caption:b,mobile:x=`stack`,stickyFirstColumn:S=!1,stickyHeader:C=!1,density:w=`comfortable`,yesLabel:T=`Yes`,noLabel:E=`No`,warningLabel:D=`Warning`,partialLabel:O=`Partial`,className:k=``,...A}=p,j={yesLabel:T,noLabel:E,warningLabel:D,partialLabel:O},M=o(null),[N,P]=s(!1);if(a(()=>{let e=()=>{let e=M.current;e&&P(h(e))};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),!Array.isArray(m))throw Error(`<AppCompareTable> columns is required: pass the feature-name column, then one per option.`);if(!Array.isArray(v))throw Error(`<AppCompareTable> rows is required: pass one row per capability.`);r(`AppCompareTable`,A),n(`AppCompareTable`,`mobile`,x,u),n(`AppCompareTable`,`density`,w,d);for(let e of m)n(`AppCompareTable`,`align`,e.align,f);let F=x===`scroll`,I=/* @__PURE__ */ l(`table`,{className:g(F&&`wui-compare-scroll-table`,F&&S&&`wui-compare-sticky-first`),children:[b&&/* @__PURE__ */ c(`caption`,{className:`visually-hidden`,children:b}),/* @__PURE__ */ c(`thead`,{children:/* @__PURE__ */ c(`tr`,{children:m.map((e,t)=>/* @__PURE__ */ c(`th`,{scope:`col`,className:_(e),children:e.label},e.label?`col-${t}-${e.label}`:`col-${t}`))})}),/* @__PURE__ */ c(`tbody`,{children:y(m,v,j)})]});return/* @__PURE__ */ c(`div`,{className:g(`compare-table`,w===`relaxed`&&`wui-compare-relaxed`,C&&`wui-compare-sticky-head`,k),"data-mobile":x,...i,...A,children:F?/* @__PURE__ */ c(`div`,{className:`wui-compare-scroll`,ref:M,tabIndex:0,role:b?`region`:void 0,"aria-label":b||void 0,"data-more":N?`end`:void 0,onScroll:e=>P(h(e.currentTarget)),children:I}):I})}export{b as default};
@@ -1 +1 @@
1
- import e from"../lib/fillLabel.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./AppButton.js";import r from"./AppIcon.js";import i from"./AppInput.js";import a from"./AppModal.js";import{MODAL_ICONS as o}from"./ModalIcons.js";import s from"./warnInvalidValue.js";import c from"./warnUnknownProps.js";import{useEffect as l,useState as u}from"react";import{Fragment as d,jsx as f,jsxs as p}from"react/jsx-runtime";var m=[`sm`,`md`,`lg`,`xl`],h=[`default`,`plain`],g=[`success`,`danger`,`warning`,`info`,`primary`];function _(_){let{marker:v,props:y}=t(`AppConfirmDialog`,_),{open:b,title:x,variant:S=`default`,description:C,confirmLabel:w=`Confirm`,cancelLabel:T=`Cancel`,typePhraseLabel:E=`Type {phrase} to confirm`,tone:D,image:O,icon:k,iconSize:A,confirmPhrase:j,onConfirm:M,onClose:N,loading:P=!1,staticBackdrop:F=!0,placement:I=`center`,size:L=`md`,className:R=``,children:z,...B}=y;c(`AppConfirmDialog`,B),s(`AppConfirmDialog`,`tone`,D,g),s(`AppConfirmDialog`,`size`,typeof L==`string`?L:null,m),s(`AppConfirmDialog`,`variant`,S,h);let[V,H]=u(``);if(l(()=>{b||H(``)},[b]),!b)return null;let U=!!j&&V.trim()!==j,[W,...G]=E.split(`{phrase}`),K=G.join(j),q=S===`plain`,J=q?`sm`:`md`,Y=q||O||k?null:o[D===`danger`?`delete`:D??`info`],X=A>0?{"--wui-confirm-icon-size":`${A}px`}:void 0,Z=()=>{P||N?.()};return/* @__PURE__ */ f(a,{...v,...B,open:b,hideHeader:!0,title:x,onClose:Z,staticBackdrop:F,placement:I,size:L,className:[`wui-confirm`,q&&`wui-confirm-plain`,R].filter(Boolean).join(` `),footer:/* @__PURE__ */ p(`div`,{className:`wui-confirm-actions`,children:[/* @__PURE__ */ f(n,{tone:`neutral`,...q?{}:{variant:`soft`},size:J,disabled:P,onClick:Z,children:T}),/* @__PURE__ */ f(n,{tone:D===`danger`?`danger`:void 0,size:J,disabled:U,loading:P,onClick:M,children:w})]}),children:/* @__PURE__ */ p(`div`,{className:`wui-confirm-content`,children:[!q&&O?/* @__PURE__ */ f(`span`,{className:`wui-confirm-icon`,style:X,children:/* @__PURE__ */ f(`img`,{src:O,alt:``,"aria-hidden":`true`})}):!q&&k?/* @__PURE__ */ f(`span`,{className:`wui-confirm-icon`,style:X,children:typeof k==`string`?/* @__PURE__ */ f(r,{name:k,size:80}):k}):Y&&/* @__PURE__ */ f(`span`,{className:`wui-confirm-icon`,style:X,children:/* @__PURE__ */ f(Y,{size:120})}),/* @__PURE__ */ f(`h3`,{className:`wui-confirm-title`,tabIndex:-1,"data-autofocus":``,children:x}),C&&/* @__PURE__ */ f(`p`,{className:`wui-confirm-msg`,children:C}),z!=null&&z!==!1&&/* @__PURE__ */ f(`div`,{className:`wui-confirm-body`,children:z}),j&&/* @__PURE__ */ f(i,{fieldClassName:`mt-3 mb-0 w-100 text-start`,label:/* @__PURE__ */ p(d,{children:[W,/* @__PURE__ */ f(`strong`,{children:j}),K]}),value:V,onChange:e=>H(e.target.value),"aria-label":e(E,{phrase:j}),disabled:P})]})})}export{_ as default};
1
+ import e from"../lib/fillLabel.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./AppButton.js";import r from"./AppIcon.js";import i from"./AppInput.js";import a from"./AppModal.js";import o from"./assertValidValue.js";import{MODAL_ICONS as s}from"./ModalIcons.js";import c from"./warnUnknownProps.js";import{useEffect as l,useState as u}from"react";import{Fragment as d,jsx as f,jsxs as p}from"react/jsx-runtime";var m=[`sm`,`md`,`lg`,`xl`],h=[`default`,`plain`],g=[`success`,`danger`,`warning`,`info`,`primary`];function _(_){let{marker:v,props:y}=t(`AppConfirmDialog`,_),{open:b,title:x,variant:S=`default`,description:C,confirmLabel:w=`Confirm`,cancelLabel:T=`Cancel`,typePhraseLabel:E=`Type {phrase} to confirm`,tone:D,image:O,icon:k,iconSize:A,confirmPhrase:j,onConfirm:M,onClose:N,loading:P=!1,staticBackdrop:F=!0,placement:I=`center`,size:L=`md`,className:R=``,children:z,...B}=y;c(`AppConfirmDialog`,B),o(`AppConfirmDialog`,`tone`,D,g),o(`AppConfirmDialog`,`size`,typeof L==`string`?L:null,m),o(`AppConfirmDialog`,`variant`,S,h);let[V,H]=u(``);if(l(()=>{b||H(``)},[b]),!b)return null;let U=!!j&&V.trim()!==j,[W,...G]=E.split(`{phrase}`),K=G.join(j),q=S===`plain`,J=q?`sm`:`md`,Y=q||O||k?null:s[D===`danger`?`delete`:D??`info`],X=A>0?{"--wui-confirm-icon-size":`${A}px`}:void 0,Z=()=>{P||N?.()};return/* @__PURE__ */ f(a,{...v,...B,open:b,hideHeader:!0,title:x,onClose:Z,staticBackdrop:F,placement:I,size:L,className:[`wui-confirm`,q&&`wui-confirm-plain`,R].filter(Boolean).join(` `),footer:/* @__PURE__ */ p(`div`,{className:`wui-confirm-actions`,children:[/* @__PURE__ */ f(n,{tone:`neutral`,...q?{}:{variant:`soft`},size:J,disabled:P,onClick:Z,children:T}),/* @__PURE__ */ f(n,{tone:D===`danger`?`danger`:void 0,size:J,disabled:U,loading:P,onClick:M,children:w})]}),children:/* @__PURE__ */ p(`div`,{className:`wui-confirm-content`,children:[!q&&O?/* @__PURE__ */ f(`span`,{className:`wui-confirm-icon`,style:X,children:/* @__PURE__ */ f(`img`,{src:O,alt:``,"aria-hidden":`true`})}):!q&&k?/* @__PURE__ */ f(`span`,{className:`wui-confirm-icon`,style:X,children:typeof k==`string`?/* @__PURE__ */ f(r,{name:k,size:80}):k}):Y&&/* @__PURE__ */ f(`span`,{className:`wui-confirm-icon`,style:X,children:/* @__PURE__ */ f(Y,{size:120})}),/* @__PURE__ */ f(`h3`,{className:`wui-confirm-title`,tabIndex:-1,"data-autofocus":``,children:x}),C&&/* @__PURE__ */ f(`p`,{className:`wui-confirm-msg`,children:C}),z!=null&&z!==!1&&/* @__PURE__ */ f(`div`,{className:`wui-confirm-body`,children:z}),j&&/* @__PURE__ */ f(i,{fieldClassName:`mt-3 mb-0 w-100 text-start`,label:/* @__PURE__ */ p(d,{children:[W,/* @__PURE__ */ f(`strong`,{children:j}),K]}),value:V,onChange:e=>H(e.target.value),"aria-label":e(E,{phrase:j}),disabled:P})]})})}export{_ as default};
@@ -1 +1 @@
1
- import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./useWuiControl.js";import n from"./warnInvalidValue.js";import r from"./warnUnknownProps.js";import{useEffect as i}from"react";import{jsx as a}from"react/jsx-runtime";import"@webority/ui-elements/elements/consent-banner";import{getConsent as o,saveConsent as s}from"@webority/analytics/site";var c=[`bottom-left`,`bottom-right`,`bar`],l=[`analytics`,`functional`,`marketing`];function u(u){let{marker:d,props:f}=e(`AppConsentBanner`,u),{title:p,description:m,policyHref:h,policyLabel:g,analyticsDescription:_,functionalDescription:v,marketingDescription:y,categories:b,position:x=`bottom-left`,standalone:S=!1,preview:C=!1,className:w=``,style:T,...E}=f;r(`AppConsentBanner`,E),n(`AppConsentBanner`,`position`,x,c);for(let e of b??[])n(`AppConsentBanner`,`categories`,e,l);let{setRef:D,innerRef:O}=t({on:{"wui-consent-save":e=>{C||(s(e.detail),O.current&&(O.current.preferences=o()))}}});return i(()=>{let e=O.current;if(!e)return;if(C){e.open();return}let t=o();e.preferences=t,t.decided||e.open()},[O,C]),/* @__PURE__ */ a(`wui-consent-banner`,{ref:D,position:x,heading:p||void 0,description:m||void 0,"policy-href":h||void 0,"policy-label":g||void 0,"analytics-description":_||void 0,"functional-description":v||void 0,"marketing-description":y||void 0,categories:b?.length?b.join(` `):void 0,standalone:S||void 0,preview:C||void 0,class:w||void 0,style:T,...d,...E})}export{u as default};
1
+ import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./assertValidValue.js";import n from"./useWuiControl.js";import r from"./warnUnknownProps.js";import{useEffect as i}from"react";import{jsx as a}from"react/jsx-runtime";import"@webority/ui-elements/elements/consent-banner";import{getConsent as o,saveConsent as s}from"@webority/analytics/site";var c=[`bottom-left`,`bottom-right`,`bar`],l=[`analytics`,`functional`,`marketing`];function u(u){let{marker:d,props:f}=e(`AppConsentBanner`,u),{title:p,description:m,policyHref:h,policyLabel:g,analyticsDescription:_,functionalDescription:v,marketingDescription:y,categories:b,position:x=`bottom-left`,standalone:S=!1,preview:C=!1,className:w=``,style:T,...E}=f;r(`AppConsentBanner`,E),t(`AppConsentBanner`,`position`,x,c);for(let e of b??[])t(`AppConsentBanner`,`categories`,e,l);let{setRef:D,innerRef:O}=n({on:{"wui-consent-save":e=>{C||(s(e.detail),O.current&&(O.current.preferences=o()))}}});return i(()=>{let e=O.current;if(!e)return;if(C){e.open();return}let t=o();e.preferences=t,t.decided||e.open()},[O,C]),/* @__PURE__ */ a(`wui-consent-banner`,{ref:D,position:x,heading:p||void 0,description:m||void 0,"policy-href":h||void 0,"policy-label":g||void 0,"analytics-description":_||void 0,"functional-description":v||void 0,"marketing-description":y||void 0,categories:b?.length?b.join(` `):void 0,standalone:S||void 0,preview:C||void 0,class:w||void 0,style:T,...d,...E})}export{u as default};
@@ -1 +1 @@
1
- import{FILL_VARIANTS as e,TONES as t}from"../lib/vocabulary.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./AppActionIcon.js";import i from"./AppButton.js";import a from"./warnInvalidValue.js";import o from"./warnUnknownProps.js";import s from"./withTooltip.js";import{COPY_FEEDBACK_MS as c,copyTextToClipboard as l}from"@webority/ui-elements/helpers";import{useCallback as u,useEffect as d,useRef as f,useState as p}from"react";import{jsx as m}from"react/jsx-runtime";var h={sm:14,md:16,lg:20};function g(g){let{marker:_,props:v}=n(`AppCopyButton`,g),{text:y,label:b=`Copy`,copiedLabel:x=`Copied`,iconOnly:S=!1,size:C=`md`,tone:w=`primary`,variant:T=`ghost`,onCopied:E,className:D=``,tooltip:O,tooltipPlacement:k,...A}=v;o(`AppCopyButton`,A),a(`AppCopyButton`,`size`,C,Object.keys(h)),a(`AppCopyButton`,`tone`,w,t),a(`AppCopyButton`,`variant`,T,e);let[j,M]=p(!1),N=f(null);d(()=>()=>clearTimeout(N.current),[]);let P=u(async()=>{await l(y)&&(M(!0),clearTimeout(N.current),N.current=setTimeout(()=>M(!1),c),E?.())},[y,E]),F=j?x:b,I=j?`check`:`files`;return s(S?/* @__PURE__ */ m(r,{icon:I,label:F,size:h[C]??h.md,onClick:P,className:D,...A,..._}):/* @__PURE__ */ m(i,{leftIcon:I,tone:w,variant:T,size:C,onClick:P,className:D,"aria-live":`polite`,...A,..._,children:F}),O,k)}export{g as default};
1
+ import{FILL_VARIANTS as e,TONES as t}from"../lib/vocabulary.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./AppActionIcon.js";import i from"./AppButton.js";import a from"./assertValidValue.js";import o from"./warnUnknownProps.js";import s from"./withTooltip.js";import{COPY_FEEDBACK_MS as c,copyTextToClipboard as l}from"@webority/ui-elements/helpers";import{useCallback as u,useEffect as d,useRef as f,useState as p}from"react";import{jsx as m}from"react/jsx-runtime";var h={sm:14,md:16,lg:20};function g(g){let{marker:_,props:v}=n(`AppCopyButton`,g),{text:y,label:b=`Copy`,copiedLabel:x=`Copied`,iconOnly:S=!1,size:C=`md`,tone:w=`primary`,variant:T=`ghost`,onCopied:E,className:D=``,tooltip:O,tooltipPlacement:k,...A}=v;o(`AppCopyButton`,A),a(`AppCopyButton`,`size`,C,Object.keys(h)),a(`AppCopyButton`,`tone`,w,t),a(`AppCopyButton`,`variant`,T,e);let[j,M]=p(!1),N=f(null);d(()=>()=>clearTimeout(N.current),[]);let P=u(async()=>{await l(y)&&(M(!0),clearTimeout(N.current),N.current=setTimeout(()=>M(!1),c),E?.())},[y,E]),F=j?x:b,I=j?`check`:`files`;return s(S?/* @__PURE__ */ m(r,{icon:I,label:F,size:h[C]??h.md,onClick:P,className:D,...A,..._}):/* @__PURE__ */ m(i,{leftIcon:I,tone:w,variant:T,size:C,onClick:P,className:D,"aria-live":`polite`,...A,..._,children:F}),O,k)}export{g 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}from"react/jsx-runtime";var i=[3,4,6,12];function a(a){let{marker:o,props:s}=e(`AppDashboardCell`,a),{span:c=12,children:l,className:u=``,...d}=s;n(`AppDashboardCell`,d),t(`AppDashboardCell`,`span`,c,i);let f=c===12||!i.includes(c)?``:` wui-dashboard-cell-${c}`;return/* @__PURE__ */ r(`div`,{className:`wui-dashboard-cell${f}${u?` ${u}`:``}`,...o,...d,children:l})}export{a as default};
1
+ import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./assertValidValue.js";import n from"./warnUnknownProps.js";import{jsx as r}from"react/jsx-runtime";var i=[3,4,6,12];function a(a){let{marker:o,props:s}=e(`AppDashboardCell`,a),{span:c=12,children:l,className:u=``,...d}=s;n(`AppDashboardCell`,d),t(`AppDashboardCell`,`span`,c,i);let f=c===12||!i.includes(c)?``:` wui-dashboard-cell-${c}`;return/* @__PURE__ */ r(`div`,{className:`wui-dashboard-cell${f}${u?` ${u}`:``}`,...o,...d,children:l})}export{a as default};
@@ -1 +1 @@
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"./AppSkeleton.js";import i from"./AppTablePagination.js";import a from"./warnInvalidValue.js";import o from"./warnUnknownProps.js";import{attachRowDrag as s,attachScrollEdges as c,syncTargets as ee}from"@webority/ui-elements/helpers";import{Children as l,Fragment as te,useEffect as u,useLayoutEffect as d,useMemo as ne,useRef as f,useState as p}from"react";import{Fragment as re,jsx as m,jsxs as h}from"react/jsx-runtime";import{FORCED_STATE_CLASSES as ie}from"@webority/theme/runtime";import{COLUMN_MAX_WIDTH as ae,COLUMN_MIN_WIDTH as oe,DATA_TABLE_TEXT as se,PIN_AT_VAR as ce,PIN_SIDES as le,ROW_HEIGHTS as ue,ROW_MOVE_LIMIT as de,ROW_SAVE_ERROR_CLASS as fe,groupCount as pe,groupItems as me,measureRows as he,pinAtValue as ge,pinClasses as _e,planPins as ve,playRowMoves as ye,rowOrderChanged as be,saveOutcomeText as xe,settledRows as Se,virtualRange as Ce}from"@webority/ui-elements/elements/data-table";var we=[`comfortable`,`cozy`,`compact`],Te=[`auto`,`fixed`],Ee=()=>{try{return process.env.NODE_ENV!==`production`}catch{return!0}},g=/* @__PURE__ */ new Set;function _(t,n){!g.has(t)&&Ee()&&(g.add(t),e(`[@webority/ui-react] <AppDataTable> ${n}`))}var De=100,Oe=e=>e.id,ke=()=>{},Ae=(e,t,n)=>{let r=!!t?.(e),i=r?``:n?.(e)||``;return{state:r?`saving`:i?`error`:null,message:i}};function v(e){return e===`end`?`wui-cell-end`:e===`num`?`num`:e===`center`?`text-center`:``}function je(e){return e===`center`?`44%`:e===`end`||e===`num`?`56%`:`60%`}function Me(e){return e==null||e===``?`-`:Array.isArray(e)?l.toArray(e):typeof e==`boolean`?String(e):e}function Ne(e){if(!e||!(e.total>0))return!1;let t=e.pageSizes?.length?e.pageSizes:[e.pageSize];return e.total>Math.min(...t)}function y(e){let{marker:l,props:Ee}=t(`AppDataTable`,e),{columns:g,rows:y,rowKey:b=Oe,sort:x,onSort:S,loading:C=!1,skeletonRows:Pe=5,empty:Fe=`No records found.`,emptyFiltered:Ie,sourceCount:Le,rowActions:w,rowActionsLabel:Re,pagination:T,ariaLabel:ze,className:Be=``,wrapperClassName:Ve=``,selectable:E=!1,selectedIds:D,isRowSelectable:He,onToggleRow:Ue,onToggleAll:We,onSelectRange:Ge,renderExpanded:Ke,density:O=`comfortable`,tableLayout:qe=`auto`,striped:Je=!1,flush:Ye=!1,pad:Xe,headerTone:Ze,rowDrag:k=!1,maxHeight:Qe,stickyFirstColumn:$e=!1,stickyActions:et=!1,stackOnMobile:A=!1,hiddenColumns:tt,rowStatus:nt,rowHref:j,onRowClick:rt,activeRowKey:it,hoverRowKey:at,resizableColumns:M=!1,viewKey:ot,groupBy:N,groupLabel:st,virtual:P=!1,rowSaving:F,rowSaveError:I,...ct}=Ee;o(`AppDataTable`,ct);let{style:lt,...ut}=ct,dt=tt?.length?new Set(tt):null;g=dt?g.filter(e=>!(e.hideable&&dt.has(e.key))):g,a(`AppDataTable`,`density`,O,we),a(`AppDataTable`,`tableLayout`,qe,Te);for(let e of g)a(`AppDataTable`,`column.pin`,e.pin,le);let ft=[`table table-ledger`,O===`cozy`||O===`compact`?`wui-table-${O}`:``,Je?`wui-table-striped`:``,$e?`wui-table-sticky-first`:``,et?`wui-table-sticky-actions`:``,A?`wui-table-stack`:``,Be].filter(Boolean).join(` `),L=typeof Ke==`function`,[pt,mt]=p(()=>/* @__PURE__ */ new Set),ht=e=>mt(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),gt=g.some(e=>typeof e.footer==`function`),R=typeof j==`function`||typeof rt==`function`,_t=e=>!!e.target.closest(`a, button, input, select, textarea, label, [role='menu'], [role='menuitem'], .dropdown`),vt=(e,t)=>{if(_t(t)||(rt&&rt(e),!j))return;let n=j(e);n&&(t.ctrlKey||t.metaKey||t.button===1?window.open(n,`_blank`,`noopener`):window.location.assign(n))},z=Qe!==void 0,yt=[`table-wrap`,z?`wui-table-scroll`:``,Ye?`wui-table-flush`:``,Ve].filter(Boolean).join(` `),bt={maxHeight:z?Qe:void 0,"--wui-table-pad":Xe!=null&&!Ye?`${Xe}px`:void 0,"--wui-table-header-bg":Ze??void 0},xt=Object.values(bt).some(e=>e!==void 0)||lt!==void 0?{...bt,...lt}:void 0,St=Math.max(1,g.length+ +!!w+ +!!E+ +!!L),Ct=g.some(e=>e.pin===`start`||e.pin===`end`),B=Ct||M||!!N||P,V=+!!L+ +!!E,wt=Ct?ve([...L?[`lead`]:[],...E?[`lead`]:[],...g.map(e=>e.pin===`start`||e.pin===`end`?e.pin:null),...w?[null]:[]]):[],H=(e,t=``)=>{let n=wt[e];return n?{className:`${t.trim()} ${_e(n)}`.trim(),style:{[ce]:ge(n.side,n.ordinal)}}:{className:t,style:void 0}},U=(e,t)=>wt[e]?{...t,...H(e).style}:t,Tt=g.length-1+ +!!w;ot&&!M&&_(`view-key`,"`viewKey` remembers resized widths: add `resizableColumns`."),P&&!z&&_(`virtual-height`,"`virtual` needs `maxHeight`: without a scroll box every row renders."),P&&(L||A)&&_(`virtual-shape`,"`virtual` takes rows of one height, so it is off with `renderExpanded` or `stackOnMobile`."),!P&&y?.length>500&&_(`rows-without-virtual`,`renders more than 500 rows without virtual: add virtual with maxHeight, or page the data.`);let W=P&&z&&!L&&!A&&!C&&y?.length>0,G=(e,t)=>!He||!!He(e,t),Et=E&&y?y.reduce((e,t,n)=>e+ +!!G(t,n),0):0,K=E&&y?y.reduce((e,t,n)=>e+(G(t,n)&&D?.has(b(t,n))?1:0),0):0,Dt=Et>0&&K===Et,Ot=K>0&&!Dt,kt=e=>{e&&(e.indeterminate=Ot)},At=f(null),jt=(e,t)=>{let n=At.current;At.current=e;let r=t&&n!==null?y.findIndex((e,t)=>b(e,t)===n):-1,i=y.findIndex((t,n)=>b(t,n)===e);if(r<0||i<0||r===i){Ue?.(e);return}let a=!D?.has(e),o=Math.min(r,i),s=y.slice(o,Math.max(r,i)+1).map((e,t)=>[e,o+t]).filter(([e,t])=>G(e,t)).map(([e,t])=>b(e,t)).filter(e=>(D?.has(e)||!1)!==a);if(Ge)Ge(s,a);else for(let e of s)Ue?.(e)},Mt=e=>{He?(y||[]).forEach((t,n)=>{let r=b(t,n);G(t,n)&&(D?.has(r)||!1)!==e&&Ue?.(r)}):We?.(e)},[Nt,Pt]=p(()=>/* @__PURE__ */ new Set),Ft=e=>Pt(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),q=ne(()=>{let e=(y||[]).map((e,t)=>({row:e,i:t}));return N?me(e,({row:e})=>String(e[N]??``)).flatMap(e=>[{group:e,open:!Nt.has(e.key)},...Nt.has(e.key)?[]:e.items]):e},[y,N,Nt]),J=f(null),It=f(null);u(()=>{let e=J.current;if(!e)return;let t=e=>{let t=e.target.closest?.(`.u-name`);t&&!t.title&&(t.scrollWidth>t.clientWidth||t.scrollHeight>t.clientHeight)&&(t.title=t.textContent.trim())},n=e=>{let t=e.target.closest?.(`tbody > tr[aria-rowindex]`)?.getAttribute(`aria-rowindex`);It.current=t?Number(t)-2:null},r=t=>{e.contains(t.relatedTarget)||(It.current=null)};e.addEventListener(`mouseover`,t),e.addEventListener(`focusin`,t),e.addEventListener(`focusin`,n),e.addEventListener(`focusout`,r);let i=c(e);return()=>{e.removeEventListener(`mouseover`,t),e.removeEventListener(`focusin`,t),e.removeEventListener(`focusin`,n),e.removeEventListener(`focusout`,r),i()}},[B]),u(()=>{if(!k||!J.current)return;let e=s(J.current);return ee(document),e},[k,B]);let Lt=f(!1);u(()=>{!Lt.current&&(Lt.current=!0,K===0)||J.current?.querySelector(`table`)?.dispatchEvent(new CustomEvent(`selectionchange`,{bubbles:!0,detail:{selected:K,total:y?.length??0,keys:y?y.flatMap((e,t)=>{let n=b(e,t);return G(e,t)&&D?.has(n)?[String(n)]:[]}):[]}}))},[E,K]);let[Rt,zt]=p({top:0,height:0}),[Y,Bt]=p(ue[O]??ue.comfortable);u(()=>{let e=J.current;if(!W||!e)return;let t=0,n=()=>{t=0;let n=e.querySelector(`:scope > table > thead`)?.getBoundingClientRect().height||0,r={top:Math.max(0,e.scrollTop-n),height:e.clientHeight};zt(e=>e.top===r.top&&e.height===r.height?e:r)},r=()=>{t||=requestAnimationFrame(n)};e.addEventListener(`scroll`,r,{passive:!0});let i=typeof ResizeObserver<`u`?new ResizeObserver(r):null;return i?.observe(e),n(),()=>{e.removeEventListener(`scroll`,r),i?.disconnect(),t&&cancelAnimationFrame(t)}},[W,B]),d(()=>{if(!W)return;let e=(J.current?.querySelector(`:scope > table > tbody > tr:not(.wui-virtual-spacer, .wui-group-row)`))?.getBoundingClientRect().height;e>0&&Math.abs(e-Y)>.5&&Bt(e)},[O,y?.length,P,W]);let X={start:0,end:q.length,before:0,after:0};if(W){X=Ce({scrollTop:Rt.top,viewport:Rt.height||Number.parseFloat(Qe)||0,rowHeight:Y,count:q.length});let e=It.current;e!==null&&e>=0&&e<q.length&&(e<X.start&&X.start-e<=De&&(X={...X,start:e,before:e*Y}),e>=X.end&&e-X.end<De&&(X={...X,end:e+1,after:(q.length-e-1)*Y}))}let Vt=f(null),Ht=f(null),Ut=f(null),Wt=!P&&!C&&y?.length>0&&y.length<=de;d(()=>{let e=Vt.current;if(!Wt||!e){Ht.current=null,Ut.current=null;return}let t=y.map((e,t)=>b(e,t));be(Ut.current,t)&&ye(e.rows,Ht.current),Ht.current=he(e.rows),Ut.current=t});let Gt=typeof F==`function`||typeof I==`function`,Kt=f(null),qt=f(null);u(()=>{if(!Gt){qt.current=null;return}let e=g[0]?.key,t=/* @__PURE__ */ new Map;(y||[]).forEach((n,r)=>{let i=e===void 0?void 0:n[e],a=typeof i==`string`||typeof i==`number`?String(i):``;t.set(b(n,r),{...Ae(n,F,I),label:a})});let n=xe(Se(qt.current,t));qt.current=t,n&&Kt.current&&(Kt.current.textContent=n)},[y,F,I,b]);let Z=Ie!==void 0&&(Le===void 0||Le>0)?Ie:Fe,Jt=({group:e,open:t},r)=>{let i=e.items[0].row[N],a=e.items.map(e=>e.row);return/* @__PURE__ */ m(`tr`,{className:`wui-group-row`,"data-group-key":e.key,"aria-rowindex":W?r+2:void 0,children:/* @__PURE__ */ m(`th`,{className:`wui-group-cell`,scope:`rowgroup`,colSpan:St,children:/* @__PURE__ */ h(`button`,{type:`button`,className:`wui-group-toggle`,"aria-expanded":t,onClick:()=>Ft(e.key),children:[/* @__PURE__ */ m(n,{name:`chevron-down`,size:16}),/* @__PURE__ */ m(`span`,{className:`wui-group-label`,children:st?st(i,a):Me(i)}),/* @__PURE__ */ m(`span`,{className:`wui-group-count`,"aria-hidden":`true`,children:pe(e.items.length)}),/* @__PURE__ */ m(`span`,{className:`visually-hidden wui-group-rows`,children:`, ${se.rows(e.items.length)}`})]})})},`group:${e.key}`)},Yt=({row:e,i:t},r)=>{let i=b(e,t),a=L&&pt.has(i),o=it!=null&&String(it)===String(i),s=at!=null&&String(at)===String(i),c=String(i).replace(/[^a-z0-9]/gi,`_`),ee=H(0,`wui-expand-cell`),l=H(+!!L,`wui-select-cell`),u=Gt?Ae(e,F,I):null,d=G(e,t);return/* @__PURE__ */ h(te,{children:[/* @__PURE__ */ h(`tr`,{className:[E&&d&&D?.has(i)?`is-selected`:``,R?`wui-row-link`:``,o?`wui-row-active`:``,s?ie.hover:``].filter(Boolean).join(` `)||void 0,"aria-current":o?`true`:void 0,"aria-rowindex":W?r+2:void 0,"aria-busy":u?.state===`saving`?`true`:void 0,"data-wui-save-state":u?.state||void 0,"data-status":nt?.(e)||void 0,"data-href":j?.(e)||void 0,"data-row-key":k?String(i):void 0,tabIndex:R?0:void 0,onClick:R?t=>vt(e,t):void 0,onAuxClick:R&&j?t=>t.button===1&&vt(e,t):void 0,onKeyDown:R?t=>{t.key===`Enter`&&t.target===t.currentTarget&&vt(e,t)}:void 0,children:[L&&/* @__PURE__ */ m(`td`,{className:ee.className,style:ee.style,children:/* @__PURE__ */ m(`button`,{type:`button`,className:`wui-expand-toggle${a?` is-open`:``}`,"aria-expanded":a,"aria-controls":a?`${c}-expanded`:void 0,"aria-label":a?`Collapse row`:`Expand row`,onClick:()=>ht(i),children:/* @__PURE__ */ m(n,{name:`chevron-down`,size:16})})}),E&&/* @__PURE__ */ m(`td`,{className:l.className,style:l.style,children:/* @__PURE__ */ m(`input`,{type:`checkbox`,className:`wui-check`,checked:d&&(D?.has(i)||!1),disabled:!d,onChange:e=>jt(i,e.nativeEvent.shiftKey),onMouseDown:e=>{e.shiftKey&&e.preventDefault()},"aria-label":`Select row`})}),g.map((t,n)=>{let r=t.rowHeader?`th`:`td`;return/* @__PURE__ */ h(r,{scope:t.rowHeader?`row`:void 0,className:H(V+n,(n===0?`wui-name-cell `:``)+(t.rowHeader?`wui-row-header `:``)+(t.nowrap?`text-nowrap `:``)+v(t.align)+(t.cellClassName?` ${t.cellClassName}`:``)).className,style:U(V+n,t.cellStyle),"data-label":A&&typeof t.label==`string`?t.label:void 0,children:[t.render?t.render(e):Me(e[t.key]),n===0&&u?.state===`error`&&/* @__PURE__ */ m(`span`,{className:fe,children:u.message})]},t.key)}),w&&/* @__PURE__ */ m(`td`,{children:/* @__PURE__ */ m(`div`,{className:`u-row-actions`,children:w(e)})})]}),a&&/* @__PURE__ */ m(`tr`,{className:`wui-row-expanded`,children:/* @__PURE__ */ m(`td`,{id:`${c}-expanded`,colSpan:St,children:Ke(e)})})]},i)},Xt=(e,t)=>e.group?Jt(e,t):Yt(e,t),Zt=(e,t)=>W?/* @__PURE__ */ m(`tr`,{className:`wui-virtual-spacer`,"aria-hidden":`true`,hidden:t===0,children:/* @__PURE__ */ m(`td`,{colSpan:St,style:{height:t}})},e):null,Q=H(0,`wui-expand-cell`),$=H(+!!L,`wui-select-cell`),Qt=()=>Array.from({length:Pe},(e,t)=>`skeleton-${t}`).map(e=>/* @__PURE__ */ h(`tr`,{children:[L&&/* @__PURE__ */ m(`td`,{className:Q.className,style:Q.style}),E&&/* @__PURE__ */ m(`td`,{className:$.className,style:$.style}),g.map((e,t)=>/* @__PURE__ */ m(`td`,{className:H(V+t,(t===0?`wui-name-cell `:``)+(e.nowrap?`text-nowrap `:``)+v(e.align)).className,style:U(V+t,void 0),"data-label":A&&typeof e.label==`string`?e.label:void 0,children:/* @__PURE__ */ m(r,{width:je(e.align),height:12,radius:6})},e.key)),w&&/* @__PURE__ */ m(`td`,{children:/* @__PURE__ */ m(`div`,{className:`u-row-actions`,children:/* @__PURE__ */ m(r,{width:`32px`,height:12,radius:6})})})]},e));return/* @__PURE__ */ h(re,{children:[/* @__PURE__ */ h(B?`wui-data-table`:`div`,{ref:J,...B?{class:yt,resizable:M?``:void 0,"view-key":ot||void 0,"data-wui-row-drag":k?``:void 0}:{className:yt,"data-wui-row-drag":k?``:void 0},style:xt,tabIndex:0,...l,...ut,children:[/* @__PURE__ */ h(`table`,{className:ft,"aria-label":ze,"aria-rowcount":W?q.length+1:void 0,style:qe===`fixed`?{tableLayout:`fixed`}:void 0,children:[/* @__PURE__ */ m(`thead`,{children:/* @__PURE__ */ h(`tr`,{"aria-rowindex":W?1:void 0,children:[L&&/* @__PURE__ */ m(`th`,{className:Q.className,style:Q.style,children:/* @__PURE__ */ m(`span`,{className:`visually-hidden`,children:`Expand`})}),E&&/* @__PURE__ */ m(`th`,{className:$.className,style:$.style,children:/* @__PURE__ */ m(`input`,{ref:kt,type:`checkbox`,className:`wui-check`,checked:Dt,disabled:C,onChange:e=>Mt(e.target.checked),"aria-label":`Select all rows`})}),g.map((e,t)=>{let r=!!(e.sortable&&S),i=x&&x.key===e.key,a=e.align===`num`||e.align===`end`,o=r&&/* @__PURE__ */ m(`span`,{className:`sort-icon${a?` wui-sort-lead`:``}`,children:/* @__PURE__ */ m(n,{name:`chevrons-up-down`,size:14})}),s=M&&t!==Tt,c=e.width||e.minWidth?{width:e.width,minWidth:e.minWidth}:void 0;return/* @__PURE__ */ h(`th`,{className:H(V+t,(r?`sortable `:``)+(t===0?`wui-name-cell `:``)+(e.nowrap?`text-nowrap `:``)+(e.grow?`wui-col-grow `:``)+(s?`wui-col-resizable `:``)+v(e.align)).className,style:U(V+t,c),"data-key":B?e.key:void 0,"aria-label":s&&typeof e.label==`string`?e.label:void 0,"data-pin":e.pin===`start`||e.pin===`end`?e.pin:void 0,tabIndex:r?0:void 0,"aria-sort":i?x.dir===`asc`?`ascending`:`descending`:r?`none`:void 0,onClick:r?()=>{C||S(e.key)}:void 0,onKeyDown:r?t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),C||S(e.key))}:void 0,children:[a&&o,e.label,!a&&o,s&&/* @__PURE__ */ m(`span`,{className:`wui-col-resize`,role:`separator`,"aria-orientation":`vertical`,"aria-valuemin":oe,"aria-valuemax":ae,tabIndex:0,"aria-label":se.resize(typeof e.label==`string`?e.label:e.key)})]},e.key)}),w&&(Re?/* @__PURE__ */ m(`th`,{className:`wui-cell-end`,children:Re}):/* @__PURE__ */ m(`th`,{className:`wui-cell-end`,children:/* @__PURE__ */ m(`span`,{className:`visually-hidden`,children:`Actions`})}))]})}),/* @__PURE__ */ m(`tbody`,{ref:Vt,children:C?Qt():y?.length?/* @__PURE__ */ h(re,{children:[Zt(`before`,X.before),q.slice(X.start,X.end).map((e,t)=>Xt(e,X.start+t)),Zt(`after`,X.after)]}):null}),gt&&!C&&y?.length>0&&/* @__PURE__ */ m(`tfoot`,{children:/* @__PURE__ */ h(`tr`,{children:[L&&/* @__PURE__ */ m(`td`,{className:Q.className,style:Q.style}),E&&/* @__PURE__ */ m(`td`,{className:$.className,style:$.style}),g.map((e,t)=>/* @__PURE__ */ m(`td`,{className:H(V+t,(t===0?`wui-name-cell `:``)+(e.nowrap?`text-nowrap `:``)+v(e.align)).className,style:U(V+t,void 0),children:e.footer?e.footer(y):null},e.key)),w&&/* @__PURE__ */ m(`td`,{})]})})]}),!C&&!y?.length&&/* @__PURE__ */ m(`div`,{className:`tbl-empty-block`,children:typeof Z==`string`?/* @__PURE__ */ m(`div`,{className:`tbl-empty-plain`,children:Z}):Z})]}),Ne(T)&&/* @__PURE__ */ m(i,{page:T.page,totalPages:T.totalPages,total:T.total,pageSize:T.pageSize,onPageChange:C?ke:T.setPage,onPageSizeChange:C?ke:T.setPageSize,pageSizes:T.pageSizes,mode:T.mode,summary:T.summary}),Gt&&/* @__PURE__ */ m(`div`,{ref:Kt,className:`visually-hidden`,role:`status`,"aria-live":`polite`,"data-wui-table-status":``})]})}export{y as default};
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"./AppSkeleton.js";import i from"./AppTablePagination.js";import a from"./assertValidValue.js";import o from"./warnUnknownProps.js";import{attachRowDrag as s,attachScrollEdges as c,syncTargets as ee}from"@webority/ui-elements/helpers";import{Children as l,Fragment as te,useEffect as u,useLayoutEffect as d,useMemo as ne,useRef as f,useState as p}from"react";import{Fragment as re,jsx as m,jsxs as h}from"react/jsx-runtime";import{FORCED_STATE_CLASSES as ie}from"@webority/theme/runtime";import{COLUMN_MAX_WIDTH as ae,COLUMN_MIN_WIDTH as oe,DATA_TABLE_TEXT as se,PIN_AT_VAR as ce,PIN_SIDES as le,ROW_HEIGHTS as ue,ROW_MOVE_LIMIT as de,ROW_SAVE_ERROR_CLASS as fe,groupCount as pe,groupItems as me,measureRows as he,pinAtValue as ge,pinClasses as _e,planPins as ve,playRowMoves as ye,rowOrderChanged as be,saveOutcomeText as xe,settledRows as Se,virtualRange as Ce}from"@webority/ui-elements/elements/data-table";var we=[`comfortable`,`cozy`,`compact`],Te=[`auto`,`fixed`],Ee=()=>{try{return process.env.NODE_ENV!==`production`}catch{return!0}},g=/* @__PURE__ */ new Set;function _(t,n){!g.has(t)&&Ee()&&(g.add(t),e(`[@webority/ui-react] <AppDataTable> ${n}`))}var De=100,Oe=e=>e.id,ke=()=>{},Ae=(e,t,n)=>{let r=!!t?.(e),i=r?``:n?.(e)||``;return{state:r?`saving`:i?`error`:null,message:i}};function v(e){return e===`end`?`wui-cell-end`:e===`num`?`num`:e===`center`?`text-center`:``}function je(e){return e===`center`?`44%`:e===`end`||e===`num`?`56%`:`60%`}function Me(e){return e==null||e===``?`-`:Array.isArray(e)?l.toArray(e):typeof e==`boolean`?String(e):e}function Ne(e){if(!e||!(e.total>0))return!1;let t=e.pageSizes?.length?e.pageSizes:[e.pageSize];return e.total>Math.min(...t)}function y(e){let{marker:l,props:Ee}=t(`AppDataTable`,e),{columns:g,rows:y,rowKey:b=Oe,sort:x,onSort:S,loading:C=!1,skeletonRows:Pe=5,empty:Fe=`No records found.`,emptyFiltered:Ie,sourceCount:Le,rowActions:w,rowActionsLabel:Re,pagination:T,ariaLabel:ze,className:Be=``,wrapperClassName:Ve=``,selectable:E=!1,selectedIds:D,isRowSelectable:He,onToggleRow:Ue,onToggleAll:We,onSelectRange:Ge,renderExpanded:Ke,density:O=`comfortable`,tableLayout:qe=`auto`,striped:Je=!1,flush:Ye=!1,pad:Xe,headerTone:Ze,rowDrag:k=!1,maxHeight:Qe,stickyFirstColumn:$e=!1,stickyActions:et=!1,stackOnMobile:A=!1,hiddenColumns:tt,rowStatus:nt,rowHref:j,onRowClick:rt,activeRowKey:it,hoverRowKey:at,resizableColumns:M=!1,viewKey:ot,groupBy:N,groupLabel:st,virtual:P=!1,rowSaving:F,rowSaveError:I,...ct}=Ee;o(`AppDataTable`,ct);let{style:lt,...ut}=ct,dt=tt?.length?new Set(tt):null;g=dt?g.filter(e=>!(e.hideable&&dt.has(e.key))):g,a(`AppDataTable`,`density`,O,we),a(`AppDataTable`,`tableLayout`,qe,Te);for(let e of g)a(`AppDataTable`,`column.pin`,e.pin,le);let ft=[`table table-ledger`,O===`cozy`||O===`compact`?`wui-table-${O}`:``,Je?`wui-table-striped`:``,$e?`wui-table-sticky-first`:``,et?`wui-table-sticky-actions`:``,A?`wui-table-stack`:``,Be].filter(Boolean).join(` `),L=typeof Ke==`function`,[pt,mt]=p(()=>/* @__PURE__ */ new Set),ht=e=>mt(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),gt=g.some(e=>typeof e.footer==`function`),R=typeof j==`function`||typeof rt==`function`,_t=e=>!!e.target.closest(`a, button, input, select, textarea, label, [role='menu'], [role='menuitem'], .dropdown`),vt=(e,t)=>{if(_t(t)||(rt&&rt(e),!j))return;let n=j(e);n&&(t.ctrlKey||t.metaKey||t.button===1?window.open(n,`_blank`,`noopener`):window.location.assign(n))},z=Qe!==void 0,yt=[`table-wrap`,z?`wui-table-scroll`:``,Ye?`wui-table-flush`:``,Ve].filter(Boolean).join(` `),bt={maxHeight:z?Qe:void 0,"--wui-table-pad":Xe!=null&&!Ye?`${Xe}px`:void 0,"--wui-table-header-bg":Ze??void 0},xt=Object.values(bt).some(e=>e!==void 0)||lt!==void 0?{...bt,...lt}:void 0,St=Math.max(1,g.length+ +!!w+ +!!E+ +!!L),Ct=g.some(e=>e.pin===`start`||e.pin===`end`),B=Ct||M||!!N||P,V=+!!L+ +!!E,wt=Ct?ve([...L?[`lead`]:[],...E?[`lead`]:[],...g.map(e=>e.pin===`start`||e.pin===`end`?e.pin:null),...w?[null]:[]]):[],H=(e,t=``)=>{let n=wt[e];return n?{className:`${t.trim()} ${_e(n)}`.trim(),style:{[ce]:ge(n.side,n.ordinal)}}:{className:t,style:void 0}},U=(e,t)=>wt[e]?{...t,...H(e).style}:t,Tt=g.length-1+ +!!w;ot&&!M&&_(`view-key`,"`viewKey` remembers resized widths: add `resizableColumns`."),P&&!z&&_(`virtual-height`,"`virtual` needs `maxHeight`: without a scroll box every row renders."),P&&(L||A)&&_(`virtual-shape`,"`virtual` takes rows of one height, so it is off with `renderExpanded` or `stackOnMobile`."),!P&&y?.length>500&&_(`rows-without-virtual`,`renders more than 500 rows without virtual: add virtual with maxHeight, or page the data.`);let W=P&&z&&!L&&!A&&!C&&y?.length>0,G=(e,t)=>!He||!!He(e,t),Et=E&&y?y.reduce((e,t,n)=>e+ +!!G(t,n),0):0,K=E&&y?y.reduce((e,t,n)=>e+(G(t,n)&&D?.has(b(t,n))?1:0),0):0,Dt=Et>0&&K===Et,Ot=K>0&&!Dt,kt=e=>{e&&(e.indeterminate=Ot)},At=f(null),jt=(e,t)=>{let n=At.current;At.current=e;let r=t&&n!==null?y.findIndex((e,t)=>b(e,t)===n):-1,i=y.findIndex((t,n)=>b(t,n)===e);if(r<0||i<0||r===i){Ue?.(e);return}let a=!D?.has(e),o=Math.min(r,i),s=y.slice(o,Math.max(r,i)+1).map((e,t)=>[e,o+t]).filter(([e,t])=>G(e,t)).map(([e,t])=>b(e,t)).filter(e=>(D?.has(e)||!1)!==a);if(Ge)Ge(s,a);else for(let e of s)Ue?.(e)},Mt=e=>{He?(y||[]).forEach((t,n)=>{let r=b(t,n);G(t,n)&&(D?.has(r)||!1)!==e&&Ue?.(r)}):We?.(e)},[Nt,Pt]=p(()=>/* @__PURE__ */ new Set),Ft=e=>Pt(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),q=ne(()=>{let e=(y||[]).map((e,t)=>({row:e,i:t}));return N?me(e,({row:e})=>String(e[N]??``)).flatMap(e=>[{group:e,open:!Nt.has(e.key)},...Nt.has(e.key)?[]:e.items]):e},[y,N,Nt]),J=f(null),It=f(null);u(()=>{let e=J.current;if(!e)return;let t=e=>{let t=e.target.closest?.(`.u-name`);t&&!t.title&&(t.scrollWidth>t.clientWidth||t.scrollHeight>t.clientHeight)&&(t.title=t.textContent.trim())},n=e=>{let t=e.target.closest?.(`tbody > tr[aria-rowindex]`)?.getAttribute(`aria-rowindex`);It.current=t?Number(t)-2:null},r=t=>{e.contains(t.relatedTarget)||(It.current=null)};e.addEventListener(`mouseover`,t),e.addEventListener(`focusin`,t),e.addEventListener(`focusin`,n),e.addEventListener(`focusout`,r);let i=c(e);return()=>{e.removeEventListener(`mouseover`,t),e.removeEventListener(`focusin`,t),e.removeEventListener(`focusin`,n),e.removeEventListener(`focusout`,r),i()}},[B]),u(()=>{if(!k||!J.current)return;let e=s(J.current);return ee(document),e},[k,B]);let Lt=f(!1);u(()=>{!Lt.current&&(Lt.current=!0,K===0)||J.current?.querySelector(`table`)?.dispatchEvent(new CustomEvent(`selectionchange`,{bubbles:!0,detail:{selected:K,total:y?.length??0,keys:y?y.flatMap((e,t)=>{let n=b(e,t);return G(e,t)&&D?.has(n)?[String(n)]:[]}):[]}}))},[E,K]);let[Rt,zt]=p({top:0,height:0}),[Y,Bt]=p(ue[O]??ue.comfortable);u(()=>{let e=J.current;if(!W||!e)return;let t=0,n=()=>{t=0;let n=e.querySelector(`:scope > table > thead`)?.getBoundingClientRect().height||0,r={top:Math.max(0,e.scrollTop-n),height:e.clientHeight};zt(e=>e.top===r.top&&e.height===r.height?e:r)},r=()=>{t||=requestAnimationFrame(n)};e.addEventListener(`scroll`,r,{passive:!0});let i=typeof ResizeObserver<`u`?new ResizeObserver(r):null;return i?.observe(e),n(),()=>{e.removeEventListener(`scroll`,r),i?.disconnect(),t&&cancelAnimationFrame(t)}},[W,B]),d(()=>{if(!W)return;let e=(J.current?.querySelector(`:scope > table > tbody > tr:not(.wui-virtual-spacer, .wui-group-row)`))?.getBoundingClientRect().height;e>0&&Math.abs(e-Y)>.5&&Bt(e)},[O,y?.length,P,W]);let X={start:0,end:q.length,before:0,after:0};if(W){X=Ce({scrollTop:Rt.top,viewport:Rt.height||Number.parseFloat(Qe)||0,rowHeight:Y,count:q.length});let e=It.current;e!==null&&e>=0&&e<q.length&&(e<X.start&&X.start-e<=De&&(X={...X,start:e,before:e*Y}),e>=X.end&&e-X.end<De&&(X={...X,end:e+1,after:(q.length-e-1)*Y}))}let Vt=f(null),Ht=f(null),Ut=f(null),Wt=!P&&!C&&y?.length>0&&y.length<=de;d(()=>{let e=Vt.current;if(!Wt||!e){Ht.current=null,Ut.current=null;return}let t=y.map((e,t)=>b(e,t));be(Ut.current,t)&&ye(e.rows,Ht.current),Ht.current=he(e.rows),Ut.current=t});let Gt=typeof F==`function`||typeof I==`function`,Kt=f(null),qt=f(null);u(()=>{if(!Gt){qt.current=null;return}let e=g[0]?.key,t=/* @__PURE__ */ new Map;(y||[]).forEach((n,r)=>{let i=e===void 0?void 0:n[e],a=typeof i==`string`||typeof i==`number`?String(i):``;t.set(b(n,r),{...Ae(n,F,I),label:a})});let n=xe(Se(qt.current,t));qt.current=t,n&&Kt.current&&(Kt.current.textContent=n)},[y,F,I,b]);let Z=Ie!==void 0&&(Le===void 0||Le>0)?Ie:Fe,Jt=({group:e,open:t},r)=>{let i=e.items[0].row[N],a=e.items.map(e=>e.row);return/* @__PURE__ */ m(`tr`,{className:`wui-group-row`,"data-group-key":e.key,"aria-rowindex":W?r+2:void 0,children:/* @__PURE__ */ m(`th`,{className:`wui-group-cell`,scope:`rowgroup`,colSpan:St,children:/* @__PURE__ */ h(`button`,{type:`button`,className:`wui-group-toggle`,"aria-expanded":t,onClick:()=>Ft(e.key),children:[/* @__PURE__ */ m(n,{name:`chevron-down`,size:16}),/* @__PURE__ */ m(`span`,{className:`wui-group-label`,children:st?st(i,a):Me(i)}),/* @__PURE__ */ m(`span`,{className:`wui-group-count`,"aria-hidden":`true`,children:pe(e.items.length)}),/* @__PURE__ */ m(`span`,{className:`visually-hidden wui-group-rows`,children:`, ${se.rows(e.items.length)}`})]})})},`group:${e.key}`)},Yt=({row:e,i:t},r)=>{let i=b(e,t),a=L&&pt.has(i),o=it!=null&&String(it)===String(i),s=at!=null&&String(at)===String(i),c=String(i).replace(/[^a-z0-9]/gi,`_`),ee=H(0,`wui-expand-cell`),l=H(+!!L,`wui-select-cell`),u=Gt?Ae(e,F,I):null,d=G(e,t);return/* @__PURE__ */ h(te,{children:[/* @__PURE__ */ h(`tr`,{className:[E&&d&&D?.has(i)?`is-selected`:``,R?`wui-row-link`:``,o?`wui-row-active`:``,s?ie.hover:``].filter(Boolean).join(` `)||void 0,"aria-current":o?`true`:void 0,"aria-rowindex":W?r+2:void 0,"aria-busy":u?.state===`saving`?`true`:void 0,"data-wui-save-state":u?.state||void 0,"data-status":nt?.(e)||void 0,"data-href":j?.(e)||void 0,"data-row-key":k?String(i):void 0,tabIndex:R?0:void 0,onClick:R?t=>vt(e,t):void 0,onAuxClick:R&&j?t=>t.button===1&&vt(e,t):void 0,onKeyDown:R?t=>{t.key===`Enter`&&t.target===t.currentTarget&&vt(e,t)}:void 0,children:[L&&/* @__PURE__ */ m(`td`,{className:ee.className,style:ee.style,children:/* @__PURE__ */ m(`button`,{type:`button`,className:`wui-expand-toggle${a?` is-open`:``}`,"aria-expanded":a,"aria-controls":a?`${c}-expanded`:void 0,"aria-label":a?`Collapse row`:`Expand row`,onClick:()=>ht(i),children:/* @__PURE__ */ m(n,{name:`chevron-down`,size:16})})}),E&&/* @__PURE__ */ m(`td`,{className:l.className,style:l.style,children:/* @__PURE__ */ m(`input`,{type:`checkbox`,className:`wui-check`,checked:d&&(D?.has(i)||!1),disabled:!d,onChange:e=>jt(i,e.nativeEvent.shiftKey),onMouseDown:e=>{e.shiftKey&&e.preventDefault()},"aria-label":`Select row`})}),g.map((t,n)=>{let r=t.rowHeader?`th`:`td`;return/* @__PURE__ */ h(r,{scope:t.rowHeader?`row`:void 0,className:H(V+n,(n===0?`wui-name-cell `:``)+(t.rowHeader?`wui-row-header `:``)+(t.nowrap?`text-nowrap `:``)+v(t.align)+(t.cellClassName?` ${t.cellClassName}`:``)).className,style:U(V+n,t.cellStyle),"data-label":A&&typeof t.label==`string`?t.label:void 0,children:[t.render?t.render(e):Me(e[t.key]),n===0&&u?.state===`error`&&/* @__PURE__ */ m(`span`,{className:fe,children:u.message})]},t.key)}),w&&/* @__PURE__ */ m(`td`,{children:/* @__PURE__ */ m(`div`,{className:`u-row-actions`,children:w(e)})})]}),a&&/* @__PURE__ */ m(`tr`,{className:`wui-row-expanded`,children:/* @__PURE__ */ m(`td`,{id:`${c}-expanded`,colSpan:St,children:Ke(e)})})]},i)},Xt=(e,t)=>e.group?Jt(e,t):Yt(e,t),Zt=(e,t)=>W?/* @__PURE__ */ m(`tr`,{className:`wui-virtual-spacer`,"aria-hidden":`true`,hidden:t===0,children:/* @__PURE__ */ m(`td`,{colSpan:St,style:{height:t}})},e):null,Q=H(0,`wui-expand-cell`),$=H(+!!L,`wui-select-cell`),Qt=()=>Array.from({length:Pe},(e,t)=>`skeleton-${t}`).map(e=>/* @__PURE__ */ h(`tr`,{children:[L&&/* @__PURE__ */ m(`td`,{className:Q.className,style:Q.style}),E&&/* @__PURE__ */ m(`td`,{className:$.className,style:$.style}),g.map((e,t)=>/* @__PURE__ */ m(`td`,{className:H(V+t,(t===0?`wui-name-cell `:``)+(e.nowrap?`text-nowrap `:``)+v(e.align)).className,style:U(V+t,void 0),"data-label":A&&typeof e.label==`string`?e.label:void 0,children:/* @__PURE__ */ m(r,{width:je(e.align),height:12,radius:6})},e.key)),w&&/* @__PURE__ */ m(`td`,{children:/* @__PURE__ */ m(`div`,{className:`u-row-actions`,children:/* @__PURE__ */ m(r,{width:`32px`,height:12,radius:6})})})]},e));return/* @__PURE__ */ h(re,{children:[/* @__PURE__ */ h(B?`wui-data-table`:`div`,{ref:J,...B?{class:yt,resizable:M?``:void 0,"view-key":ot||void 0,"data-wui-row-drag":k?``:void 0}:{className:yt,"data-wui-row-drag":k?``:void 0},style:xt,tabIndex:0,...l,...ut,children:[/* @__PURE__ */ h(`table`,{className:ft,"aria-label":ze,"aria-rowcount":W?q.length+1:void 0,style:qe===`fixed`?{tableLayout:`fixed`}:void 0,children:[/* @__PURE__ */ m(`thead`,{children:/* @__PURE__ */ h(`tr`,{"aria-rowindex":W?1:void 0,children:[L&&/* @__PURE__ */ m(`th`,{className:Q.className,style:Q.style,children:/* @__PURE__ */ m(`span`,{className:`visually-hidden`,children:`Expand`})}),E&&/* @__PURE__ */ m(`th`,{className:$.className,style:$.style,children:/* @__PURE__ */ m(`input`,{ref:kt,type:`checkbox`,className:`wui-check`,checked:Dt,disabled:C,onChange:e=>Mt(e.target.checked),"aria-label":`Select all rows`})}),g.map((e,t)=>{let r=!!(e.sortable&&S),i=x&&x.key===e.key,a=e.align===`num`||e.align===`end`,o=r&&/* @__PURE__ */ m(`span`,{className:`sort-icon${a?` wui-sort-lead`:``}`,children:/* @__PURE__ */ m(n,{name:`chevrons-up-down`,size:14})}),s=M&&t!==Tt,c=e.width||e.minWidth?{width:e.width,minWidth:e.minWidth}:void 0;return/* @__PURE__ */ h(`th`,{className:H(V+t,(r?`sortable `:``)+(t===0?`wui-name-cell `:``)+(e.nowrap?`text-nowrap `:``)+(e.grow?`wui-col-grow `:``)+(s?`wui-col-resizable `:``)+v(e.align)).className,style:U(V+t,c),"data-key":B?e.key:void 0,"aria-label":s&&typeof e.label==`string`?e.label:void 0,"data-pin":e.pin===`start`||e.pin===`end`?e.pin:void 0,tabIndex:r?0:void 0,"aria-sort":i?x.dir===`asc`?`ascending`:`descending`:r?`none`:void 0,onClick:r?()=>{C||S(e.key)}:void 0,onKeyDown:r?t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),C||S(e.key))}:void 0,children:[a&&o,e.label,!a&&o,s&&/* @__PURE__ */ m(`span`,{className:`wui-col-resize`,role:`separator`,"aria-orientation":`vertical`,"aria-valuemin":oe,"aria-valuemax":ae,tabIndex:0,"aria-label":se.resize(typeof e.label==`string`?e.label:e.key)})]},e.key)}),w&&(Re?/* @__PURE__ */ m(`th`,{className:`wui-cell-end`,children:Re}):/* @__PURE__ */ m(`th`,{className:`wui-cell-end`,children:/* @__PURE__ */ m(`span`,{className:`visually-hidden`,children:`Actions`})}))]})}),/* @__PURE__ */ m(`tbody`,{ref:Vt,children:C?Qt():y?.length?/* @__PURE__ */ h(re,{children:[Zt(`before`,X.before),q.slice(X.start,X.end).map((e,t)=>Xt(e,X.start+t)),Zt(`after`,X.after)]}):null}),gt&&!C&&y?.length>0&&/* @__PURE__ */ m(`tfoot`,{children:/* @__PURE__ */ h(`tr`,{children:[L&&/* @__PURE__ */ m(`td`,{className:Q.className,style:Q.style}),E&&/* @__PURE__ */ m(`td`,{className:$.className,style:$.style}),g.map((e,t)=>/* @__PURE__ */ m(`td`,{className:H(V+t,(t===0?`wui-name-cell `:``)+(e.nowrap?`text-nowrap `:``)+v(e.align)).className,style:U(V+t,void 0),children:e.footer?e.footer(y):null},e.key)),w&&/* @__PURE__ */ m(`td`,{})]})})]}),!C&&!y?.length&&/* @__PURE__ */ m(`div`,{className:`tbl-empty-block`,children:typeof Z==`string`?/* @__PURE__ */ m(`div`,{className:`tbl-empty-plain`,children:Z}):Z})]}),Ne(T)&&/* @__PURE__ */ m(i,{page:T.page,totalPages:T.totalPages,total:T.total,pageSize:T.pageSize,onPageChange:C?ke:T.setPage,onPageSizeChange:C?ke:T.setPageSize,pageSizes:T.pageSizes,mode:T.mode,summary:T.summary}),Gt&&/* @__PURE__ */ m(`div`,{ref:Kt,className:`visually-hidden`,role:`status`,"aria-live":`polite`,"data-wui-table-status":``})]})}export{y as default};
@@ -1 +1 @@
1
- import{devWarn as e}from"../lib/devWarn.js";import t from"../lib/FieldMessage.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./AppInfoTip.js";import i from"./AppRequiredMark.js";import a from"./useWuiControl.js";import o from"./warnInvalidValue.js";import s from"./warnUnknownProps.js";import{cloneElement as c,forwardRef as l,useId as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";import"@webority/ui-elements/elements/datepicker";var p=[`sm`,`md`,`lg`],m=l(function(l,m){let{marker:h,props:g}=n(`AppDatePicker`,l),{value:_,onChange:v,label:y,required:b=!1,optional:x=!1,optionalLabel:S=`(optional)`,helperText:C,error:w,name:T,min:E,max:D,placeholder:O=`Choose a date`,disabled:k,readOnly:A=!1,loading:j=!1,defaultValue:M,help:N,helpLabel:P=`More information`,size:F,firstDay:I,displayFormat:L,id:R,ariaLabel:z,className:B=``,fieldClassName:V=``,...H}=g;s(`AppDatePicker`,H),o(`AppDatePicker`,`size`,F,p),typeof L==`string`&&L!==``&&/DD|YYYY|YY/.test(L)&&e(`[@webority/ui-react] <AppDatePicker> displayFormat "${L}" uses uppercase day or year tokens, which print as written; the tokens are yyyy, MMMM, MMM, MM, dd and d.`);let U=u(),W=R||U,{setRef:G}=a({ref:m,value:_??(M===void 0?``:void 0),defaultValue:M,onChange:v}),K=!y&&!w&&!C,q=w?`${W}-error`:void 0,J=C?`${W}-hint`:void 0,Y=/* @__PURE__ */ d(`wui-datepicker`,{ref:G,id:W,name:T,value:(_??M)||void 0,min:E,max:D,placeholder:O,size:F||void 0,"first-day":I==null?void 0:String(I),"display-format":L||void 0,"aria-label":z||(typeof y==`string`?y:void 0),"aria-describedby":q||J,"aria-invalid":w?`true`:void 0,disabled:k?``:void 0,readonly:A?``:void 0,loading:j?``:void 0,required:b?``:void 0,className:B||void 0,...H});return K?c(Y,h):/* @__PURE__ */ f(`div`,{...h,className:`field${V?` ${V}`:``}`,children:[y&&/* @__PURE__ */ f(`label`,{className:`label`,htmlFor:W,children:[y,x&&!b&&/* @__PURE__ */ d(`span`,{className:`label-optional`,children:` ${S}`}),b&&/* @__PURE__ */ d(i,{}),N&&/* @__PURE__ */ d(r,{label:P,children:N})]}),Y,/* @__PURE__ */ d(t,{error:w,hint:C,errorId:q,hintId:J})]})});export{m as default};
1
+ import{devWarn as e}from"../lib/devWarn.js";import t from"../lib/FieldMessage.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./AppInfoTip.js";import i from"./AppRequiredMark.js";import a from"./assertValidValue.js";import o from"./useWuiControl.js";import s from"./warnUnknownProps.js";import{cloneElement as c,forwardRef as l,useId as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";import"@webority/ui-elements/elements/datepicker";var p=[`sm`,`md`,`lg`],m=l(function(l,m){let{marker:h,props:g}=n(`AppDatePicker`,l),{value:_,onChange:v,label:y,required:b=!1,optional:x=!1,optionalLabel:S=`(optional)`,helperText:C,error:w,name:T,min:E,max:D,placeholder:O=`Choose a date`,disabled:k,readOnly:A=!1,loading:j=!1,defaultValue:M,help:N,helpLabel:P=`More information`,size:F,firstDay:I,displayFormat:L,id:R,ariaLabel:z,className:B=``,fieldClassName:V=``,...H}=g;s(`AppDatePicker`,H),a(`AppDatePicker`,`size`,F,p),typeof L==`string`&&L!==``&&/DD|YYYY|YY/.test(L)&&e(`[@webority/ui-react] <AppDatePicker> displayFormat "${L}" uses uppercase day or year tokens, which print as written; the tokens are yyyy, MMMM, MMM, MM, dd and d.`);let U=u(),W=R||U,{setRef:G}=o({ref:m,value:_??(M===void 0?``:void 0),defaultValue:M,onChange:v}),K=!y&&!w&&!C,q=w?`${W}-error`:void 0,J=C?`${W}-hint`:void 0,Y=/* @__PURE__ */ d(`wui-datepicker`,{ref:G,id:W,name:T,value:(_??M)||void 0,min:E,max:D,placeholder:O,size:F||void 0,"first-day":I==null?void 0:String(I),"display-format":L||void 0,"aria-label":z||(typeof y==`string`?y:void 0),"aria-describedby":q||J,"aria-invalid":w?`true`:void 0,disabled:k?``:void 0,readonly:A?``:void 0,loading:j?``:void 0,required:b?``:void 0,className:B||void 0,...H});return K?c(Y,h):/* @__PURE__ */ f(`div`,{...h,className:`field${V?` ${V}`:``}`,children:[y&&/* @__PURE__ */ f(`label`,{className:`label`,htmlFor:W,children:[y,x&&!b&&/* @__PURE__ */ d(`span`,{className:`label-optional`,children:` ${S}`}),b&&/* @__PURE__ */ d(i,{}),N&&/* @__PURE__ */ d(r,{label:P,children:N})]}),Y,/* @__PURE__ */ d(t,{error:w,hint:C,errorId:q,hintId:J})]})});export{m as default};
@@ -1 +1 @@
1
- import e from"../lib/FieldMessage.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./AppInfoTip.js";import r from"./AppRequiredMark.js";import i from"./useWuiControl.js";import a from"./warnInvalidValue.js";import o from"./warnUnknownProps.js";import{cloneElement as s,forwardRef as c,useEffect as ee,useId as l,useRef as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";import"@webority/ui-elements/elements/date-range";var te=[`sm`,`md`,`lg`],p=e=>{if(e?.length)return e.every(e=>typeof e==`string`)?e.join(`,`):JSON.stringify(e)},m=c(function(c,m){let{marker:h,props:g}=t(`AppDateRangePicker`,c),{start:_,end:v,defaultStart:y,defaultEnd:b,onChange:x,label:S,help:C,helpLabel:ne=`More information`,required:w=!1,optional:re=!1,optionalLabel:T=`(optional)`,helperText:E,error:D,startName:O,endName:k,min:A,max:j,placeholder:M=`Start to End`,disabled:N,readOnly:P=!1,loading:F=!1,size:I,firstDay:L,timeZone:R,financialYearStart:z,presets:B,id:V,ariaLabel:H,className:U=``,fieldClassName:W=``,...G}=g;o(`AppDateRangePicker`,G),a(`AppDateRangePicker`,`size`,I,te);let K=l(),q=V||K,{setRef:J,innerRef:Y}=i({ref:m,onChange:x}),X=u(!1);ee(()=>{let e=Y.current;if(!e)return;let t=_===void 0?!X.current&&y!==void 0?y:e.value.start:_,n=v===void 0?!X.current&&b!==void 0?b:e.value.end:v;(e.value.start!==t||e.value.end!==n)&&(e.value={start:t,end:n}),X.current=!0},[_,v,y,b,Y]);let ie=!S&&!D&&!E,Z=D?`${q}-error`:void 0,Q=E?`${q}-hint`:void 0,ae=Z||Q,$=/* @__PURE__ */ d(`wui-date-range`,{ref:J,id:q,"start-name":O,"end-name":k,min:A,max:j,placeholder:M,size:I||void 0,"first-day":L==null?void 0:String(L),"time-zone":R||void 0,"financial-year-start":z==null?void 0:String(z),presets:p(B),"aria-label":H||(typeof S==`string`?S:void 0),"aria-describedby":ae,"aria-invalid":D?`true`:void 0,disabled:N?``:void 0,readonly:P?``:void 0,loading:F?``:void 0,required:w?``:void 0,className:U||void 0,...G});return ie?s($,h):/* @__PURE__ */ f(`div`,{...h,className:`field${W?` ${W}`:``}`,children:[S&&/* @__PURE__ */ f(`label`,{className:`label`,htmlFor:q,children:[S,re&&!w&&/* @__PURE__ */ d(`span`,{className:`label-optional`,children:` ${T}`}),w&&/* @__PURE__ */ d(r,{}),C&&/* @__PURE__ */ d(n,{label:ne,children:C})]}),$,/* @__PURE__ */ d(e,{error:D,hint:E,errorId:Z,hintId:Q})]})});export{m as default};
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"./assertValidValue.js";import a from"./useWuiControl.js";import o from"./warnUnknownProps.js";import{cloneElement as s,forwardRef as c,useEffect as ee,useId as l,useRef as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";import"@webority/ui-elements/elements/date-range";var te=[`sm`,`md`,`lg`],p=e=>{if(e?.length)return e.every(e=>typeof e==`string`)?e.join(`,`):JSON.stringify(e)},m=c(function(c,m){let{marker:h,props:g}=t(`AppDateRangePicker`,c),{start:_,end:v,defaultStart:y,defaultEnd:b,onChange:x,label:S,help:C,helpLabel:ne=`More information`,required:w=!1,optional:re=!1,optionalLabel:T=`(optional)`,helperText:E,error:D,startName:O,endName:k,min:A,max:j,placeholder:M=`Start to End`,disabled:N,readOnly:P=!1,loading:F=!1,size:I,firstDay:L,timeZone:R,financialYearStart:z,presets:B,id:V,ariaLabel:H,className:U=``,fieldClassName:W=``,...G}=g;o(`AppDateRangePicker`,G),i(`AppDateRangePicker`,`size`,I,te);let K=l(),q=V||K,{setRef:J,innerRef:Y}=a({ref:m,onChange:x}),X=u(!1);ee(()=>{let e=Y.current;if(!e)return;let t=_===void 0?!X.current&&y!==void 0?y:e.value.start:_,n=v===void 0?!X.current&&b!==void 0?b:e.value.end:v;(e.value.start!==t||e.value.end!==n)&&(e.value={start:t,end:n}),X.current=!0},[_,v,y,b,Y]);let ie=!S&&!D&&!E,Z=D?`${q}-error`:void 0,Q=E?`${q}-hint`:void 0,ae=Z||Q,$=/* @__PURE__ */ d(`wui-date-range`,{ref:J,id:q,"start-name":O,"end-name":k,min:A,max:j,placeholder:M,size:I||void 0,"first-day":L==null?void 0:String(L),"time-zone":R||void 0,"financial-year-start":z==null?void 0:String(z),presets:p(B),"aria-label":H||(typeof S==`string`?S:void 0),"aria-describedby":ae,"aria-invalid":D?`true`:void 0,disabled:N?``:void 0,readonly:P?``:void 0,loading:F?``:void 0,required:w?``:void 0,className:U||void 0,...G});return ie?s($,h):/* @__PURE__ */ f(`div`,{...h,className:`field${W?` ${W}`:``}`,children:[S&&/* @__PURE__ */ f(`label`,{className:`label`,htmlFor:q,children:[S,re&&!w&&/* @__PURE__ */ d(`span`,{className:`label-optional`,children:` ${T}`}),w&&/* @__PURE__ */ d(r,{}),C&&/* @__PURE__ */ d(n,{label:ne,children:C})]}),$,/* @__PURE__ */ d(e,{error:D,hint:E,errorId:Z,hintId:Q})]})});export{m as default};
@@ -1 +1 @@
1
- import{isEmpty as e}from"../lib/emptyValue.js";import{linkTarget as t}from"../lib/linkTarget.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./renderIconProp.js";import i from"./warnInvalidValue.js";import a from"./warnUnknownProps.js";import{jsx as o,jsxs as s}from"react/jsx-runtime";var c=[`sm`,`md`],l=[`grid`,`summary`,`list`],u=[1,2,3,4];function d(d){let{marker:f,props:p}=n(`AppDescriptions`,d),{items:m=[],columns:h=2,size:g=`md`,bordered:_=!1,layout:v=`grid`,title:y,linkComponent:b,className:x=``,...S}=p;a(`AppDescriptions`,S),i(`AppDescriptions`,`columns`,h,u),i(`AppDescriptions`,`size`,g,c),i(`AppDescriptions`,`layout`,v,l);let C=[`descs`,`descs-col-${h}`,g&&g!==`md`?`descs-${g}`:``,_?`descs-bordered`:``,v===`summary`?`wui-descs-summary`:``,v===`list`?`wui-descs-list`:``,h===4?`wui-descs-col-4`:``,x].filter(Boolean).join(` `)||void 0;return/* @__PURE__ */ s(`div`,{className:C,...f,...S,children:[y&&/* @__PURE__ */ o(`div`,{className:`descs-title`,children:y}),/* @__PURE__ */ o(`dl`,{className:`descs-list`,children:m.map((n,i)=>{let a=e(n.value),c=Math.min(12,Math.max(1,n.span??1)),l=n.key??`${n.label}-${i}`,u=a?`-`:n.value,{Tag:d,linkProps:f}=t(b,{href:n.href});return/* @__PURE__ */ s(`div`,{className:`descs-item${n.emphasis?` wui-descs-emphasis`:``} wui-descs-span-${c}`,children:[n.icon&&/* @__PURE__ */ o(`span`,{className:`wui-descs-icon`,children:r(n.icon,{size:16})}),/* @__PURE__ */ o(`dt`,{className:`descs-label`,children:n.label}),/* @__PURE__ */ o(`dd`,{className:`descs-value${a?` is-empty`:``}${n.multiline&&!a?` wui-pre-line`:``}`,children:n.href?/* @__PURE__ */ o(d,{className:`wui-descs-link`,...f,children:u}):u})]},l)})})]})}export{d as default};
1
+ import{isEmpty as e}from"../lib/emptyValue.js";import{linkTarget as t}from"../lib/linkTarget.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./assertValidValue.js";import i from"./renderIconProp.js";import a from"./warnUnknownProps.js";import{jsx as o,jsxs as s}from"react/jsx-runtime";var c=[`sm`,`md`],l=[`grid`,`summary`,`list`],u=[1,2,3,4];function d(d){let{marker:f,props:p}=n(`AppDescriptions`,d),{items:m=[],columns:h=2,size:g=`md`,bordered:_=!1,layout:v=`grid`,title:y,linkComponent:b,className:x=``,...S}=p;a(`AppDescriptions`,S),r(`AppDescriptions`,`columns`,h,u),r(`AppDescriptions`,`size`,g,c),r(`AppDescriptions`,`layout`,v,l);let C=[`descs`,`descs-col-${h}`,g&&g!==`md`?`descs-${g}`:``,_?`descs-bordered`:``,v===`summary`?`wui-descs-summary`:``,v===`list`?`wui-descs-list`:``,h===4?`wui-descs-col-4`:``,x].filter(Boolean).join(` `)||void 0;return/* @__PURE__ */ s(`div`,{className:C,...f,...S,children:[y&&/* @__PURE__ */ o(`div`,{className:`descs-title`,children:y}),/* @__PURE__ */ o(`dl`,{className:`descs-list`,children:m.map((n,r)=>{let a=e(n.value),c=Math.min(12,Math.max(1,n.span??1)),l=n.key??`${n.label}-${r}`,u=a?`-`:n.value,{Tag:d,linkProps:f}=t(b,{href:n.href});return/* @__PURE__ */ s(`div`,{className:`descs-item${n.emphasis?` wui-descs-emphasis`:``} wui-descs-span-${c}`,children:[n.icon&&/* @__PURE__ */ o(`span`,{className:`wui-descs-icon`,children:i(n.icon,{size:16})}),/* @__PURE__ */ o(`dt`,{className:`descs-label`,children:n.label}),/* @__PURE__ */ o(`dd`,{className:`descs-value${a?` is-empty`:``}${n.multiline&&!a?` wui-pre-line`:``}`,children:n.href?/* @__PURE__ */ o(d,{className:`wui-descs-link`,...f,children:u}):u})]},l)})})]})}export{d as default};