@webority/ui-react 0.129.0 → 0.130.1

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 (139) hide show
  1. package/README.md +1 -1
  2. package/dist/canvas-kit/kit.js +8866 -8571
  3. package/dist/canvas-kit/manifest.json +722 -241
  4. package/dist/canvas-kit/release.json +6 -6
  5. package/dist/components/AppActionIcon.js +1 -1
  6. package/dist/components/AppAlert.js +1 -1
  7. package/dist/components/AppAsyncBlock.js +1 -1
  8. package/dist/components/AppAutocomplete.js +1 -1
  9. package/dist/components/AppAvatar.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/AppCard.js +1 -1
  14. package/dist/components/AppChart.js +1 -1
  15. package/dist/components/AppCheckbox.js +1 -1
  16. package/dist/components/AppChip.js +1 -1
  17. package/dist/components/AppColorField.js +1 -1
  18. package/dist/components/AppCommentThread.js +1 -1
  19. package/dist/components/AppConfirmDialog.js +1 -1
  20. package/dist/components/AppConfirmProvider.js +1 -1
  21. package/dist/components/AppConsentBanner.js +1 -1
  22. package/dist/components/AppContextMenu.js +1 -1
  23. package/dist/components/AppCopyButton.js +1 -1
  24. package/dist/components/AppCountrySelect.js +1 -1
  25. package/dist/components/AppDatePicker.js +1 -1
  26. package/dist/components/AppDateRangePicker.js +1 -1
  27. package/dist/components/AppDropZone.js +1 -1
  28. package/dist/components/AppDropdown.js +1 -1
  29. package/dist/components/AppEmptyState.js +1 -1
  30. package/dist/components/AppFilePicker.js +1 -1
  31. package/dist/components/AppFilterBar.js +1 -1
  32. package/dist/components/AppFloatingButton.js +1 -1
  33. package/dist/components/AppImagePicker.js +1 -1
  34. package/dist/components/AppInfoTip.js +1 -1
  35. package/dist/components/AppInput.js +1 -1
  36. package/dist/components/AppKpiTile.js +1 -1
  37. package/dist/components/AppLeadPopup.js +1 -1
  38. package/dist/components/AppMentionInput.js +1 -1
  39. package/dist/components/AppMeter.js +1 -1
  40. package/dist/components/AppMetricStrip.js +1 -1
  41. package/dist/components/AppModal.js +1 -1
  42. package/dist/components/AppMultiSelect.js +1 -1
  43. package/dist/components/AppNavList.js +1 -1
  44. package/dist/components/AppNumberInput.js +1 -1
  45. package/dist/components/AppOnboardingChecklist.js +1 -1
  46. package/dist/components/AppOtpInput.js +1 -1
  47. package/dist/components/AppPageHeader.js +1 -1
  48. package/dist/components/AppPhoneNumberInput.js +1 -1
  49. package/dist/components/AppPopover.js +1 -1
  50. package/dist/components/AppProgress.js +1 -1
  51. package/dist/components/AppRadio.js +1 -1
  52. package/dist/components/AppRadioGroup.js +1 -1
  53. package/dist/components/AppRating.js +1 -1
  54. package/dist/components/AppRepeater.js +1 -1
  55. package/dist/components/AppResourceCard.js +1 -1
  56. package/dist/components/AppRichText.js +1 -1
  57. package/dist/components/AppRouteError.js +1 -1
  58. package/dist/components/AppScoreScale.js +1 -1
  59. package/dist/components/AppSectionHero.js +1 -1
  60. package/dist/components/AppSectionLeadCapture.js +1 -1
  61. package/dist/components/AppSelect.js +1 -1
  62. package/dist/components/AppShell.js +1 -1
  63. package/dist/components/AppSlider.js +1 -1
  64. package/dist/components/AppSplash.js +1 -1
  65. package/dist/components/AppSplitButton.js +1 -1
  66. package/dist/components/AppStatusBadge.js +1 -1
  67. package/dist/components/AppStepper.js +1 -1
  68. package/dist/components/AppSwitch.js +1 -1
  69. package/dist/components/AppTabs.js +1 -1
  70. package/dist/components/AppTagInput.js +1 -1
  71. package/dist/components/AppTextarea.js +1 -1
  72. package/dist/components/AppTimePicker.js +1 -1
  73. package/dist/components/AppTimeline.js +1 -1
  74. package/dist/components/AppToolbar.js +1 -1
  75. package/dist/components/AppTooltip.js +1 -1
  76. package/dist/components/AppUpdateBar.js +1 -1
  77. package/dist/components/AppWizard.js +1 -1
  78. package/dist/guidance.json +39 -46
  79. package/dist/lib/DiscardPrompt.js +1 -1
  80. package/dist/lib/buttonClass.js +1 -0
  81. package/dist/lib/sectionShell.js +1 -1
  82. package/dist/lib/vocabulary.js +1 -0
  83. package/dist/types/components/AppActionIcon.d.ts +3 -12
  84. package/dist/types/components/AppAutocomplete.d.ts +1 -1
  85. package/dist/types/components/AppBanner.d.ts +2 -2
  86. package/dist/types/components/AppButton.d.ts +9 -5
  87. package/dist/types/components/AppCard.d.ts +3 -3
  88. package/dist/types/components/AppChart.d.ts +7 -0
  89. package/dist/types/components/AppCheckbox.d.ts +1 -1
  90. package/dist/types/components/AppColorField.d.ts +2 -2
  91. package/dist/types/components/AppConfirmDialog.d.ts +6 -12
  92. package/dist/types/components/AppConfirmProvider.d.ts +5 -6
  93. package/dist/types/components/AppConsentBanner.d.ts +3 -3
  94. package/dist/types/components/AppContextMenu.d.ts +2 -2
  95. package/dist/types/components/AppCopyButton.d.ts +8 -2
  96. package/dist/types/components/AppCountrySelect.d.ts +1 -1
  97. package/dist/types/components/AppDatePicker.d.ts +2 -2
  98. package/dist/types/components/AppDateRangePicker.d.ts +1 -1
  99. package/dist/types/components/AppDropZone.d.ts +2 -2
  100. package/dist/types/components/AppDropdown.d.ts +7 -7
  101. package/dist/types/components/AppEmptyState.d.ts +3 -3
  102. package/dist/types/components/AppFilePicker.d.ts +5 -5
  103. package/dist/types/components/AppFloatingButton.d.ts +10 -4
  104. package/dist/types/components/AppImagePicker.d.ts +4 -4
  105. package/dist/types/components/AppInput.d.ts +1 -1
  106. package/dist/types/components/AppLeadPopup.d.ts +1 -1
  107. package/dist/types/components/AppMentionInput.d.ts +1 -1
  108. package/dist/types/components/AppModal.d.ts +3 -3
  109. package/dist/types/components/AppMultiSelect.d.ts +2 -2
  110. package/dist/types/components/AppNumberInput.d.ts +1 -1
  111. package/dist/types/components/AppOnboardingChecklist.d.ts +3 -3
  112. package/dist/types/components/AppOtpInput.d.ts +2 -2
  113. package/dist/types/components/AppPhoneNumberInput.d.ts +1 -1
  114. package/dist/types/components/AppPopover.d.ts +5 -5
  115. package/dist/types/components/AppRadio.d.ts +1 -1
  116. package/dist/types/components/AppRadioGroup.d.ts +2 -2
  117. package/dist/types/components/AppRating.d.ts +3 -3
  118. package/dist/types/components/AppRepeater.d.ts +3 -3
  119. package/dist/types/components/AppResourceCard.d.ts +2 -2
  120. package/dist/types/components/AppRichText.d.ts +3 -3
  121. package/dist/types/components/AppScoreScale.d.ts +3 -3
  122. package/dist/types/components/AppSectionLeadCapture.d.ts +2 -2
  123. package/dist/types/components/AppSelect.d.ts +1 -1
  124. package/dist/types/components/AppShell.d.ts +4 -4
  125. package/dist/types/components/AppSlider.d.ts +1 -1
  126. package/dist/types/components/AppSplash.d.ts +2 -2
  127. package/dist/types/components/AppSplitButton.d.ts +10 -4
  128. package/dist/types/components/AppSwitch.d.ts +2 -2
  129. package/dist/types/components/AppTagInput.d.ts +2 -2
  130. package/dist/types/components/AppTextarea.d.ts +1 -1
  131. package/dist/types/components/AppTimePicker.d.ts +2 -2
  132. package/dist/types/components/AppToolbar.d.ts +3 -3
  133. package/dist/types/components/AppTooltip.d.ts +7 -4
  134. package/dist/types/components/AppUpdateBar.d.ts +4 -4
  135. package/dist/types/lib/buttonClass.d.ts +9 -0
  136. package/dist/types/lib/sectionShell.d.ts +0 -1
  137. package/dist/types/lib/vocabulary.d.ts +3 -0
  138. package/dist/web-core/dist/query/listQuery.js +1 -0
  139. package/package.json +7 -6
@@ -1,21 +1,21 @@
1
1
  {
2
2
  "name": "webority-web",
3
- "version": "0.129.0",
3
+ "version": "0.130.1",
4
4
  "platform": "Web",
5
5
  "kitModuleVersion": 2,
6
6
  "rendererProtocolVersion": 13,
7
7
  "library": {
8
8
  "name": "@webority/ui-react",
9
- "version": "0.129.0"
9
+ "version": "0.130.1"
10
10
  },
11
11
  "files": {
12
12
  "manifest.json": {
13
- "sha256": "17d3dbd2808e2a61dd0bebd86a17a72109ac9601be1708f9fb95753cc8e87267",
14
- "bytes": 970294
13
+ "sha256": "7513d833d4963db180ab81cea0729a384917d5b05475c81d39c6b6be3bde9e04",
14
+ "bytes": 980888
15
15
  },
16
16
  "kit.js": {
17
- "sha256": "800fdaf4b5f6d8af24abc65207b371945dec23911750bb256b670003bc454b94",
18
- "bytes": 11132389
17
+ "sha256": "576194efd199342cdcd419bf44ac45b5314a3fa311e8d258eb37818ffa42aab3",
18
+ "bytes": 11139931
19
19
  },
20
20
  "kit.css": {
21
21
  "sha256": "13b14f71fb6ea024945f95cba617b4f1d49f44a65ba7c7ed05d2354805539ef6",
@@ -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`];function p(p){let{marker:m,props:h}=n(`AppActionIcon`,p),{icon:g,iconVariant:_,label:v,tooltipPlacement:y=`auto`,shortcut:b,danger:x=!1,density:S=`comfortable`,neutral:C=!1,disabled:w=!1,size:T=20,onClick:E,className:D=``,as:O,href:k,accept:A,multiple:j=!1,onFiles:M,...N}=h,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`,_,d),i(`AppActionIcon`,`density`,S,f),x&&C&&e(`AppActionIcon: danger and neutral are exclusive; danger wins.`);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`,x?`danger`:``,C&&!x?`neutral`:``,D].filter(Boolean).join(` `),{style:B,...V}=N,H={"--wui-action-size":`${F+(S===`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":v,"aria-keyshortcuts":t(b),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())},...m,...V,children:r(g,{size:F,variant:_})}),K=o(G,v,y,b);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{p 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"./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 +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{Alert as i}from"react-bootstrap";import{Fragment as a,jsx as o,jsxs as s}from"react/jsx-runtime";var c={info:`info`,success:`check`,warning:`alert-triangle`,danger:`x`},l=[`info`,`success`,`warning`,`danger`,`neutral`],u=[`sm`,`md`,`lg`],d=[`alert`,`status`,`none`],f=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`];function p(e,n,r,i,a,s){return i?/* @__PURE__ */ o(`span`,{className:`alert-icon alert-icon-image`,style:s>0?{width:s,height:s}:void 0,children:/* @__PURE__ */ o(`img`,{src:i,alt:a})}):e?typeof e==`string`?/* @__PURE__ */ o(`span`,{className:`alert-icon`,children:/* @__PURE__ */ o(t,{name:e,size:n,variant:r})}):/* @__PURE__ */ o(`span`,{className:`alert-icon`,children:e}):null}function m(t){let{marker:m,props:h}=e(`AppAlert`,t),{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;r(`AppAlert`,N),n(`AppAlert`,`tone`,g,l),n(`AppAlert`,`size`,A,u),n(`AppAlert`,`role`,M,d),n(`AppAlert`,`iconVariant`,b,f);let P=y===void 0?c[g]:y===`none`?null:y,F=!!S||!!P,I=j!=null&&j!==!1,L=v?/* @__PURE__ */ o(`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__ */ o(i,{className:B||void 0,onClose:E,dismissible:D??typeof E==`function`,transition:!1,role:M===`none`?void 0:M,...m,...N,variant:g,children:F||I?/* @__PURE__ */ s(a,{children:[F&&p(P,z,b,S,C,w),/* @__PURE__ */ s(`div`,{className:`alert-content`,children:[L,_]}),I&&/* @__PURE__ */ o(`div`,{className:`alert-action`,children:j})]}):/* @__PURE__ */ s(a,{children:[L,_]})})}export{m 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"./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 +1 @@
1
- import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./AppButton.js";import n from"./AppEmptyState.js";import r from"./AppProgress.js";import i from"./warnUnknownProps.js";import{jsx as a}from"react/jsx-runtime";function o(o){let{marker:s,props:c}=e(`AppAsyncBlock`,o),{loading:l=!1,error:u=null,empty:d=!1,children:f,onRetry:p,skeleton:m,className:h=``,loadingLabel:g=`Loading`,errorTitle:_=`Something went wrong`,retryLabel:v=`Retry`,emptyTitle:y=`Nothing to show yet`,...b}=c;i(`AppAsyncBlock`,b);let x=`async-block${h?` ${h}`:``}`;return l?/* @__PURE__ */ a(`div`,{className:x,"data-state":`loading`,...s,...b,children:m??/* @__PURE__ */ a(r,{value:0,indeterminate:!0,size:`sm`,label:g})}):u?/* @__PURE__ */ a(`div`,{className:x,"data-state":`error`,...s,...b,children:/* @__PURE__ */ a(n,{icon:`alert-circle`,title:_,text:u,action:p?/* @__PURE__ */ a(t,{variant:`secondary`,onClick:p,children:v}):null})}):d?/* @__PURE__ */ a(`div`,{className:x,"data-state":`empty`,...s,...b,children:/* @__PURE__ */ a(n,{icon:`inbox`,title:y})}):/* @__PURE__ */ a(`div`,{className:x,"data-state":`content`,...s,...b,children:f})}export{o as default};
1
+ import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./AppButton.js";import n from"./AppEmptyState.js";import r from"./AppProgress.js";import i from"./warnUnknownProps.js";import{jsx as a}from"react/jsx-runtime";function o(o){let{marker:s,props:c}=e(`AppAsyncBlock`,o),{loading:l=!1,error:u=null,empty:d=!1,children:f,onRetry:p,skeleton:m,className:h=``,loadingLabel:g=`Loading`,errorTitle:_=`Something went wrong`,retryLabel:v=`Retry`,emptyTitle:y=`Nothing to show yet`,...b}=c;i(`AppAsyncBlock`,b);let x=`async-block${h?` ${h}`:``}`;return l?/* @__PURE__ */ a(`div`,{className:x,"data-state":`loading`,...s,...b,children:m??/* @__PURE__ */ a(r,{value:0,indeterminate:!0,size:`sm`,label:g})}):u?/* @__PURE__ */ a(`div`,{className:x,"data-state":`error`,...s,...b,children:/* @__PURE__ */ a(n,{icon:`alert-circle`,title:_,description:u,action:p?/* @__PURE__ */ a(t,{variant:`soft`,onClick:p,children:v}):null})}):d?/* @__PURE__ */ a(`div`,{className:x,"data-state":`empty`,...s,...b,children:/* @__PURE__ */ a(n,{icon:`inbox`,title:y})}):/* @__PURE__ */ a(`div`,{className:x,"data-state":`content`,...s,...b,children:f})}export{o as default};
@@ -1 +1 @@
1
- import e from"../lib/FieldMessage.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./AppInfoTip.js";import r from"./AppRequiredMark.js";import i from"./useNodeLabels.js";import a,{optionsEqual as o}from"./useWuiControl.js";import s from"./warnInvalidValue.js";import ee from"./warnUnknownProps.js";import{forwardRef as c,useEffect as l,useId as u,useLayoutEffect as d,useRef as f}from"react";import{jsx as p,jsxs as m}from"react/jsx-runtime";import"@webority/ui-elements/elements/autocomplete";var h=[`sm`,`md`,`lg`],te=[],ne=(e,t)=>({...e,label:t}),g=(e,t,n)=>{if(n==null||t==null||t===``)return e;let r=String(t);return e.some(e=>String(e.value)===r)?e:[...e,{value:r,label:n}]},_=c(function(c,_){let{marker:v,props:y}=t(`AppAutocomplete`,c),{value:b,defaultValue:x,onChange:S,options:C,valueLabel:w,valueAvatar:T,valueInitials:E,loadOptions:D,placeholder:re=`Search…`,minChars:O,debounce:k,disabled:ie=!1,readOnly:ae=!1,loading:A=!1,open:j,size:M,allowCustom:N=!1,name:P,id:F,label:I,error:L,hint:R,required:z=!1,optional:B=!1,optionalLabel:V=`(optional)`,help:H,helpLabel:U=`More information`,fieldClassName:W=``,...G}=y;ee(`AppAutocomplete`,G),s(`AppAutocomplete`,`size`,M,h);let K=typeof D==`function`,q=u(),J=F||q,{setRef:oe,innerRef:Y}=a({ref:_,value:b??(x===void 0?``:void 0),defaultValue:x,on:{change:e=>S?.(e.currentTarget.value,{isCustom:!!e.detail?.isCustom})}}),X=C||te,{portal:se,toElementOptions:Z}=i(X),Q=f(!1),$=f(D);return d(()=>{$.current=D}),l(()=>{let e=Y.current;if(!e||K&&Q.current)return;let t=Z(g(X,b,w),ne);o(t,e.options)||(e.options=t)},[X,K,Y,Z,b,w]),l(()=>{let e=Y.current;if(!e||!K||!Q.current)return;let t=e.options,n=g(t,b,w);n!==t&&(e.options=n)},[b,w,K,Y]),l(()=>{let e=Y.current;if(!e||!K)return;let t=0,n=null,r=async r=>{let i=++t;n?.abort(),n=typeof AbortController==`function`?new AbortController:null,e.loading=!0;try{let a=await $.current(r.detail.query,{signal:n?.signal});i===t&&(Q.current=!0,e.options=a||[])}catch{i===t&&(Q.current=!0,e.options=[])}finally{i===t&&(e.loading=!1)}};return e.addEventListener(`search`,r),()=>{t=-1,n?.abort(),e.removeEventListener(`search`,r),e.loading=!1}},[K,Y]),d(()=>{Y.current?.toggleAttribute(`loading`,!!A)}),/* @__PURE__ */ m(`div`,{...v,className:`field${W?` ${W}`:``}`,children:[I&&/* @__PURE__ */ m(`label`,{className:`label`,htmlFor:J,children:[I,B&&!z&&/* @__PURE__ */ p(`span`,{className:`label-optional`,children:` ${V}`}),z&&/* @__PURE__ */ p(r,{}),H&&/* @__PURE__ */ p(n,{label:U,children:H})]}),/* @__PURE__ */ p(`wui-autocomplete`,{"aria-label":typeof I==`string`?I:void 0,"aria-describedby":L?`${J}-error`:R?`${J}-hint`:void 0,"aria-invalid":L?`true`:void 0,id:J,ref:oe,name:P,placeholder:re,remote:K?``:void 0,"min-chars":O==null?void 0:String(O),debounce:k==null?void 0:String(k),size:M===`md`?void 0:M||void 0,"allow-custom":N?``:void 0,disabled:ie?``:void 0,readonly:ae?``:void 0,open:j?``:void 0,required:z?``:void 0,"value-avatar":T||void 0,"value-initials":E||void 0,...G}),se,/* @__PURE__ */ p(e,{error:L,hint:R,errorId:`${J}-error`,hintId:`${J}-hint`})]})});export{_ 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"./useNodeLabels.js";import a,{optionsEqual as o}from"./useWuiControl.js";import s from"./warnInvalidValue.js";import ee from"./warnUnknownProps.js";import{forwardRef as c,useEffect as l,useId as u,useLayoutEffect as d,useRef as f}from"react";import{jsx as p,jsxs as m}from"react/jsx-runtime";import"@webority/ui-elements/elements/autocomplete";var h=[`sm`,`md`,`lg`],te=[],ne=(e,t)=>({...e,label:t}),g=(e,t,n)=>{if(n==null||t==null||t===``)return e;let r=String(t);return e.some(e=>String(e.value)===r)?e:[...e,{value:r,label:n}]},_=c(function(c,_){let{marker:v,props:y}=t(`AppAutocomplete`,c),{value:b,defaultValue:x,onChange:S,options:C,valueLabel:w,valueAvatar:T,valueInitials:E,loadOptions:D,placeholder:re=`Search…`,minChars:O,debounce:k,disabled:ie=!1,readOnly:ae=!1,loading:A=!1,open:j,size:M,allowCustom:N=!1,name:P,id:F,label:I,error:L,helperText:R,required:z=!1,optional:B=!1,optionalLabel:V=`(optional)`,help:H,helpLabel:U=`More information`,fieldClassName:W=``,...G}=y;ee(`AppAutocomplete`,G),s(`AppAutocomplete`,`size`,M,h);let K=typeof D==`function`,q=u(),J=F||q,{setRef:oe,innerRef:Y}=a({ref:_,value:b??(x===void 0?``:void 0),defaultValue:x,on:{change:e=>S?.(e.currentTarget.value,{isCustom:!!e.detail?.isCustom})}}),X=C||te,{portal:se,toElementOptions:Z}=i(X),Q=f(!1),$=f(D);return d(()=>{$.current=D}),l(()=>{let e=Y.current;if(!e||K&&Q.current)return;let t=Z(g(X,b,w),ne);o(t,e.options)||(e.options=t)},[X,K,Y,Z,b,w]),l(()=>{let e=Y.current;if(!e||!K||!Q.current)return;let t=e.options,n=g(t,b,w);n!==t&&(e.options=n)},[b,w,K,Y]),l(()=>{let e=Y.current;if(!e||!K)return;let t=0,n=null,r=async r=>{let i=++t;n?.abort(),n=typeof AbortController==`function`?new AbortController:null,e.loading=!0;try{let a=await $.current(r.detail.query,{signal:n?.signal});i===t&&(Q.current=!0,e.options=a||[])}catch{i===t&&(Q.current=!0,e.options=[])}finally{i===t&&(e.loading=!1)}};return e.addEventListener(`search`,r),()=>{t=-1,n?.abort(),e.removeEventListener(`search`,r),e.loading=!1}},[K,Y]),d(()=>{Y.current?.toggleAttribute(`loading`,!!A)}),/* @__PURE__ */ m(`div`,{...v,className:`field${W?` ${W}`:``}`,children:[I&&/* @__PURE__ */ m(`label`,{className:`label`,htmlFor:J,children:[I,B&&!z&&/* @__PURE__ */ p(`span`,{className:`label-optional`,children:` ${V}`}),z&&/* @__PURE__ */ p(r,{}),H&&/* @__PURE__ */ p(n,{label:U,children:H})]}),/* @__PURE__ */ p(`wui-autocomplete`,{"aria-label":typeof I==`string`?I:void 0,"aria-describedby":L?`${J}-error`:R?`${J}-hint`:void 0,"aria-invalid":L?`true`:void 0,id:J,ref:oe,name:P,placeholder:re,remote:K?``:void 0,"min-chars":O==null?void 0:String(O),debounce:k==null?void 0:String(k),size:M===`md`?void 0:M||void 0,"allow-custom":N?``:void 0,disabled:ie?``:void 0,readonly:ae?``:void 0,open:j?``:void 0,required:z?``:void 0,"value-avatar":T||void 0,"value-initials":E||void 0,...G}),se,/* @__PURE__ */ p(e,{error:L,hint:R,errorId:`${J}-error`,hintId:`${J}-hint`})]})});export{_ as default};
@@ -1 +1 @@
1
- import{initialsOf as e}from"../lib/initials.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./renderIconProp.js";import r from"./warnInvalidValue.js";import i from"./warnUnknownProps.js";import a from"./withTooltip.js";import{useEffect as o,useState as s}from"react";import{Fragment as c,jsx as l,jsxs as u}from"react/jsx-runtime";var d=[`circle`,`rounded`,`square`],f=[`primary`,`neutral`,`success`,`warning`,`danger`,`info`,`auto`],p=[`none`,`online`,`offline`,`away`,`busy`],m=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`],h=/* @__PURE__ */ new Set([`xs`,`sm`,`md`,`lg`,`xl`,`2xl`]),g={xs:20,sm:24,md:32,lg:48,xl:64,"2xl":96};function _(t){return e(t)||`?`}function v(e){let t=e||``,n=0;for(let e=0;e<t.length;e+=1)n=Math.imul(n,31)+t.charCodeAt(e)>>>0;return n%360}function y(e){if(typeof e==`number`)return e;if(g[e]!=null)return g[e];let t=Number.parseInt(e,10);return Number.isNaN(t)?32:t}function b(e){let{marker:g,props:b}=t(`AppAvatar`,e),{name:x,src:S,size:C=`md`,shape:w=`circle`,tone:T=`primary`,status:E=`none`,ring:D=!1,label:O,icon:k,iconVariant:A,badge:j,href:M,onClick:N,linkComponent:P,tooltip:F,tooltipPlacement:I,className:L=``,photoLabel:R=`Profile photo`,...z}=b;i(`AppAvatar`,z),r(`AppAvatar`,`shape`,w,d),r(`AppAvatar`,`tone`,T,f),r(`AppAvatar`,`status`,E,p),r(`AppAvatar`,`iconVariant`,A,m);let{style:B,...V}=z,[H,U]=s(!1);o(()=>{U(!1)},[S]);let W=typeof C==`string`&&h.has(C),G=W?null:typeof C==`number`||/^\d+$/.test(C)?`${C}px`:C,K=M!=null||N!=null,q=S!=null&&S!==``&&!H,J=[`avatar`,W&&C!==`md`?`avatar-${C}`:``,w===`circle`?``:`avatar-${w}`,T===`primary`?``:`avatar-${T}`,D?`avatar-ring`:``,K?`avatar-clickable`:``,L].filter(Boolean).join(` `),Y={};G&&(Y[`--avatar-size`]=G),T===`auto`&&(Y[`--avatar-hue`]=v(x));let X=Object.keys(Y).length||B?{...Y,...B}:void 0,Z=/* @__PURE__ */ l(`span`,{className:`avatar-face`,"aria-hidden":`true`,children:k!=null&&k!==!1&&k!==``?n(k,{size:Math.round(y(C)*.55),variant:A}):_(x)}),ee=/* @__PURE__ */ u(c,{children:[E!==`none`&&/* @__PURE__ */ l(`span`,{className:`avatar-status avatar-status-${E}`,"aria-hidden":`true`}),j!=null&&/* @__PURE__ */ l(`span`,{className:`avatar-badge`,children:j}),O!=null&&/* @__PURE__ */ l(`span`,{className:`avatar-label`,"aria-hidden":`true`,children:O})]}),Q=/* @__PURE__ */ u(c,{children:[Z,q&&/* @__PURE__ */ l(`img`,{className:`avatar-img`,src:S,alt:K?``:x||R,onError:()=>U(!0)}),ee]});if(M!=null){let e=P||`a`,t=P?{to:M}:{href:M};return a(/* @__PURE__ */ l(e,{className:J,style:X,...g,...V,"aria-label":O||x,...t,onClick:N,children:Q}),F,I)}if(N!=null)return a(/* @__PURE__ */ l(`button`,{type:`button`,className:J,style:X,...g,...V,"aria-label":O||x,onClick:N,children:Q}),F,I);if(q)return a(/* @__PURE__ */ l(`span`,{className:J,style:X,...g,...V,children:Q}),F,I);let $=O?.trim()||x?.trim();return a($?/* @__PURE__ */ l(`span`,{className:J,style:X,...g,...V,role:`img`,"aria-label":$,children:Q}):/* @__PURE__ */ l(`span`,{className:J,style:X,...g,...V,"aria-hidden":`true`,children:Q}),F,I)}export{b 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"./renderIconProp.js";import i from"./warnInvalidValue.js";import a from"./warnUnknownProps.js";import o from"./withTooltip.js";import{useEffect as ee,useState as s}from"react";import{Fragment as c,jsx as l,jsxs as u}from"react/jsx-runtime";var d=[`circle`,`rounded`,`square`],f=[...t,`auto`],p=[`none`,`online`,`offline`,`away`,`busy`],m=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`],h=/* @__PURE__ */ new Set([`xs`,`sm`,`md`,`lg`,`xl`,`2xl`]),g={xs:20,sm:24,md:32,lg:48,xl:64,"2xl":96};function _(t){return e(t)||`?`}function v(e){let t=e||``,n=0;for(let e=0;e<t.length;e+=1)n=Math.imul(n,31)+t.charCodeAt(e)>>>0;return n%360}function y(e){if(typeof e==`number`)return e;if(g[e]!=null)return g[e];let t=Number.parseInt(e,10);return Number.isNaN(t)?32:t}function b(e){let{marker:t,props:g}=n(`AppAvatar`,e),{name:b,src:x,size:S=`md`,shape:C=`circle`,tone:w=`primary`,status:T=`none`,ring:E=!1,label:D,icon:O,iconVariant:k,badge:A,href:j,onClick:M,linkComponent:N,tooltip:P,tooltipPlacement:F,className:I=``,photoLabel:L=`Profile photo`,...R}=g;a(`AppAvatar`,R),i(`AppAvatar`,`shape`,C,d),i(`AppAvatar`,`tone`,w,f),i(`AppAvatar`,`status`,T,p),i(`AppAvatar`,`iconVariant`,k,m);let{style:z,...B}=R,[V,H]=s(!1);ee(()=>{H(!1)},[x]);let U=typeof S==`string`&&h.has(S),W=U?null:typeof S==`number`||/^\d+$/.test(S)?`${S}px`:S,G=j!=null||M!=null,K=x!=null&&x!==``&&!V,q=[`avatar`,U&&S!==`md`?`avatar-${S}`:``,C===`circle`?``:`avatar-${C}`,w===`primary`?``:`avatar-${w}`,E?`avatar-ring`:``,G?`avatar-clickable`:``,I].filter(Boolean).join(` `),J={};W&&(J[`--avatar-size`]=W),w===`auto`&&(J[`--avatar-hue`]=v(b));let Y=Object.keys(J).length||z?{...J,...z}:void 0,X=/* @__PURE__ */ l(`span`,{className:`avatar-face`,"aria-hidden":`true`,children:O!=null&&O!==!1&&O!==``?r(O,{size:Math.round(y(S)*.55),variant:k}):_(b)}),Z=/* @__PURE__ */ u(c,{children:[T!==`none`&&/* @__PURE__ */ l(`span`,{className:`avatar-status avatar-status-${T}`,"aria-hidden":`true`}),A!=null&&/* @__PURE__ */ l(`span`,{className:`avatar-badge`,children:A}),D!=null&&/* @__PURE__ */ l(`span`,{className:`avatar-label`,"aria-hidden":`true`,children:D})]}),Q=/* @__PURE__ */ u(c,{children:[X,K&&/* @__PURE__ */ l(`img`,{className:`avatar-img`,src:x,alt:G?``:b||L,onError:()=>H(!0)}),Z]});if(j!=null){let e=N||`a`,n=N?{to:j}:{href:j};return o(/* @__PURE__ */ l(e,{className:q,style:Y,...t,...B,"aria-label":D||b,...n,onClick:M,children:Q}),P,F)}if(M!=null)return o(/* @__PURE__ */ l(`button`,{type:`button`,className:q,style:Y,...t,...B,"aria-label":D||b,onClick:M,children:Q}),P,F);if(K)return o(/* @__PURE__ */ l(`span`,{className:q,style:Y,...t,...B,children:Q}),P,F);let $=D?.trim()||b?.trim();return o($?/* @__PURE__ */ l(`span`,{className:q,style:Y,...t,...B,role:`img`,"aria-label":$,children:Q}):/* @__PURE__ */ l(`span`,{className:q,style:Y,...t,...B,"aria-hidden":`true`,children:Q}),P,F)}export{b as default};
@@ -1 +1 @@
1
- import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"./withTooltip.js";import{Badge as i}from"react-bootstrap";import{jsx as a}from"react/jsx-runtime";var o=[`neutral`,`primary`,`success`,`warning`,`danger`,`info`];function s(s){let{marker:c,props:l}=e(`AppBadge`,s),{children:u,tone:d,dot:f=!1,tooltip:p,tooltipPlacement:m,className:h=``,...g}=l;n(`AppBadge`,g),t(`AppBadge`,`tone`,d,o);let _=[d&&d!==`neutral`?`badge-${d}`:``,f?`badge-dot`:``,h].filter(Boolean).join(` `);return r(/* @__PURE__ */ a(i,{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"./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 +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,onDismiss: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"./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 +1 @@
1
- import{shortcutAria as e,shortcutChip as t}from"../lib/shortcutChip.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./AppIcon.js";import i from"./warnInvalidValue.js";import a from"./warnUnknownProps.js";import o from"./withTooltip.js";import{Button as s}from"react-bootstrap";import{jsx as c,jsxs as l}from"react/jsx-runtime";var u={primary:`primary`,secondary:`secondary`,outline:`outline-primary`,ghost:`ghost`,text:`text`,danger:`danger`,success:`success`,"secondary-danger":`secondary-danger`,"outline-danger":`outline-danger`,light:`light`,warning:`warning`,neutral:`neutral`,"outline-light":`outline-light`,"outline-secondary":`outline-secondary`},d=Object.keys(u);function f(e){return`btn-${u[e]??`primary`}`}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__ */ l(`span`,{className:`wui-btn-roll`,children:[/* @__PURE__ */ c(`span`,{className:`wui-btn-roll__a`,children:e}),/* @__PURE__ */ c(`span`,{className:`wui-btn-roll__b`,"aria-hidden":`true`,children:e})]})}function x(e,t,n,i){if(!e)return null;let a=n=>typeof e==`string`?/* @__PURE__ */ c(r,{name:e,size:p[t]??p.md,variant:i,className:n}):/* @__PURE__ */ c(`span`,{className:[`d-inline-flex`,n].filter(Boolean).join(` `),children:e});return/* @__PURE__ */ l(`span`,{className:n?`wui-btn-roll-ico wui-btn-pin-icon`:`wui-btn-roll-ico ms-2`,"aria-hidden":`true`,children:[a(),a(`wui-btn-roll-ico__next`)]})}function S(e,t,n,i){if(!e)return null;let a=t===`left`?`me-2`:`ms-2`;return typeof e==`string`?/* @__PURE__ */ c(r,{name:e,size:p[n]??p.md,variant:i,className:a}):/* @__PURE__ */ c(`span`,{className:`d-inline-flex ${a}`,children:e})}function C(e,t,n){return e?/* @__PURE__ */ c(`span`,{className:`wui-btn-pin-icon`,"aria-hidden":`true`,children:typeof e==`string`?/* @__PURE__ */ c(r,{name:e,size:p[t]??p.md,variant:n}):e}):null}function w(r){let{marker:d,props:f}=n(`AppButton`,r),{children:w,variant:T=`primary`,size:E=`md`,type:D=`button`,loading:O=!1,disabled:k=!1,block:A=!1,leftIcon:j=null,rightIcon:M=null,href:N,static:P=!1,tooltip:F,tooltipPlacement:I,shortcut:L,animation:R,pinRightIcon:z=!1,shape:B=`rounded`,iconVariant:V,className:H=``,onClick:U,vibrate:W,...G}=f;a(`AppButton`,G),i(`AppButton`,`vibrate`,W,_);let K=W===!0?10:Number.isInteger(W)&&W>=1&&W<=100?W:0;R!==void 0&&i(`AppButton`,`animation`,R,m);let q=R===`roll`&&!P,J=z&&M!=null&&M!==``&&!P&&!O;if(i(`AppButton`,`variant`,T,Object.keys(u)),i(`AppButton`,`size`,E,Object.keys(p)),i(`AppButton`,`shape`,B,h),i(`AppButton`,`type`,D,g),V!==void 0&&i(`AppButton`,`iconVariant`,V,v),P){let e=[`btn`,`btn-${u[T]??`primary`}`,E===`sm`?`btn-sm`:E===`lg`?`btn-lg`:``,A?`w-100`:``,y(B),`btn-static`,H].filter(Boolean).join(` `);return o(/* @__PURE__ */ l(`span`,{className:e,...d,...G,children:[S(j,`left`,E,V),w,S(M,`right`,E,V)]}),F,I)}let Y=[A?`w-100`:``,O?`is-loading`:``,R&&m.includes(R)?`btn-anim-${R}`:``,J?`wui-btn-pin-end`:``,y(B),H].filter(Boolean).join(` `),X=(G.as===void 0||G.as===`button`)&&N===void 0&&G.to===void 0,Z=X?{}:{role:void 0,tabIndex:k||O?-1:void 0},Q=F!=null&&F!==``,$=K?e=>{!k&&!O&&navigator.vibrate?.(K),U?.(e)}:U;return o(/* @__PURE__ */ l(s,{type:X?D:void 0,href:N,variant:u[T]??`primary`,size:E===`md`?void 0:E,disabled:k||O,"aria-busy":O||void 0,"aria-keyshortcuts":e(L),"data-wui-vibrate":K||void 0,className:Y||void 0,onClick:$,...Z,...d,...G,children:[O&&/* @__PURE__ */ c(`span`,{className:`spinner-border spinner-border-sm me-2`,"aria-hidden":`true`}),!O&&S(j,`left`,E,V),q?b(w):w,!O&&(q?x(M,E,J,V):J?C(M,E,V):S(M,`right`,E,V)),!Q&&t(L)]}),F,I,L)}export{d as BUTTON_VARIANTS,f as buttonVariantClass,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"./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 +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 ee=[`default`,`elevated`,`outlined`,`muted`,`accent`],l=[`primary`,`success`,`warning`,`danger`,`info`],u=[`none`,`sm`,`md`,`lg`],d=[`sans`,`serif`],f={xs:320,sm:420,md:560,lg:720};function p(p){let{marker:m,props:h}=e(`AppCard`,p),{title:g,subtitle:_,headerIcon:v,titleClassName:y=``,titleFont:b=`sans`,header:x,headerExtra:S,headerActions:C,footer:w,media:T,children:E,variant:D=`default`,tone:O=`primary`,padding:k=`md`,maxWidth:A,className:te=``,bodyClassName:ne=``,headerClassName:re=``,body:j=!0,lifted:M=!1,flush:N=!1,divided:P=!1,href:F,onClick:I,linkComponent:L,onClose:R,dismissible:z,closeLabel:B=`Close`,...V}=h,[H,U]=i(!1);r(`AppCard`,V),n(`AppCard`,`variant`,D,ee),n(`AppCard`,`tone`,O,l),n(`AppCard`,`padding`,k,u),n(`AppCard`,`titleFont`,b,d);let{style:W,...G}=V,K=F!=null||I!=null,q=[D&&D!=="default"?`card-${D}`:``,D===`accent`&&O&&O!==`primary`?`tone-${O}`:``,k&&k!==`md`?`card-pad-${k}`:``,N?`card-flush`:``,P?`card-divided`:``,M?`card-lifted`:``,A==null?``:`card-constrained`,K?`card-clickable`:``,te].filter(Boolean).join(` `)||void 0,J=A==null?void 0:f[A]==null?typeof A==`number`?`${A}px`:A:`${f[A]}px`,Y=J?{"--card-max-width":J,...W}:W,X={};F==null?I!=null&&(X={role:`button`,tabIndex:0,onClick:I,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),I(e))}}):(X=L?{as:L,to:F}:{as:`a`,href:F},I&&(X.onClick=I));let Z=z??typeof R==`function`,ie=Z?/* @__PURE__ */ s(`button`,{type:`button`,className:`card-close`,"aria-label":B,onClick:e=>{e.preventDefault(),e.stopPropagation(),U(!0),R?.()},onKeyDown:e=>e.stopPropagation(),children:/* @__PURE__ */ s(t,{name:`x`,size:16})}):null,Q=g!=null||_!=null||v!=null,ae=x!=null||Q||S!=null||C!=null||Z,$=v==null?null:typeof v==`string`?/* @__PURE__ */ s(t,{name:v,size:18}):v;return H?null:/* @__PURE__ */ c(a,{className:q,style:Y,...m,...G,...X,children:[T!=null&&/* @__PURE__ */ s(`div`,{className:`card-media`,children:T}),ae&&/* @__PURE__ */ c(a.Header,{className:re||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})]}),ie]}),j?/* @__PURE__ */ s(a.Body,{className:ne||void 0,children:E}):E,w!=null&&/* @__PURE__ */ s(`div`,{className:`card-footer`,children:w})]})}export{p as default};
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 +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 ee}from"react";import{jsx as l}from"react/jsx-runtime";var te=`wui-chart:select`,u=`wui-chart:legend-change`,ne=`wui-chart:ready`,d=[`line`,`area`,`column`,`bar`,`donut`,`heatmap`,`calendar`,`funnel`,`gauge`,`waterfall`,`treemap`,`sankey`,`scatter`,`bubble`,`multiples`],f=[`none`,`stacked`,`percent`],p=[`ready`,`loading`,`empty`,`error`],m=[`auto`,`svg`,`canvas`],h=[`chart`,`table`],re=`This chart couldn't load. Try again in a moment.`,g=()=>{try{return process.env.NODE_ENV!==`production`}catch{return!0}},_=!1;function v(){!_&&g()&&(_=!0,e("[@webority/ui-react] <AppChart> has no `title`, which names the chart for assistive tech and its exported files."))}var y=e=>e===``?void 0:e,b=e=>Array.isArray(e)?e.map(b):e==null||Object.getPrototypeOf(e)!==Object.prototype?e:Object.fromEntries(Object.entries(e).filter(([,e])=>e!==``).map(([e,t])=>[e,b(t)])),x=e=>({type:y(e.type),title:y(e.title),description:y(e.description),data:e.data,x:b(e.x),series:b(e.series),group:b(e.group),to:b(e.to),size:b(e.size),trend:e.trend,zoom:e.zoom,bands:b(e.bands),stack:y(e.stack),y:b(e.y),target:b(e.target),centerLabel:y(e.centerLabel),height:e.height>0?e.height:void 0,state:y(e.state),emptyText:y(e.emptyText),errorText:y(e.errorText),loadingText:y(e.loadingText),renderer:y(e.renderer),timeZone:y(e.timeZone)}),ie=(e,t)=>t!=null&&Object.keys(e).every(n=>Object.is(e[n],t[n])),ae=e=>{try{return JSON.stringify(e)}catch{return null}},S=i(function(i,g){let{marker:_,props:y}=t(`AppChart`,i),{type:b,title:S,description:C,data:w,x:T,series:E,group:D,to:O,size:k,trend:A,zoom:j,bands:M,stack:N,y:P,target:F,centerLabel:I,height:L,state:R,emptyText:z,errorText:B,loadingText:V,renderer:H,timeZone:U,view:W,onSelect:G,onLegendChange:K,onReady:q,className:J=``,style:Y,...X}=y;r(`AppChart`,X),n(`AppChart`,`type`,b,d),n(`AppChart`,`stack`,N,f),n(`AppChart`,`state`,R,p),n(`AppChart`,`renderer`,H,m),n(`AppChart`,`view`,W,h),S||v();let Z=c(null),Q=c({props:null,signature:null}),$=c({onSelect:G,onLegendChange:K,onReady:q}),[oe,se]=ee(!1),ce=a(e=>{Z.current=e,typeof g==`function`?g(e):g&&(g.current=e)},[g]);return o(()=>{$.current={onSelect:G,onLegendChange:K,onReady:q}}),s(()=>{let e=Z.current;if(!e)return;let t={type:b,title:S,description:C,data:w,x:T,series:E,group:D,to:O,size:k,trend:A,zoom:j,bands:M,stack:N,y:P,target:F,centerLabel:I,height:L,state:R,emptyText:z,errorText:B,loadingText:V,renderer:H,timeZone:U};if(ie(t,Q.current.props))return;Q.current.props=t;let n=x(t),r=ae(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=[[te,t(`onSelect`)],[u,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&&se(!0)}),()=>{t=!1}},[]),oe?/* @__PURE__ */ l(`div`,{..._,className:J||void 0,style:Y,role:`status`,children:/* @__PURE__ */ l(`p`,{className:`wui-chart-state-text`,children:B||re})}):/* @__PURE__ */ l(`wui-chart`,{ref:ce,view:W||void 0,className:J||void 0,style:Y,..._,...X})});export{S as default};
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 _(){!g&&h()&&(g=!0,e("[@webority/ui-react] <AppChart> has no `title`, which names the chart for assistive tech and its exported files."))}var v=e=>e===``?void 0:e,y=e=>Array.isArray(e)?e.map(y):e==null||Object.getPrototypeOf(e)!==Object.prototype?e:Object.fromEntries(Object.entries(e).filter(([,e])=>e!==``).map(([e,t])=>[e,y(t)])),b=e=>({type:v(e.type),title:v(e.title),description:v(e.description),data:e.data,x:y(e.x),series:y(e.series),group:y(e.group),to:y(e.to),size:y(e.size),trend:e.trend,zoom:e.zoom,bands:y(e.bands),stack:v(e.stack),y:y(e.y),target:y(e.target),centerLabel:v(e.centerLabel),height:e.height>0?e.height:void 0,state:v(e.state),emptyText:v(e.emptyText),errorText:v(e.errorText),loadingText:v(e.loadingText),renderer:v(e.renderer),timeZone:v(e.timeZone)}),x=(e,t)=>t!=null&&Object.keys(e).every(n=>Object.is(e[n],t[n])),ae=e=>{try{return JSON.stringify(e)}catch{return null}},S=i(function(i,g){let{marker:v,props:y}=t(`AppChart`,i),{type:S,title:C,description:oe,data:se,x:ce,series:w,group:T,to:E,size:D,trend:O,zoom:k,bands:A,stack:j,y:M,target:N,centerLabel:P,height:F,state:I,loading:L,error:R,emptyText:le,errorText:z,loadingText:B,renderer:V,timeZone:H,view:U,onSelect:W,onLegendChange:G,onReady:K,className:q=``,style:J,...Y}=y;r(`AppChart`,Y),n(`AppChart`,`type`,S,re),n(`AppChart`,`stack`,j,d),n(`AppChart`,`state`,I,f),n(`AppChart`,`renderer`,V,p),n(`AppChart`,`view`,U,ie),C||_();let X=!!R;h()&&L&&X&&e("[@webority/ui-react] <AppChart> takes `loading` or `error`, not both; `error` is shown.");let ue=X?`error`:L?`loading`:I,de=X?R:z,Z=c(null),Q=c({props:null,signature:null}),$=c({onSelect:W,onLegendChange:G,onReady:K}),[fe,pe]=l(!1),me=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:S,title:C,description:oe,data:se,x:ce,series:w,group:T,to:E,size:D,trend:O,zoom:k,bands:A,stack:j,y:M,target:N,centerLabel:P,height:F,state:ue,emptyText:le,errorText:de,loadingText:B,renderer:V,timeZone:H};if(x(t,Q.current.props))return;Q.current.props=t;let n=b(t),r=ae(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&&pe(!0)}),()=>{t=!1}},[]),fe?/* @__PURE__ */ u(`div`,{...v,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:me,view:U||void 0,className:q||void 0,style:J,...v,...Y})});export{S 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,hint: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"./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 +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{Fragment as i,jsx as a,jsxs as o}from"react/jsx-runtime";var s=[`neutral`,`primary`,`success`,`warning`,`danger`,`info`],c=[`soft`,`outline`,`solid`],l=[`sm`,`md`];function u(u){let{marker:d,props:f}=e(`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;r(`AppChip`,T),n(`AppChip`,`tone`,h,s),n(`AppChip`,`variant`,g,c),n(`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__ */ a(`span`,{className:`chip-avatar`,children:typeof y==`string`?/* @__PURE__ */ a(`img`,{src:y,alt:``}):y}):v?/* @__PURE__ */ a(`span`,{className:`chip-ic`,children:/* @__PURE__ */ a(t,{name:v,size:_===`sm`?12:14})}):null,j=x?/* @__PURE__ */ o(`button`,{type:`button`,className:`chip-body`,...D,onClick:x,disabled:S,children:[A,/* @__PURE__ */ a(`span`,{className:`chip-label`,children:E})]}):/* @__PURE__ */ o(i,{children:[A,/* @__PURE__ */ a(`span`,{className:`chip-label`,children:E})]});return/* @__PURE__ */ o(`span`,{className:k,...d,...O,children:[j,b&&/* @__PURE__ */ a(`button`,{type:`button`,className:`chip-remove`,onClick:b,disabled:S,"aria-label":C||(typeof E==`string`?`Remove ${E}`:`Remove`),children:/* @__PURE__ */ a(t,{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"./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 +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,hint: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"./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 +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`:`primary`,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,{variant:`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"./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 +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`];function g(g){let{marker:_,props:v}=t(`AppConfirmDialog`,g),{open:y,title:b,variant:x=`default`,message:S,confirmLabel:C=`Confirm`,cancelLabel:w=`Cancel`,typePhraseLabel:T=`Type {phrase} to confirm`,danger:E=!1,tone:D,image:O,icon:k,iconSize:A,confirmPhrase:j,onConfirm:M,onClose:N,loading:P=!1,staticBackdrop:F=!1,placement:I=`center`,size:L=`md`,className:R=``,children:z,...B}=v;c(`AppConfirmDialog`,B),s(`AppConfirmDialog`,`tone`,D,Object.keys(o)),s(`AppConfirmDialog`,`size`,typeof L==`string`?L:null,m),s(`AppConfirmDialog`,`variant`,x,h);let[V,H]=u(``);if(l(()=>{y||H(``)},[y]),!y)return null;let U=!!j&&V.trim()!==j,[W,...G]=T.split(`{phrase}`),K=G.join(j),q=x===`plain`,J=q?`sm`:`md`,Y=q||O||k?null:o[D||(E?`delete`:`info`)],X=A>0?{"--wui-confirm-icon-size":`${A}px`}:void 0,Z=()=>{P||N?.()};return/* @__PURE__ */ f(a,{..._,...B,open:y,hideHeader:!0,title:b,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,{variant:q?`light`:`secondary`,size:J,disabled:P,onClick:Z,children:w}),/* @__PURE__ */ f(n,{variant:E?`danger`:`primary`,size:J,disabled:U,loading:P,onClick:M,children:C})]}),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:b}),S&&/* @__PURE__ */ f(`p`,{className:`wui-confirm-msg`,children:S}),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(T,{phrase:j}),disabled:P})]})})}export{g 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{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=!1,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,{...q?{tone:`neutral`}:{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 e from"./AppConfirmDialog.js";import{createContext as t,useCallback as n,useContext as r,useEffect as i,useRef as a,useState as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";var l=t(null);function u(t){let{children:r}=t,[u,d]=o(null),[f,p]=o(!1),m=a(null),h=n((e={})=>new Promise(t=>{m.current?.(!1),m.current=t,d({...e,title:e.title||`Are you sure?`})}),[]),g=e=>{m.current?.(e),m.current=null,p(!1),d(null)};return i(()=>()=>m.current?.(!1),[]),/* @__PURE__ */ c(l.Provider,{value:h,children:[r,/* @__PURE__ */ s(e,{open:!!u,title:u?.title,message:u?.message,confirmLabel:u?.confirmLabel,cancelLabel:u?.cancelLabel,danger:u?.danger,tone:u?.tone,icon:u?.icon,confirmPhrase:u?.confirmPhrase,loading:f,onConfirm:async()=>{let e=u?.onRun;if(typeof e!=`function`)g(!0);else{p(!0);try{await e(),g(!0)}catch{p(!1)}}},onClose:()=>g(!1)})]})}function d(){let e=r(l);if(!e)throw Error(`useConfirm needs an <AppConfirmProvider> above it.`);return e}export{u as default,d as useConfirm};
1
+ import e from"./AppConfirmDialog.js";import{createContext as t,useCallback as n,useContext as r,useEffect as i,useRef as a,useState as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";var l=t(null);function u(t){let{children:r}=t,[u,d]=o(null),[f,p]=o(!1),m=a(null),h=n((e={})=>new Promise(t=>{m.current?.(!1),m.current=t,d({...e,title:e.title||`Are you sure?`})}),[]),g=e=>{m.current?.(e),m.current=null,p(!1),d(null)};return i(()=>()=>m.current?.(!1),[]),/* @__PURE__ */ c(l.Provider,{value:h,children:[r,/* @__PURE__ */ s(e,{open:!!u,title:u?.title,description:u?.description,confirmLabel:u?.confirmLabel,cancelLabel:u?.cancelLabel,tone:u?.tone,icon:u?.icon,confirmPhrase:u?.confirmPhrase,loading:f,onConfirm:async()=>{let e=u?.onRun;if(typeof e!=`function`)g(!0);else{p(!0);try{await e(),g(!0)}catch{p(!1)}}},onClose:()=>g(!1)})]})}function d(){let e=r(l);if(!e)throw Error(`useConfirm needs an <AppConfirmProvider> above it.`);return e}export{u as default,d as useConfirm};
@@ -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),{heading: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"./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 +1 @@
1
- import{shortcutAria as e,shortcutChip as t}from"../lib/shortcutChip.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./renderIconProp.js";import i from"./warnUnknownProps.js";import{useEffect as a,useLayoutEffect as o,useRef as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";import"@webority/ui-elements/elements/context-menu";function u(e){let{marker:t,props:r}=n(`AppContextMenu`,e),{items:u=[],target:d,trigger:p,children:m,ariaLabel:h=`Context menu`,disabled:g=!1,open:_,onOpen:v,onBeforeOpen:y,menuClassName:b=``,linkComponent:x,...S}=r;i(`AppContextMenu`,S);let C=s(null);return a(()=>{let e=C.current;if(!v)return;let t=e=>v(e.detail);return e.addEventListener(`wui-context-menu:open`,t),()=>e.removeEventListener(`wui-context-menu:open`,t)},[v]),a(()=>{let e=C.current;if(y)return e.addEventListener(`wui-context-menu:beforeopen`,y),()=>e.removeEventListener(`wui-context-menu:beforeopen`,y)},[y]),o(()=>{C.current.toggleAttribute(`open`,!!_)},[_]),/* @__PURE__ */ l(`wui-context-menu`,{ref:C,target:d,trigger:p,disabled:g,...t,...S,children:[m,/* @__PURE__ */ c(`div`,{className:`dropdown-menu wui-context-menu-panel${b?` ${b}`:``}`,role:`menu`,"aria-label":h,tabIndex:-1,children:f(u,x)})]})}var d=e=>`dropdown-item${e.danger?` danger`:``}${e.disabled?` disabled`:``}`;function f(n,i){return n.map(n=>{if(n.divider)return/* @__PURE__ */ c(`hr`,{className:`dropdown-divider`},n.key);if(n.items!=null){let e=n.searchPlaceholder||`Search`;return/* @__PURE__ */ l(`div`,{className:`wui-context-menu-sub`,role:`none`,"data-searchable":n.searchable?``:void 0,children:[/* @__PURE__ */ l(`button`,{type:`button`,className:d(n),role:`menuitem`,"aria-haspopup":`menu`,"aria-expanded":`false`,tabIndex:-1,"data-key":n.key,"aria-disabled":n.disabled?`true`:void 0,children:[r(n.icon,{size:16}),n.label,r(`chevron-right`,{size:14,className:`wui-context-menu-chevron`})]}),/* @__PURE__ */ l(`div`,{className:`dropdown-menu wui-context-menu-subpanel`,role:`menu`,"aria-label":n.label,tabIndex:-1,children:[n.searchable?/* @__PURE__ */ c(`input`,{type:`search`,className:`wui-context-menu-search`,autoComplete:`off`,placeholder:e,"aria-label":e}):null,f(n.items,i)]})]},n.key)}let a=!!n.to&&!n.disabled,o=a?i??`a`:`button`,s=a?i?{to:n.to}:{href:n.to}:{type:`button`};return/* @__PURE__ */ l(o,{...s,className:d(n),role:`menuitem`,tabIndex:-1,"data-key":n.key,"aria-checked":n.checked?`true`:void 0,"data-hint":n.hint||void 0,"aria-keyshortcuts":e(n.shortcut),"aria-disabled":n.disabled?`true`:void 0,onClick:n.disabled?void 0:n.onClick,children:[n.image?/* @__PURE__ */ c(`img`,{src:n.image,alt:``}):r(n.icon,{size:16}),n.label,t(n.shortcut)]},n.key)})}export{u as default};
1
+ import{shortcutAria as e,shortcutChip as t}from"../lib/shortcutChip.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./renderIconProp.js";import i from"./warnUnknownProps.js";import{useEffect as a,useLayoutEffect as o,useRef as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";import"@webority/ui-elements/elements/context-menu";function u(e){let{marker:t,props:r}=n(`AppContextMenu`,e),{items:u=[],target:d,trigger:p,children:m,ariaLabel:h=`Context menu`,disabled:g=!1,open:_,onOpen:v,onBeforeOpen:y,menuClassName:b=``,linkComponent:x,...S}=r;i(`AppContextMenu`,S);let C=s(null);return a(()=>{let e=C.current;if(!v)return;let t=e=>v(e.detail);return e.addEventListener(`wui-context-menu:open`,t),()=>e.removeEventListener(`wui-context-menu:open`,t)},[v]),a(()=>{let e=C.current;if(y)return e.addEventListener(`wui-context-menu:beforeopen`,y),()=>e.removeEventListener(`wui-context-menu:beforeopen`,y)},[y]),o(()=>{C.current.toggleAttribute(`open`,!!_)},[_]),/* @__PURE__ */ l(`wui-context-menu`,{ref:C,target:d,trigger:p,disabled:g,...t,...S,children:[m,/* @__PURE__ */ c(`div`,{className:`dropdown-menu wui-context-menu-panel${b?` ${b}`:``}`,role:`menu`,"aria-label":h,tabIndex:-1,children:f(u,x)})]})}var d=e=>`dropdown-item${e.tone===`danger`?` danger`:``}${e.disabled?` disabled`:``}`;function f(n,i){return n.map(n=>{if(n.divider)return/* @__PURE__ */ c(`hr`,{className:`dropdown-divider`},n.key);if(n.items!=null){let e=n.searchPlaceholder||`Search`;return/* @__PURE__ */ l(`div`,{className:`wui-context-menu-sub`,role:`none`,"data-searchable":n.searchable?``:void 0,children:[/* @__PURE__ */ l(`button`,{type:`button`,className:d(n),role:`menuitem`,"aria-haspopup":`menu`,"aria-expanded":`false`,tabIndex:-1,"data-key":n.key,"aria-disabled":n.disabled?`true`:void 0,children:[r(n.icon,{size:16}),n.label,r(`chevron-right`,{size:14,className:`wui-context-menu-chevron`})]}),/* @__PURE__ */ l(`div`,{className:`dropdown-menu wui-context-menu-subpanel`,role:`menu`,"aria-label":n.label,tabIndex:-1,children:[n.searchable?/* @__PURE__ */ c(`input`,{type:`search`,className:`wui-context-menu-search`,autoComplete:`off`,placeholder:e,"aria-label":e}):null,f(n.items,i)]})]},n.key)}let a=!!n.to&&!n.disabled,o=a?i??`a`:`button`,s=a?i?{to:n.to}:{href:n.to}:{type:`button`};return/* @__PURE__ */ l(o,{...s,className:d(n),role:`menuitem`,tabIndex:-1,"data-key":n.key,"aria-checked":n.checked?`true`:void 0,"data-hint":n.hint||void 0,"aria-keyshortcuts":e(n.shortcut),"aria-disabled":n.disabled?`true`:void 0,onClick:n.disabled?void 0:n.onClick,children:[n.image?/* @__PURE__ */ c(`img`,{src:n.image,alt:``}):r(n.icon,{size:16}),n.label,t(n.shortcut)]},n.key)})}export{u as default};
@@ -1 +1 @@
1
- import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./AppActionIcon.js";import n from"./AppButton.js";import r from"./warnInvalidValue.js";import i from"./warnUnknownProps.js";import a from"./withTooltip.js";import{COPY_FEEDBACK_MS as o,copyTextToClipboard as s}from"@webority/ui-elements/helpers";import{useCallback as c,useEffect as l,useRef as u,useState as d}from"react";import{jsx as f}from"react/jsx-runtime";var p={sm:14,md:16,lg:20},m=[`ghost`,`outline`,`secondary`,`light`];function h(h){let{marker:g,props:_}=e(`AppCopyButton`,h),{text:v,label:y=`Copy`,copiedLabel:b=`Copied`,iconOnly:x=!1,size:S=`md`,variant:C=`ghost`,onCopied:w,className:T=``,tooltip:E,tooltipPlacement:D,...O}=_;i(`AppCopyButton`,O),r(`AppCopyButton`,`size`,S,Object.keys(p)),r(`AppCopyButton`,`variant`,C,m);let[k,A]=d(!1),j=u(null);l(()=>()=>clearTimeout(j.current),[]);let M=c(async()=>{await s(v)&&(A(!0),clearTimeout(j.current),j.current=setTimeout(()=>A(!1),o),w?.())},[v,w]),N=k?b:y,P=k?`check`:`files`;return a(x?/* @__PURE__ */ f(t,{icon:P,label:N,size:p[S]??p.md,onClick:M,className:T,...O,...g}):/* @__PURE__ */ f(n,{leftIcon:P,variant:C,size:S,onClick:M,className:T,"aria-live":`polite`,...O,...g,children:N}),E,D)}export{h 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"./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 +1 @@
1
- import e from"../lib/FieldMessage.js";import{loadFlagStyles as t}from"../lib/flagStyles.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./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,useEffect as u,useId as d}from"react";import{jsx as f,jsxs as p}from"react/jsx-runtime";import"@webority/ui-elements/elements/country-select";var m=[`sm`,`md`,`lg`],h=[`off`,`border`],g=l(function(l,g){let{marker:_,props:v}=n(`AppCountrySelect`,l),{value:y,onChange:b,countries:x,placeholder:S=`Select country`,searchPlaceholder:C=`Search countries...`,searchable:w=!0,clearable:T=!1,size:E=`md`,floatingLabel:D=`off`,disabled:O,open:k,label:A,required:j=!1,optional:M=!1,optionalLabel:N=`(optional)`,error:P,hint:F,help:I,helpLabel:L=`More information`,id:R,name:z,className:B=``,fieldClassName:V=``,"aria-label":H,"aria-labelledby":U,"aria-describedby":W,...G}=v;s(`AppCountrySelect`,G),o(`AppCountrySelect`,`size`,E,m),o(`AppCountrySelect`,`floatingLabel`,D,h),u(()=>{t()},[]);let K=d(),{setRef:q}=a({ref:g,value:y??``,onChange:b}),J=R||K,Y=D!==`off`&&A,X=P&&J?`${J}-error`:void 0,Z=F&&J?`${J}-hint`:void 0,Q=/* @__PURE__ */ f(`wui-country-select`,{"aria-label":H||(typeof A==`string`?A:void 0),"aria-labelledby":U||void 0,"aria-describedby":X||Z||W||void 0,"aria-invalid":P?`true`:void 0,ref:q,id:J,name:z,countries:Array.isArray(x)?x.join(`,`):void 0,placeholder:Y?` `:S,"search-placeholder":C,searchable:w?``:void 0,clearable:T?``:void 0,size:E===`sm`||E===`lg`?E:void 0,disabled:O?``:void 0,open:k?``:void 0,required:j?``:void 0,className:B||void 0,...G});if(!A&&!P&&!F)return c(Q,_);let $=[`field`,V].filter(Boolean).join(` `);return/* @__PURE__ */ p(`div`,{..._,className:$,children:[A&&!Y&&/* @__PURE__ */ p(`label`,{className:`label`,htmlFor:J,children:[A,M&&!j&&/* @__PURE__ */ f(`span`,{className:`label-optional`,children:` ${N}`}),j&&/* @__PURE__ */ f(i,{}),I&&/* @__PURE__ */ f(r,{label:L,children:I})]}),Y?/* @__PURE__ */ p(`div`,{className:`field-float`,children:[Q,/* @__PURE__ */ p(`label`,{className:`float-label`,htmlFor:J,children:[A,M&&!j&&/* @__PURE__ */ f(`span`,{className:`label-optional`,children:` ${N}`}),j&&/* @__PURE__ */ f(i,{})]})]}):Q,/* @__PURE__ */ f(e,{error:P,hint:F,errorId:X,hintId:Z})]})});export{g as default};
1
+ import e from"../lib/FieldMessage.js";import{loadFlagStyles as t}from"../lib/flagStyles.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./AppInfoTip.js";import i from"./AppRequiredMark.js";import a from"./useWuiControl.js";import o from"./warnInvalidValue.js";import s from"./warnUnknownProps.js";import{cloneElement as c,forwardRef as l,useEffect as u,useId as d}from"react";import{jsx as f,jsxs as p}from"react/jsx-runtime";import"@webority/ui-elements/elements/country-select";var m=[`sm`,`md`,`lg`],h=[`off`,`border`],g=l(function(l,g){let{marker:_,props:v}=n(`AppCountrySelect`,l),{value:y,onChange:b,countries:x,placeholder:S=`Select country`,searchPlaceholder:C=`Search countries...`,searchable:w=!0,clearable:T=!1,size:E=`md`,floatingLabel:D=`off`,disabled:O,open:k,label:A,required:j=!1,optional:M=!1,optionalLabel:N=`(optional)`,error:P,helperText:F,help:I,helpLabel:L=`More information`,id:R,name:z,className:B=``,fieldClassName:V=``,"aria-label":H,"aria-labelledby":U,"aria-describedby":W,...G}=v;s(`AppCountrySelect`,G),o(`AppCountrySelect`,`size`,E,m),o(`AppCountrySelect`,`floatingLabel`,D,h),u(()=>{t()},[]);let K=d(),{setRef:q}=a({ref:g,value:y??``,onChange:b}),J=R||K,Y=D!==`off`&&A,X=P&&J?`${J}-error`:void 0,Z=F&&J?`${J}-hint`:void 0,Q=/* @__PURE__ */ f(`wui-country-select`,{"aria-label":H||(typeof A==`string`?A:void 0),"aria-labelledby":U||void 0,"aria-describedby":X||Z||W||void 0,"aria-invalid":P?`true`:void 0,ref:q,id:J,name:z,countries:Array.isArray(x)?x.join(`,`):void 0,placeholder:Y?` `:S,"search-placeholder":C,searchable:w?``:void 0,clearable:T?``:void 0,size:E===`sm`||E===`lg`?E:void 0,disabled:O?``:void 0,open:k?``:void 0,required:j?``:void 0,className:B||void 0,...G});if(!A&&!P&&!F)return c(Q,_);let $=[`field`,V].filter(Boolean).join(` `);return/* @__PURE__ */ p(`div`,{..._,className:$,children:[A&&!Y&&/* @__PURE__ */ p(`label`,{className:`label`,htmlFor:J,children:[A,M&&!j&&/* @__PURE__ */ f(`span`,{className:`label-optional`,children:` ${N}`}),j&&/* @__PURE__ */ f(i,{}),I&&/* @__PURE__ */ f(r,{label:L,children:I})]}),Y?/* @__PURE__ */ p(`div`,{className:`field-float`,children:[Q,/* @__PURE__ */ p(`label`,{className:`float-label`,htmlFor:J,children:[A,M&&!j&&/* @__PURE__ */ f(`span`,{className:`label-optional`,children:` ${N}`}),j&&/* @__PURE__ */ f(i,{})]})]}):Q,/* @__PURE__ */ f(e,{error:P,hint:F,errorId:X,hintId:Z})]})});export{g 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)`,hint: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"./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 +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)`,hint: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"./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 +1 @@
1
- import e from"../lib/FieldMessage.js";import t from"../lib/fillLabel.js";import n from"../lib/useFileDrop.js";import{splitMarkerProps as r}from"../lib/wuiMarker.js";import i from"./AppIcon.js";import a from"./warnUnknownProps.js";import{DEFAULT_MAX_SIZE_MB as o,acceptDroppedFiles as s,acceptLabel as c}from"@webority/ui-elements/helpers";import{useId as l,useState as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";function p(p){let{marker:m,props:h}=r(`AppDropZone`,p),{label:g,id:_,onChange:v,multiple:y=!1,accept:b=``,maxSizeMb:x=o,error:S,hint:C,disabled:w=!1,className:T=``,fieldClassName:E=``,style:D,browseLabel:O=`Click to upload`,dropLabel:k=`or drag & drop`,anyTypeText:A=`Any file type`,maxSizeText:j=`up to {size} MB`,...M}=h;a(`AppDropZone`,M);let[N,P]=u(``),F=l(),I=_||F,L=S||N,R=L?`${I}-error`:void 0,z=C&&!L?`${I}-hint`:void 0,B=R||z,V=b?c(b):A,H={accept:b,maxSizeMb:x,multiple:y},U=e=>{P(``),v(y?e:e[0])},W=e=>P(e.message),{dragOver:G,dropProps:K}=n({...H,disabled:w,onFiles:U,onReject:W}),q=e=>{let{files:t,rejections:n}=s(e,H);(t.length||n.length)&&(t.length&&U(t),n.length&&W(n[0]))};return/* @__PURE__ */ f(`div`,{...m,className:`field${E?` ${E}`:``}`,children:[g?/* @__PURE__ */ d(`label`,{className:`label`,htmlFor:I,children:g}):null,/* @__PURE__ */ f(`div`,{className:`file-input file-input-tall${G?` dragging`:``}${L?` error`:``}${T?` ${T}`:``}`,style:D,"aria-disabled":w||void 0,...K,children:[/* @__PURE__ */ f(`label`,{htmlFor:I,className:`file-input-zone-label`,children:[/* @__PURE__ */ d(`span`,{className:`file-input-icon`,children:/* @__PURE__ */ d(i,{name:`upload`,size:24})}),/* @__PURE__ */ f(`span`,{className:`file-input-title`,children:[/* @__PURE__ */ d(`span`,{className:`browse`,children:O}),` ${k}`]}),/* @__PURE__ */ d(`span`,{className:`file-input-text`,children:x>0?`${V}, ${t(j,{size:x})}`:V})]}),/* @__PURE__ */ d(`input`,{id:I,type:`file`,"aria-describedby":B,accept:b,multiple:y||void 0,disabled:w||void 0,className:`visually-hidden`,onClick:e=>{e.currentTarget.value=``},onChange:e=>q(e.target.files),...M})]}),/* @__PURE__ */ d(e,{error:L,hint:C,errorId:R,hintId:z})]})}export{p as default};
1
+ import e from"../lib/FieldMessage.js";import t from"../lib/fillLabel.js";import n from"../lib/useFileDrop.js";import{splitMarkerProps as r}from"../lib/wuiMarker.js";import i from"./AppIcon.js";import a from"./warnUnknownProps.js";import{DEFAULT_MAX_SIZE_MB as o,acceptDroppedFiles as s,acceptLabel as c}from"@webority/ui-elements/helpers";import{useId as l,useState as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";function p(p){let{marker:m,props:h}=r(`AppDropZone`,p),{label:g,id:_,onChange:v,multiple:y=!1,accept:b=``,maxSizeMb:x=o,error:S,helperText:C,disabled:w=!1,className:T=``,fieldClassName:E=``,style:D,browseLabel:O=`Click to upload`,dropLabel:k=`or drag & drop`,anyTypeText:A=`Any file type`,maxSizeText:j=`up to {size} MB`,...M}=h;a(`AppDropZone`,M);let[N,P]=u(``),F=l(),I=_||F,L=S||N,R=L?`${I}-error`:void 0,z=C&&!L?`${I}-hint`:void 0,B=R||z,V=b?c(b):A,H={accept:b,maxSizeMb:x,multiple:y},U=e=>{P(``),v(y?e:e[0])},W=e=>P(e.message),{dragOver:G,dropProps:K}=n({...H,disabled:w,onFiles:U,onReject:W}),q=e=>{let{files:t,rejections:n}=s(e,H);(t.length||n.length)&&(t.length&&U(t),n.length&&W(n[0]))};return/* @__PURE__ */ f(`div`,{...m,className:`field${E?` ${E}`:``}`,children:[g?/* @__PURE__ */ d(`label`,{className:`label`,htmlFor:I,children:g}):null,/* @__PURE__ */ f(`div`,{className:`file-input file-input-tall${G?` dragging`:``}${L?` error`:``}${T?` ${T}`:``}`,style:D,"aria-disabled":w||void 0,...K,children:[/* @__PURE__ */ f(`label`,{htmlFor:I,className:`file-input-zone-label`,children:[/* @__PURE__ */ d(`span`,{className:`file-input-icon`,children:/* @__PURE__ */ d(i,{name:`upload`,size:24})}),/* @__PURE__ */ f(`span`,{className:`file-input-title`,children:[/* @__PURE__ */ d(`span`,{className:`browse`,children:O}),` ${k}`]}),/* @__PURE__ */ d(`span`,{className:`file-input-text`,children:x>0?`${V}, ${t(j,{size:x})}`:V})]}),/* @__PURE__ */ d(`input`,{id:I,type:`file`,"aria-describedby":B,accept:b,multiple:y||void 0,disabled:w||void 0,className:`visually-hidden`,onClick:e=>{e.currentTarget.value=``},onChange:e=>q(e.target.files),...M})]}),/* @__PURE__ */ d(e,{error:L,hint:C,errorId:R,hintId:z})]})}export{p as default};
@@ -1 +1 @@
1
- import{devWarn as e}from"../lib/devWarn.js";import{shortcutAria as t,shortcutChip as n}from"../lib/shortcutChip.js";import{splitMarkerProps as r}from"../lib/wuiMarker.js";import i from"./AppIcon.js";import a from"./renderIconProp.js";import o from"./warnInvalidValue.js";import s from"./warnUnknownProps.js";import c from"./withTooltip.js";import{Fragment as l,forwardRef as u,useEffect as d,useRef as f,useState as p}from"react";import{Dropdown as m}from"react-bootstrap";import{jsx as h,jsxs as g}from"react/jsx-runtime";var _=[`sm`,`md`,`lg`,`xl`],v=[`neutral`],y=[`sm`,`md`,`lg`],b=e=>{e.preventDefault(),e.stopPropagation()},x=u(function(e,t){return/* @__PURE__ */ h(`button`,{...e,ref:t,"aria-disabled":`true`})}),S=!1;function C(){let t=!0;try{t=process.env.NODE_ENV!==`production`}catch{t=!0}t&&!S&&(S=!0,e("[@webority/ui-react] <AppDropdown> icon-only toggle has no accessible name — pass `label` or `ariaLabel`."))}function w(i){let{marker:u,props:S}=r(`AppDropdown`,i),{icon:w,iconSize:E,toggleClassName:D,toggleVariant:O,menuWidth:k,label:A,ariaLabel:j,align:M=`end`,items:N=[],menuClassName:P=``,linkComponent:F,children:I,trigger:L,show:R,onToggle:z,...B}=S;s(`AppDropdown`,B);for(let e of N)o(`AppDropdown`,`items[].hiddenFrom`,e.hiddenFrom,_);L||j||A||C(),o(`AppDropdown`,`toggleVariant`,O,v),o(`AppDropdown`,`menuWidth`,k,y),O&&!L&&e(`AppDropdown: toggleVariant needs a trigger; the icon toggle ignores it.`);let V=(D??(L?`wui-dropdown-trigger`:`topbar-icon-btn`))+(L&&O===`neutral`?` wui-dropdown-trigger-neutral`:``),H=[P,y.includes(k)?`wui-dropdown-menu-${k}`:``].filter(Boolean).join(` `),U=R!==void 0,[W,G]=p(!1),K=U?!!R:W,q=f(null);q.current=(e,t)=>{U||G(e),z?.(e,t)};let J=f(null);return d(()=>{if(!K)return;let e=J.current?.getBoundingClientRect(),t=()=>{let t=J.current?.getBoundingClientRect();(!e||!t||Math.abs(t.top-e.top)>2||Math.abs(t.left-e.left)>2)&&q.current(!1,{source:`scroll`})},n=()=>q.current(!1,{source:`resize`});return window.addEventListener(`scroll`,t,{capture:!0,passive:!0}),window.addEventListener(`resize`,n),()=>{window.removeEventListener(`scroll`,t,{capture:!0}),window.removeEventListener(`resize`,n)}},[K]),/* @__PURE__ */ g(m,{ref:J,align:M,show:K,onToggle:(e,t)=>q.current(e,t),...u,...B,children:[/* @__PURE__ */ h(m.Toggle,{as:T,icon:w,iconSize:E,btnClassName:V,trigger:L,title:A,"aria-label":j??(L?void 0:A)}),/* @__PURE__ */ h(m.Menu,{className:H,renderOnMount:!0,popperConfig:{strategy:`fixed`},children:I??N.map(e=>{if(e.header!=null)return/* @__PURE__ */ h(`div`,{className:`dropdown-header`,children:e.header},e.key);if(e.divider)return/* @__PURE__ */ h(m.Divider,{},e.key);if(e.disabled)return/* @__PURE__ */ h(l,{children:c(/* @__PURE__ */ g(m.Item,{as:x,type:`button`,className:[e.danger&&`danger`,`wui-dropdown-item-disabled`].filter(Boolean).join(` `),onClick:b,children:[e.image?/* @__PURE__ */ h(`img`,{src:e.image,alt:``}):a(e.icon,{size:16}),e.label,e.disabledReason&&/* @__PURE__ */ g(`span`,{className:`visually-hidden wui-dropdown-item-reason`,children:[`: `,e.disabledReason]})]}),e.disabledReason,`auto`)},e.key);let r=e.to?F?{as:F,to:e.to}:{as:`a`,href:e.to}:{as:`button`,type:`button`},i=[e.danger&&`danger`,_.includes(e.hiddenFrom)&&`wui-hidden-from-${e.hiddenFrom}`].filter(Boolean).join(` `)||void 0;return/* @__PURE__ */ g(m.Item,{...r,onClick:e.onClick,className:i,"aria-keyshortcuts":t(e.shortcut),children:[e.image?/* @__PURE__ */ h(`img`,{src:e.image,alt:``}):a(e.icon,{size:16}),e.label,n(e.shortcut)]},e.key)})})]})}var T=u(function({icon:e,iconSize:t=20,btnClassName:n=`topbar-icon-btn`,trigger:r,"aria-label":a,className:o,...s},c){return/* @__PURE__ */ h(`button`,{ref:c,type:`button`,className:n,"aria-label":a,...s,children:r??/* @__PURE__ */ h(i,{name:e,size:t})})});export{w as default};
1
+ import{devWarn as e}from"../lib/devWarn.js";import{shortcutAria as t,shortcutChip as n}from"../lib/shortcutChip.js";import{TONES as r}from"../lib/vocabulary.js";import{splitMarkerProps as i}from"../lib/wuiMarker.js";import a from"./AppIcon.js";import o from"./renderIconProp.js";import s from"./warnInvalidValue.js";import c from"./warnUnknownProps.js";import l from"./withTooltip.js";import{Fragment as u,forwardRef as d,useEffect as f,useRef as p,useState as m}from"react";import{Dropdown as h}from"react-bootstrap";import{jsx as g,jsxs as _}from"react/jsx-runtime";var v=[`sm`,`md`,`lg`,`xl`],y=[`neutral`],b=[`sm`,`md`,`lg`],x=e=>{e.preventDefault(),e.stopPropagation()},S=d(function(e,t){return/* @__PURE__ */ g(`button`,{...e,ref:t,"aria-disabled":`true`})}),C=!1;function w(){let t=!0;try{t=process.env.NODE_ENV!==`production`}catch{t=!0}t&&!C&&(C=!0,e("[@webority/ui-react] <AppDropdown> icon-only toggle has no accessible name — pass `label` or `ariaLabel`."))}function T(a){let{marker:d,props:C}=i(`AppDropdown`,a),{icon:T,iconSize:D,toggleClassName:O,toggleVariant:k,menuWidth:A,label:j,ariaLabel:M,align:N=`end`,items:P=[],menuClassName:F=``,linkComponent:I,children:L,trigger:R,open:z,onOpenChange:B,...V}=C;c(`AppDropdown`,V);for(let e of P)s(`AppDropdown`,`items[].hiddenFrom`,e.hiddenFrom,v),s(`AppDropdown`,`items[].tone`,e.tone,r);R||M||j||w(),s(`AppDropdown`,`toggleVariant`,k,y),s(`AppDropdown`,`menuWidth`,A,b),k&&!R&&e(`AppDropdown: toggleVariant needs a trigger; the icon toggle ignores it.`);let H=(O??(R?`wui-dropdown-trigger`:`topbar-icon-btn`))+(R&&k===`neutral`?` wui-dropdown-trigger-neutral`:``),U=[F,b.includes(A)?`wui-dropdown-menu-${A}`:``].filter(Boolean).join(` `),W=z!==void 0,[G,K]=m(!1),q=W?!!z:G,J=p(null);J.current=(e,t)=>{W||K(e),B?.(e,t)};let Y=p(null);return f(()=>{if(!q)return;let e=Y.current?.getBoundingClientRect(),t=()=>{let t=Y.current?.getBoundingClientRect();(!e||!t||Math.abs(t.top-e.top)>2||Math.abs(t.left-e.left)>2)&&J.current(!1,{source:`scroll`})},n=()=>J.current(!1,{source:`resize`});return window.addEventListener(`scroll`,t,{capture:!0,passive:!0}),window.addEventListener(`resize`,n),()=>{window.removeEventListener(`scroll`,t,{capture:!0}),window.removeEventListener(`resize`,n)}},[q]),/* @__PURE__ */ _(h,{ref:Y,align:N,show:q,onToggle:(e,t)=>J.current(e,t),...d,...V,children:[/* @__PURE__ */ g(h.Toggle,{as:E,icon:T,iconSize:D,btnClassName:H,trigger:R,title:j,"aria-label":M??(R?void 0:j)}),/* @__PURE__ */ g(h.Menu,{className:U,renderOnMount:!0,popperConfig:{strategy:`fixed`},children:L??P.map(e=>{if(e.header!=null)return/* @__PURE__ */ g(`div`,{className:`dropdown-header`,children:e.header},e.key);if(e.divider)return/* @__PURE__ */ g(h.Divider,{},e.key);if(e.disabled)return/* @__PURE__ */ g(u,{children:l(/* @__PURE__ */ _(h.Item,{as:S,type:`button`,className:[e.tone===`danger`&&`danger`,`wui-dropdown-item-disabled`].filter(Boolean).join(` `),onClick:x,children:[e.image?/* @__PURE__ */ g(`img`,{src:e.image,alt:``}):o(e.icon,{size:16}),e.label,e.disabledReason&&/* @__PURE__ */ _(`span`,{className:`visually-hidden wui-dropdown-item-reason`,children:[`: `,e.disabledReason]})]}),e.disabledReason,`auto`)},e.key);let r=e.to?I?{as:I,to:e.to}:{as:`a`,href:e.to}:{as:`button`,type:`button`},i=[e.tone===`danger`&&`danger`,v.includes(e.hiddenFrom)&&`wui-hidden-from-${e.hiddenFrom}`].filter(Boolean).join(` `)||void 0;return/* @__PURE__ */ _(h.Item,{...r,onClick:e.onClick,className:i,"aria-keyshortcuts":t(e.shortcut),children:[e.image?/* @__PURE__ */ g(`img`,{src:e.image,alt:``}):o(e.icon,{size:16}),e.label,n(e.shortcut)]},e.key)})})]})}var E=d(function({icon:e,iconSize:t=20,btnClassName:n=`topbar-icon-btn`,trigger:r,"aria-label":i,className:o,...s},c){return/* @__PURE__ */ g(`button`,{ref:c,type:`button`,className:n,"aria-label":i,...s,children:r??/* @__PURE__ */ g(a,{name:e,size:t})})});export{T as default};
@@ -1 +1 @@
1
- import{devWarn as e}from"../lib/devWarn.js";import t,{ILLUSTRATION_NAMES as n}from"../lib/emptyIllustration.js";import{splitMarkerProps as r}from"../lib/wuiMarker.js";import i from"./renderIconProp.js";import a from"./warnInvalidValue.js";import o from"./warnUnknownProps.js";import{jsx as s,jsxs as c}from"react/jsx-runtime";var l=[`md`,`sm`],u=[`card`,`table`],d=!1;function f(f){let{marker:p,props:m}=r(`AppEmptyState`,f),{icon:h,illustration:g,iconSize:_=24,size:v=`md`,variant:y=`card`,title:b,text:x,action:S,className:C=``,style:w,...T}=m;o(`AppEmptyState`,T),a(`AppEmptyState`,`size`,v,l),a(`AppEmptyState`,`variant`,y,u),y===`table`&&v===`sm`&&!d&&(d=!0,e(`[@webority/ui-react] <AppEmptyState> size="sm" has no table look; variant="table" uses the md scale.`)),typeof g==`string`&&a(`AppEmptyState`,`illustration`,g,n);let E=typeof g==`string`&&n.includes(g),D=g!=null&&typeof g!=`string`?g:null,O=[`empty-state`,v===`sm`?`empty-state-sm`:``,y===`table`?`wui-empty-state-table`:``,C].filter(Boolean).join(` `);return/* @__PURE__ */ c(`div`,{className:O,style:w,...p,...T,children:[E?/* @__PURE__ */ s(t,{name:g,className:`wui-empty-illustration`}):null,D?/* @__PURE__ */ s(`span`,{className:`wui-empty-illustration wui-empty-illustration-custom`,"aria-hidden":`true`,children:D}):null,h&&!E&&!D?/* @__PURE__ */ s(`div`,{className:`empty-state-icon`,children:i(h,{size:_})}):null,b!=null&&/* @__PURE__ */ s(`div`,{className:`empty-state-title`,children:b}),x!=null&&/* @__PURE__ */ s(`div`,{className:`empty-state-message`,children:x}),S&&/* @__PURE__ */ s(`div`,{className:`empty-state-action`,children:S})]})}export{f as default};
1
+ import{devWarn as e}from"../lib/devWarn.js";import t,{ILLUSTRATION_NAMES as n}from"../lib/emptyIllustration.js";import{splitMarkerProps as r}from"../lib/wuiMarker.js";import i from"./renderIconProp.js";import a from"./warnInvalidValue.js";import o from"./warnUnknownProps.js";import{jsx as s,jsxs as c}from"react/jsx-runtime";var l=[`md`,`sm`],u=[`card`,`table`],d=!1;function f(f){let{marker:p,props:m}=r(`AppEmptyState`,f),{icon:h,illustration:g,iconSize:_=24,size:v=`md`,variant:y=`card`,title:b,description:x,action:S,className:C=``,style:w,...T}=m;o(`AppEmptyState`,T),a(`AppEmptyState`,`size`,v,l),a(`AppEmptyState`,`variant`,y,u),y===`table`&&v===`sm`&&!d&&(d=!0,e(`[@webority/ui-react] <AppEmptyState> size="sm" has no table look; variant="table" uses the md scale.`)),typeof g==`string`&&a(`AppEmptyState`,`illustration`,g,n);let E=typeof g==`string`&&n.includes(g),D=g!=null&&typeof g!=`string`?g:null,O=[`empty-state`,v===`sm`?`empty-state-sm`:``,y===`table`?`wui-empty-state-table`:``,C].filter(Boolean).join(` `);return/* @__PURE__ */ c(`div`,{className:O,style:w,...p,...T,children:[E?/* @__PURE__ */ s(t,{name:g,className:`wui-empty-illustration`}):null,D?/* @__PURE__ */ s(`span`,{className:`wui-empty-illustration wui-empty-illustration-custom`,"aria-hidden":`true`,children:D}):null,h&&!E&&!D?/* @__PURE__ */ s(`div`,{className:`empty-state-icon`,children:i(h,{size:_})}):null,b!=null&&/* @__PURE__ */ s(`div`,{className:`empty-state-title`,children:b}),x!=null&&/* @__PURE__ */ s(`div`,{className:`empty-state-message`,children:x}),S&&/* @__PURE__ */ s(`div`,{className:`empty-state-action`,children:S})]})}export{f as default};
@@ -1 +1 @@
1
- import{devWarn as e}from"../lib/devWarn.js";import t from"../lib/FieldMessage.js";import n from"../lib/FileItemRow.js";import{FIELD_SIZES as r}from"../lib/fieldState.js";import{keyOf as i}from"../lib/fileItem.js";import a from"../lib/fillLabel.js";import o from"../lib/useFileDrop.js";import{splitMarkerProps as ee}from"../lib/wuiMarker.js";import s from"./AppIcon.js";import te from"./AppInfoTip.js";import ne from"./AppRequiredMark.js";import re from"./AppSpinner.js";import ie from"./warnInvalidValue.js";import ae from"./warnUnknownProps.js";import oe from"./withTooltip.js";import{DEFAULT_MAX_SIZE_MB as se,acceptDroppedFiles as ce,acceptLabel as c,isImageFile as l,isImageOnlyAccept as le,isPdfFile as ue}from"@webority/ui-elements/helpers";import{useEffect as u,useId as de,useRef as fe,useState as d}from"react";import{jsx as f,jsxs as p}from"react/jsx-runtime";var pe=[`dropzone`,`button`],me={sm:` input-sm`,md:``,lg:` input-lg`};function m(m){let{marker:he,props:ge}=ee(`AppFilePicker`,m),{label:h,value:g,name:_e,id:ve,onPick:_,multiple:v=!1,variant:y=`dropzone`,buttonLabel:ye=`Add file`,browseLabel:be=`Click to upload`,dropLabel:xe=`or drag & drop`,maxSizeText:Se=`up to {size} MB`,optionalLabel:Ce=`(optional)`,changeImageLabel:we=`Change image`,changeFileLabel:Te=`Change file`,maxFilesText:Ee=`Up to {count} files.`,removeFileLabel:De=`Remove {name}`,maxFiles:b,accept:x=`.jpg,.jpeg,.png`,maxSizeMb:S=se,required:C,optional:Oe=!1,error:ke,hint:w,help:T,helpLabel:Ae=`More information`,loading:E=!1,readOnly:D=!1,size:O=`md`,disabled:k=!1,className:A=``,fieldClassName:j=``,style:M,...N}=ge;ae(`AppFilePicker`,N),ie(`AppFilePicker`,`variant`,y,pe),ie(`AppFilePicker`,`size`,O,r);let P=me[O]??``,F=D?{"aria-readonly":`true`,"data-wui-readonly":``}:null,[je,I]=d(null),[Me,L]=d(null),[Ne,R]=d(``),z=fe(null),Pe=de(),B=ve||Pe,V=k||E;u(()=>{if(!v&&g instanceof File&&l(g)){let e=URL.createObjectURL(g);return I(e),()=>URL.revokeObjectURL(e)}I(null)},[g,v]);let H=!v&&g&&!l(g)&&ue(g)?g instanceof File?g:g.url:null;u(()=>{if(!H){L(null);return}let t=!0,n=null;return import(`@webority/ui-elements/file-viewer`).then(e=>e.renderPdfFirstPage(typeof H==`string`?{url:H}:H)).then(e=>{t&&(n=URL.createObjectURL(e),L(n))}).catch(t=>e(`[AppFilePicker] the PDF preview failed:`,t?.message)),()=>{t=!1,L(null),n&&URL.revokeObjectURL(n)}},[H]);let U=v?Array.isArray(g)?g:g?[g]:[]:[],W=ke||Ne,G=W?`${B}-error`:void 0,K=w&&!W?`${B}-hint`:void 0,Fe=G||K,q=le(x),Ie=y===`button`,Le=!v&&!!g,J=Le&&(g instanceof File?l(g):q||l(g)),Re=g?.name,ze=J?g?.url||je:Me,Y=J?`image`:`file`,Be=h?`Change ${h}`:`Change ${Y}`,X=h?`Remove ${h}`:`Remove ${Y}`,Ve=h?`${h} preview`:`Selected ${Y} preview`,He={accept:x,maxSizeMb:S,multiple:v},Ue=e=>{if(R(``),!v){_(e[0]);return}let t=Array.isArray(g)?g:g?[g]:[],n=new Set(t.map(i)),r=[];for(let t of e)n.has(i(t))||(n.add(i(t)),r.push(t));let o=t.concat(r);b&&o.length>b&&(o=o.slice(0,b),R(a(Ee,{count:b}))),_(o)},Z=e=>R(e.message),{dragOver:We,dropProps:Ge}=o({...He,disabled:V||D,onFiles:Ue,onReject:Z}),Ke=e=>{if(D)return;let{files:t,rejections:n}=ce(e,He);t.length&&Ue(t),n.length&&Z(n[0])},qe=e=>Ke(e.target.files),Je=e=>{D||(R(``),_(U.filter((t,n)=>n!==e)))},Ye=()=>{D||z.current?.click()},Q=E?/* @__PURE__ */ f(`span`,{className:`wui-file-busy`,children:/* @__PURE__ */ f(re,{size:`sm`})}):null,$=/* @__PURE__ */ f(`input`,{id:B,name:_e,ref:z,type:`file`,"aria-describedby":Fe,accept:x,multiple:v||void 0,disabled:V||void 0,className:`visually-hidden`,onClick:e=>{D?e.preventDefault():e.currentTarget.value=``},onChange:qe,...N});return/* @__PURE__ */ p(`div`,{...he,className:`field${j?` ${j}`:``}`,children:[/* @__PURE__ */ p(`label`,{className:`label`,htmlFor:B,children:[h,Oe&&!C&&/* @__PURE__ */ f(`span`,{className:`label-optional`,children:` ${Ce}`}),C&&/* @__PURE__ */ f(ne,{}),T&&/* @__PURE__ */ f(te,{label:Ae,children:T})]}),Ie?/* @__PURE__ */ p(`div`,{className:`file-input wui-file-input-button-field${P}${W?` error`:``}${A?` ${A}`:``}`,style:M,"aria-busy":E||void 0,...F,children:[/* @__PURE__ */ p(`label`,{htmlFor:B,className:`btn btn-outline-primary btn-sm`,children:[/* @__PURE__ */ f(s,{name:`paperclip`,size:16}),ye]}),$,Q]}):Le?/* @__PURE__ */ p(`div`,{className:`file-preview${P}${W?` error`:``}${A?` ${A}`:``}`,style:M,"aria-busy":E||void 0,...F,children:[/* @__PURE__ */ p(`button`,{type:`button`,className:`file-preview-open`,"aria-label":Be,onClick:Ye,disabled:V||D,children:[ze?/* @__PURE__ */ f(`img`,{src:ze,alt:Ve,className:`file-preview-img`}):/* @__PURE__ */ p(`span`,{className:`file-preview-file`,children:[/* @__PURE__ */ f(s,{name:`file-text`,size:28}),/* @__PURE__ */ f(`span`,{className:`file-preview-file-name`,children:Re})]}),/* @__PURE__ */ f(`span`,{className:`file-preview-overlay`,children:/* @__PURE__ */ p(`span`,{className:`file-preview-cta`,children:[/* @__PURE__ */ f(s,{name:J?`image`:`file-text`,size:16}),` `,J?we:Te]})})]}),oe(/* @__PURE__ */ f(`button`,{type:`button`,className:`file-preview-remove`,"aria-label":X,onClick:()=>_(null),disabled:V||D,children:/* @__PURE__ */ f(s,{name:`x`,size:16})}),X),$,Q]}):/* @__PURE__ */ p(`div`,{className:`file-input file-input-tall${P}${We?` dragging`:``}${W?` error`:``}${v&&U.length>0?` has-files`:``}${A?` ${A}`:``}`,style:M,"aria-busy":E||void 0,"aria-disabled":k||void 0,...F,...Ge,children:[/* @__PURE__ */ p(`label`,{htmlFor:B,className:`file-input-zone-label`,children:[/* @__PURE__ */ f(`span`,{className:`file-input-icon`,children:/* @__PURE__ */ f(s,{name:`upload`,size:24})}),/* @__PURE__ */ p(`span`,{className:`file-input-title`,children:[/* @__PURE__ */ f(`span`,{className:`browse`,children:be}),` ${xe}`]}),/* @__PURE__ */ f(`span`,{className:`file-input-text`,children:S>0?`${c(x)}, ${a(Se,{size:S})}`:c(x)})]}),$,Q,v&&U.length>0&&/* @__PURE__ */ f(`div`,{className:`attach-list`,children:U.map((e,t)=>/* @__PURE__ */ f(n,{item:e,isImage:e instanceof File?l(e):q||l(e),noun:`file`,removeFileLabel:De,readOnly:D,onRemove:()=>Je(t)},i(e)))})]}),/* @__PURE__ */ f(t,{error:W,hint:w,errorId:G,hintId:K})]})}export{m as default};
1
+ import{devWarn as e}from"../lib/devWarn.js";import t from"../lib/FieldMessage.js";import n from"../lib/FileItemRow.js";import{FIELD_SIZES as r}from"../lib/fieldState.js";import{keyOf as i}from"../lib/fileItem.js";import a from"../lib/fillLabel.js";import o from"../lib/useFileDrop.js";import{splitMarkerProps as ee}from"../lib/wuiMarker.js";import s from"./AppIcon.js";import te from"./AppInfoTip.js";import ne from"./AppRequiredMark.js";import re from"./AppSpinner.js";import ie from"./warnInvalidValue.js";import ae from"./warnUnknownProps.js";import oe from"./withTooltip.js";import{DEFAULT_MAX_SIZE_MB as se,acceptDroppedFiles as ce,acceptLabel as c,isImageFile as l,isImageOnlyAccept as le,isPdfFile as ue}from"@webority/ui-elements/helpers";import{useEffect as u,useId as de,useRef as fe,useState as d}from"react";import{jsx as f,jsxs as p}from"react/jsx-runtime";var pe=[`dropzone`,`button`],me={sm:` input-sm`,md:``,lg:` input-lg`};function m(m){let{marker:he,props:ge}=ee(`AppFilePicker`,m),{label:h,value:g,name:_e,id:ve,onChange:_,multiple:v=!1,variant:y=`dropzone`,buttonLabel:ye=`Add file`,browseLabel:be=`Click to upload`,dropLabel:xe=`or drag & drop`,maxSizeText:Se=`up to {size} MB`,optionalLabel:Ce=`(optional)`,changeImageLabel:we=`Change image`,changeFileLabel:Te=`Change file`,maxFilesText:Ee=`Up to {count} files.`,removeFileLabel:De=`Remove {name}`,maxFiles:b,accept:x=`.jpg,.jpeg,.png`,maxSizeMb:S=se,required:C,optional:Oe=!1,error:ke,helperText:w,help:T,helpLabel:Ae=`More information`,loading:E=!1,readOnly:D=!1,size:O=`md`,disabled:k=!1,className:A=``,fieldClassName:j=``,style:M,...N}=ge;ae(`AppFilePicker`,N),ie(`AppFilePicker`,`variant`,y,pe),ie(`AppFilePicker`,`size`,O,r);let P=me[O]??``,F=D?{"aria-readonly":`true`,"data-wui-readonly":``}:null,[je,I]=d(null),[Me,L]=d(null),[Ne,R]=d(``),z=fe(null),Pe=de(),B=ve||Pe,V=k||E;u(()=>{if(!v&&g instanceof File&&l(g)){let e=URL.createObjectURL(g);return I(e),()=>URL.revokeObjectURL(e)}I(null)},[g,v]);let H=!v&&g&&!l(g)&&ue(g)?g instanceof File?g:g.url:null;u(()=>{if(!H){L(null);return}let t=!0,n=null;return import(`@webority/ui-elements/file-viewer`).then(e=>e.renderPdfFirstPage(typeof H==`string`?{url:H}:H)).then(e=>{t&&(n=URL.createObjectURL(e),L(n))}).catch(t=>e(`[AppFilePicker] the PDF preview failed:`,t?.message)),()=>{t=!1,L(null),n&&URL.revokeObjectURL(n)}},[H]);let U=v?Array.isArray(g)?g:g?[g]:[]:[],W=ke||Ne,G=W?`${B}-error`:void 0,K=w&&!W?`${B}-hint`:void 0,Fe=G||K,q=le(x),Ie=y===`button`,Le=!v&&!!g,J=Le&&(g instanceof File?l(g):q||l(g)),Re=g?.name,ze=J?g?.url||je:Me,Y=J?`image`:`file`,Be=h?`Change ${h}`:`Change ${Y}`,X=h?`Remove ${h}`:`Remove ${Y}`,Ve=h?`${h} preview`:`Selected ${Y} preview`,He={accept:x,maxSizeMb:S,multiple:v},Ue=e=>{if(R(``),!v){_(e[0]);return}let t=Array.isArray(g)?g:g?[g]:[],n=new Set(t.map(i)),r=[];for(let t of e)n.has(i(t))||(n.add(i(t)),r.push(t));let o=t.concat(r);b&&o.length>b&&(o=o.slice(0,b),R(a(Ee,{count:b}))),_(o)},Z=e=>R(e.message),{dragOver:We,dropProps:Ge}=o({...He,disabled:V||D,onFiles:Ue,onReject:Z}),Ke=e=>{if(D)return;let{files:t,rejections:n}=ce(e,He);t.length&&Ue(t),n.length&&Z(n[0])},qe=e=>Ke(e.target.files),Je=e=>{D||(R(``),_(U.filter((t,n)=>n!==e)))},Ye=()=>{D||z.current?.click()},Q=E?/* @__PURE__ */ f(`span`,{className:`wui-file-busy`,children:/* @__PURE__ */ f(re,{size:`sm`})}):null,$=/* @__PURE__ */ f(`input`,{id:B,name:_e,ref:z,type:`file`,"aria-describedby":Fe,accept:x,multiple:v||void 0,disabled:V||void 0,className:`visually-hidden`,onClick:e=>{D?e.preventDefault():e.currentTarget.value=``},onChange:qe,...N});return/* @__PURE__ */ p(`div`,{...he,className:`field${j?` ${j}`:``}`,children:[/* @__PURE__ */ p(`label`,{className:`label`,htmlFor:B,children:[h,Oe&&!C&&/* @__PURE__ */ f(`span`,{className:`label-optional`,children:` ${Ce}`}),C&&/* @__PURE__ */ f(ne,{}),T&&/* @__PURE__ */ f(te,{label:Ae,children:T})]}),Ie?/* @__PURE__ */ p(`div`,{className:`file-input wui-file-input-button-field${P}${W?` error`:``}${A?` ${A}`:``}`,style:M,"aria-busy":E||void 0,...F,children:[/* @__PURE__ */ p(`label`,{htmlFor:B,className:`btn btn-outline-primary btn-sm`,children:[/* @__PURE__ */ f(s,{name:`paperclip`,size:16}),ye]}),$,Q]}):Le?/* @__PURE__ */ p(`div`,{className:`file-preview${P}${W?` error`:``}${A?` ${A}`:``}`,style:M,"aria-busy":E||void 0,...F,children:[/* @__PURE__ */ p(`button`,{type:`button`,className:`file-preview-open`,"aria-label":Be,onClick:Ye,disabled:V||D,children:[ze?/* @__PURE__ */ f(`img`,{src:ze,alt:Ve,className:`file-preview-img`}):/* @__PURE__ */ p(`span`,{className:`file-preview-file`,children:[/* @__PURE__ */ f(s,{name:`file-text`,size:28}),/* @__PURE__ */ f(`span`,{className:`file-preview-file-name`,children:Re})]}),/* @__PURE__ */ f(`span`,{className:`file-preview-overlay`,children:/* @__PURE__ */ p(`span`,{className:`file-preview-cta`,children:[/* @__PURE__ */ f(s,{name:J?`image`:`file-text`,size:16}),` `,J?we:Te]})})]}),oe(/* @__PURE__ */ f(`button`,{type:`button`,className:`file-preview-remove`,"aria-label":X,onClick:()=>_(null),disabled:V||D,children:/* @__PURE__ */ f(s,{name:`x`,size:16})}),X),$,Q]}):/* @__PURE__ */ p(`div`,{className:`file-input file-input-tall${P}${We?` dragging`:``}${W?` error`:``}${v&&U.length>0?` has-files`:``}${A?` ${A}`:``}`,style:M,"aria-busy":E||void 0,"aria-disabled":k||void 0,...F,...Ge,children:[/* @__PURE__ */ p(`label`,{htmlFor:B,className:`file-input-zone-label`,children:[/* @__PURE__ */ f(`span`,{className:`file-input-icon`,children:/* @__PURE__ */ f(s,{name:`upload`,size:24})}),/* @__PURE__ */ p(`span`,{className:`file-input-title`,children:[/* @__PURE__ */ f(`span`,{className:`browse`,children:be}),` ${xe}`]}),/* @__PURE__ */ f(`span`,{className:`file-input-text`,children:S>0?`${c(x)}, ${a(Se,{size:S})}`:c(x)})]}),$,Q,v&&U.length>0&&/* @__PURE__ */ f(`div`,{className:`attach-list`,children:U.map((e,t)=>/* @__PURE__ */ f(n,{item:e,isImage:e instanceof File?l(e):q||l(e),noun:`file`,removeFileLabel:De,readOnly:D,onRemove:()=>Je(t)},i(e)))})]}),/* @__PURE__ */ f(t,{error:W,hint:w,errorId:G,hintId:K})]})}export{m as default};