@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.
- package/dist/components/Menubar.d.ts +69 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/index.es.js +8117 -7871
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +10 -10
- package/dist/index.umd.js.map +1 -1
- package/dist/util/{cn.d.ts → cls.d.ts} +4 -0
- package/dist/util/index.d.ts +1 -1
- package/package.json +3 -2
- package/src/components/Alert.tsx +2 -2
- package/src/components/Autocomplete.tsx +3 -3
- package/src/components/Avatar.tsx +4 -4
- package/src/components/BooleanSwitch.tsx +4 -4
- package/src/components/BooleanSwitchWithLabel.tsx +3 -3
- package/src/components/Button.tsx +5 -5
- package/src/components/Card.tsx +2 -2
- package/src/components/CenteredView.tsx +3 -3
- package/src/components/Checkbox.tsx +3 -3
- package/src/components/Chip.tsx +2 -2
- package/src/components/CircularProgress.tsx +2 -2
- package/src/components/Collapse.tsx +2 -2
- package/src/components/Container.tsx +2 -2
- package/src/components/DateTimeField.tsx +5 -5
- package/src/components/Dialog.tsx +4 -4
- package/src/components/DialogActions.tsx +2 -2
- package/src/components/DialogContent.tsx +2 -2
- package/src/components/ExpandablePanel.tsx +5 -5
- package/src/components/FileUpload.tsx +2 -2
- package/src/components/IconButton.tsx +2 -2
- package/src/components/InfoLabel.tsx +2 -2
- package/src/components/InputLabel.tsx +2 -2
- package/src/components/Label.tsx +2 -2
- package/src/components/Markdown.tsx +2 -2
- package/src/components/Menu.tsx +3 -3
- package/src/components/Menubar.tsx +284 -0
- package/src/components/MultiSelect.tsx +6 -6
- package/src/components/Paper.tsx +2 -2
- package/src/components/Popover.tsx +2 -2
- package/src/components/RadioGroup.tsx +3 -3
- package/src/components/SearchBar.tsx +3 -3
- package/src/components/Select.tsx +9 -9
- package/src/components/Sheet.tsx +3 -3
- package/src/components/Skeleton.tsx +2 -2
- package/src/components/Table.tsx +6 -6
- package/src/components/Tabs.tsx +5 -5
- package/src/components/TextField.tsx +5 -5
- package/src/components/TextareaAutosize.tsx +2 -2
- package/src/components/Tooltip.tsx +2 -2
- package/src/components/Typography.tsx +2 -2
- package/src/components/common/SelectInputLabel.tsx +2 -2
- package/src/components/index.tsx +1 -0
- package/src/icons/Icon.tsx +2 -2
- package/src/util/cls.ts +14 -0
- package/src/util/index.ts +1 -1
- 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 {
|
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={
|
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 {
|
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={
|
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 {
|
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 =
|
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 {
|
2
|
+
import { cls } from "../../util";
|
3
3
|
|
4
4
|
export function SelectInputLabel({ children, error }: { children: React.ReactNode, error?: boolean }) {
|
5
|
-
return <div className={
|
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>;
|
package/src/components/index.tsx
CHANGED
package/src/icons/Icon.tsx
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as React from "react";
|
2
2
|
import "@material-design-icons/font/filled.css";
|
3
|
-
import {
|
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
|
-
|
59
|
+
cls("material-icons",
|
60
60
|
color ? colorClassesMapping[color] : "",
|
61
61
|
"select-none",
|
62
62
|
className)}
|
package/src/util/cls.ts
ADDED
@@ -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