@vireo-ai/trellis-ui 0.1.57 → 0.1.59

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 (78) hide show
  1. package/package.json +2 -1
  2. package/packages/client/src/components/keybinding/styles.css +15 -5
  3. package/packages/client/src/components/tabs/styles.css +9 -1
  4. package/packages/client/src/components/tooltip/styles.css +2 -2
  5. package/packages/client/src/directives/sortable.css +8 -0
  6. package/packages/client/src/runtime/drag-and-drop/resize-handle.css +50 -0
  7. package/packages/client/src/styles/generated/theme-fonts.css +1 -1
  8. package/packages/client/src/styles/generated/theme-palette.css +1 -1
  9. package/packages/client/src/styles/generated/theme-runtime.css +3 -3
  10. package/packages/client/src/styles/generated-sources.css +1 -1
  11. package/packages/client/types/components/keybinding/contract.d.ts +5 -5
  12. package/packages/client/types/components/modal/contract.d.ts +9 -3
  13. package/packages/client/types/motion/recipe.d.ts +2 -2
  14. package/packages/client/types/runtime/drag-and-drop/pdd.d.ts +2 -2
  15. package/packages/server/trellis_ui/static/trellis_ui/assets/css/trellis.css +45 -13
  16. package/packages/server/trellis_ui/static/trellis_ui/assets/css/trellis.min.css +1 -1
  17. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/build-metadata.json +277 -277
  18. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/capabilities/motion.js +1 -1
  19. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/capabilities/sortable.js +1 -1
  20. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{capability-motion-BGVnZE_T.js → capability-motion-D_BJBnwB.js} +2 -2
  21. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{capability-motion-BGVnZE_T.js.map → capability-motion-D_BJBnwB.js.map} +1 -1
  22. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/capability-sortable-BDbURlVO.js +5 -0
  23. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/capability-sortable-BDbURlVO.js.map +1 -0
  24. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/controller-C8xqwkr0.js +2 -0
  25. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/controller-C8xqwkr0.js.map +1 -0
  26. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-DYQxGle9.js → entry.generated-18lXAVBg.js} +2 -2
  27. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-DYQxGle9.js.map → entry.generated-18lXAVBg.js.map} +1 -1
  28. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-C_ObpRjR.js → entry.generated-2YvnuzOD.js} +2 -2
  29. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-C_ObpRjR.js.map → entry.generated-2YvnuzOD.js.map} +1 -1
  30. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-z3EbXrD0.js → entry.generated-BITa8xFV.js} +2 -2
  31. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-z3EbXrD0.js.map → entry.generated-BITa8xFV.js.map} +1 -1
  32. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-D_jeOgRf.js → entry.generated-BSVJpGWu.js} +2 -2
  33. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-D_jeOgRf.js.map → entry.generated-BSVJpGWu.js.map} +1 -1
  34. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-BgGSoQFS.js +2 -0
  35. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-BgGSoQFS.js.map +1 -0
  36. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-COp9wMCd.js → entry.generated-Bp3Npe3t.js} +2 -2
  37. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-COp9wMCd.js.map → entry.generated-Bp3Npe3t.js.map} +1 -1
  38. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-CVOYoh61.js → entry.generated-Ce_fpT15.js} +2 -2
  39. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-CVOYoh61.js.map → entry.generated-Ce_fpT15.js.map} +1 -1
  40. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-Cb-VMAE1.js → entry.generated-DDrayI_M.js} +2 -2
  41. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-Cb-VMAE1.js.map → entry.generated-DDrayI_M.js.map} +1 -1
  42. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-DaXIKPN9.js → entry.generated-HqE8R7N1.js} +2 -2
  43. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-DaXIKPN9.js.map → entry.generated-HqE8R7N1.js.map} +1 -1
  44. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-BREj4oHG.js → entry.generated-OT_bt7F2.js} +2 -2
  45. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-BREj4oHG.js.map → entry.generated-OT_bt7F2.js.map} +1 -1
  46. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-BAghaHV-.js → entry.generated-WRveW7p9.js} +2 -2
  47. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-BAghaHV-.js.map → entry.generated-WRveW7p9.js.map} +1 -1
  48. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-D6ai6meC.js → entry.generated-dcqwycC7.js} +2 -2
  49. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-D6ai6meC.js.map → entry.generated-dcqwycC7.js.map} +1 -1
  50. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{flip-Bzn312Nc.js → flip-crNQSZEa.js} +2 -2
  51. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{flip-Bzn312Nc.js.map → flip-crNQSZEa.js.map} +1 -1
  52. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{motion-DI5H1Js0.js → motion-B90yNOaV.js} +2 -2
  53. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/motion-B90yNOaV.js.map +1 -0
  54. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/pdd-BG5sXFGF.js.map +1 -1
  55. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/accordion.js +1 -1
  56. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/data-grid.js +1 -1
  57. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/date-picker.js +1 -1
  58. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/dropdown.js +1 -1
  59. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/index.js +1 -1
  60. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/keybinding.js +1 -1
  61. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/modal.js +1 -1
  62. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/panels.js +1 -1
  63. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/select.js +1 -1
  64. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/sidebar.js +1 -1
  65. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/tabs.js +1 -1
  66. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/toast.js +1 -1
  67. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/tooltip.js +1 -1
  68. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/index.js +1 -1
  69. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/logical-entry-manifest.json +77 -77
  70. package/packages/server/trellis_ui/static/trellis_ui/assets/js/trellis.js +7 -7
  71. package/packages/server/trellis_ui/static/trellis_ui/assets/js/trellis.min.js +7 -7
  72. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/capability-sortable-ehmPfdn1.js +0 -5
  73. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/capability-sortable-ehmPfdn1.js.map +0 -1
  74. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/controller-CalXJ5hB.js +0 -2
  75. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/controller-CalXJ5hB.js.map +0 -1
  76. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-DqL-zI7j.js +0 -2
  77. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-DqL-zI7j.js.map +0 -1
  78. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/motion-DI5H1Js0.js.map +0 -1
@@ -1,2 +0,0 @@
1
- import{n as e,t}from"./styles-CX2j92ex.js";import{i as n,r}from"./capability-shortcut-DZUQHJ3A.js";var i=t({definition:{component:`ui.keybinding`,parts:{root:{base:`inline-flex shrink-0 items-center gap-1 whitespace-nowrap text-inherit`,variants:{presentation:{keycap:`font-body text-1 [font-weight:var(--font-weight-normal)]`,plain:``}},defaults:{presentation:`keycap`}},key:{base:`inline-flex items-center justify-center bg-transparent text-current`},separator:{base:`[font:inherit] text-current`}}}}),a=t=>{let a=``,o=new Set,s=()=>{t.querySelectorAll(`[data-ui-keybinding-key]`).forEach(e=>{e.toggleAttribute(`data-pressed`,o.has(e.dataset.key??``))})},c=()=>{t.replaceChildren(),r(a).forEach((n,r)=>{if(r>0){let n=t.ownerDocument.createElement(`span`);n.textContent=`then`,n.setAttribute(`data-ui-keybinding-separator`,``),n.className=e({part:i.parts.separator}),t.append(n)}n.forEach(({label:n,token:r})=>{let a=t.ownerDocument.createElement(`kbd`);a.setAttribute(`data-ui-keybinding-key`,``),a.dataset.key=r,a.className=e({part:i.parts.key}),a.textContent=n,t.append(a)})}),t.hidden=t.childElementCount===0,s()};return{setValue(e){let n=typeof e==`string`?e.trim():``;n===a&&t.childElementCount>0||(a=n,c())},destroy:n(t.ownerDocument,e=>{o=e,s()})}};export{i as n,a as t};
2
- //# sourceMappingURL=controller-CalXJ5hB.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"controller-CalXJ5hB.js","names":[],"sources":["../../../../../../../../client/src/components/keybinding/styles.ts","../../../../../../../../client/src/components/keybinding/controller.ts"],"sourcesContent":["import {defineStyles} from '../../runtime';\n\nconst keybindingStyles = defineStyles({definition: {\n component: 'ui.keybinding',\n parts: {\n root: {\n base: 'inline-flex shrink-0 items-center gap-1 whitespace-nowrap text-inherit',\n variants: {\n presentation: {\n keycap: 'font-body text-1 [font-weight:var(--font-weight-normal)]',\n plain: '',\n },\n },\n defaults: {presentation: 'keycap'},\n },\n key: {\n base: 'inline-flex items-center justify-center bg-transparent text-current',\n },\n separator: {\n base: '[font:inherit] text-current',\n },\n },\n}});\n\nexport {keybindingStyles};\n","import {formatShortcutKeys, observePressedShortcutKeys} from '@client/capabilities/shortcut';\nimport {resolveStyle} from '@client/runtime/styles';\nimport {keybindingStyles} from './styles';\n\ntype KeybindingController = {\n setValue(value: unknown): void;\n destroy(): void;\n};\n\nconst createKeybindingController = (root: HTMLElement): KeybindingController => {\n let value = '';\n let pressedKeys: ReadonlySet<string> = new Set();\n\n const syncPressed = (): void => {\n root.querySelectorAll<HTMLElement>('[data-ui-keybinding-key]').forEach((key) => {\n key.toggleAttribute('data-pressed', pressedKeys.has(key.dataset.key ?? ''));\n });\n };\n const render = (): void => {\n root.replaceChildren();\n formatShortcutKeys(value).forEach((step, index) => {\n if (index > 0) {\n const separator = root.ownerDocument.createElement('span');\n separator.textContent = 'then';\n separator.setAttribute('data-ui-keybinding-separator', '');\n separator.className = resolveStyle({part: keybindingStyles.parts.separator});\n root.append(separator);\n }\n step.forEach(({label, token}) => {\n const key = root.ownerDocument.createElement('kbd');\n key.setAttribute('data-ui-keybinding-key', '');\n key.dataset.key = token;\n key.className = resolveStyle({part: keybindingStyles.parts.key});\n key.textContent = label;\n root.append(key);\n });\n });\n root.hidden = root.childElementCount === 0;\n syncPressed();\n };\n const stopObserving = observePressedShortcutKeys(root.ownerDocument, (keys) => {\n pressedKeys = keys;\n syncPressed();\n });\n\n return {\n setValue(nextValue): void {\n const next = typeof nextValue === 'string' ? nextValue.trim() : '';\n if (next === value && root.childElementCount > 0) return;\n value = next;\n render();\n },\n destroy: stopObserving,\n };\n};\n\nexport {createKeybindingController};\nexport type {KeybindingController};\n"],"mappings":"mGAEA,IAAM,EAAmB,EAAa,CAAC,WAAY,CAC/C,UAAW,gBACX,MAAO,CACH,KAAM,CACF,KAAM,yEACN,SAAU,CACN,aAAc,CACV,OAAQ,2DACR,MAAO,EACX,CACJ,EACA,SAAU,CAAC,aAAc,QAAQ,CACrC,EACA,IAAK,CACD,KAAM,qEACV,EACA,UAAW,CACP,KAAM,6BACV,CACJ,CACJ,CAAC,CAAC,ECbI,EAA8B,GAA4C,CAC5E,IAAI,EAAQ,GACR,EAAmC,IAAI,IAErC,MAA0B,CAC5B,EAAK,iBAA8B,0BAA0B,CAAC,CAAC,QAAS,GAAQ,CAC5E,EAAI,gBAAgB,eAAgB,EAAY,IAAI,EAAI,QAAQ,KAAO,EAAE,CAAC,CAC9E,CAAC,CACL,EACM,MAAqB,CACvB,EAAK,gBAAgB,EACrB,EAAmB,CAAK,CAAC,CAAC,SAAS,EAAM,IAAU,CAC/C,GAAI,EAAQ,EAAG,CACX,IAAM,EAAY,EAAK,cAAc,cAAc,MAAM,EACzD,EAAU,YAAc,OACxB,EAAU,aAAa,+BAAgC,EAAE,EACzD,EAAU,UAAY,EAAa,CAAC,KAAM,EAAiB,MAAM,SAAS,CAAC,EAC3E,EAAK,OAAO,CAAS,CACzB,CACA,EAAK,SAAS,CAAC,QAAO,WAAW,CAC7B,IAAM,EAAM,EAAK,cAAc,cAAc,KAAK,EAClD,EAAI,aAAa,yBAA0B,EAAE,EAC7C,EAAI,QAAQ,IAAM,EAClB,EAAI,UAAY,EAAa,CAAC,KAAM,EAAiB,MAAM,GAAG,CAAC,EAC/D,EAAI,YAAc,EAClB,EAAK,OAAO,CAAG,CACnB,CAAC,CACL,CAAC,EACD,EAAK,OAAS,EAAK,oBAAsB,EACzC,EAAY,CAChB,EAMA,MAAO,CACH,SAAS,EAAiB,CACtB,IAAM,EAAO,OAAO,GAAc,SAAW,EAAU,KAAK,EAAI,GAC5D,IAAS,GAAS,EAAK,kBAAoB,IAC/C,EAAQ,EACR,EAAO,EACX,EACA,QAZkB,EAA2B,EAAK,cAAgB,GAAS,CAC3E,EAAc,EACd,EAAY,CAChB,CASa,CACb,CACJ"}
@@ -1,2 +0,0 @@
1
- import{r as e,t}from"./dom-DiTFTWeR.js";import{r as n,t as r}from"./capability-motion-BGVnZE_T.js";import{n as i}from"./morph-Cq3V_23_.js";import{f as a,l as o,n as s,o as c,u as l}from"./codecs-CQ7olTJL.js";import{i as u,t as ee}from"./alpine-machine-CE2UN4Qu.js";import{r as d,t as f}from"./focus-pk_lz9sg.js";import{t as te}from"./cleanup-manager-D9QiZF_Q.js";import{n as p,t as m}from"./alpine-data-Dvc_bXq6.js";import{n as h,t as g}from"./styles-CX2j92ex.js";import{t as _}from"./merge-bindings-BtqW3UgP.js";import{t as v}from"./machine-CNnHDbyo.js";import{t as y}from"./dismissable-layer-BROE-Ln2.js";import{i as ne,t as b}from"./focus-scope-BrYxsrhc.js";import{t as re}from"./scroll-lock-C5dQtr4Y.js";import{d as x,g as S,u as C,z as w}from"./common-CBK89mIt.js";import{t as T}from"./controlled-open-Hy4-OT-6.js";var E=[`modal`,`sheet`],D=C,O=[`sm`,`md`,`lg`,`xl`,`full`],k=w,A=x,j=S,M={name:a,open:s,mode:o(E,`modal`),side:o(D,`right`),size:o(O,`md`),surface:o(k,`1`),elevation:o(A,`5`),dismissible:s.default(!0),closable:s.default(!0),disabled:s,initialFocus:a,finalFocus:a,label:a,descriptionId:a,panelClass:a,overlayClass:a,class:a},N={name:a,disabled:s,class:a};a.default(`ui-modal-root`),o(j,`h2`),a.default(`Close`);var ie=[u({name:`opening`,state:`opening`,project:()=>({}),onDone:`OPENING_DONE`,onError:`OPENING_ERROR`}),u({name:`closing`,state:`closing`,project:()=>({}),onDone:`CLOSING_DONE`,onError:`CLOSING_ERROR`})],P=T(),ae=({props:e,effects:t})=>v({initial:`closed`,states:{closed:{tags:[`closed`],on:{OPEN:{target:`opening`,guard:`canOpen`,effects:`prepareOpen`},PROPS_CHANGED:[{target:`opening`,guard:P.shouldOpen,reduce:`replaceProps`,effects:[`syncProps`,`prepareOpen`]},{reduce:`replaceProps`,effects:`syncProps`}]}},opening:{tags:[`visible`,`interactive`,`transitioning`],on:{OPENING_DONE:{target:`open`,effects:`finishOpen`},OPENING_ERROR:{target:`open`,effects:`finishOpen`},CLOSE:{target:`closing`,effects:`prepareClose`},CANCEL:{target:`closing`,guard:`canDismiss`,effects:[`emitCancel`,`prepareClose`]},PROPS_CHANGED:[{target:`closing`,guard:P.shouldClose,reduce:`replaceProps`,effects:[`syncProps`,`prepareClose`]},{reduce:`replaceProps`,effects:`syncProps`}]}},open:{tags:[`visible`,`interactive`,`open`],on:{CLOSE:{target:`closing`,effects:`prepareClose`},CANCEL:{target:`closing`,guard:`canDismiss`,effects:[`emitCancel`,`prepareClose`]},PROPS_CHANGED:[{target:`closing`,guard:P.shouldClose,reduce:`replaceProps`,effects:[`syncProps`,`prepareClose`]},{reduce:`replaceProps`,effects:`syncProps`}]}},closing:{tags:[`visible`,`transitioning`],on:{CLOSING_DONE:{target:`closed`,effects:`finishClose`},CLOSING_ERROR:{target:`closed`,effects:`finishClose`},OPEN:{target:`opening`,guard:`canOpen`,effects:`prepareOpen`},PROPS_CHANGED:[{target:`opening`,guard:P.shouldOpen,reduce:`replaceProps`,effects:[`syncProps`,`prepareOpen`]},{reduce:`replaceProps`,effects:`syncProps`}]}}}},{context:{},props:e,reducers:{replaceProps:P.replace},guards:{canOpen:({props:e})=>!e.disabled,canDismiss:({props:e})=>e.dismissible},effects:{prepareOpen:t.prepareOpen,finishOpen:t.finishOpen,prepareClose:t.prepareClose,finishClose:t.finishClose,syncProps:t.syncProps,emitCancel:({event:e})=>{(e.reason===`escape`||e.reason===`outside`)&&t.emitCancel(e.reason)}}}),F=[`grid-rows-[auto_auto_minmax(0,1fr)_auto]`,`[&>[data-ui-modal-body]]:-mx-1 [&>[data-ui-modal-body]]:min-h-0 [&>[data-ui-modal-body]]:content-start`,`[&>[data-ui-modal-body]]:overflow-x-hidden [&>[data-ui-modal-body]]:overflow-y-auto [&>[data-ui-modal-body]]:px-1`,`[&>[data-ui-modal-footer]]:self-end`],I=g({definition:{component:`ui.modal`,parts:{instance:{base:`contents`},root:{base:[`fixed inset-0 z-dialog m-0 h-auto max-h-none w-auto max-w-none overflow-visible border-0 bg-transparent p-0 text-surface-ink`,`backdrop:bg-transparent`]},viewport:{base:`fixed inset-0 z-dialog flex min-h-dvh`,variants:{mode:{modal:`items-center justify-center overflow-y-auto p-4`,sheet:``},side:{top:``,right:``,bottom:``,left:``}},compounds:[{when:{mode:`sheet`,side:`top`},class:`items-start justify-center`},{when:{mode:`sheet`,side:`right`},class:`items-center justify-end overflow-hidden`},{when:{mode:`sheet`,side:`bottom`},class:`items-end justify-center`},{when:{mode:`sheet`,side:`left`},class:`items-center justify-start overflow-hidden`}],defaults:{mode:`modal`,side:`right`}},overlay:{base:`fixed inset-0 bg-scrim`},panel:{base:[`relative z-dialog grid w-full min-w-0 gap-4 overflow-auto p-5 outline-none`,`max-h-full`],variants:{mode:{modal:`rounded-overlay-md`,sheet:``},side:{top:``,right:``,bottom:``,left:``},size:{sm:`max-w-modal-sm`,md:`max-w-modal-md`,lg:`max-w-modal-lg`,xl:`max-w-modal-xl`,full:`max-w-full`}},compounds:[{when:{mode:`sheet`,side:`right`},class:[`min-h-dvh rounded-l-overlay-md`,F]},{when:{mode:`sheet`,side:`left`},class:[`min-h-dvh rounded-r-overlay-md`,F]},{when:{mode:`sheet`,side:`top`},class:`max-w-full rounded-b-overlay-md`},{when:{mode:`sheet`,side:`bottom`},class:`max-w-full rounded-t-overlay-md`}],defaults:{mode:`modal`,side:`right`,size:`md`}},trigger:{base:`contents`},outlet:{base:``},title:{base:`pr-8`},description:{base:`-mt-3 pr-8 text-surface-ink-muted`},body:{base:`grid min-w-0 gap-3 text-sm`},footer:{base:`flex min-w-0 items-center justify-end gap-2 pt-1`},close:{base:[`absolute right-3 top-3 inline-flex size-control-md items-center justify-center rounded-full border border-transparent text-surface-ink-muted outline-none`,`hover:bg-interaction-hover focus-visible:ui-focus-ring`]},closeIcon:{base:`size-icon fill-current`}}}}),L=new Set,R=new Set,z=e=>e?`open`:`closed`,B=e=>e===`opening`||e===`open`,V=e=>Array.from(L).find(t=>t.name===e)??null,H=(e,t)=>{e.setAttribute(`data-state`,z(t)),e.setAttribute(`aria-expanded`,t?`true`:`false`)},U=r=>{let a=null,o=``,s=null,c=null,u=!1,p=null,g=!1,v,x=null,S=null,C=null,w=()=>{if(!a)throw Error(`Modal has not been initialized.`);return a},T=()=>{let e=w().querySelector(`[data-ui-modal]`);if(!(e instanceof HTMLDialogElement))throw Error(`Modal requires a dialog element.`);return e},E=()=>{let e=w().querySelector(`[data-ui-modal-viewport]`);if(!e)throw Error(`Modal requires a viewport element.`);return e},D=()=>{let e=w().querySelector(`[data-ui-modal-overlay]`);if(!e)throw Error(`Modal requires an overlay element.`);return e},O=()=>{let e=w().querySelector(`[data-ui-modal-panel]`);if(!e)throw Error(`Modal requires a panel element.`);return e},k=()=>w().querySelector(`[data-ui-modal-title]`),A=()=>w().querySelector(`[data-ui-modal-description]`),j=()=>{let e=F();T().className=h({part:I.parts.root,props:e,className:e.class}),E().className=h({part:I.parts.viewport,props:e}),D().className=h({part:I.parts.overlay,props:e,className:e.overlayClass}),O().className=h({part:I.parts.panel,props:e,className:e.panelClass})},N=()=>{let e=F(),t=S===e.mode&&e.open&&T().open&&Y.matches(`open`);C?.update(j,{animate:t,key:`${e.mode}:${e.size}`}),S=e.mode},P=()=>Array.from(w().children).find(e=>e instanceof HTMLElement&&e.matches(`[data-ui-modal-trigger]`))??null,F=()=>Y.getCommittedSnapshot().props,V=()=>Y.matches(`opening`)||Y.matches(`open`),U=(e,t)=>{if(H(e,V()),e.setAttribute(`aria-controls`,o),e.setAttribute(`data-ui-modal-trigger-target`,o),t||F().disabled){e.setAttribute(`aria-disabled`,`true`),e.setAttribute(`data-disabled`,``),e instanceof HTMLButtonElement&&(e.disabled=!0),d(e)||(e.tabIndex=-1);return}e.removeAttribute(`aria-disabled`),e.removeAttribute(`data-disabled`),e instanceof HTMLButtonElement&&(e.disabled=!1),d(e)||(e.tabIndex=0)},W=()=>{let e=P();e&&U(b(e),F().disabled),R.forEach(e=>e.sync())},G=()=>{let e=F(),t=T(),n=O(),r=k(),i=A();t.id=o,t.setAttribute(`role`,`dialog`),t.setAttribute(`aria-modal`,`true`),n.id||=`${o}-panel`,n.tabIndex=-1,r?(r.id||=`${o}-title`,t.setAttribute(`aria-labelledby`,r.id),t.removeAttribute(`aria-label`)):(t.removeAttribute(`aria-labelledby`),e.label?t.setAttribute(`aria-label`,e.label):t.removeAttribute(`aria-label`)),i&&(i.id||=`${o}-description`),e.descriptionId===`none`?t.removeAttribute(`aria-describedby`):e.descriptionId?t.setAttribute(`aria-describedby`,e.descriptionId):i?t.setAttribute(`aria-describedby`,i.id):t.removeAttribute(`aria-describedby`)},K=({syncOpen:e=!0}={})=>{let t=V(),n=z(t);e&&l({el:w(),schema:M,key:`open`,value:t}),[T(),E(),D(),O()].forEach(e=>{e.setAttribute(`data-state`,n)}),W()},q=e=>{if(e.trim())try{return r.evaluate(w(),e)}catch{return}},oe=()=>{let e=q(F().initialFocus);if(e===!1){let e=T().ownerDocument.activeElement;e instanceof HTMLElement&&T().contains(e)&&e.blur();return}if(e instanceof HTMLElement&&f(e,{showIndicator:!1}))return;let t=O().querySelector(`[autofocus]`);f(t,{showIndicator:!1})||f(O(),{showIndicator:!1})},se=()=>{let e=q(F().finalFocus);if(e===!1)return!1;if(e instanceof HTMLElement&&f(e,{showIndicator:!1})||f(s??c,{showIndicator:!1}))return!0;let t=w().parentElement?.closest(`[data-ui-modal-panel]`)??null;return f(t,{showIndicator:!1})},J=()=>{let e=T().ownerDocument.body,t=e.getAttribute(`tabindex`);e.tabIndex=-1,f(e,{showIndicator:!1}),t===null?e.removeAttribute(`tabindex`):e.setAttribute(`tabindex`,t)},ce=()=>{C?.refresh({animate:!1});let e=T(),t=e.ownerDocument.activeElement;c=t instanceof HTMLElement?t:null,typeof e.showModal==`function`&&!u?(e.open&&e.removeAttribute(`open`),e.showModal(),u=!0):e.open||e.setAttribute(`open`,``),p??=re(e.ownerDocument),G(),K(),queueMicrotask(oe)},le=()=>{C?.refresh({animate:!1});let t=O();t.style.removeProperty(`transform`),t.style.removeProperty(`translate`),t.style.removeProperty(`scale`),t.style.removeProperty(`rotate`),S=F().mode,K(),e({el:T(),name:`ui:open`})},ue=()=>{C?.refresh({animate:!1}),K()},de=()=>{C?.refresh({animate:!1});let t=T(),n=t.ownerDocument.activeElement;n instanceof HTMLElement&&t.contains(n)&&n.blur(),t.open&&t.close(),u=!1,p?.(),p=null,K(),S=null;let r=se(),i=t.ownerDocument.activeElement;i instanceof HTMLElement&&(t.contains(i)||!r&&(i===s||i===c))&&J(),queueMicrotask(()=>{let e=t.ownerDocument.activeElement;e instanceof HTMLElement&&t.contains(e)&&J()}),s=null,c=null,e({el:t,name:`ui:close`})},fe=()=>{N(),G(),W()},Y=ee({schema:M,hooks:ie,createMachine:({props:t})=>ae({props:t,effects:{prepareOpen:ce,finishOpen:le,prepareClose:ue,finishClose:de,syncProps:fe,emitCancel:t=>{e({el:T(),name:`ui:cancel`,detail:{reason:t}})}}})}),X=e=>{F().disabled||(s=e,Y.send(`OPEN`))},Z=(e,t)=>{t?.preventDefault(),Y.send({type:`CANCEL`,reason:e})},pe=()=>{x?.run(),x=null},me=e=>{let n=b(e);pe(),x=new te,v.addChild(x),U(n,F().disabled),t({target:n,event:`click`,handler:()=>X(n),cleanup:x}),t({target:n,event:`keydown`,handler:e=>{e instanceof KeyboardEvent&&(n instanceof HTMLButtonElement||n instanceof HTMLAnchorElement||(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),X(n)))},cleanup:x})},he=()=>{let e=T(),t=e.querySelector(`[data-ui-modal-trigger]`);t&&!t.dataset.name&&(w().insertBefore(t,e),me(t))},ge=()=>{let e=T();t({target:e,event:`cancel`,handler:t=>{t.target===e&&Z(`escape`,t)},cleanup:v}),t({target:e,event:`close`,handler:()=>{Y.hasTag(`visible`)&&Y.send(`CLOSE`)},cleanup:v}),t({target:e,event:`keydown`,handler:e=>{e instanceof KeyboardEvent&&Y.hasTag(`interactive`)&&ne(e,O())},cleanup:v}),t({target:e,event:`click`,handler:t=>{let n=t.target;if(!(n instanceof Element))return;let r=n.closest(`[data-ui-modal-close]`);r&&r.closest(`[data-ui-modal]`)===e&&(t.preventDefault(),Y.send(`CLOSE`))},cleanup:v}),t({target:document,event:`ui:modal-close`,handler:e=>{let t=e.detail;t?.name&&t.name===F().name&&Y.send(`CLOSE`)},cleanup:v}),v.add(y({isEnabled:()=>Y.hasTag(`interactive`),roots:()=>[O(),s,P()],onDismiss:e=>Z(`outside`,e)}))},Q,$={get name(){return F().name},get isOpen(){return Y.matches(`open`)},get dialogId(){return o},openFrom:X,close(e){e?.preventDefault(),Y.send(`CLOSE`)},syncExternalTrigger:U};return Q={...Y,get name(){return this.snapshot.current?.props.name??``},get isOpen(){return this.snapshot.current?.value===`open`},get isVisible(){return this.snapshot.current?.tags.includes(`visible`)??!1},get dialogId(){return o},init(){v=m(this),a=this.$el,Y.connect(this.$el,this.snapshot);let e=F();j(),C=n(O(),{properties:[`height`,`maxWidth`]}),o=T().id||this.$id(`modal${e.name?`-${e.name}`:``}`),i(T(),`open`),G(),L.add($),g=!0,he(),ge(),K({syncOpen:!1}),e.open&&queueMicrotask(()=>Y.send(`OPEN`))},destroy(){C?.destroy(),C=null,x=null,g&&=(L.delete($),!1),Y.disconnect();let e=a?.querySelector(`[data-ui-modal]`);e?.open&&e.close(),p?.(),p=null,R.forEach(e=>e.sync()),a=null},get root(){return _({inputs:[h({part:I.parts.instance,props:{},className:``}),{"data-ui-modal-instance":``}]})},get dialog(){let e=this.snapshot,t=e.current?.props??F();return _({inputs:[h({part:I.parts.root,props:t,className:t.class}),{id:o,role:`dialog`,"aria-modal":`true`,":data-state":()=>z(B(e.current?.value)),":data-mode":()=>e.current?.props.mode,":data-side":()=>e.current?.props.side,":data-size":()=>e.current?.props.size}]})},get viewport(){let e=this.snapshot,t=e.current?.props??F();return _({inputs:[h({part:I.parts.viewport,props:t}),{":data-state":()=>z(B(e.current?.value)),":data-mode":()=>e.current?.props.mode,":data-side":()=>e.current?.props.side}]})},get overlay(){let e=this.snapshot,t=e.current?.props??F();return _({inputs:[h({part:I.parts.overlay,props:t,className:t.overlayClass}),{":data-state":()=>z(B(e.current?.value))}]})},get panel(){let e=this.snapshot,t=e.current?.props??F();return _({inputs:[h({part:I.parts.panel,props:t,className:t.panelClass}),{tabindex:-1,":data-state":()=>z(B(e.current?.value)),":data-mode":()=>e.current?.props.mode,":data-side":()=>e.current?.props.side,":data-size":()=>e.current?.props.size,":data-ui-surface":()=>e.current?.props.surface,":data-ui-elevation":()=>e.current?.props.elevation}]})},open(e){if(e?.preventDefault(),F().disabled)return;let t=P();t&&(s=b(t)),Y.send(`OPEN`)},close(e){e?.preventDefault(),Y.send(`CLOSE`)}},Q},W=()=>{let e=null,n=null,r,i=!1,a=()=>{if(!e)throw Error(`Modal trigger has not been initialized.`);return e},o=()=>{if(!n)throw Error(`Modal trigger has not been initialized.`);return n},s=()=>{let e=a().name;return e?V(e):null},l=()=>{let e=a(),t=o(),n=s();if(n){n.syncExternalTrigger(t,e.disabled);return}H(t,!1),e.disabled?(t.setAttribute(`aria-disabled`,`true`),t.setAttribute(`data-disabled`,``)):(t.removeAttribute(`aria-disabled`),t.removeAttribute(`data-disabled`))},u={get name(){return a().name},get target(){return o()},sync:l};return{init(){r=m(this),e=c({el:this.$el,schema:N,onChange:()=>{e?.name&&l()}}),n=b(this.$el),e.name&&(R.add(u),i=!0,l(),t({target:n,event:`click`,handler:e=>this.open(e),cleanup:r}),t({target:n,event:`keydown`,handler:e=>{e instanceof KeyboardEvent&&(n instanceof HTMLButtonElement||n instanceof HTMLAnchorElement||(e.key===`Enter`||e.key===` `)&&this.open(e))},cleanup:r}))},destroy(){e?.disconnect(),i&&R.delete(u),i=!1,e=null,n=null},get root(){let t=a();return _({inputs:[h({part:I.parts.trigger,props:{},className:t.class}),{"data-ui-modal-trigger":``,":data-name":()=>e?.name||void 0,":data-disabled":()=>e?.disabled?``:void 0}]})},open(e){e?.preventDefault(),!a().disabled&&s()?.openFrom(o())}}},G=e=>{p(`UiModal`,()=>U(e))(e),p(`UiModalTrigger`,W)(e)},K=new WeakSet,q=e=>{K.has(e)||(K.add(e),r(e),G(e))};export{U as n,W as r,q as t};
2
- //# sourceMappingURL=entry.generated-DqL-zI7j.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"entry.generated-DqL-zI7j.js","names":[],"sources":["../../../../../../../../client/src/components/modal/contract.ts","../../../../../../../../client/src/components/modal/machine.ts","../../../../../../../../client/src/components/modal/styles.ts","../../../../../../../../client/src/components/modal/index.ts","../../../../../../../../client/src/components/modal/entry.generated.ts"],"sourcesContent":["import {bool, oneOf, string, type PropState, type SchemaToProps} from '../../runtime';\nimport {\n EDGE_POSITIONS,\n ELEVATION_REFERENCES,\n HEADING_LEVELS,\n SURFACE_REFERENCES,\n type EdgePosition,\n type ElevationReference,\n type HeadingLevel,\n type SurfaceReference,\n} from '../common';\n\nconst MODAL_MODES = ['modal', 'sheet'] as const;\nconst MODAL_SIDES = EDGE_POSITIONS;\nconst MODAL_SIZES = ['sm', 'md', 'lg', 'xl', 'full'] as const;\nconst MODAL_SURFACES = SURFACE_REFERENCES;\nconst MODAL_ELEVATIONS = ELEVATION_REFERENCES;\nconst MODAL_TITLE_AS_VALUES = HEADING_LEVELS;\n\ntype ModalMode = typeof MODAL_MODES[number];\ntype ModalSide = EdgePosition;\ntype ModalSize = typeof MODAL_SIZES[number];\ntype ModalSurface = SurfaceReference;\ntype ModalElevation = ElevationReference;\ntype ModalTitleAs = HeadingLevel;\n\nconst modalSchema = {\n name: string,\n open: bool,\n mode: oneOf(MODAL_MODES, 'modal'),\n side: oneOf(MODAL_SIDES, 'right'),\n size: oneOf(MODAL_SIZES, 'md'),\n surface: oneOf(MODAL_SURFACES, '1' as ModalSurface),\n elevation: oneOf(MODAL_ELEVATIONS, '5' as ModalElevation),\n dismissible: bool.default(true),\n closable: bool.default(true),\n disabled: bool,\n initialFocus: string,\n finalFocus: string,\n label: string,\n descriptionId: string,\n panelClass: string,\n overlayClass: string,\n class: string,\n};\n\nconst modalTriggerSchema = {\n name: string,\n disabled: bool,\n class: string,\n};\n\nconst modalOutletSchema = {\n id: string.default('ui-modal-root'),\n class: string,\n};\n\nconst modalTitleSchema = {\n as: oneOf(MODAL_TITLE_AS_VALUES, 'h2'),\n class: string,\n};\n\nconst modalDescriptionSchema = {\n class: string,\n};\n\nconst modalBodySchema = {\n class: string,\n};\n\nconst modalFooterSchema = {\n class: string,\n};\n\nconst modalCloseSchema = {\n label: string.default('Close'),\n class: string,\n};\n\ntype ModalProps = SchemaToProps<typeof modalSchema>;\ntype ModalTriggerProps = PropState<typeof modalTriggerSchema>;\n\nexport {\n MODAL_SIDES,\n MODAL_SIZES,\n MODAL_ELEVATIONS,\n MODAL_SURFACES,\n MODAL_TITLE_AS_VALUES,\n MODAL_MODES,\n modalBodySchema,\n modalCloseSchema,\n modalDescriptionSchema,\n modalFooterSchema,\n modalOutletSchema,\n modalSchema,\n modalTitleSchema,\n modalTriggerSchema,\n};\nexport type {\n ModalSide,\n ModalProps,\n ModalSize,\n ModalSurface,\n ModalElevation,\n ModalTitleAs,\n ModalTriggerProps,\n ModalMode,\n};\n","import {\n createMachine,\n type Machine,\n} from '../../runtime/state-machine';\nimport {defineHook, type TransitionHookDefinition} from '../../runtime/transition-coordinator';\nimport {defineControlledOpenProps} from '../shared/controlled-open';\nimport type {ModalProps} from './contract';\n\ntype ModalContext = Record<string, never>;\n\ntype ModalMachineEffects = {\n prepareOpen(): void;\n finishOpen(): void;\n prepareClose(): void;\n finishClose(): void;\n syncProps(): void;\n emitCancel(reason: 'escape' | 'outside'): void;\n};\n\ntype CreateModalMachineOptions = {\n props: ModalProps;\n effects: ModalMachineEffects;\n};\n\nconst openingHook = defineHook({\n name: 'opening',\n state: 'opening',\n project: () => ({}),\n onDone: 'OPENING_DONE',\n onError: 'OPENING_ERROR',\n} satisfies TransitionHookDefinition<ModalContext, ModalProps, Record<string, never>, 'opening'>);\n\nconst closingHook = defineHook({\n name: 'closing',\n state: 'closing',\n project: () => ({}),\n onDone: 'CLOSING_DONE',\n onError: 'CLOSING_ERROR',\n} satisfies TransitionHookDefinition<ModalContext, ModalProps, Record<string, never>, 'closing'>);\n\nconst modalHooks = [openingHook, closingHook] as const;\nconst controlledOpenProps = defineControlledOpenProps<ModalContext, ModalProps>();\n\nconst createModalMachine = ({\n props,\n effects,\n}: CreateModalMachineOptions): Machine<ModalContext, ModalProps> => createMachine<ModalContext, ModalProps>({\n initial: 'closed',\n states: {\n closed: {\n tags: ['closed'],\n on: {\n OPEN: {target: 'opening', guard: 'canOpen', effects: 'prepareOpen'},\n PROPS_CHANGED: [\n {\n target: 'opening',\n guard: controlledOpenProps.shouldOpen,\n reduce: 'replaceProps',\n effects: ['syncProps', 'prepareOpen'],\n },\n {reduce: 'replaceProps', effects: 'syncProps'},\n ],\n },\n },\n opening: {\n tags: ['visible', 'interactive', 'transitioning'],\n on: {\n OPENING_DONE: {target: 'open', effects: 'finishOpen'},\n OPENING_ERROR: {target: 'open', effects: 'finishOpen'},\n CLOSE: {target: 'closing', effects: 'prepareClose'},\n CANCEL: {target: 'closing', guard: 'canDismiss', effects: ['emitCancel', 'prepareClose']},\n PROPS_CHANGED: [\n {\n target: 'closing',\n guard: controlledOpenProps.shouldClose,\n reduce: 'replaceProps',\n effects: ['syncProps', 'prepareClose'],\n },\n {reduce: 'replaceProps', effects: 'syncProps'},\n ],\n },\n },\n open: {\n tags: ['visible', 'interactive', 'open'],\n on: {\n CLOSE: {target: 'closing', effects: 'prepareClose'},\n CANCEL: {target: 'closing', guard: 'canDismiss', effects: ['emitCancel', 'prepareClose']},\n PROPS_CHANGED: [\n {\n target: 'closing',\n guard: controlledOpenProps.shouldClose,\n reduce: 'replaceProps',\n effects: ['syncProps', 'prepareClose'],\n },\n {reduce: 'replaceProps', effects: 'syncProps'},\n ],\n },\n },\n closing: {\n tags: ['visible', 'transitioning'],\n on: {\n CLOSING_DONE: {target: 'closed', effects: 'finishClose'},\n CLOSING_ERROR: {target: 'closed', effects: 'finishClose'},\n OPEN: {target: 'opening', guard: 'canOpen', effects: 'prepareOpen'},\n PROPS_CHANGED: [\n {\n target: 'opening',\n guard: controlledOpenProps.shouldOpen,\n reduce: 'replaceProps',\n effects: ['syncProps', 'prepareOpen'],\n },\n {reduce: 'replaceProps', effects: 'syncProps'},\n ],\n },\n },\n },\n}, {\n context: {},\n props,\n reducers: {\n replaceProps: controlledOpenProps.replace,\n },\n guards: {\n canOpen: ({props: currentProps}) => !currentProps.disabled,\n canDismiss: ({props: currentProps}) => currentProps.dismissible,\n },\n effects: {\n prepareOpen: effects.prepareOpen,\n finishOpen: effects.finishOpen,\n prepareClose: effects.prepareClose,\n finishClose: effects.finishClose,\n syncProps: effects.syncProps,\n emitCancel: ({event}) => {\n if (event.reason === 'escape' || event.reason === 'outside') effects.emitCancel(event.reason);\n },\n },\n});\n\nexport {createModalMachine, modalHooks};\nexport type {CreateModalMachineOptions, ModalContext, ModalMachineEffects};\n","import {defineStyles} from '../../runtime';\n\nconst EDGE_PANEL_LAYOUT_CLASSES = [\n 'grid-rows-[auto_auto_minmax(0,1fr)_auto]',\n '[&>[data-ui-modal-body]]:-mx-1 [&>[data-ui-modal-body]]:min-h-0 [&>[data-ui-modal-body]]:content-start',\n '[&>[data-ui-modal-body]]:overflow-x-hidden [&>[data-ui-modal-body]]:overflow-y-auto [&>[data-ui-modal-body]]:px-1',\n '[&>[data-ui-modal-footer]]:self-end',\n] as const;\n\nconst modalStyles = defineStyles({definition: {\n component: 'ui.modal',\n parts: {\n instance: {\n base: 'contents',\n },\n root: {\n base: [\n 'fixed inset-0 z-dialog m-0 h-auto max-h-none w-auto max-w-none overflow-visible border-0 bg-transparent p-0 text-surface-ink',\n 'backdrop:bg-transparent',\n ],\n },\n viewport: {\n base: 'fixed inset-0 z-dialog flex min-h-dvh',\n variants: {\n mode: {\n modal: 'items-center justify-center overflow-y-auto p-4',\n sheet: '',\n },\n side: {\n top: '',\n right: '',\n bottom: '',\n left: '',\n },\n },\n compounds: [\n {when: {mode: 'sheet', side: 'top'}, class: 'items-start justify-center'},\n {when: {mode: 'sheet', side: 'right'}, class: 'items-center justify-end overflow-hidden'},\n {when: {mode: 'sheet', side: 'bottom'}, class: 'items-end justify-center'},\n {when: {mode: 'sheet', side: 'left'}, class: 'items-center justify-start overflow-hidden'},\n ],\n defaults: {\n mode: 'modal',\n side: 'right',\n },\n },\n overlay: {\n base: 'fixed inset-0 bg-scrim',\n },\n panel: {\n base: [\n 'relative z-dialog grid w-full min-w-0 gap-4 overflow-auto p-5 outline-none',\n 'max-h-full',\n ],\n variants: {\n mode: {\n modal: 'rounded-overlay-md',\n sheet: '',\n },\n side: {\n top: '',\n right: '',\n bottom: '',\n left: '',\n },\n size: {\n sm: 'max-w-modal-sm',\n md: 'max-w-modal-md',\n lg: 'max-w-modal-lg',\n xl: 'max-w-modal-xl',\n full: 'max-w-full',\n },\n },\n compounds: [\n {when: {mode: 'sheet', side: 'right'}, class: ['min-h-dvh rounded-l-overlay-md', EDGE_PANEL_LAYOUT_CLASSES]},\n {when: {mode: 'sheet', side: 'left'}, class: ['min-h-dvh rounded-r-overlay-md', EDGE_PANEL_LAYOUT_CLASSES]},\n {when: {mode: 'sheet', side: 'top'}, class: 'max-w-full rounded-b-overlay-md'},\n {when: {mode: 'sheet', side: 'bottom'}, class: 'max-w-full rounded-t-overlay-md'},\n ],\n defaults: {\n mode: 'modal',\n side: 'right',\n size: 'md',\n },\n },\n trigger: {\n base: 'contents',\n },\n outlet: {\n base: '',\n },\n title: {\n base: 'pr-8',\n },\n description: {\n base: '-mt-3 pr-8 text-surface-ink-muted',\n },\n body: {\n base: 'grid min-w-0 gap-3 text-sm',\n },\n footer: {\n base: 'flex min-w-0 items-center justify-end gap-2 pt-1',\n },\n close: {\n base: [\n 'absolute right-3 top-3 inline-flex size-control-md items-center justify-center rounded-full border border-transparent text-surface-ink-muted outline-none',\n 'hover:bg-interaction-hover focus-visible:ui-focus-ring',\n ],\n },\n closeIcon: {\n base: 'size-icon fill-current',\n },\n },\n}});\n\nexport {modalStyles};\n","import type Alpine from 'alpinejs';\nimport {isTabbable} from 'tabbable';\n\nimport {createBoundsMotion, type BoundsMotion} from '@client/motion';\nimport {\n type AlpineMachine,\n createAlpineMachine,\n defineAlpineData,\n reflectSchemaProp,\n type TransitionForHook,\n type TrellisAlpineComponent,\n} from '@client/runtime';\nimport {cleanupManagerFor} from '@client/runtime/alpine-data';\nimport {defineProps} from '@client/runtime/codecs';\nimport {CleanupManager} from '@client/runtime/cleanup-manager';\nimport {addDismissableLayer} from '@client/runtime/dismissable-layer';\nimport {closestTabbable, trapFocus as trapFocusWithin} from '@client/runtime/focus-scope';\nimport {focusElement} from '@client/runtime/focus';\nimport {mergeBindings, type BindingObject} from '@client/runtime/merge-bindings';\nimport {declareMorphAttributes} from '@client/runtime/morph';\nimport {acquireDocumentScrollLock} from '@client/runtime/scroll-lock';\nimport {resolveStyle} from '@client/runtime/styles';\nimport {addListener, dispatch} from '@client/utils';\nimport {\n modalSchema,\n modalTriggerSchema,\n type ModalProps,\n type ModalTriggerProps,\n} from './contract';\nimport {createModalMachine, modalHooks, type ModalContext} from './machine';\nimport {modalStyles} from './styles';\n\ntype ModalTransitionName = (typeof modalHooks)[number]['name'];\ntype ModalTransition<TName extends ModalTransitionName = ModalTransitionName> = TransitionForHook<\n Extract<(typeof modalHooks)[number], {name: TName}>,\n HTMLElement\n>;\n\ntype CancelReason = 'escape' | 'outside';\n\ntype ModalCancelDetail = {\n reason: CancelReason;\n};\n\ntype ModalCloseEventDetail = {\n name?: string;\n};\n\ntype ModalController = {\n readonly name: string;\n readonly isOpen: boolean;\n readonly dialogId: string;\n openFrom(trigger: HTMLElement): void;\n close(event?: Event): void;\n syncExternalTrigger(trigger: HTMLElement, disabled: boolean): void;\n};\n\ntype ModalTriggerController = {\n readonly name: string;\n readonly target: HTMLElement;\n sync(): void;\n};\n\n/**\n * Public Alpine API for `ui.modal`.\n *\n * @public\n */\ninterface UiModalApi {\n /** Whether the modal has completed its opening transition. */\n readonly isOpen: boolean;\n\n /** Whether the modal is opening, open, or closing. */\n readonly isVisible: boolean;\n\n /** Opens the modal unless it is disabled. */\n open(event?: Event): void;\n\n /** Closes the modal. */\n close(event?: Event): void;\n}\n\n/**\n * Public Alpine API for `ui.modal.trigger`.\n *\n * @public\n */\ninterface UiModalTriggerApi {\n /** Opens the named modal unless the trigger or modal is disabled. */\n open(event?: Event): void;\n}\n\ntype ModalData = AlpineMachine<ModalContext, ModalProps, typeof modalHooks> & UiModalApi & {\n readonly name: string;\n readonly dialogId: string;\n readonly root: BindingObject;\n readonly dialog: BindingObject;\n readonly viewport: BindingObject;\n readonly overlay: BindingObject;\n readonly panel: BindingObject;\n init(): void;\n destroy(): void;\n};\n\ntype ModalTriggerData = UiModalTriggerApi & {\n readonly root: BindingObject;\n init(): void;\n destroy(): void;\n};\n\nconst modalControllers = new Set<ModalController>();\nconst modalTriggerControllers = new Set<ModalTriggerController>();\n\nconst stateFor = (open: boolean): 'open' | 'closed' => (open ? 'open' : 'closed');\nconst isExpandedState = (state: unknown): boolean => state === 'opening' || state === 'open';\n\nconst findNamedModal = (name: string): ModalController | null => (\n Array.from(modalControllers).find((controller) => controller.name === name) ?? null\n);\n\nconst setOpenAttributes = (el: HTMLElement, open: boolean): void => {\n el.setAttribute('data-state', stateFor(open));\n el.setAttribute('aria-expanded', open ? 'true' : 'false');\n};\n\nconst UiModal = (AlpineInstance: Alpine.Alpine): TrellisAlpineComponent<ModalData> => {\n let rootEl: (HTMLElement & Alpine.ElementWithXAttributes) | null = null;\n let dialogId = '';\n let activeTrigger: HTMLElement | null = null;\n let previouslyFocused: HTMLElement | null = null;\n let didShowModal = false;\n let releaseScrollLock: (() => void) | null = null;\n let isRegistered = false;\n let cleanup: CleanupManager;\n let localTriggerCleanup: CleanupManager | null = null;\n let settledMode: ModalProps['mode'] | null = null;\n let boundsMotion: BoundsMotion | null = null;\n\n const root = (): HTMLElement => {\n if (!rootEl) throw new Error('Modal has not been initialized.');\n return rootEl;\n };\n\n const dialogEl = (): HTMLDialogElement => {\n const dialog = root().querySelector<HTMLDialogElement>('[data-ui-modal]');\n if (!(dialog instanceof HTMLDialogElement)) throw new Error('Modal requires a dialog element.');\n return dialog;\n };\n\n const viewportEl = (): HTMLElement => {\n const viewport = root().querySelector<HTMLElement>('[data-ui-modal-viewport]');\n if (!viewport) throw new Error('Modal requires a viewport element.');\n return viewport;\n };\n\n const overlayEl = (): HTMLElement => {\n const overlay = root().querySelector<HTMLElement>('[data-ui-modal-overlay]');\n if (!overlay) throw new Error('Modal requires an overlay element.');\n return overlay;\n };\n\n const panelEl = (): HTMLElement => {\n const panel = root().querySelector<HTMLElement>('[data-ui-modal-panel]');\n if (!panel) throw new Error('Modal requires a panel element.');\n return panel;\n };\n\n const titleEl = (): HTMLElement | null => root().querySelector<HTMLElement>('[data-ui-modal-title]');\n const descriptionEl = (): HTMLElement | null => root().querySelector<HTMLElement>('[data-ui-modal-description]');\n\n const syncPresentation = (): void => {\n const props = currentProps();\n dialogEl().className = resolveStyle({part: modalStyles.parts.root, props, className: props.class});\n viewportEl().className = resolveStyle({part: modalStyles.parts.viewport, props});\n overlayEl().className = resolveStyle({\n part: modalStyles.parts.overlay,\n props,\n className: props.overlayClass,\n });\n panelEl().className = resolveStyle({\n part: modalStyles.parts.panel,\n props,\n className: props.panelClass,\n });\n };\n\n const syncPresentationWithBoundsMotion = (): void => {\n const props = currentProps();\n const shouldAnimate = (\n settledMode === props.mode\n && props.open\n && dialogEl().open\n && bridge.matches('open')\n );\n boundsMotion?.update(syncPresentation, {\n animate: shouldAnimate,\n key: `${props.mode}:${props.size}`,\n });\n settledMode = props.mode;\n };\n\n const localTriggerEl = (): HTMLElement | null => (\n Array.from(root().children)\n .find((child) => child instanceof HTMLElement && child.matches('[data-ui-modal-trigger]')) as HTMLElement | undefined\n ?? null\n );\n\n const currentProps = (): Readonly<ModalProps> => bridge.getCommittedSnapshot().props;\n const isExpanded = (): boolean => bridge.matches('opening') || bridge.matches('open');\n\n const syncExternalTrigger = (trigger: HTMLElement, disabled: boolean): void => {\n const expanded = isExpanded();\n setOpenAttributes(trigger, expanded);\n trigger.setAttribute('aria-controls', dialogId);\n trigger.setAttribute('data-ui-modal-trigger-target', dialogId);\n\n if (disabled || currentProps().disabled) {\n trigger.setAttribute('aria-disabled', 'true');\n trigger.setAttribute('data-disabled', '');\n if (trigger instanceof HTMLButtonElement) trigger.disabled = true;\n if (!isTabbable(trigger)) trigger.tabIndex = -1;\n return;\n }\n\n trigger.removeAttribute('aria-disabled');\n trigger.removeAttribute('data-disabled');\n if (trigger instanceof HTMLButtonElement) trigger.disabled = false;\n if (!isTabbable(trigger)) trigger.tabIndex = 0;\n };\n\n const syncTriggers = (): void => {\n const local = localTriggerEl();\n if (local) syncExternalTrigger(closestTabbable(local), currentProps().disabled);\n modalTriggerControllers.forEach((trigger) => trigger.sync());\n };\n\n const syncAccessibility = (): void => {\n const props = currentProps();\n const dialog = dialogEl();\n const panel = panelEl();\n const title = titleEl();\n const description = descriptionEl();\n\n dialog.id = dialogId;\n dialog.setAttribute('role', 'dialog');\n dialog.setAttribute('aria-modal', 'true');\n panel.id ||= `${dialogId}-panel`;\n panel.tabIndex = -1;\n\n if (title) {\n title.id ||= `${dialogId}-title`;\n dialog.setAttribute('aria-labelledby', title.id);\n dialog.removeAttribute('aria-label');\n } else {\n dialog.removeAttribute('aria-labelledby');\n if (props.label) dialog.setAttribute('aria-label', props.label);\n else dialog.removeAttribute('aria-label');\n }\n\n if (description) description.id ||= `${dialogId}-description`;\n if (props.descriptionId === 'none') dialog.removeAttribute('aria-describedby');\n else if (props.descriptionId) dialog.setAttribute('aria-describedby', props.descriptionId);\n else if (description) dialog.setAttribute('aria-describedby', description.id);\n else dialog.removeAttribute('aria-describedby');\n };\n\n const syncStateAttributes = ({syncOpen = true}: {syncOpen?: boolean} = {}): void => {\n const expanded = isExpanded();\n const state = stateFor(expanded);\n if (syncOpen) {\n reflectSchemaProp({el: root(), schema: modalSchema, key: 'open', value: expanded});\n }\n [dialogEl(), viewportEl(), overlayEl(), panelEl()].forEach((element) => {\n element.setAttribute('data-state', state);\n });\n syncTriggers();\n };\n\n const evaluateFocusExpression = (expression: string): unknown => {\n if (!expression.trim()) return undefined;\n try {\n return AlpineInstance.evaluate(root(), expression);\n } catch {\n return undefined;\n }\n };\n\n const focusInitial = (): void => {\n const configured = evaluateFocusExpression(currentProps().initialFocus);\n if (configured === false) {\n const active = dialogEl().ownerDocument.activeElement;\n if (active instanceof HTMLElement && dialogEl().contains(active)) active.blur();\n return;\n }\n if (configured instanceof HTMLElement && focusElement(configured, {showIndicator: false})) return;\n const autofocus = panelEl().querySelector<HTMLElement>('[autofocus]');\n if (focusElement(autofocus, {showIndicator: false})) return;\n focusElement(panelEl(), {showIndicator: false});\n };\n\n const restoreFocus = (): boolean => {\n const configured = evaluateFocusExpression(currentProps().finalFocus);\n if (configured === false) return false;\n if (configured instanceof HTMLElement && focusElement(configured, {showIndicator: false})) return true;\n const target = activeTrigger ?? previouslyFocused;\n if (focusElement(target, {showIndicator: false})) return true;\n const ownerFallback = root().parentElement?.closest<HTMLElement>('[data-ui-modal-panel]') ?? null;\n return focusElement(ownerFallback, {showIndicator: false});\n };\n\n const clearFocus = (): void => {\n const body = dialogEl().ownerDocument.body;\n const tabindex = body.getAttribute('tabindex');\n body.tabIndex = -1;\n focusElement(body, {showIndicator: false});\n if (tabindex === null) body.removeAttribute('tabindex');\n else body.setAttribute('tabindex', tabindex);\n };\n\n const prepareOpen = (): void => {\n boundsMotion?.refresh({animate: false});\n const dialog = dialogEl();\n const active = dialog.ownerDocument.activeElement;\n previouslyFocused = active instanceof HTMLElement ? active : null;\n if (typeof dialog.showModal === 'function' && !didShowModal) {\n if (dialog.open) dialog.removeAttribute('open');\n dialog.showModal();\n didShowModal = true;\n } else if (!dialog.open) {\n dialog.setAttribute('open', '');\n }\n\n releaseScrollLock ??= acquireDocumentScrollLock(dialog.ownerDocument);\n syncAccessibility();\n syncStateAttributes();\n queueMicrotask(focusInitial);\n };\n\n const finishOpen = (): void => {\n boundsMotion?.refresh({animate: false});\n const panel = panelEl();\n panel.style.removeProperty('transform');\n panel.style.removeProperty('translate');\n panel.style.removeProperty('scale');\n panel.style.removeProperty('rotate');\n settledMode = currentProps().mode;\n syncStateAttributes();\n dispatch({el: dialogEl(), name: 'ui:open'});\n };\n\n const prepareClose = (): void => {\n boundsMotion?.refresh({animate: false});\n syncStateAttributes();\n };\n\n const finishClose = (): void => {\n boundsMotion?.refresh({animate: false});\n const dialog = dialogEl();\n const focusedBeforeClose = dialog.ownerDocument.activeElement;\n if (focusedBeforeClose instanceof HTMLElement && dialog.contains(focusedBeforeClose)) {\n focusedBeforeClose.blur();\n }\n if (dialog.open) dialog.close();\n didShowModal = false;\n releaseScrollLock?.();\n releaseScrollLock = null;\n syncStateAttributes();\n settledMode = null;\n const restored = restoreFocus();\n const active = dialog.ownerDocument.activeElement;\n if (\n active instanceof HTMLElement\n && (\n dialog.contains(active)\n || (!restored && (active === activeTrigger || active === previouslyFocused))\n )\n ) clearFocus();\n queueMicrotask(() => {\n const retained = dialog.ownerDocument.activeElement;\n if (retained instanceof HTMLElement && dialog.contains(retained)) clearFocus();\n });\n activeTrigger = null;\n previouslyFocused = null;\n dispatch({el: dialog, name: 'ui:close'});\n };\n\n const syncProps = (): void => {\n syncPresentationWithBoundsMotion();\n syncAccessibility();\n syncTriggers();\n };\n\n const bridge = createAlpineMachine({\n schema: modalSchema,\n hooks: modalHooks,\n createMachine: ({props}) => createModalMachine({\n props,\n effects: {\n prepareOpen,\n finishOpen,\n prepareClose,\n finishClose,\n syncProps,\n emitCancel: (reason) => {\n dispatch<ModalCancelDetail>({el: dialogEl(), name: 'ui:cancel', detail: {reason}});\n },\n },\n }),\n });\n\n const openFrom = (trigger: HTMLElement): void => {\n if (currentProps().disabled) return;\n activeTrigger = trigger;\n bridge.send('OPEN');\n };\n\n const cancel = (reason: CancelReason, event?: Event): void => {\n event?.preventDefault();\n bridge.send({type: 'CANCEL', reason});\n };\n\n const teardownLocalTrigger = (): void => {\n localTriggerCleanup?.run();\n localTriggerCleanup = null;\n };\n\n const setupLocalTrigger = (trigger: HTMLElement): void => {\n const target = closestTabbable(trigger);\n teardownLocalTrigger();\n localTriggerCleanup = new CleanupManager();\n cleanup.addChild(localTriggerCleanup);\n syncExternalTrigger(target, currentProps().disabled);\n addListener({target, event: 'click', handler: () => openFrom(target), cleanup: localTriggerCleanup});\n addListener({target, event: 'keydown', handler: (event) => {\n if (!(event instanceof KeyboardEvent)) return;\n if (target instanceof HTMLButtonElement || target instanceof HTMLAnchorElement) return;\n if (event.key !== 'Enter' && event.key !== ' ') return;\n event.preventDefault();\n openFrom(target);\n }, cleanup: localTriggerCleanup});\n };\n\n const mountLocalTrigger = (): void => {\n const dialog = dialogEl();\n const inlineTrigger = dialog.querySelector<HTMLElement>('[data-ui-modal-trigger]');\n if (!inlineTrigger || inlineTrigger.dataset.name) return;\n root().insertBefore(inlineTrigger, dialog);\n setupLocalTrigger(inlineTrigger);\n };\n\n const setupEvents = (): void => {\n const dialog = dialogEl();\n addListener({target: dialog, event: 'cancel', handler: (event) => {\n if (event.target !== dialog) return;\n cancel('escape', event);\n }, cleanup});\n addListener({target: dialog, event: 'close', handler: () => {\n if (bridge.hasTag('visible')) bridge.send('CLOSE');\n }, cleanup});\n addListener({target: dialog, event: 'keydown', handler: (event) => {\n if (\n event instanceof KeyboardEvent\n && bridge.hasTag('interactive')\n ) trapFocusWithin(event, panelEl());\n }, cleanup});\n addListener({target: dialog, event: 'click', handler: (event) => {\n const target = event.target;\n if (!(target instanceof Element)) return;\n const close = target.closest('[data-ui-modal-close]');\n if (!close || close.closest('[data-ui-modal]') !== dialog) return;\n event.preventDefault();\n bridge.send('CLOSE');\n }, cleanup});\n addListener({target: document, event: 'ui:modal-close', handler: (event) => {\n const detail = (event as CustomEvent<ModalCloseEventDetail>).detail;\n if (!detail?.name || detail.name !== currentProps().name) return;\n bridge.send('CLOSE');\n }, cleanup});\n cleanup.add(addDismissableLayer({\n isEnabled: () => bridge.hasTag('interactive'),\n roots: () => [panelEl(), activeTrigger, localTriggerEl()],\n onDismiss: (event) => cancel('outside', event),\n }));\n };\n\n let component!: TrellisAlpineComponent<ModalData>;\n const controller: ModalController = {\n get name() {\n return currentProps().name;\n },\n get isOpen() {\n return bridge.matches('open');\n },\n get dialogId() {\n return dialogId;\n },\n openFrom,\n close(event?: Event) {\n event?.preventDefault();\n bridge.send('CLOSE');\n },\n syncExternalTrigger,\n };\n\n component = {\n ...bridge,\n get name(): string {\n return this.snapshot.current?.props.name ?? '';\n },\n get isOpen(): boolean {\n return this.snapshot.current?.value === 'open';\n },\n get isVisible(): boolean {\n return this.snapshot.current?.tags.includes('visible') ?? false;\n },\n get dialogId(): string {\n return dialogId;\n },\n init(): void {\n cleanup = cleanupManagerFor(this);\n rootEl = this.$el;\n bridge.connect(this.$el, this.snapshot);\n const props = currentProps();\n syncPresentation();\n boundsMotion = createBoundsMotion(panelEl(), {properties: ['height', 'maxWidth']});\n dialogId = dialogEl().id || this.$id(`modal${props.name ? `-${props.name}` : ''}`);\n declareMorphAttributes(dialogEl(), 'open');\n syncAccessibility();\n modalControllers.add(controller);\n isRegistered = true;\n mountLocalTrigger();\n setupEvents();\n syncStateAttributes({syncOpen: false});\n if (props.open) queueMicrotask(() => bridge.send('OPEN'));\n },\n destroy(): void {\n boundsMotion?.destroy();\n boundsMotion = null;\n localTriggerCleanup = null;\n if (isRegistered) {\n modalControllers.delete(controller);\n isRegistered = false;\n }\n bridge.disconnect();\n const dialog = rootEl?.querySelector<HTMLDialogElement>('[data-ui-modal]');\n if (dialog?.open) dialog.close();\n releaseScrollLock?.();\n releaseScrollLock = null;\n modalTriggerControllers.forEach((trigger) => trigger.sync());\n rootEl = null;\n },\n get root(): BindingObject {\n return mergeBindings({inputs: [\n resolveStyle({part: modalStyles.parts.instance, props: {}, className: ''}),\n {'data-ui-modal-instance': ''},\n ]});\n },\n get dialog(): BindingObject {\n const snapshot = this.snapshot;\n const props = snapshot.current?.props ?? currentProps();\n return mergeBindings({inputs: [\n resolveStyle({part: modalStyles.parts.root, props, className: props.class}),\n {\n id: dialogId,\n role: 'dialog',\n 'aria-modal': 'true',\n ':data-state': () => stateFor(isExpandedState(snapshot.current?.value)),\n ':data-mode': () => snapshot.current?.props.mode,\n ':data-side': () => snapshot.current?.props.side,\n ':data-size': () => snapshot.current?.props.size,\n },\n ]});\n },\n get viewport(): BindingObject {\n const snapshot = this.snapshot;\n const props = snapshot.current?.props ?? currentProps();\n return mergeBindings({inputs: [\n resolveStyle({part: modalStyles.parts.viewport, props}),\n {\n ':data-state': () => stateFor(isExpandedState(snapshot.current?.value)),\n ':data-mode': () => snapshot.current?.props.mode,\n ':data-side': () => snapshot.current?.props.side,\n },\n ]});\n },\n get overlay(): BindingObject {\n const snapshot = this.snapshot;\n const props = snapshot.current?.props ?? currentProps();\n return mergeBindings({inputs: [\n resolveStyle({part: modalStyles.parts.overlay, props, className: props.overlayClass}),\n {':data-state': () => stateFor(isExpandedState(snapshot.current?.value))},\n ]});\n },\n get panel(): BindingObject {\n const snapshot = this.snapshot;\n const props = snapshot.current?.props ?? currentProps();\n return mergeBindings({inputs: [\n resolveStyle({part: modalStyles.parts.panel, props, className: props.panelClass}),\n {\n tabindex: -1,\n ':data-state': () => stateFor(isExpandedState(snapshot.current?.value)),\n ':data-mode': () => snapshot.current?.props.mode,\n ':data-side': () => snapshot.current?.props.side,\n ':data-size': () => snapshot.current?.props.size,\n ':data-ui-surface': () => snapshot.current?.props.surface,\n ':data-ui-elevation': () => snapshot.current?.props.elevation,\n },\n ]});\n },\n open(event?: Event): void {\n event?.preventDefault();\n if (currentProps().disabled) return;\n const local = localTriggerEl();\n if (local) activeTrigger = closestTabbable(local);\n bridge.send('OPEN');\n },\n close(event?: Event): void {\n event?.preventDefault();\n bridge.send('CLOSE');\n },\n };\n\n return component;\n};\n\nconst UiModalTrigger = (): TrellisAlpineComponent<ModalTriggerData> => {\n let props: ModalTriggerProps | null = null;\n let target: HTMLElement | null = null;\n let cleanup: CleanupManager;\n let isRegistered = false;\n\n const currentProps = (): ModalTriggerProps => {\n if (!props) throw new Error('Modal trigger has not been initialized.');\n return props;\n };\n\n const targetEl = (): HTMLElement => {\n if (!target) throw new Error('Modal trigger has not been initialized.');\n return target;\n };\n\n const modal = (): ModalController | null => {\n const name = currentProps().name;\n return name ? findNamedModal(name) : null;\n };\n\n const sync = (): void => {\n const triggerProps = currentProps();\n const trigger = targetEl();\n const modalController = modal();\n if (modalController) {\n modalController.syncExternalTrigger(trigger, triggerProps.disabled);\n return;\n }\n\n setOpenAttributes(trigger, false);\n if (triggerProps.disabled) {\n trigger.setAttribute('aria-disabled', 'true');\n trigger.setAttribute('data-disabled', '');\n } else {\n trigger.removeAttribute('aria-disabled');\n trigger.removeAttribute('data-disabled');\n }\n };\n\n const controller: ModalTriggerController = {\n get name() {\n return currentProps().name;\n },\n get target() {\n return targetEl();\n },\n sync,\n };\n\n return {\n init(): void {\n cleanup = cleanupManagerFor(this);\n props = defineProps({\n el: this.$el,\n schema: modalTriggerSchema,\n onChange: () => {\n if (props?.name) sync();\n },\n });\n target = closestTabbable(this.$el);\n if (!props.name) return;\n modalTriggerControllers.add(controller);\n isRegistered = true;\n sync();\n\n addListener({target, event: 'click', handler: (event) => this.open(event), cleanup});\n addListener({target, event: 'keydown', handler: (event) => {\n if (!(event instanceof KeyboardEvent)) return;\n if (target instanceof HTMLButtonElement || target instanceof HTMLAnchorElement) return;\n if (event.key !== 'Enter' && event.key !== ' ') return;\n this.open(event);\n }, cleanup});\n },\n destroy(): void {\n props?.disconnect();\n if (isRegistered) modalTriggerControllers.delete(controller);\n isRegistered = false;\n props = null;\n target = null;\n },\n get root(): BindingObject {\n const triggerProps = currentProps();\n return mergeBindings({inputs: [\n resolveStyle({part: modalStyles.parts.trigger, props: {}, className: triggerProps.class}),\n {\n 'data-ui-modal-trigger': '',\n ':data-name': () => props?.name || undefined,\n ':data-disabled': () => (props?.disabled ? '' : undefined),\n },\n ]});\n },\n open(event?: Event): void {\n event?.preventDefault();\n if (currentProps().disabled) return;\n modal()?.openFrom(targetEl());\n },\n };\n};\n\nconst registerModal = (AlpineInstance: Alpine.Alpine): void => {\n defineAlpineData('UiModal', () => UiModal(AlpineInstance))(AlpineInstance);\n defineAlpineData('UiModalTrigger', UiModalTrigger)(AlpineInstance);\n};\n\nexport {registerModal, UiModal, UiModalTrigger};\nexport type {ModalCancelDetail, ModalTransition, UiModalApi, UiModalTriggerApi};\n","// Generated by scripts/generate_component_entries.mjs from packages/client/component-entries.json.\n// Do not edit by hand.\nimport type {Alpine as AlpineType} from 'alpinejs';\nimport {registerMotionCapability} from '../../capabilities/motion';\nimport {registerModal as registerComponent} from './index';\n\nconst registered = new WeakSet<AlpineType>();\n\nconst registerModal = (AlpineInstance: AlpineType): void => {\n if (registered.has(AlpineInstance)) return;\n registered.add(AlpineInstance);\n registerMotionCapability(AlpineInstance);\n registerComponent(AlpineInstance);\n};\n\nex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