@firecms/ui 3.3.0-canary.d3242eb → 3.4.0-canary.63041d0

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 (51) hide show
  1. package/dist/components/Card.d.ts +2 -3
  2. package/dist/components/Checkbox.d.ts +2 -1
  3. package/dist/components/Chip.d.ts +5 -1
  4. package/dist/components/Dialog.d.ts +2 -1
  5. package/dist/components/FilterChip.d.ts +34 -0
  6. package/dist/components/IconButton.d.ts +1 -0
  7. package/dist/components/Popover.d.ts +3 -1
  8. package/dist/components/SearchBar.d.ts +8 -1
  9. package/dist/components/Select.d.ts +1 -1
  10. package/dist/components/TextField.d.ts +2 -2
  11. package/dist/components/index.d.ts +1 -0
  12. package/dist/hooks/index.d.ts +1 -0
  13. package/dist/hooks/useDebounceCallback.d.ts +13 -0
  14. package/dist/index.css +43 -32
  15. package/dist/index.es.js +1027 -561
  16. package/dist/index.es.js.map +1 -1
  17. package/dist/index.umd.js +1026 -560
  18. package/dist/index.umd.js.map +1 -1
  19. package/dist/styles.d.ts +2 -2
  20. package/package.json +6 -6
  21. package/src/components/Alert.tsx +7 -7
  22. package/src/components/Avatar.tsx +1 -1
  23. package/src/components/BooleanSwitch.tsx +6 -3
  24. package/src/components/Button.tsx +17 -13
  25. package/src/components/Card.tsx +22 -5
  26. package/src/components/CenteredView.tsx +1 -1
  27. package/src/components/Checkbox.tsx +10 -4
  28. package/src/components/Chip.tsx +70 -11
  29. package/src/components/Collapse.tsx +2 -0
  30. package/src/components/Dialog.tsx +8 -5
  31. package/src/components/ExpandablePanel.tsx +3 -2
  32. package/src/components/FilterChip.tsx +79 -0
  33. package/src/components/IconButton.tsx +11 -6
  34. package/src/components/InfoLabel.tsx +1 -1
  35. package/src/components/InputLabel.tsx +2 -2
  36. package/src/components/Label.tsx +1 -1
  37. package/src/components/LoadingButton.tsx +1 -1
  38. package/src/components/Menu.tsx +2 -0
  39. package/src/components/Popover.tsx +9 -3
  40. package/src/components/RadioGroup.tsx +1 -1
  41. package/src/components/SearchBar.tsx +9 -1
  42. package/src/components/Select.tsx +8 -6
  43. package/src/components/Separator.tsx +2 -2
  44. package/src/components/Skeleton.tsx +25 -8
  45. package/src/components/TextField.tsx +27 -13
  46. package/src/components/ToggleButtonGroup.tsx +4 -2
  47. package/src/components/index.tsx +1 -0
  48. package/src/hooks/index.ts +1 -0
  49. package/src/hooks/useDebounceCallback.tsx +47 -0
  50. package/src/index.css +43 -32
  51. package/src/styles.ts +2 -2
@@ -1,9 +1,8 @@
1
1
  import React from "react";
2
- type CardProps = {
2
+ declare const Card: React.ForwardRefExoticComponent<{
3
3
  children: React.ReactNode;
4
4
  style?: React.CSSProperties;
5
5
  onClick?: (e?: React.MouseEvent) => void;
6
6
  className?: string;
7
- };
8
- declare const Card: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLDivElement>>;
7
+ } & React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
9
8
  export { Card };
@@ -8,5 +8,6 @@ export interface CheckboxProps {
8
8
  padding?: boolean;
9
9
  size?: "smallest" | "small" | "medium" | "large";
10
10
  color?: "primary" | "secondary";
11
+ "aria-label"?: string;
11
12
  }
12
- export declare const Checkbox: React.MemoExoticComponent<({ id, checked, indeterminate, padding, disabled, size, onCheckedChange, color }: CheckboxProps) => React.JSX.Element>;
13
+ export declare const Checkbox: React.MemoExoticComponent<({ id, checked, indeterminate, padding, disabled, size, onCheckedChange, color, "aria-label": ariaLabel }: CheckboxProps) => React.JSX.Element>;
@@ -3,12 +3,16 @@ import { CHIP_COLORS } from "../util";
3
3
  export type ChipColorScheme = {
4
4
  color: string;
5
5
  text: string;
6
+ /** Background color override for dark mode. Falls back to `color`. */
7
+ darkColor?: string;
8
+ /** Text color override for dark mode. Falls back to `text`. */
9
+ darkText?: string;
6
10
  };
7
11
  export type ChipColorKey = keyof typeof CHIP_COLORS;
8
12
  export interface ChipProps {
9
13
  className?: string;
10
14
  children: React.ReactNode;
11
- size?: "small" | "medium" | "large";
15
+ size?: "smallest" | "small" | "medium" | "large";
12
16
  colorScheme?: ChipColorScheme | ChipColorKey;
13
17
  error?: boolean;
14
18
  outlined?: boolean;
@@ -20,6 +20,7 @@ export type DialogProps = {
20
20
  */
21
21
  disableInitialFocus?: boolean;
22
22
  portalContainer?: HTMLElement | null;
23
+ "aria-describedby"?: string;
23
24
  };
24
25
  declare const widthClasses: {
25
26
  xs: string;
@@ -35,5 +36,5 @@ declare const widthClasses: {
35
36
  "7xl": string;
36
37
  full: string;
37
38
  };
38
- export declare const Dialog: ({ open, onOpenChange, children, className, containerClassName, fullWidth, fullHeight, fullScreen, scrollable, maxWidth, modal, onOpenAutoFocus, onEscapeKeyDown, onPointerDownOutside, onInteractOutside, disableInitialFocus, portalContainer }: DialogProps) => React.JSX.Element;
39
+ export declare const Dialog: ({ open, onOpenChange, children, className, containerClassName, fullWidth, fullHeight, fullScreen, scrollable, maxWidth, modal, onOpenAutoFocus, onEscapeKeyDown, onPointerDownOutside, onInteractOutside, disableInitialFocus, portalContainer, "aria-describedby": ariaDescribedby }: DialogProps) => React.JSX.Element;
39
40
  export {};
@@ -0,0 +1,34 @@
1
+ import React from "react";
2
+ export interface FilterChipProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "children"> {
3
+ /**
4
+ * The text label displayed on the chip.
5
+ */
6
+ children: React.ReactNode;
7
+ /**
8
+ * Whether the chip is currently in an active/selected state.
9
+ */
10
+ active?: boolean;
11
+ /**
12
+ * Optional icon rendered before the label.
13
+ */
14
+ icon?: React.ReactNode;
15
+ /**
16
+ * Size variant.
17
+ * @default "medium"
18
+ */
19
+ size?: "small" | "medium";
20
+ /**
21
+ * Whether the chip is disabled.
22
+ */
23
+ disabled?: boolean;
24
+ }
25
+ /**
26
+ * A toggle chip used for filter presets and similar multi-select controls.
27
+ *
28
+ * Uses an inset box-shadow for the active ring instead of `border` so the
29
+ * chip size stays stable across states and the ring cannot be clipped by
30
+ * parent `overflow-hidden` containers.
31
+ *
32
+ * @group Interactive components
33
+ */
34
+ export declare const FilterChip: React.ForwardRefExoticComponent<FilterChipProps & React.RefAttributes<HTMLButtonElement>>;
@@ -7,5 +7,6 @@ export type IconButtonProps<C extends React.ElementType> = Omit<(C extends "butt
7
7
  toggled?: boolean;
8
8
  component?: C;
9
9
  onClick?: React.MouseEventHandler<any>;
10
+ "aria-label"?: string;
10
11
  };
11
12
  export declare const IconButton: React.ComponentType<IconButtonProps<any>>;
@@ -18,5 +18,7 @@ export interface PopoverProps {
18
18
  modal?: boolean;
19
19
  className?: string;
20
20
  portalContainer?: HTMLElement | null;
21
+ onMouseEnter?: React.MouseEventHandler<HTMLDivElement>;
22
+ onMouseLeave?: React.MouseEventHandler<HTMLDivElement>;
21
23
  }
22
- export declare function Popover({ trigger, children, open, onOpenChange, side, sideOffset, align, alignOffset, arrowPadding, sticky, hideWhenDetached, avoidCollisions, enabled, modal, portalContainer, className }: PopoverProps): React.JSX.Element;
24
+ export declare function Popover({ trigger, children, open, onOpenChange, side, sideOffset, align, alignOffset, arrowPadding, sticky, hideWhenDetached, avoidCollisions, enabled, modal, portalContainer, className, onMouseEnter, onMouseLeave }: PopoverProps): React.JSX.Element;
@@ -3,6 +3,13 @@ interface SearchBarProps {
3
3
  onClick?: () => void;
4
4
  onTextSearch?: (searchString?: string) => void;
5
5
  placeholder?: string;
6
+ /**
7
+ * Text the input is initialised with. Use it when the search term is restored from
8
+ * somewhere else, e.g. a URL query parameter, so that the input reflects the search
9
+ * that is actually being applied. Only read when the component mounts; the search bar
10
+ * owns the text from then on.
11
+ */
12
+ initialValue?: string;
6
13
  expandable?: boolean;
7
14
  /**
8
15
  * Size of the search bar.
@@ -22,5 +29,5 @@ interface SearchBarProps {
22
29
  loading?: boolean;
23
30
  inputRef?: React.Ref<HTMLInputElement>;
24
31
  }
25
- export declare function SearchBar({ onClick, onTextSearch, placeholder, expandable, size, large, innerClassName, className, autoFocus, disabled, loading, inputRef }: SearchBarProps): React.JSX.Element;
32
+ export declare function SearchBar({ onClick, onTextSearch, placeholder, initialValue, expandable, size, large, innerClassName, className, autoFocus, disabled, loading, inputRef }: SearchBarProps): React.JSX.Element;
26
33
  export {};
@@ -20,7 +20,7 @@ export type SelectProps<T extends SelectValue = string> = {
20
20
  error?: boolean;
21
21
  position?: "item-aligned" | "popper";
22
22
  endAdornment?: React.ReactNode;
23
- inputRef?: React.RefObject<HTMLButtonElement | null>;
23
+ inputRef?: React.Ref<HTMLButtonElement>;
24
24
  padding?: boolean;
25
25
  invisible?: boolean;
26
26
  children?: React.ReactNode;
@@ -27,7 +27,7 @@ export type TextFieldProps<T extends string | number> = {
27
27
  * @default 1
28
28
  */
29
29
  minRows?: number | string;
30
- } & Omit<React.InputHTMLAttributes<HTMLInputElement>, "size">;
30
+ } & Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "value">;
31
31
  export declare const TextField: React.ForwardRefExoticComponent<{
32
32
  type?: InputType;
33
33
  value?: string | number | undefined;
@@ -55,4 +55,4 @@ export declare const TextField: React.ForwardRefExoticComponent<{
55
55
  * @default 1
56
56
  */
57
57
  minRows?: number | string;
58
- } & Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> & React.RefAttributes<HTMLDivElement>>;
58
+ } & Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "size"> & React.RefAttributes<HTMLDivElement>>;
@@ -11,6 +11,7 @@ export * from "./Collapse";
11
11
  export * from "./CircularProgress";
12
12
  export * from "./Checkbox";
13
13
  export * from "./Chip";
14
+ export * from "./FilterChip";
14
15
  export * from "./ColorPicker";
15
16
  export * from "./DateTimeField";
16
17
  export * from "./Dialog";
@@ -1,5 +1,6 @@
1
1
  export * from "./useInjectStyles";
2
2
  export * from "./useOutsideAlerter";
3
3
  export * from "./useDebounceValue";
4
+ export * from "./useDebounceCallback";
4
5
  export * from "./useIconStyles";
5
6
  export * from "./PortalContainerContext";
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Returns a debounced version of the provided callback. The returned function
3
+ * keeps the same signature as the input callback; each invocation resets the
4
+ * timer, so the wrapped callback only runs once calls stop for `delay` ms.
5
+ *
6
+ * Unlike {@link useDebounceValue}, which debounces a *value*, this debounces a
7
+ * *function call* — useful for search inputs, autosave, resize handlers, etc.
8
+ *
9
+ * @param callback the function to debounce. May be undefined.
10
+ * @param delay debounce delay in milliseconds. Defaults to 200ms.
11
+ * @group Hooks
12
+ */
13
+ export declare function useDebounceCallback<T extends (...args: any[]) => unknown>(callback?: T, delay?: number): T;
package/dist/index.css CHANGED
@@ -19,26 +19,26 @@
19
19
  --color-field-disabled: rgb(224 224 226);
20
20
  --color-field-disabled-dark: rgb(35 35 37);
21
21
 
22
- /* Text Colors */
23
- --color-text-primary: rgba(0, 0, 0, 0.87);
24
- --color-text-secondary: rgba(0, 0, 0, 0.52);
25
- --color-text-disabled: rgba(0, 0, 0, 0.38);
22
+ /* Text Colors — using opaque values so icon strokes render solidly */
23
+ --color-text-primary: #212121;
24
+ --color-text-secondary: #757575;
25
+ --color-text-disabled: #9e9e9e;
26
26
  --color-text-primary-dark: #ffffff;
27
- --color-text-secondary-dark: rgba(255, 255, 255, 0.6);
28
- --color-text-disabled-dark: rgba(255, 255, 255, 0.48);
27
+ --color-text-secondary-dark: #a0a0a9;
28
+ --color-text-disabled-dark: #757580;
29
29
 
30
30
  /* Surface Colors */
31
- --color-surface-50: #f8f8fc;
32
- --color-surface-100: #e7e7eb;
33
- --color-surface-200: #cfcfd6;
34
- --color-surface-300: #b7b7bf;
35
- --color-surface-400: #a0a0a9;
36
- --color-surface-500: #87878f;
37
- --color-surface-600: #6b6b74;
38
- --color-surface-700: #454552;
39
- --color-surface-800: #292934;
40
- --color-surface-900: #18181c;
41
- --color-surface-950: #101013;
31
+ --color-surface-50: #fafafa;
32
+ --color-surface-100: #f5f5f5;
33
+ --color-surface-200: #e5e5e5;
34
+ --color-surface-300: #d4d4d4;
35
+ --color-surface-400: #a3a3a3;
36
+ --color-surface-500: #737373;
37
+ --color-surface-600: #404040;
38
+ --color-surface-700: #2e2e33;
39
+ --color-surface-800: #1f1f23;
40
+ --color-surface-900: #131316;
41
+ --color-surface-950: #0d0d0f;
42
42
 
43
43
  /* Surface Accent Colors */
44
44
  --color-surface-accent-50: #f8fafc;
@@ -50,8 +50,18 @@
50
50
  --color-surface-accent-600: #475569;
51
51
  --color-surface-accent-700: #334155;
52
52
  --color-surface-accent-800: #1e293b;
53
- --color-surface-accent-900: #0f172a;
54
- --color-surface-accent-950: #020617;
53
+ --color-surface-accent-900: #172033;
54
+ --color-surface-accent-950: #0f172a;
55
+ }
56
+
57
+ /* Native UI (scrollbars, form controls) must follow the active theme,
58
+ otherwise Chrome renders light scrollbars in dark mode */
59
+ html {
60
+ color-scheme: light;
61
+ }
62
+
63
+ html.dark {
64
+ color-scheme: dark;
55
65
  }
56
66
 
57
67
  /* Chrome, Safari and Opera */
@@ -65,50 +75,51 @@
65
75
  }
66
76
 
67
77
  .typography-h1 {
68
- @apply text-6xl font-headers font-light tracking-tight;
78
+ @apply text-4xl font-headers font-semibold tracking-tight;
69
79
  }
70
80
 
71
81
  .typography-h2 {
72
- @apply text-5xl font-headers font-light tracking-tight;
82
+ @apply text-3xl font-headers font-semibold tracking-tight;
73
83
  }
74
84
 
75
85
  .typography-h3 {
76
- @apply text-4xl font-headers font-normal tracking-tight;
86
+ @apply text-2xl font-headers font-semibold tracking-tight;
77
87
  }
78
88
 
79
89
  .typography-h4 {
80
- @apply text-3xl font-headers font-normal tracking-tight;
90
+ @apply text-xl font-headers font-semibold tracking-[-0.01em];
81
91
  }
82
92
 
83
93
  .typography-h5 {
84
- @apply text-2xl font-headers font-normal;
94
+ @apply text-lg font-headers font-semibold tracking-[-0.01em];
85
95
  }
86
96
 
87
97
  .typography-h6 {
88
- @apply text-xl font-headers font-medium;
98
+ @apply text-base font-headers font-semibold tracking-[-0.01em];
89
99
  }
90
100
 
91
101
  .typography-subtitle1 {
92
- @apply text-lg font-headers font-medium;
102
+ @apply text-sm font-headers font-semibold tracking-[-0.01em];
93
103
  }
94
104
 
95
105
  .typography-subtitle2 {
96
- @apply text-base font-headers font-medium;
106
+ @apply text-sm font-headers font-medium;
97
107
  }
98
108
 
99
109
  .typography-body1 {
110
+ @apply text-sm;
100
111
  }
101
112
 
102
113
  .typography-body2 {
103
- @apply text-sm;
114
+ @apply text-xs;
104
115
  }
105
116
 
106
117
  .typography-caption {
107
- @apply text-xs;
118
+ @apply text-[11px] leading-[1.4];
108
119
  }
109
120
 
110
121
  .typography-label {
111
- @apply text-sm font-medium;
122
+ @apply text-xs font-medium tracking-wide;
112
123
  }
113
124
 
114
125
  .typography-inherit {
@@ -116,10 +127,10 @@
116
127
  }
117
128
 
118
129
  .typography-button {
119
- @apply text-sm font-semibold uppercase;
130
+ @apply text-sm font-semibold tracking-wide;
120
131
  }
121
132
 
122
133
  :focus-visible {
123
- @apply outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-transparent
134
+ @apply outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-0 focus-visible:ring-offset-transparent
124
135
  }
125
136