@rebasepro/ui 0.9.1-canary.fd3754b → 0.10.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/dist/components/Chip.d.ts +2 -10
- package/dist/components/DebouncedTextField.d.ts +1 -1
- package/dist/components/VirtualTable/VirtualTableProps.d.ts +1 -1
- package/dist/index.es.js +5 -5
- package/dist/index.es.js.map +1 -1
- package/dist/util/chip_colors.d.ts +9 -1
- package/package.json +5 -6
- package/src/components/Chip.tsx +2 -10
- package/src/components/CircularProgress.tsx +7 -6
- package/src/components/DebouncedTextField.tsx +1 -1
- package/src/components/SearchBar.tsx +2 -1
- package/src/components/VirtualTable/VirtualTable.tsx +3 -1
- package/src/components/VirtualTable/VirtualTableProps.tsx +1 -1
- package/src/util/chip_colors.ts +11 -1
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
export type ChipColorScheme = {
|
|
2
|
+
color: string;
|
|
3
|
+
text: string;
|
|
4
|
+
/** Background color override for dark mode */
|
|
5
|
+
darkColor?: string;
|
|
6
|
+
/** Text color override for dark mode */
|
|
7
|
+
darkText?: string;
|
|
8
|
+
};
|
|
2
9
|
export declare const CHIP_COLORS: Record<string, ChipColorScheme>;
|
|
10
|
+
export type ChipColorKey = keyof typeof CHIP_COLORS;
|
|
3
11
|
export declare function getColorSchemeForKey(key: ChipColorKey): ChipColorScheme;
|
|
4
12
|
export declare function getColorSchemeForSeed(seed: string): ChipColorScheme;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rebasepro/ui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.10.0",
|
|
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.
|
|
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": ">=
|
|
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",
|
package/src/components/Chip.tsx
CHANGED
|
@@ -1,16 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { CHIP_COLORS, cls, getColorSchemeForKey } from "../util";
|
|
3
|
+
import type { ChipColorKey, ChipColorScheme } from "../util/chip_colors";
|
|
3
4
|
|
|
4
|
-
export type ChipColorScheme
|
|
5
|
-
color: string;
|
|
6
|
-
text: string;
|
|
7
|
-
/** Background color override for dark mode */
|
|
8
|
-
darkColor?: string;
|
|
9
|
-
/** Text color override for dark mode */
|
|
10
|
-
darkText?: string;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export type ChipColorKey = keyof typeof CHIP_COLORS;
|
|
5
|
+
export type { ChipColorKey, ChipColorScheme };
|
|
14
6
|
|
|
15
7
|
export interface ChipProps {
|
|
16
8
|
className?: string;
|
|
@@ -24,13 +24,13 @@ export function CircularProgress({
|
|
|
24
24
|
|
|
25
25
|
let borderClasses = "";
|
|
26
26
|
if (size === "smallest") {
|
|
27
|
-
borderClasses = "border-
|
|
27
|
+
borderClasses = "border-2";
|
|
28
28
|
} else if (size === "small") {
|
|
29
|
-
borderClasses = "border-
|
|
29
|
+
borderClasses = "border-2";
|
|
30
30
|
} else if (size === "medium") {
|
|
31
|
-
borderClasses = "border-
|
|
31
|
+
borderClasses = "border-[3px]";
|
|
32
32
|
} else {
|
|
33
|
-
borderClasses = "border-
|
|
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
|
|
42
|
-
"
|
|
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
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import React, { useCallback, useEffect, useRef, useState } from "react";
|
|
3
|
-
import { TextField, TextFieldProps } from "./
|
|
3
|
+
import { TextField, TextFieldProps } from "./TextField";
|
|
4
4
|
|
|
5
5
|
type TextFieldChangeEvent = React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>;
|
|
6
6
|
|
|
@@ -5,7 +5,8 @@ import { iconSize } from "../icons/Icon";
|
|
|
5
5
|
import React, { useCallback, useState } from "react";
|
|
6
6
|
|
|
7
7
|
import { defaultBorderMixin } from "../styles";
|
|
8
|
-
import { CircularProgress
|
|
8
|
+
import { CircularProgress } from "./CircularProgress";
|
|
9
|
+
import { IconButton } from "./IconButton";
|
|
9
10
|
|
|
10
11
|
import { cls } from "../util";
|
|
11
12
|
import { useDebounceValue } from "../hooks";
|
|
@@ -20,7 +20,9 @@ import { VirtualTableContextProps } from "./types";
|
|
|
20
20
|
import { VirtualTableHeaderRow } from "./VirtualTableHeaderRow";
|
|
21
21
|
import { VirtualTableRow } from "./VirtualTableRow";
|
|
22
22
|
import { VirtualTableCell } from "./VirtualTableCell";
|
|
23
|
-
import { CenteredView
|
|
23
|
+
import { CenteredView } from "../CenteredView";
|
|
24
|
+
import { Typography } from "../Typography";
|
|
25
|
+
import { cls } from "../../util/cls";
|
|
24
26
|
import { useDebounceCallback } from "../../hooks/useDebounceCallback";
|
|
25
27
|
import {
|
|
26
28
|
closestCenter,
|
package/src/util/chip_colors.ts
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
import { ChipColorKey, ChipColorScheme } from "../components";
|
|
2
1
|
import { hashString } from "./hash";
|
|
3
2
|
|
|
3
|
+
export type ChipColorScheme = {
|
|
4
|
+
color: string;
|
|
5
|
+
text: string;
|
|
6
|
+
/** Background color override for dark mode */
|
|
7
|
+
darkColor?: string;
|
|
8
|
+
/** Text color override for dark mode */
|
|
9
|
+
darkText?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
4
12
|
export const CHIP_COLORS: Record<string, ChipColorScheme> = {
|
|
5
13
|
blue: { color: "#cfdfff",
|
|
6
14
|
text: "#102046",
|
|
@@ -64,6 +72,8 @@ darkColor: "#059669",
|
|
|
64
72
|
darkText: "#d1fae5" }
|
|
65
73
|
};
|
|
66
74
|
|
|
75
|
+
export type ChipColorKey = keyof typeof CHIP_COLORS;
|
|
76
|
+
|
|
67
77
|
export function getColorSchemeForKey(key: ChipColorKey): ChipColorScheme {
|
|
68
78
|
return CHIP_COLORS[key];
|
|
69
79
|
}
|