@firecms/ui 3.0.0-canary.148 → 3.0.0-canary.149
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/dist/components/Button.d.ts +1 -1
- package/dist/components/Tabs.d.ts +4 -2
- package/dist/index.es.js +12 -9
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +12 -9
- package/dist/index.umd.js.map +1 -1
- package/package.json +2 -2
- package/src/components/Button.tsx +6 -6
- package/src/components/MultiSelect.tsx +1 -1
- package/src/components/Tabs.tsx +8 -3
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.
|
4
|
+
"version": "3.0.0-canary.149",
|
5
5
|
"description": "Awesome Firebase/Firestore-based headless open-source CMS",
|
6
6
|
"funding": {
|
7
7
|
"url": "https://github.com/sponsors/firecmsco"
|
@@ -108,7 +108,7 @@
|
|
108
108
|
"index.css",
|
109
109
|
"tailwind.config.js"
|
110
110
|
],
|
111
|
-
"gitHead": "
|
111
|
+
"gitHead": "c359b0324515a679faf93c74791263bc27c4087d",
|
112
112
|
"publishConfig": {
|
113
113
|
"access": "public"
|
114
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" | "
|
7
|
+
variant?: "filled" | "neutral" | "outlined" | "text";
|
8
8
|
disabled?: boolean;
|
9
9
|
color?: "primary" | "secondary" | "text" | "error";
|
10
10
|
size?: "small" | "medium" | "large" | "xl" | "2xl";
|
@@ -54,15 +54,15 @@ const ButtonInner = React.forwardRef<
|
|
54
54
|
"border border-red-500 text-red-500 hover:text-red-500 hover:bg-red-500 hover:text-white": variant === "outlined" && color === "error" && !disabled,
|
55
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
56
|
|
57
|
-
//
|
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 === "
|
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 === "
|
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-
|
57
|
+
// Neutral 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 === "neutral" && (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 === "neutral" && 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-error": variant === "neutral" && color === "error" && !disabled,
|
61
61
|
|
62
62
|
// Disabled states for all variants
|
63
63
|
"border border-transparent opacity-50": variant === "text" && disabled,
|
64
64
|
"border border-surface-500 opacity-50": variant === "outlined" && disabled,
|
65
|
-
"border border-surface-500 bg-surface-500 opacity-50": (variant === "filled" || variant === "
|
65
|
+
"border border-surface-500 bg-surface-500 opacity-50": (variant === "filled" || variant === "neutral") && disabled,
|
66
66
|
});
|
67
67
|
|
68
68
|
const sizeClasses = cls(
|
@@ -279,7 +279,7 @@ export const MultiSelect = React.forwardRef<
|
|
279
279
|
<CommandPrimitive>
|
280
280
|
<div className={"flex flex-row items-center"}>
|
281
281
|
<CommandPrimitive.Input
|
282
|
-
className={cls(focusedDisabled, "bg-transparent outline-none flex-1 h-full w-full m-4 flex-grow")}
|
282
|
+
className={cls(focusedDisabled, "bg-transparent outline-none flex-1 h-full w-full m-4 flex-grow ")}
|
283
283
|
placeholder="Search..."
|
284
284
|
onKeyDown={handleInputKeyDown}
|
285
285
|
/>
|
package/src/components/Tabs.tsx
CHANGED
@@ -5,6 +5,7 @@ import { cls } from "../util";
|
|
5
5
|
export type TabsProps = {
|
6
6
|
value: string,
|
7
7
|
children: React.ReactNode,
|
8
|
+
innerClassName?: string,
|
8
9
|
className?: string,
|
9
10
|
onValueChange: (value: string) => void
|
10
11
|
};
|
@@ -13,13 +14,14 @@ export function Tabs({
|
|
13
14
|
value,
|
14
15
|
onValueChange,
|
15
16
|
className,
|
17
|
+
innerClassName,
|
16
18
|
children
|
17
19
|
}: TabsProps) {
|
18
20
|
|
19
|
-
return <TabsPrimitive.Root value={value} onValueChange={onValueChange}>
|
21
|
+
return <TabsPrimitive.Root value={value} onValueChange={onValueChange} className={className}>
|
20
22
|
<TabsPrimitive.List className={cls(
|
21
23
|
"flex text-sm font-medium text-center text-surface-accent-800 dark:text-white max-w-full overflow-auto no-scrollbar",
|
22
|
-
|
24
|
+
innerClassName)
|
23
25
|
}>
|
24
26
|
{children}
|
25
27
|
</TabsPrimitive.List>
|
@@ -29,6 +31,7 @@ export function Tabs({
|
|
29
31
|
export type TabProps = {
|
30
32
|
value: string,
|
31
33
|
className?: string,
|
34
|
+
innerClassName?: string,
|
32
35
|
children: React.ReactNode,
|
33
36
|
disabled?: boolean
|
34
37
|
};
|
@@ -36,6 +39,7 @@ export type TabProps = {
|
|
36
39
|
export function Tab({
|
37
40
|
value,
|
38
41
|
className,
|
42
|
+
innerClassName,
|
39
43
|
children,
|
40
44
|
disabled
|
41
45
|
}: TabProps) {
|
@@ -53,7 +57,8 @@ export function Tab({
|
|
53
57
|
// "data-[state=active]:bg-surface-accent-50 data-[state=active]:dark:bg-surface-accent-800",
|
54
58
|
className)}>
|
55
59
|
<div className={cls("uppercase inline-block p-2 px-4 m-2 rounded",
|
56
|
-
"hover:bg-surface-accent-200 hover:bg-opacity-75 dark:hover:bg-surface-accent-800"
|
60
|
+
"hover:bg-surface-accent-200 hover:bg-opacity-75 dark:hover:bg-surface-accent-800",
|
61
|
+
innerClassName)}>
|
57
62
|
{children}
|
58
63
|
</div>
|
59
64
|
</TabsPrimitive.Trigger>;
|