zaravand-ui 4.0.0 → 4.1.0
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.
- package/dist/components/Accordion/Accordion.d.ts +8 -0
- package/dist/components/Accordion/Accordion.interface.d.ts +87 -0
- package/dist/components/Accordion/Accordion.variant.d.ts +15 -0
- package/dist/components/Pagination/Pagination.variant.d.ts +1 -1
- package/dist/components/Textarea/Textarea.variant.d.ts +1 -1
- package/dist/index.cjs +13 -13
- package/dist/index.css +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +7701 -7413
- package/package.json +1 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { AccordionContentProps, AccordionItemProps, AccordionProps, AccordionTriggerProps } from "./Accordion.interface";
|
|
3
|
+
declare const Accordion: React.ForwardRefExoticComponent<AccordionProps & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
declare const AccordionItem: React.ForwardRefExoticComponent<AccordionItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
declare const AccordionTrigger: React.ForwardRefExoticComponent<AccordionTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
declare const AccordionContent: React.ForwardRefExoticComponent<AccordionContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export { AccordionItem, AccordionTrigger, AccordionContent };
|
|
8
|
+
export default Accordion;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* One row inside an item's `content` when `content` is an array — a flat,
|
|
4
|
+
* minimally-divided list (not a nested Accordion) rendered inside the open
|
|
5
|
+
* panel, with its own optional per-row edit/delete icons.
|
|
6
|
+
*/
|
|
7
|
+
export interface AccordionContentItem {
|
|
8
|
+
value: string;
|
|
9
|
+
label: React.ReactNode;
|
|
10
|
+
/** Shows an edit icon button for this row. Requires `Accordion`'s `onContentItemEdit`. */
|
|
11
|
+
isEdit?: boolean;
|
|
12
|
+
/** Shows a delete icon button for this row. Requires `Accordion`'s `onContentItemDelete`. */
|
|
13
|
+
isDelete?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface AccordionItemSchema {
|
|
16
|
+
value: string;
|
|
17
|
+
title: React.ReactNode;
|
|
18
|
+
/**
|
|
19
|
+
* Either arbitrary content (the default), or an array of `AccordionContentItem`
|
|
20
|
+
* rows — rendered as a flat list separated by a minimal divider, not as a
|
|
21
|
+
* nested Accordion.
|
|
22
|
+
*/
|
|
23
|
+
content: React.ReactNode | AccordionContentItem[];
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
icon?: React.ReactNode;
|
|
26
|
+
/** Shows an edit icon button for this item (only in `items` data-driven mode). Requires `Accordion`'s `onEdit`. */
|
|
27
|
+
isEdit?: boolean;
|
|
28
|
+
/** Shows a delete icon button for this item (only in `items` data-driven mode). Requires `Accordion`'s `onDelete`. */
|
|
29
|
+
isDelete?: boolean;
|
|
30
|
+
}
|
|
31
|
+
export type AccordionItemActionInput = {
|
|
32
|
+
item: AccordionItemSchema;
|
|
33
|
+
index: number;
|
|
34
|
+
};
|
|
35
|
+
export type AccordionEditItemHandler = (input: AccordionItemActionInput) => void | Promise<void>;
|
|
36
|
+
export type AccordionDeleteItemHandler = (input: AccordionItemActionInput) => void | Promise<void>;
|
|
37
|
+
export type AccordionContentItemActionInput = {
|
|
38
|
+
item: AccordionItemSchema;
|
|
39
|
+
itemIndex: number;
|
|
40
|
+
contentItem: AccordionContentItem;
|
|
41
|
+
contentIndex: number;
|
|
42
|
+
};
|
|
43
|
+
export type AccordionContentItemEditHandler = (input: AccordionContentItemActionInput) => void | Promise<void>;
|
|
44
|
+
export type AccordionContentItemDeleteHandler = (input: AccordionContentItemActionInput) => void | Promise<void>;
|
|
45
|
+
export interface AccordionProps {
|
|
46
|
+
type?: "single" | "multiple";
|
|
47
|
+
value?: string | string[];
|
|
48
|
+
defaultValue?: string | string[];
|
|
49
|
+
onValueChange?: (value: string | string[]) => void;
|
|
50
|
+
collapsible?: boolean;
|
|
51
|
+
dir?: "rtl" | "ltr";
|
|
52
|
+
/**
|
|
53
|
+
* Data-driven usage (recommended) — same convention as Select's `options` or
|
|
54
|
+
* Table's `schema`: pass the items and Accordion renders them, no manual
|
|
55
|
+
* AccordionItem/AccordionTrigger/AccordionContent composition needed.
|
|
56
|
+
* When provided, `children` is ignored.
|
|
57
|
+
*/
|
|
58
|
+
items?: AccordionItemSchema[];
|
|
59
|
+
/** Called when an item's edit icon (`item.isEdit`) is clicked. Same convention as `Table`'s `onEdit`. */
|
|
60
|
+
onEdit?: AccordionEditItemHandler;
|
|
61
|
+
/** Called when an item's delete icon (`item.isDelete`) is clicked. Same convention as `Table`'s `onDelete`. */
|
|
62
|
+
onDelete?: AccordionDeleteItemHandler;
|
|
63
|
+
/** Called when a content-list row's edit icon (`AccordionContentItem.isEdit`) is clicked. */
|
|
64
|
+
onContentItemEdit?: AccordionContentItemEditHandler;
|
|
65
|
+
/** Called when a content-list row's delete icon (`AccordionContentItem.isDelete`) is clicked. */
|
|
66
|
+
onContentItemDelete?: AccordionContentItemDeleteHandler;
|
|
67
|
+
className?: string;
|
|
68
|
+
children?: React.ReactNode;
|
|
69
|
+
}
|
|
70
|
+
export interface AccordionItemProps {
|
|
71
|
+
value: string;
|
|
72
|
+
disabled?: boolean;
|
|
73
|
+
className?: string;
|
|
74
|
+
children?: React.ReactNode;
|
|
75
|
+
}
|
|
76
|
+
export interface AccordionTriggerProps {
|
|
77
|
+
icon?: React.ReactNode;
|
|
78
|
+
/** Extra controls (e.g. edit/delete icon buttons) rendered next to the trigger but outside its clickable button, so clicking them doesn't toggle the item. */
|
|
79
|
+
actions?: React.ReactNode;
|
|
80
|
+
className?: string;
|
|
81
|
+
children?: React.ReactNode;
|
|
82
|
+
}
|
|
83
|
+
export interface AccordionContentProps {
|
|
84
|
+
forceMount?: boolean;
|
|
85
|
+
className?: string;
|
|
86
|
+
children?: React.ReactNode;
|
|
87
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
declare const accordionVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
2
|
+
declare const accordionItemVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
3
|
+
declare const accordionTriggerRowVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
4
|
+
declare const accordionTriggerVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
5
|
+
declare const accordionTriggerActionsVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
6
|
+
declare const accordionActionButtonVariants: (props?: ({
|
|
7
|
+
tone?: "edit" | "delete" | null | undefined;
|
|
8
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
|
+
declare const accordionContentActionButtonVariants: (props?: ({
|
|
10
|
+
tone?: "edit" | "delete" | null | undefined;
|
|
11
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
12
|
+
declare const accordionContentVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
13
|
+
declare const accordionContentListVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
14
|
+
declare const accordionContentListRowVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
15
|
+
export { accordionVariants, accordionItemVariants, accordionTriggerRowVariants, accordionTriggerVariants, accordionTriggerActionsVariants, accordionActionButtonVariants, accordionContentActionButtonVariants, accordionContentVariants, accordionContentListVariants, accordionContentListRowVariants, };
|
|
@@ -2,7 +2,7 @@ declare const paginationVariants: (props?: import("class-variance-authority/type
|
|
|
2
2
|
declare const paginationContentVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
3
3
|
declare const paginationItemVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
4
4
|
declare const paginationLinkVariants: (props?: ({
|
|
5
|
-
size?: "
|
|
5
|
+
size?: "icon" | "default" | null | undefined;
|
|
6
6
|
active?: boolean | null | undefined;
|
|
7
7
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
8
|
declare const paginationPreviousVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|