tamga-ui 0.2.0 → 0.3.0
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 +86 -0
- package/dist/components/appearance.d.ts +78 -0
- package/dist/components/appearance.d.ts.map +1 -0
- package/dist/components/appearance.js +73 -0
- package/dist/components/chrome.d.ts +11 -1
- package/dist/components/chrome.d.ts.map +1 -1
- package/dist/components/chrome.js +19 -6
- package/dist/components/error-state.d.ts +7 -14
- package/dist/components/error-state.d.ts.map +1 -1
- package/dist/components/overlay.d.ts +7 -16
- package/dist/components/overlay.d.ts.map +1 -1
- package/dist/components/primitives.d.ts +7 -16
- package/dist/components/primitives.d.ts.map +1 -1
- package/dist/components/rail-link.d.ts +22 -2
- package/dist/components/rail-link.d.ts.map +1 -1
- package/dist/components/rail-link.js +12 -9
- package/dist/components/square-picker.d.ts +41 -0
- package/dist/components/square-picker.d.ts.map +1 -0
- package/dist/components/square-picker.js +90 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/kit.css +237 -729
- package/dist/lib/color.d.ts +0 -20
- package/dist/lib/color.d.ts.map +1 -1
- package/dist/lib/color.js +0 -22
- package/dist/lib/image.d.ts +46 -0
- package/dist/lib/image.d.ts.map +1 -0
- package/dist/lib/image.js +95 -0
- package/dist/lib/palette.d.ts +0 -16
- package/dist/lib/palette.d.ts.map +1 -1
- package/dist/lib/palette.js +0 -12
- package/dist/patterns/app-shell.d.ts.map +1 -1
- package/dist/patterns/app-shell.js +2 -12
- package/dist/patterns/appearance-template.d.ts +105 -0
- package/dist/patterns/appearance-template.d.ts.map +1 -0
- package/dist/patterns/appearance-template.js +23 -0
- package/dist/patterns/index.d.ts +1 -0
- package/dist/patterns/index.d.ts.map +1 -1
- package/dist/patterns/index.js +1 -0
- package/dist/patterns/settings-template.d.ts +12 -1
- package/dist/patterns/settings-template.d.ts.map +1 -1
- package/dist/patterns/settings-template.js +2 -2
- package/dist/patterns/shared.d.ts +1 -1
- package/dist/patterns/shared.d.ts.map +1 -1
- package/dist/styles.css +1 -3
- package/dist/theme.css +127 -483
- package/package.json +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,92 @@ 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.0
|
|
9
|
+
|
|
10
|
+
### Breaking
|
|
11
|
+
|
|
12
|
+
- **The Turkish aliases in `tamga-ui/palette` and the colour helpers are gone.** They were
|
|
13
|
+
`@deprecated` through 0.2.x with the removal booked for this release; the mapping is the table
|
|
14
|
+
under 0.2.0. Nothing in the two products that consume this kit still used them, and the kit's own
|
|
15
|
+
documentation site did — which is the whole reason a deprecation window has an end.
|
|
16
|
+
**Migration:** `paletUret` → `makePalette`, `paletStili` → `paletteVars`, `gecerliHex` → `isHex`,
|
|
17
|
+
and so on down that table.
|
|
18
|
+
|
|
19
|
+
### Added
|
|
20
|
+
|
|
21
|
+
- **`ThemeToggle` can be driven from outside.** New optional `dark` and `onChange`. With them the
|
|
22
|
+
control stops owning the preference: it writes no storage, touches no class, only shows and
|
|
23
|
+
reports. Without them nothing changes.
|
|
24
|
+
|
|
25
|
+
**You were affected if** your app already tracks the theme itself and also mounts this control.
|
|
26
|
+
Two writers then fight over one `.dark` class: whichever runs last wins, and the two can disagree
|
|
27
|
+
— token-driven colour saying one thing, `dark:`-driven utilities saying the other. Nothing errors.
|
|
28
|
+
Pass `dark` and `onChange` and the control stops being the second writer.
|
|
29
|
+
|
|
30
|
+
### Fixed
|
|
31
|
+
|
|
32
|
+
- **`RailLink` dropped every extra prop.** `AppShell` passes `data-nav` to each rail entry and the
|
|
33
|
+
attribute never reached the DOM — the passing side thought it had passed it, the receiving side
|
|
34
|
+
never drew it, and nothing errored. Anyone hanging a test or a style on `[data-nav]` was hanging
|
|
35
|
+
it on nothing. `RailLink` now spreads what it is given.
|
|
36
|
+
- **`ThemeToggle`'s icon variant no longer flashes the wrong glyph.** Which icon shows is decided
|
|
37
|
+
by CSS rather than React state, so the first frame is right without waiting for hydration.
|
|
38
|
+
- **A checked checkbox drew its edge in its own fill colour**, so a filled control had no base under
|
|
39
|
+
it. Filled accent objects follow the button's contract everywhere now: `accent` fill,
|
|
40
|
+
`accent-shadow` edge, `accent-ink` ink.
|
|
41
|
+
- **An image tile's hover turned its border to the accent and left its shadow neutral**, which
|
|
42
|
+
detaches the height from the object. Law 1 asks for one colour on both.
|
|
43
|
+
|
|
44
|
+
### Internal
|
|
45
|
+
|
|
46
|
+
- **`check-physics`** — a 16th gate. It reads `kit.css` and holds Law 1 against its written form:
|
|
47
|
+
blur zero, offset diagonal, offset on the ladder (0 · 1 · 2 · 3 · 4 · 6), edge and shadow the same
|
|
48
|
+
colour, a press that travels exactly the resting offset, a hover that rises exactly one step. It
|
|
49
|
+
covers 61 elevations across 37 families.
|
|
50
|
+
|
|
51
|
+
The law is the kit's, so its proof belongs here too. It used to be measured downstream, against a
|
|
52
|
+
gallery the kit does not own.
|
|
53
|
+
- **The pattern layer has tests.** 35 of them. Until now the kit had 32 tests and not one of them
|
|
54
|
+
rendered a component, while every consumer of `tamga-ui/patterns` depended on that layer.
|
|
55
|
+
|
|
56
|
+
## 0.2.1
|
|
57
|
+
|
|
58
|
+
### Added
|
|
59
|
+
|
|
60
|
+
- **`AppearanceTemplate`** (`tamga-ui/patterns`) — the whole appearance screen: logo, mark, brand
|
|
61
|
+
colour, theme and sidebar width. This screen had been built twice, by hand, in two products, and
|
|
62
|
+
the second one came out bare: a hex field instead of swatches, three words instead of three
|
|
63
|
+
pictures, no logo area at all. Handing over the parts and saying "arrange them yourself" is what
|
|
64
|
+
let them drift; that is the job the pattern layer exists for (ADR-0004).
|
|
65
|
+
|
|
66
|
+
It stores NOTHING and applies NOTHING. `value` in, `onChange` and `onSave` out, every word from
|
|
67
|
+
`labels`. Where the preference lives (session, account, browser) is a product decision, and
|
|
68
|
+
turning the chosen colour into tokens stays the product's call too, because the root element is
|
|
69
|
+
its own.
|
|
70
|
+
|
|
71
|
+
- **`ColorSwatches`, `ThemeCards`, `ImageField`** — the parts, for a screen that needs a different
|
|
72
|
+
arrangement. `ThemeCards` draws a miniature of each option rather than naming it; a theme is not
|
|
73
|
+
chosen by a word, it is chosen by seeing the result.
|
|
74
|
+
- **`SquarePicker`** — dragging a square over an uploaded logo to cut a mark out of it. A mark
|
|
75
|
+
cannot be derived automatically, and this is the honest alternative: the human says where it is.
|
|
76
|
+
- **`prepareImage` and `cropSquare`** (`tamga-ui`) — resize and square-crop an uploaded file, with
|
|
77
|
+
no library: a `<canvas>`. The ratio is kept and nothing is cropped silently; SVG passes through
|
|
78
|
+
untouched, because baking a vector into a 512px PNG stops it being sharp.
|
|
79
|
+
- **`SettingsPanel.accent`** — a coloured left edge on a section block.
|
|
80
|
+
|
|
81
|
+
### Fixed
|
|
82
|
+
|
|
83
|
+
- **Completed steps were darker than everything else on the screen.** `StepStrip` filled them with
|
|
84
|
+
`--color-accent-line`, which is the accent's TEXT variant: it is derived by SEARCHING for 4.5
|
|
85
|
+
contrast against the page, so it is always darker than the face. Every button and badge on the
|
|
86
|
+
same screen used `--color-accent`, and the gap widened with each new brand colour. The ink on top
|
|
87
|
+
was measured against `accent`, never against `accent-line`, so that pairing was never checked at
|
|
88
|
+
all. Filled accent objects now follow the button's contract everywhere: `accent` for the fill,
|
|
89
|
+
`accent-shadow` for the edge, `accent-ink` for the ink.
|
|
90
|
+
|
|
91
|
+
Nothing errored here: the colours were valid and the contrast gates passed. `check-css` now
|
|
92
|
+
refuses `--color-accent-line` as a fill, so this class of mistake cannot pass silently again.
|
|
93
|
+
|
|
8
94
|
## 0.2.0
|
|
9
95
|
|
|
10
96
|
Most of this release came out of gaps found by two people using the kit **from the outside**:
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export type SwatchOption = {
|
|
3
|
+
/** The hex the swatch applies. TR: Kutunun uyguladığı hex. */
|
|
4
|
+
hex: string;
|
|
5
|
+
/** Its name, translated, used as the accessible label. TR: Çevrilmiş adı; erişilebilir ad olarak kullanılıyor. */
|
|
6
|
+
label: string;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Brand colour chosen from a few squares, or written by hand.
|
|
10
|
+
* TR: Birkaç kareden seçilen ya da elle yazılan marka rengi.
|
|
11
|
+
*/
|
|
12
|
+
export declare function ColorSwatches({ options, value, onChange, customLabel, custom, className, }: {
|
|
13
|
+
options: readonly SwatchOption[];
|
|
14
|
+
value: string;
|
|
15
|
+
onChange: (hex: string) => void;
|
|
16
|
+
/** Accessible name of the "my own colour" control. TR: "Kendi rengim" kontrolünün erişilebilir adı. */
|
|
17
|
+
customLabel: string;
|
|
18
|
+
/** Whether a free colour is offered at all. TR: Serbest rengin hiç sunulup sunulmadığı. */
|
|
19
|
+
custom?: boolean;
|
|
20
|
+
className?: string;
|
|
21
|
+
}): import("react").JSX.Element;
|
|
22
|
+
export type ThemeChoice = "light" | "dark" | "system";
|
|
23
|
+
/**
|
|
24
|
+
* Theme picked from three little pictures of the panel.
|
|
25
|
+
* TR: Panelin üç küçük resminden seçilen tema.
|
|
26
|
+
*
|
|
27
|
+
* "Light · Dark · System" were three words, and a theme is not chosen with
|
|
28
|
+
* words: the person wants to see the result. "System" shows both halves in one
|
|
29
|
+
* frame, which is exactly what it means.
|
|
30
|
+
* TR: "Açık · Koyu · Sistem" üç kelimeydi, ve bir tema kelimeyle seçilmiyor:
|
|
31
|
+
* kullanıcı sonucu görmek istiyor. "Sistem" iki yarımı tek karede gösteriyor,
|
|
32
|
+
* anlamı tam olarak bu.
|
|
33
|
+
*/
|
|
34
|
+
export declare function ThemeCards({ value, onChange, labels, className, }: {
|
|
35
|
+
value: ThemeChoice;
|
|
36
|
+
onChange: (next: ThemeChoice) => void;
|
|
37
|
+
/** The three names and the group's accessible name. TR: Üç ad ve kümenin erişilebilir adı. */
|
|
38
|
+
labels: {
|
|
39
|
+
light: string;
|
|
40
|
+
dark: string;
|
|
41
|
+
system: string;
|
|
42
|
+
group: string;
|
|
43
|
+
};
|
|
44
|
+
className?: string;
|
|
45
|
+
}): import("react").JSX.Element;
|
|
46
|
+
/**
|
|
47
|
+
* One image with a preview, a replace and a remove.
|
|
48
|
+
* TR: Önizlemesi, değiştirmesi ve kaldırması olan tek bir görsel.
|
|
49
|
+
*
|
|
50
|
+
* NOT `FileUpload`: that one is a GALLERY (multi select, reorder arrows, a
|
|
51
|
+
* "cover" badge). Right for product photos, wrong for a single logo, where it
|
|
52
|
+
* offers reorder arrows with nothing to reorder.
|
|
53
|
+
* TR: `FileUpload` DEĞİL: o bir GALERİ (çoklu seçim, sıralama okları, "kapak"
|
|
54
|
+
* rozeti). Ürün fotoğrafları için doğru, tek bir logo için yanlış.
|
|
55
|
+
*/
|
|
56
|
+
export declare function ImageField({ value, onChange, maxEdge, labels, preview, extra, className, }: {
|
|
57
|
+
value: string | null;
|
|
58
|
+
onChange: (next: string | null) => void;
|
|
59
|
+
/** Longest edge of the stored image, in pixels. TR: Saklanan görselin en uzun kenarı, piksel. */
|
|
60
|
+
maxEdge: number;
|
|
61
|
+
labels: {
|
|
62
|
+
/** "Logo", "Mark": used inside the buttons. TR: "Logo", "Amblem": düğmelerin içinde geçiyor. */
|
|
63
|
+
name: string;
|
|
64
|
+
upload: string;
|
|
65
|
+
replace: string;
|
|
66
|
+
remove: string;
|
|
67
|
+
empty: string;
|
|
68
|
+
errorType: string;
|
|
69
|
+
errorSize: string;
|
|
70
|
+
errorUnreadable: string;
|
|
71
|
+
};
|
|
72
|
+
/** The caller draws the preview: a logo is wide, a mark is square. TR: Önizlemeyi çağıran çiziyor: logo geniş, amblem kare. */
|
|
73
|
+
preview: (src: string) => ReactNode;
|
|
74
|
+
/** An extra control beside the buttons. TR: Düğmelerin yanına giren ek kontrol. */
|
|
75
|
+
extra?: ReactNode;
|
|
76
|
+
className?: string;
|
|
77
|
+
}): import("react").JSX.Element;
|
|
78
|
+
//# sourceMappingURL=appearance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appearance.d.ts","sourceRoot":"","sources":["../../src/components/appearance.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA2B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAchE,MAAM,MAAM,YAAY,GAAG;IACzB,8DAA8D;IAC9D,GAAG,EAAE,MAAM,CAAC;IACZ,kHAAkH;IAClH,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;;GAGG;AACH,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,KAAK,EACL,QAAQ,EACR,WAAW,EACX,MAAa,EACb,SAAS,GACV,EAAE;IACD,OAAO,EAAE,SAAS,YAAY,EAAE,CAAC;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,uGAAuG;IACvG,WAAW,EAAE,MAAM,CAAC;IACpB,2FAA2F;IAC3F,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,+BAqCA;AAED,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;AAoBtD;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,QAAQ,EACR,MAAM,EACN,SAAS,GACV,EAAE;IACD,KAAK,EAAE,WAAW,CAAC;IACnB,QAAQ,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,IAAI,CAAC;IACtC,8FAA8F;IAC9F,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IACvE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,+BA6BA;AAED;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,QAAQ,EACR,OAAO,EACP,MAAM,EACN,OAAO,EACP,KAAK,EACL,SAAS,GACV,EAAE;IACD,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACxC,iGAAiG;IACjG,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE;QACN,gGAAgG;QAChG,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,MAAM,CAAC;QACd,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,MAAM,CAAC;QAClB,eAAe,EAAE,MAAM,CAAC;KACzB,CAAC;IACF,+HAA+H;IAC/H,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,SAAS,CAAC;IACpC,mFAAmF;IACnF,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,+BAoDA"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useId, useRef, useState } from "react";
|
|
4
|
+
import { cn } from "../lib/cn.js";
|
|
5
|
+
import { IMAGE_ACCEPT, prepareImage } from "../lib/image.js";
|
|
6
|
+
import { Alert } from "./primitives.js";
|
|
7
|
+
import { Button } from "./button.js";
|
|
8
|
+
/**
|
|
9
|
+
* Brand colour chosen from a few squares, or written by hand.
|
|
10
|
+
* TR: Birkaç kareden seçilen ya da elle yazılan marka rengi.
|
|
11
|
+
*/
|
|
12
|
+
export function ColorSwatches({ options, value, onChange, customLabel, custom = true, className, }) {
|
|
13
|
+
const secili = (hex) => hex.toLowerCase() === value.toLowerCase();
|
|
14
|
+
const hazirMi = options.some((o) => secili(o.hex));
|
|
15
|
+
return (_jsxs("span", { className: cn("flex flex-wrap items-center gap-3", className), children: [options.map((o) => (_jsx("button", { type: "button", className: "tamga-swatch", "data-selected": secili(o.hex), "aria-label": o.label, title: o.label, onClick: () => onChange(o.hex), children: _jsx("span", { "aria-hidden": true, style: { background: o.hex } }) }, o.hex))), custom ? (_jsxs("label", { className: "tamga-swatch", "data-selected": !hazirMi, title: customLabel, children: [_jsx("span", { className: "sr-only", children: customLabel }), _jsx("input", { type: "color", value: hazirMi ? options[0].hex : value, onChange: (e) => onChange(e.target.value), className: "tamga-color-input", "aria-label": customLabel })] })) : null] }));
|
|
16
|
+
}
|
|
17
|
+
function Yarim({ theme }) {
|
|
18
|
+
return (_jsxs("span", { className: "tamga-theme-half", "data-theme": theme, "aria-hidden": true, children: [_jsxs("span", { className: "tamga-theme-rail", children: [_jsx("span", { className: "tamga-theme-dot", "data-accent": "true" }), _jsx("span", { className: "tamga-theme-dot" }), _jsx("span", { className: "tamga-theme-dot" })] }), _jsxs("span", { className: "tamga-theme-body", children: [_jsx("span", { className: "tamga-theme-line", style: { width: "70%" } }), _jsx("span", { className: "tamga-theme-line", style: { width: "45%" } }), _jsx("span", { className: "tamga-theme-line", "data-accent": "true", style: { width: "30%" } }), _jsx("span", { className: "tamga-theme-line", style: { width: "60%" } })] })] }));
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Theme picked from three little pictures of the panel.
|
|
22
|
+
* TR: Panelin üç küçük resminden seçilen tema.
|
|
23
|
+
*
|
|
24
|
+
* "Light · Dark · System" were three words, and a theme is not chosen with
|
|
25
|
+
* words: the person wants to see the result. "System" shows both halves in one
|
|
26
|
+
* frame, which is exactly what it means.
|
|
27
|
+
* TR: "Açık · Koyu · Sistem" üç kelimeydi, ve bir tema kelimeyle seçilmiyor:
|
|
28
|
+
* kullanıcı sonucu görmek istiyor. "Sistem" iki yarımı tek karede gösteriyor,
|
|
29
|
+
* anlamı tam olarak bu.
|
|
30
|
+
*/
|
|
31
|
+
export function ThemeCards({ value, onChange, labels, className, }) {
|
|
32
|
+
const secenekler = [
|
|
33
|
+
{ deger: "light", ad: labels.light },
|
|
34
|
+
{ deger: "dark", ad: labels.dark },
|
|
35
|
+
{ deger: "system", ad: labels.system },
|
|
36
|
+
];
|
|
37
|
+
return (_jsx("div", { role: "radiogroup", "aria-label": labels.group, className: cn("flex flex-wrap gap-3", className), children: secenekler.map((s) => (_jsxs("button", { type: "button", role: "radio", "aria-checked": value === s.deger, tabIndex: value === s.deger ? 0 : -1, "data-selected": value === s.deger, className: "tamga-theme-card", onClick: () => onChange(s.deger), children: [_jsxs("span", { className: "tamga-theme-box", children: [s.deger === "dark" ? _jsx(Yarim, { theme: "dark" }) : _jsx(Yarim, { theme: "light" }), s.deger === "system" ? _jsx(Yarim, { theme: "dark" }) : null] }), _jsx("span", { className: "tamga-theme-name", children: s.ad })] }, s.deger))) }));
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* One image with a preview, a replace and a remove.
|
|
41
|
+
* TR: Önizlemesi, değiştirmesi ve kaldırması olan tek bir görsel.
|
|
42
|
+
*
|
|
43
|
+
* NOT `FileUpload`: that one is a GALLERY (multi select, reorder arrows, a
|
|
44
|
+
* "cover" badge). Right for product photos, wrong for a single logo, where it
|
|
45
|
+
* offers reorder arrows with nothing to reorder.
|
|
46
|
+
* TR: `FileUpload` DEĞİL: o bir GALERİ (çoklu seçim, sıralama okları, "kapak"
|
|
47
|
+
* rozeti). Ürün fotoğrafları için doğru, tek bir logo için yanlış.
|
|
48
|
+
*/
|
|
49
|
+
export function ImageField({ value, onChange, maxEdge, labels, preview, extra, className, }) {
|
|
50
|
+
const id = useId();
|
|
51
|
+
const girdi = useRef(null);
|
|
52
|
+
const [hata, setHata] = useState(null);
|
|
53
|
+
async function al(file) {
|
|
54
|
+
if (!file)
|
|
55
|
+
return;
|
|
56
|
+
setHata(null);
|
|
57
|
+
try {
|
|
58
|
+
onChange(await prepareImage(file, maxEdge));
|
|
59
|
+
}
|
|
60
|
+
catch (e) {
|
|
61
|
+
const kod = e instanceof Error ? e.message : "unreadable";
|
|
62
|
+
setHata(kod === "type" ? labels.errorType : kod === "size" ? labels.errorSize : labels.errorUnreadable);
|
|
63
|
+
}
|
|
64
|
+
finally {
|
|
65
|
+
/* GİRDİ SIFIRLANIYOR: aynı dosya ikinci kez seçilince `change` hiç
|
|
66
|
+
çıkmıyor, çünkü değer değişmiyor. Kullanıcı için bu "ikinci denemede
|
|
67
|
+
çalışmıyor" demek. */
|
|
68
|
+
if (girdi.current)
|
|
69
|
+
girdi.current.value = "";
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return (_jsxs("div", { className: cn("flex flex-col gap-3", className), children: [_jsx("input", { ref: girdi, id: id, type: "file", accept: IMAGE_ACCEPT, className: "sr-only", onChange: (e) => al(e.target.files?.[0]) }), _jsxs("div", { className: "flex flex-wrap items-center gap-4", children: [_jsx("span", { className: "tamga-image-field", "data-empty": value ? undefined : "true", children: value ? preview(value) : labels.empty }), _jsxs("span", { className: "flex flex-wrap items-center gap-2", children: [_jsx(Button, { type: "button", onClick: () => girdi.current?.click(), children: value ? labels.replace : labels.upload }), extra, value ? (_jsx(Button, { type: "button", variant: "ghost", onClick: () => onChange(null), children: labels.remove })) : null] })] }), hata ? _jsx(Alert, { state: "danger", title: hata }) : null] }));
|
|
73
|
+
}
|
|
@@ -21,7 +21,7 @@ import { type ComponentType, type ReactNode } from "react";
|
|
|
21
21
|
* görünür. `switch` biçimi aynı iskeleti kullanıyor — iki uçta birer simge,
|
|
22
22
|
* ortada kayan bir anahtar — yani ikisi yan yana aynı satırda oturuyor.
|
|
23
23
|
*/
|
|
24
|
-
export declare function ThemeToggle({ labels, variant, storageKey, className, }: {
|
|
24
|
+
export declare function ThemeToggle({ labels, variant, storageKey, dark: controlled, onChange, className, }: {
|
|
25
25
|
/**
|
|
26
26
|
* `icon` and `switch` need ACTION words, `select` needs STATE words. TR: `icon` ve `switch`
|
|
27
27
|
* EYLEM sözcüğü ister, `select` DURUM sözcüğü.
|
|
@@ -42,6 +42,16 @@ export declare function ThemeToggle({ labels, variant, storageKey, className, }:
|
|
|
42
42
|
light: string;
|
|
43
43
|
dark: string;
|
|
44
44
|
};
|
|
45
|
+
/**
|
|
46
|
+
* The current theme, when the PRODUCT owns it. TR: O anki tema, temayı ÜRÜN tutuyorsa.
|
|
47
|
+
*
|
|
48
|
+
* Verildiğinde bu kontrol hafızasını bırakıyor: `localStorage`a yazmıyor, `.dark` sınıfına
|
|
49
|
+
* dokunmuyor, yalnız gösteriyor ve `onChange` ile bildiriyor. Verilmediğinde tercihi kendi
|
|
50
|
+
* saklıyor. Temayı zaten tutan bir uygulamada VER: yoksa iki yazar tek sınıf için yarışır.
|
|
51
|
+
*/
|
|
52
|
+
dark?: boolean;
|
|
53
|
+
/** Called when the reader asks for the other theme. TR: Okuyucu öteki temayı istediğinde çağrılıyor. */
|
|
54
|
+
onChange?: (dark: boolean) => void;
|
|
45
55
|
/**
|
|
46
56
|
* `icon` a square button · `switch` the same shape as a language toggle · `select` a box that
|
|
47
57
|
* says the current theme in words. TR: `icon` kare düğme · `switch` bir dil anahtarıyla aynı
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chrome.d.ts","sourceRoot":"","sources":["../../src/components/chrome.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAuB,KAAK,aAAa,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AA8BhF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,WAAW,CAAC,EAC1B,MAAM,EACN,OAAgB,EAChB,UAA0B,EAC1B,SAAS,GACV,EAAE;IACD;;;;;;;;;;;;OAYG;IACH,MAAM,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAA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birer simge,
|
|
52
52
|
* ortada kayan bir anahtar — yani ikisi yan yana aynı satırda oturuyor.
|
|
53
53
|
*/
|
|
54
|
-
export function ThemeToggle({ labels, variant = "icon", storageKey = "tamga-theme", className, }) {
|
|
55
|
-
const
|
|
54
|
+
export function ThemeToggle({ labels, variant = "icon", storageKey = "tamga-theme", dark: controlled, onChange, className, }) {
|
|
55
|
+
const owned = controlled === undefined;
|
|
56
|
+
const [self, setSelf] = useState(false);
|
|
57
|
+
const dark = owned ? self : controlled;
|
|
56
58
|
useEffect(() => {
|
|
59
|
+
if (!owned)
|
|
60
|
+
return;
|
|
57
61
|
const saved = read(storageKey);
|
|
58
62
|
const initial = saved
|
|
59
63
|
? saved === "dark"
|
|
60
64
|
: window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
61
|
-
|
|
65
|
+
setSelf(initial);
|
|
62
66
|
document.documentElement.classList.toggle("dark", initial);
|
|
63
|
-
}, [storageKey]);
|
|
67
|
+
}, [owned, storageKey]);
|
|
64
68
|
function toggle() {
|
|
65
69
|
const next = !dark;
|
|
66
|
-
|
|
70
|
+
onChange?.(next);
|
|
71
|
+
if (!owned)
|
|
72
|
+
return;
|
|
73
|
+
setSelf(next);
|
|
67
74
|
document.documentElement.classList.toggle("dark", next);
|
|
68
75
|
write(storageKey, next ? "dark" : "light");
|
|
69
76
|
}
|
|
@@ -82,7 +89,13 @@ export function ThemeToggle({ labels, variant = "icon", storageKey = "tamga-them
|
|
|
82
89
|
if (variant === "switch") {
|
|
83
90
|
return (_jsxs("span", { className: cn("flex items-center gap-2", className), children: [_jsx(Icon, { icon: ThemeLight, size: "xs", "aria-hidden": true, className: dark ? "text-ink-faint" : "text-ink" }), _jsx(Switch, { on: dark, onChange: toggle, label: "toLight" in labels ? (dark ? labels.toLight : labels.toDark) : "" }), _jsx(Icon, { icon: ThemeDark, size: "xs", "aria-hidden": true, className: dark ? "text-ink" : "text-ink-faint" })] }));
|
|
84
91
|
}
|
|
85
|
-
|
|
92
|
+
/* HANGİ GLİFİN GÖRÜNECEĞİNE CSS KARAR VERİYOR, React durumu değil.
|
|
93
|
+
Sunucuda çizilen ilk kare temayı bilmiyor: durumla seçilen bir glif, tema
|
|
94
|
+
çözülene kadar YANLIŞ olanı gösterip sonra takla atıyor. `dark:` yardımcısı
|
|
95
|
+
kök sınıfla birlikte anında doğru olanı gösteriyor, hidrasyon beklemeden.
|
|
96
|
+
Erişilebilir ad bunu yapamıyor (bir düğmenin tek bir adı olur), o yüzden o
|
|
97
|
+
duruma bağlı kalıyor — ve kontrollü kullanımda ürün doğru değeri veriyor. */
|
|
98
|
+
return (_jsxs("button", { type: "button", onClick: toggle, className: cn("tamga-icon-btn", className), "aria-label": "toLight" in labels ? (dark ? labels.toLight : labels.toDark) : undefined, children: [_jsx(Icon, { icon: ThemeDark, size: "sm", className: "dark:hidden" }), _jsx(Icon, { icon: ThemeLight, size: "sm", className: "hidden dark:block" })] }));
|
|
86
99
|
}
|
|
87
100
|
/**
|
|
88
101
|
* Dil değiştirici.
|
|
@@ -11,20 +11,13 @@ export declare function ErrorState({ title, description, detail, onRetry, retryL
|
|
|
11
11
|
*/
|
|
12
12
|
description?: string;
|
|
13
13
|
/**
|
|
14
|
-
* The technical line
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* TR: Teknik satır. 2026-08-19'da KARARA BAĞLANDI (Ercüment, açık soru 5): kilitli zarf
|
|
22
|
-
* (api-kontrati.html A4) uyarınca `code` ve `meta.request_id`, bu sırayla, örneğin
|
|
23
|
-
* `quota_exceeded · req_8f2a…`. Neden bu ikisi ve HTTP durumu değil: `code` neyin
|
|
24
|
-
* bozulduğunun kararlı makine adı (hiç yerelleşmiyor, ve hem destek hem programatik istemci
|
|
25
|
-
* ona bakarak dallanıyor), `request_id` ise bu hatayı bir sunucu kaydıyla eşleştiren şey;
|
|
26
|
-
* kontrat onu 500'de zorunlu kılıyor ve `X-Request-Id` başlığında aynalıyor. İnsan cümlesi
|
|
27
|
-
* zarfın zaten yerelleşmiş `message` alanından `description`'a ait.
|
|
14
|
+
* The technical line: what support and a programmatic client can act on. TR: Teknik satır:
|
|
15
|
+
* desteğin ve programatik istemcinin üzerinde işlem yapabileceği şey.
|
|
16
|
+
*
|
|
17
|
+
* İki parça bekliyor, bu sırayla: neyin bozulduğunun KARARLI MAKİNE ADI ve hatayı bir sunucu
|
|
18
|
+
* kaydıyla eşleştiren KİMLİK, örneğin `quota_exceeded · req_8f2a…`. İkisinin de yerelleşmemesi
|
|
19
|
+
* gerekiyor; insan cümlesi `description`a ait. Alanların adı ve hangi yanıtta zorunlu olduğu
|
|
20
|
+
* ürünün API sözleşmesinin kararı, bu bileşenin değil.
|
|
28
21
|
*/
|
|
29
22
|
detail?: string;
|
|
30
23
|
onRetry?: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-state.d.ts","sourceRoot":"","sources":["../../src/components/error-state.tsx"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,EACzB,KAA6B,EAC7B,WAAW,EACX,MAAM,EACN,OAAO,EACP,UAAwB,EACxB,OAAe,GAChB,EAAE;IACD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB
|
|
1
|
+
{"version":3,"file":"error-state.d.ts","sourceRoot":"","sources":["../../src/components/error-state.tsx"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,EACzB,KAA6B,EAC7B,WAAW,EACX,MAAM,EACN,OAAO,EACP,UAAwB,EACxB,OAAe,GAChB,EAAE;IACD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,+BAuCA"}
|
|
@@ -48,22 +48,13 @@ export declare function DropdownMenu({ trigger, items, align, width, loading, lo
|
|
|
48
48
|
*/
|
|
49
49
|
loading?: boolean;
|
|
50
50
|
/**
|
|
51
|
-
* How many skeleton rows to hold while `loading`.
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* it at 4 is a bug that looks like a design choice. TR: `loading` sürerken kaç iskelet satırı
|
|
59
|
-
* tutulacağı. 2026-08-19'da KARARA BAĞLANDI (açık soru 4): bu asla bir zevk değeri değil;
|
|
60
|
-
* gerçekten gelmekte olan kayıt sayısı, çünkü iskeletin bütün amacı kayıtlar geldiğinde
|
|
61
|
-
* panelin yeniden boyutlanmaması. O sayının nereden geldiği (api-kontrati.html A7, KİLİTLİ):
|
|
62
|
-
* · sayfalı liste → isteğin `page_size` değeri (DRF varsayılanı 25, en çok 100) · son sayfa →
|
|
63
|
-
* `meta.count - (page - 1) * page_size` · imleçli liste → `page_size` (tasarım gereği `count`
|
|
64
|
-
* dönmüyor) · boyu bilinen menü → çağıranın zaten bildiği öğe sayısı Varsayılan 4 bir menüye
|
|
65
|
-
* uyuyor, bir listeye değil. 4'te bırakılmış bir liste, tasarım kararı gibi görünen bir
|
|
66
|
-
* hatadır.
|
|
51
|
+
* How many skeleton rows to hold while `loading`. TR: `loading` sürerken kaç iskelet satırı
|
|
52
|
+
* tutulacağı.
|
|
53
|
+
*
|
|
54
|
+
* ZEVK DEĞERİ DEĞİL: gerçekten gelmekte olan kayıt sayısı, çünkü iskeletin bütün amacı kayıtlar
|
|
55
|
+
* indiğinde panelin yeniden boyutlanmaması. Sayı çağıranın elinde: sayfa boyu, son sayfanın
|
|
56
|
+
* kalanı, ya da menünün zaten bilinen öğe sayısı. Varsayılan 4 bir menüye uyuyor, bir listeye
|
|
57
|
+
* değil; 4'te bırakılmış bir liste, tasarım kararı gibi görünen bir hatadır.
|
|
67
58
|
*/
|
|
68
59
|
loadingRows?: number;
|
|
69
60
|
}): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overlay.d.ts","sourceRoot":"","sources":["../../src/components/overlay.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAsCtC,MAAM,MAAM,QAAQ,GAChB;IACE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,IAAI,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB;;;;;;;;;OASG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,GACD;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,GACrB;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAErC,wBAAgB,YAAY,CAAC,EAC3B,OAAO,EACP,KAAK,EACL,KAAe,EACf,KAAW,EACX,OAAe,EACf,WAAe,EACf,WAAmB,GACpB,EAAE;IACD,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;;;;;;;;OAYG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB
|
|
1
|
+
{"version":3,"file":"overlay.d.ts","sourceRoot":"","sources":["../../src/components/overlay.tsx"],"names":[],"m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KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB,+BAsBA"}
|
|
@@ -53,22 +53,13 @@ export declare function Select({ options, value, onChange, placeholder, loading,
|
|
|
53
53
|
*/
|
|
54
54
|
loading?: boolean;
|
|
55
55
|
/**
|
|
56
|
-
* How many skeleton rows to hold while `loading`.
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
* it at 4 is a bug that looks like a design choice. TR: `loading` sürerken kaç iskelet satırı
|
|
64
|
-
* tutulacağı. 2026-08-19'da KARARA BAĞLANDI (açık soru 4): bu asla bir zevk değeri değil;
|
|
65
|
-
* gerçekten gelmekte olan kayıt sayısı, çünkü iskeletin bütün amacı kayıtlar geldiğinde
|
|
66
|
-
* panelin yeniden boyutlanmaması. O sayının nereden geldiği (api-kontrati.html A7, KİLİTLİ):
|
|
67
|
-
* · sayfalı liste → isteğin `page_size` değeri (DRF varsayılanı 25, en çok 100) · son sayfa →
|
|
68
|
-
* `meta.count - (page - 1) * page_size` · imleçli liste → `page_size` (tasarım gereği `count`
|
|
69
|
-
* dönmüyor) · boyu bilinen menü → çağıranın zaten bildiği öğe sayısı Varsayılan 4 bir menüye
|
|
70
|
-
* uyuyor, bir listeye değil. 4'te bırakılmış bir liste, tasarım kararı gibi görünen bir
|
|
71
|
-
* hatadır.
|
|
56
|
+
* How many skeleton rows to hold while `loading`. TR: `loading` sürerken kaç iskelet satırı
|
|
57
|
+
* tutulacağı.
|
|
58
|
+
*
|
|
59
|
+
* ZEVK DEĞERİ DEĞİL: gerçekten gelmekte olan kayıt sayısı, çünkü iskeletin bütün amacı kayıtlar
|
|
60
|
+
* indiğinde panelin yeniden boyutlanmaması. Sayı çağıranın elinde: sayfa boyu, son sayfanın
|
|
61
|
+
* kalanı, ya da menünün zaten bilinen öğe sayısı. Varsayılan 4 bir menüye uyuyor, bir listeye
|
|
62
|
+
* değil; 4'te bırakılmış bir liste, tasarım kararı gibi görünen bir hatadır.
|
|
72
63
|
*/
|
|
73
64
|
loadingRows?: number;
|
|
74
65
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"primitives.d.ts","sourceRoot":"","sources":["../../src/components/primitives.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAWtC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAQvC,wBAAgB,SAAS,CAAC,EAAE,QAAgB,EAAE,EAAE;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,+BAErE;AAED,yFAAyF;AACzF,wBAAgB,MAAM,CAAC,EACrB,IAAW,EACX,KAAK,EACL,QAAa,GACd,EAAE;IACD,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B,+BAQA;AAED,wBAAgB,KAAK,CAAC,EACpB,KAAiB,EACjB,KAAK,EACL,QAAQ,EACR,MAAM,GACP,EAAE;IACD,KAAK,CAAC,EAAE,IAAI,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B,+BAoBA;AAED,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,KAAK,GACN,EAAE;IACD,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC1C;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;CACf,+BA0BA;AAED,wBAAgB,KAAK,CAAC,EACpB,KAAK,EACL,WAAW,EACX,KAAK,EACL,QAAQ,EACR,OAAO,GACR,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,+BAgBA;AAED,kFAAkF;AAClF,wBAAgB,MAAM,CAAC,EACrB,OAAO,EACP,KAAK,EACL,QAAQ,EACR,WAAW,EACX,OAAe,EACf,WAAe,EACf,YAAY,EAAE,SAAS,EACvB,SAAS,GACV,EAAE;IACD,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB
|
|
1
|
+
{"version":3,"file":"primitives.d.ts","sourceRoot":"","sources":["../../src/components/primitives.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAWtC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAQvC,wBAAgB,SAAS,CAAC,EAAE,QAAgB,EAAE,EAAE;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,+BAErE;AAED,yFAAyF;AACzF,wBAAgB,MAAM,CAAC,EACrB,IAAW,EACX,KAAK,EACL,QAAa,GACd,EAAE;IACD,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,QA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AW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;;;;;;;;;;OAcG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;6DACyD;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,+BA0EA;AAED,2EAA2E;AAC3E,wBAAgB,KAAK,CAAC,EACpB,IAAI,EACJ,OAAO,EACP,KAAK,EACL,QAAQ,EACR,MAAM,EACN,OAAe,EACf,UAAU,EACV,IAAY,GACb,EAAE;IACD,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB;;;;;;;;;;;;OAYG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;IACvB;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,sCAoDA"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
1
|
+
import type { ComponentType, ReactNode } from "react";
|
|
2
2
|
/**
|
|
3
3
|
* Kendi dosyasında, çünkü YENİ BİR KONTROL.
|
|
4
4
|
*
|
|
5
5
|
* Gerekçe: docs/gerekce/05-yuzey-ve-kabuk.md
|
|
6
6
|
*/
|
|
7
7
|
/** İkon raylı gezinme öğesi. */
|
|
8
|
-
export declare function RailLink({ label, active, href, onClick, className, children, showLabel, }: {
|
|
8
|
+
export declare function RailLink({ label, active, href, onClick, className, children, showLabel, linkComponent: Link, ...rest }: {
|
|
9
9
|
label: string;
|
|
10
10
|
active?: boolean;
|
|
11
11
|
href?: string;
|
|
@@ -20,5 +20,25 @@ export declare function RailLink({ label, active, href, onClick, className, chil
|
|
|
20
20
|
* çubuğunda `true`.
|
|
21
21
|
*/
|
|
22
22
|
showLabel?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* The router's link, so the rail does not force a full page load. Without it this component
|
|
25
|
+
* can only draw a plain `<a>`, and a shell that needs client routing ends up writing its own
|
|
26
|
+
* rail link instead of using this one. TR: Yönlendiricinin bağlantısı, ray tam sayfa
|
|
27
|
+
* yüklemeye zorlamasın diye. Olmadığında bu bileşen yalnız düz bir `<a>` çizebiliyor, ve
|
|
28
|
+
* istemci yönlendirmesi isteyen bir kabuk bunu kullanmak yerine kendi ray bağlantısını
|
|
29
|
+
* yazıyor.
|
|
30
|
+
*/
|
|
31
|
+
linkComponent?: ComponentType<{
|
|
32
|
+
href: string;
|
|
33
|
+
children?: ReactNode;
|
|
34
|
+
[k: string]: unknown;
|
|
35
|
+
}>;
|
|
36
|
+
/**
|
|
37
|
+
* Anything else lands on the control: a `data-*` hook a test or a style needs. TR: Geri kalan
|
|
38
|
+
* her şey kontrolün üstüne iniyor: bir testin ya da stilin ihtiyaç duyduğu `data-*` kancası.
|
|
39
|
+
*
|
|
40
|
+
* SİLME: bu yayma olmadan `AppShell`in geçtiği `data-nav` sessizce düşüyor.
|
|
41
|
+
*/
|
|
42
|
+
[k: string]: unknown;
|
|
23
43
|
}): import("react").JSX.Element;
|
|
24
44
|
//# sourceMappingURL=rail-link.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rail-link.d.ts","sourceRoot":"","sources":["../../src/components/rail-link.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"rail-link.d.ts","sourceRoot":"","sources":["../../src/components/rail-link.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAItD;;;;GAIG;AAEH,gCAAgC;AAChC,wBAAgB,QAAQ,CAAC,EACvB,KAAK,EACL,MAAc,EACd,IAAI,EACJ,OAAO,EACP,SAAS,EACT,QAAQ,EACR,SAAiB,EACjB,aAAa,EAAE,IAAI,EACnB,GAAG,IAAI,EACR,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0BAA0B;IAC1B,QAAQ,EAAE,SAAS,CAAC;IACpB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;;;;OAOG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;QAAC,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC,CAAC;IAC5F;;;;;OAKG;IACH,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CACtB,+BA4CA"}
|
|
@@ -1,24 +1,27 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { cn } from "../lib/cn.js";
|
|
4
|
+
import { Tooltip } from "./overlay.js";
|
|
4
5
|
/**
|
|
5
6
|
* Kendi dosyasında, çünkü YENİ BİR KONTROL.
|
|
6
7
|
*
|
|
7
8
|
* Gerekçe: docs/gerekce/05-yuzey-ve-kabuk.md
|
|
8
9
|
*/
|
|
9
10
|
/** İkon raylı gezinme öğesi. */
|
|
10
|
-
export function RailLink({ label, active = false, href, onClick, className, children, showLabel = false, }) {
|
|
11
|
+
export function RailLink({ label, active = false, href, onClick, className, children, showLabel = false, linkComponent: Link, ...rest }) {
|
|
11
12
|
const shared = {
|
|
13
|
+
...rest,
|
|
12
14
|
className: cn("tamga-rail-link", showLabel && "tamga-rail-link-wide", className),
|
|
13
15
|
"data-active": active,
|
|
14
16
|
"aria-label": label,
|
|
15
|
-
/* Etiket görünürken `title` yoktur: görünen bir metnin üstünde beliren
|
|
16
|
-
ipucu aynı şeyi ikinci kez söyler ve imleci geciktirir. */
|
|
17
|
-
title: showLabel ? undefined : label,
|
|
18
17
|
"aria-current": active ? "page" : undefined,
|
|
19
18
|
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
const govde = (_jsxs(_Fragment, { children: [children, showLabel && _jsx("span", { className: "min-w-0 truncate", children: label })] }));
|
|
20
|
+
const kontrol = href ? (Link ? (_jsx(Link, { href: href, ...shared, children: govde })) : (_jsx("a", { href: href, ...shared, children: govde }))) : (_jsx("button", { type: "button", onClick: onClick, ...shared, children: govde }));
|
|
21
|
+
/* İPUCU BİLEŞENİN KENDİ İŞİ, ÇAĞIRANIN DEĞİL.
|
|
22
|
+
Burada `title={label}` vardı: tarayıcının gecikmeli gri balonu, kitin her
|
|
23
|
+
yerdeki ipucundan başka türlü görünüyor. Çağıranlar bu yüzden bir de elle
|
|
24
|
+
`Tooltip` sarıyordu ve ikisi üst üste biniyordu. Etiket görünürken ipucu
|
|
25
|
+
yok: görünen bir metnin üstünde beliren ipucu aynı şeyi ikinci kez söyler. */
|
|
26
|
+
return showLabel ? (kontrol) : (_jsx(Tooltip, { label: label, placement: "right", children: kontrol }));
|
|
24
27
|
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LOGODAN AMBLEM SEÇME — otomatik kesme DEĞİL.
|
|
3
|
+
*
|
|
4
|
+
* Sorulan soru şuydu: yüklenen logoyu ayırıp amblemi kendiliğinden çıkaramaz
|
|
5
|
+
* mıyız? Çıkaramayız, ve denememesi gerekiyor:
|
|
6
|
+
*
|
|
7
|
+
* · Dosyada "amblem" diye işaretli bir şey yok. SVG'de bazen bir grup id'si
|
|
8
|
+
* olur ama bu tasarımcının keyfine bağlı; PNG'de hiç yok.
|
|
9
|
+
* · Konum sabit değil: amblem solda, üstte, sağda olabilir, yazının içine
|
|
10
|
+
* gömülü olabilir, ya da hiç olmayabilir (yalnız kelime-logo).
|
|
11
|
+
* · Hata SESSİZ ve KALICI olur. Yanlış kesim patlamaz; yarım bir harf
|
|
12
|
+
* panelin her sayfasının sol üstünde durur ve kimse bunun otomatik
|
|
13
|
+
* kesildiğini bilmez.
|
|
14
|
+
*
|
|
15
|
+
* Bu yüzden kesimi İNSAN yapıyor: kare bir çerçeve, sürüklenip boyutlanıyor.
|
|
16
|
+
* Sonuç tahmin değil karar.
|
|
17
|
+
*
|
|
18
|
+
* ÇERÇEVE ORANLA TUTULUYOR (0–1), piksel ile değil: önizleme ekrandan ekrana
|
|
19
|
+
* farklı ölçekte çiziliyor, oran her ölçekte aynı yeri gösteriyor. Ekrana
|
|
20
|
+
* çizilirken piksele dönüyor ve dönüşüm TEK YERDE (`kenarPx`): kesim
|
|
21
|
+
* matematiği ile çerçevenin CSS'i ayrı ayrı hesaplansaydı, kullanıcının
|
|
22
|
+
* gördüğü kare ile kesilen kare farklı olurdu — ve fark sessiz olurdu.
|
|
23
|
+
*/
|
|
24
|
+
export declare function SquarePicker({ open, source, onClose, onPick, maxEdge, labels, }: {
|
|
25
|
+
open: boolean;
|
|
26
|
+
/** The image the square is cut out of. TR: Üzerinden kesilecek görsel. */
|
|
27
|
+
source: string;
|
|
28
|
+
onClose: () => void;
|
|
29
|
+
onPick: (square: string) => void;
|
|
30
|
+
/** Edge of the produced square, in pixels. TR: Üretilen karenin kenarı, piksel. */
|
|
31
|
+
maxEdge?: number;
|
|
32
|
+
labels: {
|
|
33
|
+
title: string;
|
|
34
|
+
hint: string;
|
|
35
|
+
size: string;
|
|
36
|
+
cancel: string;
|
|
37
|
+
confirm: string;
|
|
38
|
+
close: string;
|
|
39
|
+
};
|
|
40
|
+
}): import("react").JSX.Element;
|
|
41
|
+
//# sourceMappingURL=square-picker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"square-picker.d.ts","sourceRoot":"","sources":["../../src/components/square-picker.tsx"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,YAAY,CAAC,EAC3B,IAAI,EACJ,MAAM,EACN,OAAO,EACP,MAAM,EACN,OAAa,EACb,MAAM,GACP,EAAE;IACD,IAAI,EAAE,OAAO,CAAC;IACd,0EAA0E;IAC1E,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,mFAAmF;IACnF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE;QACN,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,EAAE,MAAM,CAAC;QAChB,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;CACH,+BAmHA"}
|