@rebasepro/ui 0.8.0 → 0.9.1-canary.09aaf62

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.
@@ -54,6 +54,16 @@
54
54
  --color-surface-accent-950: #0f172a;
55
55
  }
56
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;
65
+ }
66
+
57
67
  /* Chrome, Safari and Opera */
58
68
  .no-scrollbar::-webkit-scrollbar {
59
69
  display: none;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rebasepro/ui",
3
3
  "type": "module",
4
- "version": "0.8.0",
4
+ "version": "0.9.1-canary.09aaf62",
5
5
  "description": "Awesome Firebase/Firestore-based headless open-source CMS",
6
6
  "funding": {
7
7
  "url": "https://github.com/sponsors/rebaseco"
@@ -13,12 +13,12 @@
13
13
  "url": "https://github.com/rebasepro/rebase.git",
14
14
  "directory": "packages/ui"
15
15
  },
16
- "main": "./dist/index.umd.js",
16
+ "main": "./dist/index.es.js",
17
17
  "module": "./dist/index.es.js",
18
18
  "types": "./dist/index.d.ts",
19
19
  "source": "src/index.ts",
20
20
  "engines": {
21
- "node": ">=14"
21
+ "node": ">=20"
22
22
  },
23
23
  "keywords": [
24
24
  "rebase",
@@ -35,8 +35,7 @@
35
35
  ".": {
36
36
  "types": "./dist/index.d.ts",
37
37
  "development": "./dist/index.es.js",
38
- "import": "./dist/index.es.js",
39
- "require": "./dist/index.umd.js"
38
+ "import": "./dist/index.es.js"
40
39
  },
41
40
  "./package.json": "./package.json",
42
41
  "./index.css": "./dist/index.css",
@@ -112,7 +111,7 @@
112
111
  },
113
112
  "scripts": {
114
113
  "watch": "vite build --watch",
115
- "build": "rm -rf dist || true && vite build && cp dist/src/index.css dist/index.css 2>/dev/null; tsc --emitDeclarationOnly -p tsconfig.prod.json",
114
+ "build": "rm -rf dist || true && vite build && cp dist/src/index.css dist/index.css 2>/dev/null; tsc --emitDeclarationOnly -p tsconfig.prod.json && node ../../scripts/assert-build-output.mjs",
116
115
  "test:lint": "eslint \"src/**\" --quiet",
117
116
  "test": "jest --passWithNoTests",
118
117
  "clean": "rm -rf dist && find ./src -name '*.js' -type f | xargs rm -f",
@@ -24,13 +24,13 @@ export function CircularProgress({
24
24
 
25
25
  let borderClasses = "";
26
26
  if (size === "smallest") {
27
- borderClasses = "border-[3px]";
27
+ borderClasses = "border-2";
28
28
  } else if (size === "small") {
29
- borderClasses = "border-[4px]";
29
+ borderClasses = "border-2";
30
30
  } else if (size === "medium") {
31
- borderClasses = "border-4";
31
+ borderClasses = "border-[3px]";
32
32
  } else {
33
- borderClasses = "border-[6px]";
33
+ borderClasses = "border-4";
34
34
  }
35
35
 
36
36
  return (
@@ -38,8 +38,9 @@ export function CircularProgress({
38
38
  className={cls(
39
39
  sizeClasses,
40
40
  borderClasses,
41
- "inline-block animate-spin rounded-full border-solid border-current border-r-transparent align-[-0.125em] motion-reduce:animate-[spin_1.5s_linear_infinite]",
42
- "text-primary dark:text-primary",
41
+ "inline-block shrink-0 rounded-full border-solid align-[-0.125em]",
42
+ "animate-[spin_0.7s_linear_infinite] motion-reduce:animate-[spin_1.5s_linear_infinite]",
43
+ "border-surface-200 dark:border-surface-700 border-t-primary dark:border-t-primary",
43
44
  className)}
44
45
  role="status">
45
46
  <span
@@ -288,7 +288,13 @@ export type WhereFilterOp =
288
288
  | "array-contains"
289
289
  | "in"
290
290
  | "not-in"
291
- | "array-contains-any";
291
+ | "array-contains-any"
292
+ | "like"
293
+ | "ilike"
294
+ | "not-like"
295
+ | "not-ilike"
296
+ | "is-null"
297
+ | "is-not-null";
292
298
 
293
299
  export type FilterValues<Key extends string> =
294
300
  Partial<Record<Key, [WhereFilterOp, unknown] | [WhereFilterOp, unknown][]>>;
@@ -2,7 +2,7 @@ import { useSyncExternalStore, useCallback, useRef } from "react";
2
2
 
3
3
  export interface SelectedCell {
4
4
  columnKey: string;
5
- rowId: string | number;
5
+ id: string | number;
6
6
  cellRect?: DOMRect;
7
7
  width?: number;
8
8
  height?: number;
@@ -12,7 +12,7 @@ export function createVirtualTableSelectionStore<T extends SelectedCell = Select
12
12
  let selectedCell: T | undefined = undefined;
13
13
  const listeners = new Set<() => void>();
14
14
 
15
- function getSnapshot(): T | undefined {
15
+ function getEntity(): T | undefined {
16
16
  return selectedCell;
17
17
  }
18
18
 
@@ -27,7 +27,7 @@ export function createVirtualTableSelectionStore<T extends SelectedCell = Select
27
27
  }
28
28
 
29
29
  return {
30
- getSnapshot,
30
+ getEntity,
31
31
  subscribe,
32
32
  select
33
33
  };
@@ -38,17 +38,17 @@ export type VirtualTableSelectionStore<T extends SelectedCell = SelectedCell> =
38
38
  export function useVirtualTableCellSelected<T extends SelectedCell = SelectedCell>(
39
39
  store: VirtualTableSelectionStore<T>,
40
40
  columnKey: string,
41
- rowId: string | number
41
+ id: string | number
42
42
  ): boolean {
43
- const selectorRef = useRef({ columnKey, rowId });
44
- selectorRef.current = { columnKey, rowId };
43
+ const selectorRef = useRef({ columnKey, id });
44
+ selectorRef.current = { columnKey, id };
45
45
 
46
- const getSnapshot = useCallback(() => {
47
- const cell = store.getSnapshot();
46
+ const getEntity = useCallback(() => {
47
+ const cell = store.getEntity();
48
48
  if (!cell) return false;
49
49
  const s = selectorRef.current;
50
- return cell.columnKey === s.columnKey && cell.rowId === s.rowId;
50
+ return cell.columnKey === s.columnKey && cell.id === s.id;
51
51
  }, [store]);
52
52
 
53
- return useSyncExternalStore(store.subscribe, getSnapshot, getSnapshot);
53
+ return useSyncExternalStore(store.subscribe, getEntity, getEntity);
54
54
  }
package/src/index.css CHANGED
@@ -54,6 +54,16 @@
54
54
  --color-surface-accent-950: #0f172a;
55
55
  }
56
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;
65
+ }
66
+
57
67
  /* Chrome, Safari and Opera */
58
68
  .no-scrollbar::-webkit-scrollbar {
59
69
  display: none;