tamga-ui 0.3.0 → 0.3.1
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 +23 -0
- package/dist/components/layout.d.ts +15 -2
- package/dist/components/layout.d.ts.map +1 -1
- package/dist/components/layout.js +10 -2
- package/dist/components/segmented.d.ts +8 -2
- package/dist/components/segmented.d.ts.map +1 -1
- package/dist/components/segmented.js +1 -1
- package/dist/components/surface.d.ts +7 -1
- package/dist/components/surface.d.ts.map +1 -1
- package/dist/components/surface.js +2 -2
- package/dist/kit.css +1 -1
- package/dist/styles.css +1 -1
- package/dist/theme.css +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,29 @@ 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.3.1
|
|
9
|
+
|
|
10
|
+
Three components refused something a consumer legitimately needed, and in each case the way out was
|
|
11
|
+
to drop the component and write its class by hand. A class without its component is the same paint
|
|
12
|
+
with none of the behaviour, so this release is about closing the reasons to reach for it.
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- **`Link.linkComponent`** — the router's link, so an in-app link does not reload the page. Without
|
|
17
|
+
it the component could only draw a plain `<a>`, and anything with client-side routing had to hand
|
|
18
|
+
write `tamga-link` on its own link, taking the class and leaving behind the `rel="noopener
|
|
19
|
+
noreferrer"` that `external` brings. `RailLink` and `AppShell` already solved this the same way;
|
|
20
|
+
`Link` was the one that had not.
|
|
21
|
+
- **`Card.as`** — `div` (default), `section`, `article` or `ul`. A card is usually a *section*, and
|
|
22
|
+
a component that refuses the element pushes the caller to write `tamga-card` by hand. That trade
|
|
23
|
+
is worse than it looks: the hand-written version also loses `overflow="visible"`, which is the
|
|
24
|
+
guard against a menu or a calendar being clipped at the card's edge. Nothing errors when that
|
|
25
|
+
happens; the panel is simply half invisible and the first suspect is z-index, which cannot fix it.
|
|
26
|
+
- **`Segmented` options carry their own attributes.** Anything beyond `value` and `label` now lands
|
|
27
|
+
on that option's button, so a filter strip can tag each choice with the hook a test or a style
|
|
28
|
+
needs. Without it the whole control had to be hand-rolled, losing `aria-pressed` and the keyboard
|
|
29
|
+
behaviour with it.
|
|
30
|
+
|
|
8
31
|
## 0.3.0
|
|
9
32
|
|
|
10
33
|
### Breaking
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
1
|
+
import type { ComponentType, ReactNode } from "react";
|
|
2
2
|
/**
|
|
3
3
|
* Sınıfı olan ama bileşeni olmayan şeyler.
|
|
4
4
|
*
|
|
@@ -127,7 +127,20 @@ export declare function PageBand({ title, subtitle, actions, className, }: {
|
|
|
127
127
|
* olmadan açılan sayfa `window.opener` üzerinden seninkini yönlendirebilir —
|
|
128
128
|
* eski ve hâlâ geçerli bir açık.
|
|
129
129
|
*/
|
|
130
|
-
export declare function Link({ external, className, children, ...props }: React.ComponentProps<"a"> & {
|
|
130
|
+
export declare function Link({ external, className, children, linkComponent: Router, ...props }: React.ComponentProps<"a"> & {
|
|
131
131
|
external?: boolean;
|
|
132
|
+
/**
|
|
133
|
+
* The router's link, so an in-app link does not reload the page. TR: Yönlendiricinin
|
|
134
|
+
* bağlantısı, uygulama içi bir bağlantı sayfayı yeniden yüklemesin diye.
|
|
135
|
+
*
|
|
136
|
+
* Verilmezse düz bir `<a>` çiziliyor. `external` ile birlikte yok sayılıyor: uygulamanın
|
|
137
|
+
* dışına çıkan bir adres istemci yönlendirmesiyle açılamaz.
|
|
138
|
+
*/
|
|
139
|
+
linkComponent?: ComponentType<{
|
|
140
|
+
href?: string;
|
|
141
|
+
className?: string;
|
|
142
|
+
children?: ReactNode;
|
|
143
|
+
[k: string]: unknown;
|
|
144
|
+
}>;
|
|
132
145
|
}): import("react").JSX.Element;
|
|
133
146
|
//# sourceMappingURL=layout.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../src/components/layout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../src/components/layout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGtD;;;;GAIG;AAEH;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,EACtB,MAAc,EACd,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,+BAMpD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,OAAO,CAAC,EACtB,KAAK,EACL,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,+BAYjD;AAED;;;;;;;;;GASG;AACH,wBAAgB,IAAI,CAAC,EACnB,KAAS,EACT,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,+BAUlD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,IAAI,CAAC,EACnB,OAAO,EACP,CAAC,EACD,CAAC,EACD,SAAS,GACV,EAAE;IACD,yFAAyF;IACzF,OAAO,EAAE,GAAG,GAAG,GAAG,CAAC;IACnB,CAAC,EAAE,SAAS,CAAC;IACb,CAAC,EAAE,SAAS,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,+BAWA;AAED;;;;;;;;;;GAUG;AAC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;KAAE,CAAC,CAAC;CAClH,+BAUA"}
|
|
@@ -127,6 +127,14 @@ export function PageBand({ title, subtitle, actions, className, }) {
|
|
|
127
127
|
* olmadan açılan sayfa `window.opener` üzerinden seninkini yönlendirebilir —
|
|
128
128
|
* eski ve hâlâ geçerli bir açık.
|
|
129
129
|
*/
|
|
130
|
-
export function Link({ external = false, className, children, ...props }) {
|
|
131
|
-
|
|
130
|
+
export function Link({ external = false, className, children, linkComponent: Router, ...props }) {
|
|
131
|
+
const shared = {
|
|
132
|
+
className: cn("tamga-link", className),
|
|
133
|
+
target: external ? "_blank" : undefined,
|
|
134
|
+
rel: external ? "noopener noreferrer" : undefined,
|
|
135
|
+
...props,
|
|
136
|
+
};
|
|
137
|
+
/* Dış bağlantı yönlendiriciden geçmiyor: uygulamanın dışına çıkan bir adres
|
|
138
|
+
istemci yönlendirmesiyle açılamaz, ve denemek sessizce bir sekme kaybettirir. */
|
|
139
|
+
return Router && !external ? _jsx(Router, { ...shared, children: children }) : _jsx("a", { ...shared, children: children });
|
|
132
140
|
}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
2
|
export declare function Segmented<T extends string>({ options, value, onChange, label, className, }: {
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* The choices. Anything beyond `value` and `label` lands on that option's button, so a choice
|
|
5
|
+
* can carry the hook a test or a style needs. TR: Seçenekler. `value` ve `label` dışındaki her
|
|
6
|
+
* şey o seçeneğin düğmesine iniyor, yani bir seçenek testin ya da stilin ihtiyaç duyduğu
|
|
7
|
+
* kancayı taşıyabiliyor.
|
|
8
|
+
*/
|
|
9
|
+
options: readonly ({
|
|
4
10
|
value: T;
|
|
5
11
|
label: ReactNode;
|
|
6
|
-
}[];
|
|
12
|
+
} & Record<string, unknown>)[];
|
|
7
13
|
value: T;
|
|
8
14
|
onChange?: (next: T) => void;
|
|
9
15
|
/** The group's accessible name. TR: Grubun erişilebilir adı. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"segmented.d.ts","sourceRoot":"","sources":["../../src/components/segmented.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AASvC,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,EAAE,EAC1C,OAAO,EACP,KAAK,EACL,QAAQ,EACR,KAAK,EACL,SAAS,GACV,EAAE;IACD,OAAO,EAAE,SAAS;QAAE,KAAK,EAAE,CAAC,CAAC;QAAC,KAAK,EAAE,SAAS,CAAA;KAAE,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"segmented.d.ts","sourceRoot":"","sources":["../../src/components/segmented.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AASvC,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,EAAE,EAC1C,OAAO,EACP,KAAK,EACL,QAAQ,EACR,KAAK,EACL,SAAS,GACV,EAAE;IACD;;;;;OAKG;IACH,OAAO,EAAE,SAAS,CAAC;QAAE,KAAK,EAAE,CAAC,CAAC;QAAC,KAAK,EAAE,SAAS,CAAA;KAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC;IAC/E,KAAK,EAAE,CAAC,CAAC;IACT,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC;IAC7B,gEAAgE;IAChE,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,+BAiBA"}
|
|
@@ -8,5 +8,5 @@ import { cn } from "../lib/cn.js";
|
|
|
8
8
|
* "Buradasın" bir eylem değildir, o yüzden dolgu almaz (Yasa 2).
|
|
9
9
|
* ---------------------------------------------------------------- */
|
|
10
10
|
export function Segmented({ options, value, onChange, label, className, }) {
|
|
11
|
-
return (_jsx("div", { role: "group", "aria-label": label, className: cn("tamga-segment", className), children: options.map((
|
|
11
|
+
return (_jsx("div", { role: "group", "aria-label": label, className: cn("tamga-segment", className), children: options.map(({ value: v, label: etiket, ...rest }) => (_jsx("button", { type: "button", ...rest, "aria-pressed": value === v, "data-active": value === v, onClick: () => onChange?.(v), children: etiket }, v))) }));
|
|
12
12
|
}
|
|
@@ -10,7 +10,13 @@ import type { ReactNode } from "react";
|
|
|
10
10
|
* 1px kenar + 2px sert offset (Yasa 1). İçindeki her şey `Gutter`ın ritmini
|
|
11
11
|
* paylaşır, böylece iki kart yan yana geldiğinde iç boşlukları hizalanır.
|
|
12
12
|
*/
|
|
13
|
-
export declare function Card({ overflow, children, className, }: {
|
|
13
|
+
export declare function Card({ as: Tag, overflow, children, className, }: {
|
|
14
|
+
/**
|
|
15
|
+
* The element the card is drawn as. TR: Kartın hangi eleman olarak çizileceği.
|
|
16
|
+
*
|
|
17
|
+
* Belge yapısı, sunum değil: bir kart çoğu zaman bir `section`dır. Varsayılan `div`.
|
|
18
|
+
*/
|
|
19
|
+
as?: "div" | "section" | "article" | "ul";
|
|
14
20
|
/**
|
|
15
21
|
* Whether the card's content may spill past its edge. `clip` by default, because the card's
|
|
16
22
|
* rounded corners depend on it: a table inside would run out of the corners without clipping.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"surface.d.ts","sourceRoot":"","sources":["../../src/components/surface.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC;;;;GAIG;AAEH;;;;;GAKG;AACH,wBAAgB,IAAI,CAAC,EACnB,QAAiB,EACjB,QAAQ,EACR,SAAS,GACV,EAAE;IACD;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,+BAMA;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,EACvB,QAAQ,EACR,MAAM,EAC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AAQ,EACR,MAAM,EACN,SAAS,GACV,EAAE;IACD,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,+BAOA;AAED,oEAAoE;AACpE,wBAAgB,QAAQ,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,+BAE5F;AAED;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,+BAMzF;AAED;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,EACpB,QAAQ,EACR,IAAY,EACZ,SAAS,GACV,EAAE;IACD,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,+BAEA"}
|
|
@@ -11,8 +11,8 @@ import { cn } from "../lib/cn.js";
|
|
|
11
11
|
* 1px kenar + 2px sert offset (Yasa 1). İçindeki her şey `Gutter`ın ritmini
|
|
12
12
|
* paylaşır, böylece iki kart yan yana geldiğinde iç boşlukları hizalanır.
|
|
13
13
|
*/
|
|
14
|
-
export function Card({ overflow = "clip", children, className, }) {
|
|
15
|
-
return (_jsx(
|
|
14
|
+
export function Card({ as: Tag = "div", overflow = "clip", children, className, }) {
|
|
15
|
+
return (_jsx(Tag, { className: cn("tamga-card", overflow === "visible" && "tamga-card-open", className), children: children }));
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
18
|
* Kart başlığı — başlık solda, eylem sağda, ikisi aynı taban çizgisinde.
|
package/dist/kit.css
CHANGED
package/dist/styles.css
CHANGED
package/dist/theme.css
CHANGED