themelia-ui 3.0.0 → 3.2.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/.agents/skills/themelia-ui/SKILL.md +60 -33
- package/.agents/skills/themelia-ui/manifest.json +23 -0
- package/.agents/skills/themelia-ui/references/api-compatibility.md +5 -4
- package/.agents/skills/themelia-ui/references/blocks.md +123 -0
- package/.agents/skills/themelia-ui/references/composition-ladder.md +8 -8
- package/.agents/skills/themelia-ui/references/composition.md +100 -19
- package/.agents/skills/themelia-ui/references/forms.md +23 -3
- package/.agents/skills/themelia-ui/references/framework-wiring.md +41 -13
- package/.agents/skills/themelia-ui/references/i18n.md +4 -2
- package/.agents/skills/themelia-ui/references/imports.md +104 -104
- package/.agents/skills/themelia-ui/references/installation.md +60 -31
- package/.agents/skills/themelia-ui/references/migration.md +156 -5
- package/.agents/skills/themelia-ui/references/provider-and-scoping.md +37 -25
- package/.agents/skills/themelia-ui/references/reference-workflows.md +43 -0
- package/.agents/skills/themelia-ui/references/structure-and-spacing.md +147 -0
- package/.agents/skills/themelia-ui/references/theming.md +174 -131
- package/.agents/skills/themelia-ui/references/troubleshooting.md +88 -30
- package/.agents/skills/themelia-ui/references/verification.md +60 -5
- package/CHANGELOG.md +212 -0
- package/README.md +48 -60
- package/dist/accordion-CHuzMmWL.js +143 -0
- package/dist/{action-menu-BNLURfMK.js → action-menu-BwiL_F6I.js} +35 -33
- package/dist/{alert-dialog-BMVo6Z-8.js → alert-dialog-Cg2HhuBe.js} +1 -1
- package/dist/avatar-Dc_BNYfB.js +93 -0
- package/dist/badge-VlJVZjdm.js +45 -0
- package/dist/base/accordion.js +1 -1
- package/dist/base/action-menu.js +1 -1
- package/dist/base/alert-dialog.js +1 -1
- package/dist/base/aspect-ratio.js +3 -1
- package/dist/base/avatar.js +1 -1
- package/dist/base/badge.js +2 -2
- package/dist/base/batch-action-bar.js +1 -1
- package/dist/base/buttons.js +1 -1
- package/dist/base/cards.js +1 -1
- package/dist/base/carousel.js +6 -4
- package/dist/base/chart.js +1 -1
- package/dist/base/choice-inputs.js +1 -1
- package/dist/base/combobox.js +1 -1
- package/dist/base/command.js +1 -1
- package/dist/base/context-menu.js +22 -21
- package/dist/base/copyable.js +1 -1
- package/dist/base/date-pickers.js +1 -1
- package/dist/base/dialog.js +1 -1
- package/dist/base/display.js +1 -1
- package/dist/base/dropdown-menu.js +1 -1
- package/dist/base/feedback.js +1 -1
- package/dist/base/forms-numeric.js +1 -1
- package/dist/base/forms.js +1 -1
- package/dist/base/hover-card.js +26 -23
- package/dist/base/input-group.js +1 -1
- package/dist/base/item.js +1 -1
- package/dist/base/label.js +1 -1
- package/dist/base/menubar.js +20 -14
- package/dist/base/navigation-menu.js +47 -38
- package/dist/base/navigation.js +1 -1
- package/dist/base/otp-input.js +36 -30
- package/dist/base/overlay.js +1 -1
- package/dist/base/popover-menu.js +1 -1
- package/dist/base/popover.js +1 -1
- package/dist/base/qr-code.js +51 -47
- package/dist/base/repeaters.js +1 -1
- package/dist/base/resizable.js +2 -0
- package/dist/base/sheet.js +1 -1
- package/dist/base/sidebar.js +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 +1 -1
- package/dist/base/timeline.js +1 -1
- package/dist/base/toaster.js +1 -1
- package/dist/base/toggle.js +21 -15
- package/dist/base/toolbar.js +1 -1
- package/dist/base/tooltip.js +1 -1
- package/dist/base/typography.js +2 -2
- package/dist/base/upload.js +1 -1
- package/dist/base/value-inputs.js +1 -1
- package/dist/{batch-action-bar-BZYNKXdV.js → batch-action-bar-DZVMVW83.js} +11 -8
- package/dist/{admin/patterns → blocks/admin}/access.js +79 -76
- package/dist/blocks/admin/commerce.js +2493 -0
- package/dist/{patterns → blocks}/analytics.js +312 -303
- package/dist/{patterns → blocks}/onboarding.js +27 -23
- package/dist/{patterns → blocks}/timelines.js +1 -1
- package/dist/buttons-BX2JfL5X.js +173 -0
- package/dist/cards-Ddhz43Bz.js +279 -0
- package/dist/chart-BkK3Xm10.js +201 -0
- package/dist/choice-inputs-NwRxvmZN.js +694 -0
- package/dist/combobox-519ubijc.js +292 -0
- package/dist/command-JjApYFds.js +156 -0
- package/dist/comments-CCQ2QRaU.js +1443 -0
- package/dist/components/base/action-menu/action-menu.d.ts +1 -1
- package/dist/components/base/action-menu/action-menu.types.d.ts +2 -2
- package/dist/components/base/avatar/avatar.d.ts +5 -2
- package/dist/components/base/badge/badge.d.ts +10 -10
- package/dist/components/base/badge/badge.variants.d.ts +1 -2
- package/dist/components/base/badge/index.d.ts +1 -2
- package/dist/components/base/buttons/button.d.ts +9 -8
- package/dist/components/base/buttons/button.types.d.ts +2 -2
- package/dist/components/base/buttons/index.d.ts +1 -1
- package/dist/components/base/buttons/text-button.d.ts +1 -1
- package/dist/components/base/cards/card-actions.d.ts +1 -1
- package/dist/components/base/cards/card.d.ts +3 -1
- package/dist/components/base/cards/partials/card-header.d.ts +2 -1
- package/dist/components/base/choice-inputs/choice.types.d.ts +2 -2
- package/dist/components/base/choice-inputs/partials/choice-parts.d.ts +3 -3
- package/dist/components/base/command/command.d.ts +5 -2
- package/dist/components/base/display/icon-badge.d.ts +5 -3
- package/dist/components/base/display/index.d.ts +1 -1
- package/dist/components/base/display/metadata-list.d.ts +6 -6
- package/dist/components/base/display/metadata-value.d.ts +1 -1
- package/dist/components/base/display/separator.d.ts +2 -2
- package/dist/components/base/feedback/alert.d.ts +3 -2
- package/dist/components/base/feedback/empty.d.ts +5 -4
- package/dist/components/base/feedback/progress-circle.d.ts +2 -2
- package/dist/components/base/feedback/progress.d.ts +3 -1
- package/dist/components/base/forms/form-field.d.ts +2 -2
- package/dist/components/base/input-group/input-group.d.ts +8 -10
- package/dist/components/base/item/item.d.ts +2 -2
- package/dist/components/base/overlay/index.d.ts +1 -1
- package/dist/components/base/overlay/overlay.types.d.ts +7 -5
- package/dist/components/base/qr-code/qr-code.d.ts +4 -4
- package/dist/components/base/sheet/sheet.d.ts +1 -1
- package/dist/components/base/sidebar/sidebar.d.ts +9 -13
- package/dist/components/base/spinner/spinner.d.ts +2 -2
- package/dist/components/base/structure/adaptive-grid.d.ts +3 -3
- package/dist/components/base/structure/bleed.d.ts +4 -2
- package/dist/components/base/structure/grid.d.ts +10 -4
- package/dist/components/base/structure/index.d.ts +1 -1
- package/dist/components/base/structure/split.d.ts +4 -3
- package/dist/components/base/structure/stack.d.ts +5 -5
- package/dist/components/base/structure/structure.maps.d.ts +2 -1
- package/dist/components/base/structure/structure.types.d.ts +10 -4
- package/dist/components/base/toggle/toggle.d.ts +2 -2
- package/dist/components/base/toolbar/toolbar.d.ts +3 -3
- package/dist/components/base/typography/index.d.ts +2 -0
- package/dist/components/base/typography/rich-text/rich-text.variants.d.ts +9 -0
- package/dist/components/base/typography/text/index.d.ts +1 -0
- package/dist/components/base/typography/text/text.d.ts +15 -8
- package/dist/components/base/typography/text/text.variants.d.ts +41 -0
- package/dist/components/base/value-inputs/color-input.d.ts +1 -7
- package/dist/components/base/value-inputs/slider.d.ts +2 -7
- package/dist/components/{admin/patterns → blocks/admin}/commerce/vendor-profile.d.ts +2 -1
- package/dist/components/{patterns → blocks}/analytics/analytics.strings.d.ts +2 -5
- package/dist/components/features/actions/action-adapters.d.ts +3 -3
- package/dist/components/features/actions/actions.types.d.ts +3 -5
- package/dist/components/features/actions/index.d.ts +1 -1
- package/dist/components/features/activities/activities-feed.d.ts +1 -1
- package/dist/components/features/activities/activities.types.d.ts +4 -4
- package/dist/components/features/activities/activity-parts.d.ts +3 -3
- package/dist/components/features/activities/activity-row.d.ts +4 -4
- package/dist/components/features/activities/index.d.ts +1 -1
- package/dist/components/features/ai-chat/ai-chat.types.d.ts +10 -3
- package/dist/components/features/ai-chat/ai-message-surfaces.d.ts +1 -1
- package/dist/components/features/ai-chat/ai-work-surfaces.d.ts +1 -1
- package/dist/components/features/combobox/combobox.strings.d.ts +2 -2
- package/dist/components/features/combobox/fetching-combobox.d.ts +2 -1
- package/dist/components/features/combobox/resource-combobox.d.ts +3 -0
- package/dist/components/features/combobox/use-suggestions.d.ts +7 -0
- package/dist/components/features/event-calendar/event-calendar.types.d.ts +3 -0
- package/dist/components/features/media-library/index.d.ts +1 -1
- package/dist/components/features/media-library/media-library-parts.d.ts +4 -3
- package/dist/components/features/media-library/media-library-views.d.ts +4 -3
- package/dist/components/features/media-library/media-library.d.ts +1 -1
- package/dist/components/features/media-library/media-library.strings.d.ts +12 -13
- package/dist/components/features/media-library/media-library.types.d.ts +11 -9
- package/dist/components/features/media-library/media-resource-gallery.d.ts +1 -1
- package/dist/components/features/media-library/use-media-library.d.ts +1 -4
- package/dist/components/features/overlays/action-overlay-frame.d.ts +1 -1
- package/dist/components/features/overlays/index.d.ts +1 -1
- package/dist/components/features/overlays/overlay-parts.d.ts +3 -3
- package/dist/components/features/overlays/overlays.types.d.ts +8 -7
- package/dist/components/features/rich-text-editor/index.d.ts +0 -1
- package/dist/components/features/table/data-table-body.d.ts +1 -1
- package/dist/components/features/table/data-table-expanded-row.d.ts +27 -0
- package/dist/components/features/table/data-table-header.d.ts +1 -1
- package/dist/components/features/table/data-table-size.d.ts +1 -1
- package/dist/components/features/table/data-table.d.ts +1 -1
- package/dist/components/features/table/index.d.ts +1 -1
- package/dist/components/features/table/table-helpers.d.ts +9 -3
- package/dist/components/features/table/table.strings.d.ts +11 -0
- package/dist/components/features/table/table.types.d.ts +60 -2
- package/dist/components/features/theme-tweaker/index.d.ts +1 -1
- package/dist/components/features/theme-tweaker/theme-tweaker.strings.d.ts +1 -1
- package/dist/components/features/theme-tweaker/theme-tweaker.types.d.ts +6 -10
- package/dist/components/features/theme-tweaker/theme-tweaker.utils.d.ts +22 -6
- package/dist/components/layout/app-shell/topbar-sidebar-layout.d.ts +1 -1
- package/dist/components/layout/auth/auth.d.ts +1 -1
- package/dist/components/layout/auth/auth.types.d.ts +1 -1
- package/dist/components/primitives/value.d.ts +3 -1
- package/dist/containers-B8d8U9GS.js +2 -0
- package/dist/{copyable-H1TUEY-H.js → copyable-D9Okb1w6.js} +12 -11
- package/dist/core.css +2 -2
- package/dist/css/access.css +2 -1
- package/dist/css/accordion.css +2 -1
- package/dist/css/action-menu.css +2 -1
- package/dist/css/activities.css +2 -1
- package/dist/css/ai-chat.css +2 -1
- package/dist/css/analytics.css +2 -1
- package/dist/css/app-shell.css +2 -1
- package/dist/css/aspect-ratio.css +2 -1
- package/dist/css/async-preview.css +2 -1
- package/dist/css/auth.css +2 -1
- package/dist/css/avatar.css +2 -1
- package/dist/css/badge.css +2 -1
- package/dist/css/batch-action-bar.css +2 -1
- package/dist/css/buttons.css +2 -1
- package/dist/css/cards.css +2 -1
- package/dist/css/carousel.css +2 -1
- package/dist/css/chart.css +2 -1
- package/dist/css/choice-inputs.css +2 -1
- package/dist/css/combobox.css +2 -1
- package/dist/css/combobox2.css +2 -1
- package/dist/css/command.css +2 -1
- package/dist/css/comments.css +2 -1
- package/dist/css/commerce.css +2 -1
- package/dist/css/containers.css +2 -1
- package/dist/css/copyable.css +2 -1
- package/dist/css/data-view.css +2 -1
- package/dist/css/date-pickers.css +2 -1
- package/dist/css/display.css +2 -1
- package/dist/css/dropdown-menu.css +2 -1
- package/dist/css/event-calendar.css +2 -1
- package/dist/css/feedback.css +2 -1
- package/dist/css/filters.css +2 -1
- package/dist/css/forms-numeric.css +2 -1
- package/dist/css/forms.css +2 -1
- package/dist/css/global-search.css +2 -1
- package/dist/css/header.css +2 -1
- package/dist/css/hover-card.css +2 -1
- package/dist/css/input-group.css +2 -1
- package/dist/css/item.css +2 -1
- package/dist/css/kanban.css +2 -1
- package/dist/css/label.css +2 -1
- package/dist/css/map.css +2 -1
- package/dist/css/media-library.css +2 -1
- package/dist/css/mentions.css +2 -1
- package/dist/css/menubar.css +2 -1
- package/dist/css/navigation-menu.css +2 -1
- package/dist/css/navigation.css +2 -1
- package/dist/css/navigation2.css +2 -1
- package/dist/css/onboarding.css +2 -1
- package/dist/css/otp-input.css +2 -1
- package/dist/css/overlay.css +2 -1
- package/dist/css/overlays.css +2 -1
- package/dist/css/page.css +2 -1
- package/dist/css/popover-menu.css +2 -1
- package/dist/css/popover.css +2 -1
- package/dist/css/primitives.css +2 -1
- package/dist/css/products.css +2 -1
- package/dist/css/qr-code.css +2 -1
- package/dist/css/repeaters.css +2 -1
- package/dist/css/resizable.css +2 -1
- package/dist/css/resource-assignment.css +2 -1
- package/dist/css/resource.css +2 -1
- package/dist/css/rich-text-editor.css +2 -1
- package/dist/css/schema-form.css +2 -1
- package/dist/css/sidebar.css +2 -1
- package/dist/css/sidebar2.css +2 -1
- package/dist/css/skeleton.css +2 -1
- package/dist/css/spinner.css +2 -1
- package/dist/css/structure.css +2 -1
- package/dist/css/sync.css +2 -1
- package/dist/css/table.css +2 -1
- package/dist/css/table2.css +2 -1
- package/dist/css/text-inputs.css +2 -1
- package/dist/css/theme-tweaker.css +2 -1
- package/dist/css/timeline.css +2 -1
- package/dist/css/timelines.css +2 -1
- package/dist/css/toaster.css +2 -1
- package/dist/css/toggle.css +2 -1
- package/dist/css/toolbar.css +2 -1
- package/dist/css/tooltip.css +2 -1
- package/dist/css/typography.css +2 -1
- package/dist/css/upload.css +2 -1
- package/dist/css/value-inputs.css +2 -1
- package/dist/css/workspace.css +2 -1
- package/dist/css-graph.json +1027 -0
- package/dist/date-pickers-BwCwKIVM.js +685 -0
- package/dist/{dialog-CtFCuTUF.js → dialog-CAnwRNrm.js} +1 -1
- package/dist/display-a7AoX_u7.js +664 -0
- package/dist/dropdown-menu-Br8kvjrF.js +235 -0
- package/dist/empty.js +0 -0
- package/dist/features/actions.js +6 -6
- package/dist/features/activities.js +219 -216
- package/dist/features/ai-chat.js +593 -565
- package/dist/features/async-preview.js +105 -286
- package/dist/features/combobox.js +328 -314
- package/dist/features/comments.js +1 -1
- package/dist/features/data-view.js +56 -55
- package/dist/features/event-calendar.js +189 -185
- package/dist/features/filters.js +1 -1
- package/dist/features/global-search.js +259 -260
- package/dist/features/kanban.js +39 -37
- package/dist/features/map.js +357 -354
- package/dist/features/media-library.js +931 -931
- package/dist/features/mentions.js +1 -1
- package/dist/features/overlays.js +1 -1
- package/dist/features/products.js +950 -942
- package/dist/features/resource-assignment.js +39 -37
- package/dist/features/resource.js +70 -71
- package/dist/features/rich-text-editor.js +2 -2
- package/dist/features/schema-form.js +342 -338
- package/dist/features/sync.js +14 -12
- package/dist/features/table.js +1 -1
- package/dist/features/theme-tweaker.js +1002 -962
- package/dist/feedback-D4qVsKlD.js +430 -0
- package/dist/{filters-DOLKRSmb.js → filters-BhsTkWpZ.js} +386 -383
- package/dist/forms-C0WeNPFF.js +250 -0
- package/dist/forms-numeric-IwQ1ltNf.js +582 -0
- package/dist/hooks/use-native-dialog.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/input-group-HS_Z0Ei_.js +119 -0
- package/dist/item-M2pmpWXh.js +150 -0
- package/dist/{label-DumoMDm6.js → label-HOBXAscw.js} +7 -5
- package/dist/layout/app-shell.js +4 -2
- package/dist/layout/auth.js +102 -100
- package/dist/layout/header.js +190 -180
- package/dist/layout/navigation.js +1 -1
- package/dist/layout/page.js +18 -16
- package/dist/layout/settings.js +2 -2
- package/dist/layout/sidebar.js +50 -46
- package/dist/layout/workspace.js +71 -69
- package/dist/lib/action-presentation.d.ts +3 -3
- package/dist/lib/component-vocabulary.d.ts +2 -2
- package/dist/lib/css-length.d.ts +2 -0
- package/dist/lib/responsive.d.ts +1 -1
- package/dist/lib/theming/index.d.ts +1 -0
- package/dist/lib/theming/recipes.d.ts +2 -2
- package/dist/lib/theming/themes/dense.d.ts +3 -0
- package/dist/lib/theming/themes/editorial.d.ts +3 -0
- package/dist/lib/theming/themes/index.d.ts +8 -0
- package/dist/lib/theming/themes/pair.d.ts +7 -0
- package/dist/lib/theming/themes/sharp.d.ts +3 -0
- package/dist/lib/theming/themes/soft.d.ts +3 -0
- package/dist/lib/theming/themes/types.d.ts +12 -0
- package/dist/lib/ui-provider/index.d.ts +1 -1
- package/dist/lib/ui-provider/scope.d.ts +5 -8
- package/dist/lib/ui-provider/tokens.d.ts +11 -3
- package/dist/lib/ui-provider/tokens.generated.d.ts +6 -4
- package/dist/lib/ui-provider/types.d.ts +17 -19
- package/dist/lib/ui-provider/ui-scope.d.ts +1 -1
- package/dist/{mentions-BbsEHlcH.js → mentions-BOxbigwp.js} +113 -111
- package/dist/navigation-Bgu7Vc0M.js +622 -0
- package/dist/navigation-DiYACqpE.js +216 -0
- package/dist/overlay-BuQOl8aP.js +356 -0
- package/dist/{overlays-DvVoS3td.js → overlays-1sULyytH.js} +77 -75
- package/dist/popover-CA7SP_iz.js +127 -0
- package/dist/popover-menu-QXgQeWeG.js +192 -0
- package/dist/{primitives-D0bdDozz.js → primitives-BskKlf35.js} +181 -178
- package/dist/primitives.js +1 -1
- package/dist/profiles/admin.json +6 -36
- package/dist/profiles/general.json +6 -96
- package/dist/repeaters-CeH20dvr.js +445 -0
- package/dist/rich-text-editor-D_Ppm8yh.js +491 -0
- package/dist/{sheet-CKcmRbJ9.js → sheet-CJ1-OAla.js} +3 -3
- package/dist/sidebar-D8uGqxio.js +421 -0
- package/dist/skeleton-BTKNKTdj.js +173 -0
- package/dist/spinner-Tc1QCnxM.js +30 -0
- package/dist/{structure-D0WGQAP3.js → structure-CynEZ-OY.js} +15 -23
- package/dist/style.css +1 -1
- package/dist/styles/TOKENS.md +116 -275
- package/dist/styles/animation.css +114 -0
- package/dist/styles/base.css +7 -6
- package/dist/styles/fields.css +45 -63
- package/dist/styles/focus.css +12 -0
- package/dist/styles/forced-colors.css +11 -10
- package/dist/styles/index.css +23 -30
- package/dist/styles/map.css +45 -34
- package/dist/styles/mentions.css +14 -52
- package/dist/styles/overlays.css +7 -7
- package/dist/styles/tailwind.css +76 -127
- package/dist/styles/targets.css +3 -3
- package/dist/styles/theme/colour.css +86 -0
- package/dist/styles/theme/density.css +31 -0
- package/dist/styles/theme/elevation.css +9 -0
- package/dist/styles/theme/layout.css +18 -0
- package/dist/styles/theme/motion.css +18 -0
- package/dist/styles/theme/shape.css +12 -0
- package/dist/styles/theme/size.css +10 -0
- package/dist/styles/theme/spacing.css +11 -0
- package/dist/styles/theme/typography.css +20 -0
- package/dist/styles/tone.css +61 -0
- package/dist/table-B7dtIFUx.js +1262 -0
- package/dist/table-Ds_eO9av.js +191 -0
- package/dist/tailwind.css +76 -127
- package/dist/text-inputs-BboE77nZ.js +395 -0
- package/dist/theming-C5ygF5uf.js +292 -0
- package/dist/theming.js +2 -2
- package/dist/{timeline-BdaGRyj-.js → timeline-BR_jNgvz.js} +57 -49
- package/dist/{timelines-BB7550mz.js → timelines-DXG1BfIN.js} +69 -67
- package/dist/{toaster-bBMgXm8z.js → toaster-CXL8L7Mm.js} +106 -99
- package/dist/tokens.json +1027 -636
- package/dist/toolbar-DBK-c4yy.js +74 -0
- package/dist/tooltip-BPYP-jUm.js +76 -0
- package/dist/{typography-BkxEiwQ1.js → typography-DmeR05Er.js} +87 -53
- package/dist/{ui-provider-Cmoq6i_D.js → ui-provider-DpzLUD12.js} +117 -69
- package/dist/ui-provider.js +1 -1
- package/dist/upload-CYuoJykZ.js +968 -0
- package/dist/use-async-preview-BFwf9ElY.js +188 -0
- package/dist/value-inputs-ng8aVJJZ.js +728 -0
- package/docs/README.md +13 -3
- package/docs/build/browser-composition-fixture.ts +28 -0
- package/docs/build/recipes.md +11484 -10723
- package/docs/generated/component-index.json +9809 -9169
- package/docs/generated/components/INDEX.md +5 -5
- package/docs/generated/components/base--accordion.md +51 -2
- package/docs/generated/components/base--action-menu.md +14 -15
- package/docs/generated/components/base--alert-dialog.md +3 -4
- package/docs/generated/components/base--aspect-ratio.md +3 -4
- package/docs/generated/components/base--avatar.md +7 -7
- package/docs/generated/components/base--badge.md +159 -27
- package/docs/generated/components/base--batch-action-bar.md +6 -7
- package/docs/generated/components/base--buttons.md +151 -47
- package/docs/generated/components/base--cards.md +107 -14
- package/docs/generated/components/base--carousel.md +1 -2
- package/docs/generated/components/base--chart.md +44 -8
- package/docs/generated/components/base--choice-inputs.md +10 -11
- package/docs/generated/components/base--combobox.md +3 -4
- package/docs/generated/components/base--command.md +6 -6
- package/docs/generated/components/base--context-menu.md +1 -2
- package/docs/generated/components/base--copyable.md +6 -7
- package/docs/generated/components/base--date-pickers.md +6 -7
- package/docs/generated/components/base--dialog.md +6 -7
- package/docs/generated/components/base--direction.md +1 -1
- package/docs/generated/components/base--display.md +234 -54
- package/docs/generated/components/base--dropdown-menu.md +6 -7
- package/docs/generated/components/base--feedback.md +71 -18
- package/docs/generated/components/base--forms-numeric.md +6 -7
- package/docs/generated/components/base--forms.md +84 -14
- package/docs/generated/components/base--hover-card.md +3 -4
- package/docs/generated/components/base--input-group.md +27 -30
- package/docs/generated/components/base--item.md +8 -9
- package/docs/generated/components/base--label.md +2 -3
- package/docs/generated/components/base--menubar.md +2 -4
- package/docs/generated/components/base--navigation-menu.md +2 -3
- package/docs/generated/components/base--navigation.md +2 -3
- package/docs/generated/components/base--otp-input.md +3 -4
- package/docs/generated/components/base--overlay.md +56 -47
- package/docs/generated/components/base--popover-menu.md +7 -8
- package/docs/generated/components/base--popover.md +9 -10
- package/docs/generated/components/base--qr-code.md +7 -8
- package/docs/generated/components/base--repeaters.md +6 -7
- package/docs/generated/components/base--resizable.md +2 -3
- package/docs/generated/components/base--sheet.md +12 -13
- package/docs/generated/components/base--sidebar.md +9 -11
- package/docs/generated/components/base--skeleton.md +6 -7
- package/docs/generated/components/base--slot.md +1 -1
- package/docs/generated/components/base--spinner.md +5 -7
- package/docs/generated/components/base--structure.md +320 -70
- package/docs/generated/components/base--table.md +61 -3
- package/docs/generated/components/base--text-inputs.md +17 -18
- package/docs/generated/components/base--timeline.md +45 -4
- package/docs/generated/components/base--toaster.md +43 -12
- package/docs/generated/components/base--toggle.md +11 -12
- package/docs/generated/components/base--toolbar.md +7 -8
- package/docs/generated/components/base--tooltip.md +5 -6
- package/docs/generated/components/base--typography.md +317 -32
- package/docs/generated/components/base--upload.md +8 -9
- package/docs/generated/components/base--value-inputs.md +9 -38
- package/docs/generated/components/{admin--patterns--access.md → blocks--admin--access.md} +15 -6
- package/docs/generated/components/{admin--patterns--commerce.md → blocks--admin--commerce.md} +40 -41
- package/docs/generated/components/{patterns--analytics.md → blocks--analytics.md} +57 -14
- package/docs/generated/components/{patterns--onboarding.md → blocks--onboarding.md} +6 -7
- package/docs/generated/components/{patterns--timelines.md → blocks--timelines.md} +6 -7
- package/docs/generated/components/features--actions.md +8 -18
- package/docs/generated/components/features--activities.md +31 -32
- package/docs/generated/components/features--ai-chat.md +15 -15
- package/docs/generated/components/features--async-preview.md +5 -6
- package/docs/generated/components/features--combobox.md +71 -5
- package/docs/generated/components/features--comments.md +0 -1
- package/docs/generated/components/features--data-view.md +63 -8
- package/docs/generated/components/features--event-calendar.md +1 -2
- package/docs/generated/components/features--filters.md +11 -2
- package/docs/generated/components/features--global-search.md +1 -2
- package/docs/generated/components/features--kanban.md +1 -2
- package/docs/generated/components/features--map.md +1 -2
- package/docs/generated/components/features--media-library.md +105 -38
- package/docs/generated/components/features--mentions.md +7 -7
- package/docs/generated/components/features--overlays.md +75 -22
- package/docs/generated/components/features--products.md +10 -11
- package/docs/generated/components/features--resource-assignment.md +2 -3
- package/docs/generated/components/features--resource.md +3 -4
- package/docs/generated/components/features--rich-text-editor.md +42 -13
- package/docs/generated/components/features--schema-form.md +1 -2
- package/docs/generated/components/features--sync.md +2 -3
- package/docs/generated/components/features--table.md +162 -12
- package/docs/generated/components/features--theme-tweaker.md +30 -15
- package/docs/generated/components/forms.md +2 -2
- package/docs/generated/components/layout--app-shell.md +41 -11
- package/docs/generated/components/layout--auth.md +8 -9
- package/docs/generated/components/layout--containers.md +40 -1
- package/docs/generated/components/layout--header.md +2 -3
- package/docs/generated/components/layout--navigation.md +0 -1
- package/docs/generated/components/layout--page.md +33 -5
- package/docs/generated/components/layout--settings.md +0 -1
- package/docs/generated/components/layout--sidebar.md +47 -7
- package/docs/generated/components/layout--workspace.md +3 -4
- package/docs/generated/components/primitives.md +128 -17
- package/docs/generated/components/theming.md +147 -4
- package/docs/generated/components/ui-provider.md +96 -78
- package/docs/generated/composition-ladder.md +8 -8
- package/docs/generated/consumer-contract.json +5736 -0
- package/docs/generated/imports.md +104 -104
- package/docs/generated/migration-broad-imports.json +267 -90
- package/docs/generated/migration-broad-imports.md +266 -101
- package/docs/generated/migration-codemod.json +365 -70
- package/docs/generated/migration.md +665 -95
- package/docs/generated/profiles.md +27 -27
- package/docs/generated/public-api.md +104 -102
- package/docs/generated/recipes.json +755 -810
- package/docs/generated/workflows/communications-overview/analytics/communications-reference.tsx +19 -0
- package/docs/generated/workflows/index.json +691 -0
- package/docs/generated/workflows/media-picking/media-library/media-picking-reference.tsx +63 -0
- package/docs/generated/workflows/media-picking/media-library/reference-data.ts +3 -0
- package/docs/generated/workflows/multi-section-form/form-workflow/multi-section-reference.tsx +46 -0
- package/docs/generated/workflows/nested-action-flow/action-overlays/nested-action-reference.tsx +39 -0
- package/docs/generated/workflows/record-detail/page-layout/record-detail-reference.tsx +24 -0
- package/docs/generated/workflows/resource-index/data-view/resource-index-reference.tsx +51 -0
- package/docs/generated/workflows/scoped-resource-selection/combobox/scoped-resource-reference.tsx +50 -0
- package/docs/generated/workflows/website-content-editor/media-library/reference-data.ts +3 -0
- package/docs/generated/workflows/website-content-editor/rich-text-editor/website-content-reference.tsx +33 -0
- package/docs/generated/workflows/workspace-navigation/app-shell/workspace-navigation-reference.tsx +26 -0
- package/docs/learn/api-compatibility.md +5 -4
- package/docs/learn/blocks.md +123 -0
- package/docs/learn/composition.md +100 -19
- package/docs/learn/forms.md +23 -3
- package/docs/learn/framework-wiring.md +41 -13
- package/docs/learn/i18n.md +4 -2
- package/docs/learn/installation.md +60 -31
- package/docs/learn/migration.md +156 -5
- package/docs/learn/provider-and-scoping.md +37 -25
- package/docs/learn/reference-workflows.md +43 -0
- package/docs/learn/structure-and-spacing.md +147 -0
- package/docs/learn/theming.md +174 -131
- package/docs/learn/troubleshooting.md +88 -30
- package/docs/learn/verification.md +60 -5
- package/package.json +42 -473
- package/scripts/consumer/codemod.mjs +50 -32
- package/scripts/consumer/contract-reader.mjs +42 -0
- package/scripts/consumer/css-scan.mjs +51 -0
- package/scripts/consumer/diagnose.mjs +136 -0
- package/scripts/consumer/find-component.mjs +30 -17
- package/scripts/consumer/install-skill.mjs +93 -11
- package/src/styles/TOKENS.md +116 -275
- package/dist/accordion-6YPJ9XRO.js +0 -135
- package/dist/admin/patterns/access.css +0 -15
- package/dist/admin/patterns/commerce.css +0 -29
- package/dist/admin/patterns/commerce.js +0 -2493
- package/dist/avatar-CS7zow2q.js +0 -85
- package/dist/badge-CxOuTfVr.js +0 -63
- package/dist/base/accordion.css +0 -3
- package/dist/base/action-menu.css +0 -6
- package/dist/base/alert-dialog.css +0 -4
- package/dist/base/aspect-ratio.css +0 -2
- package/dist/base/avatar.css +0 -4
- package/dist/base/badge.css +0 -2
- package/dist/base/batch-action-bar.css +0 -5
- package/dist/base/buttons.css +0 -4
- package/dist/base/cards.css +0 -13
- package/dist/base/carousel.css +0 -5
- package/dist/base/chart.css +0 -2
- package/dist/base/choice-inputs.css +0 -10
- package/dist/base/combobox.css +0 -3
- package/dist/base/command.css +0 -9
- package/dist/base/context-menu.css +0 -2
- package/dist/base/copyable.css +0 -6
- package/dist/base/date-pickers.css +0 -11
- package/dist/base/dialog.css +0 -4
- package/dist/base/display.css +0 -8
- package/dist/base/dropdown-menu.css +0 -2
- package/dist/base/feedback.css +0 -5
- package/dist/base/forms-numeric.css +0 -12
- package/dist/base/forms.css +0 -14
- package/dist/base/hover-card.css +0 -2
- package/dist/base/input-group.css +0 -6
- package/dist/base/item.css +0 -9
- package/dist/base/label.css +0 -3
- package/dist/base/menubar.css +0 -2
- package/dist/base/navigation-menu.css +0 -2
- package/dist/base/navigation.css +0 -12
- package/dist/base/otp-input.css +0 -9
- package/dist/base/overlay.css +0 -4
- package/dist/base/popover-menu.css +0 -11
- package/dist/base/popover.css +0 -3
- package/dist/base/qr-code.css +0 -2
- package/dist/base/repeaters.css +0 -18
- package/dist/base/resizable.css +0 -2
- package/dist/base/sheet.css +0 -4
- package/dist/base/sidebar.css +0 -12
- package/dist/base/skeleton.css +0 -9
- package/dist/base/spinner.css +0 -2
- package/dist/base/structure.css +0 -2
- package/dist/base/table.css +0 -3
- package/dist/base/text-inputs.css +0 -2
- package/dist/base/timeline.css +0 -9
- package/dist/base/toaster.css +0 -2
- package/dist/base/toggle.css +0 -2
- package/dist/base/toolbar.css +0 -5
- package/dist/base/tooltip.css +0 -2
- package/dist/base/typography.css +0 -2
- package/dist/base/upload.css +0 -10
- package/dist/base/value-inputs.css +0 -14
- package/dist/buttons-CqXKWty3.js +0 -179
- package/dist/cards-C6Ulbkw7.js +0 -271
- package/dist/chart-nomhJ87z.js +0 -193
- package/dist/choice-inputs-OUDn0kQw.js +0 -680
- package/dist/combobox-C8oP92bT.js +0 -266
- package/dist/command-Bp3B6pUu.js +0 -143
- package/dist/comments-CAnDlyXO.js +0 -1438
- package/dist/components/admin/patterns/index.d.ts +0 -2
- package/dist/components/features/rich-text-editor/exec-command-engine.d.ts +0 -2
- package/dist/components/patterns/index.d.ts +0 -3
- package/dist/css/styles.css +0 -1
- package/dist/date-pickers-DOwIT-Nk.js +0 -661
- package/dist/display-B3Q17h5z.js +0 -645
- package/dist/dropdown-menu-TyNLCLML.js +0 -223
- package/dist/features/actions.css +0 -11
- package/dist/features/activities.css +0 -25
- package/dist/features/ai-chat.css +0 -14
- package/dist/features/async-preview.css +0 -10
- package/dist/features/combobox.css +0 -12
- package/dist/features/comments.css +0 -24
- package/dist/features/data-view.css +0 -31
- package/dist/features/event-calendar.css +0 -17
- package/dist/features/filters.css +0 -24
- package/dist/features/global-search.css +0 -19
- package/dist/features/kanban.css +0 -7
- package/dist/features/map.css +0 -15
- package/dist/features/media-library.css +0 -27
- package/dist/features/mentions.css +0 -17
- package/dist/features/overlays.css +0 -11
- package/dist/features/products.css +0 -29
- package/dist/features/resource-assignment.css +0 -14
- package/dist/features/resource.css +0 -15
- package/dist/features/rich-text-editor.css +0 -8
- package/dist/features/schema-form.css +0 -22
- package/dist/features/sync.css +0 -11
- package/dist/features/table.css +0 -20
- package/dist/features/theme-tweaker.css +0 -27
- package/dist/feedback-DRerHGuV.js +0 -469
- package/dist/forms-CPrGGif_.js +0 -242
- package/dist/forms-numeric-CPVsL7Vf.js +0 -569
- package/dist/index.css +0 -3
- package/dist/input-group-BYe0rhoB.js +0 -126
- package/dist/item-B3yQ26as.js +0 -146
- package/dist/layout/app-shell.css +0 -13
- package/dist/layout/auth.css +0 -14
- package/dist/layout/containers.css +0 -2
- package/dist/layout/header.css +0 -20
- package/dist/layout/navigation.css +0 -11
- package/dist/layout/page.css +0 -15
- package/dist/layout/settings.css +0 -16
- package/dist/layout/sidebar.css +0 -16
- package/dist/layout/workspace.css +0 -15
- package/dist/navigation-CsqTA16F.js +0 -614
- package/dist/navigation-DzxzPuwg.js +0 -202
- package/dist/overlay-WQOsLd69.js +0 -345
- package/dist/patterns/analytics.css +0 -15
- package/dist/patterns/onboarding.css +0 -11
- package/dist/patterns/timelines.css +0 -11
- package/dist/popover-DriLnIFc.js +0 -123
- package/dist/popover-menu-C2UCMAe7.js +0 -189
- package/dist/primitives.css +0 -3
- package/dist/repeaters-DuP1N0nw.js +0 -438
- package/dist/rich-text-editor-BQXFe9oN.js +0 -595
- package/dist/sidebar-D0N6ckJL.js +0 -412
- package/dist/skeleton-DGR9df28.js +0 -172
- package/dist/spinner-CUAVFecI.js +0 -52
- package/dist/styles/FACTORS.md +0 -36
- package/dist/styles/SCOPES.md +0 -86
- package/dist/styles/themes/default.css +0 -164
- package/dist/styles/theming/animation.css +0 -143
- package/dist/styles/theming/colors.css +0 -97
- package/dist/styles/theming/feedback.css +0 -17
- package/dist/styles/theming/field.css +0 -21
- package/dist/styles/theming/focus.css +0 -88
- package/dist/styles/theming/layers.css +0 -13
- package/dist/styles/theming/layout.css +0 -21
- package/dist/styles/theming/motion.css +0 -42
- package/dist/styles/theming/overlay.css +0 -52
- package/dist/styles/theming/sizing.css +0 -118
- package/dist/styles/theming/text.css +0 -30
- package/dist/styles/theming/typography.css +0 -26
- package/dist/styles/tokens/components.css +0 -22
- package/dist/styles/tokens/foundation.css +0 -80
- package/dist/styles/tokens/layout.css +0 -19
- package/dist/styles/tokens/palette.css +0 -88
- package/dist/styles/tokens/primitives.css +0 -18
- package/dist/styles/tokens/states.css +0 -77
- package/dist/table-BC4qqsUb.js +0 -180
- package/dist/table-BHDpjajL.js +0 -982
- package/dist/text-inputs-DF_lD7pA.js +0 -385
- package/dist/theming-D6KRU7hO.js +0 -104
- package/dist/toolbar-DWRywF0R.js +0 -68
- package/dist/tooltip-t1VQQ2tZ.js +0 -73
- package/dist/upload-B38YZeFJ.js +0 -938
- package/dist/value-inputs-Q4ymjXlV.js +0 -716
- package/src/styles/FACTORS.md +0 -36
- package/src/styles/SCOPES.md +0 -86
- /package/dist/components/{admin/patterns → blocks/admin}/access/admin.strings.d.ts +0 -0
- /package/dist/components/{admin/patterns → blocks/admin}/access/credential-list.d.ts +0 -0
- /package/dist/components/{admin/patterns → blocks/admin}/access/index.d.ts +0 -0
- /package/dist/components/{admin/patterns → blocks/admin}/access/role-permissions.d.ts +0 -0
- /package/dist/components/{admin/patterns → blocks/admin}/access/sensitive-action.d.ts +0 -0
- /package/dist/components/{admin/patterns → blocks/admin}/commerce/account.d.ts +0 -0
- /package/dist/components/{admin/patterns → blocks/admin}/commerce/address-lines.d.ts +0 -0
- /package/dist/components/{admin/patterns → blocks/admin}/commerce/booking.d.ts +0 -0
- /package/dist/components/{admin/patterns → blocks/admin}/commerce/cart.d.ts +0 -0
- /package/dist/components/{admin/patterns → blocks/admin}/commerce/commerce.strings.d.ts +0 -0
- /package/dist/components/{admin/patterns → blocks/admin}/commerce/commerce.types.d.ts +0 -0
- /package/dist/components/{admin/patterns → blocks/admin}/commerce/format-amount.d.ts +0 -0
- /package/dist/components/{admin/patterns → blocks/admin}/commerce/index.d.ts +0 -0
- /package/dist/components/{admin/patterns → blocks/admin}/commerce/inventory-section.d.ts +0 -0
- /package/dist/components/{admin/patterns → blocks/admin}/commerce/invoice.d.ts +0 -0
- /package/dist/components/{admin/patterns → blocks/admin}/commerce/loyalty.d.ts +0 -0
- /package/dist/components/{admin/patterns → blocks/admin}/commerce/order-customer.d.ts +0 -0
- /package/dist/components/{admin/patterns → blocks/admin}/commerce/order-detail.d.ts +0 -0
- /package/dist/components/{admin/patterns → blocks/admin}/commerce/order-line-item.d.ts +0 -0
- /package/dist/components/{admin/patterns → blocks/admin}/commerce/order-transactions.d.ts +0 -0
- /package/dist/components/{admin/patterns → blocks/admin}/commerce/order.d.ts +0 -0
- /package/dist/components/{admin/patterns → blocks/admin}/commerce/seo-listing.d.ts +0 -0
- /package/dist/components/{admin/patterns → blocks/admin}/commerce/seo-score.d.ts +0 -0
- /package/dist/components/{admin/patterns → blocks/admin}/commerce/summary-panel.d.ts +0 -0
- /package/dist/components/{patterns → blocks}/analytics/activity-heatmap.d.ts +0 -0
- /package/dist/components/{patterns → blocks}/analytics/analytics.types.d.ts +0 -0
- /package/dist/components/{patterns → blocks}/analytics/chart-card.d.ts +0 -0
- /package/dist/components/{patterns → blocks}/analytics/format-metric-value.d.ts +0 -0
- /package/dist/components/{patterns → blocks}/analytics/index.d.ts +0 -0
- /package/dist/components/{patterns → blocks}/analytics/metric-bar.d.ts +0 -0
- /package/dist/components/{patterns → blocks}/analytics/metric-comparison.d.ts +0 -0
- /package/dist/components/{patterns → blocks}/analytics/metric-gradient.d.ts +0 -0
- /package/dist/components/{patterns → blocks}/analytics/metric-grid.d.ts +0 -0
- /package/dist/components/{patterns → blocks}/analytics/metric-micro-grid.d.ts +0 -0
- /package/dist/components/{patterns → blocks}/analytics/metric-skeleton.d.ts +0 -0
- /package/dist/components/{patterns → blocks}/analytics/metric-trend-chip.d.ts +0 -0
- /package/dist/components/{patterns → blocks}/analytics/metric.d.ts +0 -0
- /package/dist/components/{patterns → blocks}/analytics/time-ruler.d.ts +0 -0
- /package/dist/components/{patterns → blocks}/onboarding/checklist.d.ts +0 -0
- /package/dist/components/{patterns → blocks}/onboarding/index.d.ts +0 -0
- /package/dist/components/{patterns → blocks}/onboarding/onboarding.strings.d.ts +0 -0
- /package/dist/components/{patterns → blocks}/timelines/changelog-timeline.d.ts +0 -0
- /package/dist/components/{patterns → blocks}/timelines/index.d.ts +0 -0
- /package/dist/components/{patterns → blocks}/timelines/milestones-timeline.d.ts +0 -0
- /package/dist/components/{patterns → blocks}/timelines/steps.d.ts +0 -0
- /package/dist/components/{patterns → blocks}/timelines/timelines.strings.d.ts +0 -0
- /package/dist/styles/{theming/breakpoints.css → breakpoints.css} +0 -0
|
@@ -1,45 +1,48 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { t as
|
|
9
|
-
import {
|
|
10
|
-
import { c as l,
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { u as
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
2
|
+
import "#core.css";
|
|
3
|
+
import { c as e } from "../typography-DmeR05Er.js";
|
|
4
|
+
import { t } from "../cx--CBrhWH0.js";
|
|
5
|
+
import { c as n } from "../buttons-BX2JfL5X.js";
|
|
6
|
+
import { o as r } from "../structure-CynEZ-OY.js";
|
|
7
|
+
import { t as i } from "../badge-VlJVZjdm.js";
|
|
8
|
+
import { p as a, t as o } from "../feedback-D4qVsKlD.js";
|
|
9
|
+
import { l as s } from "../display-a7AoX_u7.js";
|
|
10
|
+
import { a as c, n as l, o as u, s as d, t as f } from "../choice-inputs-NwRxvmZN.js";
|
|
11
|
+
import { c as p, l as m } from "../text-inputs-BboE77nZ.js";
|
|
12
|
+
import { t as h } from "../use-latest-CF0678ae.js";
|
|
13
|
+
import { u as g } from "../forms-C0WeNPFF.js";
|
|
14
|
+
import { u as _ } from "../forms-numeric-IwQ1ltNf.js";
|
|
15
|
+
import { s as v } from "../value-inputs-ng8aVJJZ.js";
|
|
16
|
+
import { PlusIcon as y } from "lucide-react";
|
|
17
|
+
import { Fragment as b, useCallback as x, useEffect as S, useId as C, useMemo as w, useRef as T, useState as E } from "react";
|
|
18
|
+
import { jsx as D, jsxs as O } from "react/jsx-runtime";
|
|
19
|
+
import "#css/schema-form.css";
|
|
17
20
|
//#region src/components/features/schema-form/schema-form-actions.tsx
|
|
18
|
-
function
|
|
19
|
-
return /* @__PURE__ */
|
|
21
|
+
function k({ submitLabel: e, resetLabel: i, showReset: a = !1, disabled: o = !1, submitDisabled: s = !1, resetDisabled: c = !1, submitting: l = !1, onReset: u, className: d }) {
|
|
22
|
+
return /* @__PURE__ */ O(r, {
|
|
20
23
|
direction: "horizontal",
|
|
21
24
|
align: "center",
|
|
22
25
|
justify: "end",
|
|
23
|
-
gap: "
|
|
24
|
-
className:
|
|
25
|
-
children: [
|
|
26
|
+
gap: "sm",
|
|
27
|
+
className: t("schema-form-actions--component", d),
|
|
28
|
+
children: [a && /* @__PURE__ */ D(n, {
|
|
26
29
|
type: "button",
|
|
27
30
|
tone: "neutral",
|
|
28
|
-
|
|
29
|
-
disabled:
|
|
31
|
+
appearance: "outline",
|
|
32
|
+
disabled: o || c || l,
|
|
30
33
|
onClick: u,
|
|
31
|
-
children:
|
|
32
|
-
}), /* @__PURE__ */
|
|
34
|
+
children: i
|
|
35
|
+
}), /* @__PURE__ */ D(n, {
|
|
33
36
|
type: "submit",
|
|
34
37
|
loading: l,
|
|
35
|
-
disabled:
|
|
36
|
-
children:
|
|
38
|
+
disabled: o || s,
|
|
39
|
+
children: e
|
|
37
40
|
})]
|
|
38
41
|
});
|
|
39
42
|
}
|
|
40
43
|
//#endregion
|
|
41
44
|
//#region src/components/features/schema-form/schema-form.utils.ts
|
|
42
|
-
function
|
|
45
|
+
function A(e, t, n) {
|
|
43
46
|
if (typeof e.hidden == "function") try {
|
|
44
47
|
return e.hidden(t);
|
|
45
48
|
} catch (e) {
|
|
@@ -47,7 +50,7 @@ function k(e, t, n) {
|
|
|
47
50
|
}
|
|
48
51
|
return e.hidden ?? !1;
|
|
49
52
|
}
|
|
50
|
-
function
|
|
53
|
+
function j(e, t, n) {
|
|
51
54
|
if (typeof e.disabled == "function") try {
|
|
52
55
|
return e.disabled(t);
|
|
53
56
|
} catch (e) {
|
|
@@ -55,11 +58,11 @@ function A(e, t, n) {
|
|
|
55
58
|
}
|
|
56
59
|
return e.disabled ?? !1;
|
|
57
60
|
}
|
|
58
|
-
function
|
|
59
|
-
return e.filter((e) => !
|
|
61
|
+
function M(e, t, n) {
|
|
62
|
+
return e.filter((e) => !A(e, t, n));
|
|
60
63
|
}
|
|
61
|
-
function
|
|
62
|
-
let a =
|
|
64
|
+
function ee(e, t, n, r, i) {
|
|
65
|
+
let a = M(e.fields, t, i), o = new Map(a.map((e) => [e.key, e])), s = /* @__PURE__ */ new Set(), c = [];
|
|
63
66
|
for (let t of e.sections ?? []) {
|
|
64
67
|
let e = t.fields ? t.fields.map((e) => o.get(e)).filter((e) => e !== void 0) : a.filter((e) => e.sectionId === t.id);
|
|
65
68
|
for (let t of e) s.add(t.key);
|
|
@@ -88,16 +91,16 @@ function N(e) {
|
|
|
88
91
|
function P(e) {
|
|
89
92
|
return Array.isArray(e) ? e.map((e) => String(e)) : [];
|
|
90
93
|
}
|
|
91
|
-
function
|
|
94
|
+
function te(e) {
|
|
92
95
|
return e === !0 || e === "true" || e === 1;
|
|
93
96
|
}
|
|
94
|
-
function
|
|
97
|
+
function ne(e, t = !1) {
|
|
95
98
|
let n = e.trim();
|
|
96
99
|
if (n.length === 0) return null;
|
|
97
100
|
let r = t ? Number.parseInt(n, 10) : Number.parseFloat(n);
|
|
98
101
|
return Number.isNaN(r) ? null : r;
|
|
99
102
|
}
|
|
100
|
-
function
|
|
103
|
+
function F(e, t = 2) {
|
|
101
104
|
if (e == null) return "";
|
|
102
105
|
if (typeof e == "string") return e;
|
|
103
106
|
try {
|
|
@@ -106,7 +109,7 @@ function ne(e, t = 2) {
|
|
|
106
109
|
return String(e);
|
|
107
110
|
}
|
|
108
111
|
}
|
|
109
|
-
function
|
|
112
|
+
function I(e) {
|
|
110
113
|
let t = e.trim();
|
|
111
114
|
if (t.length === 0) return {
|
|
112
115
|
value: null,
|
|
@@ -127,7 +130,7 @@ function F(e) {
|
|
|
127
130
|
function re(e) {
|
|
128
131
|
return e.replace(/[^a-zA-Z0-9_-]/g, "-");
|
|
129
132
|
}
|
|
130
|
-
var
|
|
133
|
+
var L = {
|
|
131
134
|
root: "schema-form__root___b94WK",
|
|
132
135
|
surface: "schema-form__surface___WSXkj",
|
|
133
136
|
header: "schema-form__header___zj925",
|
|
@@ -142,17 +145,16 @@ var I = {
|
|
|
142
145
|
widthHalf: "schema-form__widthHalf___E7faH",
|
|
143
146
|
widthFull: "schema-form__widthFull___jWKKb",
|
|
144
147
|
widthThird: "schema-form__widthThird___SYTHf",
|
|
145
|
-
mono: "schema-form__mono___-wgSa",
|
|
146
148
|
recommendations: "schema-form__recommendations___O5X6e",
|
|
147
149
|
recommendation: "schema-form__recommendation___jVRLC",
|
|
148
150
|
submitError: "schema-form__submitError___UG_Kj"
|
|
149
151
|
};
|
|
150
152
|
//#endregion
|
|
151
153
|
//#region src/components/features/schema-form/schema-form-field.tsx
|
|
152
|
-
function
|
|
154
|
+
function R(e) {
|
|
153
155
|
return e.hint ?? e.description;
|
|
154
156
|
}
|
|
155
|
-
function
|
|
157
|
+
function z(e, t, n, r) {
|
|
156
158
|
if (e.formatValue) try {
|
|
157
159
|
return e.formatValue(t, n);
|
|
158
160
|
} catch (e) {
|
|
@@ -160,7 +162,7 @@ function R(e, t, n, r) {
|
|
|
160
162
|
}
|
|
161
163
|
return N(t);
|
|
162
164
|
}
|
|
163
|
-
function
|
|
165
|
+
function B(e, t, n, r) {
|
|
164
166
|
if (e.parseValue) try {
|
|
165
167
|
return e.parseValue(t, n);
|
|
166
168
|
} catch (e) {
|
|
@@ -168,15 +170,15 @@ function z(e, t, n, r) {
|
|
|
168
170
|
}
|
|
169
171
|
return t;
|
|
170
172
|
}
|
|
171
|
-
function
|
|
173
|
+
function V(e, t, n, r, i) {
|
|
172
174
|
if (e.parseValue) try {
|
|
173
175
|
return e.parseValue(t, n);
|
|
174
176
|
} catch (e) {
|
|
175
177
|
i?.(e);
|
|
176
178
|
}
|
|
177
|
-
return
|
|
179
|
+
return ne(t, r);
|
|
178
180
|
}
|
|
179
|
-
function
|
|
181
|
+
function H(e, t, n, r) {
|
|
180
182
|
if (e.type === "json" && e.parseValue) try {
|
|
181
183
|
return {
|
|
182
184
|
value: e.parseValue(t, n),
|
|
@@ -188,251 +190,254 @@ function V(e, t, n, r) {
|
|
|
188
190
|
valid: !1
|
|
189
191
|
};
|
|
190
192
|
}
|
|
191
|
-
return
|
|
193
|
+
return I(t);
|
|
192
194
|
}
|
|
193
|
-
function
|
|
194
|
-
let
|
|
195
|
-
return
|
|
196
|
-
Object.is(
|
|
197
|
-
}, [
|
|
198
|
-
label:
|
|
199
|
-
required:
|
|
200
|
-
hint:
|
|
201
|
-
helperText:
|
|
202
|
-
error:
|
|
203
|
-
htmlFor:
|
|
195
|
+
function U({ field: n, value: r, values: i, error: a, disabled: o, fieldId: s, onValueChange: c, onError: l, strings: u }) {
|
|
196
|
+
let d = n.type === "json" ? n.jsonIndent ?? 2 : 2, [f, m] = E(), h = T(null), _ = T(r), [v, y] = E(null), b = v ?? F(r, d);
|
|
197
|
+
return S(() => {
|
|
198
|
+
Object.is(r, _.current) || (_.current = r, y(null), m(void 0), h.current?.setCustomValidity(""));
|
|
199
|
+
}, [r]), n.type === "json" ? /* @__PURE__ */ D(g, {
|
|
200
|
+
label: n.label,
|
|
201
|
+
required: n.required,
|
|
202
|
+
hint: R(n),
|
|
203
|
+
helperText: n.helperText,
|
|
204
|
+
error: a ?? f,
|
|
205
|
+
htmlFor: s,
|
|
204
206
|
className: "schema-form-field--component",
|
|
205
|
-
children: /* @__PURE__ */
|
|
207
|
+
children: /* @__PURE__ */ D(p, {
|
|
206
208
|
ref: h,
|
|
207
|
-
id:
|
|
208
|
-
name:
|
|
209
|
-
value:
|
|
210
|
-
rows:
|
|
211
|
-
disabled:
|
|
212
|
-
invalid: !!(
|
|
213
|
-
placeholder:
|
|
209
|
+
id: s,
|
|
210
|
+
name: n.key,
|
|
211
|
+
value: b,
|
|
212
|
+
rows: n.rows ?? 6,
|
|
213
|
+
disabled: o,
|
|
214
|
+
invalid: !!(a ?? f),
|
|
215
|
+
placeholder: n.placeholder,
|
|
214
216
|
spellCheck: !1,
|
|
215
|
-
className: e(
|
|
217
|
+
className: t(e({
|
|
218
|
+
size: "inherit",
|
|
219
|
+
mono: !0
|
|
220
|
+
}), n.controlClassName),
|
|
216
221
|
onChange: (e) => {
|
|
217
|
-
let
|
|
218
|
-
|
|
219
|
-
let
|
|
220
|
-
m(
|
|
222
|
+
let t = e.target.value;
|
|
223
|
+
y(t);
|
|
224
|
+
let r = H(n, t, i, l);
|
|
225
|
+
m(r.valid ? void 0 : u.jsonParseError), e.currentTarget.setCustomValidity(r.valid ? "" : u.jsonParseError), _.current = r.value, c(r.value);
|
|
221
226
|
},
|
|
222
227
|
onBlur: (e) => {
|
|
223
|
-
let
|
|
224
|
-
m(
|
|
228
|
+
let t = H(n, b, i, l);
|
|
229
|
+
m(t.valid ? void 0 : u.jsonParseError), e.currentTarget.setCustomValidity(t.valid ? "" : u.jsonParseError), _.current = t.value, c(t.value), y(null);
|
|
225
230
|
},
|
|
226
|
-
...
|
|
231
|
+
...n.textareaProps
|
|
227
232
|
})
|
|
228
233
|
}) : null;
|
|
229
234
|
}
|
|
230
|
-
function
|
|
231
|
-
let w =
|
|
232
|
-
label:
|
|
233
|
-
required:
|
|
234
|
-
hint:
|
|
235
|
-
helperText:
|
|
236
|
-
error:
|
|
237
|
-
htmlFor: !T.has(w) &&
|
|
238
|
-
className:
|
|
239
|
-
}, k =
|
|
240
|
-
if (
|
|
241
|
-
className:
|
|
242
|
-
children:
|
|
243
|
-
field:
|
|
235
|
+
function ie({ field: e, value: n, values: r, error: a, disabled: o, required: s, fieldId: h, onValueChange: b, onError: x, strings: S, className: C }) {
|
|
236
|
+
let w = e.type ?? "text", T = /* @__PURE__ */ new Set(["radio-cards", "checkbox-cards"]), E = {
|
|
237
|
+
label: e.label,
|
|
238
|
+
required: s,
|
|
239
|
+
hint: R(e),
|
|
240
|
+
helperText: e.helperText,
|
|
241
|
+
error: a,
|
|
242
|
+
htmlFor: !T.has(w) && h,
|
|
243
|
+
className: t("schema-form-field--component", C)
|
|
244
|
+
}, k = e.controlClassName;
|
|
245
|
+
if (e.type === "custom") return /* @__PURE__ */ D("div", {
|
|
246
|
+
className: t("schema-form-field--component", C),
|
|
247
|
+
children: e.render({
|
|
248
|
+
field: e,
|
|
244
249
|
value: n,
|
|
245
250
|
values: r,
|
|
246
|
-
error:
|
|
247
|
-
disabled:
|
|
248
|
-
required:
|
|
249
|
-
fieldId:
|
|
251
|
+
error: a,
|
|
252
|
+
disabled: o,
|
|
253
|
+
required: s,
|
|
254
|
+
fieldId: h,
|
|
250
255
|
onValueChange: b,
|
|
251
256
|
onError: x
|
|
252
257
|
})
|
|
253
258
|
});
|
|
254
|
-
if (
|
|
255
|
-
let r =
|
|
256
|
-
return
|
|
257
|
-
error:
|
|
258
|
-
className:
|
|
259
|
-
children: /* @__PURE__ */
|
|
260
|
-
label:
|
|
261
|
-
description:
|
|
262
|
-
hint:
|
|
263
|
-
name:
|
|
259
|
+
if (e.type === "switch") {
|
|
260
|
+
let r = te(n);
|
|
261
|
+
return e.switchStyle === "card" ? /* @__PURE__ */ D(g, {
|
|
262
|
+
error: a,
|
|
263
|
+
className: t("schema-form-field--component", C),
|
|
264
|
+
children: /* @__PURE__ */ D(f, {
|
|
265
|
+
label: e.label,
|
|
266
|
+
description: e.description,
|
|
267
|
+
hint: e.hint,
|
|
268
|
+
name: e.key,
|
|
264
269
|
value: r,
|
|
265
|
-
disabled:
|
|
266
|
-
invalid: !!
|
|
270
|
+
disabled: o,
|
|
271
|
+
invalid: !!a,
|
|
267
272
|
className: k,
|
|
268
273
|
onValueChange: b,
|
|
269
|
-
...
|
|
274
|
+
...e.switchCardProps
|
|
270
275
|
})
|
|
271
|
-
}) : /* @__PURE__ */
|
|
272
|
-
error:
|
|
273
|
-
className:
|
|
274
|
-
children: /* @__PURE__ */
|
|
275
|
-
label:
|
|
276
|
-
description:
|
|
277
|
-
name:
|
|
276
|
+
}) : /* @__PURE__ */ D(g, {
|
|
277
|
+
error: a,
|
|
278
|
+
className: t("schema-form-field--component", C),
|
|
279
|
+
children: /* @__PURE__ */ D(l, {
|
|
280
|
+
label: e.label,
|
|
281
|
+
description: e.description ?? e.hint,
|
|
282
|
+
name: e.key,
|
|
278
283
|
value: r,
|
|
279
|
-
disabled:
|
|
280
|
-
invalid: !!
|
|
284
|
+
disabled: o,
|
|
285
|
+
invalid: !!a,
|
|
281
286
|
className: k,
|
|
282
287
|
onValueChange: b,
|
|
283
|
-
...
|
|
288
|
+
...e.switchProps
|
|
284
289
|
})
|
|
285
290
|
});
|
|
286
291
|
}
|
|
287
|
-
if (
|
|
288
|
-
field:
|
|
292
|
+
if (e.type === "json") return /* @__PURE__ */ D(U, {
|
|
293
|
+
field: e,
|
|
289
294
|
value: n,
|
|
290
295
|
values: r,
|
|
291
|
-
error:
|
|
292
|
-
disabled:
|
|
293
|
-
required:
|
|
294
|
-
fieldId:
|
|
296
|
+
error: a,
|
|
297
|
+
disabled: o,
|
|
298
|
+
required: s,
|
|
299
|
+
fieldId: h,
|
|
295
300
|
onValueChange: b,
|
|
296
301
|
onError: x,
|
|
297
302
|
strings: S
|
|
298
303
|
});
|
|
299
|
-
if (
|
|
300
|
-
...
|
|
301
|
-
children: /* @__PURE__ */
|
|
302
|
-
id:
|
|
303
|
-
name:
|
|
304
|
-
value:
|
|
305
|
-
rows:
|
|
306
|
-
disabled:
|
|
307
|
-
required:
|
|
308
|
-
invalid: !!
|
|
309
|
-
placeholder:
|
|
304
|
+
if (e.type === "textarea") return /* @__PURE__ */ D(g, {
|
|
305
|
+
...E,
|
|
306
|
+
children: /* @__PURE__ */ D(p, {
|
|
307
|
+
id: h,
|
|
308
|
+
name: e.key,
|
|
309
|
+
value: z(e, n, r, x),
|
|
310
|
+
rows: e.rows,
|
|
311
|
+
disabled: o,
|
|
312
|
+
required: s,
|
|
313
|
+
invalid: !!a,
|
|
314
|
+
placeholder: e.placeholder,
|
|
310
315
|
className: k,
|
|
311
|
-
onChange: (
|
|
312
|
-
...
|
|
316
|
+
onChange: (t) => b(B(e, t.target.value, r, x)),
|
|
317
|
+
...e.textareaProps
|
|
313
318
|
})
|
|
314
319
|
});
|
|
315
|
-
if (
|
|
316
|
-
let
|
|
317
|
-
return /* @__PURE__ */
|
|
318
|
-
...
|
|
319
|
-
children: /* @__PURE__ */
|
|
320
|
-
id:
|
|
321
|
-
name:
|
|
322
|
-
value:
|
|
323
|
-
min:
|
|
324
|
-
max:
|
|
325
|
-
step:
|
|
326
|
-
decimalPlaces:
|
|
327
|
-
disabled:
|
|
328
|
-
required:
|
|
329
|
-
invalid: !!
|
|
330
|
-
placeholder:
|
|
320
|
+
if (e.type === "number" || e.type === "integer" || e.type === "decimal") {
|
|
321
|
+
let t = e.type === "integer", i = t ? 0 : e.decimalPlaces ?? (e.type === "decimal" ? 2 : 4);
|
|
322
|
+
return /* @__PURE__ */ D(g, {
|
|
323
|
+
...E,
|
|
324
|
+
children: /* @__PURE__ */ D(_, {
|
|
325
|
+
id: h,
|
|
326
|
+
name: e.key,
|
|
327
|
+
value: z(e, n, r, x),
|
|
328
|
+
min: e.min,
|
|
329
|
+
max: e.max,
|
|
330
|
+
step: e.step,
|
|
331
|
+
decimalPlaces: i,
|
|
332
|
+
disabled: o,
|
|
333
|
+
required: s,
|
|
334
|
+
invalid: !!a,
|
|
335
|
+
placeholder: e.placeholder,
|
|
331
336
|
className: k,
|
|
332
|
-
onChange: (n) => b(
|
|
333
|
-
...
|
|
337
|
+
onChange: (n) => b(V(e, n.target.value, r, t, x)),
|
|
338
|
+
...e.numberProps
|
|
334
339
|
})
|
|
335
340
|
});
|
|
336
341
|
}
|
|
337
|
-
if (
|
|
338
|
-
...
|
|
339
|
-
children: /* @__PURE__ */
|
|
340
|
-
name:
|
|
342
|
+
if (e.type === "select") return /* @__PURE__ */ D(g, {
|
|
343
|
+
...E,
|
|
344
|
+
children: /* @__PURE__ */ D(d, {
|
|
345
|
+
name: e.key,
|
|
341
346
|
value: N(n),
|
|
342
|
-
options:
|
|
347
|
+
options: e.options.map((e) => ({
|
|
343
348
|
value: e.value,
|
|
344
349
|
label: e.label,
|
|
345
350
|
disabled: e.disabled,
|
|
346
351
|
icon: e.icon
|
|
347
352
|
})),
|
|
348
|
-
allowClear:
|
|
349
|
-
disabled:
|
|
350
|
-
required:
|
|
351
|
-
invalid: !!
|
|
352
|
-
placeholder:
|
|
353
|
+
allowClear: e.allowClear,
|
|
354
|
+
disabled: o,
|
|
355
|
+
required: s,
|
|
356
|
+
invalid: !!a,
|
|
357
|
+
placeholder: e.placeholder,
|
|
353
358
|
className: k,
|
|
354
359
|
onValueChange: (e) => b(e ?? null),
|
|
355
|
-
...
|
|
360
|
+
...e.selectProps
|
|
356
361
|
})
|
|
357
362
|
});
|
|
358
|
-
if (
|
|
359
|
-
...
|
|
360
|
-
children: /* @__PURE__ */
|
|
361
|
-
name:
|
|
363
|
+
if (e.type === "radio-cards") return /* @__PURE__ */ D(g, {
|
|
364
|
+
...E,
|
|
365
|
+
children: /* @__PURE__ */ D(u, {
|
|
366
|
+
name: e.key,
|
|
362
367
|
value: N(n),
|
|
363
|
-
options:
|
|
364
|
-
columns:
|
|
365
|
-
disabled:
|
|
366
|
-
invalid: !!
|
|
368
|
+
options: e.options,
|
|
369
|
+
columns: e.columns,
|
|
370
|
+
disabled: o,
|
|
371
|
+
invalid: !!a,
|
|
367
372
|
className: k,
|
|
368
373
|
onValueChange: b,
|
|
369
|
-
...
|
|
374
|
+
...e.radioProps
|
|
370
375
|
})
|
|
371
376
|
});
|
|
372
|
-
if (
|
|
373
|
-
...
|
|
374
|
-
children: /* @__PURE__ */
|
|
375
|
-
name:
|
|
377
|
+
if (e.type === "checkbox-cards") return /* @__PURE__ */ D(g, {
|
|
378
|
+
...E,
|
|
379
|
+
children: /* @__PURE__ */ D(c, {
|
|
380
|
+
name: e.key,
|
|
376
381
|
value: P(n),
|
|
377
|
-
options:
|
|
378
|
-
columns:
|
|
379
|
-
disabled:
|
|
380
|
-
invalid: !!
|
|
382
|
+
options: e.options,
|
|
383
|
+
columns: e.columns,
|
|
384
|
+
disabled: o,
|
|
385
|
+
invalid: !!a,
|
|
381
386
|
className: k,
|
|
382
387
|
onValueChange: b,
|
|
383
|
-
...
|
|
388
|
+
...e.checkboxProps
|
|
384
389
|
})
|
|
385
390
|
});
|
|
386
|
-
if (
|
|
387
|
-
let
|
|
388
|
-
return /* @__PURE__ */
|
|
389
|
-
...
|
|
390
|
-
children: [/* @__PURE__ */
|
|
391
|
-
name:
|
|
392
|
-
value:
|
|
393
|
-
maxTags:
|
|
394
|
-
disabled:
|
|
395
|
-
invalid: !!
|
|
396
|
-
placeholder:
|
|
391
|
+
if (e.type === "tags") {
|
|
392
|
+
let t = P(n), r = (e.recommendations ?? []).filter((e) => !t.includes(e)), s = e.maxTags !== void 0 && t.length >= e.maxTags;
|
|
393
|
+
return /* @__PURE__ */ O(g, {
|
|
394
|
+
...E,
|
|
395
|
+
children: [/* @__PURE__ */ D(v, {
|
|
396
|
+
name: e.key,
|
|
397
|
+
value: t,
|
|
398
|
+
maxTags: e.maxTags,
|
|
399
|
+
disabled: o,
|
|
400
|
+
invalid: !!a,
|
|
401
|
+
placeholder: e.placeholder,
|
|
397
402
|
className: k,
|
|
398
403
|
onValueChange: b,
|
|
399
|
-
...
|
|
400
|
-
}), r.length > 0 && !
|
|
401
|
-
className:
|
|
402
|
-
children: r.map((
|
|
404
|
+
...e.tagsProps
|
|
405
|
+
}), r.length > 0 && !s && /* @__PURE__ */ D("div", {
|
|
406
|
+
className: L.recommendations,
|
|
407
|
+
children: r.map((e) => /* @__PURE__ */ D("button", {
|
|
403
408
|
type: "button",
|
|
404
|
-
disabled:
|
|
405
|
-
className:
|
|
406
|
-
onClick: () => b([...
|
|
407
|
-
children: /* @__PURE__ */
|
|
409
|
+
disabled: o,
|
|
410
|
+
className: L.recommendation,
|
|
411
|
+
onClick: () => b([...t, e]),
|
|
412
|
+
children: /* @__PURE__ */ O(i, {
|
|
408
413
|
tone: "neutral",
|
|
409
|
-
children: [/* @__PURE__ */
|
|
414
|
+
children: [/* @__PURE__ */ D(y, { "aria-hidden": !0 }), e]
|
|
410
415
|
})
|
|
411
|
-
},
|
|
416
|
+
}, e))
|
|
412
417
|
})]
|
|
413
418
|
});
|
|
414
419
|
}
|
|
415
|
-
let A =
|
|
416
|
-
return /* @__PURE__ */
|
|
417
|
-
...
|
|
418
|
-
children: /* @__PURE__ */
|
|
419
|
-
id:
|
|
420
|
-
name:
|
|
420
|
+
let A = e;
|
|
421
|
+
return /* @__PURE__ */ D(g, {
|
|
422
|
+
...E,
|
|
423
|
+
children: /* @__PURE__ */ D(m, {
|
|
424
|
+
id: h,
|
|
425
|
+
name: e.key,
|
|
421
426
|
type: w === "text" ? "text" : w,
|
|
422
|
-
value:
|
|
423
|
-
disabled:
|
|
424
|
-
required:
|
|
425
|
-
invalid: !!
|
|
426
|
-
placeholder:
|
|
427
|
+
value: z(e, n, r, x),
|
|
428
|
+
disabled: o,
|
|
429
|
+
required: s,
|
|
430
|
+
invalid: !!a,
|
|
431
|
+
placeholder: e.placeholder,
|
|
427
432
|
className: k,
|
|
428
|
-
onChange: (
|
|
433
|
+
onChange: (t) => b(B(e, t.target.value, r, x)),
|
|
429
434
|
...A.inputProps
|
|
430
435
|
})
|
|
431
436
|
});
|
|
432
437
|
}
|
|
433
438
|
//#endregion
|
|
434
439
|
//#region src/components/features/schema-form/schema-form.strings.ts
|
|
435
|
-
var
|
|
440
|
+
var W = {
|
|
436
441
|
submitLabel: "Save changes",
|
|
437
442
|
resetLabel: "Reset",
|
|
438
443
|
submitError: "Changes could not be saved. Please try again.",
|
|
@@ -445,68 +450,68 @@ var U = {
|
|
|
445
450
|
};
|
|
446
451
|
//#endregion
|
|
447
452
|
//#region src/components/features/schema-form/use-schema-form.ts
|
|
448
|
-
function
|
|
453
|
+
function G(e, t) {
|
|
449
454
|
let n = { ...t ?? {} };
|
|
450
455
|
for (let t of e) t.defaultValue !== void 0 && n[t.key] === void 0 && (n[t.key] = t.defaultValue);
|
|
451
456
|
return n;
|
|
452
457
|
}
|
|
453
|
-
function
|
|
458
|
+
function K(e) {
|
|
454
459
|
return e == null ? !0 : typeof e == "string" ? e.trim().length === 0 : Array.isArray(e) ? e.length === 0 : !1;
|
|
455
460
|
}
|
|
456
|
-
function
|
|
461
|
+
function q(e) {
|
|
457
462
|
let t = {};
|
|
458
463
|
for (let [n, r] of Object.entries(e ?? {})) r && (t[n] = r);
|
|
459
464
|
return t;
|
|
460
465
|
}
|
|
461
|
-
function
|
|
462
|
-
let
|
|
463
|
-
...
|
|
466
|
+
function J({ fields: e, value: t, defaultValue: n, errors: r, onValueChange: i, onFieldChange: a, requiredError: o, validationError: s, onError: c }) {
|
|
467
|
+
let l = t !== void 0, u = w(() => G(e, n), [n, e]), [d, f] = E(() => u), [p, m] = E({}), g = w(() => l ? {
|
|
468
|
+
...u,
|
|
464
469
|
...t ?? {}
|
|
465
|
-
} :
|
|
466
|
-
d,
|
|
467
|
-
f,
|
|
470
|
+
} : d, [
|
|
468
471
|
u,
|
|
472
|
+
d,
|
|
473
|
+
l,
|
|
469
474
|
t
|
|
470
|
-
]), _ =
|
|
471
|
-
...
|
|
472
|
-
...
|
|
473
|
-
}), [r,
|
|
474
|
-
_.current = e,
|
|
475
|
+
]), _ = h(g), v = w(() => ({
|
|
476
|
+
...p,
|
|
477
|
+
...q(r)
|
|
478
|
+
}), [r, p]), y = x((e) => {
|
|
479
|
+
_.current = e, l || f(e), i?.(e);
|
|
475
480
|
}, [
|
|
476
|
-
|
|
477
|
-
|
|
481
|
+
l,
|
|
482
|
+
i,
|
|
478
483
|
_
|
|
479
|
-
]),
|
|
484
|
+
]), b = x((e, t) => {
|
|
480
485
|
let n = {
|
|
481
486
|
..._.current,
|
|
482
487
|
[e]: t
|
|
483
488
|
};
|
|
484
|
-
_.current = n,
|
|
489
|
+
_.current = n, l || f(n), m((t) => {
|
|
485
490
|
if (!t[e]) return t;
|
|
486
491
|
let { [e]: n, ...r } = t;
|
|
487
492
|
return r;
|
|
488
|
-
}),
|
|
493
|
+
}), a?.(e, t, n), i?.(n);
|
|
489
494
|
}, [
|
|
490
|
-
|
|
491
|
-
o,
|
|
495
|
+
l,
|
|
492
496
|
a,
|
|
497
|
+
i,
|
|
493
498
|
_
|
|
494
|
-
]), S =
|
|
495
|
-
let t =
|
|
496
|
-
return _.current = t,
|
|
499
|
+
]), S = x(() => {
|
|
500
|
+
let t = G(e, n);
|
|
501
|
+
return _.current = t, l || f(t), m({}), i?.(t), t;
|
|
497
502
|
}, [
|
|
498
503
|
n,
|
|
499
504
|
e,
|
|
500
|
-
|
|
501
|
-
|
|
505
|
+
l,
|
|
506
|
+
i,
|
|
502
507
|
_
|
|
503
|
-
]),
|
|
508
|
+
]), C = x(() => {
|
|
504
509
|
let t = {}, n = _.current;
|
|
505
510
|
for (let r of e) {
|
|
506
|
-
if (
|
|
511
|
+
if (A(r, n, c) || j(r, n, c)) continue;
|
|
507
512
|
let e = n[r.key];
|
|
508
|
-
if (r.required &&
|
|
509
|
-
t[r.key] =
|
|
513
|
+
if (r.required && K(e)) {
|
|
514
|
+
t[r.key] = o(r.label);
|
|
510
515
|
continue;
|
|
511
516
|
}
|
|
512
517
|
let i = Array.isArray(r.validate) ? r.validate : r.validate ? [r.validate] : [];
|
|
@@ -517,195 +522,194 @@ function q({ fields: e, value: t, defaultValue: n, errors: r, onValueChange: a,
|
|
|
517
522
|
break;
|
|
518
523
|
}
|
|
519
524
|
} catch (e) {
|
|
520
|
-
|
|
525
|
+
c?.(e), t[r.key] = s;
|
|
521
526
|
break;
|
|
522
527
|
}
|
|
523
528
|
}
|
|
524
|
-
return
|
|
529
|
+
return m(t), Object.keys(t).length === 0;
|
|
525
530
|
}, [
|
|
526
531
|
e,
|
|
527
|
-
l,
|
|
528
|
-
s,
|
|
529
532
|
c,
|
|
533
|
+
o,
|
|
534
|
+
s,
|
|
530
535
|
_
|
|
531
536
|
]);
|
|
532
537
|
return {
|
|
533
538
|
values: g,
|
|
534
539
|
errors: v,
|
|
535
|
-
getFieldError:
|
|
536
|
-
getFieldValue:
|
|
537
|
-
setFieldValue:
|
|
540
|
+
getFieldError: x((e) => v[e], [v]),
|
|
541
|
+
getFieldValue: x((e) => g[e], [g]),
|
|
542
|
+
setFieldValue: b,
|
|
538
543
|
setValues: y,
|
|
539
544
|
reset: S,
|
|
540
|
-
validate:
|
|
545
|
+
validate: C
|
|
541
546
|
};
|
|
542
547
|
}
|
|
543
548
|
//#endregion
|
|
544
549
|
//#region src/components/features/schema-form/schema-form.tsx
|
|
545
550
|
var ae = {
|
|
546
551
|
1: void 0,
|
|
547
|
-
2:
|
|
548
|
-
3:
|
|
552
|
+
2: L.columns2,
|
|
553
|
+
3: L.columns3
|
|
549
554
|
}, oe = {
|
|
550
555
|
auto: void 0,
|
|
551
|
-
half:
|
|
552
|
-
third:
|
|
553
|
-
full:
|
|
556
|
+
half: L.widthHalf,
|
|
557
|
+
third: L.widthThird,
|
|
558
|
+
full: L.widthFull
|
|
554
559
|
};
|
|
555
560
|
function se({ section: e }) {
|
|
556
|
-
return !e.title && !e.description ? null : /* @__PURE__ */
|
|
561
|
+
return !e.title && !e.description ? null : /* @__PURE__ */ D(s, {
|
|
557
562
|
title: e.title || void 0,
|
|
558
563
|
description: e.description || void 0,
|
|
559
|
-
className:
|
|
564
|
+
className: L.sectionHeading
|
|
560
565
|
});
|
|
561
566
|
}
|
|
562
|
-
function
|
|
563
|
-
let
|
|
564
|
-
...
|
|
567
|
+
function Y({ schema: e, value: n, defaultValue: r, errors: i, disabled: c = !1, layout: l = "form", columns: u = 2, id: d, name: f, title: p, description: m, headerSlot: h, footerSlot: g, actionsSlot: _, emptySlot: v, showActions: y, submitLabel: x, resetLabel: A, submitDisabled: M = !1, resetDisabled: N = !1, submitting: P = !1, onValueChange: te, onFieldChange: ne, onSubmit: F, onReset: I, onError: R, renderField: z, renderSection: B, strings: V, className: H, contentClassName: U, sectionClassName: G, fieldClassName: K }) {
|
|
568
|
+
let q = {
|
|
569
|
+
...W,
|
|
565
570
|
...V
|
|
566
|
-
}, [
|
|
567
|
-
|
|
571
|
+
}, [Y, X] = E(!1), [ce, le] = E(!1), Z = T(!1), ue = T(null), [de, fe] = E(0), Q = P || ce;
|
|
572
|
+
S(() => {
|
|
568
573
|
de && ue.current?.querySelector("[aria-invalid=\"true\"]:not([disabled])")?.focus();
|
|
569
574
|
}, [de]);
|
|
570
|
-
let pe =
|
|
571
|
-
fields:
|
|
572
|
-
value:
|
|
573
|
-
defaultValue:
|
|
574
|
-
errors:
|
|
575
|
+
let pe = C(), me = d ?? `schema-form-${pe}`, $ = J({
|
|
576
|
+
fields: e.fields,
|
|
577
|
+
value: n,
|
|
578
|
+
defaultValue: r,
|
|
579
|
+
errors: i,
|
|
575
580
|
onValueChange: te,
|
|
576
581
|
onFieldChange: ne,
|
|
577
|
-
requiredError:
|
|
578
|
-
validationError:
|
|
582
|
+
requiredError: q.requiredError,
|
|
583
|
+
validationError: q.validationError,
|
|
579
584
|
onError: R
|
|
580
|
-
}), he =
|
|
585
|
+
}), he = w(() => ee(e, $.values, q.defaultSectionTitle, u, R), [
|
|
581
586
|
u,
|
|
582
|
-
|
|
587
|
+
q.defaultSectionTitle,
|
|
583
588
|
$.values,
|
|
584
589
|
R,
|
|
585
|
-
|
|
590
|
+
e
|
|
586
591
|
]), ge = he.length > 0, _e = {
|
|
587
592
|
setFieldValue: $.setFieldValue,
|
|
588
593
|
setValues: $.setValues,
|
|
589
594
|
reset: $.reset,
|
|
590
595
|
validate: $.validate
|
|
591
|
-
}, ve = p ??
|
|
592
|
-
let n = `${me}-${re(
|
|
593
|
-
field:
|
|
594
|
-
value: $.getFieldValue(
|
|
596
|
+
}, ve = p ?? e.title, ye = m ?? e.description, be = y ?? !!(F || I || _), xe = (e) => {
|
|
597
|
+
let n = `${me}-${re(e.key)}`, r = {
|
|
598
|
+
field: e,
|
|
599
|
+
value: $.getFieldValue(e.key),
|
|
595
600
|
values: $.values,
|
|
596
|
-
error: $.getFieldError(
|
|
597
|
-
disabled: c || Q ||
|
|
598
|
-
required: !!
|
|
601
|
+
error: $.getFieldError(e.key),
|
|
602
|
+
disabled: c || Q || j(e, $.values, R),
|
|
603
|
+
required: !!e.required,
|
|
599
604
|
fieldId: n,
|
|
600
|
-
onValueChange: (
|
|
605
|
+
onValueChange: (t) => $.setFieldValue(e.key, t),
|
|
601
606
|
onError: R
|
|
602
|
-
}, i = /* @__PURE__ */
|
|
607
|
+
}, i = /* @__PURE__ */ D(ie, {
|
|
603
608
|
...r,
|
|
604
|
-
strings:
|
|
609
|
+
strings: q
|
|
605
610
|
});
|
|
606
|
-
return /* @__PURE__ */
|
|
607
|
-
className:
|
|
611
|
+
return /* @__PURE__ */ D("div", {
|
|
612
|
+
className: t(oe[e.width ?? "auto"], e.className, K),
|
|
608
613
|
children: z?.({
|
|
609
614
|
...r,
|
|
610
615
|
defaultField: i
|
|
611
616
|
}) ?? i
|
|
612
|
-
},
|
|
613
|
-
}, Se = (
|
|
614
|
-
className:
|
|
615
|
-
children:
|
|
616
|
-
}), Ce = (
|
|
617
|
-
let n = Se(
|
|
618
|
-
section:
|
|
617
|
+
}, e.key);
|
|
618
|
+
}, Se = (e) => /* @__PURE__ */ D("div", {
|
|
619
|
+
className: t(L.grid, ae[e.columns]),
|
|
620
|
+
children: e.fields.map(xe)
|
|
621
|
+
}), Ce = (e) => {
|
|
622
|
+
let n = Se(e), r = B?.({
|
|
623
|
+
section: e,
|
|
619
624
|
fields: n,
|
|
620
625
|
values: $.values
|
|
621
626
|
});
|
|
622
|
-
return r == null ? l === "cards" ? /* @__PURE__ */
|
|
627
|
+
return r == null ? l === "cards" ? /* @__PURE__ */ O(s, {
|
|
623
628
|
surface: "bordered",
|
|
624
|
-
icon:
|
|
625
|
-
title:
|
|
626
|
-
description:
|
|
627
|
-
className: e
|
|
628
|
-
children: [n, !!
|
|
629
|
-
className:
|
|
630
|
-
children:
|
|
629
|
+
icon: e.icon,
|
|
630
|
+
title: e.title,
|
|
631
|
+
description: e.description,
|
|
632
|
+
className: t(e.className, G),
|
|
633
|
+
children: [n, !!e.footerSlot && /* @__PURE__ */ D("div", {
|
|
634
|
+
className: L.sectionFooter,
|
|
635
|
+
children: e.footerSlot
|
|
631
636
|
})]
|
|
632
|
-
},
|
|
633
|
-
className: e
|
|
637
|
+
}, e.id) : /* @__PURE__ */ O("section", {
|
|
638
|
+
className: t(e.className, G),
|
|
634
639
|
children: [
|
|
635
|
-
/* @__PURE__ */
|
|
640
|
+
/* @__PURE__ */ D(se, { section: e }),
|
|
636
641
|
n,
|
|
637
|
-
!!
|
|
638
|
-
className:
|
|
639
|
-
children:
|
|
642
|
+
!!e.footerSlot && /* @__PURE__ */ D("div", {
|
|
643
|
+
className: L.sectionFooter,
|
|
644
|
+
children: e.footerSlot
|
|
640
645
|
})
|
|
641
646
|
]
|
|
642
|
-
},
|
|
643
|
-
}, we = _ ?? (be ? /* @__PURE__ */
|
|
644
|
-
submitLabel:
|
|
645
|
-
resetLabel:
|
|
646
|
-
showReset: !!
|
|
647
|
+
}, e.id) : /* @__PURE__ */ D(b, { children: r }, e.id);
|
|
648
|
+
}, we = _ ?? (be ? /* @__PURE__ */ D(k, {
|
|
649
|
+
submitLabel: x ?? q.submitLabel,
|
|
650
|
+
resetLabel: A ?? q.resetLabel,
|
|
651
|
+
showReset: !!I,
|
|
647
652
|
disabled: c,
|
|
648
|
-
submitDisabled:
|
|
649
|
-
resetDisabled:
|
|
653
|
+
submitDisabled: M,
|
|
654
|
+
resetDisabled: N,
|
|
650
655
|
submitting: Q,
|
|
651
656
|
onReset: () => {
|
|
652
|
-
|
|
657
|
+
X(!1), I?.($.reset(), _e);
|
|
653
658
|
}
|
|
654
|
-
}) : null), Te = v ?? /* @__PURE__ */
|
|
655
|
-
title:
|
|
656
|
-
description:
|
|
657
|
-
padding: "md",
|
|
659
|
+
}) : null), Te = v ?? /* @__PURE__ */ D(a, {
|
|
660
|
+
title: q.emptyTitle,
|
|
661
|
+
description: q.emptyDescription,
|
|
658
662
|
border: !0
|
|
659
|
-
}), Ee = !!(ve || ye || h) && /* @__PURE__ */
|
|
663
|
+
}), Ee = !!(ve || ye || h) && /* @__PURE__ */ D(s, {
|
|
660
664
|
title: ve || void 0,
|
|
661
665
|
description: ye || void 0,
|
|
662
666
|
headerEnd: h,
|
|
663
|
-
className:
|
|
664
|
-
}), De = !!(g || we) && /* @__PURE__ */
|
|
665
|
-
className:
|
|
667
|
+
className: L.header
|
|
668
|
+
}), De = !!(g || we) && /* @__PURE__ */ O("div", {
|
|
669
|
+
className: L.footer,
|
|
666
670
|
children: [g, we]
|
|
667
|
-
}), Oe = /* @__PURE__ */
|
|
668
|
-
className:
|
|
669
|
-
children: [ge ? he.map(Ce) : Te,
|
|
670
|
-
className:
|
|
671
|
-
title:
|
|
671
|
+
}), Oe = /* @__PURE__ */ O("div", {
|
|
672
|
+
className: t(L.body, U),
|
|
673
|
+
children: [ge ? he.map(Ce) : Te, Y && /* @__PURE__ */ D(o, {
|
|
674
|
+
className: L.submitError,
|
|
675
|
+
title: q.submitError ?? W.submitError,
|
|
672
676
|
description: !1
|
|
673
677
|
})]
|
|
674
678
|
});
|
|
675
|
-
return /* @__PURE__ */
|
|
679
|
+
return /* @__PURE__ */ D("form", {
|
|
676
680
|
ref: ue,
|
|
677
681
|
"aria-busy": Q || void 0,
|
|
678
682
|
id: me,
|
|
679
683
|
name: f,
|
|
680
684
|
noValidate: !0,
|
|
681
|
-
className:
|
|
685
|
+
className: t("schema-form--component", L.root, H),
|
|
682
686
|
onSubmit: async (e) => {
|
|
683
|
-
if (e.preventDefault(), !(c ||
|
|
687
|
+
if (e.preventDefault(), !(c || M || Q || Z.current)) {
|
|
684
688
|
if (!$.validate()) {
|
|
685
689
|
fe((e) => e + 1);
|
|
686
690
|
return;
|
|
687
691
|
}
|
|
688
692
|
if (e.currentTarget.reportValidity()) {
|
|
689
|
-
Z.current = !0,
|
|
693
|
+
Z.current = !0, X(!1), le(!0);
|
|
690
694
|
try {
|
|
691
695
|
await F?.($.values, _e, e);
|
|
692
696
|
} catch (e) {
|
|
693
|
-
|
|
697
|
+
X(!0), R?.(e);
|
|
694
698
|
} finally {
|
|
695
|
-
Z.current = !1,
|
|
699
|
+
Z.current = !1, le(!1);
|
|
696
700
|
}
|
|
697
701
|
}
|
|
698
702
|
}
|
|
699
703
|
},
|
|
700
|
-
children: l === "cards" ? /* @__PURE__ */
|
|
701
|
-
className:
|
|
704
|
+
children: l === "cards" ? /* @__PURE__ */ O("div", {
|
|
705
|
+
className: L.cards,
|
|
702
706
|
children: [
|
|
703
707
|
Ee,
|
|
704
708
|
Oe,
|
|
705
709
|
De
|
|
706
710
|
]
|
|
707
|
-
}) : /* @__PURE__ */
|
|
708
|
-
className:
|
|
711
|
+
}) : /* @__PURE__ */ O("div", {
|
|
712
|
+
className: L.surface,
|
|
709
713
|
children: [
|
|
710
714
|
Ee,
|
|
711
715
|
Oe,
|
|
@@ -715,4 +719,4 @@ function J({ schema: r, value: i, defaultValue: o, errors: s, disabled: c = !1,
|
|
|
715
719
|
});
|
|
716
720
|
}
|
|
717
721
|
//#endregion
|
|
718
|
-
export {
|
|
722
|
+
export { Y as SchemaForm, k as SchemaFormActions, ie as SchemaFormFieldRenderer, W as defaultSchemaFormStrings, M as getVisibleFields, j as isFieldDisabled, A as isFieldHidden, ee as resolveSchemaSections, J as useSchemaForm };
|