@firecms/ui 3.0.0-canary.13 → 3.0.0-canary.130
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 +2 -2
- 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/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 +4 -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/_MultiSelect.d.ts +0 -0
- package/dist/components/index.d.ts +1 -1
- package/dist/hooks/index.d.ts +4 -0
- package/dist/hooks/useLocaleConfig.d.ts +1 -0
- package/dist/icons/Icon.d.ts +3 -3
- package/dist/index.css +77 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +13178 -13542
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +19685 -49
- package/dist/index.umd.js.map +1 -1
- package/dist/styles.d.ts +7 -7
- package/dist/util/{cn.d.ts → cls.d.ts} +4 -0
- package/dist/util/index.d.ts +1 -3
- package/package.json +109 -118
- package/src/components/Alert.tsx +2 -2
- package/src/components/Autocomplete.tsx +4 -3
- package/src/components/Avatar.tsx +7 -6
- package/src/components/Badge.tsx +1 -1
- package/src/components/BooleanSwitch.tsx +15 -15
- package/src/components/BooleanSwitchWithLabel.tsx +8 -8
- package/src/components/Button.tsx +18 -20
- package/src/components/Card.tsx +3 -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 +3 -2
- package/src/components/Container.tsx +2 -2
- package/src/components/DateTimeField.tsx +45 -50
- package/src/components/Dialog.tsx +15 -6
- package/src/components/DialogActions.tsx +2 -2
- package/src/components/DialogContent.tsx +2 -2
- package/src/components/ExpandablePanel.tsx +10 -8
- package/src/components/FileUpload.tsx +6 -9
- package/src/components/IconButton.tsx +4 -6
- package/src/components/InfoLabel.tsx +2 -2
- package/src/components/InputLabel.tsx +12 -9
- package/src/components/Label.tsx +17 -4
- package/src/components/Markdown.tsx +14 -3
- package/src/components/Menu.tsx +49 -31
- package/src/components/Menubar.tsx +322 -0
- package/src/components/MultiSelect.tsx +335 -165
- package/src/components/Paper.tsx +2 -2
- package/src/components/Popover.tsx +17 -14
- package/src/components/RadioGroup.tsx +41 -9
- package/src/components/SearchBar.tsx +8 -9
- package/src/components/Select.tsx +105 -125
- package/src/components/Separator.tsx +10 -4
- package/src/components/Sheet.tsx +45 -28
- package/src/components/Skeleton.tsx +9 -6
- package/src/components/Table.tsx +50 -33
- package/src/components/Tabs.tsx +6 -7
- package/src/components/TextField.tsx +10 -13
- package/src/components/TextareaAutosize.tsx +3 -3
- package/src/components/Tooltip.tsx +30 -14
- package/src/components/Typography.tsx +34 -19
- package/src/components/_MultiSelect.tsx +222 -0
- package/src/components/common/SelectInputLabel.tsx +2 -2
- package/src/components/index.tsx +1 -1
- package/src/hooks/index.ts +4 -0
- package/src/hooks/useLocaleConfig.tsx +18 -0
- package/src/icons/Icon.tsx +46 -43
- package/src/icons/icon_keys.ts +114 -1301
- package/src/index.css +77 -0
- package/src/index.ts +1 -0
- package/src/scripts/generateIconKeys.ts +20 -11
- package/src/styles.ts +7 -7
- 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
@@ -1,24 +1,34 @@
|
|
1
1
|
import React from "react";
|
2
2
|
import { Container } from "./Container";
|
3
|
-
import {
|
3
|
+
import { cls } from "../util";
|
4
4
|
|
5
|
-
export
|
6
|
-
children,
|
7
|
-
maxWidth,
|
8
|
-
className,
|
9
|
-
fullScreen
|
10
|
-
}: {
|
5
|
+
export type CenteredViewProps = {
|
11
6
|
children: React.ReactNode;
|
12
7
|
maxWidth?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl";
|
8
|
+
outerClassName?: string;
|
13
9
|
className?: string;
|
14
10
|
fullScreen?: boolean;
|
15
|
-
}
|
11
|
+
};
|
16
12
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
13
|
+
export const CenteredView = React.forwardRef<HTMLDivElement, CenteredViewProps>(({
|
14
|
+
children,
|
15
|
+
maxWidth,
|
16
|
+
outerClassName,
|
17
|
+
className,
|
18
|
+
fullScreen,
|
19
|
+
...rest
|
20
|
+
}, ref) => { // Notice how the ref is now received as the second argument
|
23
21
|
|
24
|
-
|
22
|
+
return (
|
23
|
+
<div ref={ref}
|
24
|
+
className={cls("flex flex-col flex-grow", fullScreen ? "h-screen" : "h-full", outerClassName)}
|
25
|
+
{...rest}>
|
26
|
+
<Container className={cls("m-auto", className)} maxWidth={maxWidth}>
|
27
|
+
{children}
|
28
|
+
</Container>
|
29
|
+
</div>
|
30
|
+
);
|
31
|
+
|
32
|
+
});
|
33
|
+
|
34
|
+
CenteredView.displayName = "CenteredView";
|
@@ -2,15 +2,16 @@ import React from "react";
|
|
2
2
|
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
3
3
|
|
4
4
|
import { Icon } from "../icons";
|
5
|
-
import {
|
5
|
+
import { cls } from "../util";
|
6
6
|
|
7
7
|
export interface CheckboxProps {
|
8
8
|
checked: boolean;
|
9
|
+
id?: string;
|
9
10
|
disabled?: boolean;
|
10
11
|
indeterminate?: boolean;
|
11
12
|
onCheckedChange?: (checked: boolean) => void;
|
12
13
|
padding?: boolean;
|
13
|
-
size?: "
|
14
|
+
size?: "smallest" | "small" | "medium" | "large";
|
14
15
|
color?: "primary" | "secondary";
|
15
16
|
}
|
16
17
|
|
@@ -18,20 +19,20 @@ const sizeClasses = {
|
|
18
19
|
large: "w-6 h-6 rounded flex items-center justify-center",
|
19
20
|
medium: "w-5 h-5 rounded flex items-center justify-center",
|
20
21
|
small: "w-4 h-4 rounded flex items-center justify-center",
|
21
|
-
|
22
|
+
smallest: "w-4 h-4 rounded flex items-center justify-center"
|
22
23
|
};
|
23
24
|
|
24
25
|
const outerSizeClasses = {
|
25
26
|
medium: "w-10 h-10",
|
26
27
|
small: "w-8 h-8",
|
27
28
|
large: "w-12 h-12 ",
|
28
|
-
|
29
|
+
smallest: "w-6 h-6"
|
29
30
|
}
|
30
31
|
const paddingClasses = {
|
31
32
|
medium: "p-2",
|
32
33
|
small: "p-2",
|
33
34
|
large: "p-2",
|
34
|
-
|
35
|
+
smallest: ""
|
35
36
|
}
|
36
37
|
|
37
38
|
const colorClasses = {
|
@@ -40,6 +41,7 @@ const colorClasses = {
|
|
40
41
|
}
|
41
42
|
|
42
43
|
export const Checkbox = ({
|
44
|
+
id,
|
43
45
|
checked,
|
44
46
|
indeterminate = false,
|
45
47
|
padding = true,
|
@@ -55,17 +57,17 @@ export const Checkbox = ({
|
|
55
57
|
? 20
|
56
58
|
: size === "small"
|
57
59
|
? 16
|
58
|
-
: size === "
|
60
|
+
: size === "smallest"
|
59
61
|
? 14
|
60
62
|
: 24;
|
61
63
|
return (
|
62
64
|
<CheckboxPrimitive.Root
|
63
|
-
|
65
|
+
id={id}
|
64
66
|
checked={indeterminate || isChecked}
|
65
67
|
disabled={disabled}
|
66
68
|
onCheckedChange={disabled ? undefined : onCheckedChange}>
|
67
69
|
|
68
|
-
<div className={
|
70
|
+
<div className={cls(
|
69
71
|
padding ? paddingClasses[size] : "",
|
70
72
|
outerSizeClasses[size],
|
71
73
|
"inline-flex items-center justify-center text-sm font-medium focus:outline-none transition-colors ease-in-out duration-150",
|
@@ -73,7 +75,7 @@ export const Checkbox = ({
|
|
73
75
|
onCheckedChange ? "cursor-pointer" : "cursor-default"
|
74
76
|
)}>
|
75
77
|
<div
|
76
|
-
className={
|
78
|
+
className={cls(
|
77
79
|
"border-2 relative transition-colors ease-in-out duration-150",
|
78
80
|
sizeClasses[size],
|
79
81
|
disabled
|
package/src/components/Chip.tsx
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import React from "react";
|
2
|
-
import { CHIP_COLORS,
|
2
|
+
import { CHIP_COLORS, cls, getColorSchemeForKey } from "../util";
|
3
3
|
|
4
4
|
export type ChipColorScheme = {
|
5
5
|
color: string;
|
@@ -11,16 +11,17 @@ export type ChipColorKey = keyof typeof CHIP_COLORS;
|
|
11
11
|
export interface ChipProps {
|
12
12
|
className?: string;
|
13
13
|
children: React.ReactNode;
|
14
|
-
size?: "
|
14
|
+
size?: "smallest" | "small" | "medium";
|
15
15
|
colorScheme?: ChipColorScheme | ChipColorKey;
|
16
16
|
error?: boolean;
|
17
17
|
outlined?: boolean;
|
18
18
|
onClick?: () => void;
|
19
19
|
icon?: React.ReactNode;
|
20
|
+
style?: React.CSSProperties;
|
20
21
|
}
|
21
22
|
|
22
23
|
const sizeClassNames = {
|
23
|
-
|
24
|
+
smallest: "px-2 py-0.5 text-sm",
|
24
25
|
small: "px-3 py-1 text-sm",
|
25
26
|
medium: "px-4 py-1.5 text-sm"
|
26
27
|
}
|
@@ -36,13 +37,14 @@ export function Chip({
|
|
36
37
|
onClick,
|
37
38
|
icon,
|
38
39
|
size = "medium",
|
39
|
-
className
|
40
|
+
className,
|
41
|
+
style
|
40
42
|
}: ChipProps) {
|
41
43
|
|
42
44
|
const usedColorScheme = typeof colorScheme === "string" ? getColorSchemeForKey(colorScheme) : colorScheme;
|
43
45
|
return (
|
44
46
|
<div
|
45
|
-
className={
|
47
|
+
className={cls("rounded-lg max-w-full w-max h-fit font-regular inline-flex gap-1",
|
46
48
|
"text-ellipsis",
|
47
49
|
onClick ? "cursor-pointer hover:bg-slate-300 hover:dark:bg-slate-700" : "",
|
48
50
|
sizeClassNames[size],
|
@@ -54,6 +56,7 @@ export function Chip({
|
|
54
56
|
backgroundColor: error || !usedColorScheme ? undefined : usedColorScheme.color,
|
55
57
|
color: error || !usedColorScheme ? undefined : usedColorScheme.text,
|
56
58
|
overflow: "hidden",
|
59
|
+
...style
|
57
60
|
// display: "-webkit-box",
|
58
61
|
// WebkitLineClamp: 1,
|
59
62
|
// WebkitBoxOrient: "vertical",
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import React from "react";
|
2
|
-
import {
|
2
|
+
import { cls } from "../util";
|
3
3
|
|
4
4
|
export type CircularProgressProps = {
|
5
5
|
size?: "small" | "medium" | "large",
|
@@ -31,7 +31,7 @@ export function CircularProgress({
|
|
31
31
|
|
32
32
|
return (
|
33
33
|
<div
|
34
|
-
className={
|
34
|
+
className={cls(
|
35
35
|
sizeClasses,
|
36
36
|
borderClasses,
|
37
37
|
"inline-block animate-spin rounded-full border-solid border-current border-r-transparent align-[-0.125em] motion-reduce:animate-[spin_1.5s_linear_infinite]",
|
@@ -1,7 +1,8 @@
|
|
1
1
|
import React from "react";
|
2
2
|
import * as Collapsible from "@radix-ui/react-collapsible";
|
3
3
|
|
4
|
-
import {
|
4
|
+
import { cls } from "../util";
|
5
|
+
import { useInjectStyles } from "../hooks";
|
5
6
|
|
6
7
|
interface CollapseProps {
|
7
8
|
children?: React.ReactNode;
|
@@ -53,7 +54,7 @@ export function Collapse({
|
|
53
54
|
className={className}>
|
54
55
|
|
55
56
|
<Collapsible.Content
|
56
|
-
className={
|
57
|
+
className={cls(`CollapseContent-${duration}`)}
|
57
58
|
>
|
58
59
|
{children}
|
59
60
|
</Collapsible.Content>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import React, { ForwardRefRenderFunction } from "react";
|
2
|
-
import {
|
2
|
+
import { cls } from "../util";
|
3
3
|
|
4
4
|
export type ContainerProps = {
|
5
5
|
children: React.ReactNode;
|
@@ -37,7 +37,7 @@ const ContainerInner: ForwardRefRenderFunction<HTMLDivElement, ContainerProps> =
|
|
37
37
|
return (
|
38
38
|
<div
|
39
39
|
ref={ref}
|
40
|
-
className={
|
40
|
+
className={cls("mx-auto px-3 md:px-4 lg-px-6",
|
41
41
|
classForMaxWidth,
|
42
42
|
className)}
|
43
43
|
style={style}>
|
@@ -1,34 +1,33 @@
|
|
1
1
|
import React, { useRef } from "react";
|
2
|
-
|
3
|
-
import DatePicker from "react-datepicker";
|
2
|
+
import * as RDP from "react-datepicker"
|
4
3
|
|
5
4
|
import { CalendarMonthIcon, ClearIcon, ErrorIcon } from "../icons";
|
6
5
|
import { IconButton } from "./IconButton";
|
7
|
-
import {
|
8
|
-
fieldBackgroundDisabledMixin,
|
9
|
-
fieldBackgroundHoverMixin,
|
10
|
-
fieldBackgroundMixin,
|
11
|
-
focusedMixin,
|
12
|
-
paperMixin
|
13
|
-
} from "../styles";
|
6
|
+
import { fieldBackgroundDisabledMixin, fieldBackgroundHoverMixin, fieldBackgroundMixin, paperMixin } from "../styles";
|
14
7
|
import { InputLabel } from "./InputLabel";
|
15
|
-
import { cn, useInjectStyles } from "../util";
|
16
8
|
import { Typography } from "./Typography";
|
9
|
+
import { cls } from "../util";
|
10
|
+
import { useInjectStyles } from "../hooks";
|
11
|
+
|
12
|
+
// this fixes the issue with the default export, affecting Next.js
|
13
|
+
const DatePicker = (((RDP.default as any).default as any) ||
|
14
|
+
(RDP.default as any) ||
|
15
|
+
(RDP as any)) as typeof RDP.default
|
16
|
+
|
17
|
+
export type DateTimeFieldProps = {
|
18
|
+
value?: Date | null;
|
19
|
+
onChange?: (date: Date | null) => void;
|
17
20
|
|
18
|
-
interface DateTimeFieldProps {
|
19
|
-
value?: Date;
|
20
|
-
onChange: (date: Date | null) => void;
|
21
21
|
mode?: "date" | "date_time";
|
22
22
|
disabled?: boolean;
|
23
23
|
clearable?: boolean;
|
24
24
|
error?: boolean;
|
25
|
-
size
|
25
|
+
size?: "small" | "medium";
|
26
26
|
label?: React.ReactNode;
|
27
27
|
className?: string;
|
28
28
|
style?: React.CSSProperties;
|
29
29
|
inputClassName?: string;
|
30
30
|
invisible?: boolean;
|
31
|
-
preventOpenOnFocus?: boolean;
|
32
31
|
locale?: string;
|
33
32
|
}
|
34
33
|
|
@@ -40,11 +39,10 @@ export const DateTimeField: React.FC<DateTimeFieldProps> = ({
|
|
40
39
|
clearable,
|
41
40
|
mode = "date",
|
42
41
|
error,
|
43
|
-
size,
|
42
|
+
size = "medium",
|
44
43
|
className,
|
45
44
|
style,
|
46
45
|
inputClassName,
|
47
|
-
preventOpenOnFocus,
|
48
46
|
invisible,
|
49
47
|
locale
|
50
48
|
}) => {
|
@@ -60,14 +58,14 @@ export const DateTimeField: React.FC<DateTimeFieldProps> = ({
|
|
60
58
|
|
61
59
|
const handleClear = (e: React.MouseEvent) => {
|
62
60
|
e.preventDefault();
|
63
|
-
onChange(null);
|
61
|
+
onChange?.(null);
|
64
62
|
}
|
65
63
|
|
66
64
|
return (
|
67
65
|
<>
|
68
66
|
|
69
67
|
<div
|
70
|
-
className={
|
68
|
+
className={cls(
|
71
69
|
"rounded-md relative max-w-full",
|
72
70
|
!invisible && fieldBackgroundMixin,
|
73
71
|
disabled ? fieldBackgroundDisabledMixin : fieldBackgroundHoverMixin,
|
@@ -80,7 +78,7 @@ export const DateTimeField: React.FC<DateTimeFieldProps> = ({
|
|
80
78
|
|
81
79
|
{label && (
|
82
80
|
<InputLabel
|
83
|
-
className={
|
81
|
+
className={cls("absolute top-1 pointer-events-none",
|
84
82
|
!error ? (focused ? "text-primary" : "text-text-secondary dark:text-text-secondary-dark") : "text-red-500 dark:text-red-500",
|
85
83
|
disabled ? "opacity-50" : "")}
|
86
84
|
shrink={hasValue || focused}
|
@@ -95,8 +93,7 @@ export const DateTimeField: React.FC<DateTimeFieldProps> = ({
|
|
95
93
|
selected={(invalidValue ? null : value) ?? null}
|
96
94
|
onChange={onChange}
|
97
95
|
disabled={false}
|
98
|
-
popperClassName={
|
99
|
-
onClick={(e: any) => e.stopPropagation()}
|
96
|
+
popperClassName={cls(paperMixin, "my-4 shadow")}
|
100
97
|
onFocus={() => setFocused(true)}
|
101
98
|
onBlur={() => setFocused(false)}
|
102
99
|
showTimeSelect={mode === "date_time"}
|
@@ -105,11 +102,10 @@ export const DateTimeField: React.FC<DateTimeFieldProps> = ({
|
|
105
102
|
timeCaption="time"
|
106
103
|
dateFormat={mode === "date_time" ? "Pp" : "P"}
|
107
104
|
preventOpenOnFocus={true}
|
108
|
-
className={
|
105
|
+
className={cls(
|
109
106
|
"w-full outline-none bg-transparent leading-normal text-base px-3",
|
110
107
|
clearable ? "pr-14" : "pr-12",
|
111
108
|
"rounded-md",
|
112
|
-
!invisible && focusedMixin,
|
113
109
|
size === "small" ? "min-h-[48px]" : "min-h-[64px]",
|
114
110
|
label ? "pt-[28px] pb-2" : "py-2",
|
115
111
|
inputClassName,
|
@@ -117,7 +113,6 @@ export const DateTimeField: React.FC<DateTimeFieldProps> = ({
|
|
117
113
|
)}
|
118
114
|
/>
|
119
115
|
|
120
|
-
|
121
116
|
<IconButton
|
122
117
|
onClick={() => {
|
123
118
|
// @ts-ignore
|
@@ -527,7 +522,7 @@ const datePickerCss = `
|
|
527
522
|
.react-datepicker__year-text--in-selecting-range,
|
528
523
|
.react-datepicker__year-text--in-range {
|
529
524
|
border-radius: 100%;
|
530
|
-
background-color: #
|
525
|
+
background-color: #186ef0;
|
531
526
|
color: #fff;
|
532
527
|
}
|
533
528
|
.react-datepicker__day--selected:hover, .react-datepicker__day--in-selecting-range:hover, .react-datepicker__day--in-range:hover,
|
@@ -540,22 +535,22 @@ const datePickerCss = `
|
|
540
535
|
.react-datepicker__year-text--selected:hover,
|
541
536
|
.react-datepicker__year-text--in-selecting-range:hover,
|
542
537
|
.react-datepicker__year-text--in-range:hover {
|
543
|
-
background-color: #
|
544
|
-
}
|
545
|
-
.react-datepicker__day--keyboard-selected,
|
546
|
-
.react-datepicker__month-text--keyboard-selected,
|
547
|
-
.react-datepicker__quarter-text--keyboard-selected,
|
548
|
-
.react-datepicker__year-text--keyboard-selected {
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
}
|
553
|
-
.react-datepicker__day--keyboard-selected:hover,
|
554
|
-
.react-datepicker__month-text--keyboard-selected:hover,
|
555
|
-
.react-datepicker__quarter-text--keyboard-selected:hover,
|
556
|
-
.react-datepicker__year-text--keyboard-selected:hover {
|
557
|
-
|
558
|
-
}
|
538
|
+
background-color: #5698f9;
|
539
|
+
}
|
540
|
+
// .react-datepicker__day--keyboard-selected,
|
541
|
+
// .react-datepicker__month-text--keyboard-selected,
|
542
|
+
// .react-datepicker__quarter-text--keyboard-selected,
|
543
|
+
// .react-datepicker__year-text--keyboard-selected {
|
544
|
+
// border-radius: 100%;
|
545
|
+
// background-color: #5193f6;
|
546
|
+
// color: rgb(0, 0, 0);
|
547
|
+
// }
|
548
|
+
// .react-datepicker__day--keyboard-selected:hover,
|
549
|
+
// .react-datepicker__month-text--keyboard-selected:hover,
|
550
|
+
// .react-datepicker__quarter-text--keyboard-selected:hover,
|
551
|
+
// .react-datepicker__year-text--keyboard-selected:hover {
|
552
|
+
// background-color: #5193f6;
|
553
|
+
// }
|
559
554
|
.react-datepicker__day--in-selecting-range:not(.react-datepicker__day--in-range,
|
560
555
|
.react-datepicker__month-text--in-range,
|
561
556
|
.react-datepicker__quarter-text--in-range,
|
@@ -838,7 +833,7 @@ const datePickerCss = `
|
|
838
833
|
:is([data-theme="dark"]) .react-datepicker__month-read-view--down-arrow,
|
839
834
|
:is([data-theme="dark"]) .react-datepicker__month-year-read-view--down-arrow,
|
840
835
|
:is([data-theme="dark"]) .react-datepicker__navigation-icon::before {
|
841
|
-
border-color: #
|
836
|
+
border-color: #999;
|
842
837
|
}
|
843
838
|
|
844
839
|
|
@@ -912,7 +907,7 @@ const datePickerCss = `
|
|
912
907
|
:is([data-theme="dark"]) .react-datepicker__year-text--selected:hover,
|
913
908
|
:is([data-theme="dark"]) .react-datepicker__time-container .react-datepicker__time .react-datepicker__time-box ul.react-datepicker__time-list li.react-datepicker__time-list-item:hover
|
914
909
|
{
|
915
|
-
background-color: #
|
910
|
+
background-color: #262626;
|
916
911
|
}
|
917
912
|
|
918
913
|
:is([data-theme="dark"]) .react-datepicker__day--selected,
|
@@ -930,12 +925,12 @@ const datePickerCss = `
|
|
930
925
|
background-color: #0e528f;
|
931
926
|
}
|
932
927
|
|
933
|
-
:is([data-theme="dark"]) .react-datepicker__day--keyboard-selected,
|
934
|
-
:is([data-theme="dark"]) .react-datepicker__month-text--keyboard-selected,
|
935
|
-
:is([data-theme="dark"]) .react-datepicker__quarter-text--keyboard-selected,
|
936
|
-
:is([data-theme="dark"]) .react-datepicker__year-text--keyboard-selected {
|
937
|
-
|
938
|
-
}
|
928
|
+
// :is([data-theme="dark"]) .react-datepicker__day--keyboard-selected,
|
929
|
+
// :is([data-theme="dark"]) .react-datepicker__month-text--keyboard-selected,
|
930
|
+
// :is([data-theme="dark"]) .react-datepicker__quarter-text--keyboard-selected,
|
931
|
+
// :is([data-theme="dark"]) .react-datepicker__year-text--keyboard-selected {
|
932
|
+
// background-color: #0e529f;
|
933
|
+
// }
|
939
934
|
|
940
935
|
:is([data-theme="dark"]) .react-datepicker__today-button {
|
941
936
|
background-color: #262626;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import React, { useEffect, useState } from "react";
|
2
2
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
3
3
|
import { paperMixin } from "../styles";
|
4
|
-
import {
|
4
|
+
import { cls } from "../util";
|
5
5
|
|
6
6
|
export type DialogProps = {
|
7
7
|
open?: boolean;
|
@@ -15,6 +15,9 @@ export type DialogProps = {
|
|
15
15
|
maxWidth?: keyof typeof widthClasses;
|
16
16
|
modal?: boolean;
|
17
17
|
onOpenAutoFocus?: (e: Event) => void;
|
18
|
+
onEscapeKeyDown?: (e: KeyboardEvent) => void;
|
19
|
+
onPointerDownOutside?: (e: Event) => void;
|
20
|
+
onInteractOutside?: (e: Event) => void;
|
18
21
|
};
|
19
22
|
|
20
23
|
const widthClasses = {
|
@@ -43,7 +46,10 @@ export const Dialog = ({
|
|
43
46
|
scrollable = true,
|
44
47
|
maxWidth = "lg",
|
45
48
|
modal = true,
|
46
|
-
onOpenAutoFocus
|
49
|
+
onOpenAutoFocus,
|
50
|
+
onEscapeKeyDown,
|
51
|
+
onPointerDownOutside,
|
52
|
+
onInteractOutside
|
47
53
|
}: DialogProps) => {
|
48
54
|
const [displayed, setDisplayed] = useState(false);
|
49
55
|
|
@@ -51,7 +57,7 @@ export const Dialog = ({
|
|
51
57
|
if (!open) {
|
52
58
|
const timeout = setTimeout(() => {
|
53
59
|
setDisplayed(false);
|
54
|
-
},
|
60
|
+
}, 150);
|
55
61
|
return () => clearTimeout(timeout);
|
56
62
|
} else {
|
57
63
|
setDisplayed(true);
|
@@ -69,7 +75,7 @@ export const Dialog = ({
|
|
69
75
|
<div className={"fixed inset-0 z-30"}>
|
70
76
|
|
71
77
|
<DialogPrimitive.Overlay
|
72
|
-
className={
|
78
|
+
className={cls("fixed inset-0 transition-opacity z-20 ease-in-out duration-200 bg-black bg-opacity-50 dark:bg-opacity-60 backdrop-blur-sm ",
|
73
79
|
displayed && open ? "opacity-100" : "opacity-0",
|
74
80
|
"z-20 fixed top-0 left-0 w-full h-full flex justify-center items-center"
|
75
81
|
)}
|
@@ -79,11 +85,14 @@ export const Dialog = ({
|
|
79
85
|
/>
|
80
86
|
|
81
87
|
<DialogPrimitive.Content
|
88
|
+
onEscapeKeyDown={onEscapeKeyDown}
|
82
89
|
onOpenAutoFocus={onOpenAutoFocus}
|
83
|
-
|
90
|
+
onPointerDownOutside={onPointerDownOutside}
|
91
|
+
onInteractOutside={onInteractOutside}
|
92
|
+
className={cls("h-full outline-none flex justify-center items-center z-40 opacity-100 transition-all duration-200 ease-in-out")}
|
84
93
|
>
|
85
94
|
<div
|
86
|
-
className={
|
95
|
+
className={cls(paperMixin,
|
87
96
|
"z-30",
|
88
97
|
"relative",
|
89
98
|
"outline-none focus:outline-none",
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import React from "react";
|
2
2
|
import { defaultBorderMixin } from "../styles";
|
3
|
-
import {
|
3
|
+
import { cls } from "../util";
|
4
4
|
|
5
5
|
export function DialogActions({
|
6
6
|
children,
|
@@ -15,7 +15,7 @@ export function DialogActions({
|
|
15
15
|
}) {
|
16
16
|
|
17
17
|
return <div
|
18
|
-
className={
|
18
|
+
className={cls(
|
19
19
|
defaultBorderMixin,
|
20
20
|
"py-3 px-4 border-t flex flex-row items-center justify-end bottom-0 right-0 left-0 text-right z-2 gap-2",
|
21
21
|
position,
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import React from "react";
|
2
|
-
import {
|
2
|
+
import { cls } from "../util";
|
3
3
|
|
4
4
|
export function DialogContent({
|
5
5
|
children,
|
@@ -17,7 +17,7 @@ export function DialogContent({
|
|
17
17
|
</div>;
|
18
18
|
|
19
19
|
return <div
|
20
|
-
className={
|
20
|
+
className={cls("py-6 px-6 h-full flex-grow", className)}>
|
21
21
|
{children}
|
22
22
|
</div>;
|
23
23
|
}
|
@@ -1,9 +1,10 @@
|
|
1
1
|
import React, { PropsWithChildren, useEffect, useState } from "react";
|
2
2
|
|
3
3
|
import * as Collapsible from "@radix-ui/react-collapsible";
|
4
|
-
import { defaultBorderMixin, fieldBackgroundMixin
|
4
|
+
import { defaultBorderMixin, fieldBackgroundMixin } from "../styles";
|
5
5
|
import { ExpandMoreIcon } from "../icons";
|
6
|
-
import {
|
6
|
+
import { cls } from "../util";
|
7
|
+
import { useInjectStyles } from "../hooks";
|
7
8
|
|
8
9
|
export function ExpandablePanel({
|
9
10
|
title,
|
@@ -75,9 +76,10 @@ export function ExpandablePanel({
|
|
75
76
|
|
76
77
|
return (<>
|
77
78
|
<Collapsible.Root
|
78
|
-
className={
|
79
|
+
className={cls(
|
79
80
|
!invisible && defaultBorderMixin + " border",
|
80
|
-
"rounded-md"
|
81
|
+
"rounded-md",
|
82
|
+
"w-full"
|
81
83
|
)}
|
82
84
|
open={open}
|
83
85
|
onOpenChange={(updatedOpen: boolean) => {
|
@@ -86,9 +88,9 @@ export function ExpandablePanel({
|
|
86
88
|
}}>
|
87
89
|
|
88
90
|
<Collapsible.Trigger
|
89
|
-
className={
|
91
|
+
className={cls(
|
90
92
|
"rounded flex items-center justify-between w-full min-h-[52px]",
|
91
|
-
"hover:bg-slate-50 dark:hover:bg-gray-800 dark:hover:bg-opacity-
|
93
|
+
"hover:bg-slate-50 dark:hover:bg-gray-800 dark:hover:bg-opacity-20",
|
92
94
|
invisible ? "border-b px-2" : "p-4",
|
93
95
|
invisible && defaultBorderMixin,
|
94
96
|
asField && fieldBackgroundMixin,
|
@@ -96,11 +98,11 @@ export function ExpandablePanel({
|
|
96
98
|
)}
|
97
99
|
>
|
98
100
|
{title}
|
99
|
-
<ExpandMoreIcon className={
|
101
|
+
<ExpandMoreIcon className={cls("transition", open ? "rotate-180" : "")}/>
|
100
102
|
</Collapsible.Trigger>
|
101
103
|
|
102
104
|
<Collapsible.Content
|
103
|
-
className={
|
105
|
+
className={cls("CollapsibleContent")}
|
104
106
|
style={{
|
105
107
|
overflow: allowOverflow ? "visible" : "hidden"
|
106
108
|
}}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import React from "react";
|
2
2
|
import { useDropzone } from "react-dropzone";
|
3
|
-
import { fieldBackgroundHoverMixin, fieldBackgroundMixin
|
4
|
-
import {
|
3
|
+
import { fieldBackgroundHoverMixin, fieldBackgroundMixin } from "../styles";
|
4
|
+
import { cls } from "../util";
|
5
5
|
import { Typography } from "./Typography";
|
6
6
|
|
7
7
|
export interface FileUploadError {
|
@@ -38,7 +38,7 @@ export function FileUpload({
|
|
38
38
|
disabled,
|
39
39
|
maxFiles,
|
40
40
|
title,
|
41
|
-
uploadDescription
|
41
|
+
uploadDescription,
|
42
42
|
children,
|
43
43
|
preventDropOnDocument = true,
|
44
44
|
size
|
@@ -63,21 +63,18 @@ export function FileUpload({
|
|
63
63
|
);
|
64
64
|
return <div
|
65
65
|
{...getRootProps()}
|
66
|
-
className={
|
66
|
+
className={cls(
|
67
67
|
fieldBackgroundMixin,
|
68
|
-
fieldBackgroundHoverMixin,
|
69
|
-
focusedMixin,
|
70
68
|
"flex gap-2",
|
71
69
|
"p-4 box-border relative items-center border-2 border-solid border-transparent outline-none rounded-md duration-200 ease-[cubic-bezier(0.4,0,0.2,1)] focus:border-primary-solid",
|
72
70
|
{
|
73
71
|
"h-44": size === "medium",
|
74
72
|
"h-28": size === "small",
|
75
73
|
"cursor-pointer": !disabled,
|
76
|
-
|
74
|
+
[fieldBackgroundHoverMixin]: !isDragActive,
|
77
75
|
"transition-colors duration-200 ease-[cubic-bezier(0,0,0.2,1)] border-red-500": isDragReject,
|
78
76
|
"transition-colors duration-200 ease-[cubic-bezier(0,0,0.2,1)] border-green-500": isDragAccept,
|
79
|
-
})}
|
80
|
-
>
|
77
|
+
})}>
|
81
78
|
|
82
79
|
<Typography variant={"caption"} color={"secondary"} className={"absolute top-2 left-3.5 cursor-inherit"}>
|
83
80
|
{title}
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import React from "react";
|
2
|
-
import {
|
3
|
-
import { cn } from "../util";
|
2
|
+
import { cls } from "../util";
|
4
3
|
|
5
4
|
export type IconButtonProps<C extends React.ElementType> =
|
6
5
|
Omit<(C extends "button" ? React.ButtonHTMLAttributes<HTMLButtonElement> : React.ComponentProps<C>), "onClick">
|
@@ -15,7 +14,7 @@ export type IconButtonProps<C extends React.ElementType> =
|
|
15
14
|
}
|
16
15
|
|
17
16
|
const buttonClasses =
|
18
|
-
"hover:bg-slate-200 hover:bg-opacity-75 dark:hover:bg-
|
17
|
+
"hover:bg-slate-200 hover:bg-opacity-75 dark:hover:bg-slate-800";
|
19
18
|
const baseClasses =
|
20
19
|
"inline-flex items-center justify-center p-2 text-sm font-medium focus:outline-none transition-colors ease-in-out duration-150";
|
21
20
|
const colorClasses = "text-slate-600 visited:text-slate-600 dark:text-slate-300 dark:visited:text-gray-300";
|
@@ -42,15 +41,14 @@ const IconButtonInner = <C extends React.ElementType = "button">({
|
|
42
41
|
...props
|
43
42
|
}: IconButtonProps<C>, ref: React.ForwardedRef<HTMLButtonElement>) => {
|
44
43
|
|
45
|
-
const bgClasses = variant === "ghost" ? "bg-transparent" : "bg-slate-50 dark:bg-gray-950 dark:bg-opacity-50";
|
44
|
+
const bgClasses = variant === "ghost" ? "bg-transparent" : "bg-slate-200 bg-opacity-50 dark:bg-gray-950 dark:bg-opacity-50";
|
46
45
|
const Component: React.ElementType<any> = component || "button";
|
47
46
|
return (
|
48
47
|
<Component
|
49
48
|
type="button"
|
50
49
|
ref={ref}
|
51
50
|
{...props}
|
52
|
-
className={
|
53
|
-
focusedMixin,
|
51
|
+
className={cls(
|
54
52
|
disabled ? "opacity-50 pointer-events-none" : "cursor-pointer",
|
55
53
|
toggled ? "outline outline-2 outline-primary" : "",
|
56
54
|
colorClasses,
|