@xenide-io/the-old-ui-theme 0.6.5 → 0.6.7

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.
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  useSuiteTheme
4
- } from "./chunk-IAH7Z46I.mjs";
4
+ } from "./chunk-VIWW7AW2.mjs";
5
5
  import "./chunk-FWCSY2DS.mjs";
6
6
 
7
7
  // src/suite/components/ai-message-blocknote.tsx
@@ -60,6 +60,9 @@ function SuiteThemeProvider({
60
60
  return { theme: theme2, resolvedTheme: resolvedTheme2 };
61
61
  });
62
62
  const { theme, resolvedTheme } = state;
63
+ useEffect(() => {
64
+ applyTheme(theme, config);
65
+ }, [theme, config]);
63
66
  useEffect(() => {
64
67
  if (theme !== "system") return;
65
68
  const media = window.matchMedia("(prefers-color-scheme: dark)");
package/dist/suite.js CHANGED
@@ -106,6 +106,9 @@ function SuiteThemeProvider({
106
106
  return { theme: theme2, resolvedTheme: resolvedTheme2 };
107
107
  });
108
108
  const { theme, resolvedTheme } = state;
109
+ (0, import_react7.useEffect)(() => {
110
+ applyTheme(theme, config);
111
+ }, [theme, config]);
109
112
  (0, import_react7.useEffect)(() => {
110
113
  if (theme !== "system") return;
111
114
  const media = window.matchMedia("(prefers-color-scheme: dark)");
@@ -1381,7 +1384,7 @@ var SUITE_APPS2 = [
1381
1384
  name: "Kraken",
1382
1385
  description: "Documents and knowledge",
1383
1386
  icon: "/kraken-icon.svg",
1384
- landing: "/today",
1387
+ landing: "/ask",
1385
1388
  baseUrlEnv: "NEXT_PUBLIC_KRAKEN_URL",
1386
1389
  baseUrlFallback: "http://localhost:3003"
1387
1390
  },
package/dist/suite.mjs CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  import {
7
7
  SuiteThemeProvider,
8
8
  useSuiteTheme
9
- } from "./chunk-IAH7Z46I.mjs";
9
+ } from "./chunk-VIWW7AW2.mjs";
10
10
  import {
11
11
  __spreadProps,
12
12
  __spreadValues
@@ -1094,7 +1094,7 @@ var SUITE_APPS2 = [
1094
1094
  name: "Kraken",
1095
1095
  description: "Documents and knowledge",
1096
1096
  icon: "/kraken-icon.svg",
1097
- landing: "/today",
1097
+ landing: "/ask",
1098
1098
  baseUrlEnv: "NEXT_PUBLIC_KRAKEN_URL",
1099
1099
  baseUrlFallback: "http://localhost:3003"
1100
1100
  },
@@ -2152,7 +2152,7 @@ import {
2152
2152
  Xmark as X2
2153
2153
  } from "iconoir-react";
2154
2154
  import { Fragment as Fragment5, jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
2155
- var SuiteAiBlockNoteMessage = lazy(() => import("./ai-message-blocknote-4Q4U2T2W.mjs"));
2155
+ var SuiteAiBlockNoteMessage = lazy(() => import("./ai-message-blocknote-DIUICX3G.mjs"));
2156
2156
  var SUITE_OPEN_ASK_AI_EVENT = "shellstack:open-ask-ai";
2157
2157
  function openSuiteAskAi(detail) {
2158
2158
  if (typeof window === "undefined") return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xenide-io/the-old-ui-theme",
3
- "version": "0.6.5",
3
+ "version": "0.6.7",
4
4
  "description": "Props-driven React components and theme tokens inspired by classic interface design \u2014 optimized for Next.js apps and internal tools.",
5
5
  "author": "Xenide",
6
6
  "license": "MIT",
@@ -1388,7 +1388,9 @@ body {
1388
1388
  .ph-modal-panel {
1389
1389
  @apply fixed left-1/2 top-1/2 z-[101] flex w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 flex-col p-6 text-ph-ink;
1390
1390
  max-height: min(42rem, calc(100dvh - 2rem));
1391
- overflow: hidden;
1391
+ /* Visible so input focus rings and 3D button chrome are not clipped by
1392
+ overflow:hidden + border-radius, especially at the bottom-right action. */
1393
+ overflow: visible;
1392
1394
  overscroll-behavior: contain;
1393
1395
  background: var(--ph-surface-overlay);
1394
1396
  border-radius: var(--ph-radius-overlay);
@@ -1404,11 +1406,16 @@ body {
1404
1406
  .ph-modal-body {
1405
1407
  @apply mt-4 min-h-0 overflow-y-auto;
1406
1408
  overscroll-behavior: contain;
1409
+ /* Focus ring is a 3px outer glow; pad so overflow-y:auto does not clip it. */
1410
+ padding: 0.375rem;
1411
+ margin-inline: -0.375rem;
1407
1412
  }
1408
1413
 
1409
1414
  .ph-modal-footer {
1410
1415
  @apply mt-6 flex shrink-0 flex-wrap justify-end gap-2 border-t pt-5;
1411
1416
  border-color: var(--ph-border-subtle);
1417
+ overflow: visible;
1418
+ padding-bottom: calc(var(--ph-chrome-depth) + 0.125rem);
1412
1419
  }
1413
1420
 
1414
1421
  @keyframes ph-modal-overlay-in {
@@ -424,7 +424,7 @@
424
424
 
425
425
  [data-theme="kraken-light"] {
426
426
  color-scheme: light;
427
- --ph-canvas: #f7f4ed;
427
+ --ph-canvas: #fafafa;
428
428
  --ph-surface: #ffffff;
429
429
  --ph-muted: #f2f2f2;
430
430
  --ph-toolbar: #e8e8e6;
@@ -0,0 +1,48 @@
1
+ import { cleanup, render, waitFor } from "@testing-library/react";
2
+ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
3
+
4
+ import { SuiteThemeProvider, type SuiteThemeConfig } from "./theme-provider";
5
+
6
+ const config: SuiteThemeConfig = {
7
+ storageKey: "test-theme",
8
+ lightThemeId: "test-light",
9
+ darkThemeId: "test-dark",
10
+ fallbackTheme: "light",
11
+ themeColorLight: "#fafafa",
12
+ themeColorDark: "#191919",
13
+ };
14
+
15
+ beforeEach(() => {
16
+ vi.stubGlobal("localStorage", {
17
+ getItem: () => "dark",
18
+ setItem: vi.fn(),
19
+ });
20
+ });
21
+
22
+ afterEach(() => {
23
+ cleanup();
24
+ vi.unstubAllGlobals();
25
+ document.documentElement.removeAttribute("data-theme");
26
+ document.documentElement.classList.remove("dark");
27
+ document.getElementById("theme-color-meta")?.remove();
28
+ });
29
+
30
+ describe("SuiteThemeProvider", () => {
31
+ it("syncs the initial theme colour after mounting", async () => {
32
+ document.documentElement.setAttribute("data-theme", config.darkThemeId);
33
+ const meta = document.createElement("meta");
34
+ meta.id = "theme-color-meta";
35
+ meta.content = config.themeColorLight!;
36
+ document.head.append(meta);
37
+
38
+ render(
39
+ <SuiteThemeProvider config={config}>
40
+ <div />
41
+ </SuiteThemeProvider>,
42
+ );
43
+
44
+ await waitFor(() =>
45
+ expect(meta).toHaveAttribute("content", config.themeColorDark),
46
+ );
47
+ });
48
+ });
@@ -123,6 +123,10 @@ export function SuiteThemeProvider({
123
123
  });
124
124
  const { theme, resolvedTheme } = state;
125
125
 
126
+ useEffect(() => {
127
+ applyTheme(theme, config);
128
+ }, [theme, config]);
129
+
126
130
  useEffect(() => {
127
131
  if (theme !== 'system') return;
128
132
  const media = window.matchMedia('(prefers-color-scheme: dark)');
@@ -59,7 +59,7 @@ export const SUITE_APPS: readonly SuiteAppDefinition[] = [
59
59
  name: 'Kraken',
60
60
  description: 'Documents and knowledge',
61
61
  icon: '/kraken-icon.svg',
62
- landing: '/today',
62
+ landing: '/ask',
63
63
  baseUrlEnv: 'NEXT_PUBLIC_KRAKEN_URL',
64
64
  baseUrlFallback: 'http://localhost:3003',
65
65
  },