import * as react_jsx_runtime from 'react/jsx-runtime'; import * as react from 'react'; import react__default, { ReactNode, PropsWithChildren } from 'react'; import * as react_hook_form from 'react-hook-form'; import { FieldValues, UseFormReturn, FieldPath, ControllerProps } from 'react-hook-form'; import { T as TabDefinition } from './constants-CBhKGpBZ.js'; export { P as PRODUCT_DETAIL_FIELDS, a as PRODUCT_DETAIL_QUERY, d as defineTabMeta } from './constants-CBhKGpBZ.js'; import { Label, Slot } from 'radix-ui'; import * as _tanstack_react_table from '@tanstack/react-table'; import { Table, ColumnDef, Row, RowSelectionState, OnChangeFn } from '@tanstack/react-table'; export { PermissionGuard, PermissionGuardProps, PermissionsProvider, PermissionsRequirement, PermissionsRequirementProps, PermissionsRequirementsProvider, RequiredPermissionsSection, RoutePermissionGuard, usePermissions, useRegisterPermissions, useRequiredPermissions, useResourcePermissions } from '@mercurjs/dashboard-shared'; export { Permission, PermissionOperation, PermissionRequirement, PermissionResource, RouteHandle, UserPolicy } from '@mercurjs/dashboard-sdk'; declare function App(): react_jsx_runtime.JSX.Element; declare const useTabbedForm: () => UseFormReturn; type FooterRenderProps = { isLastTab: boolean; onNext: () => void; isLoading?: boolean; }; type TabbedFormProps = { form: UseFormReturn; onSubmit: (e?: React.BaseSyntheticEvent) => void; children: ReactNode; isLoading?: boolean; footer?: (props: FooterRenderProps) => ReactNode; transformTabs?: (tabs: TabDefinition[]) => TabDefinition[]; model?: string; zone?: string; }; declare function Root({ form, onSubmit, children, isLoading, footer, transformTabs, }: TabbedFormProps): react_jsx_runtime.JSX.Element; declare const TabbedForm: typeof Root & { Tab: ({ children, }: { id: string; label: string; children?: ReactNode; }) => react_jsx_runtime.JSX.Element; useForm: () => UseFormReturn; }; declare const Form: ((props: react_hook_form.FormProviderProps) => react__default.JSX.Element) & { Item: react__default.ForwardRefExoticComponent & react__default.RefAttributes>; Label: react__default.ForwardRefExoticComponent, "ref"> & { optional?: boolean; tooltip?: ReactNode; icon?: ReactNode; } & react__default.RefAttributes>; Control: react__default.ForwardRefExoticComponent, "ref"> & react__default.RefAttributes>; Hint: react__default.ForwardRefExoticComponent & react__default.RefAttributes>; ErrorMessage: react__default.ForwardRefExoticComponent & react__default.RefAttributes>; Field: = FieldPath>({ ...props }: ControllerProps) => react_jsx_runtime.JSX.Element; }; interface HeadlessControllerProps = FieldPath> extends Omit, "render"> { } interface SwitchBoxProps = FieldPath> extends HeadlessControllerProps { label: string; description: string; optional?: boolean; tooltip?: ReactNode; /** * Callback for performing additional actions when the checked state changes. * This does not intercept the form control, it is only used for injecting side-effects. */ onCheckedChange?: (checked: boolean) => void; } /** * Wrapper for the Switch component to be used with `react-hook-form`. * * Use this component whenever a design calls for wrapping the Switch component * in a container with a label and description. */ declare const SwitchBox: = FieldPath>({ label, description, optional, tooltip, onCheckedChange, ...props }: SwitchBoxProps) => react_jsx_runtime.JSX.Element; interface FileType { id: string; url: string; file: File; } interface FileUploadProps { label: string; multiple?: boolean; hint?: string; hasError?: boolean; formats: string[]; onUploaded: (files: FileType[]) => void; onRemove?: () => void; uploadedImage?: string | null; fileName?: string; fileSize?: number; } declare const FileUpload: ({ label, hint, multiple, hasError, formats, onUploaded, onRemove, uploadedImage, fileName, fileSize, }: FileUploadProps) => react_jsx_runtime.JSX.Element; type ChipInputProps = { value?: string[]; onChange?: (value: string[]) => void; onBlur?: () => void; name?: string; disabled?: boolean; allowDuplicates?: boolean; showRemove?: boolean; variant?: "base" | "contrast"; placeholder?: string; className?: string; }; declare const ChipInput: react.ForwardRefExoticComponent>; type NoResultsProps = { title?: string; message?: string; className?: string; icon?: react__default.ReactNode; }; type ActionProps = { action?: { to: string; label: string; }; dataTestId?: string; }; type NoRecordsProps = { title?: string; message?: string; className?: string; buttonVariant?: string; icon?: react__default.ReactNode; } & ActionProps; type DataTableOrderByKey = { key: keyof TData; label: string; }; interface DataTableQueryProps { search?: boolean | "autofocus"; orderBy?: DataTableOrderByKey[]; defaultOrder?: string; filters?: Filter[]; prefix?: string; toolbarActions?: ReactNode; } type BulkCommand = { label: string; shortcut: string; action: (selection: Record) => Promise; }; interface DataTableRootProps { /** * The table instance to render */ table: Table; /** * The columns to render */ columns: ColumnDef[]; /** * Function to generate a link to navigate to when clicking on a row */ navigateTo?: (row: Row) => string; /** * Called when a row is clicked. Only fires for rows without a `navigateTo` * link, so it can drive non-navigation interactions like expanding a group. */ onRowClick?: (row: Row) => void; /** * Bulk actions to render */ commands?: BulkCommand[]; /** * The total number of items in the table */ count?: number; /** * Whether to display pagination controls */ pagination?: boolean; /** * Whether the table is empty due to no results from the active query */ noResults?: boolean; /** * Content overrides (title/message/icon) for the no-results empty state */ noResultsProps?: Pick; /** * Whether to display the tables header */ noHeader?: boolean; /** * The layout of the table */ layout?: "fill" | "fit"; } interface DataTableProps extends Omit, "noResults" | "noResultsProps">, DataTableQueryProps { isLoading?: boolean; pageSize: number; queryObject?: Record; noRecords?: Pick; noResults?: Pick; } /** * @deprecated Use the DataTable component from "/components/data-table" instead */ declare const _DataTable: ({ table, columns, pagination, navigateTo, onRowClick, commands, count, search, orderBy, defaultOrder, filters, prefix, queryObject, pageSize, isLoading, noHeader, layout, noRecords: noRecordsProps, noResults: noResultsProps, toolbarActions, }: DataTableProps) => react_jsx_runtime.JSX.Element; type Option = { label: string; value: unknown; }; type Filter = { key: string; label: string; } & ({ type: "select"; options: Option[]; multiple?: boolean; searchable?: boolean; } | { type: "date"; options?: never; } | { type: "string"; options?: never; } | { type: "number"; options?: never; }); type UseDataTableProps = { data?: TData[]; columns: ColumnDef[]; count?: number; pageSize?: number; enableRowSelection?: boolean | ((row: Row) => boolean); rowSelection?: { state: RowSelectionState; updater: OnChangeFn; }; enablePagination?: boolean; enableExpandableRows?: boolean; getRowId?: (original: TData, index: number) => string; getSubRows?: (original: TData) => TData[]; meta?: Record; prefix?: string; }; declare const useDataTable: ({ data, columns, count, pageSize: _pageSize, enablePagination, enableRowSelection, enableExpandableRows, rowSelection: _rowSelection, getSubRows, getRowId, meta, prefix, }: UseDataTableProps) => { table: _tanstack_react_table.Table; }; interface PageProps { children: ReactNode; data?: TData; showJSON?: boolean; showMetadata?: boolean; hasOutlet?: boolean; } declare const SingleColumnPage: ({ children, data, hasOutlet, showJSON, showMetadata, }: PageProps) => react_jsx_runtime.JSX.Element; type Action = { icon: ReactNode; label: string; disabled?: boolean; /** * Optional tooltip to display when a disabled action is hovered. */ disabledTooltip?: string | ReactNode; } & ({ to: string; onClick?: never; } | { onClick: () => void; to?: never; }); type ActionGroup = { actions: Action[]; }; type ActionMenuProps = PropsWithChildren<{ groups: ActionGroup[]; variant?: "transparent" | "primary"; }>; declare const ActionMenu: ({ groups, variant, children, }: ActionMenuProps) => react_jsx_runtime.JSX.Element; declare const Notifications: () => react_jsx_runtime.JSX.Element; export { ActionMenu, ChipInput, _DataTable as DataTable, type FileType, FileUpload, type FileUploadProps, type Filter, Form, Notifications, SingleColumnPage, SwitchBox, TabDefinition, TabbedForm, App as default, useDataTable, useTabbedForm };