@firecms/ui 3.0.0-canary.146 → 3.0.0-canary.148

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@firecms/ui",
3
3
  "type": "module",
4
- "version": "3.0.0-canary.146",
4
+ "version": "3.0.0-canary.148",
5
5
  "description": "Awesome Firebase/Firestore-based headless open-source CMS",
6
6
  "funding": {
7
7
  "url": "https://github.com/sponsors/firecmsco"
@@ -105,9 +105,10 @@
105
105
  "files": [
106
106
  "dist",
107
107
  "src",
108
+ "index.css",
108
109
  "tailwind.config.js"
109
110
  ],
110
- "gitHead": "601e622a79787f5b08f7ac27646d044787b972f1",
111
+ "gitHead": "69ccd5bec8161008d5219388a34b49ccdccda040",
111
112
  "publishConfig": {
112
113
  "access": "public"
113
114
  }
@@ -4,7 +4,7 @@ import { cls } from "../util";
4
4
  export type ButtonProps<P extends React.ElementType> =
5
5
  Omit<(P extends "button" ? React.ButtonHTMLAttributes<HTMLButtonElement> : React.ComponentProps<P>), "onClick">
6
6
  & {
7
- variant?: "filled" | "outlined" | "text";
7
+ variant?: "filled" | "ghost" | "outlined" | "text";
8
8
  disabled?: boolean;
9
9
  color?: "primary" | "secondary" | "text" | "error";
10
10
  size?: "small" | "medium" | "large" | "xl" | "2xl";
@@ -35,25 +35,34 @@ const ButtonInner = React.forwardRef<
35
35
  const buttonClasses = cls({
36
36
  "w-full": fullWidth,
37
37
  "w-fit": !fullWidth,
38
+
38
39
  // Filled Variants
39
40
  "border border-primary bg-primary hover:bg-primary-dark focus:ring-primary shadow hover:ring-1 hover:ring-primary text-white hover:text-white": variant === "filled" && color === "primary" && !disabled,
40
41
  "border border-secondary bg-secondary hover:bg-secondary-dark focus:ring-secondary shadow hover:ring-1 hover:ring-secondary text-white hover:text-white": variant === "filled" && color === "secondary" && !disabled,
41
42
  "border border-red-500 bg-red-500 hover:bg-red-500 focus:ring-red-500 shadow hover:ring-1 hover:ring-red-600 text-white hover:text-white": variant === "filled" && color === "error" && !disabled,
42
43
  "border border-surface-accent-200 bg-surface-accent-200 hover:bg-surface-accent-300 focus:ring-surface-accent-400 shadow hover:ring-1 hover:ring-surface-accent-400 text-text-primary hover:text-text-primary dark:text-text-primary-dark hover:dark:text-text-primary-dark": variant === "filled" && color === "text" && !disabled,
44
+
43
45
  // Text Variants
44
46
  "border border-transparent text-primary hover:text-primary hover:bg-surface-accent-200 dark:hover:bg-surface-900": variant === "text" && color === "primary" && !disabled,
45
47
  "border border-transparent text-secondary hover:text-secondary hover:bg-secondary-bg": variant === "text" && color === "secondary" && !disabled,
46
48
  "border border-transparent text-red-500 hover:text-red-500 hover:bg-red-500 hover:bg-opacity-10": variant === "text" && color === "error" && !disabled,
47
49
  "border border-transparent text-text-primary hover:text-text-primary dark:text-text-primary-dark hover:dark:text-text-primary-dark hover:bg-surface-accent-200 hover:dark:bg-surface-700": variant === "text" && color === "text" && !disabled,
50
+
48
51
  // Outlined Variants
49
52
  "border border-primary text-primary hover:text-primary hover:bg-primary-bg": variant === "outlined" && color === "primary" && !disabled,
50
53
  "border border-secondary text-secondary hover:text-secondary hover:bg-secondary-bg": variant === "outlined" && color === "secondary" && !disabled,
51
54
  "border border-red-500 text-red-500 hover:text-red-500 hover:bg-red-500 hover:text-white": variant === "outlined" && color === "error" && !disabled,
52
55
  "border border-surface-accent-400 text-text-primary hover:text-text-primary dark:text-text-primary-dark hover:bg-surface-accent-200": variant === "outlined" && color === "text" && !disabled,
56
+
57
+ // Ghost Variants
58
+ "border border-transparent bg-surface-100 hover:bg-surface-accent-200 text-text-primary dark:bg-surface-800 dark:hover:bg-surface-accent-700 dark:text-white": variant === "ghost" && (color === "primary" || color === "text") && !disabled,
59
+ "border border-transparent bg-surface-100 hover:bg-surface-accent-200 text-text-secondary dark:bg-surface-800 dark:hover:bg-surface-accent-700 dark:text-white": variant === "ghost" && color === "secondary" && !disabled,
60
+ "border border-transparent bg-surface-100 hover:bg-surface-accent-200 text-error dark:bg-surface-800 dark:hover:bg-surface-accent-700 dark:text-white": variant === "ghost" && color === "error" && !disabled,
61
+
53
62
  // Disabled states for all variants
54
63
  "border border-transparent opacity-50": variant === "text" && disabled,
55
64
  "border border-surface-500 opacity-50": variant === "outlined" && disabled,
56
- "border border-surface-500 bg-surface-500 opacity-50": variant === "filled" && disabled,
65
+ "border border-surface-500 bg-surface-500 opacity-50": (variant === "filled" || variant === "ghost") && disabled,
57
66
  });
58
67
 
59
68
  const sizeClasses = cls(
@@ -71,7 +80,7 @@ const ButtonInner = React.forwardRef<
71
80
  <Component
72
81
  ref={ref}
73
82
  onClick={props.onClick}
74
- className={cls( startIcon ? "pl-3" : "", baseClasses, buttonClasses, sizeClasses, className)}
83
+ className={cls(startIcon ? "pl-3" : "", baseClasses, buttonClasses, sizeClasses, className)}
75
84
  {...(props as React.ComponentPropsWithRef<any>)}>
76
85
  {startIcon}
77
86
  {children}
@@ -13,7 +13,7 @@ export type IconButtonProps<C extends React.ElementType> =
13
13
  onClick?: React.MouseEventHandler<any>
14
14
  }
15
15
 
16
- const buttonClasses = "hover:bg-surface-accent-200 hover:bg-opacity-75 dark:hover:bg-surface-accent-800";
16
+ const buttonClasses = "hover:bg-surface-accent-200 hover:bg-opacity-75 dark:hover:bg-surface-accent-800 hover:scale-110 transition-transform";
17
17
  const baseClasses = "inline-flex items-center justify-center p-2 text-sm font-medium focus:outline-none transition-colors ease-in-out duration-150";
18
18
  const colorClasses = "text-surface-accent-600 visited:text-surface-accent-600 dark:text-surface-accent-300 dark:visited:text-surface-300";
19
19
  const sizeClasses = {
@@ -168,6 +168,7 @@ export const MultiSelect = React.forwardRef<
168
168
  } else {
169
169
  updateValues(allValues);
170
170
  }
171
+ onPopoverOpenChange(false);
171
172
  };
172
173
 
173
174
  useInjectStyles("MultiSelect", `