@kahitsan/ksui 0.49.0 → 0.51.0-solid2.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 (307) hide show
  1. package/README.md +10 -0
  2. package/package.json +10 -7
  3. package/src/components/base/AccountAvatar.tsx +1 -1
  4. package/src/components/base/ActionMenu.tsx +7 -5
  5. package/src/components/base/AddAttachmentTile.tsx +6 -6
  6. package/src/components/base/BadgeSelect.tsx +11 -9
  7. package/src/components/base/Button.test.tsx +23 -0
  8. package/src/components/base/Button.tsx +35 -41
  9. package/src/components/base/CameraCapture.tsx +5 -2
  10. package/src/components/base/CopyButton.tsx +2 -1
  11. package/src/components/base/DataTable.tsx +89 -112
  12. package/src/components/base/DatePicker.tsx +15 -17
  13. package/src/components/base/DateTile.tsx +14 -12
  14. package/src/components/base/Dropdown.tsx +6 -5
  15. package/src/components/base/ExistingAttachmentTile.test.tsx +3 -3
  16. package/src/components/base/ExistingAttachmentTile.tsx +6 -4
  17. package/src/components/base/EyebrowBadge.tsx +2 -1
  18. package/src/components/base/FormErrorBanner.tsx +2 -1
  19. package/src/components/base/FormField.tsx +1 -1
  20. package/src/components/base/ImageCropper.tsx +3 -3
  21. package/src/components/base/ImageViewer.test.tsx +2 -0
  22. package/src/components/base/ImageViewer.tsx +4 -3
  23. package/src/components/base/KpiCard.tsx +3 -2
  24. package/src/components/base/Modal.test.tsx +3 -2
  25. package/src/components/base/Modal.tsx +11 -12
  26. package/src/components/base/ModalHeader.tsx +2 -1
  27. package/src/components/base/MonthCalendar.tsx +2 -1
  28. package/src/components/base/MultiSelectGroup.tsx +7 -5
  29. package/src/components/base/ProgressBar.tsx +8 -17
  30. package/src/components/base/RadioCardGroup.tsx +14 -12
  31. package/src/components/base/SectionHeading.tsx +2 -1
  32. package/src/components/base/SegmentedFilter.tsx +10 -8
  33. package/src/components/base/SocialLinksBar.tsx +2 -1
  34. package/src/components/base/StatusIndicator.tsx +2 -1
  35. package/src/components/base/StatusPill.tsx +1 -1
  36. package/src/components/base/TagPill.tsx +1 -1
  37. package/src/components/base/ThemeToggle.tsx +5 -11
  38. package/src/components/base/Tooltip.tsx +2 -1
  39. package/src/components/composite/AccountRadioPicker.tsx +14 -11
  40. package/src/components/composite/ComboBox.tsx +18 -13
  41. package/src/components/composite/CustomRenderer.tsx +1 -1
  42. package/src/components/composite/FileField.tsx +6 -3
  43. package/src/components/composite/FlowGraph.tsx +15 -12
  44. package/src/components/composite/FlowRunner.test.tsx +2 -0
  45. package/src/components/composite/FlowRunner.tsx +2 -1
  46. package/src/components/composite/FormActions.tsx +1 -1
  47. package/src/components/composite/FormAdvancedSection.tsx +13 -13
  48. package/src/components/composite/LiveTimer.tsx +8 -14
  49. package/src/components/composite/MarkdownNotes.tsx +2 -1
  50. package/src/components/composite/MentionTextarea.tsx +31 -22
  51. package/src/components/composite/MultiPeriodPicker.tsx +11 -9
  52. package/src/components/composite/NotFound.tsx +4 -15
  53. package/src/components/composite/PaymentAccountPicker.tsx +19 -24
  54. package/src/components/composite/SalesBodyEditor.tsx +10 -7
  55. package/src/components/composite/SearchableSelect.tsx +14 -13
  56. package/src/components/composite/SecretReveal.tsx +2 -2
  57. package/src/components/composite/TransactionForm.tsx +52 -42
  58. package/src/components/composite/TransferAccountsPicker.tsx +11 -10
  59. package/src/components/composite/TransferFeeChip.tsx +7 -6
  60. package/src/components/composite/VoucherPicker.test.tsx +55 -48
  61. package/src/components/composite/VoucherPicker.tsx +36 -27
  62. package/src/components/composite/picker-engine.ts +20 -14
  63. package/src/components/composite/resource/ResourcePage.test.tsx +1 -1
  64. package/src/components/composite/resource/ResourcePage.tsx +21 -7
  65. package/src/components/composite/resource/cells.tsx +1 -1
  66. package/src/icons/README.md +10 -4
  67. package/src/icons/arrow-down-left.tsx +2 -2
  68. package/src/icons/arrow-left.tsx +2 -2
  69. package/src/icons/arrow-right-left.tsx +1 -1
  70. package/src/icons/arrow-right.tsx +2 -2
  71. package/src/icons/arrow-up-down.tsx +2 -2
  72. package/src/icons/arrow-up-right.tsx +2 -2
  73. package/src/icons/arrow-up.tsx +2 -2
  74. package/src/icons/artwork/activity.ts +1 -1
  75. package/src/icons/artwork/app-window.png +0 -0
  76. package/src/icons/artwork/app-window.ts +2 -1
  77. package/src/icons/artwork/archive-restore.ts +1 -1
  78. package/src/icons/artwork/archive.ts +1 -1
  79. package/src/icons/artwork/arrow-down.ts +1 -1
  80. package/src/icons/artwork/arrow-left-right.ts +1 -1
  81. package/src/icons/artwork/at-sign.png +0 -0
  82. package/src/icons/artwork/at-sign.ts +2 -1
  83. package/src/icons/artwork/ban.png +0 -0
  84. package/src/icons/artwork/ban.ts +2 -1
  85. package/src/icons/artwork/banknote.ts +1 -1
  86. package/src/icons/artwork/bell.ts +1 -1
  87. package/src/icons/artwork/bir-form-0619-e.png +0 -0
  88. package/src/icons/artwork/bir-form-0619-e.ts +3 -0
  89. package/src/icons/artwork/bir-form-1601-eq.png +0 -0
  90. package/src/icons/artwork/bir-form-1601-eq.ts +3 -0
  91. package/src/icons/artwork/bir-form-2307.png +0 -0
  92. package/src/icons/artwork/bir-form-2307.ts +3 -0
  93. package/src/icons/artwork/bir-office.ts +2 -0
  94. package/src/icons/artwork/blocks.png +0 -0
  95. package/src/icons/artwork/blocks.ts +2 -1
  96. package/src/icons/artwork/book-open.ts +1 -1
  97. package/src/icons/artwork/boxes.ts +1 -1
  98. package/src/icons/artwork/briefcase.png +0 -0
  99. package/src/icons/artwork/briefcase.ts +2 -1
  100. package/src/icons/artwork/building-2.ts +1 -1
  101. package/src/icons/artwork/building.png +0 -0
  102. package/src/icons/artwork/building.ts +2 -1
  103. package/src/icons/artwork/calculator.png +0 -0
  104. package/src/icons/artwork/calculator.ts +2 -1
  105. package/src/icons/artwork/calendar-clock.png +0 -0
  106. package/src/icons/artwork/calendar-clock.ts +2 -1
  107. package/src/icons/artwork/calendar.png +0 -0
  108. package/src/icons/artwork/calendar.ts +2 -1
  109. package/src/icons/artwork/camera.ts +1 -1
  110. package/src/icons/artwork/chart-bar.ts +1 -1
  111. package/src/icons/artwork/check-bold.ts +1 -1
  112. package/src/icons/artwork/check-check.ts +1 -1
  113. package/src/icons/artwork/check.ts +1 -1
  114. package/src/icons/artwork/chevron-right.ts +1 -1
  115. package/src/icons/artwork/chevrons-up-down.ts +1 -1
  116. package/src/icons/artwork/circle-alert.ts +1 -1
  117. package/src/icons/artwork/circle-check-bold.png +0 -0
  118. package/src/icons/artwork/circle-check-bold.ts +2 -1
  119. package/src/icons/artwork/circle-check.png +0 -0
  120. package/src/icons/artwork/circle-check.ts +2 -1
  121. package/src/icons/artwork/circle-dot.ts +1 -1
  122. package/src/icons/artwork/circle-question-mark.png +0 -0
  123. package/src/icons/artwork/circle-question-mark.ts +2 -1
  124. package/src/icons/artwork/circle-x.ts +1 -1
  125. package/src/icons/artwork/circle.ts +1 -1
  126. package/src/icons/artwork/clipboard-list.ts +1 -1
  127. package/src/icons/artwork/clock.png +0 -0
  128. package/src/icons/artwork/clock.ts +2 -1
  129. package/src/icons/artwork/coins.ts +1 -1
  130. package/src/icons/artwork/compass.png +0 -0
  131. package/src/icons/artwork/compass.ts +2 -1
  132. package/src/icons/artwork/copy.png +0 -0
  133. package/src/icons/artwork/copy.ts +2 -1
  134. package/src/icons/artwork/corner-down-right.ts +1 -1
  135. package/src/icons/artwork/credit-card.png +0 -0
  136. package/src/icons/artwork/credit-card.ts +2 -1
  137. package/src/icons/artwork/crown.ts +1 -1
  138. package/src/icons/artwork/database.png +0 -0
  139. package/src/icons/artwork/database.ts +2 -1
  140. package/src/icons/artwork/dollar-sign.ts +1 -1
  141. package/src/icons/artwork/door-open.png +0 -0
  142. package/src/icons/artwork/door-open.ts +2 -1
  143. package/src/icons/artwork/download.ts +1 -1
  144. package/src/icons/artwork/ellipsis.ts +1 -1
  145. package/src/icons/artwork/equal.ts +1 -1
  146. package/src/icons/artwork/external-link.ts +1 -1
  147. package/src/icons/artwork/eye.ts +1 -1
  148. package/src/icons/artwork/file-spreadsheet.png +0 -0
  149. package/src/icons/artwork/file-spreadsheet.ts +2 -1
  150. package/src/icons/artwork/file-text.png +0 -0
  151. package/src/icons/artwork/file-text.ts +2 -1
  152. package/src/icons/artwork/file.ts +1 -1
  153. package/src/icons/artwork/funnel.ts +1 -1
  154. package/src/icons/artwork/globe.png +0 -0
  155. package/src/icons/artwork/globe.ts +2 -1
  156. package/src/icons/artwork/grip-vertical.ts +1 -1
  157. package/src/icons/artwork/history.png +0 -0
  158. package/src/icons/artwork/history.ts +2 -1
  159. package/src/icons/artwork/house.ts +1 -1
  160. package/src/icons/artwork/image-off.png +0 -0
  161. package/src/icons/artwork/image-off.ts +2 -1
  162. package/src/icons/artwork/inbox.ts +1 -1
  163. package/src/icons/artwork/info.ts +1 -1
  164. package/src/icons/artwork/key.ts +1 -1
  165. package/src/icons/artwork/landmark.ts +1 -1
  166. package/src/icons/artwork/layers.png +0 -0
  167. package/src/icons/artwork/layers.ts +2 -1
  168. package/src/icons/artwork/layout-dashboard.ts +1 -1
  169. package/src/icons/artwork/layout-grid.ts +1 -1
  170. package/src/icons/artwork/layout-list.png +0 -0
  171. package/src/icons/artwork/layout-list.ts +2 -1
  172. package/src/icons/artwork/link-2.ts +1 -1
  173. package/src/icons/artwork/list.ts +1 -1
  174. package/src/icons/artwork/loader-circle.ts +1 -1
  175. package/src/icons/artwork/lock.ts +1 -1
  176. package/src/icons/artwork/log-in.ts +1 -1
  177. package/src/icons/artwork/log-out.ts +1 -1
  178. package/src/icons/artwork/mail-open.ts +1 -1
  179. package/src/icons/artwork/mail.ts +1 -1
  180. package/src/icons/artwork/megaphone.ts +1 -1
  181. package/src/icons/artwork/message-square.ts +1 -1
  182. package/src/icons/artwork/minus.ts +1 -1
  183. package/src/icons/artwork/moon.ts +1 -1
  184. package/src/icons/artwork/mouse-pointer-click.ts +1 -1
  185. package/src/icons/artwork/move.ts +1 -1
  186. package/src/icons/artwork/package.ts +1 -1
  187. package/src/icons/artwork/palette.png +0 -0
  188. package/src/icons/artwork/palette.ts +2 -1
  189. package/src/icons/artwork/panel-left-close.ts +1 -1
  190. package/src/icons/artwork/panel-left.png +0 -0
  191. package/src/icons/artwork/panel-left.ts +2 -1
  192. package/src/icons/artwork/paperclip.png +0 -0
  193. package/src/icons/artwork/paperclip.ts +2 -1
  194. package/src/icons/artwork/pencil.ts +1 -1
  195. package/src/icons/artwork/phone-call.png +0 -0
  196. package/src/icons/artwork/phone-call.ts +2 -1
  197. package/src/icons/artwork/phone.ts +1 -1
  198. package/src/icons/artwork/piggy-bank.ts +1 -1
  199. package/src/icons/artwork/play.ts +1 -1
  200. package/src/icons/artwork/plus.ts +1 -1
  201. package/src/icons/artwork/power.ts +1 -1
  202. package/src/icons/artwork/radio.png +0 -0
  203. package/src/icons/artwork/radio.ts +2 -1
  204. package/src/icons/artwork/receipt.ts +1 -1
  205. package/src/icons/artwork/refresh-cw.ts +1 -1
  206. package/src/icons/artwork/rotate-ccw.ts +1 -1
  207. package/src/icons/artwork/sales.ts +2 -0
  208. package/src/icons/artwork/save.ts +1 -1
  209. package/src/icons/artwork/search.ts +1 -1
  210. package/src/icons/artwork/settings.ts +1 -1
  211. package/src/icons/artwork/shield-alert.ts +1 -1
  212. package/src/icons/artwork/shield-check.ts +1 -1
  213. package/src/icons/artwork/shield-off.ts +1 -1
  214. package/src/icons/artwork/shield.ts +1 -1
  215. package/src/icons/artwork/shopping-bag.png +0 -0
  216. package/src/icons/artwork/shopping-bag.ts +2 -1
  217. package/src/icons/artwork/shopping-cart.ts +1 -1
  218. package/src/icons/artwork/shuffle.ts +1 -1
  219. package/src/icons/artwork/sliders-horizontal.ts +1 -1
  220. package/src/icons/artwork/smartphone.ts +1 -1
  221. package/src/icons/artwork/sparkles.ts +1 -1
  222. package/src/icons/artwork/square.ts +1 -1
  223. package/src/icons/artwork/star-filled.ts +1 -1
  224. package/src/icons/artwork/star.ts +1 -1
  225. package/src/icons/artwork/sticky-note.png +0 -0
  226. package/src/icons/artwork/sticky-note.ts +2 -1
  227. package/src/icons/artwork/store.png +0 -0
  228. package/src/icons/artwork/store.ts +2 -1
  229. package/src/icons/artwork/sun.ts +1 -1
  230. package/src/icons/artwork/tag.ts +1 -1
  231. package/src/icons/artwork/target.png +0 -0
  232. package/src/icons/artwork/target.ts +2 -1
  233. package/src/icons/artwork/ticket.png +0 -0
  234. package/src/icons/artwork/ticket.ts +2 -1
  235. package/src/icons/artwork/trash-2.png +0 -0
  236. package/src/icons/artwork/trash-2.ts +2 -1
  237. package/src/icons/artwork/trending-up.ts +1 -1
  238. package/src/icons/artwork/triangle-alert.ts +1 -1
  239. package/src/icons/artwork/trophy.ts +1 -1
  240. package/src/icons/artwork/undo-2.ts +1 -1
  241. package/src/icons/artwork/upload.ts +1 -1
  242. package/src/icons/artwork/user-check.png +0 -0
  243. package/src/icons/artwork/user-check.ts +2 -1
  244. package/src/icons/artwork/user-plus.ts +1 -1
  245. package/src/icons/artwork/user.ts +1 -1
  246. package/src/icons/artwork/users.ts +1 -1
  247. package/src/icons/artwork/volume-2.ts +1 -1
  248. package/src/icons/artwork/volume-x.ts +1 -1
  249. package/src/icons/artwork/wallet.ts +1 -1
  250. package/src/icons/artwork/x.ts +1 -1
  251. package/src/icons/artwork/zap.ts +1 -1
  252. package/src/icons/artwork/zoom-in.png +0 -0
  253. package/src/icons/artwork/zoom-in.ts +2 -1
  254. package/src/icons/asset-modules.d.ts +4 -0
  255. package/src/icons/bir-form-0619-e.tsx +4 -0
  256. package/src/icons/bir-form-1601-eq.tsx +4 -0
  257. package/src/icons/bir-form-2307.tsx +4 -0
  258. package/src/icons/bir-office.tsx +4 -0
  259. package/src/icons/calendar-days.tsx +1 -1
  260. package/src/icons/check.tsx +2 -2
  261. package/src/icons/chevron-down.tsx +2 -2
  262. package/src/icons/chevron-left.tsx +2 -2
  263. package/src/icons/chevron-up.tsx +2 -2
  264. package/src/icons/circle-check-big.tsx +3 -2
  265. package/src/icons/circle-check.tsx +2 -2
  266. package/src/icons/circle-slash.tsx +1 -1
  267. package/src/icons/cloud-upload.tsx +1 -1
  268. package/src/icons/create-artwork-icon.test.tsx +33 -1
  269. package/src/icons/create-artwork-icon.tsx +35 -40
  270. package/src/icons/ellipsis-vertical.tsx +2 -2
  271. package/src/icons/index.ts +5 -0
  272. package/src/icons/key-round.tsx +1 -1
  273. package/src/icons/registry.ts +8 -3
  274. package/src/icons/sales.tsx +4 -0
  275. package/src/icons/settings-2.tsx +1 -1
  276. package/src/icons/star.tsx +2 -2
  277. package/src/icons/user-round.tsx +1 -1
  278. package/src/icons/users-round.tsx +1 -1
  279. package/src/utils/account-icons.ts +2 -1
  280. package/src/utils/accounts-index.tsx +8 -5
  281. package/src/utils/aria.ts +13 -0
  282. package/src/utils/confirm.tsx +1 -1
  283. package/src/utils/dom.ts +7 -6
  284. package/src/utils/fetch-resource.ts +59 -0
  285. package/src/utils/highlight.tsx +1 -1
  286. package/src/utils/modal-layer.ts +3 -3
  287. package/src/utils/object-url-resource.ts +11 -8
  288. package/src/utils/top-layer.ts +9 -8
  289. package/src/icons/artwork/arrow-down-left.ts +0 -2
  290. package/src/icons/artwork/arrow-left.ts +0 -2
  291. package/src/icons/artwork/arrow-right-left.ts +0 -2
  292. package/src/icons/artwork/arrow-right.ts +0 -2
  293. package/src/icons/artwork/arrow-up-down.ts +0 -2
  294. package/src/icons/artwork/arrow-up-right.ts +0 -2
  295. package/src/icons/artwork/arrow-up.ts +0 -2
  296. package/src/icons/artwork/calendar-days.ts +0 -2
  297. package/src/icons/artwork/chevron-down.ts +0 -2
  298. package/src/icons/artwork/chevron-left.ts +0 -2
  299. package/src/icons/artwork/chevron-up.ts +0 -2
  300. package/src/icons/artwork/circle-check-big.ts +0 -2
  301. package/src/icons/artwork/circle-slash.ts +0 -2
  302. package/src/icons/artwork/cloud-upload.ts +0 -2
  303. package/src/icons/artwork/ellipsis-vertical.ts +0 -2
  304. package/src/icons/artwork/key-round.ts +0 -2
  305. package/src/icons/artwork/settings-2.ts +0 -2
  306. package/src/icons/artwork/user-round.ts +0 -2
  307. package/src/icons/artwork/users-round.ts +0 -2
@@ -0,0 +1,4 @@
1
+ // Generated by scripts/build-icon-assets.mjs.
2
+ import { createArtworkIcon } from "./create-artwork-icon";
3
+ import { artwork } from "./artwork/bir-form-1601-eq";
4
+ export default /* @__PURE__ */ createArtworkIcon("bir-form-1601-eq", artwork);
@@ -0,0 +1,4 @@
1
+ // Generated by scripts/build-icon-assets.mjs.
2
+ import { createArtworkIcon } from "./create-artwork-icon";
3
+ import { artwork } from "./artwork/bir-form-2307";
4
+ export default /* @__PURE__ */ createArtworkIcon("bir-form-2307", artwork);
@@ -0,0 +1,4 @@
1
+ // Generated by scripts/build-icon-assets.mjs.
2
+ import { createArtworkIcon } from "./create-artwork-icon";
3
+ import { artwork } from "./artwork/bir-office";
4
+ export default /* @__PURE__ */ createArtworkIcon("bir-office", artwork);
@@ -1,4 +1,4 @@
1
1
  // Generated by scripts/build-icon-assets.mjs.
2
2
  import { createArtworkIcon } from "./create-artwork-icon";
3
- import { artwork } from "./artwork/calendar-days";
3
+ import { artwork } from "./artwork/calendar";
4
4
  export default /* @__PURE__ */ createArtworkIcon("calendar-days", artwork);
@@ -1,5 +1,5 @@
1
1
  // Generated by scripts/build-icon-assets.mjs.
2
2
  import { createArtworkIcon } from "./create-artwork-icon";
3
3
  import { artwork } from "./artwork/check";
4
- import { artwork as variant } from "./artwork/check-bold";
5
- export default /* @__PURE__ */ createArtworkIcon("check", artwork, { bold: variant });
4
+ import { artwork as bold } from "./artwork/check-bold";
5
+ export default /* @__PURE__ */ createArtworkIcon("check", artwork, { bold });
@@ -1,4 +1,4 @@
1
1
  // Generated by scripts/build-icon-assets.mjs.
2
2
  import { createArtworkIcon } from "./create-artwork-icon";
3
- import { artwork } from "./artwork/chevron-down";
4
- export default /* @__PURE__ */ createArtworkIcon("chevron-down", artwork);
3
+ import { artwork } from "./artwork/chevron-right";
4
+ export default /* @__PURE__ */ createArtworkIcon("chevron-down", artwork, { rotation: 90 });
@@ -1,4 +1,4 @@
1
1
  // Generated by scripts/build-icon-assets.mjs.
2
2
  import { createArtworkIcon } from "./create-artwork-icon";
3
- import { artwork } from "./artwork/chevron-left";
4
- export default /* @__PURE__ */ createArtworkIcon("chevron-left", artwork);
3
+ import { artwork } from "./artwork/chevron-right";
4
+ export default /* @__PURE__ */ createArtworkIcon("chevron-left", artwork, { rotation: 180 });
@@ -1,4 +1,4 @@
1
1
  // Generated by scripts/build-icon-assets.mjs.
2
2
  import { createArtworkIcon } from "./create-artwork-icon";
3
- import { artwork } from "./artwork/chevron-up";
4
- export default /* @__PURE__ */ createArtworkIcon("chevron-up", artwork);
3
+ import { artwork } from "./artwork/chevron-right";
4
+ export default /* @__PURE__ */ createArtworkIcon("chevron-up", artwork, { rotation: 270 });
@@ -1,4 +1,5 @@
1
1
  // Generated by scripts/build-icon-assets.mjs.
2
2
  import { createArtworkIcon } from "./create-artwork-icon";
3
- import { artwork } from "./artwork/circle-check-big";
4
- export default /* @__PURE__ */ createArtworkIcon("circle-check-big", artwork);
3
+ import { artwork } from "./artwork/circle-check";
4
+ import { artwork as bold } from "./artwork/circle-check-bold";
5
+ export default /* @__PURE__ */ createArtworkIcon("circle-check-big", artwork, { bold });
@@ -1,5 +1,5 @@
1
1
  // Generated by scripts/build-icon-assets.mjs.
2
2
  import { createArtworkIcon } from "./create-artwork-icon";
3
3
  import { artwork } from "./artwork/circle-check";
4
- import { artwork as variant } from "./artwork/circle-check-bold";
5
- export default /* @__PURE__ */ createArtworkIcon("circle-check", artwork, { bold: variant });
4
+ import { artwork as bold } from "./artwork/circle-check-bold";
5
+ export default /* @__PURE__ */ createArtworkIcon("circle-check", artwork, { bold });
@@ -1,4 +1,4 @@
1
1
  // Generated by scripts/build-icon-assets.mjs.
2
2
  import { createArtworkIcon } from "./create-artwork-icon";
3
- import { artwork } from "./artwork/circle-slash";
3
+ import { artwork } from "./artwork/ban";
4
4
  export default /* @__PURE__ */ createArtworkIcon("circle-slash", artwork);
@@ -1,4 +1,4 @@
1
1
  // Generated by scripts/build-icon-assets.mjs.
2
2
  import { createArtworkIcon } from "./create-artwork-icon";
3
- import { artwork } from "./artwork/cloud-upload";
3
+ import { artwork } from "./artwork/upload";
4
4
  export default /* @__PURE__ */ createArtworkIcon("cloud-upload", artwork);
@@ -1,5 +1,5 @@
1
1
  import { cleanup, render } from "@solidjs/testing-library";
2
- import { createSignal } from "solid-js";
2
+ import { createSignal, flush } from "solid-js";
3
3
  import { afterEach, describe, expect, it } from "vitest";
4
4
  import { createArtworkIcon } from "./create-artwork-icon";
5
5
 
@@ -10,6 +10,35 @@ const Glyph = createArtworkIcon("sample", regular, { bold, filled });
10
10
  afterEach(cleanup);
11
11
 
12
12
  describe("original artwork icon contract", () => {
13
+ it("rotates shared source geometry without changing caller SVG transforms or children", () => {
14
+ const Oriented = createArtworkIcon("left", "M72 12v120", { rotation: 90 });
15
+ const view = render(() => <Oriented transform="translate(2 3)"><desc>Previous page</desc></Oriented>);
16
+ expect(view.container.querySelector("svg")?.getAttribute("transform")).toBe("translate(2 3)");
17
+ expect(view.container.querySelector("path")?.parentElement?.getAttribute("transform")).toBe("rotate(90 72 72)");
18
+ expect(view.container.querySelector("desc")?.parentElement?.tagName.toLowerCase()).toBe("svg");
19
+ });
20
+ it("keeps accessible titles in the SVG namespace without changing the document title", () => {
21
+ const previousTitle = document.title;
22
+ document.title = "Application";
23
+ try {
24
+ const view = render(() => <Glyph title="Search" />);
25
+ const title = view.container.querySelector("title");
26
+ expect(title?.namespaceURI).toBe("http://www.w3.org/2000/svg");
27
+ expect(view.getByRole("img", { name: "Search" })).toBeTruthy();
28
+ expect(document.title).toBe("Application");
29
+ } finally {
30
+ document.title = previousTitle;
31
+ }
32
+ });
33
+
34
+ it("uses an emitted image URL without mistaking it for vector geometry", () => {
35
+ const External = createArtworkIcon("external", { image: "/assets/original.png" });
36
+ const view = render(() => <External title="Original image" />);
37
+ expect(view.container.querySelector("path")).toBeNull();
38
+ expect(view.container.querySelector("image")?.getAttribute("href")).toBe("/assets/original.png");
39
+ expect(view.getByRole("img", { name: "Original image" })).toBeTruthy();
40
+ });
41
+
13
42
  it("changes delivery format when a reactive weight selects different artwork", () => {
14
43
  const Mixed = createArtworkIcon("mixed", regular, {
15
44
  bold: "M12 12h120v120H12z",
@@ -18,6 +47,7 @@ describe("original artwork icon contract", () => {
18
47
  const view = render(() => <Mixed strokeWidth={weight()} />);
19
48
  expect(view.container.querySelector("image")).not.toBeNull();
20
49
  setWeight(3);
50
+ flush();
21
51
  expect(view.container.querySelector("image")).toBeNull();
22
52
  expect(view.container.querySelector("path")).not.toBeNull();
23
53
  });
@@ -51,6 +81,7 @@ describe("original artwork icon contract", () => {
51
81
  expect(svg.getAttribute("role")).toBe("img");
52
82
  expect(svg.hasAttribute("aria-hidden")).toBe(false);
53
83
  setSize(24);
84
+ flush();
54
85
  expect(svg.getAttribute("width")).toBe("24");
55
86
  expect(svg.getAttribute("class")).toContain("indicator");
56
87
  });
@@ -80,6 +111,7 @@ describe("original artwork icon contract", () => {
80
111
  const images = view.container.querySelectorAll("image");
81
112
  expect(images[0].getAttribute("href")).toBe(regular);
82
113
  setWeight(3);
114
+ flush();
83
115
  expect(images[0].getAttribute("href")).toBe(bold);
84
116
  expect(images[1].getAttribute("href")).toBe(filled);
85
117
  expect(view.container.querySelector("svg")?.getAttribute("fill")).toBe(
@@ -1,13 +1,11 @@
1
- import {
2
- Show,
3
- createUniqueId,
4
- splitProps,
5
- type Component,
6
- type JSX,
7
- } from "solid-js";
1
+ /// <reference path="./asset-modules.d.ts" />
2
+ import { ariaBool } from "../utils/aria";
3
+ import { Show, createUniqueId, omit, type Component } from "solid-js";
4
+ import type { JSX } from "@solidjs/web";
8
5
 
9
6
  export type IconProps = JSX.SvgSVGAttributes<SVGSVGElement> & {
10
7
  size?: number | string;
8
+ transform?: string;
11
9
  title?: string;
12
10
  strokeWidth?: number | string;
13
11
  absoluteStrokeWidth?: boolean;
@@ -16,18 +14,23 @@ export type IconProps = JSX.SvgSVGAttributes<SVGSVGElement> & {
16
14
 
17
15
  export type ArtworkIconComponent = Component<IconProps>;
18
16
 
17
+ export type ArtworkSource = string | { readonly image: string };
18
+
19
19
  export interface ArtworkVariants {
20
- bold?: string;
21
- filled?: string;
20
+ bold?: ArtworkSource;
21
+ filled?: ArtworkSource;
22
+ /** Intrinsic source orientation; native SVG transforms remain caller-controlled. */
23
+ rotation?: number;
22
24
  }
23
25
 
24
- function ArtworkLayer(props: { source: string; id: string; fill: string }) {
26
+ function ArtworkLayer(props: { source: ArtworkSource; id: string; fill: string }) {
27
+ const imageSource = () => typeof props.source === "string" ? props.source : props.source.image;
25
28
  return (
26
29
  <Show
27
- when={props.source.startsWith("data:")}
30
+ when={typeof props.source !== "string" || props.source.startsWith("data:")}
28
31
  fallback={
29
32
  <path
30
- d={props.source}
33
+ d={typeof props.source === "string" ? props.source : ""}
31
34
  fill={props.fill}
32
35
  fill-rule="evenodd"
33
36
  stroke="none"
@@ -44,7 +47,7 @@ function ArtworkLayer(props: { source: string; id: string; fill: string }) {
44
47
  maskUnits="userSpaceOnUse"
45
48
  style={{ "mask-type": "alpha" }}
46
49
  >
47
- <image href={props.source} x="0" y="0" width="144" height="144" />
50
+ <image href={imageSource()} x="0" y="0" width="144" height="144" />
48
51
  </mask>
49
52
  </defs>
50
53
  <rect
@@ -67,33 +70,23 @@ function accessibility(props: IconProps, titleId: string) {
67
70
  "aria-label": props["aria-label"],
68
71
  "aria-labelledby":
69
72
  props["aria-labelledby"] ?? (props.title ? titleId : undefined),
70
- "aria-hidden": props["aria-hidden"] ?? (labelled ? undefined : true),
73
+ "aria-hidden": ariaBool(
74
+ typeof props["aria-hidden"] === "string"
75
+ ? props["aria-hidden"] === "true"
76
+ : (props["aria-hidden"] ?? (labelled ? undefined : true)),
77
+ ),
71
78
  } as const;
72
79
  }
73
80
 
74
81
  /** Render original generated artwork while retaining native SVG component props. */
75
82
  export function createArtworkIcon(
76
83
  name: string,
77
- source: string,
84
+ source: ArtworkSource,
78
85
  variants: ArtworkVariants = {}
79
86
  ): ArtworkIconComponent {
80
87
  return function ArtworkIcon(props) {
81
- const [local, rest] = splitProps(props, [
82
- "size",
83
- "width",
84
- "height",
85
- "title",
86
- "children",
87
- "fill",
88
- "role",
89
- "aria-hidden",
90
- "aria-label",
91
- "aria-labelledby",
92
- "strokeWidth",
93
- "stroke-width",
94
- "absoluteStrokeWidth",
95
- "weight",
96
- ]);
88
+ const local = props;
89
+ const rest = omit(props, "size", "width", "height", "title", "children", "fill", "role", "aria-hidden", "aria-label", "aria-labelledby", "strokeWidth", "stroke-width", "absoluteStrokeWidth", "weight");
97
90
  const id = `artwork-${createUniqueId()}`;
98
91
  const titleId = `${id}-title`;
99
92
  const artwork = () => {
@@ -114,16 +107,18 @@ export function createArtworkIcon(
114
107
  stroke="none"
115
108
  data-icon={name}
116
109
  >
117
- {local.title && <title id={titleId}>{local.title}</title>}
110
+ <title id={titleId}>{local.title}</title>
118
111
  {local.children}
119
- <ArtworkLayer source={artwork()} id={id} fill="currentColor" />
120
- {variants.filled && (
121
- <ArtworkLayer
122
- source={variants.filled}
123
- id={`${id}-filled`}
124
- fill="inherit"
125
- />
126
- )}
112
+ <g transform={variants.rotation ? `rotate(${variants.rotation} 72 72)` : undefined}>
113
+ <ArtworkLayer source={artwork()} id={id} fill="currentColor" />
114
+ {variants.filled && (
115
+ <ArtworkLayer
116
+ source={variants.filled}
117
+ id={`${id}-filled`}
118
+ fill="inherit"
119
+ />
120
+ )}
121
+ </g>
127
122
  </svg>
128
123
  );
129
124
  };
@@ -1,4 +1,4 @@
1
1
  // Generated by scripts/build-icon-assets.mjs.
2
2
  import { createArtworkIcon } from "./create-artwork-icon";
3
- import { artwork } from "./artwork/ellipsis-vertical";
4
- export default /* @__PURE__ */ createArtworkIcon("ellipsis-vertical", artwork);
3
+ import { artwork } from "./artwork/ellipsis";
4
+ export default /* @__PURE__ */ createArtworkIcon("ellipsis-vertical", artwork, { rotation: 90 });
@@ -164,6 +164,11 @@ export { default as CheckBold } from "./check-bold";
164
164
  export { default as CircleCheckBold } from "./circle-check-bold";
165
165
  export { default as TaxDocument } from "./tax-document";
166
166
  export { default as Github } from "./github";
167
+ export { default as BirOffice } from "./bir-office";
168
+ export { default as Sales } from "./sales";
169
+ export { default as BirForm2307 } from "./bir-form-2307";
170
+ export { default as BirForm0619E } from "./bir-form-0619-e";
171
+ export { default as BirForm1601Eq } from "./bir-form-1601-eq";
167
172
  export { default as AlertCircle } from "./circle-alert";
168
173
  export { default as AlertTriangle } from "./triangle-alert";
169
174
  export { default as BarChart3 } from "./chart-column";
@@ -1,4 +1,4 @@
1
1
  // Generated by scripts/build-icon-assets.mjs.
2
2
  import { createArtworkIcon } from "./create-artwork-icon";
3
- import { artwork } from "./artwork/key-round";
3
+ import { artwork } from "./artwork/key";
4
4
  export default /* @__PURE__ */ createArtworkIcon("key-round", artwork);
@@ -167,6 +167,11 @@ const loaders = {
167
167
  "circle-check-bold": () => import("./circle-check-bold"),
168
168
  "tax-document": () => import("./tax-document"),
169
169
  "github": () => import("./github"),
170
+ "bir-office": () => import("./bir-office"),
171
+ "sales": () => import("./sales"),
172
+ "bir-form-2307": () => import("./bir-form-2307"),
173
+ "bir-form-0619-e": () => import("./bir-form-0619-e"),
174
+ "bir-form-1601-eq": () => import("./bir-form-1601-eq"),
170
175
  "bar-chart-3": () => import("./chart-column"),
171
176
  "loader-2": () => import("./loader-circle"),
172
177
  "alert-triangle": () => import("./triangle-alert"),
@@ -187,11 +192,11 @@ const loaders = {
187
192
 
188
193
  export type IconName = keyof typeof loaders;
189
194
 
190
- export function isIconName(name: string): name is IconName {
191
- return Object.hasOwn(loaders, name);
195
+ export function isIconName(name: unknown): name is IconName {
196
+ return typeof name === "string" && Object.hasOwn(loaders, name);
192
197
  }
193
198
 
194
- export async function loadIcon(name: string): Promise<ArtworkIconComponent | null> {
199
+ export async function loadIcon(name: unknown): Promise<ArtworkIconComponent | null> {
195
200
  if (!isIconName(name)) return null;
196
201
  return (await loaders[name]()).default;
197
202
  }
@@ -0,0 +1,4 @@
1
+ // Generated by scripts/build-icon-assets.mjs.
2
+ import { createArtworkIcon } from "./create-artwork-icon";
3
+ import { artwork } from "./artwork/sales";
4
+ export default /* @__PURE__ */ createArtworkIcon("sales", artwork);
@@ -1,4 +1,4 @@
1
1
  // Generated by scripts/build-icon-assets.mjs.
2
2
  import { createArtworkIcon } from "./create-artwork-icon";
3
- import { artwork } from "./artwork/settings-2";
3
+ import { artwork } from "./artwork/settings";
4
4
  export default /* @__PURE__ */ createArtworkIcon("settings-2", artwork);
@@ -1,5 +1,5 @@
1
1
  // Generated by scripts/build-icon-assets.mjs.
2
2
  import { createArtworkIcon } from "./create-artwork-icon";
3
3
  import { artwork } from "./artwork/star";
4
- import { artwork as variant } from "./artwork/star-filled";
5
- export default /* @__PURE__ */ createArtworkIcon("star", artwork, { filled: variant });
4
+ import { artwork as filled } from "./artwork/star-filled";
5
+ export default /* @__PURE__ */ createArtworkIcon("star", artwork, { filled });
@@ -1,4 +1,4 @@
1
1
  // Generated by scripts/build-icon-assets.mjs.
2
2
  import { createArtworkIcon } from "./create-artwork-icon";
3
- import { artwork } from "./artwork/user-round";
3
+ import { artwork } from "./artwork/user";
4
4
  export default /* @__PURE__ */ createArtworkIcon("user-round", artwork);
@@ -1,4 +1,4 @@
1
1
  // Generated by scripts/build-icon-assets.mjs.
2
2
  import { createArtworkIcon } from "./create-artwork-icon";
3
- import { artwork } from "./artwork/users-round";
3
+ import { artwork } from "./artwork/users";
4
4
  export default /* @__PURE__ */ createArtworkIcon("users-round", artwork);
@@ -12,7 +12,8 @@ import Coins from "../icons/coins";
12
12
  import PiggyBank from "../icons/piggy-bank";
13
13
  import DollarSign from "../icons/dollar-sign";
14
14
  import Receipt from "../icons/receipt";
15
- import type { Component, JSX } from "solid-js";
15
+ import type { Component } from "solid-js";
16
+ import type { JSX } from "@solidjs/web";
16
17
 
17
18
  export type IconComponent = Component<JSX.SvgSVGAttributes<SVGSVGElement> & { size?: number }>;
18
19
 
@@ -17,7 +17,8 @@
17
17
  // fetch 404s/fails and the index stays empty, so resolveAccount() then falls back
18
18
  // to the type-default glyph.
19
19
 
20
- import { createResource, type Resource } from "solid-js";
20
+ import { createRoot, runWithOwner } from "solid-js";
21
+ import { createFetchResource, type FetchResource } from "./fetch-resource";
21
22
  import { getActiveWorkspaceId } from "./integration";
22
23
  import type { AvatarAccount } from "../components/base/AccountAvatar";
23
24
 
@@ -71,12 +72,14 @@ async function fetchAccountsIndex(wsId: number | string | null): Promise<IndexSh
71
72
 
72
73
  // Module-level singletons so a page with N rows fires one fetch per org, not
73
74
  // 2*N. Created on first useAccountsIndex() call.
74
- let sharedResource: Resource<IndexShape> | undefined;
75
+ let sharedResource: FetchResource<IndexShape> | undefined;
75
76
 
76
- export function useAccountsIndex(): Resource<IndexShape> {
77
+ export function useAccountsIndex(): FetchResource<IndexShape> {
77
78
  if (!sharedResource) {
78
- const [data] = createResource(() => getActiveWorkspaceId(), fetchAccountsIndex);
79
- sharedResource = data;
79
+ // Detached: the shared index must outlive whichever component asked first.
80
+ sharedResource = runWithOwner(null, () =>
81
+ createRoot(() => createFetchResource(() => getActiveWorkspaceId(), fetchAccountsIndex)),
82
+ )!;
80
83
  }
81
84
  return sharedResource;
82
85
  }
@@ -0,0 +1,13 @@
1
+ // Solid 2 removes a boolean-false attribute, which would drop aria-expanded="false";
2
+ // ARIA state attributes must be serialized as strings.
3
+ export function ariaBool(value: boolean | undefined | null): "true" | "false" | undefined {
4
+ if (value === undefined || value === null) return undefined;
5
+ return value ? "true" : "false";
6
+ }
7
+
8
+ /** For aria-pressed / aria-checked, which also allow "mixed". */
9
+ export function ariaTri(
10
+ value: boolean | "mixed" | undefined | null,
11
+ ): "true" | "false" | "mixed" | undefined {
12
+ return value === "mixed" ? "mixed" : ariaBool(value);
13
+ }
@@ -8,7 +8,7 @@
8
8
  // kit, no Tailwind — Modal and Button inject their own styles.
9
9
 
10
10
  import { createSignal, Show } from "solid-js";
11
- import { render } from "solid-js/web";
11
+ import { render } from "@solidjs/web";
12
12
  import Modal from "../components/base/Modal";
13
13
  import Button from "../components/base/Button";
14
14
 
package/src/utils/dom.ts CHANGED
@@ -69,15 +69,16 @@ export function unlockPullToRefresh() {
69
69
  * a teardown function the caller can use to deactivate the trap explicitly
70
70
  * (also runs automatically when called inside a Solid `onCleanup`).
71
71
  *
72
- * Use this from a ref callback or Solid effect:
72
+ * Use this from a ref callback, keeping the teardown for an owner-level
73
+ * onCleanup (Solid 2 forbids onCleanup inside a ref callback):
73
74
  *
74
- * <div ref={(el) => { onCleanup(useFocusTrap(el)); }}>
75
+ * let release: (() => void) | undefined;
76
+ * onCleanup(() => release?.());
77
+ * <div ref={(el) => { release = useFocusTrap(el); }}>
75
78
  *
76
- * Or from an effect:
79
+ * Or from an effect, returning the teardown:
77
80
  *
78
- * createEffect(() => {
79
- * if (containerRef) onCleanup(useFocusTrap(containerRef));
80
- * });
81
+ * createEffect(() => containerRef, (el) => (el ? useFocusTrap(el) : undefined));
81
82
  *
82
83
  * The trap only intercepts Tab. Escape, click-outside, and submit handling
83
84
  * remain the modal's responsibility, the trap is purely a focus-keeper.
@@ -0,0 +1,59 @@
1
+ import { createEffect, createSignal, onCleanup, untrack, type Accessor } from "solid-js";
2
+
3
+ /**
4
+ * Value accessor with load state, the shape `createResource` gave callers.
5
+ * Solid 2 async memos throw to a <Loading> boundary instead; consumers of these
6
+ * hooks read `value()` unguarded, so loading stays a plain flag here.
7
+ */
8
+ export interface FetchResource<T> extends Accessor<T | undefined> {
9
+ readonly loading: boolean;
10
+ readonly error: unknown;
11
+ }
12
+
13
+ /**
14
+ * Fetch `fetcher(source())` whenever `source` changes to a truthy value.
15
+ * A falsy source skips the fetch and keeps the last value; a refetch keeps the
16
+ * previous value until the new one lands; a superseded response is dropped.
17
+ */
18
+ export function createFetchResource<S, T>(
19
+ source: () => S | false | null | undefined,
20
+ fetcher: (source: S) => Promise<T>,
21
+ ): FetchResource<T> {
22
+ const [value, setValue] = createSignal<T | undefined>(undefined);
23
+ // Seeded from the source so an initial read matches createResource's loading=true.
24
+ const [loading, setLoading] = createSignal(!!untrack(source));
25
+ const [error, setError] = createSignal<unknown>(undefined);
26
+ let token = 0;
27
+
28
+ createEffect(source, (src) => {
29
+ const mine = ++token;
30
+ if (!src) {
31
+ setLoading(false);
32
+ return;
33
+ }
34
+ setLoading(true);
35
+ setError(undefined);
36
+ fetcher(src).then(
37
+ (next) => {
38
+ if (mine !== token) return;
39
+ setValue(() => next);
40
+ setLoading(false);
41
+ },
42
+ (err: unknown) => {
43
+ if (mine !== token) return;
44
+ setError(err);
45
+ setLoading(false);
46
+ },
47
+ );
48
+ });
49
+ onCleanup(() => {
50
+ token++;
51
+ });
52
+
53
+ const read = (() => value()) as FetchResource<T>;
54
+ Object.defineProperties(read, {
55
+ loading: { get: loading },
56
+ error: { get: error },
57
+ });
58
+ return read;
59
+ }
@@ -8,7 +8,7 @@
8
8
  // /helper class is added once per page via a runtime <style> tag. Callers can
9
9
  // still pass their own `markClass` to override.
10
10
 
11
- import { type JSX } from "solid-js";
11
+ import type { JSX } from "@solidjs/web";
12
12
  import { injectCSS } from "./inject-css";
13
13
 
14
14
  const MARK_STYLE_ID = "ksui-mark-style";
@@ -14,15 +14,15 @@ import { createContext, useContext, type Accessor } from "solid-js";
14
14
  // both mean "mount to document.body", today's behavior.
15
15
  const ModalLayerContext = createContext<Accessor<HTMLElement | null>>(() => null);
16
16
 
17
- export const ModalLayerProvider = ModalLayerContext.Provider;
17
+ export const ModalLayerProvider = ModalLayerContext;
18
18
 
19
19
  /**
20
20
  * Mount target for a Portal-based popover: the nearest ancestor dialog's
21
21
  * element when rendered inside a dialog-variant Modal, else document.body.
22
22
  * Called once per popover-open (the Portal itself only reads `mount` at
23
- * creation), so a plain `Node` accessor — not a reactive signal — is enough.
23
+ * creation), so a plain element accessor — not a reactive signal — is enough.
24
24
  */
25
- export function usePopoverMount(): () => Node {
25
+ export function usePopoverMount(): () => HTMLElement {
26
26
  const layer = useContext(ModalLayerContext);
27
27
  return () => layer() ?? document.body;
28
28
  }
@@ -1,4 +1,5 @@
1
- import { createResource, createEffect, onCleanup, type Resource } from "solid-js";
1
+ import { createEffect, onCleanup } from "solid-js";
2
+ import { createFetchResource, type FetchResource } from "./fetch-resource";
2
3
 
3
4
  export interface ObjectUrlOptions {
4
5
  /** Extra fetch init, merged after `credentials: "include"` (e.g. tenant headers). */
@@ -25,8 +26,8 @@ export interface ObjectUrlOptions {
25
26
  export function createObjectUrlResource(
26
27
  href: () => string | null | undefined,
27
28
  options: ObjectUrlOptions = {},
28
- ): Resource<string | null> {
29
- const [url] = createResource(
29
+ ): FetchResource<string | null> {
30
+ const url = createFetchResource(
30
31
  () => href() || null,
31
32
  async (src) => {
32
33
  const res = await fetch(src, { credentials: "include", ...options.init });
@@ -40,11 +41,13 @@ export function createObjectUrlResource(
40
41
  // final one on unmount. During a refetch the resource holds its prior value
41
42
  // (cur === prev), so an in-flight reload doesn't revoke a URL still on screen.
42
43
  let prev: string | null = null;
43
- createEffect(() => {
44
- const cur = url() ?? null;
45
- if (prev && prev !== cur) URL.revokeObjectURL(prev);
46
- prev = cur;
47
- });
44
+ createEffect(
45
+ () => url() ?? null,
46
+ (cur) => {
47
+ if (prev && prev !== cur) URL.revokeObjectURL(prev);
48
+ prev = cur;
49
+ },
50
+ );
48
51
  onCleanup(() => {
49
52
  if (prev) URL.revokeObjectURL(prev);
50
53
  });
@@ -1,4 +1,3 @@
1
- import { onMount } from "solid-js";
2
1
  import { injectCSS } from "./inject-css";
3
2
 
4
3
  const STYLE_ID = "ksui-toplayer-style";
@@ -23,17 +22,16 @@ const STYLE_CSS = `
23
22
  * ksui popup keeps its own mousedown/Escape listeners unchanged.
24
23
  *
25
24
  * Call from the portaled panel's ref, mirroring useFocusTrap's shape:
26
- * ref={(el) => { popupRef = el; onCleanup(useTopLayer(el)); }}
25
+ * ref={(el) => { popupRef = el; useTopLayer(el); }}
27
26
  *
28
- * showPopover() is deferred to onMount, not called inline here: this
27
+ * showPopover() is deferred to a microtask, not called inline here: this
29
28
  * function runs synchronously inside <Portal>'s ref callback, which fires
30
29
  * while the node is still detached (Portal appends its container to
31
30
  * document.body *after* building the subtree) — el.isConnected is false
32
31
  * and el.ownerDocument !== document at that point, so an inline call
33
- * always throws InvalidStateError. onMount queues onto Solid's render-effect
34
- * list, which only flushes once the whole synchronous render pass —
35
- * including Portal's appendChild — has finished, so by the time it runs
36
- * the node is guaranteed connected. (Same fix shape as Modal's DialogModal,
32
+ * always throws InvalidStateError. A microtask runs only after the whole synchronous
33
+ * render pass — including Portal's appendChild — has finished, so by the
34
+ * time it runs the node is connected. (Same fix shape as Modal's DialogModal,
37
35
  * which calls showModal() in onMount rather than in dialogEl's ref.)
38
36
  */
39
37
  export function useTopLayer(el: HTMLElement | undefined): () => void {
@@ -41,7 +39,10 @@ export function useTopLayer(el: HTMLElement | undefined): () => void {
41
39
  injectCSS(STYLE_ID, STYLE_CSS);
42
40
  el.setAttribute("popover", "manual");
43
41
  el.setAttribute("data-ksui-toplayer", "");
44
- onMount(() => {
42
+ // Primitives are forbidden in a ref callback, so a microtask stands in for
43
+ // onSettled. The element leaves the top layer by itself when its portal is removed.
44
+ queueMicrotask(() => {
45
+ if (!el.isConnected) return;
45
46
  // No Popover API (e.g. jsdom in unit tests) — nothing to promote, not an error.
46
47
  if (typeof el.showPopover !== "function") return;
47
48
  try {