@firecms/ui 3.0.0-canary.143 → 3.0.0-canary.145
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/index.es.js +112 -106
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +112 -106
- package/dist/index.umd.js.map +1 -1
- package/dist/styles.d.ts +8 -8
- package/package.json +2 -2
- package/src/components/Alert.tsx +2 -2
- package/src/components/Autocomplete.tsx +2 -2
- package/src/components/Avatar.tsx +36 -23
- package/src/components/Badge.tsx +1 -1
- package/src/components/BooleanSwitch.tsx +4 -4
- package/src/components/BooleanSwitchWithLabel.tsx +2 -2
- package/src/components/Button.tsx +6 -6
- package/src/components/Checkbox.tsx +5 -5
- package/src/components/Chip.tsx +2 -2
- package/src/components/CircularProgress.tsx +1 -1
- package/src/components/DateTimeField.tsx +3 -3
- package/src/components/Dialog.tsx +1 -1
- package/src/components/DialogActions.tsx +1 -1
- package/src/components/ExpandablePanel.tsx +1 -1
- package/src/components/IconButton.tsx +3 -3
- package/src/components/Label.tsx +2 -2
- package/src/components/Markdown.tsx +2 -2
- package/src/components/Menu.tsx +1 -1
- package/src/components/Menubar.tsx +9 -9
- package/src/components/MultiSelect.tsx +9 -9
- package/src/components/Popover.tsx +1 -1
- package/src/components/SearchBar.tsx +4 -3
- package/src/components/Select.tsx +6 -6
- package/src/components/Separator.tsx +2 -2
- package/src/components/Sheet.tsx +3 -3
- package/src/components/Skeleton.tsx +1 -1
- package/src/components/Slider.tsx +4 -4
- package/src/components/Table.tsx +6 -6
- package/src/components/Tabs.tsx +8 -8
- package/src/components/TextField.tsx +2 -2
- package/src/components/Tooltip.tsx +2 -2
- package/src/components/common/SelectInputLabel.tsx +1 -1
- package/src/styles.ts +8 -8
- package/tailwind.config.js +38 -25
@@ -115,7 +115,7 @@ export const Select = forwardRef<HTMLDivElement, SelectProps>(({
|
|
115
115
|
"select-none rounded-md text-sm",
|
116
116
|
error ? "text-red-500 dark:text-red-600" : "focus:text-text-primary dark:focus:text-text-primary-dark",
|
117
117
|
error ? "border border-red-500 dark:border-red-600" : "",
|
118
|
-
disabled ? "text-
|
118
|
+
disabled ? "text-surface-accent-600 dark:text-surface-accent-400" : "text-surface-accent-800 dark:text-white",
|
119
119
|
"relative flex flex-row items-center",
|
120
120
|
inputClassName
|
121
121
|
)}>
|
@@ -159,7 +159,7 @@ export const Select = forwardRef<HTMLDivElement, SelectProps>(({
|
|
159
159
|
</div>
|
160
160
|
<SelectPrimitive.Portal>
|
161
161
|
<SelectPrimitive.Content position={position}
|
162
|
-
className={cls(focusedDisabled, "z-50 relative overflow-hidden border bg-white dark:bg-
|
162
|
+
className={cls(focusedDisabled, "z-50 relative overflow-hidden border bg-white dark:bg-surface-900 p-2 rounded-lg", defaultBorderMixin)}>
|
163
163
|
<SelectPrimitive.Viewport className={"p-1"}
|
164
164
|
style={{ maxHeight: "var(--radix-select-content-available-height)" }}>
|
165
165
|
{children}
|
@@ -191,10 +191,10 @@ export function SelectItem({
|
|
191
191
|
disabled={disabled}
|
192
192
|
className={cls(
|
193
193
|
"w-full",
|
194
|
-
"relative flex items-center p-2 rounded-md text-sm text-
|
194
|
+
"relative flex items-center p-2 rounded-md text-sm text-surface-accent-700 dark:text-surface-accent-300",
|
195
195
|
"focus:z-10",
|
196
|
-
"data-[state=checked]:bg-
|
197
|
-
"data-[state=checked]:focus:bg-
|
196
|
+
"data-[state=checked]:bg-surface-accent-100 data-[state=checked]:dark:bg-surface-accent-800 focus:bg-surface-accent-100 dark:focus:bg-surface-950",
|
197
|
+
"data-[state=checked]:focus:bg-surface-accent-200 data-[state=checked]:dark:focus:bg-surface-950",
|
198
198
|
disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer",
|
199
199
|
"[&>*]:w-full",
|
200
200
|
"overflow-visible",
|
@@ -222,7 +222,7 @@ export function SelectGroup({
|
|
222
222
|
return <>
|
223
223
|
<SelectPrimitive.Group
|
224
224
|
className={cls(
|
225
|
-
"text-xs text-
|
225
|
+
"text-xs text-surface-accent-900 dark:text-white uppercase tracking-wider font-bold mt-6 first:mt-2",
|
226
226
|
"px-2 py-2",
|
227
227
|
className
|
228
228
|
)}>
|
@@ -15,12 +15,12 @@ export function Separator({
|
|
15
15
|
<SeparatorPrimitive.Root
|
16
16
|
decorative={decorative}
|
17
17
|
orientation="horizontal"
|
18
|
-
className={cls("dark:bg-opacity-80 dark:bg-
|
18
|
+
className={cls("dark:bg-opacity-80 dark:bg-surface-800 bg-surface-100 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px my-4", className)}/>
|
19
19
|
);
|
20
20
|
else
|
21
21
|
return (
|
22
22
|
<SeparatorPrimitive.Root
|
23
|
-
className={cls("dark:bg-opacity-80 dark:bg-
|
23
|
+
className={cls("dark:bg-opacity-80 dark:bg-surface-800 bg-surface-100 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px mx-4", className)}
|
24
24
|
decorative={decorative}
|
25
25
|
orientation="vertical"
|
26
26
|
/>
|
package/src/components/Sheet.tsx
CHANGED
@@ -66,7 +66,7 @@ export const Sheet: React.FC<SheetProps> = ({
|
|
66
66
|
className={cls(
|
67
67
|
"fixed inset-0 transition-opacity z-20 ease-in-out duration-100 backdrop-blur-sm",
|
68
68
|
"bg-black bg-opacity-50",
|
69
|
-
"dark:bg-
|
69
|
+
"dark:bg-surface-900 dark:bg-opacity-60",
|
70
70
|
displayed && open ? "opacity-100" : "opacity-0",
|
71
71
|
overlayClassName
|
72
72
|
)}
|
@@ -82,11 +82,11 @@ export const Sheet: React.FC<SheetProps> = ({
|
|
82
82
|
defaultBorderMixin,
|
83
83
|
"transform-gpu",
|
84
84
|
"will-change-transform",
|
85
|
-
"text-
|
85
|
+
"text-surface-accent-900 dark:text-white",
|
86
86
|
"fixed transform z-20 transition-all ease-in-out",
|
87
87
|
!displayed ? "duration-150" : "duration-100",
|
88
88
|
"outline-none focus:outline-none",
|
89
|
-
transparent ? "" : "shadow-md bg-white dark:bg-
|
89
|
+
transparent ? "" : "shadow-md bg-white dark:bg-surface-950",
|
90
90
|
side === "top" || side === "bottom" ? "w-full" : "h-full",
|
91
91
|
side === "left" || side === "top" ? "left-0 top-0" : "right-0 bottom-0",
|
92
92
|
displayed && open ? "opacity-100" : "opacity-50",
|
@@ -33,7 +33,7 @@ function SliderThumb(props: {
|
|
33
33
|
<SliderPrimitive.Thumb
|
34
34
|
className={cls({
|
35
35
|
"border-primary bg-primary hover:bg-primary-dark outline-none": !props.props.disabled,
|
36
|
-
"border-
|
36
|
+
"border-surface-accent-300 bg-surface-accent-300 dark:border-surface-700 dark:bg-surface-700": props.props.disabled
|
37
37
|
},
|
38
38
|
props.classes,
|
39
39
|
"focus-visible:ring-4 focus-visible:ring-primary focus-visible:ring-opacity-50",
|
@@ -47,7 +47,7 @@ function SliderThumb(props: {
|
|
47
47
|
className={cls(
|
48
48
|
"TooltipContent",
|
49
49
|
"max-w-lg leading-relaxed",
|
50
|
-
"z-50 rounded px-3 py-2 text-xs leading-none bg-
|
50
|
+
"z-50 rounded px-3 py-2 text-xs leading-none bg-surface-accent-700 dark:bg-surface-accent-800 bg-opacity-90 font-medium text-surface-accent-50 shadow-2xl select-none duration-400 ease-in transform opacity-100",
|
51
51
|
)}>
|
52
52
|
{props.props.value?.[props.index]}
|
53
53
|
</TooltipPrimitive.Content>
|
@@ -83,12 +83,12 @@ const Slider = React.forwardRef<
|
|
83
83
|
>
|
84
84
|
<SliderPrimitive.Track
|
85
85
|
style={{ height: size === "small" ? 4 : 8 }}
|
86
|
-
className={"relative w-full grow overflow-hidden rounded-full bg-
|
86
|
+
className={"relative w-full grow overflow-hidden rounded-full bg-surface-accent-300 bg-opacity-40 dark:bg-surface-700 dark:bg-opacity-40"}>
|
87
87
|
|
88
88
|
<SliderPrimitive.Range
|
89
89
|
className={cls("absolute h-full", {
|
90
90
|
"bg-primary": !props.disabled,
|
91
|
-
"bg-
|
91
|
+
"bg-surface-accent-300 dark:bg-surface-700": props.disabled,
|
92
92
|
})}
|
93
93
|
/>
|
94
94
|
</SliderPrimitive.Track>
|
package/src/components/Table.tsx
CHANGED
@@ -15,7 +15,7 @@ export const Table = ({
|
|
15
15
|
...rest
|
16
16
|
}: TableProps) => (
|
17
17
|
<table
|
18
|
-
className={cls("text-left text-
|
18
|
+
className={cls("text-left text-surface-800 dark:text-white rounded-md overflow-x-auto", className)}
|
19
19
|
style={style}
|
20
20
|
{...rest}
|
21
21
|
>
|
@@ -34,7 +34,7 @@ export const TableBody = ({
|
|
34
34
|
...rest
|
35
35
|
}: TableBodyProps) => (
|
36
36
|
<tbody
|
37
|
-
className={cls("bg-white dark:bg-
|
37
|
+
className={cls("bg-white dark:bg-surface-950 text-sm divide-y divide-surface-100 dark:divide-surface-700 dark:divide-opacity-70", className)}
|
38
38
|
{...rest}
|
39
39
|
>
|
40
40
|
{children}
|
@@ -55,8 +55,8 @@ export const TableHeader = ({
|
|
55
55
|
<tr
|
56
56
|
className={cls(
|
57
57
|
defaultBorderMixin,
|
58
|
-
"text-sm font-medium text-
|
59
|
-
"bg-
|
58
|
+
"text-sm font-medium text-surface-700 dark:text-surface-accent-300",
|
59
|
+
"bg-surface-accent-50 border-b dark:bg-surface-900",
|
60
60
|
className
|
61
61
|
)}
|
62
62
|
>
|
@@ -83,8 +83,8 @@ export const TableRow = ({
|
|
83
83
|
onClick={onClick}
|
84
84
|
style={style}
|
85
85
|
className={cls(
|
86
|
-
"bg-white dark:bg-
|
87
|
-
onClick ? "hover:bg-
|
86
|
+
"bg-white dark:bg-surface-950",
|
87
|
+
onClick ? "hover:bg-surface-accent-100 dark:hover:bg-surface-accent-800 cursor-pointer" : "",
|
88
88
|
className
|
89
89
|
)}
|
90
90
|
{...rest}
|
package/src/components/Tabs.tsx
CHANGED
@@ -18,7 +18,7 @@ export function Tabs({
|
|
18
18
|
|
19
19
|
return <TabsPrimitive.Root value={value} onValueChange={onValueChange}>
|
20
20
|
<TabsPrimitive.List className={cls(
|
21
|
-
"flex text-sm font-medium text-center text-
|
21
|
+
"flex text-sm font-medium text-center text-surface-accent-800 dark:text-white max-w-full overflow-auto no-scrollbar",
|
22
22
|
className)
|
23
23
|
}>
|
24
24
|
{children}
|
@@ -45,15 +45,15 @@ export function Tab({
|
|
45
45
|
"border-b-2 border-transparent",
|
46
46
|
"data-[state=active]:border-secondary",
|
47
47
|
disabled
|
48
|
-
? "text-
|
49
|
-
: cls("text-
|
50
|
-
"data-[state=active]:text-
|
51
|
-
"hover:text-
|
52
|
-
// disabled ? "text-
|
53
|
-
// "data-[state=active]:bg-
|
48
|
+
? "text-surface-accent-400 dark:text-surface-accent-500"
|
49
|
+
: cls("text-surface-accent-700 dark:text-surface-accent-300",
|
50
|
+
"data-[state=active]:text-surface-accent-900 data-[state=active]:dark:text-white",
|
51
|
+
"hover:text-surface-accent-800 dark:hover:text-surface-accent-200"),
|
52
|
+
// disabled ? "text-surface-accent-400 dark:text-surface-accent-500" : "data-[state=active]:text-primary",
|
53
|
+
// "data-[state=active]:bg-surface-accent-50 data-[state=active]:dark:bg-surface-accent-800",
|
54
54
|
className)}>
|
55
55
|
<div className={cls("uppercase inline-block p-2 px-4 m-2 rounded",
|
56
|
-
"hover:bg-
|
56
|
+
"hover:bg-surface-accent-200 hover:bg-opacity-75 dark:hover:bg-surface-accent-800")}>
|
57
57
|
{children}
|
58
58
|
</div>
|
59
59
|
</TabsPrimitive.Trigger>;
|
@@ -111,7 +111,7 @@ export function TextField<T extends string | number>({
|
|
111
111
|
className={cls(
|
112
112
|
invisible ? focusedInvisibleMixin : "",
|
113
113
|
"rounded-md resize-none w-full outline-none p-[32px] text-base bg-transparent min-h-[64px] px-3 pt-8",
|
114
|
-
disabled && "border border-transparent outline-none opacity-50 text-
|
114
|
+
disabled && "border border-transparent outline-none opacity-50 text-surface-accent-600 dark:text-surface-accent-500"
|
115
115
|
)}
|
116
116
|
/>
|
117
117
|
: <input
|
@@ -129,7 +129,7 @@ export function TextField<T extends string | number>({
|
|
129
129
|
label ? (size === "medium" ? "pt-8 pb-2" : "pt-4 pb-2") : "py-2",
|
130
130
|
focused ? "text-text-primary dark:text-text-primary-dark" : "",
|
131
131
|
endAdornment ? "pr-10" : "pr-3",
|
132
|
-
disabled && "border border-transparent outline-none opacity-50 dark:opacity-50 text-
|
132
|
+
disabled && "border border-transparent outline-none opacity-50 dark:opacity-50 text-surface-accent-800 dark:text-white",
|
133
133
|
inputClassName
|
134
134
|
)}
|
135
135
|
placeholder={focused || hasValue || !label ? placeholder : undefined}
|
@@ -64,14 +64,14 @@ export const Tooltip = ({
|
|
64
64
|
<TooltipPrimitive.Content
|
65
65
|
className={cls("TooltipContent",
|
66
66
|
"max-w-lg leading-relaxed",
|
67
|
-
"z-50 rounded px-3 py-2 text-xs leading-none bg-
|
67
|
+
"z-50 rounded px-3 py-2 text-xs leading-none bg-surface-accent-700 dark:bg-surface-accent-800 bg-opacity-90 font-medium text-surface-accent-50 shadow-2xl select-none duration-400 ease-in transform opacity-100",
|
68
68
|
tooltipClassName)}
|
69
69
|
style={tooltipStyle}
|
70
70
|
sideOffset={sideOffset === undefined ? 4 : sideOffset}
|
71
71
|
align={align}
|
72
72
|
side={side}>
|
73
73
|
{title}
|
74
|
-
{/*<TooltipPrimitive.Arrow className="fill-
|
74
|
+
{/*<TooltipPrimitive.Arrow className="fill-surface-accent-600"/>*/}
|
75
75
|
</TooltipPrimitive.Content>
|
76
76
|
</TooltipPrimitive.Portal>
|
77
77
|
</TooltipPrimitive.Root>
|
@@ -3,7 +3,7 @@ import { cls } from "../../util";
|
|
3
3
|
|
4
4
|
export function SelectInputLabel({ children, error }: { children: React.ReactNode, error?: boolean }) {
|
5
5
|
return <div className={cls("text-sm font-medium ml-3.5 mb-1",
|
6
|
-
error ? "text-red-500 dark:text-red-600" : "text-
|
6
|
+
error ? "text-red-500 dark:text-red-600" : "text-surface-accent-500 dark:text-surface-accent-300",)}>
|
7
7
|
{children}
|
8
8
|
</div>;
|
9
9
|
}
|
package/src/styles.ts
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
export const focusedDisabled = "focus-visible:ring-0 focus-visible:ring-offset-0";
|
2
|
-
export const focusedInvisibleMixin = "focus:bg-opacity-70 focus:bg-
|
2
|
+
export const focusedInvisibleMixin = "focus:bg-opacity-70 focus:bg-surface-accent-100 focus:dark:bg-surface-800 focus:dark:bg-opacity-60";
|
3
3
|
export const focusedClasses = "z-30 outline-none ring-2 ring-primary ring-opacity-75 ring-offset-2 ring-offset-transparent ";
|
4
|
-
export const fieldBackgroundMixin = "bg-opacity-50 bg-
|
5
|
-
export const fieldBackgroundInvisibleMixin = "bg-opacity-0 bg-
|
6
|
-
export const fieldBackgroundDisabledMixin = "dark:bg-
|
7
|
-
export const fieldBackgroundHoverMixin = "hover:bg-opacity-70 dark:hover:bg-
|
8
|
-
export const defaultBorderMixin = "border-
|
9
|
-
export const paperMixin = "bg-white rounded-md dark:bg-
|
10
|
-
export const cardMixin = "bg-white border border-
|
4
|
+
export const fieldBackgroundMixin = "bg-opacity-50 bg-surface-accent-200 dark:bg-surface-800 dark:bg-opacity-60";
|
5
|
+
export const fieldBackgroundInvisibleMixin = "bg-opacity-0 bg-surface-accent-100 dark:bg-surface-800 dark:bg-opacity-0";
|
6
|
+
export const fieldBackgroundDisabledMixin = "dark:bg-surface-800 bg-opacity-50 dark:bg-opacity-90";
|
7
|
+
export const fieldBackgroundHoverMixin = "hover:bg-opacity-70 dark:hover:bg-surface-700 dark:hover:bg-opacity-40";
|
8
|
+
export const defaultBorderMixin = "border-surface-200 border-opacity-40 dark:border-surface-700 dark:border-opacity-40";
|
9
|
+
export const paperMixin = "bg-white rounded-md dark:bg-surface-950 border border-surface-200 border-opacity-40 dark:border-surface-700 dark:border-opacity-40";
|
10
|
+
export const cardMixin = "bg-white border border-surface-200 border-opacity-40 dark:border-transparent rounded-md dark:bg-surface-950 dark:border-surface-700 dark:border-opacity-40 m-1 -p-1";
|
11
11
|
export const cardClickableMixin = "hover:bg-primary-bg dark:hover:bg-primary-bg hover:bg-opacity-20 dark:hover:bg-opacity-20 hover:ring-2 hover:ring-primary cursor-pointer";
|
12
12
|
export const cardSelectedMixin = "bg-primary-bg dark:bg-primary-bg bg-opacity-30 dark:bg-opacity-10 ring-1 ring-primary ring-opacity-75";
|
package/tailwind.config.js
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
import typography from "@tailwindcss/typography";
|
2
|
+
|
1
3
|
export default {
|
2
4
|
darkMode: ["selector", "[data-theme=\"dark\"]"],
|
3
5
|
mode: "jit",
|
@@ -7,7 +9,7 @@ export default {
|
|
7
9
|
"./node_modules/@firecms/**/*.{js,ts,jsx,tsx}"
|
8
10
|
],
|
9
11
|
plugins: [
|
10
|
-
|
12
|
+
typography
|
11
13
|
],
|
12
14
|
theme: {
|
13
15
|
extend: {
|
@@ -34,35 +36,46 @@ export default {
|
|
34
36
|
]
|
35
37
|
},
|
36
38
|
colors: {
|
37
|
-
primary: "var(--fcms-primary)",
|
38
|
-
"primary-dark": "var(--fcms-primary-dark)",
|
39
|
+
"primary": "var(--fcms-primary)",
|
39
40
|
"primary-bg": "var(--fcms-primary-bg)",
|
40
|
-
secondary: "var(--fcms-secondary)",
|
41
|
-
field: {
|
42
|
-
disabled: "rgb(224 224 226)",
|
41
|
+
"secondary": "var(--fcms-secondary)",
|
42
|
+
"field": {
|
43
|
+
"disabled": "rgb(224 224 226)",
|
43
44
|
"disabled-dark": "rgb(35 35 37)"
|
44
45
|
},
|
45
|
-
text: {
|
46
|
-
primary: "rgba(0, 0, 0, 0.87)",
|
46
|
+
"text": {
|
47
|
+
"primary": "rgba(0, 0, 0, 0.87)",
|
48
|
+
"secondary": "rgba(0, 0, 0, 0.55)",
|
49
|
+
"disabled": "rgba(0, 0, 0, 0.38)",
|
47
50
|
"primary-dark": "#ffffff",
|
48
|
-
secondary: "rgba(
|
49
|
-
"
|
50
|
-
disabled: "rgba(0, 0, 0, 0.38)",
|
51
|
-
"disabled-dark": "rgba(255, 255, 255, 0.5)",
|
52
|
-
label: "rgb(131, 131, 131)"
|
51
|
+
"secondary-dark": "rgba(255, 255, 255, 0.60)",
|
52
|
+
"disabled-dark": "rgba(255, 255, 255, 0.48)"
|
53
53
|
},
|
54
|
-
|
55
|
-
50: "#f8f8fc",
|
56
|
-
100: "#E7E7EB",
|
57
|
-
200: "#CFCFD6",
|
58
|
-
300: "#B7B7BF",
|
59
|
-
400: "#A0A0A9",
|
60
|
-
500: "#87878F",
|
61
|
-
600: "#6B6B74",
|
62
|
-
700: "#454552",
|
63
|
-
800: "#292934",
|
64
|
-
900: "#18181C",
|
65
|
-
950: "#101013"
|
54
|
+
"surface": {
|
55
|
+
"50": "#f8f8fc",
|
56
|
+
"100": "#E7E7EB",
|
57
|
+
"200": "#CFCFD6",
|
58
|
+
"300": "#B7B7BF",
|
59
|
+
"400": "#A0A0A9",
|
60
|
+
"500": "#87878F",
|
61
|
+
"600": "#6B6B74",
|
62
|
+
"700": "#454552",
|
63
|
+
"800": "#292934",
|
64
|
+
"900": "#18181C",
|
65
|
+
"950": "#101013"
|
66
|
+
},
|
67
|
+
"surface-accent": {
|
68
|
+
"50": "#f8fafc",
|
69
|
+
"100": "#f1f5f9",
|
70
|
+
"200": "#e2e8f0",
|
71
|
+
"300": "#cbd5e1",
|
72
|
+
"400": "#94a3b8",
|
73
|
+
"500": "#64748b",
|
74
|
+
"600": "#475569",
|
75
|
+
"700": "#334155",
|
76
|
+
"800": "#1e293b",
|
77
|
+
"900": "#0f172a",
|
78
|
+
"950": "#020617"
|
66
79
|
}
|
67
80
|
}
|
68
81
|
}
|