@tuwaio/docs-ui 0.5.6 → 0.5.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.
@@ -58,7 +58,7 @@ function SiteLogo({
58
58
  alt: "TUWA",
59
59
  width,
60
60
  height,
61
- className: "tuwadocs:block tuwadocs:dark:hidden tuwadocs:h-auto tuwadocs:transition-opacity tuwadocs:duration-300",
61
+ className: "tuwadocs:block tuwadocs:dark:hidden tuwadocs:h-auto tuwadocs:max-w-none tuwadocs:transition-opacity tuwadocs:duration-300",
62
62
  style: { width: `${width}px`, height: "auto" },
63
63
  loading: "eager",
64
64
  decoding: "async"
@@ -71,7 +71,7 @@ function SiteLogo({
71
71
  alt: "TUWA",
72
72
  width,
73
73
  height,
74
- className: "tuwadocs:hidden tuwadocs:dark:block tuwadocs:h-auto tuwadocs:transition-opacity tuwadocs:duration-300",
74
+ className: "tuwadocs:hidden tuwadocs:dark:block tuwadocs:h-auto tuwadocs:max-w-none tuwadocs:transition-opacity tuwadocs:duration-300",
75
75
  style: {
76
76
  width: `${width}px`,
77
77
  height: "auto",
@@ -20,6 +20,9 @@ interface SiteLogoProps {
20
20
  * Using standalone <img> tags isolates each SVG document context, completely avoiding
21
21
  * WebKit/Safari SVG ID collision and gradient-rendering bugs.
22
22
  * Pure presentation element with no event handlers, ensuring it can safely cross Server/Client component boundaries.
23
+ *
24
+ * The logo keeps its `width` in a narrow flex row: the images opt out of the `max-width: 100%` of Tailwind's base
25
+ * styles, which let the logo link of the Nextra navbar shrink below the logo, so the logo painted over the next items.
23
26
  */
24
27
  declare function SiteLogo({ width, height, className, lightSrc, darkSrc, }: SiteLogoProps): react__default.JSX.Element;
25
28
  declare const TuwaLogo: typeof SiteLogo;
@@ -20,6 +20,9 @@ interface SiteLogoProps {
20
20
  * Using standalone <img> tags isolates each SVG document context, completely avoiding
21
21
  * WebKit/Safari SVG ID collision and gradient-rendering bugs.
22
22
  * Pure presentation element with no event handlers, ensuring it can safely cross Server/Client component boundaries.
23
+ *
24
+ * The logo keeps its `width` in a narrow flex row: the images opt out of the `max-width: 100%` of Tailwind's base
25
+ * styles, which let the logo link of the Nextra navbar shrink below the logo, so the logo painted over the next items.
23
26
  */
24
27
  declare function SiteLogo({ width, height, className, lightSrc, darkSrc, }: SiteLogoProps): react__default.JSX.Element;
25
28
  declare const TuwaLogo: typeof SiteLogo;
@@ -23,7 +23,7 @@ function SiteLogo({
23
23
  alt: "TUWA",
24
24
  width,
25
25
  height,
26
- className: "tuwadocs:block tuwadocs:dark:hidden tuwadocs:h-auto tuwadocs:transition-opacity tuwadocs:duration-300",
26
+ className: "tuwadocs:block tuwadocs:dark:hidden tuwadocs:h-auto tuwadocs:max-w-none tuwadocs:transition-opacity tuwadocs:duration-300",
27
27
  style: { width: `${width}px`, height: "auto" },
28
28
  loading: "eager",
29
29
  decoding: "async"
@@ -36,7 +36,7 @@ function SiteLogo({
36
36
  alt: "TUWA",
37
37
  width,
38
38
  height,
39
- className: "tuwadocs:hidden tuwadocs:dark:block tuwadocs:h-auto tuwadocs:transition-opacity tuwadocs:duration-300",
39
+ className: "tuwadocs:hidden tuwadocs:dark:block tuwadocs:h-auto tuwadocs:max-w-none tuwadocs:transition-opacity tuwadocs:duration-300",
40
40
  style: {
41
41
  width: `${width}px`,
42
42
  height: "auto",
@@ -26,20 +26,21 @@ var import_utils = require("@tuwaio/nova-core/utils");
26
26
  var import_nextra_theme_docs = require("nextra-theme-docs");
27
27
  var import_utils2 = require("../utils");
28
28
  function Navbar({ links, logo, children }) {
29
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_nextra_theme_docs.Navbar, { logo, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "tuwadocs:flex tuwadocs:items-center tuwadocs:gap-3", children: [
29
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_nextra_theme_docs.Navbar, { logo, className: "tuwadocs:[&>:first-child]:shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "tuwadocs:flex tuwadocs:shrink-0 tuwadocs:items-center tuwadocs:gap-3", children: [
30
30
  (links ?? import_utils2.baseNavLinks).map(({ title, href, image, className }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
31
31
  "a",
32
32
  {
33
33
  href,
34
34
  target: "_blank",
35
35
  rel: "noopener noreferrer",
36
+ title,
36
37
  className: (0, import_utils.cn)(
37
- "tuwadocs:hidden tuwadocs:sm:flex tuwadocs:items-center tuwadocs:gap-1 tuwadocs:px-3 tuwadocs:py-1.5 tuwadocs:text-sm tuwadocs:font-medium tuwadocs:transition-colors tuwadocs:text-[var(--tuwa-text-primary)]",
38
+ "tuwadocs:hidden tuwadocs:sm:flex tuwadocs:items-center tuwadocs:gap-1 tuwadocs:px-3 tuwadocs:py-1.5 tuwadocs:text-sm tuwadocs:font-medium tuwadocs:whitespace-nowrap tuwadocs:transition-colors tuwadocs:text-[var(--tuwa-text-primary)]",
38
39
  className
39
40
  ),
40
41
  children: [
41
42
  image,
42
- title
43
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "tuwadocs:sr-only tuwadocs:lg:not-sr-only", children: title })
43
44
  ]
44
45
  },
45
46
  title
@@ -5,7 +5,7 @@ import { ReactNode } from 'react';
5
5
  * A link to an external page, rendered with its icon by {@link Navbar} and {@link Footer}. Links open in a new tab.
6
6
  */
7
7
  type SocialLink = {
8
- /** Text of the link (hidden on small screens) */
8
+ /** Text of the link; {@link Navbar} shows it from 1024px wide and keeps it as the accessible name and tooltip below */
9
9
  title: string;
10
10
  /** Absolute URL of the page */
11
11
  href: string;
@@ -27,7 +27,12 @@ interface NavProps {
27
27
  }
28
28
  /**
29
29
  * The navbar of a TUWA documentation site: the `Navbar` of `nextra-theme-docs` with the logo and a row of external
30
- * links, hidden on small screens. Render it in the `navbar` prop of the Nextra `Layout`.
30
+ * links. Render it in the `navbar` prop of the Nextra `Layout`.
31
+ *
32
+ * The row stays on one line of the 64px Nextra header from 320px wide: the links are hidden below 640px and show only
33
+ * their icons below 1024px, so the Nextra search, the top-level pages and `children` such as {@link LocaleSwitcher}
34
+ * keep their room. The logo never shrinks; the top-level pages of Nextra scroll instead. Below 768px the stylesheet
35
+ * (`dist/index.css`) makes the header opaque in the theme background, so the page never shows through it.
31
36
  *
32
37
  * @param props - See {@link NavProps}.
33
38
  * @returns The navbar.
@@ -5,7 +5,7 @@ import { ReactNode } from 'react';
5
5
  * A link to an external page, rendered with its icon by {@link Navbar} and {@link Footer}. Links open in a new tab.
6
6
  */
7
7
  type SocialLink = {
8
- /** Text of the link (hidden on small screens) */
8
+ /** Text of the link; {@link Navbar} shows it from 1024px wide and keeps it as the accessible name and tooltip below */
9
9
  title: string;
10
10
  /** Absolute URL of the page */
11
11
  href: string;
@@ -27,7 +27,12 @@ interface NavProps {
27
27
  }
28
28
  /**
29
29
  * The navbar of a TUWA documentation site: the `Navbar` of `nextra-theme-docs` with the logo and a row of external
30
- * links, hidden on small screens. Render it in the `navbar` prop of the Nextra `Layout`.
30
+ * links. Render it in the `navbar` prop of the Nextra `Layout`.
31
+ *
32
+ * The row stays on one line of the 64px Nextra header from 320px wide: the links are hidden below 640px and show only
33
+ * their icons below 1024px, so the Nextra search, the top-level pages and `children` such as {@link LocaleSwitcher}
34
+ * keep their room. The logo never shrinks; the top-level pages of Nextra scroll instead. Below 768px the stylesheet
35
+ * (`dist/index.css`) makes the header opaque in the theme background, so the page never shows through it.
31
36
  *
32
37
  * @param props - See {@link NavProps}.
33
38
  * @returns The navbar.
@@ -3,20 +3,21 @@ import { cn } from "@tuwaio/nova-core/utils";
3
3
  import { Navbar as NextraNavbar } from "nextra-theme-docs";
4
4
  import { baseNavLinks } from "../utils";
5
5
  function Navbar({ links, logo, children }) {
6
- return /* @__PURE__ */ jsx(NextraNavbar, { logo, children: /* @__PURE__ */ jsxs("div", { className: "tuwadocs:flex tuwadocs:items-center tuwadocs:gap-3", children: [
6
+ return /* @__PURE__ */ jsx(NextraNavbar, { logo, className: "tuwadocs:[&>:first-child]:shrink-0", children: /* @__PURE__ */ jsxs("div", { className: "tuwadocs:flex tuwadocs:shrink-0 tuwadocs:items-center tuwadocs:gap-3", children: [
7
7
  (links ?? baseNavLinks).map(({ title, href, image, className }) => /* @__PURE__ */ jsxs(
8
8
  "a",
9
9
  {
10
10
  href,
11
11
  target: "_blank",
12
12
  rel: "noopener noreferrer",
13
+ title,
13
14
  className: cn(
14
- "tuwadocs:hidden tuwadocs:sm:flex tuwadocs:items-center tuwadocs:gap-1 tuwadocs:px-3 tuwadocs:py-1.5 tuwadocs:text-sm tuwadocs:font-medium tuwadocs:transition-colors tuwadocs:text-[var(--tuwa-text-primary)]",
15
+ "tuwadocs:hidden tuwadocs:sm:flex tuwadocs:items-center tuwadocs:gap-1 tuwadocs:px-3 tuwadocs:py-1.5 tuwadocs:text-sm tuwadocs:font-medium tuwadocs:whitespace-nowrap tuwadocs:transition-colors tuwadocs:text-[var(--tuwa-text-primary)]",
15
16
  className
16
17
  ),
17
18
  children: [
18
19
  image,
19
- title
20
+ /* @__PURE__ */ jsx("span", { className: "tuwadocs:sr-only tuwadocs:lg:not-sr-only", children: title })
20
21
  ]
21
22
  },
22
23
  title
package/dist/index.css CHANGED
@@ -849,6 +849,9 @@ html {
849
849
  .tuwadocs\:w-full {
850
850
  width: 100%;
851
851
  }
852
+ .tuwadocs\:max-w-none {
853
+ max-width: none;
854
+ }
852
855
  .tuwadocs\:min-w-0 {
853
856
  min-width: 0px;
854
857
  }
@@ -1164,6 +1167,9 @@ html {
1164
1167
  --tw-tracking: var(--tuwadocs-tracking-widest);
1165
1168
  letter-spacing: var(--tuwadocs-tracking-widest);
1166
1169
  }
1170
+ .tuwadocs\:whitespace-nowrap {
1171
+ white-space: nowrap;
1172
+ }
1167
1173
  .tuwadocs\:text-\[\#0052ff\] {
1168
1174
  color: #0052ff;
1169
1175
  }
@@ -1379,6 +1385,16 @@ html {
1379
1385
  }
1380
1386
  }
1381
1387
  @media (width >= 64rem) {
1388
+ .tuwadocs\:lg\:not-sr-only {
1389
+ position: static;
1390
+ width: auto;
1391
+ height: auto;
1392
+ padding: 0;
1393
+ margin: 0;
1394
+ overflow: visible;
1395
+ clip-path: none;
1396
+ white-space: normal;
1397
+ }
1382
1398
  .tuwadocs\:lg\:sticky {
1383
1399
  position: sticky;
1384
1400
  }
@@ -1458,6 +1474,9 @@ html {
1458
1474
  display: none;
1459
1475
  }
1460
1476
  }
1477
+ .tuwadocs\:\[\&\>\:first-child\]\:shrink-0 > :first-child {
1478
+ flex-shrink: 0;
1479
+ }
1461
1480
  }
1462
1481
  html {
1463
1482
  font-size: 16px;
@@ -2008,11 +2027,13 @@ article .nextra-border a:hover {
2008
2027
  article a[href^='http']:after {
2009
2028
  filter: hue-rotate(210deg) saturate(1.5);
2010
2029
  }
2011
- @media (max-width: 768px) {
2030
+ @media (max-width: 767.98px), (pointer: coarse) and (max-width: 1023.98px) {
2012
2031
  .nextra-navbar {
2013
2032
  backdrop-filter: none;
2014
- background: white;
2033
+ background: rgb(var(--nextra-bg, 255 255 255));
2015
2034
  }
2035
+ }
2036
+ @media (max-width: 768px) {
2016
2037
  .tuwa-footer-link span {
2017
2038
  display: none;
2018
2039
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tuwaio/docs-ui",
3
- "version": "0.5.6",
3
+ "version": "0.5.7",
4
4
  "private": false,
5
5
  "author": "Oleksandr Tkach",
6
6
  "license": "Apache-2.0",
@@ -85,14 +85,13 @@
85
85
  "devDependencies": {
86
86
  "@heroicons/react": "^2.2.0",
87
87
  "@tailwindcss/postcss": "^4.3.3",
88
- "@tailwindcss/vite": "^4.3.3",
89
88
  "@types/node": "^26.6.5",
90
89
  "@types/react": "^19.3.0",
91
- "autoprefixer": "^10.6.1",
90
+ "autoprefixer": "^10.6.2",
92
91
  "next": "16.4.3",
93
92
  "nextra": "^4.6.1",
94
93
  "nextra-theme-docs": "^4.6.1",
95
- "postcss": "^8.5.31",
94
+ "postcss": "^8.5.32",
96
95
  "postcss-cli": "^12.0.0",
97
96
  "react": "^19.3.1",
98
97
  "tailwindcss": "^4.3.3",