@zimyo/ui 1.6.2 → 1.6.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.
package/dist/index.d.ts CHANGED
@@ -6,6 +6,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
6
6
  import { Props, GroupBase } from 'react-select';
7
7
  import * as class_variance_authority_dist_types from 'class-variance-authority/dist/types';
8
8
  import { VariantProps } from 'class-variance-authority';
9
+ import { UseFormReturn } from 'react-hook-form';
9
10
  import { Theme } from '@mui/material/styles';
10
11
  import { ClassValue } from 'clsx';
11
12
 
@@ -37,8 +38,9 @@ interface SelectProps<OptionType extends Option> extends Props<OptionType, boole
37
38
  searchByID?: boolean;
38
39
  value?: any;
39
40
  floatingLabel?: boolean;
41
+ maxChipVisible?: number;
40
42
  }
41
- declare function Select<OptionType extends Option>({ label, error, className, size, required, valueKey, labelKey, isMulti, value, options, onChange, searchByID, floatingLabel, ...props }: SelectProps<OptionType>): react_jsx_runtime.JSX.Element;
43
+ declare function Select<OptionType extends Option>({ label, error, className, size, required, valueKey, labelKey, isMulti, value, options, onChange, searchByID, floatingLabel, maxChipVisible, ...props }: SelectProps<OptionType>): react_jsx_runtime.JSX.Element;
42
44
 
43
45
  interface AccordionProps extends Omit<AccordionProps$1, 'sx' | 'onChange' | 'expanded'> {
44
46
  type?: 'single' | 'multiple';
@@ -133,7 +135,7 @@ declare const Code: ({ children, sx }: CodeProps) => react_jsx_runtime.JSX.Eleme
133
135
  interface ModalProps {
134
136
  open: boolean;
135
137
  onClose: () => void;
136
- title?: string;
138
+ title?: string | any;
137
139
  description?: string;
138
140
  children?: React$1.ReactNode;
139
141
  actions?: React$1.ReactNode;
@@ -177,9 +179,9 @@ interface BadgeProps extends VariantProps<typeof badgeVariants> {
177
179
  className?: string;
178
180
  }
179
181
  declare const badgeVariants: (props?: ({
180
- variant?: "text" | "outlined" | "contained" | null | undefined;
182
+ variant?: "text" | "contained" | "outlined" | null | undefined;
181
183
  size?: "sm" | "md" | "lg" | null | undefined;
182
- type?: "default" | "success" | "error" | "info" | "warning" | null | undefined;
184
+ type?: "default" | "error" | "info" | "success" | "warning" | null | undefined;
183
185
  } & class_variance_authority_dist_types.ClassProp) | undefined) => string;
184
186
  declare const Badge: ({ label, icon, iconPosition, dot, dotPosition, variant, size, type, color, className, }: BadgeProps) => react_jsx_runtime.JSX.Element;
185
187
 
@@ -276,6 +278,88 @@ interface DateRangePickerProps {
276
278
  }
277
279
  declare const DateRangePicker: React$1.FC<DateRangePickerProps>;
278
280
 
281
+ type FieldType = "text" | "number" | "textarea" | "select" | "radio" | "switch" | "checkbox" | "date" | "daterange" | "custom";
282
+ type FormField = {
283
+ name: string;
284
+ label: string;
285
+ type: FieldType;
286
+ placeholder?: string;
287
+ required?: boolean;
288
+ defaultValue?: any;
289
+ options?: {
290
+ label: string;
291
+ value: any;
292
+ }[];
293
+ validation?: any;
294
+ visibleIf?: (values: any) => boolean;
295
+ component?: React__default.ReactNode;
296
+ colSpan?: number;
297
+ };
298
+ type FormProps = {
299
+ schema: FormField[];
300
+ form: UseFormReturn;
301
+ layout?: "vertical" | "grid";
302
+ columns?: number;
303
+ className?: string;
304
+ showSubmitButton?: boolean;
305
+ onSubmit?: (data: any) => void;
306
+ };
307
+ declare const Form: React__default.FC<FormProps>;
308
+
309
+ type CheckboxSize = "sm" | "md" | "lg";
310
+ interface CheckboxProps extends React$1.InputHTMLAttributes<HTMLInputElement> {
311
+ label?: React$1.ReactNode;
312
+ description?: React$1.ReactNode;
313
+ size?: CheckboxSize;
314
+ indeterminate?: boolean;
315
+ error?: boolean;
316
+ }
317
+ declare const Checkbox: React$1.ForwardRefExoticComponent<CheckboxProps & React$1.RefAttributes<HTMLInputElement>>;
318
+
319
+ interface CheckboxGroupOption {
320
+ label: string;
321
+ value: string;
322
+ description?: string;
323
+ disabled?: boolean;
324
+ }
325
+ type Layout = "box" | "list";
326
+ type Direction = "vertical" | "horizontal";
327
+ interface CheckboxGroupProps {
328
+ name: string;
329
+ label?: string;
330
+ description?: string;
331
+ error?: boolean;
332
+ options: CheckboxGroupOption[];
333
+ value?: string[];
334
+ defaultValue?: string[];
335
+ onChange?: (selected: string[]) => void;
336
+ direction?: Direction;
337
+ layout?: Layout;
338
+ disabled?: boolean;
339
+ size?: CheckboxProps["size"];
340
+ className?: string;
341
+ columns?: number;
342
+ }
343
+ declare const CheckboxGroup: React$1.FC<CheckboxGroupProps>;
344
+
345
+ interface RadioProps {
346
+ label?: string;
347
+ description?: string;
348
+ name?: string;
349
+ checked?: boolean;
350
+ defaultChecked?: boolean;
351
+ onChange?: (event: React__default.ChangeEvent<HTMLInputElement>, checked: boolean) => void;
352
+ disabled?: boolean;
353
+ required?: boolean;
354
+ error?: boolean;
355
+ helperText?: string;
356
+ size?: 'small' | 'medium';
357
+ color?: 'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning';
358
+ sx?: SxProps;
359
+ radioSx?: SxProps;
360
+ labelSx?: SxProps;
361
+ }
362
+
279
363
  interface UILibraryThemeProviderProps {
280
364
  children: React__default.ReactNode;
281
365
  primaryColor?: string;
@@ -370,5 +454,5 @@ declare const designTokens: {
370
454
  declare function cn(...inputs: ClassValue[]): string;
371
455
  declare function useStableId(prefix?: string): string;
372
456
 
373
- export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Badge, Blockquote, Button, Caption, Code, DatePicker, DateRangePicker, Drawer, Heading, Input, Lead, Modal, Muted, Notice, RadioGroup, Select, Strong, Switch, Text, UILibraryThemeProvider, cn, createCustomTheme, designTokens, theme, useStableId };
374
- export type { AccordionContentProps, AccordionItemProps, AccordionProps, AccordionTriggerProps, BadgeProps, ButtonProps, DatePickerProps, DateRangePickerProps, DrawerProps, InputProps, ModalProps, NoticeProps, RadioGroupProps, RadioOption, SelectProps, SwitchProps, ThemeConfig, UILibraryThemeProviderProps };
457
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Badge, Blockquote, Button, Caption, Checkbox, CheckboxGroup, Code, DatePicker, DateRangePicker, Drawer, Form, Heading, Input, Lead, Modal, Muted, Notice, RadioGroup, Select, Strong, Switch, Text, UILibraryThemeProvider, cn, createCustomTheme, designTokens, theme, useStableId };
458
+ export type { AccordionContentProps, AccordionItemProps, AccordionProps, AccordionTriggerProps, BadgeProps, ButtonProps, CheckboxGroupProps, CheckboxProps, DatePickerProps, DateRangePickerProps, DrawerProps, FormProps, InputProps, ModalProps, NoticeProps, RadioGroupProps, RadioOption, RadioProps, SelectProps, SwitchProps, ThemeConfig, UILibraryThemeProviderProps };