themelia-react-ui 2.0.1 → 2.0.3
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/CHANGELOG.md +317 -131
- package/README.md +25 -9
- package/THIRD_PARTY_NOTICES.md +7 -0
- package/dist/{accordion-B6a3vVgA.js → accordion-Cjb6sx0G.js} +14 -13
- package/dist/accordion-Cjb6sx0G.js.map +1 -0
- package/dist/action-menu-CllU52Mm.js +280 -0
- package/dist/action-menu-CllU52Mm.js.map +1 -0
- package/dist/affordance-geometry.generated-tF36bREk.js +140 -0
- package/dist/affordance-geometry.generated-tF36bREk.js.map +1 -0
- package/dist/ai-artifact-DvTwDVyL.js +1148 -0
- package/dist/ai-artifact-DvTwDVyL.js.map +1 -0
- package/dist/{app-shell-ZK5RWdo6.js → app-shell-C4FhvCqF.js} +5 -5
- package/dist/{app-shell-ZK5RWdo6.js.map → app-shell-C4FhvCqF.js.map} +1 -1
- package/dist/attachment-BxDfL2mw.js +246 -0
- package/dist/attachment-BxDfL2mw.js.map +1 -0
- package/dist/{auth-CYxKfo69.js → auth-BGua8ouh.js} +58 -54
- package/dist/auth-BGua8ouh.js.map +1 -0
- package/dist/{avatar-BBnEJIx8.js → avatar-DAPlDvhJ.js} +7 -7
- package/dist/avatar-DAPlDvhJ.js.map +1 -0
- package/dist/{badge-MrKVNzW9.js → badge-HpFqoqSY.js} +40 -40
- package/dist/badge-HpFqoqSY.js.map +1 -0
- package/dist/base/accordion.js +1 -1
- package/dist/base/action-menu.js +1 -1
- package/dist/base/attachment.js +1 -1
- package/dist/base/avatar.js +1 -1
- package/dist/base/badge.js +1 -1
- package/dist/base/batch-action-bar.js +1 -1
- package/dist/base/buttons.js +1 -1
- package/dist/base/cards.js +2 -2
- package/dist/base/carousel.js +40 -36
- package/dist/base/carousel.js.map +1 -1
- package/dist/base/cascader.js +92 -92
- package/dist/base/cascader.js.map +1 -1
- package/dist/base/chart.js +1 -1
- package/dist/base/choice-inputs.js +2 -2
- package/dist/base/code-block.js +1 -1
- package/dist/base/combobox.js +2 -2
- package/dist/base/command.js +1 -1
- package/dist/base/copyable.js +1 -1
- package/dist/base/date-pickers.js +2 -2
- package/dist/base/display.js +6 -6
- package/dist/base/feedback.js +3 -3
- package/dist/base/forms-numeric.js +1 -1
- package/dist/base/forms.js +2 -2
- package/dist/base/inline-edit.js +14 -14
- package/dist/base/inline-edit.js.map +1 -1
- package/dist/base/item.js +1 -1
- package/dist/base/media-gallery.js +1 -1
- package/dist/base/metadata-list.js +1 -1
- package/dist/base/navigation.js +6 -6
- package/dist/base/popover-menu.js +1 -1
- package/dist/base/popover.js +1 -1
- package/dist/base/qr-code.js +1 -1
- package/dist/base/repeaters.js +171 -176
- package/dist/base/repeaters.js.map +1 -1
- package/dist/base/sheet.js +1 -1
- package/dist/base/sidebar.js +1 -1
- package/dist/base/signature-pad.js +6 -6
- package/dist/base/skeleton.js +1 -1
- package/dist/base/spinner.js +79 -2
- package/dist/base/spinner.js.map +1 -0
- package/dist/base/structure.js +1 -1
- package/dist/base/table.js +1 -1
- package/dist/base/text-inputs.js +2 -2
- package/dist/base/toaster.js +46 -45
- package/dist/base/toaster.js.map +1 -1
- package/dist/base/tree.js +1 -1
- package/dist/base/upload-queue.js +1 -1
- package/dist/base/upload.js +3 -3
- package/dist/base/value-inputs.js +1 -1
- package/dist/{batch-action-bar-BZGDG-Si.js → batch-action-bar-DnUJ21NQ.js} +6 -5
- package/dist/batch-action-bar-DnUJ21NQ.js.map +1 -0
- package/dist/blocks/admin.js +42 -42
- package/dist/blocks/admin.js.map +1 -1
- package/dist/blocks/ai.js +260 -240
- package/dist/blocks/ai.js.map +1 -1
- package/dist/blocks/analytics/usage-card.js +1 -1
- package/dist/blocks/analytics.js +620 -585
- package/dist/blocks/analytics.js.map +1 -1
- package/dist/blocks/collaboration.js +1 -1
- package/dist/blocks/commerce/receipt.js +1 -1
- package/dist/blocks/commerce.js +1152 -1109
- package/dist/blocks/commerce.js.map +1 -1
- package/dist/blocks/data-display.js +2 -2
- package/dist/blocks/onboarding.js +48 -39
- package/dist/blocks/onboarding.js.map +1 -1
- package/dist/blocks/planning.js +13 -12
- package/dist/blocks/planning.js.map +1 -1
- package/dist/blocks/timelines.js +1 -1
- package/dist/{breadcrumbs-D5t7I023.js → breadcrumbs-C-oqs1sQ.js} +5 -5
- package/dist/breadcrumbs-C-oqs1sQ.js.map +1 -0
- package/dist/{button-QYwiyhD2.js → button-DVzspB_G.js} +2 -2
- package/dist/{button-QYwiyhD2.js.map → button-DVzspB_G.js.map} +1 -1
- package/dist/{buttons-SbIcm1HJ.js → buttons-DPZekJFu.js} +20 -15
- package/dist/buttons-DPZekJFu.js.map +1 -0
- package/dist/cards-BaBZR-AU.js +68 -0
- package/dist/cards-BaBZR-AU.js.map +1 -0
- package/dist/{chart-QfrARkXl.js → chart-ZOYyK2xG.js} +58 -55
- package/dist/chart-ZOYyK2xG.js.map +1 -0
- package/dist/{checkbox-DhB6K0bK.js → checkbox-AWIhNhmo.js} +2 -2
- package/dist/{checkbox-DhB6K0bK.js.map → checkbox-AWIhNhmo.js.map} +1 -1
- package/dist/{choice-inputs-t6w3ATNz.js → choice-inputs-CNHvARCJ.js} +49 -45
- package/dist/choice-inputs-CNHvARCJ.js.map +1 -0
- package/dist/{code-block-Dgbu-CU3.js → code-block-DeneBJR_.js} +8 -8
- package/dist/code-block-DeneBJR_.js.map +1 -0
- package/dist/{collapsible-D8AEGU1-.js → collapsible-C-_l4hpy.js} +3 -3
- package/dist/{collapsible-D8AEGU1-.js.map → collapsible-C-_l4hpy.js.map} +1 -1
- package/dist/{collection-content-uK16Grv0.js → collection-content-By56pLog.js} +3 -3
- package/dist/{collection-content-uK16Grv0.js.map → collection-content-By56pLog.js.map} +1 -1
- package/dist/combobox-DaHESuiL.js +355 -0
- package/dist/combobox-DaHESuiL.js.map +1 -0
- package/dist/{combobox-DLl0bfiq.js → combobox-Dxo2fAYQ.js} +289 -279
- package/dist/combobox-Dxo2fAYQ.js.map +1 -0
- package/dist/{command-kNR20o7x.js → command-C25VMRII.js} +7 -7
- package/dist/{command-kNR20o7x.js.map → command-C25VMRII.js.map} +1 -1
- package/dist/{comments-BpDuCUUu.js → comments-DD0DUPwJ.js} +114 -105
- package/dist/comments-DD0DUPwJ.js.map +1 -0
- package/dist/components/base/badge/badge.recipes.d.ts +1 -1
- package/dist/components/base/buttons/loader-button.d.ts +2 -1
- package/dist/components/base/cards/card.recipes.d.ts +2 -3
- package/dist/components/base/cards/partials/smart-card-skeleton.d.ts +3 -13
- package/dist/components/base/cards/smart-card.types.d.ts +11 -4
- package/dist/components/base/chart/chart.d.ts +2 -5
- package/dist/components/base/combobox/combobox-field.d.ts +16 -0
- package/dist/components/base/combobox/combobox.strings.d.ts +7 -0
- package/dist/components/base/combobox/index.d.ts +30 -4
- package/dist/components/base/forms/form-sizing.d.ts +11 -3
- package/dist/components/base/navigation/pagination.d.ts +5 -2
- package/dist/components/base/popover/popover.recipes.d.ts +15 -1
- package/dist/components/base/table/index.d.ts +9 -2
- package/dist/components/base/text-inputs/input-group.d.ts +2 -2
- package/dist/components/blocks/ai/ai-shimmer/ai-shimmer.d.ts +1 -1
- package/dist/components/blocks/ai/ai-shimmer/types.d.ts +3 -0
- package/dist/components/blocks/commerce/fulfillment-group/types.d.ts +3 -1
- package/dist/components/blocks/data-display/inline-stat/inline-stat.d.ts +16 -8
- package/dist/components/features/activities/partials/activity-marker.d.ts +6 -3
- package/dist/components/features/appointment-calendar/appointment-calendar.d.ts +5 -0
- package/dist/components/features/appointment-calendar/appointment-calendar.types.d.ts +220 -0
- package/dist/components/features/appointment-calendar/appointment-calendar.utils.d.ts +41 -0
- package/dist/components/features/appointment-calendar/index.d.ts +3 -0
- package/dist/components/features/appointment-calendar/partials/appointment-agenda.d.ts +32 -0
- package/dist/components/features/appointment-calendar/partials/appointment-month.d.ts +13 -0
- package/dist/components/features/combobox/combobox.strings.d.ts +15 -1
- package/dist/components/features/combobox/types.d.ts +4 -0
- package/dist/components/features/media-library/media-library.strings.d.ts +2 -0
- package/dist/components/features/rich-text-editor/index.d.ts +1 -1
- package/dist/components/features/rich-text-editor/rich-text-editor.recipes.d.ts +6 -0
- package/dist/components/features/rich-text-editor/rich-text-editor.types.d.ts +9 -1
- package/dist/components/features/table/table-header.d.ts +1 -1
- package/dist/components/features/table/table.strings.d.ts +55 -1
- package/dist/components/features/table/table.types.d.ts +17 -4
- package/dist/components/features/theme-tweaker/theme-tweaker.types.d.ts +5 -0
- package/dist/components/primitives/number.d.ts +4 -2
- package/dist/components/primitives/value.d.ts +3 -1
- package/dist/components/typography/text-link.d.ts +4 -0
- package/dist/components/ui/combobox-dismiss.d.ts +16 -0
- package/dist/components/ui/combobox.d.ts +16 -7
- package/dist/components/ui/dialog.d.ts +1 -1
- package/dist/components/ui/item.d.ts +8 -8
- package/dist/components/ui/popover.d.ts +1 -1
- package/dist/components/ui/sheet.d.ts +1 -1
- package/dist/components/ui/tabs.d.ts +1 -1
- package/dist/{containers-DmWiJa2I.js → containers-Mu1LMGV1.js} +2 -2
- package/dist/{containers-DmWiJa2I.js.map → containers-Mu1LMGV1.js.map} +1 -1
- package/dist/{copyable-B3Gwgdqc.js → copyable-ClBuk_UK.js} +4 -4
- package/dist/{copyable-B3Gwgdqc.js.map → copyable-ClBuk_UK.js.map} +1 -1
- package/dist/{data-display-DafIvCl5.js → data-display-DT_khPl_.js} +98 -87
- package/dist/data-display-DT_khPl_.js.map +1 -0
- package/dist/{date-BgK3bTdo.js → date-DCrsDTZc.js} +5 -5
- package/dist/{date-BgK3bTdo.js.map → date-DCrsDTZc.js.map} +1 -1
- package/dist/{date-picker-CF-DtUpF.js → date-picker-B2K3ucWn.js} +594 -593
- package/dist/date-picker-B2K3ucWn.js.map +1 -0
- package/dist/date-pickers-Ds8gLaoP.js +175 -0
- package/dist/date-pickers-Ds8gLaoP.js.map +1 -0
- package/dist/{display-DsQTVzMz.js → display-hAc1HjpI.js} +49 -49
- package/dist/display-hAc1HjpI.js.map +1 -0
- package/dist/dropdown-menu-Cl4X7L5S.js +193 -0
- package/dist/dropdown-menu-Cl4X7L5S.js.map +1 -0
- package/dist/editable-text-recipe-Cn61kEcv.js +10 -0
- package/dist/editable-text-recipe-Cn61kEcv.js.map +1 -0
- package/dist/features/activities.js +398 -375
- package/dist/features/activities.js.map +1 -1
- package/dist/features/ai-chat.js +188 -179
- package/dist/features/ai-chat.js.map +1 -1
- package/dist/features/appointment-calendar.js +683 -0
- package/dist/features/appointment-calendar.js.map +1 -0
- package/dist/features/async-preview.js +109 -107
- package/dist/features/async-preview.js.map +1 -1
- package/dist/features/combobox.js +1 -1
- package/dist/features/comments.js +1 -1
- package/dist/features/data-view.js +137 -137
- package/dist/features/data-view.js.map +1 -1
- package/dist/features/email-composer.js +255 -255
- package/dist/features/email-composer.js.map +1 -1
- package/dist/features/event-calendar.js +254 -248
- package/dist/features/event-calendar.js.map +1 -1
- package/dist/features/filters.js +1 -1
- package/dist/features/global-search.js +35 -32
- package/dist/features/global-search.js.map +1 -1
- package/dist/features/kanban.js +118 -117
- package/dist/features/kanban.js.map +1 -1
- package/dist/features/map.js +233 -231
- package/dist/features/map.js.map +1 -1
- package/dist/features/media-library.js +789 -775
- package/dist/features/media-library.js.map +1 -1
- package/dist/features/mentions.js +1 -1
- package/dist/features/overlays.js +1 -1
- package/dist/features/products.js +922 -902
- package/dist/features/products.js.map +1 -1
- package/dist/features/questionnaire.js +28 -24
- package/dist/features/questionnaire.js.map +1 -1
- package/dist/features/resource-assignment.js +18 -15
- package/dist/features/resource-assignment.js.map +1 -1
- package/dist/features/resource.js +12 -12
- package/dist/features/resource.js.map +1 -1
- package/dist/features/rich-text-editor.js +2 -2
- package/dist/features/schema-form.js +15 -13
- package/dist/features/schema-form.js.map +1 -1
- package/dist/features/suggestions.js +3 -3
- package/dist/features/sync.js +11 -5
- package/dist/features/sync.js.map +1 -1
- package/dist/features/table.js +1 -1
- package/dist/features/theme-tweaker.js +493 -489
- package/dist/features/theme-tweaker.js.map +1 -1
- package/dist/feedback-BYIhtitP.js +239 -0
- package/dist/feedback-BYIhtitP.js.map +1 -0
- package/dist/{field-affordance-recipes-qQeIf4lG.js → field-affordance-recipes-DZhnIL_Y.js} +11 -18
- package/dist/field-affordance-recipes-DZhnIL_Y.js.map +1 -0
- package/dist/{filters-BkHH53uv.js → filters-DJVAveHA.js} +589 -580
- package/dist/filters-DJVAveHA.js.map +1 -0
- package/dist/{form-field-DUt4UxSV.js → form-field-CwH9y77i.js} +6 -5
- package/dist/form-field-CwH9y77i.js.map +1 -0
- package/dist/{form-sizing-By94KzXE.js → form-sizing-BdP_Mf5p.js} +39 -44
- package/dist/form-sizing-BdP_Mf5p.js.map +1 -0
- package/dist/{forms-Bzha-Y3B.js → forms-B9G_xwzi.js} +8 -8
- package/dist/{forms-Bzha-Y3B.js.map → forms-B9G_xwzi.js.map} +1 -1
- package/dist/{forms-numeric-C0bvjRPZ.js → forms-numeric-B_jraJaQ.js} +309 -309
- package/dist/forms-numeric-B_jraJaQ.js.map +1 -0
- package/dist/{header-BOefOKd1.js → header-BSfIEWbI.js} +160 -153
- package/dist/header-BSfIEWbI.js.map +1 -0
- package/dist/{hooks-9k_TtmKh.js → hooks-ClH9thn4.js} +2 -2
- package/dist/{hooks-9k_TtmKh.js.map → hooks-ClH9thn4.js.map} +1 -1
- package/dist/{icon-badge-CAuKupo9.js → icon-badge-DYKIwvOV.js} +4 -4
- package/dist/{icon-badge-CAuKupo9.js.map → icon-badge-DYKIwvOV.js.map} +1 -1
- package/dist/index.js +3 -3
- package/dist/input-CZw8iU99.js +21 -0
- package/dist/input-CZw8iU99.js.map +1 -0
- package/dist/input-DQdEd0YD.js +263 -0
- package/dist/input-DQdEd0YD.js.map +1 -0
- package/dist/{interaction-recipes-CHr0dJUs.js → interaction-recipes-XR9ZpVYL.js} +2 -1
- package/dist/interaction-recipes-XR9ZpVYL.js.map +1 -0
- package/dist/item-K5_ghvze.js +275 -0
- package/dist/item-K5_ghvze.js.map +1 -0
- package/dist/layout/app-shell.js +1 -1
- package/dist/layout/auth.js +1 -1
- package/dist/layout/containers.js +1 -1
- package/dist/layout/header.js +1 -1
- package/dist/layout/hooks.js +1 -1
- package/dist/layout/navigation.js +1 -1
- package/dist/layout/page.js +1 -1
- package/dist/layout/settings.js +1 -1
- package/dist/layout/sidebar.js +2 -2
- package/dist/layout/workspace.js +1 -1
- package/dist/layout.js +10 -10
- package/dist/lib/affordance-geometry.generated.d.ts +71 -0
- package/dist/lib/editable-text-recipe.d.ts +4 -4
- package/dist/lib/field-affordance-recipes.d.ts +2 -2
- package/dist/lib/interaction-recipes.d.ts +5 -0
- package/dist/lib/theme-mode-css.d.ts +7 -0
- package/dist/lib/tone-recipes.d.ts +8 -0
- package/dist/lib/ui-provider/types.d.ts +2 -2
- package/dist/lib/use-popup-focus-recovery.d.ts +8 -0
- package/dist/lib/utils.js +1 -1
- package/dist/{media-gallery-DcTtAaeC.js → media-gallery-3zIVLMWH.js} +8 -8
- package/dist/media-gallery-3zIVLMWH.js.map +1 -0
- package/dist/{mentions-D-uyCh01.js → mentions-CGlEJ15c.js} +144 -142
- package/dist/mentions-CGlEJ15c.js.map +1 -0
- package/dist/{message-CdHgIWKf.js → message-DZ_ruyUV.js} +6 -5
- package/dist/message-DZ_ruyUV.js.map +1 -0
- package/dist/{metadata-list-X5rYAKSB.js → metadata-list-8N16ZMW_.js} +130 -119
- package/dist/metadata-list-8N16ZMW_.js.map +1 -0
- package/dist/{navigation-D3KwXmaq.js → navigation-Bnotn4AQ.js} +19 -19
- package/dist/navigation-Bnotn4AQ.js.map +1 -0
- package/dist/{navigation-HJf5zxlH.js → navigation-BzhHI3lo.js} +36 -35
- package/dist/navigation-BzhHI3lo.js.map +1 -0
- package/dist/{navigation-row-recipes-BVowojQw.js → navigation-row-recipes-BFLCk_Aq.js} +2 -2
- package/dist/{navigation-row-recipes-BVowojQw.js.map → navigation-row-recipes-BFLCk_Aq.js.map} +1 -1
- package/dist/{number-DMhe-Vsk.js → number-DbV1Dija.js} +36 -34
- package/dist/{number-DMhe-Vsk.js.map → number-DbV1Dija.js.map} +1 -1
- package/dist/{overflow-tab-bar-sQHXLlwQ.js → overflow-tab-bar-CWY7Nogn.js} +105 -103
- package/dist/overflow-tab-bar-CWY7Nogn.js.map +1 -0
- package/dist/{overlays-I0axtYA6.js → overlays-tMkF-VAN.js} +282 -278
- package/dist/overlays-tMkF-VAN.js.map +1 -0
- package/dist/{page-B5dTH9gE.js → page-CL9YeH_V.js} +8 -8
- package/dist/{page-B5dTH9gE.js.map → page-CL9YeH_V.js.map} +1 -1
- package/dist/{page-header-commands-DjzFEq3E.js → page-header-commands-DOb6WsfD.js} +5 -5
- package/dist/{page-header-commands-DjzFEq3E.js.map → page-header-commands-DOb6WsfD.js.map} +1 -1
- package/dist/pagination-BL25hu2s.js +158 -0
- package/dist/pagination-BL25hu2s.js.map +1 -0
- package/dist/{popover-Di55PyAI.js → popover-gnTOhbFM.js} +69 -66
- package/dist/popover-gnTOhbFM.js.map +1 -0
- package/dist/popover-menu-Cn9rUkdc.js +100 -0
- package/dist/popover-menu-Cn9rUkdc.js.map +1 -0
- package/dist/{popover.recipes-Bdyhj2db.js → popover.recipes-D3j8R8Yp.js} +17 -10
- package/dist/popover.recipes-D3j8R8Yp.js.map +1 -0
- package/dist/{primitives-B-CkiEMU.js → primitives-BFK08r9M.js} +45 -44
- package/dist/primitives-BFK08r9M.js.map +1 -0
- package/dist/primitives.js +4 -4
- package/dist/{progress-rnS8-uAW.js → progress-B1VnCT0K.js} +5 -5
- package/dist/{progress-rnS8-uAW.js.map → progress-B1VnCT0K.js.map} +1 -1
- package/dist/{receipt-D0oswZ0p.js → receipt-BVSOH3Xo.js} +9 -6
- package/dist/{receipt-D0oswZ0p.js.map → receipt-BVSOH3Xo.js.map} +1 -1
- package/dist/{rich-text-DvGulsNJ.js → rich-text-GOUyKQ-s.js} +3 -3
- package/dist/{rich-text-DvGulsNJ.js.map → rich-text-GOUyKQ-s.js.map} +1 -1
- package/dist/{rich-text-editor-sMU_Scqm.js → rich-text-editor-cRLC-eBK.js} +418 -426
- package/dist/rich-text-editor-cRLC-eBK.js.map +1 -0
- package/dist/rich-text-editor-toolbar-DfXg0-VC.js +94 -0
- package/dist/rich-text-editor-toolbar-DfXg0-VC.js.map +1 -0
- package/dist/{scroll-area-Bt_vXY2b.js → scroll-area-DcI-M1UT.js} +2 -2
- package/dist/{scroll-area-Bt_vXY2b.js.map → scroll-area-DcI-M1UT.js.map} +1 -1
- package/dist/{separator-C8DlRGwF.js → separator-BDV-Y648.js} +3 -3
- package/dist/{separator-C8DlRGwF.js.map → separator-BDV-Y648.js.map} +1 -1
- package/dist/{separator-CYHnjsAb.js → separator-Bom7NsGO.js} +2 -2
- package/dist/{separator-CYHnjsAb.js.map → separator-Bom7NsGO.js.map} +1 -1
- package/dist/services/actions.js +1 -1
- package/dist/{settings-CQW3b-Cu.js → settings-ybnjVwbd.js} +20 -19
- package/dist/settings-ybnjVwbd.js.map +1 -0
- package/dist/{sheet-4SEvVYzA.js → sheet-ijlsjq-n.js} +76 -73
- package/dist/sheet-ijlsjq-n.js.map +1 -0
- package/dist/{sidebar-C7WWR29L.js → sidebar-Db6gkh3U.js} +183 -182
- package/dist/sidebar-Db6gkh3U.js.map +1 -0
- package/dist/{sidebar-d7Dg80ln.js → sidebar-DkTO4VTO.js} +14 -13
- package/dist/{sidebar-d7Dg80ln.js.map → sidebar-DkTO4VTO.js.map} +1 -1
- package/dist/{skeleton-Cz890JZF.js → skeleton-Byjnt7qr.js} +3 -3
- package/dist/{skeleton-Cz890JZF.js.map → skeleton-Byjnt7qr.js.map} +1 -1
- package/dist/smart-card-DiC5aac3.js +604 -0
- package/dist/smart-card-DiC5aac3.js.map +1 -0
- package/dist/{structure-DC2dygdA.js → structure-BmisBK-3.js} +2 -2
- package/dist/{structure-DC2dygdA.js.map → structure-BmisBK-3.js.map} +1 -1
- package/dist/style.css +1 -1
- package/dist/table-BweFy_P9.js +1530 -0
- package/dist/table-BweFy_P9.js.map +1 -0
- package/dist/{table-CIKyLUsy.js → table-DsfzoUia.js} +75 -63
- package/dist/table-DsfzoUia.js.map +1 -0
- package/dist/{tabs-DwBJfjxX.js → tabs-CDocW5D1.js} +14 -13
- package/dist/tabs-CDocW5D1.js.map +1 -0
- package/dist/text-inputs-f9Ia-aCi.js +353 -0
- package/dist/text-inputs-f9Ia-aCi.js.map +1 -0
- package/dist/theme-mode-css-BB-_RYab.js +14 -0
- package/dist/theme-mode-css-BB-_RYab.js.map +1 -0
- package/dist/theme-scope-BJ6eE2xt.js +50 -0
- package/dist/theme-scope-BJ6eE2xt.js.map +1 -0
- package/dist/theme.css +285 -228
- package/dist/themes/green.css +16 -12
- package/dist/timelines-CwM_9IhD.js +457 -0
- package/dist/timelines-CwM_9IhD.js.map +1 -0
- package/dist/{tone-recipes-CPoExcTE.js → tone-recipes-BPsRAvhu.js} +5 -2
- package/dist/tone-recipes-BPsRAvhu.js.map +1 -0
- package/dist/{tooltip-CsfgrfS7.js → tooltip-yiRJUFjp.js} +4 -4
- package/dist/{tooltip-CsfgrfS7.js.map → tooltip-yiRJUFjp.js.map} +1 -1
- package/dist/{tree-BiKhg8AY.js → tree-WnKQzwbq.js} +9 -9
- package/dist/{tree-BiKhg8AY.js.map → tree-WnKQzwbq.js.map} +1 -1
- package/dist/typography/rich-text.js +1 -1
- package/dist/{typography-DTRkE9zL.js → typography-UTnveOEy.js} +6 -6
- package/dist/typography-UTnveOEy.js.map +1 -0
- package/dist/typography.js +2 -2
- package/dist/{ui-provider-1D_NSYzO.js → ui-provider-C_U0Xma4.js} +3 -3
- package/dist/ui-provider-C_U0Xma4.js.map +1 -0
- package/dist/ui-provider.js +2 -2
- package/dist/{upload-BO8-CLN6.js → upload-CXyxmQBP.js} +13 -12
- package/dist/upload-CXyxmQBP.js.map +1 -0
- package/dist/{upload-queue-EOC8g1gf.js → upload-queue-Boscubn9.js} +11 -9
- package/dist/upload-queue-Boscubn9.js.map +1 -0
- package/dist/{usage-card-obRaBskq.js → usage-card-BhO5eqkX.js} +53 -37
- package/dist/usage-card-BhO5eqkX.js.map +1 -0
- package/dist/use-popup-focus-recovery-C0QPvgOR.js +36 -0
- package/dist/use-popup-focus-recovery-C0QPvgOR.js.map +1 -0
- package/dist/{utils-l5LpDw2z.js → utils-BRhFDwuU.js} +59 -44
- package/dist/utils-BRhFDwuU.js.map +1 -0
- package/dist/{value-inputs-TAYMX111.js → value-inputs-TaX4OjNk.js} +268 -252
- package/dist/value-inputs-TaX4OjNk.js.map +1 -0
- package/dist/{value-typography-b8wpz1eX.js → value-typography-BP8OG6h5.js} +2 -2
- package/dist/{value-typography-b8wpz1eX.js.map → value-typography-BP8OG6h5.js.map} +1 -1
- package/dist/{workspace-DH0v0KcB.js → workspace-B-OEm3Kf.js} +34 -33
- package/dist/workspace-B-OEm3Kf.js.map +1 -0
- package/docs/consumer-skill/SKILL.md +3 -3
- package/docs/consumer-skill/references/agents-md.md +1 -1
- package/docs/consumer-skill/references/composition.md +8 -6
- package/docs/consumer-skill/references/installation.md +6 -0
- package/docs/consumer-skill/references/integration.md +4 -3
- package/docs/consumer-skill/references/public-api.json +105 -2
- package/docs/consumer-skill/references/review.md +7 -0
- package/docs/consumer-skill/references/theming.md +71 -6
- package/docs/consumer-skill/references/tokens.json +1 -1
- package/docs/consumer-skill/references/workflows.md +26 -0
- package/docs/consumer-skill/scripts/composition-policy.mjs +3 -2
- package/docs/consumer-skill/scripts/surface-policy.mjs +11 -0
- package/package.json +8 -4
- package/dist/accordion-B6a3vVgA.js.map +0 -1
- package/dist/action-menu-TzCoSlwL.js +0 -280
- package/dist/action-menu-TzCoSlwL.js.map +0 -1
- package/dist/affordance-geometry.generated-B5iu-Mkr.js +0 -69
- package/dist/affordance-geometry.generated-B5iu-Mkr.js.map +0 -1
- package/dist/ai-artifact-BMJdv-6q.js +0 -1115
- package/dist/ai-artifact-BMJdv-6q.js.map +0 -1
- package/dist/attachment-BtfhGm8i.js +0 -245
- package/dist/attachment-BtfhGm8i.js.map +0 -1
- package/dist/auth-CYxKfo69.js.map +0 -1
- package/dist/avatar-BBnEJIx8.js.map +0 -1
- package/dist/badge-MrKVNzW9.js.map +0 -1
- package/dist/batch-action-bar-BZGDG-Si.js.map +0 -1
- package/dist/breadcrumbs-D5t7I023.js.map +0 -1
- package/dist/buttons-SbIcm1HJ.js.map +0 -1
- package/dist/cards-CiiHpKYd.js +0 -66
- package/dist/cards-CiiHpKYd.js.map +0 -1
- package/dist/chart-QfrARkXl.js.map +0 -1
- package/dist/choice-inputs-t6w3ATNz.js.map +0 -1
- package/dist/code-block-Dgbu-CU3.js.map +0 -1
- package/dist/combobox-2Ic8N9bL.js +0 -278
- package/dist/combobox-2Ic8N9bL.js.map +0 -1
- package/dist/combobox-DLl0bfiq.js.map +0 -1
- package/dist/comments-BpDuCUUu.js.map +0 -1
- package/dist/data-display-DafIvCl5.js.map +0 -1
- package/dist/date-picker-CF-DtUpF.js.map +0 -1
- package/dist/date-pickers-BmzxJl5l.js +0 -174
- package/dist/date-pickers-BmzxJl5l.js.map +0 -1
- package/dist/display-DsQTVzMz.js.map +0 -1
- package/dist/dropdown-menu-E2qmdC7o.js +0 -193
- package/dist/dropdown-menu-E2qmdC7o.js.map +0 -1
- package/dist/editable-text-recipe-Bkm6wKHp.js +0 -10
- package/dist/editable-text-recipe-Bkm6wKHp.js.map +0 -1
- package/dist/feedback-qNuMBtRH.js +0 -233
- package/dist/feedback-qNuMBtRH.js.map +0 -1
- package/dist/field-affordance-recipes-qQeIf4lG.js.map +0 -1
- package/dist/filters-BkHH53uv.js.map +0 -1
- package/dist/form-field-DUt4UxSV.js.map +0 -1
- package/dist/form-sizing-By94KzXE.js.map +0 -1
- package/dist/forms-numeric-C0bvjRPZ.js.map +0 -1
- package/dist/header-BOefOKd1.js.map +0 -1
- package/dist/input-DWhBBBww.js +0 -262
- package/dist/input-DWhBBBww.js.map +0 -1
- package/dist/input-Ddi_LSYv.js +0 -20
- package/dist/input-Ddi_LSYv.js.map +0 -1
- package/dist/interaction-recipes-CHr0dJUs.js.map +0 -1
- package/dist/item-DEmDiTlD.js +0 -265
- package/dist/item-DEmDiTlD.js.map +0 -1
- package/dist/media-gallery-DcTtAaeC.js.map +0 -1
- package/dist/mentions-D-uyCh01.js.map +0 -1
- package/dist/message-CdHgIWKf.js.map +0 -1
- package/dist/metadata-list-X5rYAKSB.js.map +0 -1
- package/dist/navigation-D3KwXmaq.js.map +0 -1
- package/dist/navigation-HJf5zxlH.js.map +0 -1
- package/dist/overflow-tab-bar-sQHXLlwQ.js.map +0 -1
- package/dist/overlays-I0axtYA6.js.map +0 -1
- package/dist/pagination-3bPA_a6K.js +0 -149
- package/dist/pagination-3bPA_a6K.js.map +0 -1
- package/dist/popover-Di55PyAI.js.map +0 -1
- package/dist/popover-menu-B71Tn2Qz.js +0 -99
- package/dist/popover-menu-B71Tn2Qz.js.map +0 -1
- package/dist/popover.recipes-Bdyhj2db.js.map +0 -1
- package/dist/primitives-B-CkiEMU.js.map +0 -1
- package/dist/rich-text-editor-sMU_Scqm.js.map +0 -1
- package/dist/rich-text-editor.recipes-CadiF_Uu.js +0 -88
- package/dist/rich-text-editor.recipes-CadiF_Uu.js.map +0 -1
- package/dist/settings-CQW3b-Cu.js.map +0 -1
- package/dist/sheet-4SEvVYzA.js.map +0 -1
- package/dist/sidebar-C7WWR29L.js.map +0 -1
- package/dist/smart-card-lFKxn5Hu.js +0 -595
- package/dist/smart-card-lFKxn5Hu.js.map +0 -1
- package/dist/spinner-fa3h1Aif.js +0 -80
- package/dist/spinner-fa3h1Aif.js.map +0 -1
- package/dist/table-CIKyLUsy.js.map +0 -1
- package/dist/table-CrcLN9Io.js +0 -1458
- package/dist/table-CrcLN9Io.js.map +0 -1
- package/dist/tabs-DwBJfjxX.js.map +0 -1
- package/dist/text-inputs-aaK9wcDT.js +0 -326
- package/dist/text-inputs-aaK9wcDT.js.map +0 -1
- package/dist/theme-scope-kStaAer0.js +0 -39
- package/dist/theme-scope-kStaAer0.js.map +0 -1
- package/dist/timelines-C_SBwHNP.js +0 -442
- package/dist/timelines-C_SBwHNP.js.map +0 -1
- package/dist/tone-recipes-CPoExcTE.js.map +0 -1
- package/dist/typography-DTRkE9zL.js.map +0 -1
- package/dist/ui-provider-1D_NSYzO.js.map +0 -1
- package/dist/upload-BO8-CLN6.js.map +0 -1
- package/dist/upload-queue-EOC8g1gf.js.map +0 -1
- package/dist/usage-card-obRaBskq.js.map +0 -1
- package/dist/utils-l5LpDw2z.js.map +0 -1
- package/dist/value-inputs-TAYMX111.js.map +0 -1
- package/dist/workspace-DH0v0KcB.js.map +0 -1
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { s as e, v as t } from "../ui-provider-
|
|
2
|
+
import { s as e, v as t } from "../ui-provider-C_U0Xma4.js";
|
|
3
3
|
import { useStrings as n } from "../lib/strings.js";
|
|
4
|
-
import { t as r } from "../utils-
|
|
5
|
-
import { n as i } from "../buttons-
|
|
6
|
-
import {
|
|
7
|
-
import { t as c } from "../structure-
|
|
8
|
-
import { t as l } from "../progress-
|
|
9
|
-
import {
|
|
10
|
-
import { t as d } from "../input-
|
|
11
|
-
import { t as f } from "../form-field-
|
|
12
|
-
import { d as p } from "../text-inputs-
|
|
13
|
-
import { l as m, r as h, s as g } from "../choice-inputs-
|
|
14
|
-
import { t as _ } from "../checkbox-
|
|
4
|
+
import { t as r } from "../utils-BRhFDwuU.js";
|
|
5
|
+
import { n as i } from "../buttons-DPZekJFu.js";
|
|
6
|
+
import { a, c as o, s } from "../typography-UTnveOEy.js";
|
|
7
|
+
import { t as c } from "../structure-BmisBK-3.js";
|
|
8
|
+
import { t as l } from "../progress-B1VnCT0K.js";
|
|
9
|
+
import { h as u } from "../form-sizing-BdP_Mf5p.js";
|
|
10
|
+
import { t as d } from "../input-DQdEd0YD.js";
|
|
11
|
+
import { t as f } from "../form-field-CwH9y77i.js";
|
|
12
|
+
import { d as p } from "../text-inputs-f9Ia-aCi.js";
|
|
13
|
+
import { l as m, r as h, s as g } from "../choice-inputs-CNHvARCJ.js";
|
|
14
|
+
import { t as _ } from "../checkbox-AWIhNhmo.js";
|
|
15
15
|
import { forwardRef as v, useEffect as y, useId as b, useRef as x, useState as S } from "react";
|
|
16
16
|
import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
|
|
17
17
|
//#region src/components/features/questionnaire/questionnaire-control.tsx
|
|
18
|
-
function ee({ question: n, answer: i, disabled:
|
|
18
|
+
function ee({ question: n, answer: i, disabled: s, error: l, labelId: f, descriptionId: v, onAnswerChange: y, ...b }) {
|
|
19
19
|
let { defaultScale: x } = e(), S = r("questionnaire--check", g, u[t(void 0, x)]), C = {
|
|
20
|
-
disabled:
|
|
20
|
+
disabled: s,
|
|
21
21
|
invalid: !!l,
|
|
22
22
|
"aria-labelledby": f,
|
|
23
23
|
"aria-describedby": v,
|
|
@@ -27,7 +27,7 @@ function ee({ question: n, answer: i, disabled: o, error: l, labelId: f, descrip
|
|
|
27
27
|
...b,
|
|
28
28
|
question: n,
|
|
29
29
|
answer: i,
|
|
30
|
-
disabled:
|
|
30
|
+
disabled: s,
|
|
31
31
|
error: l,
|
|
32
32
|
labelId: f,
|
|
33
33
|
descriptionId: v,
|
|
@@ -58,7 +58,7 @@ function ee({ question: n, answer: i, disabled: o, error: l, labelId: f, descrip
|
|
|
58
58
|
children: /* @__PURE__ */ w(h, {
|
|
59
59
|
options: n.options,
|
|
60
60
|
value: typeof i == "string" ? i : "",
|
|
61
|
-
disabled:
|
|
61
|
+
disabled: s,
|
|
62
62
|
invalid: !!l,
|
|
63
63
|
onValueChange: y,
|
|
64
64
|
columns: 1
|
|
@@ -79,7 +79,7 @@ function ee({ question: n, answer: i, disabled: o, error: l, labelId: f, descrip
|
|
|
79
79
|
className: S,
|
|
80
80
|
children: /* @__PURE__ */ w(_, {
|
|
81
81
|
id: r,
|
|
82
|
-
disabled:
|
|
82
|
+
disabled: s || e.disabled,
|
|
83
83
|
"aria-invalid": !!l || void 0,
|
|
84
84
|
"aria-describedby": [v, e.description ? `${r}-description` : void 0].filter(Boolean).join(" ") || void 0,
|
|
85
85
|
checked: n.includes(e.value),
|
|
@@ -89,8 +89,9 @@ function ee({ question: n, answer: i, disabled: o, error: l, labelId: f, descrip
|
|
|
89
89
|
gap: "dense",
|
|
90
90
|
children: [/* @__PURE__ */ w(a, {
|
|
91
91
|
htmlFor: r,
|
|
92
|
+
className: "text-inherit",
|
|
92
93
|
children: e.label
|
|
93
|
-
}), e.description && /* @__PURE__ */ w(
|
|
94
|
+
}), e.description && /* @__PURE__ */ w(o, {
|
|
94
95
|
id: `${r}-description`,
|
|
95
96
|
size: "xs",
|
|
96
97
|
type: "secondary",
|
|
@@ -115,6 +116,7 @@ function ee({ question: n, answer: i, disabled: o, error: l, labelId: f, descrip
|
|
|
115
116
|
})
|
|
116
117
|
}), /* @__PURE__ */ w(a, {
|
|
117
118
|
htmlFor: `${f}-checkbox`,
|
|
119
|
+
className: "text-inherit",
|
|
118
120
|
children: n.label ?? n.title
|
|
119
121
|
})]
|
|
120
122
|
}) : null;
|
|
@@ -266,7 +268,8 @@ var ie = {}, ae = v(function(e, t) {
|
|
|
266
268
|
gap: "lg",
|
|
267
269
|
children: [ce, F ? ye ? ue ?? /* @__PURE__ */ T(c, {
|
|
268
270
|
gap: "sm",
|
|
269
|
-
children: [/* @__PURE__ */ w(
|
|
271
|
+
children: [/* @__PURE__ */ w(o, {
|
|
272
|
+
type: "inherit",
|
|
270
273
|
role: "status",
|
|
271
274
|
children: q.submitted
|
|
272
275
|
}), /* @__PURE__ */ w(i, {
|
|
@@ -283,7 +286,7 @@ var ie = {}, ae = v(function(e, t) {
|
|
|
283
286
|
value: I + 1,
|
|
284
287
|
max: N.length,
|
|
285
288
|
label: q.progress,
|
|
286
|
-
valueSlot: /* @__PURE__ */ w(
|
|
289
|
+
valueSlot: /* @__PURE__ */ w(o, {
|
|
287
290
|
size: "xs",
|
|
288
291
|
type: "secondary",
|
|
289
292
|
"aria-live": "polite",
|
|
@@ -297,7 +300,8 @@ var ie = {}, ae = v(function(e, t) {
|
|
|
297
300
|
role: "group",
|
|
298
301
|
"aria-labelledby": J,
|
|
299
302
|
className: "questionnaire--question outline-none",
|
|
300
|
-
children: [/* @__PURE__ */ w(
|
|
303
|
+
children: [/* @__PURE__ */ w(s, {
|
|
304
|
+
className: "text-inherit",
|
|
301
305
|
id: J,
|
|
302
306
|
tag: "h3",
|
|
303
307
|
children: F.title
|
|
@@ -318,12 +322,12 @@ var ie = {}, ae = v(function(e, t) {
|
|
|
318
322
|
}, F.id)
|
|
319
323
|
})]
|
|
320
324
|
}),
|
|
321
|
-
R && /* @__PURE__ */ w(
|
|
325
|
+
R && /* @__PURE__ */ w(o, {
|
|
322
326
|
role: "alert",
|
|
323
327
|
type: "error",
|
|
324
328
|
children: R
|
|
325
329
|
}),
|
|
326
|
-
B && /* @__PURE__ */ w(
|
|
330
|
+
B && /* @__PURE__ */ w(o, {
|
|
327
331
|
role: "status",
|
|
328
332
|
type: "secondary",
|
|
329
333
|
children: q.submitting
|
|
@@ -363,7 +367,7 @@ var ie = {}, ae = v(function(e, t) {
|
|
|
363
367
|
})
|
|
364
368
|
]
|
|
365
369
|
})
|
|
366
|
-
] }) : le ?? /* @__PURE__ */ w(
|
|
370
|
+
] }) : le ?? /* @__PURE__ */ w(o, {
|
|
367
371
|
type: "secondary",
|
|
368
372
|
children: q.empty
|
|
369
373
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"questionnaire.js","names":["_Fragment","useDensityConfig","resolveComponentScale","cn","Button","Label","Stack","Progress","formLabelSizeClasses","Input","FormField","Textarea","Select","CardRadioGroup","choiceControlTrackClasses","Checkbox","Fragment$1","QuestionnaireControl","context","checkTrack","defaultScale","common","error","labelId","descriptionId","question","answer","onAnswerChange","event","values","optionId","index","disabled","option","checked","entry","Text","defaultQuestionnaireStrings","current","total","getVisibleQuestions","questions","answers","getQuestionnaireAnswer","id","validateQuestion","value","empty","strings","selected","url","result","getSubmissionAnswers","emptyAnswers","Questionnaire","forwardRef","controlledValue","stringsProp","formProps","props","controlled","stepControlled","internalValue","setInternalValue","useState","defaultValue","answersRef","useRef","visible","internalId","setInternalId","defaultQuestionId","requestedId","questionId","position","errors","setErrors","submitError","setSubmitError","busy","setBusy","completed","setCompleted","submission","resetTimer","mounted","stageRef","useStrings","useId","locked","cancelReset","cancel","goTo","nextId","onQuestionChange","setAnswer","next","onValueChange","previous","useEffect","advance","submit","validation","firstInvalid","controller","snapshot","onSubmit","onComplete","formatSubmitError","onError","currentError","description","className","nativeEvent","initialVisible","initialQuestion","headerSlot","completionSlot","Heading","emptySlot"],"sources":["../../src/components/features/questionnaire/questionnaire-control.tsx","../../src/components/features/questionnaire/questionnaire.types.ts","../../src/components/features/questionnaire/questionnaire.utils.ts","../../src/components/features/questionnaire/questionnaire.tsx"],"sourcesContent":["import { CardRadioGroup, Checkbox, Select } from '../../base/choice-inputs';\nimport { choiceControlTrackClasses } from '../../base/choice-inputs/choice-types';\nimport { formLabelSizeClasses } from '../../base/forms/form-sizing';\nimport { Input, Textarea } from '../../base/text-inputs';\nimport { Stack } from '../../base/structure';\nimport { Label, Text } from '../../typography';\nimport { useDensityConfig } from '../../../lib/ui-provider';\nimport { resolveComponentScale } from '../../../lib/ui-provider/scale';\nimport { cn } from '../../../lib/utils';\nimport type { QuestionnaireQuestionContext } from './questionnaire.types';\n\n/** All interactive behavior remains with public Base UI-backed field owners. */\nexport function QuestionnaireControl({ question, answer, disabled, error, labelId, descriptionId, onAnswerChange, ...context }: QuestionnaireQuestionContext) {\n\tconst { defaultScale } = useDensityConfig();\n\t// Each checkbox sits in a track one Label line tall, so it centres on the\n\t// option's first line whether or not the label wraps.\n\tconst checkTrack = cn('questionnaire--check', choiceControlTrackClasses, formLabelSizeClasses[resolveComponentScale(undefined, defaultScale)]);\n\tconst common = { disabled, invalid: Boolean(error), 'aria-labelledby': labelId, 'aria-describedby': descriptionId, required: question.required };\n\tif (question.type === 'custom') return question.render({ ...context, question, answer, disabled, error, labelId, descriptionId, onAnswerChange });\n\tif (question.type === 'text') return <Input {...common} type={question.inputType ?? 'text'} maxLength={question.maxLength} placeholder={question.placeholder} value={typeof answer === 'string' ? answer : ''} onChange={(event) => onAnswerChange(event.target.value)} />;\n\tif (question.type === 'textarea') return <Textarea {...common} rows={question.rows ?? 4} maxLength={question.maxLength} placeholder={question.placeholder} value={typeof answer === 'string' ? answer : ''} onChange={(event) => onAnswerChange(event.target.value)} />;\n\tif (question.type === 'select') return <Select {...common} options={question.options} value={typeof answer === 'string' ? answer : null} onValueChange={onAnswerChange} />;\n\tif (question.type === 'single') return <fieldset aria-labelledby={labelId} aria-describedby={descriptionId} className=\"questionnaire--choices m-0 min-w-0 border-0 p-0\"><CardRadioGroup options={question.options} value={typeof answer === 'string' ? answer : ''} disabled={disabled} invalid={Boolean(error)} onValueChange={onAnswerChange} columns={1} /></fieldset>;\n\tif (question.type === 'multiple') return <fieldset aria-labelledby={labelId} aria-describedby={descriptionId} className=\"questionnaire--choices m-0 min-w-0 border-0 p-0\"><Stack gap=\"sm\">{question.options.map((option, index) => {\n\t\tconst values = Array.isArray(answer) ? answer : [];\n\t\tconst optionId = `${labelId}-option-${index}`;\n\t\treturn <Stack key={option.value} direction=\"horizontal\" align=\"start\" gap=\"sm\">\n\t\t\t<span className={checkTrack}><Checkbox id={optionId} disabled={disabled || option.disabled} aria-invalid={Boolean(error) || undefined} aria-describedby={[descriptionId, option.description ? `${optionId}-description` : undefined].filter(Boolean).join(' ') || undefined} checked={values.includes(option.value)} onCheckedChange={(checked) => onAnswerChange(checked ? [...values, option.value] : values.filter((entry) => entry !== option.value))} /></span>\n\t\t\t<Stack gap=\"dense\"><Label htmlFor={optionId}>{option.label}</Label>{option.description && <Text id={`${optionId}-description`} size=\"xs\" type=\"secondary\">{option.description}</Text>}</Stack>\n\t\t</Stack>;\n\t})}</Stack></fieldset>;\n\tif (question.type === 'boolean') return <Stack direction=\"horizontal\" align=\"start\" gap=\"sm\"><span className={checkTrack}><Checkbox {...common} aria-labelledby={undefined} id={`${labelId}-checkbox`} checked={answer === true} onCheckedChange={(checked) => onAnswerChange(checked)} /></span><Label htmlFor={`${labelId}-checkbox`}>{question.label ?? question.title}</Label></Stack>;\n\treturn null;\n}\n","import type { ComponentPropsWithoutRef, ReactNode } from 'react';\nimport type { StringsProp } from '../../../lib/strings';\n\nexport type QuestionnaireAnswer = string | string[] | boolean | undefined;\nexport type QuestionnaireAnswers = Record<string, QuestionnaireAnswer>;\nexport interface QuestionnaireOption { value: string; label: string; description?: string; disabled?: boolean }\nexport interface QuestionnaireQuestionBase {\n\t/** Unique stable key, used to retain answers across conditional visibility changes. */\n\tid: string;\n\ttitle: string;\n\tdescription?: string;\n\trequired?: boolean;\n\tdisabled?: boolean;\n\t/** Hidden answers are retained for editing, but excluded from validation/submission. */\n\twhen?: (answers: QuestionnaireAnswers) => boolean;\n\t/** Return an error message, or undefined/true for a valid answer. */\n\tvalidate?: (answer: QuestionnaireAnswer, answers: QuestionnaireAnswers) => string | true | undefined;\n}\nexport interface QuestionnaireTextQuestion extends QuestionnaireQuestionBase {\n\ttype: 'text' | 'textarea';\n\tplaceholder?: string;\n\t/** Native text input type. */\n\tinputType?: 'text' | 'email' | 'url' | 'tel';\n\trows?: number;\n\tmaxLength?: number;\n}\nexport interface QuestionnaireChoiceQuestion extends QuestionnaireQuestionBase {\n\ttype: 'single' | 'multiple' | 'select';\n\toptions: QuestionnaireOption[];\n}\nexport interface QuestionnaireBooleanQuestion extends QuestionnaireQuestionBase { type: 'boolean'; label?: string }\nexport interface QuestionnaireCustomQuestion extends QuestionnaireQuestionBase {\n\ttype: 'custom';\n\trender: (context: QuestionnaireQuestionContext) => ReactNode;\n}\nexport type QuestionnaireQuestion = QuestionnaireTextQuestion | QuestionnaireChoiceQuestion | QuestionnaireBooleanQuestion | QuestionnaireCustomQuestion;\nexport interface QuestionnaireQuestionContext {\n\tquestion: QuestionnaireQuestion;\n\tanswer: QuestionnaireAnswer;\n\tanswers: QuestionnaireAnswers;\n\tdisabled: boolean;\n\terror?: string;\n\t/** Connect custom controls to the visible title and description/error. */\n\tlabelId: string;\n\tdescriptionId?: string;\n\tonAnswerChange: (answer: QuestionnaireAnswer) => void;\n}\nexport interface QuestionnaireSubmitContext { signal: AbortSignal }\nexport interface QuestionnaireStrings {\n\tprevious: string; next: string; submit: string; retry: string; cancel: string;\n\tsubmitting: string; submitted: string; editAnswers: string; empty: string;\n\trequired: string; invalidChoice: string; invalidFormat: string; progress: string;\n\tstep: (current: number, total: number) => string;\n\tsubmitError: string;\n}\nexport const defaultQuestionnaireStrings: QuestionnaireStrings = {\n\tprevious: 'Previous', next: 'Next', submit: 'Submit answers', retry: 'Try again', cancel: 'Cancel submission',\n\tsubmitting: 'Submitting answers…', submitted: 'Your answers have been submitted.', editAnswers: 'Edit answers',\n\tempty: 'There are no questions to answer.', required: 'Please answer this question.', invalidChoice: 'Choose an available option.',\n\tinvalidFormat: 'Enter a valid answer.', progress: 'Questionnaire progress', step: (current, total) => `Question ${current} of ${total}`,\n\tsubmitError: 'Answers could not be submitted. Please try again.',\n};\nexport interface QuestionnaireProps extends Omit<ComponentPropsWithoutRef<'form'>, 'children' | 'onSubmit' | 'defaultValue' | 'onChange'> {\n\tquestions: readonly QuestionnaireQuestion[];\n\t/** Controlled answers. */\n\tvalue?: QuestionnaireAnswers;\n\t/** Initial answers for uncontrolled use. */\n\tdefaultValue?: QuestionnaireAnswers;\n\tonValueChange?: (answers: QuestionnaireAnswers) => void;\n\t/** Controlled active question key. */\n\tquestionId?: string;\n\tdefaultQuestionId?: string;\n\tonQuestionChange?: (id: string) => void;\n\tdisabled?: boolean;\n\t/** Receives only visible, enabled questions. Respect signal to cancel application requests. */\n\tonSubmit?: (answers: QuestionnaireAnswers, context: QuestionnaireSubmitContext) => void | Promise<void>;\n\tonComplete?: (answers: QuestionnaireAnswers) => void;\n\tonError?: (error: unknown) => void;\n\tformatSubmitError?: (error: unknown) => string;\n\theaderSlot?: ReactNode;\n\temptySlot?: ReactNode;\n\t/** Replaces the completion state; default includes an edit-answers action. */\n\tcompletionSlot?: ReactNode;\n\tstrings?: StringsProp<QuestionnaireStrings>;\n}\n","import type { QuestionnaireAnswers, QuestionnaireQuestion, QuestionnaireStrings } from './questionnaire.types';\n\nexport function getVisibleQuestions(questions: readonly QuestionnaireQuestion[], answers: QuestionnaireAnswers) {\n\treturn questions.filter((question) => !question.when || question.when(answers));\n}\nexport function getQuestionnaireAnswer(answers: QuestionnaireAnswers, id: string) {\n\treturn Object.hasOwn(answers, id) ? answers[id] : undefined;\n}\nexport function validateQuestion(question: QuestionnaireQuestion, answers: QuestionnaireAnswers, strings: QuestionnaireStrings): string | undefined {\n\tif (question.disabled) return;\n\tconst value = getQuestionnaireAnswer(answers, question.id);\n\tconst empty = value === undefined || (typeof value === 'string' && !value.trim()) || (Array.isArray(value) && value.length === 0);\n\tif (question.required && (empty || (question.type === 'boolean' && value !== true))) return strings.required;\n\tif (value !== undefined) {\n\t\tif ((question.type === 'text' || question.type === 'textarea') && typeof value !== 'string') return strings.invalidFormat;\n\t\tif (question.type === 'boolean' && typeof value !== 'boolean') return strings.invalidFormat;\n\t\tif ((question.type === 'multiple' && !Array.isArray(value)) || ((question.type === 'single' || question.type === 'select') && typeof value !== 'string')) return strings.invalidChoice;\n\t}\n\tif (!empty) {\n\t\tif (question.type === 'single' || question.type === 'select' || question.type === 'multiple') {\n\t\t\tconst selected = Array.isArray(value) ? value : [value];\n\t\t\tif ((question.type === 'multiple' ? !Array.isArray(value) : typeof value !== 'string') || selected.some((entry) => !question.options.some((option) => option.value === entry && !option.disabled))) return strings.invalidChoice;\n\t\t} else if (question.type === 'text' || question.type === 'textarea') {\n\t\t\tif (typeof value !== 'string' || (question.maxLength !== undefined && value.length > question.maxLength)) return strings.invalidFormat;\n\t\t\tif (question.inputType === 'email' && !/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(value)) return strings.invalidFormat;\n\t\t\tif (question.inputType === 'url') { try { const url = new URL(value); if (!url.host || !['http:', 'https:'].includes(url.protocol)) return strings.invalidFormat; } catch { return strings.invalidFormat; } }\n\t\t} else if (question.type === 'boolean' && typeof value !== 'boolean') return strings.invalidFormat;\n\t}\n\tconst result = question.validate?.(value, answers);\n\treturn typeof result === 'string' && result.length > 0 ? result : undefined;\n}\n\nexport function getSubmissionAnswers(questions: readonly QuestionnaireQuestion[], answers: QuestionnaireAnswers): QuestionnaireAnswers {\n\treturn Object.fromEntries(getVisibleQuestions(questions, answers).filter((question) => !question.disabled).map((question) => {\n\t\tconst answer = getQuestionnaireAnswer(answers, question.id);\n\t\treturn [question.id, Array.isArray(answer) ? [...answer] : answer];\n\t}));\n}\n","import { forwardRef, useEffect, useId, useRef, useState } from 'react';\nimport { Button } from '../../base/buttons';\nimport { FormField } from '../../base/forms/form-field';\nimport { Progress } from '../../base/feedback';\nimport { Stack } from '../../base/structure';\nimport { Heading, Text } from '../../typography';\nimport { useStrings } from '../../../lib/strings';\nimport { cn } from '../../../lib/utils';\nimport { QuestionnaireControl } from './questionnaire-control';\nimport { defaultQuestionnaireStrings, type QuestionnaireAnswer, type QuestionnaireAnswers, type QuestionnaireProps } from './questionnaire.types';\nimport { getQuestionnaireAnswer, getSubmissionAnswers, getVisibleQuestions, validateQuestion } from './questionnaire.utils';\n\nconst emptyAnswers: QuestionnaireAnswers = {};\n\nexport const Questionnaire = forwardRef<HTMLFormElement, QuestionnaireProps>(function Questionnaire(props, ref) {\n\tconst { questions, value: controlledValue, defaultValue = {}, onValueChange, questionId, defaultQuestionId, onQuestionChange,\n\t\tdisabled = false, onSubmit, onComplete, onError, formatSubmitError, headerSlot, emptySlot, completionSlot, strings: stringsProp,\n\t\tclassName, onReset, ...formProps } = props;\n\tconst controlled = Object.prototype.hasOwnProperty.call(props, 'value');\n\tconst stepControlled = Object.prototype.hasOwnProperty.call(props, 'questionId');\n\tconst [internalValue, setInternalValue] = useState<QuestionnaireAnswers>(defaultValue);\n\tconst answers = controlled ? controlledValue ?? emptyAnswers : internalValue;\n\tconst answersRef = useRef(answers); answersRef.current = answers;\n\tconst visible = getVisibleQuestions(questions, answers);\n\tconst [internalId, setInternalId] = useState<string | undefined>(defaultQuestionId ?? visible[0]?.id);\n\tconst requestedId = stepControlled ? questionId : internalId;\n\tconst current = visible.find((question) => question.id === requestedId) ?? visible[0];\n\tconst position = current ? visible.indexOf(current) : 0;\n\tconst [errors, setErrors] = useState<Record<string, string | undefined>>({});\n\tconst [submitError, setSubmitError] = useState<string>();\n\tconst [busy, setBusy] = useState(false);\n\tconst [completed, setCompleted] = useState(false);\n\tconst submission = useRef<AbortController | null>(null);\n\tconst resetTimer = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n\tconst mounted = useRef(true);\n\tconst stageRef = useRef<HTMLDivElement>(null);\n\tconst strings = useStrings(defaultQuestionnaireStrings, stringsProp);\n\tconst id = useId();\n\tconst labelId = `${id}-title`;\n\tconst descriptionId = `${id}-description`;\n\tconst locked = busy || disabled;\n\tconst cancelReset = () => { clearTimeout(resetTimer.current); resetTimer.current = undefined; };\n\tconst cancel = () => { submission.current?.abort(); submission.current = null; setBusy(false); };\n\tconst goTo = (nextId: string) => { if (!stepControlled) setInternalId(nextId); onQuestionChange?.(nextId); };\n\tconst setAnswer = (answer: QuestionnaireAnswer) => {\n\t\tif (!current || current.disabled || locked) return;\n\t\tconst next = { ...answersRef.current, [current.id]: answer };\n\t\tif (!controlled) { answersRef.current = next; setInternalValue(next); }\n\t\tonValueChange?.(next);\n\t\tsetErrors((previous) => ({ ...previous, [current.id]: undefined })); setSubmitError(undefined); setCompleted(false);\n\t};\n\tuseEffect(() => { stageRef.current?.focus(); }, [current?.id, completed]);\n\tuseEffect(() => {\n\t\t// Replacing data/schema or disabling during a request invalidates that result.\n\t\tcancelReset(); cancel(); setErrors({}); setSubmitError(undefined); setCompleted(false);\n\t}, [answers, questions, disabled]);\n\tuseEffect(() => { mounted.current = true; return () => { mounted.current = false; cancelReset(); submission.current?.abort(); submission.current = null; }; }, []);\n\tconst advance = () => {\n\t\tif (!current || locked) return;\n\t\tconst error = validateQuestion(current, answersRef.current, strings);\n\t\tsetErrors((previous) => ({ ...previous, [current.id]: error }));\n\t\tif (error) { stageRef.current?.focus(); return; }\n\t\tif (visible[position + 1]) goTo(visible[position + 1].id);\n\t};\n\tconst submit = async () => {\n\t\tif (submission.current || disabled || !visible.length) return;\n\t\tconst validation = Object.fromEntries(visible.map((question) => [question.id, validateQuestion(question, answersRef.current, strings)]));\n\t\tsetErrors(validation);\n\t\tconst firstInvalid = visible.find((question) => validation[question.id]);\n\t\tif (firstInvalid) { goTo(firstInvalid.id); stageRef.current?.focus(); return; }\n\t\tconst controller = new AbortController(); submission.current = controller;\n\t\tsetSubmitError(undefined); setBusy(true);\n\t\tconst snapshot = getSubmissionAnswers(questions, answersRef.current);\n\t\ttry {\n\t\t\tawait onSubmit?.(snapshot, { signal: controller.signal });\n\t\t\tif (submission.current !== controller || controller.signal.aborted) return;\n\t\t\tsetCompleted(true); onComplete?.(snapshot);\n\t\t} catch (error) {\n\t\t\tif (submission.current !== controller || controller.signal.aborted) return;\n\t\t\tsetSubmitError(formatSubmitError?.(error) ?? strings.submitError); onError?.(error);\n\t\t} finally { if (submission.current === controller) { submission.current = null; setBusy(false); } }\n\t};\n\tconst currentError = current && Object.hasOwn(errors, current.id) ? errors[current.id] : undefined;\n\tconst description = current && (currentError || current.description);\n\treturn <form {...formProps} ref={ref} noValidate aria-busy={busy || undefined} className={cn('questionnaire--component min-w-0', className)} onSubmit={(event) => { event.preventDefault(); if (position < visible.length - 1) advance(); else void submit(); }} onReset={(event) => {\n\t\tonReset?.(event); const nativeEvent = event.nativeEvent;\n\t\t// Trusted events can run microtasks before native ancestor listeners have cancelled reset.\n\t\tcancelReset(); resetTimer.current = setTimeout(() => {\n\t\t\tresetTimer.current = undefined;\n\t\t\tif (!mounted.current || nativeEvent.defaultPrevented || disabled) return; cancel();\n\t\t\tif (!controlled) { answersRef.current = defaultValue; setInternalValue(defaultValue); } onValueChange?.(defaultValue);\n\t\t\tsetErrors({}); setSubmitError(undefined); setCompleted(false);\n\t\t\tconst initialVisible = getVisibleQuestions(questions, defaultValue);\n\t\t\tconst initialQuestion = initialVisible.find((question) => question.id === defaultQuestionId) ?? initialVisible[0];\n\t\t\tif (initialQuestion) goTo(initialQuestion.id); else if (!stepControlled) setInternalId(undefined);\n\t\t}, 0);\n\t}}>\n\t\t<Stack gap=\"lg\">\n\t\t\t{headerSlot}\n\t\t\t{!current ? emptySlot ?? <Text type=\"secondary\">{strings.empty}</Text> : completed ? completionSlot ?? <Stack gap=\"sm\"><Text role=\"status\">{strings.submitted}</Text><Button disabled={disabled} type=\"button\" buttonStyle=\"outline\" onClick={() => { setCompleted(false); if (visible[0]) goTo(visible[0].id); }}>{strings.editAnswers}</Button></Stack> : <>\n\t\t\t\t<Progress value={position + 1} max={visible.length} label={strings.progress} valueSlot={<Text size=\"xs\" type=\"secondary\" aria-live=\"polite\">{strings.step(position + 1, visible.length)}</Text>} />\n\t\t\t\t<Stack ref={stageRef} gap=\"normal\" tabIndex={-1} role=\"group\" aria-labelledby={labelId} className=\"questionnaire--question outline-none\">\n\t\t\t\t\t<Heading id={labelId} tag=\"h3\">{current.title}</Heading>\n\t\t\t\t\t<FormField required={current.required} error={currentError} hint={current.description} supportingTextId={descriptionId}>\n\t\t\t\t\t\t<QuestionnaireControl key={current.id} question={current} answer={getQuestionnaireAnswer(answers, current.id)} answers={answers} disabled={locked || Boolean(current.disabled)} error={currentError} labelId={labelId} descriptionId={description ? descriptionId : undefined} onAnswerChange={setAnswer} />\n\t\t\t\t\t</FormField>\n\t\t\t\t</Stack>\n\t\t\t\t{submitError && <Text role=\"alert\" type=\"error\">{submitError}</Text>}\n\t\t\t\t{busy && <Text role=\"status\" type=\"secondary\">{strings.submitting}</Text>}\n\t\t\t\t<Stack direction=\"horizontal\" gap=\"sm\" wrap>\n\t\t\t\t\t<Button type=\"button\" buttonStyle=\"outline\" disabled={locked || position === 0} onClick={() => { setSubmitError(undefined); goTo(visible[position - 1].id); }}>{strings.previous}</Button>\n\t\t\t\t\t{position < visible.length - 1 ? <Button tone=\"primary\" type=\"button\" disabled={locked} onClick={advance}>{strings.next}</Button> : <Button tone=\"primary\" type=\"submit\" disabled={locked}>{submitError ? strings.retry : strings.submit}</Button>}\n\t\t\t\t\t{busy && <Button type=\"button\" buttonStyle=\"outline\" disabled={disabled} onClick={cancel}>{strings.cancel}</Button>}\n\t\t\t\t</Stack>\n\t\t\t</>}\n\t\t</Stack>\n\t</form>;\n});\n"],"mappings":";;;;;;;;;;;;;;;;;AAYA,SAAgBiB,GAAqB,EAAE,aAAU,WAAQ,aAAU,UAAO,YAAS,kBAAe,mBAAgB,GAAGC,KAAyC;CAC7J,IAAM,EAAE,oBAAiBjB,EAAiB,GAGpCkB,IAAahB,EAAG,wBAAwBW,GAA2BN,EAAqBN,EAAsB,KAAA,GAAWkB,CAAY,EAAE,GACvIC,IAAS;EAAE;EAAU,SAAS,EAAQC;EAAQ,mBAAmBC;EAAS,oBAAoBC;EAAe,UAAUC,EAAS;CAAS;CAe/I,OAdIA,EAAS,SAAS,WAAiBA,EAAS,OAAO;EAAE,GAAGP;EAAS;EAAU;EAAQ;EAAU;EAAO;EAAS;EAAe;CAAe,CAAC,IAC5IO,EAAS,SAAS,SAAe,kBAAChB,GAAD;EAAO,GAAIY;EAAQ,MAAMI,EAAS,aAAa;EAAQ,WAAWA,EAAS;EAAW,aAAaA,EAAS;EAAa,OAAO,OAAOC,KAAW,WAAWA,IAAS;EAAI,WAAW,MAAUC,EAAeC,EAAM,OAAO,KAAK;CAAI,CAAA,IACrQH,EAAS,SAAS,aAAmB,kBAACd,GAAD;EAAU,GAAIU;EAAQ,MAAMI,EAAS,QAAQ;EAAG,WAAWA,EAAS;EAAW,aAAaA,EAAS;EAAa,OAAO,OAAOC,KAAW,WAAWA,IAAS;EA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Field","Textarea","Select","CardRadioGroup","choiceControlTrackClasses","Checkbox","Fragment$1","QuestionnaireControl","context","checkTrack","defaultScale","common","error","labelId","descriptionId","question","answer","onAnswerChange","event","values","optionId","index","disabled","option","checked","entry","Label","defaultQuestionnaireStrings","current","total","getVisibleQuestions","questions","answers","getQuestionnaireAnswer","id","validateQuestion","value","empty","strings","selected","url","result","getSubmissionAnswers","emptyAnswers","Questionnaire","forwardRef","controlledValue","stringsProp","formProps","props","controlled","stepControlled","internalValue","setInternalValue","useState","defaultValue","answersRef","useRef","visible","internalId","setInternalId","defaultQuestionId","requestedId","questionId","position","errors","setErrors","submitError","setSubmitError","busy","setBusy","completed","setCompleted","submission","resetTimer","mounted","stageRef","useStrings","useId","locked","cancelReset","cancel","goTo","nextId","onQuestionChange","setAnswer","next","onValueChange","previous","useEffect","advance","submit","validation","firstInvalid","controller","snapshot","onSubmit","onComplete","formatSubmitError","onError","currentError","description","className","nativeEvent","initialVisible","initialQuestion","headerSlot","completionSlot","Heading","emptySlot"],"sources":["../../src/components/features/questionnaire/questionnaire-control.tsx","../../src/components/features/questionnaire/questionnaire.types.ts","../../src/components/features/questionnaire/questionnaire.utils.ts","../../src/components/features/questionnaire/questionnaire.tsx"],"sourcesContent":["import { CardRadioGroup, Checkbox, Select } from '../../base/choice-inputs';\nimport { choiceControlTrackClasses } from '../../base/choice-inputs/choice-types';\nimport { formLabelSizeClasses } from '../../base/forms/form-sizing';\nimport { Input, Textarea } from '../../base/text-inputs';\nimport { Stack } from '../../base/structure';\nimport { Label, Text } from '../../typography';\nimport { useDensityConfig } from '../../../lib/ui-provider';\nimport { resolveComponentScale } from '../../../lib/ui-provider/scale';\nimport { cn } from '../../../lib/utils';\nimport type { QuestionnaireQuestionContext } from './questionnaire.types';\n\n/** All interactive behavior remains with public Base UI-backed field owners. */\nexport function QuestionnaireControl({ question, answer, disabled, error, labelId, descriptionId, onAnswerChange, ...context }: QuestionnaireQuestionContext) {\n\tconst { defaultScale } = useDensityConfig();\n\t// Each checkbox sits in a track one Label line tall, so it centres on the\n\t// option's first line whether or not the label wraps.\n\tconst checkTrack = cn('questionnaire--check', choiceControlTrackClasses, formLabelSizeClasses[resolveComponentScale(undefined, defaultScale)]);\n\tconst common = { disabled, invalid: Boolean(error), 'aria-labelledby': labelId, 'aria-describedby': descriptionId, required: question.required };\n\tif (question.type === 'custom') return question.render({ ...context, question, answer, disabled, error, labelId, descriptionId, onAnswerChange });\n\tif (question.type === 'text') return <Input {...common} type={question.inputType ?? 'text'} maxLength={question.maxLength} placeholder={question.placeholder} value={typeof answer === 'string' ? answer : ''} onChange={(event) => onAnswerChange(event.target.value)} />;\n\tif (question.type === 'textarea') return <Textarea {...common} rows={question.rows ?? 4} maxLength={question.maxLength} placeholder={question.placeholder} value={typeof answer === 'string' ? answer : ''} onChange={(event) => onAnswerChange(event.target.value)} />;\n\tif (question.type === 'select') return <Select {...common} options={question.options} value={typeof answer === 'string' ? answer : null} onValueChange={onAnswerChange} />;\n\tif (question.type === 'single') return <fieldset aria-labelledby={labelId} aria-describedby={descriptionId} className=\"questionnaire--choices m-0 min-w-0 border-0 p-0\"><CardRadioGroup options={question.options} value={typeof answer === 'string' ? answer : ''} disabled={disabled} invalid={Boolean(error)} onValueChange={onAnswerChange} columns={1} /></fieldset>;\n\tif (question.type === 'multiple') return <fieldset aria-labelledby={labelId} aria-describedby={descriptionId} className=\"questionnaire--choices m-0 min-w-0 border-0 p-0\"><Stack gap=\"sm\">{question.options.map((option, index) => {\n\t\tconst values = Array.isArray(answer) ? answer : [];\n\t\tconst optionId = `${labelId}-option-${index}`;\n\t\treturn <Stack key={option.value} direction=\"horizontal\" align=\"start\" gap=\"sm\">\n\t\t\t<span className={checkTrack}><Checkbox id={optionId} disabled={disabled || option.disabled} aria-invalid={Boolean(error) || undefined} aria-describedby={[descriptionId, option.description ? `${optionId}-description` : undefined].filter(Boolean).join(' ') || undefined} checked={values.includes(option.value)} onCheckedChange={(checked) => onAnswerChange(checked ? [...values, option.value] : values.filter((entry) => entry !== option.value))} /></span>\n\t\t\t<Stack gap=\"dense\"><Label htmlFor={optionId} className=\"text-inherit\">{option.label}</Label>{option.description && <Text id={`${optionId}-description`} size=\"xs\" type=\"secondary\">{option.description}</Text>}</Stack>\n\t\t</Stack>;\n\t})}</Stack></fieldset>;\n\tif (question.type === 'boolean') return <Stack direction=\"horizontal\" align=\"start\" gap=\"sm\"><span className={checkTrack}><Checkbox {...common} aria-labelledby={undefined} id={`${labelId}-checkbox`} checked={answer === true} onCheckedChange={(checked) => onAnswerChange(checked)} /></span><Label htmlFor={`${labelId}-checkbox`} className=\"text-inherit\">{question.label ?? question.title}</Label></Stack>;\n\treturn null;\n}\n","import type { ComponentPropsWithoutRef, ReactNode } from 'react';\nimport type { StringsProp } from '../../../lib/strings';\n\nexport type QuestionnaireAnswer = string | string[] | boolean | undefined;\nexport type QuestionnaireAnswers = Record<string, QuestionnaireAnswer>;\nexport interface QuestionnaireOption { value: string; label: string; description?: string; disabled?: boolean }\nexport interface QuestionnaireQuestionBase {\n\t/** Unique stable key, used to retain answers across conditional visibility changes. */\n\tid: string;\n\ttitle: string;\n\tdescription?: string;\n\trequired?: boolean;\n\tdisabled?: boolean;\n\t/** Hidden answers are retained for editing, but excluded from validation/submission. */\n\twhen?: (answers: QuestionnaireAnswers) => boolean;\n\t/** Return an error message, or undefined/true for a valid answer. */\n\tvalidate?: (answer: QuestionnaireAnswer, answers: QuestionnaireAnswers) => string | true | undefined;\n}\nexport interface QuestionnaireTextQuestion extends QuestionnaireQuestionBase {\n\ttype: 'text' | 'textarea';\n\tplaceholder?: string;\n\t/** Native text input type. */\n\tinputType?: 'text' | 'email' | 'url' | 'tel';\n\trows?: number;\n\tmaxLength?: number;\n}\nexport interface QuestionnaireChoiceQuestion extends QuestionnaireQuestionBase {\n\ttype: 'single' | 'multiple' | 'select';\n\toptions: QuestionnaireOption[];\n}\nexport interface QuestionnaireBooleanQuestion extends QuestionnaireQuestionBase { type: 'boolean'; label?: string }\nexport interface QuestionnaireCustomQuestion extends QuestionnaireQuestionBase {\n\ttype: 'custom';\n\trender: (context: QuestionnaireQuestionContext) => ReactNode;\n}\nexport type QuestionnaireQuestion = QuestionnaireTextQuestion | QuestionnaireChoiceQuestion | QuestionnaireBooleanQuestion | QuestionnaireCustomQuestion;\nexport interface QuestionnaireQuestionContext {\n\tquestion: QuestionnaireQuestion;\n\tanswer: QuestionnaireAnswer;\n\tanswers: QuestionnaireAnswers;\n\tdisabled: boolean;\n\terror?: string;\n\t/** Connect custom controls to the visible title and description/error. */\n\tlabelId: string;\n\tdescriptionId?: string;\n\tonAnswerChange: (answer: QuestionnaireAnswer) => void;\n}\nexport interface QuestionnaireSubmitContext { signal: AbortSignal }\nexport interface QuestionnaireStrings {\n\tprevious: string; next: string; submit: string; retry: string; cancel: string;\n\tsubmitting: string; submitted: string; editAnswers: string; empty: string;\n\trequired: string; invalidChoice: string; invalidFormat: string; progress: string;\n\tstep: (current: number, total: number) => string;\n\tsubmitError: string;\n}\nexport const defaultQuestionnaireStrings: QuestionnaireStrings = {\n\tprevious: 'Previous', next: 'Next', submit: 'Submit answers', retry: 'Try again', cancel: 'Cancel submission',\n\tsubmitting: 'Submitting answers…', submitted: 'Your answers have been submitted.', editAnswers: 'Edit answers',\n\tempty: 'There are no questions to answer.', required: 'Please answer this question.', invalidChoice: 'Choose an available option.',\n\tinvalidFormat: 'Enter a valid answer.', progress: 'Questionnaire progress', step: (current, total) => `Question ${current} of ${total}`,\n\tsubmitError: 'Answers could not be submitted. Please try again.',\n};\nexport interface QuestionnaireProps extends Omit<ComponentPropsWithoutRef<'form'>, 'children' | 'onSubmit' | 'defaultValue' | 'onChange'> {\n\tquestions: readonly QuestionnaireQuestion[];\n\t/** Controlled answers. */\n\tvalue?: QuestionnaireAnswers;\n\t/** Initial answers for uncontrolled use. */\n\tdefaultValue?: QuestionnaireAnswers;\n\tonValueChange?: (answers: QuestionnaireAnswers) => void;\n\t/** Controlled active question key. */\n\tquestionId?: string;\n\tdefaultQuestionId?: string;\n\tonQuestionChange?: (id: string) => void;\n\tdisabled?: boolean;\n\t/** Receives only visible, enabled questions. Respect signal to cancel application requests. */\n\tonSubmit?: (answers: QuestionnaireAnswers, context: QuestionnaireSubmitContext) => void | Promise<void>;\n\tonComplete?: (answers: QuestionnaireAnswers) => void;\n\tonError?: (error: unknown) => void;\n\tformatSubmitError?: (error: unknown) => string;\n\theaderSlot?: ReactNode;\n\temptySlot?: ReactNode;\n\t/** Replaces the completion state; default includes an edit-answers action. */\n\tcompletionSlot?: ReactNode;\n\tstrings?: StringsProp<QuestionnaireStrings>;\n}\n","import type { QuestionnaireAnswers, QuestionnaireQuestion, QuestionnaireStrings } from './questionnaire.types';\n\nexport function getVisibleQuestions(questions: readonly QuestionnaireQuestion[], answers: QuestionnaireAnswers) {\n\treturn questions.filter((question) => !question.when || question.when(answers));\n}\nexport function getQuestionnaireAnswer(answers: QuestionnaireAnswers, id: string) {\n\treturn Object.hasOwn(answers, id) ? answers[id] : undefined;\n}\nexport function validateQuestion(question: QuestionnaireQuestion, answers: QuestionnaireAnswers, strings: QuestionnaireStrings): string | undefined {\n\tif (question.disabled) return;\n\tconst value = getQuestionnaireAnswer(answers, question.id);\n\tconst empty = value === undefined || (typeof value === 'string' && !value.trim()) || (Array.isArray(value) && value.length === 0);\n\tif (question.required && (empty || (question.type === 'boolean' && value !== true))) return strings.required;\n\tif (value !== undefined) {\n\t\tif ((question.type === 'text' || question.type === 'textarea') && typeof value !== 'string') return strings.invalidFormat;\n\t\tif (question.type === 'boolean' && typeof value !== 'boolean') return strings.invalidFormat;\n\t\tif ((question.type === 'multiple' && !Array.isArray(value)) || ((question.type === 'single' || question.type === 'select') && typeof value !== 'string')) return strings.invalidChoice;\n\t}\n\tif (!empty) {\n\t\tif (question.type === 'single' || question.type === 'select' || question.type === 'multiple') {\n\t\t\tconst selected = Array.isArray(value) ? value : [value];\n\t\t\tif ((question.type === 'multiple' ? !Array.isArray(value) : typeof value !== 'string') || selected.some((entry) => !question.options.some((option) => option.value === entry && !option.disabled))) return strings.invalidChoice;\n\t\t} else if (question.type === 'text' || question.type === 'textarea') {\n\t\t\tif (typeof value !== 'string' || (question.maxLength !== undefined && value.length > question.maxLength)) return strings.invalidFormat;\n\t\t\tif (question.inputType === 'email' && !/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(value)) return strings.invalidFormat;\n\t\t\tif (question.inputType === 'url') { try { const url = new URL(value); if (!url.host || !['http:', 'https:'].includes(url.protocol)) return strings.invalidFormat; } catch { return strings.invalidFormat; } }\n\t\t} else if (question.type === 'boolean' && typeof value !== 'boolean') return strings.invalidFormat;\n\t}\n\tconst result = question.validate?.(value, answers);\n\treturn typeof result === 'string' && result.length > 0 ? result : undefined;\n}\n\nexport function getSubmissionAnswers(questions: readonly QuestionnaireQuestion[], answers: QuestionnaireAnswers): QuestionnaireAnswers {\n\treturn Object.fromEntries(getVisibleQuestions(questions, answers).filter((question) => !question.disabled).map((question) => {\n\t\tconst answer = getQuestionnaireAnswer(answers, question.id);\n\t\treturn [question.id, Array.isArray(answer) ? [...answer] : answer];\n\t}));\n}\n","import { forwardRef, useEffect, useId, useRef, useState } from 'react';\nimport { Button } from '../../base/buttons';\nimport { FormField } from '../../base/forms/form-field';\nimport { Progress } from '../../base/feedback';\nimport { Stack } from '../../base/structure';\nimport { Heading, Text } from '../../typography';\nimport { useStrings } from '../../../lib/strings';\nimport { cn } from '../../../lib/utils';\nimport { QuestionnaireControl } from './questionnaire-control';\nimport { defaultQuestionnaireStrings, type QuestionnaireAnswer, type QuestionnaireAnswers, type QuestionnaireProps } from './questionnaire.types';\nimport { getQuestionnaireAnswer, getSubmissionAnswers, getVisibleQuestions, validateQuestion } from './questionnaire.utils';\n\nconst emptyAnswers: QuestionnaireAnswers = {};\n\nexport const Questionnaire = forwardRef<HTMLFormElement, QuestionnaireProps>(function Questionnaire(props, ref) {\n\tconst { questions, value: controlledValue, defaultValue = {}, onValueChange, questionId, defaultQuestionId, onQuestionChange,\n\t\tdisabled = false, onSubmit, onComplete, onError, formatSubmitError, headerSlot, emptySlot, completionSlot, strings: stringsProp,\n\t\tclassName, onReset, ...formProps } = props;\n\tconst controlled = Object.prototype.hasOwnProperty.call(props, 'value');\n\tconst stepControlled = Object.prototype.hasOwnProperty.call(props, 'questionId');\n\tconst [internalValue, setInternalValue] = useState<QuestionnaireAnswers>(defaultValue);\n\tconst answers = controlled ? controlledValue ?? emptyAnswers : internalValue;\n\tconst answersRef = useRef(answers); answersRef.current = answers;\n\tconst visible = getVisibleQuestions(questions, answers);\n\tconst [internalId, setInternalId] = useState<string | undefined>(defaultQuestionId ?? visible[0]?.id);\n\tconst requestedId = stepControlled ? questionId : internalId;\n\tconst current = visible.find((question) => question.id === requestedId) ?? visible[0];\n\tconst position = current ? visible.indexOf(current) : 0;\n\tconst [errors, setErrors] = useState<Record<string, string | undefined>>({});\n\tconst [submitError, setSubmitError] = useState<string>();\n\tconst [busy, setBusy] = useState(false);\n\tconst [completed, setCompleted] = useState(false);\n\tconst submission = useRef<AbortController | null>(null);\n\tconst resetTimer = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n\tconst mounted = useRef(true);\n\tconst stageRef = useRef<HTMLDivElement>(null);\n\tconst strings = useStrings(defaultQuestionnaireStrings, stringsProp);\n\tconst id = useId();\n\tconst labelId = `${id}-title`;\n\tconst descriptionId = `${id}-description`;\n\tconst locked = busy || disabled;\n\tconst cancelReset = () => { clearTimeout(resetTimer.current); resetTimer.current = undefined; };\n\tconst cancel = () => { submission.current?.abort(); submission.current = null; setBusy(false); };\n\tconst goTo = (nextId: string) => { if (!stepControlled) setInternalId(nextId); onQuestionChange?.(nextId); };\n\tconst setAnswer = (answer: QuestionnaireAnswer) => {\n\t\tif (!current || current.disabled || locked) return;\n\t\tconst next = { ...answersRef.current, [current.id]: answer };\n\t\tif (!controlled) { answersRef.current = next; setInternalValue(next); }\n\t\tonValueChange?.(next);\n\t\tsetErrors((previous) => ({ ...previous, [current.id]: undefined })); setSubmitError(undefined); setCompleted(false);\n\t};\n\tuseEffect(() => { stageRef.current?.focus(); }, [current?.id, completed]);\n\tuseEffect(() => {\n\t\t// Replacing data/schema or disabling during a request invalidates that result.\n\t\tcancelReset(); cancel(); setErrors({}); setSubmitError(undefined); setCompleted(false);\n\t}, [answers, questions, disabled]);\n\tuseEffect(() => { mounted.current = true; return () => { mounted.current = false; cancelReset(); submission.current?.abort(); submission.current = null; }; }, []);\n\tconst advance = () => {\n\t\tif (!current || locked) return;\n\t\tconst error = validateQuestion(current, answersRef.current, strings);\n\t\tsetErrors((previous) => ({ ...previous, [current.id]: error }));\n\t\tif (error) { stageRef.current?.focus(); return; }\n\t\tif (visible[position + 1]) goTo(visible[position + 1].id);\n\t};\n\tconst submit = async () => {\n\t\tif (submission.current || disabled || !visible.length) return;\n\t\tconst validation = Object.fromEntries(visible.map((question) => [question.id, validateQuestion(question, answersRef.current, strings)]));\n\t\tsetErrors(validation);\n\t\tconst firstInvalid = visible.find((question) => validation[question.id]);\n\t\tif (firstInvalid) { goTo(firstInvalid.id); stageRef.current?.focus(); return; }\n\t\tconst controller = new AbortController(); submission.current = controller;\n\t\tsetSubmitError(undefined); setBusy(true);\n\t\tconst snapshot = getSubmissionAnswers(questions, answersRef.current);\n\t\ttry {\n\t\t\tawait onSubmit?.(snapshot, { signal: controller.signal });\n\t\t\tif (submission.current !== controller || controller.signal.aborted) return;\n\t\t\tsetCompleted(true); onComplete?.(snapshot);\n\t\t} catch (error) {\n\t\t\tif (submission.current !== controller || controller.signal.aborted) return;\n\t\t\tsetSubmitError(formatSubmitError?.(error) ?? strings.submitError); onError?.(error);\n\t\t} finally { if (submission.current === controller) { submission.current = null; setBusy(false); } }\n\t};\n\tconst currentError = current && Object.hasOwn(errors, current.id) ? errors[current.id] : undefined;\n\tconst description = current && (currentError || current.description);\n\treturn <form {...formProps} ref={ref} noValidate aria-busy={busy || undefined} className={cn('questionnaire--component min-w-0', className)} onSubmit={(event) => { event.preventDefault(); if (position < visible.length - 1) advance(); else void submit(); }} onReset={(event) => {\n\t\tonReset?.(event); const nativeEvent = event.nativeEvent;\n\t\t// Trusted events can run microtasks before native ancestor listeners have cancelled reset.\n\t\tcancelReset(); resetTimer.current = setTimeout(() => {\n\t\t\tresetTimer.current = undefined;\n\t\t\tif (!mounted.current || nativeEvent.defaultPrevented || disabled) return; cancel();\n\t\t\tif (!controlled) { answersRef.current = defaultValue; setInternalValue(defaultValue); } onValueChange?.(defaultValue);\n\t\t\tsetErrors({}); setSubmitError(undefined); setCompleted(false);\n\t\t\tconst initialVisible = getVisibleQuestions(questions, defaultValue);\n\t\t\tconst initialQuestion = initialVisible.find((question) => question.id === defaultQuestionId) ?? initialVisible[0];\n\t\t\tif (initialQuestion) goTo(initialQuestion.id); else if (!stepControlled) setInternalId(undefined);\n\t\t}, 0);\n\t}}>\n\t\t<Stack gap=\"lg\">\n\t\t\t{headerSlot}\n\t\t\t{!current ? emptySlot ?? <Text type=\"secondary\">{strings.empty}</Text> : completed ? completionSlot ?? <Stack gap=\"sm\"><Text type=\"inherit\" role=\"status\">{strings.submitted}</Text><Button disabled={disabled} type=\"button\" buttonStyle=\"outline\" onClick={() => { setCompleted(false); if (visible[0]) goTo(visible[0].id); }}>{strings.editAnswers}</Button></Stack> : <>\n\t\t\t\t<Progress value={position + 1} max={visible.length} label={strings.progress} valueSlot={<Text size=\"xs\" type=\"secondary\" aria-live=\"polite\">{strings.step(position + 1, visible.length)}</Text>} />\n\t\t\t\t<Stack ref={stageRef} gap=\"normal\" tabIndex={-1} role=\"group\" aria-labelledby={labelId} className=\"questionnaire--question outline-none\">\n\t\t\t\t\t<Heading className=\"text-inherit\" id={labelId} tag=\"h3\">{current.title}</Heading>\n\t\t\t\t\t<FormField required={current.required} error={currentError} hint={current.description} supportingTextId={descriptionId}>\n\t\t\t\t\t\t<QuestionnaireControl key={current.id} question={current} answer={getQuestionnaireAnswer(answers, current.id)} answers={answers} disabled={locked || Boolean(current.disabled)} error={currentError} labelId={labelId} descriptionId={description ? descriptionId : undefined} onAnswerChange={setAnswer} />\n\t\t\t\t\t</FormField>\n\t\t\t\t</Stack>\n\t\t\t\t{submitError && <Text role=\"alert\" type=\"error\">{submitError}</Text>}\n\t\t\t\t{busy && <Text role=\"status\" type=\"secondary\">{strings.submitting}</Text>}\n\t\t\t\t<Stack direction=\"horizontal\" gap=\"sm\" wrap>\n\t\t\t\t\t<Button type=\"button\" buttonStyle=\"outline\" disabled={locked || position === 0} onClick={() => { setSubmitError(undefined); goTo(visible[position - 1].id); }}>{strings.previous}</Button>\n\t\t\t\t\t{position < visible.length - 1 ? <Button tone=\"primary\" type=\"button\" disabled={locked} onClick={advance}>{strings.next}</Button> : <Button tone=\"primary\" type=\"submit\" disabled={locked}>{submitError ? strings.retry : strings.submit}</Button>}\n\t\t\t\t\t{busy && <Button type=\"button\" buttonStyle=\"outline\" disabled={disabled} onClick={cancel}>{strings.cancel}</Button>}\n\t\t\t\t</Stack>\n\t\t\t</>}\n\t\t</Stack>\n\t</form>;\n});\n"],"mappings":";;;;;;;;;;;;;;;;;AAYA,SAAgBiB,GAAqB,EAAE,aAAU,WAAQ,aAAU,UAAO,YAAS,kBAAe,mBAAgB,GAAGC,KAAyC;CAC7J,IAAM,EAAE,oBAAiBjB,EAAiB,GAGpCkB,IAAahB,EAAG,wBAAwBW,GAA2BN,EAAqBN,EAAsB,KAAA,GAAWkB,CAAY,EAAE,GACvIC,IAAS;EAAE;EAAU,SAAS,EAAQC;EAAQ,mBAAmBC;EAAS,oBAAoBC;EAAe,UAAUC,EAAS;CAAS;CAe/I,OAdIA,EAAS,SAAS,WAAiBA,EAAS,OAAO;EAAE,GAAGP;EAAS;EAAU;EAAQ;EAAU;EAAO;EAAS;EAAe;CAAe,CAAC,IAC5IO,EAAS,SAAS,SAAe,kBAAChB,GAAD;EAAO,GAAIY;EAAQ,MAAMI,EAAS,aAAa;EAAQ,WAAWA,EAAS;EAAW,aAAaA,EAAS;EAAa,OAAO,OAA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AAY;OAAoB;OAAU,SAASuF;OAAS,UAAA3C,EAAQ;MAAe,CAAA;KAC5G;;GACN,EAAA,CAAA,IAfUuE,MAAa,kBAAClH,GAAD;IAAM,MAAK;IAAa,UAAA2C,EAAQ;GAAY,CAAA,CAgB/D;;CACF,CAAA;AACP,CAAC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useStrings as e } from "../lib/strings.js";
|
|
3
|
-
import { t } from "../utils-
|
|
4
|
-
import { n } from "../buttons-
|
|
5
|
-
import {
|
|
6
|
-
import { t as a } from "../structure-
|
|
7
|
-
import { n as o } from "../cards-
|
|
8
|
-
import { r as s } from "../overlays-
|
|
9
|
-
import { n as c } from "../display-
|
|
10
|
-
import { s as l } from "../data-display-
|
|
3
|
+
import { t } from "../utils-BRhFDwuU.js";
|
|
4
|
+
import { n } from "../buttons-DPZekJFu.js";
|
|
5
|
+
import { c as r, o as i } from "../typography-UTnveOEy.js";
|
|
6
|
+
import { t as a } from "../structure-BmisBK-3.js";
|
|
7
|
+
import { n as o } from "../cards-BaBZR-AU.js";
|
|
8
|
+
import { r as s } from "../overlays-tMkF-VAN.js";
|
|
9
|
+
import { n as c } from "../display-hAc1HjpI.js";
|
|
10
|
+
import { s as l } from "../data-display-DT_khPl_.js";
|
|
11
11
|
import { useCallback as u, useEffect as d, useMemo as f, useRef as p, useState as m } from "react";
|
|
12
12
|
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
13
13
|
import { Eye as v, PackageOpen as y } from "lucide-react";
|
|
@@ -108,16 +108,19 @@ function S({ context: t, strings: n, getSelectionLabel: o }) {
|
|
|
108
108
|
return l == null || l === "" ? null : /* @__PURE__ */ _(a, {
|
|
109
109
|
gap: "dense",
|
|
110
110
|
className: "default-dialog-summary--component shared-resource-card--dialog-summary",
|
|
111
|
-
children: [/* @__PURE__ */ g(
|
|
111
|
+
children: [/* @__PURE__ */ g(i, { children: s.currentlySelected }), /* @__PURE__ */ g(r, {
|
|
112
|
+
type: "inherit",
|
|
113
|
+
children: l
|
|
114
|
+
})]
|
|
112
115
|
});
|
|
113
116
|
}
|
|
114
117
|
S.displayName = "DefaultDialogSummary";
|
|
115
118
|
function C({ context: t, strings: n }) {
|
|
116
|
-
let
|
|
117
|
-
return /* @__PURE__ */ g(
|
|
119
|
+
let i = e(b, n);
|
|
120
|
+
return /* @__PURE__ */ g(r, {
|
|
118
121
|
type: "secondary",
|
|
119
122
|
className: "default-resource-content--component",
|
|
120
|
-
children:
|
|
123
|
+
children: i.noResourceContent
|
|
121
124
|
});
|
|
122
125
|
}
|
|
123
126
|
C.displayName = "DefaultResourceContent";
|
|
@@ -156,7 +159,7 @@ function T({ SelectorComponent: e, selectorProps: t, context: n }) {
|
|
|
156
159
|
T.displayName = "DefaultDialogContent";
|
|
157
160
|
//#endregion
|
|
158
161
|
//#region src/components/features/resource-assignment/resource-assignment.tsx
|
|
159
|
-
function E({ icon:
|
|
162
|
+
function E({ icon: i, title: l, description: u, className: d, contentClassName: p, alert: m, alertTone: y, actions: E, headerAction: D, footerText: O, resource: k, selector: A, sections: j, sectionsClassName: M, viewAction: N, viewLink: P, ResourceContentComponent: F, EmptyContentComponent: I, renderResourceContent: L, renderEmptyContent: R, strings: ee }) {
|
|
160
163
|
let z = e(b, ee), B = x({
|
|
161
164
|
resource: k,
|
|
162
165
|
mapInitialSelected: A?.mapInitialSelected ?? (() => null),
|
|
@@ -223,7 +226,7 @@ function E({ icon: r, title: l, description: u, className: d, contentClassName:
|
|
|
223
226
|
]), re = f(() => R ? R(B) : I ? /* @__PURE__ */ g(I, { context: B }) : V ? /* @__PURE__ */ g(w, {
|
|
224
227
|
context: B,
|
|
225
228
|
strings: z
|
|
226
|
-
}) : /* @__PURE__ */ g(
|
|
229
|
+
}) : /* @__PURE__ */ g(r, {
|
|
227
230
|
type: "secondary",
|
|
228
231
|
children: z.noResourceSelected
|
|
229
232
|
}), [
|
|
@@ -301,7 +304,7 @@ function E({ icon: r, title: l, description: u, className: d, contentClassName:
|
|
|
301
304
|
})
|
|
302
305
|
}) : null;
|
|
303
306
|
return /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ _(c, {
|
|
304
|
-
icon:
|
|
307
|
+
icon: i,
|
|
305
308
|
title: l,
|
|
306
309
|
description: u,
|
|
307
310
|
"data-state": Z ? "selected" : "empty",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource-assignment.js","names":["_Fragment","ContentComponent","DisplayLabel","Text","Stack","CardPrimaryAction","ActionDialog","ContentBlock","EmptyState","Fragment$1","defaultSharedResourceCardStrings","useSharedResourceCard","internalOpen","setInternalOpen","useState","defaultOpen","isConfirming","setIsConfirming","internalSelectedSuggestion","setInternalSelectedSuggestion","defaultValue","isOpenControlled","open","isValueControlled","value","isSelectorOpen","selectedSuggestion","hasResource","resource","initializedOpenCycleRef","useRef","hasOpenedRef","hasExplicitDefaultValueRef","setSelectorOpen","useCallback","nextOpen","onOpenChange","setSelectedSuggestion","selection","onValueChange","openSelector","isFirstOpen","initial","mapInitialSelected","onDialogOpen","closeSelector","onDialogClose","canConfirmSelection","useMemo","isConfirmDisabled","confirmSelection","onConfirmSelection","error","onError","DefaultDialogSummary","useStrings","strings","selected","context","label","getSelectionLabel","DefaultResourceContent","_context","s","DefaultEmptyContent","PackageOpen","Button","DefaultDialogContent","componentProps","selectorProps","SelectorComponent","SharedResourceCard","stringsProp","selectorContext","selector","canUseSelector","selectorActionLabel","visibleBaseActionCount","actions","action","usesDefaultEmptyAction","renderEmptyContent","EmptyContentComponent","shouldInlineSelectorAction","resolvedActions","baseActions","resolvedHeaderAction","headerAction","resourceContent","renderResourceContent","ResourceContentComponent","sections","visibleSections","section","sectionsClassName","SectionComponent","emptyContent","DialogContentComponent","DialogSummaryComponent","dialogContentProps","cardBody","shouldRenderDialog","hasCustomViewAction","viewAction","viewActionContent","viewLink","Eye","viewActionNode","cn","dialogNode","className"],"sources":["../../src/components/features/resource-assignment/resource-assignment.strings.ts","../../src/components/features/resource-assignment/hooks/use-shared-resource-card.ts","../../src/components/features/resource-assignment/partials/default-shared-resource-partials.tsx","../../src/components/features/resource-assignment/resource-assignment.tsx"],"sourcesContent":["/**\n * Default user-facing strings for the resource-assignment feature.\n *\n * Consumers wire backend i18n at the call site:\n *\n * <SharedResourceCard\n * strings={{ noResourceSelected: t('resourceAssignment.empty') }}\n * …\n * />\n */\n\nexport interface SharedResourceCardStrings {\n\tcurrentlySelected: string;\n\tnoResourceContent: string;\n\tnoResourceSelected: string;\n\tchangeAction: string;\n}\n\nexport const defaultSharedResourceCardStrings: SharedResourceCardStrings = {\n\tcurrentlySelected: 'Currently selected:',\n\tnoResourceContent: 'No resource content configured.',\n\tnoResourceSelected: 'No resource selected.',\n\tchangeAction: 'Change',\n};\n","import { useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport type { SharedResourceCardContext } from '../resource-assignment.types';\n\nexport type UseSharedResourceCardOptions<TResource, TSuggestion> = {\n\t/** Persisted assignment. `null` is the only empty state. */\n\tresource: TResource | null;\n\t/** Map persisted data when neither `value` nor first-open `defaultValue` supplies selection. */\n\tmapInitialSelected: (resource: TResource | null) => TSuggestion | null;\n\t/** Persist a confirmed suggestion. Returned promises are awaited. */\n\tonConfirmSelection: (selection: TSuggestion) => void | Promise<void>;\n\t/** Disable confirmation for a pending candidate. */\n\tisConfirmDisabled?: (selection: TSuggestion | null) => boolean;\n\t/** Called once per closed-to-open cycle, including an initially open selector. */\n\tonDialogOpen?: (selection: TSuggestion | null) => void;\n\t/** Called after selection mode closes or confirmation succeeds. */\n\tonDialogClose?: () => void;\n\t/** Called when `onConfirmSelection` throws. Library DEV-logs the error;\n\t * consumer wires telemetry. */\n\tonError?: (error: unknown, selection: TSuggestion) => void;\n\t/** Controlled selector visibility. An initial `true` value initializes selection. */\n\topen?: boolean;\n\t/** Initial selector visibility; `true` initializes selection after mount. */\n\tdefaultOpen?: boolean;\n\t/** Controlled visibility callback and uncontrolled visibility observer. */\n\tonOpenChange?: (open: boolean) => void;\n\t/** Controlled pending suggestion; authoritative over mapping on every open. */\n\tvalue?: TSuggestion | null;\n\t/** Initial uncontrolled suggestion; authoritative over mapping on the first open. */\n\tdefaultValue?: TSuggestion | null;\n\t/** Controlled selection callback and uncontrolled selection observer. */\n\tonValueChange?: (selection: TSuggestion | null) => void;\n};\n\nexport type UseSharedResourceCardResult<TResource, TSuggestion> =\n\tSharedResourceCardContext<TResource, TSuggestion>;\n\nexport function useSharedResourceCard<TResource, TSuggestion>({\n\tresource,\n\tmapInitialSelected,\n\tonConfirmSelection,\n\tisConfirmDisabled,\n\tonDialogOpen,\n\tonDialogClose,\n\tonError,\n\topen,\n\tdefaultOpen = false,\n\tonOpenChange,\n\tvalue,\n\tdefaultValue,\n\tonValueChange,\n}: UseSharedResourceCardOptions<TResource, TSuggestion>): UseSharedResourceCardResult<TResource, TSuggestion> {\n\tconst [internalOpen, setInternalOpen] = useState(defaultOpen);\n\tconst [isConfirming, setIsConfirming] = useState(false);\n\tconst [internalSelectedSuggestion, setInternalSelectedSuggestion] =\n\t\tuseState<TSuggestion | null>(defaultValue ?? null);\n\tconst isOpenControlled = open !== undefined;\n\tconst isValueControlled = value !== undefined;\n\tconst isSelectorOpen = isOpenControlled ? open : internalOpen;\n\tconst selectedSuggestion = isValueControlled ? value : internalSelectedSuggestion;\n\tconst hasResource = resource !== null;\n\tconst initializedOpenCycleRef = useRef(false);\n\tconst hasOpenedRef = useRef(false);\n\tconst hasExplicitDefaultValueRef = useRef(defaultValue !== undefined);\n\n\tconst setSelectorOpen = useCallback((nextOpen: boolean) => {\n\t\tif (!isOpenControlled) setInternalOpen(nextOpen);\n\t\tonOpenChange?.(nextOpen);\n\t}, [isOpenControlled, onOpenChange]);\n\n\tconst setSelectedSuggestion = useCallback((selection: TSuggestion | null) => {\n\t\tif (!isValueControlled) setInternalSelectedSuggestion(selection);\n\t\tonValueChange?.(selection);\n\t}, [isValueControlled, onValueChange]);\n\n\tconst openSelector = useCallback(() => {\n\t\tsetSelectorOpen(true);\n\t}, [setSelectorOpen]);\n\n\tuseEffect(() => {\n\t\tif (!isSelectorOpen) {\n\t\t\tinitializedOpenCycleRef.current = false;\n\t\t\treturn;\n\t\t}\n\n\t\tif (initializedOpenCycleRef.current) {\n\t\t\treturn;\n\t\t}\n\n\t\tinitializedOpenCycleRef.current = true;\n\t\tconst isFirstOpen = !hasOpenedRef.current;\n\t\tlet initial: TSuggestion | null;\n\n\t\tif (isValueControlled) {\n\t\t\tinitial = value;\n\t\t} else if (isFirstOpen && hasExplicitDefaultValueRef.current) {\n\t\t\tinitial = internalSelectedSuggestion;\n\t\t} else {\n\t\t\tinitial = mapInitialSelected(resource);\n\t\t\tsetSelectedSuggestion(initial);\n\t\t}\n\n\t\thasOpenedRef.current = true;\n\t\tonDialogOpen?.(initial);\n\t}, [\n\t\tinternalSelectedSuggestion,\n\t\tisSelectorOpen,\n\t\tisValueControlled,\n\t\tmapInitialSelected,\n\t\tonDialogOpen,\n\t\tresource,\n\t\tsetSelectedSuggestion,\n\t\tvalue,\n\t]);\n\n\tconst closeSelector = useCallback(() => {\n\t\tif (isConfirming) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetSelectorOpen(false);\n\t\tsetSelectedSuggestion(null);\n\t\tonDialogClose?.();\n\t}, [isConfirming, onDialogClose, setSelectedSuggestion, setSelectorOpen]);\n\n\tconst canConfirmSelection = useMemo(() => {\n\t\tif (selectedSuggestion === null) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!isConfirmDisabled) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn !isConfirmDisabled(selectedSuggestion);\n\t}, [isConfirmDisabled, selectedSuggestion]);\n\n\tconst confirmSelection = useCallback(async () => {\n\t\tif (\n\t\t\tisConfirming ||\n\t\t\t!canConfirmSelection ||\n\t\t\tselectedSuggestion === null\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetIsConfirming(true);\n\n\t\ttry {\n\t\t\tawait onConfirmSelection(selectedSuggestion);\n\t\t\tsetSelectorOpen(false);\n\t\t\tsetSelectedSuggestion(null);\n\t\t\tonDialogClose?.();\n\t\t} catch (error) {\n\t\t\tif (import.meta.env?.DEV) {\n\t\t\t\tconsole.warn('SharedResourceCard confirmation failed:', error);\n\t\t\t}\n\t\t\tonError?.(error, selectedSuggestion);\n\t\t} finally {\n\t\t\tsetIsConfirming(false);\n\t\t}\n\t}, [\n\t\tcanConfirmSelection,\n\t\tisConfirming,\n\t\tonConfirmSelection,\n\t\tonDialogClose,\n\t\tonError,\n\t\tselectedSuggestion,\n\t\tsetSelectedSuggestion,\n\t\tsetSelectorOpen,\n\t]);\n\n\treturn useMemo(\n\t\t() => ({\n\t\t\tresource,\n\t\t\thasResource,\n\t\t\tisSelectorOpen,\n\t\t\tisConfirming,\n\t\t\tselectedSuggestion,\n\t\t\tsetSelectedSuggestion,\n\t\t\topenSelector,\n\t\t\tcloseSelector,\n\t\t\tconfirmSelection,\n\t\t\tcanConfirmSelection,\n\t\t}),\n\t\t[\n\t\t\tcanConfirmSelection,\n\t\t\tcloseSelector,\n\t\t\tconfirmSelection,\n\t\t\thasResource,\n\t\t\tisConfirming,\n\t\t\tisSelectorOpen,\n\t\t\topenSelector,\n\t\t\tresource,\n\t\t\tselectedSuggestion,\n\t\t\tsetSelectedSuggestion,\n\t\t],\n\t);\n}\n","import { Stack } from '../../../base/structure';\n/**\n * Default partial implementations for `<SharedResourceCard>`.\n *\n * Consumers can override any of these by passing\n * `ResourceContentComponent` / `EmptyContentComponent` /\n * `selector.DialogContentComponent` / `selector.DialogSummaryComponent`\n * to `<SharedResourceCard>`. Strings flow through the `strings` prop\n * deep-merged over `defaultSharedResourceCardStrings`.\n */\nimport { Button } from '../../../base/buttons';\nimport { EmptyState } from '../../../blocks/data-display';\nimport { DisplayLabel, Text } from '../../../typography';\nimport { useStrings, type StringsProp } from '../../../../lib/strings';\nimport { PackageOpen } from 'lucide-react';\nimport type { ReactNode } from 'react';\n\nimport { defaultSharedResourceCardStrings, type SharedResourceCardStrings } from '../resource-assignment.strings';\nimport type {\n\tSharedResourceCardContentProps,\n\tSharedResourceCardDialogContentProps,\n\tSharedResourceCardDialogSummaryProps,\n\tSharedResourceSelectorComponentProps,\n} from '../resource-assignment.types';\n\ntype DefaultStrings = StringsProp<SharedResourceCardStrings>;\n\nexport function DefaultDialogSummary<TResource, TSuggestion>({\n\tcontext,\n\tstrings,\n\tgetSelectionLabel,\n}: SharedResourceCardDialogSummaryProps<TResource, TSuggestion> & {\n\t/** Overrides this surface's own copy. */\n\tstrings?: DefaultStrings;\n\t/** Builds the summary shown for the current selection. */\n\tgetSelectionLabel?: (selection: TSuggestion) => ReactNode;\n}) {\n\tconst s = useStrings(defaultSharedResourceCardStrings, strings);\n\tconst selected = context.selectedSuggestion;\n\n\tif (selected === null) {\n\t\treturn null;\n\t}\n\n\tconst label = getSelectionLabel?.(selected) ?? (\n\t\ttypeof selected === 'object' &&\n\t\tselected !== null &&\n\t\t'label' in selected &&\n\t\ttypeof selected.label === 'string'\n\t\t\t? selected.label\n\t\t\t: null\n\t);\n\n\tif (label === null || label === undefined || label === '') {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Stack gap=\"dense\" className=\"default-dialog-summary--component shared-resource-card--dialog-summary\">\n\t\t\t<DisplayLabel>{s.currentlySelected}</DisplayLabel>\n\t\t\t<Text>{label}</Text>\n\t\t</Stack>\n\t);\n}\nDefaultDialogSummary.displayName = 'DefaultDialogSummary';\n\nexport function DefaultResourceContent<TResource, TSuggestion>({\n\tcontext: _context,\n\tstrings,\n}: SharedResourceCardContentProps<TResource, TSuggestion> & { strings?: DefaultStrings }) {\n\tconst s = useStrings(defaultSharedResourceCardStrings, strings);\n\treturn <Text type=\"secondary\" className=\"default-resource-content--component\">{s.noResourceContent}</Text>;\n}\nDefaultResourceContent.displayName = 'DefaultResourceContent';\n\nexport function DefaultEmptyContent<TResource, TSuggestion>({\n\tcontext,\n\tstrings,\n}: SharedResourceCardContentProps<TResource, TSuggestion> & { strings?: DefaultStrings }) {\n\tconst s = useStrings(defaultSharedResourceCardStrings, strings);\n\treturn (\n\t\t<EmptyState\n\t\t\ttitle={s.noResourceSelected}\n\t\t\tdescription={false}\n\t\t\tmedia={<PackageOpen className=\"size-icon\" />}\n\t\t\tmediaVariant=\"icon-soft\"\n\t\t\tactions={<Button\n\t\t\t\ttone=\"secondary\"\n\t\t\t\tbuttonStyle=\"outline\"\n\t\t\t\tonClick={context.openSelector}\n\t\t\t\ttype=\"button\"\n\t\t\t>\n\t\t\t\t{s.changeAction}\n\t\t\t</Button>}\n\t\t\tclassName=\"default-empty-content--component\"\n\t\t/>\n\t);\n}\nDefaultEmptyContent.displayName = 'DefaultEmptyContent';\n\nexport function DefaultDialogContent<\n\tTResource,\n\tTSuggestion,\n\tTSelectorProps extends object = Record<never, never>,\n>({\n\tSelectorComponent,\n\tselectorProps,\n\tcontext,\n}: SharedResourceCardDialogContentProps<TResource, TSuggestion, TSelectorProps>) {\n\tconst componentProps = {\n\t\t...(selectorProps ?? {} as TSelectorProps),\n\t\tonSelect: context.setSelectedSuggestion,\n\t\tselected: context.selectedSuggestion,\n\t\tinModal: true,\n\t\tlockOnSelect: false,\n\t\tcontext: 'dialog' as const,\n\t} as SharedResourceSelectorComponentProps<TSuggestion, TSelectorProps>;\n\n\treturn (\n\t\t<div className=\"default-dialog-content--component\">\n\t\t\t<SelectorComponent {...componentProps} />\n\t\t</div>\n\t);\n}\nDefaultDialogContent.displayName = 'DefaultDialogContent';\n","import { Eye } from 'lucide-react';\nimport { type ReactNode, useMemo } from 'react';\n\nimport { Button } from '../../base/buttons';\nimport { CardPrimaryAction } from '../../base/cards';\nimport { ContentBlock } from '../../base/display';\nimport { Stack } from '../../base/structure';\nimport { Text } from '../../typography';\nimport { ActionDialog } from '../overlays';\nimport { useStrings } from '../../../lib/strings';\nimport { cn } from '../../../lib/utils';\n\nimport { defaultSharedResourceCardStrings } from './resource-assignment.strings';\nimport { type SharedResourceCardProps } from './resource-assignment.types';\nimport { useSharedResourceCard } from './hooks';\nimport {\n\tDefaultDialogContent,\n\tDefaultDialogSummary,\n\tDefaultEmptyContent,\n\tDefaultResourceContent,\n} from './partials';\n\n/**\n * Stateful, card-free relationship assignment workflow.\n *\n * Consumers own persisted resources, selector data, mutations, routing, and\n * translations. The feature owns pending selection, confirmation state,\n * failure handling, and the default assignment presentation.\n */\nexport function SharedResourceCard<\n\tTResource,\n\tTSuggestion,\n\tTSelectorProps extends object = Record<never, never>,\n>({\n\ticon,\n\ttitle,\n\tdescription,\n\tclassName,\n\tcontentClassName,\n\talert,\n\talertTone,\n\tactions,\n\theaderAction,\n\tfooterText,\n\tresource,\n\tselector,\n\tsections,\n\tsectionsClassName,\n\tviewAction,\n\tviewLink,\n\tResourceContentComponent,\n\tEmptyContentComponent,\n\trenderResourceContent,\n\trenderEmptyContent,\n\tstrings: stringsProp,\n}: SharedResourceCardProps<TResource, TSuggestion, TSelectorProps>) {\n\tconst strings = useStrings(defaultSharedResourceCardStrings, stringsProp);\n\tconst selectorContext = useSharedResourceCard<TResource, TSuggestion>({\n\t\tresource,\n\t\tmapInitialSelected:\n\t\t\tselector?.mapInitialSelected ?? (() => null as TSuggestion | null),\n\t\tonConfirmSelection:\n\t\t\tselector?.onConfirmSelection ?? (() => undefined),\n\t\tisConfirmDisabled: selector?.isConfirmDisabled,\n\t\tonDialogOpen: selector?.onDialogOpen,\n\t\tonDialogClose: selector?.onDialogClose,\n\t\tonError: selector?.onError,\n\t\topen: selector?.open,\n\t\tdefaultOpen: selector?.defaultOpen,\n\t\tonOpenChange: selector?.onOpenChange,\n\t\tvalue: selector?.value,\n\t\tdefaultValue: selector?.defaultValue,\n\t\tonValueChange: selector?.onValueChange,\n\t});\n\n\tconst canUseSelector = selector !== undefined;\n\tconst selectorActionLabel = selector?.actionLabel?.trim();\n\tconst visibleBaseActionCount = actions?.filter((action) => action.visible !== false).length ?? 0;\n\t// The default empty state already carries the selector call to action, so\n\t// the header does not repeat it until a resource is assigned.\n\tconst usesDefaultEmptyAction = canUseSelector\n\t\t&& !selectorContext.hasResource\n\t\t&& !renderEmptyContent\n\t\t&& !EmptyContentComponent;\n\tconst shouldInlineSelectorAction = Boolean(\n\t\tcanUseSelector && selectorActionLabel && visibleBaseActionCount === 0 && !usesDefaultEmptyAction,\n\t);\n\tconst resolvedActions = useMemo(() => {\n\t\tconst baseActions = actions ?? [];\n\n\t\tif (!canUseSelector || !selectorActionLabel || usesDefaultEmptyAction) {\n\t\t\treturn baseActions.length > 0 ? baseActions : undefined;\n\t\t}\n\n\t\tif (shouldInlineSelectorAction) {\n\t\t\treturn baseActions.length > 0 ? baseActions : undefined;\n\t\t}\n\n\t\treturn [\n\t\t\t...baseActions,\n\t\t\t{\n\t\t\t\tid: 'shared-resource-selector-change',\n\t\t\t\tlabel: selectorActionLabel,\n\t\t\t\tonClick: selectorContext.openSelector,\n\t\t\t},\n\t\t];\n\t}, [\n\t\tactions,\n\t\tcanUseSelector,\n\t\tselectorActionLabel,\n\t\tselectorContext.openSelector,\n\t\tshouldInlineSelectorAction,\n\t\tusesDefaultEmptyAction,\n\t]);\n\tconst resolvedHeaderAction = headerAction || shouldInlineSelectorAction ? (\n\t\t<>\n\t\t\t{headerAction}\n\t\t\t{shouldInlineSelectorAction && (\n\t\t\t\t<Button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\tbuttonStyle=\"outline\"\n\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\tonClick={selectorContext.openSelector}\n\t\t\t\t\tclassName=\"shared-resource-card--selector-action\"\n\t\t\t\t>\n\t\t\t\t\t{selectorActionLabel}\n\t\t\t\t</Button>\n\t\t\t)}\n\t\t</>\n\t) : undefined;\n\n\tconst resourceContent: ReactNode = useMemo(() => {\n\t\tif (renderResourceContent) {\n\t\t\treturn renderResourceContent(selectorContext);\n\t\t}\n\n\t\tif (ResourceContentComponent) {\n\t\t\tconst ContentComponent = ResourceContentComponent;\n\t\t\treturn <ContentComponent context={selectorContext} />;\n\t\t}\n\n\t\tif (Array.isArray(sections) && sections.length > 0) {\n\t\t\tconst visibleSections = sections.filter((section) => {\n\t\t\t\treturn section.when ? section.when(selectorContext) : true;\n\t\t\t});\n\n\t\t\tif (visibleSections.length > 0) {\n\t\t\t\treturn (\n\t\t\t\t\t<div className={sectionsClassName ?? 'grid gap-space-lg'}>\n\t\t\t\t\t\t{visibleSections.map((section) => {\n\t\t\t\t\t\t\tconst SectionComponent = section.Component;\n\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<div key={section.id} className={section.className}>\n\t\t\t\t\t\t\t\t\t<SectionComponent context={selectorContext} />\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t})}\n\t\t\t\t\t</div>\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn <DefaultResourceContent context={selectorContext} strings={strings} />;\n\t}, [\n\t\tResourceContentComponent,\n\t\trenderResourceContent,\n\t\tsections,\n\t\tsectionsClassName,\n\t\tselectorContext,\n\t\tstrings,\n\t]);\n\n\tconst emptyContent: ReactNode = useMemo(() => {\n\t\tif (renderEmptyContent) {\n\t\t\treturn renderEmptyContent(selectorContext);\n\t\t}\n\n\t\tif (EmptyContentComponent) {\n\t\t\tconst ContentComponent = EmptyContentComponent;\n\t\t\treturn <ContentComponent context={selectorContext} />;\n\t\t}\n\n\t\tif (!canUseSelector) {\n\t\t\treturn <Text type=\"secondary\">{strings.noResourceSelected}</Text>;\n\t\t}\n\n\t\treturn <DefaultEmptyContent context={selectorContext} strings={strings} />;\n\t}, [\n\t\tEmptyContentComponent,\n\t\tcanUseSelector,\n\t\trenderEmptyContent,\n\t\tselectorContext,\n\t\tstrings,\n\t]);\n\n\tconst DialogContentComponent = selector?.DialogContentComponent;\n\tconst DialogSummaryComponent = selector?.DialogSummaryComponent;\n\tconst SelectorComponent = selector?.SelectorComponent;\n\tconst selectorProps = selector?.selectorProps;\n\tconst dialogContentProps = selector?.dialogContentProps ?? {};\n\tconst hasResource = selectorContext.hasResource;\n\tconst cardBody = hasResource ? resourceContent : emptyContent;\n\tconst shouldRenderDialog = Boolean(\n\t\tcanUseSelector && selector && SelectorComponent,\n\t);\n\tconst hasCustomViewAction = viewAction !== undefined;\n\tlet viewActionContent: ReactNode = null;\n\n\tif (hasResource && hasCustomViewAction) {\n\t\tviewActionContent = viewAction;\n\t} else if (hasResource && viewLink) {\n\t\tviewActionContent = (\n\t\t\t<CardPrimaryAction href={viewLink.href} icon={Eye}>\n\t\t\t\t{viewLink.label}\n\t\t\t</CardPrimaryAction>\n\t\t);\n\t}\n\n\tconst viewActionNode = viewActionContent === null || viewActionContent === false\n\t\t? null\n\t\t: (\n\t\t\t<div\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'shared-resource-card--view-action',\n\t\t\t\t\t!hasCustomViewAction && viewLink?.className,\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{viewActionContent}\n\t\t\t</div>\n\t\t);\n\tconst dialogNode =\n\t\tshouldRenderDialog && selector && SelectorComponent ? (\n\t\t<ActionDialog\n\t\t\t\topen={selectorContext.isSelectorOpen}\n\t\t\t\tonOpenChange={(open) => {\n\t\t\t\t\tif (!open) {\n\t\t\t\t\t\tselectorContext.closeSelector();\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\t\ttitle={selector.title}\n\t\t\t\tdescription={selector.description}\n\t\t\t\tsize={selector.dialogSize ?? '2xl'}\n\t\t\t\tshowCancel={false}\n\t\t\t\tshowConfirm={false}\n\t\t\t\tfooter={\n\t\t\t\t\t<Stack\n\t\t\t\t\t\tdirection={{ base: 'vertical', sm: 'horizontal' }}\n\t\t\t\t\t\tgap=\"sm\"\n\t\t\t\t\t\talign={{ base: 'stretch', sm: 'center' }}\n\t\t\t\t\t\tjustify=\"end\"\n\t\t\t\t\t\tclassName=\"w-full\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\t\tbuttonStyle=\"outline\"\n\t\t\t\t\t\t\tonClick={selectorContext.closeSelector}\n\t\t\t\t\t\t\tdisabled={selectorContext.isConfirming}\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{selector.cancelText}\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t<Button tone=\"primary\"\n\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\tvoid selectorContext.confirmSelection();\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tdisabled={\n\t\t\t\t\t\t\t\t!selectorContext.canConfirmSelection ||\n\t\t\t\t\t\t\t\tselectorContext.isConfirming\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tloading={selectorContext.isConfirming}\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{selector.confirmText}\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</Stack>\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t<Stack gap=\"lg\" className=\"shared-resource-card--dialog-body\">\n\t\t\t\t\t{DialogContentComponent ? (\n\t\t\t\t\t\t<DialogContentComponent\n\t\t\t\t\t\t\tSelectorComponent={SelectorComponent}\n\t\t\t\t\t\t\tselectorProps={selectorProps}\n\t\t\t\t\t\t\tcontext={selectorContext}\n\t\t\t\t\t\t\t{...dialogContentProps}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<DefaultDialogContent<TResource, TSuggestion, TSelectorProps>\n\t\t\t\t\t\t\tSelectorComponent={SelectorComponent}\n\t\t\t\t\t\t\tselectorProps={selectorProps}\n\t\t\t\t\t\t\tcontext={selectorContext}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\n\t\t\t\t\t{DialogSummaryComponent ? (\n\t\t\t\t\t\t<DialogSummaryComponent context={selectorContext} />\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<DefaultDialogSummary\n\t\t\t\t\t\t\tcontext={selectorContext}\n\t\t\t\t\t\t\tstrings={strings}\n\t\t\t\t\t\t\tgetSelectionLabel={selector.getSelectionLabel}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t</Stack>\n\t\t</ActionDialog>\n\t\t) : null;\n\n\treturn (\n\t\t<>\n\t\t\t<ContentBlock\n\t\t\t\ticon={icon}\n\t\t\t\ttitle={title}\n\t\t\t\tdescription={description}\n\t\t\t\tdata-state={hasResource ? 'selected' : 'empty'}\n\t\t\t\tclassName={cn('shared-resource-card--component', className)}\n\t\t\t\tcontentGap=\"lg\"\n\t\t\t\tcontentClassName={contentClassName}\n\t\t\t\talert={alert}\n\t\t\t\talertTone={alertTone}\n\t\t\t\tactions={resolvedActions}\n\t\t\t\theaderAction={resolvedHeaderAction}\n\t\t\t\tfooterText={footerText}\n\t\t\t>\n\t\t\t\t{cardBody}\n\t\t\t\t{viewActionNode}\n\t\t\t</ContentBlock>\n\t\t\t{dialogNode}\n\t\t</>\n\t);\n}\n\nSharedResourceCard.displayName = 'SharedResourceCard';\n"],"mappings":";;;;;;;;;;;;;;AAkBA,IAAaU,IAA8D;CAC1E,mBAAmB;CACnB,mBAAmB;CACnB,oBAAoB;CACpB,cAAc;AACf;;;ACcA,SAAgBC,EAA8C,EAC7D,aACA,uBACA,uBACA,sBACA,iBACA,kBACA,YACA,SACA,iBAAc,IACd,iBACA,UACA,iBACA,oBAC6G;CAC7G,IAAM,CAACC,GAAcC,KAAmBC,EAASC,CAAW,GACtD,CAACC,GAAcC,KAAmBH,EAAS,EAAK,GAChD,CAACI,GAA4BC,KAClCL,EAA6BM,KAAgB,IAAI,GAC5CC,IAAmBC,MAAS,KAAA,GAC5BC,IAAoBC,MAAU,KAAA,GAC9BC,IAAiBJ,IAAmBC,IAAOV,GAC3Cc,IAAqBH,IAAoBC,IAAQN,GACjDS,IAAcC,MAAa,MAC3BC,IAA0BC,EAAO,EAAK,GAC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AC1B,MAAK;IAEJ,UAAAC,EAAS;GACH,CAAA,GACR,kBAACR,GAAD;IAAQ,MAAK;IACZ,eAAe;KACd,EAAqB,iBAAiB;IACvC;IACA,UACC,CAACO,EAAgB,uBACjBA,EAAgB;IAEjB,SAASA,EAAgB;IACzB,MAAK;IAEJ,UAAAC,EAAS;GACH,CAAA,CACF;;EAGR,UAAA,kBAACtE,GAAD;GAAO,KAAI;GAAK,WAAU;GAA1B,UAAA,CACE6F,IACA,kBAACA,GAAD;IACoB;IACJ;IACf,SAASxB;IACT,GAAI0B;GACJ,CAAA,IAED,kBAAChC,GAAD;IACoB;IACJ;IACf,SAASM;GACT,CAAA,GAGDyB,IACA,kBAACA,GAAD,EAAwB,SAASzB,EAAkB,CAAA,IAEnD,kBAACnB,GAAD;IACC,SAASmB;IACA;IACT,mBAAmBC,EAAS;GAC5B,CAAA,CAEI;;CACK,CAAA,IACV;CAEL,OACC,kBAAA1E,GAAA,EAAA,UAAA,CACC,kBAACO,GAAD;EACO;EACC;EACM;EACb,cAAYoB,IAAc,aAAa;EACvC,WAAWiF,EAAG,mCAAmCE,CAAS;EAC1D,YAAW;EACO;EACX;EACI;EACX,SAAS1B;EACT,cAAcE;EACF;EAZb,UAAA,CAcEc,IACAO,EACY;CACb,CAAA,GAAAE,EACA,EAAA,CAAA;AAEJ;AAEA,EAAmB,cAAc"}
|
|
1
|
+
{"version":3,"file":"resource-assignment.js","names":["_Fragment","ContentComponent","Text","DisplayLabel","Stack","CardPrimaryAction","ActionDialog","ContentBlock","EmptyState","Fragment$1","defaultSharedResourceCardStrings","useSharedResourceCard","internalOpen","setInternalOpen","useState","defaultOpen","isConfirming","setIsConfirming","internalSelectedSuggestion","setInternalSelectedSuggestion","defaultValue","isOpenControlled","open","isValueControlled","value","isSelectorOpen","selectedSuggestion","hasResource","resource","initializedOpenCycleRef","useRef","hasOpenedRef","hasExplicitDefaultValueRef","setSelectorOpen","useCallback","nextOpen","onOpenChange","setSelectedSuggestion","selection","onValueChange","openSelector","isFirstOpen","initial","mapInitialSelected","onDialogOpen","closeSelector","onDialogClose","canConfirmSelection","useMemo","isConfirmDisabled","confirmSelection","onConfirmSelection","error","onError","DefaultDialogSummary","useStrings","strings","selected","context","label","getSelectionLabel","DefaultResourceContent","_context","s","DefaultEmptyContent","PackageOpen","Button","DefaultDialogContent","componentProps","selectorProps","SelectorComponent","SharedResourceCard","stringsProp","selectorContext","selector","canUseSelector","selectorActionLabel","visibleBaseActionCount","actions","action","usesDefaultEmptyAction","renderEmptyContent","EmptyContentComponent","shouldInlineSelectorAction","resolvedActions","baseActions","resolvedHeaderAction","headerAction","resourceContent","renderResourceContent","ResourceContentComponent","sections","visibleSections","section","sectionsClassName","SectionComponent","emptyContent","DialogContentComponent","DialogSummaryComponent","dialogContentProps","cardBody","shouldRenderDialog","hasCustomViewAction","viewAction","viewActionContent","viewLink","Eye","viewActionNode","cn","dialogNode","className"],"sources":["../../src/components/features/resource-assignment/resource-assignment.strings.ts","../../src/components/features/resource-assignment/hooks/use-shared-resource-card.ts","../../src/components/features/resource-assignment/partials/default-shared-resource-partials.tsx","../../src/components/features/resource-assignment/resource-assignment.tsx"],"sourcesContent":["/**\n * Default user-facing strings for the resource-assignment feature.\n *\n * Consumers wire backend i18n at the call site:\n *\n * <SharedResourceCard\n * strings={{ noResourceSelected: t('resourceAssignment.empty') }}\n * …\n * />\n */\n\nexport interface SharedResourceCardStrings {\n\tcurrentlySelected: string;\n\tnoResourceContent: string;\n\tnoResourceSelected: string;\n\tchangeAction: string;\n}\n\nexport const defaultSharedResourceCardStrings: SharedResourceCardStrings = {\n\tcurrentlySelected: 'Currently selected:',\n\tnoResourceContent: 'No resource content configured.',\n\tnoResourceSelected: 'No resource selected.',\n\tchangeAction: 'Change',\n};\n","import { useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport type { SharedResourceCardContext } from '../resource-assignment.types';\n\nexport type UseSharedResourceCardOptions<TResource, TSuggestion> = {\n\t/** Persisted assignment. `null` is the only empty state. */\n\tresource: TResource | null;\n\t/** Map persisted data when neither `value` nor first-open `defaultValue` supplies selection. */\n\tmapInitialSelected: (resource: TResource | null) => TSuggestion | null;\n\t/** Persist a confirmed suggestion. Returned promises are awaited. */\n\tonConfirmSelection: (selection: TSuggestion) => void | Promise<void>;\n\t/** Disable confirmation for a pending candidate. */\n\tisConfirmDisabled?: (selection: TSuggestion | null) => boolean;\n\t/** Called once per closed-to-open cycle, including an initially open selector. */\n\tonDialogOpen?: (selection: TSuggestion | null) => void;\n\t/** Called after selection mode closes or confirmation succeeds. */\n\tonDialogClose?: () => void;\n\t/** Called when `onConfirmSelection` throws. Library DEV-logs the error;\n\t * consumer wires telemetry. */\n\tonError?: (error: unknown, selection: TSuggestion) => void;\n\t/** Controlled selector visibility. An initial `true` value initializes selection. */\n\topen?: boolean;\n\t/** Initial selector visibility; `true` initializes selection after mount. */\n\tdefaultOpen?: boolean;\n\t/** Controlled visibility callback and uncontrolled visibility observer. */\n\tonOpenChange?: (open: boolean) => void;\n\t/** Controlled pending suggestion; authoritative over mapping on every open. */\n\tvalue?: TSuggestion | null;\n\t/** Initial uncontrolled suggestion; authoritative over mapping on the first open. */\n\tdefaultValue?: TSuggestion | null;\n\t/** Controlled selection callback and uncontrolled selection observer. */\n\tonValueChange?: (selection: TSuggestion | null) => void;\n};\n\nexport type UseSharedResourceCardResult<TResource, TSuggestion> =\n\tSharedResourceCardContext<TResource, TSuggestion>;\n\nexport function useSharedResourceCard<TResource, TSuggestion>({\n\tresource,\n\tmapInitialSelected,\n\tonConfirmSelection,\n\tisConfirmDisabled,\n\tonDialogOpen,\n\tonDialogClose,\n\tonError,\n\topen,\n\tdefaultOpen = false,\n\tonOpenChange,\n\tvalue,\n\tdefaultValue,\n\tonValueChange,\n}: UseSharedResourceCardOptions<TResource, TSuggestion>): UseSharedResourceCardResult<TResource, TSuggestion> {\n\tconst [internalOpen, setInternalOpen] = useState(defaultOpen);\n\tconst [isConfirming, setIsConfirming] = useState(false);\n\tconst [internalSelectedSuggestion, setInternalSelectedSuggestion] =\n\t\tuseState<TSuggestion | null>(defaultValue ?? null);\n\tconst isOpenControlled = open !== undefined;\n\tconst isValueControlled = value !== undefined;\n\tconst isSelectorOpen = isOpenControlled ? open : internalOpen;\n\tconst selectedSuggestion = isValueControlled ? value : internalSelectedSuggestion;\n\tconst hasResource = resource !== null;\n\tconst initializedOpenCycleRef = useRef(false);\n\tconst hasOpenedRef = useRef(false);\n\tconst hasExplicitDefaultValueRef = useRef(defaultValue !== undefined);\n\n\tconst setSelectorOpen = useCallback((nextOpen: boolean) => {\n\t\tif (!isOpenControlled) setInternalOpen(nextOpen);\n\t\tonOpenChange?.(nextOpen);\n\t}, [isOpenControlled, onOpenChange]);\n\n\tconst setSelectedSuggestion = useCallback((selection: TSuggestion | null) => {\n\t\tif (!isValueControlled) setInternalSelectedSuggestion(selection);\n\t\tonValueChange?.(selection);\n\t}, [isValueControlled, onValueChange]);\n\n\tconst openSelector = useCallback(() => {\n\t\tsetSelectorOpen(true);\n\t}, [setSelectorOpen]);\n\n\tuseEffect(() => {\n\t\tif (!isSelectorOpen) {\n\t\t\tinitializedOpenCycleRef.current = false;\n\t\t\treturn;\n\t\t}\n\n\t\tif (initializedOpenCycleRef.current) {\n\t\t\treturn;\n\t\t}\n\n\t\tinitializedOpenCycleRef.current = true;\n\t\tconst isFirstOpen = !hasOpenedRef.current;\n\t\tlet initial: TSuggestion | null;\n\n\t\tif (isValueControlled) {\n\t\t\tinitial = value;\n\t\t} else if (isFirstOpen && hasExplicitDefaultValueRef.current) {\n\t\t\tinitial = internalSelectedSuggestion;\n\t\t} else {\n\t\t\tinitial = mapInitialSelected(resource);\n\t\t\tsetSelectedSuggestion(initial);\n\t\t}\n\n\t\thasOpenedRef.current = true;\n\t\tonDialogOpen?.(initial);\n\t}, [\n\t\tinternalSelectedSuggestion,\n\t\tisSelectorOpen,\n\t\tisValueControlled,\n\t\tmapInitialSelected,\n\t\tonDialogOpen,\n\t\tresource,\n\t\tsetSelectedSuggestion,\n\t\tvalue,\n\t]);\n\n\tconst closeSelector = useCallback(() => {\n\t\tif (isConfirming) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetSelectorOpen(false);\n\t\tsetSelectedSuggestion(null);\n\t\tonDialogClose?.();\n\t}, [isConfirming, onDialogClose, setSelectedSuggestion, setSelectorOpen]);\n\n\tconst canConfirmSelection = useMemo(() => {\n\t\tif (selectedSuggestion === null) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!isConfirmDisabled) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn !isConfirmDisabled(selectedSuggestion);\n\t}, [isConfirmDisabled, selectedSuggestion]);\n\n\tconst confirmSelection = useCallback(async () => {\n\t\tif (\n\t\t\tisConfirming ||\n\t\t\t!canConfirmSelection ||\n\t\t\tselectedSuggestion === null\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetIsConfirming(true);\n\n\t\ttry {\n\t\t\tawait onConfirmSelection(selectedSuggestion);\n\t\t\tsetSelectorOpen(false);\n\t\t\tsetSelectedSuggestion(null);\n\t\t\tonDialogClose?.();\n\t\t} catch (error) {\n\t\t\tif (import.meta.env?.DEV) {\n\t\t\t\tconsole.warn('SharedResourceCard confirmation failed:', error);\n\t\t\t}\n\t\t\tonError?.(error, selectedSuggestion);\n\t\t} finally {\n\t\t\tsetIsConfirming(false);\n\t\t}\n\t}, [\n\t\tcanConfirmSelection,\n\t\tisConfirming,\n\t\tonConfirmSelection,\n\t\tonDialogClose,\n\t\tonError,\n\t\tselectedSuggestion,\n\t\tsetSelectedSuggestion,\n\t\tsetSelectorOpen,\n\t]);\n\n\treturn useMemo(\n\t\t() => ({\n\t\t\tresource,\n\t\t\thasResource,\n\t\t\tisSelectorOpen,\n\t\t\tisConfirming,\n\t\t\tselectedSuggestion,\n\t\t\tsetSelectedSuggestion,\n\t\t\topenSelector,\n\t\t\tcloseSelector,\n\t\t\tconfirmSelection,\n\t\t\tcanConfirmSelection,\n\t\t}),\n\t\t[\n\t\t\tcanConfirmSelection,\n\t\t\tcloseSelector,\n\t\t\tconfirmSelection,\n\t\t\thasResource,\n\t\t\tisConfirming,\n\t\t\tisSelectorOpen,\n\t\t\topenSelector,\n\t\t\tresource,\n\t\t\tselectedSuggestion,\n\t\t\tsetSelectedSuggestion,\n\t\t],\n\t);\n}\n","import { Stack } from '../../../base/structure';\n/**\n * Default partial implementations for `<SharedResourceCard>`.\n *\n * Consumers can override any of these by passing\n * `ResourceContentComponent` / `EmptyContentComponent` /\n * `selector.DialogContentComponent` / `selector.DialogSummaryComponent`\n * to `<SharedResourceCard>`. Strings flow through the `strings` prop\n * deep-merged over `defaultSharedResourceCardStrings`.\n */\nimport { Button } from '../../../base/buttons';\nimport { EmptyState } from '../../../blocks/data-display';\nimport { DisplayLabel, Text } from '../../../typography';\nimport { useStrings, type StringsProp } from '../../../../lib/strings';\nimport { PackageOpen } from 'lucide-react';\nimport type { ReactNode } from 'react';\n\nimport { defaultSharedResourceCardStrings, type SharedResourceCardStrings } from '../resource-assignment.strings';\nimport type {\n\tSharedResourceCardContentProps,\n\tSharedResourceCardDialogContentProps,\n\tSharedResourceCardDialogSummaryProps,\n\tSharedResourceSelectorComponentProps,\n} from '../resource-assignment.types';\n\ntype DefaultStrings = StringsProp<SharedResourceCardStrings>;\n\nexport function DefaultDialogSummary<TResource, TSuggestion>({\n\tcontext,\n\tstrings,\n\tgetSelectionLabel,\n}: SharedResourceCardDialogSummaryProps<TResource, TSuggestion> & {\n\t/** Overrides this surface's own copy. */\n\tstrings?: DefaultStrings;\n\t/** Builds the summary shown for the current selection. */\n\tgetSelectionLabel?: (selection: TSuggestion) => ReactNode;\n}) {\n\tconst s = useStrings(defaultSharedResourceCardStrings, strings);\n\tconst selected = context.selectedSuggestion;\n\n\tif (selected === null) {\n\t\treturn null;\n\t}\n\n\tconst label = getSelectionLabel?.(selected) ?? (\n\t\ttypeof selected === 'object' &&\n\t\tselected !== null &&\n\t\t'label' in selected &&\n\t\ttypeof selected.label === 'string'\n\t\t\t? selected.label\n\t\t\t: null\n\t);\n\n\tif (label === null || label === undefined || label === '') {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Stack gap=\"dense\" className=\"default-dialog-summary--component shared-resource-card--dialog-summary\">\n\t\t\t<DisplayLabel>{s.currentlySelected}</DisplayLabel>\n\t\t\t<Text type=\"inherit\">{label}</Text>\n\t\t</Stack>\n\t);\n}\nDefaultDialogSummary.displayName = 'DefaultDialogSummary';\n\nexport function DefaultResourceContent<TResource, TSuggestion>({\n\tcontext: _context,\n\tstrings,\n}: SharedResourceCardContentProps<TResource, TSuggestion> & { strings?: DefaultStrings }) {\n\tconst s = useStrings(defaultSharedResourceCardStrings, strings);\n\treturn <Text type=\"secondary\" className=\"default-resource-content--component\">{s.noResourceContent}</Text>;\n}\nDefaultResourceContent.displayName = 'DefaultResourceContent';\n\nexport function DefaultEmptyContent<TResource, TSuggestion>({\n\tcontext,\n\tstrings,\n}: SharedResourceCardContentProps<TResource, TSuggestion> & { strings?: DefaultStrings }) {\n\tconst s = useStrings(defaultSharedResourceCardStrings, strings);\n\treturn (\n\t\t<EmptyState\n\t\t\ttitle={s.noResourceSelected}\n\t\t\tdescription={false}\n\t\t\tmedia={<PackageOpen className=\"size-icon\" />}\n\t\t\tmediaVariant=\"icon-soft\"\n\t\t\tactions={<Button\n\t\t\t\ttone=\"secondary\"\n\t\t\t\tbuttonStyle=\"outline\"\n\t\t\t\tonClick={context.openSelector}\n\t\t\t\ttype=\"button\"\n\t\t\t>\n\t\t\t\t{s.changeAction}\n\t\t\t</Button>}\n\t\t\tclassName=\"default-empty-content--component\"\n\t\t/>\n\t);\n}\nDefaultEmptyContent.displayName = 'DefaultEmptyContent';\n\nexport function DefaultDialogContent<\n\tTResource,\n\tTSuggestion,\n\tTSelectorProps extends object = Record<never, never>,\n>({\n\tSelectorComponent,\n\tselectorProps,\n\tcontext,\n}: SharedResourceCardDialogContentProps<TResource, TSuggestion, TSelectorProps>) {\n\tconst componentProps = {\n\t\t...(selectorProps ?? {} as TSelectorProps),\n\t\tonSelect: context.setSelectedSuggestion,\n\t\tselected: context.selectedSuggestion,\n\t\tinModal: true,\n\t\tlockOnSelect: false,\n\t\tcontext: 'dialog' as const,\n\t} as SharedResourceSelectorComponentProps<TSuggestion, TSelectorProps>;\n\n\treturn (\n\t\t<div className=\"default-dialog-content--component\">\n\t\t\t<SelectorComponent {...componentProps} />\n\t\t</div>\n\t);\n}\nDefaultDialogContent.displayName = 'DefaultDialogContent';\n","import { Eye } from 'lucide-react';\nimport { type ReactNode, useMemo } from 'react';\n\nimport { Button } from '../../base/buttons';\nimport { CardPrimaryAction } from '../../base/cards';\nimport { ContentBlock } from '../../base/display';\nimport { Stack } from '../../base/structure';\nimport { Text } from '../../typography';\nimport { ActionDialog } from '../overlays';\nimport { useStrings } from '../../../lib/strings';\nimport { cn } from '../../../lib/utils';\n\nimport { defaultSharedResourceCardStrings } from './resource-assignment.strings';\nimport { type SharedResourceCardProps } from './resource-assignment.types';\nimport { useSharedResourceCard } from './hooks';\nimport {\n\tDefaultDialogContent,\n\tDefaultDialogSummary,\n\tDefaultEmptyContent,\n\tDefaultResourceContent,\n} from './partials';\n\n/**\n * Stateful, card-free relationship assignment workflow.\n *\n * Consumers own persisted resources, selector data, mutations, routing, and\n * translations. The feature owns pending selection, confirmation state,\n * failure handling, and the default assignment presentation.\n */\nexport function SharedResourceCard<\n\tTResource,\n\tTSuggestion,\n\tTSelectorProps extends object = Record<never, never>,\n>({\n\ticon,\n\ttitle,\n\tdescription,\n\tclassName,\n\tcontentClassName,\n\talert,\n\talertTone,\n\tactions,\n\theaderAction,\n\tfooterText,\n\tresource,\n\tselector,\n\tsections,\n\tsectionsClassName,\n\tviewAction,\n\tviewLink,\n\tResourceContentComponent,\n\tEmptyContentComponent,\n\trenderResourceContent,\n\trenderEmptyContent,\n\tstrings: stringsProp,\n}: SharedResourceCardProps<TResource, TSuggestion, TSelectorProps>) {\n\tconst strings = useStrings(defaultSharedResourceCardStrings, stringsProp);\n\tconst selectorContext = useSharedResourceCard<TResource, TSuggestion>({\n\t\tresource,\n\t\tmapInitialSelected:\n\t\t\tselector?.mapInitialSelected ?? (() => null as TSuggestion | null),\n\t\tonConfirmSelection:\n\t\t\tselector?.onConfirmSelection ?? (() => undefined),\n\t\tisConfirmDisabled: selector?.isConfirmDisabled,\n\t\tonDialogOpen: selector?.onDialogOpen,\n\t\tonDialogClose: selector?.onDialogClose,\n\t\tonError: selector?.onError,\n\t\topen: selector?.open,\n\t\tdefaultOpen: selector?.defaultOpen,\n\t\tonOpenChange: selector?.onOpenChange,\n\t\tvalue: selector?.value,\n\t\tdefaultValue: selector?.defaultValue,\n\t\tonValueChange: selector?.onValueChange,\n\t});\n\n\tconst canUseSelector = selector !== undefined;\n\tconst selectorActionLabel = selector?.actionLabel?.trim();\n\tconst visibleBaseActionCount = actions?.filter((action) => action.visible !== false).length ?? 0;\n\t// The default empty state already carries the selector call to action, so\n\t// the header does not repeat it until a resource is assigned.\n\tconst usesDefaultEmptyAction = canUseSelector\n\t\t&& !selectorContext.hasResource\n\t\t&& !renderEmptyContent\n\t\t&& !EmptyContentComponent;\n\tconst shouldInlineSelectorAction = Boolean(\n\t\tcanUseSelector && selectorActionLabel && visibleBaseActionCount === 0 && !usesDefaultEmptyAction,\n\t);\n\tconst resolvedActions = useMemo(() => {\n\t\tconst baseActions = actions ?? [];\n\n\t\tif (!canUseSelector || !selectorActionLabel || usesDefaultEmptyAction) {\n\t\t\treturn baseActions.length > 0 ? baseActions : undefined;\n\t\t}\n\n\t\tif (shouldInlineSelectorAction) {\n\t\t\treturn baseActions.length > 0 ? baseActions : undefined;\n\t\t}\n\n\t\treturn [\n\t\t\t...baseActions,\n\t\t\t{\n\t\t\t\tid: 'shared-resource-selector-change',\n\t\t\t\tlabel: selectorActionLabel,\n\t\t\t\tonClick: selectorContext.openSelector,\n\t\t\t},\n\t\t];\n\t}, [\n\t\tactions,\n\t\tcanUseSelector,\n\t\tselectorActionLabel,\n\t\tselectorContext.openSelector,\n\t\tshouldInlineSelectorAction,\n\t\tusesDefaultEmptyAction,\n\t]);\n\tconst resolvedHeaderAction = headerAction || shouldInlineSelectorAction ? (\n\t\t<>\n\t\t\t{headerAction}\n\t\t\t{shouldInlineSelectorAction && (\n\t\t\t\t<Button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\tbuttonStyle=\"outline\"\n\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\tonClick={selectorContext.openSelector}\n\t\t\t\t\tclassName=\"shared-resource-card--selector-action\"\n\t\t\t\t>\n\t\t\t\t\t{selectorActionLabel}\n\t\t\t\t</Button>\n\t\t\t)}\n\t\t</>\n\t) : undefined;\n\n\tconst resourceContent: ReactNode = useMemo(() => {\n\t\tif (renderResourceContent) {\n\t\t\treturn renderResourceContent(selectorContext);\n\t\t}\n\n\t\tif (ResourceContentComponent) {\n\t\t\tconst ContentComponent = ResourceContentComponent;\n\t\t\treturn <ContentComponent context={selectorContext} />;\n\t\t}\n\n\t\tif (Array.isArray(sections) && sections.length > 0) {\n\t\t\tconst visibleSections = sections.filter((section) => {\n\t\t\t\treturn section.when ? section.when(selectorContext) : true;\n\t\t\t});\n\n\t\t\tif (visibleSections.length > 0) {\n\t\t\t\treturn (\n\t\t\t\t\t<div className={sectionsClassName ?? 'grid gap-space-lg'}>\n\t\t\t\t\t\t{visibleSections.map((section) => {\n\t\t\t\t\t\t\tconst SectionComponent = section.Component;\n\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<div key={section.id} className={section.className}>\n\t\t\t\t\t\t\t\t\t<SectionComponent context={selectorContext} />\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t})}\n\t\t\t\t\t</div>\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn <DefaultResourceContent context={selectorContext} strings={strings} />;\n\t}, [\n\t\tResourceContentComponent,\n\t\trenderResourceContent,\n\t\tsections,\n\t\tsectionsClassName,\n\t\tselectorContext,\n\t\tstrings,\n\t]);\n\n\tconst emptyContent: ReactNode = useMemo(() => {\n\t\tif (renderEmptyContent) {\n\t\t\treturn renderEmptyContent(selectorContext);\n\t\t}\n\n\t\tif (EmptyContentComponent) {\n\t\t\tconst ContentComponent = EmptyContentComponent;\n\t\t\treturn <ContentComponent context={selectorContext} />;\n\t\t}\n\n\t\tif (!canUseSelector) {\n\t\t\treturn <Text type=\"secondary\">{strings.noResourceSelected}</Text>;\n\t\t}\n\n\t\treturn <DefaultEmptyContent context={selectorContext} strings={strings} />;\n\t}, [\n\t\tEmptyContentComponent,\n\t\tcanUseSelector,\n\t\trenderEmptyContent,\n\t\tselectorContext,\n\t\tstrings,\n\t]);\n\n\tconst DialogContentComponent = selector?.DialogContentComponent;\n\tconst DialogSummaryComponent = selector?.DialogSummaryComponent;\n\tconst SelectorComponent = selector?.SelectorComponent;\n\tconst selectorProps = selector?.selectorProps;\n\tconst dialogContentProps = selector?.dialogContentProps ?? {};\n\tconst hasResource = selectorContext.hasResource;\n\tconst cardBody = hasResource ? resourceContent : emptyContent;\n\tconst shouldRenderDialog = Boolean(\n\t\tcanUseSelector && selector && SelectorComponent,\n\t);\n\tconst hasCustomViewAction = viewAction !== undefined;\n\tlet viewActionContent: ReactNode = null;\n\n\tif (hasResource && hasCustomViewAction) {\n\t\tviewActionContent = viewAction;\n\t} else if (hasResource && viewLink) {\n\t\tviewActionContent = (\n\t\t\t<CardPrimaryAction href={viewLink.href} icon={Eye}>\n\t\t\t\t{viewLink.label}\n\t\t\t</CardPrimaryAction>\n\t\t);\n\t}\n\n\tconst viewActionNode = viewActionContent === null || viewActionContent === false\n\t\t? null\n\t\t: (\n\t\t\t<div\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'shared-resource-card--view-action',\n\t\t\t\t\t!hasCustomViewAction && viewLink?.className,\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{viewActionContent}\n\t\t\t</div>\n\t\t);\n\tconst dialogNode =\n\t\tshouldRenderDialog && selector && SelectorComponent ? (\n\t\t<ActionDialog\n\t\t\t\topen={selectorContext.isSelectorOpen}\n\t\t\t\tonOpenChange={(open) => {\n\t\t\t\t\tif (!open) {\n\t\t\t\t\t\tselectorContext.closeSelector();\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\t\ttitle={selector.title}\n\t\t\t\tdescription={selector.description}\n\t\t\t\tsize={selector.dialogSize ?? '2xl'}\n\t\t\t\tshowCancel={false}\n\t\t\t\tshowConfirm={false}\n\t\t\t\tfooter={\n\t\t\t\t\t<Stack\n\t\t\t\t\t\tdirection={{ base: 'vertical', sm: 'horizontal' }}\n\t\t\t\t\t\tgap=\"sm\"\n\t\t\t\t\t\talign={{ base: 'stretch', sm: 'center' }}\n\t\t\t\t\t\tjustify=\"end\"\n\t\t\t\t\t\tclassName=\"w-full\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\t\tbuttonStyle=\"outline\"\n\t\t\t\t\t\t\tonClick={selectorContext.closeSelector}\n\t\t\t\t\t\t\tdisabled={selectorContext.isConfirming}\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{selector.cancelText}\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t<Button tone=\"primary\"\n\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\tvoid selectorContext.confirmSelection();\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tdisabled={\n\t\t\t\t\t\t\t\t!selectorContext.canConfirmSelection ||\n\t\t\t\t\t\t\t\tselectorContext.isConfirming\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tloading={selectorContext.isConfirming}\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{selector.confirmText}\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</Stack>\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t<Stack gap=\"lg\" className=\"shared-resource-card--dialog-body\">\n\t\t\t\t\t{DialogContentComponent ? (\n\t\t\t\t\t\t<DialogContentComponent\n\t\t\t\t\t\t\tSelectorComponent={SelectorComponent}\n\t\t\t\t\t\t\tselectorProps={selectorProps}\n\t\t\t\t\t\t\tcontext={selectorContext}\n\t\t\t\t\t\t\t{...dialogContentProps}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<DefaultDialogContent<TResource, TSuggestion, TSelectorProps>\n\t\t\t\t\t\t\tSelectorComponent={SelectorComponent}\n\t\t\t\t\t\t\tselectorProps={selectorProps}\n\t\t\t\t\t\t\tcontext={selectorContext}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\n\t\t\t\t\t{DialogSummaryComponent ? (\n\t\t\t\t\t\t<DialogSummaryComponent context={selectorContext} />\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<DefaultDialogSummary\n\t\t\t\t\t\t\tcontext={selectorContext}\n\t\t\t\t\t\t\tstrings={strings}\n\t\t\t\t\t\t\tgetSelectionLabel={selector.getSelectionLabel}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t</Stack>\n\t\t</ActionDialog>\n\t\t) : null;\n\n\treturn (\n\t\t<>\n\t\t\t<ContentBlock\n\t\t\t\ticon={icon}\n\t\t\t\ttitle={title}\n\t\t\t\tdescription={description}\n\t\t\t\tdata-state={hasResource ? 'selected' : 'empty'}\n\t\t\t\tclassName={cn('shared-resource-card--component', className)}\n\t\t\t\tcontentGap=\"lg\"\n\t\t\t\tcontentClassName={contentClassName}\n\t\t\t\talert={alert}\n\t\t\t\talertTone={alertTone}\n\t\t\t\tactions={resolvedActions}\n\t\t\t\theaderAction={resolvedHeaderAction}\n\t\t\t\tfooterText={footerText}\n\t\t\t>\n\t\t\t\t{cardBody}\n\t\t\t\t{viewActionNode}\n\t\t\t</ContentBlock>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O,GAAD;EACO;EACC;EACM;EACb,cAAYoB,IAAc,aAAa;EACvC,WAAWiF,EAAG,mCAAmCE,CAAS;EAC1D,YAAW;EACO;EACX;EACI;EACX,SAAS1B;EACT,cAAcE;EACF;EAZb,UAAA,CAcEc,IACAO,EACY;CACb,CAAA,GAAAE,EACA,EAAA,CAAA;AAEJ;AAEA,EAAmB,cAAc"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useStrings as e } from "../lib/strings.js";
|
|
3
|
-
import { t } from "../utils-
|
|
4
|
-
import {
|
|
5
|
-
import { t as r } from "../structure-
|
|
6
|
-
import { n as i, t as a } from "../feedback-
|
|
7
|
-
import { u as o } from "../primitives-
|
|
8
|
-
import { t as s } from "../icon-badge-
|
|
9
|
-
import { i as c, n as l, s as u } from "../avatar-
|
|
10
|
-
import { n as d } from "../display-
|
|
11
|
-
import { t as f } from "../metadata-list-
|
|
12
|
-
import { r as p, t as m } from "../overflow-tab-bar-
|
|
13
|
-
import { s as h } from "../data-display-
|
|
3
|
+
import { t } from "../utils-BRhFDwuU.js";
|
|
4
|
+
import { c as n } from "../typography-UTnveOEy.js";
|
|
5
|
+
import { t as r } from "../structure-BmisBK-3.js";
|
|
6
|
+
import { n as i, t as a } from "../feedback-BYIhtitP.js";
|
|
7
|
+
import { u as o } from "../primitives-BFK08r9M.js";
|
|
8
|
+
import { t as s } from "../icon-badge-DYKIwvOV.js";
|
|
9
|
+
import { i as c, n as l, s as u } from "../avatar-DAPlDvhJ.js";
|
|
10
|
+
import { n as d } from "../display-hAc1HjpI.js";
|
|
11
|
+
import { t as f } from "../metadata-list-8N16ZMW_.js";
|
|
12
|
+
import { r as p, t as m } from "../overflow-tab-bar-CWY7Nogn.js";
|
|
13
|
+
import { s as h } from "../data-display-DT_khPl_.js";
|
|
14
14
|
import { jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
15
15
|
//#region src/components/features/resource/resource.strings.ts
|
|
16
16
|
var v = {
|
|
@@ -78,7 +78,7 @@ function b({ children: e, leading: n, trailing: i, sticky: a = !1, className: o
|
|
|
78
78
|
return /* @__PURE__ */ g("div", {
|
|
79
79
|
"data-component": "resource-action-bar",
|
|
80
80
|
"data-slot": "resource-action-bar",
|
|
81
|
-
className: t("resource-action-bar--component rounded-radius border border-border bg-card px-surface py-row-y-lg shadow-xs", a && "sticky top-shell-header z-30", o),
|
|
81
|
+
className: t("resource-action-bar--component box-border rounded-radius border border-border bg-card text-card-foreground px-surface py-row-y-lg shadow-xs", a && "sticky top-shell-header z-30", o),
|
|
82
82
|
children: /* @__PURE__ */ _(r, {
|
|
83
83
|
direction: {
|
|
84
84
|
base: "vertical",
|