@xenide-io/the-old-ui-theme 0.9.6 → 0.9.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.
package/dist/suite.d.mts CHANGED
@@ -339,6 +339,10 @@ interface SuiteUserMenuProps {
339
339
  onSignOut: () => void;
340
340
  /** Fallback letter(s) when there is no avatar image. */
341
341
  fallbackInitials?: string;
342
+ /** Second line under the name, e.g. the workspace subscription ("Plus"). */
343
+ subtitle?: string | null;
344
+ /** Show the name + subtitle beside the avatar, for the sidebar footer. */
345
+ showDetails?: boolean;
342
346
  /** Show the old desktop sidebar sign-out action beside the avatar. */
343
347
  showSignOutAction?: boolean;
344
348
  dataTest?: string;
@@ -351,7 +355,7 @@ interface SuiteUserMenuProps {
351
355
  * profile settings and sign out. Desktop sidebars can also expose the legacy
352
356
  * adjacent sign-out action without adding it to mobile chrome.
353
357
  */
354
- declare function SuiteUserMenu({ name, email, image, settingsHref, onSignOut, fallbackInitials, showSignOutAction, dataTest, triggerId, triggerDataTest, className, }: SuiteUserMenuProps): react.JSX.Element;
358
+ declare function SuiteUserMenu({ name, email, image, settingsHref, onSignOut, fallbackInitials, subtitle, showDetails, showSignOutAction, dataTest, triggerId, triggerDataTest, className, }: SuiteUserMenuProps): react.JSX.Element;
355
359
 
356
360
  /** Any icon component that accepts sizing/stroke props (Lucide, theme icons). */
357
361
  type SuiteNavIcon = ComponentType<{
package/dist/suite.d.ts CHANGED
@@ -339,6 +339,10 @@ interface SuiteUserMenuProps {
339
339
  onSignOut: () => void;
340
340
  /** Fallback letter(s) when there is no avatar image. */
341
341
  fallbackInitials?: string;
342
+ /** Second line under the name, e.g. the workspace subscription ("Plus"). */
343
+ subtitle?: string | null;
344
+ /** Show the name + subtitle beside the avatar, for the sidebar footer. */
345
+ showDetails?: boolean;
342
346
  /** Show the old desktop sidebar sign-out action beside the avatar. */
343
347
  showSignOutAction?: boolean;
344
348
  dataTest?: string;
@@ -351,7 +355,7 @@ interface SuiteUserMenuProps {
351
355
  * profile settings and sign out. Desktop sidebars can also expose the legacy
352
356
  * adjacent sign-out action without adding it to mobile chrome.
353
357
  */
354
- declare function SuiteUserMenu({ name, email, image, settingsHref, onSignOut, fallbackInitials, showSignOutAction, dataTest, triggerId, triggerDataTest, className, }: SuiteUserMenuProps): react.JSX.Element;
358
+ declare function SuiteUserMenu({ name, email, image, settingsHref, onSignOut, fallbackInitials, subtitle, showDetails, showSignOutAction, dataTest, triggerId, triggerDataTest, className, }: SuiteUserMenuProps): react.JSX.Element;
355
359
 
356
360
  /** Any icon component that accepts sizing/stroke props (Lucide, theme icons). */
357
361
  type SuiteNavIcon = ComponentType<{
package/dist/suite.js CHANGED
@@ -2784,6 +2784,8 @@ function SuiteUserMenu({
2784
2784
  settingsHref,
2785
2785
  onSignOut,
2786
2786
  fallbackInitials,
2787
+ subtitle,
2788
+ showDetails = false,
2787
2789
  showSignOutAction = false,
2788
2790
  dataTest = "suite-user-menu",
2789
2791
  triggerId,
@@ -2813,10 +2815,17 @@ function SuiteUserMenu({
2813
2815
  children: initials
2814
2816
  }
2815
2817
  ) }) });
2818
+ const trigger = showDetails ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "flex min-w-0 items-center gap-2", children: [
2819
+ avatar,
2820
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "flex min-w-0 flex-col text-left", children: [
2821
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "truncate text-sm font-medium text-ph-ink", children: name || email || "Account" }),
2822
+ subtitle ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "truncate text-xs text-ph-mutedtext", children: subtitle }) : null
2823
+ ] })
2824
+ ] }) : avatar;
2816
2825
  const accountMenu = /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
2817
2826
  DropdownMenu,
2818
2827
  {
2819
- trigger: avatar,
2828
+ trigger,
2820
2829
  triggerId: triggerId != null ? triggerId : `${dataTest}-trigger`,
2821
2830
  triggerDataTest: triggerDataTest != null ? triggerDataTest : `${dataTest}-trigger`,
2822
2831
  "aria-label": "Account menu",
@@ -2827,6 +2836,7 @@ function SuiteUserMenu({
2827
2836
  modal: false,
2828
2837
  className: cn(
2829
2838
  "[&_.ph-dropdown-trigger]:rounded-full",
2839
+ showDetails && "min-w-0 flex-1 [&_.ph-dropdown-trigger]:w-full [&_.ph-dropdown-trigger]:justify-start [&_.ph-dropdown-trigger]:rounded-lg",
2830
2840
  showSignOutAction ? void 0 : className
2831
2841
  ),
2832
2842
  "data-test": dataTest,
@@ -3584,6 +3594,11 @@ function SuiteAiPanel({
3584
3594
  var _a;
3585
3595
  if (open && !hydrating) (_a = textareaRef.current) == null ? void 0 : _a.focus();
3586
3596
  }, [open, hydrating]);
3597
+ (0, import_react12.useEffect)(() => {
3598
+ if (!open) return;
3599
+ void Promise.resolve().then(() => (init_ai_message_markdown(), ai_message_markdown_exports)).catch(() => {
3600
+ });
3601
+ }, [open]);
3587
3602
  (0, import_react12.useLayoutEffect)(() => {
3588
3603
  const el = textareaRef.current;
3589
3604
  if (!el) return;
@@ -3805,19 +3820,11 @@ function SuiteAiPanel({
3805
3820
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "rounded-2xl rounded-bl-md bg-ph-muted px-3 py-2 text-sm leading-relaxed text-ph-ink", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3806
3821
  import_react12.Suspense,
3807
3822
  {
3808
- fallback: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
3809
- "div",
3810
- {
3811
- className: "space-y-2 py-0.5",
3812
- role: "status",
3813
- "aria-label": "Rendering response",
3814
- children: [
3815
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "sr-only", children: "Rendering response\u2026" }),
3816
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "suite-shimmer h-3 w-11/12 rounded bg-ph-mutedtext/20" }),
3817
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "suite-shimmer h-3 w-full rounded bg-ph-mutedtext/20" }),
3818
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "suite-shimmer h-3 w-3/5 rounded bg-ph-mutedtext/20" })
3819
- ]
3820
- }
3823
+ fallback: (
3824
+ // The chunk is pre-warmed above, so this only shows on a
3825
+ // cold cache. Keep it invisible — a skeleton here reads
3826
+ // as if it were part of the answer.
3827
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "sr-only", role: "status", children: "Rendering response\u2026" })
3821
3828
  ),
3822
3829
  children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3823
3830
  SuiteAiMarkdownMessage2,
@@ -4783,9 +4790,7 @@ function SuiteSidebar({
4783
4790
  className: cn(
4784
4791
  "shrink-0 border-t border-ph-border",
4785
4792
  surface ? "bg-ph-surface" : "bg-ph-canvas",
4786
- // Trim only the bottom inset: the 32px avatar sits inside a 40px
4787
- // trigger, so even padding read top-heavy once the avatar shrank.
4788
- collapsed ? "px-1.5 pt-1.5 pb-1" : "px-3 pt-3 pb-2"
4793
+ collapsed ? "p-1.5" : "p-3"
4789
4794
  ),
4790
4795
  children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
4791
4796
  "div",
package/dist/suite.mjs CHANGED
@@ -1897,6 +1897,8 @@ function SuiteUserMenu({
1897
1897
  settingsHref,
1898
1898
  onSignOut,
1899
1899
  fallbackInitials,
1900
+ subtitle,
1901
+ showDetails = false,
1900
1902
  showSignOutAction = false,
1901
1903
  dataTest = "suite-user-menu",
1902
1904
  triggerId,
@@ -1926,10 +1928,17 @@ function SuiteUserMenu({
1926
1928
  children: initials
1927
1929
  }
1928
1930
  ) }) });
1931
+ const trigger = showDetails ? /* @__PURE__ */ jsxs11("span", { className: "flex min-w-0 items-center gap-2", children: [
1932
+ avatar,
1933
+ /* @__PURE__ */ jsxs11("span", { className: "flex min-w-0 flex-col text-left", children: [
1934
+ /* @__PURE__ */ jsx13("span", { className: "truncate text-sm font-medium text-ph-ink", children: name || email || "Account" }),
1935
+ subtitle ? /* @__PURE__ */ jsx13("span", { className: "truncate text-xs text-ph-mutedtext", children: subtitle }) : null
1936
+ ] })
1937
+ ] }) : avatar;
1929
1938
  const accountMenu = /* @__PURE__ */ jsxs11(
1930
1939
  DropdownMenu,
1931
1940
  {
1932
- trigger: avatar,
1941
+ trigger,
1933
1942
  triggerId: triggerId != null ? triggerId : `${dataTest}-trigger`,
1934
1943
  triggerDataTest: triggerDataTest != null ? triggerDataTest : `${dataTest}-trigger`,
1935
1944
  "aria-label": "Account menu",
@@ -1940,6 +1949,7 @@ function SuiteUserMenu({
1940
1949
  modal: false,
1941
1950
  className: cn2(
1942
1951
  "[&_.ph-dropdown-trigger]:rounded-full",
1952
+ showDetails && "min-w-0 flex-1 [&_.ph-dropdown-trigger]:w-full [&_.ph-dropdown-trigger]:justify-start [&_.ph-dropdown-trigger]:rounded-lg",
1943
1953
  showSignOutAction ? void 0 : className
1944
1954
  ),
1945
1955
  "data-test": dataTest,
@@ -2561,6 +2571,11 @@ function SuiteAiPanel({
2561
2571
  var _a;
2562
2572
  if (open && !hydrating) (_a = textareaRef.current) == null ? void 0 : _a.focus();
2563
2573
  }, [open, hydrating]);
2574
+ useEffect7(() => {
2575
+ if (!open) return;
2576
+ void import("./ai-message-markdown-AUEMCO7K.mjs").catch(() => {
2577
+ });
2578
+ }, [open]);
2564
2579
  useLayoutEffect(() => {
2565
2580
  const el = textareaRef.current;
2566
2581
  if (!el) return;
@@ -2782,19 +2797,11 @@ function SuiteAiPanel({
2782
2797
  /* @__PURE__ */ jsx17("div", { className: "rounded-2xl rounded-bl-md bg-ph-muted px-3 py-2 text-sm leading-relaxed text-ph-ink", children: /* @__PURE__ */ jsx17(
2783
2798
  Suspense,
2784
2799
  {
2785
- fallback: /* @__PURE__ */ jsxs14(
2786
- "div",
2787
- {
2788
- className: "space-y-2 py-0.5",
2789
- role: "status",
2790
- "aria-label": "Rendering response",
2791
- children: [
2792
- /* @__PURE__ */ jsx17("span", { className: "sr-only", children: "Rendering response\u2026" }),
2793
- /* @__PURE__ */ jsx17("div", { className: "suite-shimmer h-3 w-11/12 rounded bg-ph-mutedtext/20" }),
2794
- /* @__PURE__ */ jsx17("div", { className: "suite-shimmer h-3 w-full rounded bg-ph-mutedtext/20" }),
2795
- /* @__PURE__ */ jsx17("div", { className: "suite-shimmer h-3 w-3/5 rounded bg-ph-mutedtext/20" })
2796
- ]
2797
- }
2800
+ fallback: (
2801
+ // The chunk is pre-warmed above, so this only shows on a
2802
+ // cold cache. Keep it invisible — a skeleton here reads
2803
+ // as if it were part of the answer.
2804
+ /* @__PURE__ */ jsx17("span", { className: "sr-only", role: "status", children: "Rendering response\u2026" })
2798
2805
  ),
2799
2806
  children: /* @__PURE__ */ jsx17(
2800
2807
  SuiteAiMarkdownMessage,
@@ -3764,9 +3771,7 @@ function SuiteSidebar({
3764
3771
  className: cn2(
3765
3772
  "shrink-0 border-t border-ph-border",
3766
3773
  surface ? "bg-ph-surface" : "bg-ph-canvas",
3767
- // Trim only the bottom inset: the 32px avatar sits inside a 40px
3768
- // trigger, so even padding read top-heavy once the avatar shrank.
3769
- collapsed ? "px-1.5 pt-1.5 pb-1" : "px-3 pt-3 pb-2"
3774
+ collapsed ? "p-1.5" : "p-3"
3770
3775
  ),
3771
3776
  children: /* @__PURE__ */ jsxs19(
3772
3777
  "div",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xenide-io/the-old-ui-theme",
3
- "version": "0.9.6",
3
+ "version": "0.9.7",
4
4
  "description": "Props-driven React components and theme tokens inspired by classic interface design — optimized for Next.js apps and internal tools.",
5
5
  "author": "Xenide",
6
6
  "license": "MIT",
@@ -297,6 +297,13 @@ export function SuiteAiPanel({
297
297
  if (open && !hydrating) textareaRef.current?.focus();
298
298
  }, [open, hydrating]);
299
299
 
300
+ // Warm the lazily-imported Markdown renderer as soon as the panel opens, so a
301
+ // reply never flashes a placeholder while its chunk is still downloading.
302
+ useEffect(() => {
303
+ if (!open) return;
304
+ void import("./ai-message-markdown").catch(() => {});
305
+ }, [open]);
306
+
300
307
  useLayoutEffect(() => {
301
308
  const el = textareaRef.current;
302
309
  if (!el) return;
@@ -537,16 +544,12 @@ export function SuiteAiPanel({
537
544
  <div className="rounded-2xl rounded-bl-md bg-ph-muted px-3 py-2 text-sm leading-relaxed text-ph-ink">
538
545
  <Suspense
539
546
  fallback={
540
- <div
541
- className="space-y-2 py-0.5"
542
- role="status"
543
- aria-label="Rendering response"
544
- >
545
- <span className="sr-only">Rendering response…</span>
546
- <div className="suite-shimmer h-3 w-11/12 rounded bg-ph-mutedtext/20" />
547
- <div className="suite-shimmer h-3 w-full rounded bg-ph-mutedtext/20" />
548
- <div className="suite-shimmer h-3 w-3/5 rounded bg-ph-mutedtext/20" />
549
- </div>
547
+ // The chunk is pre-warmed above, so this only shows on a
548
+ // cold cache. Keep it invisible — a skeleton here reads
549
+ // as if it were part of the answer.
550
+ <span className="sr-only" role="status">
551
+ Rendering response…
552
+ </span>
550
553
  }
551
554
  >
552
555
  <SuiteAiMarkdownMessage
@@ -320,9 +320,7 @@ export function SuiteSidebar({
320
320
  className={cn(
321
321
  "shrink-0 border-t border-ph-border",
322
322
  surface ? "bg-ph-surface" : "bg-ph-canvas",
323
- // Trim only the bottom inset: the 32px avatar sits inside a 40px
324
- // trigger, so even padding read top-heavy once the avatar shrank.
325
- collapsed ? "px-1.5 pt-1.5 pb-1" : "px-3 pt-3 pb-2",
323
+ collapsed ? "p-1.5" : "p-3",
326
324
  )}
327
325
  >
328
326
  <div
@@ -16,6 +16,10 @@ export interface SuiteUserMenuProps {
16
16
  onSignOut: () => void;
17
17
  /** Fallback letter(s) when there is no avatar image. */
18
18
  fallbackInitials?: string;
19
+ /** Second line under the name, e.g. the workspace subscription ("Plus"). */
20
+ subtitle?: string | null;
21
+ /** Show the name + subtitle beside the avatar, for the sidebar footer. */
22
+ showDetails?: boolean;
19
23
  /** Show the old desktop sidebar sign-out action beside the avatar. */
20
24
  showSignOutAction?: boolean;
21
25
  dataTest?: string;
@@ -72,6 +76,8 @@ export function SuiteUserMenu({
72
76
  settingsHref,
73
77
  onSignOut,
74
78
  fallbackInitials,
79
+ subtitle,
80
+ showDetails = false,
75
81
  showSignOutAction = false,
76
82
  dataTest = "suite-user-menu",
77
83
  triggerId,
@@ -110,9 +116,27 @@ export function SuiteUserMenu({
110
116
  </span>
111
117
  );
112
118
 
119
+ // Sidebar footer shows who is signed in and which plan the workspace is on;
120
+ // the mobile header keeps the bare avatar so its action row stays compact.
121
+ const trigger = showDetails ? (
122
+ <span className="flex min-w-0 items-center gap-2">
123
+ {avatar}
124
+ <span className="flex min-w-0 flex-col text-left">
125
+ <span className="truncate text-sm font-medium text-ph-ink">
126
+ {name || email || "Account"}
127
+ </span>
128
+ {subtitle ? (
129
+ <span className="truncate text-xs text-ph-mutedtext">{subtitle}</span>
130
+ ) : null}
131
+ </span>
132
+ </span>
133
+ ) : (
134
+ avatar
135
+ );
136
+
113
137
  const accountMenu = (
114
138
  <DropdownMenu
115
- trigger={avatar}
139
+ trigger={trigger}
116
140
  triggerId={triggerId ?? `${dataTest}-trigger`}
117
141
  triggerDataTest={triggerDataTest ?? `${dataTest}-trigger`}
118
142
  aria-label="Account menu"
@@ -123,6 +147,8 @@ export function SuiteUserMenu({
123
147
  modal={false}
124
148
  className={cn(
125
149
  "[&_.ph-dropdown-trigger]:rounded-full",
150
+ showDetails &&
151
+ "min-w-0 flex-1 [&_.ph-dropdown-trigger]:w-full [&_.ph-dropdown-trigger]:justify-start [&_.ph-dropdown-trigger]:rounded-lg",
126
152
  showSignOutAction ? undefined : className,
127
153
  )}
128
154
  data-test={dataTest}