@rebasepro/ui 0.0.1-canary.f81da60 → 0.1.0

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rebasepro/ui",
3
3
  "type": "module",
4
- "version": "0.0.1-canary.f81da60",
4
+ "version": "0.1.0",
5
5
  "description": "Awesome Firebase/Firestore-based headless open-source CMS",
6
6
  "funding": {
7
7
  "url": "https://github.com/sponsors/rebaseco"
@@ -69,7 +69,7 @@
69
69
  "react-use-measure": "^2.1.7",
70
70
  "react-window": "^1.8.11",
71
71
  "tailwind-merge": "^2.6.0",
72
- "@rebasepro/types": "0.0.1-canary.f81da60"
72
+ "@rebasepro/types": "0.1.0"
73
73
  },
74
74
  "peerDependencies": {
75
75
  "react": ">=19.0.0",
@@ -42,22 +42,22 @@ const ButtonInner = React.memo(React.forwardRef<
42
42
  "border border-primary bg-primary focus:ring-primary shadow-sm hover:shadow-md hover:brightness-110 text-white hover:text-white": variant === "filled" && color === "primary" && !disabled,
43
43
  "border border-secondary bg-secondary focus:ring-secondary shadow-sm hover:shadow-md hover:brightness-110 text-white hover:text-white": variant === "filled" && color === "secondary" && !disabled,
44
44
  "border border-red-500 bg-red-500 hover:bg-red-600 focus:ring-red-500 shadow-sm hover:shadow-md text-white hover:text-white": variant === "filled" && color === "error" && !disabled,
45
- "border border-surface-accent-200 bg-surface-accent-200 hover:bg-surface-accent-300 focus:ring-surface-accent-400 shadow-sm hover:shadow-md text-text-primary hover:text-text-primary dark:text-text-primary-dark hover:dark:text-text-primary-dark": variant === "filled" && color === "text" && !disabled,
46
- "border border-transparent bg-surface-100 hover:bg-surface-accent-200 text-text-primary dark:bg-surface-700 dark:hover:bg-surface-accent-600 dark:text-text-primary-dark hover:text-text-primary dark:text-text-primary-dark hover:dark:text-text-primary-dark": variant === "filled" && color === "neutral" && !disabled,
45
+ "border border-surface-accent-200 bg-surface-accent-200 hover:bg-surface-accent-300 focus:ring-surface-accent-400 shadow-sm hover:shadow-md text-text-primary hover:text-text-primary dark:border-surface-accent-700 dark:bg-surface-accent-700 dark:hover:bg-surface-accent-600 dark:text-text-primary-dark hover:dark:text-text-primary-dark": variant === "filled" && color === "text" && !disabled,
46
+ "border border-transparent bg-surface-100 hover:bg-surface-accent-200 text-text-primary dark:bg-surface-700 dark:hover:bg-surface-accent-700 dark:text-text-primary-dark hover:text-text-primary dark:text-text-primary-dark hover:dark:text-text-primary-dark": variant === "filled" && color === "neutral" && !disabled,
47
47
 
48
48
  // Text Variants
49
49
  "border border-transparent text-primary hover:text-primary hover:bg-surface-accent-200 hover:bg-opacity-75 hover:bg-surface-accent-200/75 dark:hover:bg-surface-accent-800": variant === "text" && color === "primary" && !disabled,
50
50
  "border border-transparent text-secondary hover:text-secondary hover:bg-surface-accent-200 hover:bg-opacity-75 hover:bg-surface-accent-200/75 dark:hover:bg-surface-accent-800": variant === "text" && color === "secondary" && !disabled,
51
51
  "border border-transparent text-red-500 hover:text-red-500 hover:bg-red-500 hover:bg-opacity-10 hover:bg-red-500/10": variant === "text" && color === "error" && !disabled,
52
- "border border-transparent text-text-primary hover:text-text-primary dark:text-text-primary-dark hover:dark:text-text-primary-dark hover:bg-surface-accent-200 hover:dark:bg-surface-700": variant === "text" && color === "text" && !disabled,
53
- "border border-transparent text-text-primary hover:text-text-primary hover:bg-surface-accent-200 dark:text-text-primary-dark dark:hover:text-text-primary-dark dark:hover:bg-surface-accent-700": variant === "text" && color === "neutral" && !disabled,
52
+ "border border-transparent text-text-primary hover:text-text-primary dark:text-text-primary-dark hover:dark:text-text-primary-dark hover:bg-surface-accent-200 hover:bg-opacity-75 hover:bg-surface-accent-200/75 dark:hover:bg-surface-accent-800": variant === "text" && color === "text" && !disabled,
53
+ "border border-transparent text-text-primary hover:text-text-primary hover:bg-surface-accent-200 hover:bg-opacity-75 hover:bg-surface-accent-200/75 dark:text-text-primary-dark dark:hover:text-text-primary-dark dark:hover:bg-surface-accent-800": variant === "text" && color === "neutral" && !disabled,
54
54
 
55
55
  // Outlined Variants
56
56
  "border border-primary text-primary hover:text-primary hover:bg-primary-bg hover:bg-primary/10": variant === "outlined" && color === "primary" && !disabled,
57
57
  "border border-secondary text-secondary hover:text-secondary hover:bg-secondary-bg": variant === "outlined" && color === "secondary" && !disabled,
58
58
  "border border-red-500 text-red-500 hover:text-red-500 hover:bg-red-500 hover:text-white": variant === "outlined" && color === "error" && !disabled,
59
- "border border-surface-accent-400 text-text-primary hover:text-text-primary dark:text-text-primary-dark hover:bg-surface-accent-200": variant === "outlined" && color === "text" && !disabled,
60
- "border border-surface-300 text-text-primary hover:bg-surface-accent-200 dark:border-surface-600 dark:text-text-primary-dark dark:hover:bg-surface-accent-700": variant === "outlined" && color === "neutral" && !disabled,
59
+ "border border-surface-accent-400 text-text-primary hover:text-text-primary dark:text-text-primary-dark dark:border-surface-accent-600 hover:bg-surface-accent-200 hover:bg-opacity-75 hover:bg-surface-accent-200/75 dark:hover:bg-surface-accent-800": variant === "outlined" && color === "text" && !disabled,
60
+ "border border-surface-300 text-text-primary hover:bg-surface-accent-200 hover:bg-opacity-75 hover:bg-surface-accent-200/75 dark:border-surface-600 dark:text-text-primary-dark dark:hover:bg-surface-accent-800": variant === "outlined" && color === "neutral" && !disabled,
61
61
 
62
62
  // Disabled states for all variants
63
63
  "text-text-disabled dark:text-text-disabled-dark": disabled,
@@ -292,7 +292,7 @@ hour12: false,
292
292
  }}
293
293
  className="absolute right-3 top-1/2 transform -translate-y-1/2 text-surface-accent-500!"
294
294
  >
295
- <CalendarIcon color={"disabled"}/>
295
+ <CalendarIcon/>
296
296
  </IconButton>
297
297
  {clearable && value && (
298
298
  <IconButton
@@ -28,6 +28,10 @@ interface SearchBarProps {
28
28
  disabled?: boolean;
29
29
  loading?: boolean;
30
30
  inputRef?: React.Ref<HTMLInputElement>;
31
+ /**
32
+ * Optional initial value for the search input, e.g. from URL params.
33
+ */
34
+ initialValue?: string;
31
35
  }
32
36
 
33
37
  export function SearchBar({
@@ -41,10 +45,11 @@ export function SearchBar({
41
45
  autoFocus,
42
46
  disabled,
43
47
  loading,
44
- inputRef
48
+ inputRef,
49
+ initialValue
45
50
  }: SearchBarProps) {
46
51
 
47
- const [searchText, setSearchText] = useState<string>("");
52
+ const [searchText, setSearchText] = useState<string>(initialValue ?? "");
48
53
  const [active, setActive] = useState<boolean>(false);
49
54
 
50
55
  const deferredValues = useDebounceValue(searchText, 200);
@@ -65,7 +65,7 @@ export const Tooltip = ({
65
65
 
66
66
  return (
67
67
  <TooltipPrimitive.Provider delayDuration={delayDuration}>
68
- <TooltipPrimitive.Root open={open} onOpenChange={onOpenChange} defaultOpen={defaultOpen}>
68
+ <TooltipPrimitive.Root {...(open !== undefined ? { open, onOpenChange } : {})} defaultOpen={defaultOpen}>
69
69
  {trigger}
70
70
  <TooltipPrimitive.Portal container={finalContainer}>
71
71
  <TooltipPrimitive.Content
@@ -8,7 +8,7 @@ import { deepEqual as equal } from "fast-equals"
8
8
  import { FixedSizeList as List } from "react-window";
9
9
  import useMeasure from "react-use-measure";
10
10
 
11
- import { CircularProgressCenter } from "../CircularProgressCenter";
11
+ import { CircularProgress } from "../CircularProgress";
12
12
  import {
13
13
  OnVirtualTableColumnResizeParams,
14
14
  VirtualTableColumn,
@@ -74,7 +74,7 @@ const innerElementType = forwardRef<HTMLDivElement, InnerElementProps>(({
74
74
  }}>
75
75
  <div style={{ position: "sticky",
76
76
  top: 0,
77
- zIndex: 10 }}>
77
+ zIndex: 20 }}>
78
78
  <VirtualTableHeaderRow {...virtualTableProps}/>
79
79
  </div>
80
80
  {!customView && children}
@@ -333,9 +333,11 @@ export const VirtualTable = React.memo<VirtualTableProps<any>>(
333
333
  </CenteredView>
334
334
  : (empty
335
335
  ? (loading
336
- ? <CircularProgressCenter/>
336
+ ? <div className="flex items-center justify-center py-12 px-8">
337
+ <CircularProgress size="small"/>
338
+ </div>
337
339
  : <div
338
- className="flex flex-col overflow-auto items-center justify-center p-8 h-full">
340
+ className="flex flex-col overflow-auto items-center justify-center py-12 px-8">
339
341
  {emptyComponent}
340
342
  </div>)
341
343
  : undefined);