import * as react from 'react'; import react__default, { ReactNode, PropsWithChildren, ComponentPropsWithoutRef, ForwardRefExoticComponent, PropsWithoutRef, ComponentProps, RefAttributes, ElementRef } from 'react'; import { L as LayoutControlSize, a as LayoutComponentProps } from './types-DYXLoDeW.mjs'; import { Layouts, SectionNameFor } from '@medusajs/admin-shared'; import { TableAdapter } from './lib.mjs'; import { Tooltip, Input, DataTableColumnDef, DataTableFilter, DataTableCommand, DataTableEmptyStateProps, DataTableRowSelectionState, DataTableRow, Drawer, FocusModal } from '@medusajs/ui'; import * as react_hook_form from 'react-hook-form'; import { FieldValues, FieldPath, ControllerProps, UseFormReturn } from 'react-hook-form'; import { Label, Slot } from 'radix-ui'; import { CellContext, Row, ColumnDef, ColumnDefTemplate, HeaderContext } from '@tanstack/react-table'; import * as _tanstack_table_core from '@tanstack/table-core'; import { HttpTypes, SalesChannelDTO } from '@medusajs/types'; import { TFunction } from 'i18next'; import { Path } from 'react-router-dom'; type LayoutEntryProps = { /** Stable identity for this entry. Survives component renames and minification. */ id: string; children: ReactNode; }; /** * Pins a stable identity to a layout entry. Use this to wrap sections whose * component name is unstable (subject to rename or minification), ensuring * any saved user preferences survive refactors. */ declare function LayoutEntry({ children }: LayoutEntryProps): react.JSX.Element; declare namespace LayoutEntry { var displayName: string; } type LayoutComposerProps$1 = { /** * The prefix used to derive widget injection zones, typically corresponds to the page. * E.g. `"login"`, `"product.list"`, `"product.details"` etc. */ widgetsZonePrefix: string; /** * The id of the layout that should be used to render the page. E.g `"core:two-column"` or `"core:single-column"`. */ preferredLayoutId: TLayoutId; /** * The content to render in each section of the layout, keyed by the * section names valid for `preferredLayoutId`. */ sections: Record, ReactNode>; /** * Data passed to the layout components(core + widgets) as props */ data?: TData; /** * Whether to render an `Outlet` after the layout, used to render modals such as drawers and dialogs. * * @default true */ hasOutlet?: boolean; /** * Stable id of the host this composer customizes (see `CUSTOMIZE_IDS`). The * central `CustomizerMenu` lists it and, when chosen, drives this composer * into edit mode. Composers for different hosts must use distinct ids; only * one composer per id is mounted at a time. * * @default CUSTOMIZE_IDS.PAGE */ customizeId?: string; /** * Visual density of each entry's edit-mode overlay. * @default "default" */ controlSize?: LayoutControlSize; /** * Skip widget injection zones entirely: no registered widgets are resolved * for `widgetsZonePrefix`, so only the core `sections` entries are composed. * Used by surfaces that are purely reorderable nav (e.g. the sidebars) where * extensions shouldn't inject content. * * @default false */ disableWidgets?: boolean; /** * Optional props to pass to the layout component. */ layoutProps?: Omit; }; type DataTableActionProps$1 = { label: string; disabled?: boolean; } & ({ to: string; } | { onClick: () => void; }); interface ConfigurableDataTableProps { adapter: TableAdapter; heading?: string; subHeading?: string; pageSize?: number; queryPrefix?: string; layout?: "fill" | "auto"; actions?: DataTableActionProps$1[]; } declare function ConfigurableDataTable({ adapter, heading, subHeading, pageSize: pageSizeProp, queryPrefix: queryPrefixProp, layout, actions, }: ConfigurableDataTableProps): react.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.Element; type ConditionalTooltipProps = PropsWithChildren & { showTooltip?: boolean; }>; declare const ConditionalTooltip: ({ children, showTooltip, ...props }: ConditionalTooltipProps) => string | number | boolean | Iterable | react.JSX.Element | null | undefined; type DisplayIdProps = { id: string; className?: string; }; declare function DisplayId({ id, className }: DisplayIdProps): react.JSX.Element; declare const Form: (({ children, watch, getValues, getFieldState, setError, clearErrors, setValue, setValues, trigger, formState, resetField, reset, resetDefaultValues, handleSubmit, unregister, control, register, setFocus, subscribe, }: 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__default.JSX.Element; }; type IconAvatarProps = PropsWithChildren<{ className?: string; size?: "small" | "large" | "xlarge"; variant?: "squared" | "rounded"; }>; /** * Use this component when a design calls for an avatar with an icon. * * The `` component from `@medusajs/ui` does not support passing an icon as a child. */ declare const IconAvatar: ({ size, variant, children, className, }: IconAvatarProps) => react.JSX.Element; type JsonViewSectionProps = { data: object; title?: string; }; declare const JsonViewSection: ({ data }: JsonViewSectionProps) => react.JSX.Element; interface ListicleProps { labelKey: string; descriptionKey: string; children?: ReactNode; } declare const Listicle: ({ labelKey, descriptionKey, children, }: ListicleProps) => react.JSX.Element; type NoResultsProps = { title?: string; message?: string; className?: string; }; declare const NoResults: ({ title, message, className }: NoResultsProps) => react__default.JSX.Element; type ActionProps = { action?: { to: string; label: string; }; }; type NoRecordsProps = { title?: string; message?: string; className?: string; buttonVariant?: string; icon?: react__default.ReactNode; } & ActionProps; declare const NoRecords: ({ title, message, action, className, buttonVariant, icon, }: NoRecordsProps) => react__default.JSX.Element; type SectionRowProps = { title: string; value?: ReactNode | string | null; actions?: ReactNode; }; declare const SectionRow: ({ title, value, actions }: SectionRowProps) => react.JSX.Element; interface SidebarLinkProps { to: string; labelKey: string; descriptionKey: string; icon: ReactNode; } declare const SidebarLink: ({ to, labelKey, descriptionKey, icon, }: SidebarLinkProps) => react.JSX.Element; type ThumbnailProps = { src?: string | null; alt?: string; size?: "small" | "base"; }; declare const Thumbnail: ({ src, alt, size }: ThumbnailProps) => react.JSX.Element; /** * A form that can only be submitted when using the meta or control key. */ declare const KeyboundForm: react__default.ForwardRefExoticComponent & react__default.RefAttributes>; type ComboboxOption = { value: string; label: string; disabled?: boolean; }; type Value = string[] | string; interface ComboboxProps extends Omit, "onChange" | "value"> { value?: T; onChange?: (value?: T) => void; searchValue?: string; onSearchValueChange?: (value: string) => void; options: ComboboxOption[]; fetchNextPage?: () => void; isFetchingNextPage?: boolean; onCreateOption?: (value: string) => void; shouldAlwaysShowCreateOption?: boolean; noResultsPlaceholder?: ReactNode; allowClear?: boolean; forceHideInput?: boolean; displayMode?: "count" | "chips"; } declare const Combobox: (props: ComboboxProps & react.RefAttributes) => ReactNode; declare const CountrySelect: react.ForwardRefExoticComponent & react.RefAttributes, "ref">, "options" | "value" | "onChange" | "multiple"> & { placeholder?: string; defaultValue?: string; allowClear?: boolean; value?: string; onChange?: (value: string | undefined) => void; } & react.RefAttributes>; type HandleInputProps = ComponentProps; declare const HandleInput: ForwardRefExoticComponent & RefAttributes>>; type VisibilityState = Record; type ColumnOrderState = string[]; type DataTableActionProps = { label: string; disabled?: boolean; tooltip?: ReactNode; } & ({ to: string; } | { onClick: () => void; }); type DataTableActionMenuActionProps = { label: string; icon: ReactNode; disabled?: boolean; } & ({ to: string; } | { onClick: () => void; }); type DataTableActionMenuGroupProps = { actions: DataTableActionMenuActionProps[]; }; type DataTableActionMenuProps = { groups: DataTableActionMenuGroupProps[]; }; interface DataTableProps { data?: TData[]; columns: DataTableColumnDef[]; filters?: DataTableFilter[]; commands?: DataTableCommand[]; action?: DataTableActionProps; actions?: DataTableActionProps[]; actionMenu?: DataTableActionMenuProps; rowCount?: number; getRowId: (row: TData) => string; enablePagination?: boolean; enableSearch?: boolean; autoFocusSearch?: boolean; rowHref?: (row: TData) => string; emptyState?: DataTableEmptyStateProps; heading?: string; headingLevel?: "h1" | "h2" | "h3"; subHeading?: string; prefix?: string; pageSize?: number; isLoading?: boolean; rowSelection?: { state: DataTableRowSelectionState; onRowSelectionChange: (value: DataTableRowSelectionState) => void; enableRowSelection?: boolean | ((row: DataTableRow) => boolean); }; layout?: "fill" | "auto"; enableColumnVisibility?: boolean; initialColumnVisibility?: VisibilityState; onColumnVisibilityChange?: (visibility: VisibilityState) => void; columnOrder?: ColumnOrderState; onColumnOrderChange?: (order: ColumnOrderState) => void; enableViewSelector?: boolean; entity?: string; currentColumns?: { visible: string[]; order: string[]; }; filterBarContent?: react__default.ReactNode; } declare const DataTable: ({ data, columns, filters, commands, action, actions, actionMenu, getRowId, rowCount, enablePagination, enableSearch, autoFocusSearch, rowHref, heading, headingLevel, subHeading, prefix, pageSize, emptyState, rowSelection, isLoading, layout, enableColumnVisibility, initialColumnVisibility, onColumnVisibilityChange, columnOrder, onColumnOrderChange, enableViewSelector, entity, currentColumns, filterBarContent, }: DataTableProps) => react__default.JSX.Element; type DataGridColumnType = "text" | "multiline-text" | "number" | "boolean" | "togglable-number"; interface DataGridCellProps { context: CellContext; } type FieldContext = { row: Row; column: ColumnDef; }; type FieldFunction = (context: FieldContext) => FieldPath | null; interface DataGridCurrencyCellProps extends DataGridCellProps { code: string; } interface DataGridRootProps { data?: TData[]; columns: ColumnDef[]; state: UseFormReturn; getSubRows?: (row: TData) => TData[] | undefined; onEditingChange?: (isEditing: boolean) => void; disableInteractions?: boolean; multiColumnSelection?: boolean; showColumnsDropdown?: boolean; /** * Custom content to render in the header, positioned between the column visibility * controls and the error/shortcuts section. */ headerContent?: ReactNode; /** * Lazy loading props - when totalRowCount is provided, the grid enters lazy loading mode. * In this mode, the virtualizer will size based on totalRowCount and trigger onFetchMore * when the user scrolls near the end of loaded data. */ /** Total count of rows for scroll sizing (enables lazy loading mode when provided) */ totalRowCount?: number; /** Called when more data should be fetched */ onFetchMore?: () => void; /** Whether more data is currently being fetched */ isFetchingMore?: boolean; /** Whether there is more data to fetch */ hasNextPage?: boolean; } interface DataGridProps extends DataGridRootProps { isLoading?: boolean; } declare const DataGrid: (({ isLoading, totalRowCount, onFetchMore, isFetchingMore, hasNextPage, ...props }: DataGridProps) => react.JSX.Element) & { BooleanCell: ({ context, disabled, }: DataGridCellProps & { disabled?: boolean; }) => react.JSX.Element; TextCell: ({ context, }: DataGridCellProps) => react.JSX.Element; MultilineCell: ({ context, }: DataGridCellProps) => react.JSX.Element; ExpandableTextCell: ({ context, fieldLabel, }: DataGridCellProps & { fieldLabel?: string; }) => react.JSX.Element; NumberCell: ({ context, ...rest }: DataGridCellProps & { min?: number; max?: number; placeholder?: string; }) => react.JSX.Element; CurrencyCell: ({ context, code, }: DataGridCurrencyCellProps) => react.JSX.Element; ReadonlyCell: ({ context, color, children, isMultiLine, }: DataGridCellProps & { children?: react.ReactNode | undefined; } & { color?: "muted" | "normal"; isMultiLine?: boolean; }) => react.JSX.Element; }; type DataGridHelperColumnsProps = { /** * The id of the column. */ id: string; /** * The name of the column, shown in the column visibility menu. */ name?: string; /** * The header template for the column. */ header: ColumnDefTemplate> | undefined; /** * The cell template for the column. */ cell: ColumnDefTemplate> | undefined; /** * Callback to set the field path for each cell in the column. * If a callback is not provided, or returns null, the cell will not be editable. */ field?: FieldFunction; /** * Whether the column cannot be hidden by the user. * * @default false */ disableHiding?: boolean; /** * The size of the column in pixels. */ size?: number; /** * The minimum size of the column in pixels. */ minSize?: number; /** * The maximum size of the column in pixels. */ maxSize?: number; } & ({ field: FieldFunction; type: DataGridColumnType; } | { field?: null | undefined; type?: never; }); declare function createDataGridHelper(): { column: ({ id, name, header, cell, disableHiding, field, type, size, minSize, maxSize, }: DataGridHelperColumnsProps) => _tanstack_table_core.DisplayColumnDef; }; type CreateDataGridPriceColumnsProps = { currencies?: string[]; regions?: HttpTypes.AdminRegion[]; pricePreferences?: HttpTypes.AdminPricePreference[]; isReadyOnly?: (context: FieldContext) => boolean; renderPriceCell?: (code: string, context: CellContext) => ReactNode; getFieldName: (context: FieldContext, value: string) => FieldPath | null; t: TFunction; }; declare const createDataGridPriceColumns: ({ currencies, regions, pricePreferences, isReadyOnly, renderPriceCell, getFieldName, t, }: CreateDataGridPriceColumnsProps) => ColumnDef[]; type ProductCellProps = { product: Pick; }; declare const ProductCell: ({ product }: ProductCellProps) => react.JSX.Element; declare const ProductHeader: () => react.JSX.Element; type ProductStatusCellProps = { status?: HttpTypes.AdminProductStatus; }; declare const ProductStatusCell: ({ status }: ProductStatusCellProps) => react.JSX.Element; declare const ProductStatusHeader: () => react.JSX.Element; type SalesChannelsCellProps = { salesChannels?: SalesChannelDTO[] | null; }; declare const SalesChannelsCell: ({ salesChannels, }: SalesChannelsCellProps) => react.JSX.Element; declare const SalesChannelHeader: () => react.JSX.Element; type VariantCellProps = { variants?: HttpTypes.AdminProductVariant[] | null; }; declare const VariantCell: ({ variants }: VariantCellProps) => react.JSX.Element; declare const VariantHeader: () => react.JSX.Element; type RouteModalFormProps = PropsWithChildren<{ form: UseFormReturn; blockSearchParams?: boolean; onClose?: (isSubmitSuccessful: boolean) => void; }>; declare const RouteModalForm: ({ form, blockSearchParams: blockSearch, children, onClose, }: RouteModalFormProps) => react.JSX.Element; type RouteDrawerProps = PropsWithChildren<{ prev?: string | Partial | number; }>; declare const Root$3: ({ prev, children }: RouteDrawerProps) => react.JSX.Element; /** * Drawer that is used to render a form on a separate route. * * Typically used for forms editing a resource. */ type RouteDrawerComponent = typeof Root$3 & { Header: typeof Drawer.Header; Title: typeof Drawer.Title; Body: typeof Drawer.Body; Description: typeof Drawer.Description; Footer: typeof Drawer.Footer; Close: typeof Drawer.Close; Form: typeof RouteModalForm; }; declare const RouteDrawer: RouteDrawerComponent; type RouteFocusModalProps = PropsWithChildren<{ prev?: string | Partial | number; }>; declare const Root$2: ({ prev, children }: RouteFocusModalProps) => react.JSX.Element; /** * FocusModal that is used to render a form on a separate route. * * Typically used for forms creating a resource or forms that require * a lot of space. */ type RouteFocusModalComponent = typeof Root$2 & { Header: typeof FocusModal.Header; Title: typeof FocusModal.Title; Body: typeof FocusModal.Body; Description: typeof FocusModal.Description; Footer: typeof FocusModal.Footer; Close: typeof FocusModal.Close; Form: typeof RouteModalForm; }; declare const RouteFocusModal: RouteFocusModalComponent; declare const useRouteModal: () => { handleSuccess: (path?: string) => void; setCloseOnEscape: (value: boolean) => void; __internal: { closeOnEscape: boolean; }; }; type StackedDrawerProps = PropsWithChildren<{ /** * A unique identifier for the modal. This is used to differentiate stacked modals, * when multiple stacked modals are registered to the same parent modal. */ id: string; }>; /** * A stacked modal that can be rendered above a parent modal. */ declare const Root$1: ({ id, children }: StackedDrawerProps) => react.JSX.Element; type StackedDrawerContentProps = ComponentPropsWithoutRef; declare const Content$1: ForwardRefExoticComponent & RefAttributes>; type StackedDrawerComponent = typeof Root$1 & { Close: typeof Drawer.Close; Header: typeof Drawer.Header; Body: typeof Drawer.Body; Content: typeof Content$1; Trigger: typeof Drawer.Trigger; Footer: typeof Drawer.Footer; Description: typeof Drawer.Description; Title: typeof Drawer.Title; }; declare const StackedDrawer: StackedDrawerComponent; type StackedFocusModalProps = PropsWithChildren<{ /** * A unique identifier for the modal. This is used to differentiate stacked modals, * when multiple stacked modals are registered to the same parent modal. */ id: string; /** * An optional callback that is called when the modal is opened or closed. */ onOpenChangeCallback?: (open: boolean) => void; }>; /** * A stacked modal that can be rendered above a parent modal. */ declare const Root: ({ id, onOpenChangeCallback, children, }: StackedFocusModalProps) => react.JSX.Element; type StackedFocusModalContentProps = ComponentPropsWithoutRef; declare const Content: ForwardRefExoticComponent & RefAttributes>; type StackedFocusModalComponent = typeof Root & { Close: typeof FocusModal.Close; Header: typeof FocusModal.Header; Body: typeof FocusModal.Body; Content: typeof Content; Trigger: typeof FocusModal.Trigger; Footer: typeof FocusModal.Footer; Description: typeof FocusModal.Description; Title: typeof FocusModal.Title; }; declare const StackedFocusModal: StackedFocusModalComponent; declare const useStackedModal: () => { getIsOpen: (id: string) => boolean; setIsOpen: (id: string, open: boolean) => void; register: (id: string) => void; unregister: (id: string) => void; }; type LayoutComposerProps = Omit, "customizeId" | "controlSize">; declare const LayoutComposer: (({ widgetsZonePrefix, preferredLayoutId, sections, data, hasOutlet, disableWidgets, }: LayoutComposerProps) => react.JSX.Element) & { Entry: typeof LayoutEntry; }; export { ActionMenu, Combobox, ConditionalTooltip, ConfigurableDataTable, CountrySelect, DataGrid, DataTable, DisplayId, Form, HandleInput, IconAvatar, JsonViewSection, KeyboundForm, LayoutComponentProps, LayoutComposer, Listicle, NoRecords, NoResults, ProductCell, ProductHeader, ProductStatusCell, ProductStatusHeader, RouteDrawer, RouteFocusModal, SalesChannelHeader, SalesChannelsCell, SectionRow, SidebarLink, StackedDrawer, StackedFocusModal, Thumbnail, VariantCell, VariantHeader, createDataGridHelper, createDataGridPriceColumns, useRouteModal, useStackedModal }; export type { Action, ActionGroup, ActionMenuProps, ConfigurableDataTableProps, DataGridProps, DataTableProps, ListicleProps, NoResultsProps, SectionRowProps, SidebarLinkProps };