@pipe0/react 0.0.5 → 0.0.6
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 +8 -0
- package/README.md +58 -2
- package/dist/components/compound/pipe-catalog/active-filters.d.mts +7 -10
- package/dist/components/compound/pipe-catalog/active-filters.d.mts.map +1 -1
- package/dist/components/compound/pipe-catalog/active-filters.mjs +22 -18
- package/dist/components/compound/pipe-catalog/active-filters.mjs.map +1 -1
- package/dist/components/compound/pipe-catalog/card.d.mts +3 -12
- package/dist/components/compound/pipe-catalog/card.d.mts.map +1 -1
- package/dist/components/compound/pipe-catalog/card.mjs +28 -25
- package/dist/components/compound/pipe-catalog/card.mjs.map +1 -1
- package/dist/components/compound/pipe-catalog/category-filter.d.mts +6 -13
- package/dist/components/compound/pipe-catalog/category-filter.d.mts.map +1 -1
- package/dist/components/compound/pipe-catalog/category-filter.mjs +12 -13
- package/dist/components/compound/pipe-catalog/category-filter.mjs.map +1 -1
- package/dist/components/compound/pipe-catalog/column-filter.d.mts +6 -14
- package/dist/components/compound/pipe-catalog/column-filter.d.mts.map +1 -1
- package/dist/components/compound/pipe-catalog/column-filter.mjs +9 -9
- package/dist/components/compound/pipe-catalog/column-filter.mjs.map +1 -1
- package/dist/components/compound/pipe-catalog/empty.d.mts +5 -10
- package/dist/components/compound/pipe-catalog/empty.d.mts.map +1 -1
- package/dist/components/compound/pipe-catalog/empty.mjs +12 -14
- package/dist/components/compound/pipe-catalog/empty.mjs.map +1 -1
- package/dist/components/compound/pipe-catalog/index.d.mts +1 -1
- package/dist/components/compound/pipe-catalog/input-field-filter.d.mts +3 -3
- package/dist/components/compound/pipe-catalog/input-field-filter.d.mts.map +1 -1
- package/dist/components/compound/pipe-catalog/input-field-filter.mjs.map +1 -1
- package/dist/components/compound/pipe-catalog/list.d.mts +8 -25
- package/dist/components/compound/pipe-catalog/list.d.mts.map +1 -1
- package/dist/components/compound/pipe-catalog/list.mjs +14 -14
- package/dist/components/compound/pipe-catalog/list.mjs.map +1 -1
- package/dist/components/compound/pipe-catalog/output-field-filter.d.mts +3 -3
- package/dist/components/compound/pipe-catalog/output-field-filter.d.mts.map +1 -1
- package/dist/components/compound/pipe-catalog/output-field-filter.mjs.map +1 -1
- package/dist/components/compound/pipe-catalog/provider-filter.d.mts +3 -3
- package/dist/components/compound/pipe-catalog/provider-filter.d.mts.map +1 -1
- package/dist/components/compound/pipe-catalog/provider-filter.mjs.map +1 -1
- package/dist/components/compound/pipe-catalog/root.d.mts +6 -6
- package/dist/components/compound/pipe-catalog/root.d.mts.map +1 -1
- package/dist/components/compound/pipe-catalog/root.mjs +2 -2
- package/dist/components/compound/pipe-catalog/root.mjs.map +1 -1
- package/dist/components/compound/pipe-catalog/search-filter.d.mts +5 -9
- package/dist/components/compound/pipe-catalog/search-filter.d.mts.map +1 -1
- package/dist/components/compound/pipe-catalog/search-filter.mjs +9 -10
- package/dist/components/compound/pipe-catalog/search-filter.mjs.map +1 -1
- package/dist/components/compound/pipe-catalog/tag-filter.d.mts +3 -3
- package/dist/components/compound/pipe-catalog/tag-filter.d.mts.map +1 -1
- package/dist/components/compound/pipe-catalog/tag-filter.mjs.map +1 -1
- package/dist/components/compound/pipe-form/content.d.mts +6 -3
- package/dist/components/compound/pipe-form/content.d.mts.map +1 -1
- package/dist/components/compound/pipe-form/content.mjs +17 -25
- package/dist/components/compound/pipe-form/content.mjs.map +1 -1
- package/dist/components/compound/pipe-form/errors.d.mts +23 -0
- package/dist/components/compound/pipe-form/errors.d.mts.map +1 -0
- package/dist/components/compound/pipe-form/errors.mjs +40 -0
- package/dist/components/compound/pipe-form/errors.mjs.map +1 -0
- package/dist/components/compound/pipe-form/footer.d.mts +7 -7
- package/dist/components/compound/pipe-form/footer.d.mts.map +1 -1
- package/dist/components/compound/pipe-form/footer.mjs +11 -6
- package/dist/components/compound/pipe-form/footer.mjs.map +1 -1
- package/dist/components/compound/pipe-form/header.d.mts +7 -7
- package/dist/components/compound/pipe-form/header.d.mts.map +1 -1
- package/dist/components/compound/pipe-form/header.mjs +11 -6
- package/dist/components/compound/pipe-form/header.mjs.map +1 -1
- package/dist/components/compound/pipe-form/index.d.mts +2 -1
- package/dist/components/compound/pipe-form/root.d.mts +18 -11
- package/dist/components/compound/pipe-form/root.d.mts.map +1 -1
- package/dist/components/compound/pipe-form/root.mjs +21 -27
- package/dist/components/compound/pipe-form/root.mjs.map +1 -1
- package/dist/components/compound/pipe-form/submit-button.d.mts +15 -4
- package/dist/components/compound/pipe-form/submit-button.d.mts.map +1 -1
- package/dist/components/compound/pipe-form/submit-button.mjs +23 -8
- package/dist/components/compound/pipe-form/submit-button.mjs.map +1 -1
- package/dist/components/compound/pipe-form/title.d.mts +9 -8
- package/dist/components/compound/pipe-form/title.d.mts.map +1 -1
- package/dist/components/compound/pipe-form/title.mjs +11 -6
- package/dist/components/compound/pipe-form/title.mjs.map +1 -1
- package/dist/components/compound/search-catalog/active-filters.d.mts +7 -10
- package/dist/components/compound/search-catalog/active-filters.d.mts.map +1 -1
- package/dist/components/compound/search-catalog/active-filters.mjs +22 -18
- package/dist/components/compound/search-catalog/active-filters.mjs.map +1 -1
- package/dist/components/compound/search-catalog/card.d.mts +4 -13
- package/dist/components/compound/search-catalog/card.d.mts.map +1 -1
- package/dist/components/compound/search-catalog/card.mjs +31 -28
- package/dist/components/compound/search-catalog/card.mjs.map +1 -1
- package/dist/components/compound/search-catalog/category-filter.d.mts +7 -13
- package/dist/components/compound/search-catalog/category-filter.d.mts.map +1 -1
- package/dist/components/compound/search-catalog/category-filter.mjs +12 -13
- package/dist/components/compound/search-catalog/category-filter.mjs.map +1 -1
- package/dist/components/compound/search-catalog/column-filter.d.mts +6 -10
- package/dist/components/compound/search-catalog/column-filter.d.mts.map +1 -1
- package/dist/components/compound/search-catalog/column-filter.mjs +9 -9
- package/dist/components/compound/search-catalog/column-filter.mjs.map +1 -1
- package/dist/components/compound/search-catalog/empty.d.mts +5 -10
- package/dist/components/compound/search-catalog/empty.d.mts.map +1 -1
- package/dist/components/compound/search-catalog/empty.mjs +12 -14
- package/dist/components/compound/search-catalog/empty.mjs.map +1 -1
- package/dist/components/compound/search-catalog/index.d.mts +1 -1
- package/dist/components/compound/search-catalog/list.d.mts +8 -10
- package/dist/components/compound/search-catalog/list.d.mts.map +1 -1
- package/dist/components/compound/search-catalog/list.mjs +14 -14
- package/dist/components/compound/search-catalog/list.mjs.map +1 -1
- package/dist/components/compound/search-catalog/output-field-filter.d.mts +3 -3
- package/dist/components/compound/search-catalog/output-field-filter.d.mts.map +1 -1
- package/dist/components/compound/search-catalog/output-field-filter.mjs.map +1 -1
- package/dist/components/compound/search-catalog/provider-filter.d.mts +3 -3
- package/dist/components/compound/search-catalog/provider-filter.d.mts.map +1 -1
- package/dist/components/compound/search-catalog/provider-filter.mjs.map +1 -1
- package/dist/components/compound/search-catalog/root.d.mts +6 -6
- package/dist/components/compound/search-catalog/root.d.mts.map +1 -1
- package/dist/components/compound/search-catalog/root.mjs +2 -2
- package/dist/components/compound/search-catalog/root.mjs.map +1 -1
- package/dist/components/compound/search-catalog/search-filter.d.mts +5 -9
- package/dist/components/compound/search-catalog/search-filter.d.mts.map +1 -1
- package/dist/components/compound/search-catalog/search-filter.mjs +9 -10
- package/dist/components/compound/search-catalog/search-filter.mjs.map +1 -1
- package/dist/components/compound/search-catalog/tag-filter.d.mts +3 -3
- package/dist/components/compound/search-catalog/tag-filter.d.mts.map +1 -1
- package/dist/components/compound/search-catalog/tag-filter.mjs.map +1 -1
- package/dist/components/compound/search-form/content.d.mts +6 -3
- package/dist/components/compound/search-form/content.d.mts.map +1 -1
- package/dist/components/compound/search-form/content.mjs +17 -25
- package/dist/components/compound/search-form/content.mjs.map +1 -1
- package/dist/components/compound/search-form/errors.d.mts +23 -0
- package/dist/components/compound/search-form/errors.d.mts.map +1 -0
- package/dist/components/compound/search-form/errors.mjs +40 -0
- package/dist/components/compound/search-form/errors.mjs.map +1 -0
- package/dist/components/compound/search-form/footer.d.mts +7 -7
- package/dist/components/compound/search-form/footer.d.mts.map +1 -1
- package/dist/components/compound/search-form/footer.mjs +11 -6
- package/dist/components/compound/search-form/footer.mjs.map +1 -1
- package/dist/components/compound/search-form/header.d.mts +7 -7
- package/dist/components/compound/search-form/header.d.mts.map +1 -1
- package/dist/components/compound/search-form/header.mjs +11 -6
- package/dist/components/compound/search-form/header.mjs.map +1 -1
- package/dist/components/compound/search-form/index.d.mts +2 -1
- package/dist/components/compound/search-form/root.d.mts +19 -12
- package/dist/components/compound/search-form/root.d.mts.map +1 -1
- package/dist/components/compound/search-form/root.mjs +21 -27
- package/dist/components/compound/search-form/root.mjs.map +1 -1
- package/dist/components/compound/search-form/submit-button.d.mts +15 -4
- package/dist/components/compound/search-form/submit-button.d.mts.map +1 -1
- package/dist/components/compound/search-form/submit-button.mjs +23 -8
- package/dist/components/compound/search-form/submit-button.mjs.map +1 -1
- package/dist/components/compound/search-form/title.d.mts +9 -8
- package/dist/components/compound/search-form/title.d.mts.map +1 -1
- package/dist/components/compound/search-form/title.mjs +11 -6
- package/dist/components/compound/search-form/title.mjs.map +1 -1
- package/dist/components/compound/searches-catalog/active-filters.d.mts +7 -10
- package/dist/components/compound/searches-catalog/active-filters.d.mts.map +1 -1
- package/dist/components/compound/searches-catalog/active-filters.mjs +22 -18
- package/dist/components/compound/searches-catalog/active-filters.mjs.map +1 -1
- package/dist/components/compound/searches-catalog/card.d.mts +5 -6
- package/dist/components/compound/searches-catalog/card.d.mts.map +1 -1
- package/dist/components/compound/searches-catalog/card.mjs +38 -28
- package/dist/components/compound/searches-catalog/card.mjs.map +1 -1
- package/dist/components/compound/searches-catalog/category-filter.d.mts +7 -13
- package/dist/components/compound/searches-catalog/category-filter.d.mts.map +1 -1
- package/dist/components/compound/searches-catalog/category-filter.mjs +12 -13
- package/dist/components/compound/searches-catalog/category-filter.mjs.map +1 -1
- package/dist/components/compound/searches-catalog/column-filter.d.mts +6 -10
- package/dist/components/compound/searches-catalog/column-filter.d.mts.map +1 -1
- package/dist/components/compound/searches-catalog/column-filter.mjs +9 -9
- package/dist/components/compound/searches-catalog/column-filter.mjs.map +1 -1
- package/dist/components/compound/searches-catalog/empty.d.mts +5 -10
- package/dist/components/compound/searches-catalog/empty.d.mts.map +1 -1
- package/dist/components/compound/searches-catalog/empty.mjs +12 -14
- package/dist/components/compound/searches-catalog/empty.mjs.map +1 -1
- package/dist/components/compound/searches-catalog/index.d.mts +1 -1
- package/dist/components/compound/searches-catalog/list.d.mts +8 -10
- package/dist/components/compound/searches-catalog/list.d.mts.map +1 -1
- package/dist/components/compound/searches-catalog/list.mjs +14 -14
- package/dist/components/compound/searches-catalog/list.mjs.map +1 -1
- package/dist/components/compound/searches-catalog/output-field-filter.d.mts +3 -3
- package/dist/components/compound/searches-catalog/output-field-filter.d.mts.map +1 -1
- package/dist/components/compound/searches-catalog/output-field-filter.mjs.map +1 -1
- package/dist/components/compound/searches-catalog/provider-filter.d.mts +3 -3
- package/dist/components/compound/searches-catalog/provider-filter.d.mts.map +1 -1
- package/dist/components/compound/searches-catalog/provider-filter.mjs.map +1 -1
- package/dist/components/compound/searches-catalog/root.d.mts +6 -6
- package/dist/components/compound/searches-catalog/root.d.mts.map +1 -1
- package/dist/components/compound/searches-catalog/root.mjs +2 -2
- package/dist/components/compound/searches-catalog/root.mjs.map +1 -1
- package/dist/components/compound/searches-catalog/search-filter.d.mts +5 -9
- package/dist/components/compound/searches-catalog/search-filter.d.mts.map +1 -1
- package/dist/components/compound/searches-catalog/search-filter.mjs +9 -10
- package/dist/components/compound/searches-catalog/search-filter.mjs.map +1 -1
- package/dist/components/compound/searches-catalog/tag-filter.d.mts +3 -3
- package/dist/components/compound/searches-catalog/tag-filter.d.mts.map +1 -1
- package/dist/components/compound/searches-catalog/tag-filter.mjs.map +1 -1
- package/dist/components/defaults/adapters/index.mjs +2 -2
- package/dist/components/defaults/adapters/index.mjs.map +1 -1
- package/dist/components/defaults/adapters/json-extraction-input.mjs +291 -199
- package/dist/components/defaults/adapters/json-extraction-input.mjs.map +1 -1
- package/dist/components/defaults/adapters/{pipes-trigger-input.mjs → pipes-run-if-input.mjs} +32 -32
- package/dist/components/defaults/adapters/pipes-run-if-input.mjs.map +1 -0
- package/dist/components/defaults/adapters/providers-input.mjs +221 -13
- package/dist/components/defaults/adapters/providers-input.mjs.map +1 -1
- package/dist/components/defaults/catalog/card-primitives.d.mts +14 -24
- package/dist/components/defaults/catalog/card-primitives.d.mts.map +1 -1
- package/dist/components/defaults/catalog/card-primitives.mjs +19 -19
- package/dist/components/defaults/catalog/card-primitives.mjs.map +1 -1
- package/dist/components/defaults/catalog/layout.mjs +7 -10
- package/dist/components/defaults/catalog/layout.mjs.map +1 -1
- package/dist/components/defaults/layout/field-wrapper.d.mts +2 -2
- package/dist/components/defaults/layout/field-wrapper.d.mts.map +1 -1
- package/dist/components/defaults/layout/field-wrapper.mjs +5 -2
- package/dist/components/defaults/layout/field-wrapper.mjs.map +1 -1
- package/dist/components/defaults/layout/group.d.mts +4 -4
- package/dist/components/defaults/layout/group.d.mts.map +1 -1
- package/dist/components/defaults/layout/group.mjs +69 -54
- package/dist/components/defaults/layout/group.mjs.map +1 -1
- package/dist/components/defaults/layout/section.d.mts +9 -4
- package/dist/components/defaults/layout/section.d.mts.map +1 -1
- package/dist/components/defaults/layout/section.mjs +11 -13
- package/dist/components/defaults/layout/section.mjs.map +1 -1
- package/dist/components/field-renderer.d.mts.map +1 -1
- package/dist/components/field-renderer.mjs +1 -1
- package/dist/components/field-renderer.mjs.map +1 -1
- package/dist/components/internal/LiquidEditor/ChipEditPopover.mjs +30 -15
- package/dist/components/internal/LiquidEditor/ChipEditPopover.mjs.map +1 -1
- package/dist/components/internal/icons.mjs +36 -1
- package/dist/components/internal/icons.mjs.map +1 -1
- package/dist/components/internal/multi-select-popover-trigger.mjs +0 -1
- package/dist/components/internal/multi-select-popover-trigger.mjs.map +1 -1
- package/dist/components/internal/tag-chip-decoration.mjs +15 -0
- package/dist/components/internal/tag-chip-decoration.mjs.map +1 -1
- package/dist/components/ui/badge.mjs +1 -1
- package/dist/components/ui/button.d.mts +1 -1
- package/dist/components/ui/combobox.mjs +0 -1
- package/dist/components/ui/combobox.mjs.map +1 -1
- package/dist/context/pipe-catalog-card-context.d.mts +7 -0
- package/dist/context/pipe-catalog-card-context.d.mts.map +1 -1
- package/dist/context/pipe-catalog-card-context.mjs.map +1 -1
- package/dist/context/pipe-form-context.d.mts +17 -3
- package/dist/context/pipe-form-context.d.mts.map +1 -1
- package/dist/context/pipe-form-context.mjs.map +1 -1
- package/dist/context/search-catalog-card-context.d.mts +8 -0
- package/dist/context/search-catalog-card-context.d.mts.map +1 -1
- package/dist/context/search-catalog-card-context.mjs.map +1 -1
- package/dist/context/search-form-context.d.mts +17 -3
- package/dist/context/search-form-context.d.mts.map +1 -1
- package/dist/context/search-form-context.mjs.map +1 -1
- package/dist/context/searches-catalog-card-context.d.mts +8 -0
- package/dist/context/searches-catalog-card-context.d.mts.map +1 -1
- package/dist/context/searches-catalog-card-context.mjs.map +1 -1
- package/dist/hooks/use-field-error.d.mts +2 -2
- package/dist/hooks/use-field-error.d.mts.map +1 -1
- package/dist/hooks/use-field-error.mjs +7 -3
- package/dist/hooks/use-field-error.mjs.map +1 -1
- package/dist/hooks/use-form-core.d.mts +0 -3
- package/dist/hooks/use-form-core.d.mts.map +1 -1
- package/dist/hooks/use-form-core.mjs +36 -2
- package/dist/hooks/use-form-core.mjs.map +1 -1
- package/dist/hooks/use-pipe-catalog-table.d.mts +8 -8
- package/dist/hooks/use-pipe-form.d.mts +11 -0
- package/dist/hooks/use-pipe-form.d.mts.map +1 -1
- package/dist/hooks/use-pipe-form.mjs +35 -6
- package/dist/hooks/use-pipe-form.mjs.map +1 -1
- package/dist/hooks/use-search-catalog-table.d.mts +6 -6
- package/dist/hooks/use-search-form.d.mts +11 -0
- package/dist/hooks/use-search-form.d.mts.map +1 -1
- package/dist/hooks/use-search-form.mjs +35 -6
- package/dist/hooks/use-search-form.mjs.map +1 -1
- package/dist/index.d.mts +9 -8
- package/dist/index.mjs +3 -9
- package/dist/styles/pipe0-form.css +4116 -1
- package/dist/types/adapters.d.mts +6 -5
- package/dist/types/adapters.d.mts.map +1 -1
- package/dist/types/catalog-adapters.d.mts +2 -2
- package/dist/types/field-props.d.mts +4 -16
- package/dist/types/field-props.d.mts.map +1 -1
- package/dist/types/form-handle.d.mts +81 -1
- package/dist/types/form-handle.d.mts.map +1 -1
- package/dist/utils/build-section-handlers.mjs +6 -2
- package/dist/utils/build-section-handlers.mjs.map +1 -1
- package/dist/utils/internal-form.mjs +28 -0
- package/dist/utils/internal-form.mjs.map +1 -0
- package/dist/widgets/avatar-group.d.mts +4 -7
- package/dist/widgets/avatar-group.d.mts.map +1 -1
- package/dist/widgets/avatar-group.mjs +13 -12
- package/dist/widgets/avatar-group.mjs.map +1 -1
- package/package.json +70 -18
- package/dist/components/compound/pipe-catalog/index.mjs +0 -15
- package/dist/components/compound/pipe-form/index.mjs +0 -11
- package/dist/components/compound/search-catalog/index.mjs +0 -14
- package/dist/components/compound/search-form/index.mjs +0 -11
- package/dist/components/compound/searches-catalog/index.mjs +0 -14
- package/dist/components/defaults/adapters/pipes-trigger-input.mjs.map +0 -1
- package/dist/components/defaults/layout/submit-button.d.mts +0 -9
- package/dist/components/defaults/layout/submit-button.d.mts.map +0 -1
- package/dist/components/defaults/layout/submit-button.mjs +0 -23
- package/dist/components/defaults/layout/submit-button.mjs.map +0 -1
- package/dist/components/defaults/toggle-advanced-button.mjs +0 -29
- package/dist/components/defaults/toggle-advanced-button.mjs.map +0 -1
- package/dist/components/ui/input-group.mjs +0 -30
- package/dist/components/ui/input-group.mjs.map +0 -1
- package/dist/context/form-customization-context.d.mts +0 -71
- package/dist/context/form-customization-context.d.mts.map +0 -1
- package/dist/context/form-customization-context.mjs +0 -114
- package/dist/context/form-customization-context.mjs.map +0 -1
- package/dist/hooks/use-disclosure.mjs +0 -35
- package/dist/hooks/use-disclosure.mjs.map +0 -1
- package/dist/utils/render-slot.d.mts +0 -44
- package/dist/utils/render-slot.d.mts.map +0 -1
- package/dist/utils/render-slot.mjs +0 -30
- package/dist/utils/render-slot.mjs.map +0 -1
- package/dist/widgets/index.mjs +0 -11
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.mts","names":[],"sources":["../../../../src/components/compound/search-form/errors.tsx"],"mappings":";;;;UAMiB,qBAAA;EACf,mBAAA;AAAA;AAAA,UAGe,qBAAA,SACP,SAAA,CAAU,cAAA,QAAsB,qBAAA;;;;AAD1C;;;iBASgB,gBAAA,CAAA;EAAmB,QAAA;EAAU,SAAA;EAAW,MAAA;EAAA,GAAW;AAAA,GAAS,qBAAA,GAAqB,OAAA,CAAA,YAAA,mBAAA,OAAA,CAAA,qBAAA"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { asInternalForm } from "../../../utils/internal-form.mjs";
|
|
2
|
+
import { FormLevelErrors } from "../../internal/form-level-errors.mjs";
|
|
3
|
+
import { useSearchFormContext } from "../../../context/search-form-context.mjs";
|
|
4
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
5
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
6
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
|
|
8
|
+
//#region src/components/compound/search-form/errors.tsx
|
|
9
|
+
/**
|
|
10
|
+
* Renders form-wide errors that don't belong to a specific visible field:
|
|
11
|
+
* the field-loader banner (when a resolver fails to load options for a
|
|
12
|
+
* field) and form-level validation errors (errors not attached to any
|
|
13
|
+
* rendered field).
|
|
14
|
+
*/
|
|
15
|
+
function SearchFormErrors({ children, className, render, ...props }) {
|
|
16
|
+
const { hasFieldLoaderError, fieldPaths, form } = useSearchFormContext();
|
|
17
|
+
const defaultBody = /* @__PURE__ */ jsxs(Fragment, { children: [hasFieldLoaderError && /* @__PURE__ */ jsx("div", {
|
|
18
|
+
"data-p0": "store-error",
|
|
19
|
+
role: "alert",
|
|
20
|
+
className: "pz:flex pz:flex-col pz:gap-1 pz:rounded-md pz:border pz:border-destructive/50 pz:bg-destructive/5 pz:px-3 pz:py-2 pz:text-destructive pz:text-xs pz:font-medium",
|
|
21
|
+
children: /* @__PURE__ */ jsx("span", { children: "Failed to load options for one or more fields. Check that your connection is valid." })
|
|
22
|
+
}), /* @__PURE__ */ jsx(FormLevelErrors, {
|
|
23
|
+
control: asInternalForm(form).control,
|
|
24
|
+
fieldPaths
|
|
25
|
+
})] });
|
|
26
|
+
return useRender({
|
|
27
|
+
defaultTagName: "div",
|
|
28
|
+
render,
|
|
29
|
+
state: { hasFieldLoaderError },
|
|
30
|
+
props: mergeProps({
|
|
31
|
+
className,
|
|
32
|
+
children: children ?? defaultBody,
|
|
33
|
+
"data-p0": "form-errors"
|
|
34
|
+
}, props)
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
//#endregion
|
|
39
|
+
export { SearchFormErrors };
|
|
40
|
+
//# sourceMappingURL=errors.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.mjs","names":[],"sources":["../../../../src/components/compound/search-form/errors.tsx"],"sourcesContent":["import { mergeProps } from \"@base-ui/react/merge-props\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport { useSearchFormContext } from \"../../../context/search-form-context.js\";\nimport { asInternalForm } from \"../../../utils/internal-form.js\";\nimport { FormLevelErrors } from \"../../internal/form-level-errors.js\";\n\nexport interface SearchFormErrorsState {\n hasFieldLoaderError: boolean;\n}\n\nexport interface SearchFormErrorsProps\n extends useRender.ComponentProps<\"div\", SearchFormErrorsState> {}\n\n/**\n * Renders form-wide errors that don't belong to a specific visible field:\n * the field-loader banner (when a resolver fails to load options for a\n * field) and form-level validation errors (errors not attached to any\n * rendered field).\n */\nexport function SearchFormErrors({ children, className, render, ...props }: SearchFormErrorsProps) {\n const { hasFieldLoaderError, fieldPaths, form } = useSearchFormContext();\n\n const defaultBody = (\n <>\n {hasFieldLoaderError && (\n <div\n data-p0=\"store-error\"\n role=\"alert\"\n className=\"pz:flex pz:flex-col pz:gap-1 pz:rounded-md pz:border pz:border-destructive/50 pz:bg-destructive/5 pz:px-3 pz:py-2 pz:text-destructive pz:text-xs pz:font-medium\"\n >\n <span>\n Failed to load options for one or more fields. Check that your connection is valid.\n </span>\n </div>\n )}\n <FormLevelErrors control={asInternalForm(form).control} fieldPaths={fieldPaths} />\n </>\n );\n\n return useRender({\n defaultTagName: \"div\",\n render,\n state: { hasFieldLoaderError },\n props: mergeProps<\"div\">(\n {\n className,\n children: children ?? defaultBody,\n ...({ \"data-p0\": \"form-errors\" } as Record<string, string>),\n },\n props,\n ),\n });\n}\n"],"mappings":";;;;;;;;;;;;;;AAmBA,SAAgB,iBAAiB,EAAE,UAAU,WAAW,QAAQ,GAAG,SAAgC;CACjG,MAAM,EAAE,qBAAqB,YAAY,SAAS,sBAAsB;CAExE,MAAM,cACJ,4CACG,uBACC,oBAAC,OAAD;EACE,WAAQ;EACR,MAAK;EACL,WAAU;YAEV,oBAAC,QAAD,YAAM,uFAEC;EACH,GAER,oBAAC,iBAAD;EAAiB,SAAS,eAAe,KAAK,CAAC;EAAqB;EAAc,EACjF;AAGL,QAAO,UAAU;EACf,gBAAgB;EAChB;EACA,OAAO,EAAE,qBAAqB;EAC9B,OAAO,WACL;GACE;GACA,UAAU,YAAY;GAChB,WAAW;GAClB,EACD,MACD;EACF,CAAC"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as _$
|
|
1
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
2
|
+
import * as _$react from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/compound/search-form/footer.d.ts
|
|
5
|
+
interface SearchFormFooterProps extends useRender.ComponentProps<"div"> {}
|
|
5
6
|
declare function SearchFormFooter({
|
|
6
7
|
children,
|
|
7
|
-
className
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}): _$react_jsx_runtime0.JSX.Element;
|
|
8
|
+
className,
|
|
9
|
+
render,
|
|
10
|
+
...props
|
|
11
|
+
}: SearchFormFooterProps): _$react.ReactElement<unknown, string | _$react.JSXElementConstructor<any>>;
|
|
12
12
|
//#endregion
|
|
13
13
|
export { SearchFormFooter };
|
|
14
14
|
//# sourceMappingURL=footer.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"footer.d.mts","names":[],"sources":["../../../../src/components/compound/search-form/footer.tsx"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"footer.d.mts","names":[],"sources":["../../../../src/components/compound/search-form/footer.tsx"],"mappings":";;;;UAGiB,qBAAA,SAA8B,SAAA,CAAU,cAAA;AAAA,iBAEzC,gBAAA,CAAA;EAAmB,QAAA;EAAU,SAAA;EAAW,MAAA;EAAA,GAAW;AAAA,GAAS,qBAAA,GAAqB,OAAA,CAAA,YAAA,mBAAA,OAAA,CAAA,qBAAA"}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
2
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
2
3
|
|
|
3
4
|
//#region src/components/compound/search-form/footer.tsx
|
|
4
|
-
function SearchFormFooter({ children, className }) {
|
|
5
|
-
return
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
function SearchFormFooter({ children, className, render, ...props }) {
|
|
6
|
+
return useRender({
|
|
7
|
+
defaultTagName: "div",
|
|
8
|
+
render,
|
|
9
|
+
props: mergeProps({
|
|
10
|
+
className,
|
|
11
|
+
children,
|
|
12
|
+
"data-p0": "form-footer"
|
|
13
|
+
}, props)
|
|
9
14
|
});
|
|
10
15
|
}
|
|
11
16
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"footer.mjs","names":[],"sources":["../../../../src/components/compound/search-form/footer.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"footer.mjs","names":[],"sources":["../../../../src/components/compound/search-form/footer.tsx"],"sourcesContent":["import { mergeProps } from \"@base-ui/react/merge-props\";\nimport { useRender } from \"@base-ui/react/use-render\";\n\nexport interface SearchFormFooterProps extends useRender.ComponentProps<\"div\"> {}\n\nexport function SearchFormFooter({ children, className, render, ...props }: SearchFormFooterProps) {\n return useRender({\n defaultTagName: \"div\",\n render,\n props: mergeProps<\"div\">(\n {\n className,\n children,\n ...({ \"data-p0\": \"form-footer\" } as Record<string, string>),\n },\n props,\n ),\n });\n}\n"],"mappings":";;;;AAKA,SAAgB,iBAAiB,EAAE,UAAU,WAAW,QAAQ,GAAG,SAAgC;AACjG,QAAO,UAAU;EACf,gBAAgB;EAChB;EACA,OAAO,WACL;GACE;GACA;GACM,WAAW;GAClB,EACD,MACD;EACF,CAAC"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as _$
|
|
1
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
2
|
+
import * as _$react from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/compound/search-form/header.d.ts
|
|
5
|
+
interface SearchFormHeaderProps extends useRender.ComponentProps<"div"> {}
|
|
5
6
|
declare function SearchFormHeader({
|
|
6
7
|
children,
|
|
7
|
-
className
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}): _$react_jsx_runtime0.JSX.Element;
|
|
8
|
+
className,
|
|
9
|
+
render,
|
|
10
|
+
...props
|
|
11
|
+
}: SearchFormHeaderProps): _$react.ReactElement<unknown, string | _$react.JSXElementConstructor<any>>;
|
|
12
12
|
//#endregion
|
|
13
13
|
export { SearchFormHeader };
|
|
14
14
|
//# sourceMappingURL=header.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header.d.mts","names":[],"sources":["../../../../src/components/compound/search-form/header.tsx"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"header.d.mts","names":[],"sources":["../../../../src/components/compound/search-form/header.tsx"],"mappings":";;;;UAGiB,qBAAA,SAA8B,SAAA,CAAU,cAAA;AAAA,iBAEzC,gBAAA,CAAA;EAAmB,QAAA;EAAU,SAAA;EAAW,MAAA;EAAA,GAAW;AAAA,GAAS,qBAAA,GAAqB,OAAA,CAAA,YAAA,mBAAA,OAAA,CAAA,qBAAA"}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
2
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
2
3
|
|
|
3
4
|
//#region src/components/compound/search-form/header.tsx
|
|
4
|
-
function SearchFormHeader({ children, className }) {
|
|
5
|
-
return
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
function SearchFormHeader({ children, className, render, ...props }) {
|
|
6
|
+
return useRender({
|
|
7
|
+
defaultTagName: "div",
|
|
8
|
+
render,
|
|
9
|
+
props: mergeProps({
|
|
10
|
+
className,
|
|
11
|
+
children,
|
|
12
|
+
"data-p0": "form-header"
|
|
13
|
+
}, props)
|
|
9
14
|
});
|
|
10
15
|
}
|
|
11
16
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header.mjs","names":[],"sources":["../../../../src/components/compound/search-form/header.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"header.mjs","names":[],"sources":["../../../../src/components/compound/search-form/header.tsx"],"sourcesContent":["import { mergeProps } from \"@base-ui/react/merge-props\";\nimport { useRender } from \"@base-ui/react/use-render\";\n\nexport interface SearchFormHeaderProps extends useRender.ComponentProps<\"div\"> {}\n\nexport function SearchFormHeader({ children, className, render, ...props }: SearchFormHeaderProps) {\n return useRender({\n defaultTagName: \"div\",\n render,\n props: mergeProps<\"div\">(\n {\n className,\n children,\n ...({ \"data-p0\": \"form-header\" } as Record<string, string>),\n },\n props,\n ),\n });\n}\n"],"mappings":";;;;AAKA,SAAgB,iBAAiB,EAAE,UAAU,WAAW,QAAQ,GAAG,SAAgC;AACjG,QAAO,UAAU;EACf,gBAAgB;EAChB;EACA,OAAO,WACL;GACE;GACA;GACM,WAAW;GAClB,EACD,MACD;EACF,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { SearchFormContent } from "./content.mjs";
|
|
2
|
+
import { SearchFormErrors } from "./errors.mjs";
|
|
2
3
|
import { SearchFormField } from "./field.mjs";
|
|
3
4
|
import { SearchFormFooter } from "./footer.mjs";
|
|
4
5
|
import { SearchFormGroup } from "./group.mjs";
|
|
5
6
|
import { SearchFormHeader } from "./header.mjs";
|
|
6
|
-
import { SearchForm, SearchFormInstanceProps,
|
|
7
|
+
import { SearchForm, SearchFormInstanceProps, SearchFormProps, SearchFormZeroConfigProps } from "./root.mjs";
|
|
7
8
|
import { SearchFormSection } from "./section.mjs";
|
|
8
9
|
import { SearchFormSubmitButton } from "./submit-button.mjs";
|
|
9
10
|
import { SearchFormTitle } from "./title.mjs";
|
|
@@ -1,45 +1,52 @@
|
|
|
1
|
+
import { FormHandle } from "../../../types/form-handle.mjs";
|
|
1
2
|
import { FieldAdapterMap, FormClassNames } from "../../../types/adapters.mjs";
|
|
2
3
|
import { GroupMap, PathMap, SectionMap } from "../../../types/form-customization.mjs";
|
|
3
4
|
import { SearchFormContext } from "../../../context/search-form-context.mjs";
|
|
4
5
|
import { ReactNode } from "react";
|
|
5
6
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
6
7
|
import { FormResolvers, PipesEnvironment, SearchId, SearchPayload } from "@pipe0/base";
|
|
7
|
-
import { UseFormReturn } from "react-hook-form";
|
|
8
8
|
|
|
9
9
|
//#region src/components/compound/search-form/root.d.ts
|
|
10
10
|
type SearchFormSubmitHandler = (payload: SearchPayload, ctx: {
|
|
11
|
-
form:
|
|
11
|
+
form: FormHandle<SearchPayload>;
|
|
12
12
|
}) => void | Promise<void>;
|
|
13
|
-
interface
|
|
14
|
-
sectionMap?: SectionMap;
|
|
15
|
-
groupMap?: GroupMap;
|
|
16
|
-
pathMap?: PathMap;
|
|
13
|
+
interface RenderingProps {
|
|
17
14
|
classNames?: FormClassNames;
|
|
18
15
|
adapters?: FieldAdapterMap;
|
|
19
16
|
className?: string;
|
|
20
17
|
}
|
|
21
|
-
interface SearchFormInstanceProps extends
|
|
18
|
+
interface SearchFormInstanceProps extends RenderingProps {
|
|
22
19
|
context: SearchFormContext;
|
|
23
20
|
onSubmit: SearchFormSubmitHandler;
|
|
24
21
|
children?: ReactNode;
|
|
25
22
|
}
|
|
26
|
-
interface
|
|
23
|
+
interface SearchFormZeroConfigProps extends RenderingProps {
|
|
27
24
|
searchId: SearchId;
|
|
28
25
|
publicKey: string;
|
|
29
26
|
onSubmit: SearchFormSubmitHandler;
|
|
30
27
|
defaultValues?: SearchPayload;
|
|
31
28
|
resolvers?: FormResolvers;
|
|
32
29
|
environment?: PipesEnvironment;
|
|
30
|
+
/**
|
|
31
|
+
* Hide / relabel / reorder sections by section key. `null` hides a section.
|
|
32
|
+
* Forwarded to the internal `useSearchForm` call. For `<SearchForm context={...}>`,
|
|
33
|
+
* pass these to `useSearchForm` directly instead.
|
|
34
|
+
*/
|
|
35
|
+
sectionMap?: SectionMap;
|
|
36
|
+
groupMap?: GroupMap;
|
|
37
|
+
pathMap?: PathMap;
|
|
33
38
|
children?: ReactNode;
|
|
34
39
|
}
|
|
35
|
-
type SearchFormProps = SearchFormInstanceProps |
|
|
40
|
+
type SearchFormProps = SearchFormInstanceProps | SearchFormZeroConfigProps;
|
|
36
41
|
/**
|
|
37
42
|
* Compound root for search forms.
|
|
38
43
|
*
|
|
39
|
-
* - Compound: `<SearchForm context={ctx} onSubmit={...}>...</SearchForm>`
|
|
40
|
-
*
|
|
44
|
+
* - Compound: `<SearchForm context={ctx} onSubmit={...}>...</SearchForm>` — pass the context from
|
|
45
|
+
* `useSearchForm`. Visibility customization lives on the hook in this mode.
|
|
46
|
+
* - Zero-config: `<SearchForm searchId="..." publicKey="..." onSubmit={...} />` — fresh hook
|
|
47
|
+
* created internally; visibility maps may be passed as props and forward to that hook.
|
|
41
48
|
*/
|
|
42
49
|
declare function SearchForm(props: SearchFormProps): _$react_jsx_runtime0.JSX.Element;
|
|
43
50
|
//#endregion
|
|
44
|
-
export { SearchForm, SearchFormInstanceProps,
|
|
51
|
+
export { SearchForm, SearchFormInstanceProps, SearchFormProps, SearchFormZeroConfigProps };
|
|
45
52
|
//# sourceMappingURL=root.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"root.d.mts","names":[],"sources":["../../../../src/components/compound/search-form/root.tsx"],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"root.d.mts","names":[],"sources":["../../../../src/components/compound/search-form/root.tsx"],"mappings":";;;;;;;;;KAcY,uBAAA,IACV,OAAA,EAAS,aAAA,EACT,GAAA;EAAO,IAAA,EAAM,UAAA,CAAW,aAAA;AAAA,aACd,OAAA;AAAA,UAEF,cAAA;EACR,UAAA,GAAa,cAAA;EACb,QAAA,GAAW,eAAA;EACX,SAAA;AAAA;AAAA,UAGe,uBAAA,SAAgC,cAAA;EAC/C,OAAA,EAAS,iBAAA;EACT,QAAA,EAAU,uBAAA;EACV,QAAA,GAAW,SAAA;AAAA;AAAA,UAGI,yBAAA,SAAkC,cAAA;EACjD,QAAA,EAAU,QAAA;EACV,SAAA;EACA,QAAA,EAAU,uBAAA;EACV,aAAA,GAAgB,aAAA;EAChB,SAAA,GAAY,aAAA;EACZ,WAAA,GAAc,gBAAA;EApBG;AAAO;;;;EA0BxB,UAAA,GAAa,UAAA;EACb,QAAA,GAAW,QAAA;EACX,OAAA,GAAU,OAAA;EACV,QAAA,GAAW,SAAA;AAAA;AAAA,KAGD,eAAA,GAAkB,uBAAA,GAA0B,yBAAA;;AAxBxD;;;;;;;iBAkCgB,UAAA,CAAW,KAAA,EAAO,eAAA,GAAe,oBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -1,52 +1,53 @@
|
|
|
1
1
|
import { PortalContainerContext } from "../../../context/portal-container-context.mjs";
|
|
2
|
-
import { FormCustomizationProvider, useFormCustomization } from "../../../context/form-customization-context.mjs";
|
|
3
2
|
import { FormProvider, FormRoot } from "../../../context/form-provider.mjs";
|
|
4
3
|
import { DefaultForm } from "../../defaults/layout/form.mjs";
|
|
5
4
|
import { SearchFormContext, useSearchFormContext } from "../../../context/search-form-context.mjs";
|
|
6
5
|
import { SearchFormContent } from "./content.mjs";
|
|
7
6
|
import { useSearchForm } from "../../../hooks/use-search-form.mjs";
|
|
8
7
|
import { SearchFormSubmitButton } from "./submit-button.mjs";
|
|
9
|
-
import { useCallback,
|
|
8
|
+
import { useCallback, useState } from "react";
|
|
10
9
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
11
10
|
|
|
12
11
|
//#region src/components/compound/search-form/root.tsx
|
|
13
12
|
/**
|
|
14
13
|
* Compound root for search forms.
|
|
15
14
|
*
|
|
16
|
-
* - Compound: `<SearchForm context={ctx} onSubmit={...}>...</SearchForm>`
|
|
17
|
-
*
|
|
15
|
+
* - Compound: `<SearchForm context={ctx} onSubmit={...}>...</SearchForm>` — pass the context from
|
|
16
|
+
* `useSearchForm`. Visibility customization lives on the hook in this mode.
|
|
17
|
+
* - Zero-config: `<SearchForm searchId="..." publicKey="..." onSubmit={...} />` — fresh hook
|
|
18
|
+
* created internally; visibility maps may be passed as props and forward to that hook.
|
|
18
19
|
*/
|
|
19
20
|
function SearchForm(props) {
|
|
20
21
|
if ("context" in props) return /* @__PURE__ */ jsx(SearchFormWithContext, { ...props });
|
|
21
|
-
return /* @__PURE__ */ jsx(
|
|
22
|
+
return /* @__PURE__ */ jsx(SearchFormZeroConfig, { ...props });
|
|
22
23
|
}
|
|
23
|
-
function
|
|
24
|
+
function SearchFormZeroConfig({ searchId, publicKey, defaultValues, onSubmit, resolvers, environment, sectionMap, groupMap, pathMap, children, classNames, adapters, className }) {
|
|
24
25
|
return /* @__PURE__ */ jsx(SearchFormWithContext, {
|
|
25
26
|
context: useSearchForm({
|
|
26
27
|
searchId,
|
|
27
28
|
publicKey,
|
|
28
29
|
defaultValues,
|
|
29
30
|
resolvers,
|
|
30
|
-
environment
|
|
31
|
+
environment,
|
|
32
|
+
sectionMap,
|
|
33
|
+
groupMap,
|
|
34
|
+
pathMap
|
|
31
35
|
}),
|
|
32
36
|
onSubmit,
|
|
33
|
-
|
|
37
|
+
className,
|
|
38
|
+
classNames,
|
|
39
|
+
adapters,
|
|
34
40
|
children
|
|
35
41
|
});
|
|
36
42
|
}
|
|
37
|
-
function SearchFormWithContext({ context, onSubmit, children, className,
|
|
43
|
+
function SearchFormWithContext({ context, onSubmit, children, className, classNames, adapters }) {
|
|
38
44
|
const hasLocalOverrides = classNames || adapters;
|
|
39
|
-
const inner = /* @__PURE__ */ jsx(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
children: /* @__PURE__ */ jsx(SearchFormShell, {
|
|
46
|
-
className,
|
|
47
|
-
onSubmit,
|
|
48
|
-
children
|
|
49
|
-
})
|
|
45
|
+
const inner = /* @__PURE__ */ jsx(SearchFormContext.Provider, {
|
|
46
|
+
value: context,
|
|
47
|
+
children: /* @__PURE__ */ jsx(SearchFormShell, {
|
|
48
|
+
className,
|
|
49
|
+
onSubmit,
|
|
50
|
+
children
|
|
50
51
|
})
|
|
51
52
|
});
|
|
52
53
|
if (hasLocalOverrides) return /* @__PURE__ */ jsx(FormRoot, { children: /* @__PURE__ */ jsx(FormProvider, {
|
|
@@ -57,14 +58,7 @@ function SearchFormWithContext({ context, onSubmit, children, className, section
|
|
|
57
58
|
return /* @__PURE__ */ jsx(FormRoot, { children: inner });
|
|
58
59
|
}
|
|
59
60
|
function SearchFormShell({ children, className, onSubmit }) {
|
|
60
|
-
const [, dispatch] = useFormCustomization();
|
|
61
61
|
const context = useSearchFormContext();
|
|
62
|
-
useEffect(() => {
|
|
63
|
-
if (!context.resolvers?.getConnections) dispatch({
|
|
64
|
-
type: "HIDE_SECTION",
|
|
65
|
-
payload: "connector"
|
|
66
|
-
});
|
|
67
|
-
}, [context.resolvers, dispatch]);
|
|
68
62
|
const [portalContainer, setPortalContainer] = useState(null);
|
|
69
63
|
const portalRef = useCallback((node) => {
|
|
70
64
|
setPortalContainer(node);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"root.mjs","names":[],"sources":["../../../../src/components/compound/search-form/root.tsx"],"sourcesContent":["import type { FormResolvers, PipesEnvironment, SearchId, SearchPayload } from \"@pipe0/base\";\nimport { type ReactNode, useCallback,
|
|
1
|
+
{"version":3,"file":"root.mjs","names":[],"sources":["../../../../src/components/compound/search-form/root.tsx"],"sourcesContent":["import type { FormResolvers, PipesEnvironment, SearchId, SearchPayload } from \"@pipe0/base\";\nimport { type ReactNode, useCallback, useState } from \"react\";\nimport { FormProvider, FormRoot } from \"../../../context/form-provider.js\";\nimport { PortalContainerContext } from \"../../../context/portal-container-context.js\";\nimport type { SearchFormContext as SearchFormContextValue } from \"../../../context/search-form-context.js\";\nimport { SearchFormContext, useSearchFormContext } from \"../../../context/search-form-context.js\";\nimport { useSearchForm } from \"../../../hooks/use-search-form.js\";\nimport type { FieldAdapterMap, FormClassNames } from \"../../../types/adapters.js\";\nimport type { GroupMap, PathMap, SectionMap } from \"../../../types/form-customization.js\";\nimport type { FormHandle } from \"../../../types/form-handle.js\";\nimport { DefaultForm } from \"../../defaults/layout/form.js\";\nimport { SearchFormContent } from \"./content.js\";\nimport { SearchFormSubmitButton } from \"./submit-button.js\";\n\nexport type SearchFormSubmitHandler = (\n payload: SearchPayload,\n ctx: { form: FormHandle<SearchPayload> },\n) => void | Promise<void>;\n\ninterface RenderingProps {\n classNames?: FormClassNames;\n adapters?: FieldAdapterMap;\n className?: string;\n}\n\nexport interface SearchFormInstanceProps extends RenderingProps {\n context: SearchFormContextValue;\n onSubmit: SearchFormSubmitHandler;\n children?: ReactNode;\n}\n\nexport interface SearchFormZeroConfigProps extends RenderingProps {\n searchId: SearchId;\n publicKey: string;\n onSubmit: SearchFormSubmitHandler;\n defaultValues?: SearchPayload;\n resolvers?: FormResolvers;\n environment?: PipesEnvironment;\n /**\n * Hide / relabel / reorder sections by section key. `null` hides a section.\n * Forwarded to the internal `useSearchForm` call. For `<SearchForm context={...}>`,\n * pass these to `useSearchForm` directly instead.\n */\n sectionMap?: SectionMap;\n groupMap?: GroupMap;\n pathMap?: PathMap;\n children?: ReactNode;\n}\n\nexport type SearchFormProps = SearchFormInstanceProps | SearchFormZeroConfigProps;\n\n/**\n * Compound root for search forms.\n *\n * - Compound: `<SearchForm context={ctx} onSubmit={...}>...</SearchForm>` — pass the context from\n * `useSearchForm`. Visibility customization lives on the hook in this mode.\n * - Zero-config: `<SearchForm searchId=\"...\" publicKey=\"...\" onSubmit={...} />` — fresh hook\n * created internally; visibility maps may be passed as props and forward to that hook.\n */\nexport function SearchForm(props: SearchFormProps) {\n if (\"context\" in props) {\n return <SearchFormWithContext {...props} />;\n }\n return <SearchFormZeroConfig {...props} />;\n}\n\nfunction SearchFormZeroConfig({\n searchId,\n publicKey,\n defaultValues,\n onSubmit,\n resolvers,\n environment,\n sectionMap,\n groupMap,\n pathMap,\n children,\n classNames,\n adapters,\n className,\n}: SearchFormZeroConfigProps) {\n const context = useSearchForm({\n searchId,\n publicKey,\n defaultValues,\n resolvers,\n environment,\n sectionMap,\n groupMap,\n pathMap,\n });\n\n return (\n <SearchFormWithContext\n context={context}\n onSubmit={onSubmit}\n className={className}\n classNames={classNames}\n adapters={adapters}\n >\n {children}\n </SearchFormWithContext>\n );\n}\n\nfunction SearchFormWithContext({\n context,\n onSubmit,\n children,\n className,\n classNames,\n adapters,\n}: SearchFormInstanceProps) {\n const hasLocalOverrides = classNames || adapters;\n\n const inner = (\n <SearchFormContext.Provider value={context}>\n <SearchFormShell className={className} onSubmit={onSubmit}>\n {children}\n </SearchFormShell>\n </SearchFormContext.Provider>\n );\n\n if (hasLocalOverrides) {\n return (\n <FormRoot>\n <FormProvider classNames={classNames} adapters={adapters}>\n {inner}\n </FormProvider>\n </FormRoot>\n );\n }\n\n return <FormRoot>{inner}</FormRoot>;\n}\n\nfunction SearchFormShell({\n children,\n className,\n onSubmit,\n}: {\n children?: ReactNode;\n className?: string;\n onSubmit: SearchFormSubmitHandler;\n}) {\n const context = useSearchFormContext();\n\n const [portalContainer, setPortalContainer] = useState<HTMLElement | null>(null);\n const portalRef = useCallback((node: HTMLElement | null) => {\n setPortalContainer(node);\n }, []);\n\n const body = children ?? (\n <>\n <SearchFormContent />\n <SearchFormSubmitButton />\n </>\n );\n\n const handleFormSubmit = context.form.handleSubmit(async (values) => {\n await onSubmit(values, { form: context.form });\n });\n\n return (\n <DefaultForm\n onSubmit={handleFormSubmit}\n ref={portalRef}\n data-p0=\"form\"\n data-p0-search={context.id}\n className={className}\n >\n <PortalContainerContext.Provider value={portalContainer}>\n {body}\n </PortalContainerContext.Provider>\n </DefaultForm>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA2DA,SAAgB,WAAW,OAAwB;AACjD,KAAI,aAAa,MACf,QAAO,oBAAC,uBAAD,EAAuB,GAAI,OAAS;AAE7C,QAAO,oBAAC,sBAAD,EAAsB,GAAI,OAAS;;AAG5C,SAAS,qBAAqB,EAC5B,UACA,WACA,eACA,UACA,WACA,aACA,YACA,UACA,SACA,UACA,YACA,UACA,aAC4B;AAY5B,QACE,oBAAC,uBAAD;EACE,SAbY,cAAc;GAC5B;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD,CAAC;EAKY;EACC;EACC;EACF;EAET;EACqB;;AAI5B,SAAS,sBAAsB,EAC7B,SACA,UACA,UACA,WACA,YACA,YAC0B;CAC1B,MAAM,oBAAoB,cAAc;CAExC,MAAM,QACJ,oBAAC,kBAAkB,UAAnB;EAA4B,OAAO;YACjC,oBAAC,iBAAD;GAA4B;GAAqB;GAC9C;GACe;EACS;AAG/B,KAAI,kBACF,QACE,oBAAC,UAAD,YACE,oBAAC,cAAD;EAA0B;EAAsB;YAC7C;EACY,GACN;AAIf,QAAO,oBAAC,UAAD,YAAW,OAAiB;;AAGrC,SAAS,gBAAgB,EACvB,UACA,WACA,YAKC;CACD,MAAM,UAAU,sBAAsB;CAEtC,MAAM,CAAC,iBAAiB,sBAAsB,SAA6B,KAAK;CAChF,MAAM,YAAY,aAAa,SAA6B;AAC1D,qBAAmB,KAAK;IACvB,EAAE,CAAC;CAEN,MAAM,OAAO,YACX,8CACE,oBAAC,mBAAD,EAAqB,GACrB,oBAAC,wBAAD,EAA0B,EACzB;AAOL,QACE,oBAAC,aAAD;EACE,UANqB,QAAQ,KAAK,aAAa,OAAO,WAAW;AACnE,SAAM,SAAS,QAAQ,EAAE,MAAM,QAAQ,MAAM,CAAC;IAC9C;EAKE,KAAK;EACL,WAAQ;EACR,kBAAgB,QAAQ;EACb;YAEX,oBAAC,uBAAuB,UAAxB;GAAiC,OAAO;aACrC;GAC+B;EACtB"}
|
|
@@ -1,9 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as _$
|
|
1
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
2
|
+
import * as _$react from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/compound/search-form/submit-button.d.ts
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
interface SearchFormSubmitButtonState {
|
|
6
|
+
isSubmitting: boolean;
|
|
7
|
+
isFieldLoaderLoading: boolean;
|
|
8
|
+
disabled: boolean;
|
|
9
|
+
}
|
|
10
|
+
interface SearchFormSubmitButtonProps extends useRender.ComponentProps<"button", SearchFormSubmitButtonState> {}
|
|
11
|
+
declare function SearchFormSubmitButton({
|
|
12
|
+
className,
|
|
13
|
+
children,
|
|
14
|
+
render,
|
|
15
|
+
disabled: disabledProp,
|
|
16
|
+
...props
|
|
17
|
+
}: SearchFormSubmitButtonProps): _$react.ReactElement<unknown, string | _$react.JSXElementConstructor<any>>;
|
|
7
18
|
//#endregion
|
|
8
19
|
export { SearchFormSubmitButton };
|
|
9
20
|
//# sourceMappingURL=submit-button.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"submit-button.d.mts","names":[],"sources":["../../../../src/components/compound/search-form/submit-button.tsx"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"submit-button.d.mts","names":[],"sources":["../../../../src/components/compound/search-form/submit-button.tsx"],"mappings":";;;;UAMiB,2BAAA;EACf,YAAA;EACA,oBAAA;EACA,QAAA;AAAA;AAAA,UAGe,2BAAA,SACP,SAAA,CAAU,cAAA,WAAyB,2BAAA;AAAA,iBAE7B,sBAAA,CAAA;EACd,SAAA;EACA,QAAA;EACA,MAAA;EACA,QAAA,EAAU,YAAA;EAAA,GACP;AAAA,GACF,2BAAA,GAA2B,OAAA,CAAA,YAAA,mBAAA,OAAA,CAAA,qBAAA"}
|
|
@@ -1,14 +1,29 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { cn } from "../../../lib/utils.mjs";
|
|
2
|
+
import { buttonVariants } from "../../ui/button.mjs";
|
|
2
3
|
import { useSearchFormContext } from "../../../context/search-form-context.mjs";
|
|
3
|
-
import {
|
|
4
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
5
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
4
6
|
|
|
5
7
|
//#region src/components/compound/search-form/submit-button.tsx
|
|
6
|
-
function SearchFormSubmitButton(props) {
|
|
7
|
-
const { form,
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
function SearchFormSubmitButton({ className, children, render, disabled: disabledProp, ...props }) {
|
|
9
|
+
const { form, isFieldLoaderLoading } = useSearchFormContext();
|
|
10
|
+
const isSubmitting = form.formState.isSubmitting;
|
|
11
|
+
const disabled = disabledProp ?? (isSubmitting || isFieldLoaderLoading);
|
|
12
|
+
return useRender({
|
|
13
|
+
defaultTagName: "button",
|
|
14
|
+
render,
|
|
15
|
+
state: {
|
|
16
|
+
isSubmitting,
|
|
17
|
+
isFieldLoaderLoading,
|
|
18
|
+
disabled
|
|
19
|
+
},
|
|
20
|
+
props: mergeProps({
|
|
21
|
+
type: "submit",
|
|
22
|
+
disabled,
|
|
23
|
+
className: cn(buttonVariants({}), "pz:mt-4", className),
|
|
24
|
+
children: children ?? (isSubmitting ? "Submitting..." : "Submit"),
|
|
25
|
+
"data-p0": "submit"
|
|
26
|
+
}, props)
|
|
12
27
|
});
|
|
13
28
|
}
|
|
14
29
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"submit-button.mjs","names":[],"sources":["../../../../src/components/compound/search-form/submit-button.tsx"],"sourcesContent":["import { useSearchFormContext } from \"../../../context/search-form-context.js\";\nimport {\
|
|
1
|
+
{"version":3,"file":"submit-button.mjs","names":[],"sources":["../../../../src/components/compound/search-form/submit-button.tsx"],"sourcesContent":["import { mergeProps } from \"@base-ui/react/merge-props\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport { useSearchFormContext } from \"../../../context/search-form-context.js\";\nimport { cn } from \"../../../lib/utils.js\";\nimport { buttonVariants } from \"../../ui/button.js\";\n\nexport interface SearchFormSubmitButtonState {\n isSubmitting: boolean;\n isFieldLoaderLoading: boolean;\n disabled: boolean;\n}\n\nexport interface SearchFormSubmitButtonProps\n extends useRender.ComponentProps<\"button\", SearchFormSubmitButtonState> {}\n\nexport function SearchFormSubmitButton({\n className,\n children,\n render,\n disabled: disabledProp,\n ...props\n}: SearchFormSubmitButtonProps) {\n const { form, isFieldLoaderLoading } = useSearchFormContext();\n const isSubmitting = form.formState.isSubmitting;\n const disabled = disabledProp ?? (isSubmitting || isFieldLoaderLoading);\n\n return useRender({\n defaultTagName: \"button\",\n render,\n state: { isSubmitting, isFieldLoaderLoading, disabled },\n props: mergeProps<\"button\">(\n {\n type: \"submit\",\n disabled,\n className: cn(buttonVariants({}), \"pz:mt-4\", className),\n children: children ?? (isSubmitting ? \"Submitting...\" : \"Submit\"),\n ...({ \"data-p0\": \"submit\" } as Record<string, string>),\n },\n props,\n ),\n });\n}\n"],"mappings":";;;;;;;AAeA,SAAgB,uBAAuB,EACrC,WACA,UACA,QACA,UAAU,cACV,GAAG,SAC2B;CAC9B,MAAM,EAAE,MAAM,yBAAyB,sBAAsB;CAC7D,MAAM,eAAe,KAAK,UAAU;CACpC,MAAM,WAAW,iBAAiB,gBAAgB;AAElD,QAAO,UAAU;EACf,gBAAgB;EAChB;EACA,OAAO;GAAE;GAAc;GAAsB;GAAU;EACvD,OAAO,WACL;GACE,MAAM;GACN;GACA,WAAW,GAAG,eAAe,EAAE,CAAC,EAAE,WAAW,UAAU;GACvD,UAAU,aAAa,eAAe,kBAAkB;GAClD,WAAW;GAClB,EACD,MACD;EACF,CAAC"}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as _$
|
|
1
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
2
|
+
import * as _$react from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/compound/search-form/title.d.ts
|
|
5
|
+
interface SearchFormTitleProps extends useRender.ComponentProps<"h2"> {
|
|
6
|
+
label?: string;
|
|
7
|
+
}
|
|
5
8
|
declare function SearchFormTitle({
|
|
6
9
|
children,
|
|
7
10
|
label,
|
|
8
|
-
className
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
className?: string;
|
|
13
|
-
}): _$react_jsx_runtime0.JSX.Element;
|
|
11
|
+
className,
|
|
12
|
+
render,
|
|
13
|
+
...props
|
|
14
|
+
}: SearchFormTitleProps): _$react.ReactElement<unknown, string | _$react.JSXElementConstructor<any>>;
|
|
14
15
|
//#endregion
|
|
15
16
|
export { SearchFormTitle };
|
|
16
17
|
//# sourceMappingURL=title.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"title.d.mts","names":[],"sources":["../../../../src/components/compound/search-form/title.tsx"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"title.d.mts","names":[],"sources":["../../../../src/components/compound/search-form/title.tsx"],"mappings":";;;;UAGiB,oBAAA,SAA6B,SAAA,CAAU,cAAA;EACtD,KAAA;AAAA;AAAA,iBAGc,eAAA,CAAA;EACd,QAAA;EACA,KAAA;EACA,SAAA;EACA,MAAA;EAAA,GACG;AAAA,GACF,oBAAA,GAAoB,OAAA,CAAA,YAAA,mBAAA,OAAA,CAAA,qBAAA"}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
2
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
2
3
|
|
|
3
4
|
//#region src/components/compound/search-form/title.tsx
|
|
4
|
-
function SearchFormTitle({ children, label, className }) {
|
|
5
|
-
return
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
function SearchFormTitle({ children, label, className, render, ...props }) {
|
|
6
|
+
return useRender({
|
|
7
|
+
defaultTagName: "h2",
|
|
8
|
+
render,
|
|
9
|
+
props: mergeProps({
|
|
10
|
+
className,
|
|
11
|
+
children: children ?? label,
|
|
12
|
+
"data-p0": "form-title"
|
|
13
|
+
}, props)
|
|
9
14
|
});
|
|
10
15
|
}
|
|
11
16
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"title.mjs","names":[],"sources":["../../../../src/components/compound/search-form/title.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"title.mjs","names":[],"sources":["../../../../src/components/compound/search-form/title.tsx"],"sourcesContent":["import { mergeProps } from \"@base-ui/react/merge-props\";\nimport { useRender } from \"@base-ui/react/use-render\";\n\nexport interface SearchFormTitleProps extends useRender.ComponentProps<\"h2\"> {\n label?: string;\n}\n\nexport function SearchFormTitle({\n children,\n label,\n className,\n render,\n ...props\n}: SearchFormTitleProps) {\n return useRender({\n defaultTagName: \"h2\",\n render,\n props: mergeProps<\"h2\">(\n {\n className,\n children: children ?? label,\n ...({ \"data-p0\": \"form-title\" } as Record<string, string>),\n },\n props,\n ),\n });\n}\n"],"mappings":";;;;AAOA,SAAgB,gBAAgB,EAC9B,UACA,OACA,WACA,QACA,GAAG,SACoB;AACvB,QAAO,UAAU;EACf,gBAAgB;EAChB;EACA,OAAO,WACL;GACE;GACA,UAAU,YAAY;GAChB,WAAW;GAClB,EACD,MACD;EACF,CAAC"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
2
2
|
import * as _$react from "react";
|
|
3
|
-
import { ComponentProps } from "react";
|
|
4
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
5
3
|
|
|
6
4
|
//#region src/components/compound/searches-catalog/active-filters.d.ts
|
|
7
5
|
interface ActiveFilter {
|
|
@@ -11,16 +9,15 @@ interface ActiveFilter {
|
|
|
11
9
|
remove: () => void;
|
|
12
10
|
}
|
|
13
11
|
interface SearchesCatalogActiveFiltersState {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
interface SearchesCatalogActiveFiltersProps {
|
|
17
|
-
className?: string;
|
|
18
|
-
render?: RenderProp<ComponentProps<"div">, SearchesCatalogActiveFiltersState>;
|
|
12
|
+
activeFilters: ActiveFilter[];
|
|
13
|
+
isEmpty: boolean;
|
|
19
14
|
}
|
|
15
|
+
interface SearchesCatalogActiveFiltersProps extends useRender.ComponentProps<"div", SearchesCatalogActiveFiltersState> {}
|
|
20
16
|
declare function SearchesCatalogActiveFilters({
|
|
21
17
|
className,
|
|
22
|
-
render
|
|
23
|
-
|
|
18
|
+
render,
|
|
19
|
+
...props
|
|
20
|
+
}: SearchesCatalogActiveFiltersProps): _$react.ReactElement<unknown, string | _$react.JSXElementConstructor<any>> | null;
|
|
24
21
|
//#endregion
|
|
25
22
|
export { ActiveFilter, SearchesCatalogActiveFilters, SearchesCatalogActiveFiltersProps, SearchesCatalogActiveFiltersState };
|
|
26
23
|
//# sourceMappingURL=active-filters.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"active-filters.d.mts","names":[],"sources":["../../../../src/components/compound/searches-catalog/active-filters.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"active-filters.d.mts","names":[],"sources":["../../../../src/components/compound/searches-catalog/active-filters.tsx"],"mappings":";;;;UAaiB,YAAA;EACf,EAAA;EACA,KAAA;EACA,KAAA;EACA,MAAA;AAAA;AAAA,UAGe,iCAAA;EACf,aAAA,EAAe,YAAA;EACf,OAAA;AAAA;AAAA,UAGe,iCAAA,SACP,SAAA,CAAU,cAAA,QAAsB,iCAAA;AAAA,iBAE1B,4BAAA,CAAA;EACd,SAAA;EACA,MAAA;EAAA,GACG;AAAA,GACF,iCAAA,GAAiC,OAAA,CAAA,YAAA,mBAAA,OAAA,CAAA,qBAAA"}
|