tamga-ui 0.1.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/LICENSE +21 -0
- package/README.md +172 -0
- package/dist/blocks/count-row.d.ts +29 -0
- package/dist/blocks/count-row.d.ts.map +1 -0
- package/dist/blocks/count-row.js +19 -0
- package/dist/blocks/filter-bar.d.ts +123 -0
- package/dist/blocks/filter-bar.d.ts.map +1 -0
- package/dist/blocks/filter-bar.js +74 -0
- package/dist/blocks/index.d.ts +24 -0
- package/dist/blocks/index.d.ts.map +1 -0
- package/dist/blocks/index.js +23 -0
- package/dist/blocks/save-bar.d.ts +31 -0
- package/dist/blocks/save-bar.d.ts.map +1 -0
- package/dist/blocks/save-bar.js +21 -0
- package/dist/components/a11y.d.ts +21 -0
- package/dist/components/a11y.d.ts.map +1 -0
- package/dist/components/a11y.js +159 -0
- package/dist/components/advanced-input.d.ts +115 -0
- package/dist/components/advanced-input.d.ts.map +1 -0
- package/dist/components/advanced-input.js +189 -0
- package/dist/components/avatar.d.ts +63 -0
- package/dist/components/avatar.d.ts.map +1 -0
- package/dist/components/avatar.js +54 -0
- package/dist/components/badge.d.ts +37 -0
- package/dist/components/badge.d.ts.map +1 -0
- package/dist/components/badge.js +29 -0
- package/dist/components/bar.d.ts +32 -0
- package/dist/components/bar.d.ts.map +1 -0
- package/dist/components/bar.js +33 -0
- package/dist/components/button.d.ts +45 -0
- package/dist/components/button.d.ts.map +1 -0
- package/dist/components/button.js +56 -0
- package/dist/components/chart.d.ts +43 -0
- package/dist/components/chart.d.ts.map +1 -0
- package/dist/components/chart.js +41 -0
- package/dist/components/checkbox.d.ts +13 -0
- package/dist/components/checkbox.d.ts.map +1 -0
- package/dist/components/checkbox.js +16 -0
- package/dist/components/chrome.d.ts +87 -0
- package/dist/components/chrome.d.ts.map +1 -0
- package/dist/components/chrome.js +107 -0
- package/dist/components/combobox.d.ts +31 -0
- package/dist/components/combobox.d.ts.map +1 -0
- package/dist/components/combobox.js +62 -0
- package/dist/components/control-base.d.ts +7 -0
- package/dist/components/control-base.d.ts.map +1 -0
- package/dist/components/control-base.js +6 -0
- package/dist/components/data-table.d.ts +68 -0
- package/dist/components/data-table.d.ts.map +1 -0
- package/dist/components/data-table.js +50 -0
- package/dist/components/date-picker.d.ts +52 -0
- package/dist/components/date-picker.d.ts.map +1 -0
- package/dist/components/date-picker.js +73 -0
- package/dist/components/disclosure.d.ts +31 -0
- package/dist/components/disclosure.d.ts.map +1 -0
- package/dist/components/disclosure.js +32 -0
- package/dist/components/display.d.ts +188 -0
- package/dist/components/display.d.ts.map +1 -0
- package/dist/components/display.js +190 -0
- package/dist/components/empty-state.d.ts +150 -0
- package/dist/components/empty-state.d.ts.map +1 -0
- package/dist/components/empty-state.js +113 -0
- package/dist/components/error-state.d.ts +38 -0
- package/dist/components/error-state.d.ts.map +1 -0
- package/dist/components/error-state.js +16 -0
- package/dist/components/file-upload.d.ts +34 -0
- package/dist/components/file-upload.d.ts.map +1 -0
- package/dist/components/file-upload.js +34 -0
- package/dist/components/gauge.d.ts +47 -0
- package/dist/components/gauge.d.ts.map +1 -0
- package/dist/components/gauge.js +65 -0
- package/dist/components/icon.d.ts +32 -0
- package/dist/components/icon.d.ts.map +1 -0
- package/dist/components/icon.js +20 -0
- package/dist/components/icons.d.ts +19 -0
- package/dist/components/icons.d.ts.map +1 -0
- package/dist/components/icons.js +39 -0
- package/dist/components/input.d.ts +35 -0
- package/dist/components/input.d.ts.map +1 -0
- package/dist/components/input.js +41 -0
- package/dist/components/layout.d.ts +133 -0
- package/dist/components/layout.d.ts.map +1 -0
- package/dist/components/layout.js +132 -0
- package/dist/components/link.d.ts +22 -0
- package/dist/components/link.d.ts.map +1 -0
- package/dist/components/link.js +2 -0
- package/dist/components/live-scope.d.ts +15 -0
- package/dist/components/live-scope.d.ts.map +1 -0
- package/dist/components/live-scope.js +67 -0
- package/dist/components/log-view.d.ts +34 -0
- package/dist/components/log-view.d.ts.map +1 -0
- package/dist/components/log-view.js +30 -0
- package/dist/components/number-input.d.ts +26 -0
- package/dist/components/number-input.d.ts.map +1 -0
- package/dist/components/number-input.js +57 -0
- package/dist/components/overlay.d.ts +257 -0
- package/dist/components/overlay.d.ts.map +1 -0
- package/dist/components/overlay.js +276 -0
- package/dist/components/pagination.d.ts +38 -0
- package/dist/components/pagination.d.ts.map +1 -0
- package/dist/components/pagination.js +46 -0
- package/dist/components/pie.d.ts +40 -0
- package/dist/components/pie.d.ts.map +1 -0
- package/dist/components/pie.js +74 -0
- package/dist/components/primitives.d.ts +96 -0
- package/dist/components/primitives.d.ts.map +1 -0
- package/dist/components/primitives.js +81 -0
- package/dist/components/progress.d.ts +29 -0
- package/dist/components/progress.d.ts.map +1 -0
- package/dist/components/progress.js +16 -0
- package/dist/components/radio-group.d.ts +17 -0
- package/dist/components/radio-group.d.ts.map +1 -0
- package/dist/components/radio-group.js +23 -0
- package/dist/components/rail-link.d.ts +24 -0
- package/dist/components/rail-link.d.ts.map +1 -0
- package/dist/components/rail-link.js +24 -0
- package/dist/components/rich-text.d.ts +51 -0
- package/dist/components/rich-text.d.ts.map +1 -0
- package/dist/components/rich-text.js +147 -0
- package/dist/components/section.d.ts +15 -0
- package/dist/components/section.d.ts.map +1 -0
- package/dist/components/section.js +8 -0
- package/dist/components/segmented.d.ts +13 -0
- package/dist/components/segmented.d.ts.map +1 -0
- package/dist/components/segmented.js +12 -0
- package/dist/components/skeleton.d.ts +69 -0
- package/dist/components/skeleton.d.ts.map +1 -0
- package/dist/components/skeleton.js +67 -0
- package/dist/components/slider.d.ts +18 -0
- package/dist/components/slider.d.ts.map +1 -0
- package/dist/components/slider.js +15 -0
- package/dist/components/sparkline.d.ts +17 -0
- package/dist/components/sparkline.d.ts.map +1 -0
- package/dist/components/sparkline.js +19 -0
- package/dist/components/spinner.d.ts +15 -0
- package/dist/components/spinner.d.ts.map +1 -0
- package/dist/components/spinner.js +22 -0
- package/dist/components/stacked-bar.d.ts +21 -0
- package/dist/components/stacked-bar.d.ts.map +1 -0
- package/dist/components/stacked-bar.js +41 -0
- package/dist/components/surface.d.ts +76 -0
- package/dist/components/surface.d.ts.map +1 -0
- package/dist/components/surface.js +49 -0
- package/dist/components/switch.d.ts +12 -0
- package/dist/components/switch.d.ts.map +1 -0
- package/dist/components/switch.js +13 -0
- package/dist/components/tabs.d.ts +47 -0
- package/dist/components/tabs.d.ts.map +1 -0
- package/dist/components/tabs.js +12 -0
- package/dist/components/timeline-strip.d.ts +19 -0
- package/dist/components/timeline-strip.d.ts.map +1 -0
- package/dist/components/timeline-strip.js +14 -0
- package/dist/components/tone.d.ts +58 -0
- package/dist/components/tone.d.ts.map +1 -0
- package/dist/components/tone.js +70 -0
- package/dist/components/tree-select.d.ts +26 -0
- package/dist/components/tree-select.d.ts.map +1 -0
- package/dist/components/tree-select.js +59 -0
- package/dist/index.d.ts +54 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +70 -0
- package/dist/kit.css +2248 -0
- package/dist/lib/cn.d.ts +10 -0
- package/dist/lib/cn.d.ts.map +1 -0
- package/dist/lib/cn.js +12 -0
- package/dist/lib/color.d.ts +68 -0
- package/dist/lib/color.d.ts.map +1 -0
- package/dist/lib/color.js +134 -0
- package/dist/lib/palette.d.ts +84 -0
- package/dist/lib/palette.d.ts.map +1 -0
- package/dist/lib/palette.js +193 -0
- package/dist/lib/scroll-lock.d.ts +19 -0
- package/dist/lib/scroll-lock.d.ts.map +1 -0
- package/dist/lib/scroll-lock.js +33 -0
- package/dist/patterns/app-shell.d.ts +36 -0
- package/dist/patterns/app-shell.d.ts.map +1 -0
- package/dist/patterns/app-shell.js +14 -0
- package/dist/patterns/auth-template.d.ts +36 -0
- package/dist/patterns/auth-template.d.ts.map +1 -0
- package/dist/patterns/auth-template.js +40 -0
- package/dist/patterns/detail-template.d.ts +52 -0
- package/dist/patterns/detail-template.d.ts.map +1 -0
- package/dist/patterns/detail-template.js +11 -0
- package/dist/patterns/index.d.ts +18 -0
- package/dist/patterns/index.d.ts.map +1 -0
- package/dist/patterns/index.js +17 -0
- package/dist/patterns/list-template.d.ts +32 -0
- package/dist/patterns/list-template.d.ts.map +1 -0
- package/dist/patterns/list-template.js +8 -0
- package/dist/patterns/overview-template.d.ts +26 -0
- package/dist/patterns/overview-template.d.ts.map +1 -0
- package/dist/patterns/overview-template.js +8 -0
- package/dist/patterns/public-template.d.ts +28 -0
- package/dist/patterns/public-template.d.ts.map +1 -0
- package/dist/patterns/public-template.js +7 -0
- package/dist/patterns/settings-template.d.ts +50 -0
- package/dist/patterns/settings-template.d.ts.map +1 -0
- package/dist/patterns/settings-template.js +33 -0
- package/dist/patterns/shared.d.ts +40 -0
- package/dist/patterns/shared.d.ts.map +1 -0
- package/dist/patterns/shared.js +29 -0
- package/dist/patterns/wizard-template.d.ts +28 -0
- package/dist/patterns/wizard-template.d.ts.map +1 -0
- package/dist/patterns/wizard-template.js +15 -0
- package/dist/styles.css +5 -0
- package/dist/theme.css +812 -0
- package/package.json +87 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Skeletons.
|
|
4
|
+
*
|
|
5
|
+
* Gerekçe: docs/gerekce/04-bos-ve-hata.md
|
|
6
|
+
*/
|
|
7
|
+
const STEP = 70;
|
|
8
|
+
const MAX_STEPS = 6;
|
|
9
|
+
function delay(i = 0) {
|
|
10
|
+
return { ["--tamga-delay"]: `${(i % MAX_STEPS) * STEP}ms` };
|
|
11
|
+
}
|
|
12
|
+
export function Skeleton({ className = "", index = 0, style, }) {
|
|
13
|
+
return (_jsx("span", { className: `tamga-skeleton block ${className}`, style: { ...delay(index), ...style } }));
|
|
14
|
+
}
|
|
15
|
+
/** Paragraph copy. The last line is always short — real text ends mid-line. */
|
|
16
|
+
export function SkeletonText({ lines = 3, className = "", }) {
|
|
17
|
+
const widths = ["100%", "96%", "92%", "98%"];
|
|
18
|
+
return (_jsx("span", { className: `flex flex-col gap-2 ${className}`, children: Array.from({ length: lines }, (_, i) => (_jsx(Skeleton, { index: i, className: "h-3", style: { width: i === lines - 1 ? "62%" : widths[i % widths.length] } }, i))) }));
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A list row. Mirrors `.tamga-list-row` exactly, including the 56px height, so the
|
|
22
|
+
* skeleton list and the real list are the same object with the text removed.
|
|
23
|
+
*/
|
|
24
|
+
export function SkeletonRows({ rows = 5, dense = false, }) {
|
|
25
|
+
return (_jsx(_Fragment, { children: Array.from({ length: rows }, (_, i) => (_jsxs("div", { className: `tamga-list-row ${dense ? "tamga-list-row-sm" : ""}`, "aria-hidden": true, children: [_jsx(Skeleton, { index: i, className: "size-2.5 shrink-0" }), _jsx(Skeleton, { index: i, className: "h-3 w-40 shrink-0" }), _jsx(Skeleton, { index: i, className: "h-3 min-w-0 flex-1 max-w-28" }), _jsx(Skeleton, { index: i, className: "ml-auto h-3 w-14 shrink-0" })] }, i))) }));
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The KPI tile: icon tile, label, big number.
|
|
29
|
+
*
|
|
30
|
+
* TR: İSKELET KARONUN KENDİSİYLE AYNI KALIPTA. `Kpi` ikon karosu alınca bu
|
|
31
|
+
* iskelet eski hâlinde kaldıysa yükleme bittiğinde içerik yana zıplıyor, ve
|
|
32
|
+
* bir iskeletin tek işi o zıplamayı önlemek. Bu yüzden ikisi aynı sınıfı
|
|
33
|
+
* (`tamga-kpi`) paylaşıyor: kalıp bir yerde değişince ikisi birden değişiyor.
|
|
34
|
+
*/
|
|
35
|
+
export function SkeletonKpi({ index = 0 }) {
|
|
36
|
+
return (_jsxs("section", { className: "tamga-kpi", "aria-hidden": true, children: [_jsx(Skeleton, { index: index, className: "size-10 shrink-0" }), _jsxs("div", { className: "flex min-w-0 flex-1 flex-col", children: [_jsx(Skeleton, { index: index + 1, className: "h-2.5 w-20" }), _jsx(Skeleton, { index: index + 2, className: "mt-2 h-7 w-24" })] })] }));
|
|
37
|
+
}
|
|
38
|
+
/** A card with a section head and a body area of a given height. */
|
|
39
|
+
export function SkeletonCard({ height = 220, title = true, }) {
|
|
40
|
+
return (_jsxs("section", { className: "tamga-card flex min-w-0 flex-col", "aria-hidden": true, children: [title ? (_jsxs("div", { className: "tamga-head tamga-section tamga-gutter flex flex-nowrap items-center gap-3", children: [_jsx(Skeleton, { className: "h-3.5 w-32 shrink-0" }), _jsx(Skeleton, { index: 1, className: "h-2.5 min-w-0 flex-1 max-w-20" }), _jsx(Skeleton, { index: 2, className: "ml-auto h-6 w-20 shrink-0" })] })) : null, _jsx("div", { className: "tamga-gutter flex-1 py-5", children: _jsx(Skeleton, { index: 3, className: "w-full", style: { height } }) })] }));
|
|
41
|
+
}
|
|
42
|
+
/** A table: header rule plus n body rows across the given column widths. */
|
|
43
|
+
export function SkeletonTable({ rows = 6, cols = ["12rem", "5rem", "6rem", "4rem", "5rem"], }) {
|
|
44
|
+
return (_jsxs("div", { className: "tamga-card overflow-hidden", "aria-hidden": true, children: [_jsx("div", { className: "tamga-head tamga-section tamga-gutter flex flex-nowrap items-center gap-6", children: cols.map((w, i) => (_jsx(Skeleton, { index: i, className: "h-2.5 min-w-0 flex-1", style: { maxWidth: w } }, i))) }), Array.from({ length: rows }, (_, r) => (_jsx("div", { className: "tamga-list-row flex flex-nowrap items-center gap-6", children: cols.map((w, i) => (_jsx(Skeleton, { index: r + i, className: "h-3 min-w-0 flex-1", style: { maxWidth: w } }, i))) }, r)))] }));
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Panel contents.
|
|
48
|
+
*
|
|
49
|
+
* A panel that opens before its data arrives is the one place a spinner is most
|
|
50
|
+
* tempting and most wrong: the panel already has a known width and a known row
|
|
51
|
+
* height, so there is a real shape to hold. A spinner throws that away and then
|
|
52
|
+
* makes the whole panel jump when the rows land.
|
|
53
|
+
*
|
|
54
|
+
* Matches `.tamga-option` — 40px tall, 16px side padding, icon slot then label.
|
|
55
|
+
*/
|
|
56
|
+
export function SkeletonOptions({ rows = 4 }) {
|
|
57
|
+
const widths = ["68%", "84%", "56%", "76%", "64%"];
|
|
58
|
+
return (_jsx("div", { className: "py-1", "aria-hidden": true, children: Array.from({ length: rows }, (_, i) => (_jsxs("div", { className: "flex h-10 items-center gap-2 px-4", children: [_jsx(Skeleton, { index: i, className: "size-4 shrink-0" }), _jsx(Skeleton, { index: i, className: "h-3 min-w-0 flex-1", style: { maxWidth: widths[i % widths.length] } })] }, i))) }));
|
|
59
|
+
}
|
|
60
|
+
/** Free-form panel body — popover, dialog, sheet. */
|
|
61
|
+
export function SkeletonPanel({ lines = 3, block, }) {
|
|
62
|
+
return (_jsxs("div", { className: "flex flex-col gap-3", "aria-hidden": true, children: [block ? _jsx(Skeleton, { className: "w-full", style: { height: block } }) : null, _jsx(SkeletonText, { lines: lines })] }));
|
|
63
|
+
}
|
|
64
|
+
/** Page band: title, subtitle, and the actions that sit on the right. */
|
|
65
|
+
export function SkeletonPageBand() {
|
|
66
|
+
return (_jsxs("div", { className: "tamga-section tamga-gutter flex flex-wrap items-center gap-4 py-4", "aria-hidden": true, children: [_jsxs("div", { className: "min-w-0", children: [_jsx(Skeleton, { className: "h-4 w-40" }), _jsx(Skeleton, { index: 1, className: "mt-2 h-2.5 w-64" })] }), _jsxs("div", { className: "ml-auto flex items-center gap-2", children: [_jsx(Skeleton, { index: 2, className: "h-10 w-32" }), _jsx(Skeleton, { index: 3, className: "h-10 w-36" })] })] }));
|
|
67
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Kendi dosyasında, çünkü YENİ BİR KONTROL.
|
|
3
|
+
*
|
|
4
|
+
* Gerekçe: docs/gerekce/01-form-ve-girdi.md
|
|
5
|
+
*/
|
|
6
|
+
/** Kaydırıcı. */
|
|
7
|
+
export declare function Slider({ value, onChange, min, max, step, label, suffix, className, }: {
|
|
8
|
+
value: number;
|
|
9
|
+
onChange: (next: number) => void;
|
|
10
|
+
min?: number;
|
|
11
|
+
max?: number;
|
|
12
|
+
step?: number;
|
|
13
|
+
label: string;
|
|
14
|
+
/** The unit beside the value: "%", "ms", "₺". TR: Değerin yanındaki birim: "%", "ms", "₺". */
|
|
15
|
+
suffix?: string;
|
|
16
|
+
className?: string;
|
|
17
|
+
}): import("react").JSX.Element;
|
|
18
|
+
//# sourceMappingURL=slider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slider.d.ts","sourceRoot":"","sources":["../../src/components/slider.tsx"],"names":[],"mappings":"AAIA;;;;GAIG;AAEH,iBAAiB;AACjB,wBAAgB,MAAM,CAAC,EACrB,KAAK,EACL,QAAQ,EACR,GAAO,EACP,GAAS,EACT,IAAQ,EACR,KAAK,EACL,MAAM,EACN,SAAS,GACV,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,8FAA8F;IAC9F,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,+BAuBA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "../lib/cn.js";
|
|
4
|
+
/**
|
|
5
|
+
* Kendi dosyasında, çünkü YENİ BİR KONTROL.
|
|
6
|
+
*
|
|
7
|
+
* Gerekçe: docs/gerekce/01-form-ve-girdi.md
|
|
8
|
+
*/
|
|
9
|
+
/** Kaydırıcı. */
|
|
10
|
+
export function Slider({ value, onChange, min = 0, max = 100, step = 1, label, suffix, className, }) {
|
|
11
|
+
const pct = ((value - min) / (max - min)) * 100;
|
|
12
|
+
return (_jsxs("span", { className: cn("flex items-center gap-4", className), children: [_jsx("input", { type: "range", value: value, min: min, max: max, step: step, "aria-label": label, onChange: (e) => onChange(Number(e.target.value)), className: "tamga-slider h-1.5 flex-1 cursor-pointer appearance-none rounded-full", style: {
|
|
13
|
+
background: `linear-gradient(to right, var(--color-accent-line) ${pct}%, var(--color-edge) ${pct}%)`,
|
|
14
|
+
} }), _jsxs("span", { className: "w-16 shrink-0 text-right font-mono text-body text-ink tabular-nums", children: [value, suffix] })] }));
|
|
15
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type Tone } from "./tone.js";
|
|
2
|
+
/**
|
|
3
|
+
* Sparkline — satır içi, eksensiz mini grafik.
|
|
4
|
+
*
|
|
5
|
+
* Gerekçe: docs/gerekce/03-grafik-ve-olcum.md
|
|
6
|
+
*/
|
|
7
|
+
export declare function Sparkline({ values, tone, width, height, }: {
|
|
8
|
+
values: number[];
|
|
9
|
+
/**
|
|
10
|
+
* Colour's job here is to report a status. A neutral line takes ink-faint. TR: Rengin işi
|
|
11
|
+
* durum bildirmek. Nötr olan çizgi rengini ink-faint alır.
|
|
12
|
+
*/
|
|
13
|
+
tone?: Tone;
|
|
14
|
+
width?: number;
|
|
15
|
+
height?: number;
|
|
16
|
+
}): import("react").JSX.Element;
|
|
17
|
+
//# sourceMappingURL=sparkline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sparkline.d.ts","sourceRoot":"","sources":["../../src/components/sparkline.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,IAAI,EAAE,MAAM,WAAW,CAAC;AAEvD;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,EACxB,MAAM,EACN,IAAgB,EAChB,KAAW,EACX,MAAW,GACZ,EAAE;IACD,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB;;;OAGG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,+BAiCA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { neutral, toneOf } from "./tone.js";
|
|
3
|
+
/**
|
|
4
|
+
* Sparkline — satır içi, eksensiz mini grafik.
|
|
5
|
+
*
|
|
6
|
+
* Gerekçe: docs/gerekce/03-grafik-ve-olcum.md
|
|
7
|
+
*/
|
|
8
|
+
export function Sparkline({ values, tone = "neutral", width = 108, height = 30, }) {
|
|
9
|
+
const min = Math.min(...values);
|
|
10
|
+
const max = Math.max(...values);
|
|
11
|
+
const span = max - min || 1;
|
|
12
|
+
const step = width / (values.length - 1);
|
|
13
|
+
const y = (v) => height - 2 - ((v - min) / span) * (height - 4);
|
|
14
|
+
const line = values.map((v, i) => `${i === 0 ? "M" : "L"}${i * step},${y(v)}`).join(" ");
|
|
15
|
+
const area = `${line} L${width},${height} L0,${height} Z`;
|
|
16
|
+
const t = toneOf(tone);
|
|
17
|
+
const stroke = tone === "neutral" || tone === "positive" ? neutral.muted : t.mark;
|
|
18
|
+
return (_jsxs("svg", { className: "w-full", height: height, viewBox: `0 0 ${width} ${height}`, preserveAspectRatio: "none", "aria-hidden": true, shapeRendering: "crispEdges", children: [_jsx("path", { d: area, style: { fill: t.bg } }), _jsx("path", { d: line, fill: "none", style: { stroke }, strokeWidth: "1.5", shapeRendering: "geometricPrecision" }), _jsx("rect", { x: width - 2.5, y: y(values[values.length - 1] ?? 0) - 2.5, width: "5", height: "5", style: { fill: stroke } }), _jsx("line", { x1: "0", y1: height, x2: width, y2: height, style: { stroke: neutral.line }, strokeWidth: "1" })] }));
|
|
19
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bars — three uprights marching, echoing the stems in the wordmark and
|
|
3
|
+
* reading as a level meter, which is what this product measures.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* The accessible name is a REQUIRED prop, not a default (docs/08 rule 5 — primitives receive
|
|
7
|
+
* translated strings, they never fetch translations themselves). A default of "Close" is the
|
|
8
|
+
* worst of both worlds: it satisfies the compiler and ships English into every other language,
|
|
9
|
+
* silently, because nobody sees an aria-label until they are already using a screen reader.
|
|
10
|
+
*/
|
|
11
|
+
export declare function Spinner({ size, label }: {
|
|
12
|
+
size?: number;
|
|
13
|
+
label: string;
|
|
14
|
+
}): import("react").JSX.Element;
|
|
15
|
+
//# sourceMappingURL=spinner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../src/components/spinner.tsx"],"names":[],"mappings":"AAEA;;;GAGG;AACH;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,EAAE,IAAS,EAAE,KAAK,EAAE,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,+BAwB7E"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
/**
|
|
4
|
+
* Bars — three uprights marching, echoing the stems in the wordmark and
|
|
5
|
+
* reading as a level meter, which is what this product measures.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* The accessible name is a REQUIRED prop, not a default (docs/08 rule 5 — primitives receive
|
|
9
|
+
* translated strings, they never fetch translations themselves). A default of "Close" is the
|
|
10
|
+
* worst of both worlds: it satisfies the compiler and ships English into every other language,
|
|
11
|
+
* silently, because nobody sees an aria-label until they are already using a screen reader.
|
|
12
|
+
*/
|
|
13
|
+
export function Spinner({ size = 16, label }) {
|
|
14
|
+
const w = Math.max(2.5, size * 0.22);
|
|
15
|
+
return (_jsx("span", { role: "status", "aria-label": label, className: "inline-flex items-end justify-between", style: { width: size, height: size }, children: [0, 1, 2].map((i) => (_jsx("span", { className: "tamga-spin-part", style: {
|
|
16
|
+
width: w,
|
|
17
|
+
height: "100%",
|
|
18
|
+
transformOrigin: "bottom",
|
|
19
|
+
background: "currentColor",
|
|
20
|
+
animation: `tamga-bar var(--duration-bar) var(--ease-breath) ${i * 140}ms infinite`,
|
|
21
|
+
} }, i))) }));
|
|
22
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Yığılmış sütun grafiği — HER GÜN İÇİN HEM TOPLAM HEM KIRILIM.
|
|
3
|
+
*
|
|
4
|
+
* Gerekçe: docs/gerekce/03-grafik-ve-olcum.md
|
|
5
|
+
*/
|
|
6
|
+
export type StackSeries = {
|
|
7
|
+
name: string;
|
|
8
|
+
values: readonly number[];
|
|
9
|
+
};
|
|
10
|
+
export declare function StackedBarChart({ series, labels, height, formatValue, className, }: {
|
|
11
|
+
series: readonly StackSeries[];
|
|
12
|
+
/**
|
|
13
|
+
* The marks on the X axis; the same length as `series[n].values`. TR: X eksenindeki
|
|
14
|
+
* işaretler; `series[n].values` ile aynı uzunlukta.
|
|
15
|
+
*/
|
|
16
|
+
labels: readonly string[];
|
|
17
|
+
height?: number;
|
|
18
|
+
formatValue?: (v: number) => string;
|
|
19
|
+
className?: string;
|
|
20
|
+
}): import("react").JSX.Element;
|
|
21
|
+
//# sourceMappingURL=stacked-bar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stacked-bar.d.ts","sourceRoot":"","sources":["../../src/components/stacked-bar.tsx"],"names":[],"mappings":"AAKA;;;;GAIG;AAEH,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;CAC3B,CAAC;AASF,wBAAgB,eAAe,CAAC,EAC9B,MAAM,EACN,MAAM,EACN,MAAY,EACZ,WAAoB,EACpB,SAAS,GACV,EAAE;IACD,MAAM,EAAE,SAAS,WAAW,EAAE,CAAC;IAC/B;;;OAGG;IACH,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,+BAkHA"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { cn } from "../lib/cn.js";
|
|
5
|
+
/** Sayıyı ızgara çizgisine yuvarlar: 87 → 100, 412 → 500. */
|
|
6
|
+
function niceMax(v) {
|
|
7
|
+
if (v <= 0)
|
|
8
|
+
return 1;
|
|
9
|
+
const mag = 10 ** Math.floor(Math.log10(v));
|
|
10
|
+
return Math.ceil(v / mag) * mag;
|
|
11
|
+
}
|
|
12
|
+
export function StackedBarChart({ series, labels, height = 260, formatValue = String, className, }) {
|
|
13
|
+
const [uzerinde, setUzerinde] = useState(null);
|
|
14
|
+
const toplamlar = labels.map((_, i) => series.reduce((n, s) => n + (s.values[i] ?? 0), 0));
|
|
15
|
+
const enBuyuk = niceMax(Math.max(0, ...toplamlar));
|
|
16
|
+
/* Dört ızgara çizgisi: daha fazlası okumayı kolaylaştırmıyor, zemini
|
|
17
|
+
kirletiyor. */
|
|
18
|
+
const cizgiler = [0, 0.25, 0.5, 0.75, 1].map((o) => enBuyuk * o);
|
|
19
|
+
return (_jsxs("figure", { className: cn("flex flex-col", className), children: [_jsxs("div", { className: "flex gap-3", style: { height }, children: [_jsx("div", { className: "flex shrink-0 flex-col justify-between py-1 text-right text-micro tabular-nums text-ink-faint", children: [...cizgiler].reverse().map((v) => (_jsx("span", { children: formatValue(v) }, v))) }), _jsxs("div", { className: "relative min-w-0 flex-1", onMouseLeave: () => setUzerinde(null), children: [cizgiler.map((v, i) => (_jsx("span", { "aria-hidden": true, className: "absolute inset-x-0 h-px bg-[var(--color-line)]", style: { bottom: `${(i / (cizgiler.length - 1)) * 100}%` } }, v))), _jsx("div", { className: "absolute inset-0 flex items-end gap-1", children: labels.map((etiket, i) => {
|
|
20
|
+
const toplam = toplamlar[i] ?? 0;
|
|
21
|
+
const secili = uzerinde === i;
|
|
22
|
+
return (_jsxs("div", { className: "flex h-full min-w-0 flex-1 cursor-default flex-col justify-end", onMouseEnter: () => setUzerinde(i), children: [[...series].reverse().map((s, ri) => {
|
|
23
|
+
const si = series.length - 1 - ri;
|
|
24
|
+
const v = s.values[i] ?? 0;
|
|
25
|
+
if (v <= 0)
|
|
26
|
+
return null;
|
|
27
|
+
return (_jsx("span", { className: "w-full transition-opacity duration-(--duration-press)", style: {
|
|
28
|
+
height: `${(v / enBuyuk) * 100}%`,
|
|
29
|
+
background: `var(--color-chart-${(si % 5) + 1})`,
|
|
30
|
+
opacity: uzerinde === null || secili ? 1 : 0.45,
|
|
31
|
+
} }, s.name));
|
|
32
|
+
}), secili && toplam > 0 && (_jsx("span", { className: "pointer-events-none absolute -translate-y-full whitespace-nowrap rounded-(--radius-mark) bg-[var(--color-ink)] px-1.5 py-0.5 text-micro tabular-nums text-[var(--color-page)]", style: { bottom: `${(toplam / enBuyuk) * 100}%` }, children: formatValue(toplam) }))] }, etiket));
|
|
33
|
+
}) })] })] }), _jsx("div", { className: "mt-2 flex gap-1 text-micro tabular-nums text-ink-faint", children: labels.map((e, i) => {
|
|
34
|
+
const aralik = Math.max(1, Math.ceil(labels.length / 12));
|
|
35
|
+
const yaz = i === 0 || i === labels.length - 1 || i % aralik === 0;
|
|
36
|
+
return (_jsx("span", { className: "min-w-0 flex-1 truncate text-center", children: yaz ? e : "" }, e));
|
|
37
|
+
}) }), _jsx("figcaption", { className: "mt-3 flex flex-wrap gap-x-5 gap-y-1", children: series.map((s, i) => {
|
|
38
|
+
const v = uzerinde !== null ? (s.values[uzerinde] ?? 0) : s.values.reduce((a, b) => a + b, 0);
|
|
39
|
+
return (_jsxs("span", { className: "flex items-center gap-2 text-small text-ink-soft", children: [_jsx("span", { "aria-hidden": true, className: "size-2.5 rounded-(--radius-mark)", style: { background: `var(--color-chart-${(i % 5) + 1})` } }), s.name, _jsx("span", { className: "font-mono tabular-nums text-ink", children: formatValue(v) })] }, s.name));
|
|
40
|
+
}) })] }));
|
|
41
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* YÜZEYLER — kart, tablo, sessiz etiket.
|
|
4
|
+
*
|
|
5
|
+
* Gerekçe: docs/gerekce/05-yuzey-ve-kabuk.md
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Kart — kitin tek yükseltilmiş yüzeyi.
|
|
9
|
+
*
|
|
10
|
+
* 1px kenar + 2px sert offset (Yasa 1). İçindeki her şey `Gutter`ın ritmini
|
|
11
|
+
* paylaşır, böylece iki kart yan yana geldiğinde iç boşlukları hizalanır.
|
|
12
|
+
*/
|
|
13
|
+
export declare function Card({ overflow, children, className, }: {
|
|
14
|
+
/**
|
|
15
|
+
* Whether the card's content may spill past its edge. `clip` by default, because the card's
|
|
16
|
+
* rounded corners depend on it: a table inside would run out of the corners without clipping.
|
|
17
|
+
* BUT THE SAME CLIP CUTS EVERY PANEL THAT OPENS INSIDE THE CARD: a Combobox list, a
|
|
18
|
+
* DatePicker calendar, a row menu. The panel works and takes clicks, but half of it is
|
|
19
|
+
* invisible; and because nothing errors, the first suspect is z-index. Z-index does not fix
|
|
20
|
+
* this: no stacking order beats an `overflow` clip. Pass `visible` when a control inside
|
|
21
|
+
* opens something. TR: Kartın içeriği kenarından taşabilir mi. Varsayılan `clip`, çünkü
|
|
22
|
+
* kartın köşe yuvarlaması ona bağlı: içindeki bir tablo, kırpma olmadan köşelerden dışarı
|
|
23
|
+
* taşar. AMA AYNI KIRPMA, KARTIN İÇİNDE AÇILAN HER PANELİ KESER: bir Combobox listesi, bir
|
|
24
|
+
* DatePicker takvimi, bir satır menüsü. Panel çalışır, tıklanır, ama yarısı görünmez; ve hata
|
|
25
|
+
* vermediği için sebebi aranırken ilk akla gelen z-index olur. Z-index bunu çözmez: hiçbir
|
|
26
|
+
* yığın sırası bir `overflow` kırpmasını aşamaz. İçinde açılır bir kontrol varsa `visible`
|
|
27
|
+
* ver.
|
|
28
|
+
*/
|
|
29
|
+
overflow?: "clip" | "visible";
|
|
30
|
+
children: ReactNode;
|
|
31
|
+
className?: string;
|
|
32
|
+
}): import("react").JSX.Element;
|
|
33
|
+
/**
|
|
34
|
+
* Kart başlığı — başlık solda, eylem sağda, ikisi aynı taban çizgisinde.
|
|
35
|
+
*
|
|
36
|
+
* Eylemin yeri tartışmaya kapalı: üründeki her satır kontrolünü sağda tutar,
|
|
37
|
+
* ve başka yere koyan bir başlık listeden kopmuş görünür.
|
|
38
|
+
*/
|
|
39
|
+
export declare function CardHead({ children, action, className, }: {
|
|
40
|
+
children: ReactNode;
|
|
41
|
+
action?: ReactNode;
|
|
42
|
+
className?: string;
|
|
43
|
+
}): import("react").JSX.Element;
|
|
44
|
+
/** Kart gövdesi — başlıkla aynı yatay ritim, kendi dikey nefesi. */
|
|
45
|
+
export declare function CardBody({ children, className }: {
|
|
46
|
+
children: ReactNode;
|
|
47
|
+
className?: string;
|
|
48
|
+
}): import("react").JSX.Element;
|
|
49
|
+
/**
|
|
50
|
+
* Tablo.
|
|
51
|
+
*
|
|
52
|
+
* `overflow-x` sarmalayıcısı bileşenin İÇİNDE, çünkü dar bir ekranda taşan bir
|
|
53
|
+
* tablo tüm sayfayı yana kaydırır — ve bunu unutmak, unutulduğu yerde fark
|
|
54
|
+
* edilmeyen bir hatadır.
|
|
55
|
+
*/
|
|
56
|
+
export declare function Table({ children, className }: {
|
|
57
|
+
children: ReactNode;
|
|
58
|
+
className?: string;
|
|
59
|
+
}): import("react").JSX.Element;
|
|
60
|
+
/**
|
|
61
|
+
* Sessiz etiket — bir başlığın yanındaki ya da bir grubun üstündeki meta satır.
|
|
62
|
+
*
|
|
63
|
+
* Form etiketi DEĞİLDİR: bir kontrolü adlandırmaz, bir şeyi niteler
|
|
64
|
+
* (`p95 · 24h`, `10 kontrol`). Form etiketi için `Field` kullan — o `htmlFor`
|
|
65
|
+
* bağını da kurar.
|
|
66
|
+
*/
|
|
67
|
+
export declare function Label({ children, mono, className, }: {
|
|
68
|
+
children: ReactNode;
|
|
69
|
+
/**
|
|
70
|
+
* Identifier-shaped text (codes, SKUs) keeps the mono face. TR: Tanımlayıcı biçimli metinler
|
|
71
|
+
* (kodlar, SKU) mono yüzü korur.
|
|
72
|
+
*/
|
|
73
|
+
mono?: boolean;
|
|
74
|
+
className?: string;
|
|
75
|
+
}): import("react").JSX.Element;
|
|
76
|
+
//# sourceMappingURL=surface.d.ts.map
|
|
@@ -0,0 +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,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"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../lib/cn.js";
|
|
3
|
+
/**
|
|
4
|
+
* YÜZEYLER — kart, tablo, sessiz etiket.
|
|
5
|
+
*
|
|
6
|
+
* Gerekçe: docs/gerekce/05-yuzey-ve-kabuk.md
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Kart — kitin tek yükseltilmiş yüzeyi.
|
|
10
|
+
*
|
|
11
|
+
* 1px kenar + 2px sert offset (Yasa 1). İçindeki her şey `Gutter`ın ritmini
|
|
12
|
+
* paylaşır, böylece iki kart yan yana geldiğinde iç boşlukları hizalanır.
|
|
13
|
+
*/
|
|
14
|
+
export function Card({ overflow = "clip", children, className, }) {
|
|
15
|
+
return (_jsx("div", { className: cn("tamga-card", overflow === "visible" && "tamga-card-open", className), children: children }));
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Kart başlığı — başlık solda, eylem sağda, ikisi aynı taban çizgisinde.
|
|
19
|
+
*
|
|
20
|
+
* Eylemin yeri tartışmaya kapalı: üründeki her satır kontrolünü sağda tutar,
|
|
21
|
+
* ve başka yere koyan bir başlık listeden kopmuş görünür.
|
|
22
|
+
*/
|
|
23
|
+
export function CardHead({ children, action, className, }) {
|
|
24
|
+
return (_jsxs("div", { className: cn("tamga-head tamga-gutter tamga-section", className), children: [children, action ? _jsx("span", { className: "ml-auto", children: action }) : null] }));
|
|
25
|
+
}
|
|
26
|
+
/** Kart gövdesi — başlıkla aynı yatay ritim, kendi dikey nefesi. */
|
|
27
|
+
export function CardBody({ children, className }) {
|
|
28
|
+
return _jsx("div", { className: cn("tamga-gutter py-6", className), children: children });
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Tablo.
|
|
32
|
+
*
|
|
33
|
+
* `overflow-x` sarmalayıcısı bileşenin İÇİNDE, çünkü dar bir ekranda taşan bir
|
|
34
|
+
* tablo tüm sayfayı yana kaydırır — ve bunu unutmak, unutulduğu yerde fark
|
|
35
|
+
* edilmeyen bir hatadır.
|
|
36
|
+
*/
|
|
37
|
+
export function Table({ children, className }) {
|
|
38
|
+
return (_jsx("div", { className: "w-full overflow-x-auto", children: _jsx("table", { className: cn("tamga-table", className), children: children }) }));
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Sessiz etiket — bir başlığın yanındaki ya da bir grubun üstündeki meta satır.
|
|
42
|
+
*
|
|
43
|
+
* Form etiketi DEĞİLDİR: bir kontrolü adlandırmaz, bir şeyi niteler
|
|
44
|
+
* (`p95 · 24h`, `10 kontrol`). Form etiketi için `Field` kullan — o `htmlFor`
|
|
45
|
+
* bağını da kurar.
|
|
46
|
+
*/
|
|
47
|
+
export function Label({ children, mono = false, className, }) {
|
|
48
|
+
return _jsx("span", { className: cn("tamga-label", mono && "font-mono", className), children: children });
|
|
49
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare function Switch({ on, onChange, label, disabled, className, }: {
|
|
2
|
+
on: boolean;
|
|
3
|
+
onChange?: (next: boolean) => void;
|
|
4
|
+
/**
|
|
5
|
+
* The accessible name. There is no text inside a switch; without it, it is nameless. TR:
|
|
6
|
+
* Erişilebilir ad. Anahtarın içinde metin yoktur; onsuz adsızdır.
|
|
7
|
+
*/
|
|
8
|
+
label: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
className?: string;
|
|
11
|
+
}): import("react").JSX.Element;
|
|
12
|
+
//# sourceMappingURL=switch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../src/components/switch.tsx"],"names":[],"mappings":"AAWA,wBAAgB,MAAM,CAAC,EACrB,EAAE,EACF,QAAQ,EACR,KAAK,EACL,QAAgB,EAChB,SAAS,GACV,EAAE;IACD,EAAE,EAAE,OAAO,CAAC;IACZ,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACnC;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,+BAqBA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "../lib/cn.js";
|
|
4
|
+
import { OFF } from "./control-base.js";
|
|
5
|
+
/* ---------------------------------------------------------------- *
|
|
6
|
+
* Switch — akranlar arası seçim DEĞİL, açık/kapalı durumu.
|
|
7
|
+
*
|
|
8
|
+
* Dolgu burada Yasa 2'nin üçüncü bilinçli istisnası: dolu iz metaforun
|
|
9
|
+
* kendisidir, bir devrenin kapalı olması demektir.
|
|
10
|
+
* ---------------------------------------------------------------- */
|
|
11
|
+
export function Switch({ on, onChange, label, disabled = false, className, }) {
|
|
12
|
+
return (_jsx("button", { type: "button", role: "switch", "aria-checked": on, "aria-label": label, "aria-disabled": disabled || undefined, disabled: disabled, onClick: () => !disabled && onChange?.(!on), className: cn("tamga-switch", className), "data-on": on, style: disabled ? OFF : undefined, children: _jsx("span", { "aria-hidden": true }) }));
|
|
13
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Sekme şeridi.
|
|
4
|
+
*
|
|
5
|
+
* Gerekçe: docs/gerekce/05-yuzey-ve-kabuk.md
|
|
6
|
+
*/
|
|
7
|
+
export type TabItem<T extends string> = {
|
|
8
|
+
value: T;
|
|
9
|
+
label: ReactNode;
|
|
10
|
+
icon?: ReactNode;
|
|
11
|
+
/** Verilirse sekme bir BAĞLANTI olur ve şerit bir gezinme alanına döner. */
|
|
12
|
+
href?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Sekme YERİNDE ama henüz gidilemiyor.
|
|
15
|
+
*
|
|
16
|
+
* NEDEN GİZLEMEK YERİNE KAPATMAK. "Önce kaydet, sonra zenginleştir"
|
|
17
|
+
* akışında bir kayıt doğmadan fotoğrafı ya da kategorisi olamaz. Sekmeleri
|
|
18
|
+
* o ana kadar gizlemek, kaydettikten sonra ekranın altından dört yeni
|
|
19
|
+
* sekme çıkması demek; kullanıcı ne kazandığını değil neyin değiştiğini
|
|
20
|
+
* anlamaya çalışıyor. Kapalı sekme yapılacak işin ŞEKLİNİ baştan
|
|
21
|
+
* gösteriyor.
|
|
22
|
+
*
|
|
23
|
+
* Kapalı sekme bir bağlantı DEĞİL: `<a>` üretmiyor, o yüzden sağ tıklayıp
|
|
24
|
+
* yeni sekmede açılabilen ölü bir adres de bırakmıyor.
|
|
25
|
+
*/
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
};
|
|
28
|
+
export declare function Tabs<T extends string>({ items, value, onChange, label, scroll, linkAs, className, }: {
|
|
29
|
+
items: readonly TabItem<T>[];
|
|
30
|
+
value: T;
|
|
31
|
+
onChange?: (next: T) => void;
|
|
32
|
+
/** The tab strip's accessible name. TR: Sekme şeridinin erişilebilir adı. */
|
|
33
|
+
label: string;
|
|
34
|
+
/**
|
|
35
|
+
* Scroll the tabs horizontally when they do not fit; no wrapping. TR: Sekmeler sığmıyorsa
|
|
36
|
+
* yatay kaydır; sarma yok.
|
|
37
|
+
*/
|
|
38
|
+
scroll?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* The link component, such as Next.js's `Link`. Left out, a plain `<a>`. The kit knows no
|
|
41
|
+
* router, so the caller supplies one. TR: Bağlantı bileşeni: Next.js'in `Link`i gibi.
|
|
42
|
+
* Verilmezse düz `<a>`. Kit bir yönlendirici tanımıyor, o yüzden çağıran veriyor.
|
|
43
|
+
*/
|
|
44
|
+
linkAs?: React.ElementType;
|
|
45
|
+
className?: string;
|
|
46
|
+
}): import("react").JSX.Element;
|
|
47
|
+
//# sourceMappingURL=tabs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../src/components/tabs.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC;;;;GAIG;AAEH,MAAM,MAAM,OAAO,CAAC,CAAC,SAAS,MAAM,IAAI;IACtC,KAAK,EAAE,CAAC,CAAC;IACT,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,4EAA4E;IAC5E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,wBAAgB,IAAI,CAAC,CAAC,SAAS,MAAM,EAAE,EACrC,KAAK,EACL,KAAK,EACL,QAAQ,EACR,KAAK,EACL,MAAc,EACd,MAAM,EACN,SAAS,GACV,EAAE;IACD,KAAK,EAAE,SAAS,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;IAC7B,KAAK,EAAE,CAAC,CAAC;IACT,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC;IAC7B,6EAA6E;IAC7E,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,+BA4DA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "../lib/cn.js";
|
|
4
|
+
export function Tabs({ items, value, onChange, label, scroll = false, linkAs, className, }) {
|
|
5
|
+
const kap = cn("flex gap-6 border-b border-[var(--color-line)]", scroll && "overflow-x-auto", className);
|
|
6
|
+
const bagliMi = items.some((t) => t.href);
|
|
7
|
+
const A = linkAs ?? "a";
|
|
8
|
+
if (bagliMi) {
|
|
9
|
+
return (_jsx("nav", { "aria-label": label, className: kap, children: items.map((t) => t.disabled ? (_jsxs("span", { "aria-disabled": "true", className: cn("tamga-tab", scroll && "shrink-0"), "data-disabled": "true", children: [t.icon, t.label] }, t.value)) : (_jsxs(A, { href: t.href, className: cn("tamga-tab", scroll && "shrink-0"), "data-active": value === t.value, "aria-current": value === t.value ? "page" : undefined, children: [t.icon, t.label] }, t.value))) }));
|
|
10
|
+
}
|
|
11
|
+
return (_jsx("div", { role: "tablist", "aria-label": label, className: kap, children: items.map((t) => (_jsxs("button", { type: "button", role: "tab", "aria-selected": value === t.value, disabled: t.disabled, className: cn("tamga-tab", scroll && "shrink-0"), "data-active": value === t.value, "data-disabled": t.disabled || undefined, onClick: () => onChange?.(t.value), children: [t.icon, t.label] }, t.value))) }));
|
|
12
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type Tone } from "./tone.js";
|
|
2
|
+
/**
|
|
3
|
+
* TimelineStrip — kova başına bir işaret, renk durumu taşır.
|
|
4
|
+
*
|
|
5
|
+
* Gerekçe: docs/gerekce/02-veri-ve-liste.md
|
|
6
|
+
*/
|
|
7
|
+
export declare function TimelineStrip({ data, height, gap, minWidth,
|
|
8
|
+
/** Şeridin iki ucundaki zaman etiketi — "90 gün önce" · "bugün". */
|
|
9
|
+
labels,
|
|
10
|
+
/** Her kovanın erişilebilir açıklaması. Kit çeviri çekmez. */
|
|
11
|
+
describe, }: {
|
|
12
|
+
data: readonly Tone[];
|
|
13
|
+
height?: number;
|
|
14
|
+
gap?: number;
|
|
15
|
+
minWidth?: number;
|
|
16
|
+
labels?: [string, string];
|
|
17
|
+
describe?: (index: number, tone: Tone) => string;
|
|
18
|
+
}): import("react").JSX.Element;
|
|
19
|
+
//# sourceMappingURL=timeline-strip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline-strip.d.ts","sourceRoot":"","sources":["../../src/components/timeline-strip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,IAAI,EAAE,MAAM,WAAW,CAAC;AAE9C;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,EAC5B,IAAI,EACJ,MAAW,EACX,GAAO,EACP,QAAY;AACZ,oEAAoE;AACpE,MAAM;AACN,8DAA8D;AAC9D,QAAQ,GACT,EAAE;IACD,IAAI,EAAE,SAAS,IAAI,EAAE,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,KAAK,MAAM,CAAC;CAClD,+BAqBA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { toneOf } from "./tone.js";
|
|
3
|
+
/**
|
|
4
|
+
* TimelineStrip — kova başına bir işaret, renk durumu taşır.
|
|
5
|
+
*
|
|
6
|
+
* Gerekçe: docs/gerekce/02-veri-ve-liste.md
|
|
7
|
+
*/
|
|
8
|
+
export function TimelineStrip({ data, height = 32, gap = 2, minWidth = 3,
|
|
9
|
+
/** Şeridin iki ucundaki zaman etiketi — "90 gün önce" · "bugün". */
|
|
10
|
+
labels,
|
|
11
|
+
/** Her kovanın erişilebilir açıklaması. Kit çeviri çekmez. */
|
|
12
|
+
describe, }) {
|
|
13
|
+
return (_jsxs("div", { children: [_jsx("div", { className: "flex items-end", style: { gap }, children: data.map((tone, i) => (_jsx("span", { title: describe?.(i, tone), className: "flex-1 transition-opacity hover:opacity-60", style: { height, minWidth, background: toneOf(tone).mark } }, i))) }), labels ? (_jsxs("div", { className: "mt-2 flex justify-between", children: [_jsx("span", { className: "font-mono text-micro text-ink-faint", children: labels[0] }), _jsx("span", { className: "font-mono text-micro text-ink-faint", children: labels[1] })] })) : null] }));
|
|
14
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The tone scale — layer 3 of the palette.
|
|
3
|
+
*
|
|
4
|
+
* Gerekçe: docs/gerekce/06-isaret-ve-ton.md
|
|
5
|
+
*/
|
|
6
|
+
/** What a tone paints. */
|
|
7
|
+
export type ToneStyle = {
|
|
8
|
+
/** text + border colour for chips and labels */
|
|
9
|
+
fg: string;
|
|
10
|
+
/** solid mark: dots, bars, spines, chart marks */
|
|
11
|
+
mark: string;
|
|
12
|
+
/** chip / cell wash */
|
|
13
|
+
bg: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Four roles, and nothing outside them.
|
|
17
|
+
*
|
|
18
|
+
* `neutral` is the one that carries meaning by NOT carrying colour: a grey row
|
|
19
|
+
* says "this is not reporting" on its own. That only works while it stays the
|
|
20
|
+
* single uncoloured state — which is why healthy is green here rather than
|
|
21
|
+
* neutral, a deliberate reversal recorded in the product's design notes.
|
|
22
|
+
*/
|
|
23
|
+
export type Tone = "neutral" | "positive" | "caution" | "danger";
|
|
24
|
+
export declare const tones: Record<Tone, ToneStyle>;
|
|
25
|
+
export declare function toneOf(tone: Tone): ToneStyle;
|
|
26
|
+
/**
|
|
27
|
+
* How loudly a tone asks for the screen's single pulse (see live-scope).
|
|
28
|
+
*
|
|
29
|
+
* `null` means "never pulses". Only `danger` breathes, and the reasoning is the
|
|
30
|
+
* same in every domain the kit serves: too few signals is a smaller failure
|
|
31
|
+
* than a signal that has stopped meaning anything. `caution` already carries
|
|
32
|
+
* its own colour; the pulse stays reserved for "look here, now".
|
|
33
|
+
*
|
|
34
|
+
* A product that ranks its own states more finely passes an explicit rank
|
|
35
|
+
* instead — this is the DEFAULT, not the policy.
|
|
36
|
+
*/
|
|
37
|
+
export declare const TONE_RANK: Record<Tone, number | null>;
|
|
38
|
+
export declare function rankOf(tone: Tone, override?: number | null): number | null;
|
|
39
|
+
/** Layer 1 — neutral ramp, for anything that is not reporting a state. */
|
|
40
|
+
export declare const neutral: {
|
|
41
|
+
page: string;
|
|
42
|
+
surface: string;
|
|
43
|
+
hover: string;
|
|
44
|
+
chartFill: string;
|
|
45
|
+
line: string;
|
|
46
|
+
edge: string;
|
|
47
|
+
lineStrong: string;
|
|
48
|
+
muted: string;
|
|
49
|
+
body: string;
|
|
50
|
+
title: string;
|
|
51
|
+
};
|
|
52
|
+
/** Layer 2 — interaction only. */
|
|
53
|
+
export declare const accent: {
|
|
54
|
+
fg: string;
|
|
55
|
+
bg: string;
|
|
56
|
+
ink: string;
|
|
57
|
+
};
|
|
58
|
+
//# sourceMappingURL=tone.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tone.d.ts","sourceRoot":"","sources":["../../src/components/tone.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,0BAA0B;AAC1B,MAAM,MAAM,SAAS,GAAG;IACtB,gDAAgD;IAChD,EAAE,EAAE,MAAM,CAAC;IACX,kDAAkD;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,uBAAuB;IACvB,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,IAAI,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEjE,eAAO,MAAM,KAAK,EAAE,MAAM,CAAC,IAAI,EAAE,SAAS,CAsBzC,CAAC;AAEF,wBAAgB,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,SAAS,CAE5C;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAKjD,CAAC;AAEF,wBAAgB,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAE1E;AAED,0EAA0E;AAC1E,eAAO,MAAM,OAAO;IAClB,IAAI;IACJ,OAAO;IACP,KAAK;IACL,SAAS;IACT,IAAI;IACJ,IAAI;IACJ,UAAU;IACV,KAAK;IACL,IAAI;IACJ,KAAK;CACN,CAAC;AAEF,kCAAkC;AAClC,eAAO,MAAM,MAAM;IACjB,EAAE;IACF,EAAE;IACF,GAAG;CACJ,CAAC"}
|