@brdgapp/ui 1.9.0 → 1.11.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/CHANGELOG.md +54 -1
- package/README.md +6 -1
- package/components/action-menu.d.ts +18 -6
- package/components/action-menu.js +28 -9
- package/components/app-shell.js +1 -1
- package/components/button.d.ts +6 -1
- package/components/button.js +16 -4
- package/components/column-filter-menu.d.ts +20 -4
- package/components/column-filter-menu.js +26 -4
- package/components/copy-field.d.ts +14 -7
- package/components/copy-field.js +25 -22
- package/components/data-table.d.ts +1 -1
- package/components/data-table.js +2 -2
- package/components/date-picker.d.ts +77 -0
- package/components/date-picker.js +367 -0
- package/components/filter-pill.d.ts +58 -4
- package/components/filter-pill.js +115 -10
- package/components/icon-button.d.ts +7 -1
- package/components/icon-button.js +14 -4
- package/components/input.d.ts +27 -3
- package/components/input.js +96 -3
- package/components/search-input.js +2 -2
- package/components/select.d.ts +41 -6
- package/components/select.js +167 -2
- package/components/spinner.d.ts +19 -0
- package/components/spinner.js +20 -0
- package/hooks/use-copy.d.ts +10 -0
- package/hooks/use-copy.js +27 -0
- package/hooks/use-theme.js +3 -3
- package/lib/theme.d.ts +2 -2
- package/lib/theme.js +7 -7
- package/package.json +4 -3
package/lib/theme.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
// Light, dark or system, the same in every Bridge app. Decided 2026-11-03 (Aman): every web app offers dark
|
|
2
|
-
// mode; the choice is Light, Dark or System (
|
|
2
|
+
// mode; the choice is Light, Dark or System (following the device); one choice applies across
|
|
3
3
|
// all Bridge apps, so it's kept in a cookie for the whole brdg.app domain. Built on Bridge OS's version
|
|
4
4
|
// (src/lib/hooks/use-theme.tsx and the init script in its root layout), which kept it per app in
|
|
5
5
|
// localStorage under "bridge-theme" and offered Light and Dark only; that key is still read, so people who
|
|
6
|
-
// chose dark in Bridge OS keep it.
|
|
6
|
+
// chose dark in Bridge OS keep it. Light is the default until someone chooses (Aman, 2026-11-19).
|
|
7
7
|
export const THEME_COOKIE = "bridge-theme";
|
|
8
8
|
const ONE_YEAR = 60 * 60 * 24 * 365;
|
|
9
9
|
const DARK_QUERY = "(prefers-color-scheme: dark)";
|
|
10
10
|
function isPreference(v) {
|
|
11
11
|
return v === "light" || v === "dark" || v === "system";
|
|
12
12
|
}
|
|
13
|
-
/** The saved choice: the shared cookie, then Bridge OS's old per-app key, then
|
|
13
|
+
/** The saved choice: the shared cookie, then Bridge OS's old per-app key, then Light. */
|
|
14
14
|
export function readPreference() {
|
|
15
15
|
if (typeof document === "undefined")
|
|
16
|
-
return "
|
|
16
|
+
return "light";
|
|
17
17
|
const match = document.cookie.match(new RegExp(`(?:^|; )${THEME_COOKIE}=(light|dark|system)`));
|
|
18
18
|
if (match && isPreference(match[1]))
|
|
19
19
|
return match[1];
|
|
@@ -23,9 +23,9 @@ export function readPreference() {
|
|
|
23
23
|
return old;
|
|
24
24
|
}
|
|
25
25
|
catch {
|
|
26
|
-
// Storage blocked: fall through to
|
|
26
|
+
// Storage blocked: fall through to Light.
|
|
27
27
|
}
|
|
28
|
-
return "
|
|
28
|
+
return "light";
|
|
29
29
|
}
|
|
30
30
|
/** Saves the choice for every Bridge app: on brdg.app it's shared by all subdomains; elsewhere (localhost, previews) by this site. */
|
|
31
31
|
export function writePreference(preference) {
|
|
@@ -59,5 +59,5 @@ export function applyTheme(theme) {
|
|
|
59
59
|
* Runs in <head> before the page paints, so someone in dark never sees a white flash. The same steps as
|
|
60
60
|
* readPreference and resolveTheme, written out because it can't import anything.
|
|
61
61
|
*/
|
|
62
|
-
export const themeScript = `(function(){try{var m=document.cookie.match(/(?:^|; )${THEME_COOKIE}=(light|dark|system)/),p=m?m[1]:null;if(!p){try{p=localStorage.getItem("${THEME_COOKIE}")}catch(e){}}if(p!=="light"&&p!=="dark")p="
|
|
62
|
+
export const themeScript = `(function(){try{var m=document.cookie.match(/(?:^|; )${THEME_COOKIE}=(light|dark|system)/),p=m?m[1]:null;if(!p){try{p=localStorage.getItem("${THEME_COOKIE}")}catch(e){}}if(p!=="light"&&p!=="dark"&&p!=="system")p="light";var t=p==="dark"||(p==="system"&&matchMedia("${DARK_QUERY}").matches)?"dark":"light",r=document.documentElement;r.dataset.theme=t;r.style.colorScheme=t}catch(e){}})()`;
|
|
63
63
|
export { DARK_QUERY };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brdgapp/ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.0",
|
|
4
4
|
"description": "Bridge's shared components, tokens and styles. Documented at handbook.brdg.app.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"homepage": "https://handbook.brdg.app",
|
|
@@ -34,13 +34,14 @@
|
|
|
34
34
|
"class-variance-authority": "^0.7.1",
|
|
35
35
|
"clsx": "^2.1.1",
|
|
36
36
|
"lucide-react": "^1.6.0",
|
|
37
|
+
"react-day-picker": "^10.0.2",
|
|
37
38
|
"tailwind-merge": "^3.7.0"
|
|
38
39
|
},
|
|
39
40
|
"peerDependencies": {
|
|
40
41
|
"react": ">=19",
|
|
41
42
|
"react-dom": ">=19",
|
|
42
|
-
"
|
|
43
|
-
"
|
|
43
|
+
"recharts": ">=3.8",
|
|
44
|
+
"tailwindcss": ">=4"
|
|
44
45
|
},
|
|
45
46
|
"peerDependenciesMeta": {
|
|
46
47
|
"recharts": {
|