@firecms/ui 3.0.0-canary.8 → 3.0.0-canary.80

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.
Files changed (89) hide show
  1. package/README.md +1 -1
  2. package/dist/components/Avatar.d.ts +1 -0
  3. package/dist/components/BooleanSwitch.d.ts +1 -1
  4. package/dist/components/CenteredView.d.ts +4 -2
  5. package/dist/components/Checkbox.d.ts +4 -3
  6. package/dist/components/DateTimeField.d.ts +2 -2
  7. package/dist/components/InputLabel.d.ts +2 -2
  8. package/dist/components/Label.d.ts +4 -1
  9. package/dist/components/Markdown.d.ts +1 -0
  10. package/dist/components/Menu.d.ts +2 -1
  11. package/dist/components/Menubar.d.ts +69 -0
  12. package/dist/components/RadioGroup.d.ts +25 -3
  13. package/dist/components/Select.d.ts +1 -1
  14. package/dist/components/TextField.d.ts +1 -1
  15. package/dist/components/TextareaAutosize.d.ts +3 -34
  16. package/dist/components/index.d.ts +1 -1
  17. package/dist/hooks/index.d.ts +4 -0
  18. package/dist/hooks/useLocaleConfig.d.ts +1 -0
  19. package/dist/icons/Icon.d.ts +2 -2
  20. package/dist/index.d.ts +1 -0
  21. package/dist/index.es.js +8362 -8066
  22. package/dist/index.es.js.map +1 -1
  23. package/dist/index.umd.js +10 -10
  24. package/dist/index.umd.js.map +1 -1
  25. package/dist/styles.d.ts +6 -6
  26. package/dist/util/{cn.d.ts → cls.d.ts} +4 -0
  27. package/dist/util/index.d.ts +1 -3
  28. package/package.json +39 -49
  29. package/src/components/Alert.tsx +2 -2
  30. package/src/components/Autocomplete.tsx +4 -3
  31. package/src/components/Avatar.tsx +7 -4
  32. package/src/components/Badge.tsx +1 -1
  33. package/src/components/BooleanSwitch.tsx +9 -9
  34. package/src/components/BooleanSwitchWithLabel.tsx +5 -5
  35. package/src/components/Button.tsx +7 -7
  36. package/src/components/Card.tsx +2 -2
  37. package/src/components/CenteredView.tsx +25 -15
  38. package/src/components/Checkbox.tsx +31 -24
  39. package/src/components/Chip.tsx +2 -2
  40. package/src/components/CircularProgress.tsx +2 -2
  41. package/src/components/Collapse.tsx +3 -2
  42. package/src/components/Container.tsx +2 -2
  43. package/src/components/DateTimeField.tsx +10 -9
  44. package/src/components/Dialog.tsx +4 -4
  45. package/src/components/DialogActions.tsx +2 -2
  46. package/src/components/DialogContent.tsx +2 -2
  47. package/src/components/ExpandablePanel.tsx +8 -6
  48. package/src/components/FileUpload.tsx +5 -7
  49. package/src/components/IconButton.tsx +3 -3
  50. package/src/components/InfoLabel.tsx +2 -2
  51. package/src/components/InputLabel.tsx +10 -9
  52. package/src/components/Label.tsx +17 -4
  53. package/src/components/Markdown.tsx +14 -3
  54. package/src/components/Menu.tsx +13 -7
  55. package/src/components/Menubar.tsx +287 -0
  56. package/src/components/MultiSelect.tsx +7 -6
  57. package/src/components/Paper.tsx +2 -2
  58. package/src/components/Popover.tsx +3 -2
  59. package/src/components/RadioGroup.tsx +40 -9
  60. package/src/components/SearchBar.tsx +6 -6
  61. package/src/components/Select.tsx +24 -23
  62. package/src/components/Sheet.tsx +7 -7
  63. package/src/components/Skeleton.tsx +8 -5
  64. package/src/components/Table.tsx +6 -6
  65. package/src/components/Tabs.tsx +5 -5
  66. package/src/components/TextField.tsx +8 -7
  67. package/src/components/TextareaAutosize.tsx +3 -3
  68. package/src/components/Tooltip.tsx +4 -3
  69. package/src/components/Typography.tsx +20 -3
  70. package/src/components/common/SelectInputLabel.tsx +2 -2
  71. package/src/components/index.tsx +1 -1
  72. package/src/hooks/index.ts +4 -0
  73. package/src/hooks/useLocaleConfig.tsx +18 -0
  74. package/src/icons/Icon.tsx +44 -41
  75. package/src/index.ts +1 -0
  76. package/src/scripts/generateIconKeys.ts +0 -1
  77. package/src/styles.ts +6 -6
  78. package/src/util/cls.ts +14 -0
  79. package/src/util/index.ts +1 -3
  80. package/tailwind.config.js +70 -0
  81. package/dist/components/Spinner.d.ts +0 -1
  82. package/src/components/Spinner.tsx +0 -18
  83. package/src/util/cn.ts +0 -6
  84. /package/dist/{util → hooks}/useDebounceValue.d.ts +0 -0
  85. /package/dist/{util → hooks}/useInjectStyles.d.ts +0 -0
  86. /package/dist/{util → hooks}/useOutsideAlerter.d.ts +0 -0
  87. /package/src/{util → hooks}/useDebounceValue.tsx +0 -0
  88. /package/src/{util → hooks}/useInjectStyles.tsx +0 -0
  89. /package/src/{util → hooks}/useOutsideAlerter.tsx +0 -0
package/README.md CHANGED
@@ -49,7 +49,7 @@ FireCMS is based on this great technologies:
49
49
  The easiest way to get going is to check our quickstart guide! You will just
50
50
  need to follow some quick steps:
51
51
 
52
- https://firecms.co/docs/quickstart
52
+ https://firecms.co/docs
53
53
 
54
54
  ### Demo
55
55
 
@@ -4,6 +4,7 @@ export interface AvatarProps {
4
4
  alt?: string;
5
5
  children?: React.ReactNode;
6
6
  className?: string;
7
+ outerClassName?: string;
7
8
  style?: React.CSSProperties;
8
9
  }
9
10
  export declare const Avatar: React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<HTMLButtonElement>>;
@@ -3,7 +3,7 @@ export type BooleanSwitchProps = {
3
3
  value: boolean | null;
4
4
  className?: string;
5
5
  disabled?: boolean;
6
- size?: "small" | "medium";
6
+ size?: "small" | "medium" | "large";
7
7
  } & ({
8
8
  allowIndeterminate: true;
9
9
  onValueChange?: (newValue: boolean | null) => void;
@@ -1,7 +1,9 @@
1
1
  import React from "react";
2
- export declare function CenteredView({ children, maxWidth, className, fullScreen }: {
2
+ export type CenteredViewProps = {
3
3
  children: React.ReactNode;
4
4
  maxWidth?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl";
5
+ outerClassName?: string;
5
6
  className?: string;
6
7
  fullScreen?: boolean;
7
- }): import("react/jsx-runtime").JSX.Element;
8
+ };
9
+ export declare const CenteredView: React.ForwardRefExoticComponent<CenteredViewProps & React.RefAttributes<HTMLDivElement>>;
@@ -1,10 +1,11 @@
1
- interface CheckboxProps {
1
+ export interface CheckboxProps {
2
2
  checked: boolean;
3
+ id?: string;
3
4
  disabled?: boolean;
4
5
  indeterminate?: boolean;
5
6
  onCheckedChange?: (checked: boolean) => void;
7
+ padding?: boolean;
6
8
  size?: "tiny" | "small" | "medium" | "large";
7
9
  color?: "primary" | "secondary";
8
10
  }
9
- export declare const Checkbox: ({ checked, indeterminate, disabled, size, onCheckedChange, color }: CheckboxProps) => import("react/jsx-runtime").JSX.Element;
10
- export {};
11
+ export declare const Checkbox: ({ id, checked, indeterminate, padding, disabled, size, onCheckedChange, color }: CheckboxProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,12 +1,12 @@
1
1
  import React from "react";
2
2
  interface DateTimeFieldProps {
3
3
  value?: Date;
4
- onChange: (date: Date | null) => void;
4
+ onChange: (date: Date | undefined) => void;
5
5
  mode?: "date" | "date_time";
6
6
  disabled?: boolean;
7
7
  clearable?: boolean;
8
8
  error?: boolean;
9
- size: "small" | "medium";
9
+ size?: "small" | "medium";
10
10
  label?: React.ReactNode;
11
11
  className?: string;
12
12
  style?: React.CSSProperties;
@@ -6,6 +6,6 @@ export type InputLabelProps = {
6
6
  } & React.LabelHTMLAttributes<HTMLLabelElement>;
7
7
  export declare const InputLabel: React.ForwardRefExoticComponent<{
8
8
  children?: React.ReactNode;
9
- className?: string | undefined;
10
- shrink?: boolean | undefined;
9
+ className?: string;
10
+ shrink?: boolean;
11
11
  } & React.LabelHTMLAttributes<HTMLLabelElement> & React.RefAttributes<HTMLLabelElement>>;
@@ -1,4 +1,7 @@
1
1
  import * as React from "react";
2
2
  import * as LabelPrimitive from "@radix-ui/react-label";
3
- declare const Label: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & React.RefAttributes<HTMLLabelElement>>;
3
+ declare const Label: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & {
4
+ border?: boolean;
5
+ onClick?: React.MouseEventHandler<HTMLLabelElement>;
6
+ } & React.RefAttributes<HTMLLabelElement>>;
4
7
  export { Label };
@@ -1,6 +1,7 @@
1
1
  import React from "react";
2
2
  export interface MarkdownProps {
3
3
  source: string;
4
+ size?: "small" | "medium" | "large" | "xl" | "2xl";
4
5
  className?: string;
5
6
  }
6
7
  /**
@@ -13,4 +13,5 @@ export type MenuItemProps = {
13
13
  dense?: boolean;
14
14
  onClick?: (event: React.MouseEvent) => void;
15
15
  };
16
- export declare function MenuItem({ children, dense, onClick }: MenuItemProps): import("react/jsx-runtime").JSX.Element;
16
+ export declare function MenuItem({ children, dense, // Default value is false if not provided
17
+ onClick }: MenuItemProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,69 @@
1
+ export declare function Menubar({ children, className }: {
2
+ children: React.ReactNode;
3
+ className?: string;
4
+ }): import("react/jsx-runtime").JSX.Element;
5
+ export declare function MenubarMenu({ children, }: {
6
+ children: React.ReactNode;
7
+ }): import("react/jsx-runtime").JSX.Element;
8
+ export declare function MenubarTrigger({ children, className }: {
9
+ children: React.ReactNode;
10
+ className?: string;
11
+ }): import("react/jsx-runtime").JSX.Element;
12
+ export declare function MenubarPortal({ children, }: {
13
+ children: React.ReactNode;
14
+ }): import("react/jsx-runtime").JSX.Element;
15
+ export declare function MenubarContent({ children, className, align, sideOffset, alignOffset, ...rest }: {
16
+ children: React.ReactNode;
17
+ className?: string;
18
+ align?: "start" | "center" | "end";
19
+ sideOffset?: number;
20
+ alignOffset?: number;
21
+ }): import("react/jsx-runtime").JSX.Element;
22
+ export declare function MenubarItem({ children, leftPadding, className, disabled, ...rest }: {
23
+ children: React.ReactNode;
24
+ leftPadding?: boolean;
25
+ className?: string;
26
+ disabled?: boolean;
27
+ }): import("react/jsx-runtime").JSX.Element;
28
+ export declare function MenubarSeparator({ children, className, ...rest }: {
29
+ children?: React.ReactNode;
30
+ className?: string;
31
+ }): import("react/jsx-runtime").JSX.Element;
32
+ export declare function MenubarSub({ children, ...rest }: {
33
+ children?: React.ReactNode;
34
+ }): import("react/jsx-runtime").JSX.Element;
35
+ export declare function MenubarSubTrigger({ children, className, ...rest }: {
36
+ children?: React.ReactNode;
37
+ className?: string;
38
+ }): import("react/jsx-runtime").JSX.Element;
39
+ export declare function MenubarSubContent({ children, alignOffset, className, ...rest }: {
40
+ children?: React.ReactNode;
41
+ alignOffset?: number;
42
+ className?: string;
43
+ }): import("react/jsx-runtime").JSX.Element;
44
+ export declare function MenubarCheckboxItem({ children, checked, onCheckedChange, className, ...rest }: {
45
+ children?: React.ReactNode;
46
+ checked?: boolean;
47
+ onCheckedChange?: () => void;
48
+ className?: string;
49
+ }): import("react/jsx-runtime").JSX.Element;
50
+ export declare function MenubarItemIndicator({ children, className, ...rest }: {
51
+ children?: React.ReactNode;
52
+ className?: string;
53
+ }): import("react/jsx-runtime").JSX.Element;
54
+ export declare function MenubarRadioGroup({ children, className, value, onValueChange, ...rest }: {
55
+ children?: React.ReactNode;
56
+ value?: string;
57
+ onValueChange?: (value: string) => void;
58
+ className?: string;
59
+ }): import("react/jsx-runtime").JSX.Element;
60
+ export declare function MenubarRadioItem({ children, className, value, ...rest }: {
61
+ children?: React.ReactNode;
62
+ value: string;
63
+ className?: string;
64
+ }): import("react/jsx-runtime").JSX.Element;
65
+ export declare function MenubarShortcut({ children, className, ...rest }: {
66
+ children?: React.ReactNode;
67
+ className?: string;
68
+ }): import("react/jsx-runtime").JSX.Element;
69
+ export declare function MenubarSubTriggerIndicator(): import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,27 @@
1
1
  import * as React from "react";
2
- import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
3
- declare const RadioGroup: React.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
4
- declare const RadioGroupItem: React.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupItemProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
2
+ export interface RadioGroupProps {
3
+ id?: string;
4
+ children: React.ReactNode;
5
+ name?: string;
6
+ required?: boolean;
7
+ disabled?: boolean;
8
+ /**
9
+ * Whether keyboard navigation should loop around
10
+ * @defaultValue false
11
+ */
12
+ loop?: boolean;
13
+ defaultValue?: string;
14
+ value?: string;
15
+ onValueChange?(value: string): void;
16
+ className?: string;
17
+ }
18
+ declare const RadioGroup: React.ForwardRefExoticComponent<RadioGroupProps & React.RefAttributes<HTMLDivElement>>;
19
+ export interface RadioGroupItemProps {
20
+ id?: string;
21
+ value: string;
22
+ checked?: boolean;
23
+ required?: boolean;
24
+ className?: string;
25
+ }
26
+ declare const RadioGroupItem: React.ForwardRefExoticComponent<RadioGroupItemProps & React.RefAttributes<HTMLButtonElement>>;
5
27
  export { RadioGroup, RadioGroupItem };
@@ -14,7 +14,7 @@ export type SelectProps = {
14
14
  renderValue?: (value: string, index: number) => React.ReactNode;
15
15
  renderValues?: (values: string[]) => React.ReactNode;
16
16
  size?: "small" | "medium";
17
- label?: React.ReactNode;
17
+ label?: React.ReactNode | string;
18
18
  disabled?: boolean;
19
19
  error?: boolean;
20
20
  position?: "item-aligned" | "popper";
@@ -13,7 +13,7 @@ export type TextFieldProps<T extends string | number> = {
13
13
  endAdornment?: React.ReactNode;
14
14
  autoFocus?: boolean;
15
15
  placeholder?: string;
16
- size?: "small" | "medium";
16
+ size?: "smallest" | "small" | "medium";
17
17
  className?: string;
18
18
  style?: React.CSSProperties;
19
19
  inputClassName?: string;
@@ -3,40 +3,9 @@ type State = {
3
3
  outerHeightStyle: number;
4
4
  overflow?: boolean | undefined;
5
5
  };
6
- export declare const TextareaAutosize: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLTextAreaElement>, "onResize"> & {
7
- className?: string | undefined;
8
- shadowClassName?: string | undefined;
9
- /**
10
- * Maximum number of rows to display.
11
- */
12
- maxRows?: string | number | undefined;
13
- /**
14
- * Minimum number of rows to display.
15
- * @default 1
16
- */
17
- minRows?: string | number | undefined;
18
- /**
19
- * @ignore
20
- */
21
- onChange?: ((event: React.ChangeEvent<HTMLTextAreaElement>) => void) | undefined;
22
- /**
23
- * @ignore
24
- */
25
- placeholder?: string | undefined;
26
- /**
27
- * @ignore
28
- */
29
- style?: object | undefined;
30
- /**
31
- * @ignore
32
- */
33
- value?: string | number | string[] | undefined;
34
- sizeRef?: React.RefObject<HTMLDivElement> | undefined;
35
- onScroll?: ((event: React.UIEvent<HTMLTextAreaElement>) => void) | undefined;
36
- onResize?: ((state: State) => void) | undefined;
37
- autoFocus?: boolean | undefined;
38
- ignoreBoxSizing?: boolean | undefined;
39
- } & React.RefAttributes<Element>>;
6
+ export declare const TextareaAutosize: React.FC<TextareaAutosizeProps & {
7
+ ref?: React.ForwardedRef<Element>;
8
+ }>;
40
9
  export type TextareaAutosizeProps = Omit<React.InputHTMLAttributes<HTMLTextAreaElement>, "onResize"> & {
41
10
  className?: string;
42
11
  shadowClassName?: string;
@@ -24,6 +24,7 @@ export * from "./Label";
24
24
  export * from "./LoadingButton";
25
25
  export * from "./Markdown";
26
26
  export * from "./Menu";
27
+ export * from "./Menubar";
27
28
  export * from "./MultiSelect";
28
29
  export * from "./Paper";
29
30
  export * from "./RadioGroup";
@@ -31,7 +32,6 @@ export * from "./SearchBar";
31
32
  export * from "./Select";
32
33
  export * from "./Separator";
33
34
  export * from "./Sheet";
34
- export * from "./Spinner";
35
35
  export * from "./TextareaAutosize";
36
36
  export * from "./TextField";
37
37
  export * from "./Tooltip";
@@ -0,0 +1,4 @@
1
+ export * from "./useLocaleConfig";
2
+ export * from "./useInjectStyles";
3
+ export * from "./useOutsideAlerter";
4
+ export * from "./useDebounceValue";
@@ -0,0 +1 @@
1
+ export declare function useLocaleConfig(locale?: string): void;
@@ -8,6 +8,6 @@ export type IconProps = {
8
8
  onClick?: (e: React.SyntheticEvent) => void;
9
9
  style?: React.CSSProperties;
10
10
  };
11
- export declare function Icon({ iconKey, size, color, className, onClick, style }: IconProps & {
11
+ export declare const Icon: React.ForwardRefExoticComponent<IconProps & {
12
12
  iconKey: string;
13
- }): import("react/jsx-runtime").JSX.Element;
13
+ } & React.RefAttributes<HTMLSpanElement>>;
package/dist/index.d.ts CHANGED
@@ -2,3 +2,4 @@ export * from "./components";
2
2
  export * from "./styles";
3
3
  export * from "./util";
4
4
  export * from "./icons";
5
+ export * from "./hooks";