@webority/ui-react 0.128.0 → 0.130.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (233) hide show
  1. package/README.md +1 -1
  2. package/dist/canvas-kit/kit.js +29757 -25503
  3. package/dist/canvas-kit/manifest.json +3343 -275
  4. package/dist/canvas-kit/release.json +6 -6
  5. package/dist/components/AppAccountSwitcher.js +1 -0
  6. package/dist/components/AppActionIcon.js +1 -1
  7. package/dist/components/AppAlert.js +1 -1
  8. package/dist/components/AppAsyncBlock.js +1 -1
  9. package/dist/components/AppAuthLayout.js +1 -0
  10. package/dist/components/AppAutocomplete.js +1 -1
  11. package/dist/components/AppAvatar.js +1 -1
  12. package/dist/components/AppAvatarGroup.js +1 -1
  13. package/dist/components/AppBadge.js +1 -1
  14. package/dist/components/AppBanner.js +1 -1
  15. package/dist/components/AppButton.js +1 -1
  16. package/dist/components/AppCalendar.js +1 -1
  17. package/dist/components/AppCard.js +1 -1
  18. package/dist/components/AppCell.js +1 -0
  19. package/dist/components/AppChart.js +1 -1
  20. package/dist/components/AppChartCard.js +1 -1
  21. package/dist/components/AppCheckbox.js +1 -1
  22. package/dist/components/AppChip.js +1 -1
  23. package/dist/components/AppChoiceCard.js +1 -1
  24. package/dist/components/AppChoiceChip.js +1 -1
  25. package/dist/components/AppColorField.js +1 -1
  26. package/dist/components/AppCommandPalette.js +1 -1
  27. package/dist/components/AppCommentThread.js +1 -1
  28. package/dist/components/AppCompareTable.js +1 -1
  29. package/dist/components/AppConfirmDialog.js +1 -1
  30. package/dist/components/AppConfirmProvider.js +1 -1
  31. package/dist/components/AppConsentBanner.js +1 -1
  32. package/dist/components/AppContextMenu.js +1 -1
  33. package/dist/components/AppCopyButton.js +1 -1
  34. package/dist/components/AppCountrySelect.js +1 -1
  35. package/dist/components/AppDataTable.js +1 -1
  36. package/dist/components/AppDatePicker.js +1 -1
  37. package/dist/components/AppDateRangePicker.js +1 -1
  38. package/dist/components/AppDescriptions.js +1 -1
  39. package/dist/components/AppDrawer.js +1 -1
  40. package/dist/components/AppDropZone.js +1 -1
  41. package/dist/components/AppDropdown.js +1 -1
  42. package/dist/components/AppDueDate.js +1 -1
  43. package/dist/components/AppEmptyState.js +1 -1
  44. package/dist/components/AppErrorBoundary.js +1 -0
  45. package/dist/components/AppFileAttachment.js +1 -1
  46. package/dist/components/AppFilePicker.js +1 -1
  47. package/dist/components/AppFileTiles.js +1 -1
  48. package/dist/components/AppFilterBar.js +1 -1
  49. package/dist/components/AppFloatingButton.js +1 -0
  50. package/dist/components/AppImagePicker.js +1 -1
  51. package/dist/components/AppInfoTip.js +1 -1
  52. package/dist/components/AppInlineEdit.js +1 -1
  53. package/dist/components/AppInput.js +1 -1
  54. package/dist/components/AppKanban.js +1 -1
  55. package/dist/components/AppKpiTile.js +1 -1
  56. package/dist/components/AppLeadPopup.js +1 -0
  57. package/dist/components/AppLink.js +1 -1
  58. package/dist/components/AppMarkdown.js +1 -1
  59. package/dist/components/AppMentionInput.js +1 -1
  60. package/dist/components/AppMeter.js +1 -1
  61. package/dist/components/AppMetricStrip.js +1 -1
  62. package/dist/components/AppModal.js +1 -1
  63. package/dist/components/AppMultiSelect.js +1 -1
  64. package/dist/components/AppNavList.js +1 -1
  65. package/dist/components/AppNotificationCenter.js +1 -1
  66. package/dist/components/AppNumberInput.js +1 -1
  67. package/dist/components/AppOnboardingChecklist.js +1 -1
  68. package/dist/components/AppOtpInput.js +1 -1
  69. package/dist/components/AppPageHeader.js +1 -1
  70. package/dist/components/AppPhoneNumberInput.js +1 -1
  71. package/dist/components/AppPopover.js +1 -1
  72. package/dist/components/AppProgress.js +1 -1
  73. package/dist/components/AppRadio.js +1 -1
  74. package/dist/components/AppRadioGroup.js +1 -1
  75. package/dist/components/AppRating.js +1 -1
  76. package/dist/components/AppRepeater.js +1 -1
  77. package/dist/components/AppResourceCard.js +1 -1
  78. package/dist/components/AppRichText.js +1 -1
  79. package/dist/components/AppRouteError.js +1 -1
  80. package/dist/components/AppScoreScale.js +1 -1
  81. package/dist/components/AppSearch.js +1 -1
  82. package/dist/components/AppSectionHero.js +1 -1
  83. package/dist/components/AppSectionLeadCapture.js +1 -1
  84. package/dist/components/AppSectionLogos.js +1 -1
  85. package/dist/components/AppSegmented.js +1 -1
  86. package/dist/components/AppSelect.js +1 -1
  87. package/dist/components/AppShell.js +1 -1
  88. package/dist/components/AppSlider.js +1 -1
  89. package/dist/components/AppSortableList.js +1 -1
  90. package/dist/components/AppSparkline.js +1 -1
  91. package/dist/components/AppSplash.js +1 -1
  92. package/dist/components/AppSplitButton.js +1 -1
  93. package/dist/components/AppSplitView.js +1 -1
  94. package/dist/components/AppStatusBadge.js +1 -1
  95. package/dist/components/AppStepper.js +1 -1
  96. package/dist/components/AppSwitch.js +1 -1
  97. package/dist/components/AppTablePagination.js +1 -1
  98. package/dist/components/AppTableToolbar.js +1 -1
  99. package/dist/components/AppTabs.js +1 -1
  100. package/dist/components/AppTagInput.js +1 -1
  101. package/dist/components/AppTextarea.js +1 -1
  102. package/dist/components/AppTimePicker.js +1 -1
  103. package/dist/components/AppTimeline.js +1 -1
  104. package/dist/components/AppToast.js +1 -1
  105. package/dist/components/AppToolbar.js +1 -1
  106. package/dist/components/AppTooltip.js +1 -1
  107. package/dist/components/AppUpdateBar.js +1 -1
  108. package/dist/components/AppWhatsNew.js +1 -1
  109. package/dist/components/AppWizard.js +1 -1
  110. package/dist/components/AppWorkspaceSwitcher.js +1 -1
  111. package/dist/components/iconCatalogNames.g.js +1 -1
  112. package/dist/components/iconGlyphs.g.js +1 -1
  113. package/dist/components/iconVariants.g.js +1 -1
  114. package/dist/components/useWuiControl.js +1 -1
  115. package/dist/guidance.json +273 -47
  116. package/dist/lib/CheckField.js +1 -1
  117. package/dist/lib/DiscardPrompt.js +1 -1
  118. package/dist/lib/FileItemRow.js +1 -1
  119. package/dist/lib/buttonClass.js +1 -0
  120. package/dist/lib/fieldState.js +1 -0
  121. package/dist/lib/fillLabel.js +1 -0
  122. package/dist/lib/labelWithHelp.js +1 -0
  123. package/dist/lib/linkTarget.js +1 -0
  124. package/dist/lib/sectionShell.js +1 -1
  125. package/dist/lib/vocabulary.js +1 -0
  126. package/dist/markdown-core/dist/links.js +1 -1
  127. package/dist/types/components/AppAccountSwitcher.d.ts +41 -0
  128. package/dist/types/components/AppActionIcon.d.ts +3 -12
  129. package/dist/types/components/AppAsyncBlock.d.ts +24 -0
  130. package/dist/types/components/AppAuthLayout.d.ts +45 -0
  131. package/dist/types/components/AppAutocomplete.d.ts +23 -3
  132. package/dist/types/components/AppAvatar.d.ts +6 -0
  133. package/dist/types/components/AppAvatarGroup.d.ts +6 -0
  134. package/dist/types/components/AppBanner.d.ts +8 -2
  135. package/dist/types/components/AppButton.d.ts +9 -4
  136. package/dist/types/components/AppCalendar.d.ts +3 -1
  137. package/dist/types/components/AppCard.d.ts +16 -4
  138. package/dist/types/components/AppCell.d.ts +36 -0
  139. package/dist/types/components/AppChart.d.ts +14 -0
  140. package/dist/types/components/AppChartCard.d.ts +60 -0
  141. package/dist/types/components/AppCheckbox.d.ts +23 -1
  142. package/dist/types/components/AppChoiceCard.d.ts +21 -0
  143. package/dist/types/components/AppChoiceChip.d.ts +21 -0
  144. package/dist/types/components/AppColorField.d.ts +45 -6
  145. package/dist/types/components/AppCommandPalette.d.ts +6 -0
  146. package/dist/types/components/AppCommentThread.d.ts +102 -3
  147. package/dist/types/components/AppCompareTable.d.ts +24 -0
  148. package/dist/types/components/AppConfirmDialog.d.ts +10 -10
  149. package/dist/types/components/AppConfirmProvider.d.ts +5 -6
  150. package/dist/types/components/AppConsentBanner.d.ts +3 -3
  151. package/dist/types/components/AppContextMenu.d.ts +2 -2
  152. package/dist/types/components/AppCopyButton.d.ts +8 -2
  153. package/dist/types/components/AppCountrySelect.d.ts +6 -1
  154. package/dist/types/components/AppDataTable.d.ts +1 -1
  155. package/dist/types/components/AppDatePicker.d.ts +26 -2
  156. package/dist/types/components/AppDateRangePicker.d.ts +32 -2
  157. package/dist/types/components/AppDescriptions.d.ts +4 -1
  158. package/dist/types/components/AppDrawer.d.ts +6 -0
  159. package/dist/types/components/AppDropZone.d.ts +26 -2
  160. package/dist/types/components/AppDropdown.d.ts +7 -7
  161. package/dist/types/components/AppDueDate.d.ts +42 -0
  162. package/dist/types/components/AppEmptyState.d.ts +3 -3
  163. package/dist/types/components/AppErrorBoundary.d.ts +39 -0
  164. package/dist/types/components/AppFileAttachment.d.ts +54 -1
  165. package/dist/types/components/AppFilePicker.d.ts +80 -5
  166. package/dist/types/components/AppFileTiles.d.ts +6 -3
  167. package/dist/types/components/AppFilterBar.d.ts +73 -0
  168. package/dist/types/components/AppFloatingButton.d.ts +70 -0
  169. package/dist/types/components/AppImagePicker.d.ts +64 -4
  170. package/dist/types/components/AppInlineEdit.d.ts +6 -0
  171. package/dist/types/components/AppInput.d.ts +38 -3
  172. package/dist/types/components/AppKanban.d.ts +32 -0
  173. package/dist/types/components/AppLeadPopup.d.ts +122 -0
  174. package/dist/types/components/AppLink.d.ts +3 -0
  175. package/dist/types/components/AppMentionInput.d.ts +18 -1
  176. package/dist/types/components/AppMetricStrip.d.ts +2 -0
  177. package/dist/types/components/AppModal.d.ts +9 -3
  178. package/dist/types/components/AppMultiSelect.d.ts +20 -3
  179. package/dist/types/components/AppNotificationCenter.d.ts +2 -0
  180. package/dist/types/components/AppNumberInput.d.ts +25 -3
  181. package/dist/types/components/AppOnboardingChecklist.d.ts +3 -3
  182. package/dist/types/components/AppOtpInput.d.ts +31 -2
  183. package/dist/types/components/AppPhoneNumberInput.d.ts +25 -1
  184. package/dist/types/components/AppPopover.d.ts +5 -5
  185. package/dist/types/components/AppRadio.d.ts +23 -1
  186. package/dist/types/components/AppRadioGroup.d.ts +26 -2
  187. package/dist/types/components/AppRating.d.ts +42 -3
  188. package/dist/types/components/AppRepeater.d.ts +3 -3
  189. package/dist/types/components/AppResourceCard.d.ts +2 -2
  190. package/dist/types/components/AppRichText.d.ts +10 -3
  191. package/dist/types/components/AppRouteError.d.ts +54 -0
  192. package/dist/types/components/AppScoreScale.d.ts +9 -3
  193. package/dist/types/components/AppSearch.d.ts +17 -2
  194. package/dist/types/components/AppSectionLeadCapture.d.ts +50 -2
  195. package/dist/types/components/AppSectionLogos.d.ts +2 -0
  196. package/dist/types/components/AppSegmented.d.ts +27 -3
  197. package/dist/types/components/AppSelect.d.ts +23 -3
  198. package/dist/types/components/AppShell.d.ts +151 -4
  199. package/dist/types/components/AppSlider.d.ts +29 -1
  200. package/dist/types/components/AppSortableList.d.ts +5 -0
  201. package/dist/types/components/AppSparkline.d.ts +24 -0
  202. package/dist/types/components/AppSplash.d.ts +2 -2
  203. package/dist/types/components/AppSplitButton.d.ts +10 -4
  204. package/dist/types/components/AppSplitView.d.ts +68 -0
  205. package/dist/types/components/AppStepper.d.ts +6 -0
  206. package/dist/types/components/AppSwitch.d.ts +24 -2
  207. package/dist/types/components/AppTablePagination.d.ts +44 -2
  208. package/dist/types/components/AppTableToolbar.d.ts +30 -0
  209. package/dist/types/components/AppTagInput.d.ts +20 -3
  210. package/dist/types/components/AppTextarea.d.ts +21 -1
  211. package/dist/types/components/AppTimePicker.d.ts +19 -2
  212. package/dist/types/components/AppTimeline.d.ts +8 -0
  213. package/dist/types/components/AppToast.d.ts +6 -0
  214. package/dist/types/components/AppToolbar.d.ts +3 -3
  215. package/dist/types/components/AppTooltip.d.ts +7 -4
  216. package/dist/types/components/AppUpdateBar.d.ts +20 -2
  217. package/dist/types/components/AppWhatsNew.d.ts +2 -0
  218. package/dist/types/components/AppWorkspaceSwitcher.d.ts +18 -0
  219. package/dist/types/components/iconGlyphs.g.d.ts +1 -0
  220. package/dist/types/components/iconVariants.g.d.ts +5 -0
  221. package/dist/types/components/useWuiControl.d.ts +3 -1
  222. package/dist/types/index.d.ts +6 -0
  223. package/dist/types/lib/FileItemRow.d.ts +9 -2
  224. package/dist/types/lib/buttonClass.d.ts +9 -0
  225. package/dist/types/lib/fieldState.d.ts +3 -0
  226. package/dist/types/lib/fillLabel.d.ts +1 -0
  227. package/dist/types/lib/labelWithHelp.d.ts +10 -0
  228. package/dist/types/lib/linkTarget.d.ts +30 -0
  229. package/dist/types/lib/sectionShell.d.ts +0 -1
  230. package/dist/types/lib/vocabulary.d.ts +3 -0
  231. package/dist/ui-react.js +1 -1
  232. package/dist/web-core/dist/query/listQuery.js +1 -0
  233. package/package.json +8 -7
@@ -1,21 +1,21 @@
1
1
  {
2
2
  "name": "webority-web",
3
- "version": "0.128.0",
3
+ "version": "0.130.0",
4
4
  "platform": "Web",
5
5
  "kitModuleVersion": 2,
6
6
  "rendererProtocolVersion": 13,
7
7
  "library": {
8
8
  "name": "@webority/ui-react",
9
- "version": "0.128.0"
9
+ "version": "0.130.0"
10
10
  },
11
11
  "files": {
12
12
  "manifest.json": {
13
- "sha256": "23166d1a187dabddb0d719f05977e577152fff7da7b8046272a69d6679e85ca6",
14
- "bytes": 868170
13
+ "sha256": "e9f4c449641506d81c3e9e8bb5c0bee17540e480e1b8fffed79c17bdbeed9ee1",
14
+ "bytes": 971863
15
15
  },
16
16
  "kit.js": {
17
- "sha256": "0f22750cc3d1137b8adeb8070ce62140ca6eb5ed723151d55df078f0383a1af9",
18
- "bytes": 10998717
17
+ "sha256": "9b626b8b2448a98f959f358f92bcf213adbd17f175c3b8b41c32dadd283a8324",
18
+ "bytes": 11133702
19
19
  },
20
20
  "kit.css": {
21
21
  "sha256": "13b14f71fb6ea024945f95cba617b4f1d49f44a65ba7c7ed05d2354805539ef6",
@@ -0,0 +1 @@
1
+ import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./AppAvatar.js";import n from"./AppIcon.js";import r from"./warnUnknownProps.js";import{Dropdown as i}from"react-bootstrap";import{jsx as a,jsxs as o}from"react/jsx-runtime";function s(t){let{marker:n,props:i}=e(`AppAccountSwitcher`,t),{accounts:s=[],currentId:l,onSelect:u,label:d=`Switch account`,linkComponent:f,...p}=i;if(r(`AppAccountSwitcher`,p),s.length===0)return null;let m=s.find(e=>e.id===l)??s[0];return/* @__PURE__ */ o(`div`,{className:`wui-account-switcher`,role:`group`,"aria-label":d,...n,children:[/* @__PURE__ */ a(`div`,{className:`wui-account-switcher-label`,children:d}),/* @__PURE__ */ a(`div`,{className:`wui-account-switcher-list`,children:s.map(e=>/* @__PURE__ */ a(c,{account:e,current:e.id===m.id,onSelect:u,linkComponent:f},e.id))})]})}function c({account:e,current:r,onSelect:s,linkComponent:c}){let{id:l,name:u,description:d,photo:f,badge:p,href:m}=e,h=m?c??`a`:`button`,g=m?c?{to:m}:{href:m}:{type:`button`,onClick:()=>s?.(e)};return/* @__PURE__ */ o(i.Item,{as:h,className:`wui-account-switcher-option${r?` is-active`:``}`,"data-account-id":l,"aria-current":r?`true`:void 0,...g,children:[/* @__PURE__ */ a(t,{name:u,src:f,size:`md`,tone:`auto`}),/* @__PURE__ */ o(`span`,{className:`wui-account-switcher-option-text`,children:[/* @__PURE__ */ a(`span`,{className:`wui-account-switcher-option-name`,children:u}),d?/* @__PURE__ */ a(`span`,{className:`wui-account-switcher-option-note`,children:d}):null]}),p?/* @__PURE__ */ a(`span`,{className:`wui-account-switcher-badge`,children:p}):null,r?/* @__PURE__ */ a(n,{name:`check`,size:16,className:`wui-account-switcher-tick`}):null]})}export{s as default};
@@ -1 +1 @@
1
- import{devWarn as e}from"../lib/devWarn.js";import{shortcutAria as t}from"../lib/shortcutChip.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./renderIconProp.js";import i from"./warnInvalidValue.js";import a from"./warnUnknownProps.js";import o from"./withTooltip.js";import{useRef as s}from"react";import{Fragment as c,jsx as l,jsxs as u}from"react/jsx-runtime";var d=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`],f=[`comfortable`,`compact`];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=``,...g}=c;i(`AppAsyncBlock`,g);let _=`async-block${h?` ${h}`:``}`;return l?/* @__PURE__ */ a(`div`,{className:_,"data-state":`loading`,...s,...g,children:m??/* @__PURE__ */ a(r,{value:0,indeterminate:!0,size:`sm`,label:`Loading`})}):u?/* @__PURE__ */ a(`div`,{className:_,"data-state":`error`,...s,...g,children:/* @__PURE__ */ a(n,{icon:`alert-circle`,title:`Something went wrong`,text:u,action:p?/* @__PURE__ */ a(t,{variant:`secondary`,onClick:p,children:`Retry`}):null})}):d?/* @__PURE__ */ a(`div`,{className:_,"data-state":`empty`,...s,...g,children:/* @__PURE__ */ a(n,{icon:`inbox`,title:`Nothing to show yet`})}):/* @__PURE__ */ a(`div`,{className:_,"data-state":`content`,...s,...g,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};
@@ -0,0 +1 @@
1
+ import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import{jsx as r,jsxs as i}from"react/jsx-runtime";var a=[`centred`,`split`],o={sm:360,md:420,lg:520},s=e=>e!=null&&e!==!1;function c(c){let{marker:l,props:u}=e(`AppAuthLayout`,c),{logo:d,variant:f=`centred`,maxWidth:p=`md`,aside:m,footer:h,children:g,className:_=``,...v}=u;n(`AppAuthLayout`,v),t(`AppAuthLayout`,`variant`,f,a),t(`AppAuthLayout`,`maxWidth`,typeof p==`string`?p:null,Object.keys(o));let{style:y,...b}=v,x=typeof p==`number`&&p>0?p:o[p]??o.md,S=f===`split`&&s(m);return/* @__PURE__ */ i(`div`,{className:`wui-auth ${S?`wui-auth-split`:`wui-auth-centred`}${_?` ${_}`:``}`,style:{"--wui-auth-width":`${x}px`,...y},...l,...b,children:[/* @__PURE__ */ r(`div`,{className:`wui-auth-main`,children:/* @__PURE__ */ i(`div`,{className:`wui-auth-panel`,children:[s(d)&&/* @__PURE__ */ r(`div`,{className:`wui-auth-logo`,children:d}),/* @__PURE__ */ r(`div`,{className:`wui-auth-body`,children:g}),s(h)&&/* @__PURE__ */ r(`div`,{className:`wui-auth-footer`,children:h})]})}),S&&/* @__PURE__ */ r(`aside`,{className:`wui-auth-aside`,children:m})]})}export{c as default};
@@ -1 +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 c from"./warnUnknownProps.js";import{forwardRef as l,useEffect as u,useId as d,useLayoutEffect as f,useRef as p}from"react";import{jsx as m,jsxs as h}from"react/jsx-runtime";import"@webority/ui-elements/elements/autocomplete";var ee=[`sm`,`lg`],te=[],g=(e,t)=>({...e,label:t}),_=(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}]},v=l(function(l,v){let{marker:y,props:b}=t(`AppAutocomplete`,l),{value:x,onChange:S,options:C,valueLabel:w,valueAvatar:T,valueInitials:E,loadOptions:D,placeholder:O=`Search…`,minChars:k,debounce:A,disabled:ne=!1,open:j,size:M,allowCustom:N=!1,name:P,id:F,label:I,error:L,hint:R,required:z=!1,optional:B=!1,help:V,helpLabel:H=`More information`,fieldClassName:U=``,...W}=b;c(`AppAutocomplete`,W),s(`AppAutocomplete`,`size`,M,ee);let G=typeof D==`function`,K=d(),q=F||K,{setRef:J,innerRef:Y}=a({ref:v,value:x??``,on:{change:e=>S?.(e.currentTarget.value,{isCustom:!!e.detail?.isCustom})}}),X=C||te,{portal:re,toElementOptions:Z}=i(X),Q=p(!1),$=p(D);return f(()=>{$.current=D}),u(()=>{let e=Y.current;if(!e||G&&Q.current)return;let t=Z(_(X,x,w),g);o(t,e.options)||(e.options=t)},[X,G,Y,Z,x,w]),u(()=>{let e=Y.current;if(!e||!G||!Q.current)return;let t=e.options,n=_(t,x,w);n!==t&&(e.options=n)},[x,w,G,Y]),u(()=>{let e=Y.current;if(!e||!G)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}},[G,Y]),/* @__PURE__ */ h(`div`,{...y,className:`field${U?` ${U}`:``}`,children:[I&&/* @__PURE__ */ h(`label`,{className:`label`,htmlFor:q,children:[I,B&&!z&&/* @__PURE__ */ m(`span`,{className:`label-optional`,children:` (optional)`}),z&&/* @__PURE__ */ m(r,{}),V&&/* @__PURE__ */ m(n,{label:H,children:V})]}),/* @__PURE__ */ m(`wui-autocomplete`,{"aria-label":typeof I==`string`?I:void 0,"aria-describedby":L?`${q}-error`:R?`${q}-hint`:void 0,"aria-invalid":L?`true`:void 0,id:q,ref:J,name:P,placeholder:O,remote:G?``:void 0,"min-chars":k==null?void 0:String(k),debounce:A==null?void 0:String(A),size:M||void 0,"allow-custom":N?``:void 0,disabled:ne?``:void 0,open:j?``:void 0,required:z?``:void 0,"value-avatar":T||void 0,"value-initials":E||void 0,...W}),re,/* @__PURE__ */ m(e,{error:L,hint:R,errorId:`${q}-error`,hintId:`${q}-hint`})]})});export{v 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=``,...R}=b;i(`AppAvatar`,R),r(`AppAvatar`,`shape`,w,d),r(`AppAvatar`,`tone`,T,f),r(`AppAvatar`,`status`,E,p),r(`AppAvatar`,`iconVariant`,A,m);let{style:z,...B}=R,[V,H]=s(!1);o(()=>{H(!1)},[S]);let U=typeof C==`string`&&h.has(C),W=U?null:typeof C==`number`||/^\d+$/.test(C)?`${C}px`:C,G=M!=null||N!=null,K=S!=null&&S!==``&&!V,q=[`avatar`,U&&C!==`md`?`avatar-${C}`:``,w===`circle`?``:`avatar-${w}`,T===`primary`?``:`avatar-${T}`,D?`avatar-ring`:``,G?`avatar-clickable`:``,L].filter(Boolean).join(` `),J={};W&&(J[`--avatar-size`]=W),T===`auto`&&(J[`--avatar-hue`]=v(x));let Y=Object.keys(J).length||z?{...J,...z}:void 0,X=/* @__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)}),Z=/* @__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:[X,K&&/* @__PURE__ */ l(`img`,{className:`avatar-img`,src:S,alt:G?``:x||`Profile photo`,onError:()=>H(!0)}),Z]});if(M!=null){let e=P||`a`,t=P?{to:M}:{href:M};return a(/* @__PURE__ */ l(e,{className:q,style:Y,...g,...B,"aria-label":O||x,...t,onClick:N,children:Q}),F,I)}if(N!=null)return a(/* @__PURE__ */ l(`button`,{type:`button`,className:q,style:Y,...g,...B,"aria-label":O||x,onClick:N,children:Q}),F,I);if(K)return a(/* @__PURE__ */ l(`span`,{className:q,style:Y,...g,...B,children:Q}),F,I);let $=O?.trim()||x?.trim();return a($?/* @__PURE__ */ l(`span`,{className:q,style:Y,...g,...B,role:`img`,"aria-label":$,children:Q}):/* @__PURE__ */ l(`span`,{className:q,style:Y,...g,...B,"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{jsx as r,jsxs as i}from"react/jsx-runtime";var a=[`tight`,`normal`,`loose`],o={xs:20,sm:24,md:32,lg:48,xl:64,"2xl":96};function s(e){return e==null?null:typeof e==`number`?`${e}px`:o[e]==null?/^\d+$/.test(e)?`${e}px`:e:`${o[e]}px`}function c(o){let{marker:c,props:l}=e(`AppAvatarGroup`,o),{children:u,size:d,spacing:f=`normal`,overflow:p,className:m=``,...h}=l;n(`AppAvatarGroup`,h),t(`AppAvatarGroup`,`spacing`,f,a);let{style:g,..._}=h,v=[`avatar-group`,f===`normal`?``:`avatar-group-${f}`,m].filter(Boolean).join(` `),y=s(d),b=y?{"--avatar-size":y,...g}:g,x=typeof p==`string`?Number.parseInt(p,10):p,S=typeof p==`string`&&!/^\d+$/.test(p)?p:`+${x}`;return/* @__PURE__ */ i(`div`,{className:v,style:b,...c,..._,children:[u,x>0&&/* @__PURE__ */ r(`span`,{className:`avatar avatar-more`,role:`img`,"aria-label":`${x} more`,children:S})]})}export{c as default};
1
+ import e from"../lib/fillLabel.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./warnInvalidValue.js";import r from"./warnUnknownProps.js";import{jsx as i,jsxs as a}from"react/jsx-runtime";var o=[`tight`,`normal`,`loose`],s={xs:20,sm:24,md:32,lg:48,xl:64,"2xl":96};function c(e){return e==null?null:typeof e==`number`?`${e}px`:s[e]==null?/^\d+$/.test(e)?`${e}px`:e:`${s[e]}px`}function l(s){let{marker:l,props:u}=t(`AppAvatarGroup`,s),{children:d,size:f,spacing:p=`normal`,overflow:m,moreLabel:h=`{count} more`,className:g=``,..._}=u;r(`AppAvatarGroup`,_),n(`AppAvatarGroup`,`spacing`,p,o);let{style:v,...y}=_,b=[`avatar-group`,p===`normal`?``:`avatar-group-${p}`,g].filter(Boolean).join(` `),x=c(f),S=x?{"--avatar-size":x,...v}:v,C=typeof m==`string`?Number.parseInt(m,10):m,w=typeof m==`string`&&!/^\d+$/.test(m)?m:`+${C}`;return/* @__PURE__ */ a(`div`,{className:b,style:S,...l,...y,children:[d,C>0&&/* @__PURE__ */ i(`span`,{className:`avatar avatar-more`,role:`img`,"aria-label":e(h,{count:C}),children:w})]})}export{l as default};
@@ -1 +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=``,...y}=d;i(`AppBanner`,y),r(`AppBanner`,`tone`,f,c);let[b,x]=a(!0);if(!b)return null;let S=c.includes(f)?f:`info`,C=_!=null&&_!==!1,w=()=>{x(!1),g?.()};return/* @__PURE__ */ s(`div`,{className:`wui-banner wui-banner-${S}${C?` wui-banner-has-action`:``}${v?` ${v}`:``}`,role:`status`,...u,...y,children:[p&&/* @__PURE__ */ o(`span`,{className:`wui-banner-icon`,children:n(p,{size:18})}),/* @__PURE__ */ o(`div`,{className:`wui-banner-body`,children:m}),C&&/* @__PURE__ */ o(`div`,{className:`wui-banner-action`,children:_}),h&&/* @__PURE__ */ o(`button`,{type:`button`,className:`wui-banner-dismiss`,"aria-label":`Dismiss`,onClick:w,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`};function d(e){return`btn-${u[e]??`primary`}`}var f={sm:14,md:16,lg:20},p=[`sheen`,`fill`,`expand`,`glow`,`roll`,`none`],m=[`rounded`,`pill`,`sharp`],h=[`button`,`submit`,`reset`],g=/* @__PURE__ */ new Set([!0,!1,...Array.from({length:100},(e,t)=>t+1)]),_=[`linear`,`outline`,`bold`,`bulk`,`broken`,`twotone`],v=e=>e===`pill`||e===`sharp`?`wui-btn-shape-${e}`:``;function y(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 b(e,t,n,i){if(!e)return null;let a=n=>typeof e==`string`?/* @__PURE__ */ c(r,{name:e,size:f[t]??f.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 x(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:f[n]??f.md,variant:i,className:a}):/* @__PURE__ */ c(`span`,{className:`d-inline-flex ${a}`,children:e})}function S(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:f[t]??f.md,variant:n}):e}):null}function C(r){let{marker:d,props:C}=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}=C;a(`AppButton`,G),i(`AppButton`,`vibrate`,W,g);let K=W===!0?10:Number.isInteger(W)&&W>=1&&W<=100?W:0;R!==void 0&&i(`AppButton`,`animation`,R,p);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(f)),i(`AppButton`,`shape`,B,m),i(`AppButton`,`type`,D,h),V!==void 0&&i(`AppButton`,`iconVariant`,V,_),P){let e=[`btn`,`btn-${u[T]??`primary`}`,E===`sm`?`btn-sm`:E===`lg`?`btn-lg`:``,A?`w-100`:``,v(B),`btn-static`,H].filter(Boolean).join(` `);return o(/* @__PURE__ */ l(`span`,{className:e,...d,...G,children:[x(j,`left`,E,V),w,x(M,`right`,E,V)]}),F,I)}let Y=[A?`w-100`:``,O?`is-loading`:``,R&&p.includes(R)?`btn-anim-${R}`:``,J?`wui-btn-pin-end`:``,v(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&&x(j,`left`,E,V),q?y(w):w,!O&&(q?b(M,E,J,V):J?S(M,E,V):x(M,`right`,E,V)),!Q&&t(L)]}),F,I,L)}export{d as buttonVariantClass,C 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{devWarn as e}from"../lib/devWarn.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./warnInvalidValue.js";import r from"./warnUnknownProps.js";import{forwardRef as i,useCallback as a,useEffect as o,useLayoutEffect as s,useRef as c,useState as l}from"react";import{jsx as u}from"react/jsx-runtime";var d=`wui-calendar:event-click`,f=`wui-calendar:date-click`,p=`wui-calendar:range-change`,m=[`month`,`week`,`day`,`list`],h=`This calendar couldn't load. Try again in a moment.`,g=i(function(i,g){let{marker:_,props:v}=t(`AppCalendar`,i),{label:y,events:b,eventsUrl:x,view:S,date:C,emptyText:w,errorText:T,firstDay:E,onEventClick:D,onDateClick:O,onRangeChange:k,className:A=``,style:j,...M}=v;r(`AppCalendar`,M),n(`AppCalendar`,`view`,S,m);let N=c(null),P=c(``),F=c({onEventClick:D,onDateClick:O,onRangeChange:k}),[I,L]=l(!1),R=a(e=>{N.current=e,typeof g==`function`?g(e):g&&(g.current=e)},[g]);return o(()=>{F.current={onEventClick:D,onDateClick:O,onRangeChange:k}}),s(()=>{let e=N.current;if(!e)return;let t=b==null?``:JSON.stringify(b);t!==P.current&&(P.current=t,e.events=b??null)}),o(()=>{let e=N.current,t=[[d,e=>{F.current.onEventClick?.(e.detail)===!1&&e.preventDefault()}],[f,e=>F.current.onDateClick?.(e.detail)],[p,e=>F.current.onRangeChange?.(e.detail)]];for(let[n,r]of t)e.addEventListener(n,r);return()=>{for(let[n,r]of t)e.removeEventListener(n,r)}},[]),o(()=>{let t=!0;return import(`@webority/ui-elements/calendar`).catch(n=>{e(`[AppCalendar] the calendar failed to load:`,n?.message),t&&L(!0)}),()=>{t=!1}},[]),I?/* @__PURE__ */ u(`div`,{..._,className:A||void 0,style:j,role:`status`,children:/* @__PURE__ */ u(`p`,{className:`wui-calendar-status-text`,children:T||h})}):/* @__PURE__ */ u(`wui-calendar`,{ref:R,label:y||void 0,"events-url":x||void 0,view:S||void 0,date:C||void 0,"empty-text":w||void 0,"error-text":T||void 0,"first-day":E==null?void 0:String(E),className:A||void 0,style:j,..._,...M})});export{g 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 d=`wui-calendar:event-click`,f=`wui-calendar:date-click`,p=`wui-calendar:range-change`,m=[`month`,`week`,`day`,`list`],h=`This calendar couldn't load. Try again in a moment.`,g=i(function(i,g){let{marker:_,props:v}=t(`AppCalendar`,i),{label:y,events:b,eventsUrl:x,view:S,date:C,emptyText:w,errorText:T,firstDay:E,timeZone:D,onEventClick:O,onDateClick:k,onRangeChange:A,className:j=``,style:M,...N}=v;r(`AppCalendar`,N),n(`AppCalendar`,`view`,S,m);let P=c(null),F=c(``),I=c({onEventClick:O,onDateClick:k,onRangeChange:A}),[L,R]=l(!1),z=a(e=>{P.current=e,typeof g==`function`?g(e):g&&(g.current=e)},[g]);return o(()=>{I.current={onEventClick:O,onDateClick:k,onRangeChange:A}}),s(()=>{let e=P.current;if(!e)return;let t=b==null?``:JSON.stringify(b);t!==F.current&&(F.current=t,e.events=b??null)}),o(()=>{let e=P.current,t=[[d,e=>{I.current.onEventClick?.(e.detail)===!1&&e.preventDefault()}],[f,e=>I.current.onDateClick?.(e.detail)],[p,e=>I.current.onRangeChange?.(e.detail)]];for(let[n,r]of t)e.addEventListener(n,r);return()=>{for(let[n,r]of t)e.removeEventListener(n,r)}},[]),o(()=>{let t=!0;return import(`@webority/ui-elements/calendar`).catch(n=>{e(`[AppCalendar] the calendar failed to load:`,n?.message),t&&R(!0)}),()=>{t=!1}},[]),L?/* @__PURE__ */ u(`div`,{..._,className:j||void 0,style:M,role:`status`,children:/* @__PURE__ */ u(`p`,{className:`wui-calendar-status-text`,children:T||h})}):/* @__PURE__ */ u(`wui-calendar`,{ref:z,label:y||void 0,"events-url":x||void 0,view:S||void 0,date:C||void 0,"empty-text":w||void 0,"error-text":T||void 0,"first-day":E==null?void 0:String(E),"time-zone":D||void 0,className:j||void 0,style:M,..._,...N})});export{g as default};
@@ -1 +1 @@
1
- import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./AppIcon.js";import n from"./warnInvalidValue.js";import r from"./warnUnknownProps.js";import{useState as i}from"react";import{Card as a}from"react-bootstrap";import{Fragment as o,jsx as s,jsxs as c}from"react/jsx-runtime";var l=[`default`,`elevated`,`outlined`,`muted`,`accent`],u=[`primary`,`success`,`warning`,`danger`,`info`],d=[`none`,`sm`,`md`,`lg`],f=[`sans`,`serif`],p={xs:320,sm:420,md:560,lg:720};function m(m){let{marker:h,props:g}=e(`AppCard`,m),{title:_,subtitle:v,headerIcon:y,titleClassName:b=``,titleFont:x=`sans`,header:S,headerExtra:C,headerActions:w,footer:T,media:E,children:D,variant:O=`default`,tone:k=`primary`,padding:A=`md`,maxWidth:j,className:M=``,bodyClassName:ee=``,headerClassName:te=``,body:N=!0,lifted:P=!1,href:F,onClick:I,linkComponent:L,onClose:R,dismissible:z,closeLabel:B=`Close`,...V}=g,[H,U]=i(!1);r(`AppCard`,V),n(`AppCard`,`variant`,O,l),n(`AppCard`,`tone`,k,u),n(`AppCard`,`padding`,A,d),n(`AppCard`,`titleFont`,x,f);let{style:W,...G}=V,K=F!=null||I!=null,q=[O&&O!=="default"?`card-${O}`:``,O===`accent`&&k&&k!==`primary`?`tone-${k}`:``,A&&A!==`md`?`card-pad-${A}`:``,P?`card-lifted`:``,j==null?``:`card-constrained`,K?`card-clickable`:``,M].filter(Boolean).join(` `)||void 0,J=j==null?void 0:p[j]==null?typeof j==`number`?`${j}px`:j:`${p[j]}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`,ne=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=_!=null||v!=null||y!=null,re=S!=null||Q||C!=null||w!=null||Z,$=y==null?null:typeof y==`string`?/* @__PURE__ */ s(t,{name:y,size:18}):y;return H?null:/* @__PURE__ */ c(a,{className:q,style:Y,...h,...G,...X,children:[E!=null&&/* @__PURE__ */ s(`div`,{className:`card-media`,children:E}),re&&/* @__PURE__ */ c(a.Header,{className:te||void 0,children:[S??/* @__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:[_!=null&&/* @__PURE__ */ s(`div`,{className:[`card-title`,b].filter(Boolean).join(` `),style:x===`serif`?{fontFamily:`var(--wui-font-display)`}:void 0,children:_}),v!=null&&/* @__PURE__ */ s(`div`,{className:`card-subtitle`,children:v})]})]}),C,w!=null&&/* @__PURE__ */ s(`div`,{className:`card-header-actions`,children:w})]}),ne]}),N?/* @__PURE__ */ s(a.Body,{className:ee||void 0,children:D}):D,T!=null&&/* @__PURE__ */ s(`div`,{className:`card-footer`,children:T})]})}export{m 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};
@@ -0,0 +1 @@
1
+ import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./warnUnknownProps.js";import{jsx as n,jsxs as r}from"react/jsx-runtime";var i=(...e)=>e.filter(Boolean).join(` `),a=e=>e==null||e===``;function o(o){let{marker:s,props:c}=e(`AppCell`,o),{primary:l,secondary:u,href:d,mono:f=!1,numeric:p=!1,className:m=``,...h}=c;t(`AppCell`,h);let g=a(l)?`-`:l;return/* @__PURE__ */ r(`div`,{className:i(`wui-cell`,p&&`wui-cell-numeric`,f&&`wui-cell-mono`,m),...s,...h,children:[d?/* @__PURE__ */ n(`a`,{className:`wui-cell-primary`,href:d,children:g}):/* @__PURE__ */ n(`span`,{className:`wui-cell-primary`,children:g}),a(u)?null:/* @__PURE__ */ n(`span`,{className:`wui-cell-secondary`,children:u})]})}export{o 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 u=`wui-chart:select`,d=`wui-chart:legend-change`,te=`wui-chart:ready`,f=[`line`,`area`,`column`,`bar`,`donut`,`heatmap`,`calendar`,`funnel`,`gauge`,`waterfall`,`treemap`,`sankey`,`scatter`,`bubble`,`multiples`],ne=[`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),renderer:y(e.renderer)}),S=(e,t)=>t!=null&&Object.keys(e).every(n=>Object.is(e[n],t[n])),C=e=>{try{return JSON.stringify(e)}catch{return null}},w=i(function(i,g){let{marker:_,props:y}=t(`AppChart`,i),{type:b,title:w,description:T,data:E,x:D,series:O,group:k,to:A,size:j,trend:M,zoom:N,bands:P,stack:F,y:I,target:L,centerLabel:R,height:z,state:B,emptyText:V,errorText:H,renderer:U,view:W,onSelect:G,onLegendChange:K,onReady:q,className:J=``,style:Y,...X}=y;r(`AppChart`,X),n(`AppChart`,`type`,b,f),n(`AppChart`,`stack`,F,ne),n(`AppChart`,`state`,B,p),n(`AppChart`,`renderer`,U,m),n(`AppChart`,`view`,W,h),w||v();let Z=c(null),Q=c({props:null,signature:null}),$=c({onSelect:G,onLegendChange:K,onReady:q}),[ie,ae]=ee(!1),oe=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:w,description:T,data:E,x:D,series:O,group:k,to:A,size:j,trend:M,zoom:N,bands:P,stack:F,y:I,target:L,centerLabel:R,height:z,state:B,emptyText:V,errorText:H,renderer:U};if(S(t,Q.current.props))return;Q.current.props=t;let n=x(t),r=C(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=[[u,t(`onSelect`)],[d,t(`onLegendChange`)],[te,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&&ae(!0)}),()=>{t=!1}},[]),ie?/* @__PURE__ */ l(`div`,{..._,className:J||void 0,style:Y,role:`status`,children:/* @__PURE__ */ l(`p`,{className:`wui-chart-state-text`,children:H||re})}):/* @__PURE__ */ l(`wui-chart`,{ref:oe,view:W||void 0,className:J||void 0,style:Y,..._,...X})});export{w 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{devWarn as e}from"../lib/devWarn.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./AppButton.js";import r from"./AppCard.js";import i from"./AppDropdown.js";import a from"./AppIcon.js";import o from"./AppSegmented.js";import s from"./warnUnknownProps.js";import{useLayoutEffect as c,useRef as l,useState as u}from"react";import{Dropdown as d}from"react-bootstrap";import{Fragment as f,jsx as p,jsxs as m}from"react/jsx-runtime";var h=[{value:`chart`,label:`Chart`,icon:`chart`},{value:`table`,label:`Table`,icon:`grid`}],g=()=>{try{return process.env.NODE_ENV!==`production`}catch{return!0}},_=!1;function v(){!_&&g()&&(_=!0,e("[@webority/ui-react] <AppChartCard> has no `title`, which is the card's heading and names its menu button."))}var y=e=>e.getAttribute(`view`)===`table`?`table`:`chart`;function b(e){let{marker:g,props:_}=t(`AppChartCard`,e),{title:b,subtitle:x,toolbar:S=!0,onRetry:C,footer:w,children:T,className:E=``,...D}=_;s(`AppChartCard`,D),b||v();let O=l(null),k=l(null),[A,j]=u(`chart`),M=l(A);M.current=A;let[N,P]=u(!0),F=()=>O.current?.querySelector(`wui-chart`);c(()=>{let e=O.current,t=()=>{let t=e.querySelector(`wui-chart`);t&&(t===k.current?j(y(t)):(k.current=t,t.hasAttribute(`view`)?j(y(t)):M.current!==`chart`&&t.setAttribute(`view`,M.current)))};t();let n=new MutationObserver(t);return n.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`view`]}),()=>n.disconnect()},[]);let I=/* @__PURE__ */ m(f,{children:[/* @__PURE__ */ p(`button`,{type:`button`,className:`topbar-icon-btn wui-chart-card-tool wui-chart-card-legend-tool`,"aria-pressed":N,"aria-label":`Show legend`,title:`Show or hide the legend`,onClick:()=>P(!N),children:/* @__PURE__ */ p(a,{name:`list`,size:16})}),/* @__PURE__ */ p(o,{size:`sm`,label:`View`,options:h,value:A,onChange:e=>{j(e),F()?.setAttribute(`view`,e)}}),/* @__PURE__ */ m(i,{icon:`more-horizontal`,label:b?`More actions for ${b}`:`More actions`,children:[/* @__PURE__ */ m(d.Item,{as:`button`,type:`button`,onClick:()=>F()?.exportPng?.(),children:[/* @__PURE__ */ p(a,{name:`image`,size:16}),`Download PNG`]}),/* @__PURE__ */ m(d.Item,{as:`button`,type:`button`,onClick:()=>F()?.exportCsv?.(),children:[/* @__PURE__ */ p(a,{name:`download`,size:16}),`Download CSV`]})]})]}),L=[`wui-chart-card`,N?``:`wui-chart-card-legend-off`,E].filter(Boolean).join(` `);return/* @__PURE__ */ m(r,{title:b,subtitle:x,headerActions:S?I:void 0,footer:w,className:L,...g,...D,children:[/* @__PURE__ */ p(`div`,{ref:O,children:T}),C&&/* @__PURE__ */ p(`div`,{className:`wui-chart-card-retry`,children:/* @__PURE__ */ p(n,{variant:`outline`,size:`sm`,onClick:C,children:`Try again`})})]})}export{b as default};
1
+ import{devWarn as e}from"../lib/devWarn.js";import t from"../lib/fillLabel.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./AppButton.js";import i from"./AppCard.js";import a from"./AppDropdown.js";import o from"./AppIcon.js";import s from"./AppSegmented.js";import c from"./warnUnknownProps.js";import{useLayoutEffect as l,useMemo as u,useRef as d,useState as f}from"react";import{Dropdown as p}from"react-bootstrap";import{Fragment as m,jsx as h,jsxs as g}from"react/jsx-runtime";var _=()=>{try{return process.env.NODE_ENV!==`production`}catch{return!0}},v=!1;function y(){!v&&_()&&(v=!0,e("[@webority/ui-react] <AppChartCard> has no `title`, which is the card's heading and names its menu button."))}var b=e=>e.getAttribute(`view`)===`table`?`table`:`chart`;function x(e){let{marker:_,props:v}=n(`AppChartCard`,e),{title:x,subtitle:S,toolbar:C=!0,onRetry:w,footer:T,children:E,className:D=``,legendLabel:O=`Show legend`,legendTitle:k=`Show or hide the legend`,viewLabel:A=`View`,chartViewLabel:j=`Chart`,tableViewLabel:M=`Table`,moreActionsLabel:N=`More actions`,moreActionsForLabel:P=`More actions for {title}`,downloadPngLabel:F=`Download PNG`,downloadCsvLabel:I=`Download CSV`,retryLabel:L=`Try again`,...R}=v;c(`AppChartCard`,R),x||y();let z=d(null),B=d(null),[V,H]=f(`chart`),U=d(V);U.current=V;let[W,G]=f(!0),K=()=>z.current?.querySelector(`wui-chart`);l(()=>{let e=z.current,t=()=>{let t=e.querySelector(`wui-chart`);t&&(t===B.current?H(b(t)):(B.current=t,t.hasAttribute(`view`)?H(b(t)):U.current!==`chart`&&t.setAttribute(`view`,U.current)))};t();let n=new MutationObserver(t);return n.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`view`]}),()=>n.disconnect()},[]);let q=e=>{H(e),K()?.setAttribute(`view`,e)},J=u(()=>[{value:`chart`,label:j,icon:`chart`},{value:`table`,label:M,icon:`grid`}],[j,M]),Y=/* @__PURE__ */ g(m,{children:[/* @__PURE__ */ h(`button`,{type:`button`,className:`topbar-icon-btn wui-chart-card-tool wui-chart-card-legend-tool`,"aria-pressed":W,"aria-label":O,title:k,onClick:()=>G(!W),children:/* @__PURE__ */ h(o,{name:`list`,size:16})}),/* @__PURE__ */ h(s,{size:`sm`,label:A,options:J,value:V,onChange:q}),/* @__PURE__ */ g(a,{icon:`more-horizontal`,label:x?t(P,{title:x}):N,children:[/* @__PURE__ */ g(p.Item,{as:`button`,type:`button`,onClick:()=>K()?.exportPng?.(),children:[/* @__PURE__ */ h(o,{name:`image`,size:16}),F]}),/* @__PURE__ */ g(p.Item,{as:`button`,type:`button`,onClick:()=>K()?.exportCsv?.(),children:[/* @__PURE__ */ h(o,{name:`download`,size:16}),I]})]})]}),X=[`wui-chart-card`,W?``:`wui-chart-card-legend-off`,D].filter(Boolean).join(` `);return/* @__PURE__ */ g(i,{title:x,subtitle:S,headerActions:C?Y:void 0,footer:T,className:X,..._,...R,children:[/* @__PURE__ */ h(`div`,{ref:z,children:E}),w&&/* @__PURE__ */ h(`div`,{className:`wui-chart-card-retry`,children:/* @__PURE__ */ h(r,{variant:`outline`,size:`sm`,onClick:w,children:L})})]})}export{x as default};
@@ -1 +1 @@
1
- import e from"../lib/CheckField.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./warnInvalidValue.js";import r from"./warnUnknownProps.js";import{forwardRef as i}from"react";import{jsx as a}from"react/jsx-runtime";var o=[`circle`],s=i(function(i,s){let{marker:c,props:l}=t(`AppCheckbox`,i),{label:u,id:d,name:f,error:p,hint:m,shape:h,className:g=``,..._}=l;return r(`AppCheckbox`,_),n(`AppCheckbox`,`shape`,h,o),/* @__PURE__ */ a(e,{rootProps:c,ref:s,label:u,id:d,name:f,error:p,hint:m,className:g,rest:_,inputType:`checkbox`,wrapperClass:h===`circle`?`form-check form-check-circle`:`form-check`})});export{s 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{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={sm:` wui-struct-card-sm`,md:``,lg:` wui-struct-card-lg`},c={inline:``,stacked:` wui-struct-card-stacked`},l={filled:` wui-struct-card-filled`},u={sm:16,md:18,lg:22};function d(d){let{marker:f,props:p}=e(`AppChoiceCard`,d),{name:m,multiple:h=!1,value:g,checked:_,onChange:v,icon:y,iconNode:b,iconSize:x,image:S,imageAlt:C=``,children:w,title:T,description:E,checkIcon:D=`check`,checkSize:O=18,hideCheck:k=!1,disabled:A=!1,size:j=`md`,layout:M=`inline`,selectedStyle:N,className:P=``,...F}=p;r(`AppChoiceCard`,F),n(`AppChoiceCard`,`size`,j,Object.keys(s)),n(`AppChoiceCard`,`layout`,M,Object.keys(c)),n(`AppChoiceCard`,`selectedStyle`,N,Object.keys(l));let I=s[j]??``,L=c[M]??``,R=l[N]??``,z=x??u[j]??u.md;return/* @__PURE__ */ o(`label`,{className:`struct-card${S?` struct-card-img-card`:``}${I}${L}${R}${k?` wui-struct-card-no-check`:``}${P?` ${P}`:``}`,"aria-disabled":A||void 0,...f,...F,children:[/* @__PURE__ */ a(`input`,{type:h?`checkbox`:`radio`,name:m,value:g,className:`struct-card-input`,checked:_,onChange:v,disabled:A}),S?/* @__PURE__ */ a(`span`,{className:`struct-card-media`,children:/* @__PURE__ */ a(`img`,{className:`struct-card-img`,src:S,alt:C})}):b||y?/* @__PURE__ */ a(`span`,{className:`struct-card-ic`,children:b||/* @__PURE__ */ o(i,{children:[/* @__PURE__ */ a(`span`,{className:`wui-struct-card-glyph`,children:/* @__PURE__ */ a(t,{name:y,size:z})}),/* @__PURE__ */ a(`span`,{className:`wui-struct-card-glyph-on`,children:/* @__PURE__ */ a(t,{name:y,size:z,variant:`bold`})})]})}):null,/* @__PURE__ */ a(`span`,{className:`struct-card-body`,children:w||/* @__PURE__ */ o(i,{children:[T&&/* @__PURE__ */ a(`span`,{className:`struct-card-title`,children:T}),E&&/* @__PURE__ */ a(`span`,{className:`struct-card-desc`,children:E})]})}),!k&&/* @__PURE__ */ a(`span`,{className:`struct-card-check`,children:/* @__PURE__ */ a(t,{name:D,size:O})})]})}export{d as default};
1
+ import{FIELD_BUSY_CLASS as e,blockWhenReadOnly as t}from"../lib/fieldState.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./AppIcon.js";import i from"./AppInfoTip.js";import a from"./warnInvalidValue.js";import o from"./warnUnknownProps.js";import{Fragment as s,jsx as c,jsxs as l}from"react/jsx-runtime";var u={sm:` wui-struct-card-sm`,md:``,lg:` wui-struct-card-lg`},d={inline:``,stacked:` wui-struct-card-stacked`},f={filled:` wui-struct-card-filled`},p={sm:16,md:18,lg:22};function m(m){let{marker:h,props:g}=n(`AppChoiceCard`,m),{name:_,multiple:v=!1,value:y,checked:b,onChange:x,icon:S,iconNode:C,iconSize:w,image:T,imageAlt:E=``,children:D,title:O,description:k,help:A,helpLabel:j=`More information`,checkIcon:M=`check`,checkSize:N=18,hideCheck:P=!1,disabled:F=!1,readOnly:I=!1,loading:L=!1,size:R=`md`,layout:z=`inline`,selectedStyle:B,className:V=``,...H}=g;o(`AppChoiceCard`,H),a(`AppChoiceCard`,`size`,R,Object.keys(u)),a(`AppChoiceCard`,`layout`,z,Object.keys(d)),a(`AppChoiceCard`,`selectedStyle`,B,Object.keys(f));let U=u[R]??``,W=d[z]??``,G=f[B]??``,K=w??p[R]??p.md;return/* @__PURE__ */ l(`label`,{className:`struct-card${T?` struct-card-img-card`:``}${U}${W}${G}${P?` wui-struct-card-no-check`:``}${V?` ${V}`:``}${L?` ${e}`:``}`,"aria-disabled":F||void 0,"aria-busy":L||void 0,...h,...H,children:[/* @__PURE__ */ c(`input`,{type:v?`checkbox`:`radio`,name:_,value:y,className:`struct-card-input`,checked:b,onChange:x,onClick:t(I||L),"aria-readonly":I||void 0,disabled:F||L}),T?/* @__PURE__ */ c(`span`,{className:`struct-card-media`,children:/* @__PURE__ */ c(`img`,{className:`struct-card-img`,src:T,alt:E})}):C||S?/* @__PURE__ */ c(`span`,{className:`struct-card-ic`,children:C||/* @__PURE__ */ l(s,{children:[/* @__PURE__ */ c(`span`,{className:`wui-struct-card-glyph`,children:/* @__PURE__ */ c(r,{name:S,size:K})}),/* @__PURE__ */ c(`span`,{className:`wui-struct-card-glyph-on`,children:/* @__PURE__ */ c(r,{name:S,size:K,variant:`bold`})})]})}):null,/* @__PURE__ */ l(`span`,{className:`struct-card-body`,children:[D||/* @__PURE__ */ l(s,{children:[O&&/* @__PURE__ */ c(`span`,{className:`struct-card-title`,children:O}),k&&/* @__PURE__ */ c(`span`,{className:`struct-card-desc`,children:k})]}),A&&/* @__PURE__ */ c(i,{label:j,children:A})]}),!P&&/* @__PURE__ */ c(`span`,{className:`struct-card-check`,children:/* @__PURE__ */ c(r,{name:M,size:N})})]})}export{m as default};
@@ -1 +1 @@
1
- import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import{jsx as r,jsxs as i}from"react/jsx-runtime";var a=[`sm`,`md`,`lg`],o=[`soft`,`solid`];function s(s){let{marker:c,props:l}=e(`AppChoiceChip`,s),{multiple:u=!0,label:d,name:f,value:p,checked:m,onChange:h,children:g,count:_,size:v=`md`,variant:y=`soft`,disabled:b=!1,className:x=``,...S}=l;return n(`AppChoiceChip`,S),t(`AppChoiceChip`,`size`,v,a),t(`AppChoiceChip`,`variant`,y,o),/* @__PURE__ */ i(`label`,{className:`choice-chip${m?` checked`:``}${v===`sm`?` choice-chip-sm`:v===`lg`?` choice-chip-lg`:``}${y===`solid`?` wui-choice-chip-solid`:``}${x?` ${x}`:``}`,...c,...S,children:[/* @__PURE__ */ r(`input`,{type:u?`checkbox`:`radio`,name:f,value:p,checked:m,disabled:b,onChange:h}),/* @__PURE__ */ r(`span`,{children:d??g}),_!=null&&/* @__PURE__ */ r(`span`,{className:`count`,children:_})]})}export{s as default};
1
+ import{FIELD_BUSY_CLASS as e,blockWhenReadOnly as t}from"../lib/fieldState.js";import{splitMarkerProps as n}from"../lib/wuiMarker.js";import r from"./AppInfoTip.js";import i from"./warnInvalidValue.js";import a from"./warnUnknownProps.js";import{Fragment as o,jsx as s,jsxs as c}from"react/jsx-runtime";var l=[`sm`,`md`,`lg`],u=[`soft`,`solid`];function d(d){let{marker:f,props:p}=n(`AppChoiceChip`,d),{multiple:m=!0,label:h,name:g,value:_,checked:v,onChange:y,children:b,count:x,help:S,helpLabel:C=`More information`,size:w=`md`,variant:T=`soft`,disabled:E=!1,readOnly:D=!1,loading:O=!1,className:k=``,...A}=p;return a(`AppChoiceChip`,A),i(`AppChoiceChip`,`size`,w,l),i(`AppChoiceChip`,`variant`,T,u),/* @__PURE__ */ c(o,{children:[/* @__PURE__ */ c(`label`,{className:`choice-chip${v?` checked`:``}${w===`sm`?` choice-chip-sm`:w===`lg`?` choice-chip-lg`:``}${T===`solid`?` wui-choice-chip-solid`:``}${k?` ${k}`:``}${O?` ${e}`:``}`,"aria-busy":O||void 0,...f,...A,children:[/* @__PURE__ */ s(`input`,{type:m?`checkbox`:`radio`,name:g,value:_,checked:v,disabled:E||O,"aria-readonly":D||void 0,onClick:t(D||O),onChange:y}),/* @__PURE__ */ s(`span`,{children:h??b}),x!=null&&/* @__PURE__ */ s(`span`,{className:`count`,children:x})]}),S&&/* @__PURE__ */ s(r,{label:C,children:S})]})}export{d as default};
@@ -1 +1 @@
1
- import e from"../lib/FieldMessage.js";import{splitMarkerProps as t}from"../lib/wuiMarker.js";import n from"./AppRequiredMark.js";import r from"./warnInvalidValue.js";import i from"./warnUnknownProps.js";import{useId as a}from"react";import{jsx as o,jsxs as s}from"react/jsx-runtime";var c=[`sm`,`md`,`lg`];function l(l){let{marker:u,props:d}=t(`AppColorField`,l),{value:f=`#000000`,onChange:p,label:m,required:h=!1,optional:g=!1,error:_,hint:v,name:y,id:b,disabled:x=!1,size:S=`md`,className:C=``,fieldClassName:w=``,...T}=d;i(`AppColorField`,T),r(`AppColorField`,`size`,S,c);let E=a(),D=b||E,O=_?`${D}-error`:v?`${D}-hint`:void 0,k=e=>/^#[0-9a-f]{6}$/i.test(e),A=S===`sm`?` color-field-sm`:S===`lg`?` color-field-lg`:``,j=S===`sm`?` input-sm`:S===`lg`?` input-lg`:``;return/* @__PURE__ */ s(`div`,{...u,className:`field${w?` ${w}`:``}`,children:[m&&/* @__PURE__ */ s(`label`,{className:`label`,htmlFor:D,children:[m,g&&!h&&/* @__PURE__ */ o(`span`,{className:`label-optional`,children:` (optional)`}),h&&/* @__PURE__ */ o(n,{})]}),/* @__PURE__ */ s(`div`,{className:`color-field${A}`,children:[/* @__PURE__ */ o(`input`,{type:`color`,className:`color-field-swatch`,value:k(f)?f:`#000000`,onChange:e=>p?.(e.target.value),disabled:x,"aria-label":`${m||`Colour`}, colour picker`,tabIndex:-1}),/* @__PURE__ */ o(`input`,{type:`text`,className:`input color-field-hex${j}${_?` error`:``}${C?` ${C}`:``}`,id:D,name:y,value:f,onChange:e=>p?.(e.target.value),placeholder:`#4F46E5`,spellCheck:!1,maxLength:7,required:h,disabled:x,"aria-invalid":_?`true`:`false`,"aria-describedby":O,...T})]}),/* @__PURE__ */ o(e,{error:_,hint:v,errorId:`${D}-error`,hintId:`${D}-hint`})]})}export{l 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{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"./AppModal.js";import a from"./AppSpinner.js";import o from"./renderIconProp.js";import s from"./warnUnknownProps.js";import{matchSegments as c}from"@webority/ui-elements/helpers";import{Fragment as l,useEffect as u,useId as d,useLayoutEffect as f,useRef as p}from"react";import{jsx as m,jsxs as h}from"react/jsx-runtime";import"@webority/ui-elements/elements/command-palette";var g=`lg`;function _(e){let{marker:t,props:r}=n(`AppCommandPalette`,e),{open:a,onClose:o,query:c=``,onQueryChange:l,placeholder:u=`Search…`,groups:f=[],path:p=[],onPathChange:h,rootLabel:_,backLabel:y=`Back`,recentsKey:b,recentsLimit:x,recentsLabel:S,loading:C=!1,emptyText:w=`No results`,footer:T,ariaLabel:E=`Search`,highlight:D=!0,id:O,className:k=``,...A}=r;s(`AppCommandPalette`,A);let j=d(),M=O||j;return/* @__PURE__ */ m(i,{...t,open:a,onClose:o,hideHeader:!0,placement:`top`,size:g,ariaLabel:E,className:`wui-cmd-card${k?` ${k}`:``}`,children:/* @__PURE__ */ m(v,{baseId:M,query:c,onQueryChange:l,placeholder:u,groups:f,path:p,onPathChange:h,rootLabel:_,backLabel:y,recentsKey:b,recentsLimit:x,recentsLabel:S,loading:C,emptyText:w,footer:T,ariaLabel:E,highlight:D,onClose:o,rest:A})})}function v({baseId:n,query:i,onQueryChange:s,placeholder:c,groups:l,path:d,onPathChange:g,rootLabel:_,backLabel:v,recentsKey:x,recentsLimit:S,recentsLabel:C,loading:w,emptyText:T,footer:E,ariaLabel:D,highlight:O,onClose:k,rest:A}){let j=p(null),M=`${n}-list`,N=l.filter(e=>e.items?.length),P=!w&&i.trim()!==``&&N.length===0;return f(()=>{j.current?.refresh?.()}),u(()=>{let e=j.current,t=e=>{let t=l.find(t=>String(t.key)===e.detail.groupKey)?.items?.find(t=>String(t.key)===e.detail.key);t&&(e.preventDefault(),t.page?(s?.(``),g?.([...d,{key:t.page.key,label:t.page.label}])):(t.onSelect?.(),k?.()))},n=e=>{e.preventDefault(),s?.(``),g?.(e.detail.path)};return e.addEventListener(`wui-command-palette:select`,t),e.addEventListener(`wui-command-palette:navigate`,n),()=>{e.removeEventListener(`wui-command-palette:select`,t),e.removeEventListener(`wui-command-palette:navigate`,n)}},[l,d,k,s,g]),/* @__PURE__ */ h(`wui-command-palette`,{ref:j,path:JSON.stringify(d),"root-label":_,"recents-key":x,"recents-limit":S,"recents-label":C,...A,children:[/* @__PURE__ */ h(`div`,{className:`wui-cmd-search`,children:[/* @__PURE__ */ m(`span`,{className:`wui-cmd-search-icon`,"aria-hidden":`true`,children:/* @__PURE__ */ m(r,{name:`search`,size:18})}),/* @__PURE__ */ m(`input`,{className:`wui-cmd-input`,type:`text`,role:`combobox`,"aria-expanded":`true`,"aria-controls":M,"aria-autocomplete":`list`,"aria-label":D,placeholder:c,autoComplete:`off`,spellCheck:!1,"data-autofocus":``,value:i,onChange:e=>s?.(e.target.value)}),w&&/* @__PURE__ */ m(a,{size:`sm`,className:`wui-cmd-spinner`})]}),/* @__PURE__ */ h(`div`,{className:`wui-cmd-crumbs`,hidden:!0,children:[/* @__PURE__ */ m(`button`,{type:`button`,className:`wui-cmd-back`,"aria-label":v,children:/* @__PURE__ */ m(r,{name:`chevron-left`,size:16})}),/* @__PURE__ */ m(`ol`,{className:`wui-cmd-trail`})]}),/* @__PURE__ */ h(`div`,{className:`wui-cmd-list`,role:`listbox`,id:M,"aria-label":`Results`,"aria-busy":w?`true`:void 0,hidden:N.length===0,children:[/* @__PURE__ */ m(`div`,{className:`wui-cmd-recents`}),N.map(a=>{let s=`${n}-${b(a.key)}`;return/* @__PURE__ */ h(`div`,{className:`wui-cmd-group`,role:`group`,"aria-labelledby":s,children:[/* @__PURE__ */ m(`div`,{className:`wui-cmd-group-label`,role:`presentation`,id:s,children:a.label}),a.items.map(n=>{let c=`${s}-${b(n.key)}`,l=n.description==null?null:`${c}-desc`,u=n.meta==null?null:`${c}-meta`;return/* @__PURE__ */ h(`div`,{className:`wui-cmd-item`,role:`option`,id:c,"data-group-key":String(a.key),"data-key":String(n.key),"data-opens":n.page?String(n.page.key):void 0,"aria-label":n.ariaLabel||(typeof n.label==`string`?n.label:``)||void 0,"aria-describedby":[l,u].filter(Boolean).join(` `)||void 0,"aria-disabled":n.disabled?`true`:void 0,"aria-keyshortcuts":e(n.shortcut),children:[n.icon!=null&&/* @__PURE__ */ m(`span`,{className:`wui-cmd-item-icon`,"aria-hidden":`true`,children:o(n.icon,{size:18})}),/* @__PURE__ */ h(`span`,{className:`wui-cmd-item-text`,children:[/* @__PURE__ */ m(`span`,{className:`wui-cmd-item-label`,children:O?y(n.label,i):n.label}),l&&/* @__PURE__ */ m(`span`,{className:`wui-cmd-item-desc`,id:l,children:n.description})]}),u&&/* @__PURE__ */ m(`span`,{className:`wui-cmd-item-meta`,id:u,children:n.meta}),t(n.shortcut),n.page&&/* @__PURE__ */ m(`span`,{className:`wui-cmd-item-chevron`,"aria-hidden":`true`,children:/* @__PURE__ */ m(r,{name:`chevron-right`,size:16})})]},n.key)})]},a.key)})]}),/* @__PURE__ */ m(`div`,{className:`wui-cmd-empty`,role:`status`,children:P?T:null}),E!=null&&/* @__PURE__ */ m(`div`,{className:`wui-cmd-footer`,children:E})]})}function y(e,t){if(typeof e!=`string`)return e;let n=c(e,t);if(n.length===1&&!n[0].match)return e;let r=0;return n.map(e=>{let t=r;return r+=e.text.length,e.match?/* @__PURE__ */ m(`mark`,{className:`wui-cmd-mark`,children:e.text},t):/* @__PURE__ */ m(l,{children:e.text},t)})}function b(e){return String(e).replace(/\s+/g,`_`)}export{_ 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"./AppIcon.js";import i from"./AppModal.js";import a from"./AppSpinner.js";import o from"./renderIconProp.js";import s from"./warnUnknownProps.js";import{matchSegments as c}from"@webority/ui-elements/helpers";import{Fragment as l,useEffect as u,useId as d,useLayoutEffect as f,useRef as p}from"react";import{jsx as m,jsxs as h}from"react/jsx-runtime";import"@webority/ui-elements/elements/command-palette";var g=`lg`;function _(e){let{marker:t,props:r}=n(`AppCommandPalette`,e),{open:a,onClose:o,query:c=``,onQueryChange:l,placeholder:u=`Search…`,groups:f=[],path:p=[],onPathChange:h,rootLabel:_,backLabel:y=`Back`,recentsKey:b,recentsLimit:x,recentsLabel:S,loading:C=!1,emptyText:w=`No results`,footer:T,ariaLabel:E=`Search`,resultsLabel:D=`Results`,highlight:O=!0,id:k,className:A=``,...j}=r;s(`AppCommandPalette`,j);let M=d(),N=k||M;return/* @__PURE__ */ m(i,{...t,open:a,onClose:o,hideHeader:!0,placement:`top`,size:g,ariaLabel:E,className:`wui-cmd-card${A?` ${A}`:``}`,children:/* @__PURE__ */ m(v,{baseId:N,query:c,onQueryChange:l,placeholder:u,groups:f,path:p,onPathChange:h,rootLabel:_,backLabel:y,recentsKey:b,recentsLimit:x,recentsLabel:S,loading:C,emptyText:w,footer:T,ariaLabel:E,resultsLabel:D,highlight:O,onClose:o,rest:j})})}function v({baseId:n,query:i,onQueryChange:s,placeholder:c,groups:l,path:d,onPathChange:g,rootLabel:_,backLabel:v,recentsKey:x,recentsLimit:S,recentsLabel:C,loading:w,emptyText:T,footer:E,ariaLabel:D,resultsLabel:O,highlight:k,onClose:A,rest:j}){let M=p(null),N=`${n}-list`,P=l.filter(e=>e.items?.length),F=!w&&i.trim()!==``&&P.length===0;return f(()=>{M.current?.refresh?.()}),u(()=>{let e=M.current,t=e=>{let t=l.find(t=>String(t.key)===e.detail.groupKey)?.items?.find(t=>String(t.key)===e.detail.key);t&&(e.preventDefault(),t.page?(s?.(``),g?.([...d,{key:t.page.key,label:t.page.label}])):(t.onSelect?.(),A?.()))},n=e=>{e.preventDefault(),s?.(``),g?.(e.detail.path)};return e.addEventListener(`wui-command-palette:select`,t),e.addEventListener(`wui-command-palette:navigate`,n),()=>{e.removeEventListener(`wui-command-palette:select`,t),e.removeEventListener(`wui-command-palette:navigate`,n)}},[l,d,A,s,g]),/* @__PURE__ */ h(`wui-command-palette`,{ref:M,path:JSON.stringify(d),"root-label":_,"recents-key":x,"recents-limit":S,"recents-label":C,...j,children:[/* @__PURE__ */ h(`div`,{className:`wui-cmd-search`,children:[/* @__PURE__ */ m(`span`,{className:`wui-cmd-search-icon`,"aria-hidden":`true`,children:/* @__PURE__ */ m(r,{name:`search`,size:18})}),/* @__PURE__ */ m(`input`,{className:`wui-cmd-input`,type:`text`,role:`combobox`,"aria-expanded":`true`,"aria-controls":N,"aria-autocomplete":`list`,"aria-label":D,placeholder:c,autoComplete:`off`,spellCheck:!1,"data-autofocus":``,value:i,onChange:e=>s?.(e.target.value)}),w&&/* @__PURE__ */ m(a,{size:`sm`,className:`wui-cmd-spinner`})]}),/* @__PURE__ */ h(`div`,{className:`wui-cmd-crumbs`,hidden:!0,children:[/* @__PURE__ */ m(`button`,{type:`button`,className:`wui-cmd-back`,"aria-label":v,children:/* @__PURE__ */ m(r,{name:`chevron-left`,size:16})}),/* @__PURE__ */ m(`ol`,{className:`wui-cmd-trail`})]}),/* @__PURE__ */ h(`div`,{className:`wui-cmd-list`,role:`listbox`,id:N,"aria-label":O,"aria-busy":w?`true`:void 0,hidden:P.length===0,children:[/* @__PURE__ */ m(`div`,{className:`wui-cmd-recents`}),P.map(a=>{let s=`${n}-${b(a.key)}`;return/* @__PURE__ */ h(`div`,{className:`wui-cmd-group`,role:`group`,"aria-labelledby":s,children:[/* @__PURE__ */ m(`div`,{className:`wui-cmd-group-label`,role:`presentation`,id:s,children:a.label}),a.items.map(n=>{let c=`${s}-${b(n.key)}`,l=n.description==null?null:`${c}-desc`,u=n.meta==null?null:`${c}-meta`;return/* @__PURE__ */ h(`div`,{className:`wui-cmd-item`,role:`option`,id:c,"data-group-key":String(a.key),"data-key":String(n.key),"data-opens":n.page?String(n.page.key):void 0,"aria-label":n.ariaLabel||(typeof n.label==`string`?n.label:``)||void 0,"aria-describedby":[l,u].filter(Boolean).join(` `)||void 0,"aria-disabled":n.disabled?`true`:void 0,"aria-keyshortcuts":e(n.shortcut),children:[n.icon!=null&&/* @__PURE__ */ m(`span`,{className:`wui-cmd-item-icon`,"aria-hidden":`true`,children:o(n.icon,{size:18})}),/* @__PURE__ */ h(`span`,{className:`wui-cmd-item-text`,children:[/* @__PURE__ */ m(`span`,{className:`wui-cmd-item-label`,children:k?y(n.label,i):n.label}),l&&/* @__PURE__ */ m(`span`,{className:`wui-cmd-item-desc`,id:l,children:n.description})]}),u&&/* @__PURE__ */ m(`span`,{className:`wui-cmd-item-meta`,id:u,children:n.meta}),t(n.shortcut),n.page&&/* @__PURE__ */ m(`span`,{className:`wui-cmd-item-chevron`,"aria-hidden":`true`,children:/* @__PURE__ */ m(r,{name:`chevron-right`,size:16})})]},n.key)})]},a.key)})]}),/* @__PURE__ */ m(`div`,{className:`wui-cmd-empty`,role:`status`,children:F?T:null}),E!=null&&/* @__PURE__ */ m(`div`,{className:`wui-cmd-footer`,children:E})]})}function y(e,t){if(typeof e!=`string`)return e;let n=c(e,t);if(n.length===1&&!n[0].match)return e;let r=0;return n.map(e=>{let t=r;return r+=e.text.length,e.match?/* @__PURE__ */ m(`mark`,{className:`wui-cmd-mark`,children:e.text},t):/* @__PURE__ */ m(l,{children:e.text},t)})}function b(e){return String(e).replace(/\s+/g,`_`)}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"./AppAvatar.js";import r from"./AppBadge.js";import i from"./AppButton.js";import a from"./AppIcon.js";import o from"./warnInvalidValue.js";import s from"./warnUnknownProps.js";import{parseMentionValue as c}from"@webority/ui-elements/elements/mention-input";import{formatDate as l,formatFileSize as u,formatNumber as d,toInstant as f}from"@webority/ui-elements/helpers";import{Fragment as p,useEffect as m,useId as h,useRef as g}from"react";import{jsx as _,jsxs as v}from"react/jsx-runtime";import{COMMENT_REACTIONS as y,COMMENT_TEXT as b}from"@webority/ui-elements/elements/comment-thread";var x=[`stacked`,`inline`],S=[`list`,`conversation`];function C(e){let{marker:r,props:a}=t(`AppCommentThread`,e),{comments:c=[],onPost:l,onReply:u,onEdit:d,onDelete:f,onReact:p,people:C,loadPeople:T,reactionChoices:E,allowReplies:D=!0,allowReactions:O=!0,composerPlaceholder:k,variant:A=`list`,composer:j=`stacked`,author:M,postLabel:N=b.post,composerRows:P,readOnly:F=!1,label:I=b.listName,id:L,className:R=``,...z}=a;s(`AppCommentThread`,z),o(`AppCommentThread`,`variant`,A,S),o(`AppCommentThread`,`composer`,j,x);let B=h(),V=L||`comment-thread-${B.replace(/[^a-zA-Z0-9_-]/g,``)}`,H=g(null),U=typeof T==`function`,W=E?.length?E:y,G=j===`inline`,K=P??(G?1:3),q=g(null);return q.current={onPost:l,onReply:u,onEdit:d,onDelete:f,onReact:p,loadPeople:T},m(()=>{let e=H.current;if(e)return e.submit=async({intent:e,commentId:t,parentId:n,body:r,emoji:i})=>{let a=q.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}},[]),m(()=>{let e=H.current;e&&!U&&(e.people=C||[])},[C,U]),m(()=>{let e=H.current;if(!e||!U)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 q.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)},[U]),/* @__PURE__ */ v(`wui-comment-thread`,{ref:H,id:V,class:[`wui-comment-thread`,A===`conversation`&&`wui-comment-thread--conversation`,R].filter(Boolean).join(` `),controlled:``,"read-only":F?``:void 0,remote:U?``:void 0,"reaction-choices":E?.length?E.join(` `):void 0,"no-replies":D?void 0:``,"no-reactions":O?void 0:``,"composer-placeholder":k,...r,...z,children:[/* @__PURE__ */ _(`div`,{className:`wui-comment-items`,"data-wui-items":``,children:c.length?/* @__PURE__ */ _(`ol`,{className:`wui-comment-list`,"aria-label":I,children:c.map(e=>/* @__PURE__ */ _(w,{comment:e,topLevel:!0,readOnly:F,allowReplies:D,allowReactions:O},e.id))}):/* @__PURE__ */ _(`p`,{className:`wui-comment-empty`,children:b.empty})}),!F&&O&&/* @__PURE__ */ _(`div`,{className:`wui-reaction-picker`,role:`group`,"aria-label":b.pickerName,"data-wui-picker":``,hidden:!0,children:W.map(e=>/* @__PURE__ */ _(`button`,{type:`button`,className:`wui-reaction-choice`,"data-wui-emoji":e,children:e},e))}),!F&&/* @__PURE__ */ v(`div`,{className:G?`wui-comment-composer wui-comment-composer-inline`:`wui-comment-composer`,"data-wui-composer":``,children:[G&&M?/* @__PURE__ */ _(n,{name:M,size:`sm`,tone:`auto`,className:`wui-comment-composer-avatar`}):null,/* @__PURE__ */ _(`wui-mention-input`,{id:`${V}-new`,class:`wui-mention-input`,label:b.composerLabel,placeholder:k??b.composerPlaceholder,rows:String(K),remote:U?``:void 0}),/* @__PURE__ */ _(`div`,{className:`wui-comment-form-actions`,children:/* @__PURE__ */ _(i,{variant:G?`outline`:`primary`,size:`sm`,"data-wui-action":`post`,children:N})}),/* @__PURE__ */ _(`div`,{className:`wui-comment-error`,"data-wui-error":``,hidden:!0})]}),/* @__PURE__ */ _(`span`,{className:`visually-hidden`,"data-wui-live":``,"aria-live":`polite`,"aria-atomic":`true`})]})}function w({comment:t,topLevel:n=!1,readOnly:o,allowReplies:s,allowReactions:m}){let{id:h,author:g,at:y,value:x,edited:S,mine:C,internal:T,attachments:E=[],deleted:D,canEdit:O,canDelete:k,reactions:A=[],replies:j=[]}=t,M=g?.name||``,N=f(y),P=!o&&!D&&O,F=!o&&!D&&k,I=n&&s,L=[`wui-comment`,T&&`wui-comment--internal`,C&&`wui-comment--mine`].filter(Boolean).join(` `);return/* @__PURE__ */ v(`li`,{className:L,"data-wui-comment":h,"data-value":x??``,"data-wui-deleted":D?``:void 0,children:[/* @__PURE__ */ v(`div`,{className:`wui-comment-row`,children:[/* @__PURE__ */ v(`span`,{className:`avatar avatar-sm wui-comment-avatar`,"aria-hidden":`true`,children:[/* @__PURE__ */ _(`span`,{className:`avatar-face`,children:e(M)||`?`}),g?.src&&/* @__PURE__ */ _(`img`,{className:`avatar-img`,src:g.src,alt:``,onError:e=>{e.currentTarget.hidden=!0}})]}),/* @__PURE__ */ v(`div`,{className:`wui-comment-main`,children:[/* @__PURE__ */ v(`div`,{className:`wui-comment-head`,children:[/* @__PURE__ */ _(`span`,{className:`wui-comment-author`,children:M}),/* @__PURE__ */ _(`time`,{className:`wui-comment-time`,dateTime:Number.isFinite(N)?new Date(N).toISOString():void 0,children:l(y,{pattern:`datetime`})}),S&&!D&&/* @__PURE__ */ _(`span`,{className:`wui-comment-edited`,children:b.edited}),T&&/* @__PURE__ */ _(r,{className:`wui-comment-internal-badge`,children:`Internal note`})]}),D?/* @__PURE__ */ _(`div`,{className:`wui-comment-text wui-comment-text-deleted`,children:b.deleted}):/* @__PURE__ */ _(`div`,{className:`wui-comment-text`,"data-wui-text":``,children:c(x).map((e,t)=>`text`in e?/* @__PURE__ */ _(p,{children:e.text},t):/* @__PURE__ */ v(`span`,{className:`wui-mention`,"data-mention-id":e.id,children:[`@`,e.label]},t))}),!D&&E.length>0&&/* @__PURE__ */ _(`ul`,{className:`wui-comment-attachments`,"aria-label":`Attachments`,children:E.map(e=>/* @__PURE__ */ v(`li`,{children:[/* @__PURE__ */ v(`a`,{className:`wui-comment-attachment`,href:e.href,download:!0,children:[/* @__PURE__ */ _(a,{name:`paperclip`,size:14}),e.name]}),typeof e.sizeBytes==`number`&&/* @__PURE__ */ _(`span`,{className:`wui-comment-attachment-size`,children:u(e.sizeBytes)})]},e.href))}),P&&/* @__PURE__ */ _(`div`,{className:`wui-comment-editor`,"data-wui-editor":``,hidden:!0}),m&&!D&&(A.length>0||!o)&&/* @__PURE__ */ v(`div`,{className:`wui-comment-reactions`,role:`group`,"aria-label":b.reactions,children:[A.map(e=>o?/* @__PURE__ */ v(`span`,{className:e.mine?`wui-reaction wui-reaction-mine`:`wui-reaction`,children:[/* @__PURE__ */ _(`span`,{className:`wui-reaction-emoji`,children:e.emoji}),/* @__PURE__ */ _(`span`,{className:`wui-reaction-count`,children:d(e.count,{decimals:0})})]},e.emoji):/* @__PURE__ */ v(`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__ */ _(`span`,{className:`wui-reaction-emoji`,children:e.emoji}),/* @__PURE__ */ _(`span`,{className:`wui-reaction-count`,children:d(e.count,{decimals:0})})]},e.emoji)),!o&&/* @__PURE__ */ _(`button`,{type:`button`,className:`wui-reaction-add`,"data-wui-action":`react-menu`,"aria-label":b.addReaction,"aria-haspopup":`true`,"aria-expanded":`false`,children:/* @__PURE__ */ _(a,{name:`emoji-smile`,size:16})})]}),!o&&!D&&(I||P||F)&&/* @__PURE__ */ v(`div`,{className:`wui-comment-actions`,"data-wui-actions":``,children:[I&&/* @__PURE__ */ _(`button`,{type:`button`,className:`wui-comment-action`,"data-wui-action":`reply`,children:b.reply}),P&&/* @__PURE__ */ _(`button`,{type:`button`,className:`wui-comment-action`,"data-wui-action":`edit`,children:b.edit}),F&&/* @__PURE__ */ _(`button`,{type:`button`,className:`wui-comment-action`,"data-wui-action":`delete`,children:b.delete})]}),F&&/* @__PURE__ */ v(`div`,{className:`wui-comment-confirm`,"data-wui-confirm":``,hidden:!0,children:[/* @__PURE__ */ _(`span`,{className:`wui-comment-confirm-text`,children:b.confirmDelete}),/* @__PURE__ */ _(i,{variant:`danger`,size:`sm`,"data-wui-action":`confirm-delete`,children:b.delete}),/* @__PURE__ */ _(i,{variant:`ghost`,size:`sm`,"data-wui-action":`cancel-delete`,children:b.cancel})]}),!o&&/* @__PURE__ */ _(`div`,{className:`wui-comment-error`,"data-wui-error":``,hidden:!0})]})]}),n&&j.length>0&&/* @__PURE__ */ _(`ol`,{className:`wui-comment-list wui-comment-replies`,"aria-label":b.repliesName(M),children:j.map(e=>/* @__PURE__ */ _(w,{comment:e,readOnly:o,allowReactions:m},e.id))}),I&&!o&&!D&&/* @__PURE__ */ _(`div`,{className:`wui-comment-reply`,"data-wui-reply":``,hidden:!0})]})}export{C 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{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./AppIcon.js";import n from"./warnInvalidValue.js";import r from"./warnUnknownProps.js";import{isValidElement as i,useEffect as a,useRef as o,useState as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";var u=[`stack`,`scroll`],d=[`comfortable`,`relaxed`],f=[`start`,`center`],p={yes:{icon:`tick-circle`,label:`Yes`},no:{icon:`close-circle`,label:`No`},warn:{icon:`danger`,label:`Warning`},partial:{icon:`minus-circle`,label:`Partial`}};function m(e){return typeof e==`object`&&!!e&&!i(e)}function h(e){return e.scrollLeft+e.clientWidth<e.scrollWidth-1}function g(...e){return e.filter(Boolean).join(` `)||void 0}function _(e){return g(e.highlight&&`is-highlight`,e.align===`center`&&`wui-compare-center`,e.nowrap&&`wui-compare-nowrap`)}function v(e){if(e===!0)return/* @__PURE__ */ l(`span`,{className:`compare-yes`,children:[/* @__PURE__ */ c(t,{name:`check`,size:16}),/* @__PURE__ */ c(`span`,{className:`visually-hidden`,children:`Yes`})]});if(e===!1)return/* @__PURE__ */ l(`span`,{className:`compare-no`,children:[/* @__PURE__ */ c(`span`,{"aria-hidden":`true`,children:`-`}),/* @__PURE__ */ c(`span`,{className:`visually-hidden`,children:`No`})]});if(m(e)&&`state`in e){let r=p[e.state];return n(`AppCompareTable`,`state`,e.state,Object.keys(p)),/* @__PURE__ */ l(`span`,{className:`wui-compare-state wui-compare-state-${e.state}`,children:[r&&/* @__PURE__ */ c(t,{name:r.icon,size:16,variant:`bulk`}),r&&/* @__PURE__ */ c(`span`,{className:`visually-hidden`,children:`${r.label}: `}),e.text]})}return m(e)&&`code`in e?/* @__PURE__ */ c(`span`,{className:`wui-compare-code`,children:e.code}):e}function y(e,t){let n=[],r=null;return t.forEach((t,i)=>{t.group!=null&&t.group!==r&&n.push(/* @__PURE__ */ c(`tr`,{className:`wui-compare-group-row`,children:/* @__PURE__ */ c(`th`,{colSpan:e.length,scope:`rowgroup`,className:`wui-compare-group`,children:t.group})},`group:${t.group}:${t.key??t.label}`)),r=t.group??null,n.push(/* @__PURE__ */ l(`tr`,{children:[/* @__PURE__ */ c(`th`,{scope:`row`,children:t.label}),t.values.map((t,n)=>{let r=e[n+1];return/* @__PURE__ */ c(`td`,{className:_(r??{}),"data-label":r?.label,children:v(t)},r?.label??n)})]},t.key??`${t.label}-${i}`))}),n}function b(t){let{marker:i,props:p}=e(`AppCompareTable`,t),{columns:m,rows:v,caption:b,mobile:x=`stack`,stickyFirstColumn:S=!1,stickyHeader:C=!1,density:w=`comfortable`,className:T=``,...E}=p,D=o(null),[O,k]=s(!1);if(a(()=>{let e=()=>{let e=D.current;e&&k(h(e))};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),!Array.isArray(m))throw Error(`<AppCompareTable> columns is required: pass the feature-name column, then one per option.`);if(!Array.isArray(v))throw Error(`<AppCompareTable> rows is required: pass one row per capability.`);r(`AppCompareTable`,E),n(`AppCompareTable`,`mobile`,x,u),n(`AppCompareTable`,`density`,w,d);for(let e of m)n(`AppCompareTable`,`align`,e.align,f);let A=x===`scroll`,j=/* @__PURE__ */ l(`table`,{className:g(A&&`wui-compare-scroll-table`,A&&S&&`wui-compare-sticky-first`),children:[b&&/* @__PURE__ */ c(`caption`,{className:`visually-hidden`,children:b}),/* @__PURE__ */ c(`thead`,{children:/* @__PURE__ */ c(`tr`,{children:m.map((e,t)=>/* @__PURE__ */ c(`th`,{scope:`col`,className:_(e),children:e.label},e.label?`col-${t}-${e.label}`:`col-${t}`))})}),/* @__PURE__ */ c(`tbody`,{children:y(m,v)})]});return/* @__PURE__ */ c(`div`,{className:g(`compare-table`,w===`relaxed`&&`wui-compare-relaxed`,C&&`wui-compare-sticky-head`,T),"data-mobile":x,...i,...E,children:A?/* @__PURE__ */ c(`div`,{className:`wui-compare-scroll`,ref:D,tabIndex:0,role:b?`region`:void 0,"aria-label":b||void 0,"data-more":O?`end`:void 0,onScroll:e=>k(h(e.currentTarget)),children:j}):j})}export{b 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{isValidElement as i,useEffect as a,useRef as o,useState as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";var u=[`stack`,`scroll`],d=[`comfortable`,`relaxed`],f=[`start`,`center`],p={yes:{icon:`tick-circle`},no:{icon:`close-circle`},warn:{icon:`danger`},partial:{icon:`minus-circle`}};function m(e){return typeof e==`object`&&!!e&&!i(e)}function h(e){return e.scrollLeft+e.clientWidth<e.scrollWidth-1}function g(...e){return e.filter(Boolean).join(` `)||void 0}function _(e){return g(e.highlight&&`is-highlight`,e.align===`center`&&`wui-compare-center`,e.nowrap&&`wui-compare-nowrap`)}function v(e,r){if(e===!0)return/* @__PURE__ */ l(`span`,{className:`compare-yes`,children:[/* @__PURE__ */ c(t,{name:`check`,size:16}),/* @__PURE__ */ c(`span`,{className:`visually-hidden`,children:r.yesLabel})]});if(e===!1)return/* @__PURE__ */ l(`span`,{className:`compare-no`,children:[/* @__PURE__ */ c(`span`,{"aria-hidden":`true`,children:`-`}),/* @__PURE__ */ c(`span`,{className:`visually-hidden`,children:r.noLabel})]});if(m(e)&&`state`in e){let i=p[e.state],a={yes:r.yesLabel,no:r.noLabel,warn:r.warningLabel,partial:r.partialLabel};return n(`AppCompareTable`,`state`,e.state,Object.keys(p)),/* @__PURE__ */ l(`span`,{className:`wui-compare-state wui-compare-state-${e.state}`,children:[i&&/* @__PURE__ */ c(t,{name:i.icon,size:16,variant:`bulk`}),i&&/* @__PURE__ */ c(`span`,{className:`visually-hidden`,children:`${a[e.state]}: `}),e.text]})}return m(e)&&`code`in e?/* @__PURE__ */ c(`span`,{className:`wui-compare-code`,children:e.code}):e}function y(e,t,n){let r=[],i=null;return t.forEach((t,a)=>{t.group!=null&&t.group!==i&&r.push(/* @__PURE__ */ c(`tr`,{className:`wui-compare-group-row`,children:/* @__PURE__ */ c(`th`,{colSpan:e.length,scope:`rowgroup`,className:`wui-compare-group`,children:t.group})},`group:${t.group}:${t.key??t.label}`)),i=t.group??null,r.push(/* @__PURE__ */ l(`tr`,{children:[/* @__PURE__ */ c(`th`,{scope:`row`,children:t.label}),t.values.map((t,r)=>{let i=e[r+1];return/* @__PURE__ */ c(`td`,{className:_(i??{}),"data-label":i?.label,children:v(t,n)},i?.label??r)})]},t.key??`${t.label}-${a}`))}),r}function b(t){let{marker:i,props:p}=e(`AppCompareTable`,t),{columns:m,rows:v,caption:b,mobile:x=`stack`,stickyFirstColumn:S=!1,stickyHeader:C=!1,density:w=`comfortable`,yesLabel:T=`Yes`,noLabel:E=`No`,warningLabel:D=`Warning`,partialLabel:O=`Partial`,className:k=``,...A}=p,j={yesLabel:T,noLabel:E,warningLabel:D,partialLabel:O},M=o(null),[N,P]=s(!1);if(a(()=>{let e=()=>{let e=M.current;e&&P(h(e))};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),!Array.isArray(m))throw Error(`<AppCompareTable> columns is required: pass the feature-name column, then one per option.`);if(!Array.isArray(v))throw Error(`<AppCompareTable> rows is required: pass one row per capability.`);r(`AppCompareTable`,A),n(`AppCompareTable`,`mobile`,x,u),n(`AppCompareTable`,`density`,w,d);for(let e of m)n(`AppCompareTable`,`align`,e.align,f);let F=x===`scroll`,I=/* @__PURE__ */ l(`table`,{className:g(F&&`wui-compare-scroll-table`,F&&S&&`wui-compare-sticky-first`),children:[b&&/* @__PURE__ */ c(`caption`,{className:`visually-hidden`,children:b}),/* @__PURE__ */ c(`thead`,{children:/* @__PURE__ */ c(`tr`,{children:m.map((e,t)=>/* @__PURE__ */ c(`th`,{scope:`col`,className:_(e),children:e.label},e.label?`col-${t}-${e.label}`:`col-${t}`))})}),/* @__PURE__ */ c(`tbody`,{children:y(m,v,j)})]});return/* @__PURE__ */ c(`div`,{className:g(`compare-table`,w===`relaxed`&&`wui-compare-relaxed`,C&&`wui-compare-sticky-head`,k),"data-mobile":x,...i,...A,children:F?/* @__PURE__ */ c(`div`,{className:`wui-compare-scroll`,ref:M,tabIndex:0,role:b?`region`:void 0,"aria-label":b||void 0,"data-more":N?`end`:void 0,onScroll:e=>P(h(e.currentTarget)),children:I}):I})}export{b as default};
@@ -1 +1 @@
1
- import{splitMarkerProps as e}from"../lib/wuiMarker.js";import t from"./AppButton.js";import n from"./AppIcon.js";import r from"./AppInput.js";import i from"./AppModal.js";import{MODAL_ICONS as a}from"./ModalIcons.js";import o from"./warnInvalidValue.js";import s from"./warnUnknownProps.js";import{useEffect as c,useState as l}from"react";import{Fragment as u,jsx as d,jsxs as f}from"react/jsx-runtime";var p=[`sm`,`md`,`lg`,`xl`],m=[`default`,`plain`];function h(h){let{marker:g,props:_}=e(`AppConfirmDialog`,h),{open:v,title:y,variant:b=`default`,message:x,confirmLabel:S=`Confirm`,cancelLabel:C=`Cancel`,danger:w=!1,tone:T,image:E,icon:D,iconSize:O,confirmPhrase:k,onConfirm:A,onClose:j,loading:M=!1,staticBackdrop:N=!1,placement:P=`center`,size:F=`md`,className:I=``,children:L,...R}=_;s(`AppConfirmDialog`,R),o(`AppConfirmDialog`,`tone`,T,Object.keys(a)),o(`AppConfirmDialog`,`size`,typeof F==`string`?F:null,p),o(`AppConfirmDialog`,`variant`,b,m);let[z,B]=l(``);if(c(()=>{v||B(``)},[v]),!v)return null;let V=!!k&&z.trim()!==k,H=b===`plain`,U=H?`sm`:`md`,W=H||E||D?null:a[T||(w?`delete`:`info`)],G=O>0?{"--wui-confirm-icon-size":`${O}px`}:void 0,K=()=>{M||j?.()};return/* @__PURE__ */ d(i,{...g,...R,open:v,hideHeader:!0,title:y,onClose:K,staticBackdrop:N,placement:P,size:F,className:[`wui-confirm`,H&&`wui-confirm-plain`,I].filter(Boolean).join(` `),footer:/* @__PURE__ */ f(`div`,{className:`wui-confirm-actions`,children:[/* @__PURE__ */ d(t,{variant:H?`light`:`secondary`,size:U,disabled:M,onClick:K,children:C}),/* @__PURE__ */ d(t,{variant:w?`danger`:`primary`,size:U,disabled:V,loading:M,onClick:A,children:S})]}),children:/* @__PURE__ */ f(`div`,{className:`wui-confirm-content`,children:[!H&&E?/* @__PURE__ */ d(`span`,{className:`wui-confirm-icon`,style:G,children:/* @__PURE__ */ d(`img`,{src:E,alt:``,"aria-hidden":`true`})}):!H&&D?/* @__PURE__ */ d(`span`,{className:`wui-confirm-icon`,style:G,children:typeof D==`string`?/* @__PURE__ */ d(n,{name:D,size:80}):D}):W&&/* @__PURE__ */ d(`span`,{className:`wui-confirm-icon`,style:G,children:/* @__PURE__ */ d(W,{size:120})}),/* @__PURE__ */ d(`h3`,{className:`wui-confirm-title`,tabIndex:-1,"data-autofocus":``,children:y}),x&&/* @__PURE__ */ d(`p`,{className:`wui-confirm-msg`,children:x}),L!=null&&L!==!1&&/* @__PURE__ */ d(`div`,{className:`wui-confirm-body`,children:L}),k&&/* @__PURE__ */ d(r,{fieldClassName:`mt-3 mb-0 w-100 text-start`,label:/* @__PURE__ */ f(u,{children:[`Type `,/* @__PURE__ */ d(`strong`,{children:k}),` to confirm`]}),value:z,onChange:e=>B(e.target.value),"aria-label":`Type ${k} to confirm`,disabled:M})]})})}export{h 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};