@xenide-io/the-old-ui-theme 0.7.0 → 0.9.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/README.md +9 -10
- package/dist/{Chip-Cq3AiAji.d.mts → Chip-BzuNgJIa.d.mts} +81 -23
- package/dist/{Chip-Cq3AiAji.d.ts → Chip-BzuNgJIa.d.ts} +81 -23
- package/dist/{ai-message-blocknote-WABTHFY7.mjs → ai-message-blocknote-D4Z6DUCJ.mjs} +9 -3
- package/dist/chunk-2EO5VCXP.mjs +3912 -0
- package/dist/chunk-APKRZQRO.mjs +251 -0
- package/dist/chunk-BS7BZI5W.mjs +19 -0
- package/dist/chunk-IULORI3A.mjs +8 -0
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +997 -576
- package/dist/index.mjs +49 -45
- package/dist/suite.d.mts +157 -55
- package/dist/suite.d.ts +157 -55
- package/dist/suite.js +4249 -801
- package/dist/suite.mjs +2578 -594
- package/dist/theme-boot-P-oqKVZF.d.mts +74 -0
- package/dist/theme-boot-P-oqKVZF.d.ts +74 -0
- package/dist/theme-boot.d.mts +2 -0
- package/dist/theme-boot.d.ts +2 -0
- package/dist/theme-boot.js +44 -0
- package/dist/theme-boot.mjs +8 -0
- package/dist/ui.d.mts +5 -29
- package/dist/ui.d.ts +5 -29
- package/dist/ui.js +647 -352
- package/dist/ui.mjs +10 -12
- package/docs/README.md +34 -0
- package/docs/ai-quick-reference.md +56 -0
- package/docs/component-library-improvement-plan.md +751 -0
- package/docs/component-reference.md +81 -0
- package/docs/components.md +48 -0
- package/docs/demos.md +19 -0
- package/docs/installation.md +117 -0
- package/docs/suite-audit.md +34 -0
- package/docs/theme-token-reference.md +67 -0
- package/docs/themes.md +164 -0
- package/package.json +22 -21
- package/public/fonts/OpenRunde-Bold.woff2 +0 -0
- package/public/fonts/OpenRunde-Medium.woff2 +0 -0
- package/public/fonts/OpenRunde-Regular.woff2 +0 -0
- package/public/fonts/OpenRunde-Semibold.woff2 +0 -0
- package/scripts/package-smoke.mjs +43 -0
- package/src/app/globals.css +2 -1
- package/src/components/ui/Accordion.tsx +20 -6
- package/src/components/ui/Avatar.tsx +5 -3
- package/src/components/ui/Calendar.tsx +187 -63
- package/src/components/ui/Card.test.tsx +38 -0
- package/src/components/ui/Card.tsx +77 -14
- package/src/components/ui/CollapsibleSection.tsx +12 -4
- package/src/components/ui/CommandPalette.test.tsx +91 -4
- package/src/components/ui/CommandPalette.tsx +138 -128
- package/src/components/ui/EmptyState.tsx +2 -2
- package/src/components/ui/FormField.tsx +1 -1
- package/src/components/ui/Input.tsx +42 -18
- package/src/components/ui/Kbd.tsx +18 -3
- package/src/components/ui/Modal.tsx +3 -1
- package/src/components/ui/Progress.tsx +14 -5
- package/src/components/ui/SegmentedControl.tsx +2 -2
- package/src/components/ui/SettingsLayout.tsx +1 -1
- package/src/components/ui/Stat.tsx +3 -2
- package/src/components/ui/Table.tsx +8 -3
- package/src/components/ui/Tooltip.test.tsx +70 -1
- package/src/components/ui/Tooltip.tsx +53 -29
- package/src/components/ui/Typography.tsx +103 -49
- package/src/components/ui/avatar-stat.test.tsx +23 -0
- package/src/components/ui/calendar.test.tsx +88 -0
- package/src/components/ui/disclosure.test.tsx +39 -0
- package/src/components/ui/index.ts +44 -6
- package/src/components/ui/progress.test.tsx +15 -0
- package/src/components/ui/typography.test.tsx +26 -1
- package/src/styles/suite-skin.css +8 -2
- package/src/styles/themes.css +184 -68
- package/src/suite/components/ai-message-blocknote.tsx +13 -2
- package/src/suite/components/ai-panel.tsx +41 -10
- package/src/suite/components/app-switcher.test.tsx +21 -6
- package/src/suite/components/app-switcher.tsx +7 -11
- package/src/suite/components/suite-app-layout.tsx +12 -3
- package/src/suite/components/suite-bottom-nav.tsx +0 -1
- package/src/suite/components/suite-clients-projects-directory.test.tsx +71 -0
- package/src/suite/components/suite-clients-projects-directory.tsx +943 -0
- package/src/suite/components/suite-integration-picker.test.tsx +224 -0
- package/src/suite/components/suite-integration-picker.tsx +939 -0
- package/src/suite/components/suite-integration-rules.test.tsx +157 -0
- package/src/suite/components/suite-integration-rules.tsx +471 -0
- package/src/suite/components/suite-mobile-drawer.test.tsx +18 -2
- package/src/suite/components/suite-mobile-drawer.tsx +65 -98
- package/src/suite/components/suite-notification-bell.tsx +29 -4
- package/src/suite/components/suite-sidebar.tsx +25 -25
- package/src/suite/components/suite-skeleton.tsx +2 -2
- package/src/suite/components/suite-user-menu.tsx +9 -8
- package/src/suite/components/theme-provider.test.tsx +87 -3
- package/src/suite/components/theme-provider.tsx +144 -23
- package/src/suite/components/today-ui.tsx +79 -68
- package/src/suite/components/workspace-switcher.test.tsx +56 -0
- package/src/suite/components/workspace-switcher.tsx +3 -3
- package/src/suite/icons/app-accents.ts +12 -12
- package/src/suite/icons/glyphs.ts +6 -12
- package/src/suite/index.ts +27 -0
- package/src/suite/lib/apps.test.ts +9 -1
- package/src/suite/lib/apps.ts +14 -8
- package/src/suite/lib/cookies.ts +53 -0
- package/src/suite/lib/theme-boot.ts +32 -0
- package/src/suite/lib/theme-cookie.ts +7 -0
- package/src/suite/lib/use-sidebar-width.ts +5 -51
- package/dist/chunk-KDR6HI6F.mjs +0 -1075
- package/dist/chunk-NOI42JNZ.mjs +0 -151
- package/dist/chunk-VXISSXTB.mjs +0 -2564
- package/src/suite/lib/use-lock-mobile-page-zoom.test.tsx +0 -65
- package/src/suite/lib/use-lock-mobile-page-zoom.ts +0 -51
package/dist/chunk-NOI42JNZ.mjs
DELETED
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__spreadProps,
|
|
3
|
-
__spreadValues
|
|
4
|
-
} from "./chunk-FWCSY2DS.mjs";
|
|
5
|
-
|
|
6
|
-
// src/suite/components/theme-provider.tsx
|
|
7
|
-
import {
|
|
8
|
-
createContext,
|
|
9
|
-
useCallback,
|
|
10
|
-
useContext,
|
|
11
|
-
useEffect as useEffect2,
|
|
12
|
-
useMemo,
|
|
13
|
-
useState
|
|
14
|
-
} from "react";
|
|
15
|
-
|
|
16
|
-
// src/suite/lib/use-lock-mobile-page-zoom.ts
|
|
17
|
-
import { useEffect } from "react";
|
|
18
|
-
var MOBILE_PAGE_ZOOM_QUERY = "(hover: none) and (pointer: coarse)";
|
|
19
|
-
var LOCKED_VIEWPORT = "width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover";
|
|
20
|
-
function preventGesture(event) {
|
|
21
|
-
event.preventDefault();
|
|
22
|
-
}
|
|
23
|
-
function useLockMobilePageZoom() {
|
|
24
|
-
useEffect(() => {
|
|
25
|
-
if (typeof window.matchMedia !== "function") return;
|
|
26
|
-
const media = window.matchMedia(MOBILE_PAGE_ZOOM_QUERY);
|
|
27
|
-
const meta = document.querySelector('meta[name="viewport"]');
|
|
28
|
-
const original = meta == null ? void 0 : meta.getAttribute("content");
|
|
29
|
-
const apply = () => {
|
|
30
|
-
const lock = media.matches;
|
|
31
|
-
document.documentElement.toggleAttribute(
|
|
32
|
-
"data-suite-lock-page-zoom",
|
|
33
|
-
lock
|
|
34
|
-
);
|
|
35
|
-
document.removeEventListener("gesturestart", preventGesture);
|
|
36
|
-
document.removeEventListener("gesturechange", preventGesture);
|
|
37
|
-
if (lock) {
|
|
38
|
-
meta == null ? void 0 : meta.setAttribute("content", LOCKED_VIEWPORT);
|
|
39
|
-
document.addEventListener("gesturestart", preventGesture);
|
|
40
|
-
document.addEventListener("gesturechange", preventGesture);
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
if (original) meta == null ? void 0 : meta.setAttribute("content", original);
|
|
44
|
-
};
|
|
45
|
-
apply();
|
|
46
|
-
media.addEventListener("change", apply);
|
|
47
|
-
return () => {
|
|
48
|
-
media.removeEventListener("change", apply);
|
|
49
|
-
document.documentElement.removeAttribute("data-suite-lock-page-zoom");
|
|
50
|
-
if (original) meta == null ? void 0 : meta.setAttribute("content", original);
|
|
51
|
-
document.removeEventListener("gesturestart", preventGesture);
|
|
52
|
-
document.removeEventListener("gesturechange", preventGesture);
|
|
53
|
-
};
|
|
54
|
-
}, []);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// src/suite/components/theme-provider.tsx
|
|
58
|
-
import { jsx } from "react/jsx-runtime";
|
|
59
|
-
var SuiteThemeContext = createContext(null);
|
|
60
|
-
function systemTheme(fallback) {
|
|
61
|
-
if (typeof window === "undefined") return fallback;
|
|
62
|
-
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
63
|
-
}
|
|
64
|
-
function resolveTheme(theme, fallback) {
|
|
65
|
-
return theme === "system" ? systemTheme(fallback) : theme;
|
|
66
|
-
}
|
|
67
|
-
function applyTheme(theme, config) {
|
|
68
|
-
const resolved = resolveTheme(theme, config.fallbackTheme);
|
|
69
|
-
if (typeof document === "undefined") return resolved;
|
|
70
|
-
document.documentElement.setAttribute(
|
|
71
|
-
"data-theme",
|
|
72
|
-
resolved === "dark" ? config.darkThemeId : config.lightThemeId
|
|
73
|
-
);
|
|
74
|
-
document.documentElement.classList.toggle("dark", resolved === "dark");
|
|
75
|
-
if (config.themeColorLight && config.themeColorDark) {
|
|
76
|
-
const meta = document.getElementById(
|
|
77
|
-
"theme-color-meta"
|
|
78
|
-
);
|
|
79
|
-
if (meta) {
|
|
80
|
-
meta.content = resolved === "light" ? config.themeColorLight : config.themeColorDark;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
return resolved;
|
|
84
|
-
}
|
|
85
|
-
function readStoredTheme(storageKey) {
|
|
86
|
-
if (typeof window === "undefined") return "system";
|
|
87
|
-
const stored = localStorage.getItem(storageKey);
|
|
88
|
-
if (stored === "light" || stored === "dark" || stored === "system")
|
|
89
|
-
return stored;
|
|
90
|
-
return "system";
|
|
91
|
-
}
|
|
92
|
-
function SuiteThemeProvider({
|
|
93
|
-
config,
|
|
94
|
-
children
|
|
95
|
-
}) {
|
|
96
|
-
useLockMobilePageZoom();
|
|
97
|
-
const [state, setState] = useState(() => {
|
|
98
|
-
const theme2 = readStoredTheme(config.storageKey);
|
|
99
|
-
if (typeof document === "undefined") {
|
|
100
|
-
return { theme: theme2, resolvedTheme: config.fallbackTheme };
|
|
101
|
-
}
|
|
102
|
-
const domTheme = document.documentElement.getAttribute("data-theme");
|
|
103
|
-
const resolvedTheme2 = domTheme === config.darkThemeId ? "dark" : domTheme === config.lightThemeId ? "light" : resolveTheme(theme2, config.fallbackTheme);
|
|
104
|
-
return { theme: theme2, resolvedTheme: resolvedTheme2 };
|
|
105
|
-
});
|
|
106
|
-
const { theme, resolvedTheme } = state;
|
|
107
|
-
useEffect2(() => {
|
|
108
|
-
applyTheme(theme, config);
|
|
109
|
-
}, [theme, config]);
|
|
110
|
-
useEffect2(() => {
|
|
111
|
-
if (theme !== "system") return;
|
|
112
|
-
const media = window.matchMedia("(prefers-color-scheme: dark)");
|
|
113
|
-
const update = () => {
|
|
114
|
-
const resolved = applyTheme("system", config);
|
|
115
|
-
setState((current) => __spreadProps(__spreadValues({}, current), { resolvedTheme: resolved }));
|
|
116
|
-
};
|
|
117
|
-
media.addEventListener("change", update);
|
|
118
|
-
return () => media.removeEventListener("change", update);
|
|
119
|
-
}, [theme, config]);
|
|
120
|
-
const setTheme = useCallback(
|
|
121
|
-
(next) => {
|
|
122
|
-
const resolved = applyTheme(next, config);
|
|
123
|
-
setState({ theme: next, resolvedTheme: resolved });
|
|
124
|
-
localStorage.setItem(config.storageKey, next);
|
|
125
|
-
},
|
|
126
|
-
[config]
|
|
127
|
-
);
|
|
128
|
-
const toggleTheme = useCallback(() => {
|
|
129
|
-
setState((prev) => {
|
|
130
|
-
const next = resolveTheme(prev.theme, config.fallbackTheme) === "dark" ? "light" : "dark";
|
|
131
|
-
const resolved = applyTheme(next, config);
|
|
132
|
-
localStorage.setItem(config.storageKey, next);
|
|
133
|
-
return { theme: next, resolvedTheme: resolved };
|
|
134
|
-
});
|
|
135
|
-
}, [config]);
|
|
136
|
-
const value = useMemo(
|
|
137
|
-
() => ({ theme, resolvedTheme, setTheme, toggleTheme }),
|
|
138
|
-
[theme, resolvedTheme, setTheme, toggleTheme]
|
|
139
|
-
);
|
|
140
|
-
return /* @__PURE__ */ jsx(SuiteThemeContext.Provider, { value, children });
|
|
141
|
-
}
|
|
142
|
-
function useSuiteTheme() {
|
|
143
|
-
const ctx = useContext(SuiteThemeContext);
|
|
144
|
-
if (!ctx) throw new Error("useTheme must be used within ThemeProvider");
|
|
145
|
-
return ctx;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
export {
|
|
149
|
-
SuiteThemeProvider,
|
|
150
|
-
useSuiteTheme
|
|
151
|
-
};
|