chesai-ui 0.13.3 → 0.13.4

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.
@@ -0,0 +1,60 @@
1
+ import { VariantProps } from 'class-variance-authority';
2
+ import { default as React } from 'react';
3
+ declare const sortableItemVariants: (props?: ({
4
+ variant?: "primary" | "secondary" | "ghost" | "surface" | null | undefined;
5
+ shape?: "full" | "minimal" | "sharp" | null | undefined;
6
+ padding?: "sm" | "md" | "lg" | "none" | null | undefined;
7
+ } & import('class-variance-authority/dist/types').ClassProp) | undefined) => string;
8
+ type SortableVariant = VariantProps<typeof sortableItemVariants>["variant"];
9
+ type SortableShape = VariantProps<typeof sortableItemVariants>["shape"];
10
+ type SortablePadding = VariantProps<typeof sortableItemVariants>["padding"];
11
+ interface SortableItemContextValue {
12
+ attributes: Record<string, any>;
13
+ listeners: Record<string, any>;
14
+ isDragging: boolean;
15
+ }
16
+ export declare const useSortableItem: () => SortableItemContextValue;
17
+ export interface SortableListProps<T extends {
18
+ id: string | number;
19
+ }> {
20
+ /** Array of items to be rendered. Each must have a unique `id` */
21
+ items: T[];
22
+ /** Callback fired when items are successfully reordered */
23
+ onReorder: (items: T[]) => void;
24
+ /** React children, typically a mapped array of `<SortableList.Item>` */
25
+ children: React.ReactNode;
26
+ className?: string;
27
+ /** Default variant applied to all items */
28
+ variant?: SortableVariant;
29
+ /** Default shape applied to all items */
30
+ shape?: SortableShape;
31
+ /** Default padding applied to all items */
32
+ padding?: SortablePadding;
33
+ /** Vertical gap between items */
34
+ gap?: "none" | "sm" | "md" | "lg";
35
+ }
36
+ export declare const SortableListRoot: <T extends {
37
+ id: string | number;
38
+ }>(props: SortableListProps<T>) => React.ReactElement;
39
+ export interface SortableItemProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "id"> {
40
+ /** Must match the item's unique id in the data array */
41
+ id: string | number;
42
+ /** Overrides the list's default variant */
43
+ variant?: SortableVariant;
44
+ /** Overrides the list's default shape */
45
+ shape?: SortableShape;
46
+ /** Overrides the list's default padding */
47
+ padding?: SortablePadding;
48
+ /** Disables dragging for this specific item */
49
+ disabled?: boolean;
50
+ }
51
+ export interface SortableDragHandleProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
52
+ icon?: React.ReactNode;
53
+ }
54
+ export declare const SortableList: (<T extends {
55
+ id: string | number;
56
+ }>(props: SortableListProps<T>) => React.ReactElement) & {
57
+ Item: (props: SortableItemProps) => import("react/jsx-runtime").JSX.Element;
58
+ DragHandle: React.ForwardRefExoticComponent<SortableDragHandleProps & React.RefAttributes<HTMLButtonElement>>;
59
+ };
60
+ export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "chesai-ui",
3
3
  "private": false,
4
- "version": "0.13.3",
4
+ "version": "0.13.4",
5
5
  "packageManager": "pnpm@10.12.1",
6
6
  "repository": {
7
7
  "type": "git",