@firecms/ui 3.0.0-canary.209 → 3.0.0-canary.210

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.209",
4
+ "version": "3.0.0-canary.210",
5
5
  "description": "Awesome Firebase/Firestore-based headless open-source CMS",
6
6
  "funding": {
7
7
  "url": "https://github.com/sponsors/firecmsco"
@@ -115,7 +115,7 @@
115
115
  "index.css",
116
116
  "tailwind.config.js"
117
117
  ],
118
- "gitHead": "9e3b4e8746ea9405f8c7b51e058a1a8c5a63f86b",
118
+ "gitHead": "b8bcb3a2230e8b02644ce5ed0891b273e7e7d630",
119
119
  "publishConfig": {
120
120
  "access": "public"
121
121
  }
@@ -2,9 +2,7 @@
2
2
  import React from "react";
3
3
  import { cls } from "../util";
4
4
 
5
- export type ButtonProps<P extends React.ElementType> =
6
- Omit<(P extends "button" ? React.ButtonHTMLAttributes<HTMLButtonElement> : React.ComponentProps<P>), "onClick">
7
- & {
5
+ export type ButtonProps<C extends React.ElementType = "button"> = {
8
6
  children?: React.ReactNode;
9
7
  variant?: "filled" | "neutral" | "outlined" | "text";
10
8
  disabled?: boolean;
@@ -13,11 +11,13 @@ export type ButtonProps<P extends React.ElementType> =
13
11
  startIcon?: React.ReactNode;
14
12
  fullWidth?: boolean;
15
13
  className?: string;
16
- onClick?: React.MouseEventHandler<any>
17
- };
14
+ component?: C;
15
+ onClick?: React.MouseEventHandler<any>;
16
+ } & React.ComponentPropsWithoutRef<C>;
18
17
 
19
18
  const ButtonInner = React.forwardRef<
20
- ButtonProps<React.ElementType<any>>
19
+ HTMLButtonElement,
20
+ ButtonProps<React.ElementType>
21
21
  >(({
22
22
  children,
23
23
  className,
@@ -45,8 +45,8 @@ const ButtonInner = React.forwardRef<
45
45
  "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,
46
46
 
47
47
  // Text Variants
48
- "border border-transparent text-primary hover:text-primary hover:bg-surface-accent-200 dark:hover:bg-surface-900": variant === "text" && color === "primary" && !disabled,
49
- "border border-transparent text-secondary hover:text-secondary hover:bg-secondary-bg": variant === "text" && color === "secondary" && !disabled,
48
+ "border border-transparent text-primary hover:text-primary hover:bg-surface-accent-200 hover:bg-opacity-75 dark:hover:bg-surface-accent-800": variant === "text" && color === "primary" && !disabled,
49
+ "border border-transparent text-secondary hover:text-secondary hover:bg-surface-accent-200 hover:bg-opacity-75 dark:hover:bg-surface-accent-800": variant === "text" && color === "secondary" && !disabled,
50
50
  "border border-transparent text-red-500 hover:text-red-500 hover:bg-red-500 hover:bg-opacity-10": variant === "text" && color === "error" && !disabled,
51
51
  "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,
52
52
 
@@ -84,7 +84,7 @@ const ButtonInner = React.forwardRef<
84
84
  ref={ref}
85
85
  onClick={props.onClick}
86
86
  className={cls(startIcon ? "pl-3" : "", baseClasses, buttonClasses, sizeClasses, className)}
87
- {...(props as React.ComponentPropsWithRef<any>)}>
87
+ {...props}>
88
88
  {startIcon}
89
89
  {children}
90
90
  </Component>
@@ -5,7 +5,6 @@ import { cls } from "../util";
5
5
  export type IconButtonProps<C extends React.ElementType> =
6
6
  Omit<(C extends "button" ? React.ButtonHTMLAttributes<HTMLButtonElement> : React.ComponentProps<C>), "onClick">
7
7
  & {
8
- children?: React.ReactNode;
9
8
  size?: "medium" | "small" | "smallest" | "large";
10
9
  variant?: "ghost" | "filled",
11
10
  shape?: "circular" | "square",
@@ -44,7 +44,7 @@ export function MenubarTrigger({
44
44
  return (
45
45
  <MenubarPrimitive.Trigger
46
46
  onSelect={onSelect}
47
- className={cls("py-2 px-3 outline-none select-none font-medium leading-none rounded text-text-primary dark:text-text-primary-dark text-[13px] flex items-center justify-between gap-[2px] data-[highlighted]:bg-surface-accent-100 data-[highlighted]:dark:bg-surface-800 data-[state=open]:bg-surface-accent-100 data-[state=open]:dark:bg-surface-800 hover:bg-surface-accent-200 hover:bg-opacity-75 dark:hover:bg-surface-700 dark:hover:bg-opacity-50",
47
+ className={cls("py-2 px-3 outline-none select-none font-medium leading-none rounded text-text-primary dark:text-text-primary-dark text-[13px] flex items-center justify-between gap-[2px] data-[highlighted]:bg-surface-accent-100 data-[highlighted]:dark:bg-surface-800 data-[state=open]:bg-surface-accent-100 data-[state=open]:dark:bg-surface-800 hover:bg-surface-accent-200 hover:bg-opacity-75 dark:hover:bg-surface-accent-800",
48
48
  className)}>
49
49
  {children}
50
50
  </MenubarPrimitive.Trigger>