@mastra/playground-ui 69.0.0 → 69.1.0-alpha.1
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/dist/{Comment-D_gSx7oM.js → Comment-CEHnV3TI.js} +2 -2
- package/dist/{Comment-D_gSx7oM.js.map → Comment-CEHnV3TI.js.map} +1 -1
- package/dist/{Comment-A07IvOt2.cjs → Comment-D9Rw3sVA.cjs} +2 -2
- package/dist/{Comment-A07IvOt2.cjs.map → Comment-D9Rw3sVA.cjs.map} +1 -1
- package/dist/{DataList-2PEZd6GU.cjs → DataList-D6UDH7qT.cjs} +2 -2
- package/dist/{DataList-2PEZd6GU.cjs.map → DataList-D6UDH7qT.cjs.map} +1 -1
- package/dist/{DataList-DCaKvoCH.js → DataList-DIGkHZWZ.js} +2 -2
- package/dist/{DataList-DCaKvoCH.js.map → DataList-DIGkHZWZ.js.map} +1 -1
- package/dist/{EmptyState-Dc-sP95H.cjs → EmptyState-DDZM8XgE.cjs} +146 -7
- package/dist/EmptyState-DDZM8XgE.cjs.map +1 -0
- package/dist/{EmptyState-i88y1x75.js → EmptyState-sRS41Bzj.js} +146 -7
- package/dist/EmptyState-sRS41Bzj.js.map +1 -0
- package/dist/{FilterBar-PhVKghDp.js → FilterBar-C1L0opT3.js} +10 -6
- package/dist/FilterBar-C1L0opT3.js.map +1 -0
- package/dist/{FilterBar-DY6aXUnv.cjs → FilterBar-CCh4ZYuL.cjs} +10 -6
- package/dist/FilterBar-CCh4ZYuL.cjs.map +1 -0
- package/dist/{LogsDataList-Ca016D5o.js → LogsDataList-DUKQJ9e5.js} +2 -2
- package/dist/{LogsDataList-Ca016D5o.js.map → LogsDataList-DUKQJ9e5.js.map} +1 -1
- package/dist/{LogsDataList-DVXS1HN4.cjs → LogsDataList-Sgcx1aKA.cjs} +2 -2
- package/dist/{LogsDataList-DVXS1HN4.cjs.map → LogsDataList-Sgcx1aKA.cjs.map} +1 -1
- package/dist/Sidebar.css +60 -0
- package/dist/components/Comment.cjs.js +1 -1
- package/dist/components/Comment.es.js +1 -1
- package/dist/components/CopyInput.cjs.js +1 -1
- package/dist/components/CopyInput.es.js +1 -1
- package/dist/components/DataList.cjs.js +3 -3
- package/dist/components/DataList.es.js +3 -3
- package/dist/components/EmptyState.cjs.js +1 -1
- package/dist/components/EmptyState.es.js +1 -1
- package/dist/components/EnvironmentVariablesEditor.cjs.js +2 -2
- package/dist/components/EnvironmentVariablesEditor.es.js +2 -2
- package/dist/components/FileDropBackdrop.cjs.js +1 -1
- package/dist/components/FileDropBackdrop.es.js +1 -1
- package/dist/components/FilterBar.cjs.js +3 -3
- package/dist/components/FilterBar.es.js +3 -3
- package/dist/components/FormFieldBlocks.cjs.js +0 -88
- package/dist/components/FormFieldBlocks.cjs.js.map +1 -1
- package/dist/components/FormFieldBlocks.es.js +1 -88
- package/dist/components/FormFieldBlocks.es.js.map +1 -1
- package/dist/components/InputGroup.cjs.js +1 -1
- package/dist/components/InputGroup.es.js +1 -1
- package/dist/components/InputNumber.cjs.js +1 -1
- package/dist/components/InputNumber.es.js +1 -1
- package/dist/components/LogsDataList.cjs.js +2 -2
- package/dist/components/LogsDataList.es.js +2 -2
- package/dist/components/SavedViews.cjs.js +1 -1
- package/dist/components/SavedViews.es.js +1 -1
- package/dist/components/SearchInput.cjs.js +93 -37
- package/dist/components/SearchInput.cjs.js.map +1 -1
- package/dist/components/SearchInput.es.js +94 -39
- package/dist/components/SearchInput.es.js.map +1 -1
- package/dist/components/Sidebar.cjs.js +121 -76
- package/dist/components/Sidebar.cjs.js.map +1 -1
- package/dist/components/Sidebar.es.js +121 -77
- package/dist/components/Sidebar.es.js.map +1 -1
- package/dist/{data-list-DM8WpKCm.js → data-list-C04BQEv9.js} +2 -2
- package/dist/data-list-C04BQEv9.js.map +1 -0
- package/dist/{data-list-1JOwQrF5.cjs → data-list-Czhl2UBM.cjs} +2 -2
- package/dist/data-list-Czhl2UBM.cjs.map +1 -0
- package/dist/domains/auth/components/permission-denied.cjs.js +1 -1
- package/dist/domains/auth/components/permission-denied.es.js +1 -1
- package/dist/domains/auth/components/session-expired.cjs.js +1 -1
- package/dist/domains/auth/components/session-expired.es.js +1 -1
- package/dist/domains/chat/tools/connect-prompt-tool.cjs.js +1 -1
- package/dist/domains/chat/tools/connect-prompt-tool.es.js +1 -1
- package/dist/domains/dashboards/kinds/kpis/options.cjs.js +9 -6
- package/dist/domains/dashboards/kinds/kpis/options.cjs.js.map +1 -1
- package/dist/domains/dashboards/kinds/kpis/options.es.js +8 -7
- package/dist/domains/dashboards/kinds/kpis/options.es.js.map +1 -1
- package/dist/domains/dashboards/kinds/kpis.cjs.js +2 -0
- package/dist/domains/dashboards/kinds/kpis.cjs.js.map +1 -1
- package/dist/domains/dashboards/kinds/kpis.es.js +2 -2
- package/dist/domains/dashboards/kinds/kpis.es.js.map +1 -1
- package/dist/domains/dashboards/kinds/timeseries.cjs.js +2 -0
- package/dist/domains/dashboards/kinds/timeseries.cjs.js.map +1 -1
- package/dist/domains/dashboards/kinds/timeseries.es.js +2 -2
- package/dist/domains/dashboards/kinds/timeseries.es.js.map +1 -1
- package/dist/domains/dashboards/kinds.cjs.js +12 -0
- package/dist/domains/dashboards/kinds.cjs.js.map +1 -1
- package/dist/domains/dashboards/kinds.es.js +5 -1
- package/dist/domains/dashboards/kinds.es.js.map +1 -1
- package/dist/domains/dashboards.cjs.js +23 -2
- package/dist/domains/dashboards.es.js +8 -3
- package/dist/domains/knowledge/components/KnowledgePageExplorer.cjs.js +1 -1
- package/dist/domains/knowledge/components/KnowledgePageExplorer.es.js +1 -1
- package/dist/domains/logs/components/logs-error-content.cjs.js +1 -1
- package/dist/domains/logs/components/logs-error-content.es.js +1 -1
- package/dist/domains/logs/components/logs-list-view.cjs.js +2 -2
- package/dist/domains/logs/components/logs-list-view.es.js +2 -2
- package/dist/domains/logs/components/no-logs-info.cjs.js +1 -1
- package/dist/domains/logs/components/no-logs-info.es.js +1 -1
- package/dist/domains/mcps/components/mcp-app-viewer.cjs.js +1 -1
- package/dist/domains/mcps/components/mcp-app-viewer.es.js +1 -1
- package/dist/domains/mcps/hooks/use-mcp-app-tool-call.cjs.js +1 -1
- package/dist/domains/mcps/hooks/use-mcp-app-tool-call.es.js +1 -1
- package/dist/domains/memory/components/observation-detail-view.cjs.js +1 -1
- package/dist/domains/memory/components/observation-detail-view.es.js +1 -1
- package/dist/domains/metrics/components/metrics-time-range-chip.cjs.js +1 -1
- package/dist/domains/metrics/components/metrics-time-range-chip.es.js +1 -1
- package/dist/domains/observability/components/observability-capability-gate.cjs.js +1 -1
- package/dist/domains/observability/components/observability-capability-gate.es.js +1 -1
- package/dist/domains/observability/hooks/use-observability-list-filters.cjs.js +15 -2
- package/dist/domains/observability/hooks/use-observability-list-filters.cjs.js.map +1 -1
- package/dist/domains/observability/hooks/use-observability-list-filters.es.js +15 -2
- package/dist/domains/observability/hooks/use-observability-list-filters.es.js.map +1 -1
- package/dist/domains/observability/lib/text-search-filter.cjs.js +24 -0
- package/dist/domains/observability/lib/text-search-filter.cjs.js.map +1 -0
- package/dist/domains/observability/lib/text-search-filter.d.ts +1 -0
- package/dist/domains/observability/lib/text-search-filter.es.js +23 -0
- package/dist/domains/observability/lib/text-search-filter.es.js.map +1 -0
- package/dist/domains/observability/lib/text-search.cjs.js +12 -0
- package/dist/domains/observability/lib/text-search.cjs.js.map +1 -0
- package/dist/domains/observability/lib/text-search.d.ts +1 -0
- package/dist/domains/observability/lib/text-search.es.js +11 -0
- package/dist/domains/observability/lib/text-search.es.js.map +1 -0
- package/dist/domains/observability/saved-view-state.cjs.js +16 -2
- package/dist/domains/observability/saved-view-state.cjs.js.map +1 -1
- package/dist/domains/observability/saved-view-state.es.js +16 -2
- package/dist/domains/observability/saved-view-state.es.js.map +1 -1
- package/dist/domains/scores/components/trace-scores-list.cjs.js +1 -1
- package/dist/domains/scores/components/trace-scores-list.es.js +1 -1
- package/dist/domains/scores/components/trace-scores-tab.cjs.js +2 -2
- package/dist/domains/scores/components/trace-scores-tab.es.js +2 -2
- package/dist/domains/spans/components/spans-explorer-body.cjs.js +15 -4
- package/dist/domains/spans/components/spans-explorer-body.cjs.js.map +1 -1
- package/dist/domains/spans/components/spans-explorer-body.es.js +15 -4
- package/dist/domains/spans/components/spans-explorer-body.es.js.map +1 -1
- package/dist/domains/spans/components/spans-explorer-histogram.cjs.js +2 -2
- package/dist/domains/spans/components/spans-explorer-histogram.cjs.js.map +1 -1
- package/dist/domains/spans/components/spans-explorer-histogram.es.js +2 -2
- package/dist/domains/spans/components/spans-explorer-histogram.es.js.map +1 -1
- package/dist/domains/spans/components/spans-filter-bar.cjs.js +10 -5
- package/dist/domains/spans/components/spans-filter-bar.cjs.js.map +1 -1
- package/dist/domains/spans/components/spans-filter-bar.es.js +10 -5
- package/dist/domains/spans/components/spans-filter-bar.es.js.map +1 -1
- package/dist/domains/spans/hooks/use-spans-filter-bar.cjs.js +37 -17
- package/dist/domains/spans/hooks/use-spans-filter-bar.cjs.js.map +1 -1
- package/dist/domains/spans/hooks/use-spans-filter-bar.es.js +37 -17
- package/dist/domains/spans/hooks/use-spans-filter-bar.es.js.map +1 -1
- package/dist/domains/threads/components/threads-filter-bar.cjs.js +2 -2
- package/dist/domains/threads/components/threads-filter-bar.es.js +2 -2
- package/dist/domains/threads/hooks/use-threads-filter-bar.cjs.js +1 -1
- package/dist/domains/threads/hooks/use-threads-filter-bar.es.js +1 -1
- package/dist/domains/traces/components/feedback-thread.cjs.js +2 -2
- package/dist/domains/traces/components/feedback-thread.es.js +2 -2
- package/dist/domains/traces/components/no-traces-info.cjs.js +1 -1
- package/dist/domains/traces/components/no-traces-info.es.js +1 -1
- package/dist/domains/traces/components/trace-error-cell.cjs.js +1 -1
- package/dist/domains/traces/components/trace-error-cell.es.js +1 -1
- package/dist/domains/traces/components/traces-error-content.cjs.js +1 -1
- package/dist/domains/traces/components/traces-error-content.es.js +1 -1
- package/dist/domains/traces/components/traces-explorer/traces-explorer-actions.cjs.js +1 -0
- package/dist/domains/traces/components/traces-explorer/traces-explorer-actions.cjs.js.map +1 -1
- package/dist/domains/traces/components/traces-explorer/traces-explorer-actions.es.js +1 -0
- package/dist/domains/traces/components/traces-explorer/traces-explorer-actions.es.js.map +1 -1
- package/dist/domains/traces/components/traces-explorer/traces-explorer-context.cjs.js.map +1 -1
- package/dist/domains/traces/components/traces-explorer/traces-explorer-context.es.js.map +1 -1
- package/dist/domains/traces/components/traces-explorer/traces-explorer-filter-bar.cjs.js +2 -2
- package/dist/domains/traces/components/traces-explorer/traces-explorer-filter-bar.es.js +2 -2
- package/dist/domains/traces/components/traces-explorer/traces-explorer-histogram.cjs.js +2 -2
- package/dist/domains/traces/components/traces-explorer/traces-explorer-histogram.cjs.js.map +1 -1
- package/dist/domains/traces/components/traces-explorer/traces-explorer-histogram.es.js +2 -2
- package/dist/domains/traces/components/traces-explorer/traces-explorer-histogram.es.js.map +1 -1
- package/dist/domains/traces/components/traces-explorer/traces-explorer-list-provider.cjs.js +4 -3
- package/dist/domains/traces/components/traces-explorer/traces-explorer-list-provider.cjs.js.map +1 -1
- package/dist/domains/traces/components/traces-explorer/traces-explorer-list-provider.es.js +4 -3
- package/dist/domains/traces/components/traces-explorer/traces-explorer-list-provider.es.js.map +1 -1
- package/dist/domains/traces/components/traces-explorer/traces-explorer-root.cjs.js +31 -8
- package/dist/domains/traces/components/traces-explorer/traces-explorer-root.cjs.js.map +1 -1
- package/dist/domains/traces/components/traces-explorer/traces-explorer-root.es.js +31 -8
- package/dist/domains/traces/components/traces-explorer/traces-explorer-root.es.js.map +1 -1
- package/dist/domains/traces/components/traces-explorer/use-traces-filter-bar.cjs.js +28 -19
- package/dist/domains/traces/components/traces-explorer/use-traces-filter-bar.cjs.js.map +1 -1
- package/dist/domains/traces/components/traces-explorer/use-traces-filter-bar.es.js +28 -19
- package/dist/domains/traces/components/traces-explorer/use-traces-filter-bar.es.js.map +1 -1
- package/dist/domains/traces/components/traces-list-view.cjs.js +2 -2
- package/dist/domains/traces/components/traces-list-view.es.js +2 -2
- package/dist/domains/traces/components/traces-page-skeleton.cjs.js +1 -1
- package/dist/domains/traces/components/traces-page-skeleton.es.js +1 -1
- package/dist/domains/traces/hooks/use-traces-list-source.cjs.js +2 -2
- package/dist/domains/traces/hooks/use-traces-list-source.cjs.js.map +1 -1
- package/dist/domains/traces/hooks/use-traces-list-source.es.js +2 -2
- package/dist/domains/traces/hooks/use-traces-list-source.es.js.map +1 -1
- package/dist/domains/workflows/components/workflows-list/no-workflows-info.cjs.js +1 -1
- package/dist/domains/workflows/components/workflows-list/no-workflows-info.es.js +1 -1
- package/dist/domains/workflows/components/workflows-list/workflows-list.cjs.js +2 -2
- package/dist/domains/workflows/components/workflows-list/workflows-list.es.js +2 -2
- package/dist/domains/workspace/components/workspace-parts.cjs.js +1 -1
- package/dist/domains/workspace/components/workspace-parts.es.js +1 -1
- package/dist/domains/workspace/components/workspace-search.cjs.js +1 -1
- package/dist/domains/workspace/components/workspace-search.es.js +1 -1
- package/dist/ee/signals/components/entity-index-list.cjs.js +1 -1
- package/dist/ee/signals/components/entity-index-list.es.js +1 -1
- package/dist/ee/signals/components/trace-intelligence-entity-detail.cjs.js +1 -1
- package/dist/ee/signals/components/trace-intelligence-entity-detail.es.js +1 -1
- package/dist/ee/signals/components/trace-intelligence-entity-index.cjs.js +8 -7
- package/dist/ee/signals/components/trace-intelligence-entity-index.cjs.js.map +1 -1
- package/dist/ee/signals/components/trace-intelligence-entity-index.es.js +8 -7
- package/dist/ee/signals/components/trace-intelligence-entity-index.es.js.map +1 -1
- package/dist/ee/topics/components/topic-trace-summary-list.cjs.js +1 -1
- package/dist/ee/topics/components/topic-trace-summary-list.es.js +1 -1
- package/dist/{filter-bar-chip-jOPeM21t.js → filter-bar-chip-DBkPWlc-.js} +54 -32
- package/dist/filter-bar-chip-DBkPWlc-.js.map +1 -0
- package/dist/{filter-bar-chip-Bhn7lo4e.cjs → filter-bar-chip-DgdVLscK.cjs} +52 -30
- package/dist/filter-bar-chip-DgdVLscK.cjs.map +1 -0
- package/dist/{filter-bar-time-range-C099qEMm.cjs → filter-bar-time-range-BUmb3A1m.cjs} +2 -2
- package/dist/{filter-bar-time-range-C099qEMm.cjs.map → filter-bar-time-range-BUmb3A1m.cjs.map} +1 -1
- package/dist/{filter-bar-time-range-B1XhplO7.js → filter-bar-time-range-CtK8Dlp-.js} +2 -2
- package/dist/{filter-bar-time-range-B1XhplO7.js.map → filter-bar-time-range-CtK8Dlp-.js.map} +1 -1
- package/dist/icons/AgentIcon.cjs.js +3 -3
- package/dist/icons/AgentIcon.cjs.js.map +1 -1
- package/dist/icons/AgentIcon.es.js +3 -3
- package/dist/icons/AgentIcon.es.js.map +1 -1
- package/dist/icons/McpServerIcon.cjs.js +3 -3
- package/dist/icons/McpServerIcon.cjs.js.map +1 -1
- package/dist/icons/McpServerIcon.es.js +3 -3
- package/dist/icons/McpServerIcon.es.js.map +1 -1
- package/dist/icons/WorkflowIcon.cjs.js +2 -2
- package/dist/icons/WorkflowIcon.cjs.js.map +1 -1
- package/dist/icons/WorkflowIcon.es.js +2 -2
- package/dist/icons/WorkflowIcon.es.js.map +1 -1
- package/dist/{input-group-CCSyY4J5.js → input-group-1OAXTPnG.js} +7 -5
- package/dist/input-group-1OAXTPnG.js.map +1 -0
- package/dist/{input-group-Da8HBo30.cjs → input-group-BrBYp1gP.cjs} +6 -4
- package/dist/input-group-BrBYp1gP.cjs.map +1 -0
- package/dist/layout/tabbed-container.cjs.js +1 -1
- package/dist/layout/tabbed-container.es.js +1 -1
- package/dist/src/domains/dashboards/index.d.ts +2 -0
- package/dist/src/domains/dashboards/kinds/index.d.ts +8 -4
- package/dist/src/domains/dashboards/kinds/kpis/index.d.ts +3 -3
- package/dist/src/domains/dashboards/kinds/kpis/options.d.ts +22 -0
- package/dist/src/domains/dashboards/kinds/timeseries/index.d.ts +6 -4
- package/dist/src/domains/observability/hooks/use-observability-list-filters.d.ts +5 -1
- package/dist/src/domains/observability/lib/text-search-filter.d.ts +3 -0
- package/dist/src/domains/observability/lib/text-search.d.ts +2 -0
- package/dist/src/domains/spans/components/spans-explorer-histogram.d.ts +3 -1
- package/dist/src/domains/spans/components/spans-filter-bar.d.ts +4 -1
- package/dist/src/domains/spans/hooks/use-spans-filter-bar.d.ts +5 -2
- package/dist/src/domains/traces/components/traces-explorer/traces-explorer-actions.d.ts +1 -0
- package/dist/src/domains/traces/components/traces-explorer/traces-explorer-context.d.ts +4 -0
- package/dist/src/ds/components/EmptyState/empty-state-illustration.d.ts +1 -1
- package/dist/src/ds/components/EmptyState/illustrations/no-alerts-art.d.ts +1 -0
- package/dist/src/ds/components/EmptyState/illustrations/no-destinations-art.d.ts +3 -0
- package/dist/src/ds/components/FilterBar/types.d.ts +6 -0
- package/dist/src/ds/components/FilterBar/use-value-step.d.ts +1 -0
- package/dist/src/ds/components/FormFieldBlocks/index.d.ts +0 -1
- package/dist/src/ds/components/InputGroup/input-group.d.ts +1 -1
- package/dist/src/ds/components/SearchInput/index.d.ts +1 -0
- package/dist/src/ds/components/SearchInput/list-search-props.d.ts +6 -0
- package/dist/src/ds/components/SearchInput/search-input.d.ts +26 -3
- package/dist/src/ds/components/Sidebar/footer/sidebar-meter.d.ts +8 -0
- package/dist/src/ds/components/Sidebar/index.d.ts +1 -0
- package/dist/src/ds/components/Sidebar/root/sidebar-provider.d.ts +4 -4
- package/dist/src/ds/components/Sidebar/root/sidebar-widths.d.ts +7 -0
- package/dist/src/ds/layout/tabbed-container/tabbed-container-root.d.ts +5 -2
- package/dist/style.css +111 -41
- package/dist/{tabbed-container-yJX9GClR.js → tabbed-container-CZYkYekf.js} +11 -6
- package/dist/tabbed-container-CZYkYekf.js.map +1 -0
- package/dist/{tabbed-container--5P96PDX.cjs → tabbed-container-DHfamugk.cjs} +11 -6
- package/dist/tabbed-container-DHfamugk.cjs.map +1 -0
- package/dist/{types-BwdKiX24.js → types-CCm0-NSE.js} +2 -2
- package/dist/{types-BwdKiX24.js.map → types-CCm0-NSE.js.map} +1 -1
- package/dist/types-CP7wbYua.cjs.map +1 -1
- package/dist/{types-KjLUPShK.cjs → types-CqdYjhgk.cjs} +2 -2
- package/dist/{types-KjLUPShK.cjs.map → types-CqdYjhgk.cjs.map} +1 -1
- package/dist/types-DiiL5mTO.js.map +1 -1
- package/oxlint/index.js +1 -1
- package/package.json +7 -7
- package/dist/EmptyState-Dc-sP95H.cjs.map +0 -1
- package/dist/EmptyState-i88y1x75.js.map +0 -1
- package/dist/FilterBar-DY6aXUnv.cjs.map +0 -1
- package/dist/FilterBar-PhVKghDp.js.map +0 -1
- package/dist/components/ListSearch.cjs.js +0 -3
- package/dist/components/ListSearch.d.ts +0 -1
- package/dist/components/ListSearch.es.js +0 -1
- package/dist/data-list-1JOwQrF5.cjs.map +0 -1
- package/dist/data-list-DM8WpKCm.js.map +0 -1
- package/dist/filter-bar-chip-Bhn7lo4e.cjs.map +0 -1
- package/dist/filter-bar-chip-jOPeM21t.js.map +0 -1
- package/dist/input-group-CCSyY4J5.js.map +0 -1
- package/dist/input-group-Da8HBo30.cjs.map +0 -1
- package/dist/list-search-DUcIMJTk.js +0 -45
- package/dist/list-search-DUcIMJTk.js.map +0 -1
- package/dist/list-search-yF02rvZt.cjs +0 -50
- package/dist/list-search-yF02rvZt.cjs.map +0 -1
- package/dist/src/ds/components/FormFieldBlocks/fields/search-field-block.d.ts +0 -26
- package/dist/src/ds/components/ListSearch/index.d.ts +0 -1
- package/dist/src/ds/components/ListSearch/list-search.d.ts +0 -21
- package/dist/tabbed-container--5P96PDX.cjs.map +0 -1
- package/dist/tabbed-container-yJX9GClR.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormFieldBlocks.cjs.js","names":["cn","cn","fieldErrorId","FieldBlock","VisuallyHidden","Input","fieldErrorId","FieldBlock","VisuallyHidden","Textarea","useRef","Tooltip","TooltipTrigger","Button","SearchIcon","TooltipContent","FieldBlock","Input","fieldErrorId","cn","XIcon","FieldBlock","VisuallyHidden","Select","SelectTrigger","fieldErrorId","SelectValue","SelectContent","SelectItem"],"sources":["../../src/ds/components/FormFieldBlocks/layout/field-blocks-layout-column.tsx","../../src/ds/components/FormFieldBlocks/layout/field-blocks-layout-root.tsx","../../src/ds/components/FormFieldBlocks/layout/field-blocks-layout.tsx","../../src/ds/components/FormFieldBlocks/fields/text-field-block.tsx","../../src/ds/components/FormFieldBlocks/fields/textarea-field-block.tsx","../../src/ds/components/FormFieldBlocks/fields/search-field-block.tsx","../../src/ds/components/FormFieldBlocks/fields/select-field-block.tsx"],"sourcesContent":["import { cn } from '@/lib/utils';\n\nexport type FieldBlocksLayoutColumnProps = {\n children: React.ReactNode;\n className?: string;\n};\n\nexport function FieldBlocksLayoutColumn({ children, className }: FieldBlocksLayoutColumnProps) {\n return <div className={cn('grid content-start gap-6', className)}>{children}</div>;\n}\n","import { cn } from '@/lib/utils';\n\nexport type FieldBlocksLayoutRootProps = {\n children: React.ReactNode;\n className?: string;\n columns?: 1 | 2;\n gap?: string;\n};\n\nexport function FieldBlocksLayoutRoot({ children, className, columns = 1, gap }: FieldBlocksLayoutRootProps) {\n return (\n <div\n className={cn(\n 'grid',\n {\n 'grid-cols-1': columns === 1,\n 'grid-cols-2': columns === 2,\n },\n gap ?? 'gap-6',\n className,\n )}\n >\n {children}\n </div>\n );\n}\n","import { FieldBlocksLayoutColumn } from './field-blocks-layout-column';\nimport { FieldBlocksLayoutRoot } from './field-blocks-layout-root';\n\n/** @deprecated Lay fields out with plain grid or flex classes; `FieldGroup` stacks related fields. */\nexport const FieldBlocksLayout = Object.assign(FieldBlocksLayoutRoot, {\n Column: FieldBlocksLayoutColumn,\n});\n","import { Input } from '../../Input';\nimport type { InputProps } from '../../Input';\nimport { FieldBlock } from '../block/field-block';\nimport type { FieldBlockErrorMsgProps } from '../block/field-block-error-msg';\nimport type { FieldBlockHelpTextProps } from '../block/field-block-help-text';\nimport type { FieldBlockLabelProps } from '../block/field-block-label';\nimport type { FieldBlockLayoutProps } from '../block/field-block-layout';\nimport { fieldErrorId } from '../block/field-error-id';\nimport { VisuallyHidden } from '@/ds/primitives/visually-hidden';\n\nexport type TextFieldBlockProps = Pick<FieldBlockLayoutProps, 'layout' | 'labelColumnWidth'> &\n Omit<InputProps, 'name' | 'size'> & {\n name: string;\n labelIsHidden?: boolean;\n label?: FieldBlockLabelProps['children'];\n labelSize?: FieldBlockLabelProps['size'];\n helpText?: FieldBlockHelpTextProps['children'];\n errorMsg?: FieldBlockErrorMsgProps['children'];\n size?: InputProps['size'];\n };\n\n/** @deprecated Use `Field` + `FieldLabel` + `Input`. */\nexport function TextFieldBlock({\n name,\n value,\n label,\n labelIsHidden = false,\n labelColumnWidth,\n helpText,\n error,\n errorMsg,\n required = false,\n disabled = false,\n labelSize,\n layout = 'vertical',\n placeholder,\n size = 'md',\n testId,\n className,\n 'aria-describedby': ariaDescribedBy,\n ...props\n}: TextFieldBlockProps) {\n const describedBy =\n [ariaDescribedBy, errorMsg ? fieldErrorId(name) : undefined].filter(Boolean).join(' ') || undefined;\n\n return (\n <FieldBlock.Layout layout={layout} labelColumnWidth={labelColumnWidth} className={className}>\n {layout === 'horizontal' ? (\n <FieldBlock.Column>\n <FieldBlock.Label name={name} required={required} disabled={disabled} size={labelSize || 'bigger'}>\n {labelIsHidden ? <VisuallyHidden>{label}</VisuallyHidden> : label}\n </FieldBlock.Label>\n </FieldBlock.Column>\n ) : null}\n <FieldBlock.Column>\n {!labelIsHidden && layout === 'vertical' ? (\n <FieldBlock.Label name={name} required={required} disabled={disabled} size={labelSize || 'default'}>\n {label}\n </FieldBlock.Label>\n ) : null}\n <FieldBlock.Column className=\"gap-1\">\n <Input\n id={`input-${name}`}\n name={name}\n disabled={disabled}\n required={required}\n value={value}\n placeholder={placeholder}\n data-testid={testId}\n size={size}\n error={error || Boolean(errorMsg)}\n aria-describedby={describedBy}\n {...props}\n />\n {helpText || errorMsg ? <FieldBlock.Message name={name} helpText={helpText} errorMsg={errorMsg} /> : null}\n </FieldBlock.Column>\n </FieldBlock.Column>\n </FieldBlock.Layout>\n );\n}\n","import { Textarea } from '../../Textarea';\nimport type { TextareaProps } from '../../Textarea';\nimport { FieldBlock } from '../block/field-block';\nimport type { FieldBlockErrorMsgProps } from '../block/field-block-error-msg';\nimport type { FieldBlockHelpTextProps } from '../block/field-block-help-text';\nimport type { FieldBlockLabelProps } from '../block/field-block-label';\nimport type { FieldBlockLayoutProps } from '../block/field-block-layout';\nimport { fieldErrorId } from '../block/field-error-id';\nimport { VisuallyHidden } from '@/ds/primitives/visually-hidden';\n\nexport type TextareaFieldBlockProps = Pick<FieldBlockLayoutProps, 'layout' | 'labelColumnWidth'> &\n Omit<TextareaProps, 'name' | 'size'> & {\n name: string;\n labelIsHidden?: boolean;\n label?: FieldBlockLabelProps['children'];\n labelSize?: FieldBlockLabelProps['size'];\n helpText?: FieldBlockHelpTextProps['children'];\n errorMsg?: FieldBlockErrorMsgProps['children'];\n size?: TextareaProps['size'];\n };\n\n/** @deprecated Use `Field` + `FieldLabel` + `Textarea`. */\nexport function TextareaFieldBlock({\n name,\n label,\n labelIsHidden = false,\n labelColumnWidth,\n helpText,\n error,\n errorMsg,\n required = false,\n disabled = false,\n labelSize,\n layout = 'vertical',\n size = 'md',\n testId,\n className,\n 'aria-describedby': ariaDescribedBy,\n ...props\n}: TextareaFieldBlockProps) {\n const describedBy =\n [ariaDescribedBy, errorMsg ? fieldErrorId(name) : undefined].filter(Boolean).join(' ') || undefined;\n\n return (\n <FieldBlock.Layout layout={layout} labelColumnWidth={labelColumnWidth} className={className}>\n {layout === 'horizontal' ? (\n <FieldBlock.Column>\n <FieldBlock.Label name={name} required={required} disabled={disabled} size={labelSize || 'bigger'}>\n {labelIsHidden ? <VisuallyHidden>{label}</VisuallyHidden> : label}\n </FieldBlock.Label>\n </FieldBlock.Column>\n ) : null}\n <FieldBlock.Column>\n {!labelIsHidden && layout === 'vertical' ? (\n <FieldBlock.Label name={name} required={required} disabled={disabled} size={labelSize || 'default'}>\n {label}\n </FieldBlock.Label>\n ) : null}\n <FieldBlock.Column className=\"gap-1\">\n <Textarea\n id={`input-${name}`}\n name={name}\n disabled={disabled}\n required={required}\n size={size}\n data-testid={testId}\n error={error || Boolean(errorMsg)}\n aria-describedby={describedBy}\n {...props}\n />\n {helpText || errorMsg ? <FieldBlock.Message name={name} helpText={helpText} errorMsg={errorMsg} /> : null}\n </FieldBlock.Column>\n </FieldBlock.Column>\n </FieldBlock.Layout>\n );\n}\n","import { SearchIcon, XIcon } from 'lucide-react';\nimport { useEffect, useRef } from 'react';\nimport type { RefObject } from 'react';\nimport { Button } from '../../Button';\nimport { Input } from '../../Input';\nimport type { InputProps } from '../../Input';\nimport { Tooltip, TooltipContent, TooltipTrigger } from '../../Tooltip';\nimport { FieldBlock } from '../block/field-block';\nimport { fieldErrorId } from '../block/field-error-id';\nimport { cn } from '@/lib/utils';\n\nexport type SearchFieldBlockProps = {\n name: string;\n testId?: string;\n label?: string;\n labelIsHidden?: boolean;\n required?: boolean;\n disabled?: boolean;\n value?: string;\n placeholder?: string;\n onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;\n onReset?: () => void;\n helpText?: string;\n error?: boolean;\n errorMsg?: string;\n layout?: 'horizontal' | 'vertical';\n className?: string;\n size?: InputProps['size'];\n isMinimized?: boolean;\n onMinimizedChange?: (minimized: boolean) => void;\n /** Gives the caller access to the underlying input, e.g. to focus it from a keyboard shortcut. */\n inputRef?: RefObject<HTMLInputElement | null>;\n};\n\n/** @deprecated Use `SearchInput`. */\nexport function SearchFieldBlock({\n name,\n helpText,\n error,\n errorMsg,\n required = false,\n disabled = false,\n value,\n label,\n labelIsHidden = false,\n layout = 'vertical',\n placeholder = 'Search',\n onChange,\n onReset,\n className,\n size,\n isMinimized,\n onMinimizedChange,\n inputRef: externalInputRef,\n}: SearchFieldBlockProps) {\n const inputRef = useRef<HTMLInputElement>(null);\n\n const setInputRef = (element: HTMLInputElement | null) => {\n inputRef.current = element;\n if (externalInputRef) externalInputRef.current = element;\n };\n useEffect(() => {\n if (isMinimized === false) {\n inputRef.current?.focus();\n }\n }, [isMinimized]);\n\n if (isMinimized) {\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n size={`icon-${size || 'sm'}`}\n aria-label={label || 'Search'}\n disabled={disabled}\n onClick={() => onMinimizedChange?.(false)}\n >\n <SearchIcon />\n </Button>\n </TooltipTrigger>\n <TooltipContent>{label || 'Search'}</TooltipContent>\n </Tooltip>\n );\n }\n\n return (\n <FieldBlock.Layout layout={layout} className={className}>\n {layout === 'horizontal' ? (\n <FieldBlock.Column className={labelIsHidden ? 'sr-only' : undefined}>\n <FieldBlock.Label name={name} required={required} disabled={disabled}>\n {label}\n </FieldBlock.Label>\n </FieldBlock.Column>\n ) : null}\n <FieldBlock.Column className={layout === 'horizontal' && labelIsHidden ? 'col-span-full' : undefined}>\n {layout === 'vertical' && label ? (\n <FieldBlock.Label\n name={name}\n required={required}\n disabled={disabled}\n className={labelIsHidden ? 'sr-only' : undefined}\n >\n {label}\n </FieldBlock.Label>\n ) : null}\n <FieldBlock.Column className=\"gap-1\">\n <div className=\"group relative\">\n <Input\n ref={setInputRef}\n id={`input-${name}`}\n name={name}\n disabled={disabled}\n value={value}\n placeholder={placeholder}\n onChange={onChange}\n size={size}\n error={error || Boolean(errorMsg)}\n aria-describedby={errorMsg ? fieldErrorId(name) : undefined}\n className={cn(size === 'sm' && 'px-8', (!size || size === 'md') && 'px-9', size === 'lg' && 'px-10')}\n />\n <SearchIcon\n aria-hidden=\"true\"\n className={cn(\n 'absolute top-1/2 left-3 -translate-y-1/2 text-muted-foreground',\n size === 'sm' && 'size-3.5',\n (!size || size === 'md') && 'size-4',\n size === 'lg' && 'size-[1.125rem]',\n )}\n />\n {onReset && (value || isMinimized === false) && (\n <Button\n variant=\"ghost\"\n size={`icon-${size || 'md'}`}\n aria-label=\"Clear search\"\n onClick={() => {\n if (value) {\n onReset();\n }\n if (isMinimized === false) {\n onMinimizedChange?.(true);\n }\n }}\n className=\"absolute top-1/2 right-0 -translate-y-1/2\"\n >\n <XIcon />\n </Button>\n )}\n </div>\n {helpText || errorMsg ? <FieldBlock.Message name={name} helpText={helpText} errorMsg={errorMsg} /> : null}\n </FieldBlock.Column>\n </FieldBlock.Column>\n </FieldBlock.Layout>\n );\n}\n","import type { SelectTriggerProps } from '../../Select/select';\nimport { FieldBlock } from '../block/field-block';\nimport type { FieldBlockErrorMsgProps } from '../block/field-block-error-msg';\nimport type { FieldBlockHelpTextProps } from '../block/field-block-help-text';\nimport type { FieldBlockLabelProps } from '../block/field-block-label';\nimport type { FieldBlockLayoutProps } from '../block/field-block-layout';\nimport { fieldErrorId } from '../block/field-error-id';\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/ds/components/Select';\nimport { VisuallyHidden } from '@/ds/primitives/visually-hidden';\n\nexport type SelectFieldBlockProps = Pick<FieldBlockLayoutProps, 'layout' | 'labelColumnWidth'> &\n Pick<FieldBlockLabelProps, 'name' | 'required'> & {\n testId?: string;\n label?: string | null;\n labelIsHidden?: boolean;\n labelSize?: FieldBlockLabelProps['size'];\n disabled?: boolean;\n value?: string;\n options: { value: string; label: string }[];\n placeholder?: string;\n onValueChange: (value: string) => void;\n helpText?: FieldBlockHelpTextProps['children'];\n errorMsg?: FieldBlockErrorMsgProps['children'];\n error?: boolean;\n className?: string;\n size?: SelectTriggerProps['size'];\n };\n\n/** @deprecated Use `Field` + `FieldLabel` + `Select`. */\nexport function SelectFieldBlock({\n name,\n helpText,\n errorMsg,\n required = false,\n disabled = false,\n size = 'md',\n value,\n label,\n labelIsHidden = false,\n layout = 'vertical',\n labelColumnWidth,\n options,\n placeholder = 'Select an option',\n onValueChange,\n className,\n}: SelectFieldBlockProps) {\n return (\n <FieldBlock.Layout layout={layout} labelColumnWidth={labelColumnWidth} className={className}>\n {layout === 'horizontal' ? (\n <FieldBlock.Column>\n <FieldBlock.Label name={name} required={required} disabled={disabled}>\n {labelIsHidden ? <VisuallyHidden>{label}</VisuallyHidden> : label}\n </FieldBlock.Label>\n </FieldBlock.Column>\n ) : null}\n <FieldBlock.Column>\n {layout === 'vertical' && label && !labelIsHidden ? (\n <FieldBlock.Label name={name} required={required} disabled={disabled}>\n {label}\n </FieldBlock.Label>\n ) : null}\n <FieldBlock.Column className=\"gap-1\">\n <Select\n aria-label={labelIsHidden ? label : undefined}\n name={name}\n value={value}\n onValueChange={onValueChange}\n disabled={disabled}\n >\n <SelectTrigger\n id={`input-${name}`}\n size={size}\n aria-invalid={errorMsg ? true : undefined}\n aria-describedby={errorMsg ? fieldErrorId(name) : undefined}\n >\n <SelectValue placeholder={placeholder} />\n </SelectTrigger>\n <SelectContent>\n {options.map(option => (\n <SelectItem key={option.value} value={option.value}>\n {option.label}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n {helpText || errorMsg ? <FieldBlock.Message name={name} helpText={helpText} errorMsg={errorMsg} /> : null}\n </FieldBlock.Column>\n </FieldBlock.Column>\n </FieldBlock.Layout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAOA,SAAgB,wBAAwB,EAAE,UAAU,aAA2C;CAC7F,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EAAK,WAAWA,cAAAA,GAAG,4BAA4B,SAAS;EAAI;CAAc,CAAA;AACnF;;ACAA,SAAgB,sBAAsB,EAAE,UAAU,WAAW,UAAU,GAAG,OAAmC;CAC3G,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EACE,WAAWC,cAAAA,GACT,QACA;GACE,eAAe,YAAY;GAC3B,eAAe,YAAY;EAC7B,GACA,OAAO,SACP,SACF;EAEC;CACE,CAAA;AAET;;;ACrBA,IAAa,oBAAoB,OAAO,OAAO,uBAAuB,EACpE,QAAQ,wBACV,CAAC;;;ACgBD,SAAgB,eAAe,EAC7B,MACA,OACA,OACA,gBAAgB,OAChB,kBACA,UACA,OACA,UACA,WAAW,OACX,WAAW,OACX,WACA,SAAS,YACT,aACA,OAAO,MACP,QAC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A,CAACC,eAAAA,eAAD;KACE,IAAI,SAAS;KACP;KACN,gBAAc,WAAW,OAAO,KAAA;KAChC,oBAAkB,WAAWC,uBAAAA,aAAa,IAAI,IAAI,KAAA;KAElD,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,eAAAA,aAAD,EAA0B,YAAc,CAAA;IAC3B,CAAA,GACf,iBAAA,GAAA,kBAAA,IAAA,CAACC,eAAAA,eAAD,EAAA,UACG,QAAQ,KAAI,WACX,iBAAA,GAAA,kBAAA,IAAA,CAACC,eAAAA,YAAD;KAA+B,OAAO,OAAO;KAC1C,UAAA,OAAO;IACE,GAFK,OAAO,KAEZ,CACb,EACY,CAAA,CACT;GACP,CAAA,GAAA,YAAY,WAAW,iBAAA,GAAA,kBAAA,IAAA,CAACP,uBAAAA,WAAW,SAAZ;IAA0B;IAAgB;IAAoB;GAAW,CAAA,IAAI,IACpF;EACF,CAAA,CAAA,EAAA,CAAA,CACF;;AAEvB"}
|
|
1
|
+
{"version":3,"file":"FormFieldBlocks.cjs.js","names":["cn","cn","fieldErrorId","FieldBlock","VisuallyHidden","Input","fieldErrorId","FieldBlock","VisuallyHidden","Textarea","FieldBlock","VisuallyHidden","Select","SelectTrigger","fieldErrorId","SelectValue","SelectContent","SelectItem"],"sources":["../../src/ds/components/FormFieldBlocks/layout/field-blocks-layout-column.tsx","../../src/ds/components/FormFieldBlocks/layout/field-blocks-layout-root.tsx","../../src/ds/components/FormFieldBlocks/layout/field-blocks-layout.tsx","../../src/ds/components/FormFieldBlocks/fields/text-field-block.tsx","../../src/ds/components/FormFieldBlocks/fields/textarea-field-block.tsx","../../src/ds/components/FormFieldBlocks/fields/select-field-block.tsx"],"sourcesContent":["import { cn } from '@/lib/utils';\n\nexport type FieldBlocksLayoutColumnProps = {\n children: React.ReactNode;\n className?: string;\n};\n\nexport function FieldBlocksLayoutColumn({ children, className }: FieldBlocksLayoutColumnProps) {\n return <div className={cn('grid content-start gap-6', className)}>{children}</div>;\n}\n","import { cn } from '@/lib/utils';\n\nexport type FieldBlocksLayoutRootProps = {\n children: React.ReactNode;\n className?: string;\n columns?: 1 | 2;\n gap?: string;\n};\n\nexport function FieldBlocksLayoutRoot({ children, className, columns = 1, gap }: FieldBlocksLayoutRootProps) {\n return (\n <div\n className={cn(\n 'grid',\n {\n 'grid-cols-1': columns === 1,\n 'grid-cols-2': columns === 2,\n },\n gap ?? 'gap-6',\n className,\n )}\n >\n {children}\n </div>\n );\n}\n","import { FieldBlocksLayoutColumn } from './field-blocks-layout-column';\nimport { FieldBlocksLayoutRoot } from './field-blocks-layout-root';\n\n/** @deprecated Lay fields out with plain grid or flex classes; `FieldGroup` stacks related fields. */\nexport const FieldBlocksLayout = Object.assign(FieldBlocksLayoutRoot, {\n Column: FieldBlocksLayoutColumn,\n});\n","import { Input } from '../../Input';\nimport type { InputProps } from '../../Input';\nimport { FieldBlock } from '../block/field-block';\nimport type { FieldBlockErrorMsgProps } from '../block/field-block-error-msg';\nimport type { FieldBlockHelpTextProps } from '../block/field-block-help-text';\nimport type { FieldBlockLabelProps } from '../block/field-block-label';\nimport type { FieldBlockLayoutProps } from '../block/field-block-layout';\nimport { fieldErrorId } from '../block/field-error-id';\nimport { VisuallyHidden } from '@/ds/primitives/visually-hidden';\n\nexport type TextFieldBlockProps = Pick<FieldBlockLayoutProps, 'layout' | 'labelColumnWidth'> &\n Omit<InputProps, 'name' | 'size'> & {\n name: string;\n labelIsHidden?: boolean;\n label?: FieldBlockLabelProps['children'];\n labelSize?: FieldBlockLabelProps['size'];\n helpText?: FieldBlockHelpTextProps['children'];\n errorMsg?: FieldBlockErrorMsgProps['children'];\n size?: InputProps['size'];\n };\n\n/** @deprecated Use `Field` + `FieldLabel` + `Input`. */\nexport function TextFieldBlock({\n name,\n value,\n label,\n labelIsHidden = false,\n labelColumnWidth,\n helpText,\n error,\n errorMsg,\n required = false,\n disabled = false,\n labelSize,\n layout = 'vertical',\n placeholder,\n size = 'md',\n testId,\n className,\n 'aria-describedby': ariaDescribedBy,\n ...props\n}: TextFieldBlockProps) {\n const describedBy =\n [ariaDescribedBy, errorMsg ? fieldErrorId(name) : undefined].filter(Boolean).join(' ') || undefined;\n\n return (\n <FieldBlock.Layout layout={layout} labelColumnWidth={labelColumnWidth} className={className}>\n {layout === 'horizontal' ? (\n <FieldBlock.Column>\n <FieldBlock.Label name={name} required={required} disabled={disabled} size={labelSize || 'bigger'}>\n {labelIsHidden ? <VisuallyHidden>{label}</VisuallyHidden> : label}\n </FieldBlock.Label>\n </FieldBlock.Column>\n ) : null}\n <FieldBlock.Column>\n {!labelIsHidden && layout === 'vertical' ? (\n <FieldBlock.Label name={name} required={required} disabled={disabled} size={labelSize || 'default'}>\n {label}\n </FieldBlock.Label>\n ) : null}\n <FieldBlock.Column className=\"gap-1\">\n <Input\n id={`input-${name}`}\n name={name}\n disabled={disabled}\n required={required}\n value={value}\n placeholder={placeholder}\n data-testid={testId}\n size={size}\n error={error || Boolean(errorMsg)}\n aria-describedby={describedBy}\n {...props}\n />\n {helpText || errorMsg ? <FieldBlock.Message name={name} helpText={helpText} errorMsg={errorMsg} /> : null}\n </FieldBlock.Column>\n </FieldBlock.Column>\n </FieldBlock.Layout>\n );\n}\n","import { Textarea } from '../../Textarea';\nimport type { TextareaProps } from '../../Textarea';\nimport { FieldBlock } from '../block/field-block';\nimport type { FieldBlockErrorMsgProps } from '../block/field-block-error-msg';\nimport type { FieldBlockHelpTextProps } from '../block/field-block-help-text';\nimport type { FieldBlockLabelProps } from '../block/field-block-label';\nimport type { FieldBlockLayoutProps } from '../block/field-block-layout';\nimport { fieldErrorId } from '../block/field-error-id';\nimport { VisuallyHidden } from '@/ds/primitives/visually-hidden';\n\nexport type TextareaFieldBlockProps = Pick<FieldBlockLayoutProps, 'layout' | 'labelColumnWidth'> &\n Omit<TextareaProps, 'name' | 'size'> & {\n name: string;\n labelIsHidden?: boolean;\n label?: FieldBlockLabelProps['children'];\n labelSize?: FieldBlockLabelProps['size'];\n helpText?: FieldBlockHelpTextProps['children'];\n errorMsg?: FieldBlockErrorMsgProps['children'];\n size?: TextareaProps['size'];\n };\n\n/** @deprecated Use `Field` + `FieldLabel` + `Textarea`. */\nexport function TextareaFieldBlock({\n name,\n label,\n labelIsHidden = false,\n labelColumnWidth,\n helpText,\n error,\n errorMsg,\n required = false,\n disabled = false,\n labelSize,\n layout = 'vertical',\n size = 'md',\n testId,\n className,\n 'aria-describedby': ariaDescribedBy,\n ...props\n}: TextareaFieldBlockProps) {\n const describedBy =\n [ariaDescribedBy, errorMsg ? fieldErrorId(name) : undefined].filter(Boolean).join(' ') || undefined;\n\n return (\n <FieldBlock.Layout layout={layout} labelColumnWidth={labelColumnWidth} className={className}>\n {layout === 'horizontal' ? (\n <FieldBlock.Column>\n <FieldBlock.Label name={name} required={required} disabled={disabled} size={labelSize || 'bigger'}>\n {labelIsHidden ? <VisuallyHidden>{label}</VisuallyHidden> : label}\n </FieldBlock.Label>\n </FieldBlock.Column>\n ) : null}\n <FieldBlock.Column>\n {!labelIsHidden && layout === 'vertical' ? (\n <FieldBlock.Label name={name} required={required} disabled={disabled} size={labelSize || 'default'}>\n {label}\n </FieldBlock.Label>\n ) : null}\n <FieldBlock.Column className=\"gap-1\">\n <Textarea\n id={`input-${name}`}\n name={name}\n disabled={disabled}\n required={required}\n size={size}\n data-testid={testId}\n error={error || Boolean(errorMsg)}\n aria-describedby={describedBy}\n {...props}\n />\n {helpText || errorMsg ? <FieldBlock.Message name={name} helpText={helpText} errorMsg={errorMsg} /> : null}\n </FieldBlock.Column>\n </FieldBlock.Column>\n </FieldBlock.Layout>\n );\n}\n","import type { SelectTriggerProps } from '../../Select/select';\nimport { FieldBlock } from '../block/field-block';\nimport type { FieldBlockErrorMsgProps } from '../block/field-block-error-msg';\nimport type { FieldBlockHelpTextProps } from '../block/field-block-help-text';\nimport type { FieldBlockLabelProps } from '../block/field-block-label';\nimport type { FieldBlockLayoutProps } from '../block/field-block-layout';\nimport { fieldErrorId } from '../block/field-error-id';\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/ds/components/Select';\nimport { VisuallyHidden } from '@/ds/primitives/visually-hidden';\n\nexport type SelectFieldBlockProps = Pick<FieldBlockLayoutProps, 'layout' | 'labelColumnWidth'> &\n Pick<FieldBlockLabelProps, 'name' | 'required'> & {\n testId?: string;\n label?: string | null;\n labelIsHidden?: boolean;\n labelSize?: FieldBlockLabelProps['size'];\n disabled?: boolean;\n value?: string;\n options: { value: string; label: string }[];\n placeholder?: string;\n onValueChange: (value: string) => void;\n helpText?: FieldBlockHelpTextProps['children'];\n errorMsg?: FieldBlockErrorMsgProps['children'];\n error?: boolean;\n className?: string;\n size?: SelectTriggerProps['size'];\n };\n\n/** @deprecated Use `Field` + `FieldLabel` + `Select`. */\nexport function SelectFieldBlock({\n name,\n helpText,\n errorMsg,\n required = false,\n disabled = false,\n size = 'md',\n value,\n label,\n labelIsHidden = false,\n layout = 'vertical',\n labelColumnWidth,\n options,\n placeholder = 'Select an option',\n onValueChange,\n className,\n}: SelectFieldBlockProps) {\n return (\n <FieldBlock.Layout layout={layout} labelColumnWidth={labelColumnWidth} className={className}>\n {layout === 'horizontal' ? (\n <FieldBlock.Column>\n <FieldBlock.Label name={name} required={required} disabled={disabled}>\n {labelIsHidden ? <VisuallyHidden>{label}</VisuallyHidden> : label}\n </FieldBlock.Label>\n </FieldBlock.Column>\n ) : null}\n <FieldBlock.Column>\n {layout === 'vertical' && label && !labelIsHidden ? (\n <FieldBlock.Label name={name} required={required} disabled={disabled}>\n {label}\n </FieldBlock.Label>\n ) : null}\n <FieldBlock.Column className=\"gap-1\">\n <Select\n aria-label={labelIsHidden ? label : undefined}\n name={name}\n value={value}\n onValueChange={onValueChange}\n disabled={disabled}\n >\n <SelectTrigger\n id={`input-${name}`}\n size={size}\n aria-invalid={errorMsg ? true : undefined}\n aria-describedby={errorMsg ? fieldErrorId(name) : undefined}\n >\n <SelectValue placeholder={placeholder} />\n </SelectTrigger>\n <SelectContent>\n {options.map(option => (\n <SelectItem key={option.value} value={option.value}>\n {option.label}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n {helpText || errorMsg ? <FieldBlock.Message name={name} helpText={helpText} errorMsg={errorMsg} /> : null}\n </FieldBlock.Column>\n </FieldBlock.Column>\n </FieldBlock.Layout>\n );\n}\n"],"mappings":";;;;;;;;;AAOA,SAAgB,wBAAwB,EAAE,UAAU,aAA2C;CAC7F,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EAAK,WAAWA,cAAAA,GAAG,4BAA4B,SAAS;EAAI;CAAc,CAAA;AACnF;;ACAA,SAAgB,sBAAsB,EAAE,UAAU,WAAW,UAAU,GAAG,OAAmC;CAC3G,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EACE,WAAWC,cAAAA,GACT,QACA;GACE,eAAe,YAAY;GAC3B,eAAe,YAAY;EAC7B,GACA,OAAO,SACP,SACF;EAEC;CACE,CAAA;AAET;;;ACrBA,IAAa,oBAAoB,OAAO,OAAO,uBAAuB,EACpE,QAAQ,wBACV,CAAC;;;ACgBD,SAAgB,eAAe,EAC7B,MACA,OACA,OACA,gBAAgB,OAChB,kBACA,UACA,OACA,UACA,WAAW,OACX,WAAW,OACX,WACA,SAAS,YACT,aACA,OAAO,MACP,QACA,WACA,oBAAoB,iBACpB,GAAG,SACmB;CACtB,MAAM,cACJ,CAAC,iBAAiB,WAAWC,uBAAAA,aAAa,IAAI,IAAI,KAAA,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,KAAK,KAAA;CAE5F,OACE,iBAAA,GAAA,kBAAA,KAAA,CAACC,uBAAAA,WAAW,QAAZ;EAA2B;EAA0B;EAA6B;EAAlF,UAAA,CACG,WAAW,eACV,iBAAA,GAAA,kBAAA,IAAA,CAACA,uBAAAA,WAAW,QAAZ,EAAA,UACE,iBAAA,GAAA,kBAAA,IAAA,CAACA,uBAAAA,WAAW,OAAZ;GAAwB;GAAgB;GAAoB;GA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A,EAAA,CAAA,CACF;;AAEvB"}
|
|
@@ -3,12 +3,8 @@ import { t as cn } from "../utils-DQx8TpNT.js";
|
|
|
3
3
|
import { t as Input } from "../input-DqReKX0A.js";
|
|
4
4
|
import { VisuallyHidden } from "../primitives/visually-hidden.es.js";
|
|
5
5
|
import { Textarea } from "./Textarea.es.js";
|
|
6
|
-
import { t as Button } from "../Button-Bi7aXd_G.js";
|
|
7
|
-
import { i as TooltipTrigger, n as TooltipContent, t as Tooltip } from "../tooltip-DJcze2VZ.js";
|
|
8
6
|
import { i as SelectItem, n as SelectContent, o as SelectTrigger, s as SelectValue, t as Select } from "../select-DkAAWqHI.js";
|
|
9
|
-
import { useEffect, useRef } from "react";
|
|
10
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
-
import { SearchIcon, XIcon } from "lucide-react";
|
|
12
8
|
// src/ds/components/FormFieldBlocks/layout/field-blocks-layout-column.tsx
|
|
13
9
|
function FieldBlocksLayoutColumn({ children, className }) {
|
|
14
10
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -111,89 +107,6 @@ function TextareaFieldBlock({ name, label, labelIsHidden = false, labelColumnWid
|
|
|
111
107
|
})] })]
|
|
112
108
|
});
|
|
113
109
|
}
|
|
114
|
-
// src/ds/components/FormFieldBlocks/fields/search-field-block.tsx
|
|
115
|
-
/** @deprecated Use `SearchInput`. */
|
|
116
|
-
function SearchFieldBlock({ name, helpText, error, errorMsg, required = false, disabled = false, value, label, labelIsHidden = false, layout = "vertical", placeholder = "Search", onChange, onReset, className, size, isMinimized, onMinimizedChange, inputRef: externalInputRef }) {
|
|
117
|
-
const inputRef = useRef(null);
|
|
118
|
-
const setInputRef = (element) => {
|
|
119
|
-
inputRef.current = element;
|
|
120
|
-
if (externalInputRef) externalInputRef.current = element;
|
|
121
|
-
};
|
|
122
|
-
useEffect(() => {
|
|
123
|
-
if (isMinimized === false) inputRef.current?.focus();
|
|
124
|
-
}, [isMinimized]);
|
|
125
|
-
if (isMinimized) return /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
|
|
126
|
-
asChild: true,
|
|
127
|
-
children: /* @__PURE__ */ jsx(Button, {
|
|
128
|
-
size: `icon-${size || "sm"}`,
|
|
129
|
-
"aria-label": label || "Search",
|
|
130
|
-
disabled,
|
|
131
|
-
onClick: () => onMinimizedChange?.(false),
|
|
132
|
-
children: /* @__PURE__ */ jsx(SearchIcon, {})
|
|
133
|
-
})
|
|
134
|
-
}), /* @__PURE__ */ jsx(TooltipContent, { children: label || "Search" })] });
|
|
135
|
-
return /* @__PURE__ */ jsxs(FieldBlock.Layout, {
|
|
136
|
-
layout,
|
|
137
|
-
className,
|
|
138
|
-
children: [layout === "horizontal" ? /* @__PURE__ */ jsx(FieldBlock.Column, {
|
|
139
|
-
className: labelIsHidden ? "sr-only" : void 0,
|
|
140
|
-
children: /* @__PURE__ */ jsx(FieldBlock.Label, {
|
|
141
|
-
name,
|
|
142
|
-
required,
|
|
143
|
-
disabled,
|
|
144
|
-
children: label
|
|
145
|
-
})
|
|
146
|
-
}) : null, /* @__PURE__ */ jsxs(FieldBlock.Column, {
|
|
147
|
-
className: layout === "horizontal" && labelIsHidden ? "col-span-full" : void 0,
|
|
148
|
-
children: [layout === "vertical" && label ? /* @__PURE__ */ jsx(FieldBlock.Label, {
|
|
149
|
-
name,
|
|
150
|
-
required,
|
|
151
|
-
disabled,
|
|
152
|
-
className: labelIsHidden ? "sr-only" : void 0,
|
|
153
|
-
children: label
|
|
154
|
-
}) : null, /* @__PURE__ */ jsxs(FieldBlock.Column, {
|
|
155
|
-
className: "gap-1",
|
|
156
|
-
children: [/* @__PURE__ */ jsxs("div", {
|
|
157
|
-
className: "group relative",
|
|
158
|
-
children: [
|
|
159
|
-
/* @__PURE__ */ jsx(Input, {
|
|
160
|
-
ref: setInputRef,
|
|
161
|
-
id: `input-${name}`,
|
|
162
|
-
name,
|
|
163
|
-
disabled,
|
|
164
|
-
value,
|
|
165
|
-
placeholder,
|
|
166
|
-
onChange,
|
|
167
|
-
size,
|
|
168
|
-
error: error || Boolean(errorMsg),
|
|
169
|
-
"aria-describedby": errorMsg ? fieldErrorId(name) : void 0,
|
|
170
|
-
className: cn(size === "sm" && "px-8", (!size || size === "md") && "px-9", size === "lg" && "px-10")
|
|
171
|
-
}),
|
|
172
|
-
/* @__PURE__ */ jsx(SearchIcon, {
|
|
173
|
-
"aria-hidden": "true",
|
|
174
|
-
className: cn("absolute top-1/2 left-3 -translate-y-1/2 text-muted-foreground", size === "sm" && "size-3.5", (!size || size === "md") && "size-4", size === "lg" && "size-[1.125rem]")
|
|
175
|
-
}),
|
|
176
|
-
onReset && (value || isMinimized === false) && /* @__PURE__ */ jsx(Button, {
|
|
177
|
-
variant: "ghost",
|
|
178
|
-
size: `icon-${size || "md"}`,
|
|
179
|
-
"aria-label": "Clear search",
|
|
180
|
-
onClick: () => {
|
|
181
|
-
if (value) onReset();
|
|
182
|
-
if (isMinimized === false) onMinimizedChange?.(true);
|
|
183
|
-
},
|
|
184
|
-
className: "absolute top-1/2 right-0 -translate-y-1/2",
|
|
185
|
-
children: /* @__PURE__ */ jsx(XIcon, {})
|
|
186
|
-
})
|
|
187
|
-
]
|
|
188
|
-
}), helpText || errorMsg ? /* @__PURE__ */ jsx(FieldBlock.Message, {
|
|
189
|
-
name,
|
|
190
|
-
helpText,
|
|
191
|
-
errorMsg
|
|
192
|
-
}) : null]
|
|
193
|
-
})]
|
|
194
|
-
})]
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
110
|
// src/ds/components/FormFieldBlocks/fields/select-field-block.tsx
|
|
198
111
|
/** @deprecated Use `Field` + `FieldLabel` + `Select`. */
|
|
199
112
|
function SelectFieldBlock({ name, helpText, errorMsg, required = false, disabled = false, size = "md", value, label, labelIsHidden = false, layout = "vertical", labelColumnWidth, options, placeholder = "Select an option", onValueChange, className }) {
|
|
@@ -237,6 +150,6 @@ function SelectFieldBlock({ name, helpText, errorMsg, required = false, disabled
|
|
|
237
150
|
})] })]
|
|
238
151
|
});
|
|
239
152
|
}
|
|
240
|
-
export { FieldBlock, FieldBlocksLayout,
|
|
153
|
+
export { FieldBlock, FieldBlocksLayout, SelectFieldBlock, TextFieldBlock, TextareaFieldBlock, fieldErrorId };
|
|
241
154
|
|
|
242
155
|
//# sourceMappingURL=FormFieldBlocks.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormFieldBlocks.es.js","names":[],"sources":["../../src/ds/components/FormFieldBlocks/layout/field-blocks-layout-column.tsx","../../src/ds/components/FormFieldBlocks/layout/field-blocks-layout-root.tsx","../../src/ds/components/FormFieldBlocks/layout/field-blocks-layout.tsx","../../src/ds/components/FormFieldBlocks/fields/text-field-block.tsx","../../src/ds/components/FormFieldBlocks/fields/textarea-field-block.tsx","../../src/ds/components/FormFieldBlocks/fields/search-field-block.tsx","../../src/ds/components/FormFieldBlocks/fields/select-field-block.tsx"],"sourcesContent":["import { cn } from '@/lib/utils';\n\nexport type FieldBlocksLayoutColumnProps = {\n children: React.ReactNode;\n className?: string;\n};\n\nexport function FieldBlocksLayoutColumn({ children, className }: FieldBlocksLayoutColumnProps) {\n return <div className={cn('grid content-start gap-6', className)}>{children}</div>;\n}\n","import { cn } from '@/lib/utils';\n\nexport type FieldBlocksLayoutRootProps = {\n children: React.ReactNode;\n className?: string;\n columns?: 1 | 2;\n gap?: string;\n};\n\nexport function FieldBlocksLayoutRoot({ children, className, columns = 1, gap }: FieldBlocksLayoutRootProps) {\n return (\n <div\n className={cn(\n 'grid',\n {\n 'grid-cols-1': columns === 1,\n 'grid-cols-2': columns === 2,\n },\n gap ?? 'gap-6',\n className,\n )}\n >\n {children}\n </div>\n );\n}\n","import { FieldBlocksLayoutColumn } from './field-blocks-layout-column';\nimport { FieldBlocksLayoutRoot } from './field-blocks-layout-root';\n\n/** @deprecated Lay fields out with plain grid or flex classes; `FieldGroup` stacks related fields. */\nexport const FieldBlocksLayout = Object.assign(FieldBlocksLayoutRoot, {\n Column: FieldBlocksLayoutColumn,\n});\n","import { Input } from '../../Input';\nimport type { InputProps } from '../../Input';\nimport { FieldBlock } from '../block/field-block';\nimport type { FieldBlockErrorMsgProps } from '../block/field-block-error-msg';\nimport type { FieldBlockHelpTextProps } from '../block/field-block-help-text';\nimport type { FieldBlockLabelProps } from '../block/field-block-label';\nimport type { FieldBlockLayoutProps } from '../block/field-block-layout';\nimport { fieldErrorId } from '../block/field-error-id';\nimport { VisuallyHidden } from '@/ds/primitives/visually-hidden';\n\nexport type TextFieldBlockProps = Pick<FieldBlockLayoutProps, 'layout' | 'labelColumnWidth'> &\n Omit<InputProps, 'name' | 'size'> & {\n name: string;\n labelIsHidden?: boolean;\n label?: FieldBlockLabelProps['children'];\n labelSize?: FieldBlockLabelProps['size'];\n helpText?: FieldBlockHelpTextProps['children'];\n errorMsg?: FieldBlockErrorMsgProps['children'];\n size?: InputProps['size'];\n };\n\n/** @deprecated Use `Field` + `FieldLabel` + `Input`. */\nexport function TextFieldBlock({\n name,\n value,\n label,\n labelIsHidden = false,\n labelColumnWidth,\n helpText,\n error,\n errorMsg,\n required = false,\n disabled = false,\n labelSize,\n layout = 'vertical',\n placeholder,\n size = 'md',\n testId,\n className,\n 'aria-describedby': ariaDescribedBy,\n ...props\n}: TextFieldBlockProps) {\n const describedBy =\n [ariaDescribedBy, errorMsg ? fieldErrorId(name) : undefined].filter(Boolean).join(' ') || undefined;\n\n return (\n <FieldBlock.Layout layout={layout} labelColumnWidth={labelColumnWidth} className={className}>\n {layout === 'horizontal' ? (\n <FieldBlock.Column>\n <FieldBlock.Label name={name} required={required} disabled={disabled} size={labelSize || 'bigger'}>\n {labelIsHidden ? <VisuallyHidden>{label}</VisuallyHidden> : label}\n </FieldBlock.Label>\n </FieldBlock.Column>\n ) : null}\n <FieldBlock.Column>\n {!labelIsHidden && layout === 'vertical' ? (\n <FieldBlock.Label name={name} required={required} disabled={disabled} size={labelSize || 'default'}>\n {label}\n </FieldBlock.Label>\n ) : null}\n <FieldBlock.Column className=\"gap-1\">\n <Input\n id={`input-${name}`}\n name={name}\n disabled={disabled}\n required={required}\n value={value}\n placeholder={placeholder}\n data-testid={testId}\n size={size}\n error={error || Boolean(errorMsg)}\n aria-describedby={describedBy}\n {...props}\n />\n {helpText || errorMsg ? <FieldBlock.Message name={name} helpText={helpText} errorMsg={errorMsg} /> : null}\n </FieldBlock.Column>\n </FieldBlock.Column>\n </FieldBlock.Layout>\n );\n}\n","import { Textarea } from '../../Textarea';\nimport type { TextareaProps } from '../../Textarea';\nimport { FieldBlock } from '../block/field-block';\nimport type { FieldBlockErrorMsgProps } from '../block/field-block-error-msg';\nimport type { FieldBlockHelpTextProps } from '../block/field-block-help-text';\nimport type { FieldBlockLabelProps } from '../block/field-block-label';\nimport type { FieldBlockLayoutProps } from '../block/field-block-layout';\nimport { fieldErrorId } from '../block/field-error-id';\nimport { VisuallyHidden } from '@/ds/primitives/visually-hidden';\n\nexport type TextareaFieldBlockProps = Pick<FieldBlockLayoutProps, 'layout' | 'labelColumnWidth'> &\n Omit<TextareaProps, 'name' | 'size'> & {\n name: string;\n labelIsHidden?: boolean;\n label?: FieldBlockLabelProps['children'];\n labelSize?: FieldBlockLabelProps['size'];\n helpText?: FieldBlockHelpTextProps['children'];\n errorMsg?: FieldBlockErrorMsgProps['children'];\n size?: TextareaProps['size'];\n };\n\n/** @deprecated Use `Field` + `FieldLabel` + `Textarea`. */\nexport function TextareaFieldBlock({\n name,\n label,\n labelIsHidden = false,\n labelColumnWidth,\n helpText,\n error,\n errorMsg,\n required = false,\n disabled = false,\n labelSize,\n layout = 'vertical',\n size = 'md',\n testId,\n className,\n 'aria-describedby': ariaDescribedBy,\n ...props\n}: TextareaFieldBlockProps) {\n const describedBy =\n [ariaDescribedBy, errorMsg ? fieldErrorId(name) : undefined].filter(Boolean).join(' ') || undefined;\n\n return (\n <FieldBlock.Layout layout={layout} labelColumnWidth={labelColumnWidth} className={className}>\n {layout === 'horizontal' ? (\n <FieldBlock.Column>\n <FieldBlock.Label name={name} required={required} disabled={disabled} size={labelSize || 'bigger'}>\n {labelIsHidden ? <VisuallyHidden>{label}</VisuallyHidden> : label}\n </FieldBlock.Label>\n </FieldBlock.Column>\n ) : null}\n <FieldBlock.Column>\n {!labelIsHidden && layout === 'vertical' ? (\n <FieldBlock.Label name={name} required={required} disabled={disabled} size={labelSize || 'default'}>\n {label}\n </FieldBlock.Label>\n ) : null}\n <FieldBlock.Column className=\"gap-1\">\n <Textarea\n id={`input-${name}`}\n name={name}\n disabled={disabled}\n required={required}\n size={size}\n data-testid={testId}\n error={error || Boolean(errorMsg)}\n aria-describedby={describedBy}\n {...props}\n />\n {helpText || errorMsg ? <FieldBlock.Message name={name} helpText={helpText} errorMsg={errorMsg} /> : null}\n </FieldBlock.Column>\n </FieldBlock.Column>\n </FieldBlock.Layout>\n );\n}\n","import { SearchIcon, XIcon } from 'lucide-react';\nimport { useEffect, useRef } from 'react';\nimport type { RefObject } from 'react';\nimport { Button } from '../../Button';\nimport { Input } from '../../Input';\nimport type { InputProps } from '../../Input';\nimport { Tooltip, TooltipContent, TooltipTrigger } from '../../Tooltip';\nimport { FieldBlock } from '../block/field-block';\nimport { fieldErrorId } from '../block/field-error-id';\nimport { cn } from '@/lib/utils';\n\nexport type SearchFieldBlockProps = {\n name: string;\n testId?: string;\n label?: string;\n labelIsHidden?: boolean;\n required?: boolean;\n disabled?: boolean;\n value?: string;\n placeholder?: string;\n onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;\n onReset?: () => void;\n helpText?: string;\n error?: boolean;\n errorMsg?: string;\n layout?: 'horizontal' | 'vertical';\n className?: string;\n size?: InputProps['size'];\n isMinimized?: boolean;\n onMinimizedChange?: (minimized: boolean) => void;\n /** Gives the caller access to the underlying input, e.g. to focus it from a keyboard shortcut. */\n inputRef?: RefObject<HTMLInputElement | null>;\n};\n\n/** @deprecated Use `SearchInput`. */\nexport function SearchFieldBlock({\n name,\n helpText,\n error,\n errorMsg,\n required = false,\n disabled = false,\n value,\n label,\n labelIsHidden = false,\n layout = 'vertical',\n placeholder = 'Search',\n onChange,\n onReset,\n className,\n size,\n isMinimized,\n onMinimizedChange,\n inputRef: externalInputRef,\n}: SearchFieldBlockProps) {\n const inputRef = useRef<HTMLInputElement>(null);\n\n const setInputRef = (element: HTMLInputElement | null) => {\n inputRef.current = element;\n if (externalInputRef) externalInputRef.current = element;\n };\n useEffect(() => {\n if (isMinimized === false) {\n inputRef.current?.focus();\n }\n }, [isMinimized]);\n\n if (isMinimized) {\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n size={`icon-${size || 'sm'}`}\n aria-label={label || 'Search'}\n disabled={disabled}\n onClick={() => onMinimizedChange?.(false)}\n >\n <SearchIcon />\n </Button>\n </TooltipTrigger>\n <TooltipContent>{label || 'Search'}</TooltipContent>\n </Tooltip>\n );\n }\n\n return (\n <FieldBlock.Layout layout={layout} className={className}>\n {layout === 'horizontal' ? (\n <FieldBlock.Column className={labelIsHidden ? 'sr-only' : undefined}>\n <FieldBlock.Label name={name} required={required} disabled={disabled}>\n {label}\n </FieldBlock.Label>\n </FieldBlock.Column>\n ) : null}\n <FieldBlock.Column className={layout === 'horizontal' && labelIsHidden ? 'col-span-full' : undefined}>\n {layout === 'vertical' && label ? (\n <FieldBlock.Label\n name={name}\n required={required}\n disabled={disabled}\n className={labelIsHidden ? 'sr-only' : undefined}\n >\n {label}\n </FieldBlock.Label>\n ) : null}\n <FieldBlock.Column className=\"gap-1\">\n <div className=\"group relative\">\n <Input\n ref={setInputRef}\n id={`input-${name}`}\n name={name}\n disabled={disabled}\n value={value}\n placeholder={placeholder}\n onChange={onChange}\n size={size}\n error={error || Boolean(errorMsg)}\n aria-describedby={errorMsg ? fieldErrorId(name) : undefined}\n className={cn(size === 'sm' && 'px-8', (!size || size === 'md') && 'px-9', size === 'lg' && 'px-10')}\n />\n <SearchIcon\n aria-hidden=\"true\"\n className={cn(\n 'absolute top-1/2 left-3 -translate-y-1/2 text-muted-foreground',\n size === 'sm' && 'size-3.5',\n (!size || size === 'md') && 'size-4',\n size === 'lg' && 'size-[1.125rem]',\n )}\n />\n {onReset && (value || isMinimized === false) && (\n <Button\n variant=\"ghost\"\n size={`icon-${size || 'md'}`}\n aria-label=\"Clear search\"\n onClick={() => {\n if (value) {\n onReset();\n }\n if (isMinimized === false) {\n onMinimizedChange?.(true);\n }\n }}\n className=\"absolute top-1/2 right-0 -translate-y-1/2\"\n >\n <XIcon />\n </Button>\n )}\n </div>\n {helpText || errorMsg ? <FieldBlock.Message name={name} helpText={helpText} errorMsg={errorMsg} /> : null}\n </FieldBlock.Column>\n </FieldBlock.Column>\n </FieldBlock.Layout>\n );\n}\n","import type { SelectTriggerProps } from '../../Select/select';\nimport { FieldBlock } from '../block/field-block';\nimport type { FieldBlockErrorMsgProps } from '../block/field-block-error-msg';\nimport type { FieldBlockHelpTextProps } from '../block/field-block-help-text';\nimport type { FieldBlockLabelProps } from '../block/field-block-label';\nimport type { FieldBlockLayoutProps } from '../block/field-block-layout';\nimport { fieldErrorId } from '../block/field-error-id';\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/ds/components/Select';\nimport { VisuallyHidden } from '@/ds/primitives/visually-hidden';\n\nexport type SelectFieldBlockProps = Pick<FieldBlockLayoutProps, 'layout' | 'labelColumnWidth'> &\n Pick<FieldBlockLabelProps, 'name' | 'required'> & {\n testId?: string;\n label?: string | null;\n labelIsHidden?: boolean;\n labelSize?: FieldBlockLabelProps['size'];\n disabled?: boolean;\n value?: string;\n options: { value: string; label: string }[];\n placeholder?: string;\n onValueChange: (value: string) => void;\n helpText?: FieldBlockHelpTextProps['children'];\n errorMsg?: FieldBlockErrorMsgProps['children'];\n error?: boolean;\n className?: string;\n size?: SelectTriggerProps['size'];\n };\n\n/** @deprecated Use `Field` + `FieldLabel` + `Select`. */\nexport function SelectFieldBlock({\n name,\n helpText,\n errorMsg,\n required = false,\n disabled = false,\n size = 'md',\n value,\n label,\n labelIsHidden = false,\n layout = 'vertical',\n labelColumnWidth,\n options,\n placeholder = 'Select an option',\n onValueChange,\n className,\n}: SelectFieldBlockProps) {\n return (\n <FieldBlock.Layout layout={layout} labelColumnWidth={labelColumnWidth} className={className}>\n {layout === 'horizontal' ? (\n <FieldBlock.Column>\n <FieldBlock.Label name={name} required={required} disabled={disabled}>\n {labelIsHidden ? <VisuallyHidden>{label}</VisuallyHidden> : label}\n </FieldBlock.Label>\n </FieldBlock.Column>\n ) : null}\n <FieldBlock.Column>\n {layout === 'vertical' && label && !labelIsHidden ? (\n <FieldBlock.Label name={name} required={required} disabled={disabled}>\n {label}\n </FieldBlock.Label>\n ) : null}\n <FieldBlock.Column className=\"gap-1\">\n <Select\n aria-label={labelIsHidden ? label : undefined}\n name={name}\n value={value}\n onValueChange={onValueChange}\n disabled={disabled}\n >\n <SelectTrigger\n id={`input-${name}`}\n size={size}\n aria-invalid={errorMsg ? true : undefined}\n aria-describedby={errorMsg ? fieldErrorId(name) : undefined}\n >\n <SelectValue placeholder={placeholder} />\n </SelectTrigger>\n <SelectContent>\n {options.map(option => (\n <SelectItem key={option.value} value={option.value}>\n {option.label}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n {helpText || errorMsg ? <FieldBlock.Message name={name} helpText={helpText} errorMsg={errorMsg} /> : null}\n </FieldBlock.Column>\n </FieldBlock.Column>\n </FieldBlock.Layout>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAOA,SAAgB,wBAAwB,EAAE,UAAU,aAA2C;CAC7F,OAAO,oBAAC,OAAD;EAAK,WAAW,GAAG,4BAA4B,SAAS;EAAI;CAAc,CAAA;AACnF;;ACAA,SAAgB,sBAAsB,EAAE,UAAU,WAAW,UAAU,GAAG,OAAmC;CAC3G,OACE,oBAAC,OAAD;EACE,WAAW,GACT,QACA;GACE,eAAe,YAAY;GAC3B,eAAe,YAAY;EAC7B,GACA,OAAO,SACP,SACF;EAEC;CACE,CAAA;AAET;;;ACrBA,IAAa,oBAAo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AD,EAA0B,YAAc,CAAA;IAC3B,CAAA,GACf,oBAAC,eAAD,EAAA,UACG,QAAQ,KAAI,WACX,oBAAC,YAAD;KAA+B,OAAO,OAAO;KAC1C,UAAA,OAAO;IACE,GAFK,OAAO,KAEZ,CACb,EACY,CAAA,CACT;GACP,CAAA,GAAA,YAAY,WAAW,oBAAC,WAAW,SAAZ;IAA0B;IAAgB;IAAoB;GAAW,CAAA,IAAI,IACpF;EACF,CAAA,CAAA,EAAA,CAAA,CACF;;AAEvB"}
|
|
1
|
+
{"version":3,"file":"FormFieldBlocks.es.js","names":[],"sources":["../../src/ds/components/FormFieldBlocks/layout/field-blocks-layout-column.tsx","../../src/ds/components/FormFieldBlocks/layout/field-blocks-layout-root.tsx","../../src/ds/components/FormFieldBlocks/layout/field-blocks-layout.tsx","../../src/ds/components/FormFieldBlocks/fields/text-field-block.tsx","../../src/ds/components/FormFieldBlocks/fields/textarea-field-block.tsx","../../src/ds/components/FormFieldBlocks/fields/select-field-block.tsx"],"sourcesContent":["import { cn } from '@/lib/utils';\n\nexport type FieldBlocksLayoutColumnProps = {\n children: React.ReactNode;\n className?: string;\n};\n\nexport function FieldBlocksLayoutColumn({ children, className }: FieldBlocksLayoutColumnProps) {\n return <div className={cn('grid content-start gap-6', className)}>{children}</div>;\n}\n","import { cn } from '@/lib/utils';\n\nexport type FieldBlocksLayoutRootProps = {\n children: React.ReactNode;\n className?: string;\n columns?: 1 | 2;\n gap?: string;\n};\n\nexport function FieldBlocksLayoutRoot({ children, className, columns = 1, gap }: FieldBlocksLayoutRootProps) {\n return (\n <div\n className={cn(\n 'grid',\n {\n 'grid-cols-1': columns === 1,\n 'grid-cols-2': columns === 2,\n },\n gap ?? 'gap-6',\n className,\n )}\n >\n {children}\n </div>\n );\n}\n","import { FieldBlocksLayoutColumn } from './field-blocks-layout-column';\nimport { FieldBlocksLayoutRoot } from './field-blocks-layout-root';\n\n/** @deprecated Lay fields out with plain grid or flex classes; `FieldGroup` stacks related fields. */\nexport const FieldBlocksLayout = Object.assign(FieldBlocksLayoutRoot, {\n Column: FieldBlocksLayoutColumn,\n});\n","import { Input } from '../../Input';\nimport type { InputProps } from '../../Input';\nimport { FieldBlock } from '../block/field-block';\nimport type { FieldBlockErrorMsgProps } from '../block/field-block-error-msg';\nimport type { FieldBlockHelpTextProps } from '../block/field-block-help-text';\nimport type { FieldBlockLabelProps } from '../block/field-block-label';\nimport type { FieldBlockLayoutProps } from '../block/field-block-layout';\nimport { fieldErrorId } from '../block/field-error-id';\nimport { VisuallyHidden } from '@/ds/primitives/visually-hidden';\n\nexport type TextFieldBlockProps = Pick<FieldBlockLayoutProps, 'layout' | 'labelColumnWidth'> &\n Omit<InputProps, 'name' | 'size'> & {\n name: string;\n labelIsHidden?: boolean;\n label?: FieldBlockLabelProps['children'];\n labelSize?: FieldBlockLabelProps['size'];\n helpText?: FieldBlockHelpTextProps['children'];\n errorMsg?: FieldBlockErrorMsgProps['children'];\n size?: InputProps['size'];\n };\n\n/** @deprecated Use `Field` + `FieldLabel` + `Input`. */\nexport function TextFieldBlock({\n name,\n value,\n label,\n labelIsHidden = false,\n labelColumnWidth,\n helpText,\n error,\n errorMsg,\n required = false,\n disabled = false,\n labelSize,\n layout = 'vertical',\n placeholder,\n size = 'md',\n testId,\n className,\n 'aria-describedby': ariaDescribedBy,\n ...props\n}: TextFieldBlockProps) {\n const describedBy =\n [ariaDescribedBy, errorMsg ? fieldErrorId(name) : undefined].filter(Boolean).join(' ') || undefined;\n\n return (\n <FieldBlock.Layout layout={layout} labelColumnWidth={labelColumnWidth} className={className}>\n {layout === 'horizontal' ? (\n <FieldBlock.Column>\n <FieldBlock.Label name={name} required={required} disabled={disabled} size={labelSize || 'bigger'}>\n {labelIsHidden ? <VisuallyHidden>{label}</VisuallyHidden> : label}\n </FieldBlock.Label>\n </FieldBlock.Column>\n ) : null}\n <FieldBlock.Column>\n {!labelIsHidden && layout === 'vertical' ? (\n <FieldBlock.Label name={name} required={required} disabled={disabled} size={labelSize || 'default'}>\n {label}\n </FieldBlock.Label>\n ) : null}\n <FieldBlock.Column className=\"gap-1\">\n <Input\n id={`input-${name}`}\n name={name}\n disabled={disabled}\n required={required}\n value={value}\n placeholder={placeholder}\n data-testid={testId}\n size={size}\n error={error || Boolean(errorMsg)}\n aria-describedby={describedBy}\n {...props}\n />\n {helpText || errorMsg ? <FieldBlock.Message name={name} helpText={helpText} errorMsg={errorMsg} /> : null}\n </FieldBlock.Column>\n </FieldBlock.Column>\n </FieldBlock.Layout>\n );\n}\n","import { Textarea } from '../../Textarea';\nimport type { TextareaProps } from '../../Textarea';\nimport { FieldBlock } from '../block/field-block';\nimport type { FieldBlockErrorMsgProps } from '../block/field-block-error-msg';\nimport type { FieldBlockHelpTextProps } from '../block/field-block-help-text';\nimport type { FieldBlockLabelProps } from '../block/field-block-label';\nimport type { FieldBlockLayoutProps } from '../block/field-block-layout';\nimport { fieldErrorId } from '../block/field-error-id';\nimport { VisuallyHidden } from '@/ds/primitives/visually-hidden';\n\nexport type TextareaFieldBlockProps = Pick<FieldBlockLayoutProps, 'layout' | 'labelColumnWidth'> &\n Omit<TextareaProps, 'name' | 'size'> & {\n name: string;\n labelIsHidden?: boolean;\n label?: FieldBlockLabelProps['children'];\n labelSize?: FieldBlockLabelProps['size'];\n helpText?: FieldBlockHelpTextProps['children'];\n errorMsg?: FieldBlockErrorMsgProps['children'];\n size?: TextareaProps['size'];\n };\n\n/** @deprecated Use `Field` + `FieldLabel` + `Textarea`. */\nexport function TextareaFieldBlock({\n name,\n label,\n labelIsHidden = false,\n labelColumnWidth,\n helpText,\n error,\n errorMsg,\n required = false,\n disabled = false,\n labelSize,\n layout = 'vertical',\n size = 'md',\n testId,\n className,\n 'aria-describedby': ariaDescribedBy,\n ...props\n}: TextareaFieldBlockProps) {\n const describedBy =\n [ariaDescribedBy, errorMsg ? fieldErrorId(name) : undefined].filter(Boolean).join(' ') || undefined;\n\n return (\n <FieldBlock.Layout layout={layout} labelColumnWidth={labelColumnWidth} className={className}>\n {layout === 'horizontal' ? (\n <FieldBlock.Column>\n <FieldBlock.Label name={name} required={required} disabled={disabled} size={labelSize || 'bigger'}>\n {labelIsHidden ? <VisuallyHidden>{label}</VisuallyHidden> : label}\n </FieldBlock.Label>\n </FieldBlock.Column>\n ) : null}\n <FieldBlock.Column>\n {!labelIsHidden && layout === 'vertical' ? (\n <FieldBlock.Label name={name} required={required} disabled={disabled} size={labelSize || 'default'}>\n {label}\n </FieldBlock.Label>\n ) : null}\n <FieldBlock.Column className=\"gap-1\">\n <Textarea\n id={`input-${name}`}\n name={name}\n disabled={disabled}\n required={required}\n size={size}\n data-testid={testId}\n error={error || Boolean(errorMsg)}\n aria-describedby={describedBy}\n {...props}\n />\n {helpText || errorMsg ? <FieldBlock.Message name={name} helpText={helpText} errorMsg={errorMsg} /> : null}\n </FieldBlock.Column>\n </FieldBlock.Column>\n </FieldBlock.Layout>\n );\n}\n","import type { SelectTriggerProps } from '../../Select/select';\nimport { FieldBlock } from '../block/field-block';\nimport type { FieldBlockErrorMsgProps } from '../block/field-block-error-msg';\nimport type { FieldBlockHelpTextProps } from '../block/field-block-help-text';\nimport type { FieldBlockLabelProps } from '../block/field-block-label';\nimport type { FieldBlockLayoutProps } from '../block/field-block-layout';\nimport { fieldErrorId } from '../block/field-error-id';\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/ds/components/Select';\nimport { VisuallyHidden } from '@/ds/primitives/visually-hidden';\n\nexport type SelectFieldBlockProps = Pick<FieldBlockLayoutProps, 'layout' | 'labelColumnWidth'> &\n Pick<FieldBlockLabelProps, 'name' | 'required'> & {\n testId?: string;\n label?: string | null;\n labelIsHidden?: boolean;\n labelSize?: FieldBlockLabelProps['size'];\n disabled?: boolean;\n value?: string;\n options: { value: string; label: string }[];\n placeholder?: string;\n onValueChange: (value: string) => void;\n helpText?: FieldBlockHelpTextProps['children'];\n errorMsg?: FieldBlockErrorMsgProps['children'];\n error?: boolean;\n className?: string;\n size?: SelectTriggerProps['size'];\n };\n\n/** @deprecated Use `Field` + `FieldLabel` + `Select`. */\nexport function SelectFieldBlock({\n name,\n helpText,\n errorMsg,\n required = false,\n disabled = false,\n size = 'md',\n value,\n label,\n labelIsHidden = false,\n layout = 'vertical',\n labelColumnWidth,\n options,\n placeholder = 'Select an option',\n onValueChange,\n className,\n}: SelectFieldBlockProps) {\n return (\n <FieldBlock.Layout layout={layout} labelColumnWidth={labelColumnWidth} className={className}>\n {layout === 'horizontal' ? (\n <FieldBlock.Column>\n <FieldBlock.Label name={name} required={required} disabled={disabled}>\n {labelIsHidden ? <VisuallyHidden>{label}</VisuallyHidden> : label}\n </FieldBlock.Label>\n </FieldBlock.Column>\n ) : null}\n <FieldBlock.Column>\n {layout === 'vertical' && label && !labelIsHidden ? (\n <FieldBlock.Label name={name} required={required} disabled={disabled}>\n {label}\n </FieldBlock.Label>\n ) : null}\n <FieldBlock.Column className=\"gap-1\">\n <Select\n aria-label={labelIsHidden ? label : undefined}\n name={name}\n value={value}\n onValueChange={onValueChange}\n disabled={disabled}\n >\n <SelectTrigger\n id={`input-${name}`}\n size={size}\n aria-invalid={errorMsg ? true : undefined}\n aria-describedby={errorMsg ? fieldErrorId(name) : undefined}\n >\n <SelectValue placeholder={placeholder} />\n </SelectTrigger>\n <SelectContent>\n {options.map(option => (\n <SelectItem key={option.value} value={option.value}>\n {option.label}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n {helpText || errorMsg ? <FieldBlock.Message name={name} helpText={helpText} errorMsg={errorMsg} /> : null}\n </FieldBlock.Column>\n </FieldBlock.Column>\n </FieldBlock.Layout>\n );\n}\n"],"mappings":";;;;;;;;AAOA,SAAgB,wBAAwB,EAAE,UAAU,aAA2C;CAC7F,OAAO,oBAAC,OAAD;EAAK,WAAW,GAAG,4BAA4B,SAAS;EAAI;CAAc,CAAA;AACnF;;ACAA,SAAgB,sBAAsB,EAAE,UAAU,WAAW,UAAU,GAAG,OAAmC;CAC3G,OACE,oBAAC,OAAD;E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AAlF,UAAA,CACG,WAAW,eACV,oBAAC,WAAW,QAAZ,EAAA,UACE,oBAAC,WAAW,OAAZ;GAAwB;GAAgB;GAAoB;GACzD,UAAA,gBAAgB,oBAAC,gBAAD,EAAA,UAAiB,MAAsB,CAAA,IAAI;EAC5C,CAAA,EACD,CAAA,IACjB,MACJ,qBAAC,WAAW,QAAZ,EAAA,UAAA,CACG,WAAW,cAAc,SAAS,CAAC,gBAClC,oBAAC,WAAW,OAAZ;GAAwB;GAAgB;GAAoB;GACzD,UAAA;EACe,CAAA,IAChB,MACJ,qBAAC,WAAW,QAAZ;GAAmB,WAAU;GAA7B,UAAA,CACE,qBAAC,QAAD;IACE,cAAY,gBAAgB,QAAQ,KAAA;IAC9B;IACC;IACQ;IACL;IALZ,UAAA,CAOE,oBAAC,eAAD;KACE,IAAI,SAAS;KACP;KACN,gBAAc,WAAW,OAAO,KAAA;KAChC,oBAAkB,WAAW,aAAa,IAAI,IAAI,KAAA;KAElD,UAAA,oBAAC,aAAD,EAA0B,YAAc,CAAA;IAC3B,CAAA,GACf,oBAAC,eAAD,EAAA,UACG,QAAQ,KAAI,WACX,oBAAC,YAAD;KAA+B,OAAO,OAAO;KAC1C,UAAA,OAAO;IACE,GAFK,OAAO,KAEZ,CACb,EACY,CAAA,CACT;GACP,CAAA,GAAA,YAAY,WAAW,oBAAC,WAAW,SAAZ;IAA0B;IAAgB;IAAoB;GAAW,CAAA,IAAI,IACpF;EACF,CAAA,CAAA,EAAA,CAAA,CACF;;AAEvB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_input_group = require("../input-group-
|
|
2
|
+
const require_input_group = require("../input-group-BrBYp1gP.cjs");
|
|
3
3
|
exports.InputGroup = require_input_group.InputGroup;
|
|
4
4
|
exports.InputGroupAddon = require_input_group.InputGroupAddon;
|
|
5
5
|
exports.InputGroupButton = require_input_group.InputGroupButton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as InputGroup, n as InputGroupAddon, r as InputGroupButton, i as InputGroupInput, a as InputGroupText, o as InputGroupTextarea, s as inputGroupClassName, c as inputGroupControlClassName } from "../input-group-
|
|
1
|
+
export { t as InputGroup, n as InputGroupAddon, r as InputGroupButton, i as InputGroupInput, a as InputGroupText, o as InputGroupTextarea, s as inputGroupClassName, c as inputGroupControlClassName } from "../input-group-1OAXTPnG.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_rolldown_runtime = require("../rolldown-runtime-CmQyd0Gu.cjs");
|
|
3
3
|
const require_Button = require("../Button-BfICfyxD.cjs");
|
|
4
|
-
const require_input_group = require("../input-group-
|
|
4
|
+
const require_input_group = require("../input-group-BrBYp1gP.cjs");
|
|
5
5
|
const require_icons_Icon = require("../icons/Icon.cjs.js");
|
|
6
6
|
const require_primitives_control_size = require("../primitives/control-size.cjs.js");
|
|
7
7
|
const require_primitives_password_manager_autofill = require("../primitives/password-manager-autofill.cjs.js");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { o as buttonVariants } from "../Button-Bi7aXd_G.js";
|
|
2
|
-
import { c as inputGroupControlClassName, s as inputGroupClassName } from "../input-group-
|
|
2
|
+
import { c as inputGroupControlClassName, s as inputGroupClassName } from "../input-group-1OAXTPnG.js";
|
|
3
3
|
import { Icon } from "../icons/Icon.es.js";
|
|
4
4
|
import { ControlSizeContext, controlHeight } from "../primitives/control-size.es.js";
|
|
5
5
|
import { textFieldAutofillProps } from "../primitives/password-manager-autofill.es.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_DataList = require("../DataList-
|
|
3
|
-
const require_LogsDataList = require("../LogsDataList-
|
|
2
|
+
const require_DataList = require("../DataList-D6UDH7qT.cjs");
|
|
3
|
+
const require_LogsDataList = require("../LogsDataList-Sgcx1aKA.cjs");
|
|
4
4
|
exports.LogsDataList = require_LogsDataList.LogsDataList;
|
|
5
5
|
exports.LogsDataListSkeleton = require_DataList.DataListSkeleton;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { r as DataListSkeleton } from "../DataList-
|
|
2
|
-
import { t as LogsDataList } from "../LogsDataList-
|
|
1
|
+
import { r as DataListSkeleton } from "../DataList-DIGkHZWZ.js";
|
|
2
|
+
import { t as LogsDataList } from "../LogsDataList-DUKQJ9e5.js";
|
|
3
3
|
export { LogsDataList, DataListSkeleton as LogsDataListSkeleton };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_saved_view_schema = require("../saved-view-schema-DRJYELfK.cjs");
|
|
3
3
|
const require_primitives_password_manager_autofill = require("../primitives/password-manager-autofill.cjs.js");
|
|
4
|
-
const require_filter_bar_chip = require("../filter-bar-chip-
|
|
4
|
+
const require_filter_bar_chip = require("../filter-bar-chip-DgdVLscK.cjs");
|
|
5
5
|
const require_Txt = require("../Txt-_00wWxTd.cjs");
|
|
6
6
|
const require_icons_icon_size_classes = require("../icons/icon-size-classes.cjs.js");
|
|
7
7
|
const require_utils = require("../utils-uDc1ofX1.cjs");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as savedViewNameSchema, r as serializeSavedViews, t as parseSavedViews } from "../saved-view-schema-eJXlRRel.js";
|
|
2
2
|
import { passwordManagerOptOutProps } from "../primitives/password-manager-autofill.es.js";
|
|
3
|
-
import { o as FilterBarFieldLabel, u as formatValue } from "../filter-bar-chip-
|
|
3
|
+
import { o as FilterBarFieldLabel, u as formatValue } from "../filter-bar-chip-DBkPWlc-.js";
|
|
4
4
|
import { t as Txt } from "../Txt-5efBsb2p.js";
|
|
5
5
|
import { iconSizeClasses } from "../icons/icon-size-classes.es.js";
|
|
6
6
|
import { t as cn } from "../utils-DQx8TpNT.js";
|
|
@@ -1,53 +1,109 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const
|
|
3
|
-
const
|
|
2
|
+
const require_input_group = require("../input-group-BrBYp1gP.cjs");
|
|
3
|
+
const require_keyboard_use_keydown = require("../keyboard/use-keydown.cjs.js");
|
|
4
4
|
const require_merge_refs = require("../merge-refs-C0BDbPAW.cjs");
|
|
5
5
|
let react = require("react");
|
|
6
6
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
7
|
let lucide_react = require("lucide-react");
|
|
8
|
+
let use_debounce = require("use-debounce");
|
|
8
9
|
// src/ds/components/SearchInput/search-input.tsx
|
|
9
|
-
|
|
10
|
+
/** What the field shows: its own text, or the parent's value unless a draft was typed over it. */
|
|
11
|
+
function shownText({ value, ownText, draft }) {
|
|
12
|
+
if (value === void 0) return ownText;
|
|
13
|
+
if (draft && (draft.over === value || draft.sent === value)) return draft.text;
|
|
14
|
+
return value;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* A search field: an `InputGroup` with a search icon and a clear button, nothing styled of its
|
|
18
|
+
* own. Compose `InputGroup` directly for anything this doesn't cover.
|
|
19
|
+
*/
|
|
20
|
+
function SearchInput({ label, value, defaultValue = "", onValueChange, debounceMs = 0, shortcut = false, onClose, size, className, ref, ...inputProps }) {
|
|
21
|
+
const [ownText, setOwnText] = (0, react.useState)(defaultValue);
|
|
22
|
+
const [draft, setDraft] = (0, react.useState)();
|
|
23
|
+
const sentRef = (0, react.useRef)(void 0);
|
|
24
|
+
const report = (next) => {
|
|
25
|
+
sentRef.current = next;
|
|
26
|
+
onValueChange(next);
|
|
27
|
+
};
|
|
28
|
+
const debouncedChange = (0, use_debounce.useDebouncedCallback)((next) => {
|
|
29
|
+
setDraft(void 0);
|
|
30
|
+
report(next);
|
|
31
|
+
}, debounceMs);
|
|
32
|
+
const text = shownText({
|
|
33
|
+
value,
|
|
34
|
+
ownText,
|
|
35
|
+
draft: debouncedChange.isPending() ? draft : void 0
|
|
36
|
+
});
|
|
37
|
+
const editable = !inputProps.disabled && !inputProps.readOnly;
|
|
38
|
+
const hasButton = Boolean(onClose || text && editable);
|
|
10
39
|
const inputRef = (0, react.useRef)(null);
|
|
11
|
-
|
|
12
|
-
onValueChange("");
|
|
40
|
+
require_keyboard_use_keydown.useKeydown({ "mod+shift+f": () => {
|
|
13
41
|
inputRef.current?.focus();
|
|
42
|
+
inputRef.current?.select();
|
|
43
|
+
} }, { enabled: shortcut });
|
|
44
|
+
(0, react.useEffect)(() => () => debouncedChange.cancel(), [debouncedChange]);
|
|
45
|
+
(0, react.useEffect)(() => {
|
|
46
|
+
if (value !== void 0 && value === sentRef.current) {
|
|
47
|
+
sentRef.current = void 0;
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
sentRef.current = void 0;
|
|
51
|
+
debouncedChange.cancel();
|
|
52
|
+
}, [value, debouncedChange]);
|
|
53
|
+
const change = (next) => {
|
|
54
|
+
setOwnText(next);
|
|
55
|
+
if (next && debounceMs > 0) {
|
|
56
|
+
if (value !== void 0) setDraft({
|
|
57
|
+
text: next,
|
|
58
|
+
over: value,
|
|
59
|
+
sent: sentRef.current
|
|
60
|
+
});
|
|
61
|
+
debouncedChange(next);
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
setDraft(void 0);
|
|
65
|
+
debouncedChange.cancel();
|
|
66
|
+
report(next);
|
|
14
67
|
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
onClose?.();
|
|
18
|
-
};
|
|
19
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_components_Field.Field, {
|
|
68
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_input_group.InputGroup, {
|
|
69
|
+
size,
|
|
20
70
|
className,
|
|
21
|
-
children: [
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.XIcon, {})
|
|
45
|
-
})
|
|
71
|
+
children: [
|
|
72
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_input_group.InputGroupAddon, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.SearchIcon, {}) }),
|
|
73
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_input_group.InputGroupInput, {
|
|
74
|
+
...inputProps,
|
|
75
|
+
ref: require_merge_refs.mergeRefs(inputRef, ref),
|
|
76
|
+
type: "search",
|
|
77
|
+
"aria-label": label,
|
|
78
|
+
value: text,
|
|
79
|
+
onChange: (event) => change(event.target.value)
|
|
80
|
+
}),
|
|
81
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_input_group.InputGroupAddon, {
|
|
82
|
+
align: "inline-end",
|
|
83
|
+
"aria-hidden": !hasButton,
|
|
84
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_input_group.InputGroupButton, {
|
|
85
|
+
"aria-label": onClose ? "Close search" : "Clear search",
|
|
86
|
+
className: hasButton ? void 0 : "invisible",
|
|
87
|
+
inert: !hasButton,
|
|
88
|
+
onClick: () => {
|
|
89
|
+
if (editable) change("");
|
|
90
|
+
if (onClose) onClose();
|
|
91
|
+
else inputRef.current?.focus();
|
|
92
|
+
},
|
|
93
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.XIcon, {})
|
|
46
94
|
})
|
|
47
|
-
|
|
48
|
-
|
|
95
|
+
})
|
|
96
|
+
]
|
|
49
97
|
});
|
|
50
98
|
}
|
|
99
|
+
// src/ds/components/SearchInput/list-search-props.ts
|
|
100
|
+
/** A list page's search: the toolbar size, typing reported after a pause, and Cmd/Ctrl+Shift+F. */
|
|
101
|
+
var listSearchProps = {
|
|
102
|
+
size: "sm",
|
|
103
|
+
debounceMs: 300,
|
|
104
|
+
shortcut: true
|
|
105
|
+
};
|
|
51
106
|
exports.SearchInput = SearchInput;
|
|
107
|
+
exports.listSearchProps = listSearchProps;
|
|
52
108
|
|
|
53
109
|
//# sourceMappingURL=SearchInput.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchInput.cjs.js","names":["
|
|
1
|
+
{"version":3,"file":"SearchInput.cjs.js","names":["useState","useRef","useDebouncedCallback","InputGroup","InputGroupAddon","SearchIcon","InputGroupInput","mergeRefs","InputGroupButton","XIcon"],"sources":["../../src/ds/components/SearchInput/search-input.tsx","../../src/ds/components/SearchInput/list-search-props.ts"],"sourcesContent":["import { SearchIcon, XIcon } from 'lucide-react';\nimport { useEffect, useRef, useState } from 'react';\nimport type { Ref } from 'react';\nimport { useDebouncedCallback } from 'use-debounce';\nimport { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from '@/ds/components/InputGroup';\nimport type { InputGroupInputProps, InputGroupProps } from '@/ds/components/InputGroup';\nimport { useKeydown } from '@/lib/keyboard';\nimport { mergeRefs } from '@/lib/merge-refs';\n\ntype SearchInputBaseProps = Omit<\n InputGroupInputProps,\n 'value' | 'defaultValue' | 'onChange' | 'type' | 'ref' | 'error'\n> & {\n /** The field's accessible name. */\n label: string;\n /** Called with the text as it changes; with `debounceMs`, after the pause and right away when cleared. */\n onValueChange: (value: string) => void;\n /** Cmd/Ctrl+Shift+F focuses the field. Give it to the one main search of a page. */\n shortcut?: boolean;\n /** Shows a Close button that clears the text and calls this, e.g. to collapse the search. */\n onClose?: () => void;\n size?: InputGroupProps['size'];\n className?: string;\n ref?: Ref<HTMLInputElement>;\n};\n\n/**\n * Controlled by `value` (it follows every change the parent makes, e.g. a URL change or a Reset)\n * or keeping its own text from `defaultValue`. Either way `debounceMs` delays `onValueChange`\n * while typing; a controlled field shows what was typed until the parent's value moves.\n */\nexport type SearchInputProps = SearchInputBaseProps &\n ({ value: string; defaultValue?: never } | { value?: never; defaultValue?: string }) & {\n debounceMs?: number;\n };\n\n/**\n * Typed text waiting on the debounce, the parent's value it was typed over, and the search this\n * field had already sent then (the parent may still be applying it, e.g. through the URL).\n */\ntype Draft = { text: string; over: string; sent?: string };\n\n/** What the field shows: its own text, or the parent's value unless a draft was typed over it. */\nfunction shownText({ value, ownText, draft }: { value?: string; ownText: string; draft?: Draft }) {\n if (value === undefined) return ownText;\n if (draft && (draft.over === value || draft.sent === value)) return draft.text;\n return value;\n}\n\n/**\n * A search field: an `InputGroup` with a search icon and a clear button, nothing styled of its\n * own. Compose `InputGroup` directly for anything this doesn't cover.\n */\nexport function SearchInput({\n label,\n value,\n defaultValue = '',\n onValueChange,\n debounceMs = 0,\n shortcut = false,\n onClose,\n size,\n className,\n ref,\n ...inputProps\n}: SearchInputProps) {\n const [ownText, setOwnText] = useState(defaultValue);\n // Typed text waiting on the debounce, and the parent's value it was typed over. It shows only\n // while its search is still pending and that value hasn't moved: once the search is applied,\n // cancelled, or the parent changes the value some other way, the field follows the parent.\n const [draft, setDraft] = useState<Draft>();\n // The last search this field sent and the parent hasn't applied yet.\n const sentRef = useRef<string>(undefined);\n const report = (next: string) => {\n sentRef.current = next;\n onValueChange(next);\n };\n const debouncedChange = useDebouncedCallback((next: string) => {\n setDraft(undefined);\n report(next);\n }, debounceMs);\n const text = shownText({ value, ownText, draft: debouncedChange.isPending() ? draft : undefined });\n const editable = !inputProps.disabled && !inputProps.readOnly;\n const hasButton = Boolean(onClose || (text && editable));\n const inputRef = useRef<HTMLInputElement>(null);\n\n useKeydown(\n {\n 'mod+shift+f': () => {\n inputRef.current?.focus();\n inputRef.current?.select();\n },\n },\n { enabled: shortcut },\n );\n\n useEffect(() => () => debouncedChange.cancel(), [debouncedChange]);\n\n // When the parent's value moves, a search still waiting on the debounce is stale (a Reset or URL\n // change replaced the text) unless the parent is only applying what this field already sent.\n useEffect(() => {\n if (value !== undefined && value === sentRef.current) {\n sentRef.current = undefined;\n return;\n }\n sentRef.current = undefined;\n debouncedChange.cancel();\n }, [value, debouncedChange]);\n\n const change = (next: string) => {\n setOwnText(next);\n if (next && debounceMs > 0) {\n if (value !== undefined) setDraft({ text: next, over: value, sent: sentRef.current });\n debouncedChange(next);\n return;\n }\n setDraft(undefined);\n debouncedChange.cancel();\n report(next);\n };\n\n return (\n <InputGroup size={size} className={className}>\n <InputGroupAddon>\n <SearchIcon />\n </InputGroupAddon>\n <InputGroupInput\n {...inputProps}\n ref={mergeRefs(inputRef, ref)}\n type=\"search\"\n aria-label={label}\n value={text}\n onChange={event => change(event.target.value)}\n />\n {/* Always rendered so the field keeps its width when text appears (it can be sized by its\n content, e.g. joined in a ButtonsGroup). While empty only the button hides, so a click on\n its spot still lands on the addon, which focuses the input. */}\n <InputGroupAddon align=\"inline-end\" aria-hidden={!hasButton}>\n <InputGroupButton\n aria-label={onClose ? 'Close search' : 'Clear search'}\n className={hasButton ? undefined : 'invisible'}\n inert={!hasButton}\n onClick={() => {\n if (editable) change('');\n if (onClose) onClose();\n else inputRef.current?.focus();\n }}\n >\n <XIcon />\n </InputGroupButton>\n </InputGroupAddon>\n </InputGroup>\n );\n}\n","import type { SearchInputProps } from './search-input';\n\n/** A list page's search: the toolbar size, typing reported after a pause, and Cmd/Ctrl+Shift+F. */\nexport const listSearchProps = {\n size: 'sm',\n debounceMs: 300,\n shortcut: true,\n} as const satisfies Pick<SearchInputProps, 'size' | 'debounceMs' | 'shortcut'>;\n"],"mappings":";;;;;;;;;;AA2CA,SAAS,UAAU,EAAE,OAAO,SAAS,SAA6D;CAChG,IAAI,UAAU,KAAA,GAAW,OAAO;CAChC,IAAI,UAAU,MAAM,SAAS,SAAS,MAAM,SAAS,QAAQ,OAAO,MAAM;CAC1E,OAAO;AACT;;;;;AAMA,SAAgB,YAAY,EAC1B,OACA,OAC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