@vinicunca/taman-ui 0.1.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 (296) hide show
  1. package/README.md +95 -0
  2. package/dist/_virtual/_/plugin-vue/export-helper.mjs +8 -0
  3. package/dist/components/auth/index.d.ts +2 -0
  4. package/dist/components/auth/index.mjs +2 -0
  5. package/dist/components/auth/taman-auth-form.mjs +67 -0
  6. package/dist/components/auth/taman-auth-form.vue.d.ts +31 -0
  7. package/dist/components/back-to-top/index.mjs +2 -0
  8. package/dist/components/back-to-top/taman-back-to-top.mjs +70 -0
  9. package/dist/components/back-to-top/taman-back-to-top.vue.d.ts +18 -0
  10. package/dist/components/button/check-group-selection.mjs +17 -0
  11. package/dist/components/button/index.d.ts +4 -0
  12. package/dist/components/button/index.mjs +3 -0
  13. package/dist/components/button/taman-button-check-group.mjs +132 -0
  14. package/dist/components/button/taman-button-check-group.types.d.ts +22 -0
  15. package/dist/components/button/taman-button-check-group.vue.d.ts +41 -0
  16. package/dist/components/button/taman-button-icon.mjs +105 -0
  17. package/dist/components/button/taman-button-icon.vue.d.ts +17 -0
  18. package/dist/components/descriptions/index.d.ts +4 -0
  19. package/dist/components/descriptions/index.mjs +3 -0
  20. package/dist/components/descriptions/taman-description-cell.mjs +116 -0
  21. package/dist/components/descriptions/taman-description-item.mjs +10 -0
  22. package/dist/components/descriptions/taman-description-item.vue.d.ts +5 -0
  23. package/dist/components/descriptions/taman-description-row.mjs +131 -0
  24. package/dist/components/descriptions/taman-description.mjs +78 -0
  25. package/dist/components/descriptions/taman-description.types.d.ts +51 -0
  26. package/dist/components/descriptions/taman-description.vue.d.ts +23 -0
  27. package/dist/components/descriptions/use-taman-description.mjs +161 -0
  28. package/dist/components/file-upload/index.d.ts +3 -0
  29. package/dist/components/file-upload/index.mjs +2 -0
  30. package/dist/components/file-upload/taman-file-upload.mjs +88 -0
  31. package/dist/components/file-upload/taman-file-upload.types.d.ts +10 -0
  32. package/dist/components/file-upload/taman-file-upload.vue.d.ts +21 -0
  33. package/dist/components/full-screen/full-screen.mjs +27 -0
  34. package/dist/components/full-screen/full-screen.vue.d.ts +8 -0
  35. package/dist/components/full-screen/index.mjs +2 -0
  36. package/dist/components/icon/icon.mjs +27 -0
  37. package/dist/components/icon/icon.vue.d.ts +9 -0
  38. package/dist/components/icon/index.d.ts +2 -0
  39. package/dist/components/icon/index.mjs +2 -0
  40. package/dist/components/index.d.ts +34 -0
  41. package/dist/components/index.mjs +31 -0
  42. package/dist/components/input/index.d.ts +5 -0
  43. package/dist/components/input/index.mjs +4 -0
  44. package/dist/components/input/password-strength.d.ts +7 -0
  45. package/dist/components/input/password-strength.mjs +21 -0
  46. package/dist/components/input/taman-input-currency.mjs +76 -0
  47. package/dist/components/input/taman-input-currency.types.d.ts +8 -0
  48. package/dist/components/input/taman-input-currency.vue.d.ts +15 -0
  49. package/dist/components/input/taman-input-password.mjs +99 -0
  50. package/dist/components/input/taman-input-password.vue.d.ts +17 -0
  51. package/dist/components/input-date/format-calendar-input-value.mjs +26 -0
  52. package/dist/components/input-date/index.d.ts +3 -0
  53. package/dist/components/input-date/index.mjs +2 -0
  54. package/dist/components/input-date/taman-input-date.mjs +116 -0
  55. package/dist/components/input-date/taman-input-date.types.d.ts +14 -0
  56. package/dist/components/input-date/taman-input-date.vue.d.ts +21 -0
  57. package/dist/components/loading/index.d.ts +3 -0
  58. package/dist/components/loading/index.mjs +2 -0
  59. package/dist/components/loading/taman-loading.mjs +64 -0
  60. package/dist/components/loading/taman-loading.vue.d.ts +25 -0
  61. package/dist/components/loading/types.d.ts +13 -0
  62. package/dist/components/logo/index.mjs +2 -0
  63. package/dist/components/logo/taman-logo.mjs +60 -0
  64. package/dist/components/logo/taman-logo.vue.d.ts +32 -0
  65. package/dist/components/render-content/index.d.ts +2 -0
  66. package/dist/components/render-content/index.mjs +2 -0
  67. package/dist/components/render-content/render-content.mjs +42 -0
  68. package/dist/components/render-content/render-content.vue.d.ts +31 -0
  69. package/dist/components/scrollbar/index.d.ts +2 -0
  70. package/dist/components/scrollbar/index.mjs +2 -0
  71. package/dist/components/scrollbar/scrollbar.mjs +136 -0
  72. package/dist/components/scrollbar/scrollbar.vue.d.ts +50 -0
  73. package/dist/form/components/form-actions.mjs +151 -0
  74. package/dist/form/components/form-field-array.mjs +154 -0
  75. package/dist/form/components/form-field-array.types.d.ts +18 -0
  76. package/dist/form/form-render/form-render-field-collapsible.mjs +32 -0
  77. package/dist/form/form-render/form-render-field-control.mjs +44 -0
  78. package/dist/form/form-render/form-render-form-field.mjs +408 -0
  79. package/dist/form/form-render/form-render-form-label.mjs +46 -0
  80. package/dist/form/form-render/form-render-form.mjs +163 -0
  81. package/dist/form/form-render/form-render-group.mjs +89 -0
  82. package/dist/form/form-render/form-render.context.mjs +10 -0
  83. package/dist/form/form-render/form-render.dependencies.mjs +101 -0
  84. package/dist/form/form-render/form-render.helper.mjs +31 -0
  85. package/dist/form/form-render/form-render.schema.mjs +209 -0
  86. package/dist/form/form-render/index.mjs +4 -0
  87. package/dist/form/form.api.d.ts +54 -0
  88. package/dist/form/form.api.mjs +324 -0
  89. package/dist/form/form.built-ins.d.ts +36 -0
  90. package/dist/form/form.built-ins.mjs +48 -0
  91. package/dist/form/form.codec.d.ts +17 -0
  92. package/dist/form/form.codec.mjs +45 -0
  93. package/dist/form/form.config.d.ts +6 -0
  94. package/dist/form/form.config.mjs +43 -0
  95. package/dist/form/form.empty-value.d.ts +4 -0
  96. package/dist/form/form.empty-value.mjs +20 -0
  97. package/dist/form/form.field-name.mjs +25 -0
  98. package/dist/form/form.rule-registry.mjs +10 -0
  99. package/dist/form/form.runtime-field.mjs +56 -0
  100. package/dist/form/form.runtime.mjs +235 -0
  101. package/dist/form/form.schema-defaults.mjs +36 -0
  102. package/dist/form/form.types.d.ts +315 -0
  103. package/dist/form/form.use-delayed-flag.mjs +35 -0
  104. package/dist/form/form.use-form-context.mjs +44 -0
  105. package/dist/form/form.use-taman-form.d.ts +7 -0
  106. package/dist/form/form.use-taman-form.mjs +36 -0
  107. package/dist/form/index.d.ts +8 -0
  108. package/dist/form/index.mjs +6 -0
  109. package/dist/form/taman-use-form.mjs +146 -0
  110. package/dist/index.d.ts +63 -0
  111. package/dist/index.mjs +56 -0
  112. package/dist/layout/components/index.mjs +6 -0
  113. package/dist/layout/components/taman-core-button-collapse.mjs +38 -0
  114. package/dist/layout/components/taman-core-button-fixed.mjs +29 -0
  115. package/dist/layout/components/taman-core-layout-content.mjs +50 -0
  116. package/dist/layout/components/taman-core-layout-footer.mjs +38 -0
  117. package/dist/layout/components/taman-core-layout-header.mjs +48 -0
  118. package/dist/layout/components/taman-core-layout-sidebar.mjs +319 -0
  119. package/dist/layout/components/taman-core-layout-tabbar.mjs +21 -0
  120. package/dist/layout/composables/use-layout.mjs +31 -0
  121. package/dist/layout/composables/use-sidebar-drag.mjs +103 -0
  122. package/dist/layout/header-scroll-state.mjs +9 -0
  123. package/dist/layout/index.d.ts +3 -0
  124. package/dist/layout/index.mjs +2 -0
  125. package/dist/layout/taman-core-layout.d.ts +41 -0
  126. package/dist/layout/taman-core-layout.mjs +603 -0
  127. package/dist/layout/taman-core-layout.vue.d.ts +99 -0
  128. package/dist/menu/components/collapse-transition.mjs +82 -0
  129. package/dist/menu/components/index.mjs +5 -0
  130. package/dist/menu/components/normal-menu/index.d.ts +3 -0
  131. package/dist/menu/components/normal-menu/index.mjs +2 -0
  132. package/dist/menu/components/normal-menu/normal-menu.d.ts +11 -0
  133. package/dist/menu/components/normal-menu/normal-menu.mjs +50 -0
  134. package/dist/menu/components/normal-menu/normal-menu.vue.d.ts +19 -0
  135. package/dist/menu/components/taman-menu-badge-dot.mjs +23 -0
  136. package/dist/menu/components/taman-menu-badge.mjs +49 -0
  137. package/dist/menu/components/taman-menu-badge.vue.d.ts +9 -0
  138. package/dist/menu/components/taman-menu-item.mjs +124 -0
  139. package/dist/menu/components/taman-menu-root.mjs +250 -0
  140. package/dist/menu/components/taman-menu-sub-menu-content.mjs +83 -0
  141. package/dist/menu/components/taman-menu-sub-menu.mjs +216 -0
  142. package/dist/menu/composables/index.mjs +3 -0
  143. package/dist/menu/composables/use-menu-context.mjs +36 -0
  144. package/dist/menu/composables/use-menu-scroll.mjs +23 -0
  145. package/dist/menu/composables/use-menu.mjs +33 -0
  146. package/dist/menu/index.d.ts +7 -0
  147. package/dist/menu/index.mjs +5 -0
  148. package/dist/menu/menu.constants.mjs +5 -0
  149. package/dist/menu/menu.types.d.ts +63 -0
  150. package/dist/menu/menu.utils.mjs +27 -0
  151. package/dist/menu/taman-menu.mjs +41 -0
  152. package/dist/menu/taman-menu.vue.d.ts +12 -0
  153. package/dist/menu/taman-sub-menu.mjs +75 -0
  154. package/dist/popup/alert/alert-builder.d.ts +8 -0
  155. package/dist/popup/alert/alert-builder.mjs +98 -0
  156. package/dist/popup/alert/alert-overlay.mjs +55 -0
  157. package/dist/popup/alert/alert.d.ts +43 -0
  158. package/dist/popup/alert/alert.mjs +10 -0
  159. package/dist/popup/alert/alert.vue.d.ts +26 -0
  160. package/dist/popup/alert/alert2.mjs +238 -0
  161. package/dist/popup/alert/index.d.ts +4 -0
  162. package/dist/popup/alert/index.mjs +4 -0
  163. package/dist/popup/dialog/dialog.api.d.ts +23 -0
  164. package/dist/popup/dialog/dialog.api.mjs +133 -0
  165. package/dist/popup/dialog/dialog.mjs +336 -0
  166. package/dist/popup/dialog/dialog.types.d.ts +60 -0
  167. package/dist/popup/dialog/dialog.vue.d.ts +46 -0
  168. package/dist/popup/dialog/index.d.ts +4 -0
  169. package/dist/popup/dialog/index.mjs +3 -0
  170. package/dist/popup/dialog/use-dialog-draggable.mjs +93 -0
  171. package/dist/popup/dialog/use-taman-dialog.d.ts +13 -0
  172. package/dist/popup/dialog/use-taman-dialog.mjs +106 -0
  173. package/dist/popup/drawer/drawer.api.d.ts +23 -0
  174. package/dist/popup/drawer/drawer.api.mjs +124 -0
  175. package/dist/popup/drawer/drawer.mjs +277 -0
  176. package/dist/popup/drawer/drawer.types.d.ts +56 -0
  177. package/dist/popup/drawer/drawer.vue.d.ts +47 -0
  178. package/dist/popup/drawer/index.d.ts +4 -0
  179. package/dist/popup/drawer/index.mjs +3 -0
  180. package/dist/popup/drawer/use-taman-drawer.d.ts +13 -0
  181. package/dist/popup/drawer/use-taman-drawer.mjs +109 -0
  182. package/dist/popup/index.d.ts +13 -0
  183. package/dist/popup/index.mjs +11 -0
  184. package/dist/tabs/components/index.mjs +2 -0
  185. package/dist/tabs/components/taman-tabs.mjs +158 -0
  186. package/dist/tabs/components/widgets/index.d.ts +4 -0
  187. package/dist/tabs/components/widgets/index.mjs +4 -0
  188. package/dist/tabs/components/widgets/tool-more.mjs +45 -0
  189. package/dist/tabs/components/widgets/tool-more.vue.d.ts +7 -0
  190. package/dist/tabs/components/widgets/tool-refresh.mjs +25 -0
  191. package/dist/tabs/components/widgets/tool-refresh.vue.d.ts +9 -0
  192. package/dist/tabs/components/widgets/tool-screen.mjs +29 -0
  193. package/dist/tabs/components/widgets/tool-screen.vue.d.ts +12 -0
  194. package/dist/tabs/index.d.ts +8 -0
  195. package/dist/tabs/index.mjs +6 -0
  196. package/dist/tabs/strict-context-menu.d.ts +10 -0
  197. package/dist/tabs/tabs.types.d.ts +30 -0
  198. package/dist/tabs/taman-tabs-view.mjs +101 -0
  199. package/dist/tabs/taman-tabs-view.vue.d.ts +18 -0
  200. package/dist/tabs/use-tabs-drag.mjs +69 -0
  201. package/dist/tabs/use-tabs-view-scroll.mjs +114 -0
  202. package/dist/ui/alert-dialog/alert-dialog-action.mjs +21 -0
  203. package/dist/ui/alert-dialog/alert-dialog-action.vue.d.ts +16 -0
  204. package/dist/ui/alert-dialog/alert-dialog-cancel.mjs +21 -0
  205. package/dist/ui/alert-dialog/alert-dialog-cancel.vue.d.ts +16 -0
  206. package/dist/ui/alert-dialog/alert-dialog-content.mjs +111 -0
  207. package/dist/ui/alert-dialog/alert-dialog-content.vue.d.ts +49 -0
  208. package/dist/ui/alert-dialog/alert-dialog-description.mjs +30 -0
  209. package/dist/ui/alert-dialog/alert-dialog-description.vue.d.ts +20 -0
  210. package/dist/ui/alert-dialog/alert-dialog-footer.mjs +14 -0
  211. package/dist/ui/alert-dialog/alert-dialog-footer.vue.d.ts +15 -0
  212. package/dist/ui/alert-dialog/alert-dialog-header.mjs +14 -0
  213. package/dist/ui/alert-dialog/alert-dialog-header.vue.d.ts +15 -0
  214. package/dist/ui/alert-dialog/alert-dialog-overlay.mjs +29 -0
  215. package/dist/ui/alert-dialog/alert-dialog-root.mjs +23 -0
  216. package/dist/ui/alert-dialog/alert-dialog-root.vue.d.ts +23 -0
  217. package/dist/ui/alert-dialog/alert-dialog-title.mjs +30 -0
  218. package/dist/ui/alert-dialog/alert-dialog-title.vue.d.ts +20 -0
  219. package/dist/ui/alert-dialog/alert-dialog-trigger.mjs +21 -0
  220. package/dist/ui/alert-dialog/alert-dialog-trigger.vue.d.ts +16 -0
  221. package/dist/ui/alert-dialog/index.d.ts +10 -0
  222. package/dist/ui/alert-dialog/index.mjs +10 -0
  223. package/dist/ui/dialog/dialog-close.mjs +21 -0
  224. package/dist/ui/dialog/dialog-close.vue.d.ts +16 -0
  225. package/dist/ui/dialog/dialog-content.mjs +111 -0
  226. package/dist/ui/dialog/dialog-content.vue.d.ts +51 -0
  227. package/dist/ui/dialog/dialog-description.mjs +31 -0
  228. package/dist/ui/dialog/dialog-description.vue.d.ts +20 -0
  229. package/dist/ui/dialog/dialog-footer.mjs +14 -0
  230. package/dist/ui/dialog/dialog-footer.vue.d.ts +15 -0
  231. package/dist/ui/dialog/dialog-header.mjs +14 -0
  232. package/dist/ui/dialog/dialog-header.vue.d.ts +15 -0
  233. package/dist/ui/dialog/dialog-overlay.mjs +34 -0
  234. package/dist/ui/dialog/dialog-overlay.vue.d.ts +14 -0
  235. package/dist/ui/dialog/dialog-root.mjs +24 -0
  236. package/dist/ui/dialog/dialog-root.vue.d.ts +23 -0
  237. package/dist/ui/dialog/dialog-title.mjs +31 -0
  238. package/dist/ui/dialog/dialog-title.vue.d.ts +20 -0
  239. package/dist/ui/dialog/dialog-trigger.mjs +21 -0
  240. package/dist/ui/dialog/dialog-trigger.vue.d.ts +16 -0
  241. package/dist/ui/dialog/index.d.ts +10 -0
  242. package/dist/ui/dialog/index.mjs +10 -0
  243. package/dist/ui/dialog/use-dialog-state-events.mjs +60 -0
  244. package/dist/ui/form/form-control.mjs +27 -0
  245. package/dist/ui/form/form-control.vue.d.ts +15 -0
  246. package/dist/ui/form/form-description.mjs +27 -0
  247. package/dist/ui/form/form-description.vue.d.ts +19 -0
  248. package/dist/ui/form/form-field.mjs +37 -0
  249. package/dist/ui/form/form-field.vue.d.ts +27 -0
  250. package/dist/ui/form/form-item.mjs +27 -0
  251. package/dist/ui/form/form-item.vue.d.ts +19 -0
  252. package/dist/ui/form/form-label.mjs +41 -0
  253. package/dist/ui/form/form-label.vue.d.ts +20 -0
  254. package/dist/ui/form/form-message.mjs +28 -0
  255. package/dist/ui/form/form-message.vue.d.ts +9 -0
  256. package/dist/ui/form/index.d.ts +8 -0
  257. package/dist/ui/form/index.mjs +8 -0
  258. package/dist/ui/form/injection-keys.d.ts +13 -0
  259. package/dist/ui/form/injection-keys.mjs +5 -0
  260. package/dist/ui/form/use-form-field.mjs +27 -0
  261. package/dist/ui/index.d.ts +42 -0
  262. package/dist/ui/index.mjs +42 -0
  263. package/dist/ui/label/index.d.ts +2 -0
  264. package/dist/ui/label/index.mjs +2 -0
  265. package/dist/ui/label/label.mjs +31 -0
  266. package/dist/ui/label/label.vue.d.ts +20 -0
  267. package/dist/ui/scroll-area/index.d.ts +3 -0
  268. package/dist/ui/scroll-area/index.mjs +3 -0
  269. package/dist/ui/scroll-area/scroll-area.mjs +47 -0
  270. package/dist/ui/scroll-area/scroll-area.vue.d.ts +21 -0
  271. package/dist/ui/scroll-area/scroll-bar.mjs +38 -0
  272. package/dist/ui/scroll-area/scroll-bar.vue.d.ts +12 -0
  273. package/dist/ui/sheet/index.d.ts +8 -0
  274. package/dist/ui/sheet/index.mjs +8 -0
  275. package/dist/ui/sheet/sheet-close.mjs +21 -0
  276. package/dist/ui/sheet/sheet-close.vue.d.ts +16 -0
  277. package/dist/ui/sheet/sheet-content.mjs +105 -0
  278. package/dist/ui/sheet/sheet-content.vue.d.ts +48 -0
  279. package/dist/ui/sheet/sheet-description.mjs +30 -0
  280. package/dist/ui/sheet/sheet-description.vue.d.ts +20 -0
  281. package/dist/ui/sheet/sheet-footer.mjs +14 -0
  282. package/dist/ui/sheet/sheet-footer.vue.d.ts +15 -0
  283. package/dist/ui/sheet/sheet-header.mjs +14 -0
  284. package/dist/ui/sheet/sheet-header.vue.d.ts +15 -0
  285. package/dist/ui/sheet/sheet-overlay.mjs +32 -0
  286. package/dist/ui/sheet/sheet-root.mjs +24 -0
  287. package/dist/ui/sheet/sheet-root.vue.d.ts +23 -0
  288. package/dist/ui/sheet/sheet-title.mjs +31 -0
  289. package/dist/ui/sheet/sheet-title.vue.d.ts +20 -0
  290. package/dist/ui/sheet/sheet.variants.d.ts +27 -0
  291. package/dist/ui/sheet/sheet.variants.mjs +12 -0
  292. package/dist/unocss/content.d.ts +4 -0
  293. package/dist/unocss/content.mjs +9 -0
  294. package/dist/unocss/index.d.ts +2 -0
  295. package/dist/unocss/index.mjs +2 -0
  296. package/package.json +78 -0
@@ -0,0 +1,21 @@
1
+ import { createBlock, defineComponent, mergeProps, openBlock, renderSlot, unref, withCtx } from "vue";
2
+ import { DialogClose } from "akar";
3
+ //#region src/ui/dialog/dialog-close.vue
4
+ const _sfc_main = /*@__PURE__*/ defineComponent({
5
+ __name: "dialog-close",
6
+ props: {
7
+ asChild: { type: Boolean },
8
+ as: {}
9
+ },
10
+ setup(__props) {
11
+ const props = __props;
12
+ return (_ctx, _cache) => {
13
+ return openBlock(), createBlock(unref(DialogClose), mergeProps({ "data-slot": "dialog-close" }, props), {
14
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
15
+ _: 3
16
+ }, 16);
17
+ };
18
+ }
19
+ });
20
+ //#endregion
21
+ export { _sfc_main as default };
@@ -0,0 +1,16 @@
1
+ import { DialogCloseProps } from "akar";
2
+ //#region src/ui/dialog/dialog-close.vue.d.ts
3
+ declare var __VLS_8: {};
4
+ type __VLS_Slots = {} & {
5
+ default?: (props: typeof __VLS_8) => any;
6
+ };
7
+ declare const __VLS_base: import("vue").DefineComponent<DialogCloseProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DialogCloseProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
8
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
9
+ declare const _default: typeof __VLS_export;
10
+ type __VLS_WithSlots<T, S> = T & {
11
+ new (): {
12
+ $slots: S;
13
+ };
14
+ };
15
+ //#endregion
16
+ export { _default as default };
@@ -0,0 +1,111 @@
1
+ import { useDialogStateEvents } from "./use-dialog-state-events.mjs";
2
+ import _sfc_main$1 from "./dialog-overlay.mjs";
3
+ import { Transition, computed, createBlock, createCommentVNode, createVNode, defineComponent, mergeProps, openBlock, ref, renderSlot, unref, withCtx } from "vue";
4
+ import { DialogContent, DialogPortal, useForwardPropsEmits } from "akar";
5
+ //#region src/ui/dialog/dialog-content.vue
6
+ const _sfc_main = /*@__PURE__*/ defineComponent({
7
+ inheritAttrs: false,
8
+ __name: "dialog-content",
9
+ props: {
10
+ forceMount: { type: Boolean },
11
+ disableOutsidePointerEvents: { type: Boolean },
12
+ asChild: { type: Boolean },
13
+ as: {},
14
+ animationType: { default: "slide" },
15
+ appendTo: { default: "body" },
16
+ class: { type: [
17
+ Boolean,
18
+ null,
19
+ String,
20
+ Object,
21
+ Array
22
+ ] },
23
+ modal: { type: Boolean },
24
+ open: { type: Boolean },
25
+ overlayBlur: {},
26
+ zIndex: {}
27
+ },
28
+ emits: [
29
+ "escapeKeyDown",
30
+ "pointerDownOutside",
31
+ "focusOutside",
32
+ "interactOutside",
33
+ "openAutoFocus",
34
+ "closeAutoFocus",
35
+ "close",
36
+ "closed",
37
+ "opened"
38
+ ],
39
+ setup(__props, { expose: __expose, emit: __emit }) {
40
+ const props = __props;
41
+ const emits = __emit;
42
+ const delegatedProps = computed(() => {
43
+ const { class: _, modal: _modal, open: _open, animationType: ___, ...delegated } = props;
44
+ return delegated;
45
+ });
46
+ function isAppendToBody() {
47
+ return props.appendTo === "body" || props.appendTo === document.body || !props.appendTo;
48
+ }
49
+ const position = computed(() => {
50
+ return isAppendToBody() ? "fixed" : "absolute";
51
+ });
52
+ const forwarded = useForwardPropsEmits(delegatedProps, emits);
53
+ const contentRef = ref(null);
54
+ const { handleAnimationEvent } = useDialogStateEvents({
55
+ contentRef,
56
+ isOpen: () => props.open,
57
+ onClosed: () => emits("closed"),
58
+ onOpened: () => emits("opened")
59
+ });
60
+ __expose({ getContentRef: () => contentRef.value });
61
+ return (_ctx, _cache) => {
62
+ return openBlock(), createBlock(unref(DialogPortal), { to: __props.appendTo }, {
63
+ default: withCtx(() => [createVNode(Transition, {
64
+ "enter-active-class": "transition-opacity-300",
65
+ "leave-active-class": "transition-opacity-300",
66
+ "enter-from-class": "opacity-0",
67
+ "leave-to-class": "opacity-0"
68
+ }, {
69
+ default: withCtx(() => [__props.open && __props.modal ? (openBlock(), createBlock(_sfc_main$1, {
70
+ key: 0,
71
+ open: __props.open,
72
+ "overlay-blur": __props.overlayBlur,
73
+ position: position.value,
74
+ "z-index": __props.zIndex,
75
+ onClick: _cache[0] || (_cache[0] = () => emits("close"))
76
+ }, null, 8, [
77
+ "open",
78
+ "overlay-blur",
79
+ "position",
80
+ "z-index"
81
+ ])) : createCommentVNode("v-if", true)]),
82
+ _: 1
83
+ }), createVNode(unref(DialogContent), mergeProps({
84
+ ref_key: "contentRef",
85
+ ref: contentRef,
86
+ style: {
87
+ ...__props.zIndex ? { zIndex: __props.zIndex } : {},
88
+ position: position.value
89
+ },
90
+ "data-slot": "dialog-content",
91
+ class: "outline-hidden bg-background shadow-lg z-popup sm:rounded-xl data-[state=closed]:(animate-out fade-out-0 zoom-out-95) data-[state=open]:(animate-in fade-in-0 zoom-in-95) pohon:animate-duration-280"
92
+ }, unref(forwarded), {
93
+ class: [{ "data-[state=closed]:slide-out-to-top-48% data-[state=open]:slide-in-from-top-48%": __props.animationType === "slide" }, props.class],
94
+ onAnimationend: unref(handleAnimationEvent),
95
+ onAnimationcancel: unref(handleAnimationEvent)
96
+ }), {
97
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
98
+ _: 3
99
+ }, 16, [
100
+ "style",
101
+ "class",
102
+ "onAnimationend",
103
+ "onAnimationcancel"
104
+ ])]),
105
+ _: 3
106
+ }, 8, ["to"]);
107
+ };
108
+ }
109
+ });
110
+ //#endregion
111
+ export { _sfc_main as default };
@@ -0,0 +1,51 @@
1
+ import { HTMLAttributes } from "vue";
2
+ import { DialogContent, DialogContentProps } from "akar";
3
+ //#region src/ui/dialog/dialog-content.vue.d.ts
4
+ type __VLS_Props = DialogContentProps & {
5
+ animationType?: 'scale' | 'slide';
6
+ appendTo?: HTMLElement | string;
7
+ class?: HTMLAttributes['class'];
8
+ modal?: boolean;
9
+ open?: boolean;
10
+ overlayBlur?: number;
11
+ zIndex?: number;
12
+ };
13
+ declare var __VLS_32: {};
14
+ type __VLS_Slots = {} & {
15
+ default?: (props: typeof __VLS_32) => any;
16
+ };
17
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
18
+ getContentRef: () => InstanceType<typeof DialogContent> | null;
19
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
20
+ close: () => any;
21
+ openAutoFocus: (event: Event) => any;
22
+ closed: () => any;
23
+ opened: () => any;
24
+ escapeKeyDown: (event: KeyboardEvent) => any;
25
+ pointerDownOutside: (event: import("akar").PointerDownOutsideEvent) => any;
26
+ focusOutside: (event: import("akar").FocusOutsideEvent) => any;
27
+ interactOutside: (event: import("akar").PointerDownOutsideEvent | import("akar").FocusOutsideEvent) => any;
28
+ closeAutoFocus: (event: Event) => any;
29
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
30
+ onClose?: (() => any) | undefined;
31
+ onOpenAutoFocus?: ((event: Event) => any) | undefined;
32
+ onClosed?: (() => any) | undefined;
33
+ onOpened?: (() => any) | undefined;
34
+ onEscapeKeyDown?: ((event: KeyboardEvent) => any) | undefined;
35
+ onPointerDownOutside?: ((event: import("akar").PointerDownOutsideEvent) => any) | undefined;
36
+ onFocusOutside?: ((event: import("akar").FocusOutsideEvent) => any) | undefined;
37
+ onInteractOutside?: ((event: import("akar").PointerDownOutsideEvent | import("akar").FocusOutsideEvent) => any) | undefined;
38
+ onCloseAutoFocus?: ((event: Event) => any) | undefined;
39
+ }>, {
40
+ animationType: "scale" | "slide";
41
+ appendTo: HTMLElement | string;
42
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
43
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
44
+ declare const _default: typeof __VLS_export;
45
+ type __VLS_WithSlots<T, S> = T & {
46
+ new (): {
47
+ $slots: S;
48
+ };
49
+ };
50
+ //#endregion
51
+ export { _default as default };
@@ -0,0 +1,31 @@
1
+ import { createBlock, defineComponent, mergeProps, openBlock, renderSlot, unref, withCtx } from "vue";
2
+ import { reactiveOmit } from "@vueuse/core";
3
+ import { DialogDescription, useForwardProps } from "akar";
4
+ //#region src/ui/dialog/dialog-description.vue
5
+ const _sfc_main = /*@__PURE__*/ defineComponent({
6
+ __name: "dialog-description",
7
+ props: {
8
+ asChild: { type: Boolean },
9
+ as: {},
10
+ class: { type: [
11
+ Boolean,
12
+ null,
13
+ String,
14
+ Object,
15
+ Array
16
+ ] }
17
+ },
18
+ setup(__props) {
19
+ const props = __props;
20
+ const delegatedProps = reactiveOmit(props, "class");
21
+ const forwardedProps = useForwardProps(delegatedProps);
22
+ return (_ctx, _cache) => {
23
+ return openBlock(), createBlock(unref(DialogDescription), mergeProps({ "data-slot": "dialog-description" }, unref(forwardedProps), { class: ["text-sm color-text-muted", props.class] }), {
24
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
25
+ _: 3
26
+ }, 16, ["class"]);
27
+ };
28
+ }
29
+ });
30
+ //#endregion
31
+ export { _sfc_main as default };
@@ -0,0 +1,20 @@
1
+ import { HTMLAttributes } from "vue";
2
+ import { DialogDescriptionProps } from "akar";
3
+ //#region src/ui/dialog/dialog-description.vue.d.ts
4
+ type __VLS_Props = DialogDescriptionProps & {
5
+ class?: HTMLAttributes['class'];
6
+ };
7
+ declare var __VLS_8: {};
8
+ type __VLS_Slots = {} & {
9
+ default?: (props: typeof __VLS_8) => any;
10
+ };
11
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
13
+ declare const _default: typeof __VLS_export;
14
+ type __VLS_WithSlots<T, S> = T & {
15
+ new (): {
16
+ $slots: S;
17
+ };
18
+ };
19
+ //#endregion
20
+ export { _default as default };
@@ -0,0 +1,14 @@
1
+ import export_helper_default from "../../_virtual/_/plugin-vue/export-helper.mjs";
2
+ import { createElementBlock, openBlock, renderSlot } from "vue";
3
+ //#region src/ui/dialog/dialog-footer.vue
4
+ const _sfc_main = {};
5
+ const _hoisted_1 = {
6
+ "data-slot": "dialog-footer",
7
+ class: "flex flex-col-reverse gap-2 sm:(flex-row justify-end)"
8
+ };
9
+ function _sfc_render(_ctx, _cache) {
10
+ return openBlock(), createElementBlock("div", _hoisted_1, [renderSlot(_ctx.$slots, "default")]);
11
+ }
12
+ var dialog_footer_default = /*#__PURE__*/ export_helper_default(_sfc_main, [["render", _sfc_render]]);
13
+ //#endregion
14
+ export { dialog_footer_default as default };
@@ -0,0 +1,15 @@
1
+ //#region src/ui/dialog/dialog-footer.vue.d.ts
2
+ declare var __VLS_1: {};
3
+ type __VLS_Slots = {} & {
4
+ default?: (props: typeof __VLS_1) => any;
5
+ };
6
+ declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
7
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
8
+ declare const _default: typeof __VLS_export;
9
+ type __VLS_WithSlots<T, S> = T & {
10
+ new (): {
11
+ $slots: S;
12
+ };
13
+ };
14
+ //#endregion
15
+ export { _default as default };
@@ -0,0 +1,14 @@
1
+ import export_helper_default from "../../_virtual/_/plugin-vue/export-helper.mjs";
2
+ import { createElementBlock, openBlock, renderSlot } from "vue";
3
+ //#region src/ui/dialog/dialog-header.vue
4
+ const _sfc_main = {};
5
+ const _hoisted_1 = {
6
+ "data-slot": "dialog-header",
7
+ class: "px-4 py-3 flex gap-1.5"
8
+ };
9
+ function _sfc_render(_ctx, _cache) {
10
+ return openBlock(), createElementBlock("div", _hoisted_1, [renderSlot(_ctx.$slots, "default")]);
11
+ }
12
+ var dialog_header_default = /*#__PURE__*/ export_helper_default(_sfc_main, [["render", _sfc_render]]);
13
+ //#endregion
14
+ export { dialog_header_default as default };
@@ -0,0 +1,15 @@
1
+ //#region src/ui/dialog/dialog-header.vue.d.ts
2
+ declare var __VLS_1: {};
3
+ type __VLS_Slots = {} & {
4
+ default?: (props: typeof __VLS_1) => any;
5
+ };
6
+ declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
7
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
8
+ declare const _default: typeof __VLS_export;
9
+ type __VLS_WithSlots<T, S> = T & {
10
+ new (): {
11
+ $slots: S;
12
+ };
13
+ };
14
+ //#endregion
15
+ export { _default as default };
@@ -0,0 +1,34 @@
1
+ import { createElementBlock, defineComponent, inject, normalizeStyle, openBlock, unref } from "vue";
2
+ import { useScrollLock } from "@vinicunca/taman-core/composables";
3
+ import { DISMISSABLE_DIALOG_ID } from "@vinicunca/taman-core/constants";
4
+ //#region src/ui/dialog/dialog-overlay.vue
5
+ const _hoisted_1 = ["data-dismissable-dialog", "data-state"];
6
+ const _sfc_main = /*@__PURE__*/ defineComponent({
7
+ __name: "dialog-overlay",
8
+ props: {
9
+ class: {},
10
+ overlayBlur: {},
11
+ position: { default: "fixed" },
12
+ zIndex: {},
13
+ open: { type: Boolean }
14
+ },
15
+ setup(__props) {
16
+ const props = __props;
17
+ useScrollLock();
18
+ const dismissableDialogId = inject(DISMISSABLE_DIALOG_ID, void 0);
19
+ return (_ctx, _cache) => {
20
+ return openBlock(), createElementBlock("div", {
21
+ "data-dismissable-dialog": unref(dismissableDialogId),
22
+ "data-state": __props.open ? "open" : "closed",
23
+ style: normalizeStyle({
24
+ ...__props.zIndex ? { zIndex: __props.zIndex } : {},
25
+ position: props.position,
26
+ backdropFilter: props.overlayBlur && props.overlayBlur > 0 ? `blur(${props.overlayBlur}px)` : "none"
27
+ }),
28
+ class: "bg-background-elevated/75 inset-0 fixed z-popup isolate data-[state=closed]:(animate-out fade-out-0) data-[state=open]:(animate-in fade-in-0) pohon:animate-duration-280"
29
+ }, null, 12, _hoisted_1);
30
+ };
31
+ }
32
+ });
33
+ //#endregion
34
+ export { _sfc_main as default };
@@ -0,0 +1,14 @@
1
+ //#region src/ui/dialog/dialog-overlay.vue.d.ts
2
+ type __VLS_Props = {
3
+ class?: any;
4
+ overlayBlur?: number;
5
+ position?: 'absolute' | 'fixed';
6
+ zIndex?: number;
7
+ open?: boolean;
8
+ };
9
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
10
+ position: "absolute" | "fixed";
11
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
+ declare const _default: typeof __VLS_export;
13
+ //#endregion
14
+ export { _default as default };
@@ -0,0 +1,24 @@
1
+ import { createBlock, defineComponent, guardReactiveProps, mergeProps, normalizeProps, openBlock, renderSlot, unref, withCtx } from "vue";
2
+ import { DialogRoot, useForwardPropsEmits } from "akar";
3
+ //#region src/ui/dialog/dialog-root.vue
4
+ const _sfc_main = /*@__PURE__*/ defineComponent({
5
+ __name: "dialog-root",
6
+ props: {
7
+ open: { type: Boolean },
8
+ defaultOpen: { type: Boolean },
9
+ modal: { type: Boolean },
10
+ unmountOnHide: { type: Boolean }
11
+ },
12
+ emits: ["update:open"],
13
+ setup(__props, { emit: __emit }) {
14
+ const forwarded = useForwardPropsEmits(__props, __emit);
15
+ return (_ctx, _cache) => {
16
+ return openBlock(), createBlock(unref(DialogRoot), mergeProps({ "data-slot": "dialog" }, unref(forwarded)), {
17
+ default: withCtx((slotProps) => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(slotProps)))]),
18
+ _: 3
19
+ }, 16);
20
+ };
21
+ }
22
+ });
23
+ //#endregion
24
+ export { _sfc_main as default };
@@ -0,0 +1,23 @@
1
+ import { DialogRootProps } from "akar";
2
+ //#region src/ui/dialog/dialog-root.vue.d.ts
3
+ declare var __VLS_8: {
4
+ open: boolean;
5
+ close: () => void;
6
+ };
7
+ type __VLS_Slots = {} & {
8
+ default?: (props: typeof __VLS_8) => any;
9
+ };
10
+ declare const __VLS_base: import("vue").DefineComponent<DialogRootProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
11
+ "update:open": (value: boolean) => any;
12
+ }, string, import("vue").PublicProps, Readonly<DialogRootProps> & Readonly<{
13
+ "onUpdate:open"?: ((value: boolean) => any) | undefined;
14
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
15
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
16
+ declare const _default: typeof __VLS_export;
17
+ type __VLS_WithSlots<T, S> = T & {
18
+ new (): {
19
+ $slots: S;
20
+ };
21
+ };
22
+ //#endregion
23
+ export { _default as default };
@@ -0,0 +1,31 @@
1
+ import { createBlock, defineComponent, mergeProps, openBlock, renderSlot, unref, withCtx } from "vue";
2
+ import { reactiveOmit } from "@vueuse/core";
3
+ import { DialogTitle, useForwardProps } from "akar";
4
+ //#region src/ui/dialog/dialog-title.vue
5
+ const _sfc_main = /*@__PURE__*/ defineComponent({
6
+ __name: "dialog-title",
7
+ props: {
8
+ asChild: { type: Boolean },
9
+ as: {},
10
+ class: { type: [
11
+ Boolean,
12
+ null,
13
+ String,
14
+ Object,
15
+ Array
16
+ ] }
17
+ },
18
+ setup(__props) {
19
+ const props = __props;
20
+ const delegatedProps = reactiveOmit(props, "class");
21
+ const forwardedProps = useForwardProps(delegatedProps);
22
+ return (_ctx, _cache) => {
23
+ return openBlock(), createBlock(unref(DialogTitle), mergeProps({ "data-slot": "dialog-title" }, unref(forwardedProps), { class: ["text-lg leading-none font-600", props.class] }), {
24
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
25
+ _: 3
26
+ }, 16, ["class"]);
27
+ };
28
+ }
29
+ });
30
+ //#endregion
31
+ export { _sfc_main as default };
@@ -0,0 +1,20 @@
1
+ import { HTMLAttributes } from "vue";
2
+ import { DialogTitleProps } from "akar";
3
+ //#region src/ui/dialog/dialog-title.vue.d.ts
4
+ type __VLS_Props = DialogTitleProps & {
5
+ class?: HTMLAttributes['class'];
6
+ };
7
+ declare var __VLS_8: {};
8
+ type __VLS_Slots = {} & {
9
+ default?: (props: typeof __VLS_8) => any;
10
+ };
11
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
13
+ declare const _default: typeof __VLS_export;
14
+ type __VLS_WithSlots<T, S> = T & {
15
+ new (): {
16
+ $slots: S;
17
+ };
18
+ };
19
+ //#endregion
20
+ export { _default as default };
@@ -0,0 +1,21 @@
1
+ import { createBlock, defineComponent, mergeProps, openBlock, renderSlot, unref, withCtx } from "vue";
2
+ import { DialogTrigger } from "akar";
3
+ //#region src/ui/dialog/dialog-trigger.vue
4
+ const _sfc_main = /*@__PURE__*/ defineComponent({
5
+ __name: "dialog-trigger",
6
+ props: {
7
+ asChild: { type: Boolean },
8
+ as: {}
9
+ },
10
+ setup(__props) {
11
+ const props = __props;
12
+ return (_ctx, _cache) => {
13
+ return openBlock(), createBlock(unref(DialogTrigger), mergeProps({ "data-slot": "dialog-trigger" }, props), {
14
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
15
+ _: 3
16
+ }, 16);
17
+ };
18
+ }
19
+ });
20
+ //#endregion
21
+ export { _sfc_main as default };
@@ -0,0 +1,16 @@
1
+ import { DialogTriggerProps } from "akar";
2
+ //#region src/ui/dialog/dialog-trigger.vue.d.ts
3
+ declare var __VLS_8: {};
4
+ type __VLS_Slots = {} & {
5
+ default?: (props: typeof __VLS_8) => any;
6
+ };
7
+ declare const __VLS_base: import("vue").DefineComponent<DialogTriggerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DialogTriggerProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
8
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
9
+ declare const _default: typeof __VLS_export;
10
+ type __VLS_WithSlots<T, S> = T & {
11
+ new (): {
12
+ $slots: S;
13
+ };
14
+ };
15
+ //#endregion
16
+ export { _default as default };
@@ -0,0 +1,10 @@
1
+ import _default from "./dialog-close.vue.js";
2
+ import _default$1 from "./dialog-content.vue.js";
3
+ import _default$2 from "./dialog-description.vue.js";
4
+ import _default$3 from "./dialog-footer.vue.js";
5
+ import _default$4 from "./dialog-header.vue.js";
6
+ import _default$5 from "./dialog-overlay.vue.js";
7
+ import _default$6 from "./dialog-root.vue.js";
8
+ import _default$7 from "./dialog-title.vue.js";
9
+ import _default$8 from "./dialog-trigger.vue.js";
10
+ export { _default as DialogClose, _default$1 as DialogContent, _default$2 as DialogDescription, _default$3 as DialogFooter, _default$4 as DialogHeader, _default$5 as DialogOverlay, _default$6 as DialogRoot, _default$7 as DialogTitle, _default$8 as DialogTrigger };
@@ -0,0 +1,10 @@
1
+ import _sfc_main from "./dialog-close.mjs";
2
+ import _sfc_main$1 from "./dialog-overlay.mjs";
3
+ import _sfc_main$2 from "./dialog-content.mjs";
4
+ import _sfc_main$3 from "./dialog-description.mjs";
5
+ import dialog_footer_default from "./dialog-footer.mjs";
6
+ import dialog_header_default from "./dialog-header.mjs";
7
+ import _sfc_main$4 from "./dialog-root.mjs";
8
+ import _sfc_main$5 from "./dialog-title.mjs";
9
+ import _sfc_main$6 from "./dialog-trigger.mjs";
10
+ export { _sfc_main as DialogClose, _sfc_main$2 as DialogContent, _sfc_main$3 as DialogDescription, dialog_footer_default as DialogFooter, dialog_header_default as DialogHeader, _sfc_main$1 as DialogOverlay, _sfc_main$4 as DialogRoot, _sfc_main$5 as DialogTitle, _sfc_main$6 as DialogTrigger };
@@ -0,0 +1,60 @@
1
+ import { onScopeDispose, watch } from "vue";
2
+ //#region src/ui/dialog/use-dialog-state-events.ts
3
+ /**
4
+ * The `closed`/`opened` events for the popup are determined by the content element's own exit animation (`animationend`).
5
+ * If the animation is skipped or cancelled (e.g., due to reduced motion settings, interruption, or class changes during closure),
6
+ * the events would otherwise never fire—leaving the popup visible, the `hidden` class unapplied,
7
+ * and pending operations like re-mounting (for `destroy-on-close`) or `onClosed` listeners stalled.
8
+ * This implementation aligns with akar's Presence behavior (treating `animationcancel` as completion)
9
+ * and adds a fallback trigger after the animation window closes, ensuring the closure sequence
10
+ * always completes exactly once.
11
+ */
12
+ /** The exit animation duration of the popup in this repository is 150ms; 300ms can safely cover it. */
13
+ const CLOSED_EVENT_FALLBACK_MS = 300;
14
+ function useDialogStateEvents({ contentRef, isOpen, onClosed, onOpened }) {
15
+ let closeFallbackTimer = null;
16
+ let closeAcknowledged = false;
17
+ function emitOpenStateChange() {
18
+ if (closeFallbackTimer !== null) {
19
+ clearTimeout(closeFallbackTimer);
20
+ closeFallbackTimer = null;
21
+ }
22
+ if (isOpen()) {
23
+ onOpened();
24
+ return;
25
+ }
26
+ if (closeAcknowledged) return;
27
+ closeAcknowledged = true;
28
+ onClosed();
29
+ }
30
+ /**
31
+ * Listen to the `animationend` and `animationcancel` events of the content element simultaneously —— the cancelled animation is also considered as complete (akar's Presence also handles this way),
32
+ * the closure sequence will not wait indefinitely.
33
+ */
34
+ function handleAnimationEvent(event) {
35
+ if (event.target === contentRef.value?.$el) emitOpenStateChange();
36
+ }
37
+ watch(isOpen, (open) => {
38
+ if (open) {
39
+ closeAcknowledged = false;
40
+ if (closeFallbackTimer !== null) {
41
+ clearTimeout(closeFallbackTimer);
42
+ closeFallbackTimer = null;
43
+ }
44
+ return;
45
+ }
46
+ if (closeFallbackTimer === null) closeFallbackTimer = setTimeout(() => {
47
+ closeFallbackTimer = null;
48
+ if (!isOpen()) emitOpenStateChange();
49
+ }, CLOSED_EVENT_FALLBACK_MS);
50
+ });
51
+ onScopeDispose(() => {
52
+ if (closeFallbackTimer !== null) {
53
+ clearTimeout(closeFallbackTimer);
54
+ closeFallbackTimer = null;
55
+ }
56
+ });
57
+ return { handleAnimationEvent };
58
+ }
59
+ //#endregion
60
+ export { useDialogStateEvents };
@@ -0,0 +1,27 @@
1
+ import { useFormField } from "./use-form-field.mjs";
2
+ import { createBlock, defineComponent, openBlock, renderSlot, unref, withCtx } from "vue";
3
+ import { Slot } from "akar";
4
+ //#region src/ui/form/form-control.vue
5
+ const _sfc_main = /*@__PURE__*/ defineComponent({
6
+ __name: "form-control",
7
+ setup(__props) {
8
+ const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
9
+ return (_ctx, _cache) => {
10
+ return openBlock(), createBlock(unref(Slot), {
11
+ id: unref(formItemId),
12
+ "data-slot": "form-control",
13
+ "aria-describedby": !unref(error) ? `${unref(formDescriptionId)}` : `${unref(formDescriptionId)} ${unref(formMessageId)}`,
14
+ "aria-invalid": !!unref(error)
15
+ }, {
16
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
17
+ _: 3
18
+ }, 8, [
19
+ "id",
20
+ "aria-describedby",
21
+ "aria-invalid"
22
+ ]);
23
+ };
24
+ }
25
+ });
26
+ //#endregion
27
+ export { _sfc_main as default };
@@ -0,0 +1,15 @@
1
+ //#region src/ui/form/form-control.vue.d.ts
2
+ declare var __VLS_8: {};
3
+ type __VLS_Slots = {} & {
4
+ default?: (props: typeof __VLS_8) => any;
5
+ };
6
+ declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
7
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
8
+ declare const _default: typeof __VLS_export;
9
+ type __VLS_WithSlots<T, S> = T & {
10
+ new (): {
11
+ $slots: S;
12
+ };
13
+ };
14
+ //#endregion
15
+ export { _default as default };