themelia-react-ui 2.0.6 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +250 -0
- package/MIGRATION.md +746 -7
- package/README.md +27 -23
- package/dist/{accordion-0tQUZ20r.js → accordion-DNVqwEIC.js} +36 -36
- package/dist/accordion-DNVqwEIC.js.map +1 -0
- package/dist/action-menu-D5343RwT.js +286 -0
- package/dist/action-menu-D5343RwT.js.map +1 -0
- package/dist/ai-artifact-otrz9ZwS.js +1214 -0
- package/dist/ai-artifact-otrz9ZwS.js.map +1 -0
- package/dist/anchored-positioning-1U_eBFNx.js +9 -0
- package/dist/anchored-positioning-1U_eBFNx.js.map +1 -0
- package/dist/app-shell-CPN30Nb1.js +372 -0
- package/dist/app-shell-CPN30Nb1.js.map +1 -0
- package/dist/{attachment-BCpA4e7i.js → attachment-D2-fpfmv.js} +15 -15
- package/dist/{attachment-BCpA4e7i.js.map → attachment-D2-fpfmv.js.map} +1 -1
- package/dist/{auth-B0girIk_.js → auth-g_oUTDDC.js} +234 -241
- package/dist/auth-g_oUTDDC.js.map +1 -0
- package/dist/{avatar-B9Jnp-T-.js → avatar-Ca3Ihrq4.js} +4 -4
- package/dist/{avatar-B9Jnp-T-.js.map → avatar-Ca3Ihrq4.js.map} +1 -1
- package/dist/{badge-wWauMgAt.js → badge-oGiXblW7.js} +8 -9
- package/dist/badge-oGiXblW7.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 +2 -2
- package/dist/base/cards.js +3 -3
- package/dist/base/carousel.js +11 -11
- package/dist/base/carousel.js.map +1 -1
- package/dist/base/cascader.js +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 +1 -1
- 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 +7 -7
- package/dist/base/feedback.js +4 -4
- package/dist/base/forms-numeric.js +2 -2
- package/dist/base/forms.js +2 -2
- package/dist/base/inline-edit.js +13 -13
- package/dist/base/inline-edit.js.map +1 -1
- package/dist/base/item.js +1 -1
- package/dist/base/media-gallery.js +203 -2
- package/dist/base/media-gallery.js.map +1 -0
- package/dist/base/metadata-list.js +1 -1
- package/dist/base/navigation.js +7 -7
- package/dist/base/popover-menu.js +1 -1
- package/dist/base/popover.js +1 -1
- package/dist/base/qr-code.js +32 -22
- package/dist/base/qr-code.js.map +1 -1
- package/dist/base/repeaters.js +91 -88
- package/dist/base/repeaters.js.map +1 -1
- package/dist/base/sidebar.js +2 -2
- package/dist/base/signature-pad.js +14 -14
- package/dist/base/signature-pad.js.map +1 -1
- package/dist/base/skeleton.js +1 -1
- package/dist/base/spinner.js +6 -12
- package/dist/base/spinner.js.map +1 -1
- package/dist/base/structure.js +1 -1
- package/dist/base/table.js +1 -1
- package/dist/base/text-inputs.js +3 -3
- package/dist/base/toaster.js +2 -2
- package/dist/base/tree.js +2 -2
- package/dist/base/upload-queue.js +303 -2
- package/dist/base/upload-queue.js.map +1 -0
- package/dist/base/upload.js +3 -4
- package/dist/base/value-inputs.js +1 -1
- package/dist/{batch-action-bar-BoqWIIpV.js → batch-action-bar-D6MZQNnC.js} +10 -10
- package/dist/{batch-action-bar-BoqWIIpV.js.map → batch-action-bar-D6MZQNnC.js.map} +1 -1
- package/dist/blocks/admin.js +242 -228
- package/dist/blocks/admin.js.map +1 -1
- package/dist/blocks/ai.js +395 -357
- package/dist/blocks/ai.js.map +1 -1
- package/dist/blocks/analytics/charts.js +1022 -0
- package/dist/blocks/analytics/charts.js.map +1 -0
- package/dist/blocks/analytics/usage-card.js +1 -1
- package/dist/blocks/analytics.js +171 -1365
- 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 +1487 -1358
- package/dist/blocks/commerce.js.map +1 -1
- package/dist/blocks/data-display.js +2 -3
- package/dist/blocks/onboarding.js +91 -82
- package/dist/blocks/onboarding.js.map +1 -1
- package/dist/blocks/planning.js +25 -25
- package/dist/blocks/planning.js.map +1 -1
- package/dist/blocks/timelines.js +2 -2
- package/dist/{breadcrumbs-Bp9Ke7kd.js → breadcrumbs-CQ9JSlez.js} +52 -45
- package/dist/breadcrumbs-CQ9JSlez.js.map +1 -0
- package/dist/{button-ChBovTx0.js → button-rd6FiHfQ.js} +12 -8
- package/dist/button-rd6FiHfQ.js.map +1 -0
- package/dist/{buttons-DeW0bQeK.js → buttons-pZVgPTZn.js} +230 -246
- package/dist/buttons-pZVgPTZn.js.map +1 -0
- package/dist/{cards-CNXnmvV5.js → cards-CgWyqvgZ.js} +25 -22
- package/dist/{cards-CNXnmvV5.js.map → cards-CgWyqvgZ.js.map} +1 -1
- package/dist/cascader-Cf05pwaq.js +444 -0
- package/dist/cascader-Cf05pwaq.js.map +1 -0
- package/dist/{chart-I7ROnsl8.js → chart-CygRCyIZ.js} +5 -5
- package/dist/{chart-I7ROnsl8.js.map → chart-CygRCyIZ.js.map} +1 -1
- package/dist/{checkbox-MoyHIAPs.js → checkbox-Dy5_XBMZ.js} +4 -4
- package/dist/{checkbox-MoyHIAPs.js.map → checkbox-Dy5_XBMZ.js.map} +1 -1
- package/dist/{choice-inputs-DHGtx0QV.js → choice-inputs-oJEsrb5Y.js} +113 -114
- package/dist/choice-inputs-oJEsrb5Y.js.map +1 -0
- package/dist/{code-block-BSJyq9e-.js → code-block-BrLD7mCi.js} +44 -60
- package/dist/code-block-BrLD7mCi.js.map +1 -0
- package/dist/collapsible-CRCCg_bO.js +80 -0
- package/dist/collapsible-CRCCg_bO.js.map +1 -0
- package/dist/{collection-content-CSnwtOTH.js → collection-content-D7SoDlYd.js} +3 -3
- package/dist/{collection-content-CSnwtOTH.js.map → collection-content-D7SoDlYd.js.map} +1 -1
- package/dist/combobox-Dl6f6kHz.js +362 -0
- package/dist/combobox-Dl6f6kHz.js.map +1 -0
- package/dist/combobox-DrDXtSSt.js +929 -0
- package/dist/combobox-DrDXtSSt.js.map +1 -0
- package/dist/command-CjZ2VzKC.js +432 -0
- package/dist/command-CjZ2VzKC.js.map +1 -0
- package/dist/comments-C2MZyRmh.js +1214 -0
- package/dist/comments-C2MZyRmh.js.map +1 -0
- package/dist/components/base/accordion/accordion.d.ts +11 -3
- package/dist/components/base/action-menu/action-menu.d.ts +11 -3
- package/dist/components/base/buttons/button.d.ts +2 -2
- package/dist/components/base/buttons/index.d.ts +1 -1
- package/dist/components/base/buttons/loader-button.d.ts +6 -15
- package/dist/components/base/cards/index.d.ts +1 -1
- package/dist/components/base/cards/partials/card-body-context.d.ts +6 -0
- package/dist/components/base/cards/smart-card.d.ts +0 -2
- package/dist/components/base/cards/smart-card.types.d.ts +12 -10
- package/dist/components/base/cascader/cascader.d.ts +8 -2
- package/dist/components/base/cascader/cascader.types.d.ts +24 -2
- package/dist/components/base/cascader/index.d.ts +1 -1
- package/dist/components/base/choice-inputs/switch.d.ts +1 -1
- package/dist/components/base/code-block/use-code-copy.d.ts +2 -6
- package/dist/components/base/command/command.d.ts +1 -1
- package/dist/components/base/date-pickers/datepicker.types.d.ts +1 -3
- package/dist/components/base/display/dialog.d.ts +3 -9
- package/dist/components/base/display/index.d.ts +2 -3
- package/dist/components/base/display/separator.d.ts +1 -1
- package/dist/components/base/feedback/alert.d.ts +2 -1
- package/dist/components/base/feedback/empty.d.ts +10 -2
- package/dist/components/base/forms/workflow.d.ts +2 -2
- package/dist/components/base/forms-numeric/dimensions-input.d.ts +9 -17
- package/dist/components/base/forms-numeric/index.d.ts +3 -3
- package/dist/components/base/item/item.types.d.ts +6 -2
- package/dist/components/base/metadata-list/index.d.ts +1 -3
- package/dist/components/base/metadata-list/metadata-list.d.ts +4 -1
- package/dist/components/base/navigation/index.d.ts +2 -2
- package/dist/components/base/navigation/language-switcher.d.ts +7 -6
- package/dist/components/base/navigation/navigation-tabs.d.ts +8 -1
- package/dist/components/base/navigation/page-header/index.d.ts +1 -1
- package/dist/components/base/navigation/page-header/page-header.d.ts +13 -17
- package/dist/components/base/navigation/pagination.d.ts +5 -5
- package/dist/components/base/popover/popover.recipes.d.ts +0 -1
- package/dist/components/base/qr-code/qr-code.d.ts +4 -0
- package/dist/components/base/repeaters/index.d.ts +1 -1
- package/dist/components/base/repeaters/key-value-editor.d.ts +4 -0
- package/dist/components/base/sheet/sheet.d.ts +6 -15
- package/dist/components/base/sidebar/index.d.ts +1 -6
- package/dist/components/base/sidebar/sidebar.d.ts +38 -10
- package/dist/components/base/skeleton/skeleton.d.ts +1 -1
- package/dist/components/base/structure/structure.types.d.ts +11 -2
- package/dist/components/base/text-inputs/index.d.ts +1 -1
- package/dist/components/base/tree/index.d.ts +1 -0
- package/dist/components/base/tree/tree.d.ts +2 -2
- package/dist/components/base/tree/tree.types.d.ts +7 -1
- package/dist/components/base/upload/file-upload.validation.d.ts +37 -1
- package/dist/components/base/upload/image-upload.d.ts +2 -0
- package/dist/components/base/upload/index.d.ts +3 -9
- package/dist/components/base/value-inputs/date-time-input.d.ts +4 -0
- package/dist/components/base/value-inputs/slider.d.ts +5 -2
- package/dist/components/blocks/admin/action-surfaces/index.d.ts +17 -4
- package/dist/components/blocks/admin/api-key-list/api-key-list.types.d.ts +9 -3
- package/dist/components/blocks/admin/index.d.ts +1 -1
- package/dist/components/blocks/ai/ai-artifact/ai-artifact.d.ts +1 -1
- package/dist/components/blocks/ai/ai-artifact/types.d.ts +9 -4
- package/dist/components/blocks/ai/ai-chain-of-thought/ai-chain-of-thought.d.ts +1 -1
- package/dist/components/blocks/ai/ai-chain-of-thought/types.d.ts +11 -1
- package/dist/components/blocks/ai/ai-citation/ai-citation.d.ts +1 -1
- package/dist/components/blocks/ai/ai-citation/types.d.ts +6 -0
- package/dist/components/blocks/ai/ai-confirmation/ai-confirmation.d.ts +1 -1
- package/dist/components/blocks/ai/ai-confirmation/types.d.ts +21 -5
- package/dist/components/blocks/ai/ai-feedback/types.d.ts +7 -2
- package/dist/components/blocks/ai/ai-inline-citation/types.d.ts +9 -3
- package/dist/components/blocks/ai/ai-package-info/ai-package-info.d.ts +1 -1
- package/dist/components/blocks/ai/ai-package-info/types.d.ts +6 -0
- package/dist/components/blocks/ai/ai-sources/ai-sources.d.ts +1 -1
- package/dist/components/blocks/ai/ai-sources/types.d.ts +8 -2
- package/dist/components/blocks/ai/ai-task/ai-task.d.ts +1 -1
- package/dist/components/blocks/ai/ai-task/types.d.ts +10 -1
- package/dist/components/blocks/ai/ai-tool-call/ai-tool-call.d.ts +1 -1
- package/dist/components/blocks/ai/ai-tool-call/types.d.ts +6 -0
- package/dist/components/blocks/ai/ai.strings.d.ts +2 -0
- package/dist/components/blocks/analytics/activity-heatmap/types.d.ts +1 -1
- package/dist/components/blocks/analytics/analytics.strings.d.ts +2 -0
- package/dist/components/blocks/analytics/atoms/metric-trend-chip.d.ts +11 -1
- package/dist/components/blocks/analytics/chart-card/chart-card.d.ts +7 -5
- package/dist/components/blocks/analytics/charts/index.d.ts +27 -0
- package/dist/components/blocks/analytics/index.d.ts +17 -24
- package/dist/components/blocks/analytics/metric/metric.d.ts +5 -5
- package/dist/components/blocks/analytics/metric-grid/metric-grid.d.ts +2 -2
- package/dist/components/blocks/analytics/types.d.ts +12 -3
- package/dist/components/blocks/analytics/usage-card/usage-card.strings.d.ts +2 -0
- package/dist/components/blocks/commerce/address-card/address-card.d.ts +1 -1
- package/dist/components/blocks/commerce/address-card/types.d.ts +5 -16
- package/dist/components/blocks/commerce/booking-calendar-event-card/booking-calendar-event-card.d.ts +2 -2
- package/dist/components/blocks/commerce/booking-calendar-event-card/booking-calendar-event-card.types.d.ts +6 -4
- package/dist/components/blocks/commerce/cart-summary/cart-summary.d.ts +0 -2
- package/dist/components/blocks/commerce/cart-summary/index.d.ts +2 -2
- package/dist/components/blocks/commerce/cart-summary/types.d.ts +9 -11
- package/dist/components/blocks/commerce/coupon-input/coupon-input.d.ts +1 -1
- package/dist/components/blocks/commerce/coupon-input/types.d.ts +7 -3
- package/dist/components/blocks/commerce/discount-stack/discount-stack.d.ts +0 -2
- package/dist/components/blocks/commerce/discount-stack/index.d.ts +2 -2
- package/dist/components/blocks/commerce/discount-stack/types.d.ts +4 -6
- package/dist/components/blocks/commerce/fulfillment-group/fulfillment-group.d.ts +1 -1
- package/dist/components/blocks/commerce/fulfillment-group/types.d.ts +2 -0
- package/dist/components/blocks/commerce/giftcard-card/partials/giftcard-balance.d.ts +18 -0
- package/dist/components/blocks/commerce/giftcard-card/partials/giftcard-compact.d.ts +1 -1
- package/dist/components/blocks/commerce/giftcard-card/partials/giftcard-copy-button.d.ts +0 -1
- package/dist/components/blocks/commerce/giftcard-card/partials/giftcard-dark.d.ts +1 -1
- package/dist/components/blocks/commerce/giftcard-card/partials/giftcard-full.d.ts +1 -1
- package/dist/components/blocks/commerce/giftcard-card/partials/giftcard-illustrated.d.ts +1 -1
- package/dist/components/blocks/commerce/giftcard-card/partials/giftcard-minimal.d.ts +1 -1
- package/dist/components/blocks/commerce/giftcard-card/types.d.ts +16 -5
- package/dist/components/blocks/commerce/index.d.ts +8 -8
- package/dist/components/blocks/commerce/inventory-level/inventory-level.strings.d.ts +2 -0
- package/dist/components/blocks/commerce/inventory-level/types.d.ts +1 -1
- package/dist/components/blocks/commerce/inventory-section/types.d.ts +0 -5
- package/dist/components/blocks/commerce/invoice-line-items/types.d.ts +6 -3
- package/dist/components/blocks/commerce/loyalty-points/loyalty-points.d.ts +1 -1
- package/dist/components/blocks/commerce/loyalty-points/types.d.ts +11 -5
- package/dist/components/blocks/commerce/order-status/order-status.d.ts +1 -1
- package/dist/components/blocks/commerce/order-status/types.d.ts +8 -8
- package/dist/components/blocks/commerce/order-timeline/order-timeline.d.ts +1 -1
- package/dist/components/blocks/commerce/order-timeline/types.d.ts +3 -1
- package/dist/components/blocks/commerce/payment-method/index.d.ts +2 -2
- package/dist/components/blocks/commerce/payment-method/payment-method.d.ts +0 -8
- package/dist/components/blocks/commerce/payment-method/types.d.ts +0 -2
- package/dist/components/blocks/commerce/receipt/index.d.ts +1 -1
- package/dist/components/blocks/commerce/receipt/receipt-items.d.ts +1 -1
- package/dist/components/blocks/commerce/receipt/types.d.ts +10 -0
- package/dist/components/blocks/commerce/refund-status/index.d.ts +2 -2
- package/dist/components/blocks/commerce/refund-status/refund-status.d.ts +0 -2
- package/dist/components/blocks/commerce/refund-status/types.d.ts +0 -2
- package/dist/components/blocks/commerce/seo-listing/types.d.ts +7 -0
- package/dist/components/blocks/commerce/shared/code-entry.d.ts +39 -0
- package/dist/components/blocks/commerce/shared/order-status.d.ts +1 -1
- package/dist/components/blocks/commerce/subscription-summary/subscription-summary.d.ts +1 -1
- package/dist/components/blocks/commerce/subscription-summary/types.d.ts +10 -1
- package/dist/components/blocks/commerce/upcoming-booking/index.d.ts +2 -1
- package/dist/components/blocks/commerce/upcoming-booking/types.d.ts +8 -0
- package/dist/components/blocks/commerce/upcoming-booking/upcoming-booking.d.ts +2 -2
- package/dist/components/blocks/commerce/vendor-profile/types.d.ts +4 -5
- package/dist/components/blocks/commerce/voucher-entry/types.d.ts +6 -3
- package/dist/components/blocks/commerce/voucher-entry/voucher-entry.d.ts +1 -1
- package/dist/components/blocks/content-block-hooks.d.ts +22 -0
- package/dist/components/blocks/data-display/dense-info-card/dense-info.strings.d.ts +5 -1
- package/dist/components/blocks/data-display/dense-info-card/helpers.d.ts +3 -1
- package/dist/components/blocks/data-display/dense-info-card/index.d.ts +1 -1
- package/dist/components/blocks/data-display/dense-info-card/partials/dense-info-classification.d.ts +1 -1
- package/dist/components/blocks/data-display/dense-info-card/partials/dense-info-dashboard.d.ts +1 -1
- package/dist/components/blocks/data-display/dense-info-card/partials/dense-info-financial.d.ts +1 -1
- package/dist/components/blocks/data-display/dense-info-card/partials/dense-info-project.d.ts +1 -1
- package/dist/components/blocks/data-display/dense-info-card/partials/dense-info-score.d.ts +1 -1
- package/dist/components/blocks/data-display/dense-info-card/types.d.ts +12 -5
- package/dist/components/blocks/data-display/empty-state/empty-state.types.d.ts +6 -0
- package/dist/components/blocks/data-display/index.d.ts +0 -1
- package/dist/components/blocks/data-display/relationship-card-frame.d.ts +1 -1
- package/dist/components/blocks/onboarding/checklist/checklist.types.d.ts +5 -3
- package/dist/components/blocks/planning/task-card.types.d.ts +7 -3
- package/dist/components/blocks/timelines/changelog/types.d.ts +2 -2
- package/dist/components/blocks/timelines/index.d.ts +2 -2
- package/dist/components/blocks/timelines/milestones/types.d.ts +2 -2
- package/dist/components/blocks/timelines/shared/timeline.d.ts +6 -0
- package/dist/components/blocks/timelines/steps-card/index.d.ts +2 -1
- package/dist/components/blocks/timelines/steps-card/steps-card.d.ts +2 -2
- package/dist/components/blocks/timelines/steps-card/types.d.ts +13 -1
- package/dist/components/features/activities/activities.strings.d.ts +5 -3
- package/dist/components/features/activities/activities.types.d.ts +28 -11
- package/dist/components/features/activities/hooks/use-activity-feed.d.ts +6 -0
- package/dist/components/features/activities/index.d.ts +1 -1
- package/dist/components/features/activities/partials/activity-headline.d.ts +5 -0
- package/dist/components/features/activities/partials/activity-row.d.ts +12 -13
- package/dist/components/features/activities/partials/row-layers.d.ts +7 -0
- package/dist/components/features/activities/relative-time.d.ts +18 -0
- package/dist/components/features/ai-chat/ai-chat.d.ts +6 -2
- package/dist/components/features/ai-chat/ai-chat.strings.d.ts +41 -2
- package/dist/components/features/ai-chat/ai-chat.types.d.ts +6 -0
- package/dist/components/features/ai-chat/partials/ai-chat-attachments-strip.d.ts +5 -1
- package/dist/components/features/ai-chat/partials/ai-chat-prompt-input.d.ts +2 -2
- package/dist/components/features/ai-chat/partials/ai-chat-queue.d.ts +3 -1
- package/dist/components/features/ai-chat/partials/ai-chat-suggestions-row.d.ts +6 -1
- package/dist/components/features/appointment-calendar/appointment-calendar.d.ts +1 -1
- package/dist/components/features/appointment-calendar/appointment-calendar.types.d.ts +19 -5
- package/dist/components/features/appointment-calendar/index.d.ts +1 -1
- package/dist/components/features/appointment-calendar/partials/appointment-agenda.d.ts +18 -10
- package/dist/components/features/async-preview/async-preview.d.ts +2 -2
- package/dist/components/features/async-preview/async-preview.types.d.ts +30 -1
- package/dist/components/features/async-preview/preview-trigger-cell.d.ts +7 -2
- package/dist/components/features/combobox/async-resource-combobox.d.ts +2 -2
- package/dist/components/features/combobox/combobox.d.ts +12 -3
- package/dist/components/features/combobox/components/error-message.d.ts +3 -1
- package/dist/components/features/combobox/hooks/use-combobox-core.d.ts +2 -2
- package/dist/components/features/combobox/index.d.ts +1 -1
- package/dist/components/features/combobox/types.d.ts +47 -45
- package/dist/components/features/comments/comments.strings.d.ts +6 -5
- package/dist/components/features/comments/comments.types.d.ts +40 -26
- package/dist/components/features/comments/hooks/use-attachment-upload.d.ts +5 -1
- package/dist/components/features/comments/hooks/use-comments.d.ts +8 -1
- package/dist/components/features/data-view/data-view.strings.d.ts +9 -2
- package/dist/components/features/data-view/data-view.types.d.ts +15 -2
- package/dist/components/features/email-composer/email-html.d.ts +5 -0
- package/dist/components/features/email-composer/http.d.ts +2 -0
- package/dist/components/features/email-composer/strings.d.ts +17 -2
- package/dist/components/features/email-composer/types.d.ts +17 -2
- package/dist/components/features/email-composer/use-composer.d.ts +2 -78
- package/dist/components/features/event-calendar/event-calendar-day-cell.d.ts +1 -1
- package/dist/components/features/event-calendar/event-calendar-event-badge.d.ts +1 -1
- package/dist/components/features/event-calendar/event-calendar-header.d.ts +1 -1
- package/dist/components/features/event-calendar/event-calendar-legend.d.ts +2 -2
- package/dist/components/features/event-calendar/event-calendar.d.ts +1 -1
- package/dist/components/features/event-calendar/event-calendar.types.d.ts +126 -21
- package/dist/components/features/filters/facets/range-facet.d.ts +13 -8
- package/dist/components/features/filters/filter-context.d.ts +9 -0
- package/dist/components/features/filters/filters.strings.d.ts +36 -3
- package/dist/components/features/filters/filters.types.d.ts +72 -5
- package/dist/components/features/filters/hooks/use-filter-draft.d.ts +1 -0
- package/dist/components/features/filters/index.d.ts +2 -2
- package/dist/components/features/filters/operator-options.d.ts +25 -2
- package/dist/components/features/filters/partials/active-filter-item.d.ts +0 -13
- package/dist/components/features/filters/partials/async-options-status.d.ts +32 -0
- package/dist/components/features/filters/partials/filter-draft-footer.d.ts +11 -0
- package/dist/components/features/filters/partials/filter-operator-select.d.ts +4 -2
- package/dist/components/features/filters/partials/filter-pill.d.ts +5 -1
- package/dist/components/features/filters/partials/filter-tabs.d.ts +2 -1
- package/dist/components/features/filters/partials/regular-filter-content.d.ts +1 -1
- package/dist/components/features/filters/utils/filter-utils.d.ts +29 -4
- package/dist/components/features/global-search/global-search-dialog.d.ts +7 -1
- package/dist/components/features/global-search/global-search.d.ts +7 -1
- package/dist/components/features/global-search/global-search.strings.d.ts +19 -3
- package/dist/components/features/global-search/global-search.types.d.ts +30 -6
- package/dist/components/features/global-search/index.d.ts +1 -1
- package/dist/components/features/global-search/partials/global-search-idle-state.d.ts +6 -1
- package/dist/components/features/global-search/partials/global-search-input.d.ts +2 -0
- package/dist/components/features/kanban/index.d.ts +2 -2
- package/dist/components/features/kanban/kanban-context.d.ts +4 -0
- package/dist/components/features/kanban/kanban-keyboard.d.ts +7 -2
- package/dist/components/features/kanban/kanban.d.ts +10 -1
- package/dist/components/features/kanban/kanban.strings.d.ts +11 -2
- package/dist/components/features/kanban/kanban.types.d.ts +26 -0
- package/dist/components/features/map/map.d.ts +4 -0
- package/dist/components/features/map/place-autocomplete.d.ts +10 -1
- package/dist/components/features/media-library/hooks/use-media-library.d.ts +3 -1
- package/dist/components/features/media-library/media-library.d.ts +1 -1
- package/dist/components/features/media-library/media-library.strings.d.ts +33 -3
- package/dist/components/features/media-library/media-library.types.d.ts +47 -2
- package/dist/components/features/media-library/partials/media-library-partials.d.ts +1 -1
- package/dist/components/features/mentions/hooks/use-mentions-search.d.ts +7 -0
- package/dist/components/features/mentions/index.d.ts +1 -1
- package/dist/components/features/mentions/mentions.strings.d.ts +10 -2
- package/dist/components/features/mentions/partials/mention-chip.d.ts +1 -0
- package/dist/components/features/mentions/partials/mention-inline-suggestions.d.ts +8 -1
- package/dist/components/features/mentions/partials/mention-picker.d.ts +8 -1
- package/dist/components/features/mentions/partials/mention-search-error.d.ts +6 -0
- package/dist/components/features/mentions/utils/index.d.ts +0 -1
- package/dist/components/features/overlays/alert-dialog.d.ts +1 -1
- package/dist/components/features/overlays/dialog.d.ts +1 -1
- package/dist/components/features/overlays/drawer.d.ts +1 -1
- package/dist/components/features/overlays/index.d.ts +2 -2
- package/dist/components/features/overlays/overlays.strings.d.ts +2 -1
- package/dist/components/features/overlays/overlays.types.d.ts +27 -10
- package/dist/components/features/products/components/index.d.ts +0 -10
- package/dist/components/features/products/components/product-contract-overview.d.ts +1 -1
- package/dist/components/features/products/components/product-details-card.d.ts +1 -1
- package/dist/components/features/products/components/product-operations-card.d.ts +1 -1
- package/dist/components/features/products/components/product-option-action-menu.d.ts +1 -1
- package/dist/components/features/products/components/product-options-summary.d.ts +1 -1
- package/dist/components/features/products/components/product-policies-card.d.ts +1 -1
- package/dist/components/features/products/components/product-quote-preview-card.d.ts +1 -1
- package/dist/components/features/products/components/product-readiness-card.d.ts +1 -1
- package/dist/components/features/products/components/product-structure-card.d.ts +1 -1
- package/dist/components/features/products/components/product-variant-action-menu.d.ts +1 -1
- package/dist/components/features/products/components/product-variants-manager.d.ts +1 -1
- package/dist/components/features/products/components/product-variants-table.d.ts +1 -1
- package/dist/components/features/products/partials/product-surface.d.ts +15 -0
- package/dist/components/features/products/products.strings.d.ts +8 -0
- package/dist/components/features/products/products.types.d.ts +25 -7
- package/dist/components/features/questionnaire/questionnaire.types.d.ts +6 -4
- package/dist/components/features/resource/index.d.ts +2 -3
- package/dist/components/features/resource/resource.d.ts +2 -10
- package/dist/components/features/resource/resource.types.d.ts +7 -149
- package/dist/components/features/resource-assignment/partials/assignment-surface.d.ts +15 -0
- package/dist/components/features/resource-assignment/resource-assignment.strings.d.ts +6 -1
- package/dist/components/features/resource-assignment/resource-assignment.types.d.ts +6 -0
- package/dist/components/features/rich-text-editor/partials/caret-helpers.d.ts +5 -7
- package/dist/components/features/rich-text-editor/partials/html-helpers.d.ts +2 -3
- package/dist/components/features/rich-text-editor/partials/image-uploads.d.ts +6 -2
- package/dist/components/features/rich-text-editor/partials/index.d.ts +2 -3
- package/dist/components/features/rich-text-editor/partials/rich-text-editor-tiptap.d.ts +0 -1
- package/dist/components/features/rich-text-editor/partials/rich-text-editor-toolbar.d.ts +2 -3
- package/dist/components/features/rich-text-editor/rich-text-editor.types.d.ts +13 -1
- package/dist/components/features/schema-form/hooks/use-schema-form.d.ts +5 -0
- package/dist/components/features/schema-form/schema-form.d.ts +1 -1
- package/dist/components/features/schema-form/schema-form.types.d.ts +13 -5
- package/dist/components/features/suggestions/suggestions.strings.d.ts +14 -0
- package/dist/components/features/suggestions/suggestions.types.d.ts +12 -4
- package/dist/components/features/table/data-table.d.ts +1 -1
- package/dist/components/features/table/filter-bar.d.ts +1 -1
- package/dist/components/features/table/pagination.d.ts +1 -1
- package/dist/components/features/table/partials/cell-value.d.ts +1 -1
- package/dist/components/features/table/table-body.d.ts +1 -1
- package/dist/components/features/table/table-header.d.ts +1 -1
- package/dist/components/features/table/table-helpers.d.ts +31 -9
- package/dist/components/features/table/table-region.recipes.d.ts +11 -0
- package/dist/components/features/table/table-toolbar.d.ts +1 -1
- package/dist/components/features/table/table.strings.d.ts +1 -0
- package/dist/components/features/table/table.types.d.ts +74 -48
- package/dist/components/features/theme-tweaker/theme-provider-settings.d.ts +4 -0
- package/dist/components/features/theme-tweaker/theme-tweaker.strings.d.ts +10 -7
- package/dist/components/features/theme-tweaker/theme-tweaker.utils.d.ts +17 -0
- package/dist/components/layout/app-shell/app-shell.types.d.ts +46 -49
- package/dist/components/layout/app-shell/index.d.ts +2 -2
- package/dist/components/layout/app-shell/shell-regions.d.ts +9 -0
- package/dist/components/layout/app-shell/shell-skip-link.d.ts +9 -0
- package/dist/components/layout/app-shell/sidebar-inset-layout.d.ts +1 -1
- package/dist/components/layout/app-shell/stacked-layout.d.ts +1 -1
- package/dist/components/layout/app-shell/topbar-sidebar-layout.d.ts +1 -1
- package/dist/components/layout/auth/auth-shell.d.ts +1 -1
- package/dist/components/layout/auth/auth.types.d.ts +0 -5
- package/dist/components/layout/containers/inline-gutter-context.d.ts +7 -0
- package/dist/components/layout/containers/main-landmark-context.d.ts +6 -0
- package/dist/components/layout/header/header.types.d.ts +16 -6
- package/dist/components/layout/header/partials/header-global-search-trigger.d.ts +1 -1
- package/dist/components/layout/header/partials/header-notifications.d.ts +1 -1
- package/dist/components/layout/header/partials/header-search.d.ts +1 -1
- package/dist/components/layout/hooks/use-command-shortcut.d.ts +10 -1
- package/dist/components/layout/layout.types.d.ts +2 -2
- package/dist/components/layout/navigation/breadcrumb-progress/breadcrumb-progress.d.ts +1 -1
- package/dist/components/layout/navigation/breadcrumb-progress/types.d.ts +9 -0
- package/dist/components/layout/navigation/section-nav/section-nav.d.ts +8 -1
- package/dist/components/layout/page/index.d.ts +2 -3
- package/dist/components/layout/page/page.strings.d.ts +12 -0
- package/dist/components/layout/page/page.types.d.ts +7 -110
- package/dist/components/layout/page/partials/page-header.d.ts +1 -1
- package/dist/components/layout/settings/index.d.ts +1 -1
- package/dist/components/layout/settings/settings.d.ts +3 -5
- package/dist/components/layout/sidebar/app-sidebar.d.ts +1 -1
- package/dist/components/layout/sidebar/components/sidebar-grouped-navigation.d.ts +1 -1
- package/dist/components/layout/sidebar/components/sidebar-navigation-footer.d.ts +1 -1
- package/dist/components/layout/sidebar/components/sidebar-navigation.d.ts +1 -1
- package/dist/components/layout/sidebar/index.d.ts +1 -1
- package/dist/components/layout/sidebar/sidebar-navigation-rail.d.ts +15 -7
- package/dist/components/layout/sidebar/sidebar.types.d.ts +10 -12
- package/dist/components/layout/sidebar/sidebar.utils.d.ts +4 -0
- package/dist/components/layout/workspace/workspace.strings.d.ts +2 -2
- package/dist/components/layout/workspace/workspace.types.d.ts +13 -7
- package/dist/components/primitives/date.d.ts +22 -3
- package/dist/components/primitives/file-size.d.ts +8 -2
- package/dist/components/primitives/index.d.ts +1 -1
- package/dist/components/primitives/initials.d.ts +3 -1
- package/dist/components/primitives/link.d.ts +8 -1
- package/dist/components/primitives/money.d.ts +1 -1
- package/dist/components/primitives/number.d.ts +2 -1
- package/dist/components/typography/heading.d.ts +9 -3
- package/dist/components/typography/index.d.ts +1 -1
- package/dist/components/typography/text-link.d.ts +10 -3
- package/dist/components/ui/badge.d.ts +2 -4
- package/dist/components/ui/breadcrumb.d.ts +2 -3
- package/dist/components/ui/button.d.ts +8 -2
- package/dist/components/ui/collapsible.d.ts +1 -4
- package/dist/components/ui/command.d.ts +20 -18
- package/dist/components/ui/dialog.d.ts +3 -9
- package/dist/components/ui/empty.d.ts +2 -2
- package/dist/components/ui/input-group.d.ts +3 -3
- package/dist/components/ui/item.d.ts +3 -3
- package/dist/components/ui/popover.d.ts +3 -7
- package/dist/components/ui/sheet.d.ts +4 -12
- package/dist/components/ui/sidebar-state.d.ts +6 -1
- package/dist/components/ui/sidebar.d.ts +7 -4
- package/dist/components/ui/tabs.d.ts +2 -2
- package/dist/components/ui/toggle-group.d.ts +3 -3
- package/dist/components/ui/toggle.d.ts +2 -2
- package/dist/components/ui/tooltip.d.ts +1 -3
- package/dist/{containers-CSdc32h9.js → containers-BdfLTP4w.js} +37 -32
- package/dist/containers-BdfLTP4w.js.map +1 -0
- package/dist/content-block-hooks-Z3iKjqd1.js +17 -0
- package/dist/content-block-hooks-Z3iKjqd1.js.map +1 -0
- package/dist/{copyable-3fdHfMR3.js → copyable-Bmr14W0d.js} +6 -6
- package/dist/{copyable-3fdHfMR3.js.map → copyable-Bmr14W0d.js.map} +1 -1
- package/dist/{data-display-Cmj-xZYl.js → data-display-CWe9SOYh.js} +264 -251
- package/dist/data-display-CWe9SOYh.js.map +1 -0
- package/dist/date-3qsCE1ID.js +209 -0
- package/dist/date-3qsCE1ID.js.map +1 -0
- package/dist/{date-picker-CyQlFYsP.js → date-picker-D1keJQIG.js} +129 -129
- package/dist/date-picker-D1keJQIG.js.map +1 -0
- package/dist/date-pickers-D8aJoeHc.js +185 -0
- package/dist/date-pickers-D8aJoeHc.js.map +1 -0
- package/dist/disclosure-panel-B0HFNZ9x.js.map +1 -1
- package/dist/{display-CT_N2a3w.js → display-VlmP1I0i.js} +23 -46
- package/dist/display-VlmP1I0i.js.map +1 -0
- package/dist/{dropdown-menu-C08iIugv.js → dropdown-menu-B8hjvbkS.js} +9 -9
- package/dist/{dropdown-menu-C08iIugv.js.map → dropdown-menu-B8hjvbkS.js.map} +1 -1
- package/dist/dropzone-CHBNK3de.js +116 -0
- package/dist/dropzone-CHBNK3de.js.map +1 -0
- package/dist/features/activities.js +682 -628
- package/dist/features/activities.js.map +1 -1
- package/dist/features/ai-chat.js +258 -226
- package/dist/features/ai-chat.js.map +1 -1
- package/dist/features/appointment-calendar.js +436 -340
- package/dist/features/appointment-calendar.js.map +1 -1
- package/dist/features/async-preview.js +351 -265
- package/dist/features/async-preview.js.map +1 -1
- package/dist/features/combobox.js +2 -2
- package/dist/features/comments.js +1 -1
- package/dist/features/data-view.js +212 -151
- package/dist/features/data-view.js.map +1 -1
- package/dist/features/email-composer/engine.js +1 -1
- package/dist/features/email-composer.js +344 -315
- package/dist/features/email-composer.js.map +1 -1
- package/dist/features/event-calendar.js +504 -355
- package/dist/features/event-calendar.js.map +1 -1
- package/dist/features/filters.js +2 -2
- package/dist/features/global-search.js +250 -206
- package/dist/features/global-search.js.map +1 -1
- package/dist/features/kanban.js +269 -189
- package/dist/features/kanban.js.map +1 -1
- package/dist/features/map.js +385 -371
- package/dist/features/map.js.map +1 -1
- package/dist/features/media-library.js +1571 -1199
- package/dist/features/media-library.js.map +1 -1
- package/dist/features/mentions.js +2 -2
- package/dist/features/overlays.js +2 -2
- package/dist/features/products.js +1780 -1691
- package/dist/features/products.js.map +1 -1
- package/dist/features/questionnaire.js +165 -152
- package/dist/features/questionnaire.js.map +1 -1
- package/dist/features/resource-assignment.js +223 -191
- package/dist/features/resource-assignment.js.map +1 -1
- package/dist/features/resource.js +55 -220
- package/dist/features/resource.js.map +1 -1
- package/dist/features/rich-text-editor.js +3 -3
- package/dist/features/schema-form.js +280 -228
- package/dist/features/schema-form.js.map +1 -1
- package/dist/features/suggestions.js +48 -39
- package/dist/features/suggestions.js.map +1 -1
- package/dist/features/table.js +2 -2
- package/dist/features/theme-tweaker.js +723 -633
- package/dist/features/theme-tweaker.js.map +1 -1
- package/dist/feedback-DmqmXKLn.js +254 -0
- package/dist/feedback-DmqmXKLn.js.map +1 -0
- package/dist/{field-affordance-recipes-D6H7tVJi.js → field-affordance-recipes-DfbMadot.js} +13 -9
- package/dist/field-affordance-recipes-DfbMadot.js.map +1 -0
- package/dist/{field-state-recipes-7sza8QbC.js → field-state-recipes-EtCxpEy3.js} +6 -2
- package/dist/field-state-recipes-EtCxpEy3.js.map +1 -0
- package/dist/filters-BviMRMLS.js +2692 -0
- package/dist/filters-BviMRMLS.js.map +1 -0
- package/dist/{focus-recipes-B653VaLq.js → focus-recipes-DSkiUvUp.js} +3 -3
- package/dist/focus-recipes-DSkiUvUp.js.map +1 -0
- package/dist/{form-field-CAPdwdnZ.js → form-field-BdfCwSoQ.js} +5 -5
- package/dist/{form-field-CAPdwdnZ.js.map → form-field-BdfCwSoQ.js.map} +1 -1
- package/dist/{form-sizing-CgcrUbLU.js → form-sizing-DE_dZw32.js} +3 -3
- package/dist/{form-sizing-CgcrUbLU.js.map → form-sizing-DE_dZw32.js.map} +1 -1
- package/dist/{forms-B3W8CH7-.js → forms-B8DzJnBN.js} +35 -35
- package/dist/forms-B8DzJnBN.js.map +1 -0
- package/dist/forms-numeric-DOBswjKj.js +992 -0
- package/dist/forms-numeric-DOBswjKj.js.map +1 -0
- package/dist/{header-ZIIsRKxP.js → header-Cq3G0ZRP.js} +100 -95
- package/dist/header-Cq3G0ZRP.js.map +1 -0
- package/dist/{hooks-BitHSh-Y.js → hooks-DHfeSMAO.js} +34 -14
- package/dist/hooks-DHfeSMAO.js.map +1 -0
- package/dist/{http-D_6rOnzU.js → http-Cu-GPpss.js} +61 -35
- package/dist/http-Cu-GPpss.js.map +1 -0
- package/dist/{icon-badge-npxF1SLX.js → icon-badge-B0Kq7wom.js} +3 -3
- package/dist/{icon-badge-npxF1SLX.js.map → icon-badge-B0Kq7wom.js.map} +1 -1
- package/dist/index.js +6 -6
- package/dist/inline-gutter-context-CSqmrMFZ.js +11 -0
- package/dist/inline-gutter-context-CSqmrMFZ.js.map +1 -0
- package/dist/{input-DIREVYHs.js → input-2YrgTUrz.js} +3 -3
- package/dist/{input-DIREVYHs.js.map → input-2YrgTUrz.js.map} +1 -1
- package/dist/{input-7KAc7XQL.js → input-DfJyrjoR.js} +6 -6
- package/dist/{input-7KAc7XQL.js.map → input-DfJyrjoR.js.map} +1 -1
- package/dist/{interaction-recipes-4wZ2tvfb.js → interaction-recipes-DmuS1ase.js} +2 -2
- package/dist/{interaction-recipes-4wZ2tvfb.js.map → interaction-recipes-DmuS1ase.js.map} +1 -1
- package/dist/item-GJ9mvCcg.js +279 -0
- package/dist/item-GJ9mvCcg.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 +2 -2
- package/dist/layout/settings.js +2 -2
- package/dist/layout/sidebar.js +3 -3
- package/dist/layout/workspace.js +1 -1
- package/dist/layout.js +12 -12
- package/dist/{layout.types-E_GAApzO.js → layout.types-DbtnyAtd.js} +11 -8
- package/dist/layout.types-DbtnyAtd.js.map +1 -0
- package/dist/lib/anchored-positioning.d.ts +11 -0
- package/dist/lib/field-affordance-recipes.d.ts +10 -0
- package/dist/lib/field-state-recipes.d.ts +6 -0
- package/dist/lib/focus-recipes.d.ts +7 -0
- package/dist/lib/format.d.ts +25 -0
- package/dist/lib/money-format.d.ts +6 -0
- package/dist/lib/motion-recipes.d.ts +6 -0
- package/dist/lib/surface-recipes.d.ts +32 -2
- package/dist/lib/theme-scope.d.ts +17 -1
- package/dist/lib/token-merge.generated.d.ts +13 -19
- package/dist/lib/ui-provider/index.d.ts +1 -1
- package/dist/lib/ui-provider/types.d.ts +5 -0
- package/dist/lib/use-controllable-state.d.ts +16 -0
- package/dist/lib/use-copy-feedback.d.ts +15 -0
- package/dist/lib/utils.js +1 -1
- package/dist/lib/variant-props.d.ts +9 -0
- package/dist/main-landmark-context-BAsyqp2I.js +11 -0
- package/dist/main-landmark-context-BAsyqp2I.js.map +1 -0
- package/dist/mentions-zz0ewNIq.js +670 -0
- package/dist/mentions-zz0ewNIq.js.map +1 -0
- package/dist/{message-BJHnn43M.js → message-BiiVrRrm.js} +10 -7
- package/dist/{message-BJHnn43M.js.map → message-BiiVrRrm.js.map} +1 -1
- package/dist/{metadata-list-XkqZ_UXH.js → metadata-list-G85roWjS.js} +13 -12
- package/dist/metadata-list-G85roWjS.js.map +1 -0
- package/dist/{motion-recipes-DitYv6P2.js → motion-recipes-CUc_aHuG.js} +7 -4
- package/dist/motion-recipes-CUc_aHuG.js.map +1 -0
- package/dist/navigation-C0Be5C3i.js +304 -0
- package/dist/navigation-C0Be5C3i.js.map +1 -0
- package/dist/{navigation-Bt-v7rWP.js → navigation-CmqaQR_G.js} +99 -103
- package/dist/navigation-CmqaQR_G.js.map +1 -0
- package/dist/number-NFWKIoiK.js +340 -0
- package/dist/number-NFWKIoiK.js.map +1 -0
- package/dist/{overflow-tab-bar-BQCA2Zn2.js → overflow-tab-bar-DV7HE_3t.js} +8 -8
- package/dist/{overflow-tab-bar-BQCA2Zn2.js.map → overflow-tab-bar-DV7HE_3t.js.map} +1 -1
- package/dist/overlays-D-gAIfPF.js +1018 -0
- package/dist/overlays-D-gAIfPF.js.map +1 -0
- package/dist/page-D4pQhgSq.js +216 -0
- package/dist/page-D4pQhgSq.js.map +1 -0
- package/dist/{page-header-commands-DIKspJfx.js → page-header-commands-elelNOfd.js} +29 -29
- package/dist/{page-header-commands-DIKspJfx.js.map → page-header-commands-elelNOfd.js.map} +1 -1
- package/dist/{pagination-Br8TdV9A.js → pagination-BuSWw1US.js} +22 -23
- package/dist/pagination-BuSWw1US.js.map +1 -0
- package/dist/{popover-k8TdUcAt.js → popover-BpMxbqEK.js} +73 -69
- package/dist/popover-BpMxbqEK.js.map +1 -0
- package/dist/{popover-menu-yn-o0kyA.js → popover-menu-CO-_iiuz.js} +7 -7
- package/dist/{popover-menu-yn-o0kyA.js.map → popover-menu-CO-_iiuz.js.map} +1 -1
- package/dist/{popover.recipes-DJ0AkUan.js → popover.recipes-BqkdvlZn.js} +3 -4
- package/dist/{popover.recipes-DJ0AkUan.js.map → popover.recipes-BqkdvlZn.js.map} +1 -1
- package/dist/{portal-recipes-DyUXqUtD.js → portal-recipes-BPeS4rGB.js} +2 -2
- package/dist/{portal-recipes-DyUXqUtD.js.map → portal-recipes-BPeS4rGB.js.map} +1 -1
- package/dist/primitives-BlC1lXBr.js +447 -0
- package/dist/primitives-BlC1lXBr.js.map +1 -0
- package/dist/primitives.js +4 -4
- package/dist/{progress-DZFXXzPs.js → progress-RARK8AjB.js} +5 -5
- package/dist/{progress-DZFXXzPs.js.map → progress-RARK8AjB.js.map} +1 -1
- package/dist/receipt-CUf2Vegp.js +114 -0
- package/dist/receipt-CUf2Vegp.js.map +1 -0
- package/dist/{rich-text-BnTzZjIo.js → rich-text-Cypm9__d.js} +7 -8
- package/dist/{rich-text-BnTzZjIo.js.map → rich-text-Cypm9__d.js.map} +1 -1
- package/dist/rich-text-editor-Z6cQepsA.js +919 -0
- package/dist/rich-text-editor-Z6cQepsA.js.map +1 -0
- package/dist/rich-text-editor-toolbar-DYbRJARB.js +100 -0
- package/dist/rich-text-editor-toolbar-DYbRJARB.js.map +1 -0
- package/dist/rich-text-tree-DdKHIJx4.js +154 -0
- package/dist/rich-text-tree-DdKHIJx4.js.map +1 -0
- package/dist/safe-image-src-C6kQSMBZ.js +17 -0
- package/dist/safe-image-src-C6kQSMBZ.js.map +1 -0
- package/dist/{scroll-area-Bj6CRUif.js → scroll-area-B9HKbji0.js} +3 -3
- package/dist/{scroll-area-Bj6CRUif.js.map → scroll-area-B9HKbji0.js.map} +1 -1
- package/dist/{separator-DM6gs2vu.js → separator-DaDe26sf.js} +3 -3
- package/dist/separator-DaDe26sf.js.map +1 -0
- package/dist/{separator-B9ewiCGO.js → separator-KGsNXt2J.js} +2 -2
- package/dist/{separator-B9ewiCGO.js.map → separator-KGsNXt2J.js.map} +1 -1
- package/dist/services/actions/action-adapters.d.ts +5 -2
- package/dist/services/actions/index.d.ts +1 -1
- package/dist/services/actions.js +2 -2
- package/dist/services/actions.js.map +1 -1
- package/dist/settings-D5j_RJvT.js +160 -0
- package/dist/settings-D5j_RJvT.js.map +1 -0
- package/dist/sheet-B6j_BE9O.js +241 -0
- package/dist/sheet-B6j_BE9O.js.map +1 -0
- package/dist/{sidebar-CmD6a-HK.js → sidebar-C-iQ_TJP.js} +377 -351
- package/dist/sidebar-C-iQ_TJP.js.map +1 -0
- package/dist/sidebar-D5VO2W8S.js +715 -0
- package/dist/sidebar-D5VO2W8S.js.map +1 -0
- package/dist/{skeleton-DDgdhmu9.js → skeleton-Cab_KgVo.js} +12 -12
- package/dist/skeleton-Cab_KgVo.js.map +1 -0
- package/dist/{smart-card-B6vLxqa_.js → smart-card-C59z6KFO.js} +217 -210
- package/dist/smart-card-C59z6KFO.js.map +1 -0
- package/dist/{structure-DZJ2wbAU.js → structure-DElaQwwN.js} +2 -2
- package/dist/{structure-DZJ2wbAU.js.map → structure-DElaQwwN.js.map} +1 -1
- package/dist/style.css +1 -1
- package/dist/{surface-recipes-C8mNycaY.js → surface-recipes-DV6rrOFq.js} +10 -2
- package/dist/surface-recipes-DV6rrOFq.js.map +1 -0
- package/dist/{table-CXSPHH25.js → table-CSRUgpdK.js} +62 -61
- package/dist/table-CSRUgpdK.js.map +1 -0
- package/dist/table-DdXDBsR_.js +1657 -0
- package/dist/table-DdXDBsR_.js.map +1 -0
- package/dist/{tabs-C4Kr_hCr.js → tabs-WnHfV2pM.js} +27 -27
- package/dist/tabs-WnHfV2pM.js.map +1 -0
- package/dist/{text-inputs-jdkS3ReG.js → text-inputs-ljyBYaCd.js} +112 -112
- package/dist/text-inputs-ljyBYaCd.js.map +1 -0
- package/dist/theme.css +21 -5
- package/dist/timelines-mOmS9Eh3.js +479 -0
- package/dist/timelines-mOmS9Eh3.js.map +1 -0
- package/dist/tooltip-yjX-Uv-p.js +112 -0
- package/dist/tooltip-yjX-Uv-p.js.map +1 -0
- package/dist/{tree-CeYVzdFE.js → tree-YpkxUG2Z.js} +80 -72
- package/dist/tree-YpkxUG2Z.js.map +1 -0
- package/dist/typography/rich-text.js +1 -1
- package/dist/{typography-C7-YMW1S.js → typography-C0dELqYV.js} +46 -40
- package/dist/typography-C0dELqYV.js.map +1 -0
- package/dist/typography.js +1 -1
- package/dist/{ui-provider-C-74NVLc.js → ui-provider-Bu1S-o96.js} +4 -3
- package/dist/ui-provider-Bu1S-o96.js.map +1 -0
- package/dist/ui-provider.js +2 -2
- package/dist/{upload-Hdm5gObf.js → upload-DMuMYJFT.js} +276 -268
- package/dist/upload-DMuMYJFT.js.map +1 -0
- package/dist/{usage-card-9s8hLDfn.js → usage-card-DDPki5P1.js} +57 -54
- package/dist/usage-card-DDPki5P1.js.map +1 -0
- package/dist/use-controllable-state-BlP8SyBI.js +13 -0
- package/dist/use-controllable-state-BlP8SyBI.js.map +1 -0
- package/dist/use-copy-feedback-CzcaqlLf.js +28 -0
- package/dist/use-copy-feedback-CzcaqlLf.js.map +1 -0
- package/dist/use-metric-format-options-Dk4rC1NO.js +251 -0
- package/dist/use-metric-format-options-Dk4rC1NO.js.map +1 -0
- package/dist/{utils-DhuoqFy4.js → utils-BVbAG2J6.js} +98 -76
- package/dist/utils-BVbAG2J6.js.map +1 -0
- package/dist/value-inputs-h5MwjGCo.js +982 -0
- package/dist/value-inputs-h5MwjGCo.js.map +1 -0
- package/dist/value-typography-D15uwfj-.js +154 -0
- package/dist/value-typography-D15uwfj-.js.map +1 -0
- package/dist/workspace-DIryPqBt.js +400 -0
- package/dist/workspace-DIryPqBt.js.map +1 -0
- package/docs/consumer-skill/SKILL.md +7 -0
- package/docs/consumer-skill/agents/themelia-ui-designer.md +11 -2
- package/docs/consumer-skill/examples/analytics.tsx +1 -1
- package/docs/consumer-skill/examples/app-layout.tsx +3 -3
- package/docs/consumer-skill/examples/commerce-lines.tsx +7 -5
- package/docs/consumer-skill/examples/detail.tsx +3 -2
- package/docs/consumer-skill/examples/email-composer.tsx +1 -1
- package/docs/consumer-skill/examples/index-table.tsx +2 -2
- package/docs/consumer-skill/examples/scoped-directory.tsx +7 -6
- package/docs/consumer-skill/references/agents-md.md +20 -16
- package/docs/consumer-skill/references/analytics.md +20 -6
- package/docs/consumer-skill/references/building-views.md +213 -0
- package/docs/consumer-skill/references/catalogue.md +617 -0
- package/docs/consumer-skill/references/component-contracts.json +10202 -18084
- package/docs/consumer-skill/references/composition.md +21 -17
- package/docs/consumer-skill/references/discovery.md +8 -5
- package/docs/consumer-skill/references/installation.md +10 -4
- package/docs/consumer-skill/references/integration.md +5 -5
- package/docs/consumer-skill/references/product-composition.md +2 -2
- package/docs/consumer-skill/references/public-api.json +580 -633
- package/docs/consumer-skill/references/review.md +6 -4
- package/docs/consumer-skill/references/screen-archetypes.md +2 -2
- package/docs/consumer-skill/references/theming.md +1 -1
- package/docs/consumer-skill/references/tokens.json +4 -4
- package/docs/consumer-skill/references/workflows.md +7 -7
- package/docs/consumer-skill/scripts/composition-policy.mjs +40 -20
- package/docs/consumer-skill/scripts/composition.mjs +4 -1
- package/docs/consumer-skill/scripts/discovery.mjs +3 -1
- package/docs/consumer-skill/scripts/setup-skills.mjs +31 -4
- package/docs/consumer-skills/themelia-components/SKILL.md +8 -4
- package/docs/consumer-skills/themelia-composition/SKILL.md +7 -3
- package/docs/consumer-skills/themelia-design/SKILL.md +7 -1
- package/docs/consumer-skills/themelia-tokenization/SKILL.md +1 -1
- package/package.json +9 -12
- package/templates/README.md +3 -2
- package/templates/admin-shell-template.tsx +49 -9
- package/templates/analytics-operations-template.tsx +20 -24
- package/templates/customers-template.tsx +12 -9
- package/templates/index.ts +2 -8
- package/templates/orders-template.tsx +28 -24
- package/templates/products-template.tsx +14 -4
- package/templates/user-permissions-template.tsx +11 -14
- package/dist/accordion-0tQUZ20r.js.map +0 -1
- package/dist/action-menu-C0gjzLyE.js +0 -284
- package/dist/action-menu-C0gjzLyE.js.map +0 -1
- package/dist/ai-artifact-CGGpQryR.js +0 -1200
- package/dist/ai-artifact-CGGpQryR.js.map +0 -1
- package/dist/anchored-positioning-DPnKTvNs.js +0 -6
- package/dist/anchored-positioning-DPnKTvNs.js.map +0 -1
- package/dist/app-shell-EHuuRDGy.js +0 -321
- package/dist/app-shell-EHuuRDGy.js.map +0 -1
- package/dist/auth-B0girIk_.js.map +0 -1
- package/dist/badge-wWauMgAt.js.map +0 -1
- package/dist/base/sheet.js +0 -3
- package/dist/breadcrumbs-Bp9Ke7kd.js.map +0 -1
- package/dist/button-ChBovTx0.js.map +0 -1
- package/dist/buttons-DeW0bQeK.js.map +0 -1
- package/dist/cascader-CrAl9zD5.js +0 -439
- package/dist/cascader-CrAl9zD5.js.map +0 -1
- package/dist/choice-inputs-DHGtx0QV.js.map +0 -1
- package/dist/code-block-BSJyq9e-.js.map +0 -1
- package/dist/collapsible-BzJ91LUG.js +0 -81
- package/dist/collapsible-BzJ91LUG.js.map +0 -1
- package/dist/combobox-Bcvu5J8O.js +0 -363
- package/dist/combobox-Bcvu5J8O.js.map +0 -1
- package/dist/combobox-C2JiSQPc.js +0 -915
- package/dist/combobox-C2JiSQPc.js.map +0 -1
- package/dist/command-9e52NPgK.js +0 -425
- package/dist/command-9e52NPgK.js.map +0 -1
- package/dist/comments-BsgErEqd.js +0 -1174
- package/dist/comments-BsgErEqd.js.map +0 -1
- package/dist/components/base/buttons/tooltip-button.d.ts +0 -7
- package/dist/components/base/display/content-block.d.ts +0 -75
- package/dist/components/base/display/content-block.strings.d.ts +0 -5
- package/dist/components/base/sheet/index.d.ts +0 -29
- package/dist/components/blocks/ai/use-copy-feedback.d.ts +0 -6
- package/dist/components/blocks/data-display/metadata/index.d.ts +0 -30
- package/dist/components/features/mentions/utils/split-html-by-mentions.d.ts +0 -10
- package/dist/components/features/resource/resource.strings.d.ts +0 -12
- package/dist/components/features/rich-text-editor/partials/rich-text-editor-fallback.d.ts +0 -8
- package/dist/components/features/sync/index.d.ts +0 -26
- package/dist/components/features/sync/sync-range-dialog-form.d.ts +0 -5
- package/dist/components/features/sync/sync.strings.d.ts +0 -18
- package/dist/components/features/sync/sync.types.d.ts +0 -44
- package/dist/components/layout/page/partials/page-actions.d.ts +0 -3
- package/dist/components/ui/slot.d.ts +0 -6
- package/dist/containers-CSdc32h9.js.map +0 -1
- package/dist/data-display-Cmj-xZYl.js.map +0 -1
- package/dist/date-Br0FicVv.js +0 -144
- package/dist/date-Br0FicVv.js.map +0 -1
- package/dist/date-picker-CyQlFYsP.js.map +0 -1
- package/dist/date-pickers-tj2MXmXd.js +0 -185
- package/dist/date-pickers-tj2MXmXd.js.map +0 -1
- package/dist/display-CT_N2a3w.js.map +0 -1
- package/dist/features/sync.js +0 -142
- package/dist/features/sync.js.map +0 -1
- package/dist/feedback-Dzo1xtAU.js +0 -246
- package/dist/feedback-Dzo1xtAU.js.map +0 -1
- package/dist/field-affordance-recipes-D6H7tVJi.js.map +0 -1
- package/dist/field-state-recipes-7sza8QbC.js.map +0 -1
- package/dist/filters-Dl80yYtN.js +0 -2415
- package/dist/filters-Dl80yYtN.js.map +0 -1
- package/dist/focus-recipes-B653VaLq.js.map +0 -1
- package/dist/forms-B3W8CH7-.js.map +0 -1
- package/dist/forms-numeric-CwjQJe-O.js +0 -991
- package/dist/forms-numeric-CwjQJe-O.js.map +0 -1
- package/dist/header-ZIIsRKxP.js.map +0 -1
- package/dist/hooks-BitHSh-Y.js.map +0 -1
- package/dist/http-D_6rOnzU.js.map +0 -1
- package/dist/item-FfWnaYST.js +0 -278
- package/dist/item-FfWnaYST.js.map +0 -1
- package/dist/layout.types-E_GAApzO.js.map +0 -1
- package/dist/media-gallery-C81DAnKI.js +0 -203
- package/dist/media-gallery-C81DAnKI.js.map +0 -1
- package/dist/mentions-qOnedSt4.js +0 -639
- package/dist/mentions-qOnedSt4.js.map +0 -1
- package/dist/metadata-list-XkqZ_UXH.js.map +0 -1
- package/dist/motion-recipes-DitYv6P2.js.map +0 -1
- package/dist/navigation-BgtPJAhi.js +0 -288
- package/dist/navigation-BgtPJAhi.js.map +0 -1
- package/dist/navigation-Bt-v7rWP.js.map +0 -1
- package/dist/number-CYqBcrSj.js +0 -346
- package/dist/number-CYqBcrSj.js.map +0 -1
- package/dist/overlays-CC8zI3Du.js +0 -1017
- package/dist/overlays-CC8zI3Du.js.map +0 -1
- package/dist/page-BoQ1VaFJ.js +0 -331
- package/dist/page-BoQ1VaFJ.js.map +0 -1
- package/dist/pagination-Br8TdV9A.js.map +0 -1
- package/dist/popover-k8TdUcAt.js.map +0 -1
- package/dist/primitives-BkkQjYl7.js +0 -385
- package/dist/primitives-BkkQjYl7.js.map +0 -1
- package/dist/receipt-C7LhOg7Q.js +0 -116
- package/dist/receipt-C7LhOg7Q.js.map +0 -1
- package/dist/rich-text-editor-CAurDwT5.js +0 -1273
- package/dist/rich-text-editor-CAurDwT5.js.map +0 -1
- package/dist/rich-text-editor-toolbar-DbXig7Jk.js +0 -99
- package/dist/rich-text-editor-toolbar-DbXig7Jk.js.map +0 -1
- package/dist/rich-text-tree-BqyQ_7-R.js +0 -66
- package/dist/rich-text-tree-BqyQ_7-R.js.map +0 -1
- package/dist/sanitize-html-BWkH4dLM.js +0 -105
- package/dist/sanitize-html-BWkH4dLM.js.map +0 -1
- package/dist/separator-DM6gs2vu.js.map +0 -1
- package/dist/settings-DZPHgpx4.js +0 -155
- package/dist/settings-DZPHgpx4.js.map +0 -1
- package/dist/sheet-C4DHsgLk.js +0 -250
- package/dist/sheet-C4DHsgLk.js.map +0 -1
- package/dist/sidebar-C8BnDwTH.js +0 -709
- package/dist/sidebar-C8BnDwTH.js.map +0 -1
- package/dist/sidebar-CmD6a-HK.js.map +0 -1
- package/dist/skeleton-DDgdhmu9.js.map +0 -1
- package/dist/slot-CLF9kLrS.js +0 -16
- package/dist/slot-CLF9kLrS.js.map +0 -1
- package/dist/smart-card-B6vLxqa_.js.map +0 -1
- package/dist/surface-recipes-C8mNycaY.js.map +0 -1
- package/dist/table-CBonSdTp.js +0 -1584
- package/dist/table-CBonSdTp.js.map +0 -1
- package/dist/table-CXSPHH25.js.map +0 -1
- package/dist/tabs-C4Kr_hCr.js.map +0 -1
- package/dist/text-inputs-jdkS3ReG.js.map +0 -1
- package/dist/timelines-CoPwdJP0.js +0 -458
- package/dist/timelines-CoPwdJP0.js.map +0 -1
- package/dist/tooltip-31NwIpTo.js +0 -113
- package/dist/tooltip-31NwIpTo.js.map +0 -1
- package/dist/tree-CeYVzdFE.js.map +0 -1
- package/dist/typography-C7-YMW1S.js.map +0 -1
- package/dist/ui-provider-C-74NVLc.js.map +0 -1
- package/dist/upload-Hdm5gObf.js.map +0 -1
- package/dist/upload-queue-D0sYPuqo.js +0 -409
- package/dist/upload-queue-D0sYPuqo.js.map +0 -1
- package/dist/usage-card-9s8hLDfn.js.map +0 -1
- package/dist/utils-DhuoqFy4.js.map +0 -1
- package/dist/value-inputs-D3aPgq9H.js +0 -980
- package/dist/value-inputs-D3aPgq9H.js.map +0 -1
- package/dist/value-typography-uSzzG9Gf.js +0 -122
- package/dist/value-typography-uSzzG9Gf.js.map +0 -1
- package/dist/workspace-CC8Vchiu.js +0 -411
- package/dist/workspace-CC8Vchiu.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-form.js","names":["Text","copyRoleProps","Stack","Card","compositionRhythm","Input","FormField","Textarea","ToggleField","CardCheckboxGroup","Select","SwitchCard","CardRadioGroup","ContentBlock","TagsInput","DecimalInput","EmptyState","SCHEMA_FORM_COLUMNS","SCHEMA_FORM_FIELD_WIDTH","isFieldHidden","field","values","error","onError","isFieldDisabled","getVisibleFields","fields","resolveSchemaSections","visibleFields","schema","fieldsByKey","usedKeys","sections","section","sectionFields","key","defaultColumns","unsectioned","defaultSectionTitle","toStringValue","value","toStringArray","item","toBooleanValue","parseNumberValue","trimmed","rawValue","parsed","integer","formatJsonValue","quoteString","indent","parseJsonValue","getDefaultValues","defaultValue","shouldRequireValue","normalizeErrors","next","message","errors","useSchemaForm","externalErrors","options","isControlled","initialValues","useMemo","internalValues","setInternalValues","useState","validationErrors","setValidationErrors","invalidParsedFields","useRef","committedValues","currentValues","currentOptions","useLayoutEffect","mergedErrors","writeValues","useCallback","nextValues","setValues","setFieldValue","fieldValue","current","setFieldParseValidity","valid","reset","onValueChange","validate","nextErrors","hasParseError","formatRequiredError","validators","validator","result","validationError","min","max","SchemaFormActions","cn","className","showReset","Button","disabled","resetDisabled","submitting","onReset","resetLabel","submitDisabled","submitLabel","SchemaFormEmpty","getFieldHint","getTextDisplayValue","parseTextValue","parseNumberFieldValue","NumberFieldControl","inputProps","editing","draft","setDraft","acceptedDraft","onParseError","onFocus","event","onBlur","text","onParsedChange","parseJsonFieldValue","optionIconNode","option","Icon","JsonFieldControl","quoteParsedString","setText","parseError","setParseError","isFocused","setIsFocused","lastParse","useEffect","acceptedParse","onParseValidityChange","commit","strings","fieldId","SchemaFormFieldRenderer","fieldType","commonFieldProps","controlClassName","describedBy","checked","displayValue","decimalPlaces","inputType","nativeInputProps","defaultSchemaFormStrings","label","toDomId","SectionHeading","SchemaForm","stringsProp","generatedId","useId","formId","id","useStrings","form","columns","hasFields","helpers","shouldShowActions","showActions","onSubmit","actionsSlot","resolvedSubmitLabel","resolvedResetLabel","renderFieldNode","fieldDisabled","context","nextValue","defaultField","fieldClassName","renderField","renderSectionFields","renderPlainSection","custom","renderSection","sectionClassName","Fragment","renderCardSection","actions","empty","emptySlot","submittedValues","layout","contentClassName","title","description","headerSlot","footerSlot"],"sources":["../../src/components/features/schema-form/schema-form.utils.ts","../../src/components/features/schema-form/hooks/use-schema-form.ts","../../src/components/features/schema-form/partials/schema-form-actions.tsx","../../src/components/features/schema-form/partials/schema-form-empty.tsx","../../src/components/features/schema-form/partials/schema-form-field.tsx","../../src/components/features/schema-form/schema-form.strings.ts","../../src/components/features/schema-form/schema-form.tsx"],"sourcesContent":["import type {\n\tResolvedSchemaFormSection,\n\tSchemaFormField,\n\tSchemaFormFieldWidth,\n\tSchemaFormSchema,\n\tSchemaFormValue,\n\tSchemaFormValues,\n} from './schema-form.types';\n\ntype SchemaFormErrorHandler = (error: unknown) => void;\n\n/*\n * Container widths, not viewport widths — a schema form is as often rendered in\n * a drawer or a side panel as at page width, and keyed to the screen it kept\n * three field columns inside a 320px drawer. 448/576 clears every width these\n * forms render at today (672-814px) while collapsing below a real drawer.\n */\nexport const SCHEMA_FORM_COLUMNS: Record<1 | 2 | 3, string> = {\n\t1: 'grid grid-cols-1 gap-space-xl',\n\t2: 'grid grid-cols-1 gap-space-xl @md/schema-form:grid-cols-2',\n\t3: 'grid grid-cols-1 gap-space-xl @md/schema-form:grid-cols-2 @xl/schema-form:grid-cols-3',\n};\n\nexport const SCHEMA_FORM_FIELD_WIDTH: Record<SchemaFormFieldWidth, string> = {\n\tauto: '',\n\thalf: '@md/schema-form:col-span-1',\n\tthird: '@xl/schema-form:col-span-1',\n\tfull: '@md/schema-form:col-span-full @xl/schema-form:col-span-full',\n};\n\nexport function isFieldHidden(\n\tfield: SchemaFormField,\n\tvalues: SchemaFormValues,\n\tonError?: SchemaFormErrorHandler,\n): boolean {\n\tif (typeof field.hidden === 'function') {\n\t\ttry {\n\t\t\treturn field.hidden(values);\n\t\t} catch (error) {\n\t\t\tonError?.(error);\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn field.hidden ?? false;\n}\n\nexport function isFieldDisabled(\n\tfield: SchemaFormField,\n\tvalues: SchemaFormValues,\n\tonError?: SchemaFormErrorHandler,\n): boolean {\n\tif (typeof field.disabled === 'function') {\n\t\ttry {\n\t\t\treturn field.disabled(values);\n\t\t} catch (error) {\n\t\t\tonError?.(error);\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn field.disabled ?? false;\n}\n\nexport function getVisibleFields(\n\tfields: SchemaFormField[],\n\tvalues: SchemaFormValues,\n\tonError?: SchemaFormErrorHandler,\n): SchemaFormField[] {\n\treturn fields.filter((field) => !isFieldHidden(field, values, onError));\n}\n\nexport function resolveSchemaSections(\n\tschema: SchemaFormSchema,\n\tvalues: SchemaFormValues,\n\tdefaultSectionTitle: string,\n\tdefaultColumns: 1 | 2 | 3,\n\tonError?: SchemaFormErrorHandler,\n): ResolvedSchemaFormSection[] {\n\tconst visibleFields = getVisibleFields(schema.fields, values, onError);\n\tconst fieldsByKey = new Map(visibleFields.map((field) => [field.key, field]));\n\tconst usedKeys = new Set<string>();\n\tconst sections: ResolvedSchemaFormSection[] = [];\n\n\tfor (const section of schema.sections ?? []) {\n\t\tconst sectionFields = section.fields\n\t\t\t? section.fields\n\t\t\t\t\t.map((key) => fieldsByKey.get(key))\n\t\t\t\t\t.filter((field): field is SchemaFormField => field !== undefined)\n\t\t\t: visibleFields.filter((field) => field.sectionId === section.id);\n\n\t\tfor (const field of sectionFields) {\n\t\t\tusedKeys.add(field.key);\n\t\t}\n\n\t\tsections.push({\n\t\t\tid: section.id,\n\t\t\ttitle: section.title,\n\t\t\tdescription: section.description,\n\t\t\ticon: section.icon,\n\t\t\tfields: sectionFields,\n\t\t\tcolumns: section.columns ?? defaultColumns,\n\t\t\tfooterSlot: section.footerSlot,\n\t\t\tclassName: section.className,\n\t\t});\n\t}\n\n\tconst unsectioned = visibleFields.filter((field) => !usedKeys.has(field.key));\n\tif (unsectioned.length > 0 || sections.length === 0) {\n\t\tsections.unshift({\n\t\t\tid: 'default',\n\t\t\ttitle: schema.sections?.length ? defaultSectionTitle : undefined,\n\t\t\tfields: unsectioned,\n\t\t\tcolumns: defaultColumns,\n\t\t});\n\t}\n\n\treturn sections.filter((section) => section.fields.length > 0);\n}\n\nexport function toStringValue(value: SchemaFormValue): string {\n\tif (value === undefined || value === null) return '';\n\tif (typeof value === 'string') return value;\n\tif (typeof value === 'number' || typeof value === 'boolean') return String(value);\n\treturn JSON.stringify(value);\n}\n\nexport function toStringArray(value: SchemaFormValue): string[] {\n\tif (!Array.isArray(value)) return [];\n\treturn value.map((item) => String(item));\n}\n\nexport function toBooleanValue(value: SchemaFormValue): boolean {\n\treturn value === true || value === 'true' || value === 1;\n}\n\nexport function parseNumberValue(rawValue: string, integer = false): number | null {\n\tconst trimmed = rawValue.trim();\n\tif (trimmed.length === 0) return null;\n\tconst parsed = integer ? Number.parseInt(trimmed, 10) : Number.parseFloat(trimmed);\n\treturn Number.isNaN(parsed) ? null : parsed;\n}\n\nexport function formatJsonValue(value: SchemaFormValue, indent = 2, quoteString = false): string {\n\tif (value === undefined || value === null) return '';\n\tif (typeof value === 'string') return quoteString ? JSON.stringify(value) : value;\n\ttry {\n\t\treturn JSON.stringify(value, null, indent);\n\t} catch {\n\t\treturn String(value);\n\t}\n}\n\nexport function parseJsonValue(rawValue: string): { value: SchemaFormValue; valid: boolean } {\n\tconst trimmed = rawValue.trim();\n\tif (trimmed.length === 0) return { value: null, valid: true };\n\n\ttry {\n\t\treturn { value: JSON.parse(trimmed) as SchemaFormValue, valid: true };\n\t} catch {\n\t\treturn { value: rawValue, valid: false };\n\t}\n}\n","import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';\n\nimport type {\n\tSchemaFormErrors,\n\tSchemaFormField,\n\tSchemaFormSubmitHelpers,\n\tSchemaFormValue,\n\tSchemaFormValues,\n} from '../schema-form.types';\nimport { isFieldHidden } from '../schema-form.utils';\n\nexport interface UseSchemaFormOptions {\n\tfields: SchemaFormField[];\n\tvalue?: SchemaFormValues;\n\tdefaultValue?: SchemaFormValues;\n\terrors?: SchemaFormErrors;\n\tonValueChange?: (values: SchemaFormValues) => void;\n\tonFieldChange?: (key: string, value: SchemaFormValue, values: SchemaFormValues) => void;\n\tformatRequiredError: (label: string) => string;\n\tvalidationError: string;\n\tonError?: (error: unknown) => void;\n}\n\nexport interface UseSchemaFormResult extends SchemaFormSubmitHelpers {\n\tvalues: SchemaFormValues;\n\terrors: SchemaFormErrors;\n\tgetFieldError: (key: string) => string | undefined;\n\tgetFieldValue: (key: string) => SchemaFormValue;\n\t/** Reads the latest values, including writes made in the current event. */\n\tgetValues: () => SchemaFormValues;\n\tsetFieldValue: (key: string, value: SchemaFormValue) => void;\n\tsetValues: (values: SchemaFormValues) => void;\n\t/** Registers a field editor's current parse validity with form validation. */\n\tsetFieldParseValidity: (key: string, valid: boolean) => void;\n\treset: () => SchemaFormValues;\n\tvalidate: () => boolean;\n}\n\nfunction getDefaultValues(fields: SchemaFormField[], defaultValue?: SchemaFormValues): SchemaFormValues {\n\tconst values: SchemaFormValues = { ...defaultValue };\n\n\tfor (const field of fields) {\n\t\tif (field.defaultValue !== undefined && values[field.key] === undefined) {\n\t\t\tvalues[field.key] = field.defaultValue;\n\t\t}\n\t}\n\n\treturn values;\n}\n\nfunction shouldRequireValue(value: SchemaFormValue): boolean {\n\tif (value === undefined || value === null) return true;\n\tif (typeof value === 'string') return value.trim().length === 0;\n\tif (Array.isArray(value)) return value.length === 0;\n\treturn false;\n}\n\nfunction normalizeErrors(errors?: SchemaFormErrors): SchemaFormErrors {\n\tconst next: SchemaFormErrors = {};\n\tfor (const [key, message] of Object.entries(errors ?? {})) {\n\t\tif (message) next[key] = message;\n\t}\n\treturn next;\n}\n\nexport function useSchemaForm(options: UseSchemaFormOptions): UseSchemaFormResult {\n\tconst { fields, value, defaultValue, errors: externalErrors } = options;\n\tconst isControlled = value !== undefined;\n\tconst initialValues = useMemo(\n\t\t() => getDefaultValues(fields, defaultValue),\n\t\t[defaultValue, fields],\n\t);\n\tconst [internalValues, setInternalValues] = useState<SchemaFormValues>(() => initialValues);\n\tconst [validationErrors, setValidationErrors] = useState<SchemaFormErrors>({});\n\tconst invalidParsedFields = useRef(new Set<string>());\n\tconst values = useMemo(\n\t\t() => (isControlled ? { ...initialValues, ...value } : internalValues),\n\t\t[initialValues, internalValues, isControlled, value],\n\t);\n\tconst committedValues = useRef(values);\n\tconst currentValues = useRef(values);\n\tconst currentOptions = useRef(options);\n\tuseLayoutEffect(() => {\n\t\tcommittedValues.current = values;\n\t\tcurrentValues.current = values;\n\t}, [values]);\n\tuseLayoutEffect(() => {\n\t\tcurrentOptions.current = options;\n\t}, [options]);\n\n\tconst mergedErrors = useMemo(\n\t\t() => ({\n\t\t\t...validationErrors,\n\t\t\t...normalizeErrors(externalErrors),\n\t\t}),\n\t\t[externalErrors, validationErrors],\n\t);\n\n\tconst writeValues = useCallback((nextValues: SchemaFormValues) => {\n\t\tcurrentValues.current = nextValues;\n\t\tif (currentOptions.current.value === undefined) {\n\t\t\tsetInternalValues(nextValues);\n\t\t\treturn;\n\t\t}\n\t\t// Compose same-event controlled proposals. Later events read the\n\t\t// committed parent value if the owner declined the proposal.\n\t\tqueueMicrotask(() => {\n\t\t\tif (currentValues.current === nextValues) currentValues.current = committedValues.current;\n\t\t});\n\t}, []);\n\n\tconst setValues = useCallback(\n\t\t(nextValues: SchemaFormValues) => {\n\t\t\twriteValues(nextValues);\n\t\t\tcurrentOptions.current.onValueChange?.(nextValues);\n\t\t},\n\t\t[writeValues],\n\t);\n\n\tconst setFieldValue = useCallback(\n\t\t(key: string, fieldValue: SchemaFormValue) => {\n\t\t\tconst nextValues = { ...currentValues.current, [key]: fieldValue };\n\t\t\twriteValues(nextValues);\n\t\t\tsetValidationErrors((current) => {\n\t\t\t\tif (!current[key]) return current;\n\t\t\t\tconst next = { ...current };\n\t\t\t\tdelete next[key];\n\t\t\t\treturn next;\n\t\t\t});\n\t\t\tcurrentOptions.current.onFieldChange?.(key, fieldValue, nextValues);\n\t\t\tcurrentOptions.current.onValueChange?.(nextValues);\n\t\t},\n\t\t[writeValues],\n\t);\n\n\tconst setFieldParseValidity = useCallback((key: string, valid: boolean) => {\n\t\tif (valid) invalidParsedFields.current.delete(key);\n\t\telse invalidParsedFields.current.add(key);\n\t}, []);\n\n\tconst reset = useCallback(() => {\n\t\tconst { fields, defaultValue, onValueChange } = currentOptions.current;\n\t\tconst nextValues = getDefaultValues(fields, defaultValue);\n\t\twriteValues(nextValues);\n\t\tinvalidParsedFields.current.clear();\n\t\tsetValidationErrors({});\n\t\tonValueChange?.(nextValues);\n\t\treturn nextValues;\n\t}, [writeValues]);\n\n\tconst validate = useCallback(() => {\n\t\tconst { fields, formatRequiredError, onError, validationError } = currentOptions.current;\n\t\tconst values = currentValues.current;\n\t\tconst nextErrors: SchemaFormErrors = {};\n\t\tlet hasParseError = false;\n\n\t\tfor (const field of fields) {\n\t\t\tif (isFieldHidden(field, values, onError)) continue;\n\t\t\tif (field.type === 'json' && invalidParsedFields.current.has(field.key)) {\n\t\t\t\thasParseError = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst fieldValue = values[field.key];\n\t\t\tif (field.required && shouldRequireValue(fieldValue)) {\n\t\t\t\tnextErrors[field.key] = formatRequiredError(field.label);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst validators = Array.isArray(field.validate)\n\t\t\t\t? field.validate\n\t\t\t\t: field.validate\n\t\t\t\t\t? [field.validate]\n\t\t\t\t\t: [];\n\n\t\t\tfor (const validator of validators) {\n\t\t\t\ttry {\n\t\t\t\t\tconst result = validator(fieldValue, values, field);\n\t\t\t\t\tif (typeof result === 'string' && result.length > 0) {\n\t\t\t\t\t\tnextErrors[field.key] = result;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} catch (error) {\n\t\t\t\t\tonError?.(error);\n\t\t\t\t\tnextErrors[field.key] = validationError;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!nextErrors[field.key] && typeof fieldValue === 'number' &&\n\t\t\t\t(field.type === 'number' || field.type === 'integer' || field.type === 'decimal')) {\n\t\t\t\tconst { min, max } = { min: field.min, max: field.max, ...field.numberProps };\n\t\t\t\tif ((min !== undefined && fieldValue < min) || (max !== undefined && fieldValue > max)) {\n\t\t\t\t\tnextErrors[field.key] = validationError;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tsetValidationErrors(nextErrors);\n\t\treturn !hasParseError && Object.keys(nextErrors).length === 0;\n\t}, []);\n\n\tconst getFieldError = useCallback(\n\t\t(key: string) => mergedErrors[key],\n\t\t[mergedErrors],\n\t);\n\n\tconst getFieldValue = useCallback(\n\t\t(key: string) => values[key],\n\t\t[values],\n\t);\n\tconst getValues = useCallback(() => currentValues.current, []);\n\n\treturn {\n\t\tvalues,\n\t\terrors: mergedErrors,\n\t\tgetFieldError,\n\t\tgetFieldValue,\n\t\tgetValues,\n\t\tsetFieldValue,\n\t\tsetValues,\n\t\tsetFieldParseValidity,\n\t\treset,\n\t\tvalidate,\n\t};\n}\n","import { Button } from '../../../base/buttons';\nimport { Stack } from '../../../base/structure';\nimport {compositionRhythm} from '../../../base/structure/composition.recipes';\nimport { cn } from '../../../../lib/utils';\n\nexport interface SchemaFormActionsProps {\n\t/** Copy for the submit button. */\n\tsubmitLabel: string;\n\t/** Copy for the reset button. */\n\tresetLabel: string;\n\t/** Renders the reset. */\n\tshowReset?: boolean;\n\t/** Renders the entry as unselectable. */\n\tdisabled?: boolean;\n\t/** Disables the submit button. */\n\tsubmitDisabled?: boolean;\n\t/** Disables the reset button. */\n\tresetDisabled?: boolean;\n\t/** Shows the pending state on submit. */\n\tsubmitting?: boolean;\n\tonReset?: () => void;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n}\n\nexport function SchemaFormActions({\n\tsubmitLabel,\n\tresetLabel,\n\tshowReset = false,\n\tdisabled = false,\n\tsubmitDisabled = false,\n\tresetDisabled = false,\n\tsubmitting = false,\n\tonReset,\n\tclassName,\n}: SchemaFormActionsProps) {\n\treturn (\n\t\t<Stack direction=\"horizontal\" align=\"center\" justify=\"end\" gap={compositionRhythm.commands} className={cn('schema-form-actions--component', className)}>\n\t\t\t{!!showReset && (\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\tdisabled={disabled || resetDisabled || submitting}\n\t\t\t\t\tonClick={onReset}\n\t\t\t\t>\n\t\t\t\t\t{resetLabel}\n\t\t\t\t</Button>\n\t\t\t)}\n\t\t\t<Button\n\t\t\t\ttype=\"submit\"\n\t\t\t\ttone=\"primary\"\n\t\t\t\tloading={submitting}\n\t\t\t\tdisabled={disabled || submitDisabled}\n\t\t\t>\n\t\t\t\t{submitLabel}\n\t\t\t</Button>\n\t\t</Stack>\n\t);\n}\n\nSchemaFormActions.displayName = 'SchemaFormActions';\n","import { EmptyState } from '../../../blocks/data-display';\nimport { cn } from '../../../../lib/utils';\n\nexport interface SchemaFormEmptyProps {\n\t/** Surface title. */\n\ttitle: string;\n\t/** Supporting copy shown under the label. */\n\tdescription: string;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n}\n\nexport function SchemaFormEmpty({ title, description, className }: SchemaFormEmptyProps) {\n\treturn (\n\t\t<EmptyState\n\t\t\ttitle={title}\n\t\t\tdescription={description}\n\t\t\tpadding=\"md\"\n\t\t\tborder\n\t\t\tclassName={cn('schema-form-empty--component bg-muted/30', className)}\n\t\t/>\n\t);\n}\n\nSchemaFormEmpty.displayName = 'SchemaFormEmpty';\n","import { useEffect, useRef, useState, type ElementType } from 'react';\n\nimport { CardCheckboxGroup, CardRadioGroup, Select, SwitchCard, ToggleField } from '../../../base/choice-inputs';\nimport { FormField } from '../../../base/forms';\nimport { Input, Textarea } from '../../../base/text-inputs';\nimport { TagsInput } from '../../../base/value-inputs';\nimport { DecimalInput, type DecimalInputProps } from '../../../base/forms-numeric';\nimport { cn } from '../../../../lib/utils';\n\nimport type { SchemaFormStrings } from '../schema-form.strings';\nimport type {\n\tSchemaFormField,\n\tSchemaFormFieldContext,\n\tSchemaFormNumberField,\n\tSchemaFormValue,\n\tSchemaFormValues,\n} from '../schema-form.types';\nimport {\n\tformatJsonValue,\n\tparseJsonValue,\n\tparseNumberValue,\n\ttoBooleanValue,\n\ttoStringArray,\n\ttoStringValue,\n} from '../schema-form.utils';\n\nexport interface SchemaFormFieldRendererProps extends SchemaFormFieldContext {\n\t/** Overrides this surface's own copy. */\n\tstrings: SchemaFormStrings;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Reports whether the JSON editor can parse its current draft. */\n\tonParseValidityChange?: (key: string, valid: boolean) => void;\n}\n\nfunction getFieldHint(field: SchemaFormField): string | undefined {\n\treturn field.hint ?? field.description;\n}\n\nfunction getTextDisplayValue(\n\tfield: SchemaFormField,\n\tvalue: SchemaFormValue,\n\tvalues: SchemaFormValues,\n\tonError?: (error: unknown) => void,\n): string {\n\tif (field.formatValue) {\n\t\ttry {\n\t\t\treturn field.formatValue(value, values);\n\t\t} catch (error) {\n\t\t\tonError?.(error);\n\t\t}\n\t}\n\treturn toStringValue(value);\n}\n\nfunction parseTextValue(\n\tfield: SchemaFormField,\n\trawValue: string,\n\tvalues: SchemaFormValues,\n\tonError?: (error: unknown) => void,\n): SchemaFormValue {\n\tif (field.parseValue) {\n\t\ttry {\n\t\t\treturn field.parseValue(rawValue, values);\n\t\t} catch (error) {\n\t\t\tonError?.(error);\n\t\t}\n\t}\n\treturn rawValue;\n}\n\nfunction parseNumberFieldValue(\n\tfield: SchemaFormField,\n\trawValue: string,\n\tvalues: SchemaFormValues,\n\tinteger: boolean,\n\tonError?: (error: unknown) => void,\n): SchemaFormValue {\n\tif (field.parseValue) {\n\t\ttry {\n\t\t\treturn field.parseValue(rawValue, values);\n\t\t} catch (error) {\n\t\t\tonError?.(error);\n\t\t}\n\t}\n\treturn parseNumberValue(rawValue, integer);\n}\n\nfunction NumberFieldControl({\n\tfield,\n\tvalue,\n\tvalues,\n\tonParsedChange,\n\tonParseError,\n\tonFocus,\n\tonBlur,\n\t...inputProps\n}: Pick<SchemaFormFieldContext, 'value' | 'values'>\n\t& {\n\t\tfield: SchemaFormNumberField;\n\t\tonParsedChange: SchemaFormFieldContext['onValueChange'];\n\t\tonParseError?: SchemaFormFieldContext['onError'];\n\t}\n\t& Omit<DecimalInputProps, 'value' | 'defaultValue' | 'onChange'>) {\n\tconst editing = useRef(false);\n\tconst [draft, setDraft] = useState<{ text: string; value: SchemaFormValue } | null>(null);\n\t// A parent can accept the parsed value or replace it. Only an accepted edit\n\t// can keep intermediate text such as \"1.\" or \"0.0\" in the field.\n\tconst acceptedDraft = draft && Object.is(draft.value, value) ? draft : null;\n\tif (draft && !acceptedDraft) setDraft(null);\n\n\treturn (\n\t\t<DecimalInput\n\t\t\t{...inputProps}\n\t\t\tvalue={acceptedDraft?.text ?? getTextDisplayValue(field, value, values, onParseError)}\n\t\t\tonFocus={(event) => {\n\t\t\t\tediting.current = true;\n\t\t\t\tonFocus?.(event);\n\t\t\t}}\n\t\t\tonBlur={(event) => {\n\t\t\t\tediting.current = false;\n\t\t\t\tsetDraft(null);\n\t\t\t\tonBlur?.(event);\n\t\t\t}}\n\t\t\tonChange={(event) => {\n\t\t\t\tconst text = event.target.value;\n\t\t\t\tconst next = parseNumberFieldValue(field, text, values, field.type === 'integer', onParseError);\n\t\t\t\tif (editing.current) setDraft({ text, value: next });\n\t\t\t\tonParsedChange(next);\n\t\t\t}}\n\t\t/>\n\t);\n}\n\nfunction parseJsonFieldValue(\n\tfield: SchemaFormField,\n\trawValue: string,\n\tvalues: SchemaFormValues,\n\tonError?: (error: unknown) => void,\n): { value: SchemaFormValue; valid: boolean } {\n\tif (field.type === 'json' && field.parseValue) {\n\t\ttry {\n\t\t\treturn { value: field.parseValue(rawValue, values), valid: true };\n\t\t} catch (error) {\n\t\t\tonError?.(error);\n\t\t\treturn { value: rawValue, valid: false };\n\t\t}\n\t}\n\treturn parseJsonValue(rawValue);\n}\n\nfunction optionIconNode(option: { icon?: ElementType }) {\n\tif (!option.icon) return undefined;\n\tconst Icon = option.icon;\n\treturn <Icon className=\"size-icon\" aria-hidden=\"true\" />;\n}\n\nfunction JsonFieldControl({\n\tfield,\n\tvalue,\n\tvalues,\n\terror,\n\tdisabled,\n\tfieldId,\n\tonValueChange,\n\tonError,\n\tstrings,\n\tonParseValidityChange,\n}: SchemaFormFieldRendererProps) {\n\tconst indent = field.type === 'json' ? field.jsonIndent ?? 2 : 2;\n\tconst quoteParsedString = !field.parseValue;\n\tconst [text, setText] = useState(() => formatJsonValue(value, indent));\n\tconst [parseError, setParseError] = useState<string | undefined>();\n\tconst [isFocused, setIsFocused] = useState(false);\n\tconst lastParse = useRef<ReturnType<typeof parseJsonFieldValue> | null>(null);\n\n\tuseEffect(() => {\n\t\tif (isFocused) return;\n\t\tconst acceptedParse = lastParse.current && Object.is(lastParse.current.value, value) ? lastParse.current : null;\n\t\tsetText(formatJsonValue(value, indent, quoteParsedString && !!acceptedParse?.valid));\n\t\tif (!acceptedParse && lastParse.current) {\n\t\t\tlastParse.current = null;\n\t\t\tsetParseError(undefined);\n\t\t\tonParseValidityChange?.(field.key, true);\n\t\t}\n\t}, [field.key, indent, isFocused, onParseValidityChange, quoteParsedString, value]);\n\n\tuseEffect(() => () => onParseValidityChange?.(field.key, true), [field.key, onParseValidityChange]);\n\n\tif (field.type !== 'json') return null;\n\n\tconst commit = (rawValue: string) => {\n\t\tconst parsed = parseJsonFieldValue(field, rawValue, values, onError);\n\t\tlastParse.current = parsed;\n\t\tsetParseError(parsed.valid ? undefined : strings.jsonParseError);\n\t\tonParseValidityChange?.(field.key, parsed.valid);\n\t\tonValueChange(parsed.value);\n\t\treturn parsed;\n\t};\n\n\treturn (\n\t\t<FormField\n\t\t\tlabel={field.label}\n\t\t\trequired={field.required}\n\t\t\thint={getFieldHint(field)}\n\t\t\thelperText={field.helperText}\n\t\t\terror={error ?? parseError}\n\t\t\thtmlFor={fieldId}\n\t\t\tsupportingTextId={`${fieldId}-supporting`}\n\t\t\tclassName=\"schema-form-field--component schema-form-field--json\"\n\t\t>\n\t\t\t<Textarea\n\t\t\t\tid={fieldId}\n\t\t\t\tname={field.key}\n\t\t\t\tvalue={text}\n\t\t\t\trows={field.rows ?? 6}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tinvalid={Boolean(error ?? parseError)}\n\t\t\t\tplaceholder={field.placeholder}\n\t\t\t\tspellCheck={false}\n\t\t\t\tclassName={cn('font-mono', field.controlClassName)}\n\t\t\t\tonFocus={() => setIsFocused(true)}\n\t\t\t\tonChange={(event) => {\n\t\t\t\t\tconst next = event.target.value;\n\t\t\t\t\tsetText(next);\n\t\t\t\t\tcommit(next);\n\t\t\t\t}}\n\t\t\t\tonBlur={() => {\n\t\t\t\t\tsetIsFocused(false);\n\t\t\t\t\tconst parsed = commit(text);\n\t\t\t\t\tif (parsed.valid) setText(formatJsonValue(parsed.value, indent, quoteParsedString));\n\t\t\t\t}}\n\t\t\t\t{...field.textareaProps}\n\t\t\t\t\taria-describedby={[field.textareaProps?.['aria-describedby'], error || parseError || field.helperText || getFieldHint(field) ? `${fieldId}-supporting` : undefined].filter(Boolean).join(' ') || undefined}\n\t\t\t/>\n\t\t</FormField>\n\t);\n}\n\nexport function SchemaFormFieldRenderer({\n\tfield,\n\tvalue,\n\tvalues,\n\terror,\n\tdisabled,\n\trequired,\n\tfieldId,\n\tonValueChange,\n\tonError,\n\tstrings,\n\tclassName,\n\tonParseValidityChange,\n}: SchemaFormFieldRendererProps) {\n\tconst fieldType = field.type ?? 'text';\n\tconst commonFieldProps = {\n\t\tlabel: field.label,\n\t\trequired,\n\t\thint: getFieldHint(field),\n\t\thelperText: field.helperText,\n\t\terror,\n\t\thtmlFor: fieldId,\n\t\tsupportingTextId: `${fieldId}-supporting`,\n\t\tclassName: cn('schema-form-field--component', className),\n\t};\n\n\tconst controlClassName = field.controlClassName;\n\tconst describedBy = error || field.helperText || getFieldHint(field) ? `${fieldId}-supporting` : undefined;\n\n\tif (fieldType === 'custom' && field.type === 'custom') {\n\t\treturn (\n\t\t\t<div className={cn('schema-form-field--component schema-form-field--custom', className)}>\n\t\t\t\t{field.render({ field, value, values, error, disabled, required, fieldId, onValueChange, onError })}\n\t\t\t</div>\n\t\t);\n\t}\n\n\tif (fieldType === 'switch' && field.type === 'switch') {\n\t\tconst checked = toBooleanValue(value);\n\t\tif (field.switchStyle === 'card') {\n\t\t\treturn (\n\t\t\t\t<FormField error={error} supportingTextId={`${fieldId}-supporting`} className={cn('schema-form-field--component schema-form-field--switch-card', className)}>\n\t\t\t\t\t<SwitchCard\n\t\t\t\t\tlabel={field.label}\n\t\t\t\t\t\tdescription={field.description}\n\t\t\t\t\t\thint={field.hint}\n\t\t\t\t\t\tname={field.key}\n\t\t\t\t\t\tvalue={checked}\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\tinvalid={Boolean(error)}\n\t\t\t\t\t\tclassName={controlClassName}\n\t\t\t\t\t\tonValueChange={(next) => onValueChange(next)}\n\t\t\t\t\t\t{...field.switchCardProps}\n\t\t\t\t\taria-describedby={[field.switchCardProps?.['aria-describedby'], error ? `${fieldId}-supporting` : undefined].filter(Boolean).join(' ') || undefined}\n\t\t\t\t\t/>\n\t\t\t\t</FormField>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<FormField error={error} supportingTextId={`${fieldId}-supporting`} className={cn('schema-form-field--component schema-form-field--switch', className)}>\n\t\t\t\t<ToggleField\n\t\t\t\t\tlabel={field.label}\n\t\t\t\t\tdescription={field.description ?? field.hint}\n\t\t\t\t\tname={field.key}\n\t\t\t\t\tvalue={checked}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tinvalid={Boolean(error)}\n\t\t\t\t\tclassName={controlClassName}\n\t\t\t\t\tonValueChange={(next) => onValueChange(next)}\n\t\t\t\t\t{...field.switchProps}\n\t\t\t\t\taria-describedby={[field.switchProps?.['aria-describedby'], error ? `${fieldId}-supporting` : undefined].filter(Boolean).join(' ') || undefined}\n\t\t\t\t/>\n\t\t\t</FormField>\n\t\t);\n\t}\n\n\tif (fieldType === 'json') {\n\t\treturn (\n\t\t\t<JsonFieldControl\n\t\t\t\tfield={field}\n\t\t\t\tvalue={value}\n\t\t\t\tvalues={values}\n\t\t\t\terror={error}\n\t\t\t\tdisabled={disabled}\n\t\t\t\trequired={required}\n\t\t\t\tfieldId={fieldId}\n\t\t\t\tonValueChange={onValueChange}\n\t\t\t\tonError={onError}\n\t\t\t\tstrings={strings}\n\t\t\t\tonParseValidityChange={onParseValidityChange}\n\t\t\t/>\n\t\t);\n\t}\n\n\tif (fieldType === 'textarea' && field.type === 'textarea') {\n\t\tconst displayValue = getTextDisplayValue(field, value, values, onError);\n\t\treturn (\n\t\t\t<FormField {...commonFieldProps}>\n\t\t\t\t<Textarea\n\t\t\t\t\taria-describedby={describedBy}\n\t\t\t\t\tid={fieldId}\n\t\t\t\t\tname={field.key}\n\t\t\t\t\tvalue={displayValue}\n\t\t\t\t\trows={field.rows}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\trequired={required}\n\t\t\t\t\tinvalid={Boolean(error)}\n\t\t\t\t\tplaceholder={field.placeholder}\n\t\t\t\t\tclassName={controlClassName}\n\t\t\t\t\tonChange={(event) => onValueChange(parseTextValue(field, event.target.value, values, onError))}\n\t\t\t\t\t{...field.textareaProps}\n\t\t\t\t/>\n\t\t\t</FormField>\n\t\t);\n\t}\n\n\tif ((fieldType === 'number' || fieldType === 'integer' || fieldType === 'decimal') && (\n\t\tfield.type === 'number' || field.type === 'integer' || field.type === 'decimal'\n\t)) {\n\t\tconst integer = field.type === 'integer';\n\t\tconst decimalPlaces = integer ? 0 : field.decimalPlaces ?? (field.type === 'decimal' ? 2 : 4);\n\t\treturn (\n\t\t\t<FormField {...commonFieldProps}>\n\t\t\t\t<NumberFieldControl\n\t\t\t\t\tfield={field}\n\t\t\t\t\tvalue={value}\n\t\t\t\t\tvalues={values}\n\t\t\t\t\tonParsedChange={onValueChange}\n\t\t\t\t\tonParseError={onError}\n\t\t\t\t\tid={fieldId}\n\t\t\t\t\tname={field.key}\n\t\t\t\t\tmin={field.min}\n\t\t\t\t\tmax={field.max}\n\t\t\t\t\tstep={field.step}\n\t\t\t\t\tdecimalPlaces={decimalPlaces}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\trequired={required}\n\t\t\t\t\tinvalid={Boolean(error)}\n\t\t\t\t\tplaceholder={field.placeholder}\n\t\t\t\t\tclassName={controlClassName}\n\t\t\t\t\t{...field.numberProps}\n\t\t\t\t\taria-describedby={[field.numberProps?.['aria-describedby'], describedBy].filter(Boolean).join(' ') || undefined}\n\t\t\t\t/>\n\t\t\t</FormField>\n\t\t);\n\t}\n\n\tif (fieldType === 'select' && field.type === 'select') {\n\t\tconst options = field.options.map((option) => ({\n\t\t\tvalue: option.value,\n\t\t\tlabel: option.label,\n\t\t\tdisabled: option.disabled,\n\t\t\ticon: optionIconNode(option),\n\t\t}));\n\n\t\treturn (\n\t\t\t<FormField {...commonFieldProps}>\n\t\t\t\t<Select\n\t\t\t\t\tname={field.key}\n\t\t\t\t\tvalue={toStringValue(value)}\n\t\t\t\t\toptions={options}\n\t\t\t\t\tallowClear={field.allowClear}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\trequired={required}\n\t\t\t\t\tinvalid={Boolean(error)}\n\t\t\t\t\tplaceholder={field.placeholder}\n\t\t\t\t\taria-label={field.label}\n\t\t\t\t\tclassName={controlClassName}\n\t\t\t\t\tonValueChange={(next) => onValueChange(next ?? null)}\n\t\t\t\t\t{...field.selectProps}\n\t\t\t\t\taria-describedby={[field.selectProps?.['aria-describedby'], describedBy].filter(Boolean).join(' ') || undefined}\n\t\t\t\t/>\n\t\t\t</FormField>\n\t\t);\n\t}\n\n\tif (fieldType === 'radio-cards' && field.type === 'radio-cards') {\n\t\treturn (\n\t\t\t<FormField {...commonFieldProps}>\n\t\t\t\t<CardRadioGroup\n\t\t\t\t\tname={field.key}\n\t\t\t\t\tvalue={toStringValue(value)}\n\t\t\t\t\toptions={field.options}\n\t\t\t\t\tcolumns={field.columns}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tinvalid={Boolean(error)}\n\t\t\t\t\tclassName={controlClassName}\n\t\t\t\t\tonValueChange={(next) => onValueChange(next)}\n\t\t\t\t\t{...field.radioProps}\n\t\t\t\t\taria-describedby={[field.radioProps?.['aria-describedby'], describedBy].filter(Boolean).join(' ') || undefined}\n\t\t\t\t/>\n\t\t\t</FormField>\n\t\t);\n\t}\n\n\tif (fieldType === 'checkbox-cards' && field.type === 'checkbox-cards') {\n\t\treturn (\n\t\t\t<FormField {...commonFieldProps}>\n\t\t\t\t<CardCheckboxGroup\n\t\t\t\t\tname={field.key}\n\t\t\t\t\tvalue={toStringArray(value)}\n\t\t\t\t\toptions={field.options}\n\t\t\t\t\tcolumns={field.columns}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tinvalid={Boolean(error)}\n\t\t\t\t\tclassName={controlClassName}\n\t\t\t\t\tonValueChange={(next) => onValueChange(next)}\n\t\t\t\t\t{...field.checkboxProps}\n\t\t\t\t\taria-describedby={[field.checkboxProps?.['aria-describedby'], describedBy].filter(Boolean).join(' ') || undefined}\n\t\t\t\t/>\n\t\t\t</FormField>\n\t\t);\n\t}\n\n\tif (fieldType === 'tags' && field.type === 'tags') {\n\t\treturn (\n\t\t\t<FormField {...commonFieldProps}>\n\t\t\t\t<TagsInput\n\t\t\t\t\tid={fieldId}\n\t\t\t\t\tvalue={toStringArray(value)}\n\t\t\t\t\trecommendations={field.recommendations}\n\t\t\t\t\tmaxTags={field.maxTags}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tinvalid={Boolean(error)}\n\t\t\t\t\tplaceholder={field.placeholder}\n\t\t\t\t\tclassName={controlClassName}\n\t\t\t\t\tonValueChange={(next) => onValueChange(next)}\n\t\t\t\t\t{...field.tagsProps}\n\t\t\t\t\taria-describedby={[field.tagsProps?.['aria-describedby'], describedBy].filter(Boolean).join(' ') || undefined}\n\t\t\t\t/>\n\t\t\t</FormField>\n\t\t);\n\t}\n\n\tconst inputType = fieldType === 'text' ? 'text' : fieldType;\n\tconst nativeInputProps = field.type === undefined || field.type === 'text' || field.type === 'email' || field.type === 'password' || field.type === 'url' || field.type === 'tel' || field.type === 'search' ? field.inputProps : undefined;\n\tconst displayValue = getTextDisplayValue(field, value, values, onError);\n\n\treturn (\n\t\t<FormField {...commonFieldProps}>\n\t\t\t<Input\n\t\t\t\tid={fieldId}\n\t\t\t\tname={field.key}\n\t\t\t\ttype={inputType}\n\t\t\t\tvalue={displayValue}\n\t\t\t\tdisabled={disabled}\n\t\t\t\trequired={required}\n\t\t\t\tinvalid={Boolean(error)}\n\t\t\t\tplaceholder={field.placeholder}\n\t\t\t\tclassName={controlClassName}\n\t\t\t\tonChange={(event) => onValueChange(parseTextValue(field, event.target.value, values, onError))}\n\t\t\t\t{...nativeInputProps}\n\t\t\t\taria-describedby={[nativeInputProps?.['aria-describedby'], describedBy].filter(Boolean).join(' ') || undefined}\n\t\t\t/>\n\t\t</FormField>\n\t);\n}\n\nSchemaFormFieldRenderer.displayName = 'SchemaFormFieldRenderer';\n","export interface SchemaFormStrings {\n\tsubmitLabel: string;\n\tresetLabel: string;\n\tdefaultSectionTitle: string;\n\temptyTitle: string;\n\temptyDescription: string;\n\tjsonParseError: string;\n\tvalidationError: string;\n\tformatRequiredError: (label: string) => string;\n}\n\nexport const defaultSchemaFormStrings: SchemaFormStrings = {\n\tsubmitLabel: 'Save changes',\n\tresetLabel: 'Reset',\n\tdefaultSectionTitle: 'General',\n\temptyTitle: 'No fields configured',\n\temptyDescription: 'Add fields to the schema to render a form.',\n\tjsonParseError: 'Enter valid JSON.',\n\tvalidationError: 'Invalid value.',\n\tformatRequiredError: (label) => `${label} is required.`,\n};\n","import { Fragment, useId, useMemo } from 'react';\n\nimport { Card } from '../../base/cards';\nimport { ContentBlock } from '../../base/display';\nimport { Stack } from '../../base/structure';\nimport {compositionRhythm} from '../../base/structure/composition.recipes';\nimport { Text } from '../../typography';\nimport {copyRoleProps} from '../../typography/text.styles';\nimport { useStrings } from '../../../lib/strings';\nimport { cn } from '../../../lib/utils';\n\nimport { useSchemaForm } from './hooks';\nimport {\n\tSchemaFormActions,\n\tSchemaFormEmpty,\n\tSchemaFormFieldRenderer,\n} from './partials';\nimport {\n\tdefaultSchemaFormStrings,\n\ttype SchemaFormStrings,\n} from './schema-form.strings';\nimport type {\n\tResolvedSchemaFormSection,\n\tSchemaFormField,\n\tSchemaFormFieldContext,\n\tSchemaFormProps,\n\tSchemaFormSubmitHelpers,\n} from './schema-form.types';\nimport {\n\tSCHEMA_FORM_COLUMNS,\n\tSCHEMA_FORM_FIELD_WIDTH,\n\tisFieldDisabled,\n\tresolveSchemaSections,\n} from './schema-form.utils';\n\nfunction toDomId(value: string): string {\n\treturn value.replace(/[^a-zA-Z0-9_-]/g, '-');\n}\n\nfunction SectionHeading({ section }: { section: ResolvedSchemaFormSection }) {\n\tif (!section.title && !section.description) return null;\n\n\treturn (\n\t\t<Stack gap=\"normal\" className=\"schema-form--section-heading\">\n\t\t\t{!!section.title && (\n\t\t\t\t<Text {...copyRoleProps.subsection} className=\"schema-form--section-title\">\n\t\t\t\t\t{section.title}\n\t\t\t\t</Text>\n\t\t\t)}\n\t\t\t{!!section.description && (\n\t\t\t\t<Text {...copyRoleProps.structuralDescription} className=\"schema-form--section-description\">\n\t\t\t\t\t{section.description}\n\t\t\t\t</Text>\n\t\t\t)}\n\t\t</Stack>\n\t);\n}\n\nexport function SchemaForm({\n\tschema,\n\tvalue,\n\tdefaultValue,\n\terrors,\n\tdisabled = false,\n\tlayout = 'form',\n\tcolumns = 2,\n\tid,\n\tname,\n\ttitle,\n\tdescription,\n\theaderSlot,\n\tfooterSlot,\n\tactionsSlot,\n\temptySlot,\n\tshowActions,\n\tsubmitLabel,\n\tresetLabel,\n\tsubmitDisabled = false,\n\tresetDisabled = false,\n\tsubmitting = false,\n\tonValueChange,\n\tonFieldChange,\n\tonSubmit,\n\tonReset,\n\tonError,\n\trenderField,\n\trenderSection,\n\tstrings: stringsProp,\n\tclassName,\n\tcontentClassName,\n\tsectionClassName,\n\tfieldClassName,\n}: SchemaFormProps) {\n\tconst generatedId = useId();\n\tconst formId = id ?? `schema-form-${generatedId}`;\n\tconst strings: SchemaFormStrings = useStrings(defaultSchemaFormStrings, stringsProp);\n\tconst form = useSchemaForm({\n\t\tfields: schema.fields,\n\t\tvalue,\n\t\tdefaultValue,\n\t\terrors,\n\t\tonValueChange,\n\t\tonFieldChange,\n\t\tformatRequiredError: strings.formatRequiredError,\n\t\tvalidationError: strings.validationError,\n\t\tonError,\n\t});\n\n\tconst sections = useMemo(\n\t\t() => resolveSchemaSections(schema, form.values, strings.defaultSectionTitle, columns, onError),\n\t\t[columns, form.values, onError, schema, strings.defaultSectionTitle],\n\t);\n\tconst hasFields = sections.some((section) => section.fields.length > 0);\n\n\tconst helpers: SchemaFormSubmitHelpers = {\n\t\tsetFieldValue: form.setFieldValue,\n\t\tsetValues: form.setValues,\n\t\treset: form.reset,\n\t\tvalidate: form.validate,\n\t};\n\n\tconst shouldShowActions = showActions ?? Boolean(onSubmit || onReset || actionsSlot);\n\tconst resolvedSubmitLabel = submitLabel ?? strings.submitLabel;\n\tconst resolvedResetLabel = resetLabel ?? strings.resetLabel;\n\n\tconst renderFieldNode = (field: SchemaFormField) => {\n\t\tconst fieldId = `${formId}-${toDomId(field.key)}`;\n\t\tconst fieldDisabled = disabled || isFieldDisabled(field, form.values, onError);\n\t\tconst context: SchemaFormFieldContext = {\n\t\t\tfield,\n\t\t\tvalue: form.getFieldValue(field.key),\n\t\t\tvalues: form.values,\n\t\t\terror: form.getFieldError(field.key),\n\t\t\tdisabled: fieldDisabled,\n\t\t\trequired: Boolean(field.required),\n\t\t\tfieldId,\n\t\t\tonValueChange: (nextValue) => form.setFieldValue(field.key, nextValue),\n\t\t\tonError,\n\t\t};\n\t\tconst defaultField = (\n\t\t\t<SchemaFormFieldRenderer\n\t\t\t\t{...context}\n\t\t\t\tstrings={strings}\n\t\t\t\tonParseValidityChange={form.setFieldParseValidity}\n\t\t\t/>\n\t\t);\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tkey={field.key}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'schema-form--field',\n\t\t\t\t\tSCHEMA_FORM_FIELD_WIDTH[field.width ?? 'auto'],\n\t\t\t\t\tfield.className,\n\t\t\t\t\tfieldClassName,\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{renderField?.({ ...context, defaultField }) ?? defaultField}\n\t\t\t</div>\n\t\t);\n\t};\n\n\tconst renderSectionFields = (section: ResolvedSchemaFormSection) => (\n\t\t<div className={cn('schema-form--section-fields', SCHEMA_FORM_COLUMNS[section.columns])}>\n\t\t\t{section.fields.map(renderFieldNode)}\n\t\t</div>\n\t);\n\n\tconst renderPlainSection = (section: ResolvedSchemaFormSection) => {\n\t\tconst fields = renderSectionFields(section);\n\t\tconst custom = renderSection?.({ section, fields, values: form.values });\n\t\tif (custom !== undefined && custom !== null) {\n\t\t\treturn <Fragment key={section.id}>{custom}</Fragment>;\n\t\t}\n\n\t\treturn (\n\t\t\t<Stack\n\t\t\t\tkey={section.id}\n\t\t\t\trender={<section />}\n\t\t\t\tgap=\"lg\"\n\t\t\t\tclassName={cn('schema-form--section', section.className, sectionClassName)}\n\t\t\t>\n\t\t\t\t<SectionHeading section={section} />\n\t\t\t\t{fields}\n\t\t\t\t{!!section.footerSlot && (\n\t\t\t\t\t<div className=\"schema-form--section-footer\">\n\t\t\t\t\t\t{section.footerSlot}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</Stack>\n\t\t);\n\t};\n\n\tconst renderCardSection = (section: ResolvedSchemaFormSection) => {\n\t\tconst fields = renderSectionFields(section);\n\t\tconst custom = renderSection?.({ section, fields, values: form.values });\n\t\tif (custom !== undefined && custom !== null) {\n\t\t\treturn <Fragment key={section.id}>{custom}</Fragment>;\n\t\t}\n\n\t\treturn (\n\t\t\t<ContentBlock\n\t\t\t\tkey={section.id}\n\t\t\t\tclassName={cn('schema-form--section-card', section.className, sectionClassName)}\n\t\t\t\ticon={section.icon}\n\t\t\t\ttitle={section.title}\n\t\t\t\tdescription={section.description}\n\t\t\t\tfooterSlot={section.footerSlot}\n\t\t\t>\n\t\t\t\t{fields}\n\t\t\t</ContentBlock>\n\t\t);\n\t};\n\n\tconst actions = actionsSlot ?? (\n\t\tshouldShowActions ? (\n\t\t\t<SchemaFormActions\n\t\t\t\tsubmitLabel={resolvedSubmitLabel}\n\t\t\t\tresetLabel={resolvedResetLabel}\n\t\t\t\tshowReset={Boolean(onReset)}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tsubmitDisabled={submitDisabled}\n\t\t\t\tresetDisabled={resetDisabled}\n\t\t\t\tsubmitting={submitting}\n\t\t\t\tonReset={() => {\n\t\t\t\t\tconst nextValues = form.reset();\n\t\t\t\t\tonReset?.(nextValues, helpers);\n\t\t\t\t}}\n\t\t\t/>\n\t\t) : null\n\t);\n\n\tconst empty = emptySlot ?? (\n\t\t<SchemaFormEmpty\n\t\t\ttitle={strings.emptyTitle}\n\t\t\tdescription={strings.emptyDescription}\n\t\t/>\n\t);\n\n\treturn (\n\t\t<form\n\t\t\tid={formId}\n\t\t\tname={name}\n\t\t\tnoValidate\n\t\t\tclassName={cn('schema-form--component @container/schema-form', className)}\n\t\t\tonSubmit={async (event) => {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif (disabled || submitDisabled || submitting) return;\n\t\t\t\tconst submittedValues = form.getValues();\n\t\t\t\tconst valid = form.validate();\n\t\t\t\tif (!valid) return;\n\t\t\t\ttry {\n\t\t\t\t\tawait onSubmit?.(submittedValues, helpers, event);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tonError?.(error);\n\t\t\t\t}\n\t\t\t}}\n\t\t>\n\t\t\t{layout === 'cards' ? (\n\t\t\t\t<Stack gap={compositionRhythm.subjects} className={cn('schema-form--cards', contentClassName)}>\n\t\t\t\t\t{!!(title ?? schema.title ?? description ?? schema.description ?? headerSlot) && (\n\t\t\t\t\t\t<Stack direction=\"horizontal\" align=\"start\" justify=\"between\" gap=\"xl\" className=\"schema-form--header\">\n\t\t\t\t\t\t<Stack gap=\"normal\" className=\"min-w-0\">\n\t\t\t\t\t\t\t\t{!!(title ?? schema.title) && (\n\t\t\t\t\t\t\t\t\t<Text type=\"inherit\" size=\"base\" weight=\"semibold\" className=\"schema-form--title\">\n\t\t\t\t\t\t\t\t\t\t{title ?? schema.title}\n\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t{!!(description ?? schema.description) && (\n\t\t\t\t\t\t\t\t\t<Text type=\"secondary\" className=\"schema-form--description\">\n\t\t\t\t\t\t\t\t\t\t{description ?? schema.description}\n\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t\t{headerSlot}\n\t\t\t\t\t\t</Stack>\n\t\t\t\t\t)}\n\t\t\t\t\t{hasFields ? sections.map(renderCardSection) : empty}\n\t\t\t\t\t{footerSlot}\n\t\t\t\t\t{actions}\n\t\t\t\t</Stack>\n\t\t\t) : (\n\t\t\t\t\t<Card\n\t\t\t\t\t\tsurface=\"flat\"\n\t\t\t\t\t\tpadding=\"none\"\n\t\t\t\t\t\tclassName=\"schema-form--surface\"\n\t\t\t\t\t\tgap={compositionRhythm.subjects}\n\t\t\t\t\t\tcontentGap={compositionRhythm.subjects}\n\t\t\t\t\t\tcontentClassName={cn('schema-form--content', contentClassName)}\n\t\t\t\t\t\ttitle={title ?? schema.title}\n\t\t\t\t\t\tdescription={description ?? schema.description}\n\t\t\t\t\t\theaderEnd={headerSlot}\n\t\t\t\t\t\tfooterSlot={\n\t\t\t\t\t\t\tfooterSlot || actions ? (\n\t\t\t\t\t\t\t\t<Stack gap=\"lg\" className=\"schema-form--footer\">\n\t\t\t\t\t\t\t\t\t{footerSlot}\n\t\t\t\t\t\t\t\t\t{actions}\n\t\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t\t) : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{hasFields ? sections.map(renderPlainSection) : empty}\n\t\t\t\t\t</Card>\n\t\t\t)}\n\t\t</form>\n\t);\n}\n\nSchemaForm.displayName = 'SchemaForm';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAiBA,IAAaiB,KAAiD;CAC7D,GAAG;CACH,GAAG;CACH,GAAG;AACJ,GAEaC,KAAgE;CAC5E,MAAM;CACN,MAAM;CACN,OAAO;CACP,MAAM;AACP;AAEA,SAAgBC,EACf,GACA,GACA,GACU;CACV,IAAI,OAAOC,EAAM,UAAW,YAC3B,IAAI;EACH,OAAOA,EAAM,OAAOC,CAAM;CAC3B,SAASC,GAAO;EAEf,OADAC,IAAUD,CAAK,GACR;CACR;CAED,OAAOF,EAAM,UAAU;AACxB;AAEA,SAAgBI,GACf,GACA,GACA,GACU;CACV,IAAI,OAAOJ,EAAM,YAAa,YAC7B,IAAI;EACH,OAAOA,EAAM,SAASC,CAAM;CAC7B,SAASC,GAAO;EAEf,OADAC,IAAUD,CAAK,GACR;CACR;CAED,OAAOF,EAAM,YAAY;AAC1B;AAEA,SAAgBK,GACf,GACA,GACA,GACoB;CACpB,OAAOC,EAAO,QAAQ,MAAU,CAACP,EAAcC,GAAOC,GAAQE,CAAO,CAAC;AACvE;AAEA,SAAgBI,GACf,GACA,GACA,GACA,GACA,GAC8B;CAC9B,IAAMC,IAAgBH,GAAiBI,EAAO,QAAQR,GAAQE,CAAO,GAC/DO,IAAc,IAAI,IAAIF,EAAc,KAAK,MAAU,CAACR,EAAM,K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;IAAK,WAAU;IAA1B,UAAA,CACEsM,GACAT,CACK;GACJ,CAAA,IAAA,KAAA;GAGJ,UAAAtB,KAAYzI,EAAS,IAAIyJ,EAAkB,IAAIO;EAC3C,CAAA;CAEH,CAAA;AAER;AAEA,EAAW,cAAc"}
|
|
1
|
+
{"version":3,"file":"schema-form.js","names":["Text","copyRoleProps","Button","Stack","Card","compositionRhythm","Input","FormField","Textarea","ToggleField","CardCheckboxGroup","Select","SwitchCard","CardRadioGroup","TagsInput","DecimalInput","EmptyState","SCHEMA_FORM_COLUMNS","SCHEMA_FORM_FIELD_WIDTH","isFieldHidden","field","values","error","onError","isFieldDisabled","getVisibleFields","fields","resolveSchemaSections","visibleFields","schema","fieldsByKey","usedKeys","sections","section","sectionFields","key","defaultColumns","unsectioned","defaultSectionTitle","toStringValue","value","toStringArray","item","toBooleanValue","parseNumberValue","trimmed","rawValue","parsed","integer","formatJsonValue","quoteString","indent","parseJsonValue","getDefaultValues","defaultValue","shouldRequireValue","normalizeErrors","next","message","errors","useSchemaForm","externalErrors","options","isControlled","initialValues","useMemo","internalValues","setInternalValues","useState","validationErrors","setValidationErrors","invalidParsedFields","useRef","lastInvalidKeys","committedValues","currentValues","currentOptions","useLayoutEffect","mergedErrors","writeValues","useCallback","nextValues","setValues","setFieldValue","fieldValue","current","setFieldParseValidity","valid","reset","onValueChange","validate","nextErrors","invalidKeys","formatRequiredError","validators","validator","result","validationError","min","max","SchemaFormActions","cn","className","showReset","disabled","resetDisabled","submitting","onReset","resetLabel","submitDisabled","submitLabel","SchemaFormEmpty","getFieldHint","getTextDisplayValue","parseTextValue","parseNumberFieldValue","NumberFieldControl","inputProps","editing","draft","setDraft","acceptedDraft","onParseError","onFocus","event","onBlur","text","onParsedChange","parseJsonFieldValue","optionIconNode","option","Icon","JsonFieldControl","quoteParsedString","setText","parseError","setParseError","isFocused","setIsFocused","lastParse","useEffect","acceptedParse","onParseValidityChange","commit","strings","fieldId","SchemaFormFieldRenderer","fieldType","commonFieldProps","controlClassName","describedBy","checked","displayValue","decimalPlaces","inputType","nativeInputProps","defaultSchemaFormStrings","label","toDomId","FIELD_FOCUS_TARGETS","selector","focusFieldControl","wrapper","target","SectionHeading","SchemaForm","stringsProp","generatedId","useId","formId","id","useStrings","form","columns","hasFields","fieldNodes","submissionInFlight","pendingSubmission","setPendingSubmission","isSubmitting","helpers","shouldShowActions","showActions","onSubmit","actionsSlot","renderFieldNode","fieldDisabled","context","nextValue","defaultField","node","fieldClassName","renderField","renderSectionFields","renderPlainSection","custom","renderSection","sectionClassName","Fragment","renderCardSection","actions","empty","emptySlot","candidate","submittedValues","hiddenValues","layout","contentClassName","title","description","headerSlot","footerSlot"],"sources":["../../src/components/features/schema-form/schema-form.utils.ts","../../src/components/features/schema-form/hooks/use-schema-form.ts","../../src/components/features/schema-form/partials/schema-form-actions.tsx","../../src/components/features/schema-form/partials/schema-form-empty.tsx","../../src/components/features/schema-form/partials/schema-form-field.tsx","../../src/components/features/schema-form/schema-form.strings.ts","../../src/components/features/schema-form/schema-form.tsx"],"sourcesContent":["import type {\n\tResolvedSchemaFormSection,\n\tSchemaFormField,\n\tSchemaFormFieldWidth,\n\tSchemaFormSchema,\n\tSchemaFormValue,\n\tSchemaFormValues,\n} from './schema-form.types';\n\ntype SchemaFormErrorHandler = (error: unknown) => void;\n\n/*\n * Container widths, not viewport widths — a schema form is as often rendered in\n * a drawer or a side panel as at page width, and keyed to the screen it kept\n * three field columns inside a 320px drawer. 448/576 clears every width these\n * forms render at today (672-814px) while collapsing below a real drawer.\n */\nexport const SCHEMA_FORM_COLUMNS: Record<1 | 2 | 3, string> = {\n\t1: 'grid grid-cols-1 gap-space-xl',\n\t2: 'grid grid-cols-1 gap-space-xl @md/schema-form:grid-cols-2',\n\t3: 'grid grid-cols-1 gap-space-xl @md/schema-form:grid-cols-2 @xl/schema-form:grid-cols-3',\n};\n\nexport const SCHEMA_FORM_FIELD_WIDTH: Record<SchemaFormFieldWidth, string> = {\n\tauto: '',\n\thalf: '@md/schema-form:col-span-1',\n\tthird: '@xl/schema-form:col-span-1',\n\tfull: '@md/schema-form:col-span-full @xl/schema-form:col-span-full',\n};\n\nexport function isFieldHidden(\n\tfield: SchemaFormField,\n\tvalues: SchemaFormValues,\n\tonError?: SchemaFormErrorHandler,\n): boolean {\n\tif (typeof field.hidden === 'function') {\n\t\ttry {\n\t\t\treturn field.hidden(values);\n\t\t} catch (error) {\n\t\t\tonError?.(error);\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn field.hidden ?? false;\n}\n\nexport function isFieldDisabled(\n\tfield: SchemaFormField,\n\tvalues: SchemaFormValues,\n\tonError?: SchemaFormErrorHandler,\n): boolean {\n\tif (typeof field.disabled === 'function') {\n\t\ttry {\n\t\t\treturn field.disabled(values);\n\t\t} catch (error) {\n\t\t\tonError?.(error);\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn field.disabled ?? false;\n}\n\nexport function getVisibleFields(\n\tfields: SchemaFormField[],\n\tvalues: SchemaFormValues,\n\tonError?: SchemaFormErrorHandler,\n): SchemaFormField[] {\n\treturn fields.filter((field) => !isFieldHidden(field, values, onError));\n}\n\nexport function resolveSchemaSections(\n\tschema: SchemaFormSchema,\n\tvalues: SchemaFormValues,\n\tdefaultSectionTitle: string,\n\tdefaultColumns: 1 | 2 | 3,\n\tonError?: SchemaFormErrorHandler,\n): ResolvedSchemaFormSection[] {\n\tconst visibleFields = getVisibleFields(schema.fields, values, onError);\n\tconst fieldsByKey = new Map(visibleFields.map((field) => [field.key, field]));\n\tconst usedKeys = new Set<string>();\n\tconst sections: ResolvedSchemaFormSection[] = [];\n\n\tfor (const section of schema.sections ?? []) {\n\t\tconst sectionFields = section.fields\n\t\t\t? section.fields\n\t\t\t\t\t.map((key) => fieldsByKey.get(key))\n\t\t\t\t\t.filter((field): field is SchemaFormField => field !== undefined)\n\t\t\t: visibleFields.filter((field) => field.sectionId === section.id);\n\n\t\tfor (const field of sectionFields) {\n\t\t\tusedKeys.add(field.key);\n\t\t}\n\n\t\tsections.push({\n\t\t\tid: section.id,\n\t\t\ttitle: section.title,\n\t\t\tdescription: section.description,\n\t\t\ticon: section.icon,\n\t\t\tfields: sectionFields,\n\t\t\tcolumns: section.columns ?? defaultColumns,\n\t\t\tfooterSlot: section.footerSlot,\n\t\t\tclassName: section.className,\n\t\t});\n\t}\n\n\tconst unsectioned = visibleFields.filter((field) => !usedKeys.has(field.key));\n\tif (unsectioned.length > 0 || sections.length === 0) {\n\t\tsections.unshift({\n\t\t\tid: 'default',\n\t\t\ttitle: schema.sections?.length ? defaultSectionTitle : undefined,\n\t\t\tfields: unsectioned,\n\t\t\tcolumns: defaultColumns,\n\t\t});\n\t}\n\n\treturn sections.filter((section) => section.fields.length > 0);\n}\n\nexport function toStringValue(value: SchemaFormValue): string {\n\tif (value === undefined || value === null) return '';\n\tif (typeof value === 'string') return value;\n\tif (typeof value === 'number' || typeof value === 'boolean') return String(value);\n\treturn JSON.stringify(value);\n}\n\nexport function toStringArray(value: SchemaFormValue): string[] {\n\tif (!Array.isArray(value)) return [];\n\treturn value.map((item) => String(item));\n}\n\nexport function toBooleanValue(value: SchemaFormValue): boolean {\n\treturn value === true || value === 'true' || value === 1;\n}\n\nexport function parseNumberValue(rawValue: string, integer = false): number | null {\n\tconst trimmed = rawValue.trim();\n\tif (trimmed.length === 0) return null;\n\tconst parsed = integer ? Number.parseInt(trimmed, 10) : Number.parseFloat(trimmed);\n\treturn Number.isNaN(parsed) ? null : parsed;\n}\n\nexport function formatJsonValue(value: SchemaFormValue, indent = 2, quoteString = false): string {\n\tif (value === undefined || value === null) return '';\n\tif (typeof value === 'string') return quoteString ? JSON.stringify(value) : value;\n\ttry {\n\t\treturn JSON.stringify(value, null, indent);\n\t} catch {\n\t\treturn String(value);\n\t}\n}\n\nexport function parseJsonValue(rawValue: string): { value: SchemaFormValue; valid: boolean } {\n\tconst trimmed = rawValue.trim();\n\tif (trimmed.length === 0) return { value: null, valid: true };\n\n\ttry {\n\t\treturn { value: JSON.parse(trimmed) as SchemaFormValue, valid: true };\n\t} catch {\n\t\treturn { value: rawValue, valid: false };\n\t}\n}\n","import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';\n\nimport type {\n\tSchemaFormErrors,\n\tSchemaFormField,\n\tSchemaFormSubmitHelpers,\n\tSchemaFormValue,\n\tSchemaFormValues,\n} from '../schema-form.types';\nimport { isFieldHidden } from '../schema-form.utils';\n\nexport interface UseSchemaFormOptions {\n\tfields: SchemaFormField[];\n\tvalue?: SchemaFormValues;\n\tdefaultValue?: SchemaFormValues;\n\terrors?: SchemaFormErrors;\n\tonValueChange?: (values: SchemaFormValues) => void;\n\tonFieldChange?: (key: string, value: SchemaFormValue, values: SchemaFormValues) => void;\n\tformatRequiredError: (label: string) => string;\n\tvalidationError: string;\n\tonError?: (error: unknown) => void;\n}\n\nexport interface UseSchemaFormResult extends SchemaFormSubmitHelpers {\n\tvalues: SchemaFormValues;\n\terrors: SchemaFormErrors;\n\tgetFieldError: (key: string) => string | undefined;\n\tgetFieldValue: (key: string) => SchemaFormValue;\n\t/** Reads the latest values, including writes made in the current event. */\n\tgetValues: () => SchemaFormValues;\n\tsetFieldValue: (key: string, value: SchemaFormValue) => void;\n\tsetValues: (values: SchemaFormValues) => void;\n\t/** Registers a field editor's current parse validity with form validation. */\n\tsetFieldParseValidity: (key: string, valid: boolean) => void;\n\treset: () => SchemaFormValues;\n\tvalidate: () => boolean;\n\t/**\n\t * Keys the latest `validate()` call rejected, in schema order. Includes\n\t * JSON fields whose draft cannot be parsed; empty after a passing run.\n\t */\n\tgetInvalidKeys: () => string[];\n}\n\nfunction getDefaultValues(fields: SchemaFormField[], defaultValue?: SchemaFormValues): SchemaFormValues {\n\tconst values: SchemaFormValues = { ...defaultValue };\n\n\tfor (const field of fields) {\n\t\tif (field.defaultValue !== undefined && values[field.key] === undefined) {\n\t\t\tvalues[field.key] = field.defaultValue;\n\t\t}\n\t}\n\n\treturn values;\n}\n\nfunction shouldRequireValue(value: SchemaFormValue): boolean {\n\tif (value === undefined || value === null) return true;\n\tif (typeof value === 'string') return value.trim().length === 0;\n\tif (Array.isArray(value)) return value.length === 0;\n\treturn false;\n}\n\nfunction normalizeErrors(errors?: SchemaFormErrors): SchemaFormErrors {\n\tconst next: SchemaFormErrors = {};\n\tfor (const [key, message] of Object.entries(errors ?? {})) {\n\t\tif (message) next[key] = message;\n\t}\n\treturn next;\n}\n\nexport function useSchemaForm(options: UseSchemaFormOptions): UseSchemaFormResult {\n\tconst { fields, value, defaultValue, errors: externalErrors } = options;\n\tconst isControlled = value !== undefined;\n\tconst initialValues = useMemo(\n\t\t() => getDefaultValues(fields, defaultValue),\n\t\t[defaultValue, fields],\n\t);\n\tconst [internalValues, setInternalValues] = useState<SchemaFormValues>(() => initialValues);\n\tconst [validationErrors, setValidationErrors] = useState<SchemaFormErrors>({});\n\tconst invalidParsedFields = useRef(new Set<string>());\n\tconst lastInvalidKeys = useRef<string[]>([]);\n\tconst values = useMemo(\n\t\t() => (isControlled ? { ...initialValues, ...value } : internalValues),\n\t\t[initialValues, internalValues, isControlled, value],\n\t);\n\tconst committedValues = useRef(values);\n\tconst currentValues = useRef(values);\n\tconst currentOptions = useRef(options);\n\tuseLayoutEffect(() => {\n\t\tcommittedValues.current = values;\n\t\tcurrentValues.current = values;\n\t}, [values]);\n\tuseLayoutEffect(() => {\n\t\tcurrentOptions.current = options;\n\t}, [options]);\n\n\tconst mergedErrors = useMemo(\n\t\t() => ({\n\t\t\t...validationErrors,\n\t\t\t...normalizeErrors(externalErrors),\n\t\t}),\n\t\t[externalErrors, validationErrors],\n\t);\n\n\tconst writeValues = useCallback((nextValues: SchemaFormValues) => {\n\t\tcurrentValues.current = nextValues;\n\t\tif (currentOptions.current.value === undefined) {\n\t\t\tsetInternalValues(nextValues);\n\t\t\treturn;\n\t\t}\n\t\t// Compose same-event controlled proposals. Later events read the\n\t\t// committed parent value if the owner declined the proposal.\n\t\tqueueMicrotask(() => {\n\t\t\tif (currentValues.current === nextValues) currentValues.current = committedValues.current;\n\t\t});\n\t}, []);\n\n\tconst setValues = useCallback(\n\t\t(nextValues: SchemaFormValues) => {\n\t\t\twriteValues(nextValues);\n\t\t\tcurrentOptions.current.onValueChange?.(nextValues);\n\t\t},\n\t\t[writeValues],\n\t);\n\n\tconst setFieldValue = useCallback(\n\t\t(key: string, fieldValue: SchemaFormValue) => {\n\t\t\tconst nextValues = { ...currentValues.current, [key]: fieldValue };\n\t\t\twriteValues(nextValues);\n\t\t\tsetValidationErrors((current) => {\n\t\t\t\tif (!current[key]) return current;\n\t\t\t\tconst next = { ...current };\n\t\t\t\tdelete next[key];\n\t\t\t\treturn next;\n\t\t\t});\n\t\t\tcurrentOptions.current.onFieldChange?.(key, fieldValue, nextValues);\n\t\t\tcurrentOptions.current.onValueChange?.(nextValues);\n\t\t},\n\t\t[writeValues],\n\t);\n\n\tconst setFieldParseValidity = useCallback((key: string, valid: boolean) => {\n\t\tif (valid) invalidParsedFields.current.delete(key);\n\t\telse invalidParsedFields.current.add(key);\n\t}, []);\n\n\tconst reset = useCallback(() => {\n\t\tconst { fields, defaultValue, onValueChange } = currentOptions.current;\n\t\tconst nextValues = getDefaultValues(fields, defaultValue);\n\t\twriteValues(nextValues);\n\t\tinvalidParsedFields.current.clear();\n\t\tlastInvalidKeys.current = [];\n\t\tsetValidationErrors({});\n\t\tonValueChange?.(nextValues);\n\t\treturn nextValues;\n\t}, [writeValues]);\n\n\tconst validate = useCallback(() => {\n\t\tconst { fields, formatRequiredError, onError, validationError } = currentOptions.current;\n\t\tconst values = currentValues.current;\n\t\tconst nextErrors: SchemaFormErrors = {};\n\t\tconst invalidKeys: string[] = [];\n\n\t\tfor (const field of fields) {\n\t\t\tif (isFieldHidden(field, values, onError)) continue;\n\t\t\tif (field.type === 'json' && invalidParsedFields.current.has(field.key)) {\n\t\t\t\tinvalidKeys.push(field.key);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst fieldValue = values[field.key];\n\t\t\tif (field.required && shouldRequireValue(fieldValue)) {\n\t\t\t\tnextErrors[field.key] = formatRequiredError(field.label);\n\t\t\t\tinvalidKeys.push(field.key);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst validators = Array.isArray(field.validate)\n\t\t\t\t? field.validate\n\t\t\t\t: field.validate\n\t\t\t\t\t? [field.validate]\n\t\t\t\t\t: [];\n\n\t\t\tfor (const validator of validators) {\n\t\t\t\ttry {\n\t\t\t\t\tconst result = validator(fieldValue, values, field);\n\t\t\t\t\tif (typeof result === 'string' && result.length > 0) {\n\t\t\t\t\t\tnextErrors[field.key] = result;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} catch (error) {\n\t\t\t\t\tonError?.(error);\n\t\t\t\t\tnextErrors[field.key] = validationError;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!nextErrors[field.key] && typeof fieldValue === 'number' &&\n\t\t\t\t(field.type === 'number' || field.type === 'integer' || field.type === 'decimal')) {\n\t\t\t\tconst { min, max } = { min: field.min, max: field.max, ...field.numberProps };\n\t\t\t\tif ((min !== undefined && fieldValue < min) || (max !== undefined && fieldValue > max)) {\n\t\t\t\t\tnextErrors[field.key] = validationError;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (nextErrors[field.key]) invalidKeys.push(field.key);\n\t\t}\n\n\t\tlastInvalidKeys.current = invalidKeys;\n\t\tsetValidationErrors(nextErrors);\n\t\treturn invalidKeys.length === 0;\n\t}, []);\n\n\tconst getFieldError = useCallback(\n\t\t(key: string) => mergedErrors[key],\n\t\t[mergedErrors],\n\t);\n\n\tconst getFieldValue = useCallback(\n\t\t(key: string) => values[key],\n\t\t[values],\n\t);\n\tconst getValues = useCallback(() => currentValues.current, []);\n\tconst getInvalidKeys = useCallback(() => lastInvalidKeys.current, []);\n\n\treturn {\n\t\tvalues,\n\t\terrors: mergedErrors,\n\t\tgetFieldError,\n\t\tgetFieldValue,\n\t\tgetValues,\n\t\tsetFieldValue,\n\t\tsetValues,\n\t\tsetFieldParseValidity,\n\t\treset,\n\t\tvalidate,\n\t\tgetInvalidKeys,\n\t};\n}\n","import { Button } from '../../../base/buttons';\nimport { Stack } from '../../../base/structure';\nimport {compositionRhythm} from '../../../base/structure/composition.recipes';\nimport { cn } from '../../../../lib/utils';\n\nexport interface SchemaFormActionsProps {\n\t/** Copy for the submit button. */\n\tsubmitLabel: string;\n\t/** Copy for the reset button. */\n\tresetLabel: string;\n\t/** Renders the reset. */\n\tshowReset?: boolean;\n\t/** Renders the entry as unselectable. */\n\tdisabled?: boolean;\n\t/** Disables the submit button. */\n\tsubmitDisabled?: boolean;\n\t/** Disables the reset button. */\n\tresetDisabled?: boolean;\n\t/** Shows the pending state on submit. */\n\tsubmitting?: boolean;\n\tonReset?: () => void;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n}\n\nexport function SchemaFormActions({\n\tsubmitLabel,\n\tresetLabel,\n\tshowReset = false,\n\tdisabled = false,\n\tsubmitDisabled = false,\n\tresetDisabled = false,\n\tsubmitting = false,\n\tonReset,\n\tclassName,\n}: SchemaFormActionsProps) {\n\treturn (\n\t\t<Stack direction=\"horizontal\" align=\"center\" justify=\"end\" gap={compositionRhythm.commands} className={cn('schema-form-actions--component', className)}>\n\t\t\t{!!showReset && (\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\tdisabled={disabled || resetDisabled || submitting}\n\t\t\t\t\tonClick={onReset}\n\t\t\t\t>\n\t\t\t\t\t{resetLabel}\n\t\t\t\t</Button>\n\t\t\t)}\n\t\t\t<Button\n\t\t\t\ttype=\"submit\"\n\t\t\t\ttone=\"primary\"\n\t\t\t\tloading={submitting}\n\t\t\t\tdisabled={disabled || submitDisabled}\n\t\t\t>\n\t\t\t\t{submitLabel}\n\t\t\t</Button>\n\t\t</Stack>\n\t);\n}\n\nSchemaFormActions.displayName = 'SchemaFormActions';\n","import { EmptyState } from '../../../blocks/data-display';\nimport { cn } from '../../../../lib/utils';\n\nexport interface SchemaFormEmptyProps {\n\t/** Surface title. */\n\ttitle: string;\n\t/** Supporting copy shown under the label. */\n\tdescription: string;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n}\n\nexport function SchemaFormEmpty({ title, description, className }: SchemaFormEmptyProps) {\n\treturn (\n\t\t<EmptyState\n\t\t\ttitle={title}\n\t\t\tdescription={description}\n\t\t\tpadding=\"md\"\n\t\t\tsurface=\"wash\"\n\t\t\tclassName={cn('schema-form-empty--component', className)}\n\t\t/>\n\t);\n}\n\nSchemaFormEmpty.displayName = 'SchemaFormEmpty';\n","import { useEffect, useRef, useState, type ElementType } from 'react';\n\nimport { CardCheckboxGroup, CardRadioGroup, Select, SwitchCard, ToggleField } from '../../../base/choice-inputs';\nimport { FormField } from '../../../base/forms';\nimport { Input, Textarea } from '../../../base/text-inputs';\nimport { TagsInput } from '../../../base/value-inputs';\nimport { DecimalInput, type DecimalInputProps } from '../../../base/forms-numeric';\nimport { cn } from '../../../../lib/utils';\n\nimport type { SchemaFormStrings } from '../schema-form.strings';\nimport type {\n\tSchemaFormField,\n\tSchemaFormFieldContext,\n\tSchemaFormNumberField,\n\tSchemaFormValue,\n\tSchemaFormValues,\n} from '../schema-form.types';\nimport {\n\tformatJsonValue,\n\tparseJsonValue,\n\tparseNumberValue,\n\ttoBooleanValue,\n\ttoStringArray,\n\ttoStringValue,\n} from '../schema-form.utils';\n\nexport interface SchemaFormFieldRendererProps extends SchemaFormFieldContext {\n\t/** Overrides this surface's own copy. */\n\tstrings: SchemaFormStrings;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n\t/** Reports whether the JSON editor can parse its current draft. */\n\tonParseValidityChange?: (key: string, valid: boolean) => void;\n}\n\nfunction getFieldHint(field: SchemaFormField): string | undefined {\n\treturn field.hint ?? field.description;\n}\n\nfunction getTextDisplayValue(\n\tfield: SchemaFormField,\n\tvalue: SchemaFormValue,\n\tvalues: SchemaFormValues,\n\tonError?: (error: unknown) => void,\n): string {\n\tif (field.formatValue) {\n\t\ttry {\n\t\t\treturn field.formatValue(value, values);\n\t\t} catch (error) {\n\t\t\tonError?.(error);\n\t\t}\n\t}\n\treturn toStringValue(value);\n}\n\nfunction parseTextValue(\n\tfield: SchemaFormField,\n\trawValue: string,\n\tvalues: SchemaFormValues,\n\tonError?: (error: unknown) => void,\n): SchemaFormValue {\n\tif (field.parseValue) {\n\t\ttry {\n\t\t\treturn field.parseValue(rawValue, values);\n\t\t} catch (error) {\n\t\t\tonError?.(error);\n\t\t}\n\t}\n\treturn rawValue;\n}\n\nfunction parseNumberFieldValue(\n\tfield: SchemaFormField,\n\trawValue: string,\n\tvalues: SchemaFormValues,\n\tinteger: boolean,\n\tonError?: (error: unknown) => void,\n): SchemaFormValue {\n\tif (field.parseValue) {\n\t\ttry {\n\t\t\treturn field.parseValue(rawValue, values);\n\t\t} catch (error) {\n\t\t\tonError?.(error);\n\t\t}\n\t}\n\treturn parseNumberValue(rawValue, integer);\n}\n\nfunction NumberFieldControl({\n\tfield,\n\tvalue,\n\tvalues,\n\tonParsedChange,\n\tonParseError,\n\tonFocus,\n\tonBlur,\n\t...inputProps\n}: Pick<SchemaFormFieldContext, 'value' | 'values'>\n\t& {\n\t\tfield: SchemaFormNumberField;\n\t\tonParsedChange: SchemaFormFieldContext['onValueChange'];\n\t\tonParseError?: SchemaFormFieldContext['onError'];\n\t}\n\t& Omit<DecimalInputProps, 'value' | 'defaultValue' | 'onChange'>) {\n\tconst editing = useRef(false);\n\tconst [draft, setDraft] = useState<{ text: string; value: SchemaFormValue } | null>(null);\n\t// A parent can accept the parsed value or replace it. Only an accepted edit\n\t// can keep intermediate text such as \"1.\" or \"0.0\" in the field.\n\tconst acceptedDraft = draft && Object.is(draft.value, value) ? draft : null;\n\tif (draft && !acceptedDraft) setDraft(null);\n\n\treturn (\n\t\t<DecimalInput\n\t\t\t{...inputProps}\n\t\t\tvalue={acceptedDraft?.text ?? getTextDisplayValue(field, value, values, onParseError)}\n\t\t\tonFocus={(event) => {\n\t\t\t\tediting.current = true;\n\t\t\t\tonFocus?.(event);\n\t\t\t}}\n\t\t\tonBlur={(event) => {\n\t\t\t\tediting.current = false;\n\t\t\t\tsetDraft(null);\n\t\t\t\tonBlur?.(event);\n\t\t\t}}\n\t\t\tonChange={(event) => {\n\t\t\t\tconst text = event.target.value;\n\t\t\t\tconst next = parseNumberFieldValue(field, text, values, field.type === 'integer', onParseError);\n\t\t\t\tif (editing.current) setDraft({ text, value: next });\n\t\t\t\tonParsedChange(next);\n\t\t\t}}\n\t\t/>\n\t);\n}\n\nfunction parseJsonFieldValue(\n\tfield: SchemaFormField,\n\trawValue: string,\n\tvalues: SchemaFormValues,\n\tonError?: (error: unknown) => void,\n): { value: SchemaFormValue; valid: boolean } {\n\tif (field.type === 'json' && field.parseValue) {\n\t\ttry {\n\t\t\treturn { value: field.parseValue(rawValue, values), valid: true };\n\t\t} catch (error) {\n\t\t\tonError?.(error);\n\t\t\treturn { value: rawValue, valid: false };\n\t\t}\n\t}\n\treturn parseJsonValue(rawValue);\n}\n\nfunction optionIconNode(option: { icon?: ElementType }) {\n\tif (!option.icon) return undefined;\n\tconst Icon = option.icon;\n\treturn <Icon className=\"size-icon\" aria-hidden=\"true\" />;\n}\n\nfunction JsonFieldControl({\n\tfield,\n\tvalue,\n\tvalues,\n\terror,\n\tdisabled,\n\tfieldId,\n\tonValueChange,\n\tonError,\n\tstrings,\n\tonParseValidityChange,\n}: SchemaFormFieldRendererProps) {\n\tconst indent = field.type === 'json' ? field.jsonIndent ?? 2 : 2;\n\tconst quoteParsedString = !field.parseValue;\n\tconst [text, setText] = useState(() => formatJsonValue(value, indent));\n\tconst [parseError, setParseError] = useState<string | undefined>();\n\tconst [isFocused, setIsFocused] = useState(false);\n\tconst lastParse = useRef<ReturnType<typeof parseJsonFieldValue> | null>(null);\n\n\tuseEffect(() => {\n\t\tif (isFocused) return;\n\t\tconst acceptedParse = lastParse.current && Object.is(lastParse.current.value, value) ? lastParse.current : null;\n\t\tsetText(formatJsonValue(value, indent, quoteParsedString && !!acceptedParse?.valid));\n\t\tif (!acceptedParse && lastParse.current) {\n\t\t\tlastParse.current = null;\n\t\t\tsetParseError(undefined);\n\t\t\tonParseValidityChange?.(field.key, true);\n\t\t}\n\t}, [field.key, indent, isFocused, onParseValidityChange, quoteParsedString, value]);\n\n\tuseEffect(() => () => onParseValidityChange?.(field.key, true), [field.key, onParseValidityChange]);\n\n\tif (field.type !== 'json') return null;\n\n\tconst commit = (rawValue: string) => {\n\t\tconst parsed = parseJsonFieldValue(field, rawValue, values, onError);\n\t\tlastParse.current = parsed;\n\t\tsetParseError(parsed.valid ? undefined : strings.jsonParseError);\n\t\tonParseValidityChange?.(field.key, parsed.valid);\n\t\tonValueChange(parsed.value);\n\t\treturn parsed;\n\t};\n\n\treturn (\n\t\t<FormField\n\t\t\tlabel={field.label}\n\t\t\trequired={field.required}\n\t\t\thint={getFieldHint(field)}\n\t\t\thelperText={field.helperText}\n\t\t\terror={error ?? parseError}\n\t\t\thtmlFor={fieldId}\n\t\t\tsupportingTextId={`${fieldId}-supporting`}\n\t\t\tclassName=\"schema-form-field--component schema-form-field--json\"\n\t\t>\n\t\t\t<Textarea\n\t\t\t\tid={fieldId}\n\t\t\t\tname={field.key}\n\t\t\t\tvalue={text}\n\t\t\t\trows={field.rows ?? 6}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tinvalid={Boolean(error ?? parseError)}\n\t\t\t\tplaceholder={field.placeholder}\n\t\t\t\tspellCheck={false}\n\t\t\t\tclassName={cn('font-mono', field.controlClassName)}\n\t\t\t\tonFocus={() => setIsFocused(true)}\n\t\t\t\tonChange={(event) => {\n\t\t\t\t\tconst next = event.target.value;\n\t\t\t\t\tsetText(next);\n\t\t\t\t\tcommit(next);\n\t\t\t\t}}\n\t\t\t\tonBlur={() => {\n\t\t\t\t\tsetIsFocused(false);\n\t\t\t\t\tconst parsed = commit(text);\n\t\t\t\t\tif (parsed.valid) setText(formatJsonValue(parsed.value, indent, quoteParsedString));\n\t\t\t\t}}\n\t\t\t\t{...field.textareaProps}\n\t\t\t\t\taria-describedby={[field.textareaProps?.['aria-describedby'], error || parseError || field.helperText || getFieldHint(field) ? `${fieldId}-supporting` : undefined].filter(Boolean).join(' ') || undefined}\n\t\t\t/>\n\t\t</FormField>\n\t);\n}\n\nexport function SchemaFormFieldRenderer({\n\tfield,\n\tvalue,\n\tvalues,\n\terror,\n\tdisabled,\n\trequired,\n\tfieldId,\n\tonValueChange,\n\tonError,\n\tstrings,\n\tclassName,\n\tonParseValidityChange,\n}: SchemaFormFieldRendererProps) {\n\tconst fieldType = field.type ?? 'text';\n\tconst commonFieldProps = {\n\t\tlabel: field.label,\n\t\trequired,\n\t\thint: getFieldHint(field),\n\t\thelperText: field.helperText,\n\t\terror,\n\t\thtmlFor: fieldId,\n\t\tsupportingTextId: `${fieldId}-supporting`,\n\t\tclassName: cn('schema-form-field--component', className),\n\t};\n\n\tconst controlClassName = field.controlClassName;\n\tconst describedBy = error || field.helperText || getFieldHint(field) ? `${fieldId}-supporting` : undefined;\n\n\tif (fieldType === 'custom' && field.type === 'custom') {\n\t\treturn (\n\t\t\t<div className={cn('schema-form-field--component schema-form-field--custom', className)}>\n\t\t\t\t{field.render({ field, value, values, error, disabled, required, fieldId, onValueChange, onError })}\n\t\t\t</div>\n\t\t);\n\t}\n\n\tif (fieldType === 'switch' && field.type === 'switch') {\n\t\tconst checked = toBooleanValue(value);\n\t\tif (field.switchStyle === 'card') {\n\t\t\treturn (\n\t\t\t\t<FormField error={error} supportingTextId={`${fieldId}-supporting`} className={cn('schema-form-field--component schema-form-field--switch-card', className)}>\n\t\t\t\t\t<SwitchCard\n\t\t\t\t\tlabel={field.label}\n\t\t\t\t\t\tdescription={field.description}\n\t\t\t\t\t\thint={field.hint}\n\t\t\t\t\t\tname={field.key}\n\t\t\t\t\t\tvalue={checked}\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\tinvalid={Boolean(error)}\n\t\t\t\t\t\tclassName={controlClassName}\n\t\t\t\t\t\tonValueChange={(next) => onValueChange(next)}\n\t\t\t\t\t\t{...field.switchCardProps}\n\t\t\t\t\taria-describedby={[field.switchCardProps?.['aria-describedby'], error ? `${fieldId}-supporting` : undefined].filter(Boolean).join(' ') || undefined}\n\t\t\t\t\t/>\n\t\t\t\t</FormField>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<FormField error={error} supportingTextId={`${fieldId}-supporting`} className={cn('schema-form-field--component schema-form-field--switch', className)}>\n\t\t\t\t<ToggleField\n\t\t\t\t\tlabel={field.label}\n\t\t\t\t\tdescription={field.description ?? field.hint}\n\t\t\t\t\tname={field.key}\n\t\t\t\t\tvalue={checked}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tinvalid={Boolean(error)}\n\t\t\t\t\tclassName={controlClassName}\n\t\t\t\t\tonValueChange={(next) => onValueChange(next)}\n\t\t\t\t\t{...field.switchProps}\n\t\t\t\t\taria-describedby={[field.switchProps?.['aria-describedby'], error ? `${fieldId}-supporting` : undefined].filter(Boolean).join(' ') || undefined}\n\t\t\t\t/>\n\t\t\t</FormField>\n\t\t);\n\t}\n\n\tif (fieldType === 'json') {\n\t\treturn (\n\t\t\t<JsonFieldControl\n\t\t\t\tfield={field}\n\t\t\t\tvalue={value}\n\t\t\t\tvalues={values}\n\t\t\t\terror={error}\n\t\t\t\tdisabled={disabled}\n\t\t\t\trequired={required}\n\t\t\t\tfieldId={fieldId}\n\t\t\t\tonValueChange={onValueChange}\n\t\t\t\tonError={onError}\n\t\t\t\tstrings={strings}\n\t\t\t\tonParseValidityChange={onParseValidityChange}\n\t\t\t/>\n\t\t);\n\t}\n\n\tif (fieldType === 'textarea' && field.type === 'textarea') {\n\t\tconst displayValue = getTextDisplayValue(field, value, values, onError);\n\t\treturn (\n\t\t\t<FormField {...commonFieldProps}>\n\t\t\t\t<Textarea\n\t\t\t\t\taria-describedby={describedBy}\n\t\t\t\t\tid={fieldId}\n\t\t\t\t\tname={field.key}\n\t\t\t\t\tvalue={displayValue}\n\t\t\t\t\trows={field.rows}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\trequired={required}\n\t\t\t\t\tinvalid={Boolean(error)}\n\t\t\t\t\tplaceholder={field.placeholder}\n\t\t\t\t\tclassName={controlClassName}\n\t\t\t\t\tonChange={(event) => onValueChange(parseTextValue(field, event.target.value, values, onError))}\n\t\t\t\t\t{...field.textareaProps}\n\t\t\t\t/>\n\t\t\t</FormField>\n\t\t);\n\t}\n\n\tif ((fieldType === 'number' || fieldType === 'integer' || fieldType === 'decimal') && (\n\t\tfield.type === 'number' || field.type === 'integer' || field.type === 'decimal'\n\t)) {\n\t\tconst integer = field.type === 'integer';\n\t\tconst decimalPlaces = integer ? 0 : field.decimalPlaces ?? (field.type === 'decimal' ? 2 : 4);\n\t\treturn (\n\t\t\t<FormField {...commonFieldProps}>\n\t\t\t\t<NumberFieldControl\n\t\t\t\t\tfield={field}\n\t\t\t\t\tvalue={value}\n\t\t\t\t\tvalues={values}\n\t\t\t\t\tonParsedChange={onValueChange}\n\t\t\t\t\tonParseError={onError}\n\t\t\t\t\tid={fieldId}\n\t\t\t\t\tname={field.key}\n\t\t\t\t\tmin={field.min}\n\t\t\t\t\tmax={field.max}\n\t\t\t\t\tstep={field.step}\n\t\t\t\t\tdecimalPlaces={decimalPlaces}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\trequired={required}\n\t\t\t\t\tinvalid={Boolean(error)}\n\t\t\t\t\tplaceholder={field.placeholder}\n\t\t\t\t\tclassName={controlClassName}\n\t\t\t\t\t{...field.numberProps}\n\t\t\t\t\taria-describedby={[field.numberProps?.['aria-describedby'], describedBy].filter(Boolean).join(' ') || undefined}\n\t\t\t\t/>\n\t\t\t</FormField>\n\t\t);\n\t}\n\n\tif (fieldType === 'select' && field.type === 'select') {\n\t\tconst options = field.options.map((option) => ({\n\t\t\tvalue: option.value,\n\t\t\tlabel: option.label,\n\t\t\tdisabled: option.disabled,\n\t\t\ticon: optionIconNode(option),\n\t\t}));\n\n\t\treturn (\n\t\t\t<FormField {...commonFieldProps}>\n\t\t\t\t<Select\n\t\t\t\t\tname={field.key}\n\t\t\t\t\tvalue={toStringValue(value)}\n\t\t\t\t\toptions={options}\n\t\t\t\t\tallowClear={field.allowClear}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\trequired={required}\n\t\t\t\t\tinvalid={Boolean(error)}\n\t\t\t\t\tplaceholder={field.placeholder}\n\t\t\t\t\taria-label={field.label}\n\t\t\t\t\tclassName={controlClassName}\n\t\t\t\t\tonValueChange={(next) => onValueChange(next ?? null)}\n\t\t\t\t\t{...field.selectProps}\n\t\t\t\t\taria-describedby={[field.selectProps?.['aria-describedby'], describedBy].filter(Boolean).join(' ') || undefined}\n\t\t\t\t/>\n\t\t\t</FormField>\n\t\t);\n\t}\n\n\tif (fieldType === 'radio-cards' && field.type === 'radio-cards') {\n\t\treturn (\n\t\t\t<FormField {...commonFieldProps}>\n\t\t\t\t<CardRadioGroup\n\t\t\t\t\tname={field.key}\n\t\t\t\t\tvalue={toStringValue(value)}\n\t\t\t\t\toptions={field.options}\n\t\t\t\t\tcolumns={field.columns}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tinvalid={Boolean(error)}\n\t\t\t\t\tclassName={controlClassName}\n\t\t\t\t\tonValueChange={(next) => onValueChange(next)}\n\t\t\t\t\t{...field.radioProps}\n\t\t\t\t\taria-describedby={[field.radioProps?.['aria-describedby'], describedBy].filter(Boolean).join(' ') || undefined}\n\t\t\t\t/>\n\t\t\t</FormField>\n\t\t);\n\t}\n\n\tif (fieldType === 'checkbox-cards' && field.type === 'checkbox-cards') {\n\t\treturn (\n\t\t\t<FormField {...commonFieldProps}>\n\t\t\t\t<CardCheckboxGroup\n\t\t\t\t\tname={field.key}\n\t\t\t\t\tvalue={toStringArray(value)}\n\t\t\t\t\toptions={field.options}\n\t\t\t\t\tcolumns={field.columns}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tinvalid={Boolean(error)}\n\t\t\t\t\tclassName={controlClassName}\n\t\t\t\t\tonValueChange={(next) => onValueChange(next)}\n\t\t\t\t\t{...field.checkboxProps}\n\t\t\t\t\taria-describedby={[field.checkboxProps?.['aria-describedby'], describedBy].filter(Boolean).join(' ') || undefined}\n\t\t\t\t/>\n\t\t\t</FormField>\n\t\t);\n\t}\n\n\tif (fieldType === 'tags' && field.type === 'tags') {\n\t\treturn (\n\t\t\t<FormField {...commonFieldProps}>\n\t\t\t\t<TagsInput\n\t\t\t\t\tid={fieldId}\n\t\t\t\t\tvalue={toStringArray(value)}\n\t\t\t\t\trecommendations={field.recommendations}\n\t\t\t\t\tmaxTags={field.maxTags}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tinvalid={Boolean(error)}\n\t\t\t\t\tplaceholder={field.placeholder}\n\t\t\t\t\tclassName={controlClassName}\n\t\t\t\t\tonValueChange={(next) => onValueChange(next)}\n\t\t\t\t\t{...field.tagsProps}\n\t\t\t\t\taria-describedby={[field.tagsProps?.['aria-describedby'], describedBy].filter(Boolean).join(' ') || undefined}\n\t\t\t\t/>\n\t\t\t</FormField>\n\t\t);\n\t}\n\n\tconst inputType = fieldType === 'text' ? 'text' : fieldType;\n\tconst nativeInputProps = field.type === undefined || field.type === 'text' || field.type === 'email' || field.type === 'password' || field.type === 'url' || field.type === 'tel' || field.type === 'search' ? field.inputProps : undefined;\n\tconst displayValue = getTextDisplayValue(field, value, values, onError);\n\n\treturn (\n\t\t<FormField {...commonFieldProps}>\n\t\t\t<Input\n\t\t\t\tid={fieldId}\n\t\t\t\tname={field.key}\n\t\t\t\ttype={inputType}\n\t\t\t\tvalue={displayValue}\n\t\t\t\tdisabled={disabled}\n\t\t\t\trequired={required}\n\t\t\t\tinvalid={Boolean(error)}\n\t\t\t\tplaceholder={field.placeholder}\n\t\t\t\tclassName={controlClassName}\n\t\t\t\tonChange={(event) => onValueChange(parseTextValue(field, event.target.value, values, onError))}\n\t\t\t\t{...nativeInputProps}\n\t\t\t\taria-describedby={[nativeInputProps?.['aria-describedby'], describedBy].filter(Boolean).join(' ') || undefined}\n\t\t\t/>\n\t\t</FormField>\n\t);\n}\n\nSchemaFormFieldRenderer.displayName = 'SchemaFormFieldRenderer';\n","export interface SchemaFormStrings {\n\tsubmitLabel: string;\n\tresetLabel: string;\n\tdefaultSectionTitle: string;\n\temptyTitle: string;\n\temptyDescription: string;\n\tjsonParseError: string;\n\tvalidationError: string;\n\tformatRequiredError: (label: string) => string;\n}\n\nexport const defaultSchemaFormStrings: SchemaFormStrings = {\n\tsubmitLabel: 'Save changes',\n\tresetLabel: 'Reset',\n\tdefaultSectionTitle: 'General',\n\temptyTitle: 'No fields configured',\n\temptyDescription: 'Add fields to the schema to render a form.',\n\tjsonParseError: 'Enter valid JSON.',\n\tvalidationError: 'Invalid value.',\n\tformatRequiredError: (label) => `${label} is required.`,\n};\n","import { Fragment, useId, useMemo, useRef, useState } from 'react';\n\nimport { Card } from '../../base/cards';\nimport { Stack } from '../../base/structure';\nimport {compositionRhythm} from '../../base/structure/composition.recipes';\nimport { Text } from '../../typography';\nimport {copyRoleProps} from '../../typography/text.styles';\nimport { useStrings } from '../../../lib/strings';\nimport { cn } from '../../../lib/utils';\n\nimport { useSchemaForm } from './hooks';\nimport {\n\tSchemaFormActions,\n\tSchemaFormEmpty,\n\tSchemaFormFieldRenderer,\n} from './partials';\nimport {\n\tdefaultSchemaFormStrings,\n\ttype SchemaFormStrings,\n} from './schema-form.strings';\nimport type {\n\tResolvedSchemaFormSection,\n\tSchemaFormField,\n\tSchemaFormFieldContext,\n\tSchemaFormProps,\n\tSchemaFormSubmitHelpers,\n} from './schema-form.types';\nimport {\n\tSCHEMA_FORM_COLUMNS,\n\tSCHEMA_FORM_FIELD_WIDTH,\n\tisFieldDisabled,\n\tisFieldHidden,\n\tresolveSchemaSections,\n} from './schema-form.utils';\n\nfunction toDomId(value: string): string {\n\treturn value.replace(/[^a-zA-Z0-9_-]/g, '-');\n}\n\n/** Controls a keyboard user can reach, excluding the hidden inputs that carry a composite's form value. */\nconst FIELD_FOCUS_TARGETS = [\n\t'input:not([type=\"hidden\"])',\n\t'textarea',\n\t'select',\n\t'button',\n\t'[tabindex]',\n].map((selector) => `${selector}:not([disabled]):not([tabindex=\"-1\"]):not([aria-hidden=\"true\"])`).join(', ');\n\nfunction focusFieldControl(wrapper: HTMLElement | undefined, fieldId: string): boolean {\n\tif (!wrapper) return false;\n\tconst target = wrapper.querySelector<HTMLElement>(`[id=\"${fieldId}\"]`)\n\t\t?? wrapper.querySelector<HTMLElement>(FIELD_FOCUS_TARGETS);\n\tif (!target) return false;\n\ttarget.focus();\n\treturn true;\n}\n\nfunction SectionHeading({ section }: { section: ResolvedSchemaFormSection }) {\n\tif (!section.title && !section.description) return null;\n\n\treturn (\n\t\t<Stack gap=\"normal\" className=\"schema-form--section-heading\">\n\t\t\t{!!section.title && (\n\t\t\t\t<Text {...copyRoleProps.subsection} className=\"schema-form--section-title\">\n\t\t\t\t\t{section.title}\n\t\t\t\t</Text>\n\t\t\t)}\n\t\t\t{!!section.description && (\n\t\t\t\t<Text {...copyRoleProps.structuralDescription} className=\"schema-form--section-description\">\n\t\t\t\t\t{section.description}\n\t\t\t\t</Text>\n\t\t\t)}\n\t\t</Stack>\n\t);\n}\n\nexport function SchemaForm({\n\tschema,\n\tvalue,\n\tdefaultValue,\n\terrors,\n\tdisabled = false,\n\tlayout = 'form',\n\tcolumns = 2,\n\tid,\n\tname,\n\ttitle,\n\tdescription,\n\theaderSlot,\n\tfooterSlot,\n\tactionsSlot,\n\temptySlot,\n\tshowActions,\n\tsubmitDisabled = false,\n\tresetDisabled = false,\n\tsubmitting,\n\thiddenValues = 'keep',\n\tonValueChange,\n\tonFieldChange,\n\tonSubmit,\n\tonReset,\n\tonError,\n\trenderField,\n\trenderSection,\n\tstrings: stringsProp,\n\tclassName,\n\tcontentClassName,\n\tsectionClassName,\n\tfieldClassName,\n}: SchemaFormProps) {\n\tconst generatedId = useId();\n\tconst formId = id ?? `schema-form-${generatedId}`;\n\tconst strings: SchemaFormStrings = useStrings(defaultSchemaFormStrings, stringsProp);\n\tconst form = useSchemaForm({\n\t\tfields: schema.fields,\n\t\tvalue,\n\t\tdefaultValue,\n\t\terrors,\n\t\tonValueChange,\n\t\tonFieldChange,\n\t\tformatRequiredError: strings.formatRequiredError,\n\t\tvalidationError: strings.validationError,\n\t\tonError,\n\t});\n\n\tconst sections = useMemo(\n\t\t() => resolveSchemaSections(schema, form.values, strings.defaultSectionTitle, columns, onError),\n\t\t[columns, form.values, onError, schema, strings.defaultSectionTitle],\n\t);\n\tconst hasFields = sections.some((section) => section.fields.length > 0);\n\tconst fieldNodes = useRef(new Map<string, HTMLElement>());\n\t// The ref blocks re-entry in the same tick; the state drives the button.\n\tconst submissionInFlight = useRef(false);\n\tconst [pendingSubmission, setPendingSubmission] = useState(false);\n\tconst isSubmitting = submitting ?? pendingSubmission;\n\n\tconst helpers: SchemaFormSubmitHelpers = {\n\t\tsetFieldValue: form.setFieldValue,\n\t\tsetValues: form.setValues,\n\t\treset: form.reset,\n\t\tvalidate: form.validate,\n\t};\n\n\tconst shouldShowActions = showActions ?? Boolean(onSubmit || onReset || actionsSlot);\n\n\tconst renderFieldNode = (field: SchemaFormField) => {\n\t\tconst fieldId = `${formId}-${toDomId(field.key)}`;\n\t\tconst fieldDisabled = disabled || isFieldDisabled(field, form.values, onError);\n\t\tconst context: SchemaFormFieldContext = {\n\t\t\tfield,\n\t\t\tvalue: form.getFieldValue(field.key),\n\t\t\tvalues: form.values,\n\t\t\terror: form.getFieldError(field.key),\n\t\t\tdisabled: fieldDisabled,\n\t\t\trequired: Boolean(field.required),\n\t\t\tfieldId,\n\t\t\tonValueChange: (nextValue) => form.setFieldValue(field.key, nextValue),\n\t\t\tonError,\n\t\t};\n\t\tconst defaultField = (\n\t\t\t<SchemaFormFieldRenderer\n\t\t\t\t{...context}\n\t\t\t\tstrings={strings}\n\t\t\t\tonParseValidityChange={form.setFieldParseValidity}\n\t\t\t/>\n\t\t);\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tkey={field.key}\n\t\t\t\tref={(node) => {\n\t\t\t\t\tif (node) fieldNodes.current.set(field.key, node);\n\t\t\t\t\telse fieldNodes.current.delete(field.key);\n\t\t\t\t}}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'schema-form--field',\n\t\t\t\t\tSCHEMA_FORM_FIELD_WIDTH[field.width ?? 'auto'],\n\t\t\t\t\tfield.className,\n\t\t\t\t\tfieldClassName,\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{renderField?.({ ...context, defaultField }) ?? defaultField}\n\t\t\t</div>\n\t\t);\n\t};\n\n\tconst renderSectionFields = (section: ResolvedSchemaFormSection) => (\n\t\t<div className={cn('schema-form--section-fields', SCHEMA_FORM_COLUMNS[section.columns])}>\n\t\t\t{section.fields.map(renderFieldNode)}\n\t\t</div>\n\t);\n\n\tconst renderPlainSection = (section: ResolvedSchemaFormSection) => {\n\t\tconst fields = renderSectionFields(section);\n\t\tconst custom = renderSection?.({ section, fields, values: form.values });\n\t\tif (custom !== undefined && custom !== null) {\n\t\t\treturn <Fragment key={section.id}>{custom}</Fragment>;\n\t\t}\n\n\t\treturn (\n\t\t\t<Stack\n\t\t\t\tkey={section.id}\n\t\t\t\trender={<section />}\n\t\t\t\tgap=\"lg\"\n\t\t\t\tclassName={cn('schema-form--section', section.className, sectionClassName)}\n\t\t\t>\n\t\t\t\t<SectionHeading section={section} />\n\t\t\t\t{fields}\n\t\t\t\t{!!section.footerSlot && (\n\t\t\t\t\t<div className=\"schema-form--section-footer\">\n\t\t\t\t\t\t{section.footerSlot}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</Stack>\n\t\t);\n\t};\n\n\tconst renderCardSection = (section: ResolvedSchemaFormSection) => {\n\t\tconst fields = renderSectionFields(section);\n\t\tconst custom = renderSection?.({ section, fields, values: form.values });\n\t\tif (custom !== undefined && custom !== null) {\n\t\t\treturn <Fragment key={section.id}>{custom}</Fragment>;\n\t\t}\n\n\t\treturn (\n\t\t\t<Card\n\t\t\t\tkey={section.id}\n\t\t\t\tsurface=\"flat\"\n\t\t\t\tpadding=\"none\"\n\t\t\t\t// Sections were drawn through the ContentBlock adapter. Its hooks stay\n\t\t\t\t// on the same nodes for consumer selectors written against them.\n\t\t\t\tdata-component=\"content-block\"\n\t\t\t\tdata-slot=\"content-block\"\n\t\t\t\tclassName={cn('content-block--component schema-form--section-card', section.className, sectionClassName)}\n\t\t\t\theaderClassName=\"content-block--header\"\n\t\t\t\tcontentClassName=\"content-block--content\"\n\t\t\t\tfooterClassName=\"content-block--footer\"\n\t\t\t\ticon={section.icon}\n\t\t\t\ttitle={section.title}\n\t\t\t\tdescription={section.description}\n\t\t\t\tfooterSlot={section.footerSlot}\n\t\t\t>\n\t\t\t\t{fields}\n\t\t\t</Card>\n\t\t);\n\t};\n\n\tconst actions = actionsSlot ?? (\n\t\tshouldShowActions ? (\n\t\t\t<SchemaFormActions\n\t\t\t\tsubmitLabel={strings.submitLabel}\n\t\t\t\tresetLabel={strings.resetLabel}\n\t\t\t\tshowReset={Boolean(onReset)}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tsubmitDisabled={submitDisabled}\n\t\t\t\tresetDisabled={resetDisabled}\n\t\t\t\tsubmitting={isSubmitting}\n\t\t\t\tonReset={() => {\n\t\t\t\t\tconst nextValues = form.reset();\n\t\t\t\t\tonReset?.(nextValues, helpers);\n\t\t\t\t}}\n\t\t\t/>\n\t\t) : null\n\t);\n\n\tconst empty = emptySlot ?? (\n\t\t<SchemaFormEmpty\n\t\t\ttitle={strings.emptyTitle}\n\t\t\tdescription={strings.emptyDescription}\n\t\t/>\n\t);\n\n\treturn (\n\t\t<form\n\t\t\tid={formId}\n\t\t\tname={name}\n\t\t\tnoValidate\n\t\t\tclassName={cn('schema-form--component @container/schema-form', className)}\n\t\t\tonSubmit={async (event) => {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif (disabled || submitDisabled || submitting || submissionInFlight.current) return;\n\t\t\t\tconst currentValues = form.getValues();\n\t\t\t\tconst valid = form.validate();\n\t\t\t\tif (!valid) {\n\t\t\t\t\tconst invalidKeys = new Set(form.getInvalidKeys());\n\t\t\t\t\t// Rendered order, so focus lands on the first error a reader meets.\n\t\t\t\t\tfor (const section of sections) {\n\t\t\t\t\t\tconst field = section.fields.find((candidate) => invalidKeys.has(candidate.key));\n\t\t\t\t\t\tif (!field) continue;\n\t\t\t\t\t\tfocusFieldControl(fieldNodes.current.get(field.key), `${formId}-${toDomId(field.key)}`);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (!onSubmit) return;\n\t\t\t\tlet submittedValues = currentValues;\n\t\t\t\tif (hiddenValues === 'omit') {\n\t\t\t\t\tsubmittedValues = { ...currentValues };\n\t\t\t\t\tfor (const field of schema.fields) {\n\t\t\t\t\t\tif (isFieldHidden(field, currentValues, onError)) delete submittedValues[field.key];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tlet result: void | Promise<void>;\n\t\t\t\ttry {\n\t\t\t\t\tresult = onSubmit(submittedValues, helpers, event);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tonError?.(error);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t// A synchronous handler never shows a pending state.\n\t\t\t\tif (!result || typeof result.then !== 'function') return;\n\t\t\t\tsubmissionInFlight.current = true;\n\t\t\t\tsetPendingSubmission(true);\n\t\t\t\ttry {\n\t\t\t\t\tawait result;\n\t\t\t\t} catch (error) {\n\t\t\t\t\tonError?.(error);\n\t\t\t\t} finally {\n\t\t\t\t\tsubmissionInFlight.current = false;\n\t\t\t\t\tsetPendingSubmission(false);\n\t\t\t\t}\n\t\t\t}}\n\t\t>\n\t\t\t{layout === 'cards' ? (\n\t\t\t\t<Stack gap={compositionRhythm.subjects} className={cn('schema-form--cards', contentClassName)}>\n\t\t\t\t\t{!!(title ?? schema.title ?? description ?? schema.description ?? headerSlot) && (\n\t\t\t\t\t\t<Stack direction=\"horizontal\" align=\"start\" justify=\"between\" gap=\"xl\" className=\"schema-form--header\">\n\t\t\t\t\t\t<Stack gap=\"normal\" className=\"min-w-0\">\n\t\t\t\t\t\t\t\t{!!(title ?? schema.title) && (\n\t\t\t\t\t\t\t\t\t<Text type=\"inherit\" size=\"base\" weight=\"semibold\" className=\"schema-form--title\">\n\t\t\t\t\t\t\t\t\t\t{title ?? schema.title}\n\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t{!!(description ?? schema.description) && (\n\t\t\t\t\t\t\t\t\t<Text type=\"secondary\" className=\"schema-form--description\">\n\t\t\t\t\t\t\t\t\t\t{description ?? schema.description}\n\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t\t{headerSlot}\n\t\t\t\t\t\t</Stack>\n\t\t\t\t\t)}\n\t\t\t\t\t{hasFields ? sections.map(renderCardSection) : empty}\n\t\t\t\t\t{footerSlot}\n\t\t\t\t\t{actions}\n\t\t\t\t</Stack>\n\t\t\t) : (\n\t\t\t\t\t<Card\n\t\t\t\t\t\tsurface=\"flat\"\n\t\t\t\t\t\tpadding=\"none\"\n\t\t\t\t\t\tclassName=\"schema-form--surface\"\n\t\t\t\t\t\tgap={compositionRhythm.subjects}\n\t\t\t\t\t\tcontentGap={compositionRhythm.subjects}\n\t\t\t\t\t\tcontentClassName={cn('schema-form--content', contentClassName)}\n\t\t\t\t\t\ttitle={title ?? schema.title}\n\t\t\t\t\t\tdescription={description ?? schema.description}\n\t\t\t\t\t\theaderEnd={headerSlot}\n\t\t\t\t\t\tfooterSlot={\n\t\t\t\t\t\t\tfooterSlot || actions ? (\n\t\t\t\t\t\t\t\t<Stack gap=\"lg\" className=\"schema-form--footer\">\n\t\t\t\t\t\t\t\t\t{footerSlot}\n\t\t\t\t\t\t\t\t\t{actions}\n\t\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t\t) : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{hasFields ? sections.map(renderPlainSection) : empty}\n\t\t\t\t\t</Card>\n\t\t\t)}\n\t\t</form>\n\t);\n}\n\nSchemaForm.displayName = 'SchemaForm';\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAiBA,IAAaiB,IAAiD;CAC7D,GAAG;CACH,GAAG;CACH,GAAG;AACJ,GAEaC,KAAgE;CAC5E,MAAM;CACN,MAAM;CACN,OAAO;CACP,MAAM;AACP;AAEA,SAAgBC,EACf,GACA,GACA,GACU;CACV,IAAI,OAAOC,EAAM,UAAW,YAC3B,IAAI;EACH,OAAOA,EAAM,OAAOC,CAAM;CAC3B,SAASC,GAAO;EAEf,OADAC,IAAUD,CAAK,GACR;CACR;CAED,OAAOF,EAAM,UAAU;AACxB;AAEA,SAAgBI,GACf,GACA,GACA,GACU;CACV,IAAI,OAAOJ,EAAM,YAAa,YAC7B,IAAI;EACH,OAAOA,EAAM,SAASC,CAAM;CAC7B,SAASC,GAAO;EAEf,OADAC,IAAUD,CAAK,GACR;CACR;CAED,OAAOF,EAAM,YAAY;AAC1B;AAEA,SAAgBK,EACf,GACA,GACA,GACoB;CACpB,OAAOC,EAAO,QAAQ,MAAU,CAACP,EAAcC,GAAOC,GAAQE,CAAO,CAAC;AACvE;AAEA,SAAgBI,GACf,GACA,GACA,GACA,GACA,GAC8B;CAC9B,IAAMC,IAAgBH,EAAiBI,EAAO,QAAQR,GAAQE,CAAO,GAC/DO,IAAc,IAAI,IAAIF,EAAc,KAAK,MAAU,CAACR,EAAM,KAAKA,CAAK,CAAC,CAAC,GACtEW,oBAAW,IAAI,IAAY,GAC3BC,IAAwC,CAAC;CAE/C,KAAK,IAAMC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CACK;;IAEPpC,KAAY9I,EAAS,IAAIuK,EAAiB,IAAIE;IAC9CU;IACAX;GACK;EAEN,CAAA,IAAA,kBAACpM,GAAD;GACC,SAAQ;GACR,SAAQ;GACR,WAAU;GACV,KAAKC,EAAkB;GACvB,YAAYA,EAAkB;GAC9B,kBAAkBgG,EAAG,wBAAwB0G,CAAgB;GAC7D,OAAOC,KAASnL,EAAO;GACvB,aAAaoL,KAAepL,EAAO;GACnC,WAAWqL;GACX,YACCC,KAAcX,IACb,kBAACrM,GAAD;IAAO,KAAI;IAAK,WAAU;IAA1B,UAAA,CACEgN,GACAX,CACK;GACJ,CAAA,IAAA,KAAA;GAGJ,UAAA1B,KAAY9I,EAAS,IAAIkK,EAAkB,IAAIO;EAC3C,CAAA;CAEH,CAAA;AAER;AAEA,EAAW,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 { t as n } from "../feedback-
|
|
3
|
+
import { t } from "../utils-BVbAG2J6.js";
|
|
4
|
+
import { t as n } from "../feedback-DmqmXKLn.js";
|
|
5
5
|
import { t as r } from "../use-debounced-callback-Cx1h-hdv.js";
|
|
6
|
-
import {
|
|
7
|
-
import { useCallback as
|
|
8
|
-
import { jsx as
|
|
6
|
+
import { i, s as a } from "../combobox-DrDXtSSt.js";
|
|
7
|
+
import { useCallback as o, useEffect as s, useMemo as c, useRef as l, useState as u } from "react";
|
|
8
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
9
9
|
//#region src/components/features/suggestions/hooks/use-suggestions.ts
|
|
10
|
-
var
|
|
10
|
+
var p = (e, t) => new Promise((n) => {
|
|
11
11
|
if (t.aborted) {
|
|
12
12
|
n();
|
|
13
13
|
return;
|
|
@@ -19,45 +19,45 @@ var f = (e, t) => new Promise((n) => {
|
|
|
19
19
|
};
|
|
20
20
|
t.addEventListener("abort", i, { once: !0 });
|
|
21
21
|
});
|
|
22
|
-
function
|
|
22
|
+
function m(e) {
|
|
23
23
|
return !!(e && e.name === "AbortError");
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
let { fetchData: t, minQueryLength: n = 1, debounceMs: i = 300, requestDelay:
|
|
25
|
+
function h(e) {
|
|
26
|
+
let { fetchData: t, minQueryLength: n = 1, debounceMs: i = 300, requestDelay: a = 0, preload: c = !1, query: d, defaultQuery: f = "", onQueryChange: h, value: g, defaultValue: _ = null, onValueChange: v, open: y, defaultOpen: b = !1, onOpenChange: x, onError: S } = e, [C, w] = u([]), [T, E] = u(f), [D, O] = u(_), [k, A] = u(b), [j, M] = u(!1), [N, P] = u(null), [F, I] = u(0), L = l(t), R = l(S);
|
|
27
27
|
L.current = t, R.current = S;
|
|
28
|
-
let z = d ?? T, B = g === void 0 ? D : g, V = y ?? k, H =
|
|
28
|
+
let z = d ?? T, B = g === void 0 ? D : g, V = y ?? k, H = o((e) => {
|
|
29
29
|
d === void 0 && E(e), h?.(e);
|
|
30
|
-
}, [d, h]), U =
|
|
30
|
+
}, [d, h]), U = o((e) => {
|
|
31
31
|
g === void 0 && O(e), v?.(e);
|
|
32
|
-
}, [g, v]), W =
|
|
32
|
+
}, [g, v]), W = o((e) => {
|
|
33
33
|
y === void 0 && A(e), x?.(e);
|
|
34
|
-
}, [y, x]), G =
|
|
34
|
+
}, [y, x]), G = o(() => {
|
|
35
35
|
I((e) => e + 1);
|
|
36
36
|
}, []), K = r((e, t, n) => {
|
|
37
37
|
(async () => {
|
|
38
38
|
M(!0), P(null);
|
|
39
39
|
try {
|
|
40
|
-
if (t > 0 && await
|
|
40
|
+
if (t > 0 && await p(t, n), n.aborted) return;
|
|
41
41
|
let r = await L.current(e, { signal: n });
|
|
42
42
|
n.aborted || w(Array.isArray(r) ? r : []);
|
|
43
43
|
} catch (t) {
|
|
44
|
-
!n.aborted && !
|
|
44
|
+
!n.aborted && !m(t) && (w((e) => e.length === 0 ? e : []), P(t), R.current?.(t, e));
|
|
45
45
|
} finally {
|
|
46
46
|
n.aborted || M(!1);
|
|
47
47
|
}
|
|
48
48
|
})();
|
|
49
49
|
}, i);
|
|
50
|
-
return
|
|
51
|
-
let e = new AbortController();
|
|
52
|
-
return
|
|
50
|
+
return s(() => {
|
|
51
|
+
let e = new AbortController(), t = z.trim().length;
|
|
52
|
+
return (t > 0 ? t >= n : c || n === 0) ? (M(!0), P(null), K(t === 0 ? "" : z, a, e.signal), () => {
|
|
53
53
|
K.cancel(), e.abort();
|
|
54
54
|
}) : (w((e) => e.length === 0 ? e : []), P(null), M(!1), () => e.abort());
|
|
55
55
|
}, [
|
|
56
56
|
n,
|
|
57
|
-
|
|
57
|
+
c,
|
|
58
58
|
z,
|
|
59
59
|
F,
|
|
60
|
-
|
|
60
|
+
a,
|
|
61
61
|
K
|
|
62
62
|
]), {
|
|
63
63
|
items: C,
|
|
@@ -75,19 +75,23 @@ function m(e) {
|
|
|
75
75
|
}
|
|
76
76
|
//#endregion
|
|
77
77
|
//#region src/components/features/suggestions/suggestions.strings.ts
|
|
78
|
-
var
|
|
78
|
+
var g = {
|
|
79
79
|
placeholder: "Search...",
|
|
80
80
|
emptyMessage: "No results found.",
|
|
81
81
|
loadingMessage: "Searching...",
|
|
82
82
|
startTypingMessage: "Type to search.",
|
|
83
83
|
errorMessage: "Failed to load suggestions.",
|
|
84
|
-
retry: "Retry"
|
|
84
|
+
retry: "Retry",
|
|
85
|
+
typeMoreMessage: a.typeMore,
|
|
86
|
+
clear: a.clear,
|
|
87
|
+
toggle: a.toggle,
|
|
88
|
+
dismiss: a.dismiss
|
|
85
89
|
};
|
|
86
90
|
//#endregion
|
|
87
91
|
//#region src/components/features/suggestions/suggestions.tsx
|
|
88
|
-
function
|
|
89
|
-
let { fetchData:
|
|
90
|
-
fetchData:
|
|
92
|
+
function _(r) {
|
|
93
|
+
let { fetchData: a, itemKey: s, itemText: u, onValueChange: p, renderItem: m, minQueryLength: _ = 1, debounceMs: v = 300, requestDelay: y = 0, preload: b = !1, query: x, defaultQuery: S, onQueryChange: C, value: w, defaultValue: T, allowClear: E = !0, clearInputOnClose: D = !1, open: O, defaultOpen: k, onOpenChange: A, disabled: j = !1, className: M, onError: N, renderError: P, strings: F } = r, I = e(g, F), L = l(null), { items: R, isLoading: z, query: B, setQuery: V, value: H, setValue: U, open: W, setOpen: G, error: K, isError: q, retry: J } = h({
|
|
94
|
+
fetchData: a,
|
|
91
95
|
minQueryLength: _,
|
|
92
96
|
debounceMs: v,
|
|
93
97
|
requestDelay: y,
|
|
@@ -102,12 +106,17 @@ function g(r) {
|
|
|
102
106
|
defaultOpen: k,
|
|
103
107
|
onOpenChange: A,
|
|
104
108
|
onError: N
|
|
105
|
-
}), Y =
|
|
109
|
+
}), Y = c(() => ({
|
|
106
110
|
placeholder: I.placeholder,
|
|
107
111
|
noResults: I.emptyMessage,
|
|
108
112
|
searching: I.loadingMessage,
|
|
109
|
-
typeToSearch: I.startTypingMessage
|
|
110
|
-
|
|
113
|
+
typeToSearch: I.startTypingMessage,
|
|
114
|
+
...I.typeMoreMessage === void 0 ? {} : { typeMore: I.typeMoreMessage },
|
|
115
|
+
...I.formatTypeMore === void 0 ? {} : { formatTypeMore: I.formatTypeMore },
|
|
116
|
+
...I.clear === void 0 ? {} : { clear: I.clear },
|
|
117
|
+
...I.toggle === void 0 ? {} : { toggle: I.toggle },
|
|
118
|
+
...I.dismiss === void 0 ? {} : { dismiss: I.dismiss }
|
|
119
|
+
}), [I]), X = o(() => {
|
|
111
120
|
W || G(!0), L.current?.focus(), J();
|
|
112
121
|
}, [
|
|
113
122
|
W,
|
|
@@ -117,27 +126,27 @@ function g(r) {
|
|
|
117
126
|
error: K,
|
|
118
127
|
query: B,
|
|
119
128
|
retry: X
|
|
120
|
-
}) ?? /* @__PURE__ */
|
|
129
|
+
}) ?? /* @__PURE__ */ d(n, {
|
|
121
130
|
variant: "inline",
|
|
122
131
|
title: I.errorMessage,
|
|
123
132
|
onRetry: X,
|
|
124
133
|
retryLabel: I.retry,
|
|
125
134
|
className: "suggestions-combobox--error"
|
|
126
135
|
}) : null;
|
|
127
|
-
return /* @__PURE__ */
|
|
136
|
+
return /* @__PURE__ */ f("div", {
|
|
128
137
|
className: t("suggestions--component suggestions-combobox--component", M),
|
|
129
|
-
children: [/* @__PURE__ */
|
|
138
|
+
children: [/* @__PURE__ */ d(i, {
|
|
130
139
|
ref: L,
|
|
131
140
|
className: "suggestions-combobox--control",
|
|
132
141
|
items: R,
|
|
133
142
|
searchValue: B,
|
|
134
143
|
onSearchValueChange: V,
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
getItemLabel:
|
|
138
|
-
getItemKey: (e) => String(
|
|
139
|
-
renderItem:
|
|
140
|
-
minSearchLength: _,
|
|
144
|
+
value: H,
|
|
145
|
+
onValueChange: U,
|
|
146
|
+
getItemLabel: u,
|
|
147
|
+
getItemKey: (e) => String(s(e)),
|
|
148
|
+
renderItem: m,
|
|
149
|
+
minSearchLength: b && B.trim() === "" ? 0 : _,
|
|
141
150
|
loading: !q && z,
|
|
142
151
|
showListContent: !q,
|
|
143
152
|
strings: Y,
|
|
@@ -149,8 +158,8 @@ function g(r) {
|
|
|
149
158
|
}), Z]
|
|
150
159
|
});
|
|
151
160
|
}
|
|
152
|
-
|
|
161
|
+
_.displayName = "SuggestionsCombobox";
|
|
153
162
|
//#endregion
|
|
154
|
-
export {
|
|
163
|
+
export { _ as SuggestionsCombobox, g as defaultSuggestionsStrings, h as useSuggestions };
|
|
155
164
|
|
|
156
165
|
//# sourceMappingURL=suggestions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suggestions.js","names":["ErrorState","useDebouncedCallback","Combobox","wait","signal","timer","handleAbort","resolve","ms","isAbortError","error","useSuggestions","controlledQuery","controlledValue","controlledOpen","config","items","setItems","useState","internalQuery","setInternalQuery","defaultQuery","internalValue","setInternalValue","defaultValue","internalOpen","setInternalOpen","defaultOpen","isLoading","setIsLoading","setError","reloadTick","setReloadTick","fetchDataRef","useRef","fetchData","onErrorRef","onError","query","value","open","setQuery","useCallback","nextQuery","onQueryChange","setValue","nextValue","onValueChange","setOpen","nextOpen","onOpenChange","retry","current","runFetch","delayBeforeRequest","result","debounceMs","useEffect","controller","minQueryLength","preload","requestDelay","defaultSuggestionsStrings","SuggestionsCombobox","stringsProp","props","strings","useStrings","inputRef","comboboxStrings","useMemo","retryQuery","errorNode","isError","renderError","cn","className","itemText","itemKey","item","allowClear","clearInputOnClose"],"sources":["../../src/components/features/suggestions/hooks/use-suggestions.ts","../../src/components/features/suggestions/suggestions.strings.ts","../../src/components/features/suggestions/suggestions.tsx"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from 'react';\n\nimport { DEFAULT_DEBOUNCE_MS, useDebouncedCallback } from '../../../../hooks/use-debounced-callback';\n\nimport type {\n\tUseSuggestionsConfig,\n\tUseSuggestionsResult,\n} from '../suggestions.types';\n\nconst wait = (ms: number, signal: AbortSignal): Promise<void> =>\n\tnew Promise((resolve) => {\n\t\tif (signal.aborted) {\n\t\t\tresolve();\n\t\t\treturn;\n\t\t}\n\n\t\tconst timer = setTimeout(() => {\n\t\t\tsignal.removeEventListener('abort', handleAbort);\n\t\t\tresolve();\n\t\t}, ms);\n\t\tconst handleAbort = () => {\n\t\t\tclearTimeout(timer);\n\t\t\tresolve();\n\t\t};\n\t\tsignal.addEventListener('abort', handleAbort, { once: true });\n\t});\n\nfunction isAbortError(error: unknown): boolean {\n\treturn Boolean(error && (error as { name?: string }).name === 'AbortError');\n}\n\n/**\n * Headless data-fetching state machine for the suggestions feature.\n *\n * Returns the search/selection/open state plus the latest items + loading flag.\n * Consumers that want a different visual layer can build their own UI on top\n * of this hook without touching `<SuggestionsCombobox>`.\n */\nexport function useSuggestions<T>(\n\tconfig: UseSuggestionsConfig<T>,\n): UseSuggestionsResult<T> {\n\tconst {\n\t\tfetchData,\n\t\tminQueryLength = 1,\n\t\tdebounceMs = DEFAULT_DEBOUNCE_MS,\n\t\trequestDelay = 0,\n\t\tpreload = false,\n\t\tquery: controlledQuery,\n\t\tdefaultQuery = '',\n\t\tonQueryChange,\n\t\tvalue: controlledValue,\n\t\tdefaultValue = null,\n\t\tonValueChange,\n\t\topen: controlledOpen,\n\t\tdefaultOpen = false,\n\t\tonOpenChange,\n\t\tonError,\n\t} = config;\n\n\tconst [items, setItems] = useState<T[]>([]);\n\tconst [internalQuery, setInternalQuery] = useState(defaultQuery);\n\tconst [internalValue, setInternalValue] = useState<T | null>(defaultValue);\n\tconst [internalOpen, setInternalOpen] = useState(defaultOpen);\n\tconst [isLoading, setIsLoading] = useState<boolean>(false);\n\tconst [error, setError] = useState<unknown | null>(null);\n\tconst [reloadTick, setReloadTick] = useState(0);\n\tconst fetchDataRef = useRef(fetchData);\n\tconst onErrorRef = useRef(onError);\n\n\tfetchDataRef.current = fetchData;\n\tonErrorRef.current = onError;\n\n\tconst query = controlledQuery ?? internalQuery;\n\tconst value = controlledValue !== undefined ? controlledValue : internalValue;\n\tconst open = controlledOpen ?? internalOpen;\n\n\tconst setQuery = useCallback((nextQuery: string) => {\n\t\tif (controlledQuery === undefined) {\n\t\t\tsetInternalQuery(nextQuery);\n\t\t}\n\t\tonQueryChange?.(nextQuery);\n\t}, [controlledQuery, onQueryChange]);\n\n\tconst setValue = useCallback((nextValue: T | null) => {\n\t\tif (controlledValue === undefined) {\n\t\t\tsetInternalValue(nextValue);\n\t\t}\n\t\tonValueChange?.(nextValue);\n\t}, [controlledValue, onValueChange]);\n\n\tconst setOpen = useCallback((nextOpen: boolean) => {\n\t\tif (controlledOpen === undefined) {\n\t\t\tsetInternalOpen(nextOpen);\n\t\t}\n\t\tonOpenChange?.(nextOpen);\n\t}, [controlledOpen, onOpenChange]);\n\n\tconst retry = useCallback(() => {\n\t\tsetReloadTick((current) => current + 1);\n\t}, []);\n\n\tconst runFetch = useDebouncedCallback(\n\t\t(\n\t\t\tnextQuery: string,\n\t\t\tdelayBeforeRequest: number,\n\t\t\tsignal: AbortSignal,\n\t\t) => {\n\t\t\tvoid (async () => {\n\t\t\t\tsetIsLoading(true);\n\t\t\t\tsetError(null);\n\t\t\t\ttry {\n\t\t\t\t\tif (delayBeforeRequest > 0) {\n\t\t\t\t\t\tawait wait(delayBeforeRequest, signal);\n\t\t\t\t\t}\n\t\t\t\t\tif (signal.aborted) return;\n\n\t\t\t\t\tconst result = await fetchDataRef.current(nextQuery, { signal });\n\t\t\t\t\tif (!signal.aborted) {\n\t\t\t\t\t\tsetItems(Array.isArray(result) ? result : []);\n\t\t\t\t\t}\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (!signal.aborted && !isAbortError(error)) {\n\t\t\t\t\t\tsetItems((current) => (current.length === 0 ? current : []));\n\t\t\t\t\t\tsetError(error);\n\t\t\t\t\t\tonErrorRef.current?.(error, nextQuery);\n\t\t\t\t\t}\n\t\t\t\t} finally {\n\t\t\t\t\tif (!signal.aborted) {\n\t\t\t\t\t\tsetIsLoading(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})();\n\t\t},\n\t\tdebounceMs,\n\t);\n\n\tuseEffect(() => {\n\t\tconst controller = new AbortController();\n\n\t\tconst shouldQuery =\n\t\t\tquery.length >= minQueryLength ||\n\t\t\t(preload && query.length === 0);\n\n\t\tif (!shouldQuery) {\n\t\t\tsetItems((current) => (current.length === 0 ? current : []));\n\t\t\tsetError(null);\n\t\t\tsetIsLoading(false);\n\t\t\treturn () => controller.abort();\n\t\t}\n\n\t\trunFetch(query, requestDelay, controller.signal);\n\n\t\treturn () => {\n\t\t\trunFetch.cancel();\n\t\t\tcontroller.abort();\n\t\t};\n\t}, [\n\t\tminQueryLength,\n\t\tpreload,\n\t\tquery,\n\t\treloadTick,\n\t\trequestDelay,\n\t\trunFetch,\n\t]);\n\n\treturn {\n\t\titems,\n\t\tisLoading,\n\t\terror,\n\t\tisError: error !== null,\n\t\tretry,\n\t\tquery,\n\t\tsetQuery,\n\t\tvalue,\n\t\tsetValue,\n\t\topen,\n\t\tsetOpen,\n\t};\n}\n","/**\n * Default user-facing strings for `<SuggestionsCombobox>`.\n *\n * Consumers wire backend i18n at the call site:\n *\n * <SuggestionsCombobox strings={{ emptyMessage: t('search.empty') }} … />\n */\n\nexport interface SuggestionsStrings {\n\tplaceholder: string;\n\temptyMessage: string;\n\tloadingMessage: string;\n\tstartTypingMessage: string;\n\terrorMessage: string;\n\tretry: string;\n}\n\nexport const defaultSuggestionsStrings: SuggestionsStrings = {\n\tplaceholder: 'Search...',\n\temptyMessage: 'No results found.',\n\tloadingMessage: 'Searching...',\n\tstartTypingMessage: 'Type to search.',\n\terrorMessage: 'Failed to load suggestions.',\n\tretry: 'Retry',\n};\n","import { useCallback, useMemo, useRef } from 'react';\n\nimport { Combobox } from '../combobox';\nimport { ErrorState } from '../../base/feedback';\nimport { useStrings } from '../../../lib/strings';\nimport { cn } from '../../../lib/utils';\n\nimport { useSuggestions } from './hooks';\nimport { defaultSuggestionsStrings } from './suggestions.strings';\nimport type { SuggestionsComboboxProps } from './suggestions.types';\n\nexport function SuggestionsCombobox<T>(props: SuggestionsComboboxProps<T>) {\n\tconst {\n\t\tfetchData,\n\t\titemKey,\n\t\titemText,\n\t\tonValueChange,\n\t\trenderItem,\n\t\tminQueryLength = 1,\n\t\tdebounceMs = 250,\n\t\trequestDelay = 0,\n\t\tpreload = false,\n\t\tquery: controlledQuery,\n\t\tdefaultQuery,\n\t\tonQueryChange,\n\t\tvalue: controlledValue,\n\t\tdefaultValue,\n\t\tallowClear = true,\n\t\tclearInputOnClose = false,\n\t\topen: controlledOpen,\n\t\tdefaultOpen,\n\t\tonOpenChange,\n\t\tdisabled = false,\n\t\tclassName,\n\t\tonError,\n\t\trenderError,\n\t\tstrings: stringsProp,\n\t} = props;\n\n\tconst strings = useStrings(defaultSuggestionsStrings, stringsProp);\n\tconst inputRef = useRef<HTMLInputElement>(null);\n\n\tconst {\n\t\titems,\n\t\tisLoading,\n\t\tquery,\n\t\tsetQuery,\n\t\tvalue,\n\t\tsetValue,\n\t\topen,\n\t\tsetOpen,\n\t\terror,\n\t\tisError,\n\t\tretry,\n\t} = useSuggestions<T>({\n\t\tfetchData,\n\t\tminQueryLength,\n\t\tdebounceMs,\n\t\trequestDelay,\n\t\tpreload,\n\t\tquery: controlledQuery,\n\t\tdefaultQuery,\n\t\tonQueryChange,\n\t\tvalue: controlledValue,\n\t\tdefaultValue,\n\t\tonValueChange,\n\t\topen: controlledOpen,\n\t\tdefaultOpen,\n\t\tonOpenChange,\n\t\tonError,\n\t});\n\n\tconst comboboxStrings = useMemo(\n\t\t() => ({\n\t\t\tplaceholder: strings.placeholder,\n\t\t\tnoResults: strings.emptyMessage,\n\t\t\tsearching: strings.loadingMessage,\n\t\t\ttypeToSearch: strings.startTypingMessage,\n\t\t}),\n\t\t[strings],\n\t);\n\tconst retryQuery = useCallback(() => {\n\t\tif (!open) setOpen(true);\n\t\tinputRef.current?.focus();\n\t\tretry();\n\t}, [open, retry, setOpen]);\n\n\tconst errorNode = isError && error !== null\n\t\t? renderError?.({ error, query, retry: retryQuery }) ?? (\n\t\t\t<ErrorState\n\t\t\t\tvariant=\"inline\"\n\t\t\t\ttitle={strings.errorMessage}\n\t\t\t\tonRetry={retryQuery}\n\t\t\t\tretryLabel={strings.retry}\n\t\t\t\tclassName=\"suggestions-combobox--error\"\n\t\t\t/>\n\t\t)\n\t\t: null;\n\n\treturn (\n\t\t<div className={cn('suggestions--component suggestions-combobox--component', className)}>\n\t\t\t<Combobox<T>\n\t\t\t\tref={inputRef}\n\t\t\t\tclassName=\"suggestions-combobox--control\"\n\t\t\t\titems={items}\n\t\t\t\tsearchValue={query}\n\t\t\t\tonSearchValueChange={setQuery}\n\t\t\t\tselectedValue={value}\n\t\t\t\tonSelectedValueChange={setValue}\n\t\t\t\tgetItemLabel={itemText}\n\t\t\t\tgetItemKey={(item) => String(itemKey(item))}\n\t\t\t\trenderItem={renderItem}\n\t\t\t\tminSearchLength={minQueryLength}\n\t\t\t\tloading={!isError && isLoading}\n\t\t\t\tshowListContent={!isError}\n\t\t\t\tstrings={comboboxStrings}\n\t\t\t\tclearable={allowClear}\n\t\t\t\topen={open}\n\t\t\t\tonOpenChange={setOpen}\n\t\t\t\tclearSearchOnClose={clearInputOnClose && !isError}\n\t\t\t\tdisabled={disabled}\n\t\t\t/>\n\t\t\t{errorNode}\n\t\t</div>\n\t);\n}\n\nSuggestionsCombobox.displayName = 'SuggestionsCombobox';\n"],"mappings":";;;;;;;;;AASA,IAAMG,KAAQ,GAAY,MACzB,IAAI,SAAS,MAAY;CACxB,IAAIC,EAAO,SAAS;EACnB,EAAQ;EACR;CACD;CAEA,IAAMC,IAAQ,iBAAiB;EAE9B,AADAD,EAAO,oBAAoB,SAASE,CAAW,GAC/CC,EAAQ;CACT,GAAGC,CAAE,GACCF,UAAoB;EAEzB,AADA,aAAaD,CAAK,GAClBE,EAAQ;CACT;CACA,EAAO,iBAAiB,SAASD,GAAa,EAAE,MAAM,GAAK,CAAC;AAC7D,CAAC;AAEF,SAASG,EAAa,GAAyB;CAC9C,OAAO,GAAQC,KAAUA,EAA4B,SAAS;AAC/D;AASA,SAAgBC,EACf,GAC0B;CAC1B,IAAM,EACL,cACA,oBAAiB,GACjB,gBAAA,KACA,kBAAe,GACf,aAAU,IACV,OAAOC,GACP,kBAAe,IACf,kBACA,OAAOC,GACP,kBAAe,MACf,kBACA,MAAMC,GACN,iBAAc,IACd,iBACA,eACGC,GAEE,CAACC,GAAOC,KAAYC,EAAc,CAAC,CAAC,GACpC,CAACC,GAAeC,KAAoBF,EAASG,CAAY,GACzD,CAACC,GAAeC,KAAoBL,EAAmBM,CAAY,GACnE,CAACC,GAAcC,KAAmBR,EAASS,CAAW,GACtD,CAACC,GAAWC,KAAgBX,EAAkB,EAAK,GACnD,CAACR,GAAOoB,KAAYZ,EAAyB,IAAI,GACjD,CAACa,GAAYC,KAAiBd,EAAS,CAAC,GACxCe,IAAeC,EAAOC,CAAS,GAC/BC,IAAaF,EAAOG,CAAO;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,EAAQ;CACvB,IACA,CAACA,CAAO,CACT,GACMK,IAAa7B,QAAkB;EAGpC,AAFKF,KAAMQ,EAAQ,EAAI,GACvBoB,EAAS,SAAS,MAAM,GACxBjB,EAAM;CACP,GAAG;EAACX;EAAMW;EAAOH;CAAO,CAAC,GAEnBwB,IAAYC,KAAW/D,MAAU,OACpCgE,IAAc;EAAE;EAAO;EAAO,OAAOH;CAAW,CAAC,KAClD,kBAACvE,GAAD;EACC,SAAQ;EACR,OAAOkE,EAAQ;EACf,SAASK;EACT,YAAYL,EAAQ;EACpB,WAAU;CACV,CAAA,IAEA;CAEH,OACC,kBAAC,OAAD;EAAK,WAAWS,EAAG,0DAA0DC,CAAS;EAAtF,UAAA,CACC,kBAAC1E,GAAD;GACC,KAAKkE;GACL,WAAU;GACH;GACP,aAAa9B;GACb,qBAAqBG;GACrB,eAAeF;GACf,uBAAuBM;GACvB,cAAcgC;GACd,aAAa,MAAS,OAAOC,EAAQC,CAAI,CAAC;GAC9B;GACZ,iBAAiBpB;GACjB,SAAS,CAACc,KAAW7C;GACrB,iBAAiB,CAAC6C;GAClB,SAASJ;GACT,WAAWW;GACL;GACN,cAAchC;GACd,oBAAoBiC,KAAqB,CAACR;GAChC;EACV,CAAA,GACAD,CACG;;AAEP;AAEA,EAAoB,cAAc"}
|
|
1
|
+
{"version":3,"file":"suggestions.js","names":["ErrorState","useDebouncedCallback","defaultComboboxStrings","wait","signal","timer","handleAbort","resolve","ms","isAbortError","error","useSuggestions","controlledQuery","controlledValue","controlledOpen","config","items","setItems","useState","internalQuery","setInternalQuery","defaultQuery","internalValue","setInternalValue","defaultValue","internalOpen","setInternalOpen","defaultOpen","isLoading","setIsLoading","setError","reloadTick","setReloadTick","fetchDataRef","useRef","fetchData","onErrorRef","onError","query","value","open","setQuery","useCallback","nextQuery","onQueryChange","setValue","nextValue","onValueChange","setOpen","nextOpen","onOpenChange","retry","current","runFetch","delayBeforeRequest","result","debounceMs","useEffect","controller","typedLength","minQueryLength","preload","requestDelay","defaultSuggestionsStrings","SuggestionsCombobox","stringsProp","props","strings","useStrings","inputRef","comboboxStrings","useMemo","retryQuery","errorNode","isError","renderError","cn","className","ComboboxWithListControl","itemText","itemKey","item","allowClear","clearInputOnClose"],"sources":["../../src/components/features/suggestions/hooks/use-suggestions.ts","../../src/components/features/suggestions/suggestions.strings.ts","../../src/components/features/suggestions/suggestions.tsx"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from 'react';\n\nimport { DEFAULT_DEBOUNCE_MS, useDebouncedCallback } from '../../../../hooks/use-debounced-callback';\n\nimport type {\n\tUseSuggestionsConfig,\n\tUseSuggestionsResult,\n} from '../suggestions.types';\n\nconst wait = (ms: number, signal: AbortSignal): Promise<void> =>\n\tnew Promise((resolve) => {\n\t\tif (signal.aborted) {\n\t\t\tresolve();\n\t\t\treturn;\n\t\t}\n\n\t\tconst timer = setTimeout(() => {\n\t\t\tsignal.removeEventListener('abort', handleAbort);\n\t\t\tresolve();\n\t\t}, ms);\n\t\tconst handleAbort = () => {\n\t\t\tclearTimeout(timer);\n\t\t\tresolve();\n\t\t};\n\t\tsignal.addEventListener('abort', handleAbort, { once: true });\n\t});\n\nfunction isAbortError(error: unknown): boolean {\n\treturn Boolean(error && (error as { name?: string }).name === 'AbortError');\n}\n\n/**\n * Headless data-fetching state machine for the suggestions feature.\n *\n * Returns the search/selection/open state plus the latest items + loading flag.\n * Consumers that want a different visual layer can build their own UI on top\n * of this hook without touching `<SuggestionsCombobox>`.\n */\nexport function useSuggestions<T>(\n\tconfig: UseSuggestionsConfig<T>,\n): UseSuggestionsResult<T> {\n\tconst {\n\t\tfetchData,\n\t\tminQueryLength = 1,\n\t\tdebounceMs = DEFAULT_DEBOUNCE_MS,\n\t\trequestDelay = 0,\n\t\tpreload = false,\n\t\tquery: controlledQuery,\n\t\tdefaultQuery = '',\n\t\tonQueryChange,\n\t\tvalue: controlledValue,\n\t\tdefaultValue = null,\n\t\tonValueChange,\n\t\topen: controlledOpen,\n\t\tdefaultOpen = false,\n\t\tonOpenChange,\n\t\tonError,\n\t} = config;\n\n\tconst [items, setItems] = useState<T[]>([]);\n\tconst [internalQuery, setInternalQuery] = useState(defaultQuery);\n\tconst [internalValue, setInternalValue] = useState<T | null>(defaultValue);\n\tconst [internalOpen, setInternalOpen] = useState(defaultOpen);\n\tconst [isLoading, setIsLoading] = useState<boolean>(false);\n\tconst [error, setError] = useState<unknown | null>(null);\n\tconst [reloadTick, setReloadTick] = useState(0);\n\tconst fetchDataRef = useRef(fetchData);\n\tconst onErrorRef = useRef(onError);\n\n\tfetchDataRef.current = fetchData;\n\tonErrorRef.current = onError;\n\n\tconst query = controlledQuery ?? internalQuery;\n\tconst value = controlledValue !== undefined ? controlledValue : internalValue;\n\tconst open = controlledOpen ?? internalOpen;\n\n\tconst setQuery = useCallback((nextQuery: string) => {\n\t\tif (controlledQuery === undefined) {\n\t\t\tsetInternalQuery(nextQuery);\n\t\t}\n\t\tonQueryChange?.(nextQuery);\n\t}, [controlledQuery, onQueryChange]);\n\n\tconst setValue = useCallback((nextValue: T | null) => {\n\t\tif (controlledValue === undefined) {\n\t\t\tsetInternalValue(nextValue);\n\t\t}\n\t\tonValueChange?.(nextValue);\n\t}, [controlledValue, onValueChange]);\n\n\tconst setOpen = useCallback((nextOpen: boolean) => {\n\t\tif (controlledOpen === undefined) {\n\t\t\tsetInternalOpen(nextOpen);\n\t\t}\n\t\tonOpenChange?.(nextOpen);\n\t}, [controlledOpen, onOpenChange]);\n\n\tconst retry = useCallback(() => {\n\t\tsetReloadTick((current) => current + 1);\n\t}, []);\n\n\tconst runFetch = useDebouncedCallback(\n\t\t(\n\t\t\tnextQuery: string,\n\t\t\tdelayBeforeRequest: number,\n\t\t\tsignal: AbortSignal,\n\t\t) => {\n\t\t\tvoid (async () => {\n\t\t\t\tsetIsLoading(true);\n\t\t\t\tsetError(null);\n\t\t\t\ttry {\n\t\t\t\t\tif (delayBeforeRequest > 0) {\n\t\t\t\t\t\tawait wait(delayBeforeRequest, signal);\n\t\t\t\t\t}\n\t\t\t\t\tif (signal.aborted) return;\n\n\t\t\t\t\tconst result = await fetchDataRef.current(nextQuery, { signal });\n\t\t\t\t\tif (!signal.aborted) {\n\t\t\t\t\t\tsetItems(Array.isArray(result) ? result : []);\n\t\t\t\t\t}\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (!signal.aborted && !isAbortError(error)) {\n\t\t\t\t\t\tsetItems((current) => (current.length === 0 ? current : []));\n\t\t\t\t\t\tsetError(error);\n\t\t\t\t\t\tonErrorRef.current?.(error, nextQuery);\n\t\t\t\t\t}\n\t\t\t\t} finally {\n\t\t\t\t\tif (!signal.aborted) {\n\t\t\t\t\t\tsetIsLoading(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})();\n\t\t},\n\t\tdebounceMs,\n\t);\n\n\tuseEffect(() => {\n\t\tconst controller = new AbortController();\n\n\t\t// The threshold counts what the user actually typed. A run of spaces is\n\t\t// the empty query: it is requested only where the empty query would be.\n\t\tconst typedLength = query.trim().length;\n\t\tconst shouldQuery = typedLength > 0\n\t\t\t? typedLength >= minQueryLength\n\t\t\t: preload || minQueryLength === 0;\n\n\t\tif (!shouldQuery) {\n\t\t\tsetItems((current) => (current.length === 0 ? current : []));\n\t\t\tsetError(null);\n\t\t\tsetIsLoading(false);\n\t\t\treturn () => controller.abort();\n\t\t}\n\n\t\t// Pending from the moment the query changes, not from when the debounced\n\t\t// request starts, so stale items are not offered in between.\n\t\tsetIsLoading(true);\n\t\tsetError(null);\n\t\trunFetch(typedLength === 0 ? '' : query, requestDelay, controller.signal);\n\n\t\treturn () => {\n\t\t\trunFetch.cancel();\n\t\t\tcontroller.abort();\n\t\t};\n\t}, [\n\t\tminQueryLength,\n\t\tpreload,\n\t\tquery,\n\t\treloadTick,\n\t\trequestDelay,\n\t\trunFetch,\n\t]);\n\n\treturn {\n\t\titems,\n\t\tisLoading,\n\t\terror,\n\t\tisError: error !== null,\n\t\tretry,\n\t\tquery,\n\t\tsetQuery,\n\t\tvalue,\n\t\tsetValue,\n\t\topen,\n\t\tsetOpen,\n\t};\n}\n","/**\n * Default user-facing strings for `<SuggestionsCombobox>`.\n *\n * Consumers wire backend i18n at the call site:\n *\n * <SuggestionsCombobox strings={{ emptyMessage: t('search.empty') }} … />\n */\n\nimport { defaultComboboxStrings } from '../combobox';\n\nexport interface SuggestionsStrings {\n\tplaceholder: string;\n\temptyMessage: string;\n\tloadingMessage: string;\n\tstartTypingMessage: string;\n\terrorMessage: string;\n\tretry: string;\n\t/**\n\t * Hint shown while the query is shorter than `minQueryLength`. `{remaining}`\n\t * is replaced by the number of characters still needed and `{s}` by an\n\t * English plural suffix; use `formatTypeMore` for other plural rules.\n\t */\n\ttypeMoreMessage?: string;\n\t/** Builds the remaining-characters hint from the count. Wins over `typeMoreMessage`. */\n\tformatTypeMore?: (remaining: number) => string;\n\t/** Accessible name of the control that clears the selection. */\n\tclear?: string;\n\t/** Accessible name of the control that opens the list. */\n\ttoggle?: string;\n\t/** Accessible name of the screen-reader dismissal controls inside the list. */\n\tdismiss?: string;\n}\n\nexport const defaultSuggestionsStrings: SuggestionsStrings = {\n\tplaceholder: 'Search...',\n\temptyMessage: 'No results found.',\n\tloadingMessage: 'Searching...',\n\tstartTypingMessage: 'Type to search.',\n\terrorMessage: 'Failed to load suggestions.',\n\tretry: 'Retry',\n\ttypeMoreMessage: defaultComboboxStrings.typeMore,\n\tclear: defaultComboboxStrings.clear,\n\ttoggle: defaultComboboxStrings.toggle,\n\tdismiss: defaultComboboxStrings.dismiss,\n};\n","import { useCallback, useMemo, useRef } from 'react';\n\nimport { DEFAULT_DEBOUNCE_MS } from '../../../hooks/use-debounced-callback';\n\nimport { ComboboxWithListControl } from '../combobox/combobox';\nimport { ErrorState } from '../../base/feedback';\nimport { useStrings } from '../../../lib/strings';\nimport { cn } from '../../../lib/utils';\n\nimport { useSuggestions } from './hooks';\nimport { defaultSuggestionsStrings } from './suggestions.strings';\nimport type { SuggestionsComboboxProps } from './suggestions.types';\n\nexport function SuggestionsCombobox<T>(props: SuggestionsComboboxProps<T>) {\n\tconst {\n\t\tfetchData,\n\t\titemKey,\n\t\titemText,\n\t\tonValueChange,\n\t\trenderItem,\n\t\tminQueryLength = 1,\n\t\tdebounceMs = DEFAULT_DEBOUNCE_MS,\n\t\trequestDelay = 0,\n\t\tpreload = false,\n\t\tquery: controlledQuery,\n\t\tdefaultQuery,\n\t\tonQueryChange,\n\t\tvalue: controlledValue,\n\t\tdefaultValue,\n\t\tallowClear = true,\n\t\tclearInputOnClose = false,\n\t\topen: controlledOpen,\n\t\tdefaultOpen,\n\t\tonOpenChange,\n\t\tdisabled = false,\n\t\tclassName,\n\t\tonError,\n\t\trenderError,\n\t\tstrings: stringsProp,\n\t} = props;\n\n\tconst strings = useStrings(defaultSuggestionsStrings, stringsProp);\n\tconst inputRef = useRef<HTMLInputElement>(null);\n\n\tconst {\n\t\titems,\n\t\tisLoading,\n\t\tquery,\n\t\tsetQuery,\n\t\tvalue,\n\t\tsetValue,\n\t\topen,\n\t\tsetOpen,\n\t\terror,\n\t\tisError,\n\t\tretry,\n\t} = useSuggestions<T>({\n\t\tfetchData,\n\t\tminQueryLength,\n\t\tdebounceMs,\n\t\trequestDelay,\n\t\tpreload,\n\t\tquery: controlledQuery,\n\t\tdefaultQuery,\n\t\tonQueryChange,\n\t\tvalue: controlledValue,\n\t\tdefaultValue,\n\t\tonValueChange,\n\t\topen: controlledOpen,\n\t\tdefaultOpen,\n\t\tonOpenChange,\n\t\tonError,\n\t});\n\n\tconst comboboxStrings = useMemo(\n\t\t() => ({\n\t\t\tplaceholder: strings.placeholder,\n\t\t\tnoResults: strings.emptyMessage,\n\t\t\tsearching: strings.loadingMessage,\n\t\t\ttypeToSearch: strings.startTypingMessage,\n\t\t\t// The optional keys fall through to the Combobox defaults when unset.\n\t\t\t...(strings.typeMoreMessage === undefined ? {} : { typeMore: strings.typeMoreMessage }),\n\t\t\t...(strings.formatTypeMore === undefined ? {} : { formatTypeMore: strings.formatTypeMore }),\n\t\t\t...(strings.clear === undefined ? {} : { clear: strings.clear }),\n\t\t\t...(strings.toggle === undefined ? {} : { toggle: strings.toggle }),\n\t\t\t...(strings.dismiss === undefined ? {} : { dismiss: strings.dismiss }),\n\t\t}),\n\t\t[strings],\n\t);\n\tconst retryQuery = useCallback(() => {\n\t\tif (!open) setOpen(true);\n\t\tinputRef.current?.focus();\n\t\tretry();\n\t}, [open, retry, setOpen]);\n\n\tconst errorNode = isError && error !== null\n\t\t? renderError?.({ error, query, retry: retryQuery }) ?? (\n\t\t\t<ErrorState\n\t\t\t\tvariant=\"inline\"\n\t\t\t\ttitle={strings.errorMessage}\n\t\t\t\tonRetry={retryQuery}\n\t\t\t\tretryLabel={strings.retry}\n\t\t\t\tclassName=\"suggestions-combobox--error\"\n\t\t\t/>\n\t\t)\n\t\t: null;\n\n\treturn (\n\t\t<div className={cn('suggestions--component suggestions-combobox--component', className)}>\n\t\t\t<ComboboxWithListControl<T>\n\t\t\t\tref={inputRef}\n\t\t\t\tclassName=\"suggestions-combobox--control\"\n\t\t\t\titems={items}\n\t\t\t\tsearchValue={query}\n\t\t\t\tonSearchValueChange={setQuery}\n\t\t\t\tvalue={value}\n\t\t\t\tonValueChange={setValue}\n\t\t\t\tgetItemLabel={itemText}\n\t\t\t\tgetItemKey={(item) => String(itemKey(item))}\n\t\t\t\trenderItem={renderItem}\n\t\t\t\t// A preloaded list is browsable before typing; the threshold applies\n\t\t\t\t// again from the first character.\n\t\t\t\tminSearchLength={preload && query.trim() === '' ? 0 : minQueryLength}\n\t\t\t\tloading={!isError && isLoading}\n\t\t\t\tshowListContent={!isError}\n\t\t\t\tstrings={comboboxStrings}\n\t\t\t\tclearable={allowClear}\n\t\t\t\topen={open}\n\t\t\t\tonOpenChange={setOpen}\n\t\t\t\tclearSearchOnClose={clearInputOnClose && !isError}\n\t\t\t\tdisabled={disabled}\n\t\t\t/>\n\t\t\t{errorNode}\n\t\t</div>\n\t);\n}\n\nSu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|
|
|
1
1
|
"use client";
|
|
2
|
-
import { A as e, C as t, D as n, E as r,
|
|
3
|
-
export { D as AvatarCell, b as CellStack, O as CellValue, h as ColumnVisibilityToggle, S as CurrencyCell, m as DataTable,
|
|
2
|
+
import { A as e, C as t, D as n, E as r, N as i, O as a, P as o, S as s, T as c, _ as l, a as u, b as d, c as f, d as p, f as m, g as h, h as g, i as _, j as v, k as y, l as b, m as x, n as S, o as C, p as w, r as T, s as E, t as D, u as O, v as k, w as A, x as j, y as M } from "../table-DdXDBsR_.js";
|
|
3
|
+
export { D as AvatarCell, b as CellStack, O as CellValue, h as ColumnVisibilityToggle, S as CurrencyCell, m as DataTable, a as DataTableActions, k as DataTableBody, p as DataTableFilterBar, l as DataTableHeader, x as DataTableToolbar, T as DateCell, _ as DateMetaCell, g as FullscreenToggle, y as Pagination, E as ResourceCell, u as StatusCell, C as StatusClusterCell, f as TableLink, M as addSelectionColumn, d as createHeaderSelectionCheckbox, j as createRowSelectionCheckbox, e as defaultDataTableStrings, s as getCellClassName, i as getDataTableScrollContainer, t as getRowClassName, A as getSelectedRowsData, c as handleColumnVisibilityChange, r as handleRowSelectionChange, n as handleSortingChange, v as mergeDataTableStrings, o as useDataTableScrollState, w as useDataTableSize };
|