@shapio/cms 0.0.0-stage → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -2
- package/dist/admin/apple-touch-icon.png +0 -0
- package/dist/admin/assets/AssistError-hVUWpP3F.js +2 -0
- package/dist/admin/assets/AssistError-hVUWpP3F.js.map +1 -0
- package/dist/admin/assets/BlockMenuItems-B0g93m6M.js +6 -0
- package/dist/admin/assets/BlockMenuItems-B0g93m6M.js.map +1 -0
- package/dist/admin/assets/Body-CFQKONK4.js +2 -0
- package/dist/admin/assets/Body-CFQKONK4.js.map +1 -0
- package/dist/admin/assets/Builder-Do5KVHV9.js +2 -0
- package/dist/admin/assets/Builder-Do5KVHV9.js.map +1 -0
- package/dist/admin/assets/ConfirmDialog-D6rs75TP.js +2 -0
- package/dist/admin/assets/ConfirmDialog-D6rs75TP.js.map +1 -0
- package/dist/admin/assets/CopyButton-Bc7crFDE.js +2 -0
- package/dist/admin/assets/CopyButton-Bc7crFDE.js.map +1 -0
- package/dist/admin/assets/CursorPager-BFPD_adV.js +2 -0
- package/dist/admin/assets/CursorPager-BFPD_adV.js.map +1 -0
- package/dist/admin/assets/ExternalLink-Cdfcyyed.js +2 -0
- package/dist/admin/assets/ExternalLink-Cdfcyyed.js.map +1 -0
- package/dist/admin/assets/FormCheckboxGroup-Bicl1CBP.js +2 -0
- package/dist/admin/assets/FormCheckboxGroup-Bicl1CBP.js.map +1 -0
- package/dist/admin/assets/FormRadioGroup-34iVSV4L.js +2 -0
- package/dist/admin/assets/FormRadioGroup-34iVSV4L.js.map +1 -0
- package/dist/admin/assets/FormSelectField-Ba4fIu-8.js +2 -0
- package/dist/admin/assets/FormSelectField-Ba4fIu-8.js.map +1 -0
- package/dist/admin/assets/FormSwitchField-DN6bfPC0.js +2 -0
- package/dist/admin/assets/FormSwitchField-DN6bfPC0.js.map +1 -0
- package/dist/admin/assets/FormTextareaField-WsNjLm32.js +2 -0
- package/dist/admin/assets/FormTextareaField-WsNjLm32.js.map +1 -0
- package/dist/admin/assets/HintedLabel-jKLM0ETt.js +2 -0
- package/dist/admin/assets/HintedLabel-jKLM0ETt.js.map +1 -0
- package/dist/admin/assets/InfoHint-DBqcrmZ3.js +2 -0
- package/dist/admin/assets/InfoHint-DBqcrmZ3.js.map +1 -0
- package/dist/admin/assets/InsertMenuItem-CRKXblK5.js +2 -0
- package/dist/admin/assets/InsertMenuItem-CRKXblK5.js.map +1 -0
- package/dist/admin/assets/LinkTabs-Bn2JVqOL.js +2 -0
- package/dist/admin/assets/LinkTabs-Bn2JVqOL.js.map +1 -0
- package/dist/admin/assets/Match-DaYgKrk7.js +2 -0
- package/dist/admin/assets/Match-DaYgKrk7.js.map +1 -0
- package/dist/admin/assets/Panel-6wFe96Gr.js +2 -0
- package/dist/admin/assets/Panel-6wFe96Gr.js.map +1 -0
- package/dist/admin/assets/QueryView-DFZtm0fn.js +2 -0
- package/dist/admin/assets/QueryView-DFZtm0fn.js.map +1 -0
- package/dist/admin/assets/RadioTile-DsTyz7ml.js +2 -0
- package/dist/admin/assets/RadioTile-DsTyz7ml.js.map +1 -0
- package/dist/admin/assets/RichTextField-BGkH403g.js +144 -0
- package/dist/admin/assets/RichTextField-BGkH403g.js.map +1 -0
- package/dist/admin/assets/RowTitle-sFt6NjO4.js +2 -0
- package/dist/admin/assets/RowTitle-sFt6NjO4.js.map +1 -0
- package/dist/admin/assets/SecretReveal-Z6MOFdcL.js +2 -0
- package/dist/admin/assets/SecretReveal-Z6MOFdcL.js.map +1 -0
- package/dist/admin/assets/StepList-BTP_EMzx.js +2 -0
- package/dist/admin/assets/StepList-BTP_EMzx.js.map +1 -0
- package/dist/admin/assets/Structure-D5-hCUuF.js +2 -0
- package/dist/admin/assets/Structure-D5-hCUuF.js.map +1 -0
- package/dist/admin/assets/SubNavLink-C5oN5mzB.js +2 -0
- package/dist/admin/assets/SubNavLink-C5oN5mzB.js.map +1 -0
- package/dist/admin/assets/SuggestAltButton-BuN35BBL.js +2 -0
- package/dist/admin/assets/SuggestAltButton-BuN35BBL.js.map +1 -0
- package/dist/admin/assets/TextLink-B4a6j3r6.js +2 -0
- package/dist/admin/assets/TextLink-B4a6j3r6.js.map +1 -0
- package/dist/admin/assets/Thumbnail-u8NE5NhQ.js +2 -0
- package/dist/admin/assets/Thumbnail-u8NE5NhQ.js.map +1 -0
- package/dist/admin/assets/UnsavedChangesGuard-BYwMTDsE.js +2 -0
- package/dist/admin/assets/UnsavedChangesGuard-BYwMTDsE.js.map +1 -0
- package/dist/admin/assets/UserAvatar-D-yX0ozh.js +2 -0
- package/dist/admin/assets/UserAvatar-D-yX0ozh.js.map +1 -0
- package/dist/admin/assets/View-BLsQYPow.js +11 -0
- package/dist/admin/assets/View-BLsQYPow.js.map +1 -0
- package/dist/admin/assets/arrow-up-Ws7W9KsZ.js +2 -0
- package/dist/admin/assets/arrow-up-Ws7W9KsZ.js.map +1 -0
- package/dist/admin/assets/auth-b3_9QbtL.js +2 -0
- package/dist/admin/assets/auth-b3_9QbtL.js.map +1 -0
- package/dist/admin/assets/badge-CMox6-v3.js +2 -0
- package/dist/admin/assets/badge-CMox6-v3.js.map +1 -0
- package/dist/admin/assets/calendar-clock-9W0Lkt89.js +2 -0
- package/dist/admin/assets/calendar-clock-9W0Lkt89.js.map +1 -0
- package/dist/admin/assets/changeSets-CO7JdILW.js +2 -0
- package/dist/admin/assets/changeSets-CO7JdILW.js.map +1 -0
- package/dist/admin/assets/chevron-left-DyqYjcMB.js +2 -0
- package/dist/admin/assets/chevron-left-DyqYjcMB.js.map +1 -0
- package/dist/admin/assets/circle-check-aJ2DW5t4.js +2 -0
- package/dist/admin/assets/circle-check-aJ2DW5t4.js.map +1 -0
- package/dist/admin/assets/circle-x-BnRBht9z.js +2 -0
- package/dist/admin/assets/circle-x-BnRBht9z.js.map +1 -0
- package/dist/admin/assets/client-C8vMCv-p.js +10 -0
- package/dist/admin/assets/client-C8vMCv-p.js.map +1 -0
- package/dist/admin/assets/clock-DRtFQbTs.js +2 -0
- package/dist/admin/assets/clock-DRtFQbTs.js.map +1 -0
- package/dist/admin/assets/cn-DnXL75B0.js +2 -0
- package/dist/admin/assets/cn-DnXL75B0.js.map +1 -0
- package/dist/admin/assets/coerce-COM3rk1i.js +2 -0
- package/dist/admin/assets/coerce-COM3rk1i.js.map +1 -0
- package/dist/admin/assets/constants-CS1ziZO0.js +2 -0
- package/dist/admin/assets/constants-CS1ziZO0.js.map +1 -0
- package/dist/admin/assets/constants-DCtq_UOe.js +2 -0
- package/dist/admin/assets/constants-DCtq_UOe.js.map +1 -0
- package/dist/admin/assets/constants-DUBUgzpU.js +2 -0
- package/dist/admin/assets/constants-DUBUgzpU.js.map +1 -0
- package/dist/admin/assets/content-Dic2fof_.js +3 -0
- package/dist/admin/assets/content-Dic2fof_.js.map +1 -0
- package/dist/admin/assets/contentCounts-Ct0tYgHD.js +2 -0
- package/dist/admin/assets/contentCounts-Ct0tYgHD.js.map +1 -0
- package/dist/admin/assets/contentTypes-D4_Ax9rb.js +2 -0
- package/dist/admin/assets/contentTypes-D4_Ax9rb.js.map +1 -0
- package/dist/admin/assets/copy-B5B8RjV0.js +2 -0
- package/dist/admin/assets/copy-B5B8RjV0.js.map +1 -0
- package/dist/admin/assets/dateTimeLocal-BuBv3it2.js +2 -0
- package/dist/admin/assets/dateTimeLocal-BuBv3it2.js.map +1 -0
- package/dist/admin/assets/defineEditor-CiJc766Y.js +2 -0
- package/dist/admin/assets/defineEditor-CiJc766Y.js.map +1 -0
- package/dist/admin/assets/develop-Brnb5YPC.js +11 -0
- package/dist/admin/assets/develop-Brnb5YPC.js.map +1 -0
- package/dist/admin/assets/dropdown-menu-CW3fabv5.js +2 -0
- package/dist/admin/assets/dropdown-menu-CW3fabv5.js.map +1 -0
- package/dist/admin/assets/ellipsis-DNdmromA.js +2 -0
- package/dist/admin/assets/ellipsis-DNdmromA.js.map +1 -0
- package/dist/admin/assets/errors-DfoXUVDI.js +2 -0
- package/dist/admin/assets/errors-DfoXUVDI.js.map +1 -0
- package/dist/admin/assets/external-link-YnuWXDBk.js +2 -0
- package/dist/admin/assets/external-link-YnuWXDBk.js.map +1 -0
- package/dist/admin/assets/file-text-CB7Bc0GA.js +2 -0
- package/dist/admin/assets/file-text-CB7Bc0GA.js.map +1 -0
- package/dist/admin/assets/fileRoute-BYwireXG.js +2 -0
- package/dist/admin/assets/fileRoute-BYwireXG.js.map +1 -0
- package/dist/admin/assets/globe-Bvs3UC3V.js +2 -0
- package/dist/admin/assets/globe-Bvs3UC3V.js.map +1 -0
- package/dist/admin/assets/image-CeoxwJeM.js +2 -0
- package/dist/admin/assets/image-CeoxwJeM.js.map +1 -0
- package/dist/admin/assets/image-off-iVqYw2Zc.js +2 -0
- package/dist/admin/assets/image-off-iVqYw2Zc.js.map +1 -0
- package/dist/admin/assets/inbox-DYbEOpaQ.js +2 -0
- package/dist/admin/assets/inbox-DYbEOpaQ.js.map +1 -0
- package/dist/admin/assets/inbox-wDoqym--.js +2 -0
- package/dist/admin/assets/inbox-wDoqym--.js.map +1 -0
- package/dist/admin/assets/index-57Mn6XLO.js +4 -0
- package/dist/admin/assets/index-57Mn6XLO.js.map +1 -0
- package/dist/admin/assets/index-BLYOgCKc.css +2 -0
- package/dist/admin/assets/jsx-runtime-DREnUpxT.js +2 -0
- package/dist/admin/assets/jsx-runtime-DREnUpxT.js.map +1 -0
- package/dist/admin/assets/key-round-Bcw6qqcb.js +2 -0
- package/dist/admin/assets/key-round-Bcw6qqcb.js.map +1 -0
- package/dist/admin/assets/link-2-DhM2vi4v.js +2 -0
- package/dist/admin/assets/link-2-DhM2vi4v.js.map +1 -0
- package/dist/admin/assets/link-2-off-DpDOMsa-.js +2 -0
- package/dist/admin/assets/link-2-off-DpDOMsa-.js.map +1 -0
- package/dist/admin/assets/link-CKr_uUfb.js +2 -0
- package/dist/admin/assets/link-CKr_uUfb.js.map +1 -0
- package/dist/admin/assets/list-BElvKZw_.js +2 -0
- package/dist/admin/assets/list-BElvKZw_.js.map +1 -0
- package/dist/admin/assets/locales-Bnv3qcdZ.js +2 -0
- package/dist/admin/assets/locales-Bnv3qcdZ.js.map +1 -0
- package/dist/admin/assets/media-BfDqe_2P.js +2 -0
- package/dist/admin/assets/media-BfDqe_2P.js.map +1 -0
- package/dist/admin/assets/media-DjK3xGFN.js +2 -0
- package/dist/admin/assets/media-DjK3xGFN.js.map +1 -0
- package/dist/admin/assets/modelPermissions-DZ1lWfQZ.js +2 -0
- package/dist/admin/assets/modelPermissions-DZ1lWfQZ.js.map +1 -0
- package/dist/admin/assets/network-CAJ76ILr.js +2 -0
- package/dist/admin/assets/network-CAJ76ILr.js.map +1 -0
- package/dist/admin/assets/pencil-Zd05MDs2.js +2 -0
- package/dist/admin/assets/pencil-Zd05MDs2.js.map +1 -0
- package/dist/admin/assets/plus-B0gd63Da.js +2 -0
- package/dist/admin/assets/plus-B0gd63Da.js.map +1 -0
- package/dist/admin/assets/preload-helper-CJKHb_rG.js +2 -0
- package/dist/admin/assets/preload-helper-CJKHb_rG.js.map +1 -0
- package/dist/admin/assets/publishing-B7zv1e7j.js +2 -0
- package/dist/admin/assets/publishing-B7zv1e7j.js.map +1 -0
- package/dist/admin/assets/publishing-vCVjaSGF.js +2 -0
- package/dist/admin/assets/publishing-vCVjaSGF.js.map +1 -0
- package/dist/admin/assets/radio-group-DVR0mTpo.js +2 -0
- package/dist/admin/assets/radio-group-DVR0mTpo.js.map +1 -0
- package/dist/admin/assets/react-CQOZoUwg.js +2 -0
- package/dist/admin/assets/react-CQOZoUwg.js.map +1 -0
- package/dist/admin/assets/react-dom-pEVw9mjF.js +2 -0
- package/dist/admin/assets/react-dom-pEVw9mjF.js.map +1 -0
- package/dist/admin/assets/rolldown-runtime-Dd_uD5pT.js +1 -0
- package/dist/admin/assets/root-CDpNo7ef.js +2 -0
- package/dist/admin/assets/root-CDpNo7ef.js.map +1 -0
- package/dist/admin/assets/rotate-ccw-BOTDOdHf.js +2 -0
- package/dist/admin/assets/rotate-ccw-BOTDOdHf.js.map +1 -0
- package/dist/admin/assets/schedules-CG-ZphRK.js +2 -0
- package/dist/admin/assets/schedules-CG-ZphRK.js.map +1 -0
- package/dist/admin/assets/schema-KXXSPVJn.js +2 -0
- package/dist/admin/assets/schema-KXXSPVJn.js.map +1 -0
- package/dist/admin/assets/scroll-text-D-gHqYwR.js +2 -0
- package/dist/admin/assets/scroll-text-D-gHqYwR.js.map +1 -0
- package/dist/admin/assets/search-BcPL1qyc.js +2 -0
- package/dist/admin/assets/search-BcPL1qyc.js.map +1 -0
- package/dist/admin/assets/searchSchema-BGrRDBL_.js +2 -0
- package/dist/admin/assets/searchSchema-BGrRDBL_.js.map +1 -0
- package/dist/admin/assets/searchSchemas-ChN9hhuQ.js +2 -0
- package/dist/admin/assets/searchSchemas-ChN9hhuQ.js.map +1 -0
- package/dist/admin/assets/sections-BrGcWOnw.js +2 -0
- package/dist/admin/assets/sections-BrGcWOnw.js.map +1 -0
- package/dist/admin/assets/sections-i9TeeK-h.js +2 -0
- package/dist/admin/assets/sections-i9TeeK-h.js.map +1 -0
- package/dist/admin/assets/select--nGB4WjU.js +2 -0
- package/dist/admin/assets/select--nGB4WjU.js.map +1 -0
- package/dist/admin/assets/send-Bu3RRfdI.js +2 -0
- package/dist/admin/assets/send-Bu3RRfdI.js.map +1 -0
- package/dist/admin/assets/settings-68BAxrPM.js +2 -0
- package/dist/admin/assets/settings-68BAxrPM.js.map +1 -0
- package/dist/admin/assets/settle-LRKtTN_e.js +2 -0
- package/dist/admin/assets/settle-LRKtTN_e.js.map +1 -0
- package/dist/admin/assets/shared-react-KADNSNpb.js +1 -0
- package/dist/admin/assets/shared-react-dom-BpneAejY.js +1 -0
- package/dist/admin/assets/shared-react-dom-client-CnpZTXxo.js +1 -0
- package/dist/admin/assets/shared-react-jsx-runtime-CU_Fm1m8.js +1 -0
- package/dist/admin/assets/shared-shapio-editor-sdk-9ANIbEN0.js +1 -0
- package/dist/admin/assets/sites-C6_THCVK.js +2 -0
- package/dist/admin/assets/sites-C6_THCVK.js.map +1 -0
- package/dist/admin/assets/skeleton-DUvclBAr.js +42 -0
- package/dist/admin/assets/skeleton-DUvclBAr.js.map +1 -0
- package/dist/admin/assets/snapshots-CKjK-vkL.js +2 -0
- package/dist/admin/assets/snapshots-CKjK-vkL.js.map +1 -0
- package/dist/admin/assets/sparkles-B_NX7PAY.js +2 -0
- package/dist/admin/assets/sparkles-B_NX7PAY.js.map +1 -0
- package/dist/admin/assets/src-D6DABe5J.js +4 -0
- package/dist/admin/assets/src-D6DABe5J.js.map +1 -0
- package/dist/admin/assets/stableId-Dmr2Afn_.js +2 -0
- package/dist/admin/assets/stableId-Dmr2Afn_.js.map +1 -0
- package/dist/admin/assets/store-B5xrQ1Ex.js +2 -0
- package/dist/admin/assets/store-B5xrQ1Ex.js.map +1 -0
- package/dist/admin/assets/switch-B-FbT-l8.js +2 -0
- package/dist/admin/assets/switch-B-FbT-l8.js.map +1 -0
- package/dist/admin/assets/table-DQzCPm7J.js +56 -0
- package/dist/admin/assets/table-DQzCPm7J.js.map +1 -0
- package/dist/admin/assets/tabs-YThoOiE3.js +5 -0
- package/dist/admin/assets/tabs-YThoOiE3.js.map +1 -0
- package/dist/admin/assets/textarea-_wcx8Mn1.js +2 -0
- package/dist/admin/assets/textarea-_wcx8Mn1.js.map +1 -0
- package/dist/admin/assets/titles-DyCBLXue.js +2 -0
- package/dist/admin/assets/titles-DyCBLXue.js.map +1 -0
- package/dist/admin/assets/tokens-CqsxrApC.js +2 -0
- package/dist/admin/assets/tokens-CqsxrApC.js.map +1 -0
- package/dist/admin/assets/tooltip-BMe4HylJ.js +2 -0
- package/dist/admin/assets/tooltip-BMe4HylJ.js.map +1 -0
- package/dist/admin/assets/undo-2-DMOHOH6w.js +2 -0
- package/dist/admin/assets/undo-2-DMOHOH6w.js.map +1 -0
- package/dist/admin/assets/useAuditLabels-CSw_kwLs.js +2 -0
- package/dist/admin/assets/useAuditLabels-CSw_kwLs.js.map +1 -0
- package/dist/admin/assets/useConfirmTarget-9JmfiY2X.js +2 -0
- package/dist/admin/assets/useConfirmTarget-9JmfiY2X.js.map +1 -0
- package/dist/admin/assets/useContentSchema-CS5QQcRk.js +2 -0
- package/dist/admin/assets/useContentSchema-CS5QQcRk.js.map +1 -0
- package/dist/admin/assets/useCursorPager-Dt_axwd1.js +2 -0
- package/dist/admin/assets/useCursorPager-Dt_axwd1.js.map +1 -0
- package/dist/admin/assets/useDebouncedValue-Dqs3wwhn.js +2 -0
- package/dist/admin/assets/useDebouncedValue-Dqs3wwhn.js.map +1 -0
- package/dist/admin/assets/useDiscardGuard-7rRGpd4q.js +2 -0
- package/dist/admin/assets/useDiscardGuard-7rRGpd4q.js.map +1 -0
- package/dist/admin/assets/useMediaUploader-CBUcNW6d.js +2 -0
- package/dist/admin/assets/useMediaUploader-CBUcNW6d.js.map +1 -0
- package/dist/admin/assets/usePaletteItems-bbTIqpPu.js +2 -0
- package/dist/admin/assets/usePaletteItems-bbTIqpPu.js.map +1 -0
- package/dist/admin/assets/usePlaces-D1raoQ2s.js +2 -0
- package/dist/admin/assets/usePlaces-D1raoQ2s.js.map +1 -0
- package/dist/admin/assets/useQueries-DKGIdq6A.js +2 -0
- package/dist/admin/assets/useQueries-DKGIdq6A.js.map +1 -0
- package/dist/admin/assets/useSaveShortcut-rKtp1qK7.js +2 -0
- package/dist/admin/assets/useSaveShortcut-rKtp1qK7.js.map +1 -0
- package/dist/admin/assets/useSearchInput-1fDoEtXe.js +2 -0
- package/dist/admin/assets/useSearchInput-1fDoEtXe.js.map +1 -0
- package/dist/admin/assets/users-C1ZSee3N.js +2 -0
- package/dist/admin/assets/users-C1ZSee3N.js.map +1 -0
- package/dist/admin/assets/users-DMfQL0s4.js +2 -0
- package/dist/admin/assets/users-DMfQL0s4.js.map +1 -0
- package/dist/admin/assets/w3c-keyname-BOAvb0qz.js +2 -0
- package/dist/admin/assets/w3c-keyname-BOAvb0qz.js.map +1 -0
- package/dist/admin/assets/zod-Pf5A-ax4.js +2 -0
- package/dist/admin/assets/zod-Pf5A-ax4.js.map +1 -0
- package/dist/admin/favicon-32.png +0 -0
- package/dist/admin/favicon.svg +5 -0
- package/dist/admin/fonts/OFL-SourceSerif4.txt +93 -0
- package/dist/admin/fonts/OFL.txt +93 -0
- package/dist/admin/fonts/manrope-latin-ext-wght-normal.woff2 +0 -0
- package/dist/admin/fonts/manrope-latin-wght-normal.woff2 +0 -0
- package/dist/admin/fonts/source-serif-4-latin-ext-wght-italic.woff2 +0 -0
- package/dist/admin/fonts/source-serif-4-latin-ext-wght-normal.woff2 +0 -0
- package/dist/admin/fonts/source-serif-4-latin-wght-italic.woff2 +0 -0
- package/dist/admin/fonts/source-serif-4-latin-wght-normal.woff2 +0 -0
- package/dist/admin/index.html +89 -0
- package/dist/admin/theme-init.js +18 -0
- package/dist/cli.js +5163 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.d.ts +2 -0
- package/dist/config.js +39 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +1051 -0
- package/dist/index.js +3 -0
- package/dist/public-CKU0Gkfq.d.ts +1177 -0
- package/dist/worker-C-MSYr4l.js +46445 -0
- package/dist/worker-C-MSYr4l.js.map +1 -0
- package/package.json +98 -3
- package/vendor/graphiql/LICENSE.graphiql +21 -0
- package/vendor/graphiql/LICENSE.react +21 -0
- package/vendor/graphiql/LICENSE.react-dom +21 -0
- package/vendor/graphiql/graphiql.min.css +1 -0
- package/vendor/graphiql/graphiql.min.js +46 -0
- package/vendor/graphiql/react-dom.production.min.js +267 -0
- package/vendor/graphiql/react.production.min.js +31 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./react-CQOZoUwg.js";import{t as n}from"./jsx-runtime-DREnUpxT.js";import{i as r,j as i,r as a,t as o}from"./cn-DnXL75B0.js";import{C as s,D as c,E as l,S as u,T as d,b as f,g as p,w as m,x as h,y as g}from"./badge-CMox6-v3.js";import{N as _,a as v,d as y,i as b,n as x,o as S,r as C,z as w}from"./InfoHint-DBqcrmZ3.js";import{E as T,O as E,T as D,a as O,b as k,g as A,h as j,i as M,k as N,v as P,y as F}from"./skeleton-DUvclBAr.js";var I={name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]};I.node;var L=r(I),R=e(t(),1),z=e(n(),1),ee=Object.defineProperty,B=(e,t)=>ee(e,`name`,{value:t,configurable:!0}),[te,ne]=F(`AlertDialog`,[c]),V=c(),re=B(e=>{let{__scopeAlertDialog:t,...n}=e,r=V(t);return(0,z.jsx)(g,{...r,...n,modal:!0})},`AlertDialog`);R.forwardRef(B(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=V(n);return(0,z.jsx)(l,{...i,...r,ref:t})},`AlertDialogTrigger`));var ie=B(e=>{let{__scopeAlertDialog:t,...n}=e,r=V(t);return(0,z.jsx)(m,{...r,...n})},`AlertDialogPortal`),ae=R.forwardRef(B(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=V(n);return(0,z.jsx)(s,{...i,...r,ref:t})},`AlertDialogOverlay`)),[oe,se]=te(`AlertDialogContent`),ce=R.forwardRef(B(function(e,t){let{__scopeAlertDialog:n,children:r,...i}=e,a=V(n),o=R.useRef(null),s=D(t,o),c=R.useRef(null);return(0,z.jsx)(oe,{scope:n,cancelRef:c,children:(0,z.jsx)(h,{role:`alertdialog`,...a,...i,ref:s,onOpenAutoFocus:P(i.onOpenAutoFocus,e=>{e.preventDefault(),c.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:r})})},`AlertDialogContent`)),le=R.forwardRef(B(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=V(n);return(0,z.jsx)(d,{...i,...r,ref:t})},`AlertDialogTitle`)),ue=R.forwardRef(B(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=V(n);return(0,z.jsx)(u,{...i,...r,ref:t})},`AlertDialogDescription`)),de=R.forwardRef(B(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=V(n);return(0,z.jsx)(f,{...i,...r,ref:t})},`AlertDialogAction`)),fe=`AlertDialogCancel`,pe=R.forwardRef(B(function(e,t){let{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=se(fe,n),a=V(n),o=D(t,i);return(0,z.jsx)(f,{...a,...r,ref:o})},`AlertDialogCancel`)),me=re,he=ie,ge=ae,_e=ce,ve=de,ye=pe,be=le,xe=ue,Se=Object.defineProperty,H=(e,t)=>Se(e,`name`,{value:t,configurable:!0}),U=`Checkbox`,[Ce,we]=F(U),[Te,W]=Ce(U);function G(e){let{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=A({prop:n,defaultProp:i??!1,onChange:c,caller:U}),[m,h]=R.useState(null),[g,_]=R.useState(null),v=R.useRef(!1),[y,b]=R.useReducer(e=>e+1,0),x=!m||!!o||!!m.closest(`form`),S={checked:f,disabled:a,setChecked:p,control:m,setControl:h,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:v,userInteractionCount:y,onUserInteraction:b,required:l,defaultChecked:!q(i)&&i,isFormControl:x,bubbleInput:g,setBubbleInput:_};return(0,z.jsx)(Te,{scope:t,...S,children:K(d)?d(S):r})}H(G,`CheckboxProvider`);var Ee=`CheckboxTrigger`,De=R.forwardRef(H(function({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i){let{control:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,onUserInteraction:p,isFormControl:m,bubbleInput:h}=W(Ee,e),g=D(i,u),_=R.useRef(c);return R.useEffect(()=>{let e=a?.form;if(e){let t=H(()=>d(_.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[a,d]),(0,z.jsx)(k.button,{type:`button`,role:`checkbox`,"aria-checked":q(c)?`mixed`:c,"aria-required":l,"data-state":J(c),"data-disabled":s?``:void 0,disabled:s,value:o,...r,ref:g,onKeyDown:P(t,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:P(n,e=>{p(),d(e=>q(e)?!0:!e),h&&m&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})},`CheckboxTrigger`)),Oe=R.forwardRef(H(function(e,t){let{__scopeCheckbox:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,z.jsx)(G,{__scopeCheckbox:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(De,{...d,ref:t,__scopeCheckbox:n}),e&&(0,z.jsx)(Me,{__scopeCheckbox:n})]})})},`Checkbox`)),ke=`CheckboxIndicator`,Ae=R.forwardRef(H(function(e,t){let{__scopeCheckbox:n,forceMount:r,...i}=e,a=W(ke,n);return(0,z.jsx)(j,{present:r||q(a.checked)||a.checked===!0,children:(0,z.jsx)(k.span,{"data-state":J(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t,style:{pointerEvents:`none`,...e.style}})})},`CheckboxIndicator`)),je=`CheckboxBubbleInput`,Me=R.forwardRef(H(function({__scopeCheckbox:e,onClick:t,...n},r){let{control:i,hasConsumerStoppedPropagationRef:a,userInteractionCount:o,checked:s,defaultChecked:c,required:l,disabled:u,name:d,value:f,form:p,bubbleInput:m,setBubbleInput:h}=W(je,e),g=D(r,h),v=_(i),y=R.useRef(!1),b=R.useRef(s),x=R.useRef(o);R.useEffect(()=>{let e=m;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=o!==x.current;x.current=o;let i=b.current!==s;b.current=s;let c=!(r&&a.current);if(i&&n){y.current=!r;let t=new Event(`click`,{bubbles:c});e.indeterminate=q(s),n.call(e,!q(s)&&s),e.dispatchEvent(t),y.current=!1}},[m,s,a,o]);let S=R.useRef(!q(s)&&s);return(0,z.jsx)(k.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:c??S.current,required:l,disabled:u,name:d,value:f,form:p,...n,tabIndex:-1,ref:g,onClick:P(t,e=>{y.current&&e.stopPropagation()}),style:{...n.style,...v,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`CheckboxBubbleInput`));function K(e){return typeof e==`function`}H(K,`isFunction`);function q(e){return e===`indeterminate`}H(q,`isIndeterminate`);function J(e){return q(e)?`indeterminate`:e?`checked`:`unchecked`}H(J,`getState`);var Ne=T(`relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current`,{variants:{variant:{default:`bg-card text-card-foreground`,destructive:`border-destructive/30 bg-destructive-muted text-destructive *:data-[slot=alert-description]:text-destructive [&>svg]:text-current`,warning:`border-warning/30 bg-warning-muted text-warning *:data-[slot=alert-description]:text-warning [&>svg]:text-current`,info:`border-border bg-muted text-foreground *:data-[slot=alert-description]:text-muted-foreground dark:border-info/30 dark:bg-info-muted dark:text-info dark:*:data-[slot=alert-description]:text-info [&>svg]:text-info`,success:`border-success/30 bg-success-muted text-success *:data-[slot=alert-description]:text-success [&>svg]:text-current`}},defaultVariants:{variant:`default`}});function Y({className:e,variant:t,...n}){return(0,z.jsx)(`div`,{"data-slot":`alert`,role:`alert`,className:o(Ne({variant:t}),e),...n})}function Pe({className:e,...t}){return(0,z.jsx)(`div`,{"data-slot":`alert-title`,className:o(`col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight`,e),...t})}function X({className:e,...t}){return(0,z.jsx)(`div`,{"data-slot":`alert-description`,className:o(`col-start-2 grid justify-items-start gap-1 text-sm text-muted-foreground [&_p]:leading-relaxed`,e),...t})}var Z=({error:e})=>e?(0,z.jsxs)(Y,{variant:`destructive`,children:[(0,z.jsx)(L,{"aria-hidden":`true`}),(0,z.jsx)(X,{children:N(e)})]}):null,Fe=e=>{let{title:t,description:n,confirmLabel:r,cancelLabel:o,pendingLabel:s,tone:c,onConfirm:l,align:u=`end`,side:d=`bottom`,onCloseAutoFocus:f}=e,{t:m}=i(),h=(0,R.useId)(),g=(0,R.useId)(),_=(0,R.useRef)(null),y=(0,R.useRef)(null),[S,w]=(0,R.useState)(!1),[T,E]=(0,R.useState)(!1),[D,O]=(0,R.useState)(null),k=e.trigger===void 0?e.open:S,A=t=>{t&&O(null),e.trigger===void 0?e.onOpenChange(t):w(t)},j=e=>T&&!e?void 0:A(e),N=()=>{let e=l();if(!(e instanceof Promise)){A(!1);return}E(!0),O(null),e.then(()=>{E(!1),A(!1)},e=>{E(!1),O(e)})},P=p(e=>{e.preventDefault(),(c===`danger`?_:y).current?.focus()},f);return(0,z.jsxs)(x,{open:k,onOpenChange:j,modal:!0,children:[e.trigger===void 0?(0,z.jsx)(C,{asChild:!0,children:e.children}):(0,z.jsx)(v,{asChild:!0,children:e.trigger}),(0,z.jsxs)(b,{role:`alertdialog`,"aria-modal":`true`,"aria-labelledby":h,"aria-describedby":n?g:void 0,align:u,side:d,className:`w-80 space-y-4`,...P,children:[(0,z.jsxs)(`div`,{className:`space-y-1`,children:[(0,z.jsx)(`p`,{id:h,className:`text-sm font-semibold`,children:t}),n?(0,z.jsx)(`p`,{id:g,className:`text-meta text-muted-foreground`,children:n}):null]}),(0,z.jsx)(Z,{error:D}),(0,z.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,z.jsx)(M,{ref:_,type:`button`,size:`sm`,variant:`outline`,disabled:T,onClick:()=>A(!1),children:o??m(`common.cancel`)}),(0,z.jsx)(M,{ref:y,type:`button`,size:`sm`,variant:c===`danger`?`destructive`:`default`,disabled:T,"aria-busy":T||void 0,onClick:N,children:T?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(a,{className:`animate-spin`,"aria-hidden":`true`}),s??r]}):r})]})]})]})};function Q({className:e,...t}){return(0,z.jsx)(Oe,{"data-slot":`checkbox`,className:o(`peer size-4 shrink-0 rounded-[4px] border border-input shadow-xs transition-shadow outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=indeterminate]:border-primary data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground dark:bg-input/30 dark:aria-invalid:ring-destructive/40 dark:data-[state=checked]:bg-primary dark:data-[state=indeterminate]:bg-primary`,e),...t,children:(0,z.jsx)(Ae,{"data-slot":`checkbox-indicator`,className:`grid place-content-center text-current transition-none`,children:t.checked===`indeterminate`?(0,z.jsx)(w,{className:`size-3.5`}):(0,z.jsx)(E,{className:`size-3.5`})})})}function Ie({...e}){return(0,z.jsx)(me,{"data-slot":`alert-dialog`,...e})}function Le({...e}){return(0,z.jsx)(he,{"data-slot":`alert-dialog-portal`,...e})}function $({className:e,...t}){return(0,z.jsx)(ge,{"data-slot":`alert-dialog-overlay`,className:o(`fixed inset-0 z-50 bg-overlay/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}function Re({className:e,size:t=`default`,onOpenAutoFocus:n,onCloseAutoFocus:r,...i}){let a=p(n,r);return(0,z.jsxs)(Le,{children:[(0,z.jsx)($,{}),(0,z.jsx)(_e,{"data-slot":`alert-dialog-content`,"data-size":t,className:o(`group/alert-dialog-content fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border bg-card p-6 shadow-lg duration-200 data-[size=sm]:max-w-xs data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[size=default]:sm:max-w-lg`,e),...i,...a})]})}function ze({className:e,...t}){return(0,z.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:o(`grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]`,e),...t})}function Be({className:e,...t}){return(0,z.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:o(`flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end`,e),...t})}function Ve({className:e,...t}){return(0,z.jsx)(be,{"data-slot":`alert-dialog-title`,className:o(`text-lg font-semibold sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2`,e),...t})}function He({className:e,...t}){return(0,z.jsx)(xe,{"data-slot":`alert-dialog-description`,className:o(`text-sm text-muted-foreground`,e),...t})}function Ue({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,z.jsx)(M,{variant:t,size:n,asChild:!0,children:(0,z.jsx)(ve,{"data-slot":`alert-dialog-action`,className:o(e),...r})})}function We({className:e,variant:t=`outline`,size:n=`default`,...r}){return(0,z.jsx)(M,{variant:t,size:n,asChild:!0,children:(0,z.jsx)(ye,{"data-slot":`alert-dialog-cancel`,className:o(e),...r})})}var Ge=({open:e,onOpenChange:t,title:n,description:r,confirmLabel:o,cancelLabel:s,destructive:c=!1,onConfirm:l,acknowledgement:u,pending:d,pendingLabel:f,error:p})=>{let{t:m}=i(),h=(0,R.useId)(),[g,_]=(0,R.useState)(!1),[v,b]=(0,R.useState)(e);e!==v&&(b(e),e&&_(!1));let x=d!==void 0,C=d===!0,w=u!==void 0&&!g,T=O({variant:c?`destructive`:`default`});return(0,z.jsx)(Ie,{open:e,onOpenChange:e=>C&&!e?void 0:t(e),children:(0,z.jsxs)(Re,{children:[(0,z.jsxs)(ze,{children:[(0,z.jsx)(Ve,{children:n}),(0,z.jsx)(He,{children:r})]}),u?(0,z.jsxs)(S,{orientation:`horizontal`,children:[(0,z.jsx)(Q,{id:h,checked:g,disabled:C,onCheckedChange:e=>_(e===!0)}),(0,z.jsx)(y,{htmlFor:h,className:`font-normal`,children:u})]}):null,x?(0,z.jsx)(Z,{error:p}):null,(0,z.jsxs)(Be,{children:[(0,z.jsx)(We,{disabled:C,children:s??m(`common.cancel`)}),x?(0,z.jsx)(M,{type:`button`,variant:c?`destructive`:`default`,disabled:C||w,"aria-busy":C||void 0,onClick:l,children:C?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(a,{className:`animate-spin`,"aria-hidden":`true`}),f??o]}):o}):(0,z.jsx)(Ue,{className:T,disabled:w,onClick:l,children:o})]})]})})};export{Y as a,L as c,Z as i,Q as n,X as o,Fe as r,Pe as s,Ge as t};
|
|
2
|
+
//# sourceMappingURL=ConfirmDialog-D6rs75TP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfirmDialog-D6rs75TP.js","names":["__defProp","__name","AlertDialog","DialogPrimitive.Root","DialogPrimitive.Trigger","AlertDialogPortal","DialogPrimitive.Portal","AlertDialogOverlay","DialogPrimitive.Overlay","AlertDialogContent","DialogPrimitive.Content","AlertDialogTitle","DialogPrimitive.Title","AlertDialogDescription","DialogPrimitive.Description","AlertDialogAction","DialogPrimitive.Close","AlertDialogCancel","Checkbox","Fragment","AlertCircle","useId","useRef","useState","_Fragment","Loader2","CheckboxPrimitive.Root","CheckboxPrimitive.Indicator","MinusIcon","CheckIcon","AlertDialogPrimitive.Root","AlertDialogPrimitive.Portal","AlertDialogPrimitive.Overlay","AlertDialogPrimitive.Content","AlertDialogPrimitive.Title","AlertDialogPrimitive.Description","AlertDialogPrimitive.Action","AlertDialogPrimitive.Cancel","useId","useState","_Fragment","Loader2","__toESM","require_jsx_runtime","createLucideIcon","useTranslation","LoaderCircle","cn","DialogOverlay","createDialogScope","DialogTrigger","DialogDescription","DialogTitle","DialogClose","useReturnFocus","DialogPortal","DialogContent","Dialog","useSize","PopoverTrigger","FieldLabel","PopoverContent","Popover","Field","PopoverAnchor","Minus","cva","Check","useComposedRefs","buttonVariants","Primitive","useControllableState","Presence","Button","describeError","composeEventHandlers","createContextScope","__iconData","CircleAlert","import_react","require_react","import_jsx_runtime","__defProp$1","__name$1","target","createAlertDialogContext","createAlertDialogScope","useDialogScope","AlertDialog$1","alertDialogProps","props","dialogScope","__scopeAlertDialog","triggerProps","forwardedRef","AlertDialogPortal$1","portalProps","AlertDialogOverlay$1","overlayProps","AlertDialogContentProvider","useAlertDialogContentContext","AlertDialogContent$1","contentProps","contentRef","composedRefs","cancelRef","event","AlertDialogTitle$1","titleProps","AlertDialogDescription$1","descriptionProps","AlertDialogAction$1","actionProps","CANCEL_NAME","AlertDialogCancel$1","cancelProps","ref","Root2","Portal2","Overlay2","Content2","Action","Cancel","Title2","Description2","__defProp","__name","CHECKBOX_NAME","createCheckboxContext","createCheckboxScope","CheckboxProviderImpl","useCheckboxContext","CheckboxProvider","checkedProp","checked","setChecked","defaultChecked","onCheckedChange","control","setControl","bubbleInput","setBubbleInput","hasConsumerStoppedPropagationRef","userInteractionCount","onUserInteraction","count","isFormControl","form","context","__scopeCheckbox","isFunction","internal_do_not_use_render","children","TRIGGER_NAME","CheckboxTrigger","checkboxProps","initialCheckedStateRef","reset","isIndeterminate","required","getState","disabled","onKeyDown","onClick","prevChecked","Checkbox$1","CheckboxBubbleInput","INDICATOR_NAME","CheckboxIndicator","indicatorProps","forceMount","BUBBLE_INPUT_NAME","controlSize","shouldStopClickPropagationRef","prevCheckedRef","prevUserInteractionCountRef","input","inputProto","isUserInteraction","checkedChanged","bubbles","defaultCheckedRef","value","alertVariants","Alert","className","AlertTitle","AlertDescription","FormError","error","InlineConfirm","titleId","descriptionId","confirmRef","uncontrolledOpen","setUncontrolledOpen","pending","setPending","setError","open","changeOpen","next","requestOpenChange","confirm","result","onConfirm","reason","returnFocus","tone","onCloseAutoFocus","description","title","cancelLabel","t","pendingLabel","confirmLabel","Checkbox","AlertDialog","AlertDialogPortal","AlertDialogOverlay","AlertDialogContent","onOpenAutoFocus","size","AlertDialogHeader","AlertDialogFooter","AlertDialogTitle","AlertDialogDescription","AlertDialogAction","AlertDialogCancel","ConfirmDialog","acknowledgementId","acknowledged","setAcknowledged","wasOpen","setWasOpen","isAsync","busy","blocked","acknowledgement","confirmClassName","destructive","onOpenChange"],"sources":["../../../../node_modules/.pnpm/lucide-react@1.49.0_@types+react@19.3.0_react@19.3.0/node_modules/lucide-react/dist/esm/icons/circle-alert.mjs","../../../../node_modules/.pnpm/@radix-ui+react-alert-dialog@1.1.23_@types+react-dom@19.3.0_@types+react@19.3.0__@types_490aa920fbab0adbc2c4344386ab6831/node_modules/@radix-ui/react-alert-dialog/dist/index.mjs","../../../../node_modules/.pnpm/@radix-ui+react-checkbox@1.3.11_@types+react-dom@19.3.0_@types+react@19.3.0__@types+rea_c6d869b9fcc94d95bd12a12175a8f53a/node_modules/@radix-ui/react-checkbox/dist/index.mjs","../../src/components/ui/alert.tsx","../../src/components/FormError/index.tsx","../../src/components/InlineConfirm/index.tsx","../../src/components/ui/checkbox.tsx","../../src/components/ui/alert-dialog.tsx","../../src/components/ConfirmDialog/index.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.49.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"circle-alert\",\n size: 24,\n node: [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }],\n [\"line\", { x1: \"12\", x2: \"12\", y1: \"8\", y2: \"12\", key: \"1pkeuh\" }],\n [\"line\", { x1: \"12\", x2: \"12.01\", y1: \"16\", y2: \"16\", key: \"4dfq90\" }]\n ],\n aliases: [\"alert-circle\"]\n};\n__iconData.node;\nconst CircleAlert = createLucideIcon(__iconData);\n\nexport { __iconData, CircleAlert as default };\n//# sourceMappingURL=circle-alert.mjs.map\n","\"use client\";\nvar __defProp = Object.defineProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\n\n// src/alert-dialog.tsx\nimport * as React from \"react\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { createDialogScope } from \"@radix-ui/react-dialog\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { jsx } from \"react/jsx-runtime\";\nvar ROOT_NAME = \"AlertDialog\";\nvar [createAlertDialogContext, createAlertDialogScope] = createContextScope(ROOT_NAME, [\n createDialogScope\n]);\nvar useDialogScope = createDialogScope();\nvar AlertDialog = /* @__PURE__ */ __name((props) => {\n const { __scopeAlertDialog, ...alertDialogProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return /* @__PURE__ */ jsx(DialogPrimitive.Root, { ...dialogScope, ...alertDialogProps, modal: true });\n}, \"AlertDialog\");\nvar AlertDialogTrigger = React.forwardRef(\n /* @__PURE__ */ __name(function AlertDialogTrigger2(props, forwardedRef) {\n const { __scopeAlertDialog, ...triggerProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return /* @__PURE__ */ jsx(DialogPrimitive.Trigger, { ...dialogScope, ...triggerProps, ref: forwardedRef });\n }, \"AlertDialogTrigger\")\n);\nvar AlertDialogPortal = /* @__PURE__ */ __name((props) => {\n const { __scopeAlertDialog, ...portalProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return /* @__PURE__ */ jsx(DialogPrimitive.Portal, { ...dialogScope, ...portalProps });\n}, \"AlertDialogPortal\");\nvar AlertDialogOverlay = React.forwardRef(\n /* @__PURE__ */ __name(function AlertDialogOverlay2(props, forwardedRef) {\n const { __scopeAlertDialog, ...overlayProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return /* @__PURE__ */ jsx(DialogPrimitive.Overlay, { ...dialogScope, ...overlayProps, ref: forwardedRef });\n }, \"AlertDialogOverlay\")\n);\nvar CONTENT_NAME = \"AlertDialogContent\";\nvar [AlertDialogContentProvider, useAlertDialogContentContext] = createAlertDialogContext(CONTENT_NAME);\nvar AlertDialogContent = React.forwardRef(\n /* @__PURE__ */ __name(function AlertDialogContent2(props, forwardedRef) {\n const { __scopeAlertDialog, children, ...contentProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n const contentRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, contentRef);\n const cancelRef = React.useRef(null);\n return /* @__PURE__ */ jsx(AlertDialogContentProvider, { scope: __scopeAlertDialog, cancelRef, children: /* @__PURE__ */ jsx(\n DialogPrimitive.Content,\n {\n role: \"alertdialog\",\n ...dialogScope,\n ...contentProps,\n ref: composedRefs,\n onOpenAutoFocus: composeEventHandlers(contentProps.onOpenAutoFocus, (event) => {\n event.preventDefault();\n cancelRef.current?.focus({ preventScroll: true });\n }),\n onPointerDownOutside: (event) => event.preventDefault(),\n onInteractOutside: (event) => event.preventDefault(),\n children\n }\n ) });\n }, \"AlertDialogContent\")\n);\nvar AlertDialogTitle = React.forwardRef(\n /* @__PURE__ */ __name(function AlertDialogTitle2(props, forwardedRef) {\n const { __scopeAlertDialog, ...titleProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return /* @__PURE__ */ jsx(DialogPrimitive.Title, { ...dialogScope, ...titleProps, ref: forwardedRef });\n }, \"AlertDialogTitle\")\n);\nvar AlertDialogDescription = React.forwardRef(/* @__PURE__ */ __name(function AlertDialogDescription2(props, forwardedRef) {\n const { __scopeAlertDialog, ...descriptionProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return /* @__PURE__ */ jsx(DialogPrimitive.Description, { ...dialogScope, ...descriptionProps, ref: forwardedRef });\n}, \"AlertDialogDescription\"));\nvar AlertDialogAction = React.forwardRef(\n /* @__PURE__ */ __name(function AlertDialogAction2(props, forwardedRef) {\n const { __scopeAlertDialog, ...actionProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return /* @__PURE__ */ jsx(DialogPrimitive.Close, { ...dialogScope, ...actionProps, ref: forwardedRef });\n }, \"AlertDialogAction\")\n);\nvar CANCEL_NAME = \"AlertDialogCancel\";\nvar AlertDialogCancel = React.forwardRef(\n /* @__PURE__ */ __name(function AlertDialogCancel2(props, forwardedRef) {\n const { __scopeAlertDialog, ...cancelProps } = props;\n const { cancelRef } = useAlertDialogContentContext(CANCEL_NAME, __scopeAlertDialog);\n const dialogScope = useDialogScope(__scopeAlertDialog);\n const ref = useComposedRefs(forwardedRef, cancelRef);\n return /* @__PURE__ */ jsx(DialogPrimitive.Close, { ...dialogScope, ...cancelProps, ref });\n }, \"AlertDialogCancel\")\n);\nvar Root2 = AlertDialog;\nvar Trigger2 = AlertDialogTrigger;\nvar Portal2 = AlertDialogPortal;\nvar Overlay2 = AlertDialogOverlay;\nvar Content2 = AlertDialogContent;\nvar Action = AlertDialogAction;\nvar Cancel = AlertDialogCancel;\nvar Title2 = AlertDialogTitle;\nvar Description2 = AlertDialogDescription;\nexport {\n Action,\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogOverlay,\n AlertDialogPortal,\n AlertDialogTitle,\n AlertDialogTrigger,\n Cancel,\n Content2 as Content,\n Description2 as Description,\n Overlay2 as Overlay,\n Portal2 as Portal,\n Root2 as Root,\n Title2 as Title,\n Trigger2 as Trigger,\n createAlertDialogScope\n};\n//# sourceMappingURL=index.mjs.map\n","\"use client\";\nvar __defProp = Object.defineProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\n\n// src/checkbox.tsx\nimport * as React from \"react\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { useSize } from \"@radix-ui/react-use-size\";\nimport { Presence } from \"@radix-ui/react-presence\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nvar CHECKBOX_NAME = \"Checkbox\";\nvar [createCheckboxContext, createCheckboxScope] = createContextScope(CHECKBOX_NAME);\nvar [CheckboxProviderImpl, useCheckboxContext] = createCheckboxContext(CHECKBOX_NAME);\nfunction CheckboxProvider(props) {\n const {\n __scopeCheckbox,\n checked: checkedProp,\n children,\n defaultChecked,\n disabled,\n form,\n name,\n onCheckedChange,\n required,\n value = \"on\",\n // @ts-expect-error\n internal_do_not_use_render\n } = props;\n const [checked, setChecked] = useControllableState({\n prop: checkedProp,\n defaultProp: defaultChecked ?? false,\n onChange: onCheckedChange,\n caller: CHECKBOX_NAME\n });\n const [control, setControl] = React.useState(null);\n const [bubbleInput, setBubbleInput] = React.useState(null);\n const hasConsumerStoppedPropagationRef = React.useRef(false);\n const [userInteractionCount, onUserInteraction] = React.useReducer(\n (count) => count + 1,\n 0\n );\n const isFormControl = control ? !!form || !!control.closest(\"form\") : (\n // We set this to true by default so that events bubble to forms without JS (SSR)\n true\n );\n const context = {\n checked,\n disabled,\n setChecked,\n control,\n setControl,\n name,\n form,\n value,\n hasConsumerStoppedPropagationRef,\n userInteractionCount,\n onUserInteraction,\n required,\n defaultChecked: isIndeterminate(defaultChecked) ? false : defaultChecked,\n isFormControl,\n bubbleInput,\n setBubbleInput\n };\n return /* @__PURE__ */ jsx(\n CheckboxProviderImpl,\n {\n scope: __scopeCheckbox,\n ...context,\n children: isFunction(internal_do_not_use_render) ? internal_do_not_use_render(context) : children\n }\n );\n}\n__name(CheckboxProvider, \"CheckboxProvider\");\nvar TRIGGER_NAME = \"CheckboxTrigger\";\nvar CheckboxTrigger = /* @__PURE__ */ React.forwardRef(\n /* @__PURE__ */ __name(function CheckboxTrigger2({ __scopeCheckbox, onKeyDown, onClick, ...checkboxProps }, forwardedRef) {\n const {\n control,\n value,\n disabled,\n checked,\n required,\n setControl,\n setChecked,\n hasConsumerStoppedPropagationRef,\n onUserInteraction,\n isFormControl,\n bubbleInput\n } = useCheckboxContext(TRIGGER_NAME, __scopeCheckbox);\n const composedRefs = useComposedRefs(forwardedRef, setControl);\n const initialCheckedStateRef = React.useRef(checked);\n React.useEffect(() => {\n const form = control?.form;\n if (form) {\n const reset = /* @__PURE__ */ __name(() => setChecked(initialCheckedStateRef.current), \"reset\");\n form.addEventListener(\"reset\", reset);\n return () => form.removeEventListener(\"reset\", reset);\n }\n }, [control, setChecked]);\n return /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n role: \"checkbox\",\n \"aria-checked\": isIndeterminate(checked) ? \"mixed\" : checked,\n \"aria-required\": required,\n \"data-state\": getState(checked),\n \"data-disabled\": disabled ? \"\" : void 0,\n disabled,\n value,\n ...checkboxProps,\n ref: composedRefs,\n onKeyDown: composeEventHandlers(onKeyDown, (event) => {\n if (event.key === \"Enter\") event.preventDefault();\n }),\n onClick: composeEventHandlers(onClick, (event) => {\n onUserInteraction();\n setChecked((prevChecked) => isIndeterminate(prevChecked) ? true : !prevChecked);\n if (bubbleInput && isFormControl) {\n hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();\n if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();\n }\n })\n }\n );\n }, \"CheckboxTrigger\")\n);\nvar Checkbox = /* @__PURE__ */ React.forwardRef(\n // blank line to reduce diff noise\n /* @__PURE__ */ __name(function Checkbox2(props, forwardedRef) {\n const {\n __scopeCheckbox,\n name,\n checked,\n defaultChecked,\n required,\n disabled,\n value,\n onCheckedChange,\n form,\n ...checkboxProps\n } = props;\n return /* @__PURE__ */ jsx(\n CheckboxProvider,\n {\n __scopeCheckbox,\n checked,\n defaultChecked,\n disabled,\n required,\n onCheckedChange,\n name,\n form,\n value,\n internal_do_not_use_render: ({ isFormControl }) => /* @__PURE__ */ jsxs(Fragment, { children: [\n /* @__PURE__ */ jsx(\n CheckboxTrigger,\n {\n ...checkboxProps,\n ref: forwardedRef,\n __scopeCheckbox\n }\n ),\n isFormControl && /* @__PURE__ */ jsx(\n CheckboxBubbleInput,\n {\n __scopeCheckbox\n }\n )\n ] })\n }\n );\n }, \"Checkbox\")\n);\nvar INDICATOR_NAME = \"CheckboxIndicator\";\nvar CheckboxIndicator = /* @__PURE__ */ React.forwardRef(\n // blank line to reduce diff noise\n /* @__PURE__ */ __name(function CheckboxIndicator2(props, forwardedRef) {\n const { __scopeCheckbox, forceMount, ...indicatorProps } = props;\n const context = useCheckboxContext(INDICATOR_NAME, __scopeCheckbox);\n return /* @__PURE__ */ jsx(\n Presence,\n {\n present: forceMount || isIndeterminate(context.checked) || context.checked === true,\n children: /* @__PURE__ */ jsx(\n Primitive.span,\n {\n \"data-state\": getState(context.checked),\n \"data-disabled\": context.disabled ? \"\" : void 0,\n ...indicatorProps,\n ref: forwardedRef,\n style: { pointerEvents: \"none\", ...props.style }\n }\n )\n }\n );\n }, \"CheckboxIndicator\")\n);\nvar BUBBLE_INPUT_NAME = \"CheckboxBubbleInput\";\nvar CheckboxBubbleInput = /* @__PURE__ */ React.forwardRef(\n // blank line to reduce diff noise\n /* @__PURE__ */ __name(function CheckboxBubbleInput2({ __scopeCheckbox, onClick, ...props }, forwardedRef) {\n const {\n control,\n hasConsumerStoppedPropagationRef,\n userInteractionCount,\n checked,\n defaultChecked,\n required,\n disabled,\n name,\n value,\n form,\n bubbleInput,\n setBubbleInput\n } = useCheckboxContext(BUBBLE_INPUT_NAME, __scopeCheckbox);\n const composedRefs = useComposedRefs(forwardedRef, setBubbleInput);\n const controlSize = useSize(control);\n const shouldStopClickPropagationRef = React.useRef(false);\n const prevCheckedRef = React.useRef(checked);\n const prevUserInteractionCountRef = React.useRef(userInteractionCount);\n React.useEffect(() => {\n const input = bubbleInput;\n if (!input) return;\n const inputProto = window.HTMLInputElement.prototype;\n const descriptor = Object.getOwnPropertyDescriptor(\n inputProto,\n \"checked\"\n );\n const setChecked = descriptor.set;\n const isUserInteraction = userInteractionCount !== prevUserInteractionCountRef.current;\n prevUserInteractionCountRef.current = userInteractionCount;\n const checkedChanged = prevCheckedRef.current !== checked;\n prevCheckedRef.current = checked;\n const bubbles = !(isUserInteraction && hasConsumerStoppedPropagationRef.current);\n if (checkedChanged && setChecked) {\n shouldStopClickPropagationRef.current = !isUserInteraction;\n const event = new Event(\"click\", { bubbles });\n input.indeterminate = isIndeterminate(checked);\n setChecked.call(input, isIndeterminate(checked) ? false : checked);\n input.dispatchEvent(event);\n shouldStopClickPropagationRef.current = false;\n }\n }, [bubbleInput, checked, hasConsumerStoppedPropagationRef, userInteractionCount]);\n const defaultCheckedRef = React.useRef(isIndeterminate(checked) ? false : checked);\n return /* @__PURE__ */ jsx(\n Primitive.input,\n {\n type: \"checkbox\",\n \"aria-hidden\": true,\n defaultChecked: defaultChecked ?? defaultCheckedRef.current,\n required,\n disabled,\n name,\n value,\n form,\n ...props,\n tabIndex: -1,\n ref: composedRefs,\n onClick: composeEventHandlers(onClick, (event) => {\n if (shouldStopClickPropagationRef.current) {\n event.stopPropagation();\n }\n }),\n style: {\n ...props.style,\n ...controlSize,\n position: \"absolute\",\n pointerEvents: \"none\",\n opacity: 0,\n margin: 0,\n // We transform because the input is absolutely positioned but we have\n // rendered it **after** the button. This pulls it back to sit on top\n // of the button.\n transform: \"translateX(-100%)\"\n }\n }\n );\n }, \"CheckboxBubbleInput\")\n);\nfunction isFunction(value) {\n return typeof value === \"function\";\n}\n__name(isFunction, \"isFunction\");\nfunction isIndeterminate(checked) {\n return checked === \"indeterminate\";\n}\n__name(isIndeterminate, \"isIndeterminate\");\nfunction getState(checked) {\n return isIndeterminate(checked) ? \"indeterminate\" : checked ? \"checked\" : \"unchecked\";\n}\n__name(getState, \"getState\");\nexport {\n Checkbox,\n CheckboxIndicator,\n CheckboxIndicator as Indicator,\n Checkbox as Root,\n createCheckboxScope,\n CheckboxBubbleInput as unstable_BubbleInput,\n CheckboxBubbleInput as unstable_CheckboxBubbleInput,\n CheckboxProvider as unstable_CheckboxProvider,\n CheckboxTrigger as unstable_CheckboxTrigger,\n CheckboxProvider as unstable_Provider,\n CheckboxTrigger as unstable_Trigger\n};\n//# sourceMappingURL=index.mjs.map\n","import { cva, type VariantProps } from 'class-variance-authority';\nimport * as React from 'react';\nimport { cn } from '@/helpers/cn';\n\nconst alertVariants = cva(\n 'relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current',\n {\n variants: {\n variant: {\n default: 'bg-card text-card-foreground',\n destructive:\n 'border-destructive/30 bg-destructive-muted text-destructive *:data-[slot=alert-description]:text-destructive [&>svg]:text-current',\n // Shapio: status alerts on the status tokens (DESIGN.md).\n warning:\n 'border-warning/30 bg-warning-muted text-warning *:data-[slot=alert-description]:text-warning [&>svg]:text-current',\n // Light: a neutral note with a cobalt icon (no blue surfaces outside the info chip); dark keeps the tint.\n info: 'border-border bg-muted text-foreground *:data-[slot=alert-description]:text-muted-foreground dark:border-info/30 dark:bg-info-muted dark:text-info dark:*:data-[slot=alert-description]:text-info [&>svg]:text-info',\n success:\n 'border-success/30 bg-success-muted text-success *:data-[slot=alert-description]:text-success [&>svg]:text-current',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n },\n);\n\nfunction Alert({\n className,\n variant,\n ...props\n}: React.ComponentProps<'div'> & VariantProps<typeof alertVariants>) {\n return (\n <div data-slot=\"alert\" role=\"alert\" className={cn(alertVariants({ variant }), className)} {...props} />\n );\n}\n\nfunction AlertTitle({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"alert-title\"\n className={cn('col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight', className)}\n {...props}\n />\n );\n}\n\nfunction AlertDescription({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"alert-description\"\n className={cn(\n 'col-start-2 grid justify-items-start gap-1 text-sm text-muted-foreground [&_p]:leading-relaxed',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Alert, AlertTitle, AlertDescription };\n","import { AlertCircle } from 'lucide-react';\nimport { Alert, AlertDescription } from '@/components/ui/alert';\nimport { describeError } from '@/helpers/describeError';\n\ntype FormErrorProps = { error: unknown };\n\n/** The server's answer to a failed form submission, shown above the submit button and announced. */\nexport const FormError = ({ error }: FormErrorProps) => {\n if (!error) {\n return null;\n }\n return (\n <Alert variant=\"destructive\">\n <AlertCircle aria-hidden=\"true\" />\n <AlertDescription>{describeError(error)}</AlertDescription>\n </Alert>\n );\n};\n","import { Loader2 } from 'lucide-react';\nimport { useId, useRef, useState, type ReactElement } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { Button } from '@/components/ui/button';\nimport { Popover, PopoverAnchor, PopoverContent, PopoverTrigger } from '@/components/ui/popover';\nimport { useReturnFocus } from '@/hooks/useReturnFocus';\nimport { FormError } from '../FormError';\n\ntype InlineConfirmCommonProps = {\n /** The question, and the popover's accessible name (\"Delete “Hero”?\"). */\n title: string;\n /** The consequence, in one line. */\n description?: string;\n confirmLabel: string;\n cancelLabel?: string;\n /** Shown on Confirm while an async `onConfirm` runs. */\n pendingLabel?: string;\n /** `danger`: red Confirm, focus starts on Cancel. `default`: primary Confirm, focus starts on it. */\n tone: 'danger' | 'default';\n /**\n * Runs on Confirm. Return nothing to close at once; return a promise (`mutateAsync`) to keep the popover\n * open with a spinner until it settles: it closes when it resolves and shows the error when it rejects.\n */\n onConfirm: () => void | Promise<unknown>;\n align?: 'start' | 'center' | 'end';\n side?: 'top' | 'right' | 'bottom' | 'left';\n /**\n * Runs as the popover closes, before focus returns to the opener. Call `event.preventDefault()` to keep\n * focus where it is (e.g. on a `SecretReveal` that a confirmed rotate just showed).\n */\n onCloseAutoFocus?: (event: Event) => void;\n};\n\n/** Trigger mode: the popover opens from this button (it gets `aria-expanded` and returns focus to it). */\ntype TriggerModeProps = InlineConfirmCommonProps & {\n trigger: ReactElement;\n open?: never;\n onOpenChange?: never;\n children?: never;\n};\n\n/**\n * Anchored mode, for actions in a menu (a menu item disappears with its menu): the caller opens it (from\n * the item's `onSelect`) and the popover points at `children`, usually the menu's own trigger button.\n */\ntype AnchoredModeProps = InlineConfirmCommonProps & {\n trigger?: never;\n open: boolean;\n onOpenChange: (open: boolean) => void;\n children: ReactElement;\n};\n\ntype InlineConfirmProps = TriggerModeProps | AnchoredModeProps;\n\n/**\n * Confirms a routine destructive or consequential action where it was asked for (DESIGN.md \"Dialogs\"): a\n * modal popover with role `alertdialog`, the question, one line of consequence and Cancel / Confirm. Escape\n * or a click outside cancels, Enter activates the focused button, focus returns to the opener.\n */\nexport const InlineConfirm = (props: InlineConfirmProps) => {\n const {\n title,\n description,\n confirmLabel,\n cancelLabel,\n pendingLabel,\n tone,\n onConfirm,\n align = 'end',\n side = 'bottom',\n onCloseAutoFocus,\n } = props;\n const { t } = useTranslation();\n const titleId = useId();\n const descriptionId = useId();\n const cancelRef = useRef<HTMLButtonElement>(null);\n const confirmRef = useRef<HTMLButtonElement>(null);\n const [uncontrolledOpen, setUncontrolledOpen] = useState(false);\n const [pending, setPending] = useState(false);\n const [error, setError] = useState<unknown>(null);\n const open = props.trigger === undefined ? props.open : uncontrolledOpen;\n\n const changeOpen = (next: boolean) => {\n if (next) {\n setError(null);\n }\n if (props.trigger === undefined) {\n props.onOpenChange(next);\n } else {\n setUncontrolledOpen(next);\n }\n };\n // Nothing dismisses it while the action runs.\n const requestOpenChange = (next: boolean) => (pending && !next ? undefined : changeOpen(next));\n\n const confirm = () => {\n const result = onConfirm();\n if (!(result instanceof Promise)) {\n changeOpen(false);\n return;\n }\n setPending(true);\n setError(null);\n result.then(\n () => {\n setPending(false);\n changeOpen(false);\n },\n (reason: unknown) => {\n // Already logged and toasted by the mutation cache; shown here too, beside the action that failed.\n setPending(false);\n setError(reason);\n },\n );\n };\n\n const returnFocus = useReturnFocus((event) => {\n event.preventDefault();\n (tone === 'danger' ? cancelRef : confirmRef).current?.focus();\n }, onCloseAutoFocus);\n\n return (\n <Popover open={open} onOpenChange={requestOpenChange} modal>\n {props.trigger === undefined ? (\n <PopoverAnchor asChild>{props.children}</PopoverAnchor>\n ) : (\n <PopoverTrigger asChild>{props.trigger}</PopoverTrigger>\n )}\n <PopoverContent\n role=\"alertdialog\"\n // Modal like Radix's own dialogs: focus is trapped and the rest of the page is aria-hidden. Declaring\n // it lets assistive technology (and axe's aria-hidden-focus rule) know the hidden page is inert.\n aria-modal=\"true\"\n aria-labelledby={titleId}\n aria-describedby={description ? descriptionId : undefined}\n align={align}\n side={side}\n className=\"w-80 space-y-4\"\n {...returnFocus}\n >\n <div className=\"space-y-1\">\n <p id={titleId} className=\"text-sm font-semibold\">\n {title}\n </p>\n {description ? (\n <p id={descriptionId} className=\"text-meta text-muted-foreground\">\n {description}\n </p>\n ) : null}\n </div>\n <FormError error={error} />\n <div className=\"flex justify-end gap-2\">\n <Button\n ref={cancelRef}\n type=\"button\"\n size=\"sm\"\n variant=\"outline\"\n disabled={pending}\n onClick={() => changeOpen(false)}\n >\n {cancelLabel ?? t('common.cancel')}\n </Button>\n <Button\n ref={confirmRef}\n type=\"button\"\n size=\"sm\"\n variant={tone === 'danger' ? 'destructive' : 'default'}\n disabled={pending}\n aria-busy={pending || undefined}\n onClick={confirm}\n >\n {pending ? (\n <>\n <Loader2 className=\"animate-spin\" aria-hidden=\"true\" />\n {pendingLabel ?? confirmLabel}\n </>\n ) : (\n confirmLabel\n )}\n </Button>\n </div>\n </PopoverContent>\n </Popover>\n );\n};\n","import { CheckIcon, MinusIcon } from 'lucide-react';\nimport { Checkbox as CheckboxPrimitive } from 'radix-ui';\nimport * as React from 'react';\nimport { cn } from '@/helpers/cn';\n\nfunction Checkbox({ className, ...props }: React.ComponentProps<typeof CheckboxPrimitive.Root>) {\n return (\n <CheckboxPrimitive.Root\n data-slot=\"checkbox\"\n className={cn(\n 'peer size-4 shrink-0 rounded-[4px] border border-input shadow-xs transition-shadow outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=indeterminate]:border-primary data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground dark:bg-input/30 dark:aria-invalid:ring-destructive/40 dark:data-[state=checked]:bg-primary dark:data-[state=indeterminate]:bg-primary',\n className,\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n className=\"grid place-content-center text-current transition-none\"\n >\n {props.checked === 'indeterminate' ? (\n <MinusIcon className=\"size-3.5\" />\n ) : (\n <CheckIcon className=\"size-3.5\" />\n )}\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n );\n}\n\nexport { Checkbox };\n","'use client';\n\nimport { AlertDialog as AlertDialogPrimitive } from 'radix-ui';\nimport * as React from 'react';\nimport { Button } from '@/components/ui/button';\nimport { cn } from '@/helpers/cn';\nimport { useReturnFocus } from '@/hooks/useReturnFocus';\n\nfunction AlertDialog({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Root>) {\n return <AlertDialogPrimitive.Root data-slot=\"alert-dialog\" {...props} />;\n}\n\nfunction AlertDialogTrigger({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>) {\n return <AlertDialogPrimitive.Trigger data-slot=\"alert-dialog-trigger\" {...props} />;\n}\n\nfunction AlertDialogPortal({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Portal>) {\n return <AlertDialogPrimitive.Portal data-slot=\"alert-dialog-portal\" {...props} />;\n}\n\nfunction AlertDialogOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Overlay>) {\n return (\n <AlertDialogPrimitive.Overlay\n data-slot=\"alert-dialog-overlay\"\n className={cn(\n 'fixed inset-0 z-50 bg-overlay/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction AlertDialogContent({\n className,\n size = 'default',\n onOpenAutoFocus,\n onCloseAutoFocus,\n ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Content> & {\n size?: 'default' | 'sm';\n}) {\n const returnFocus = useReturnFocus(onOpenAutoFocus, onCloseAutoFocus);\n return (\n <AlertDialogPortal>\n <AlertDialogOverlay />\n <AlertDialogPrimitive.Content\n data-slot=\"alert-dialog-content\"\n data-size={size}\n className={cn(\n 'group/alert-dialog-content fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border bg-card p-6 shadow-lg duration-200 data-[size=sm]:max-w-xs data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[size=default]:sm:max-w-lg',\n className,\n )}\n {...props}\n {...returnFocus}\n />\n </AlertDialogPortal>\n );\n}\n\nfunction AlertDialogHeader({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"alert-dialog-header\"\n className={cn(\n 'grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction AlertDialogFooter({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"alert-dialog-footer\"\n className={cn(\n 'flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction AlertDialogTitle({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Title>) {\n return (\n <AlertDialogPrimitive.Title\n data-slot=\"alert-dialog-title\"\n className={cn(\n 'text-lg font-semibold sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction AlertDialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Description>) {\n return (\n <AlertDialogPrimitive.Description\n data-slot=\"alert-dialog-description\"\n className={cn('text-sm text-muted-foreground', className)}\n {...props}\n />\n );\n}\n\nfunction AlertDialogMedia({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"alert-dialog-media\"\n className={cn(\n \"mb-2 inline-flex size-16 items-center justify-center rounded-md bg-muted sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-8\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction AlertDialogAction({\n className,\n variant = 'default',\n size = 'default',\n ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Action> &\n Pick<React.ComponentProps<typeof Button>, 'variant' | 'size'>) {\n return (\n <Button variant={variant} size={size} asChild>\n <AlertDialogPrimitive.Action data-slot=\"alert-dialog-action\" className={cn(className)} {...props} />\n </Button>\n );\n}\n\nfunction AlertDialogCancel({\n className,\n variant = 'outline',\n size = 'default',\n ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Cancel> &\n Pick<React.ComponentProps<typeof Button>, 'variant' | 'size'>) {\n return (\n <Button variant={variant} size={size} asChild>\n <AlertDialogPrimitive.Cancel data-slot=\"alert-dialog-cancel\" className={cn(className)} {...props} />\n </Button>\n );\n}\n\nexport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogMedia,\n AlertDialogOverlay,\n AlertDialogPortal,\n AlertDialogTitle,\n AlertDialogTrigger,\n};\n","import { Loader2 } from 'lucide-react';\nimport { useId, useState } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n} from '@/components/ui/alert-dialog';\nimport { Button, buttonVariants } from '@/components/ui/button';\nimport { Checkbox } from '@/components/ui/checkbox';\nimport { Field, FieldLabel } from '@/components/ui/field';\nimport { FormError } from '../FormError';\n\ntype ConfirmDialogProps = {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n title: string;\n description: string;\n confirmLabel: string;\n cancelLabel?: string;\n destructive?: boolean;\n onConfirm: () => void;\n /** When set, Confirm stays disabled until this statement is checked (unticked on every open). */\n acknowledgement?: string;\n /**\n * Async mode: pass the mutation's pending state. Confirm then doesn't close the dialog; the caller closes\n * it on success. While pending, Confirm shows `pendingLabel` and the dialog can't be dismissed.\n */\n pending?: boolean;\n pendingLabel?: string;\n /** The failed attempt's error, shown above the buttons (async mode). */\n error?: unknown;\n};\n\n/**\n * A blocking yes/no question, kept only for irreversible acknowledgements (DESIGN.md \"Dialogs\"). Focus starts\n * on Cancel (Radix default).\n */\nexport const ConfirmDialog = ({\n open,\n onOpenChange,\n title,\n description,\n confirmLabel,\n cancelLabel,\n destructive = false,\n onConfirm,\n acknowledgement,\n pending,\n pendingLabel,\n error,\n}: ConfirmDialogProps) => {\n const { t } = useTranslation();\n const acknowledgementId = useId();\n const [acknowledged, setAcknowledged] = useState(false);\n const [wasOpen, setWasOpen] = useState(open);\n if (open !== wasOpen) {\n setWasOpen(open);\n if (open) {\n setAcknowledged(false);\n }\n }\n const isAsync = pending !== undefined;\n const busy = pending === true;\n const blocked = acknowledgement !== undefined && !acknowledged;\n const confirmClassName = buttonVariants({ variant: destructive ? 'destructive' : 'default' });\n return (\n <AlertDialog open={open} onOpenChange={(next) => (busy && !next ? undefined : onOpenChange(next))}>\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>{title}</AlertDialogTitle>\n <AlertDialogDescription>{description}</AlertDialogDescription>\n </AlertDialogHeader>\n {acknowledgement ? (\n <Field orientation=\"horizontal\">\n <Checkbox\n id={acknowledgementId}\n checked={acknowledged}\n disabled={busy}\n onCheckedChange={(checked) => setAcknowledged(checked === true)}\n />\n <FieldLabel htmlFor={acknowledgementId} className=\"font-normal\">\n {acknowledgement}\n </FieldLabel>\n </Field>\n ) : null}\n {isAsync ? <FormError error={error} /> : null}\n <AlertDialogFooter>\n <AlertDialogCancel disabled={busy}>{cancelLabel ?? t('common.cancel')}</AlertDialogCancel>\n {isAsync ? (\n <Button\n type=\"button\"\n variant={destructive ? 'destructive' : 'default'}\n disabled={busy || blocked}\n aria-busy={busy || undefined}\n onClick={onConfirm}\n >\n {busy ? (\n <>\n <Loader2 className=\"animate-spin\" aria-hidden=\"true\" />\n {pendingLabel ?? confirmLabel}\n </>\n ) : (\n confirmLabel\n )}\n </Button>\n ) : (\n <AlertDialogAction className={confirmClassName} disabled={blocked} onClick={onConfirm}>\n {confirmLabel}\n </AlertDialogAction>\n )}\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n );\n};\n"],"ignoreList":[0,1,2],"mappings":"k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AAAzC,EAAAA,SAAA,CAAA,SAAA,EACE,EAAAyC,EAAA,IAAA,CAACxC,EAAD,CAAS,UAAU,eAAe,cAAY,MAAQ,CAAA,EACrD6K,GAAgBC,CACjB,CAAA,CAAA,EAEFA,CAEI,CAAA,GAER,EAAAtI,EAAA,IAAA,CAACkJ,GAAD,CAAmB,UAAWY,EAAkB,SAAUF,EAAS,QAAShC,EACzE,SAAAU,CACgB,CAAA,CAEJ,CAAA,CAAA,CACD,CAAA,CAAA,CACT,CAAA,CAEjB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./react-CQOZoUwg.js";import{t as n}from"./jsx-runtime-DREnUpxT.js";import{j as r}from"./cn-DnXL75B0.js";import{U as i}from"./InfoHint-DBqcrmZ3.js";import{O as a,i as o}from"./skeleton-DUvclBAr.js";import{t as s}from"./copy-B5B8RjV0.js";var c=e(t(),1),l=e(n(),1),u=2e3,d=({value:e,ref:t})=>{let{t:n}=r(),[d,f]=(0,c.useState)(!1),p=async()=>{try{await navigator.clipboard.writeText(e),f(!0),setTimeout(()=>f(!1),u)}catch(e){i(e,`copy to clipboard`)}};return(0,l.jsxs)(o,{ref:t,type:`button`,variant:`outline`,onClick:()=>void p(),children:[d?(0,l.jsx)(a,{"aria-hidden":`true`}):(0,l.jsx)(s,{"aria-hidden":`true`}),(0,l.jsx)(`span`,{"aria-live":`polite`,children:n(d?`common.copied`:`common.copy`)})]})};export{d as t};
|
|
2
|
+
//# sourceMappingURL=CopyButton-Bc7crFDE.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CopyButton-Bc7crFDE.js","names":["useState","__toESM","require_jsx_runtime","useTranslation","reportError","Check","Button","Copy","import_react","require_react","import_jsx_runtime","COPIED_RESET_MS","CopyButton","copied","setCopied","copy","value","error","t"],"sources":["../../src/components/CopyButton/index.tsx"],"sourcesContent":["import { Check, Copy } from 'lucide-react';\nimport { useState, type Ref } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { Button } from '@/components/ui/button';\nimport { reportError } from '@/helpers/reportError';\n\ntype CopyButtonProps = {\n value: string;\n /** For a caller that moves focus to the button (SecretReveal on mount). */\n ref?: Ref<HTMLButtonElement>;\n};\n\nconst COPIED_RESET_MS = 2000;\n\nexport const CopyButton = ({ value, ref }: CopyButtonProps) => {\n const { t } = useTranslation();\n const [copied, setCopied] = useState(false);\n const copy = async () => {\n try {\n await navigator.clipboard.writeText(value);\n setCopied(true);\n setTimeout(() => setCopied(false), COPIED_RESET_MS);\n } catch (error) {\n reportError(error, 'copy to clipboard');\n }\n };\n return (\n <Button ref={ref} type=\"button\" variant=\"outline\" onClick={() => void copy()}>\n {copied ? <Check aria-hidden=\"true\" /> : <Copy aria-hidden=\"true\" />}\n <span aria-live=\"polite\">{copied ? t('common.copied') : t('common.copy')}</span>\n </Button>\n );\n};\n"],"mappings":"uUAYMW,EAAkB,IAEXC,GAAc,CAAE,QAAO,SAA2B,CAC7D,GAAM,CAAE,KAAMT,EAAe,EACvB,CAACU,EAAQC,IAAA,EAAad,EAAAA,SAAAA,CAAS,EAAK,EACpCe,EAAO,SAAY,CACvB,GAAI,CACF,MAAM,UAAU,UAAU,UAAUC,CAAK,EACzCF,EAAU,EAAI,EACd,eAAiBA,EAAU,EAAK,EAAGH,CAAe,CACpD,OAASM,EAAO,CACdb,EAAYa,EAAO,mBAAmB,CACxC,CACF,EACA,OACE,EAAAP,EAAA,KAAA,CAACJ,EAAD,CAAa,MAAK,KAAK,SAAS,QAAQ,UAAU,YAAe,KAAKS,EAAK,EAA3E,SAAA,CACGF,GAAS,EAAAH,EAAA,IAAA,CAACL,EAAD,CAAO,cAAY,MAAQ,CAAA,GAAI,EAAAK,EAAA,IAAA,CAACH,EAAD,CAAM,cAAY,MAAQ,CAAA,GACnE,EAAAG,EAAA,IAAA,CAAC,OAAD,CAAM,YAAU,SAAU,SAASQ,EAATL,EAAW,gBAAqB,aAAa,CAAQ,CAAA,CACzE,GAEZ"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./jsx-runtime-DREnUpxT.js";import{i as n,j as r,t as i}from"./cn-DnXL75B0.js";import{D as a,i as o}from"./skeleton-DUvclBAr.js";import{t as s}from"./chevron-left-DyqYjcMB.js";var c={name:`chevrons-left`,size:24,node:[[`path`,{d:`m11 17-5-5 5-5`,key:`13zhaf`}],[`path`,{d:`m18 17-5-5 5-5`,key:`h8a8et`}]]};c.node;var l=n(c),u=e(t(),1),d=({onFirst:e,onPrevious:t,onNext:n,className:c})=>{let{t:d}=r();return(0,u.jsxs)(`nav`,{"aria-label":d(`common.pagination`),className:i(`flex items-center justify-end gap-2`,c),children:[(0,u.jsx)(o,{variant:`outline`,size:`icon-sm`,"aria-label":d(`common.first`),disabled:!e,onClick:e,children:(0,u.jsx)(l,{"aria-hidden":`true`})}),(0,u.jsx)(o,{variant:`outline`,size:`icon-sm`,"aria-label":d(`common.previous`),disabled:!t,onClick:t,children:(0,u.jsx)(s,{"aria-hidden":`true`})}),(0,u.jsx)(o,{variant:`outline`,size:`icon-sm`,"aria-label":d(`common.next`),disabled:!n,onClick:n,children:(0,u.jsx)(a,{"aria-hidden":`true`})})]})};export{d as t};
|
|
2
|
+
//# sourceMappingURL=CursorPager-BFPD_adV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CursorPager-BFPD_adV.js","names":["__toESM","createLucideIcon","useTranslation","cn","ChevronRight","Button","ChevronLeft","__iconData","ChevronsLeft","import_jsx_runtime","require_jsx_runtime","CursorPager","t","className","onFirst","onPrevious","onNext"],"sources":["../../../../node_modules/.pnpm/lucide-react@1.49.0_@types+react@19.3.0_react@19.3.0/node_modules/lucide-react/dist/esm/icons/chevrons-left.mjs","../../src/components/CursorPager/index.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.49.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"chevrons-left\",\n size: 24,\n node: [\n [\"path\", { d: \"m11 17-5-5 5-5\", key: \"13zhaf\" }],\n [\"path\", { d: \"m18 17-5-5 5-5\", key: \"h8a8et\" }]\n ]\n};\n__iconData.node;\nconst ChevronsLeft = createLucideIcon(__iconData);\n\nexport { __iconData, ChevronsLeft as default };\n//# sourceMappingURL=chevrons-left.mjs.map\n","import { ChevronLeft, ChevronRight, ChevronsLeft } from 'lucide-react';\nimport { useTranslation } from 'react-i18next';\nimport { Button } from '@/components/ui/button';\nimport { cn } from '@/helpers/cn';\n\ntype CursorPagerProps = {\n /** Undefined when already on the first page. */\n onFirst: (() => void) | undefined;\n onPrevious: (() => void) | undefined;\n /** Undefined when there is no further page. */\n onNext: (() => void) | undefined;\n className?: string;\n};\n\n/** Paging for cursor-paginated lists (newest first, no total): Newest, Previous, Next as icon buttons. */\nexport const CursorPager = ({ onFirst, onPrevious, onNext, className }: CursorPagerProps) => {\n const { t } = useTranslation();\n return (\n <nav aria-label={t('common.pagination')} className={cn('flex items-center justify-end gap-2', className)}>\n <Button\n variant=\"outline\"\n size=\"icon-sm\"\n aria-label={t('common.first')}\n disabled={!onFirst}\n onClick={onFirst}\n >\n <ChevronsLeft aria-hidden=\"true\" />\n </Button>\n <Button\n variant=\"outline\"\n size=\"icon-sm\"\n aria-label={t('common.previous')}\n disabled={!onPrevious}\n onClick={onPrevious}\n >\n <ChevronLeft aria-hidden=\"true\" />\n </Button>\n <Button\n variant=\"outline\"\n size=\"icon-sm\"\n aria-label={t('common.next')}\n disabled={!onNext}\n onClick={onNext}\n >\n <ChevronRight aria-hidden=\"true\" />\n </Button>\n </nav>\n );\n};\n"],"ignoreList":[0],"mappings":"gPASA,IAAMO,EAAa,CACjB,KAAM,gBACN,KAAM,GACN,KAAM,CACJ,CAAC,OAAQ,CAAE,EAAG,iBAAkB,IAAK,QAAS,CAAC,EAC/C,CAAC,OAAQ,CAAE,EAAG,iBAAkB,IAAK,QAAS,CAAC,CACjD,CACF,EACAA,EAAW,KACX,IAAMC,EAAeP,EAAiBM,CAAU,aCHnCI,GAAe,CAAE,UAAS,aAAY,SAAQ,eAAkC,CAC3F,GAAM,CAAE,KAAMT,EAAe,EAC7B,OACE,EAAAO,EAAA,KAAA,CAAC,MAAD,CAAK,aAAYG,EAAE,mBAAmB,EAAG,UAAWT,EAAG,sCAAuCU,CAAS,EAAvG,SAAA,EACE,EAAAJ,EAAA,IAAA,CAACJ,EAAD,CACE,QAAQ,UACR,KAAK,UACL,aAAYO,EAAE,cAAc,EAC5B,SAAU,CAACE,EACX,QAASA,EAET,UAAA,EAAAL,EAAA,IAAA,CAACD,EAAD,CAAc,cAAY,MAAQ,CAAA,CAC5B,CAAA,GACR,EAAAC,EAAA,IAAA,CAACJ,EAAD,CACE,QAAQ,UACR,KAAK,UACL,aAAYO,EAAE,iBAAiB,EAC/B,SAAU,CAACG,EACX,QAASA,EAET,UAAA,EAAAN,EAAA,IAAA,CAACH,EAAD,CAAa,cAAY,MAAQ,CAAA,CAC3B,CAAA,GACR,EAAAG,EAAA,IAAA,CAACJ,EAAD,CACE,QAAQ,UACR,KAAK,UACL,aAAYO,EAAE,aAAa,EAC3B,SAAU,CAACI,EACX,QAASA,EAET,UAAA,EAAAP,EAAA,IAAA,CAACL,EAAD,CAAc,cAAY,MAAQ,CAAA,CAC5B,CAAA,CACL,GAET"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./jsx-runtime-DREnUpxT.js";import{j as n}from"./cn-DnXL75B0.js";import{t as r}from"./external-link-YnuWXDBk.js";var i=e(t(),1),a=({href:e,children:t})=>{let{t:a}=n();return(0,i.jsxs)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 rounded-sm font-medium break-all text-link underline-offset-4 outline-none hover:underline focus-visible:ring-[3px] focus-visible:ring-ring/50`,children:[t,(0,i.jsx)(r,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),(0,i.jsx)(`span`,{className:`sr-only`,children:a(`publishing.opensInNewTab`)})]})};export{a as t};
|
|
2
|
+
//# sourceMappingURL=ExternalLink-Cdfcyyed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExternalLink-Cdfcyyed.js","names":["ExternalLinkIcon","__toESM","useTranslation","ExternalLink$1","import_jsx_runtime","require_jsx_runtime","ExternalLink","children","t"],"sources":["../../src/features/Publishing/ExternalLink/index.tsx"],"sourcesContent":["import { ExternalLink as ExternalLinkIcon } from 'lucide-react';\nimport type { ReactNode } from 'react';\nimport { useTranslation } from 'react-i18next';\n\ntype ExternalLinkProps = { href: string; children: ReactNode };\n\n/** A link that leaves the admin in a new tab, without giving the other site access to this window. */\nexport const ExternalLink = ({ href, children }: ExternalLinkProps) => {\n const { t } = useTranslation();\n return (\n <a\n href={href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"inline-flex items-center gap-1 rounded-sm font-medium break-all text-link underline-offset-4 outline-none hover:underline focus-visible:ring-[3px] focus-visible:ring-ring/50\"\n >\n {children}\n <ExternalLinkIcon className=\"size-3.5 shrink-0\" aria-hidden=\"true\" />\n <span className=\"sr-only\">{t('publishing.opensInNewTab')}</span>\n </a>\n );\n};\n"],"mappings":"gMAOaM,GAAgB,CAAE,OAAM,cAAkC,CACrE,GAAM,CAAE,KAAMJ,EAAe,EAC7B,OACE,EAAAE,EAAA,KAAA,CAAC,IAAD,CACQ,OACN,OAAO,SACP,IAAI,sBACJ,UAAU,gLAJZ,SAAA,CAMGG,GACD,EAAAH,EAAA,IAAA,CAACJ,EAAD,CAAkB,UAAU,oBAAoB,cAAY,MAAQ,CAAA,GACpE,EAAAI,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,UAAW,SAAAI,EAAE,0BAA0B,CAAQ,CAAA,CAC9D,GAEP"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./jsx-runtime-DREnUpxT.js";import{c as n,d as r,f as i,o as a,p as o}from"./InfoHint-DBqcrmZ3.js";import{n as s}from"./ConfirmDialog-D6rs75TP.js";import{c,r as l}from"./zod-Pf5A-ax4.js";var u=[`publish`,`unpublish`],d=[`scheduled`,`done`,`failed`,`cancelled`],f=[`generic_webhook`,`cloudflare_pages`,`vercel`,`netlify`,`github`],p=[`publish`,`change_set`,`schema`,`manual`],m=e(t(),1),h=({control:e,name:t,legend:u,description:d,options:f,disabled:p})=>{let{field:h,fieldState:g}=c({control:e,name:t}),_=h.value??[],v=(e,t)=>h.onChange(t?[..._,e]:_.filter(t=>t!==e)),y=g.error?.message;return(0,m.jsxs)(o,{"data-invalid":g.invalid||void 0,children:[(0,m.jsx)(i,{variant:`label`,children:u}),d?(0,m.jsx)(n,{children:d}):null,(0,m.jsx)(`div`,{"data-slot":`checkbox-group`,className:`grid gap-3 sm:grid-cols-2`,children:f.map(e=>{let n=`field-${t}-${e.value}`;return(0,m.jsxs)(a,{orientation:`horizontal`,children:[(0,m.jsx)(s,{id:n,checked:_.includes(e.value),onCheckedChange:t=>v(e.value,t===!0),onBlur:h.onBlur,disabled:p}),(0,m.jsx)(r,{htmlFor:n,className:`font-normal`,children:e.label})]},e.value)})}),(0,m.jsx)(l,{message:y})]})};export{d as a,u as i,f as n,p as r,h as t};
|
|
2
|
+
//# sourceMappingURL=FormCheckboxGroup-Bicl1CBP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormCheckboxGroup-Bicl1CBP.js","names":["__toESM","FieldDescription","FieldLabel","FieldLegend","Field","FieldSet","Checkbox","FormFieldError","PUBLICATION_ACTIONS","SCHEDULE_STATUSES","DEPLOYMENT_PROVIDERS","DEPLOYMENT_TRIGGERS","import_jsx_runtime","require_jsx_runtime","FormCheckboxGroup","useController","selected","field","toggle","checked","value","item","errorMessage","fieldState","legend","description","options","id","name","option"],"sources":["../../../../packages/client/src/admin/publishingTypes.ts","../../src/components/FormCheckboxGroup/index.tsx"],"sourcesContent":["/**\n * Publishing types (package H, `apps/api/src/routes/admin/{jobs,publishing,webhooks,deployments,preview}`).\n * Dates are ISO-8601 strings.\n */\nimport type { SiteRef } from './sitesTypes.js';\n\nexport type Page<T> = { items: T[]; nextCursor: string | null };\n\n// Jobs ---------------------------------------------------------------------------------------------\n\nexport const JOB_STATUSES = ['pending', 'running', 'succeeded', 'dead'] as const;\nexport type JobStatus = (typeof JOB_STATUSES)[number];\n\nexport type Job = {\n id: string;\n type: string;\n status: JobStatus;\n attempts: number;\n maxAttempts: number;\n /** When it runs next (pending) or ran last. */\n runAt: string;\n idempotencyKey: string | null;\n lockedBy: string | null;\n lockedUntil: string | null;\n /** Payload and result with secret-looking values replaced by `[redacted]`. */\n payload: unknown;\n result: unknown;\n /** Progress a long job saved (e.g. an import's phase and counts); null when it saved none. */\n progress: unknown;\n lastError: string | null;\n createdAt: string;\n updatedAt: string;\n finishedAt: string | null;\n};\n\nexport type JobQuery = { status?: JobStatus; type?: string; cursor?: string; limit?: number };\n\nexport type JobSummary = { counts: Record<JobStatus, number>; types: string[] };\n\n// Scheduled publications ---------------------------------------------------------------------------\n\nexport const PUBLICATION_ACTIONS = ['publish', 'unpublish'] as const;\nexport type PublicationAction = (typeof PUBLICATION_ACTIONS)[number];\n\nexport const SCHEDULE_STATUSES = ['scheduled', 'done', 'failed', 'cancelled'] as const;\nexport type ScheduleStatus = (typeof SCHEDULE_STATUSES)[number];\n\nexport type ScheduledPublication = {\n id: string;\n entryId: string;\n modelId: string;\n /** Null when the model no longer exists. */\n modelKey: string | null;\n locale: string;\n action: PublicationAction;\n runAt: string;\n status: ScheduleStatus;\n error: string | null;\n /** Publication sequence the change was published at (once done). */\n snapshot: number | null;\n createdBy: string | null;\n createdAt: string;\n executedAt: string | null;\n};\n\nexport type ScheduleQuery = { status?: ScheduleStatus; entryId?: string; cursor?: string; limit?: number };\n\nexport type CreateScheduleInput = {\n modelKey: string;\n entryId: string;\n /** Omit for non-localized models (and for the default locale). */\n locale?: string;\n action: PublicationAction;\n runAt: string;\n};\n\n// Webhooks -----------------------------------------------------------------------------------------\n\nexport type WebhookEventType = { type: string; group: string };\n\nexport type WebhookDeliveryStatus = 'pending' | 'retrying' | 'succeeded' | 'dead';\n\nexport type Webhook = {\n id: string;\n name: string;\n url: string;\n /** Event types or `group.*` patterns. */\n events: string[];\n enabled: boolean;\n allowPrivateNetwork: boolean;\n maxAttempts: number;\n /** The site whose events it receives; null for a network-wide webhook (every site's events). */\n site: SiteRef | null;\n lastDelivery: { status: WebhookDeliveryStatus; at: string } | null;\n createdBy: string | null;\n createdAt: string;\n updatedAt: string;\n version: number;\n};\n\nexport type CreateWebhookInput = {\n name: string;\n url: string;\n events: string[];\n enabled?: boolean;\n allowPrivateNetwork?: boolean;\n maxAttempts?: number;\n /** A network-wide webhook (every site's events); otherwise it belongs to the request's site. */\n network?: boolean;\n};\n\n/** A webhook's site is fixed once created. */\nexport type UpdateWebhookInput = Partial<Omit<CreateWebhookInput, 'network'>> & { expectedVersion: number };\n\n/** The JSON body every webhook delivery sends (signed; verify it with `verifyWebhookSignature`). */\nexport type WebhookEventBody = {\n id: string;\n type: string;\n createdAt: string;\n /** The site the event is about; null for events about no site (network-wide). */\n site: SiteRef | null;\n data: unknown;\n};\n\n/** `secret` is shown once: on creation and after rotation. */\nexport type WebhookWithSecret = { webhook: Webhook; secret: string };\n\nexport type WebhookAttempt = {\n attempt: number;\n at: string;\n durationMs: number;\n request: { method: string; url: string; headers: Record<string, string> };\n /** Null when no response arrived (refused, timeout, blocked by the network policy). */\n response: { status: number; headers: Record<string, string>; body: string; truncated: boolean } | null;\n error: string | null;\n};\n\nexport type WebhookDelivery = {\n id: string;\n webhookId: string;\n eventId: string | null;\n eventType: string;\n isTest: boolean;\n status: WebhookDeliveryStatus;\n attempts: number;\n lastResponseStatus: number | null;\n lastError: string | null;\n payload: unknown;\n attemptLog: WebhookAttempt[];\n createdAt: string;\n updatedAt: string;\n deliveredAt: string | null;\n};\n\n// Deployments --------------------------------------------------------------------------------------\n\nexport const DEPLOYMENT_PROVIDERS = [\n 'generic_webhook',\n 'cloudflare_pages',\n 'vercel',\n 'netlify',\n 'github',\n] as const;\nexport type DeploymentProvider = (typeof DEPLOYMENT_PROVIDERS)[number];\n\nexport const DEPLOYMENT_TRIGGERS = ['publish', 'change_set', 'schema', 'manual'] as const;\nexport type DeploymentTriggerPolicy = (typeof DEPLOYMENT_TRIGGERS)[number];\n\nexport const DEPLOYMENT_RUN_STATUSES = [\n 'queued',\n 'triggered',\n 'building',\n 'deployed',\n 'failed',\n 'unknown',\n] as const;\nexport type DeploymentRunStatus = (typeof DEPLOYMENT_RUN_STATUSES)[number];\n\nexport type DeploymentRunTrigger = 'publish' | 'change_set' | 'schema' | 'manual' | 'retry';\n\n/**\n * Provider settings (not secret). Generic: `{ url }`. Cloudflare Pages: `{ accountId, projectName }`.\n * GitHub: `{ owner, repo, branch, mode: 'commit' | 'pull_request', directory }`.\n */\nexport type DeploymentSettings = Record<string, string>;\n\n/**\n * Secret names per provider. Generic: `signingSecret` (generated when omitted). Cloudflare Pages:\n * `deployHookUrl`, `apiToken`. GitHub: `token`. Values are write-only. A value of `${ENV:VAR_NAME}`\n * makes the server read the secret from that environment variable instead of storing it.\n */\nexport type DeploymentSecretsInput = Record<string, string>;\n\n/** Which secrets are set; values never leave the server. `envVar`: read from this environment variable. */\nexport type DeploymentSecretState = Record<string, { set: boolean; envVar: string | null }>;\n\nexport type DeploymentTimelineEvent = {\n status: DeploymentRunStatus;\n at: string;\n source: 'shapio' | 'callback' | 'provider';\n message: string | null;\n};\n\nexport type DeploymentRun = {\n id: string;\n connectionId: string;\n connectionName: string;\n provider: DeploymentProvider;\n status: DeploymentRunStatus;\n trigger: DeploymentRunTrigger;\n /** Publication sequence the run was triggered at (`?snapshot=` on delivery). */\n snapshot: number | null;\n schemaVersion: number | null;\n retryOf: string | null;\n providerRef: string | null;\n logUrl: string | null;\n siteUrl: string | null;\n error: string | null;\n /** False for providers that cannot report completion without callbacks (shown as \"completion unknown\"). */\n completionReported: boolean;\n timeline: DeploymentTimelineEvent[];\n triggeredAt: string | null;\n finishedAt: string | null;\n createdAt: string;\n updatedAt: string;\n};\n\nexport type DeploymentConnection = {\n id: string;\n name: string;\n provider: DeploymentProvider;\n settings: DeploymentSettings;\n secrets: DeploymentSecretState;\n previewUrlTemplate: string | null;\n /** Preview tokens issued for this connection show exactly what this delivery role reads. */\n deliveryRoleId: string | null;\n triggerPolicy: DeploymentTriggerPolicy[];\n debounceSeconds: number;\n allowPrivateNetwork: boolean;\n enabled: boolean;\n /** Where the site posts signed build callbacks (generic webhook connections). */\n callbackUrl: string;\n latestRun: DeploymentRun | null;\n /** The newest deployed run by snapshot: what the site is serving, as far as Shapio knows. */\n currentRun: DeploymentRun | null;\n createdBy: string | null;\n createdAt: string;\n updatedAt: string;\n version: number;\n};\n\nexport type CreateDeploymentConnectionInput = {\n name: string;\n provider: DeploymentProvider;\n settings: DeploymentSettings;\n secrets: DeploymentSecretsInput;\n previewUrlTemplate?: string | null;\n triggerPolicy: DeploymentTriggerPolicy[];\n debounceSeconds?: number;\n allowPrivateNetwork?: boolean;\n enabled?: boolean;\n deliveryRoleId?: string | null;\n};\n\nexport type UpdateDeploymentConnectionInput = Partial<Omit<CreateDeploymentConnectionInput, 'provider'>> & {\n expectedVersion: number;\n};\n\n/** `generatedSecrets` holds secrets Shapio generated (the generic signing secret), shown once. */\nexport type DeploymentConnectionCreated = {\n connection: DeploymentConnection;\n generatedSecrets: Record<string, string>;\n};\n\nexport type ConnectionTestResult = {\n ok: boolean;\n checks: Array<{ name: string; ok: boolean; message: string }>;\n};\n\nexport type DeploymentRunQuery = { connectionId?: string; cursor?: string; limit?: number };\n\n// Preview ------------------------------------------------------------------------------------------\n\nexport type PreviewToken = {\n id: string;\n tokenPrefix: string;\n modelId: string;\n modelKey: string | null;\n entryId: string | null;\n locale: string | null;\n connectionId: string | null;\n /** Fields follow this delivery role (within the creator's access); null = the public fields. */\n deliveryRoleId: string | null;\n createdBy: string;\n expiresAt: string;\n revokedAt: string | null;\n lastUsedAt: string | null;\n createdAt: string;\n};\n\nexport type CreatePreviewTokenInput = {\n modelKey: string;\n entryId?: string;\n locale?: string;\n /** Default 1 hour, at most 30 days. */\n ttlSeconds?: number;\n connectionId?: string;\n /** Defaults to the connection's delivery role. */\n deliveryRoleId?: string;\n};\n\n/** `token` is shown once. `url` is rendered from the connection's preview URL template (null without one). */\nexport type PreviewTokenCreated = { token: string; previewToken: PreviewToken; url: string | null };\n\nexport type OpenPreviewInput = {\n modelKey: string;\n entryId: string;\n locale?: string;\n /** Defaults to the first enabled connection with a preview URL template. */\n connectionId?: string;\n};\n\n/** What the entry form's Preview button opens. `apiUrl` is the preview read endpoint for this entry. */\nexport type OpenPreviewResult = {\n /** The token's ID (revoke it when the preview closes). */\n id: string;\n url: string | null;\n apiUrl: string;\n token: string;\n expiresAt: string;\n connectionId: string | null;\n};\n\n/** A connection the site's previews open on (names and origins only). */\nexport type PreviewTarget = {\n connectionId: string;\n name: string;\n /** null when the preview URL template's origin depends on a variable. */\n origin: string | null;\n /** Whether the admin can show it in its preview frame. */\n framable: boolean;\n};\n","import { useController, type Control, type FieldPath, type FieldValues } from 'react-hook-form';\nimport { Checkbox } from '@/components/ui/checkbox';\nimport { Field, FieldDescription, FieldLabel, FieldLegend, FieldSet } from '@/components/ui/field';\nimport { FormFieldError } from '../FormFieldError';\n\nexport type CheckboxOption = { value: string; label: string; description?: string };\n\ntype FormCheckboxGroupProps<TValues extends FieldValues> = {\n control: Control<TValues>;\n name: FieldPath<TValues>;\n legend: string;\n description?: string;\n options: readonly CheckboxOption[];\n disabled?: boolean;\n};\n\n/** A fieldset of checkboxes bound to a `string[]` form value. */\nexport const FormCheckboxGroup = <TValues extends FieldValues>({\n control,\n name,\n legend,\n description,\n options,\n disabled,\n}: FormCheckboxGroupProps<TValues>) => {\n const { field, fieldState } = useController({ control, name });\n const selected = (field.value as string[] | undefined) ?? [];\n const toggle = (value: string, checked: boolean) =>\n field.onChange(checked ? [...selected, value] : selected.filter((item) => item !== value));\n const errorMessage = fieldState.error?.message;\n return (\n <FieldSet data-invalid={fieldState.invalid || undefined}>\n <FieldLegend variant=\"label\">{legend}</FieldLegend>\n {description ? <FieldDescription>{description}</FieldDescription> : null}\n <div data-slot=\"checkbox-group\" className=\"grid gap-3 sm:grid-cols-2\">\n {options.map((option) => {\n const id = `field-${name}-${option.value}`;\n return (\n <Field key={option.value} orientation=\"horizontal\">\n <Checkbox\n id={id}\n checked={selected.includes(option.value)}\n onCheckedChange={(checked) => toggle(option.value, checked === true)}\n onBlur={field.onBlur}\n disabled={disabled}\n />\n <FieldLabel htmlFor={id} className=\"font-normal\">\n {option.label}\n </FieldLabel>\n </Field>\n );\n })}\n </div>\n <FormFieldError message={errorMessage} />\n </FieldSet>\n );\n};\n"],"mappings":"2PAyCA,IAAaQ,EAAsB,CAAC,UAAW,WAAW,EAG7CC,EAAoB,CAAC,YAAa,OAAQ,SAAU,WAAW,EAgH/DC,EAAuB,CAClC,kBACA,mBACA,SACA,UACA,QACF,EAGaC,EAAsB,CAAC,UAAW,aAAc,SAAU,QAAQ,aCpJlEG,GAAkD,CAC7D,UACA,OACA,SACA,cACA,UACA,cACqC,CACrC,GAAM,CAAE,QAAO,cAAeC,EAAc,CAAE,UAAS,MAAK,CAAC,EACvDC,EAAYC,EAAM,OAAkC,CAAC,EACrDC,GAAU,EAAe,IAC7BD,EAAM,SAASE,EAAU,CAAC,GAAGH,EAAUI,CAAK,EAAIJ,EAAS,OAAQ,GAASK,IAASD,CAAK,CAAC,EACrFE,EAAeC,EAAW,OAAO,QACvC,OACE,EAAAX,EAAA,KAAA,CAACP,EAAD,CAAU,eAAckB,EAAW,SAAW,IAAA,GAA9C,SAAA,EACE,EAAAX,EAAA,IAAA,CAACT,EAAD,CAAa,QAAQ,QAAS,SAAAqB,CAAoB,CAAA,EACjDC,GAAc,EAAAb,EAAA,IAAA,CAACX,EAAD,CAAA,SAAmBwB,CAA8B,CAAA,EAAI,MACpE,EAAAb,EAAA,IAAA,CAAC,MAAD,CAAK,YAAU,iBAAiB,UAAU,4BACvC,SAAAc,EAAQ,IAAK,GAAW,CACvB,IAAMC,EAAK,SAASC,EAAK,GAAGC,EAAO,QACnC,OACE,EAAAjB,EAAA,KAAA,CAACR,EAAD,CAA0B,YAAY,aAAtC,SAAA,EACE,EAAAQ,EAAA,IAAA,CAACN,EAAD,CACM,KACJ,QAASU,EAAS,SAASa,EAAO,KAAK,EACvC,gBAAkB,GAAYX,EAAOW,EAAO,MAAOV,IAAY,EAAI,EACnE,OAAQF,EAAM,OACJ,UACX,CAAA,GACD,EAAAL,EAAA,IAAA,CAACV,EAAD,CAAY,QAASyB,EAAI,UAAU,cAChC,SAAAE,EAAO,KACE,CAAA,CACP,CAXK,EAAAA,EAAO,KAWZ,CAEX,CAAC,CACE,CAAA,GACL,EAAAjB,EAAA,IAAA,CAACL,EAAD,CAAgB,QAASe,CAAe,CAAA,CAChC,GAEd"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./jsx-runtime-DREnUpxT.js";import{c as n,d as r,f as i,o as a,p as o,s}from"./InfoHint-DBqcrmZ3.js";import{n as c,t as l}from"./radio-group-DVR0mTpo.js";import{c as u,r as d}from"./zod-Pf5A-ax4.js";var f=e(t(),1),p=({control:e,name:t,legend:p,options:m,disabled:h})=>{let{field:g,fieldState:_}=u({control:e,name:t}),v=`field-${t}-legend`,y=`field-${t}-error`,b=_.error?.message;return(0,f.jsxs)(o,{"data-invalid":_.invalid||void 0,children:[(0,f.jsx)(i,{id:v,variant:`label`,children:p}),(0,f.jsx)(l,{"aria-labelledby":v,"aria-describedby":b?y:void 0,"aria-invalid":_.invalid||void 0,value:g.value??``,onValueChange:g.onChange,onBlur:g.onBlur,disabled:h,children:m.map(e=>{let i=`field-${t}-${e.value}`,o=e.description?`${i}-description`:void 0;return(0,f.jsxs)(a,{orientation:`horizontal`,children:[(0,f.jsx)(c,{id:i,value:e.value,"aria-describedby":o}),(0,f.jsxs)(s,{children:[(0,f.jsx)(r,{htmlFor:i,className:`font-normal`,children:e.label}),e.description?(0,f.jsx)(n,{id:o,children:e.description}):null]})]},e.value)})}),(0,f.jsx)(d,{id:y,message:b})]})};export{p as t};
|
|
2
|
+
//# sourceMappingURL=FormRadioGroup-34iVSV4L.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormRadioGroup-34iVSV4L.js","names":["__toESM","FieldDescription","FieldLabel","FieldLegend","Field","FieldSet","RadioGroupItem","RadioGroup","useController","FormFieldError","import_jsx_runtime","require_jsx_runtime","FormRadioGroup","legendId","name","errorId","errorMessage","fieldState","legend","field","options","id","option","descriptionId","FieldContent"],"sources":["../../src/components/FormRadioGroup/index.tsx"],"sourcesContent":["import { useController, type Control, type FieldPath, type FieldValues } from 'react-hook-form';\nimport {\n Field,\n FieldContent,\n FieldDescription,\n FieldLabel,\n FieldLegend,\n FieldSet,\n} from '@/components/ui/field';\nimport { RadioGroup, RadioGroupItem } from '@/components/ui/radio-group';\nimport { FormFieldError } from '../FormFieldError';\n\nexport type RadioOption = { value: string; label: string; description?: string };\n\ntype FormRadioGroupProps<TValues extends FieldValues> = {\n control: Control<TValues>;\n name: FieldPath<TValues>;\n legend: string;\n options: readonly RadioOption[];\n disabled?: boolean;\n};\n\n/**\n * A fieldset of radio buttons bound to a `string` form value: exactly one choice. Arrow keys move between\n * options and Tab enters at the checked one; each option's description is linked to its radio.\n */\nexport const FormRadioGroup = <TValues extends FieldValues>({\n control,\n name,\n legend,\n options,\n disabled,\n}: FormRadioGroupProps<TValues>) => {\n const { field, fieldState } = useController({ control, name });\n const legendId = `field-${name}-legend`;\n const errorId = `field-${name}-error`;\n const errorMessage = fieldState.error?.message;\n return (\n <FieldSet data-invalid={fieldState.invalid || undefined}>\n <FieldLegend id={legendId} variant=\"label\">\n {legend}\n </FieldLegend>\n <RadioGroup\n aria-labelledby={legendId}\n aria-describedby={errorMessage ? errorId : undefined}\n aria-invalid={fieldState.invalid || undefined}\n value={field.value ?? ''}\n onValueChange={field.onChange}\n onBlur={field.onBlur}\n disabled={disabled}\n >\n {options.map((option) => {\n const id = `field-${name}-${option.value}`;\n const descriptionId = option.description ? `${id}-description` : undefined;\n return (\n <Field key={option.value} orientation=\"horizontal\">\n <RadioGroupItem id={id} value={option.value} aria-describedby={descriptionId} />\n <FieldContent>\n <FieldLabel htmlFor={id} className=\"font-normal\">\n {option.label}\n </FieldLabel>\n {option.description ? (\n <FieldDescription id={descriptionId}>{option.description}</FieldDescription>\n ) : null}\n </FieldContent>\n </Field>\n );\n })}\n </RadioGroup>\n <FormFieldError id={errorId} message={errorMessage} />\n </FieldSet>\n );\n};\n"],"mappings":"sRA0BaY,GAA+C,CAC1D,UACA,OACA,SACA,UACA,cACkC,CAClC,GAAM,CAAE,QAAO,cAAeJ,EAAc,CAAE,UAAS,MAAK,CAAC,EACvDK,EAAW,SAASC,EAAK,SACzBC,EAAU,SAASD,EAAK,QACxBE,EAAeC,EAAW,OAAO,QACvC,OACE,EAAAP,EAAA,KAAA,CAACL,EAAD,CAAU,eAAcY,EAAW,SAAW,IAAA,GAA9C,SAAA,EACE,EAAAP,EAAA,IAAA,CAACP,EAAD,CAAa,GAAIU,EAAU,QAAQ,QAChC,SAAAK,CACU,CAAA,GACb,EAAAR,EAAA,IAAA,CAACH,EAAD,CACE,kBAAiBM,EACjB,mBAAkBG,EAAeD,EAAU,IAAA,GAC3C,eAAcE,EAAW,SAAW,IAAA,GACpC,MAAOE,EAAM,OAAS,GACtB,cAAeA,EAAM,SACrB,OAAQA,EAAM,OACJ,WAET,SAAAC,EAAQ,IAAK,GAAW,CACvB,IAAMC,EAAK,SAASP,EAAK,GAAGQ,EAAO,QAC7BC,EAAgBD,EAAO,YAAc,GAAGD,EAAG,cAAgB,IAAA,GACjE,OACE,EAAAX,EAAA,KAAA,CAACN,EAAD,CAA0B,YAAY,aAAtC,SAAA,EACE,EAAAM,EAAA,IAAA,CAACJ,EAAD,CAAoB,KAAI,MAAOgB,EAAO,MAAO,mBAAkBC,CAAgB,CAAA,GAC/E,EAAAb,EAAA,KAAA,CAACc,EAAD,CAAA,SAAA,EACE,EAAAd,EAAA,IAAA,CAACR,EAAD,CAAY,QAASmB,EAAI,UAAU,cAChC,SAAAC,EAAO,KACE,CAAA,EACXA,EAAO,aACN,EAAAZ,EAAA,IAAA,CAACT,EAAD,CAAkB,GAAIsB,EAAgB,SAAAD,EAAO,WAA8B,CAAA,EACzE,IACQ,CAAA,CAAA,CACT,CAVK,EAAAA,EAAO,KAUZ,CAEX,CAAC,CACS,CAAA,GACZ,EAAAZ,EAAA,IAAA,CAACD,EAAD,CAAgB,GAAIM,EAAS,QAASC,CAAe,CAAA,CAC7C,GAEd"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./jsx-runtime-DREnUpxT.js";import{j as n,t as r}from"./cn-DnXL75B0.js";import{_ as i,c as a,d as o,f as s,m as c,p as l,u}from"./badge-CMox6-v3.js";import{c as d,o as f,u as p}from"./InfoHint-DBqcrmZ3.js";import{i as m}from"./skeleton-DUvclBAr.js";import{a as h,i as g,n as _,r as v,t as y}from"./select--nGB4WjU.js";import{c as b,r as x}from"./zod-Pf5A-ax4.js";import{n as S}from"./settle-LRKtTN_e.js";import{t as C}from"./HintedLabel-jKLM0ETt.js";import{t as w}from"./useDiscardGuard-7rRGpd4q.js";var T=e(t(),1),E=({open:e,onOpenChange:t,title:d,description:f,dirty:h,pending:g,submitLabel:_,pendingLabel:v,onSubmit:y,size:b,bodyClassName:x,onCloseAutoFocus:S,children:C})=>{let{t:E}=n(),{requestOpenChange:D,discardPrompt:O}=w({dirty:h,pending:g,onOpenChange:t});return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(a,{open:e,onOpenChange:D,children:(0,T.jsxs)(u,{size:b,...f?{}:{"aria-describedby":void 0},...S?{onCloseAutoFocus:S}:{},children:[(0,T.jsxs)(l,{className:`pr-14`,children:[(0,T.jsx)(c,{children:d}),f?(0,T.jsx)(o,{children:f}):null]}),(0,T.jsxs)(`form`,{noValidate:!0,onSubmit:y,className:`flex min-h-0 flex-1 flex-col`,children:[(0,T.jsx)(p,{className:r(`relative min-h-0 flex-1 gap-5 overflow-y-auto px-6 pt-1 pb-6`,x),children:C}),(0,T.jsxs)(s,{children:[(0,T.jsx)(m,{type:`button`,variant:`outline`,onClick:()=>D(!1),children:E(`common.cancel`)}),(0,T.jsx)(i,{pending:g,pendingLabel:v,children:_})]})]})]})}),O]})},D=({control:e,name:t,label:n,hint:r,description:i,placeholder:a,options:o,disabled:s})=>{let{field:{ref:c,onBlur:l,onChange:u,value:p,name:m},fieldState:w}=b({control:e,name:t}),E=`field-${t}`,D=w.error?.message,O=r?`${E}-hint`:void 0;return(0,T.jsxs)(f,{"data-invalid":w.invalid||void 0,children:[(0,T.jsx)(C,{htmlFor:E,label:n,hint:r,hintId:O}),(0,T.jsxs)(y,{name:m,value:typeof p==`string`?p:``,onValueChange:u,disabled:s,children:[(0,T.jsx)(g,{id:E,ref:c,onBlur:l,"aria-invalid":w.invalid||void 0,"aria-describedby":S(O,i&&`${E}-description`,D&&`${E}-error`),className:`w-full`,children:(0,T.jsx)(h,{placeholder:a})}),(0,T.jsx)(_,{children:o.map(e=>(0,T.jsx)(v,{value:e.value,children:e.label},e.value))})]}),i?(0,T.jsx)(d,{id:`${E}-description`,children:i}):null,(0,T.jsx)(x,{id:`${E}-error`,message:D})]})};export{E as n,D as t};
|
|
2
|
+
//# sourceMappingURL=FormSelectField-Ba4fIu-8.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormSelectField-Ba4fIu-8.js","names":["_Fragment","__toESM","useTranslation","cn","SubmitButton","Sheet","SheetDescription","SheetFooter","SheetTitle","SheetHeader","FieldDescription","Field","FieldGroup","Button","SelectValue","SelectTrigger","SelectContent","SelectItem","Select","useController","FormFieldError","describedBy","HintedLabel","useDiscardGuard","import_jsx_runtime","require_jsx_runtime","FormSheet","requestOpenChange","SheetContent","description","onCloseAutoFocus","title","bodyClassName","t","submitLabel","discardPrompt","FormSelectField","fieldName","id","name","errorMessage","fieldState","hintId","hint","value","onChange","options","option"],"sources":["../../src/components/FormSheet/index.tsx","../../src/components/FormSelectField/index.tsx"],"sourcesContent":["import type { FormEventHandler, ReactNode } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { Button } from '@/components/ui/button';\nimport { FieldGroup } from '@/components/ui/field';\nimport {\n Sheet,\n SheetContent,\n SheetDescription,\n SheetFooter,\n SheetHeader,\n SheetTitle,\n} from '@/components/ui/sheet';\nimport { cn } from '@/helpers/cn';\nimport { useDiscardGuard } from '@/hooks/useDiscardGuard';\nimport { SubmitButton } from '../SubmitButton';\n\ntype FormSheetProps = {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n title: string;\n description?: string;\n /** Unsaved edits: closing asks before discarding them. */\n dirty: boolean;\n pending: boolean;\n submitLabel: string;\n pendingLabel: string;\n onSubmit: FormEventHandler<HTMLFormElement>;\n /** sm 400px (default), md 560px, lg 720px from the sm breakpoint; full width on phones. */\n size?: 'sm' | 'md' | 'lg';\n /** Layout overrides for the scrolling body (e.g. a split layout whose panes scroll on their own). */\n bodyClassName?: string;\n /**\n * Runs as the sheet finishes closing, before focus returns to the opener. Call `event.preventDefault()` to\n * keep focus where it is (e.g. on a `SecretReveal` that took it).\n */\n onCloseAutoFocus?: (event: Event) => void;\n children: ReactNode;\n};\n\n/**\n * A form in a right-hand sheet: create or edit a record while the list stays in view. Labelled,\n * keyboard-closable and protected against losing unsaved edits; the header and the footer (Cancel, then the\n * primary action) stay put while a long body scrolls.\n */\nexport const FormSheet = ({\n open,\n onOpenChange,\n title,\n description,\n dirty,\n pending,\n submitLabel,\n pendingLabel,\n onSubmit,\n size,\n bodyClassName,\n onCloseAutoFocus,\n children,\n}: FormSheetProps) => {\n const { t } = useTranslation();\n const { requestOpenChange, discardPrompt } = useDiscardGuard({ dirty, pending, onOpenChange });\n return (\n <>\n <Sheet open={open} onOpenChange={requestOpenChange}>\n <SheetContent\n size={size}\n {...(description ? {} : { 'aria-describedby': undefined })}\n {...(onCloseAutoFocus ? { onCloseAutoFocus } : {})}\n >\n <SheetHeader className=\"pr-14\">\n <SheetTitle>{title}</SheetTitle>\n {description ? <SheetDescription>{description}</SheetDescription> : null}\n </SheetHeader>\n <form noValidate onSubmit={onSubmit} className=\"flex min-h-0 flex-1 flex-col\">\n {/* The scrolling body is the field group itself, so `bodyClassName` lays out the fields. */}\n <FieldGroup\n className={cn('relative min-h-0 flex-1 gap-5 overflow-y-auto px-6 pt-1 pb-6', bodyClassName)}\n >\n {children}\n </FieldGroup>\n <SheetFooter>\n <Button type=\"button\" variant=\"outline\" onClick={() => requestOpenChange(false)}>\n {t('common.cancel')}\n </Button>\n <SubmitButton pending={pending} pendingLabel={pendingLabel}>\n {submitLabel}\n </SubmitButton>\n </SheetFooter>\n </form>\n </SheetContent>\n </Sheet>\n {discardPrompt}\n </>\n );\n};\n","import { useController, type Control, type FieldPath, type FieldValues } from 'react-hook-form';\nimport { Field, FieldDescription } from '@/components/ui/field';\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';\nimport { describedBy } from '@/helpers/describedBy';\nimport { FormFieldError } from '../FormFieldError';\nimport { HintedLabel } from '../HintedLabel';\n\nexport type SelectOption = { value: string; label: string };\n\ntype FormSelectFieldProps<TValues extends FieldValues> = {\n control: Control<TValues>;\n name: FieldPath<TValues>;\n label: string;\n /** Explanation behind an info icon next to the label (DESIGN.md, helper-text rule). */\n hint?: string;\n description?: string;\n placeholder?: string;\n options: readonly SelectOption[];\n disabled?: boolean;\n};\n\nexport const FormSelectField = <TValues extends FieldValues>({\n control,\n name,\n label,\n hint,\n description,\n placeholder,\n options,\n disabled,\n}: FormSelectFieldProps<TValues>) => {\n const {\n field: { ref, onBlur, onChange, value, name: fieldName },\n fieldState,\n } = useController({ control, name });\n const id = `field-${name}`;\n const errorMessage = fieldState.error?.message;\n const hintId = hint ? `${id}-hint` : undefined;\n return (\n <Field data-invalid={fieldState.invalid || undefined}>\n <HintedLabel htmlFor={id} label={label} hint={hint} hintId={hintId} />\n <Select\n name={fieldName}\n value={typeof value === 'string' ? value : ''}\n onValueChange={onChange}\n disabled={disabled}\n >\n <SelectTrigger\n id={id}\n ref={ref}\n onBlur={onBlur}\n aria-invalid={fieldState.invalid || undefined}\n aria-describedby={describedBy(\n hintId,\n description && `${id}-description`,\n errorMessage && `${id}-error`,\n )}\n className=\"w-full\"\n >\n <SelectValue placeholder={placeholder} />\n </SelectTrigger>\n <SelectContent>\n {options.map((option) => (\n <SelectItem key={option.value} value={option.value}>\n {option.label}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n {description ? <FieldDescription id={`${id}-description`}>{description}</FieldDescription> : null}\n <FormFieldError id={`${id}-error`} message={errorMessage} />\n </Field>\n );\n};\n"],"mappings":"mkBA4Ca0B,GAAa,CACxB,OACA,eACA,QACA,cACA,QACA,UACA,cACA,eACA,WACA,OACA,gBACA,mBACA,cACoB,CACpB,GAAM,CAAE,KAAMxB,EAAe,EACvB,CAAE,oBAAmB,iBAAkBqB,EAAgB,CAAE,QAAO,UAAS,cAAa,CAAC,EAC7F,OACE,EAAAC,EAAA,KAAA,CAAAxB,EAAAA,SAAA,CAAA,SAAA,EACE,EAAAwB,EAAA,IAAA,CAACnB,EAAD,CAAa,OAAM,aAAcsB,EAC/B,UAAA,EAAAH,EAAA,KAAA,CAACI,EAAD,CACQ,OACN,GAAKC,EAAc,CAAC,EAAI,CAAE,mBAAoB,IAAA,EAAU,EACxD,GAAKC,EAAmB,CAAE,kBA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E,KAAMmB,EACN,MAAO,OAAOO,GAAU,SAAWA,EAAQ,GAC3C,cAAeC,EACL,WAJZ,SAAA,EAME,EAAArB,EAAA,IAAA,CAACT,EAAD,CACM,KACC,MACG,SACR,eAAc0B,EAAW,SAAW,IAAA,GACpC,mBAAkBpB,EAChBqB,EACAb,GAAe,GAAGS,EAAG,cACrBE,GAAgB,GAAGF,EAAG,OACxB,EACA,UAAU,SAEV,UAAA,EAAAd,EAAA,IAAA,CAACV,EAAD,CAA0B,aAAc,CAAA,CAC3B,CAAA,GACf,EAAAU,EAAA,IAAA,CAACR,EAAD,CAAA,SACG8B,EAAQ,IAAK,IACZ,EAAAtB,EAAA,IAAA,CAACP,EAAD,CAA+B,MAAO8B,EAAO,MAC1C,SAAAA,EAAO,KACE,EAFKA,EAAO,KAEZ,CACb,CACY,CAAA,CACT,IACPlB,GAAc,EAAAL,EAAA,IAAA,CAACd,EAAD,CAAkB,GAAI,GAAG4B,EAAG,cAAgB,SAAAT,CAA8B,CAAA,EAAI,MAC7F,EAAAL,EAAA,IAAA,CAACJ,EAAD,CAAgB,GAAI,GAAGkB,EAAG,QAAS,QAASE,CAAe,CAAA,CACtD,GAEX"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./jsx-runtime-DREnUpxT.js";import{c as n,o as r,s as i}from"./InfoHint-DBqcrmZ3.js";import{E as a}from"./skeleton-DUvclBAr.js";import{t as o}from"./switch-B-FbT-l8.js";import{c as s,r as c}from"./zod-Pf5A-ax4.js";import{n as l}from"./settle-LRKtTN_e.js";import{t as u}from"./HintedLabel-jKLM0ETt.js";var d=e(t(),1),f=a(``,{variants:{variant:{plain:``,bordered:`gap-4 rounded-lg border bg-card p-4`}},defaultVariants:{variant:`plain`}}),p=({control:e,name:t,label:a,hint:p,description:m,disabled:h,variant:g})=>{let{field:{ref:_,onBlur:v,onChange:y,value:b,name:x},fieldState:S}=s({control:e,name:t}),C=`field-${t}`,w=p?`${C}-hint`:void 0,T=m?`${C}-description`:void 0;return(0,d.jsxs)(r,{orientation:`horizontal`,className:f({variant:g}),"data-invalid":S.invalid||void 0,children:[(0,d.jsxs)(i,{children:[(0,d.jsx)(u,{htmlFor:C,label:a,hint:p,hintId:w}),m?(0,d.jsx)(n,{id:T,children:m}):null,(0,d.jsx)(c,{id:`${C}-error`,message:S.error?.message})]}),(0,d.jsx)(o,{id:C,ref:_,name:x,checked:b===!0,onCheckedChange:y,onBlur:v,disabled:h,"aria-describedby":l(w,T)})]})};export{p as t};
|
|
2
|
+
//# sourceMappingURL=FormSwitchField-DN6bfPC0.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormSwitchField-DN6bfPC0.js","names":["__toESM","FieldDescription","Field","FieldContent","cva","Switch","useController","FormFieldError","describedBy","HintedLabel","import_jsx_runtime","require_jsx_runtime","switchFieldVariants","FormSwitchField","fieldName","id","name","hintId","hint","descriptionId","description","fieldState","value","onChange"],"sources":["../../src/components/FormSwitchField/index.tsx"],"sourcesContent":["import { cva } from 'class-variance-authority';\nimport { useController, type Control, type FieldPath, type FieldValues } from 'react-hook-form';\nimport { Field, FieldContent, FieldDescription } from '@/components/ui/field';\nimport { Switch } from '@/components/ui/switch';\nimport { describedBy } from '@/helpers/describedBy';\nimport { FormFieldError } from '../FormFieldError';\nimport { HintedLabel } from '../HintedLabel';\n\nconst switchFieldVariants = cva('', {\n variants: {\n variant: {\n plain: '',\n /** A bordered row: label and hint on the left, the switch on the right. */\n bordered: 'gap-4 rounded-lg border bg-card p-4',\n },\n },\n defaultVariants: { variant: 'plain' },\n});\n\ntype FormSwitchFieldProps<TValues extends FieldValues> = {\n control: Control<TValues>;\n name: FieldPath<TValues>;\n label: string;\n /** Explanation behind an info icon next to the label (DESIGN.md, helper-text rule). */\n hint?: string;\n description?: string;\n disabled?: boolean;\n variant?: 'plain' | 'bordered';\n};\n\n/** An on/off setting bound to a boolean form value, with its label and hint beside the switch. */\nexport const FormSwitchField = <TValues extends FieldValues>({\n control,\n name,\n label,\n hint,\n description,\n disabled,\n variant,\n}: FormSwitchFieldProps<TValues>) => {\n const {\n field: { ref, onBlur, onChange, value, name: fieldName },\n fieldState,\n } = useController({ control, name });\n const id = `field-${name}`;\n const hintId = hint ? `${id}-hint` : undefined;\n const descriptionId = description ? `${id}-description` : undefined;\n return (\n <Field\n orientation=\"horizontal\"\n className={switchFieldVariants({ variant })}\n data-invalid={fieldState.invalid || undefined}\n >\n <FieldContent>\n <HintedLabel htmlFor={id} label={label} hint={hint} hintId={hintId} />\n {description ? <FieldDescription id={descriptionId}>{description}</FieldDescription> : null}\n <FormFieldError id={`${id}-error`} message={fieldState.error?.message} />\n </FieldContent>\n <Switch\n id={id}\n ref={ref}\n name={fieldName}\n checked={value === true}\n onCheckedChange={onChange}\n onBlur={onBlur}\n disabled={disabled}\n aria-describedby={describedBy(hintId, descriptionId)}\n />\n </Field>\n );\n};\n"],"mappings":"4XAQMY,EAAsBR,EAAI,GAAI,CAClC,SAAU,CACR,QAAS,CACP,MAAO,GAEP,SAAU,qCACZ,CACF,EACA,gBAAiB,CAAE,QAAS,OAAQ,CACtC,CAAC,EAcYS,GAAgD,CAC3D,UACA,OACA,QACA,OACA,cACA,WACA,aACmC,CACnC,GAAM,CACJ,MAAO,CAAE,MAAK,SAAQ,WAAU,QAAO,KAAMC,GAC7C,cACER,EAAc,CAAE,UAAS,MAAK,CAAC,EAC7BS,EAAK,SAASC,IACdC,EAASC,EAAO,GAAGH,EAAG,OAAS,IAAA,GAC/BI,EAAgBC,EAAc,GAAGL,EAAG,cAAgB,IAAA,GAC1D,OACE,EAAAL,EAAA,KAAA,CAACR,EAAD,CACE,YAAY,aACZ,UAAWU,EAAoB,CAAE,SAAQ,CAAC,EAC1C,eAAcS,EAAW,SAAW,IAAA,GAHtC,SAAA,EAKE,EAAAX,EAAA,KAAA,CAACP,EAAD,CAAA,SAAA,EACE,EAAAO,EAAA,IAAA,CAACD,EAAD,CAAa,QAASM,EAAW,QAAa,OAAc,QAAS,CAAA,EACpEK,GAAc,EAAAV,EAAA,IAAA,CAACT,EAAD,CAAkB,GAAIkB,EAAgB,SAAAC,CAA8B,CAAA,EAAI,MACvF,EAAAV,EAAA,IAAA,CAACH,EAAD,CAAgB,GAAI,GAAGQ,EAAG,QAAS,QAASM,EAAW,OAAO,OAAU,CAAA,CAC5D,CAAA,CAAA,GACd,EAAAX,EAAA,IAAA,CAACL,EAAD,CACM,KACC,MACL,KAAMS,EACN,QAASQ,IAAU,GACnB,gBAAiBC,EACT,SACE,WACV,mBAAkBf,EAAYS,EAAQE,CAAa,CACpD,CAAA,CACI,GAEX"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./jsx-runtime-DREnUpxT.js";import{o as n}from"./InfoHint-DBqcrmZ3.js";import{c as r,r as i}from"./zod-Pf5A-ax4.js";import{n as a}from"./settle-LRKtTN_e.js";import{t as o}from"./HintedLabel-jKLM0ETt.js";import{t as s}from"./textarea-_wcx8Mn1.js";var c=e(t(),1),l=({control:e,name:t,label:l,hint:u,...d})=>{let{field:f,fieldState:p}=r({control:e,name:t}),m=`field-${t}`,h=p.error?.message,g=u?`${m}-hint`:void 0;return(0,c.jsxs)(n,{"data-invalid":p.invalid||void 0,children:[(0,c.jsx)(o,{htmlFor:m,label:l,hint:u,hintId:g}),(0,c.jsx)(s,{...d,...f,value:f.value??``,id:m,"aria-invalid":p.invalid||void 0,"aria-describedby":a(g,h&&`${m}-error`)}),(0,c.jsx)(i,{id:`${m}-error`,message:h})]})};export{l as t};
|
|
2
|
+
//# sourceMappingURL=FormTextareaField-WsNjLm32.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormTextareaField-WsNjLm32.js","names":["__toESM","Field","useController","FormFieldError","describedBy","HintedLabel","Textarea","import_jsx_runtime","require_jsx_runtime","FormTextareaField","textareaProps","id","name","errorMessage","fieldState","hintId","hint","field"],"sources":["../../src/components/FormTextareaField/index.tsx"],"sourcesContent":["import type { ComponentProps } from 'react';\nimport { useController, type Control, type FieldPath, type FieldValues } from 'react-hook-form';\nimport { Field } from '@/components/ui/field';\nimport { Textarea } from '@/components/ui/textarea';\nimport { describedBy } from '@/helpers/describedBy';\nimport { FormFieldError } from '../FormFieldError';\nimport { HintedLabel } from '../HintedLabel';\n\ntype TextareaProps = Omit<ComponentProps<typeof Textarea>, 'name' | 'value' | 'onChange' | 'onBlur' | 'id'>;\n\ntype FormTextareaFieldProps<TValues extends FieldValues> = TextareaProps & {\n control: Control<TValues>;\n name: FieldPath<TValues>;\n label: string;\n /** Explanation behind an info icon next to the label (DESIGN.md, helper-text rule). */\n hint?: string;\n};\n\nexport const FormTextareaField = <TValues extends FieldValues>({\n control,\n name,\n label,\n hint,\n ...textareaProps\n}: FormTextareaFieldProps<TValues>) => {\n const { field, fieldState } = useController({ control, name });\n const id = `field-${name}`;\n const errorMessage = fieldState.error?.message;\n const hintId = hint ? `${id}-hint` : undefined;\n return (\n <Field data-invalid={fieldState.invalid || undefined}>\n <HintedLabel htmlFor={id} label={label} hint={hint} hintId={hintId} />\n <Textarea\n {...textareaProps}\n {...field}\n value={field.value ?? ''}\n id={id}\n aria-invalid={fieldState.invalid || undefined}\n aria-describedby={describedBy(hintId, errorMessage && `${id}-error`)}\n />\n <FormFieldError id={`${id}-error`} message={errorMessage} />\n </Field>\n );\n};\n"],"mappings":"qUAkBaS,GAAkD,CAC7D,UACA,OACA,QACA,OACA,GAAGC,KACkC,CACrC,GAAM,CAAE,QAAO,cAAeR,EAAc,CAAE,UAAS,MAAK,CAAC,EACvDS,EAAK,SAASC,IACdC,EAAeC,EAAW,OAAO,QACjCC,EAASC,EAAO,GAAGL,EAAG,OAAS,IAAA,GACrC,OACE,EAAAJ,EAAA,KAAA,CAACN,EAAD,CAAO,eAAca,EAAW,SAAW,IAAA,GAA3C,SAAA,EACE,EAAAP,EAAA,IAAA,CAACF,EAAD,CAAa,QAASM,EAAW,QAAa,OAAc,QAAS,CAAA,GACrE,EAAAJ,EAAA,IAAA,CAACD,EAAD,CACE,GAAII,EACJ,GAAIO,EACJ,MAAOA,EAAM,OAAS,GAClB,KACJ,eAAcH,EAAW,SAAW,IAAA,GACpC,mBAAkBV,EAAYW,EAAQF,GAAgB,GAAGF,EAAG,OAAO,CACpE,CAAA,GACD,EAAAJ,EAAA,IAAA,CAACJ,EAAD,CAAgB,GAAI,GAAGQ,EAAG,QAAS,QAASE,CAAe,CAAA,CACtD,GAEX"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./jsx-runtime-DREnUpxT.js";import{t as n}from"./cn-DnXL75B0.js";import{d as r,t as i}from"./InfoHint-DBqcrmZ3.js";var a=e(t(),1),o=({htmlFor:e,label:t,hint:o,hintId:s,className:c})=>(0,a.jsxs)(`div`,{className:n(`flex items-center gap-1`,c),children:[(0,a.jsx)(r,{htmlFor:e,children:t}),o?(0,a.jsx)(i,{about:t,id:s,children:o}):null]});export{o as t};
|
|
2
|
+
//# sourceMappingURL=HintedLabel-jKLM0ETt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HintedLabel-jKLM0ETt.js","names":["__toESM","cn","FieldLabel","InfoHint","import_jsx_runtime","require_jsx_runtime","HintedLabel","className","label","hint","hintId"],"sources":["../../src/components/HintedLabel/index.tsx"],"sourcesContent":["import { FieldLabel } from '@/components/ui/field';\nimport { cn } from '@/helpers/cn';\nimport { InfoHint } from '../InfoHint';\n\ntype HintedLabelProps = {\n htmlFor: string;\n label: string;\n /** Optional explanation behind an info icon (see InfoHint). */\n hint?: string;\n /** Id of the hidden hint text; put it in the control's `aria-describedby`. */\n hintId?: string;\n className?: string;\n};\n\n/** A field label with an optional info-icon hint beside it (the label stays the click target). */\nexport const HintedLabel = ({ htmlFor, label, hint, hintId, className }: HintedLabelProps) => (\n <div className={cn('flex items-center gap-1', className)}>\n <FieldLabel htmlFor={htmlFor}>{label}</FieldLabel>\n {hint ? (\n <InfoHint about={label} id={hintId}>\n {hint}\n </InfoHint>\n ) : null}\n </div>\n);\n"],"mappings":"kMAeaM,GAAe,CAAE,UAAS,QAAO,OAAM,SAAQ,gBAC1D,EAAAF,EAAA,KAAA,CAAC,MAAD,CAAK,UAAWH,EAAG,0BAA2BM,CAAS,EAAvD,SAAA,EACE,EAAAH,EAAA,IAAA,CAACF,EAAD,CAAqB,UAAU,SAAAM,CAAkB,CAAA,EAChDC,GACC,EAAAL,EAAA,IAAA,CAACD,EAAD,CAAU,MAAOK,EAAO,GAAIE,EACzB,SAAAD,CACO,CAAA,EACR,IACD"}
|