import * as react_jsx_runtime from 'react/jsx-runtime'; 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 { T as TableAdapter } from './table-adapters-DnG5KPvi.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_runtime.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_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; type ConditionalTooltipProps = PropsWithChildren & { showTooltip?: boolean; }>; declare const ConditionalTooltip: ({ children, showTooltip, ...props }: ConditionalTooltipProps) => string | number | boolean | Iterable | react_jsx_runtime.JSX.Element | null | undefined; type DisplayIdProps = { id: string; className?: string; }; declare function DisplayId({ id, className }: DisplayIdProps): react_jsx_runtime.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_jsx_runtime.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_runtime.JSX.Element; type JsonViewSectionProps = { data: object; title?: string; }; declare const JsonViewSection: ({ data }: JsonViewSectionProps) => react_jsx_runtime.JSX.Element; interface ListicleProps { labelKey: string; descriptionKey: string; children?: ReactNode; } declare const Listicle: ({ labelKey, descriptionKey, children, }: ListicleProps) => react_jsx_runtime.JSX.Element; type NoResultsProps = { title?: string; message?: string; className?: string; }; declare const NoResults: ({ title, message, className }: NoResultsProps) => react_jsx_runtime.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_jsx_runtime.JSX.Element; type SectionRowProps = { title: string; value?: ReactNode | string | null; actions?: ReactNode; }; declare const SectionRow: ({ title, value, actions }: SectionRowProps) => react_jsx_runtime.JSX.Element; interface SidebarLinkProps { to: string; labelKey: string; descriptionKey: string; icon: ReactNode; } declare const SidebarLink: ({ to, labelKey, descriptionKey, icon, }: SidebarLinkProps) => react_jsx_runtime.JSX.Element; type ThumbnailProps = { src?: string | null; alt?: string; size?: "small" | "base"; }; declare const Thumbnail: ({ src, alt, size }: ThumbnailProps) => react_jsx_runtime.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">, "value" | "options" | "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_jsx_runtime.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_runtime.JSX.Element) & { BooleanCell: ({ context, disabled, }: DataGridCellProps & { disabled?: boolean; }) => react_jsx_runtime.JSX.Element; TextCell: ({ context, }: DataGridCellProps) => react_jsx_runtime.JSX.Element; MultilineCell: ({ context, }: DataGridCellProps) => react_jsx_runtime.JSX.Element; ExpandableTextCell: ({ context, fieldLabel, }: DataGridCellProps & { fieldLabel?: string; }) => react_jsx_runtime.JSX.Element; NumberCell: ({ context, ...rest }: DataGridCellProps & { min?: number; max?: number; placeholder?: string; }) => react_jsx_runtime.JSX.Element; CurrencyCell: ({ context, code, }: DataGridCurrencyCellProps) => react_jsx_runtime.JSX.Element; ReadonlyCell: ({ context, color, children, isMultiLine, }: DataGridCellProps & { children?: React.ReactNode | undefined; } & { color?: "muted" | "normal"; isMultiLine?: boolean; }) => react_jsx_runtime.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_runtime.JSX.Element; declare const ProductHeader: () => react_jsx_runtime.JSX.Element; type ProductStatusCellProps = { status?: HttpTypes.AdminProductStatus; }; declare const ProductStatusCell: ({ status }: ProductStatusCellProps) => react_jsx_runtime.JSX.Element; declare const ProductStatusHeader: () => react_jsx_runtime.JSX.Element; type SalesChannelsCellProps = { salesChannels?: SalesChannelDTO[] | null; }; declare const SalesChannelsCell: ({ salesChannels, }: SalesChannelsCellProps) => react_jsx_runtime.JSX.Element; declare const SalesChannelHeader: () => react_jsx_runtime.JSX.Element; type VariantCellProps = { variants?: HttpTypes.AdminProductVariant[] | null; }; declare const VariantCell: ({ variants }: VariantCellProps) => react_jsx_runtime.JSX.Element; declare const VariantHeader: () => react_jsx_runtime.JSX.Element; type RouteModalFormProps = PropsWithChildren<{ form: UseFormReturn; blockSearchParams?: boolean; onClose?: (isSubmitSuccessful: boolean) => void; }>; declare const RouteModalForm: ({ form, blockSearchParams: blockSearch, children, onClose, }: RouteModalFormProps) => react_jsx_runtime.JSX.Element; type RouteDrawerProps = PropsWithChildren<{ prev?: string | Partial | number; }>; declare const Root$3: ({ prev, children }: RouteDrawerProps) => react_jsx_runtime.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_runtime.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_runtime.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_runtime.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_runtime.JSX.Element) & { Entry: typeof LayoutEntry; }; export { type Action, type ActionGroup, ActionMenu, type ActionMenuProps, Combobox, ConditionalTooltip, ConfigurableDataTable, type ConfigurableDataTableProps, CountrySelect, DataGrid, type DataGridProps, DataTable, type DataTableProps, DisplayId, Form, HandleInput, IconAvatar, JsonViewSection, KeyboundForm, LayoutComponentProps, LayoutComposer, Listicle, type ListicleProps, NoRecords, NoResults, type NoResultsProps, ProductCell, ProductHeader, ProductStatusCell, ProductStatusHeader, RouteDrawer, RouteFocusModal, SalesChannelHeader, SalesChannelsCell, SectionRow, type SectionRowProps, SidebarLink, type SidebarLinkProps, StackedDrawer, StackedFocusModal, Thumbnail, VariantCell, VariantHeader, createDataGridHelper, createDataGridPriceColumns, useRouteModal, useStackedModal };