@firecms/ui 3.0.0-canary.14 → 3.0.0-canary.141
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/README.md +3 -3
- package/dist/components/Avatar.d.ts +1 -0
- package/dist/components/BooleanSwitch.d.ts +1 -1
- package/dist/components/CenteredView.d.ts +4 -2
- package/dist/components/Checkbox.d.ts +3 -2
- package/dist/components/Chip.d.ts +3 -2
- package/dist/components/DateTimeField.d.ts +5 -7
- package/dist/components/Dialog.d.ts +4 -1
- package/dist/components/DialogTitle.d.ts +9 -0
- package/dist/components/ExpandablePanel.d.ts +2 -1
- package/dist/components/FileUpload.d.ts +1 -1
- package/dist/components/InputLabel.d.ts +2 -2
- package/dist/components/Label.d.ts +4 -1
- package/dist/components/Markdown.d.ts +1 -0
- package/dist/components/Menu.d.ts +6 -2
- package/dist/components/Menubar.d.ts +79 -0
- package/dist/components/MultiSelect.d.ts +31 -16
- package/dist/components/Popover.d.ts +2 -1
- package/dist/components/RadioGroup.d.ts +26 -3
- package/dist/components/Select.d.ts +6 -10
- package/dist/components/Separator.d.ts +2 -1
- package/dist/components/Sheet.d.ts +6 -0
- package/dist/components/Slider.d.ts +21 -0
- package/dist/components/Table.d.ts +10 -10
- package/dist/components/TextField.d.ts +1 -1
- package/dist/components/TextareaAutosize.d.ts +3 -34
- package/dist/components/Tooltip.d.ts +6 -2
- package/dist/components/Typography.d.ts +5 -4
- package/dist/components/index.d.ts +3 -1
- package/dist/hooks/index.d.ts +3 -0
- package/dist/icons/Icon.d.ts +3 -3
- package/dist/index.css +73 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +13371 -14447
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +19782 -857
- package/dist/index.umd.js.map +1 -1
- package/dist/styles.d.ts +8 -8
- package/dist/util/{cn.d.ts → cls.d.ts} +4 -0
- package/dist/util/index.d.ts +1 -3
- package/package.json +111 -118
- package/src/components/Alert.tsx +2 -2
- package/src/components/Autocomplete.tsx +5 -3
- package/src/components/Avatar.tsx +8 -7
- package/src/components/Badge.tsx +1 -1
- package/src/components/BooleanSwitch.tsx +15 -15
- package/src/components/BooleanSwitchWithLabel.tsx +9 -8
- package/src/components/Button.tsx +18 -20
- package/src/components/Card.tsx +4 -3
- package/src/components/CenteredView.tsx +25 -15
- package/src/components/Checkbox.tsx +11 -9
- package/src/components/Chip.tsx +8 -5
- package/src/components/CircularProgress.tsx +2 -2
- package/src/components/Collapse.tsx +4 -2
- package/src/components/Container.tsx +2 -2
- package/src/components/DateTimeField.tsx +142 -921
- package/src/components/DebouncedTextField.tsx +1 -0
- package/src/components/Dialog.tsx +16 -6
- package/src/components/DialogActions.tsx +2 -2
- package/src/components/DialogContent.tsx +2 -2
- package/src/components/DialogTitle.tsx +35 -0
- package/src/components/ExpandablePanel.tsx +20 -12
- package/src/components/FileUpload.tsx +8 -10
- package/src/components/IconButton.tsx +4 -6
- package/src/components/InfoLabel.tsx +2 -2
- package/src/components/InputLabel.tsx +11 -9
- package/src/components/Label.tsx +17 -4
- package/src/components/Markdown.tsx +15 -3
- package/src/components/Menu.tsx +49 -31
- package/src/components/Menubar.tsx +322 -0
- package/src/components/MultiSelect.tsx +336 -165
- package/src/components/Paper.tsx +2 -2
- package/src/components/Popover.tsx +18 -14
- package/src/components/RadioGroup.tsx +41 -9
- package/src/components/SearchBar.tsx +9 -9
- package/src/components/Select.tsx +97 -124
- package/src/components/Separator.tsx +10 -4
- package/src/components/Sheet.tsx +52 -30
- package/src/components/Skeleton.tsx +9 -6
- package/src/components/Slider.tsx +109 -0
- package/src/components/Table.tsx +50 -33
- package/src/components/Tabs.tsx +6 -7
- package/src/components/TextField.tsx +14 -16
- package/src/components/TextareaAutosize.tsx +4 -3
- package/src/components/Tooltip.tsx +31 -14
- package/src/components/Typography.tsx +42 -26
- package/src/components/common/SelectInputLabel.tsx +2 -2
- package/src/components/index.tsx +3 -1
- package/src/hooks/index.ts +3 -0
- package/src/icons/Icon.tsx +46 -43
- package/src/icons/icon_keys.ts +114 -1301
- package/src/index.css +73 -0
- package/src/index.ts +1 -0
- package/src/scripts/generateIconKeys.ts +20 -11
- package/src/styles.ts +8 -8
- package/src/util/cls.ts +14 -0
- package/src/util/index.ts +1 -3
- package/tailwind.config.js +8 -6
- package/dist/components/Spinner.d.ts +0 -1
- package/src/components/Spinner.tsx +0 -18
- package/src/util/cn.ts +0 -6
- /package/dist/{util → hooks}/useDebounceValue.d.ts +0 -0
- /package/dist/{util → hooks}/useInjectStyles.d.ts +0 -0
- /package/dist/{util → hooks}/useOutsideAlerter.d.ts +0 -0
- /package/src/{util → hooks}/useDebounceValue.tsx +0 -0
- /package/src/{util → hooks}/useInjectStyles.tsx +0 -0
- /package/src/{util → hooks}/useOutsideAlerter.tsx +0 -0
package/src/components/index.tsx
CHANGED
@@ -15,6 +15,7 @@ export * from "./DateTimeField";
|
|
15
15
|
export * from "./Dialog";
|
16
16
|
export * from "./DialogActions";
|
17
17
|
export * from "./DialogContent";
|
18
|
+
export * from "./DialogTitle";
|
18
19
|
export * from "./ExpandablePanel";
|
19
20
|
export * from "./FileUpload";
|
20
21
|
export * from "./IconButton";
|
@@ -24,14 +25,15 @@ export * from "./Label";
|
|
24
25
|
export * from "./LoadingButton";
|
25
26
|
export * from "./Markdown";
|
26
27
|
export * from "./Menu";
|
28
|
+
export * from "./Menubar";
|
27
29
|
export * from "./MultiSelect";
|
28
30
|
export * from "./Paper";
|
29
31
|
export * from "./RadioGroup";
|
30
32
|
export * from "./SearchBar";
|
31
33
|
export * from "./Select";
|
32
34
|
export * from "./Separator";
|
35
|
+
export * from "./Slider";
|
33
36
|
export * from "./Sheet";
|
34
|
-
export * from "./Spinner";
|
35
37
|
export * from "./TextareaAutosize";
|
36
38
|
export * from "./TextField";
|
37
39
|
export * from "./Tooltip";
|
package/src/icons/Icon.tsx
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as React from "react";
|
2
|
-
import "
|
3
|
-
import
|
2
|
+
import { cls } from "../util";
|
3
|
+
import 'material-icons/iconfont/filled.css';
|
4
4
|
|
5
5
|
export type IconColor = "inherit" | "primary" | "secondary" | "disabled" | "error" | "success" | "warning";
|
6
6
|
export type IconProps = {
|
@@ -8,7 +8,7 @@ export type IconProps = {
|
|
8
8
|
color?: IconColor,
|
9
9
|
className?: string,
|
10
10
|
onClick?: (e: React.SyntheticEvent) => void,
|
11
|
-
style?: React.CSSProperties
|
11
|
+
style?: React.CSSProperties,
|
12
12
|
}
|
13
13
|
|
14
14
|
const colorClassesMapping: Record<IconColor, string> = {
|
@@ -17,47 +17,50 @@ const colorClassesMapping: Record<IconColor, string> = {
|
|
17
17
|
success: "text-green-500",
|
18
18
|
warning: "text-yellow-500",
|
19
19
|
secondary: "text-secondary",
|
20
|
-
disabled: "text-disabled dark:text-disabled-dark",
|
20
|
+
disabled: "text-text-disabled dark:text-text-disabled-dark",
|
21
21
|
error: "text-red-500"
|
22
22
|
}
|
23
23
|
|
24
|
-
export
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
24
|
+
export const Icon = React.forwardRef<HTMLSpanElement, IconProps & { iconKey: string }>(
|
25
|
+
({
|
26
|
+
iconKey,
|
27
|
+
size = "medium",
|
28
|
+
color,
|
29
|
+
className,
|
30
|
+
onClick,
|
31
|
+
style
|
32
|
+
}, ref) => {
|
33
|
+
let sizeInPx: number;
|
34
|
+
switch (size) {
|
35
|
+
case "smallest":
|
36
|
+
sizeInPx = 16;
|
37
|
+
break;
|
38
|
+
case "small":
|
39
|
+
sizeInPx = 20;
|
40
|
+
break;
|
41
|
+
case "medium":
|
42
|
+
sizeInPx = 24;
|
43
|
+
break;
|
44
|
+
case "large":
|
45
|
+
sizeInPx = 28;
|
46
|
+
break
|
47
|
+
default:
|
48
|
+
sizeInPx = typeof size === "number" ? size : 24;
|
49
|
+
}
|
50
50
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
}
|
51
|
+
return <span
|
52
|
+
ref={ref} // Attach the ref to the span
|
53
|
+
style={{
|
54
|
+
fontSize: `${sizeInPx}px`,
|
55
|
+
display: "block",
|
56
|
+
...style
|
57
|
+
}}
|
58
|
+
className={
|
59
|
+
cls("material-icons",
|
60
|
+
color ? colorClassesMapping[color] : "",
|
61
|
+
"select-none",
|
62
|
+
className)}
|
63
|
+
onClick={onClick}>{iconKey}</span>
|
64
|
+
});
|
65
|
+
|
66
|
+
Icon.displayName = "Icon";
|