@firecms/ui 3.0.0-canary.4 → 3.0.0-canary.41

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.
Files changed (69) hide show
  1. package/README.md +2 -2
  2. package/dist/components/Button.d.ts +1 -1
  3. package/dist/components/Card.d.ts +4 -2
  4. package/dist/components/CenteredView.d.ts +5 -2
  5. package/dist/components/Checkbox.d.ts +5 -4
  6. package/dist/components/Chip.d.ts +1 -1
  7. package/dist/components/DateTimeField.d.ts +2 -2
  8. package/dist/components/Dialog.d.ts +2 -1
  9. package/dist/components/Label.d.ts +4 -0
  10. package/dist/components/Markdown.d.ts +1 -0
  11. package/dist/components/Menu.d.ts +2 -1
  12. package/dist/components/RadioGroup.d.ts +27 -0
  13. package/dist/components/TextareaAutosize.d.ts +4 -2
  14. package/dist/components/Tooltip.d.ts +2 -1
  15. package/dist/components/index.d.ts +2 -0
  16. package/dist/hooks/index.d.ts +4 -0
  17. package/dist/hooks/useLocaleConfig.d.ts +1 -0
  18. package/dist/icons/Icon.d.ts +2 -2
  19. package/dist/index.d.ts +1 -0
  20. package/dist/index.es.js +7701 -7613
  21. package/dist/index.es.js.map +1 -1
  22. package/dist/index.umd.js +10 -10
  23. package/dist/index.umd.js.map +1 -1
  24. package/dist/styles.d.ts +5 -5
  25. package/dist/util/index.d.ts +0 -2
  26. package/package.json +27 -21
  27. package/src/components/Alert.tsx +2 -2
  28. package/src/components/Autocomplete.tsx +2 -1
  29. package/src/components/BooleanSwitch.tsx +2 -2
  30. package/src/components/Button.tsx +10 -18
  31. package/src/components/Card.tsx +16 -10
  32. package/src/components/CenteredView.tsx +25 -13
  33. package/src/components/Checkbox.tsx +34 -23
  34. package/src/components/Chip.tsx +3 -3
  35. package/src/components/Collapse.tsx +2 -1
  36. package/src/components/DateTimeField.tsx +6 -5
  37. package/src/components/Dialog.tsx +4 -1
  38. package/src/components/ExpandablePanel.tsx +5 -3
  39. package/src/components/FileUpload.tsx +1 -1
  40. package/src/components/IconButton.tsx +2 -2
  41. package/src/components/InputLabel.tsx +8 -7
  42. package/src/components/Label.tsx +18 -0
  43. package/src/components/Markdown.tsx +14 -3
  44. package/src/components/Menu.tsx +11 -5
  45. package/src/components/MultiSelect.tsx +2 -1
  46. package/src/components/Popover.tsx +2 -1
  47. package/src/components/RadioGroup.tsx +72 -0
  48. package/src/components/SearchBar.tsx +1 -1
  49. package/src/components/Select.tsx +21 -21
  50. package/src/components/Table.tsx +1 -1
  51. package/src/components/Tabs.tsx +2 -2
  52. package/src/components/TextField.tsx +1 -1
  53. package/src/components/TextareaAutosize.tsx +1 -1
  54. package/src/components/Tooltip.tsx +5 -1
  55. package/src/components/Typography.tsx +1 -1
  56. package/src/components/index.tsx +2 -0
  57. package/src/hooks/index.ts +4 -0
  58. package/src/hooks/useLocaleConfig.tsx +18 -0
  59. package/src/icons/Icon.tsx +43 -40
  60. package/src/index.ts +1 -0
  61. package/src/styles.ts +5 -5
  62. package/src/util/index.ts +0 -2
  63. package/tailwind.config.js +70 -0
  64. /package/dist/{util → hooks}/useDebounceValue.d.ts +0 -0
  65. /package/dist/{util → hooks}/useInjectStyles.d.ts +0 -0
  66. /package/dist/{util → hooks}/useOutsideAlerter.d.ts +0 -0
  67. /package/src/{util → hooks}/useDebounceValue.tsx +0 -0
  68. /package/src/{util → hooks}/useInjectStyles.tsx +0 -0
  69. /package/src/{util → hooks}/useOutsideAlerter.tsx +0 -0
@@ -0,0 +1,18 @@
1
+ import * as React from "react"
2
+ import * as LabelPrimitive from "@radix-ui/react-label"
3
+ import { cn } from "../util";
4
+ import { defaultBorderMixin } from "../styles";
5
+
6
+ const Label = React.forwardRef<
7
+ React.ElementRef<typeof LabelPrimitive.Root>,
8
+ React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>
9
+ >(({ className, ...props }, ref) => (
10
+ <LabelPrimitive.Root
11
+ ref={ref}
12
+ className={cn("text-sm font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70", defaultBorderMixin, className)}
13
+ {...props}
14
+ />
15
+ ))
16
+ Label.displayName = LabelPrimitive.Root.displayName
17
+
18
+ export { Label }
@@ -3,26 +3,37 @@ import equal from "react-fast-compare"
3
3
 
4
4
  // @ts-ignore
5
5
  import MarkdownIt from "markdown-it";
6
+ import { cn } from "../util";
6
7
 
7
8
  export interface MarkdownProps {
8
9
  source: string,
10
+ size?: "small" | "medium" | "large" | "xl" | "2xl";
9
11
  className?: string
10
12
  }
11
13
 
12
- const md = new MarkdownIt({ html: true, });
14
+ const proseClasses = {
15
+ small: "prose-sm",
16
+ medium: "prose",
17
+ large: "prose-lg",
18
+ xl: "prose-xl",
19
+ "2xl": "prose-2xl"
20
+ };
21
+
22
+ const md = new MarkdownIt({ html: true });
13
23
  /**
14
24
  * @group Preview components
15
25
  */
16
26
  export const Markdown = React.memo<MarkdownProps>(function Markdown({
17
27
  source,
18
- className
28
+ className,
29
+ size = "medium"
19
30
  }: MarkdownProps) {
20
31
  const html = useMemo(() => {
21
32
  return md.render(typeof source === "string" ? source : "");
22
33
  }, [source]);
23
34
 
24
35
  return <div
25
- className={className}
36
+ className={cn(proseClasses[size], "dark:prose-invert prose-headings:font-title", className)}
26
37
  dangerouslySetInnerHTML={{ __html: html }}
27
38
  />;
28
39
  }
@@ -43,18 +43,24 @@ export type MenuItemProps = {
43
43
  children: React.ReactNode;
44
44
  dense?: boolean;
45
45
  onClick?: (event: React.MouseEvent) => void;
46
- }
46
+ };
47
47
 
48
48
  export function MenuItem({
49
49
  children,
50
- dense,
50
+ dense = false, // Default value is false if not provided
51
51
  onClick
52
52
  }: MenuItemProps) {
53
+ // Dynamically adjusting the class based on the "dense" prop
54
+ const classNames = cn(
55
+ focusedMixin,
56
+ onClick && "cursor-pointer",
57
+ "rounded-md text-sm font-medium text-slate-700 dark:text-slate-300 hover:bg-slate-100 dark:hover:bg-slate-900 flex items-center gap-4",
58
+ dense ? "px-3 py-1.5" : "px-4 py-2"
59
+ );
60
+
53
61
  return (
54
62
  <DropdownMenu.Item
55
- className={cn(focusedMixin,
56
- onClick && "cursor-pointer",
57
- "rounded-md px-4 py-2 text-sm font-medium text-slate-700 dark:text-slate-300 hover:bg-slate-100 dark:hover:bg-slate-900 flex items-center gap-4")}
63
+ className={classNames}
58
64
  onClick={onClick}>
59
65
  {children}
60
66
  </DropdownMenu.Item>
@@ -6,8 +6,9 @@ import { Command as CommandPrimitive } from "cmdk";
6
6
 
7
7
  import { ExpandMoreIcon } from "../icons";
8
8
  import { fieldBackgroundDisabledMixin, fieldBackgroundHoverMixin, fieldBackgroundMixin, focusedMixin } from "../styles";
9
- import { cn, useOutsideAlerter } from "../util";
9
+ import { cn } from "../util";
10
10
  import { SelectInputLabel } from "./common/SelectInputLabel";
11
+ import { useOutsideAlerter } from "../hooks";
11
12
 
12
13
  export type MultiSelectProps = {
13
14
  open?: boolean,
@@ -2,7 +2,8 @@ import React from "react";
2
2
  import * as PopoverPrimitive from "@radix-ui/react-popover";
3
3
 
4
4
  import { paperMixin } from "../styles";
5
- import { cn, useInjectStyles } from "../util";
5
+ import { cn } from "../util";
6
+ import { useInjectStyles } from "../hooks";
6
7
 
7
8
  export type PopoverSide = "top" | "right" | "bottom" | "left";
8
9
  export type PopoverAlign = "start" | "center" | "end";
@@ -0,0 +1,72 @@
1
+ import * as React from "react"
2
+ import * as RadioGroupPrimitive from "@radix-ui/react-radio-group"
3
+ import { cn } from "../util";
4
+
5
+ export interface RadioGroupProps {
6
+ id?: string;
7
+ children: React.ReactNode;
8
+ name?: string
9
+ required?: boolean;
10
+ disabled?: boolean;
11
+ /**
12
+ * Whether keyboard navigation should loop around
13
+ * @defaultValue false
14
+ */
15
+ loop?: boolean;
16
+ defaultValue?: string;
17
+ value?: string;
18
+
19
+ onValueChange?(value: string): void;
20
+
21
+ className?: string;
22
+ }
23
+
24
+ const RadioGroup = React.forwardRef<
25
+ React.ElementRef<typeof RadioGroupPrimitive.Root>,
26
+ RadioGroupProps
27
+ >(({
28
+ className,
29
+ ...props
30
+ }, ref) => {
31
+ return (
32
+ <RadioGroupPrimitive.Root
33
+ className={cn("grid gap-2", className)}
34
+ {...props}
35
+ ref={ref}
36
+ />
37
+ )
38
+ })
39
+ RadioGroup.displayName = RadioGroupPrimitive.Root.displayName
40
+
41
+ export interface RadioGroupItemProps {
42
+ id?: string;
43
+ value: string;
44
+ checked?: boolean;
45
+ required?: boolean;
46
+ className?: string;
47
+ }
48
+ const RadioGroupItem = React.forwardRef<
49
+ React.ElementRef<typeof RadioGroupPrimitive.Item>,
50
+ RadioGroupItemProps
51
+ >(({
52
+ className,
53
+ ...props
54
+ }, ref) => {
55
+ return (
56
+ <RadioGroupPrimitive.Item
57
+ ref={ref}
58
+ className={cn(
59
+ "aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
60
+ className
61
+ )}
62
+ {...props}
63
+ >
64
+ <RadioGroupPrimitive.Indicator className="flex items-center justify-center">
65
+ <div className="h-2.5 w-2.5 fill-current text-current bg-primary rounded-lg"/>
66
+ </RadioGroupPrimitive.Indicator>
67
+ </RadioGroupPrimitive.Item>
68
+ )
69
+ })
70
+ RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName
71
+
72
+ export { RadioGroup, RadioGroupItem }
@@ -4,7 +4,7 @@ import { defaultBorderMixin, focusedMixin } from "../styles";
4
4
  import { CircularProgress, IconButton } from "./index";
5
5
  import { ClearIcon, SearchIcon } from "../icons";
6
6
  import { cn } from "../util";
7
- import { useDebounceValue } from "../util/useDebounceValue";
7
+ import { useDebounceValue } from "../hooks";
8
8
 
9
9
  interface SearchBarProps {
10
10
  onClick?: () => void;
@@ -127,38 +127,38 @@ export function Select({
127
127
  "w-full h-full",
128
128
  size === "small" ? "h-[42px]" : "h-[64px]",
129
129
  padding ? "px-4 " : "",
130
- "outlin e-none focus:outline-none",
130
+ "outline-none focus:outline-none",
131
131
  "select-none rounded-md text-sm",
132
132
  error ? "text-red-500 dark:text-red-600" : "focus:text-text-primary dark:focus:text-text-primary-dark",
133
133
  error ? "border border-red-500 dark:border-red-600" : "",
134
- disabled ? "text-slate-600 dark:text-slate-400" : "text-slate-800 dark:text-slate-200",
134
+ disabled ? "text-slate-600 dark:text-slate-400" : "text-slate-800 dark:text-white",
135
135
  "relative flex items-center",
136
136
  includeFocusOutline ? focusedMixin : "",
137
137
  inputClassName
138
138
  )}>
139
139
 
140
- <SelectPrimitive.Value asChild>
141
- <div className={cn(
142
- "flex-grow w-full max-w-full flex flex-row gap-2 items-center",
143
- "overflow-visible",
144
- size === "small" ? "h-[42px]" : "h-[64px]"
145
- )}>
146
- {renderValue &&
147
- (value && Array.isArray(value)
148
- ? value.map((v, i) => (
149
- <div key={v} className={"flex items-center gap-1 max-w-full"}>
150
- {renderValue ? renderValue(v, i) : v}
151
- </div>))
152
- : (typeof value === "string" ? (renderValue ? renderValue(value, 0) : value) : placeholder))}
140
+ <div className={cn(
141
+ "flex-grow w-full max-w-full flex flex-row gap-2 items-center",
142
+ "overflow-visible",
143
+ size === "small" ? "h-[42px]" : "h-[64px]"
144
+ )}>
145
+ <SelectPrimitive.Value placeholder={placeholder}>
146
+ {renderValue &&
147
+ (value && Array.isArray(value)
148
+ ? value.map((v, i) => (
149
+ <div key={v} className={"flex items-center gap-1 max-w-full"}>
150
+ {renderValue ? renderValue(v, i) : v}
151
+ </div>))
152
+ : (typeof value === "string" ? (renderValue ? renderValue(value, 0) : value) : placeholder))}
153
153
 
154
- {renderValues && (!value || Array.isArray(value))
155
- ? renderValues(value as string[] ?? [])
156
- : null}
154
+ {renderValues && (!value || Array.isArray(value))
155
+ ? renderValues(value as string[] ?? [])
156
+ : null}
157
157
 
158
- {!renderValue && !renderValues && value}
158
+ {!renderValue && !renderValues && value}
159
159
 
160
- </div>
161
160
  </SelectPrimitive.Value>
161
+ </div>
162
162
 
163
163
  <SelectPrimitive.Icon className={cn(
164
164
  "px-2 h-full flex items-center",
@@ -249,7 +249,7 @@ export function SelectGroup({
249
249
  return <>
250
250
  <SelectPrimitive.Group
251
251
  className={cn(
252
- "text-xs text-slate-900 dark:text-slate-100 uppercase tracking-wider font-bold mt-6 first:mt-2",
252
+ "text-xs text-slate-900 dark:text-white uppercase tracking-wider font-bold mt-6 first:mt-2",
253
253
  "px-2 py-2",
254
254
  className
255
255
  )}>
@@ -13,7 +13,7 @@ export const Table = ({
13
13
  className,
14
14
  style
15
15
  }: TableProps) => (
16
- <table className={cn("w-full text-left text-gray-800 dark:text-slate-200 rounded-md overflow-x-auto",
16
+ <table className={cn("w-full text-left text-gray-800 dark:text-white rounded-md overflow-x-auto",
17
17
  className)}
18
18
  style={style}>
19
19
  {children}
@@ -19,7 +19,7 @@ export function Tabs({
19
19
 
20
20
  return <TabsPrimitive.Root value={value} onValueChange={onValueChange}>
21
21
  <TabsPrimitive.List className={cn(
22
- "flex text-sm font-medium text-center text-slate-800 dark:text-slate-200",
22
+ "flex text-sm font-medium text-center text-slate-800 dark:text-white max-w-full overflow-auto no-scrollbar",
23
23
  className)
24
24
  }>
25
25
  {children}
@@ -48,7 +48,7 @@ export function Tab({
48
48
  disabled
49
49
  ? "text-slate-400 dark:text-slate-500"
50
50
  : cn("text-slate-700 dark:text-slate-300",
51
- "data-[state=active]:text-slate-900 data-[state=active]:dark:text-slate-100",
51
+ "data-[state=active]:text-slate-900 data-[state=active]:dark:text-white",
52
52
  "hover:text-slate-800 dark:hover:text-slate-200"),
53
53
  // disabled ? "text-slate-400 dark:text-slate-500" : "data-[state=active]:text-primary",
54
54
  // "data-[state=active]:bg-slate-50 data-[state=active]:dark:bg-slate-800",
@@ -132,7 +132,7 @@ export function TextField<T extends string | number>({
132
132
  label ? (size === "medium" ? "pt-[28px] pb-2" : "pt-4 pb-2") : "py-2",
133
133
  focused ? "text-text-primary dark:text-text-primary-dark" : "",
134
134
  endAdornment ? "pr-10" : "pr-3",
135
- disabled && "border border-transparent outline-none opacity-50 dark:opacity-50 text-slate-800 dark:text-slate-200",
135
+ disabled && "border border-transparent outline-none opacity-50 dark:opacity-50 text-slate-800 dark:text-white",
136
136
  inputClassName
137
137
  )}
138
138
  placeholder={focused || hasValue || !label ? placeholder : undefined}
@@ -288,7 +288,7 @@ export const TextareaAutosize = React.forwardRef(function TextareaAutosize(
288
288
  />
289
289
  </React.Fragment>
290
290
  );
291
- });
291
+ }) as React.FC<TextareaAutosizeProps & { ref?: React.ForwardedRef<Element> }>;
292
292
 
293
293
  export type TextareaAutosizeProps = Omit<React.InputHTMLAttributes<HTMLTextAreaElement>, "onResize"> & {
294
294
 
@@ -1,12 +1,14 @@
1
1
  import React from "react";
2
2
  import * as TooltipPrimitive from "@radix-ui/react-tooltip";
3
3
 
4
- import { cn, useInjectStyles } from "../util";
4
+ import { cn } from "../util";
5
+ import { useInjectStyles } from "../hooks";
5
6
 
6
7
  export type TooltipProps = {
7
8
  open?: boolean,
8
9
  onOpenChange?: (open: boolean) => void,
9
10
  side?: "top" | "bottom" | "left" | "right",
11
+ align?: "start" | "center" | "end",
10
12
  sideOffset?: number,
11
13
  title?: string | React.ReactNode,
12
14
  delayDuration?: number;
@@ -21,6 +23,7 @@ export const Tooltip = ({
21
23
  side = "bottom",
22
24
  delayDuration = 250,
23
25
  sideOffset,
26
+ align,
24
27
  onOpenChange,
25
28
  title,
26
29
  className,
@@ -49,6 +52,7 @@ export const Tooltip = ({
49
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",
50
53
  tooltipClassName)}
51
54
  sideOffset={sideOffset === undefined ? 4 : sideOffset}
55
+ align={align}
52
56
  side={side}>
53
57
  {title}
54
58
  {/*<TooltipPrimitive.Arrow className="fill-slate-600"/>*/}
@@ -87,7 +87,7 @@ export function Typography<C extends React.ElementType>(
87
87
  variantToClasses[variant],
88
88
  color ? colorToClasses[color] : "",
89
89
  align !== "inherit" && `text-${align}`,
90
- gutterBottom && "mb-[0.35em]",
90
+ gutterBottom && "mb-2",
91
91
  noWrap && "truncate",
92
92
  paragraph && "mb-3",
93
93
  className
@@ -20,11 +20,13 @@ export * from "./FileUpload";
20
20
  export * from "./IconButton";
21
21
  export * from "./InputLabel";
22
22
  export * from "./InfoLabel";
23
+ export * from "./Label";
23
24
  export * from "./LoadingButton";
24
25
  export * from "./Markdown";
25
26
  export * from "./Menu";
26
27
  export * from "./MultiSelect";
27
28
  export * from "./Paper";
29
+ export * from "./RadioGroup";
28
30
  export * from "./SearchBar";
29
31
  export * from "./Select";
30
32
  export * from "./Separator";
@@ -0,0 +1,4 @@
1
+ export * from "./useLocaleConfig";
2
+ export * from "./useInjectStyles";
3
+ export * from "./useOutsideAlerter";
4
+ export * from "./useDebounceValue";
@@ -0,0 +1,18 @@
1
+ import * as locales from "date-fns/locale";
2
+ // @ts-ignore
3
+ import { registerLocale, setDefaultLocale } from "react-datepicker";
4
+ import { useEffect } from "react";
5
+
6
+ export function useLocaleConfig(locale?: string) {
7
+ useEffect(() => {
8
+ if (!locale) {
9
+ return;
10
+ }
11
+ // @ts-ignore
12
+ const dateFnsLocale = locales[locale];
13
+ if (dateFnsLocale) {
14
+ registerLocale(locale, dateFnsLocale);
15
+ setDefaultLocale(locale);
16
+ }
17
+ }, [locale])
18
+ }
@@ -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> = {
@@ -21,43 +21,46 @@ const colorClassesMapping: Record<IconColor, string> = {
21
21
  error: "text-red-500"
22
22
  }
23
23
 
24
- export function Icon({
25
- iconKey,
26
- size = "medium",
27
- color,
28
- className,
29
- onClick,
30
- style
31
- }: IconProps & { iconKey: string }) {
32
- let sizeInPx: number;
33
- switch (size) {
34
- case "smallest":
35
- sizeInPx = 16;
36
- break;
37
- case "small":
38
- sizeInPx = 20;
39
- break;
40
- case "medium":
41
- sizeInPx = 24;
42
- break;
43
- case "large":
44
- sizeInPx = 28;
45
- break
46
- default:
47
- sizeInPx = size;
48
- }
49
- if (!sizeInPx) sizeInPx = 24;
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
- return <span
52
- style={{
53
- fontSize: `${sizeInPx}px`,
54
- display: "block",
55
- ...style
56
- }}
57
- className={
58
- cn("material-icons",
59
- color ? colorClassesMapping[color] : "",
60
- "select-none",
61
- className)}
62
- onClick={onClick}>{iconKey}</span>
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
+ cn("material-icons",
60
+ color ? colorClassesMapping[color] : "",
61
+ "select-none",
62
+ className)}
63
+ onClick={onClick}>{iconKey}</span>
64
+ });
65
+
66
+ Icon.displayName = "Icon";
package/src/index.ts CHANGED
@@ -2,3 +2,4 @@ export * from "./components";
2
2
  export * from "./styles";
3
3
  export * from "./util";
4
4
  export * from "./icons";
5
+ export * from "./hooks";
package/src/styles.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  export const focusedMixin = "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-opacity-75 focus-visible:ring-offset-2 focus-visible:ring-offset-transparent";
2
2
  export const focusedInvisibleMixin = "focus:bg-opacity-70 focus:bg-slate-100 focus:dark:bg-gray-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-slate-200 dark:bg-gray-800 dark:bg-opacity-60 transition duration-150 ease-in-out";
4
+ export const fieldBackgroundMixin = "bg-opacity-50 bg-slate-200 dark:bg-gray-700 dark:bg-opacity-40 transition duration-150 ease-in-out";
5
5
  export const fieldBackgroundInvisibleMixin = "bg-opacity-0 bg-slate-100 dark:bg-gray-800 dark:bg-opacity-0 transition duration-150 ease-in-out";
6
- export const fieldBackgroundDisabledMixin = "bg-opacity-80 dark:bg-opacity-90";
7
- export const fieldBackgroundHoverMixin = "hover:bg-opacity-70 dark:hover:bg-opacity-90";
6
+ export const fieldBackgroundDisabledMixin = "dark:bg-gray-800 bg-opacity-80 dark:bg-opacity-90";
7
+ export const fieldBackgroundHoverMixin = "hover:bg-opacity-70 dark:hover:bg-opacity-60";
8
8
  export const defaultBorderMixin = "border-gray-100 dark:border-gray-800 dark:border-opacity-80";
9
- export const paperMixin = "bg-white rounded-md dark:bg-gray-950 border dark:border-gray-800 dark:border-opacity-90 border-gray-100";
10
- export const cardMixin = "bg-white rounded-md dark:bg-gray-950 dark:border-gray-800 dark:border-opacity-50 transition duration-200 ease-in-out m-1 -p-1 border border-transparent";
9
+ export const paperMixin = "bg-white rounded-md dark:bg-gray-950 border dark:border-gray-800 dark:border-opacity-80 border-gray-100";
10
+ export const cardMixin = "bg-white border border-gray-100 dark:border-transparent rounded-md dark:bg-gray-950 dark:border-gray-800 dark:border-opacity-50 transition duration-200 ease-in-out 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/src/util/index.ts CHANGED
@@ -2,5 +2,3 @@ export * from "./cn";
2
2
  export * from "./debounce";
3
3
  export * from "./chip_colors";
4
4
  export * from "./key_to_icon_component";
5
- export * from "./useInjectStyles";
6
- export * from "./useOutsideAlerter";
@@ -0,0 +1,70 @@
1
+ export default {
2
+ darkMode: ["selector", "[data-theme=\"dark\"]"],
3
+ mode: "jit",
4
+ content: [
5
+ "./index.html",
6
+ "./src/**/*.{js,ts,jsx,tsx}",
7
+ "./node_modules/@firecms/**/*.{js,ts,jsx,tsx}"
8
+ ],
9
+ plugins: [
10
+ require("@tailwindcss/typography")
11
+ ],
12
+ theme: {
13
+ extend: {
14
+ fontFamily: {
15
+ sans: [
16
+ "Rubik",
17
+ "Roboto",
18
+ "Helvetica",
19
+ "Arial",
20
+ "sans-serif"
21
+ ],
22
+ headers: [
23
+ "Rubik",
24
+ "Roboto",
25
+ "Helvetica",
26
+ "Arial",
27
+ "sans-serif"
28
+ ],
29
+ mono: [
30
+ "JetBrains Mono",
31
+ "Space Mono",
32
+ "Lucida Console",
33
+ "monospace"
34
+ ]
35
+ },
36
+ colors: {
37
+ primary: "var(--fcms-primary)",
38
+ "primary-dark": "var(--fcms-primary-dark)",
39
+ "primary-bg": "var(--fcms-primary-bg)",
40
+ secondary: "var(--fcms-secondary)",
41
+ field: {
42
+ disabled: "rgb(224 224 226)",
43
+ "disabled-dark": "rgb(35 35 37)"
44
+ },
45
+ text: {
46
+ primary: "rgba(0, 0, 0, 0.87)",
47
+ "primary-dark": "#ffffff",
48
+ secondary: "rgba(0, 0, 0, 0.6)",
49
+ "secondary-dark": "rgba(255, 255, 255, 0.7)",
50
+ disabled: "rgba(0, 0, 0, 0.38)",
51
+ "disabled-dark": "rgba(255, 255, 255, 0.5)",
52
+ label: "rgb(131, 131, 131)"
53
+ },
54
+ gray: {
55
+ 50: "#f8f8fc",
56
+ 100: "#E7E7EB",
57
+ 200: "#CFCFD6",
58
+ 300: "#B7B7BF",
59
+ 400: "#A0A0A9",
60
+ 500: "#87878F",
61
+ 600: "#6C6C75",
62
+ 700: "#505058",
63
+ 800: "#35353A",
64
+ 900: "#18181C",
65
+ 950: "#101013"
66
+ }
67
+ }
68
+ }
69
+ }
70
+ };
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes