@openreachtech/furo-vue 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (310) hide show
  1. package/LICENSE +9 -0
  2. package/README.ja.md +334 -0
  3. package/README.md +333 -0
  4. package/index.js +11 -0
  5. package/lib/assets/css/furo/0010.variables-palette-color-scale.css +298 -0
  6. package/lib/assets/css/furo/0020.variables-z-index.css +10 -0
  7. package/lib/assets/css/furo/0030.variables-semantic-color.css +178 -0
  8. package/lib/assets/css/furo/0035.variables-semantic-dimension.css +104 -0
  9. package/lib/assets/css/furo/0040.variables-component-furo.css +28 -0
  10. package/lib/assets/css/furo/0050.furo-editor-content.css +22 -0
  11. package/lib/assets/css/furo.css +15 -0
  12. package/lib/components/atoms/FuroAvatar/FuroAvatar.vue +135 -0
  13. package/lib/components/atoms/FuroAvatar/FuroAvatarContext.js +147 -0
  14. package/lib/components/atoms/FuroBadge/FuroBadge.vue +240 -0
  15. package/lib/components/atoms/FuroBadge/FuroBadgeContext.js +298 -0
  16. package/lib/components/atoms/FuroButton/ButtonEmitPayload.js +44 -0
  17. package/lib/components/atoms/FuroButton/FuroButton.vue +301 -0
  18. package/lib/components/atoms/FuroButton/FuroButtonContext.js +328 -0
  19. package/lib/components/atoms/FuroCheckbox/CheckboxEmitPayload.js +106 -0
  20. package/lib/components/atoms/FuroCheckbox/FuroCheckbox.vue +173 -0
  21. package/lib/components/atoms/FuroCheckbox/FuroCheckboxContext.js +682 -0
  22. package/lib/components/atoms/FuroEmailField/EmailFieldEmitPayload.js +74 -0
  23. package/lib/components/atoms/FuroEmailField/FuroEmailField.vue +119 -0
  24. package/lib/components/atoms/FuroEmailField/FuroEmailFieldContext.js +311 -0
  25. package/lib/components/atoms/FuroFileField/FileFieldEmitPayload.js +80 -0
  26. package/lib/components/atoms/FuroFileField/FuroFileField.vue +128 -0
  27. package/lib/components/atoms/FuroFileField/FuroFileFieldContext.js +195 -0
  28. package/lib/components/atoms/FuroIcon/FuroIcon.vue +74 -0
  29. package/lib/components/atoms/FuroIcon/FuroIconContext.js +293 -0
  30. package/lib/components/atoms/FuroIcon/FuroIconRegistry.js +617 -0
  31. package/lib/components/atoms/FuroIcon/FuroIconifyRendererContext.js +101 -0
  32. package/lib/components/atoms/FuroIcon/furoIconData.js +164 -0
  33. package/lib/components/atoms/FuroIcon/iconRenderers.js +62 -0
  34. package/lib/components/atoms/FuroIcon/icons.js +7 -0
  35. package/lib/components/atoms/FuroNumberField/FuroNumberField.vue +213 -0
  36. package/lib/components/atoms/FuroNumberField/FuroNumberFieldContext.js +442 -0
  37. package/lib/components/atoms/FuroNumberField/NumberFieldEmitPayload.js +162 -0
  38. package/lib/components/atoms/FuroPasswordField/FuroPasswordField.vue +119 -0
  39. package/lib/components/atoms/FuroPasswordField/FuroPasswordFieldContext.js +311 -0
  40. package/lib/components/atoms/FuroPasswordField/PasswordFieldEmitPayload.js +74 -0
  41. package/lib/components/atoms/FuroRadio/FuroRadio.vue +193 -0
  42. package/lib/components/atoms/FuroRadio/FuroRadioContext.js +557 -0
  43. package/lib/components/atoms/FuroRadio/RadioEmitPayload.js +72 -0
  44. package/lib/components/atoms/FuroSwitch/FuroSwitch.vue +165 -0
  45. package/lib/components/atoms/FuroSwitch/FuroSwitchContext.js +440 -0
  46. package/lib/components/atoms/FuroSwitch/SwitchEmitPayload.js +86 -0
  47. package/lib/components/atoms/FuroTextField/FuroTextField.vue +119 -0
  48. package/lib/components/atoms/FuroTextField/FuroTextFieldContext.js +311 -0
  49. package/lib/components/atoms/FuroTextField/TextFieldEmitPayload.js +83 -0
  50. package/lib/components/atoms/FuroTextarea/FuroTextarea.vue +121 -0
  51. package/lib/components/atoms/FuroTextarea/FuroTextareaContext.js +322 -0
  52. package/lib/components/atoms/FuroTextarea/TextareaEmitPayload.js +83 -0
  53. package/lib/components/atoms/FuroToggle/FuroToggle.vue +172 -0
  54. package/lib/components/atoms/FuroToggle/FuroToggleContext.js +410 -0
  55. package/lib/components/atoms/FuroToggle/ToggleEmitPayload.js +86 -0
  56. package/lib/components/molecules/FuroAccordion/AccordionEmitPayload.js +80 -0
  57. package/lib/components/molecules/FuroAccordion/FuroAccordion.vue +219 -0
  58. package/lib/components/molecules/FuroAccordion/FuroAccordionContext.js +547 -0
  59. package/lib/components/molecules/FuroAttachment/FuroAttachment.vue +376 -0
  60. package/lib/components/molecules/FuroAttachment/FuroAttachmentContext.js +628 -0
  61. package/lib/components/molecules/FuroAutocompleteField/AutocompleteEmitPayload.js +225 -0
  62. package/lib/components/molecules/FuroAutocompleteField/FuroAutocompleteField.vue +669 -0
  63. package/lib/components/molecules/FuroAutocompleteField/FuroAutocompleteFieldContext.js +1525 -0
  64. package/lib/components/molecules/FuroAvatarGroup/FuroAvatarGroup.vue +126 -0
  65. package/lib/components/molecules/FuroAvatarGroup/FuroAvatarGroupContext.js +245 -0
  66. package/lib/components/molecules/FuroBreadcrumb/FuroBreadcrumb.vue +219 -0
  67. package/lib/components/molecules/FuroBreadcrumb/FuroBreadcrumbContext.js +257 -0
  68. package/lib/components/molecules/FuroCollapsible/CollapsibleEmitPayload.js +69 -0
  69. package/lib/components/molecules/FuroCollapsible/FuroCollapsible.vue +177 -0
  70. package/lib/components/molecules/FuroCollapsible/FuroCollapsibleContext.js +389 -0
  71. package/lib/components/molecules/FuroControlBlock/FuroControlBlock.vue +149 -0
  72. package/lib/components/molecules/FuroControlBlock/FuroControlBlockContext.js +81 -0
  73. package/lib/components/molecules/FuroDatePicker/DatePickerEmitPayload.js +74 -0
  74. package/lib/components/molecules/FuroDatePicker/FuroDatePicker.vue +661 -0
  75. package/lib/components/molecules/FuroDatePicker/FuroDatePickerContext.js +1038 -0
  76. package/lib/components/molecules/FuroDateTimePicker/DateTimePickerEmitPayload.js +96 -0
  77. package/lib/components/molecules/FuroDateTimePicker/FuroDateTimePicker.vue +153 -0
  78. package/lib/components/molecules/FuroDateTimePicker/FuroDateTimePickerContext.js +840 -0
  79. package/lib/components/molecules/FuroDropdownMenu/DropdownMenuOptionSelectEmitPayload.js +100 -0
  80. package/lib/components/molecules/FuroDropdownMenu/FuroDropdownMenu.vue +348 -0
  81. package/lib/components/molecules/FuroDropdownMenu/FuroDropdownMenuContext.js +714 -0
  82. package/lib/components/molecules/FuroDropdownMenu/FuroDropdownMenuOptionRows.vue +222 -0
  83. package/lib/components/molecules/FuroEditableField/EditableEmitPayload.js +89 -0
  84. package/lib/components/molecules/FuroEditableField/FuroEditableField.vue +314 -0
  85. package/lib/components/molecules/FuroEditableField/FuroEditableFieldContext.js +1018 -0
  86. package/lib/components/molecules/FuroEditableField/processors/EditorCollisionProcessor.js +236 -0
  87. package/lib/components/molecules/FuroEditableField/processors/ObjectProcessor.js +101 -0
  88. package/lib/components/molecules/FuroEmptyState/FuroEmptyState.vue +124 -0
  89. package/lib/components/molecules/FuroEmptyState/FuroEmptyStateContext.js +42 -0
  90. package/lib/components/molecules/FuroErrorState/FuroErrorState.vue +125 -0
  91. package/lib/components/molecules/FuroErrorState/FuroErrorStateContext.js +42 -0
  92. package/lib/components/molecules/FuroPagination/FuroPagination.vue +246 -0
  93. package/lib/components/molecules/FuroPagination/FuroPaginationContext.js +489 -0
  94. package/lib/components/molecules/FuroPopover/FuroPopover.vue +171 -0
  95. package/lib/components/molecules/FuroPopover/FuroPopoverContext.js +279 -0
  96. package/lib/components/molecules/FuroScrollArea/FuroScrollArea.vue +181 -0
  97. package/lib/components/molecules/FuroScrollArea/FuroScrollAreaContext.js +149 -0
  98. package/lib/components/molecules/FuroSearchField/FuroSearchField.vue +155 -0
  99. package/lib/components/molecules/FuroSearchField/FuroSearchFieldContext.js +231 -0
  100. package/lib/components/molecules/FuroSectionHeader/FuroSectionHeader.vue +140 -0
  101. package/lib/components/molecules/FuroSectionHeader/FuroSectionHeaderContext.js +204 -0
  102. package/lib/components/molecules/FuroSelect/FuroSelect.vue +474 -0
  103. package/lib/components/molecules/FuroSelect/FuroSelectContext.js +743 -0
  104. package/lib/components/molecules/FuroSelect/SelectEmitPayload.js +181 -0
  105. package/lib/components/molecules/FuroSeparator/FuroSeparator.vue +88 -0
  106. package/lib/components/molecules/FuroSeparator/FuroSeparatorContext.js +40 -0
  107. package/lib/components/molecules/FuroSkeleton/FuroSkeleton.vue +101 -0
  108. package/lib/components/molecules/FuroSkeleton/FuroSkeletonContext.js +82 -0
  109. package/lib/components/molecules/FuroSplitter/FuroSplitter.vue +237 -0
  110. package/lib/components/molecules/FuroSplitter/FuroSplitterContext.js +429 -0
  111. package/lib/components/molecules/FuroSplitter/SplitterEmitPayload.js +69 -0
  112. package/lib/components/molecules/FuroTimeField/FuroTimeField.vue +251 -0
  113. package/lib/components/molecules/FuroTimeField/FuroTimeFieldContext.js +1138 -0
  114. package/lib/components/molecules/FuroTimeField/TimeFieldEmitPayload.js +74 -0
  115. package/lib/components/molecules/FuroToggleGroup/FuroToggleGroup.vue +211 -0
  116. package/lib/components/molecules/FuroToggleGroup/FuroToggleGroupContext.js +551 -0
  117. package/lib/components/molecules/FuroToggleGroup/ToggleGroupEmitPayload.js +80 -0
  118. package/lib/components/molecules/FuroToolBar/FuroToolBar.vue +91 -0
  119. package/lib/components/molecules/FuroToolBar/FuroToolBarContext.js +75 -0
  120. package/lib/components/molecules/FuroTooltip/FuroTooltip.vue +183 -0
  121. package/lib/components/molecules/FuroTooltip/FuroTooltipContext.js +290 -0
  122. package/lib/components/organisms/FuroAlertDialog/FuroAlertDialog.vue +324 -0
  123. package/lib/components/organisms/FuroAlertDialog/FuroAlertDialogContext.js +608 -0
  124. package/lib/components/organisms/FuroDialog/FuroDialog.vue +362 -0
  125. package/lib/components/organisms/FuroDialog/FuroDialogContext.js +535 -0
  126. package/lib/components/organisms/FuroDrawer/FuroDrawer.vue +618 -0
  127. package/lib/components/organisms/FuroDrawer/FuroDrawerContext.js +676 -0
  128. package/lib/components/organisms/FuroEditor/FuroEditor.vue +613 -0
  129. package/lib/components/organisms/FuroEditor/FuroEditorCommandContext.js +420 -0
  130. package/lib/components/organisms/FuroEditor/FuroEditorContext.js +2048 -0
  131. package/lib/components/organisms/FuroEditor/FuroEditorMentionMenu.vue +120 -0
  132. package/lib/components/organisms/FuroEditor/FuroEditorMentionMenuContext.js +261 -0
  133. package/lib/components/organisms/FuroEditor/PreserveNewlinesPasteExtension.js +267 -0
  134. package/lib/components/organisms/FuroEditor/build-editor-extensions.js +97 -0
  135. package/lib/components/organisms/FuroEditor/mention-suggestion.js +320 -0
  136. package/lib/components/organisms/FuroEditor/paste-link-segments.js +124 -0
  137. package/lib/components/organisms/FuroSidebar/FuroSidebar.vue +473 -0
  138. package/lib/components/organisms/FuroSidebar/FuroSidebarContext.js +1014 -0
  139. package/lib/components/organisms/FuroStepper/FuroStepper.vue +345 -0
  140. package/lib/components/organisms/FuroStepper/FuroStepperContext.js +481 -0
  141. package/lib/components/organisms/FuroTable/FuroTable.vue +707 -0
  142. package/lib/components/organisms/FuroTable/FuroTableContext.js +1965 -0
  143. package/lib/components/organisms/FuroTable/FuroTableRowItemContext.js +111 -0
  144. package/lib/components/organisms/FuroTabs/FuroTabs.vue +403 -0
  145. package/lib/components/organisms/FuroTabs/FuroTabsContext.js +846 -0
  146. package/lib/components/organisms/FuroToast/FuroToast.vue +624 -0
  147. package/lib/components/organisms/FuroToast/FuroToastContext.js +1089 -0
  148. package/lib/components/organisms/FuroToast/FuroToaster.vue +44 -0
  149. package/lib/components/organisms/FuroToast/FuroToasterContext.js +113 -0
  150. package/lib/components/organisms/FuroToast/ToastQueue.js +325 -0
  151. package/lib/components/organisms/FuroToast/toast.js +64 -0
  152. package/lib/contexts/BaseFuroContext.js +318 -0
  153. package/lib/contexts/BaseFuroContextAccessor.js +47 -0
  154. package/lib/emit-payload/BaseEmitPayload.js +91 -0
  155. package/lib/index.components.js +61 -0
  156. package/lib/index.core.js +18 -0
  157. package/lib/tools/TimerClerk.js +75 -0
  158. package/nuxt/index.js +109 -0
  159. package/nuxt/runtime/furo-icon-renderer.js +24 -0
  160. package/package.json +137 -0
  161. package/public/furo-vue/components.json +4619 -0
  162. package/public/furo-vue/llms.txt +66 -0
  163. package/types/furo-nuxt.d.ts +48 -0
  164. package/types/generated/components/atoms/FuroAvatar/FuroAvatar.vue.d.ts +74 -0
  165. package/types/generated/components/atoms/FuroAvatar/FuroAvatarContext.d.ts +82 -0
  166. package/types/generated/components/atoms/FuroBadge/FuroBadge.vue.d.ts +12 -0
  167. package/types/generated/components/atoms/FuroBadge/FuroBadgeContext.d.ts +160 -0
  168. package/types/generated/components/atoms/FuroButton/ButtonEmitPayload.d.ts +19 -0
  169. package/types/generated/components/atoms/FuroButton/FuroButton.vue.d.ts +53 -0
  170. package/types/generated/components/atoms/FuroButton/FuroButtonContext.d.ts +156 -0
  171. package/types/generated/components/atoms/FuroCheckbox/CheckboxEmitPayload.d.ts +55 -0
  172. package/types/generated/components/atoms/FuroCheckbox/FuroCheckbox.vue.d.ts +87 -0
  173. package/types/generated/components/atoms/FuroCheckbox/FuroCheckboxContext.d.ts +342 -0
  174. package/types/generated/components/atoms/FuroEmailField/EmailFieldEmitPayload.d.ts +46 -0
  175. package/types/generated/components/atoms/FuroEmailField/FuroEmailField.vue.d.ts +458 -0
  176. package/types/generated/components/atoms/FuroEmailField/FuroEmailFieldContext.d.ts +161 -0
  177. package/types/generated/components/atoms/FuroFileField/FileFieldEmitPayload.d.ts +46 -0
  178. package/types/generated/components/atoms/FuroFileField/FuroFileField.vue.d.ts +454 -0
  179. package/types/generated/components/atoms/FuroFileField/FuroFileFieldContext.d.ts +109 -0
  180. package/types/generated/components/atoms/FuroIcon/FuroIcon.vue.d.ts +14 -0
  181. package/types/generated/components/atoms/FuroIcon/FuroIconContext.d.ts +152 -0
  182. package/types/generated/components/atoms/FuroIcon/FuroIconRegistry.d.ts +457 -0
  183. package/types/generated/components/atoms/FuroIcon/FuroIconifyRendererContext.d.ts +65 -0
  184. package/types/generated/components/atoms/FuroIcon/furoIconData.d.ts +154 -0
  185. package/types/generated/components/atoms/FuroIcon/iconRenderers.d.ts +6 -0
  186. package/types/generated/components/atoms/FuroIcon/icons.d.ts +6 -0
  187. package/types/generated/components/atoms/FuroNumberField/FuroNumberField.vue.d.ts +500 -0
  188. package/types/generated/components/atoms/FuroNumberField/FuroNumberFieldContext.d.ts +243 -0
  189. package/types/generated/components/atoms/FuroNumberField/NumberFieldEmitPayload.d.ts +74 -0
  190. package/types/generated/components/atoms/FuroPasswordField/FuroPasswordField.vue.d.ts +458 -0
  191. package/types/generated/components/atoms/FuroPasswordField/FuroPasswordFieldContext.d.ts +161 -0
  192. package/types/generated/components/atoms/FuroPasswordField/PasswordFieldEmitPayload.d.ts +46 -0
  193. package/types/generated/components/atoms/FuroRadio/FuroRadio.vue.d.ts +96 -0
  194. package/types/generated/components/atoms/FuroRadio/FuroRadioContext.d.ts +290 -0
  195. package/types/generated/components/atoms/FuroRadio/RadioEmitPayload.d.ts +39 -0
  196. package/types/generated/components/atoms/FuroSwitch/FuroSwitch.vue.d.ts +74 -0
  197. package/types/generated/components/atoms/FuroSwitch/FuroSwitchContext.d.ts +218 -0
  198. package/types/generated/components/atoms/FuroSwitch/SwitchEmitPayload.d.ts +42 -0
  199. package/types/generated/components/atoms/FuroTextField/FuroTextField.vue.d.ts +458 -0
  200. package/types/generated/components/atoms/FuroTextField/FuroTextFieldContext.d.ts +161 -0
  201. package/types/generated/components/atoms/FuroTextField/TextFieldEmitPayload.d.ts +52 -0
  202. package/types/generated/components/atoms/FuroTextarea/FuroTextarea.vue.d.ts +422 -0
  203. package/types/generated/components/atoms/FuroTextarea/FuroTextareaContext.d.ts +161 -0
  204. package/types/generated/components/atoms/FuroTextarea/TextareaEmitPayload.d.ts +52 -0
  205. package/types/generated/components/atoms/FuroToggle/FuroToggle.vue.d.ts +51 -0
  206. package/types/generated/components/atoms/FuroToggle/FuroToggleContext.d.ts +191 -0
  207. package/types/generated/components/atoms/FuroToggle/ToggleEmitPayload.d.ts +42 -0
  208. package/types/generated/components/molecules/FuroAccordion/AccordionEmitPayload.d.ts +41 -0
  209. package/types/generated/components/molecules/FuroAccordion/FuroAccordion.vue.d.ts +133 -0
  210. package/types/generated/components/molecules/FuroAccordion/FuroAccordionContext.d.ts +279 -0
  211. package/types/generated/components/molecules/FuroAttachment/FuroAttachment.vue.d.ts +79 -0
  212. package/types/generated/components/molecules/FuroAttachment/FuroAttachmentContext.d.ts +363 -0
  213. package/types/generated/components/molecules/FuroAutocompleteField/AutocompleteEmitPayload.d.ts +129 -0
  214. package/types/generated/components/molecules/FuroAutocompleteField/FuroAutocompleteField.vue.d.ts +751 -0
  215. package/types/generated/components/molecules/FuroAutocompleteField/FuroAutocompleteFieldContext.d.ts +722 -0
  216. package/types/generated/components/molecules/FuroAvatarGroup/FuroAvatarGroup.vue.d.ts +84 -0
  217. package/types/generated/components/molecules/FuroAvatarGroup/FuroAvatarGroupContext.d.ts +150 -0
  218. package/types/generated/components/molecules/FuroBreadcrumb/FuroBreadcrumb.vue.d.ts +24 -0
  219. package/types/generated/components/molecules/FuroBreadcrumb/FuroBreadcrumbContext.d.ts +152 -0
  220. package/types/generated/components/molecules/FuroCollapsible/CollapsibleEmitPayload.d.ts +36 -0
  221. package/types/generated/components/molecules/FuroCollapsible/FuroCollapsible.vue.d.ts +98 -0
  222. package/types/generated/components/molecules/FuroCollapsible/FuroCollapsibleContext.d.ts +191 -0
  223. package/types/generated/components/molecules/FuroControlBlock/FuroControlBlock.vue.d.ts +30 -0
  224. package/types/generated/components/molecules/FuroControlBlock/FuroControlBlockContext.d.ts +57 -0
  225. package/types/generated/components/molecules/FuroDatePicker/DatePickerEmitPayload.d.ts +41 -0
  226. package/types/generated/components/molecules/FuroDatePicker/FuroDatePicker.vue.d.ts +456 -0
  227. package/types/generated/components/molecules/FuroDatePicker/FuroDatePickerContext.d.ts +516 -0
  228. package/types/generated/components/molecules/FuroDateTimePicker/DateTimePickerEmitPayload.d.ts +55 -0
  229. package/types/generated/components/molecules/FuroDateTimePicker/FuroDateTimePicker.vue.d.ts +1365 -0
  230. package/types/generated/components/molecules/FuroDateTimePicker/FuroDateTimePickerContext.d.ts +435 -0
  231. package/types/generated/components/molecules/FuroDropdownMenu/DropdownMenuOptionSelectEmitPayload.d.ts +48 -0
  232. package/types/generated/components/molecules/FuroDropdownMenu/FuroDropdownMenu.vue.d.ts +773 -0
  233. package/types/generated/components/molecules/FuroDropdownMenu/FuroDropdownMenuContext.d.ts +380 -0
  234. package/types/generated/components/molecules/FuroDropdownMenu/FuroDropdownMenuOptionRows.vue.d.ts +261 -0
  235. package/types/generated/components/molecules/FuroEditableField/EditableEmitPayload.d.ts +39 -0
  236. package/types/generated/components/molecules/FuroEditableField/FuroEditableField.vue.d.ts +646 -0
  237. package/types/generated/components/molecules/FuroEditableField/FuroEditableFieldContext.d.ts +477 -0
  238. package/types/generated/components/molecules/FuroEditableField/processors/EditorCollisionProcessor.d.ts +121 -0
  239. package/types/generated/components/molecules/FuroEditableField/processors/ObjectProcessor.d.ts +45 -0
  240. package/types/generated/components/molecules/FuroEmptyState/FuroEmptyState.vue.d.ts +21 -0
  241. package/types/generated/components/molecules/FuroEmptyState/FuroEmptyStateContext.d.ts +32 -0
  242. package/types/generated/components/molecules/FuroErrorState/FuroErrorState.vue.d.ts +21 -0
  243. package/types/generated/components/molecules/FuroErrorState/FuroErrorStateContext.d.ts +32 -0
  244. package/types/generated/components/molecules/FuroPagination/FuroPagination.vue.d.ts +534 -0
  245. package/types/generated/components/molecules/FuroPagination/FuroPaginationContext.d.ts +271 -0
  246. package/types/generated/components/molecules/FuroPopover/FuroPopover.vue.d.ts +513 -0
  247. package/types/generated/components/molecules/FuroPopover/FuroPopoverContext.d.ts +160 -0
  248. package/types/generated/components/molecules/FuroScrollArea/FuroScrollArea.vue.d.ts +124 -0
  249. package/types/generated/components/molecules/FuroScrollArea/FuroScrollAreaContext.d.ts +86 -0
  250. package/types/generated/components/molecules/FuroSearchField/FuroSearchField.vue.d.ts +487 -0
  251. package/types/generated/components/molecules/FuroSearchField/FuroSearchFieldContext.d.ts +137 -0
  252. package/types/generated/components/molecules/FuroSectionHeader/FuroSectionHeader.vue.d.ts +49 -0
  253. package/types/generated/components/molecules/FuroSectionHeader/FuroSectionHeaderContext.d.ts +121 -0
  254. package/types/generated/components/molecules/FuroSelect/FuroSelect.vue.d.ts +719 -0
  255. package/types/generated/components/molecules/FuroSelect/FuroSelectContext.d.ts +402 -0
  256. package/types/generated/components/molecules/FuroSelect/SelectEmitPayload.d.ts +102 -0
  257. package/types/generated/components/molecules/FuroSeparator/FuroSeparator.vue.d.ts +39 -0
  258. package/types/generated/components/molecules/FuroSeparator/FuroSeparatorContext.d.ts +31 -0
  259. package/types/generated/components/molecules/FuroSkeleton/FuroSkeleton.vue.d.ts +27 -0
  260. package/types/generated/components/molecules/FuroSkeleton/FuroSkeletonContext.d.ts +61 -0
  261. package/types/generated/components/molecules/FuroSplitter/FuroSplitter.vue.d.ts +139 -0
  262. package/types/generated/components/molecules/FuroSplitter/FuroSplitterContext.d.ts +226 -0
  263. package/types/generated/components/molecules/FuroSplitter/SplitterEmitPayload.d.ts +41 -0
  264. package/types/generated/components/molecules/FuroTimeField/FuroTimeField.vue.d.ts +498 -0
  265. package/types/generated/components/molecules/FuroTimeField/FuroTimeFieldContext.d.ts +555 -0
  266. package/types/generated/components/molecules/FuroTimeField/TimeFieldEmitPayload.d.ts +41 -0
  267. package/types/generated/components/molecules/FuroToggleGroup/FuroToggleGroup.vue.d.ts +70 -0
  268. package/types/generated/components/molecules/FuroToggleGroup/FuroToggleGroupContext.d.ts +270 -0
  269. package/types/generated/components/molecules/FuroToggleGroup/ToggleGroupEmitPayload.d.ts +41 -0
  270. package/types/generated/components/molecules/FuroToolBar/FuroToolBar.vue.d.ts +30 -0
  271. package/types/generated/components/molecules/FuroToolBar/FuroToolBarContext.d.ts +48 -0
  272. package/types/generated/components/molecules/FuroTooltip/FuroTooltip.vue.d.ts +524 -0
  273. package/types/generated/components/molecules/FuroTooltip/FuroTooltipContext.d.ts +166 -0
  274. package/types/generated/components/organisms/FuroAlertDialog/FuroAlertDialog.vue.d.ts +651 -0
  275. package/types/generated/components/organisms/FuroAlertDialog/FuroAlertDialogContext.d.ts +299 -0
  276. package/types/generated/components/organisms/FuroDialog/FuroDialog.vue.d.ts +583 -0
  277. package/types/generated/components/organisms/FuroDialog/FuroDialogContext.d.ts +264 -0
  278. package/types/generated/components/organisms/FuroDrawer/FuroDrawer.vue.d.ts +635 -0
  279. package/types/generated/components/organisms/FuroDrawer/FuroDrawerContext.d.ts +347 -0
  280. package/types/generated/components/organisms/FuroEditor/FuroEditor.vue.d.ts +2487 -0
  281. package/types/generated/components/organisms/FuroEditor/FuroEditorCommandContext.d.ts +192 -0
  282. package/types/generated/components/organisms/FuroEditor/FuroEditorContext.d.ts +904 -0
  283. package/types/generated/components/organisms/FuroEditor/FuroEditorMentionMenu.vue.d.ts +43 -0
  284. package/types/generated/components/organisms/FuroEditor/FuroEditorMentionMenuContext.d.ts +159 -0
  285. package/types/generated/components/organisms/FuroEditor/PreserveNewlinesPasteExtension.d.ts +43 -0
  286. package/types/generated/components/organisms/FuroEditor/build-editor-extensions.d.ts +22 -0
  287. package/types/generated/components/organisms/FuroEditor/mention-suggestion.d.ts +25 -0
  288. package/types/generated/components/organisms/FuroEditor/paste-link-segments.d.ts +31 -0
  289. package/types/generated/components/organisms/FuroSidebar/FuroSidebar.vue.d.ts +898 -0
  290. package/types/generated/components/organisms/FuroSidebar/FuroSidebarContext.d.ts +596 -0
  291. package/types/generated/components/organisms/FuroStepper/FuroStepper.vue.d.ts +589 -0
  292. package/types/generated/components/organisms/FuroStepper/FuroStepperContext.d.ts +266 -0
  293. package/types/generated/components/organisms/FuroTable/FuroTable.vue.d.ts +528 -0
  294. package/types/generated/components/organisms/FuroTable/FuroTableContext.d.ts +1035 -0
  295. package/types/generated/components/organisms/FuroTable/FuroTableRowItemContext.d.ts +62 -0
  296. package/types/generated/components/organisms/FuroTabs/FuroTabs.vue.d.ts +515 -0
  297. package/types/generated/components/organisms/FuroTabs/FuroTabsContext.d.ts +438 -0
  298. package/types/generated/components/organisms/FuroToast/FuroToast.vue.d.ts +725 -0
  299. package/types/generated/components/organisms/FuroToast/FuroToastContext.d.ts +543 -0
  300. package/types/generated/components/organisms/FuroToast/FuroToaster.vue.d.ts +729 -0
  301. package/types/generated/components/organisms/FuroToast/FuroToasterContext.d.ts +62 -0
  302. package/types/generated/components/organisms/FuroToast/ToastQueue.d.ts +201 -0
  303. package/types/generated/components/organisms/FuroToast/toast.d.ts +23 -0
  304. package/types/generated/contexts/BaseFuroContext.d.ts +207 -0
  305. package/types/generated/contexts/BaseFuroContextAccessor.d.ts +28 -0
  306. package/types/generated/emit-payload/BaseEmitPayload.d.ts +62 -0
  307. package/types/generated/index.components.d.ts +50 -0
  308. package/types/generated/index.core.d.ts +6 -0
  309. package/types/generated/tools/TimerClerk.d.ts +50 -0
  310. package/types/index.d.ts +12 -0
@@ -0,0 +1,1089 @@
1
+ import {
2
+ reactive,
3
+ onUnmounted,
4
+ } from 'vue'
5
+
6
+ import BaseFuroContext from '../../../contexts/BaseFuroContext.js'
7
+
8
+ const DEFAULT_DURATION = 4000
9
+ const DEFAULT_POSITION = 'bottom-right'
10
+ const DEFAULT_SWIPE_DIRECTION = 'right'
11
+ const DEFAULT_LABEL = 'Notifications'
12
+ const DEFAULT_TYPE = 'info'
13
+ const DEFAULT_CLOSE_TEXT = 'Close'
14
+ const DEFAULT_MAX_VISIBLE = 3
15
+
16
+ /**
17
+ * Vertical gap between stacked toasts, in pixels. Mirrors the static
18
+ * `--furo-toast-gap` CSS token so the JS-computed expand offsets line up with
19
+ * the CSS collapsed offsets.
20
+ */
21
+ const STACK_GAP = 14
22
+
23
+ /**
24
+ * How long to keep a dismissed toast mounted so its exit transition can play
25
+ * before the parent removes it. Mirrors the CSS exit transition duration.
26
+ */
27
+ const EXIT_ANIMATION_MS = 250
28
+
29
+ /**
30
+ * Swipe-to-dismiss direction per position: left-anchored toasts swipe left,
31
+ * right-anchored swipe right, centered toasts swipe toward their vertical edge.
32
+ */
33
+ const SWIPE_DIRECTION_BY_POSITION = {
34
+ 'top-left': 'left',
35
+ 'bottom-left': 'left',
36
+ 'top-right': 'right',
37
+ 'bottom-right': 'right',
38
+ 'top-center': 'up',
39
+ 'bottom-center': 'down',
40
+ }
41
+
42
+ /**
43
+ * Exit transform per swipe direction — the toast leaves toward that edge.
44
+ */
45
+ const SWIPE_EXIT_TRANSFORM_HASH = {
46
+ right: 'translateX(calc(100% + 1.5rem))',
47
+ left: 'translateX(calc(-100% - 1.5rem))',
48
+ up: 'translateY(calc(-100% - 1.5rem))',
49
+ down: 'translateY(calc(100% + 1.5rem))',
50
+ }
51
+
52
+ /**
53
+ * A loading toast must not auto-dismiss while the promise is pending — the
54
+ * parent resolves it by updating the entry. Use a very long duration instead
55
+ * of relying on the auto-close timer.
56
+ */
57
+ const LOADING_DURATION = 1000000000
58
+
59
+ /**
60
+ * Phosphor (`ph:`) icon name per toast type. A single small icon carries the
61
+ * only accent — the toast body stays neutral.
62
+ */
63
+ const TYPE_ICON_NAME_HASH = {
64
+ info: 'ph:info',
65
+ success: 'ph:check-circle',
66
+ warning: 'ph:warning',
67
+ error: 'ph:x-circle',
68
+ loading: 'ph:circle-notch',
69
+ }
70
+
71
+ /**
72
+ * Context class for FuroToast organism.
73
+ *
74
+ * Presentational, controlled notification stack built on a headless toast
75
+ * primitive (`Provider` + `Viewport` + per-toast `Root`/`Title`/`Description`/
76
+ * `Action`/`Close`). The parent owns the `toasts` queue via `parcel.toasts`;
77
+ * this component renders the queue and emits `dismiss` / `action` by key so the
78
+ * parent can update its own array.
79
+ *
80
+ * Renders a collapsed stack: the newest toast sits on top and
81
+ * pushes older ones down/back (scaled + offset); hovering or focusing the stack
82
+ * expands it into a full list. Only the most recent `maxVisible` toasts render.
83
+ * Supports a `loading` type (spinner) for the promise pattern and a per-toast
84
+ * `actionPending` flag for async actions. No internal queue, no imperative API,
85
+ * registry-free. Domain-agnostic: no GraphQL or router imports.
86
+ *
87
+ * @extends {BaseFuroContext<null, Props, EmitEventName>}
88
+ */
89
+ export default class FuroToastContext extends BaseFuroContext {
90
+ /**
91
+ * Constructor.
92
+ *
93
+ * @param {FuroToastContextParams} params - Parameters of this constructor.
94
+ */
95
+ constructor ({
96
+ props,
97
+ componentContext,
98
+
99
+ reactiveHash,
100
+ }) {
101
+ super({
102
+ props,
103
+ componentContext,
104
+
105
+ reactiveHash,
106
+ })
107
+
108
+ this.reactiveHash = reactiveHash
109
+
110
+ /** @type {Record<string, HTMLElement>} */
111
+ this.elementHash = {}
112
+
113
+ /** @type {Record<string, (element: HTMLElement | null) => void>} */
114
+ this.refCallbackHash = {}
115
+
116
+ /** @type {Record<string, ReturnType<typeof setTimeout>>} */
117
+ this.exitTimerHash = {}
118
+
119
+ /** @type {ResizeObserver | null} */
120
+ this.resizeObserver = null
121
+ }
122
+
123
+ /**
124
+ * Factory method.
125
+ *
126
+ * @template {X extends typeof FuroToastContext ? X : never} T, X
127
+ * @override
128
+ * @param {FuroToastContextFactoryParams} params - Parameters of this factory method.
129
+ * @returns {InstanceType<T>} An instance of this class.
130
+ * @this {T}
131
+ */
132
+ static create ({
133
+ props,
134
+ componentContext,
135
+
136
+ reactiveHash = this.buildReactiveHash(),
137
+ }) {
138
+ return /** @type {InstanceType<T>} */ (
139
+ new this({
140
+ props,
141
+ componentContext,
142
+
143
+ reactiveHash,
144
+ })
145
+ )
146
+ }
147
+
148
+ /**
149
+ * Get emit event name.
150
+ *
151
+ * @override
152
+ * @returns {Readonly<{
153
+ * DISMISS: 'dismiss'
154
+ * ACTION: 'action'
155
+ * }>}
156
+ */
157
+ static get EMIT_EVENT_NAME () {
158
+ return {
159
+ DISMISS: 'dismiss',
160
+ ACTION: 'action',
161
+ }
162
+ }
163
+
164
+ /**
165
+ * Get emit options.
166
+ *
167
+ * @returns {{
168
+ * dismiss: (payload: { key: ToastKey }) => void
169
+ * action: (payload: { key: ToastKey, actionKey: string }) => void
170
+ * }}
171
+ */
172
+ static get EMIT_EVENT_HASH () {
173
+ return {
174
+ [this.EMIT_EVENT_NAME.DISMISS]: payload => {},
175
+ [this.EMIT_EVENT_NAME.ACTION]: payload => {},
176
+ }
177
+ }
178
+
179
+ /**
180
+ * Build reactive hash — measured toast heights, mounted flags, and the
181
+ * expand/collapse UI flag.
182
+ *
183
+ * @override
184
+ * @returns {{
185
+ * heightHash: Record<ToastKey, number>
186
+ * mountedHash: Record<ToastKey, boolean>
187
+ * uiState: { expanded: boolean }
188
+ * }}
189
+ */
190
+ static buildReactiveHash () {
191
+ return {
192
+ heightHash: /** @type {Record<ToastKey, number>} */ (reactive({})),
193
+ mountedHash: /** @type {Record<ToastKey, boolean>} */ (reactive({})),
194
+ uiState: reactive({
195
+ expanded: false,
196
+ }),
197
+ }
198
+ }
199
+
200
+ /**
201
+ * Build the per-toast stacking entries (pure math).
202
+ * Newest toast is last in the array and becomes the front of the stack.
203
+ *
204
+ * @param {{
205
+ * toasts: Array<{ key: ToastKey }>
206
+ * heightHash: Record<ToastKey, number>
207
+ * gap: number
208
+ * }} params
209
+ * @returns {Array<StackEntry>}
210
+ */
211
+ static buildStackEntries ({
212
+ toasts,
213
+ heightHash,
214
+ gap,
215
+ }) {
216
+ const lastIndex = toasts.length - 1
217
+
218
+ return toasts.map((toast, index) => {
219
+ const toastsBefore = lastIndex - index
220
+
221
+ const offset = toasts
222
+ .slice(index + 1)
223
+ .reduce(
224
+ (total, newer) => total + (heightHash[newer.key] ?? 0) + gap,
225
+ 0
226
+ )
227
+
228
+ return {
229
+ toastsBefore,
230
+ offset,
231
+ zIndex: index + 1,
232
+ isFront: index === lastIndex,
233
+ height: heightHash[toast.key] ?? 0,
234
+ }
235
+ })
236
+ }
237
+
238
+ /**
239
+ * get: Constructor of this class.
240
+ *
241
+ * @override
242
+ * @returns {typeof FuroToastContext}
243
+ */
244
+ get Ctor () {
245
+ return /** @type {typeof FuroToastContext} */ (
246
+ this.constructor
247
+ )
248
+ }
249
+
250
+ /**
251
+ * Setup component — start the height observer and dispose it on unmount.
252
+ *
253
+ * @template {X extends FuroToastContext ? X : never} T, X
254
+ * @override
255
+ * @returns {T} For method chaining.
256
+ * @this {T}
257
+ */
258
+ setupComponent () {
259
+ this.resizeObserver = this.createResizeObserver()
260
+
261
+ onUnmounted(() => {
262
+ this.resizeObserver?.disconnect()
263
+
264
+ Object.values(this.exitTimerHash)
265
+ .map(timer => clearTimeout(timer))
266
+ })
267
+
268
+ return this
269
+ }
270
+
271
+ /**
272
+ * Create a ResizeObserver that re-measures toasts on content/size change.
273
+ *
274
+ * @returns {ResizeObserver | null}
275
+ */
276
+ createResizeObserver () {
277
+ if (typeof ResizeObserver === 'undefined') {
278
+ return null
279
+ }
280
+
281
+ return new ResizeObserver(entries => {
282
+ entries.map(entry =>
283
+ this.measureElement({
284
+ element: entry.target,
285
+ }))
286
+ })
287
+ }
288
+
289
+ /**
290
+ * Parcel passed from parent via props, with defaults applied.
291
+ *
292
+ * @override
293
+ * @returns {NonNullable<Props['parcel']>}
294
+ */
295
+ get parcel () {
296
+ return {
297
+ toasts: [],
298
+ position: DEFAULT_POSITION,
299
+ durationInMilliseconds: DEFAULT_DURATION,
300
+ swipeDirection: null,
301
+ label: DEFAULT_LABEL,
302
+ hotkey: null,
303
+ maxVisible: DEFAULT_MAX_VISIBLE,
304
+ richColors: false,
305
+ ...this.props.parcel,
306
+ }
307
+ }
308
+
309
+ /**
310
+ * Resolve the swipe-to-dismiss direction. Honors an explicit
311
+ * `parcel.swipeDirection`; otherwise derives it from the position so a
312
+ * left toast swipes left and a right toast swipes right.
313
+ *
314
+ * @returns {ToastSwipeDirection}
315
+ */
316
+ extractSwipeDirection () {
317
+ return /** @type {ToastSwipeDirection} */ (
318
+ this.parcel?.swipeDirection
319
+ ?? SWIPE_DIRECTION_BY_POSITION[this.extractPosition()]
320
+ ?? DEFAULT_SWIPE_DIRECTION
321
+ )
322
+ }
323
+
324
+ /**
325
+ * Resolve the transform a toast uses to leave on swipe — toward the swipe edge.
326
+ *
327
+ * @returns {string}
328
+ */
329
+ extractSwipeExitTransform () {
330
+ return SWIPE_EXIT_TRANSFORM_HASH[this.extractSwipeDirection()]
331
+ ?? SWIPE_EXIT_TRANSFORM_HASH.right
332
+ }
333
+
334
+ /**
335
+ * Whether toasts render with full type-colored surfaces (rich colors).
336
+ *
337
+ * @returns {boolean}
338
+ */
339
+ isRichColors () {
340
+ return this.parcel?.richColors === true
341
+ }
342
+
343
+ /**
344
+ * Resolve the default auto-dismiss duration (ms).
345
+ *
346
+ * @returns {number}
347
+ */
348
+ extractDefaultDuration () {
349
+ return this.parcel?.durationInMilliseconds
350
+ ?? DEFAULT_DURATION
351
+ }
352
+
353
+ /**
354
+ * Resolve the maximum number of toasts rendered at once.
355
+ *
356
+ * @returns {number}
357
+ */
358
+ extractMaxVisible () {
359
+ return this.parcel?.maxVisible
360
+ ?? DEFAULT_MAX_VISIBLE
361
+ }
362
+
363
+ /**
364
+ * Normalize the parcel toasts into display-ready records, capped to the most
365
+ * recent `maxVisible` entries (newest last).
366
+ *
367
+ * @returns {Array<NormalizedToast>}
368
+ */
369
+ normalizeToasts () {
370
+ const toasts = this.parcel?.toasts
371
+ ?? []
372
+
373
+ const visibleToasts = toasts.slice(-this.extractMaxVisible())
374
+
375
+ return visibleToasts.map(toast => {
376
+ const type = toast.type ?? DEFAULT_TYPE
377
+ const actions = this.normalizeActions({ toast })
378
+
379
+ return {
380
+ key: toast.key,
381
+ title: toast.title ?? null,
382
+ description: toast.description ?? null,
383
+ type,
384
+ durationInMilliseconds: toast.durationInMilliseconds ?? null,
385
+ closeText: toast.closeText ?? DEFAULT_CLOSE_TEXT,
386
+ actions,
387
+ hasActions: actions.length > 0,
388
+ actionPending: toast.actionPending ?? false,
389
+ isLoading: type === 'loading',
390
+ }
391
+ })
392
+ }
393
+
394
+ /**
395
+ * Normalize a toast's action buttons into a serializable array.
396
+ * Accepts an `actions` array (`{ actionKey, label }`) or the single-action
397
+ * shorthand `actionText` (mapped to one `default` action).
398
+ *
399
+ * @param {{
400
+ * toast: ToastEntry
401
+ * }} params
402
+ * @returns {Array<ToastActionDescriptor>}
403
+ */
404
+ normalizeActions ({
405
+ toast,
406
+ }) {
407
+ if (Array.isArray(toast.actions)) {
408
+ return toast.actions.map(action => ({
409
+ actionKey: action.actionKey,
410
+ label: action.label,
411
+ }))
412
+ }
413
+
414
+ const actionText = toast.actionText
415
+ ?? null
416
+
417
+ if (actionText !== null) {
418
+ return [
419
+ {
420
+ actionKey: 'default',
421
+ label: actionText,
422
+ },
423
+ ]
424
+ }
425
+
426
+ return []
427
+ }
428
+
429
+ /**
430
+ * Build the full per-toast view models: display fields + stacking geometry +
431
+ * mounted flag. Consumed by the template `v-for`.
432
+ *
433
+ * @returns {Array<ToastViewModel>}
434
+ */
435
+ createToastViewModels () {
436
+ const normalized = this.normalizeToasts()
437
+
438
+ const stackEntries = this.Ctor.buildStackEntries({
439
+ toasts: normalized,
440
+ heightHash: this.reactiveHash.heightHash,
441
+ gap: STACK_GAP,
442
+ })
443
+
444
+ return normalized.map((toast, index) => ({
445
+ ...toast,
446
+ ...stackEntries[index],
447
+ isMounted: this.isToastMounted({
448
+ key: toast.key,
449
+ }),
450
+ }))
451
+ }
452
+
453
+ /**
454
+ * Count toasts hidden by the `maxVisible` cap (still queued).
455
+ *
456
+ * @returns {number}
457
+ */
458
+ extractHiddenCount () {
459
+ const total = (this.parcel?.toasts ?? []).length
460
+
461
+ return Math.max(
462
+ 0,
463
+ total - this.extractMaxVisible()
464
+ )
465
+ }
466
+
467
+ /**
468
+ * Height of the front (newest) visible toast — collapsed cards share it.
469
+ *
470
+ * @returns {number}
471
+ */
472
+ extractFrontHeight () {
473
+ const measuredToasts = this.normalizeToasts()
474
+ .filter(toast => (this.reactiveHash.heightHash[toast.key] ?? 0) > 0)
475
+
476
+ const frontToast = measuredToasts.at(-1)
477
+
478
+ if (!frontToast) {
479
+ return 0
480
+ }
481
+
482
+ return this.reactiveHash.heightHash[frontToast.key]
483
+ }
484
+
485
+ /**
486
+ * Vertical lift direction: top positions stack downward (+1), bottom upward (-1).
487
+ *
488
+ * @returns {number}
489
+ */
490
+ extractLift () {
491
+ const isTop = this.extractPosition()
492
+ .startsWith('top')
493
+
494
+ return isTop
495
+ ? 1
496
+ : -1
497
+ }
498
+
499
+ /**
500
+ * Extract viewport placement.
501
+ *
502
+ * @returns {ToastPosition}
503
+ */
504
+ extractPosition () {
505
+ return this.parcel?.position
506
+ ?? DEFAULT_POSITION
507
+ }
508
+
509
+ /**
510
+ * Extract viewport class names (root host + placement variant).
511
+ *
512
+ * @returns {Record<string, boolean>}
513
+ */
514
+ extractViewportClassNames () {
515
+ return {
516
+ 'unit-toast-viewport': true,
517
+ [this.extractPosition()]: true,
518
+ }
519
+ }
520
+
521
+ /**
522
+ * Extract CSS custom properties applied to the viewport (shared by all toasts).
523
+ *
524
+ * @returns {Record<string, string | number>}
525
+ */
526
+ extractViewportStyle () {
527
+ return {
528
+ '--furo-toast-front-height': `${this.extractFrontHeight()}px`,
529
+ '--furo-toast-lift': this.extractLift(),
530
+ '--furo-toast-swipe-exit': this.extractSwipeExitTransform(),
531
+ }
532
+ }
533
+
534
+ /**
535
+ * Extract per-toast class names (type accent variant).
536
+ *
537
+ * @param {{
538
+ * type: ToastType
539
+ * }} params
540
+ * @returns {Record<string, boolean>}
541
+ */
542
+ extractToastClassNames ({
543
+ type,
544
+ }) {
545
+ return {
546
+ 'unit-toast': true,
547
+ [type]: true,
548
+ 'rich-colors': this.isRichColors(),
549
+ }
550
+ }
551
+
552
+ /**
553
+ * Extract per-toast CSS custom properties for stacking geometry.
554
+ *
555
+ * @param {{
556
+ * viewModel: ToastViewModel
557
+ * }} params
558
+ * @returns {Record<string, string | number>}
559
+ */
560
+ extractToastStyle ({
561
+ viewModel,
562
+ }) {
563
+ return {
564
+ '--furo-toast-z': viewModel.zIndex,
565
+ '--furo-toast-toasts-before': viewModel.toastsBefore,
566
+ '--furo-toast-offset': `${viewModel.offset}px`,
567
+ '--furo-toast-initial-height': `${viewModel.height}px`,
568
+ }
569
+ }
570
+
571
+ /**
572
+ * Extract the Phosphor icon name for a toast type.
573
+ *
574
+ * @param {{
575
+ * type: ToastType
576
+ * }} params
577
+ * @returns {string}
578
+ */
579
+ extractToastIconName ({
580
+ type,
581
+ }) {
582
+ return TYPE_ICON_NAME_HASH[type]
583
+ ?? TYPE_ICON_NAME_HASH[DEFAULT_TYPE]
584
+ }
585
+
586
+ /**
587
+ * Extract attributes forwarded to the toast provider.
588
+ *
589
+ * @returns {Record<string, unknown>}
590
+ */
591
+ extractProviderAttributes () {
592
+ const entries = [
593
+ ['duration', this.parcel?.durationInMilliseconds ?? null], // mapped to the primitive's `duration` (ms)
594
+ ['swipeDirection', this.extractSwipeDirection()],
595
+ ['label', this.parcel?.label ?? null],
596
+ ]
597
+ .filter(([, attributeValue]) => attributeValue !== null)
598
+
599
+ return Object.fromEntries(entries)
600
+ }
601
+
602
+ /**
603
+ * Extract attributes forwarded to the toast viewport.
604
+ *
605
+ * @returns {Record<string, unknown>}
606
+ */
607
+ extractViewportAttributes () {
608
+ const entries = [
609
+ ['hotkey', this.parcel?.hotkey ?? null],
610
+ ]
611
+ .filter(([, attributeValue]) => attributeValue !== null)
612
+
613
+ return Object.fromEntries(entries)
614
+ }
615
+
616
+ /**
617
+ * Extract attributes forwarded to a single toast root host element.
618
+ * A loading toast is held open (long duration) until the parent resolves it.
619
+ *
620
+ * @param {{
621
+ * toast: NormalizedToast
622
+ * }} params
623
+ * @returns {Record<string, unknown>}
624
+ */
625
+ extractToastRootAttributes ({
626
+ toast,
627
+ }) {
628
+ const resolvedDuration = toast.isLoading
629
+ ? LOADING_DURATION
630
+ : (toast.durationInMilliseconds ?? this.extractDefaultDuration())
631
+
632
+ return {
633
+ duration: resolvedDuration, // the primitive's root `duration` prop (ms)
634
+ }
635
+ }
636
+
637
+ /**
638
+ * Whether the stack is expanded (hovered / focused).
639
+ *
640
+ * @returns {boolean}
641
+ */
642
+ isExpanded () {
643
+ return this.reactiveHash.uiState.expanded
644
+ }
645
+
646
+ /**
647
+ * Whether a toast has completed its mount tick (drives the enter transition).
648
+ *
649
+ * @param {{
650
+ * key: ToastKey
651
+ * }} params
652
+ * @returns {boolean}
653
+ */
654
+ isToastMounted ({
655
+ key,
656
+ }) {
657
+ return this.reactiveHash.mountedHash[key]
658
+ ?? false
659
+ }
660
+
661
+ /**
662
+ * Whether a title region should render for a toast (parcel text or `title` slot).
663
+ *
664
+ * @param {{
665
+ * toast: NormalizedToast
666
+ * }} params
667
+ * @returns {boolean}
668
+ */
669
+ shouldRenderToastTitle ({
670
+ toast,
671
+ }) {
672
+ const hasTitleText = toast.title !== null
673
+ const hasTitleSlot = Boolean(this.slots?.title)
674
+
675
+ return hasTitleText || hasTitleSlot
676
+ }
677
+
678
+ /**
679
+ * Whether a description region should render for a toast (parcel text or `description` slot).
680
+ *
681
+ * @param {{
682
+ * toast: NormalizedToast
683
+ * }} params
684
+ * @returns {boolean}
685
+ */
686
+ shouldRenderToastDescription ({
687
+ toast,
688
+ }) {
689
+ const hasDescriptionText = toast.description !== null
690
+ const hasDescriptionSlot = Boolean(this.slots?.description)
691
+
692
+ return hasDescriptionText || hasDescriptionSlot
693
+ }
694
+
695
+ /**
696
+ * Get a stable ref callback for a toast's inner element — memoized per key so
697
+ * Vue does not re-invoke it (with null then the element) on every render,
698
+ * which would spuriously unregister the toast and clear its exit timer.
699
+ *
700
+ * @param {{
701
+ * key: ToastKey
702
+ * }} params
703
+ * @returns {(element: HTMLElement | null) => void}
704
+ */
705
+ getToastElementRef ({
706
+ key,
707
+ }) {
708
+ if (!this.refCallbackHash[key]) {
709
+ this.refCallbackHash[key] = element => this.registerToastElement({
710
+ key,
711
+ element,
712
+ })
713
+ }
714
+
715
+ return this.refCallbackHash[key]
716
+ }
717
+
718
+ /**
719
+ * Register (or unregister) a toast's measurable inner element.
720
+ *
721
+ * @param {{
722
+ * key: ToastKey
723
+ * element: HTMLElement | null
724
+ * }} params
725
+ */
726
+ registerToastElement ({
727
+ key,
728
+ element,
729
+ }) {
730
+ if (!element) {
731
+ this.unregisterToastElement({
732
+ key,
733
+ })
734
+
735
+ return
736
+ }
737
+
738
+ this.elementHash[key] = element
739
+ this.resizeObserver?.observe(element)
740
+
741
+ this.measureElement({
742
+ element,
743
+ })
744
+
745
+ this.scheduleToastMount({
746
+ key,
747
+ })
748
+ }
749
+
750
+ /**
751
+ * Stop observing a toast element and drop its measured state.
752
+ *
753
+ * @param {{
754
+ * key: ToastKey
755
+ * }} params
756
+ */
757
+ unregisterToastElement ({
758
+ key,
759
+ }) {
760
+ const element = this.elementHash[key]
761
+ ?? null
762
+
763
+ if (element) {
764
+ this.resizeObserver?.unobserve(element)
765
+ }
766
+
767
+ // NOTE: do not clear the exit/dismiss timer here. The toast's inner element
768
+ // unmounts (via the headless primitive's exit) before the delayed dismiss
769
+ // fires; clearing the timer would strand the toast in the parent queue.
770
+ delete this.elementHash[key]
771
+ delete this.refCallbackHash[key]
772
+ delete this.reactiveHash.heightHash[key]
773
+ delete this.reactiveHash.mountedHash[key]
774
+ }
775
+
776
+ /**
777
+ * Measure an element's natural height into the height hash.
778
+ *
779
+ * @param {{
780
+ * element: Element
781
+ * }} params
782
+ */
783
+ measureElement ({
784
+ element,
785
+ }) {
786
+ const match = Object.entries(this.elementHash ?? {})
787
+ .find(([, candidate]) => candidate === element)
788
+
789
+ if (!match) {
790
+ return
791
+ }
792
+
793
+ const height = /** @type {HTMLElement} */ (element).offsetHeight
794
+
795
+ if (height <= 0) {
796
+ return
797
+ }
798
+
799
+ this.reactiveHash.heightHash[match[0]] = height
800
+ }
801
+
802
+ /**
803
+ * Flip a toast to mounted on the next frame so the enter transition runs.
804
+ *
805
+ * @param {{
806
+ * key: ToastKey
807
+ * }} params
808
+ */
809
+ scheduleToastMount ({
810
+ key,
811
+ }) {
812
+ if (this.isToastMounted({ key })) {
813
+ return
814
+ }
815
+
816
+ if (typeof requestAnimationFrame === 'undefined') {
817
+ this.reactiveHash.mountedHash[key] = true
818
+
819
+ return
820
+ }
821
+
822
+ requestAnimationFrame(() => {
823
+ this.reactiveHash.mountedHash[key] = true
824
+ })
825
+ }
826
+
827
+ /**
828
+ * Expand the stack on pointer enter / focus.
829
+ */
830
+ onStackExpand () {
831
+ this.reactiveHash.uiState.expanded = true
832
+ }
833
+
834
+ /**
835
+ * Collapse the stack on pointer leave / blur.
836
+ */
837
+ onStackCollapse () {
838
+ this.reactiveHash.uiState.expanded = false
839
+ }
840
+
841
+ /**
842
+ * Handle a toast open-state change from the root host element.
843
+ * Reka closes a toast on timeout, swipe, or the close button — when the
844
+ * resolved state is closed, request the parent to remove it.
845
+ *
846
+ * @param {{
847
+ * key: ToastKey
848
+ * isOpen: boolean
849
+ * }} params
850
+ */
851
+ onToastOpenChange ({
852
+ key,
853
+ isOpen,
854
+ }) {
855
+ if (isOpen) {
856
+ return
857
+ }
858
+
859
+ this.scheduleDismiss({
860
+ key,
861
+ })
862
+ }
863
+
864
+ /**
865
+ * Emit dismiss after the exit transition so the close/auto-dismiss animation
866
+ * (slide back toward the entry edge) can play before the parent removes the
867
+ * toast. The toast carries Reka's `data-state="closed"` during this window.
868
+ *
869
+ * @param {{
870
+ * key: ToastKey
871
+ * }} params
872
+ */
873
+ scheduleDismiss ({
874
+ key,
875
+ }) {
876
+ if (typeof setTimeout === 'undefined') {
877
+ this.emitDismiss({ key })
878
+
879
+ return
880
+ }
881
+
882
+ this.exitTimerHash[key] = setTimeout(
883
+ () => {
884
+ delete this.exitTimerHash[key]
885
+
886
+ this.emitDismiss({ key })
887
+ },
888
+ EXIT_ANIMATION_MS
889
+ )
890
+ }
891
+
892
+ /**
893
+ * Emit the dismiss event for a toast.
894
+ *
895
+ * @param {{
896
+ * key: ToastKey
897
+ * }} params
898
+ */
899
+ emitDismiss ({
900
+ key,
901
+ }) {
902
+ this.emit(
903
+ this.EMIT_EVENT_NAME.DISMISS,
904
+ {
905
+ key,
906
+ }
907
+ )
908
+ }
909
+
910
+ /**
911
+ * Handle an action-button click on a single toast.
912
+ *
913
+ * @param {{
914
+ * key: ToastKey
915
+ * actionKey: string
916
+ * }} params
917
+ */
918
+ onActionClick ({
919
+ key,
920
+ actionKey,
921
+ }) {
922
+ this.emit(
923
+ this.EMIT_EVENT_NAME.ACTION,
924
+ {
925
+ key,
926
+ actionKey,
927
+ }
928
+ )
929
+ }
930
+ }
931
+
932
+ /**
933
+ * @typedef {import('../../../contexts/BaseFuroContext.js').BaseFuroContextParams & {
934
+ * props: Props
935
+ * componentContext: ComponentContext
936
+ * reactiveHash: {
937
+ * heightHash: Record<ToastKey, number>
938
+ * mountedHash: Record<ToastKey, boolean>
939
+ * uiState: {
940
+ * expanded: boolean
941
+ * }
942
+ * }
943
+ * }} FuroToastContextParams
944
+ */
945
+
946
+ /**
947
+ * @typedef {Omit<FuroToastContextParams, 'reactiveHash'> & {
948
+ * reactiveHash?: FuroToastContextParams['reactiveHash']
949
+ * }} FuroToastContextFactoryParams
950
+ */
951
+
952
+ /**
953
+ * @typedef {'DISMISS' | 'ACTION'} EmitEventName
954
+ */
955
+
956
+ /**
957
+ * @typedef {string | number} ToastKey
958
+ */
959
+
960
+ /**
961
+ * @typedef {'info' | 'success' | 'warning' | 'error' | 'loading'} ToastType
962
+ */
963
+
964
+ /**
965
+ * @typedef {(
966
+ * 'top-left'
967
+ * | 'top-center'
968
+ * | 'top-right'
969
+ * | 'bottom-left'
970
+ * | 'bottom-center'
971
+ * | 'bottom-right'
972
+ * )} ToastPosition
973
+ */
974
+
975
+ /**
976
+ * @typedef {'right' | 'left' | 'up' | 'down'} ToastSwipeDirection
977
+ */
978
+
979
+ /**
980
+ * A single toast entry owned by the parent queue.
981
+ *
982
+ * @typedef {{
983
+ * key: ToastKey
984
+ * title?: string | null
985
+ * description?: string | null
986
+ * type?: ToastType
987
+ * durationInMilliseconds?: number | null
988
+ * closeText?: string
989
+ * actionText?: string | null
990
+ * actions?: Array<ToastActionDescriptor>
991
+ * actionPending?: boolean
992
+ * }} ToastEntry
993
+ */
994
+
995
+ /**
996
+ * A single action button on a toast (serializable — no handler functions).
997
+ *
998
+ * @typedef {{
999
+ * actionKey: string
1000
+ * label: string
1001
+ * }} ToastActionDescriptor
1002
+ */
1003
+
1004
+ /**
1005
+ * Display-ready toast record produced by `normalizeToasts()`.
1006
+ *
1007
+ * @typedef {{
1008
+ * key: ToastKey
1009
+ * title: string | null
1010
+ * description: string | null
1011
+ * type: ToastType
1012
+ * durationInMilliseconds: number | null
1013
+ * closeText: string
1014
+ * actions: Array<ToastActionDescriptor>
1015
+ * hasActions: boolean
1016
+ * actionPending: boolean
1017
+ * isLoading: boolean
1018
+ * }} NormalizedToast
1019
+ */
1020
+
1021
+ /**
1022
+ * Per-toast stacking geometry produced by `buildStackEntries()`.
1023
+ *
1024
+ * @typedef {{
1025
+ * toastsBefore: number
1026
+ * offset: number
1027
+ * zIndex: number
1028
+ * isFront: boolean
1029
+ * height: number
1030
+ * }} StackEntry
1031
+ */
1032
+
1033
+ /**
1034
+ * Full per-toast view model (display + stacking + mounted) for the template.
1035
+ *
1036
+ * @typedef {NormalizedToast & StackEntry & {
1037
+ * isMounted: boolean
1038
+ * }} ToastViewModel
1039
+ */
1040
+
1041
+ /**
1042
+ * @typedef {import('vue').HTMLAttributes & {
1043
+ * parcel?: ToastParcel | null
1044
+ * }} Props
1045
+ */
1046
+
1047
+ /**
1048
+ * Closed-set Furo behavior for `<FuroToast>`.
1049
+ * JSON-serializable only. Not an open passthrough to the internal primitive.
1050
+ *
1051
+ * @typedef {{
1052
+ * toasts?: Array<ToastEntry>
1053
+ * position?: ToastPosition
1054
+ * durationInMilliseconds?: number
1055
+ * swipeDirection?: ToastSwipeDirection
1056
+ * label?: string
1057
+ * hotkey?: Array<string> | null
1058
+ * maxVisible?: number
1059
+ * richColors?: boolean
1060
+ * }} ToastParcel
1061
+ */
1062
+
1063
+ /**
1064
+ * @typedef {import('vue').SetupContext<FuroToastEmitHash, FuroToastSlots>} ComponentContext
1065
+ */
1066
+
1067
+ /**
1068
+ * @typedef {typeof FuroToastContext.EMIT_EVENT_HASH} FuroToastEmitHash
1069
+ */
1070
+
1071
+ /**
1072
+ * @typedef {import('vue').SlotsType<{
1073
+ * title: {
1074
+ * toast: NormalizedToast
1075
+ * }
1076
+ * description: {
1077
+ * toast: NormalizedToast
1078
+ * }
1079
+ * }>} FuroToastSlots
1080
+ */
1081
+
1082
+ /**
1083
+ * @typedef {(
1084
+ * props: Props,
1085
+ * componentContext: ComponentContext
1086
+ * ) => {
1087
+ * context: FuroToastContext
1088
+ * }} FuroToastSetup
1089
+ */