zaravand-ui 3.1.5 → 4.0.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.
@@ -0,0 +1,4 @@
1
+ import * as React from "react";
2
+ import type { SwitchProps } from "./Switch.interface";
3
+ declare const Switch: React.ForwardRefExoticComponent<SwitchProps & React.RefAttributes<HTMLButtonElement>>;
4
+ export default Switch;
@@ -0,0 +1,18 @@
1
+ import type * as React from "react";
2
+ import type { VariantProps } from "class-variance-authority";
3
+ import type { switchVariants } from "./Switch.variant";
4
+ export interface SwitchProps extends VariantProps<typeof switchVariants> {
5
+ checked?: boolean;
6
+ defaultChecked?: boolean;
7
+ onCheckedChange?: (checked: boolean) => void;
8
+ required?: boolean;
9
+ name?: string;
10
+ value?: string;
11
+ form?: string;
12
+ id?: string;
13
+ className?: string;
14
+ "aria-label"?: string;
15
+ disabled?: boolean;
16
+ onClick?: React.MouseEventHandler<HTMLButtonElement>;
17
+ onInvalid?: React.FormEventHandler<HTMLButtonElement>;
18
+ }
@@ -0,0 +1,7 @@
1
+ declare const switchVariants: (props?: ({
2
+ size?: "sm" | "default" | "lg" | null | undefined;
3
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
4
+ declare const switchThumbVariants: (props?: ({
5
+ size?: "sm" | "default" | "lg" | null | undefined;
6
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
+ export { switchVariants, switchThumbVariants };
@@ -5,6 +5,8 @@ export declare const noSearchResultMessage = "\u062F\u0627\u062F\u0647\u200C\u06
5
5
  export declare const actionsColumnLabel = "\u0639\u0645\u0644\u06CC\u0627\u062A";
6
6
  export declare const rowNumberColumnLabel = "\u0631\u062F\u06CC\u0641";
7
7
  export declare const addButtonLabel = "\u0627\u0641\u0632\u0648\u062F\u0646";
8
+ export declare const printButtonLabel = "\u0686\u0627\u067E";
9
+ export declare const previewPrintButtonLabel = "\u067E\u06CC\u0634\u200C\u0646\u0645\u0627\u06CC\u0634 \u0686\u0627\u067E";
8
10
  export declare const editButtonLabel = "\u0648\u06CC\u0631\u0627\u06CC\u0634";
9
11
  export declare const deleteButtonLabel = "\u062D\u0630\u0641";
10
12
  export declare const actionIconClassName = "zui:size-4";
@@ -33,7 +35,7 @@ export declare const infiniteCompletedStatusLabel = "\u0647\u0645\u0647 \u0631\u
33
35
  export declare const defaultLoadingRowsCount = 6;
34
36
  export declare const maxLoadingRowsCount = 12;
35
37
  export declare const sortIconClassName = "zui:size-4";
36
- export declare const sortToggleButtonClassName = "zui:inline-flex zui:cursor-pointer zui:items-center zui:justify-center zui:rounded zui:border-0 zui:bg-transparent zui:p-0 zui:text-[var(--zui-theme-text-primary)] zui:transition-transform zui:duration-200 zui:ease-out zui:hover:scale-125 zui:focus-visible:outline-none zui:focus-visible:ring-2 zui:focus-visible:ring-[var(--zui-theme-action-secondary)]";
38
+ export declare const sortToggleButtonClassName = "zui:inline-flex zui:cursor-pointer zui:items-center zui:justify-center zui:rounded zui:border-0 zui:bg-transparent zui:p-0 zui:text-[var(--zui-color-surface)] zui:transition-transform zui:duration-200 zui:ease-out zui:hover:scale-125 zui:focus-visible:outline-none zui:focus-visible:ring-2 zui:focus-visible:ring-[var(--zui-theme-action-secondary)]";
37
39
  export declare const sortAscendingLabel = "\u0635\u0639\u0648\u062F\u06CC";
38
40
  export declare const sortDescendingLabel = "\u0646\u0632\u0648\u0644\u06CC";
39
41
  export declare const sortTooltipPrefixLabel = "\u0645\u0631\u062A\u0628\u200C\u0633\u0627\u0632\u06CC \u0628\u0631 \u0627\u0633\u0627\u0633";
@@ -27,6 +27,20 @@ export type TableRowActionInput = {
27
27
  export type TableAddRowHandler = () => void | Promise<void>;
28
28
  export type TableEditRowHandler = (input: TableRowActionInput) => void | Promise<void>;
29
29
  export type TableDeleteRowHandler = (input: TableRowActionInput) => void | Promise<void>;
30
+ export type TablePrintHandlerInput = {
31
+ /**
32
+ * Currently filtered + sorted rows (full result set, not just the active
33
+ * page). Consumers wanting to print exactly what the user sees on the
34
+ * current page can slice this using their own pagination state.
35
+ */
36
+ rows: DynamicTableRow[];
37
+ /**
38
+ * Currently visible columns (row-number/actions columns excluded), in the
39
+ * same order rendered by the table.
40
+ */
41
+ columns: TableSchemaColumn[];
42
+ };
43
+ export type TablePrintHandler = (input: TablePrintHandlerInput) => void | Promise<void>;
30
44
  export type TableAction = {
31
45
  icon: React.ReactNode;
32
46
  onClick: (input: TableRowActionInput) => void | Promise<void>;
@@ -141,6 +155,18 @@ export interface TableProps {
141
155
  onAdd?: TableAddRowHandler;
142
156
  onEdit?: TableEditRowHandler;
143
157
  onDelete?: TableDeleteRowHandler;
158
+ /**
159
+ * When provided, shows a print icon button in the table controls that
160
+ * calls this handler with the current filtered/sorted rows and visible
161
+ * columns. The table performs no printing itself.
162
+ */
163
+ onPrint?: TablePrintHandler;
164
+ /**
165
+ * When provided, shows a print-preview icon button in the table controls
166
+ * that calls this handler with the current filtered/sorted rows and
167
+ * visible columns. The table performs no printing itself.
168
+ */
169
+ onPreviewPrint?: TablePrintHandler;
144
170
  actions?: TableAction[];
145
171
  onCellSelectChange?: TableCellSelectChangeHandler;
146
172
  getRowId?: TableRowIdResolver;
@@ -0,0 +1,4 @@
1
+ import * as React from "react";
2
+ import type { ToggleProps } from "./Toggle.interface";
3
+ declare const Toggle: React.ForwardRefExoticComponent<ToggleProps & React.RefAttributes<HTMLButtonElement>>;
4
+ export default Toggle;
@@ -0,0 +1,13 @@
1
+ import type * as React from "react";
2
+ import type { VariantProps } from "class-variance-authority";
3
+ import type { toggleVariants } from "./Toggle.variant";
4
+ export interface ToggleProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "children" | "disabled" | "onClick">, VariantProps<typeof toggleVariants> {
5
+ pressed?: boolean;
6
+ defaultPressed?: boolean;
7
+ onPressedChange?: (pressed: boolean) => void;
8
+ disabled?: boolean;
9
+ label?: React.ReactNode;
10
+ icon?: React.ReactNode;
11
+ ariaLabel?: string;
12
+ className?: string;
13
+ }
@@ -0,0 +1,5 @@
1
+ declare const toggleVariants: (props?: ({
2
+ variant?: "default" | "outline" | null | undefined;
3
+ size?: "sm" | "default" | "lg" | null | undefined;
4
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
5
+ export { toggleVariants };