tamga-ui 0.3.0 → 0.3.2
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 +55 -0
- package/dist/components/advanced-input.d.ts +9 -3
- package/dist/components/advanced-input.d.ts.map +1 -1
- package/dist/components/advanced-input.js +7 -6
- package/dist/components/appearance.d.ts +9 -3
- package/dist/components/appearance.d.ts.map +1 -1
- package/dist/components/appearance.js +7 -6
- package/dist/components/avatar.d.ts +6 -2
- package/dist/components/avatar.d.ts.map +1 -1
- package/dist/components/avatar.js +5 -4
- package/dist/components/badge.d.ts +9 -3
- package/dist/components/badge.d.ts.map +1 -1
- package/dist/components/badge.js +7 -6
- package/dist/components/bar.d.ts +3 -1
- package/dist/components/bar.d.ts.map +1 -1
- package/dist/components/bar.js +3 -2
- package/dist/components/chart.d.ts +3 -1
- package/dist/components/chart.d.ts.map +1 -1
- package/dist/components/chart.js +3 -2
- package/dist/components/checkbox.d.ts +3 -1
- package/dist/components/checkbox.d.ts.map +1 -1
- package/dist/components/checkbox.js +3 -2
- package/dist/components/chrome.d.ts +12 -4
- package/dist/components/chrome.d.ts.map +1 -1
- package/dist/components/chrome.js +9 -8
- package/dist/components/combobox.d.ts +3 -1
- package/dist/components/combobox.d.ts.map +1 -1
- package/dist/components/combobox.js +3 -2
- package/dist/components/data-table.d.ts +9 -3
- package/dist/components/data-table.d.ts.map +1 -1
- package/dist/components/data-table.js +7 -6
- package/dist/components/date-picker.d.ts +6 -2
- package/dist/components/date-picker.d.ts.map +1 -1
- package/dist/components/date-picker.js +5 -4
- package/dist/components/disclosure.d.ts +5 -2
- package/dist/components/disclosure.d.ts.map +1 -1
- package/dist/components/disclosure.js +5 -4
- package/dist/components/display.d.ts +17 -6
- package/dist/components/display.d.ts.map +1 -1
- package/dist/components/display.js +16 -12
- package/dist/components/empty-state.d.ts +15 -5
- package/dist/components/empty-state.d.ts.map +1 -1
- package/dist/components/empty-state.js +11 -10
- package/dist/components/error-state.d.ts +3 -1
- package/dist/components/error-state.d.ts.map +1 -1
- package/dist/components/error-state.js +3 -2
- package/dist/components/file-upload.d.ts +3 -1
- package/dist/components/file-upload.d.ts.map +1 -1
- package/dist/components/file-upload.js +3 -2
- package/dist/components/gauge.d.ts +4 -2
- package/dist/components/gauge.d.ts.map +1 -1
- package/dist/components/gauge.js +5 -4
- package/dist/components/layout.d.ts +24 -5
- package/dist/components/layout.d.ts.map +1 -1
- package/dist/components/layout.js +18 -8
- package/dist/components/log-view.d.ts +3 -1
- package/dist/components/log-view.d.ts.map +1 -1
- package/dist/components/log-view.js +3 -2
- package/dist/components/number-input.d.ts +3 -1
- package/dist/components/number-input.d.ts.map +1 -1
- package/dist/components/number-input.js +3 -2
- package/dist/components/overlay.d.ts +18 -6
- package/dist/components/overlay.d.ts.map +1 -1
- package/dist/components/overlay.js +13 -12
- package/dist/components/pagination.d.ts +3 -1
- package/dist/components/pagination.d.ts.map +1 -1
- package/dist/components/pagination.js +3 -2
- package/dist/components/pie.d.ts +3 -1
- package/dist/components/pie.d.ts.map +1 -1
- package/dist/components/pie.js +3 -2
- package/dist/components/primitives.d.ts +20 -7
- package/dist/components/primitives.d.ts.map +1 -1
- package/dist/components/primitives.js +15 -14
- package/dist/components/progress.d.ts +3 -6
- package/dist/components/progress.d.ts.map +1 -1
- package/dist/components/progress.js +3 -2
- package/dist/components/radio-group.d.ts +3 -1
- package/dist/components/radio-group.d.ts.map +1 -1
- package/dist/components/radio-group.js +3 -2
- package/dist/components/rich-text.d.ts +3 -1
- package/dist/components/rich-text.d.ts.map +1 -1
- package/dist/components/rich-text.js +3 -2
- package/dist/components/section.d.ts +3 -1
- package/dist/components/section.d.ts.map +1 -1
- package/dist/components/section.js +3 -2
- package/dist/components/segmented.d.ts +8 -2
- package/dist/components/segmented.d.ts.map +1 -1
- package/dist/components/segmented.js +1 -1
- package/dist/components/skeleton.d.ts +25 -14
- package/dist/components/skeleton.d.ts.map +1 -1
- package/dist/components/skeleton.js +24 -18
- package/dist/components/slider.d.ts +3 -1
- package/dist/components/slider.d.ts.map +1 -1
- package/dist/components/slider.js +3 -2
- package/dist/components/spinner.d.ts +2 -1
- package/dist/components/spinner.d.ts.map +1 -1
- package/dist/components/spinner.js +3 -2
- package/dist/components/square-picker.d.ts +3 -1
- package/dist/components/square-picker.d.ts.map +1 -1
- package/dist/components/square-picker.js +3 -2
- package/dist/components/stacked-bar.d.ts +3 -1
- package/dist/components/stacked-bar.d.ts.map +1 -1
- package/dist/components/stacked-bar.js +3 -2
- package/dist/components/surface.d.ts +19 -5
- package/dist/components/surface.d.ts.map +1 -1
- package/dist/components/surface.js +11 -10
- package/dist/components/switch.d.ts +3 -1
- package/dist/components/switch.d.ts.map +1 -1
- package/dist/components/switch.js +3 -2
- package/dist/components/tabs.d.ts +3 -1
- package/dist/components/tabs.d.ts.map +1 -1
- package/dist/components/tabs.js +3 -2
- package/dist/components/timeline-strip.d.ts +3 -1
- package/dist/components/timeline-strip.d.ts.map +1 -1
- package/dist/components/timeline-strip.js +3 -2
- package/dist/components/tree-select.d.ts +3 -1
- package/dist/components/tree-select.d.ts.map +1 -1
- package/dist/components/tree-select.js +3 -2
- package/dist/kit.css +1 -1
- package/dist/lib/data-props.d.ts +20 -0
- package/dist/lib/data-props.d.ts.map +1 -0
- package/dist/lib/data-props.js +25 -0
- package/dist/styles.css +1 -1
- package/dist/theme.css +1 -1
- package/package.json +1 -1
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useEffect, useRef } from "react";
|
|
4
4
|
import { cn } from "../lib/cn.js";
|
|
5
|
+
import { dataProps } from "../lib/data-props.js";
|
|
5
6
|
import { toneOf } from "./tone.js";
|
|
6
|
-
export function LogView({ lines, label, height = 320, follow = true, wrap = false, className, }) {
|
|
7
|
+
export function LogView({ lines, label, height = 320, follow = true, wrap = false, className, ...rest }) {
|
|
7
8
|
const box = useRef(null);
|
|
8
9
|
useEffect(() => {
|
|
9
10
|
if (!follow)
|
|
@@ -19,7 +20,7 @@ export function LogView({ lines, label, height = 320, follow = true, wrap = fals
|
|
|
19
20
|
if (atBottom)
|
|
20
21
|
el.scrollTop = el.scrollHeight;
|
|
21
22
|
}, [lines, follow]);
|
|
22
|
-
return (_jsx("div", { ref: box, className: cn("tamga-surface overflow-y-auto p-3 font-mono text-caption", className), style: { height },
|
|
23
|
+
return (_jsx("div", { ...dataProps(rest), ref: box, className: cn("tamga-surface overflow-y-auto p-3 font-mono text-caption", className), style: { height },
|
|
23
24
|
/* `log` rolü: ekran okuyucu bunu bir günlük olarak tanır ve — kritik
|
|
24
25
|
olarak — `aria-live` OLMADAN sessiz kalır. Akan bir bölgeyi
|
|
25
26
|
duyurmak sesli okuyucuyu boğar; kullanıcı isterse kendisi okur. */
|
|
@@ -7,7 +7,7 @@ export declare function NumberInput({ value, onChange, min, max, step,
|
|
|
7
7
|
/** Değerin sonuna yapışan birim: "₺", "kg", "%" */
|
|
8
8
|
suffix, disabled, invalid, full,
|
|
9
9
|
/** Artır/azalt düğmelerinin erişilebilir adları. Kit çeviri çekmez. */
|
|
10
|
-
labels, className, }: {
|
|
10
|
+
labels, className, ...rest }: {
|
|
11
11
|
value: number | null;
|
|
12
12
|
onChange?: (next: number | null) => void;
|
|
13
13
|
min?: number;
|
|
@@ -22,5 +22,7 @@ labels, className, }: {
|
|
|
22
22
|
decrease: string;
|
|
23
23
|
};
|
|
24
24
|
className?: string;
|
|
25
|
+
/** `data-*` hooks pass through. TR: `data-*` kancaları geçiyor. */
|
|
26
|
+
[k: `data-${string}`]: unknown;
|
|
25
27
|
}): import("react").JSX.Element;
|
|
26
28
|
//# sourceMappingURL=number-input.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"number-input.d.ts","sourceRoot":"","sources":["../../src/components/number-input.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"number-input.d.ts","sourceRoot":"","sources":["../../src/components/number-input.tsx"],"names":[],"mappings":"AAQA;;;;GAIG;AAEH,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,QAAQ,EACR,GAAG,EACH,GAAG,EACH,IAAQ;AACR,mDAAmD;AACnD,MAAM,EACN,QAAgB,EAChB,OAAe,EACf,IAAY;AACZ,uEAAuE;AACvE,MAAM,EACN,SAAS,EACT,GAAG,IAAI,EACR,EAAE;IACD,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACzC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mEAAmE;IACnE,CAAC,CAAC,EAAE,QAAQ,MAAM,EAAE,GAAG,OAAO,CAAC;CAChC,+BAoFA"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useId } from "react";
|
|
4
4
|
import { cn } from "../lib/cn.js";
|
|
5
|
+
import { dataProps } from "../lib/data-props.js";
|
|
5
6
|
import { Icon } from "./icon.js";
|
|
6
7
|
import { CaretDown } from "./icons.js";
|
|
7
8
|
/**
|
|
@@ -13,7 +14,7 @@ export function NumberInput({ value, onChange, min, max, step = 1,
|
|
|
13
14
|
/** Değerin sonuna yapışan birim: "₺", "kg", "%" */
|
|
14
15
|
suffix, disabled = false, invalid = false, full = false,
|
|
15
16
|
/** Artır/azalt düğmelerinin erişilebilir adları. Kit çeviri çekmez. */
|
|
16
|
-
labels, className, }) {
|
|
17
|
+
labels, className, ...rest }) {
|
|
17
18
|
const id = useId();
|
|
18
19
|
const clamp = (n) => {
|
|
19
20
|
if (min !== undefined && n < min)
|
|
@@ -33,7 +34,7 @@ labels, className, }) {
|
|
|
33
34
|
};
|
|
34
35
|
const atMin = min !== undefined && value !== null && value <= min;
|
|
35
36
|
const atMax = max !== undefined && value !== null && value >= max;
|
|
36
|
-
return (_jsxs("span", { className: cn("relative inline-flex items-center", full && "w-full", className), children: [_jsx("input", { id: id, type: "text", inputMode: "decimal", value: value ?? "", disabled: disabled, "aria-invalid": invalid || undefined, onChange: (e) => {
|
|
37
|
+
return (_jsxs("span", { ...dataProps(rest), className: cn("relative inline-flex items-center", full && "w-full", className), children: [_jsx("input", { id: id, type: "text", inputMode: "decimal", value: value ?? "", disabled: disabled, "aria-invalid": invalid || undefined, onChange: (e) => {
|
|
37
38
|
const raw = e.target.value.replace(",", ".").trim();
|
|
38
39
|
if (raw === "")
|
|
39
40
|
return onChange?.(null);
|
|
@@ -23,7 +23,7 @@ export type MenuItem = {
|
|
|
23
23
|
kind: "label";
|
|
24
24
|
label: string;
|
|
25
25
|
};
|
|
26
|
-
export declare function DropdownMenu({ trigger, items, align, width, loading, loadingRows, openOnHover, }: {
|
|
26
|
+
export declare function DropdownMenu({ trigger, items, align, width, loading, loadingRows, openOnHover, ...rest }: {
|
|
27
27
|
trigger: React.ReactNode;
|
|
28
28
|
items: MenuItem[];
|
|
29
29
|
align?: "start" | "end";
|
|
@@ -57,8 +57,10 @@ export declare function DropdownMenu({ trigger, items, align, width, loading, lo
|
|
|
57
57
|
* değil; 4'te bırakılmış bir liste, tasarım kararı gibi görünen bir hatadır.
|
|
58
58
|
*/
|
|
59
59
|
loadingRows?: number;
|
|
60
|
+
/** `data-*` hooks pass through. TR: `data-*` kancaları geçiyor. */
|
|
61
|
+
[k: `data-${string}`]: unknown;
|
|
60
62
|
}): import("react").JSX.Element;
|
|
61
|
-
export declare function Popover({ trigger, title, children, footer, width, align, loading, loadingBlock, closeLabel, }: {
|
|
63
|
+
export declare function Popover({ trigger, title, children, footer, width, align, loading, loadingBlock, closeLabel, ...rest }: {
|
|
62
64
|
trigger: React.ReactNode;
|
|
63
65
|
title?: string;
|
|
64
66
|
/**
|
|
@@ -80,6 +82,8 @@ export declare function Popover({ trigger, title, children, footer, width, align
|
|
|
80
82
|
* gövdesi bir blokla açılıyorsa o baştaki bloğun yüksekliği
|
|
81
83
|
*/
|
|
82
84
|
loadingBlock?: number;
|
|
85
|
+
/** `data-*` hooks pass through. TR: `data-*` kancaları geçiyor. */
|
|
86
|
+
[k: `data-${string}`]: unknown;
|
|
83
87
|
}): import("react").JSX.Element;
|
|
84
88
|
declare const placements: {
|
|
85
89
|
readonly top: "bottom-[var(--overlay-above)] left-1/2 -translate-x-1/2";
|
|
@@ -104,13 +108,15 @@ declare const placements: {
|
|
|
104
108
|
* hizalanmasının yolu yok. Ölçüm yalnız ipucu açılırken yapılıyor: kapalıyken
|
|
105
109
|
* hiçbir maliyeti yok.
|
|
106
110
|
*/
|
|
107
|
-
export declare function Tooltip({ label, placement, children, }: {
|
|
111
|
+
export declare function Tooltip({ label, placement, children, ...rest }: {
|
|
108
112
|
label: string;
|
|
109
113
|
placement?: keyof typeof placements;
|
|
110
114
|
children: React.ReactNode;
|
|
115
|
+
/** `data-*` hooks pass through. TR: `data-*` kancaları geçiyor. */
|
|
116
|
+
[k: `data-${string}`]: unknown;
|
|
111
117
|
}): import("react").JSX.Element;
|
|
112
118
|
export type ToastTone = Tone;
|
|
113
|
-
export declare function Toast({ tone, title, description, action, onDismiss, dismissLabel, }: {
|
|
119
|
+
export declare function Toast({ tone, title, description, action, onDismiss, dismissLabel, ...rest }: {
|
|
114
120
|
tone?: ToastTone;
|
|
115
121
|
title: string;
|
|
116
122
|
description?: string;
|
|
@@ -121,6 +127,8 @@ export declare function Toast({ tone, title, description, action, onDismiss, dis
|
|
|
121
127
|
* Kapatma kontrolünün erişilebilir adı, çağıran veriyor (docs/08 kural 5).
|
|
122
128
|
*/
|
|
123
129
|
dismissLabel: string;
|
|
130
|
+
/** `data-*` hooks pass through. TR: `data-*` kancaları geçiyor. */
|
|
131
|
+
[k: `data-${string}`]: unknown;
|
|
124
132
|
}): import("react").JSX.Element;
|
|
125
133
|
/**
|
|
126
134
|
* Where toasts land. Top-right is the default: it is the one corner that
|
|
@@ -132,9 +140,11 @@ declare const corners: {
|
|
|
132
140
|
readonly "bottom-right": "bottom-6 right-6 items-end";
|
|
133
141
|
readonly "bottom-left": "bottom-6 left-6 items-start";
|
|
134
142
|
};
|
|
135
|
-
export declare function ToastViewport({ position, children, }: {
|
|
143
|
+
export declare function ToastViewport({ position, children, ...rest }: {
|
|
136
144
|
position?: keyof typeof corners;
|
|
137
145
|
children: React.ReactNode;
|
|
146
|
+
/** `data-*` hooks pass through. TR: `data-*` kancaları geçiyor. */
|
|
147
|
+
[k: `data-${string}`]: unknown;
|
|
138
148
|
}): import("react").JSX.Element;
|
|
139
149
|
/**
|
|
140
150
|
* The modal shell. Hooks cannot run behind an early return, so the trap lives
|
|
@@ -220,7 +230,7 @@ export declare function ConfirmDialog({ open, onClose, onConfirm, title, childre
|
|
|
220
230
|
*/
|
|
221
231
|
confirmDisabled?: boolean;
|
|
222
232
|
}): import("react").JSX.Element;
|
|
223
|
-
export declare function Dialog({ open, onClose, title, children, footer, loading, closeLabel, size, }: {
|
|
233
|
+
export declare function Dialog({ open, onClose, title, children, footer, loading, closeLabel, size, ...rest }: {
|
|
224
234
|
open: boolean;
|
|
225
235
|
onClose: () => void;
|
|
226
236
|
title: string;
|
|
@@ -243,6 +253,8 @@ export declare function Dialog({ open, onClose, title, children, footer, loading
|
|
|
243
253
|
* tuval).
|
|
244
254
|
*/
|
|
245
255
|
size?: DialogSize;
|
|
256
|
+
/** `data-*` hooks pass through. TR: `data-*` kancaları geçiyor. */
|
|
257
|
+
[k: `data-${string}`]: unknown;
|
|
246
258
|
}): import("react").JSX.Element;
|
|
247
259
|
export {};
|
|
248
260
|
//# sourceMappingURL=overlay.d.ts.map
|
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"overlay.d.ts","sourceRoot":"","sources":["../../src/components/overlay.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAuCtC,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,EACnB,GAAG,IAAI,EACR,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;;;OAG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ffect, useRef, useState } from "react";
|
|
|
4
4
|
import { toneOf } from "./tone.js";
|
|
5
5
|
import { Icon } from "./icon.js";
|
|
6
6
|
import { cn } from "../lib/cn.js";
|
|
7
|
+
import { dataProps } from "../lib/data-props.js";
|
|
7
8
|
import { Close } from "./icons.js";
|
|
8
9
|
import { SkeletonOptions, SkeletonPanel } from "./skeleton.js";
|
|
9
10
|
import { Button } from "./button.js";
|
|
@@ -35,7 +36,7 @@ function useDismiss(open, close) {
|
|
|
35
36
|
}, [open, close]);
|
|
36
37
|
return box;
|
|
37
38
|
}
|
|
38
|
-
export function DropdownMenu({ trigger, items, align = "start", width = 200, loading = false, loadingRows = 4, openOnHover = false, }) {
|
|
39
|
+
export function DropdownMenu({ trigger, items, align = "start", width = 200, loading = false, loadingRows = 4, openOnHover = false, ...rest }) {
|
|
39
40
|
const [open, setOpen] = useState(false);
|
|
40
41
|
const box = useDismiss(open, () => setOpen(false));
|
|
41
42
|
const close = useCallback(() => setOpen(false), []);
|
|
@@ -58,7 +59,7 @@ export function DropdownMenu({ trigger, items, align = "start", width = 200, loa
|
|
|
58
59
|
}
|
|
59
60
|
}, []);
|
|
60
61
|
useEffect(() => () => kapatmayiIptal(), [kapatmayiIptal]);
|
|
61
|
-
return (_jsxs("div", { ref: box, className: "relative inline-flex", onPointerEnter: openOnHover
|
|
62
|
+
return (_jsxs("div", { ...dataProps(rest), ref: box, className: "relative inline-flex", onPointerEnter: openOnHover
|
|
62
63
|
? (e) => {
|
|
63
64
|
/* YALNIZ FARE. Dokunmatik bir ekranda `pointerenter` dokunmayla
|
|
64
65
|
birlikte geliyor ve hemen ardından gelen `click` menüyü kapatıyor:
|
|
@@ -86,10 +87,10 @@ export function DropdownMenu({ trigger, items, align = "start", width = 200, loa
|
|
|
86
87
|
})] }))] }));
|
|
87
88
|
}
|
|
88
89
|
/* --------------------------- popover --------------------------- */
|
|
89
|
-
export function Popover({ trigger, title, children, footer, width = 288, align = "start", loading = false, loadingBlock, closeLabel, }) {
|
|
90
|
+
export function Popover({ trigger, title, children, footer, width = 288, align = "start", loading = false, loadingBlock, closeLabel, ...rest }) {
|
|
90
91
|
const [open, setOpen] = useState(false);
|
|
91
92
|
const box = useDismiss(open, () => setOpen(false));
|
|
92
|
-
return (_jsxs("div", { ref: box, className: "relative inline-flex", children: [_jsx("span", { onClick: () => setOpen((o) => !o), children: trigger }), open && (_jsxs("div", { className: "tamga-overlay absolute top-[var(--overlay-below)] z-40", style: { width, [align === "end" ? "right" : "left"]: 0 }, "aria-busy": loading || undefined, children: [title ? (_jsxs("div", { className: "tamga-head tamga-gutter tamga-section", children: [_jsx("h4", { className: "text-control font-semibold", children: title }), _jsx(MiniButton, { className: "ml-auto", "aria-label": closeLabel, onClick: () => setOpen(false), children: _jsx(Icon, { icon: Close, size: "xs" }) })] })) : null, _jsx("div", { className: "tamga-gutter py-4 text-small leading-relaxed", children: loading ? _jsx(SkeletonPanel, { lines: 3, block: loadingBlock }) : children }), footer ? (_jsx("div", { className: "tamga-gutter flex justify-end gap-2 border-t border-line py-3", children: footer })) : null] }))] }));
|
|
93
|
+
return (_jsxs("div", { ...dataProps(rest), ref: box, className: "relative inline-flex", children: [_jsx("span", { onClick: () => setOpen((o) => !o), children: trigger }), open && (_jsxs("div", { className: "tamga-overlay absolute top-[var(--overlay-below)] z-40", style: { width, [align === "end" ? "right" : "left"]: 0 }, "aria-busy": loading || undefined, children: [title ? (_jsxs("div", { className: "tamga-head tamga-gutter tamga-section", children: [_jsx("h4", { className: "text-control font-semibold", children: title }), _jsx(MiniButton, { className: "ml-auto", "aria-label": closeLabel, onClick: () => setOpen(false), children: _jsx(Icon, { icon: Close, size: "xs" }) })] })) : null, _jsx("div", { className: "tamga-gutter py-4 text-small leading-relaxed", children: loading ? _jsx(SkeletonPanel, { lines: 3, block: loadingBlock }) : children }), footer ? (_jsx("div", { className: "tamga-gutter flex justify-end gap-2 border-t border-line py-3", children: footer })) : null] }))] }));
|
|
93
94
|
}
|
|
94
95
|
/* --------------------------- tooltip --------------------------- */
|
|
95
96
|
const placements = {
|
|
@@ -140,7 +141,7 @@ const arrows = {
|
|
|
140
141
|
* hizalanmasının yolu yok. Ölçüm yalnız ipucu açılırken yapılıyor: kapalıyken
|
|
141
142
|
* hiçbir maliyeti yok.
|
|
142
143
|
*/
|
|
143
|
-
export function Tooltip({ label, placement = "bottom", children, }) {
|
|
144
|
+
export function Tooltip({ label, placement = "bottom", children, ...rest }) {
|
|
144
145
|
const sarmal = useRef(null);
|
|
145
146
|
const [konum, setKonum] = useState(null);
|
|
146
147
|
const olc = useCallback(() => {
|
|
@@ -176,7 +177,7 @@ export function Tooltip({ label, placement = "bottom", children, }) {
|
|
|
176
177
|
left: "translate(-100%, -50%)",
|
|
177
178
|
right: "translate(0, -50%)",
|
|
178
179
|
};
|
|
179
|
-
return (_jsxs("span", { ref: sarmal, className: "relative inline-flex", onPointerEnter: olc, onPointerLeave: kapat, onFocusCapture: olc, onBlurCapture: kapat, children: [children, konum && (_jsxs("span", { role: "tooltip", className: "pointer-events-none fixed z-40 whitespace-nowrap px-2 py-1 text-small", style: {
|
|
180
|
+
return (_jsxs("span", { ...dataProps(rest), ref: sarmal, className: "relative inline-flex", onPointerEnter: olc, onPointerLeave: kapat, onFocusCapture: olc, onBlurCapture: kapat, children: [children, konum && (_jsxs("span", { role: "tooltip", className: "pointer-events-none fixed z-40 whitespace-nowrap px-2 py-1 text-small", style: {
|
|
180
181
|
left: konum.left,
|
|
181
182
|
top: konum.top,
|
|
182
183
|
transform: kaydirma[placement],
|
|
@@ -185,9 +186,9 @@ export function Tooltip({ label, placement = "bottom", children, }) {
|
|
|
185
186
|
borderRadius: "var(--radius-ctl)",
|
|
186
187
|
}, children: [label, _jsx("span", { "aria-hidden": true, className: "absolute block", style: { background: "var(--color-ink)", ...arrows[placement] } })] }))] }));
|
|
187
188
|
}
|
|
188
|
-
export function Toast({ tone = "neutral", title, description, action, onDismiss, dismissLabel, }) {
|
|
189
|
+
export function Toast({ tone = "neutral", title, description, action, onDismiss, dismissLabel, ...rest }) {
|
|
189
190
|
const mark = tone === "neutral" ? "var(--color-ink)" : toneOf(tone).mark;
|
|
190
|
-
return (_jsxs("div", { role: "status", className: "tamga-toast tamga-overlay flex w-80 items-start gap-4 p-4", style: { animation: "tamga-toast-in var(--duration-base) var(--ease-standard) both" }, children: [_jsx("span", { className: "mt-1 size-2.5 shrink-0", style: { background: mark } }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("p", { className: "text-body font-medium text-ink", children: title }), description ? (_jsx("p", { className: "mt-1 text-small leading-relaxed text-ink-faint", children: description })) : null, action ? _jsx("div", { className: "mt-3", children: action }) : null] }), onDismiss ? (_jsx(MiniButton, { onClick: onDismiss, "aria-label": dismissLabel, children: _jsx(Icon, { icon: Close, size: "xs" }) })) : null] }));
|
|
191
|
+
return (_jsxs("div", { ...dataProps(rest), role: "status", className: "tamga-toast tamga-overlay flex w-80 items-start gap-4 p-4", style: { animation: "tamga-toast-in var(--duration-base) var(--ease-standard) both" }, children: [_jsx("span", { className: "mt-1 size-2.5 shrink-0", style: { background: mark } }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("p", { className: "text-body font-medium text-ink", children: title }), description ? (_jsx("p", { className: "mt-1 text-small leading-relaxed text-ink-faint", children: description })) : null, action ? _jsx("div", { className: "mt-3", children: action }) : null] }), onDismiss ? (_jsx(MiniButton, { onClick: onDismiss, "aria-label": dismissLabel, children: _jsx(Icon, { icon: Close, size: "xs" }) })) : null] }));
|
|
191
192
|
}
|
|
192
193
|
/**
|
|
193
194
|
* Where toasts land. Top-right is the default: it is the one corner that
|
|
@@ -199,8 +200,8 @@ const corners = {
|
|
|
199
200
|
"bottom-right": "bottom-6 right-6 items-end",
|
|
200
201
|
"bottom-left": "bottom-6 left-6 items-start",
|
|
201
202
|
};
|
|
202
|
-
export function ToastViewport({ position = "top-right", children, }) {
|
|
203
|
-
return (_jsx("div", { className: `pointer-events-none fixed z-50 flex flex-col gap-2 ${corners[position]}`, children: _jsx("div", { className: "pointer-events-auto flex flex-col gap-2", children: children }) }));
|
|
203
|
+
export function ToastViewport({ position = "top-right", children, ...rest }) {
|
|
204
|
+
return (_jsx("div", { ...dataProps(rest), className: `pointer-events-none fixed z-50 flex flex-col gap-2 ${corners[position]}`, children: _jsx("div", { className: "pointer-events-auto flex flex-col gap-2", children: children }) }));
|
|
204
205
|
}
|
|
205
206
|
/* ---------------------------- dialog --------------------------- */
|
|
206
207
|
/**
|
|
@@ -271,6 +272,6 @@ function DialogShell({ open, onClose, loading, label, size = "md", children, })
|
|
|
271
272
|
export function ConfirmDialog({ open, onClose, onConfirm, title, children, confirmLabel, cancelLabel, closeLabel, tone = "danger", busy = false, confirmDisabled = false, }) {
|
|
272
273
|
return (_jsx(Dialog, { open: open, onClose: onClose, title: title, closeLabel: closeLabel, footer: _jsxs(_Fragment, { children: [_jsx(Button, { type: "button", onClick: onClose, disabled: busy, "data-autofocus": true, children: cancelLabel }), _jsx(Button, { variant: tone, onClick: onConfirm, disabled: busy || confirmDisabled, children: confirmLabel })] }), children: children }));
|
|
273
274
|
}
|
|
274
|
-
export function Dialog({ open, onClose, title, children, footer, loading = false, closeLabel, size = "md", }) {
|
|
275
|
-
return (_jsxs(DialogShell, { open: open, onClose: onClose, loading: loading, label: title, size: size, children: [_jsxs("div", { className: "tamga-head tamga-gutter tamga-section", children: [_jsx("h3", { className: "text-subhead font-semibold", children: title }), _jsx(MiniButton, { onClick: onClose, "aria-label": closeLabel, className: "ml-auto", children: _jsx(Icon, { icon: Close, size: "xs" }) })] }), _jsx("div", { className: cn("tamga-gutter py-6 text-body leading-relaxed", size === "full" && "min-h-0 flex-1 overflow-y-auto"), children: loading ? _jsx(SkeletonPanel, { lines: 4 }) : children }), footer ? (_jsx("div", { className: "tamga-gutter flex justify-end gap-2 border-t border-line py-4", children: footer })) : null] }));
|
|
275
|
+
export function Dialog({ open, onClose, title, children, footer, loading = false, closeLabel, size = "md", ...rest }) {
|
|
276
|
+
return (_jsxs(DialogShell, { open: open, onClose: onClose, loading: loading, label: title, size: size, children: [_jsxs("div", { ...dataProps(rest), className: "tamga-head tamga-gutter tamga-section", children: [_jsx("h3", { className: "text-subhead font-semibold", children: title }), _jsx(MiniButton, { onClick: onClose, "aria-label": closeLabel, className: "ml-auto", children: _jsx(Icon, { icon: Close, size: "xs" }) })] }), _jsx("div", { className: cn("tamga-gutter py-6 text-body leading-relaxed", size === "full" && "min-h-0 flex-1 overflow-y-auto"), children: loading ? _jsx(SkeletonPanel, { lines: 4 }) : children }), footer ? (_jsx("div", { className: "tamga-gutter flex justify-end gap-2 border-t border-line py-4", children: footer })) : null] }));
|
|
276
277
|
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
/** Gösterilecek numaraları hesaplar. `null` = kısaltma. */
|
|
7
7
|
export declare function pageWindow(page: number, pages: number, span?: number): (number | null)[];
|
|
8
|
-
export declare function Pagination({ page, pageSize, total, onChange, labels, span, className, }: {
|
|
8
|
+
export declare function Pagination({ page, pageSize, total, onChange, labels, span, className, ...rest }: {
|
|
9
9
|
/** Starts at 1. TR: 1'den başlar. */
|
|
10
10
|
page: number;
|
|
11
11
|
pageSize: number;
|
|
@@ -34,5 +34,7 @@ export declare function Pagination({ page, pageSize, total, onChange, labels, sp
|
|
|
34
34
|
summary?: (from: number, to: number, total: number) => string;
|
|
35
35
|
};
|
|
36
36
|
className?: string;
|
|
37
|
+
/** `data-*` hooks pass through. TR: `data-*` kancaları geçiyor. */
|
|
38
|
+
[k: `data-${string}`]: unknown;
|
|
37
39
|
}): import("react").JSX.Element;
|
|
38
40
|
//# sourceMappingURL=pagination.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../src/components/pagination.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../src/components/pagination.tsx"],"names":[],"mappings":"AAOA;;;;GAIG;AAEH,2DAA2D;AAC3D,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,SAAI,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAiBnF;AAED,wBAAgB,UAAU,CAAC,EACzB,IAAI,EACJ,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,MAAM,EACN,IAAQ,EACR,SAAS,EACT,GAAG,IAAI,EACR,EAAE;IACD,qCAAqC;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,MAAM,EAAE;QACN,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;QAC5B,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;KAC/D,CAAC;IACF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mEAAmE;IACnE,CAAC,CAAC,EAAE,QAAQ,MAAM,EAAE,GAAG,OAAO,CAAC;CAChC,+BA8DA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { cn } from "../lib/cn.js";
|
|
4
|
+
import { dataProps } from "../lib/data-props.js";
|
|
4
5
|
import { Icon } from "./icon.js";
|
|
5
6
|
import { CaretLeft, CaretRight } from "./icons.js";
|
|
6
7
|
/**
|
|
@@ -29,13 +30,13 @@ export function pageWindow(page, pages, span = 1) {
|
|
|
29
30
|
out.push(pages);
|
|
30
31
|
return out;
|
|
31
32
|
}
|
|
32
|
-
export function Pagination({ page, pageSize, total, onChange, labels, span = 1, className, }) {
|
|
33
|
+
export function Pagination({ page, pageSize, total, onChange, labels, span = 1, className, ...rest }) {
|
|
33
34
|
const pages = total !== undefined ? Math.max(1, Math.ceil(total / pageSize)) : undefined;
|
|
34
35
|
const canPrev = page > 1;
|
|
35
36
|
const canNext = pages === undefined ? true : page < pages;
|
|
36
37
|
const from = (page - 1) * pageSize + 1;
|
|
37
38
|
const to = total !== undefined ? Math.min(page * pageSize, total) : page * pageSize;
|
|
38
|
-
return (_jsxs("nav", { className: cn("flex flex-wrap items-center gap-3", className), "aria-label": labels.page(page), children: [total !== undefined && labels.summary ? (_jsx("span", { className: "tamga-label tabular-nums", children: labels.summary(from, to, total) })) : null, _jsxs("span", { className: "ml-auto flex items-center gap-1.5", children: [_jsx("button", { type: "button", className: "tamga-icon-btn shrink-0", "aria-label": labels.previous, disabled: !canPrev, onClick: () => canPrev && onChange?.(page - 1), children: _jsx(Icon, { icon: CaretLeft, size: "sm" }) }), pages !== undefined
|
|
39
|
+
return (_jsxs("nav", { ...dataProps(rest), className: cn("flex flex-wrap items-center gap-3", className), "aria-label": labels.page(page), children: [total !== undefined && labels.summary ? (_jsx("span", { className: "tamga-label tabular-nums", children: labels.summary(from, to, total) })) : null, _jsxs("span", { className: "ml-auto flex items-center gap-1.5", children: [_jsx("button", { type: "button", className: "tamga-icon-btn shrink-0", "aria-label": labels.previous, disabled: !canPrev, onClick: () => canPrev && onChange?.(page - 1), children: _jsx(Icon, { icon: CaretLeft, size: "sm" }) }), pages !== undefined
|
|
39
40
|
? pageWindow(page, pages, span).map((n, i) => n === null ? (_jsx("span", { className: "px-1 text-small text-ink-faint", "aria-hidden": true, children: "\u2026" }, `gap-${i}`)) : (_jsx("button", { type: "button",
|
|
40
41
|
/* Seçili sayfa DOLGU almaz: "buradasın" bir eylem değildir
|
|
41
42
|
(Yasa 2). Gerekçesi `.tamga-page`'in üstünde — bu satır
|
package/dist/components/pie.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export type PieSlice = {
|
|
|
7
7
|
label: string;
|
|
8
8
|
value: number;
|
|
9
9
|
};
|
|
10
|
-
export declare function PieChart({ slices, total, totalLabel, formatValue, inner, size, className, }: {
|
|
10
|
+
export declare function PieChart({ slices, total, totalLabel, formatValue, inner, size, className, ...rest }: {
|
|
11
11
|
/**
|
|
12
12
|
* Five slices at most: more does not read, and a chart that does not read is wrong
|
|
13
13
|
* information. TR: En çok beş dilim: fazlası okunmuyor, ve okunmayan bir grafik yanlış
|
|
@@ -36,5 +36,7 @@ export declare function PieChart({ slices, total, totalLabel, formatValue, inner
|
|
|
36
36
|
inner?: number;
|
|
37
37
|
size?: number;
|
|
38
38
|
className?: string;
|
|
39
|
+
/** `data-*` hooks pass through. TR: `data-*` kancaları geçiyor. */
|
|
40
|
+
[k: `data-${string}`]: unknown;
|
|
39
41
|
}): import("react").JSX.Element;
|
|
40
42
|
//# sourceMappingURL=pie.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pie.d.ts","sourceRoot":"","sources":["../../src/components/pie.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pie.d.ts","sourceRoot":"","sources":["../../src/components/pie.tsx"],"names":[],"mappings":"AAMA;;;;GAIG;AAEH,MAAM,MAAM,QAAQ,GAAG;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAUF,wBAAgB,QAAQ,CAAC,EACvB,MAAM,EACN,KAAK,EACL,UAAU,EACV,WAAoB,EACpB,KAAY,EACZ,IAAU,EACV,SAAS,EACT,GAAG,IAAI,EACR,EAAE;IACD;;;;OAIG;IACH,MAAM,EAAE,SAAS,QAAQ,EAAE,CAAC;IAC5B;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IACpC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mEAAmE;IACnE,CAAC,CAAC,EAAE,QAAQ,MAAM,EAAE,GAAG,OAAO,CAAC;CAChC,+BAwJA"}
|
package/dist/components/pie.js
CHANGED
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useId, useState } from "react";
|
|
4
4
|
import { cn } from "../lib/cn.js";
|
|
5
|
+
import { dataProps } from "../lib/data-props.js";
|
|
5
6
|
const R = 100;
|
|
6
7
|
/** Kutup koordinatından kartezyene; 0° saat 12 yönü. */
|
|
7
8
|
function nokta(aci, yaricap) {
|
|
8
9
|
const rad = ((aci - 90) * Math.PI) / 180;
|
|
9
10
|
return [R + yaricap * Math.cos(rad), R + yaricap * Math.sin(rad)];
|
|
10
11
|
}
|
|
11
|
-
export function PieChart({ slices, total, totalLabel, formatValue = String, inner = 0.58, size = 200, className, }) {
|
|
12
|
+
export function PieChart({ slices, total, totalLabel, formatValue = String, inner = 0.58, size = 200, className, ...rest }) {
|
|
12
13
|
const id = useId();
|
|
13
14
|
/* Üzerinde durulan dilimin indeksi. Grafik ile legend AYNI durumu paylaşıyor:
|
|
14
15
|
legend satırına gelmek dilimi, dilime gelmek legend satırını vurguluyor.
|
|
@@ -25,7 +26,7 @@ export function PieChart({ slices, total, totalLabel, formatValue = String, inne
|
|
|
25
26
|
aci = son;
|
|
26
27
|
return { ...s, pay, bas, son, renk: `var(--color-chart-${(i % 5) + 1})` };
|
|
27
28
|
});
|
|
28
|
-
return (_jsxs("div", { className: cn("flex flex-wrap items-center gap-6", className), children: [_jsxs("svg", {
|
|
29
|
+
return (_jsxs("div", { ...dataProps(rest), className: cn("flex flex-wrap items-center gap-6", className), children: [_jsxs("svg", {
|
|
29
30
|
/* `viewBox` dilimin dışarı taşan halini de kapsıyor: üzerine gelinen
|
|
30
31
|
dilim 6 birim dışarı kayıyor, ve kutu büyümezse kırpılıyor. */
|
|
31
32
|
viewBox: `-8 -8 ${R * 2 + 16} ${R * 2 + 16}`, width: size, height: size, className: "shrink-0 overflow-visible", role: "img", "aria-labelledby": id, onMouseLeave: () => setUzerinde(null), children: [_jsx("title", { id: id, children: parcalar
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { Tone } from "./tone.js";
|
|
2
2
|
export { Spinner } from "./spinner.js";
|
|
3
|
-
export declare function Separator({ vertical }: {
|
|
3
|
+
export declare function Separator({ vertical, ...rest }: {
|
|
4
4
|
vertical?: boolean;
|
|
5
|
+
[k: `data-${string}`]: unknown;
|
|
5
6
|
}): import("react").JSX.Element;
|
|
6
7
|
/** Running is not a deviation, so the live mark stays neutral — the pulse carries it. */
|
|
7
|
-
export declare function Beacon({ live, label, severity, }: {
|
|
8
|
+
export declare function Beacon({ live, label, severity, ...rest }: {
|
|
8
9
|
live?: boolean;
|
|
9
10
|
label?: string;
|
|
10
11
|
/**
|
|
@@ -12,14 +13,18 @@ export declare function Beacon({ live, label, severity, }: {
|
|
|
12
13
|
* işaret hiçbir şeye üstün gelmez; yarışması için ona bir sıra verin
|
|
13
14
|
*/
|
|
14
15
|
severity?: number | null;
|
|
16
|
+
/** `data-*` hooks pass through. TR: `data-*` kancaları geçiyor. */
|
|
17
|
+
[k: `data-${string}`]: unknown;
|
|
15
18
|
}): import("react").JSX.Element;
|
|
16
|
-
export declare function Alert({ state, title, children, action, }: {
|
|
19
|
+
export declare function Alert({ state, title, children, action, ...rest }: {
|
|
17
20
|
state?: Tone;
|
|
18
21
|
title: string;
|
|
19
22
|
children?: React.ReactNode;
|
|
20
23
|
action?: React.ReactNode;
|
|
24
|
+
/** `data-*` hooks pass through. TR: `data-*` kancaları geçiyor. */
|
|
25
|
+
[k: `data-${string}`]: unknown;
|
|
21
26
|
}): import("react").JSX.Element;
|
|
22
|
-
export declare function Breadcrumb({ items, label, }: {
|
|
27
|
+
export declare function Breadcrumb({ items, label, ...rest }: {
|
|
23
28
|
items: {
|
|
24
29
|
label: string;
|
|
25
30
|
href?: string;
|
|
@@ -29,16 +34,20 @@ export declare function Breadcrumb({ items, label, }: {
|
|
|
29
34
|
* Spinner'daki nota bakın.
|
|
30
35
|
*/
|
|
31
36
|
label: string;
|
|
37
|
+
/** `data-*` hooks pass through. TR: `data-*` kancaları geçiyor. */
|
|
38
|
+
[k: `data-${string}`]: unknown;
|
|
32
39
|
}): import("react").JSX.Element;
|
|
33
|
-
export declare function Field({ label, description, error, children, htmlFor, }: {
|
|
40
|
+
export declare function Field({ label, description, error, children, htmlFor, ...rest }: {
|
|
34
41
|
label: string;
|
|
35
42
|
description?: string;
|
|
36
43
|
error?: string;
|
|
37
44
|
children: React.ReactNode;
|
|
38
45
|
htmlFor?: string;
|
|
46
|
+
/** `data-*` hooks pass through. TR: `data-*` kancaları geçiyor. */
|
|
47
|
+
[k: `data-${string}`]: unknown;
|
|
39
48
|
}): import("react").JSX.Element;
|
|
40
49
|
/** A plain select: the same overlay as the searchable one, without the search. */
|
|
41
|
-
export declare function Select({ options, value, onChange, placeholder, loading, loadingRows, "aria-label": ariaLabel, className, }: {
|
|
50
|
+
export declare function Select({ options, value, onChange, placeholder, loading, loadingRows, "aria-label": ariaLabel, className, ...rest }: {
|
|
42
51
|
options: string[];
|
|
43
52
|
value?: string;
|
|
44
53
|
onChange?: (v: string) => void;
|
|
@@ -81,9 +90,11 @@ export declare function Select({ options, value, onChange, placeholder, loading,
|
|
|
81
90
|
/** Genişlik ve konum çağıranın. Varsayılan `w-56`; `w-full` verildiğinde
|
|
82
91
|
* tailwind-merge onu ezer, yani kontrol kabına uyar. */
|
|
83
92
|
className?: string;
|
|
93
|
+
/** `data-*` hooks pass through. TR: `data-*` kancaları geçiyor. */
|
|
94
|
+
[k: `data-${string}`]: unknown;
|
|
84
95
|
}): import("react").JSX.Element;
|
|
85
96
|
/** Side panel. Overlay plane, so it carries the 6px offset and a scrim. */
|
|
86
|
-
export declare function Sheet({ open, onClose, title, children, footer, loading, closeLabel, side, }: {
|
|
97
|
+
export declare function Sheet({ open, onClose, title, children, footer, loading, closeLabel, side, ...rest }: {
|
|
87
98
|
open: boolean;
|
|
88
99
|
onClose: () => void;
|
|
89
100
|
title: string;
|
|
@@ -113,5 +124,7 @@ export declare function Sheet({ open, onClose, title, children, footer, loading,
|
|
|
113
124
|
* henüz gelmedi; panel bir dönen simge göstermek yerine şeklini koruyor
|
|
114
125
|
*/
|
|
115
126
|
loading?: boolean;
|
|
127
|
+
/** `data-*` hooks pass through. TR: `data-*` kancaları geçiyor. */
|
|
128
|
+
[k: `data-${string}`]: unknown;
|
|
116
129
|
}): import("react").JSX.Element | null;
|
|
117
130
|
//# sourceMappingURL=primitives.d.ts.map
|
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"primitives.d.ts","sourceRoot":"","sources":["../../src/components/primitives.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAYtC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAQvC,wBAAgB,SAAS,CAAC,EAAE,QAAgB,EAAE,GAAG,IAAI,EAAE,EAAE;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,CAAC,CAAC,EAAE,QAAQ,MAAM,EAAE,GAAG,OAAO,CAAA;CAAE,+BAE9G;AAED,yFAAyF;AACzF,wBAAgB,MAAM,CAAC,EACrB,IAAW,EACX,KAAK,EACL,QAAa,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mEAAmE;IACnE,CAAC,CAAC,EAAE,QAAQ,MAAM,EAAE,GAAG,OAAO,CAAC;CAChC,sCAoDA"}
|
|
@@ -7,6 +7,7 @@ import { CaretRight, Check, Close } from "./icons.js";
|
|
|
7
7
|
import { SkeletonOptions, SkeletonPanel } from "./skeleton.js";
|
|
8
8
|
import { useScrollLock } from "../lib/scroll-lock.js";
|
|
9
9
|
import { cn } from "../lib/cn.js";
|
|
10
|
+
import { dataProps } from "../lib/data-props.js";
|
|
10
11
|
import { useFocusTrap, useListKeys } from "./a11y.js";
|
|
11
12
|
import { useLiveClaim } from "./live-scope.js";
|
|
12
13
|
import { Button, MiniButton } from "./button.js";
|
|
@@ -16,29 +17,29 @@ export { Spinner } from "./spinner.js";
|
|
|
16
17
|
* idea — if a component here needs a rule that Foundations does not
|
|
17
18
|
* already state, the rule is missing, not the component.
|
|
18
19
|
* ------------------------------------------------------------------ */
|
|
19
|
-
export function Separator({ vertical = false }) {
|
|
20
|
-
return _jsx("span", { className: vertical ? "tamga-rule-v" : "tamga-rule-h", role: "separator" });
|
|
20
|
+
export function Separator({ vertical = false, ...rest }) {
|
|
21
|
+
return _jsx("span", { ...dataProps(rest), className: vertical ? "tamga-rule-v" : "tamga-rule-h", role: "separator" });
|
|
21
22
|
}
|
|
22
23
|
/** Running is not a deviation, so the live mark stays neutral — the pulse carries it. */
|
|
23
|
-
export function Beacon({ live = true, label, severity = 50, }) {
|
|
24
|
+
export function Beacon({ live = true, label, severity = 50, ...rest }) {
|
|
24
25
|
const pulses = useLiveClaim(live ? severity : null);
|
|
25
|
-
return (_jsxs("span", { className: "inline-flex items-center gap-2", children: [_jsx("span", { className: "tamga-beacon", "data-live": pulses }), label ? _jsx("span", { className: "text-small text-ink-faint", children: label }) : null] }));
|
|
26
|
+
return (_jsxs("span", { ...dataProps(rest), className: "inline-flex items-center gap-2", children: [_jsx("span", { className: "tamga-beacon", "data-live": pulses }), label ? _jsx("span", { className: "text-small text-ink-faint", children: label }) : null] }));
|
|
26
27
|
}
|
|
27
|
-
export function Alert({ state = "caution", title, children, action, }) {
|
|
28
|
+
export function Alert({ state = "caution", title, children, action, ...rest }) {
|
|
28
29
|
const h = toneOf(state);
|
|
29
|
-
return (_jsxs("div", { className: "tamga-alert", style: { borderLeftColor: h.mark }, role: "status", children: [_jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("p", { className: "text-body font-medium text-ink", children: title }), children ? (_jsx("div", { className: "mt-1 text-small leading-relaxed text-ink-soft", children: children })) : null] }), action ? _jsx("div", { className: "shrink-0", children: action }) : null] }));
|
|
30
|
+
return (_jsxs("div", { ...dataProps(rest), className: "tamga-alert", style: { borderLeftColor: h.mark }, role: "status", children: [_jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("p", { className: "text-body font-medium text-ink", children: title }), children ? (_jsx("div", { className: "mt-1 text-small leading-relaxed text-ink-soft", children: children })) : null] }), action ? _jsx("div", { className: "shrink-0", children: action }) : null] }));
|
|
30
31
|
}
|
|
31
|
-
export function Breadcrumb({ items, label, }) {
|
|
32
|
-
return (_jsx("nav", { "aria-label": label, children: _jsx("ol", { className: "flex flex-wrap items-center gap-2 text-body", children: items.map((item, i) => {
|
|
32
|
+
export function Breadcrumb({ items, label, ...rest }) {
|
|
33
|
+
return (_jsx("nav", { ...dataProps(rest), "aria-label": label, children: _jsx("ol", { className: "flex flex-wrap items-center gap-2 text-body", children: items.map((item, i) => {
|
|
33
34
|
const last = i === items.length - 1;
|
|
34
35
|
return (_jsxs("li", { className: "flex items-center gap-2", children: [last ? (_jsx("span", { "aria-current": "page", className: "font-medium text-ink", children: item.label })) : (_jsx("a", { href: item.href ?? "#", className: "tamga-link", children: item.label })), last ? null : (_jsx(Icon, { icon: CaretRight, size: "xs", weight: "bold", className: "text-ink-faint" }))] }, item.label));
|
|
35
36
|
}) }) }));
|
|
36
37
|
}
|
|
37
|
-
export function Field({ label, description, error, children, htmlFor, }) {
|
|
38
|
-
return (_jsxs("div", { className: "flex flex-col gap-2", children: [_jsx("label", { htmlFor: htmlFor, className: "text-small font-medium text-ink", children: label }), children, error ? (_jsx("p", { className: "text-small", style: { color: toneOf("danger").fg }, children: error })) : description ? (_jsx("p", { className: "text-small text-ink-faint", children: description })) : null] }));
|
|
38
|
+
export function Field({ label, description, error, children, htmlFor, ...rest }) {
|
|
39
|
+
return (_jsxs("div", { ...dataProps(rest), className: "flex flex-col gap-2", children: [_jsx("label", { htmlFor: htmlFor, className: "text-small font-medium text-ink", children: label }), children, error ? (_jsx("p", { className: "text-small", style: { color: toneOf("danger").fg }, children: error })) : description ? (_jsx("p", { className: "text-small text-ink-faint", children: description })) : null] }));
|
|
39
40
|
}
|
|
40
41
|
/** A plain select: the same overlay as the searchable one, without the search. */
|
|
41
|
-
export function Select({ options, value, onChange, placeholder, loading = false, loadingRows = 4, "aria-label": ariaLabel, className, }) {
|
|
42
|
+
export function Select({ options, value, onChange, placeholder, loading = false, loadingRows = 4, "aria-label": ariaLabel, className, ...rest }) {
|
|
42
43
|
const [open, setOpen] = useState(false);
|
|
43
44
|
const [inner, setInner] = useState(value ?? "");
|
|
44
45
|
const box = useRef(null);
|
|
@@ -56,14 +57,14 @@ export function Select({ options, value, onChange, placeholder, loading = false,
|
|
|
56
57
|
document.addEventListener("mousedown", away);
|
|
57
58
|
return () => document.removeEventListener("mousedown", away);
|
|
58
59
|
}, [open]);
|
|
59
|
-
return (_jsxs("div", { ref: box, className: cn("relative w-56", className), children: [_jsxs(Button, { full: true, className: "justify-between", "aria-haspopup": "listbox", "aria-expanded": open, "aria-label": ariaLabel, onClick: () => setOpen((o) => !o), children: [_jsx("span", { className: cn("min-w-0 truncate", current ? "" : "text-ink-faint"), children: current || placeholder }), _jsx(Icon, { icon: CaretRight, size: "xs", className: "shrink-0 rotate-90" })] }), open && (_jsxs("div", { ref: list, role: "listbox", className: "tamga-overlay absolute left-0 top-[var(--overlay-below)] z-40 w-full overflow-hidden py-1", "aria-busy": loading || undefined, children: [loading && _jsx(SkeletonOptions, { rows: loadingRows }), !loading && options.map((o) => (_jsxs("button", { role: "option", "aria-selected": o === current, "data-tamga-option": true, className: "tamga-option", "data-selected": o === current, onClick: () => {
|
|
60
|
+
return (_jsxs("div", { ...dataProps(rest), ref: box, className: cn("relative w-56", className), children: [_jsxs(Button, { full: true, className: "justify-between", "aria-haspopup": "listbox", "aria-expanded": open, "aria-label": ariaLabel, onClick: () => setOpen((o) => !o), children: [_jsx("span", { className: cn("min-w-0 truncate", current ? "" : "text-ink-faint"), children: current || placeholder }), _jsx(Icon, { icon: CaretRight, size: "xs", className: "shrink-0 rotate-90" })] }), open && (_jsxs("div", { ref: list, role: "listbox", className: "tamga-overlay absolute left-0 top-[var(--overlay-below)] z-40 w-full overflow-hidden py-1", "aria-busy": loading || undefined, children: [loading && _jsx(SkeletonOptions, { rows: loadingRows }), !loading && options.map((o) => (_jsxs("button", { role: "option", "aria-selected": o === current, "data-tamga-option": true, className: "tamga-option", "data-selected": o === current, onClick: () => {
|
|
60
61
|
setInner(o);
|
|
61
62
|
onChange?.(o);
|
|
62
63
|
setOpen(false);
|
|
63
64
|
}, children: [o, o === current && _jsx(Icon, { icon: Check, size: "xs", weight: "bold", className: "ml-auto" })] }, o)))] }))] }));
|
|
64
65
|
}
|
|
65
66
|
/** Side panel. Overlay plane, so it carries the 6px offset and a scrim. */
|
|
66
|
-
export function Sheet({ open, onClose, title, children, footer, loading = false, closeLabel, side = "end", }) {
|
|
67
|
+
export function Sheet({ open, onClose, title, children, footer, loading = false, closeLabel, side = "end", ...rest }) {
|
|
67
68
|
/* the trap has to be called before any early return, so the hook lives here
|
|
68
69
|
and the null is returned after it */
|
|
69
70
|
const panel = useFocusTrap(open);
|
|
@@ -77,7 +78,7 @@ export function Sheet({ open, onClose, title, children, footer, loading = false,
|
|
|
77
78
|
}, [open, onClose]);
|
|
78
79
|
if (!open)
|
|
79
80
|
return null;
|
|
80
|
-
return (_jsxs("div", { className: cn("fixed inset-0 z-50 flex", side === "start" ? "justify-start" : "justify-end"), children: [_jsx("div", { className: "tamga-scrim absolute inset-0", "aria-hidden": true, onClick: onClose }), _jsxs("aside", { ref: panel, role: "dialog", "aria-modal": true, "aria-label": title,
|
|
81
|
+
return (_jsxs("div", { ...dataProps(rest), className: cn("fixed inset-0 z-50 flex", side === "start" ? "justify-start" : "justify-end"), children: [_jsx("div", { className: "tamga-scrim absolute inset-0", "aria-hidden": true, onClick: onClose }), _jsxs("aside", { ref: panel, role: "dialog", "aria-modal": true, "aria-label": title,
|
|
81
82
|
/* PANEL KAYARAK GİRİYOR, VE GİRDİĞİ KENARDAN.
|
|
82
83
|
Animasyonsuz hâli bir kare içinde beliriyordu: nereden geldiği,
|
|
83
84
|
dolayısıyla nereye geri gideceği okunmuyordu. Kayma yönü `side` ile
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* Progress — an instrument scale.
|
|
3
|
-
*
|
|
4
|
-
* Gerekçe: docs/gerekce/03-grafik-ve-olcum.md
|
|
5
|
-
*/
|
|
6
|
-
export declare function Progress({ value, label, showScale, ariaLabel, className, }: {
|
|
1
|
+
export declare function Progress({ value, label, showScale, ariaLabel, className, ...rest }: {
|
|
7
2
|
/**
|
|
8
3
|
* 0–100; clamped, so a bad number cannot paint outside the track TR: 0–100; sınırlanıyor,
|
|
9
4
|
* yani kötü bir sayı yolun dışına boyayamıyor
|
|
@@ -25,5 +20,7 @@ export declare function Progress({ value, label, showScale, ariaLabel, className
|
|
|
25
20
|
*/
|
|
26
21
|
ariaLabel?: string;
|
|
27
22
|
className?: string;
|
|
23
|
+
/** `data-*` hooks pass through. TR: `data-*` kancaları geçiyor. */
|
|
24
|
+
[k: `data-${string}`]: unknown;
|
|
28
25
|
}): import("react").JSX.Element;
|
|
29
26
|
//# sourceMappingURL=progress.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../src/components/progress.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../src/components/progress.tsx"],"names":[],"mappings":"AASA,wBAAgB,QAAQ,CAAC,EACvB,KAAK,EACL,KAAK,EACL,SAAiB,EACjB,SAAS,EACT,SAAc,EACd,GAAG,IAAI,EACR,EAAE;IACD;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mEAAmE;IACnE,CAAC,CAAC,EAAE,QAAQ,MAAM,EAAE,GAAG,OAAO,CAAC;CAChC,+BA4CA"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { dataProps } from "../lib/data-props.js";
|
|
2
3
|
/**
|
|
3
4
|
* Progress — an instrument scale.
|
|
4
5
|
*
|
|
5
6
|
* Gerekçe: docs/gerekce/03-grafik-ve-olcum.md
|
|
6
7
|
*/
|
|
7
8
|
const TICKS = [10, 20, 30, 40, 50, 60, 70, 80, 90];
|
|
8
|
-
export function Progress({ value, label, showScale = false, ariaLabel, className = "", }) {
|
|
9
|
+
export function Progress({ value, label, showScale = false, ariaLabel, className = "", ...rest }) {
|
|
9
10
|
const pct = Math.max(0, Math.min(100, value));
|
|
10
|
-
return (_jsxs("div", { className: className, children: [_jsxs("div", { className: "tamga-progress", role: "progressbar", "aria-valuenow": Math.round(pct), "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": label ?? ariaLabel ?? "Progress", children: [_jsx("div", { className: "tamga-progress-fill", style: { width: `${pct}%` } }), TICKS.map((t) => (_jsx("span", { "aria-hidden": true, className: "tamga-progress-tick", style: {
|
|
11
|
+
return (_jsxs("div", { ...dataProps(rest), className: className, children: [_jsxs("div", { className: "tamga-progress", role: "progressbar", "aria-valuenow": Math.round(pct), "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": label ?? ariaLabel ?? "Progress", children: [_jsx("div", { className: "tamga-progress-fill", style: { width: `${pct}%` } }), TICKS.map((t) => (_jsx("span", { "aria-hidden": true, className: "tamga-progress-tick", style: {
|
|
11
12
|
left: `${t}%`,
|
|
12
13
|
/* a tick over the fill has to cut out of it, not sit on it */
|
|
13
14
|
background: t <= pct ? "var(--color-page)" : "var(--color-tick)",
|