@firecms/ui 3.0.0-beta.12 → 3.0.0-beta.14

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.
@@ -3,6 +3,7 @@ export type AutocompleteProps = {
3
3
  children: React.ReactNode;
4
4
  open: boolean;
5
5
  setOpen: (open: boolean) => void;
6
+ className?: string;
6
7
  };
7
8
  export declare const useAutoComplete: ({ ref }: {
8
9
  ref: React.MutableRefObject<HTMLDivElement | null>;
@@ -11,9 +12,10 @@ export declare const useAutoComplete: ({ ref }: {
11
12
  autoCompleteOpen: boolean;
12
13
  setAutoCompleteOpen: React.Dispatch<React.SetStateAction<boolean>>;
13
14
  };
14
- export declare function Autocomplete({ children, open, setOpen }: AutocompleteProps): import("react/jsx-runtime").JSX.Element;
15
+ export declare function Autocomplete({ children, open, setOpen, className }: AutocompleteProps): import("react/jsx-runtime").JSX.Element;
15
16
  export type AutocompleteItemProps = {
16
17
  children: React.ReactNode;
17
18
  onClick?: () => void;
19
+ className?: string;
18
20
  };
19
- export declare function AutocompleteItem({ children, onClick }: AutocompleteItemProps): import("react/jsx-runtime").JSX.Element;
21
+ export declare function AutocompleteItem({ children, onClick, className }: AutocompleteItemProps): import("react/jsx-runtime").JSX.Element;
@@ -3,7 +3,7 @@ export type BooleanSwitchProps = {
3
3
  value: boolean | null;
4
4
  className?: string;
5
5
  disabled?: boolean;
6
- size?: "small" | "medium" | "large";
6
+ size?: "smallest" | "small" | "medium" | "large";
7
7
  } & ({
8
8
  allowIndeterminate: true;
9
9
  onValueChange?: (newValue: boolean | null) => void;
@@ -14,4 +14,4 @@ export type BooleanSwitchWithLabelProps = BooleanSwitchProps & {
14
14
  * Simple boolean switch.
15
15
  *
16
16
  */
17
- export declare const BooleanSwitchWithLabel: ({ value, position, invisible, onValueChange, error, label, autoFocus, disabled, size, className, fullWidth, inputClassName, ...props }: BooleanSwitchWithLabelProps) => import("react/jsx-runtime").JSX.Element;
17
+ export declare const BooleanSwitchWithLabel: ({ value, position, size, invisible, onValueChange, error, label, autoFocus, disabled, className, fullWidth, inputClassName, ...props }: BooleanSwitchWithLabelProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,12 +1,14 @@
1
1
  import React from "react";
2
- export type ButtonProps<P extends React.ElementType> = Omit<(P extends "button" ? React.ButtonHTMLAttributes<HTMLButtonElement> : React.ComponentProps<P>), "onClick"> & {
3
- variant?: "filled" | "neutral" | "outlined" | "text";
2
+ export type ButtonProps<C extends React.ElementType = "button"> = {
3
+ children?: React.ReactNode;
4
+ variant?: "filled" | "outlined" | "text";
4
5
  disabled?: boolean;
5
- color?: "primary" | "secondary" | "text" | "error";
6
+ color?: "primary" | "secondary" | "text" | "error" | "neutral";
6
7
  size?: "small" | "medium" | "large" | "xl" | "2xl";
7
8
  startIcon?: React.ReactNode;
8
9
  fullWidth?: boolean;
9
10
  className?: string;
11
+ component?: C;
10
12
  onClick?: React.MouseEventHandler<any>;
11
- };
13
+ } & React.ComponentPropsWithoutRef<C>;
12
14
  export declare const Button: React.FC<ButtonProps<any>>;
@@ -6,7 +6,7 @@ export type DateTimeFieldProps = {
6
6
  disabled?: boolean;
7
7
  clearable?: boolean;
8
8
  error?: boolean;
9
- size?: "medium" | "large";
9
+ size?: "smallest" | "small" | "medium" | "large";
10
10
  label?: React.ReactNode;
11
11
  className?: string;
12
12
  style?: React.CSSProperties;
@@ -4,6 +4,7 @@ export type DialogProps = {
4
4
  onOpenChange?: (open: boolean) => void;
5
5
  children: React.ReactNode;
6
6
  className?: string;
7
+ containerClassName?: string;
7
8
  fullWidth?: boolean;
8
9
  fullHeight?: boolean;
9
10
  fullScreen?: boolean;
@@ -29,5 +30,5 @@ declare const widthClasses: {
29
30
  "7xl": string;
30
31
  full: string;
31
32
  };
32
- export declare const Dialog: ({ open, onOpenChange, children, className, fullWidth, fullHeight, fullScreen, scrollable, maxWidth, modal, onOpenAutoFocus, onEscapeKeyDown, onPointerDownOutside, onInteractOutside }: DialogProps) => import("react/jsx-runtime").JSX.Element;
33
+ export declare const Dialog: ({ open, onOpenChange, children, className, containerClassName, fullWidth, fullHeight, fullScreen, scrollable, maxWidth, modal, onOpenAutoFocus, onEscapeKeyDown, onPointerDownOutside, onInteractOutside }: DialogProps) => import("react/jsx-runtime").JSX.Element;
33
34
  export {};
@@ -1,35 +1,27 @@
1
1
  import * as React from "react";
2
2
  import { ChangeEvent } from "react";
3
- interface MultiSelectContextProps {
4
- fieldValue?: string[];
5
- onItemClick: (v: string) => void;
3
+ export type MultiSelectValue = string | number | boolean;
4
+ interface MultiSelectContextProps<T extends MultiSelectValue = string> {
5
+ fieldValue?: T[];
6
+ onItemClick: (v: T) => void;
6
7
  }
7
- export declare const MultiSelectContext: React.Context<MultiSelectContextProps>;
8
+ export declare const MultiSelectContext: React.Context<MultiSelectContextProps<any>>;
8
9
  /**
9
10
  * Props for MultiSelect component
10
11
  */
11
- interface MultiSelectProps {
12
- /**
13
- * The modality of the popover. When set to true, interaction with outside elements
14
- * will be disabled and only popover content will be visible to screen readers.
15
- * Optional, defaults to false.
16
- */
12
+ interface MultiSelectProps<T extends MultiSelectValue = string> {
17
13
  modalPopover?: boolean;
18
- /**
19
- * Additional class names to apply custom styles to the multi-select component.
20
- * Optional, can be used to add custom styles.
21
- */
22
14
  className?: string;
23
15
  open?: boolean;
24
16
  name?: string;
25
17
  id?: string;
26
18
  onOpenChange?: (open: boolean) => void;
27
- value?: string[];
19
+ value?: T[];
28
20
  inputClassName?: string;
29
21
  onChange?: React.EventHandler<ChangeEvent<HTMLSelectElement>>;
30
- onValueChange?: (updatedValue: string[]) => void;
22
+ onValueChange?: (updatedValue: T[]) => void;
31
23
  placeholder?: React.ReactNode;
32
- size?: "small" | "medium";
24
+ size?: "smallest" | "small" | "medium" | "large";
33
25
  useChips?: boolean;
34
26
  label?: React.ReactNode | string;
35
27
  disabled?: boolean;
@@ -43,13 +35,13 @@ interface MultiSelectProps {
43
35
  padding?: boolean;
44
36
  invisible?: boolean;
45
37
  children: React.ReactNode;
46
- renderValues?: (values: string[]) => React.ReactNode;
38
+ renderValues?: (values: T[]) => React.ReactNode;
47
39
  }
48
- export declare const MultiSelect: React.ForwardRefExoticComponent<MultiSelectProps & React.RefAttributes<HTMLButtonElement>>;
49
- export interface MultiSelectItemProps {
50
- value: string;
40
+ export declare const MultiSelect: React.ForwardRefExoticComponent<MultiSelectProps<string> & React.RefAttributes<HTMLButtonElement>>;
41
+ export interface MultiSelectItemProps<T extends MultiSelectValue = string> {
42
+ value: T;
51
43
  children?: React.ReactNode;
52
44
  className?: string;
53
45
  }
54
- export declare function MultiSelectItem({ children, value, className }: MultiSelectItemProps): import("react/jsx-runtime").JSX.Element;
46
+ export declare function MultiSelectItem<T extends MultiSelectValue = string>({ children, value, className }: MultiSelectItemProps<T>): import("react/jsx-runtime").JSX.Element;
55
47
  export {};
@@ -1,18 +1,19 @@
1
1
  import React, { ChangeEvent } from "react";
2
- export type SelectProps = {
2
+ export type SelectValue = string | number | boolean;
3
+ export type SelectProps<T extends SelectValue = string> = {
3
4
  open?: boolean;
4
5
  name?: string;
5
6
  fullWidth?: boolean;
6
7
  id?: string;
7
8
  onOpenChange?: (open: boolean) => void;
8
- value?: string;
9
+ value?: T;
9
10
  className?: string;
10
11
  inputClassName?: string;
11
12
  onChange?: React.EventHandler<ChangeEvent<HTMLSelectElement>>;
12
- onValueChange?: (updatedValue: string) => void;
13
+ onValueChange?: (updatedValue: T) => void;
13
14
  placeholder?: React.ReactNode;
14
- renderValue?: (value: string) => React.ReactNode;
15
- size?: "small" | "medium" | "large";
15
+ renderValue?: (value: T) => React.ReactNode;
16
+ size?: "smallest" | "small" | "medium" | "large";
16
17
  label?: React.ReactNode | string;
17
18
  disabled?: boolean;
18
19
  error?: boolean;
@@ -22,15 +23,16 @@ export type SelectProps = {
22
23
  padding?: boolean;
23
24
  invisible?: boolean;
24
25
  children?: React.ReactNode;
26
+ dataType?: "string" | "number" | "boolean";
25
27
  };
26
- export declare const Select: React.ForwardRefExoticComponent<SelectProps & React.RefAttributes<HTMLDivElement>>;
27
- export type SelectItemProps = {
28
- value: string;
28
+ export declare const Select: React.ForwardRefExoticComponent<SelectProps<string> & React.RefAttributes<HTMLDivElement>>;
29
+ export type SelectItemProps<T extends SelectValue = string> = {
30
+ value: T;
29
31
  children?: React.ReactNode;
30
32
  disabled?: boolean;
31
33
  className?: string;
32
34
  };
33
- export declare function SelectItem({ value, children, disabled, className }: SelectItemProps): import("react/jsx-runtime").JSX.Element;
35
+ export declare function SelectItem<T extends SelectValue = string>({ value, children, disabled, className }: SelectItemProps<T>): import("react/jsx-runtime").JSX.Element;
34
36
  export type SelectGroupProps = {
35
37
  label: React.ReactNode;
36
38
  children: React.ReactNode;
@@ -6,19 +6,27 @@ export type TextFieldProps<T extends string | number> = {
6
6
  onChange?: (event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
7
7
  label?: React.ReactNode;
8
8
  multiline?: boolean;
9
- rows?: number;
10
9
  disabled?: boolean;
11
10
  invisible?: boolean;
12
11
  error?: boolean;
13
12
  endAdornment?: React.ReactNode;
14
13
  autoFocus?: boolean;
15
14
  placeholder?: string;
16
- size?: "small" | "medium" | "large";
15
+ size?: "smallest" | "small" | "medium" | "large";
17
16
  className?: string;
18
17
  style?: React.CSSProperties;
19
18
  inputClassName?: string;
20
19
  inputStyle?: React.CSSProperties;
21
20
  inputRef?: React.ForwardedRef<any>;
21
+ /**
22
+ * Maximum number of rows to display.
23
+ */
24
+ maxRows?: number | string;
25
+ /**
26
+ * Minimum number of rows to display.
27
+ * @default 1
28
+ */
29
+ minRows?: number | string;
22
30
  } & Omit<React.InputHTMLAttributes<HTMLInputElement>, "size">;
23
31
  export declare const TextField: React.ForwardRefExoticComponent<{
24
32
  type?: InputType;
@@ -26,17 +34,25 @@ export declare const TextField: React.ForwardRefExoticComponent<{
26
34
  onChange?: (event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
27
35
  label?: React.ReactNode;
28
36
  multiline?: boolean;
29
- rows?: number;
30
37
  disabled?: boolean;
31
38
  invisible?: boolean;
32
39
  error?: boolean;
33
40
  endAdornment?: React.ReactNode;
34
41
  autoFocus?: boolean;
35
42
  placeholder?: string;
36
- size?: "small" | "medium" | "large";
43
+ size?: "smallest" | "small" | "medium" | "large";
37
44
  className?: string;
38
45
  style?: React.CSSProperties;
39
46
  inputClassName?: string;
40
47
  inputStyle?: React.CSSProperties;
41
48
  inputRef?: React.ForwardedRef<any>;
49
+ /**
50
+ * Maximum number of rows to display.
51
+ */
52
+ maxRows?: number | string;
53
+ /**
54
+ * Minimum number of rows to display.
55
+ * @default 1
56
+ */
57
+ minRows?: number | string;
42
58
  } & Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> & React.RefAttributes<HTMLDivElement>>;
package/dist/index.css CHANGED
@@ -71,3 +71,4 @@
71
71
  a {
72
72
  @apply text-blue-600 dark:text-blue-400 dark:hover:text-blue-600 hover:text-blue-800
73
73
  }
74
+