@firecms/ui 3.0.0-canary.56 → 3.0.0-canary.58

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 (55) hide show
  1. package/dist/components/Menubar.d.ts +69 -0
  2. package/dist/components/index.d.ts +1 -0
  3. package/dist/index.es.js +8117 -7871
  4. package/dist/index.es.js.map +1 -1
  5. package/dist/index.umd.js +10 -10
  6. package/dist/index.umd.js.map +1 -1
  7. package/dist/util/{cn.d.ts → cls.d.ts} +4 -0
  8. package/dist/util/index.d.ts +1 -1
  9. package/package.json +3 -2
  10. package/src/components/Alert.tsx +2 -2
  11. package/src/components/Autocomplete.tsx +3 -3
  12. package/src/components/Avatar.tsx +4 -4
  13. package/src/components/BooleanSwitch.tsx +4 -4
  14. package/src/components/BooleanSwitchWithLabel.tsx +3 -3
  15. package/src/components/Button.tsx +5 -5
  16. package/src/components/Card.tsx +2 -2
  17. package/src/components/CenteredView.tsx +3 -3
  18. package/src/components/Checkbox.tsx +3 -3
  19. package/src/components/Chip.tsx +2 -2
  20. package/src/components/CircularProgress.tsx +2 -2
  21. package/src/components/Collapse.tsx +2 -2
  22. package/src/components/Container.tsx +2 -2
  23. package/src/components/DateTimeField.tsx +5 -5
  24. package/src/components/Dialog.tsx +4 -4
  25. package/src/components/DialogActions.tsx +2 -2
  26. package/src/components/DialogContent.tsx +2 -2
  27. package/src/components/ExpandablePanel.tsx +5 -5
  28. package/src/components/FileUpload.tsx +2 -2
  29. package/src/components/IconButton.tsx +2 -2
  30. package/src/components/InfoLabel.tsx +2 -2
  31. package/src/components/InputLabel.tsx +2 -2
  32. package/src/components/Label.tsx +2 -2
  33. package/src/components/Markdown.tsx +2 -2
  34. package/src/components/Menu.tsx +3 -3
  35. package/src/components/Menubar.tsx +284 -0
  36. package/src/components/MultiSelect.tsx +6 -6
  37. package/src/components/Paper.tsx +2 -2
  38. package/src/components/Popover.tsx +2 -2
  39. package/src/components/RadioGroup.tsx +3 -3
  40. package/src/components/SearchBar.tsx +3 -3
  41. package/src/components/Select.tsx +9 -9
  42. package/src/components/Sheet.tsx +3 -3
  43. package/src/components/Skeleton.tsx +2 -2
  44. package/src/components/Table.tsx +6 -6
  45. package/src/components/Tabs.tsx +5 -5
  46. package/src/components/TextField.tsx +5 -5
  47. package/src/components/TextareaAutosize.tsx +2 -2
  48. package/src/components/Tooltip.tsx +2 -2
  49. package/src/components/Typography.tsx +2 -2
  50. package/src/components/common/SelectInputLabel.tsx +2 -2
  51. package/src/components/index.tsx +1 -0
  52. package/src/icons/Icon.tsx +2 -2
  53. package/src/util/cls.ts +14 -0
  54. package/src/util/index.ts +1 -1
  55. package/src/util/cn.ts +0 -6
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import { useLayoutEffect } from "react";
3
3
  import * as ReactDOM from "react-dom";
4
- import { cn, debounce } from "../util";
4
+ import { cls, debounce } from "../util";
5
5
 
6
6
  type State = {
7
7
  outerHeightStyle: number;
@@ -276,7 +276,7 @@ export const TextareaAutosize = React.forwardRef(function TextareaAutosize(
276
276
  />
277
277
  <textarea
278
278
  aria-hidden
279
- className={cn(props.className, props.shadowClassName)}
279
+ className={cls(props.className, props.shadowClassName)}
280
280
  readOnly
281
281
  ref={shadowRef}
282
282
  tabIndex={-1}
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import * as TooltipPrimitive from "@radix-ui/react-tooltip";
3
3
 
4
- import { cn } from "../util";
4
+ import { cls } from "../util";
5
5
  import { useInjectStyles } from "../hooks";
6
6
 
7
7
  export type TooltipProps = {
@@ -47,7 +47,7 @@ export const Tooltip = ({
47
47
  </TooltipPrimitive.Trigger>
48
48
  <TooltipPrimitive.Portal>
49
49
  <TooltipPrimitive.Content
50
- className={cn("TooltipContent",
50
+ className={cls("TooltipContent",
51
51
  "max-w-lg leading-relaxed",
52
52
  "z-50 rounded px-3 py-2 text-xs leading-none bg-slate-700 dark:bg-slate-800 bg-opacity-90 font-medium text-slate-50 shadow-2xl select-none duration-400 ease-in transform opacity-100",
53
53
  tooltipClassName)}
@@ -1,6 +1,6 @@
1
1
  import React, { ReactEventHandler } from "react";
2
2
  import { focusedMixin } from "../styles";
3
- import { cn } from "../util";
3
+ import { cls } from "../util";
4
4
 
5
5
  export type TextProps<C extends React.ElementType> = {
6
6
  align?: "center" | "inherit" | "justify" | "left" | "right";
@@ -99,7 +99,7 @@ export function Typography<C extends React.ElementType>(
99
99
  (paragraph ? "p" : variantMapping[variant] || defaultVariantMapping[variant]) ||
100
100
  "span";
101
101
 
102
- const classes = cn(
102
+ const classes = cls(
103
103
  focusedMixin,
104
104
  variantToClasses[variant],
105
105
  color ? colorToClasses[color] : "",
@@ -1,8 +1,8 @@
1
1
  import React from "react";
2
- import { cn } from "../../util";
2
+ import { cls } from "../../util";
3
3
 
4
4
  export function SelectInputLabel({ children, error }: { children: React.ReactNode, error?: boolean }) {
5
- return <div className={cn("text-sm font-medium ml-3.5 mb-1",
5
+ return <div className={cls("text-sm font-medium ml-3.5 mb-1",
6
6
  error ? "text-red-500 dark:text-red-600" : "text-slate-500 dark:text-slate-300",)}>
7
7
  {children}
8
8
  </div>;
@@ -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";
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  import "@material-design-icons/font/filled.css";
3
- import { cn } from "../util";
3
+ import { cls } from "../util";
4
4
 
5
5
  export type IconColor = "inherit" | "primary" | "secondary" | "disabled" | "error" | "success" | "warning";
6
6
  export type IconProps = {
@@ -56,7 +56,7 @@ export const Icon = React.forwardRef<HTMLSpanElement, IconProps & { iconKey: str
56
56
  ...style
57
57
  }}
58
58
  className={
59
- cn("material-icons",
59
+ cls("material-icons",
60
60
  color ? colorClassesMapping[color] : "",
61
61
  "select-none",
62
62
  className)}
@@ -0,0 +1,14 @@
1
+ import { type ClassValue, clsx } from "clsx";
2
+ import { twMerge } from "tailwind-merge";
3
+
4
+ export function cls(...classes: ClassValue[]) {
5
+ return twMerge(clsx(classes))
6
+ }
7
+
8
+ /**
9
+ * @deprecated
10
+ */
11
+ export function cn(...classes: ClassValue[]) {
12
+ console.warn("cn() is deprecated, use cls() instead. cn will be removed in the final 3.0.0 version");
13
+ return cls(...classes)
14
+ }
package/src/util/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- export * from "./cn";
1
+ export * from "./cls";
2
2
  export * from "./debounce";
3
3
  export * from "./chip_colors";
4
4
  export * from "./key_to_icon_component";
package/src/util/cn.ts DELETED
@@ -1,6 +0,0 @@
1
- import { type ClassValue, clsx } from "clsx";
2
- import { twMerge } from "tailwind-merge";
3
-
4
- export function cn(...classes: ClassValue[]) {
5
- return twMerge(clsx(classes))
6
- }