tamga-ui 0.4.2 → 0.4.3

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 CHANGED
@@ -5,7 +5,22 @@ Versions follow [semver](https://semver.org/). Through `0.x`, breaking changes m
5
5
 
6
6
  > 🇹🇷 Türkçe için [tamga.org.tr/tr](https://tamga.org.tr/tr).
7
7
 
8
- ## 0.4.2
8
+ ## 0.4.3
9
+
10
+ ### Fixed
11
+
12
+ - **`AppShell` marks the most specific entry, not every entry above it.** The rule was "an entry
13
+ owns its subtree, except `/`, which matches exactly". That holds only when the root really is
14
+ `/`. In a panel mounted under `/panel`, the root entry swallowed every route beneath it: on an
15
+ order's detail page both "Dashboard" and "Orders" showed as current. The wrong answer was the
16
+ sneaky kind, because the right entry was lit too, so nothing looked missing.
17
+
18
+ Which path is the root is the product's knowledge, not the library's, so this did not become a
19
+ new prop. The rule was generalised instead: of the entries containing the path, the longest one
20
+ wins. `/` is now an instance of that rule rather than an exception to it, and the special case is
21
+ gone.
22
+
23
+
9
24
 
10
25
  ### Added
11
26
 
package/dist/kit.css CHANGED
@@ -1,4 +1,4 @@
1
- /*! tamga-ui 0.4.2 · MIT · https://tamga.org.tr */
1
+ /*! tamga-ui 0.4.3 · MIT · https://tamga.org.tr */
2
2
  :root {
3
3
 
4
4
  --overlay-gap: 8px;
@@ -1 +1 @@
1
- {"version":3,"file":"app-shell.d.ts","sourceRoot":"","sources":["../../src/patterns/app-shell.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAE7C,OAAO,EAAa,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5D;;;;;GAKG;AAEH,MAAM,MAAM,QAAQ,GAAG;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC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M,CAAC;IACb,wKAAwK;IACxK,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,cAAc,CAAC,OAAO,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC;IAC1C;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,wJAAwJ;IACxJ,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,GAAG,EAAE,SAAS,QAAQ,EAAE,CAAC;IACzB,mGAAmG;IACnG,UAAU,EAAE,MAAM,CAAC;IACnB;;;;;;;;;;;OAWG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IACzB;;;;OAIG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,uIAAuI;IACvI,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC;IAC7C,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF,wBAAgB,QAAQ,CAAC,EACvB,KAAK,EACL,GAAG,EACH,UAAU,EACV,IAAe,EACf,MAAM,EACN,UAAU,EACV,aAAa,EAAE,IAAgB,EAC/B,MAAM,EACN,QAAQ,GACT,EAAE,aAAa,+BA6Gf"}
@@ -6,9 +6,22 @@ import { RailLink } from "../components/rail-link.js";
6
6
  import { PlainLink } from "./shared.js";
7
7
  export function AppShell({ brand, nav, activePath, rail = "narrow", topbar, railFooter, linkComponent: Link = PlainLink, labels, children, }) {
8
8
  /* Bir giriş kendi alt ağacına sahip: `/urunler`, `/urunler/42/fotograflar`
9
- üzerinde de açık giriştir. Tam eşleşme yalnız kök yol için, yoksa kısa href
10
- altındaki her rotayı yutar. */
11
- const isCurrent = (href) => href === "/" ? activePath === href : activePath === href || activePath.startsWith(`${href}/`);
9
+ üzerinde de açık giriştir.
10
+
11
+ AMA EN UZUN EŞLEŞEN KAZANIR, ve bu bir özel durumu ortadan kaldırdı. Önce
12
+ kural "tam eşleşme yalnız `/` için" diye yazılıydı: kökün `/` olmadığı bir
13
+ panelde (`/panel`) kök giriş altındaki HER rotayı yutuyordu, yani sipariş
14
+ detayında hem "Pano" hem "Siparişler" açık görünüyordu. Ölçüldü.
15
+
16
+ Kökün hangi yol olduğu ürünün bilgisi, kitin değil — o yüzden kite yeni bir
17
+ prop eklemek yerine kural genelleştirildi: yolu kapsayan girişlerden EN
18
+ ÖZELİ açık. `/` de bu kuralın kendiliğinden bir örneği, artık ayrıca
19
+ yazılmıyor. */
20
+ const kapsiyor = (href) => activePath === href || activePath.startsWith(`${href}/`);
21
+ const enOzel = nav.reduce((kazanan, entry) => kapsiyor(entry.href) && (kazanan === null || entry.href.length > kazanan.length)
22
+ ? entry.href
23
+ : kazanan, null);
24
+ const isCurrent = (href) => href === enOzel;
12
25
  const wide = rail === "wide";
13
26
  return (_jsxs("div", { className: "flex h-dvh w-full overflow-hidden bg-shell text-ink-soft", children: [_jsxs("aside", { className: `flex shrink-0 flex-col gap-2 bg-shell py-4 ${wide ? "w-60 px-3" : "w-20 items-center px-1"}`, "data-rail": rail, children: [brand ? (_jsxs(_Fragment, { children: [_jsx("span", { "aria-label": labels.home, className: `mb-2 flex h-10 shrink-0 items-center text-ink ${wide ? "px-2" : "w-10 justify-center"}`, children: brand }), _jsx("span", { className: `h-0 w-6 border-t border-line ${wide ? "ml-2" : ""}` })] })) : null, _jsx("nav", { "aria-label": labels.primaryNav, className: `tamga-rail-scroll flex w-full flex-1 flex-col gap-2 py-1 ${wide ? "" : "items-center"}`, children: nav.map((entry, i) => (_jsxs(Fragment, { children: [wide && entry.section && entry.section !== nav[i - 1]?.section ? (_jsx("p", { className: `px-2.5 text-micro font-semibold uppercase tracking-wide text-ink-faint ${i > 0 ? "mt-4 pb-1" : "pb-1"}`, children: entry.section })) : null, _jsx(RailLink, { href: entry.href, label: entry.label, active: isCurrent(entry.href), showLabel: wide, linkComponent: Link, "data-nav": entry.key, children: _jsx(Icon, { icon: entry.icon, size: "base" }) })] }, entry.key))) }), railFooter ? _jsx("div", { className: "shrink-0", children: railFooter }) : null] }), _jsxs("div", { className: "flex min-w-0 flex-1 flex-col", children: [_jsx("header", { className: "tamga-gutter flex items-center gap-4 py-4", children: topbar }), _jsx("div", { className: "min-h-0 flex-1 overflow-hidden pr-4 pb-4", children: _jsx("main", { className: "tamga-surface relative h-full min-h-0 overflow-y-auto", children: children }) })] })] }));
14
27
  }
package/dist/styles.css CHANGED
@@ -1,3 +1,3 @@
1
- /*! tamga-ui 0.4.2 · MIT · https://tamga.org.tr */
1
+ /*! tamga-ui 0.4.3 · MIT · https://tamga.org.tr */
2
2
  @import "./theme.css";
3
3
  @import "./kit.css";
package/dist/theme.css CHANGED
@@ -1,4 +1,4 @@
1
- /*! tamga-ui 0.4.2 · MIT · https://tamga.org.tr */
1
+ /*! tamga-ui 0.4.3 · MIT · https://tamga.org.tr */
2
2
  @custom-variant dark (&:is(.dark *));
3
3
 
4
4
  @theme {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tamga-ui",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "description": "Mantıksal's shared interface library: tokens, physics and components.",
5
5
  "license": "MIT",
6
6
  "type": "module",