UNPKG

pragmate-ui

Version:

An advanced, on-demand React UI library optimized for BeyondJS. Pragmate UI provides modular, responsive, and accessible components with a focus on efficient bundle sizes and a streamlined development process.

165 lines (149 loc) 5.47 kB
/************ Processor: ts ************/ import * as __beyond_dep_ns_0 from 'react'; import __beyond_dep_def_0 from 'react'; import * as __beyond_dep_ns_1 from 'pragmate-ui/base'; import * as __beyond_dep_ns_2 from 'framer-motion'; // draggable.tsx declare namespace ns_0 { import React = __beyond_dep_def_0; import IDraggableListProps = ns_6.IDraggableListProps; import IListItem = ns_6.IListItem; export function DraggableList<T extends IListItem<any, any>>({ specs, control, index, ...props }: Partial<IDraggableListProps<T>>): React.JSX.Element; } // html-attributes.ts declare namespace ns_1 { /** * Filters the properties of an object to include only those that are recognized HTML attributes, with the * capability to explicitly exclude certain attributes even if they are valid. The function checks for standard * attributes defined in the `htmlAttributes` set, and dynamically accepts any properties that begin with 'aria-' * or 'data-'. It excludes any properties listed in the `exclusions` array, regardless of their validity as HTML attributes. * * @param {Record<string, any>} props - The object containing properties that may or may not correspond to valid HTML attributes. * @param {string[]} exclusions - Array of property names to be excluded from the returned object, even if they are valid HTML attributes. * @returns {Record<string, any>} A new object containing only the properties that are valid HTML attributes and not listed in exclusions. */ export function getAttributes(props: Record<string, any>, exclusions?: string[]): Record<string, any>; } // index.tsx declare namespace ns_2 { import ReactElement = __beyond_dep_ns_0.ReactElement; import IListItem = ns_6.IListItem; import IListProps = ns_6.IListProps; export function List<T extends IListItem<any, any>>({ items, children, control, empty, ...props }: Partial<IListProps<T>>): ReactElement; } // item\dragable.tsx declare namespace ns_3 { import React = __beyond_dep_def_0; import IListItem = ns_6.IListItem; export function DraggableItem<T>({ as, ...props }: IListItem<T>): React.JSX.Element; } // item\html.tsx declare namespace ns_4 { import React = __beyond_dep_def_0; interface IHTMLItemProps { as?: keyof React.ReactHTML; children?: React.ReactNode; } export function HTMLItem({ as, children, ...props }: IHTMLItemProps & Record<string, any>): React.JSX.Element; export {}; } // item\index.tsx declare namespace ns_5 { import React = __beyond_dep_def_0; import IListItem = ns_6.IListItem; /** * Componente que renderiza un elemento de la lista. * * @template T - El tipo de los elementos en la lista. * @template U - Tipo de las propiedades adicionales opcionales (por defecto un objeto genérico). * * @param props - Las propiedades de `ItemList`. * @returns El elemento renderizado. */ export function ItemList<T, U = Record<string, any>>({ index, item, idx, as, control, specs }: IListItem<T, U>): React.ReactElement<any, string | React.JSXElementConstructor<any>>; } // types.ts declare namespace ns_6 { /// <reference types="react" /> import IPUIProps = __beyond_dep_ns_1.IPUIProps; import Reorder = __beyond_dep_ns_2.Reorder; /** Interface for the control type that can be reused across components. */ interface IItemControl { control?: React.FunctionComponent; } /** * Interface for the properties of the `ItemList` component. * * @template T - The type of the items in the list. * @template U - Type for additional optional properties (default is a generic object). */ export interface IListItem<T, U = Record<string, any>> extends IPUIProps, IItemControl { /** Index key for the item in the list. */ index: string; /** Individual item in the list. */ item: T; /** Index of the item in the list. */ idx: number; /** Type of the HTML container for the item (default is 'li'). */ as?: keyof React.ReactHTML; /** Additional optional properties. */ specs?: U; } export interface IListProps<T extends IListItem<any, any> = IListItem<any, any>, U = Record<string, any>> extends IPUIProps, IItemControl { /** Index key for the list. */ index: string; /** Array of items in the list. */ items: any[]; /** Additional parameters to be passed to each item. */ specs?: U; /** Enables dragging functionality if true. */ draggable?: boolean; /** Position of children relative to the item (either 'top' or 'bottom'). */ childrenPosition?: 'top' | 'bottom'; /** Custom HTML or React element to render the list container. */ as: keyof React.ReactHTML; /** Deprecated: Use 'as' instead for the container. */ container: React.ReactHTML; empty: React.ElementType; } export interface IDraggableListProps<T extends IListItem<any, any>, U = Record<string, any>> extends Omit<React.ComponentProps<typeof Reorder.Group>, 'children'> { items: T[]; specs?: U; index?: string; draggable?: boolean; childrenPosition?: 'top' | 'bottom'; as?: keyof React.ReactHTML; control?: React.FunctionComponent<T>; empty?: React.ElementType; } export {}; } export import List = ns_2.List; export declare const hmr: {on: (event: string, listener: any) => void, off: (event: string, listener: any) => void };