themelia-react-ui 1.0.2 → 2.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 +281 -1
- package/README.md +10 -5
- package/dist/{accordion-BRTcsp8J.js → accordion-CQXVcd7Q.js} +13 -13
- package/dist/accordion-CQXVcd7Q.js.map +1 -0
- package/dist/action-menu-BTpyPWJ2.js +264 -0
- package/dist/action-menu-BTpyPWJ2.js.map +1 -0
- package/dist/{affordance-geometry.generated-CL84ZN9A.js → affordance-geometry.generated-CCIXb2A1.js} +7 -2
- package/dist/affordance-geometry.generated-CCIXb2A1.js.map +1 -0
- package/dist/{ai-artifact-DLVdK0Py.js → ai-artifact-2PQ2fItc.js} +171 -176
- package/dist/ai-artifact-2PQ2fItc.js.map +1 -0
- package/dist/{app-shell-C_fKpljx.js → app-shell-BE_j8-AT.js} +4 -4
- package/dist/{app-shell-C_fKpljx.js.map → app-shell-BE_j8-AT.js.map} +1 -1
- package/dist/{attachment-DbjUWsP0.js → attachment-q69dlt5Y.js} +9 -9
- package/dist/{attachment-DbjUWsP0.js.map → attachment-q69dlt5Y.js.map} +1 -1
- package/dist/{auth-CAQcasMV.js → auth-M3vGMgDR.js} +42 -42
- package/dist/{auth-CAQcasMV.js.map → auth-M3vGMgDR.js.map} +1 -1
- package/dist/{avatar-Bu2HhitA.js → avatar-djdaaQ_s.js} +14 -12
- package/dist/avatar-djdaaQ_s.js.map +1 -0
- package/dist/{badge-CzId1Wlm.js → badge-0tATj-tW.js} +9 -9
- package/dist/badge-0tATj-tW.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/buttons.js +2 -2
- package/dist/base/cards.js +2 -2
- package/dist/base/carousel.js +11 -11
- package/dist/base/carousel.js.map +1 -1
- package/dist/base/cascader.js +244 -222
- package/dist/base/cascader.js.map +1 -1
- package/dist/base/chart.js +1 -1
- package/dist/base/choice-inputs.js +2 -2
- package/dist/base/code-block.js +1 -1
- package/dist/base/combobox.js +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 +6 -6
- package/dist/base/feedback.js +3 -3
- package/dist/base/forms-numeric.js +1 -1
- package/dist/base/forms.js +2 -2
- package/dist/base/inline-edit.js +81 -76
- package/dist/base/inline-edit.js.map +1 -1
- package/dist/base/item.js +1 -1
- package/dist/base/media-gallery.js +1 -1
- package/dist/base/navigation.js +6 -6
- package/dist/base/popover-menu.js +1 -1
- package/dist/base/popover.js +1 -1
- package/dist/base/qr-code.js +7 -4
- package/dist/base/qr-code.js.map +1 -1
- package/dist/base/repeaters.js +42 -42
- package/dist/base/repeaters.js.map +1 -1
- package/dist/base/sheet.js +1 -1
- package/dist/base/sidebar.js +1 -1
- package/dist/base/signature-pad.js +9 -9
- package/dist/base/signature-pad.js.map +1 -1
- package/dist/base/skeleton.js +1 -1
- package/dist/base/spinner.js +1 -1
- package/dist/base/structure.js +1 -1
- package/dist/base/table.js +1 -1
- package/dist/base/text-inputs.js +2 -2
- package/dist/base/toaster.js +4 -4
- package/dist/base/toaster.js.map +1 -1
- package/dist/base/tree.js +1 -1
- package/dist/base/upload-queue.js +1 -1
- package/dist/base/upload.js +3 -3
- package/dist/base/value-inputs.js +1 -1
- package/dist/blocks/admin.js +229 -220
- package/dist/blocks/admin.js.map +1 -1
- package/dist/blocks/ai.js +147 -180
- package/dist/blocks/ai.js.map +1 -1
- package/dist/blocks/analytics/usage-card.js +1 -1
- package/dist/blocks/analytics.js +530 -523
- 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 +1390 -1516
- package/dist/blocks/commerce.js.map +1 -1
- package/dist/blocks/data-display.js +1 -1
- package/dist/blocks/onboarding.js +5 -5
- package/dist/blocks/planning.js +82 -91
- package/dist/blocks/planning.js.map +1 -1
- package/dist/blocks/timelines.js +1 -1
- package/dist/{breadcrumbs-BuYz5SDU.js → breadcrumbs-BG_FfMK4.js} +5 -5
- package/dist/{breadcrumbs-BuYz5SDU.js.map → breadcrumbs-BG_FfMK4.js.map} +1 -1
- package/dist/{button-BZDasD04.js → button-BS3KDg00.js} +185 -162
- package/dist/button-BS3KDg00.js.map +1 -0
- package/dist/{button-BZyfTvwm.js → button-R9CCoH7A.js} +2 -2
- package/dist/{button-BZyfTvwm.js.map → button-R9CCoH7A.js.map} +1 -1
- package/dist/{buttons-D_6KJvEE.js → buttons-DS0ZIwJ_.js} +11 -11
- package/dist/buttons-DS0ZIwJ_.js.map +1 -0
- package/dist/{cards-qGSErLw_.js → cards-QoJ4syG9.js} +7 -7
- package/dist/{cards-qGSErLw_.js.map → cards-QoJ4syG9.js.map} +1 -1
- package/dist/{chart-Bsc5BICK.js → chart-DwYRKKc-.js} +17 -15
- package/dist/chart-DwYRKKc-.js.map +1 -0
- package/dist/checkbox-B7ygNTYp.js +35 -0
- package/dist/checkbox-B7ygNTYp.js.map +1 -0
- package/dist/choice-inputs-DrJ17tpL.js +752 -0
- package/dist/choice-inputs-DrJ17tpL.js.map +1 -0
- package/dist/{code-block-DzHKRybS.js → code-block-CD0B7M93.js} +19 -19
- package/dist/{code-block-DzHKRybS.js.map → code-block-CD0B7M93.js.map} +1 -1
- package/dist/{collapsible-ClvC7Bj3.js → collapsible-oMUGM4tr.js} +3 -3
- package/dist/{collapsible-ClvC7Bj3.js.map → collapsible-oMUGM4tr.js.map} +1 -1
- package/dist/{collection-content-D6S8cv_n.js → collection-content-Ys-OZOkY.js} +3 -3
- package/dist/{collection-content-D6S8cv_n.js.map → collection-content-Ys-OZOkY.js.map} +1 -1
- package/dist/{combobox-BFnbJJp3.js → combobox-6dvVny2q.js} +96 -97
- package/dist/combobox-6dvVny2q.js.map +1 -0
- package/dist/{combobox-hozNwUcc.js → combobox-CB7039j7.js} +326 -308
- package/dist/combobox-CB7039j7.js.map +1 -0
- package/dist/{command-BnmSchli.js → command-kPMPjIxJ.js} +34 -30
- package/dist/command-kPMPjIxJ.js.map +1 -0
- package/dist/{comments-u5L0OGip.js → comments-You0Bzbr.js} +349 -348
- package/dist/comments-You0Bzbr.js.map +1 -0
- package/dist/components/base/accordion/accordion-variants.d.ts +3 -3
- package/dist/components/base/action-menu/action-menu.d.ts +7 -2
- package/dist/components/base/avatar/stacked-avatars.d.ts +5 -4
- package/dist/components/base/badge/badge.d.ts +1 -1
- package/dist/components/base/badge/badge.recipes.d.ts +4 -4
- package/dist/components/base/buttons/base-button.d.ts +7 -0
- package/dist/components/base/buttons/button-group.recipes.d.ts +2 -2
- package/dist/components/base/buttons/button.variants.d.ts +1 -0
- package/dist/components/base/buttons/loader-button.d.ts +3 -1
- package/dist/components/base/buttons/text-button.d.ts +2 -2
- package/dist/components/base/carousel/carousel.d.ts +3 -1
- package/dist/components/base/chart/chart.d.ts +7 -7
- package/dist/components/base/choice-inputs/checkbox.d.ts +6 -7
- package/dist/components/base/choice-inputs/choice-types.d.ts +10 -1
- package/dist/components/base/choice-inputs/pill-radio-group.d.ts +9 -0
- package/dist/components/base/choice-inputs/select-popup.d.ts +9 -1
- package/dist/components/base/choice-inputs/switch-card.d.ts +1 -1
- package/dist/components/base/date-pickers/date-picker-field.d.ts +23 -0
- package/dist/components/base/date-pickers/datepicker.types.d.ts +13 -3
- package/dist/components/base/display/alert-dialog.d.ts +8 -2
- package/dist/components/base/display/content-block.d.ts +4 -2
- package/dist/components/base/display/date-block.d.ts +1 -1
- package/dist/components/base/display/dialog.d.ts +12 -5
- package/dist/components/base/display/surface-title.d.ts +6 -1
- package/dist/components/base/feedback/alert.d.ts +1 -1
- package/dist/components/base/feedback/state-display.d.ts +5 -4
- package/dist/components/base/forms/form-sizing.d.ts +32 -0
- package/dist/components/base/forms/workflow.d.ts +2 -0
- package/dist/components/base/forms-numeric/coordinates-input.d.ts +3 -0
- package/dist/components/base/forms-numeric/rounding-mode-select.d.ts +4 -1
- package/dist/components/base/navigation/dropdown-menu.d.ts +2 -2
- package/dist/components/base/navigation/language-switcher.d.ts +4 -1
- package/dist/components/base/navigation/overflow-tab-bar.d.ts +7 -0
- package/dist/components/base/navigation/page-header/page-header.d.ts +4 -1
- package/dist/components/base/qr-code/qr-code.d.ts +2 -0
- package/dist/components/base/sheet/index.d.ts +29 -1
- package/dist/components/base/sheet/sheet.d.ts +14 -5
- package/dist/components/base/spinner/spinner.d.ts +3 -2
- package/dist/components/base/structure/structure.types.d.ts +1 -1
- package/dist/components/base/text-inputs/input-group.d.ts +2 -2
- package/dist/components/base/upload/upload.recipes.d.ts +11 -0
- package/dist/components/base/value-inputs/date-time-input.d.ts +4 -2
- package/dist/components/base/value-inputs/tags-input.d.ts +2 -0
- package/dist/components/blocks/admin/api-key-list/api-key-list.types.d.ts +1 -1
- package/dist/components/blocks/analytics/format-metric-value.d.ts +11 -1
- package/dist/components/blocks/analytics/index.d.ts +1 -1
- package/dist/components/blocks/analytics/use-metric-format-options.d.ts +3 -0
- package/dist/components/blocks/commerce/address-card/address-card.d.ts +1 -1
- package/dist/components/blocks/commerce/address-card/types.d.ts +3 -1
- package/dist/components/blocks/commerce/booking-calendar-event-card/booking-calendar-event-card.d.ts +4 -0
- package/dist/components/blocks/commerce/booking-calendar-event-card/booking-calendar-event-card.types.d.ts +2 -2
- package/dist/components/blocks/commerce/discount-stack/types.d.ts +1 -1
- package/dist/components/blocks/commerce/inventory-section/types.d.ts +4 -1
- package/dist/components/blocks/commerce/loyalty-points/types.d.ts +1 -1
- package/dist/components/blocks/commerce/order-status/types.d.ts +4 -0
- package/dist/components/blocks/commerce/payment-method/payment-method.d.ts +1 -1
- package/dist/components/blocks/commerce/payment-method/types.d.ts +3 -1
- package/dist/components/blocks/commerce/seo-listing/seo-listing-card.d.ts +1 -1
- package/dist/components/blocks/commerce/seo-listing/types.d.ts +3 -1
- package/dist/components/blocks/commerce/vendor-profile/types.d.ts +4 -1
- package/dist/components/blocks/data-display/dense-info-card/dense-info.strings.d.ts +4 -1
- package/dist/components/blocks/data-display/inline-stat/inline-stat.d.ts +4 -1
- package/dist/components/features/global-search/partials/global-search-idle-state.d.ts +1 -1
- package/dist/components/features/overlays/alert-dialog.d.ts +1 -1
- package/dist/components/features/overlays/drawer.d.ts +1 -1
- package/dist/components/features/overlays/hooks/use-overlay-actions.d.ts +2 -2
- package/dist/components/features/overlays/hooks/use-overlay-visibility.d.ts +11 -4
- package/dist/components/features/overlays/overlay-tone-icon.d.ts +37 -0
- package/dist/components/features/overlays/overlays.types.d.ts +42 -19
- package/dist/components/features/products/components/product-variants-manager.d.ts +1 -1
- package/dist/components/features/products/partials/index.d.ts +1 -1
- package/dist/components/features/products/partials/product-metric-tile.d.ts +6 -0
- package/dist/components/features/products/partials/product-tone.d.ts +11 -1
- package/dist/components/features/products/products.types.d.ts +2 -1
- package/dist/components/features/table/partials/cell-renderers.d.ts +1 -1
- package/dist/components/layout/page/index.d.ts +1 -1
- package/dist/components/layout/page/page.types.d.ts +53 -3
- package/dist/components/layout/page/partials/page-header-commands.d.ts +13 -0
- package/dist/components/layout/page/partials/page-header.d.ts +1 -1
- package/dist/components/primitives/date.d.ts +16 -3
- package/dist/components/primitives/dimensions.d.ts +6 -0
- package/dist/components/primitives/duration.d.ts +6 -0
- package/dist/components/primitives/file-size.d.ts +6 -0
- package/dist/components/primitives/index.d.ts +1 -1
- package/dist/components/primitives/initials.d.ts +11 -2
- package/dist/components/primitives/link.d.ts +7 -0
- package/dist/components/primitives/money.d.ts +29 -7
- package/dist/components/primitives/number.d.ts +17 -0
- package/dist/components/primitives/value-typography.d.ts +54 -0
- package/dist/components/primitives/value.d.ts +31 -6
- package/dist/components/typography/heading.d.ts +9 -1
- package/dist/components/typography/label.d.ts +3 -0
- package/dist/components/typography/running-text.d.ts +12 -0
- package/dist/components/typography/text-link.d.ts +23 -1
- package/dist/components/typography/text.d.ts +12 -0
- package/dist/components/typography/text.styles.d.ts +35 -13
- package/dist/components/ui/button.d.ts +1 -1
- package/dist/components/ui/checkbox.d.ts +5 -0
- package/dist/components/ui/overlay.recipes.d.ts +15 -2
- package/dist/components/ui/select.d.ts +3 -1
- package/dist/components/ui/switch.d.ts +5 -0
- package/dist/{containers-DqB-bSYE.js → containers-D_L4mTVb.js} +3 -3
- package/dist/{containers-DqB-bSYE.js.map → containers-D_L4mTVb.js.map} +1 -1
- package/dist/{copyable-BTSByfmq.js → copyable-DDjTeW_j.js} +4 -4
- package/dist/{copyable-BTSByfmq.js.map → copyable-DDjTeW_j.js.map} +1 -1
- package/dist/{data-display-Bihs9Ven.js → data-display-3xWQUnMA.js} +471 -478
- package/dist/data-display-3xWQUnMA.js.map +1 -0
- package/dist/date-picker-DrDFj8Lo.js +1527 -0
- package/dist/date-picker-DrDFj8Lo.js.map +1 -0
- package/dist/date-pickers-CnFCb0n2.js +174 -0
- package/dist/date-pickers-CnFCb0n2.js.map +1 -0
- package/dist/date-uf3z37Nm.js +144 -0
- package/dist/date-uf3z37Nm.js.map +1 -0
- package/dist/{display-CS6Hbk18.js → display-DrdvPwF0.js} +25 -25
- package/dist/display-DrdvPwF0.js.map +1 -0
- package/dist/{dropdown-menu-D-boNgGO.js → dropdown-menu-CURh59jb.js} +22 -15
- package/dist/dropdown-menu-CURh59jb.js.map +1 -0
- package/dist/features/activities.js +38 -35
- package/dist/features/activities.js.map +1 -1
- package/dist/features/ai-chat.js +36 -35
- package/dist/features/ai-chat.js.map +1 -1
- package/dist/features/async-preview.js +8 -8
- package/dist/features/combobox.js +1 -1
- package/dist/features/comments.js +1 -1
- package/dist/features/data-view.js +10 -10
- package/dist/features/email-composer.js +325 -326
- package/dist/features/email-composer.js.map +1 -1
- package/dist/features/event-calendar.js +190 -200
- package/dist/features/event-calendar.js.map +1 -1
- package/dist/features/filters.js +1 -1
- package/dist/features/global-search.js +77 -77
- package/dist/features/global-search.js.map +1 -1
- package/dist/features/kanban.js +4 -4
- package/dist/features/map.js +8 -8
- package/dist/features/media-library.js +499 -502
- package/dist/features/media-library.js.map +1 -1
- package/dist/features/mentions.js +1 -1
- package/dist/features/overlays.js +1 -1
- package/dist/features/products.js +1216 -1248
- package/dist/features/products.js.map +1 -1
- package/dist/features/questionnaire.js +46 -44
- package/dist/features/questionnaire.js.map +1 -1
- package/dist/features/resource-assignment.js +96 -88
- package/dist/features/resource-assignment.js.map +1 -1
- package/dist/features/resource.js +11 -11
- package/dist/features/rich-text-editor.js +2 -2
- package/dist/features/schema-form.js +188 -184
- package/dist/features/schema-form.js.map +1 -1
- package/dist/features/suggestions.js +3 -3
- package/dist/features/sync.js +7 -7
- package/dist/features/sync.js.map +1 -1
- package/dist/features/table.js +1 -1
- package/dist/features/theme-tweaker.js +469 -470
- package/dist/features/theme-tweaker.js.map +1 -1
- package/dist/{feedback-CJkUAapr.js → feedback-C7nR0UtT.js} +9 -10
- package/dist/feedback-C7nR0UtT.js.map +1 -0
- package/dist/field-affordance-recipes-CkOCdE2y.js +46 -0
- package/dist/field-affordance-recipes-CkOCdE2y.js.map +1 -0
- package/dist/{field-state-recipes-DQQpiLWC.js → field-state-recipes-C-MFBX_8.js} +3 -3
- package/dist/field-state-recipes-C-MFBX_8.js.map +1 -0
- package/dist/{filters-D6FF8L6s.js → filters-Da-gNPsE.js} +467 -467
- package/dist/filters-Da-gNPsE.js.map +1 -0
- package/dist/{form-field-CZwrkP7m.js → form-field-VZRULhUK.js} +7 -7
- package/dist/{form-field-CZwrkP7m.js.map → form-field-VZRULhUK.js.map} +1 -1
- package/dist/form-sizing-uWP4lzVh.js +126 -0
- package/dist/form-sizing-uWP4lzVh.js.map +1 -0
- package/dist/{forms-B5NCbkSC.js → forms-DDeEnXSY.js} +11 -11
- package/dist/forms-DDeEnXSY.js.map +1 -0
- package/dist/forms-numeric-D3CO60IF.js +905 -0
- package/dist/forms-numeric-D3CO60IF.js.map +1 -0
- package/dist/{header-kxruN3RM.js → header-2ycNqGOR.js} +43 -42
- package/dist/header-2ycNqGOR.js.map +1 -0
- package/dist/{hooks-BrlnCwQd.js → hooks-DQ5SPwZw.js} +2 -2
- package/dist/{hooks-BrlnCwQd.js.map → hooks-DQ5SPwZw.js.map} +1 -1
- package/dist/{icon-badge-Btc6pQrp.js → icon-badge-DKlaKXoo.js} +3 -3
- package/dist/{icon-badge-Btc6pQrp.js.map → icon-badge-DKlaKXoo.js.map} +1 -1
- package/dist/index.js +2 -2
- package/dist/{input-vxcaNCYC.js → input-BoLm9Hks.js} +3 -3
- package/dist/{input-vxcaNCYC.js.map → input-BoLm9Hks.js.map} +1 -1
- package/dist/input-DhQdBnV3.js +255 -0
- package/dist/{input-SX9V0AL3.js.map → input-DhQdBnV3.js.map} +1 -1
- package/dist/item-xzh8Df65.js +264 -0
- package/dist/item-xzh8Df65.js.map +1 -0
- package/dist/layout/app-shell.js +1 -1
- package/dist/layout/auth.js +1 -1
- package/dist/layout/containers.js +1 -1
- package/dist/layout/header.js +1 -1
- package/dist/layout/hooks.js +1 -1
- package/dist/layout/navigation.js +1 -1
- package/dist/layout/page.js +1 -1
- package/dist/layout/settings.js +1 -1
- package/dist/layout/sidebar.js +2 -2
- package/dist/layout/workspace.js +1 -1
- package/dist/layout.js +10 -10
- package/dist/lib/affordance-geometry.generated.d.ts +6 -1
- package/dist/lib/field-affordance-recipes.d.ts +35 -0
- package/dist/lib/field-state-recipes.d.ts +4 -2
- package/dist/lib/format.d.ts +9 -0
- package/dist/lib/money-format.d.ts +30 -0
- package/dist/lib/overlay-anatomy-recipes.d.ts +1 -1
- package/dist/lib/surface-recipes.d.ts +8 -6
- package/dist/lib/token-merge.generated.d.ts +11 -11
- package/dist/lib/track-recipes.d.ts +1 -1
- package/dist/lib/ui-provider/provider.d.ts +7 -2
- package/dist/lib/ui-provider/store.d.ts +6 -2
- package/dist/lib/ui-provider/types.d.ts +5 -2
- package/dist/lib/utils.js +1 -1
- package/dist/{media-gallery-DLp3HAz0.js → media-gallery-DQUQ0m3O.js} +8 -8
- package/dist/media-gallery-DQUQ0m3O.js.map +1 -0
- package/dist/{mentions-Cl0Kt_Pd.js → mentions-DwnO1hh4.js} +34 -35
- package/dist/{mentions-Cl0Kt_Pd.js.map → mentions-DwnO1hh4.js.map} +1 -1
- package/dist/{message-SZUNB1eX.js → message-YfFmbXNP.js} +5 -5
- package/dist/{message-SZUNB1eX.js.map → message-YfFmbXNP.js.map} +1 -1
- package/dist/{navigation-DyytsLRB.js → navigation-Cbp5V8gG.js} +33 -34
- package/dist/navigation-Cbp5V8gG.js.map +1 -0
- package/dist/{navigation-DnQSNMT0.js → navigation-Cs1npsPm.js} +111 -87
- package/dist/navigation-Cs1npsPm.js.map +1 -0
- package/dist/{navigation-row-recipes-DQEXQcqY.js → navigation-row-recipes-DlU-4QYO.js} +2 -2
- package/dist/{navigation-row-recipes-DQEXQcqY.js.map → navigation-row-recipes-DlU-4QYO.js.map} +1 -1
- package/dist/number-CKRBYmZK.js +352 -0
- package/dist/number-CKRBYmZK.js.map +1 -0
- package/dist/overlay.recipes-CNO2S9V6.js +34 -0
- package/dist/overlay.recipes-CNO2S9V6.js.map +1 -0
- package/dist/overlays-DhZO7N-I.js +994 -0
- package/dist/overlays-DhZO7N-I.js.map +1 -0
- package/dist/page-C6R_8jFt.js +325 -0
- package/dist/page-C6R_8jFt.js.map +1 -0
- package/dist/{page-header-D8nERkn5.js → page-header-hUTzcRZX.js} +9 -9
- package/dist/page-header-hUTzcRZX.js.map +1 -0
- package/dist/{pagination-NLGqRirf.js → pagination-Cm0jqa3I.js} +8 -8
- package/dist/{pagination-NLGqRirf.js.map → pagination-Cm0jqa3I.js.map} +1 -1
- package/dist/{popover-CghIYdQf.js → popover-Dcv_9jxr.js} +6 -6
- package/dist/{popover-CghIYdQf.js.map → popover-Dcv_9jxr.js.map} +1 -1
- package/dist/{popover-menu-B4PoWhRl.js → popover-menu-DnRFKnHP.js} +6 -6
- package/dist/{popover-menu-B4PoWhRl.js.map → popover-menu-DnRFKnHP.js.map} +1 -1
- package/dist/{popover.recipes-QlD4JenO.js → popover.recipes-wmbvL8Ah.js} +2 -2
- package/dist/{popover.recipes-QlD4JenO.js.map → popover.recipes-wmbvL8Ah.js.map} +1 -1
- package/dist/primitives-BHrwQXFC.js +379 -0
- package/dist/primitives-BHrwQXFC.js.map +1 -0
- package/dist/primitives.js +5 -5
- package/dist/{progress-BroqrAyV.js → progress-Br9WTFya.js} +7 -7
- package/dist/progress-Br9WTFya.js.map +1 -0
- package/dist/{receipt-BuJynLgf.js → receipt-CV89q1fs.js} +6 -6
- package/dist/{receipt-BuJynLgf.js.map → receipt-CV89q1fs.js.map} +1 -1
- package/dist/{rich-text-editor-BKyG7rWz.js → rich-text-editor-CF8QYt5p.js} +6 -6
- package/dist/{rich-text-editor-BKyG7rWz.js.map → rich-text-editor-CF8QYt5p.js.map} +1 -1
- package/dist/{rich-text-editor.recipes-B72Nfuze.js → rich-text-editor.recipes-CnrbmTS1.js} +4 -4
- package/dist/{rich-text-editor.recipes-B72Nfuze.js.map → rich-text-editor.recipes-CnrbmTS1.js.map} +1 -1
- package/dist/{rich-text-DlxDOtf4.js → rich-text-j-FGAeZW.js} +4 -4
- package/dist/{rich-text-DlxDOtf4.js.map → rich-text-j-FGAeZW.js.map} +1 -1
- package/dist/{scroll-area-D-pIhEKl.js → scroll-area-DRdr16Pt.js} +3 -3
- package/dist/scroll-area-DRdr16Pt.js.map +1 -0
- package/dist/{separator-BhtFyo4x.js → separator-BMEvwnSX.js} +2 -2
- package/dist/{separator-BhtFyo4x.js.map → separator-BMEvwnSX.js.map} +1 -1
- package/dist/{separator-BNIgG3au.js → separator-Do5GWDYi.js} +4 -4
- package/dist/separator-Do5GWDYi.js.map +1 -0
- package/dist/services/actions/action-adapters.d.ts +4 -0
- package/dist/services/actions.js +8 -3
- package/dist/services/actions.js.map +1 -1
- package/dist/{settings-DOTOzeZ2.js → settings-DHk0L2MF.js} +17 -17
- package/dist/settings-DHk0L2MF.js.map +1 -0
- package/dist/sheet-DRFNY1_D.js +207 -0
- package/dist/sheet-DRFNY1_D.js.map +1 -0
- package/dist/sidebar-Cb8WzOvE.js +511 -0
- package/dist/sidebar-Cb8WzOvE.js.map +1 -0
- package/dist/{sidebar-CyR4XKwR.js → sidebar-Crc9M9JV.js} +18 -18
- package/dist/sidebar-Crc9M9JV.js.map +1 -0
- package/dist/{skeleton-3F0uhYn3.js → skeleton-DVMXr15h.js} +4 -4
- package/dist/{skeleton-3F0uhYn3.js.map → skeleton-DVMXr15h.js.map} +1 -1
- package/dist/{smart-card-DjGVV2xr.js → smart-card-Bek-TwUp.js} +222 -207
- package/dist/smart-card-Bek-TwUp.js.map +1 -0
- package/dist/{spinner-Cpf7oRkF.js → spinner-CmTAbEp0.js} +8 -6
- package/dist/spinner-CmTAbEp0.js.map +1 -0
- package/dist/{structure-CRdqVawd.js → structure-hzCW-XsV.js} +3 -3
- package/dist/{structure-CRdqVawd.js.map → structure-hzCW-XsV.js.map} +1 -1
- package/dist/{structure.recipes-Bqhf9oIh.js → structure.recipes-EPz60cU8.js} +37 -19
- package/dist/structure.recipes-EPz60cU8.js.map +1 -0
- package/dist/style.css +1 -1
- package/dist/surface-recipes-DOdoBXGm.js +28 -0
- package/dist/surface-recipes-DOdoBXGm.js.map +1 -0
- package/dist/table-D6zKeYQX.js +162 -0
- package/dist/table-D6zKeYQX.js.map +1 -0
- package/dist/{table-CcRDZiLP.js → table-Dn4XSrSB.js} +348 -348
- package/dist/table-Dn4XSrSB.js.map +1 -0
- package/dist/{tabs-BNgu7g0u.js → tabs-Dk8E_knt.js} +14 -13
- package/dist/tabs-Dk8E_knt.js.map +1 -0
- package/dist/{text-inputs-DsR56TR-.js → text-inputs-BFpku0Qd.js} +150 -149
- package/dist/text-inputs-BFpku0Qd.js.map +1 -0
- package/dist/{text.styles-Q4sGAIgA.js → text.styles-g4He6UIW.js} +17 -14
- package/dist/text.styles-g4He6UIW.js.map +1 -0
- package/dist/theme.css +16 -12
- package/dist/themes/green.css +24 -0
- package/dist/{timelines-D1pkt3se.js → timelines-CxuAFIc2.js} +25 -38
- package/dist/timelines-CxuAFIc2.js.map +1 -0
- package/dist/track-recipes-CDcKmndW.js +10 -0
- package/dist/track-recipes-CDcKmndW.js.map +1 -0
- package/dist/{tree-BtmYyMZV.js → tree-BotPlyiD.js} +13 -13
- package/dist/{tree-BtmYyMZV.js.map → tree-BotPlyiD.js.map} +1 -1
- package/dist/typography/rich-text.js +1 -1
- package/dist/typography-CAr3dQhX.js +116 -0
- package/dist/typography-CAr3dQhX.js.map +1 -0
- package/dist/typography.js +2 -2
- package/dist/{ui-provider-DRPn3qNl.js → ui-provider-D2_TeLqw.js} +20 -21
- package/dist/ui-provider-D2_TeLqw.js.map +1 -0
- package/dist/ui-provider.js +1 -1
- package/dist/{upload-CDbYw1WN.js → upload-B0WHW7ak.js} +221 -220
- package/dist/upload-B0WHW7ak.js.map +1 -0
- package/dist/{upload-queue-CNd_hH_a.js → upload-queue-BHZ_wBfd.js} +59 -62
- package/dist/upload-queue-BHZ_wBfd.js.map +1 -0
- package/dist/{usage-card-VyJLUwRr.js → usage-card-U0YBLTNT.js} +42 -43
- package/dist/{usage-card-VyJLUwRr.js.map → usage-card-U0YBLTNT.js.map} +1 -1
- package/dist/{utils-BvH9PSmq.js → utils-Cospvlj1.js} +221 -51
- package/dist/utils-Cospvlj1.js.map +1 -0
- package/dist/value-inputs-CjfzGMsN.js +854 -0
- package/dist/value-inputs-CjfzGMsN.js.map +1 -0
- package/dist/value-typography-Deb3yQZg.js +116 -0
- package/dist/value-typography-Deb3yQZg.js.map +1 -0
- package/dist/{workspace-CcR8r-Nt.js → workspace-YoFjXi6i.js} +44 -45
- package/dist/workspace-YoFjXi6i.js.map +1 -0
- package/docs/consumer-skill/SKILL.md +51 -38
- package/docs/consumer-skill/examples/app-layout.tsx +2 -4
- package/docs/consumer-skill/examples/detail.tsx +3 -4
- package/docs/consumer-skill/examples/edit.tsx +1 -1
- package/docs/consumer-skill/examples/layout-blocks.tsx +20 -0
- package/docs/consumer-skill/examples/manifest.json +28 -6
- package/docs/consumer-skill/examples/scoped-directory.tsx +2 -2
- package/docs/consumer-skill/references/composition.md +89 -17
- package/docs/consumer-skill/references/discovery.md +4 -0
- package/docs/consumer-skill/references/installation.md +22 -0
- package/docs/consumer-skill/references/integration.md +32 -1
- package/docs/consumer-skill/references/public-api.json +111 -70
- package/docs/consumer-skill/references/review.md +20 -4
- package/docs/consumer-skill/references/theming.md +7 -1
- package/docs/consumer-skill/references/tokens.json +5 -2
- package/docs/consumer-skill/references/workflows.md +4 -2
- package/docs/consumer-skill/scripts/composition-policy.mjs +93 -2
- package/docs/consumer-skill/scripts/discovery.mjs +11 -3
- package/docs/consumer-skill/scripts/pin-button-defaults.mjs +95 -0
- package/package.json +5 -3
- package/dist/accordion-BRTcsp8J.js.map +0 -1
- package/dist/action-menu-Drxw_vJk.js +0 -265
- package/dist/action-menu-Drxw_vJk.js.map +0 -1
- package/dist/affordance-geometry.generated-CL84ZN9A.js.map +0 -1
- package/dist/ai-artifact-DLVdK0Py.js.map +0 -1
- package/dist/avatar-Bu2HhitA.js.map +0 -1
- package/dist/badge-CzId1Wlm.js.map +0 -1
- package/dist/button-BZDasD04.js.map +0 -1
- package/dist/buttons-D_6KJvEE.js.map +0 -1
- package/dist/chart-Bsc5BICK.js.map +0 -1
- package/dist/checkbox-BQNDjUCh.js +0 -34
- package/dist/checkbox-BQNDjUCh.js.map +0 -1
- package/dist/choice-inputs-Mk3iWbhr.js +0 -725
- package/dist/choice-inputs-Mk3iWbhr.js.map +0 -1
- package/dist/combobox-BFnbJJp3.js.map +0 -1
- package/dist/combobox-hozNwUcc.js.map +0 -1
- package/dist/command-BnmSchli.js.map +0 -1
- package/dist/comments-u5L0OGip.js.map +0 -1
- package/dist/data-display-Bihs9Ven.js.map +0 -1
- package/dist/date-DOKhJPu7.js +0 -140
- package/dist/date-DOKhJPu7.js.map +0 -1
- package/dist/date-picker-DzP5HQq7.js +0 -1541
- package/dist/date-picker-DzP5HQq7.js.map +0 -1
- package/dist/date-pickers-BpgGz7S-.js +0 -196
- package/dist/date-pickers-BpgGz7S-.js.map +0 -1
- package/dist/display-CS6Hbk18.js.map +0 -1
- package/dist/dropdown-menu-D-boNgGO.js.map +0 -1
- package/dist/feedback-CJkUAapr.js.map +0 -1
- package/dist/field-affordance-recipes-uKY4MsZ_.js +0 -25
- package/dist/field-affordance-recipes-uKY4MsZ_.js.map +0 -1
- package/dist/field-state-recipes-DQQpiLWC.js.map +0 -1
- package/dist/filters-D6FF8L6s.js.map +0 -1
- package/dist/form-sizing-QP8aIRaW.js +0 -103
- package/dist/form-sizing-QP8aIRaW.js.map +0 -1
- package/dist/format-iamDSqs2.js +0 -110
- package/dist/format-iamDSqs2.js.map +0 -1
- package/dist/forms-B5NCbkSC.js.map +0 -1
- package/dist/forms-numeric-Crrm80Lm.js +0 -867
- package/dist/forms-numeric-Crrm80Lm.js.map +0 -1
- package/dist/header-kxruN3RM.js.map +0 -1
- package/dist/input-SX9V0AL3.js +0 -255
- package/dist/item-DE4YnuJx.js +0 -258
- package/dist/item-DE4YnuJx.js.map +0 -1
- package/dist/media-gallery-DLp3HAz0.js.map +0 -1
- package/dist/navigation-DnQSNMT0.js.map +0 -1
- package/dist/navigation-DyytsLRB.js.map +0 -1
- package/dist/number-DasMFWEG.js +0 -269
- package/dist/number-DasMFWEG.js.map +0 -1
- package/dist/overlay.recipes-BxW5FIfK.js +0 -6
- package/dist/overlay.recipes-BxW5FIfK.js.map +0 -1
- package/dist/overlays-DUbs1KEi.js +0 -1011
- package/dist/overlays-DUbs1KEi.js.map +0 -1
- package/dist/page-hGmT4nWK.js +0 -213
- package/dist/page-hGmT4nWK.js.map +0 -1
- package/dist/page-header-D8nERkn5.js.map +0 -1
- package/dist/primitives-C7ff0QaI.js +0 -337
- package/dist/primitives-C7ff0QaI.js.map +0 -1
- package/dist/progress-BroqrAyV.js.map +0 -1
- package/dist/scroll-area-D-pIhEKl.js.map +0 -1
- package/dist/separator-BNIgG3au.js.map +0 -1
- package/dist/settings-DOTOzeZ2.js.map +0 -1
- package/dist/sheet-BFhrNehm.js +0 -205
- package/dist/sheet-BFhrNehm.js.map +0 -1
- package/dist/sidebar-CyR4XKwR.js.map +0 -1
- package/dist/sidebar-SvGJ0Zwi.js +0 -506
- package/dist/sidebar-SvGJ0Zwi.js.map +0 -1
- package/dist/smart-card-DjGVV2xr.js.map +0 -1
- package/dist/spinner-Cpf7oRkF.js.map +0 -1
- package/dist/structure.recipes-Bqhf9oIh.js.map +0 -1
- package/dist/surface-recipes-Dd__PD-w.js +0 -28
- package/dist/surface-recipes-Dd__PD-w.js.map +0 -1
- package/dist/table-CLtJTxoR.js +0 -147
- package/dist/table-CLtJTxoR.js.map +0 -1
- package/dist/table-CcRDZiLP.js.map +0 -1
- package/dist/tabs-BNgu7g0u.js.map +0 -1
- package/dist/text-inputs-DsR56TR-.js.map +0 -1
- package/dist/text.styles-Q4sGAIgA.js.map +0 -1
- package/dist/timelines-D1pkt3se.js.map +0 -1
- package/dist/track-recipes-LLPNVwFg.js +0 -10
- package/dist/track-recipes-LLPNVwFg.js.map +0 -1
- package/dist/typography-BxQgiZyw.js +0 -96
- package/dist/typography-BxQgiZyw.js.map +0 -1
- package/dist/ui-provider-DRPn3qNl.js.map +0 -1
- package/dist/upload-CDbYw1WN.js.map +0 -1
- package/dist/upload-queue-CNd_hH_a.js.map +0 -1
- package/dist/utils-BvH9PSmq.js.map +0 -1
- package/dist/value-inputs-D0KCrfVC.js +0 -840
- package/dist/value-inputs-D0KCrfVC.js.map +0 -1
- package/dist/workspace-CcR8r-Nt.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-form.js","names":["Text","Button","Stack","Input","Textarea","ToggleField","CardCheckboxGroup","SwitchCard","CardRadioGroup","ContentBlock","FormField","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","indent","parseJsonValue","getDefaultValues","defaultValue","shouldRequireValue","normalizeErrors","next","message","errors","useSchemaForm","externalErrors","isControlled","initialValues","useMemo","internalValues","setInternalValues","useState","validationErrors","setValidationErrors","mergedErrors","setValues","useCallback","nextValues","onValueChange","setFieldValue","fieldValue","current","onFieldChange","reset","validate","nextErrors","formatRequiredError","validators","validator","result","validationError","SchemaFormActions","cn","className","showReset","disabled","resetDisabled","submitting","onReset","resetLabel","submitDisabled","submitLabel","SchemaFormEmpty","getFieldHint","getTextDisplayValue","parseTextValue","parseNumberFieldValue","parseJsonFieldValue","optionIconNode","option","Icon","JsonFieldControl","text","setText","parseError","setParseError","isFocused","setIsFocused","useEffect","commit","strings","fieldId","event","SchemaFormFieldRenderer","fieldType","commonFieldProps","controlClassName","describedBy","checked","displayValue","decimalPlaces","options","Select","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","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): string {\n\tif (value === undefined || value === null) return '';\n\tif (typeof value === 'string') return 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, useMemo, 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\tsetFieldValue: (key: string, value: SchemaFormValue) => void;\n\tsetValues: (values: SchemaFormValues) => 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({\n\tfields,\n\tvalue,\n\tdefaultValue,\n\terrors: externalErrors,\n\tonValueChange,\n\tonFieldChange,\n\tformatRequiredError,\n\tvalidationError,\n\tonError,\n}: UseSchemaFormOptions): UseSchemaFormResult {\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 values = useMemo(\n\t\t() => (isControlled ? { ...initialValues, ...value } : internalValues),\n\t\t[initialValues, internalValues, isControlled, value],\n\t);\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 setValues = useCallback(\n\t\t(nextValues: SchemaFormValues) => {\n\t\t\tif (!isControlled) setInternalValues(nextValues);\n\t\t\tonValueChange?.(nextValues);\n\t\t},\n\t\t[isControlled, onValueChange],\n\t);\n\n\tconst setFieldValue = useCallback(\n\t\t(key: string, fieldValue: SchemaFormValue) => {\n\t\t\tconst nextValues = { ...values, [key]: fieldValue };\n\t\t\tif (!isControlled) setInternalValues(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\tonFieldChange?.(key, fieldValue, nextValues);\n\t\t\tonValueChange?.(nextValues);\n\t\t},\n\t\t[isControlled, onFieldChange, onValueChange, values],\n\t);\n\n\tconst reset = useCallback(() => {\n\t\tconst nextValues = getDefaultValues(fields, defaultValue);\n\t\tif (!isControlled) setInternalValues(nextValues);\n\t\tsetValidationErrors({});\n\t\tonValueChange?.(nextValues);\n\t\treturn nextValues;\n\t}, [defaultValue, fields, isControlled, onValueChange]);\n\n\tconst validate = useCallback(() => {\n\t\tconst nextErrors: SchemaFormErrors = {};\n\n\t\tfor (const field of fields) {\n\t\t\tif (isFieldHidden(field, values, onError)) continue;\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\t\t}\n\n\t\tsetValidationErrors(nextErrors);\n\t\treturn Object.keys(nextErrors).length === 0;\n\t}, [fields, formatRequiredError, onError, validationError, values]);\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\n\treturn {\n\t\tvalues,\n\t\terrors: mergedErrors,\n\t\tgetFieldError,\n\t\tgetFieldValue,\n\t\tsetFieldValue,\n\t\tsetValues,\n\t\treset,\n\t\tvalidate,\n\t};\n}\n","import { Button } from '../../../base/buttons';\nimport { Stack } from '../../../base/structure';\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=\"md\" 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/20', className)}\n\t\t/>\n\t);\n}\n\nSchemaFormEmpty.displayName = 'SchemaFormEmpty';\n","import { useEffect, 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 } from '../../../base/forms-numeric';\nimport { cn } from '../../../../lib/utils';\n\nimport type { SchemaFormStrings } from '../schema-form.strings';\nimport type {\n\tSchemaFormField,\n\tSchemaFormFieldContext,\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}\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 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}: SchemaFormFieldContext & { strings: SchemaFormStrings }) {\n\tconst indent = field.type === 'json' ? field.jsonIndent ?? 2 : 2;\n\tconst [text, setText] = useState(() => formatJsonValue(value, indent));\n\tconst [parseError, setParseError] = useState<string | undefined>();\n\tconst [isFocused, setIsFocused] = useState(false);\n\n\tuseEffect(() => {\n\t\tif (!isFocused) setText(formatJsonValue(value, indent));\n\t}, [indent, isFocused, value]);\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\tsetParseError(parsed.valid ? undefined : strings.jsonParseError);\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\tconst parsed = parseJsonFieldValue(field, next, values, onError);\n\t\t\t\t\tsetParseError(parsed.valid ? undefined : strings.jsonParseError);\n\t\t\t\t\tonValueChange(parsed.value);\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));\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}: 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/>\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 displayValue = getTextDisplayValue(field, value, values, onError);\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<DecimalInput\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\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\tonChange={(event) => {\n\t\t\t\t\t\tconst rawValue = event.target.value;\n\t\t\t\t\t\tonValueChange(parseNumberFieldValue(field, rawValue, values, integer, onError));\n\t\t\t\t\t}}\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 { ContentBlock } from '../../base/display';\nimport { Stack } from '../../base/structure';\nimport { Text } from '../../typography';\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 mb-space-lg\">\n\t\t\t{!!section.title && (\n\t\t\t\t<Text weight=\"semibold\" 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 type=\"secondary\" 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/>\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<section\n\t\t\t\tkey={section.id}\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 mt-space-lg\">\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</section>\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\theaderDivider\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 valid = form.validate();\n\t\t\t\tif (!valid) return;\n\t\t\t\ttry {\n\t\t\t\t\tawait onSubmit?.(form.values, 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=\"xl\" 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 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<ContentBlock\n\t\t\t\t\t\tclassName=\"schema-form--surface\"\n\t\t\t\t\t\tcontentGap=\"2xl\"\n\t\t\t\t\t\tcontentClassName={cn('schema-form--content', contentClassName)}\n\t\t\t\t\ttitle={title ?? schema.title}\n\t\t\t\t\tdescription={description ?? schema.description}\n\t\t\t\t\theaderEnd={headerSlot}\n\t\t\t\t\tfooterSlot={\n\t\t\t\t\t\tfooterSlot || actions ? (\n\t\t\t\t\t\t\t<Stack gap=\"lg\" className=\"schema-form--footer\">\n\t\t\t\t\t\t\t\t{footerSlot}\n\t\t\t\t\t\t\t\t{actions}\n\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t) : undefined\n\t\t\t\t\t}\n\t\t\t\t\theaderDivider={Boolean(title ?? schema.title ?? description ?? schema.description ?? headerSlot)}\n\t\t\t\t\tfooterDivider={Boolean(footerSlot || actions)}\n\t\t\t\t>\n\t\t\t\t\t\t{hasFields ? sections.map(renderPlainSection) : empty}\n\t\t\t\t\t</ContentBlock>\n\t\t\t)}\n\t\t</form>\n\t);\n}\n\nSchemaForm.displayName = 'SchemaForm';\n"],"mappings":";;;;;;;;;;;;;;;;;AAiBA,IAAac,IAAiD;CAC7D,GAAG;CACH,GAAG;CACH,GAAG;AACJ,GAEaC,IAAgE;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,EACf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EAAO,gBACzB,kBAAC1B,GAAD;OAAM,MAAK;OAAY,WAAU;OAC/B,UAAAwK,KAAe9I,EAAO;MAClB,CAAA,CAED;KACN,CAAA,GAAA+I,CACK;;IAEP7B,KAAY/G,EAAS,IAAIoI,EAAiB,IAAIE;IAC9CO;IACAR;GACK;EAEN,CAAA,IAAA,kBAACzJ,GAAD;GACC,WAAU;GACV,YAAW;GACX,kBAAkB2E,EAAG,wBAAwBkF,CAAgB;GAC9D,OAAOC,KAAS7I,EAAO;GACvB,aAAa8I,KAAe9I,EAAO;GACnC,WAAW+I;GACX,YACCC,KAAcR,IACb,kBAAChK,GAAD;IAAO,KAAI;IAAK,WAAU;IAA1B,UAAA,CACEwK,GACAR,CACK;GACJ,CAAA,IAAA,KAAA;GAEL,eAAe,GAAQK,KAAS7I,EAAO,SAAS8I,KAAe9I,EAAO,eAAe+I;GACrF,eAAe,GAAQC,KAAcR;GAEnC,UAAAtB,KAAY/G,EAAS,IAAI+H,EAAkB,IAAIO;EACnC,CAAA;CAEX,CAAA;AAER;AAEA,EAAW,cAAc"}
|
|
1
|
+
{"version":3,"file":"schema-form.js","names":["Text","Button","Stack","Card","Input","FormField","Textarea","ToggleField","Select","CardCheckboxGroup","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","indent","parseJsonValue","getDefaultValues","defaultValue","shouldRequireValue","normalizeErrors","next","message","errors","useSchemaForm","externalErrors","isControlled","initialValues","useMemo","internalValues","setInternalValues","useState","validationErrors","setValidationErrors","mergedErrors","setValues","useCallback","nextValues","onValueChange","setFieldValue","fieldValue","current","onFieldChange","reset","validate","nextErrors","formatRequiredError","validators","validator","result","validationError","SchemaFormActions","cn","className","showReset","disabled","resetDisabled","submitting","onReset","resetLabel","submitDisabled","submitLabel","SchemaFormEmpty","getFieldHint","getTextDisplayValue","parseTextValue","parseNumberFieldValue","parseJsonFieldValue","optionIconNode","option","Icon","JsonFieldControl","text","setText","parseError","setParseError","isFocused","setIsFocused","useEffect","commit","strings","fieldId","event","SchemaFormFieldRenderer","fieldType","commonFieldProps","controlClassName","describedBy","checked","displayValue","decimalPlaces","options","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","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): string {\n\tif (value === undefined || value === null) return '';\n\tif (typeof value === 'string') return 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, useMemo, 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\tsetFieldValue: (key: string, value: SchemaFormValue) => void;\n\tsetValues: (values: SchemaFormValues) => 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({\n\tfields,\n\tvalue,\n\tdefaultValue,\n\terrors: externalErrors,\n\tonValueChange,\n\tonFieldChange,\n\tformatRequiredError,\n\tvalidationError,\n\tonError,\n}: UseSchemaFormOptions): UseSchemaFormResult {\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 values = useMemo(\n\t\t() => (isControlled ? { ...initialValues, ...value } : internalValues),\n\t\t[initialValues, internalValues, isControlled, value],\n\t);\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 setValues = useCallback(\n\t\t(nextValues: SchemaFormValues) => {\n\t\t\tif (!isControlled) setInternalValues(nextValues);\n\t\t\tonValueChange?.(nextValues);\n\t\t},\n\t\t[isControlled, onValueChange],\n\t);\n\n\tconst setFieldValue = useCallback(\n\t\t(key: string, fieldValue: SchemaFormValue) => {\n\t\t\tconst nextValues = { ...values, [key]: fieldValue };\n\t\t\tif (!isControlled) setInternalValues(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\tonFieldChange?.(key, fieldValue, nextValues);\n\t\t\tonValueChange?.(nextValues);\n\t\t},\n\t\t[isControlled, onFieldChange, onValueChange, values],\n\t);\n\n\tconst reset = useCallback(() => {\n\t\tconst nextValues = getDefaultValues(fields, defaultValue);\n\t\tif (!isControlled) setInternalValues(nextValues);\n\t\tsetValidationErrors({});\n\t\tonValueChange?.(nextValues);\n\t\treturn nextValues;\n\t}, [defaultValue, fields, isControlled, onValueChange]);\n\n\tconst validate = useCallback(() => {\n\t\tconst nextErrors: SchemaFormErrors = {};\n\n\t\tfor (const field of fields) {\n\t\t\tif (isFieldHidden(field, values, onError)) continue;\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\t\t}\n\n\t\tsetValidationErrors(nextErrors);\n\t\treturn Object.keys(nextErrors).length === 0;\n\t}, [fields, formatRequiredError, onError, validationError, values]);\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\n\treturn {\n\t\tvalues,\n\t\terrors: mergedErrors,\n\t\tgetFieldError,\n\t\tgetFieldValue,\n\t\tsetFieldValue,\n\t\tsetValues,\n\t\treset,\n\t\tvalidate,\n\t};\n}\n","import { Button } from '../../../base/buttons';\nimport { Stack } from '../../../base/structure';\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=\"md\" 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/20', className)}\n\t\t/>\n\t);\n}\n\nSchemaFormEmpty.displayName = 'SchemaFormEmpty';\n","import { useEffect, 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 } from '../../../base/forms-numeric';\nimport { cn } from '../../../../lib/utils';\n\nimport type { SchemaFormStrings } from '../schema-form.strings';\nimport type {\n\tSchemaFormField,\n\tSchemaFormFieldContext,\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}\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 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}: SchemaFormFieldContext & { strings: SchemaFormStrings }) {\n\tconst indent = field.type === 'json' ? field.jsonIndent ?? 2 : 2;\n\tconst [text, setText] = useState(() => formatJsonValue(value, indent));\n\tconst [parseError, setParseError] = useState<string | undefined>();\n\tconst [isFocused, setIsFocused] = useState(false);\n\n\tuseEffect(() => {\n\t\tif (!isFocused) setText(formatJsonValue(value, indent));\n\t}, [indent, isFocused, value]);\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\tsetParseError(parsed.valid ? undefined : strings.jsonParseError);\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\tconst parsed = parseJsonFieldValue(field, next, values, onError);\n\t\t\t\t\tsetParseError(parsed.valid ? undefined : strings.jsonParseError);\n\t\t\t\t\tonValueChange(parsed.value);\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));\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}: 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/>\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 displayValue = getTextDisplayValue(field, value, values, onError);\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<DecimalInput\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\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\tonChange={(event) => {\n\t\t\t\t\t\tconst rawValue = event.target.value;\n\t\t\t\t\t\tonValueChange(parseNumberFieldValue(field, rawValue, values, integer, onError));\n\t\t\t\t\t}}\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 { Text } from '../../typography';\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 weight=\"semibold\" 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 type=\"secondary\" 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/>\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 valid = form.validate();\n\t\t\t\tif (!valid) return;\n\t\t\t\ttry {\n\t\t\t\t\tawait onSubmit?.(form.values, 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=\"2xl\" 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 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=\"2xl\"\n\t\t\t\t\t\tcontentGap=\"2xl\"\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,IAAagB,IAAiD;CAC7D,GAAG;CACH,GAAG;CACH,GAAG;AACJ,GAEaC,IAAgE;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;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,YAAW;GACX,kBAAkBmF,EAAG,wBAAwBiF,CAAgB;GAC7D,OAAOC,KAAS5I,EAAO;GACvB,aAAa6I,KAAe7I,EAAO;GACnC,WAAW8I;GACX,YACCC,KAAcR,IACb,kBAACjK,GAAD;IAAO,KAAI;IAAK,WAAU;IAA1B,UAAA,CACEyK,GACAR,CACK;GACJ,CAAA,IAAA,KAAA;GAGJ,UAAAtB,KAAY9G,EAAS,IAAI8H,EAAkB,IAAIO;EAC3C,CAAA;CAEH,CAAA;AAER;AAEA,EAAW,cAAc"}
|
|
@@ -1,9 +1,9 @@
|
|
|
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-Cospvlj1.js";
|
|
4
|
+
import { t as n } from "../feedback-C7nR0UtT.js";
|
|
5
5
|
import { t as r } from "../use-debounced-callback-Cx1h-hdv.js";
|
|
6
|
-
import { r as i } from "../combobox-
|
|
6
|
+
import { r as i } from "../combobox-CB7039j7.js";
|
|
7
7
|
import { useCallback as a, useEffect as o, useMemo as s, useRef as c, useState as l } from "react";
|
|
8
8
|
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
9
9
|
//#region src/components/features/suggestions/hooks/use-suggestions.ts
|
package/dist/features/sync.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useStrings as e } from "../lib/strings.js";
|
|
3
|
-
import {
|
|
4
|
-
import { t as r } from "../structure-
|
|
5
|
-
import { i, r as a } from "../choice-inputs-
|
|
3
|
+
import { i as t, s as n } from "../typography-CAr3dQhX.js";
|
|
4
|
+
import { t as r } from "../structure-hzCW-XsV.js";
|
|
5
|
+
import { i, r as a } from "../choice-inputs-DrJ17tpL.js";
|
|
6
6
|
import { useEffect as o, useMemo as s } from "react";
|
|
7
7
|
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
8
8
|
import { Controller as u, useForm as d } from "react-hook-form";
|
|
@@ -67,7 +67,7 @@ function h(h) {
|
|
|
67
67
|
/* @__PURE__ */ l(r, {
|
|
68
68
|
gap: "dense",
|
|
69
69
|
className: "sync-range-dialog-form--section-header",
|
|
70
|
-
children: [/* @__PURE__ */ c(
|
|
70
|
+
children: [/* @__PURE__ */ c(t, { children: A.hoursLabel }), /* @__PURE__ */ c(n, {
|
|
71
71
|
size: "xs",
|
|
72
72
|
type: "secondary",
|
|
73
73
|
children: A.hoursDescription
|
|
@@ -92,19 +92,19 @@ function h(h) {
|
|
|
92
92
|
disabled: R
|
|
93
93
|
})
|
|
94
94
|
}),
|
|
95
|
-
j("hours") && /* @__PURE__ */ c(
|
|
95
|
+
j("hours") && /* @__PURE__ */ c(n, {
|
|
96
96
|
type: "error",
|
|
97
97
|
children: j("hours")
|
|
98
98
|
})
|
|
99
99
|
]
|
|
100
100
|
}), !!v && v.length > 0 && /* @__PURE__ */ c("section", {
|
|
101
|
-
className: "sync-range-dialog-form--section
|
|
101
|
+
className: "sync-range-dialog-form--section",
|
|
102
102
|
children: /* @__PURE__ */ l(r, {
|
|
103
103
|
gap: "md",
|
|
104
104
|
children: [/* @__PURE__ */ l(r, {
|
|
105
105
|
gap: "dense",
|
|
106
106
|
className: "sync-range-dialog-form--section-header",
|
|
107
|
-
children: [/* @__PURE__ */ c(
|
|
107
|
+
children: [/* @__PURE__ */ c(t, { children: A.optionsLabel }), /* @__PURE__ */ c(n, {
|
|
108
108
|
size: "xs",
|
|
109
109
|
type: "secondary",
|
|
110
110
|
children: A.optionsDescription
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync.js","names":["Text","Stack","CardRadioGroup","useFormErrors","errors","error","defaultSyncRangeDialogFormStrings","defaultTransformSubmit","hours","value","SyncRangeDialogForm","stringsProp","props","strings","useStrings","key","nextValue","initialValue","useMemo","defaultValue","formIsSubmitting","useForm","controlsDisabled","disabled","submitting","useEffect","reset","resetKey","emitChange","next","formId","handleSubmit","onSubmit","transformSubmit","values","Label","Controller","field","getValues","getError","syncOptions","CardCheckboxGroup","nextOptions"],"sources":["../../src/hooks/useFormErrors.ts","../../src/components/features/sync/sync.strings.ts","../../src/components/features/sync/sync-range-dialog-form.tsx"],"sourcesContent":["type ErrorKey<T> = Extract<keyof T, string>;\n\ntype ErrorBag<T> = Partial<Record<ErrorKey<T> | 'server' | 'general', string>>;\n\nexport const useFormErrors = <T extends Record<string, unknown> = Record<string, unknown>>(\n\terrors?: ErrorBag<T>,\n) => {\n\n\tconst getError = (error: ErrorKey<T>) => {\n\t\tif (!errors) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn errors[error];\n\t};\n\n\tconst hasError = (error: ErrorKey<T>) => {\n\t\treturn errors !== undefined && errors[error] !== undefined;\n\t};\n\n\treturn {\n\t\tgetError,\n\t\thasError,\n\t};\n};\n","/**\n * Default user-facing strings for `<SyncRangeDialogForm>`.\n *\n * Consumers wire backend i18n at the call site:\n *\n * <SyncRangeDialogForm strings={{ optionsLabel: t('sync.options') }} … />\n */\n\nexport interface SyncRangeDialogFormStrings {\n\t/** Label rendered above the required sync-window radio group. */\n\thoursLabel: string;\n\t/** Helper copy rendered below the sync-window label. */\n\thoursDescription: string;\n\t/** Label rendered above the optional sync-options checkbox group. */\n\toptionsLabel: string;\n\t/** Helper copy rendered below the optional sync-options label. */\n\toptionsDescription: string;\n}\n\nexport const defaultSyncRangeDialogFormStrings: SyncRangeDialogFormStrings = {\n\thoursLabel: 'Sync window',\n\thoursDescription: 'Choose how far back the integration should reconcile records.',\n\toptionsLabel: 'Options',\n\toptionsDescription: 'Limit the run when the repair only needs a specific record family.',\n};\n","import { useEffect, useMemo } from 'react';\nimport { Controller, type SubmitHandler, useForm } from 'react-hook-form';\nimport { CardCheckboxGroup, CardRadioGroup } from '../../base/choice-inputs';\nimport { Stack } from '../../base/structure';\nimport { Label, Text } from '../../typography';\nimport { useFormErrors } from '../../../hooks/useFormErrors';\nimport { useStrings } from '../../../lib/strings';\n\nimport { defaultSyncRangeDialogFormStrings } from './sync.strings';\nimport type { SyncRangeDialogFormProps, SyncRangeDialogFormSubmit, SyncRangeDialogFormValues } from './sync.types';\n\nfunction defaultTransformSubmit(value: SyncRangeDialogFormValues): SyncRangeDialogFormSubmit {\n\tconst hours = Number(value.hours);\n\tif (!Number.isFinite(hours)) {\n\t\tthrow new TypeError('SyncRangeDialogForm requires numeric range values unless transformSubmit is provided.');\n\t}\n\n\treturn {\n\t\thours,\n\t\toptions: [...value.options],\n\t};\n}\n\nexport function SyncRangeDialogForm<TSubmit = SyncRangeDialogFormSubmit>(props: SyncRangeDialogFormProps<TSubmit>) {\n\tconst {\n\t\tformId,\n\t\toptions,\n\t\tsyncOptions,\n\t\tvalue,\n\t\tdefaultValue,\n\t\tonValueChange,\n\t\ttransformSubmit,\n\t\tonSubmit,\n\t\tonError,\n\t\tresetKey,\n\t\tdisabled = false,\n\t\tsubmitting = false,\n\t\terrors,\n\t\tstrings: stringsProp,\n\t} = props;\n\tconst strings = useStrings(defaultSyncRangeDialogFormStrings, stringsProp);\n\tconst normalizedErrors = Object.fromEntries(\n\t\tObject.entries(errors ?? {}).map(([key, nextValue]) => [key, Array.isArray(nextValue) ? nextValue[0] : nextValue]),\n\t) as Partial<Record<string, string>>;\n\tconst { getError } = useFormErrors(normalizedErrors);\n\tconst initialValue = useMemo<SyncRangeDialogFormValues>(\n\t\t() => ({\n\t\t\thours: defaultValue?.hours ?? '24',\n\t\t\toptions: [...(defaultValue?.options ?? [])],\n\t\t}),\n\t\t[defaultValue?.hours, defaultValue?.options],\n\t);\n\n\tconst {\n\t\tcontrol,\n\t\tgetValues,\n\t\thandleSubmit,\n\t\treset,\n\t\tformState: { isSubmitting: formIsSubmitting },\n\t} = useForm<SyncRangeDialogFormValues>({\n\t\tdefaultValues: value ?? initialValue,\n\t});\n\tconst controlsDisabled = disabled || submitting || formIsSubmitting;\n\n\tuseEffect(() => {\n\t\tif (value !== undefined) reset(value);\n\t}, [reset, value]);\n\n\tuseEffect(() => {\n\t\tif (resetKey === undefined) return;\n\t\treset(value ?? initialValue);\n\t}, [initialValue, reset, resetKey, value]);\n\n\tconst emitChange = (next: SyncRangeDialogFormValues) => {\n\t\tonValueChange?.(next);\n\t};\n\n\tconst submit: SubmitHandler<SyncRangeDialogFormValues> = async (values) => {\n\t\ttry {\n\t\t\tconst transform =\n\t\t\t\ttransformSubmit ?? (defaultTransformSubmit as unknown as (value: SyncRangeDialogFormValues) => TSubmit);\n\t\t\tawait onSubmit(transform(values), values);\n\t\t} catch (error) {\n\t\t\tif (import.meta.env?.DEV) {\n\t\t\t\tconsole.warn('[SyncRangeDialogForm] Submit failed.', error);\n\t\t\t}\n\t\t\tonError?.(error);\n\t\t}\n\t};\n\n\treturn (\n\t\t<Stack\n\t\t\trender={<form />}\n\t\t\tgap=\"xl\"\n\t\t\tid={formId}\n\t\t\tonSubmit={handleSubmit(submit)}\n\t\t\tclassName=\"sync-range-dialog-form--component\"\n\t\t\taria-busy={submitting || formIsSubmitting || undefined}\n\t\t>\n\t\t\t<Stack render={<section />} gap=\"md\" className=\"sync-range-dialog-form--section\">\n\t\t\t\t<Stack gap=\"dense\" className=\"sync-range-dialog-form--section-header\">\n\t\t\t\t\t<Label>{strings.hoursLabel}</Label>\n\t\t\t\t\t<Text size=\"xs\" type=\"secondary\">\n\t\t\t\t\t\t{strings.hoursDescription}\n\t\t\t\t\t</Text>\n\t\t\t\t</Stack>\n\t\t\t\t<Controller\n\t\t\t\t\tname=\"hours\"\n\t\t\t\t\tcontrol={control}\n\t\t\t\t\trules={{ required: true }}\n\t\t\t\t\trender={({ field }) => (\n\t\t\t\t\t\t<CardRadioGroup\n\t\t\t\t\t\t\toptions={options}\n\t\t\t\t\t\t\tvalue={field.value}\n\t\t\t\t\t\t\tonValueChange={(hours) => {\n\t\t\t\t\t\t\t\tfield.onChange(hours);\n\t\t\t\t\t\t\t\temitChange({ ...getValues(), hours });\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tname={field.name}\n\t\t\t\t\t\t\tcolumns={2}\n\t\t\t\t\t\t\tinvalid={Boolean(getError('hours'))}\n\t\t\t\t\t\t\tdisabled={controlsDisabled}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t/>\n\n\t\t\t\t{getError('hours') && <Text type=\"error\">{getError('hours')}</Text>}\n\t\t\t</Stack>\n\n\t\t\t{!!syncOptions && syncOptions.length > 0 && (\n\t\t\t\t<section className=\"sync-range-dialog-form--section rounded-inner border border-border/70 bg-muted/20 p-surface\">\n\t\t\t\t\t<Stack gap=\"md\">\n\t\t\t\t\t\t<Stack gap=\"dense\" className=\"sync-range-dialog-form--section-header\">\n\t\t\t\t\t\t\t<Label>{strings.optionsLabel}</Label>\n\t\t\t\t\t\t\t<Text size=\"xs\" type=\"secondary\">\n\t\t\t\t\t\t\t\t{strings.optionsDescription}\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t<Controller\n\t\t\t\t\t\t\tname=\"options\"\n\t\t\t\t\t\t\tcontrol={control}\n\t\t\t\t\t\t\trender={({ field }) => (\n\t\t\t\t\t\t\t\t<CardCheckboxGroup\n\t\t\t\t\t\t\t\t\toptions={syncOptions}\n\t\t\t\t\t\t\t\t\tvalue={field.value}\n\t\t\t\t\t\t\t\t\tonValueChange={(nextOptions) => {\n\t\t\t\t\t\t\t\t\t\tfield.onChange(nextOptions);\n\t\t\t\t\t\t\t\t\t\temitChange({\n\t\t\t\t\t\t\t\t\t\t\t...getValues(),\n\t\t\t\t\t\t\t\t\t\t\toptions: nextOptions,\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\tcolumns={2}\n\t\t\t\t\t\t\t\t\tdisabled={controlsDisabled}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</Stack>\n\t\t\t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AAQ,CAAA;GAC5D;EAEN,CAAA,GAAA,CAAC,CAACC,KAAeA,EAAY,SAAS,KACtC,kBAAC,WAAD;GAAS,WAAU;GAClB,UAAA,kBAACvC,GAAD;IAAO,KAAI;IAAX,UAAA,CACC,kBAACA,GAAD;KAAO,KAAI;KAAQ,WAAU;KAA7B,UAAA,CACC,kBAACkC,GAAD,EAAA,UAAQtB,EAAQ,aAAoB,CAAA,GACpC,kBAACb,GAAD;MAAM,MAAK;MAAK,MAAK;MACnB,UAAAa,EAAQ;KACJ,CAAA,CACA;IACP,CAAA,GAAA,kBAACuB,GAAD;KACC,MAAK;KACI;KACT,SAAS,EAAE,eACV,kBAACK,GAAD;MACC,SAASD;MACT,OAAOH,EAAM;MACb,gBAAgB,MAAgB;OAE/B,AADAA,EAAM,SAASK,CAAW,GAC1Bd,EAAW;QACV,GAAGU,EAAU;QACb,SAASI;OACV,CAAC;MACF;MACA,SAAS;MACT,UAAUpB;KACV,CAAA;IAEF,CAAA,CACK;;EACC,CAAA,CAEJ;;AAET;AAEA,EAAoB,cAAc"}
|
|
1
|
+
{"version":3,"file":"sync.js","names":["Label","Text","Stack","CardRadioGroup","useFormErrors","errors","error","defaultSyncRangeDialogFormStrings","defaultTransformSubmit","hours","value","SyncRangeDialogForm","stringsProp","props","strings","useStrings","key","nextValue","initialValue","useMemo","defaultValue","formIsSubmitting","useForm","controlsDisabled","disabled","submitting","useEffect","reset","resetKey","emitChange","next","formId","handleSubmit","onSubmit","transformSubmit","values","Controller","field","getValues","getError","syncOptions","CardCheckboxGroup","nextOptions"],"sources":["../../src/hooks/useFormErrors.ts","../../src/components/features/sync/sync.strings.ts","../../src/components/features/sync/sync-range-dialog-form.tsx"],"sourcesContent":["type ErrorKey<T> = Extract<keyof T, string>;\n\ntype ErrorBag<T> = Partial<Record<ErrorKey<T> | 'server' | 'general', string>>;\n\nexport const useFormErrors = <T extends Record<string, unknown> = Record<string, unknown>>(\n\terrors?: ErrorBag<T>,\n) => {\n\n\tconst getError = (error: ErrorKey<T>) => {\n\t\tif (!errors) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn errors[error];\n\t};\n\n\tconst hasError = (error: ErrorKey<T>) => {\n\t\treturn errors !== undefined && errors[error] !== undefined;\n\t};\n\n\treturn {\n\t\tgetError,\n\t\thasError,\n\t};\n};\n","/**\n * Default user-facing strings for `<SyncRangeDialogForm>`.\n *\n * Consumers wire backend i18n at the call site:\n *\n * <SyncRangeDialogForm strings={{ optionsLabel: t('sync.options') }} … />\n */\n\nexport interface SyncRangeDialogFormStrings {\n\t/** Label rendered above the required sync-window radio group. */\n\thoursLabel: string;\n\t/** Helper copy rendered below the sync-window label. */\n\thoursDescription: string;\n\t/** Label rendered above the optional sync-options checkbox group. */\n\toptionsLabel: string;\n\t/** Helper copy rendered below the optional sync-options label. */\n\toptionsDescription: string;\n}\n\nexport const defaultSyncRangeDialogFormStrings: SyncRangeDialogFormStrings = {\n\thoursLabel: 'Sync window',\n\thoursDescription: 'Choose how far back the integration should reconcile records.',\n\toptionsLabel: 'Options',\n\toptionsDescription: 'Limit the run when the repair only needs a specific record family.',\n};\n","import { useEffect, useMemo } from 'react';\nimport { Controller, type SubmitHandler, useForm } from 'react-hook-form';\nimport { CardCheckboxGroup, CardRadioGroup } from '../../base/choice-inputs';\nimport { Stack } from '../../base/structure';\nimport { Label, Text } from '../../typography';\nimport { useFormErrors } from '../../../hooks/useFormErrors';\nimport { useStrings } from '../../../lib/strings';\n\nimport { defaultSyncRangeDialogFormStrings } from './sync.strings';\nimport type { SyncRangeDialogFormProps, SyncRangeDialogFormSubmit, SyncRangeDialogFormValues } from './sync.types';\n\nfunction defaultTransformSubmit(value: SyncRangeDialogFormValues): SyncRangeDialogFormSubmit {\n\tconst hours = Number(value.hours);\n\tif (!Number.isFinite(hours)) {\n\t\tthrow new TypeError('SyncRangeDialogForm requires numeric range values unless transformSubmit is provided.');\n\t}\n\n\treturn {\n\t\thours,\n\t\toptions: [...value.options],\n\t};\n}\n\nexport function SyncRangeDialogForm<TSubmit = SyncRangeDialogFormSubmit>(props: SyncRangeDialogFormProps<TSubmit>) {\n\tconst {\n\t\tformId,\n\t\toptions,\n\t\tsyncOptions,\n\t\tvalue,\n\t\tdefaultValue,\n\t\tonValueChange,\n\t\ttransformSubmit,\n\t\tonSubmit,\n\t\tonError,\n\t\tresetKey,\n\t\tdisabled = false,\n\t\tsubmitting = false,\n\t\terrors,\n\t\tstrings: stringsProp,\n\t} = props;\n\tconst strings = useStrings(defaultSyncRangeDialogFormStrings, stringsProp);\n\tconst normalizedErrors = Object.fromEntries(\n\t\tObject.entries(errors ?? {}).map(([key, nextValue]) => [key, Array.isArray(nextValue) ? nextValue[0] : nextValue]),\n\t) as Partial<Record<string, string>>;\n\tconst { getError } = useFormErrors(normalizedErrors);\n\tconst initialValue = useMemo<SyncRangeDialogFormValues>(\n\t\t() => ({\n\t\t\thours: defaultValue?.hours ?? '24',\n\t\t\toptions: [...(defaultValue?.options ?? [])],\n\t\t}),\n\t\t[defaultValue?.hours, defaultValue?.options],\n\t);\n\n\tconst {\n\t\tcontrol,\n\t\tgetValues,\n\t\thandleSubmit,\n\t\treset,\n\t\tformState: { isSubmitting: formIsSubmitting },\n\t} = useForm<SyncRangeDialogFormValues>({\n\t\tdefaultValues: value ?? initialValue,\n\t});\n\tconst controlsDisabled = disabled || submitting || formIsSubmitting;\n\n\tuseEffect(() => {\n\t\tif (value !== undefined) reset(value);\n\t}, [reset, value]);\n\n\tuseEffect(() => {\n\t\tif (resetKey === undefined) return;\n\t\treset(value ?? initialValue);\n\t}, [initialValue, reset, resetKey, value]);\n\n\tconst emitChange = (next: SyncRangeDialogFormValues) => {\n\t\tonValueChange?.(next);\n\t};\n\n\tconst submit: SubmitHandler<SyncRangeDialogFormValues> = async (values) => {\n\t\ttry {\n\t\t\tconst transform =\n\t\t\t\ttransformSubmit ?? (defaultTransformSubmit as unknown as (value: SyncRangeDialogFormValues) => TSubmit);\n\t\t\tawait onSubmit(transform(values), values);\n\t\t} catch (error) {\n\t\t\tif (import.meta.env?.DEV) {\n\t\t\t\tconsole.warn('[SyncRangeDialogForm] Submit failed.', error);\n\t\t\t}\n\t\t\tonError?.(error);\n\t\t}\n\t};\n\n\treturn (\n\t\t<Stack\n\t\t\trender={<form />}\n\t\t\tgap=\"xl\"\n\t\t\tid={formId}\n\t\t\tonSubmit={handleSubmit(submit)}\n\t\t\tclassName=\"sync-range-dialog-form--component\"\n\t\t\taria-busy={submitting || formIsSubmitting || undefined}\n\t\t>\n\t\t\t<Stack render={<section />} gap=\"md\" className=\"sync-range-dialog-form--section\">\n\t\t\t\t<Stack gap=\"dense\" className=\"sync-range-dialog-form--section-header\">\n\t\t\t\t\t<Label>{strings.hoursLabel}</Label>\n\t\t\t\t\t<Text size=\"xs\" type=\"secondary\">\n\t\t\t\t\t\t{strings.hoursDescription}\n\t\t\t\t\t</Text>\n\t\t\t\t</Stack>\n\t\t\t\t<Controller\n\t\t\t\t\tname=\"hours\"\n\t\t\t\t\tcontrol={control}\n\t\t\t\t\trules={{ required: true }}\n\t\t\t\t\trender={({ field }) => (\n\t\t\t\t\t\t<CardRadioGroup\n\t\t\t\t\t\t\toptions={options}\n\t\t\t\t\t\t\tvalue={field.value}\n\t\t\t\t\t\t\tonValueChange={(hours) => {\n\t\t\t\t\t\t\t\tfield.onChange(hours);\n\t\t\t\t\t\t\t\temitChange({ ...getValues(), hours });\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tname={field.name}\n\t\t\t\t\t\t\tcolumns={2}\n\t\t\t\t\t\t\tinvalid={Boolean(getError('hours'))}\n\t\t\t\t\t\t\tdisabled={controlsDisabled}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t/>\n\n\t\t\t\t{getError('hours') && <Text type=\"error\">{getError('hours')}</Text>}\n\t\t\t</Stack>\n\n\t\t\t{!!syncOptions && syncOptions.length > 0 && (\n\t\t\t\t<section className=\"sync-range-dialog-form--section\">\n\t\t\t\t\t<Stack gap=\"md\">\n\t\t\t\t\t\t<Stack gap=\"dense\" className=\"sync-range-dialog-form--section-header\">\n\t\t\t\t\t\t\t<Label>{strings.optionsLabel}</Label>\n\t\t\t\t\t\t\t<Text size=\"xs\" type=\"secondary\">\n\t\t\t\t\t\t\t\t{strings.optionsDescription}\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t<Controller\n\t\t\t\t\t\t\tname=\"options\"\n\t\t\t\t\t\t\tcontrol={control}\n\t\t\t\t\t\t\trender={({ field }) => (\n\t\t\t\t\t\t\t\t<CardCheckboxGroup\n\t\t\t\t\t\t\t\t\toptions={syncOptions}\n\t\t\t\t\t\t\t\t\tvalue={field.value}\n\t\t\t\t\t\t\t\t\tonValueChange={(nextOptions) => {\n\t\t\t\t\t\t\t\t\t\tfield.onChange(nextOptions);\n\t\t\t\t\t\t\t\t\t\temitChange({\n\t\t\t\t\t\t\t\t\t\t\t...getValues(),\n\t\t\t\t\t\t\t\t\t\t\toptions: nextOptions,\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\tcolumns={2}\n\t\t\t\t\t\t\t\t\tdisabled={controlsDisabled}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</Stack>\n\t\t\t\t</section>\n\t\t\t)}\n\t\t</Stack>\n\t);\n}\n\nSyncRangeDialogForm.displayName = 'SyncRangeDialogForm';\n"],"mappings":";;;;;;;;;AAIA,IAAaI,KACZ,OAeO;CACN,WAbiB,MAAuB;EACxC,IAAKC,GAIL,OAAOA,EAAOC;CACf;CAQC,WANiB,MACVD,MAAW,KAAA,KAAaA,EAAOC,OAAW,KAAA;AAMlD,ICJYC,IAAgE;CAC5E,YAAY;CACZ,kBAAkB;CAClB,cAAc;CACd,oBAAoB;AACrB;;;ACbA,SAASC,EAAuB,GAA6D;CAC5F,IAAMC,IAAQ,O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AK;KACI;KACT,SAAS,EAAE,eACV,kBAACK,GAAD;MACC,SAASD;MACT,OAAOH,EAAM;MACb,gBAAgB,MAAgB;OAE/B,AADAA,EAAM,SAASK,CAAW,GAC1Bb,EAAW;QACV,GAAGS,EAAU;QACb,SAASI;OACV,CAAC;MACF;MACA,SAAS;MACT,UAAUnB;KACV,CAAA;IAEF,CAAA,CACK;;EACC,CAAA,CAEJ;;AAET;AAEA,EAAoB,cAAc"}
|
package/dist/features/table.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { A as e, C as t, D as n, E as r, M as i, N as a, O 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-
|
|
2
|
+
import { A as e, C as t, D as n, E as r, M as i, N as a, O 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-Dn4XSrSB.js";
|
|
3
3
|
export { D as AvatarCell, b as CellStack, O as CellValue, h as ColumnVisibilityToggle, S as CurrencyCell, m as DataTable, o 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, a as useDataTableScrollState, w as useDataTableSize };
|