tamga-ui 0.3.1 → 0.4.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.
Files changed (127) hide show
  1. package/CHANGELOG.md +99 -0
  2. package/dist/components/advanced-input.d.ts +16 -4
  3. package/dist/components/advanced-input.d.ts.map +1 -1
  4. package/dist/components/advanced-input.js +10 -8
  5. package/dist/components/appearance.d.ts +9 -3
  6. package/dist/components/appearance.d.ts.map +1 -1
  7. package/dist/components/appearance.js +7 -6
  8. package/dist/components/avatar.d.ts +6 -2
  9. package/dist/components/avatar.d.ts.map +1 -1
  10. package/dist/components/avatar.js +5 -4
  11. package/dist/components/badge.d.ts +9 -3
  12. package/dist/components/badge.d.ts.map +1 -1
  13. package/dist/components/badge.js +7 -6
  14. package/dist/components/bar.d.ts +3 -1
  15. package/dist/components/bar.d.ts.map +1 -1
  16. package/dist/components/bar.js +3 -2
  17. package/dist/components/chart.d.ts +3 -1
  18. package/dist/components/chart.d.ts.map +1 -1
  19. package/dist/components/chart.js +3 -2
  20. package/dist/components/checkbox.d.ts +3 -1
  21. package/dist/components/checkbox.d.ts.map +1 -1
  22. package/dist/components/checkbox.js +3 -2
  23. package/dist/components/chrome.d.ts +12 -4
  24. package/dist/components/chrome.d.ts.map +1 -1
  25. package/dist/components/chrome.js +9 -8
  26. package/dist/components/combobox.d.ts +3 -1
  27. package/dist/components/combobox.d.ts.map +1 -1
  28. package/dist/components/combobox.js +3 -2
  29. package/dist/components/data-table.d.ts +9 -3
  30. package/dist/components/data-table.d.ts.map +1 -1
  31. package/dist/components/data-table.js +7 -6
  32. package/dist/components/date-picker.d.ts +6 -2
  33. package/dist/components/date-picker.d.ts.map +1 -1
  34. package/dist/components/date-picker.js +5 -4
  35. package/dist/components/disclosure.d.ts +5 -2
  36. package/dist/components/disclosure.d.ts.map +1 -1
  37. package/dist/components/disclosure.js +5 -4
  38. package/dist/components/display.d.ts +43 -10
  39. package/dist/components/display.d.ts.map +1 -1
  40. package/dist/components/display.js +19 -16
  41. package/dist/components/empty-state.d.ts +15 -5
  42. package/dist/components/empty-state.d.ts.map +1 -1
  43. package/dist/components/empty-state.js +11 -10
  44. package/dist/components/error-state.d.ts +3 -1
  45. package/dist/components/error-state.d.ts.map +1 -1
  46. package/dist/components/error-state.js +3 -2
  47. package/dist/components/file-upload.d.ts +3 -1
  48. package/dist/components/file-upload.d.ts.map +1 -1
  49. package/dist/components/file-upload.js +3 -2
  50. package/dist/components/gauge.d.ts +4 -2
  51. package/dist/components/gauge.d.ts.map +1 -1
  52. package/dist/components/gauge.js +5 -4
  53. package/dist/components/layout.d.ts +11 -5
  54. package/dist/components/layout.d.ts.map +1 -1
  55. package/dist/components/layout.js +12 -10
  56. package/dist/components/log-view.d.ts +3 -1
  57. package/dist/components/log-view.d.ts.map +1 -1
  58. package/dist/components/log-view.js +3 -2
  59. package/dist/components/number-input.d.ts +3 -1
  60. package/dist/components/number-input.d.ts.map +1 -1
  61. package/dist/components/number-input.js +3 -2
  62. package/dist/components/overlay.d.ts +18 -6
  63. package/dist/components/overlay.d.ts.map +1 -1
  64. package/dist/components/overlay.js +13 -12
  65. package/dist/components/pagination.d.ts +3 -1
  66. package/dist/components/pagination.d.ts.map +1 -1
  67. package/dist/components/pagination.js +3 -2
  68. package/dist/components/pie.d.ts +3 -1
  69. package/dist/components/pie.d.ts.map +1 -1
  70. package/dist/components/pie.js +3 -2
  71. package/dist/components/primitives.d.ts +20 -7
  72. package/dist/components/primitives.d.ts.map +1 -1
  73. package/dist/components/primitives.js +15 -14
  74. package/dist/components/progress.d.ts +3 -6
  75. package/dist/components/progress.d.ts.map +1 -1
  76. package/dist/components/progress.js +3 -2
  77. package/dist/components/radio-group.d.ts +16 -1
  78. package/dist/components/radio-group.d.ts.map +1 -1
  79. package/dist/components/radio-group.js +4 -3
  80. package/dist/components/rich-text.d.ts +3 -1
  81. package/dist/components/rich-text.d.ts.map +1 -1
  82. package/dist/components/rich-text.js +3 -2
  83. package/dist/components/section.d.ts +3 -1
  84. package/dist/components/section.d.ts.map +1 -1
  85. package/dist/components/section.js +3 -2
  86. package/dist/components/skeleton.d.ts +25 -14
  87. package/dist/components/skeleton.d.ts.map +1 -1
  88. package/dist/components/skeleton.js +24 -18
  89. package/dist/components/slider.d.ts +3 -1
  90. package/dist/components/slider.d.ts.map +1 -1
  91. package/dist/components/slider.js +3 -2
  92. package/dist/components/spinner.d.ts +2 -1
  93. package/dist/components/spinner.d.ts.map +1 -1
  94. package/dist/components/spinner.js +3 -2
  95. package/dist/components/square-picker.d.ts +3 -1
  96. package/dist/components/square-picker.d.ts.map +1 -1
  97. package/dist/components/square-picker.js +3 -2
  98. package/dist/components/stacked-bar.d.ts +3 -1
  99. package/dist/components/stacked-bar.d.ts.map +1 -1
  100. package/dist/components/stacked-bar.js +3 -2
  101. package/dist/components/surface.d.ts +13 -5
  102. package/dist/components/surface.d.ts.map +1 -1
  103. package/dist/components/surface.js +11 -10
  104. package/dist/components/switch.d.ts +3 -1
  105. package/dist/components/switch.d.ts.map +1 -1
  106. package/dist/components/switch.js +3 -2
  107. package/dist/components/tabs.d.ts +3 -1
  108. package/dist/components/tabs.d.ts.map +1 -1
  109. package/dist/components/tabs.js +3 -2
  110. package/dist/components/timeline-strip.d.ts +3 -1
  111. package/dist/components/timeline-strip.d.ts.map +1 -1
  112. package/dist/components/timeline-strip.js +3 -2
  113. package/dist/components/tree-select.d.ts +3 -1
  114. package/dist/components/tree-select.d.ts.map +1 -1
  115. package/dist/components/tree-select.js +3 -2
  116. package/dist/index.d.ts +1 -1
  117. package/dist/index.d.ts.map +1 -1
  118. package/dist/kit.css +65 -1
  119. package/dist/lib/data-props.d.ts +20 -0
  120. package/dist/lib/data-props.d.ts.map +1 -0
  121. package/dist/lib/data-props.js +25 -0
  122. package/dist/patterns/wizard-template.d.ts +11 -5
  123. package/dist/patterns/wizard-template.d.ts.map +1 -1
  124. package/dist/patterns/wizard-template.js +1 -1
  125. package/dist/styles.css +1 -1
  126. package/dist/theme.css +1 -1
  127. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -5,6 +5,105 @@ Versions follow [semver](https://semver.org/). Through `0.x`, breaking changes m
5
5
 
6
6
  > 🇹🇷 Türkçe için [tamga.org.tr/tr](https://tamga.org.tr/tr).
7
7
 
8
+ ## 0.4.0
9
+
10
+ **A step now has an identity of its own.** `Steps` took a plain `readonly string[]`, so a step was
11
+ nothing but its translated label. Two consequences followed, and both were silent.
12
+
13
+ The React key was the label. Change the language and every step becomes, to React, a different
14
+ element: the old node is torn down and a new one built in its place. Nothing looks wrong, but
15
+ anything holding on to that node goes with it. Two steps sharing a label collided the same way.
16
+
17
+ And there was no way to reach a single step. A caller who needed to point at one, to test it or to
18
+ style it, had nothing to point with; the only thing in the DOM that told steps apart was the
19
+ translated text, which is the one thing that changes underneath a test. The sibling component for
20
+ picking one of several options had carried per-option hooks since 0.3.1. The step strip had not,
21
+ and a gate exemption recorded that gap as though it were a decision.
22
+
23
+ ### Breaking
24
+
25
+ - **`Steps.steps`** is now `readonly Step[]` instead of `readonly string[]`, where
26
+ `Step = { key: string; label: string } & Record<string, unknown>`. Anything beyond `key` and
27
+ `label` lands on that step's `<li>`.
28
+
29
+ ```diff
30
+ - <Steps steps={["Details", "Connection", "Done"]} current={1} />
31
+ + <Steps
32
+ + steps={[
33
+ + { key: "details", label: "Details" },
34
+ + { key: "connection", label: "Connection" },
35
+ + { key: "done", label: "Done" },
36
+ + ]}
37
+ + current={1}
38
+ + />
39
+ ```
40
+
41
+ The key is an identifier, so it is not translated; the label is. A caller that already had keys
42
+ for its steps passes them straight through.
43
+
44
+ - **`WizardStep` is now an alias of `Step`.** It was a second declaration of the same shape, and
45
+ the template flattened it to labels before drawing the strip, which is exactly where the identity
46
+ was being dropped. Code that already builds `{ key, label }` objects needs no change.
47
+
48
+ ### Added
49
+
50
+ - **`RadioGroup.look`** — `list` (default), `chip` or `card`. Only the shell changes: the role, the
51
+ mark, the keyboard behaviour and `aria-checked` are identical in all three, and the selected shell
52
+ takes an outline and a hard offset rather than a fill.
53
+
54
+ The card shape was missing, so a product that wanted "one of N, drawn as cards" built it from a
55
+ stack of bare buttons. The picture came out right and the meaning did not: a screen reader
56
+ announced three separate buttons instead of one choice among three. Rebuilding the role and the
57
+ keyboard at every call site is work, and it is done incompletely every time.
58
+
59
+ A second line goes inside `label`, which is already a `ReactNode`. There is no separate `hint`
60
+ field, because a prop that means something in only one shell is a lie told to everyone reading the
61
+ props table.
62
+
63
+ - **`PasswordInput.invalid`** — the sibling text field had it, this one did not, so a caller marking
64
+ a wrong password had to write the kit's class by hand. The class is only half of it: the hand-written
65
+ route never carried `aria-invalid`, so the error was visible and never announced.
66
+
67
+ ### Fixed
68
+
69
+ - The step strip no longer remounts its list items when labels change.
70
+
71
+ - **`PasswordInput` now reads the kit's own class table** instead of writing `tamga-input` by hand.
72
+ A rule added to the table reached every text field except this one, which is the same defect the
73
+ library asks its consumers not to introduce.
74
+
75
+ ## 0.3.2
76
+
77
+ **Every component that draws a host element now accepts `data-*`.** 98 of them; before this, 79 did
78
+ not.
79
+
80
+ A `data-*` attribute is inert: it binds to no behaviour, it only carries a hook for a test, a style
81
+ or an analytics reader. Refusing it cannot protect a component from anything. What it does instead
82
+ is push the caller off the component entirely — a hook is needed, the component will not take it,
83
+ so the class goes on a hand-written element and every guard that came with the component stays
84
+ behind: the clip that keeps a menu whole inside a card, the wrapper that lets a table scroll on a
85
+ narrow screen, the button that a keyboard can reach. None of it errors. The attribute is simply
86
+ absent, and so is the behaviour.
87
+
88
+ `aria-*` is deliberately not in this passthrough. It is not inert: an `aria-label` from outside
89
+ silently overrides the accessible name a component computed for itself. Accessibility is asked for
90
+ by an explicit prop.
91
+
92
+ `Segmented` and `Steps` are the two exceptions, and the reason is written into the gate: their hooks
93
+ belong to the individual option, not the wrapper, and `options[]` already carries them.
94
+
95
+ ### Added
96
+
97
+ - **`Card.as`** — `div` (default), `section`, `article` or `ul`. A card is usually a *section*, and
98
+ the element is document structure rather than a presentation choice.
99
+
100
+ ### Internal
101
+
102
+ - **`check-data-props`** — a 17th gate. It reads every exported component that renders a host
103
+ element and fails if it cannot take `data-*`. The five fixes that preceded this release were five
104
+ separate discoveries of one defect, found one call site at a time; this gate finds all of them in
105
+ one pass.
106
+
8
107
  ## 0.3.1
9
108
 
10
109
  Three components refused something a consumer legitimately needed, and in each case the way out was
@@ -3,11 +3,17 @@
3
3
  *
4
4
  * Gerekçe: docs/gerekce/01-form-ve-girdi.md
5
5
  */
6
- export declare function PasswordInput({ labels, className, ...props }: Omit<React.ComponentProps<"input">, "type"> & {
6
+ export declare function PasswordInput({ labels, invalid, className, ...props }: Omit<React.ComponentProps<"input">, "type"> & {
7
7
  labels: {
8
8
  show: string;
9
9
  hide: string;
10
10
  };
11
+ /**
12
+ * The field failed validation: it takes the error edge and sets `aria-invalid`, so the failure is
13
+ * announced as well as shown. TR: Alan doğrulamadan geçemedi: hata kenarını alıyor ve
14
+ * `aria-invalid` koyuyor, yani hata görünmekle kalmıyor duyuruluyor da.
15
+ */
16
+ invalid?: boolean;
11
17
  }): import("react").JSX.Element;
12
18
  /**
13
19
  * Maskeli sır — API anahtarı, webhook secret.
@@ -20,7 +26,7 @@ export declare function PasswordInput({ labels, className, ...props }: Omit<Reac
20
26
  * "hangi anahtar bu" sorusunu cevapsız bırakır; üç anahtarı olan biri
21
27
  * hangisine baktığını bilemez.
22
28
  */
23
- export declare function SecretField({ value, labels, visibleChars, className, }: {
29
+ export declare function SecretField({ value, labels, visibleChars, className, ...rest }: {
24
30
  value: string;
25
31
  labels: {
26
32
  reveal: string;
@@ -35,6 +41,8 @@ export declare function SecretField({ value, labels, visibleChars, className, }:
35
41
  */
36
42
  visibleChars?: number;
37
43
  className?: string;
44
+ /** `data-*` hooks pass through. TR: `data-*` kancaları geçiyor. */
45
+ [k: `data-${string}`]: unknown;
38
46
  }): import("react").JSX.Element;
39
47
  /**
40
48
  * Etiket girdisi.
@@ -47,7 +55,7 @@ export declare function SecretField({ value, labels, visibleChars, className, }:
47
55
  * yazmak bir hata değil, bir tekrardır, ve kullanıcı zaten istediğini almış
48
56
  * olur.
49
57
  */
50
- export declare function TagsInput({ value, onChange, placeholder, labels, max, className, }: {
58
+ export declare function TagsInput({ value, onChange, placeholder, labels, max, className, ...rest }: {
51
59
  value: readonly string[];
52
60
  onChange: (next: string[]) => void;
53
61
  placeholder: string;
@@ -57,6 +65,8 @@ export declare function TagsInput({ value, onChange, placeholder, labels, max, c
57
65
  /** The ceiling; the input closes once it is full. TR: Üst sınır; dolduğunda girdi kapanır. */
58
66
  max?: number;
59
67
  className?: string;
68
+ /** `data-*` hooks pass through. TR: `data-*` kancaları geçiyor. */
69
+ [k: `data-${string}`]: unknown;
60
70
  }): import("react").JSX.Element;
61
71
  /**
62
72
  * Çoklu seçim — aranabilir.
@@ -69,7 +79,7 @@ export declare function TagsInput({ value, onChange, placeholder, labels, max, c
69
79
  * değil: seçim ile seçilenler arasındaki mesafe arttıkça, kullanıcı neyi
70
80
  * seçtiğini görmek için gözünü iki yere birden koymak zorunda kalır.
71
81
  */
72
- export declare function MultiSelect({ options, value, onChange, placeholder, labels, className, }: {
82
+ export declare function MultiSelect({ options, value, onChange, placeholder, labels, className, ...rest }: {
73
83
  options: readonly {
74
84
  value: string;
75
85
  label: string;
@@ -84,6 +94,8 @@ export declare function MultiSelect({ options, value, onChange, placeholder, lab
84
94
  open: string;
85
95
  };
86
96
  className?: string;
97
+ /** `data-*` hooks pass through. TR: `data-*` kancaları geçiyor. */
98
+ [k: `data-${string}`]: unknown;
87
99
  }): import("react").JSX.Element;
88
100
  /**
89
101
  * Zamanlama girdisi — "her N dakikada bir".
@@ -1 +1 @@
1
- {"version":3,"file":"advanced-input.d.ts","sourceRoot":"","sources":["../../src/components/advanced-input.tsx"],"names":[],"mappings":"AAcA;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,EAC5B,MAAM,EACN,SAAS,EACT,GAAG,KAAK,EACT,EAAE,IAAI,CAAC,KAAK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AK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACpE,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mEAAmE;IACnE,CAAC,CAAC,EAAE,QAAQ,MAAM,EAAE,GAAG,OAAO,CAAC;CAChC,+BAwJA;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,QAAQ,EACR,OAAO,EACP,KAAK,EACL,SAAS,GACV,EAAE;IACD,6DAA6D;IAC7D,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC;;;OAGG;IACH,OAAO,EAAE,SAAS;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACvD,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,+BAeA"}
@@ -2,6 +2,8 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useEffect, useId, useRef, useState } from "react";
4
4
  import { cn } from "../lib/cn.js";
5
+ import { inputVariants } from "./input.js";
6
+ import { dataProps } from "../lib/data-props.js";
5
7
  import { Icon } from "./icon.js";
6
8
  import { Check, Close, Customize, Eye, EyeSlash, Search } from "./icons.js";
7
9
  /* ------------------------------------------------------------------ *
@@ -15,9 +17,9 @@ import { Check, Close, Customize, Eye, EyeSlash, Search } from "./icons.js";
15
17
  *
16
18
  * Gerekçe: docs/gerekce/01-form-ve-girdi.md
17
19
  */
18
- export function PasswordInput({ labels, className, ...props }) {
20
+ export function PasswordInput({ labels, invalid = false, className, ...props }) {
19
21
  const [shown, setShown] = useState(false);
20
- return (_jsxs("span", { className: "relative flex items-center", children: [_jsx("input", { ...props, type: shown ? "text" : "password", className: cn("tamga-input w-full pr-10", className) }), _jsx("button", { type: "button", className: "tamga-mini-btn absolute right-1.5", "aria-label": shown ? labels.hide : labels.show, "aria-pressed": shown, onClick: () => setShown((v) => !v), children: _jsx(Icon, { icon: shown ? EyeSlash : Eye, size: "xs" }) })] }));
22
+ return (_jsxs("span", { className: "relative flex items-center", children: [_jsx("input", { type: shown ? "text" : "password", "aria-invalid": invalid || undefined, className: cn(inputVariants({ invalid }), "w-full pr-11", className), ...props }), _jsx("button", { type: "button", className: "tamga-field-btn", "aria-label": shown ? labels.hide : labels.show, "aria-pressed": shown, onClick: () => setShown((v) => !v), children: _jsx(Icon, { icon: shown ? EyeSlash : Eye, size: "xs" }) })] }));
21
23
  }
22
24
  /**
23
25
  * Maskeli sır — API anahtarı, webhook secret.
@@ -30,7 +32,7 @@ export function PasswordInput({ labels, className, ...props }) {
30
32
  * "hangi anahtar bu" sorusunu cevapsız bırakır; üç anahtarı olan biri
31
33
  * hangisine baktığını bilemez.
32
34
  */
33
- export function SecretField({ value, labels, visibleChars = 4, className, }) {
35
+ export function SecretField({ value, labels, visibleChars = 4, className, ...rest }) {
34
36
  const [shown, setShown] = useState(false);
35
37
  const [copied, setCopied] = useState("idle");
36
38
  const timer = useRef(undefined);
@@ -55,7 +57,7 @@ export function SecretField({ value, labels, visibleChars = 4, className, }) {
55
57
  window.clearTimeout(timer.current);
56
58
  timer.current = window.setTimeout(() => setCopied("idle"), 1600);
57
59
  }
58
- return (_jsxs("span", { className: cn("relative flex items-center", className), children: [_jsx("input", { readOnly: true, value: shown ? value : masked, className: "tamga-input w-full pr-18 font-mono",
60
+ return (_jsxs("span", { ...dataProps(rest), className: cn("relative flex items-center", className), children: [_jsx("input", { readOnly: true, value: shown ? value : masked, className: "tamga-input w-full pr-18 font-mono",
59
61
  /* Salt-okunur bir alan yine de odaklanabilir olmalı: kullanıcı onu
60
62
  seçip elle kopyalayabilsin. `disabled` bunu imkânsız kılardı. */
61
63
  onFocus: (e) => e.currentTarget.select() }), _jsxs("span", { className: "absolute right-1.5 flex gap-0.5", children: [_jsx("button", { type: "button", className: "tamga-mini-btn", "aria-label": shown ? labels.hide : labels.reveal, "aria-pressed": shown, onClick: () => setShown((v) => !v), children: _jsx(Icon, { icon: shown ? EyeSlash : Eye, size: "xs" }) }), _jsx("button", { type: "button", className: "tamga-mini-btn", "aria-label": copied === "done" ? labels.copied : copied === "failed" ? labels.failed : labels.copy, onClick: copy, children: _jsx(Icon, { icon: copied === "done" ? Check : Customize, size: "xs" }) })] })] }));
@@ -71,7 +73,7 @@ export function SecretField({ value, labels, visibleChars = 4, className, }) {
71
73
  * yazmak bir hata değil, bir tekrardır, ve kullanıcı zaten istediğini almış
72
74
  * olur.
73
75
  */
74
- export function TagsInput({ value, onChange, placeholder, labels, max, className, }) {
76
+ export function TagsInput({ value, onChange, placeholder, labels, max, className, ...rest }) {
75
77
  const [draft, setDraft] = useState("");
76
78
  const full = max !== undefined && value.length >= max;
77
79
  function commit() {
@@ -81,7 +83,7 @@ export function TagsInput({ value, onChange, placeholder, labels, max, className
81
83
  return;
82
84
  onChange([...value, tag]);
83
85
  }
84
- return (_jsxs("span", { className: cn("tamga-input h-auto min-h-10 w-full flex-wrap items-center gap-1.5 py-1.5", className), style: { display: "flex" }, children: [value.map((tag) => (_jsxs("span", { className: "tamga-chip gap-1", children: [tag, _jsx("button", { type: "button", "aria-label": labels.remove(tag), onClick: () => onChange(value.filter((x) => x !== tag)), className: "-mr-1 inline-flex items-center", children: _jsx(Icon, { icon: Close, size: "xs" }) })] }, tag))), !full ? (_jsx("input", { value: draft, placeholder: value.length === 0 ? placeholder : undefined, onChange: (e) => setDraft(e.target.value), onBlur: commit, onKeyDown: (e) => {
86
+ return (_jsxs("span", { ...dataProps(rest), className: cn("tamga-input h-auto min-h-10 w-full flex-wrap items-center gap-1.5 py-1.5", className), style: { display: "flex" }, children: [value.map((tag) => (_jsxs("span", { className: "tamga-chip gap-1", children: [tag, _jsx("button", { type: "button", "aria-label": labels.remove(tag), onClick: () => onChange(value.filter((x) => x !== tag)), className: "-mr-1 inline-flex items-center", children: _jsx(Icon, { icon: Close, size: "xs" }) })] }, tag))), !full ? (_jsx("input", { value: draft, placeholder: value.length === 0 ? placeholder : undefined, onChange: (e) => setDraft(e.target.value), onBlur: commit, onKeyDown: (e) => {
85
87
  if (e.key === "Enter" || e.key === ",") {
86
88
  e.preventDefault();
87
89
  commit();
@@ -102,7 +104,7 @@ export function TagsInput({ value, onChange, placeholder, labels, max, className
102
104
  * değil: seçim ile seçilenler arasındaki mesafe arttıkça, kullanıcı neyi
103
105
  * seçtiğini görmek için gözünü iki yere birden koymak zorunda kalır.
104
106
  */
105
- export function MultiSelect({ options, value, onChange, placeholder, labels, className, }) {
107
+ export function MultiSelect({ options, value, onChange, placeholder, labels, className, ...rest }) {
106
108
  const id = useId();
107
109
  const [open, setOpen] = useState(false);
108
110
  const [query, setQuery] = useState("");
@@ -157,7 +159,7 @@ export function MultiSelect({ options, value, onChange, placeholder, labels, cla
157
159
  if (e.key === "Escape")
158
160
  setOpen(false);
159
161
  }
160
- return (_jsxs("div", { ref: box, className: cn("relative", className),
162
+ return (_jsxs("div", { ...dataProps(rest), ref: box, className: cn("relative", className),
161
163
  /* Odak kutunun DIŞINA çıkınca kapanıyor — tıklama dinleyicisiyle değil.
162
164
  Dışarı tıklamayı dinlemek klavyeyle çıkanı görmez ve liste açık kalır. */
163
165
  onBlur: (e) => {
@@ -9,7 +9,7 @@ export type SwatchOption = {
9
9
  * Brand colour chosen from a few squares, or written by hand.
10
10
  * TR: Birkaç kareden seçilen ya da elle yazılan marka rengi.
11
11
  */
12
- export declare function ColorSwatches({ options, value, onChange, customLabel, custom, className, }: {
12
+ export declare function ColorSwatches({ options, value, onChange, customLabel, custom, className, ...rest }: {
13
13
  options: readonly SwatchOption[];
14
14
  value: string;
15
15
  onChange: (hex: string) => void;
@@ -18,6 +18,8 @@ export declare function ColorSwatches({ options, value, onChange, customLabel, c
18
18
  /** Whether a free colour is offered at all. TR: Serbest rengin hiç sunulup sunulmadığı. */
19
19
  custom?: boolean;
20
20
  className?: string;
21
+ /** `data-*` hooks pass through. TR: `data-*` kancaları geçiyor. */
22
+ [k: `data-${string}`]: unknown;
21
23
  }): import("react").JSX.Element;
22
24
  export type ThemeChoice = "light" | "dark" | "system";
23
25
  /**
@@ -31,7 +33,7 @@ export type ThemeChoice = "light" | "dark" | "system";
31
33
  * kullanıcı sonucu görmek istiyor. "Sistem" iki yarımı tek karede gösteriyor,
32
34
  * anlamı tam olarak bu.
33
35
  */
34
- export declare function ThemeCards({ value, onChange, labels, className, }: {
36
+ export declare function ThemeCards({ value, onChange, labels, className, ...rest }: {
35
37
  value: ThemeChoice;
36
38
  onChange: (next: ThemeChoice) => void;
37
39
  /** The three names and the group's accessible name. TR: Üç ad ve kümenin erişilebilir adı. */
@@ -42,6 +44,8 @@ export declare function ThemeCards({ value, onChange, labels, className, }: {
42
44
  group: string;
43
45
  };
44
46
  className?: string;
47
+ /** `data-*` hooks pass through. TR: `data-*` kancaları geçiyor. */
48
+ [k: `data-${string}`]: unknown;
45
49
  }): import("react").JSX.Element;
46
50
  /**
47
51
  * One image with a preview, a replace and a remove.
@@ -53,7 +57,7 @@ export declare function ThemeCards({ value, onChange, labels, className, }: {
53
57
  * TR: `FileUpload` DEĞİL: o bir GALERİ (çoklu seçim, sıralama okları, "kapak"
54
58
  * rozeti). Ürün fotoğrafları için doğru, tek bir logo için yanlış.
55
59
  */
56
- export declare function ImageField({ value, onChange, maxEdge, labels, preview, extra, className, }: {
60
+ export declare function ImageField({ value, onChange, maxEdge, labels, preview, extra, className, ...rest }: {
57
61
  value: string | null;
58
62
  onChange: (next: string | null) => void;
59
63
  /** Longest edge of the stored image, in pixels. TR: Saklanan görselin en uzun kenarı, piksel. */
@@ -74,5 +78,7 @@ export declare function ImageField({ value, onChange, maxEdge, labels, preview,
74
78
  /** An extra control beside the buttons. TR: Düğmelerin yanına giren ek kontrol. */
75
79
  extra?: ReactNode;
76
80
  className?: string;
81
+ /** `data-*` hooks pass through. TR: `data-*` kancaları geçiyor. */
82
+ [k: `data-${string}`]: unknown;
77
83
  }): import("react").JSX.Element;
78
84
  //# sourceMappingURL=appearance.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"appearance.d.ts","sourceRoot":"","sources":["../../src/components/appearance.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA2B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAchE,MAAM,MAAM,YAAY,GAAG;IACzB,8DAA8D;IAC9D,GAAG,EAAE,MAAM,CAAC;IACZ,kHAAkH;IAClH,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;;GAGG;AACH,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,KAAK,EACL,QAAQ,EACR,WAAW,EACX,MAAa,EACb,SAAS,GACV,EAAE;IACD,OAAO,EAAE,SAAS,YAAY,EAAE,CAAC;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,uGAAuG;IACvG,WAAW,EAAE,MAAM,CAAC;IACpB,2FAA2F;IAC3F,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,+BAqCA;AAED,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;AAoBtD;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,QAAQ,EACR,MAAM,EACN,SAAS,GACV,EAAE;IACD,KAAK,EAAE,WAAW,CAAC;IACnB,QAAQ,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,IAAI,CAAC;IACtC,8FAA8F;IAC9F,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IACvE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,+BA6BA;AAED;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,QAAQ,EACR,OAAO,EACP,MAAM,EACN,OAAO,EACP,KAAK,EACL,SAAS,GACV,EAAE;IACD,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACxC,iGAAiG;IACjG,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE;QACN,gGAAgG;QAChG,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,MAAM,CAAC;QACd,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,MAAM,CAAC;QAClB,eAAe,EAAE,MAAM,CAAC;KACzB,CAAC;IACF,+HAA+H;IAC/H,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,SAAS,CAAC;IACpC,mFAAmF;IACnF,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,+BAoDA"}
1
+ {"version":3,"file":"appearance.d.ts","sourceRoot":"","sources":["../../src/components/appearance.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA2B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAehE,MAAM,MAAM,YAAY,GAAG;I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ACR,OAAO,EACP,MAAM,EACN,OAAO,EACP,KAAK,EACL,SAAS,EACT,GAAG,IAAI,EACR,EAAE;IACD,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACxC,iGAAiG;IACjG,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE;QACN,gGAAgG;QAChG,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,MAAM,CAAC;QACd,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,MAAM,CAAC;QAClB,eAAe,EAAE,MAAM,CAAC;KACzB,CAAC;IACF,+HAA+H;IAC/H,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,SAAS,CAAC;IACpC,mFAAmF;IACnF,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mEAAmE;IACnE,CAAC,CAAC,EAAE,QAAQ,MAAM,EAAE,GAAG,OAAO,CAAC;CAChC,+BAoDA"}
@@ -2,6 +2,7 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useId, useRef, useState } from "react";
4
4
  import { cn } from "../lib/cn.js";
5
+ import { dataProps } from "../lib/data-props.js";
5
6
  import { IMAGE_ACCEPT, prepareImage } from "../lib/image.js";
6
7
  import { Alert } from "./primitives.js";
7
8
  import { Button } from "./button.js";
@@ -9,10 +10,10 @@ import { Button } from "./button.js";
9
10
  * Brand colour chosen from a few squares, or written by hand.
10
11
  * TR: Birkaç kareden seçilen ya da elle yazılan marka rengi.
11
12
  */
12
- export function ColorSwatches({ options, value, onChange, customLabel, custom = true, className, }) {
13
+ export function ColorSwatches({ options, value, onChange, customLabel, custom = true, className, ...rest }) {
13
14
  const secili = (hex) => hex.toLowerCase() === value.toLowerCase();
14
15
  const hazirMi = options.some((o) => secili(o.hex));
15
- return (_jsxs("span", { className: cn("flex flex-wrap items-center gap-3", className), children: [options.map((o) => (_jsx("button", { type: "button", className: "tamga-swatch", "data-selected": secili(o.hex), "aria-label": o.label, title: o.label, onClick: () => onChange(o.hex), children: _jsx("span", { "aria-hidden": true, style: { background: o.hex } }) }, o.hex))), custom ? (_jsxs("label", { className: "tamga-swatch", "data-selected": !hazirMi, title: customLabel, children: [_jsx("span", { className: "sr-only", children: customLabel }), _jsx("input", { type: "color", value: hazirMi ? options[0].hex : value, onChange: (e) => onChange(e.target.value), className: "tamga-color-input", "aria-label": customLabel })] })) : null] }));
16
+ return (_jsxs("span", { ...dataProps(rest), className: cn("flex flex-wrap items-center gap-3", className), children: [options.map((o) => (_jsx("button", { type: "button", className: "tamga-swatch", "data-selected": secili(o.hex), "aria-label": o.label, title: o.label, onClick: () => onChange(o.hex), children: _jsx("span", { "aria-hidden": true, style: { background: o.hex } }) }, o.hex))), custom ? (_jsxs("label", { className: "tamga-swatch", "data-selected": !hazirMi, title: customLabel, children: [_jsx("span", { className: "sr-only", children: customLabel }), _jsx("input", { type: "color", value: hazirMi ? options[0].hex : value, onChange: (e) => onChange(e.target.value), className: "tamga-color-input", "aria-label": customLabel })] })) : null] }));
16
17
  }
17
18
  function Yarim({ theme }) {
18
19
  return (_jsxs("span", { className: "tamga-theme-half", "data-theme": theme, "aria-hidden": true, children: [_jsxs("span", { className: "tamga-theme-rail", children: [_jsx("span", { className: "tamga-theme-dot", "data-accent": "true" }), _jsx("span", { className: "tamga-theme-dot" }), _jsx("span", { className: "tamga-theme-dot" })] }), _jsxs("span", { className: "tamga-theme-body", children: [_jsx("span", { className: "tamga-theme-line", style: { width: "70%" } }), _jsx("span", { className: "tamga-theme-line", style: { width: "45%" } }), _jsx("span", { className: "tamga-theme-line", "data-accent": "true", style: { width: "30%" } }), _jsx("span", { className: "tamga-theme-line", style: { width: "60%" } })] })] }));
@@ -28,13 +29,13 @@ function Yarim({ theme }) {
28
29
  * kullanıcı sonucu görmek istiyor. "Sistem" iki yarımı tek karede gösteriyor,
29
30
  * anlamı tam olarak bu.
30
31
  */
31
- export function ThemeCards({ value, onChange, labels, className, }) {
32
+ export function ThemeCards({ value, onChange, labels, className, ...rest }) {
32
33
  const secenekler = [
33
34
  { deger: "light", ad: labels.light },
34
35
  { deger: "dark", ad: labels.dark },
35
36
  { deger: "system", ad: labels.system },
36
37
  ];
37
- return (_jsx("div", { role: "radiogroup", "aria-label": labels.group, className: cn("flex flex-wrap gap-3", className), children: secenekler.map((s) => (_jsxs("button", { type: "button", role: "radio", "aria-checked": value === s.deger, tabIndex: value === s.deger ? 0 : -1, "data-selected": value === s.deger, className: "tamga-theme-card", onClick: () => onChange(s.deger), children: [_jsxs("span", { className: "tamga-theme-box", children: [s.deger === "dark" ? _jsx(Yarim, { theme: "dark" }) : _jsx(Yarim, { theme: "light" }), s.deger === "system" ? _jsx(Yarim, { theme: "dark" }) : null] }), _jsx("span", { className: "tamga-theme-name", children: s.ad })] }, s.deger))) }));
38
+ return (_jsx("div", { ...dataProps(rest), role: "radiogroup", "aria-label": labels.group, className: cn("flex flex-wrap gap-3", className), children: secenekler.map((s) => (_jsxs("button", { type: "button", role: "radio", "aria-checked": value === s.deger, tabIndex: value === s.deger ? 0 : -1, "data-selected": value === s.deger, className: "tamga-theme-card", onClick: () => onChange(s.deger), children: [_jsxs("span", { className: "tamga-theme-box", children: [s.deger === "dark" ? _jsx(Yarim, { theme: "dark" }) : _jsx(Yarim, { theme: "light" }), s.deger === "system" ? _jsx(Yarim, { theme: "dark" }) : null] }), _jsx("span", { className: "tamga-theme-name", children: s.ad })] }, s.deger))) }));
38
39
  }
39
40
  /**
40
41
  * One image with a preview, a replace and a remove.
@@ -46,7 +47,7 @@ export function ThemeCards({ value, onChange, labels, className, }) {
46
47
  * TR: `FileUpload` DEĞİL: o bir GALERİ (çoklu seçim, sıralama okları, "kapak"
47
48
  * rozeti). Ürün fotoğrafları için doğru, tek bir logo için yanlış.
48
49
  */
49
- export function ImageField({ value, onChange, maxEdge, labels, preview, extra, className, }) {
50
+ export function ImageField({ value, onChange, maxEdge, labels, preview, extra, className, ...rest }) {
50
51
  const id = useId();
51
52
  const girdi = useRef(null);
52
53
  const [hata, setHata] = useState(null);
@@ -69,5 +70,5 @@ export function ImageField({ value, onChange, maxEdge, labels, preview, extra, c
69
70
  girdi.current.value = "";
70
71
  }
71
72
  }
72
- return (_jsxs("div", { className: cn("flex flex-col gap-3", className), children: [_jsx("input", { ref: girdi, id: id, type: "file", accept: IMAGE_ACCEPT, className: "sr-only", onChange: (e) => al(e.target.files?.[0]) }), _jsxs("div", { className: "flex flex-wrap items-center gap-4", children: [_jsx("span", { className: "tamga-image-field", "data-empty": value ? undefined : "true", children: value ? preview(value) : labels.empty }), _jsxs("span", { className: "flex flex-wrap items-center gap-2", children: [_jsx(Button, { type: "button", onClick: () => girdi.current?.click(), children: value ? labels.replace : labels.upload }), extra, value ? (_jsx(Button, { type: "button", variant: "ghost", onClick: () => onChange(null), children: labels.remove })) : null] })] }), hata ? _jsx(Alert, { state: "danger", title: hata }) : null] }));
73
+ return (_jsxs("div", { ...dataProps(rest), className: cn("flex flex-col gap-3", className), children: [_jsx("input", { ref: girdi, id: id, type: "file", accept: IMAGE_ACCEPT, className: "sr-only", onChange: (e) => al(e.target.files?.[0]) }), _jsxs("div", { className: "flex flex-wrap items-center gap-4", children: [_jsx("span", { className: "tamga-image-field", "data-empty": value ? undefined : "true", children: value ? preview(value) : labels.empty }), _jsxs("span", { className: "flex flex-wrap items-center gap-2", children: [_jsx(Button, { type: "button", onClick: () => girdi.current?.click(), children: value ? labels.replace : labels.upload }), extra, value ? (_jsx(Button, { type: "button", variant: "ghost", onClick: () => onChange(null), children: labels.remove })) : null] })] }), hata ? _jsx(Alert, { state: "danger", title: hata }) : null] }));
73
74
  }
@@ -1,5 +1,5 @@
1
1
  /** Square, monochrome. Identity is text — color is reserved for health. */
2
- export declare function Avatar({ name, size, src, bare, letters, }: {
2
+ export declare function Avatar({ name, size, src, bare, letters, ...rest }: {
3
3
  name: string;
4
4
  size?: number;
5
5
  /**
@@ -28,6 +28,8 @@ export declare function Avatar({ name, size, src, bare, letters, }: {
28
28
  * harf ise yarım okunamaz. `AvatarStack` bu yüzden 1 geçiyor.
29
29
  */
30
30
  letters?: 1 | 2;
31
+ /** `data-*` hooks pass through. TR: `data-*` kancaları geçiyor. */
32
+ [k: `data-${string}`]: unknown;
31
33
  }): import("react").JSX.Element;
32
34
  /**
33
35
  * Üst üste binen ekip.
@@ -50,7 +52,7 @@ export declare function Avatar({ name, size, src, bare, letters, }: {
50
52
  * çağıran onu söyler. Bulanıklık yok: `0 0 0` yayılımsız bir halka, gölge
51
53
  * değil.
52
54
  */
53
- export declare function AvatarStack({ names, extra, size, surface, }: {
55
+ export declare function AvatarStack({ names, extra, size, surface, ...rest }: {
54
56
  names: string[];
55
57
  extra?: number;
56
58
  size?: number;
@@ -59,5 +61,7 @@ export declare function AvatarStack({ names, extra, size, surface, }: {
59
61
  * arkasındaki zeminin rengi; ayırıcı halka bu renkte çizilir.
60
62
  */
61
63
  surface?: string;
64
+ /** `data-*` hooks pass through. TR: `data-*` kancaları geçiyor. */
65
+ [k: `data-${string}`]: unknown;
62
66
  }): import("react").JSX.Element;
63
67
  //# sourceMappingURL=avatar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["../../src/components/avatar.tsx"],"names":[],"mappings":"AAUA,2EAA2E;AAC3E,wBAAgB,MAAM,CAAC,EACrB,IAAI,EACJ,IAAS,EACT,GAAG,EACH,IAAY,EACZ,OAAW,GACZ,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;;;;;;;;OAUG;IACH,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;CACjB,+BAiCA;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,KAAK,EACL,IAAS,EACT,OAA8B,GAC/B,EAAE;IACD,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,+BA4BA"}
1
+ {"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["../../src/components/avatar.tsx"],"names":[],"mappings":"AAWA,2EAA2E;AAC3E,wBAAgB,MAAM,CAAC,EACrB,IAAI,EACJ,IAAS,EACT,GAAG,EACH,IAAY,EACZ,OAAW,EACX,GAAG,IAAI,EACR,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;;;;;;;;OAUG;IACH,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IAChB,mEAAmE;IACnE,CAAC,CAAC,EAAE,QAAQ,MAAM,EAAE,GAAG,OAAO,CAAC;CAChC,+BAkCA;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,KAAK,EACL,IAAS,EACT,OAA8B,EAC9B,GAAG,IAAI,EACR,EAAE;IACD,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mEAAmE;IACnE,CAAC,CAAC,EAAE,QAAQ,MAAM,EAAE,GAAG,OAAO,CAAC;CAChC,+BA4BA"}
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { cn } from "../lib/cn.js";
3
+ import { dataProps } from "../lib/data-props.js";
3
4
  function initials(name, count) {
4
5
  return name
5
6
  .split(" ")
@@ -9,7 +10,7 @@ function initials(name, count) {
9
10
  .join("");
10
11
  }
11
12
  /** Square, monochrome. Identity is text — color is reserved for health. */
12
- export function Avatar({ name, size = 32, src, bare = false, letters = 2, }) {
13
+ export function Avatar({ name, size = 32, src, bare = false, letters = 2, ...rest }) {
13
14
  const box = {
14
15
  width: size,
15
16
  height: size,
@@ -20,7 +21,7 @@ export function Avatar({ name, size = 32, src, bare = false, letters = 2, }) {
20
21
  if (src) {
21
22
  return (_jsx("img", { src: src, alt: name, width: size, height: size, className: cn("shrink-0 object-cover", !bare && "rounded-[var(--radius-mark)] border border-edge"), style: box }));
22
23
  }
23
- return (_jsx("span", { className: cn("inline-flex shrink-0 items-center justify-center font-semibold text-ink", !bare && "rounded-[var(--radius-mark)] border border-edge bg-hover"), style: box, "aria-hidden": true, children: initials(name, letters) }));
24
+ return (_jsx("span", { ...dataProps(rest), className: cn("inline-flex shrink-0 items-center justify-center font-semibold text-ink", !bare && "rounded-[var(--radius-mark)] border border-edge bg-hover"), style: box, "aria-hidden": true, children: initials(name, letters) }));
24
25
  }
25
26
  /**
26
27
  * Üst üste binen ekip.
@@ -43,12 +44,12 @@ export function Avatar({ name, size = 32, src, bare = false, letters = 2, }) {
43
44
  * çağıran onu söyler. Bulanıklık yok: `0 0 0` yayılımsız bir halka, gölge
44
45
  * değil.
45
46
  */
46
- export function AvatarStack({ names, extra, size = 24, surface = "var(--color-shell)", }) {
47
+ export function AvatarStack({ names, extra, size = 24, surface = "var(--color-shell)", ...rest }) {
47
48
  const overlap = Math.round(size / 4);
48
49
  const ring = { boxShadow: `0 0 0 2px ${surface}` };
49
50
  /* Karoların kendi baş harfleri `aria-hidden` — üst üste binmiş harfler ekran
50
51
  okuyucuda anlamsız bir dizi olurdu. Adlar bir kez, düz metin olarak
51
52
  veriliyor: "Berika Sultan, Deniz Kara ve 7 kişi daha". */
52
53
  const spoken = [...names, extra ? `+${extra}` : null].filter(Boolean).join(", ");
53
- return (_jsxs("div", { className: "flex items-center", role: "img", "aria-label": spoken, children: [names.map((n, i) => (_jsx("span", { className: "rounded-[var(--radius-mark)]", style: { marginLeft: i === 0 ? 0 : -overlap, ...ring }, children: _jsx(Avatar, { name: n, size: size, letters: 1 }) }, n + i))), extra ? (_jsxs("span", { className: "inline-flex items-center justify-center rounded-[var(--radius-mark)] border border-edge bg-shell font-mono text-caption font-bold text-ink", style: { width: size, height: size, marginLeft: -overlap, ...ring }, children: ["+", extra] })) : null] }));
54
+ return (_jsxs("div", { ...dataProps(rest), className: "flex items-center", role: "img", "aria-label": spoken, children: [names.map((n, i) => (_jsx("span", { className: "rounded-[var(--radius-mark)]", style: { marginLeft: i === 0 ? 0 : -overlap, ...ring }, children: _jsx(Avatar, { name: n, size: size, letters: 1 }) }, n + i))), extra ? (_jsxs("span", { className: "inline-flex items-center justify-center rounded-[var(--radius-mark)] border border-edge bg-shell font-mono text-caption font-bold text-ink", style: { width: size, height: size, marginLeft: -overlap, ...ring }, children: ["+", extra] })) : null] }));
54
55
  }
@@ -1,5 +1,5 @@
1
1
  import type { Tone } from "./tone.js";
2
- export declare function StatusChip({ label, state, dot, live, mono, severity, }: {
2
+ export declare function StatusChip({ label, state, dot, live, mono, severity, ...rest }: {
3
3
  label: string;
4
4
  state: Tone;
5
5
  dot?: boolean;
@@ -14,18 +14,22 @@ export declare function StatusChip({ label, state, dot, live, mono, severity, }:
14
14
  * taşıdığında açık sıra; yoksa durumdan türetiliyor
15
15
  */
16
16
  severity?: number | null;
17
+ /** `data-*` hooks pass through. TR: `data-*` kancaları geçiyor. */
18
+ [k: `data-${string}`]: unknown;
17
19
  }): import("react").JSX.Element;
18
- export declare function Delta({ value, better, mono, }: {
20
+ export declare function Delta({ value, better, mono, ...rest }: {
19
21
  value: string;
20
22
  better: boolean;
21
23
  mono?: boolean;
24
+ /** `data-*` hooks pass through. TR: `data-*` kancaları geçiyor. */
25
+ [k: `data-${string}`]: unknown;
22
26
  }): import("react").JSX.Element;
23
27
  /**
24
28
  * Solid square status mark used in dense tables. Uses `fg` rather than `mark`
25
29
  * so a single 10px square still reads at rest — bars can afford to be quieter,
26
30
  * a lone dot cannot.
27
31
  */
28
- export declare function Dot({ state, live, severity, }: {
32
+ export declare function Dot({ state, live, severity, ...rest }: {
29
33
  state: Tone;
30
34
  live?: boolean;
31
35
  /**
@@ -33,5 +37,7 @@ export declare function Dot({ state, live, severity, }: {
33
37
  * taşıdığında açık sıra; yoksa durumdan türetiliyor
34
38
  */
35
39
  severity?: number | null;
40
+ /** `data-*` hooks pass through. TR: `data-*` kancaları geçiyor. */
41
+ [k: `data-${string}`]: unknown;
36
42
  }): import("react").JSX.Element;
37
43
  //# sourceMappingURL=badge.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../src/components/badge.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAStC,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,KAAK,EACL,GAAU,EACV,IAAY,EACZ,IAAY,EACZ,QAAQ,GACT,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,IAAI,CAAC;IACZ,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B,+BAiBA;AAED,wBAAgB,KAAK,CAAC,EACpB,KAAK,EACL,MAAM,EACN,IAAW,GACZ,EAAE;IAC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K,EACL,IAAY,EACZ,QAAQ,EACR,GAAG,IAAI,EACR,EAAE;IACD,KAAK,EAAE,IAAI,CAAC;IACZ,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,mEAAmE;IACnE,CAAC,CAAC,EAAE,QAAQ,MAAM,EAAE,GAAG,OAAO,CAAC;CAChC,+BAWA"}
@@ -1,29 +1,30 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { dataProps } from "../lib/data-props.js";
3
4
  import { toneOf, rankOf } from "./tone.js";
4
5
  import { useLiveClaim } from "./live-scope.js";
5
6
  /* `live` is a REQUEST, not a decision. The element asks the nearest LiveScope
6
7
  to pulse and only the most severe asker wins — see live-scope.tsx. Call sites
7
8
  keep writing `live={m.health === "down"}` exactly as before; the counting is
8
9
  no longer their problem. */
9
- export function StatusChip({ label, state, dot = true, live = false, mono = false, severity, }) {
10
+ export function StatusChip({ label, state, dot = true, live = false, mono = false, severity, ...rest }) {
10
11
  const h = toneOf(state);
11
12
  const pulses = useLiveClaim(live ? rankOf(state, severity) : null);
12
- return (_jsxs("span", { className: `tamga-chip ${mono ? "tamga-chip-mono" : ""}`, style: { background: h.bg, color: h.fg }, children: [dot && (_jsx("span", { className: `inline-block size-[var(--mark-dot)] ${pulses ? "tamga-live" : ""}`, style: { background: h.mark } })), label] }));
13
+ return (_jsxs("span", { ...dataProps(rest), className: `tamga-chip ${mono ? "tamga-chip-mono" : ""}`, style: { background: h.bg, color: h.fg }, children: [dot && (_jsx("span", { className: `inline-block size-[var(--mark-dot)] ${pulses ? "tamga-live" : ""}`, style: { background: h.mark } })), label] }));
13
14
  }
14
- export function Delta({ value, better, mono = true, }) {
15
+ export function Delta({ value, better, mono = true, ...rest }) {
15
16
  /* good movement stays neutral — color is reserved for deviation */
16
17
  const color = better ? "var(--color-ink-faint)" : "var(--color-critical)";
17
18
  const rising = !value.trimStart().startsWith("-");
18
- return (_jsxs("span", { className: `inline-flex items-center gap-1 text-small font-bold ${mono ? "font-mono" : ""}`, style: { color }, children: [_jsx("svg", { width: "9", height: "9", viewBox: "0 0 10 10", "aria-hidden": true, children: _jsx("path", { d: rising ? "M5 1L9 8H1Z" : "M5 9L1 2H9Z", style: { fill: color } }) }), value] }));
19
+ return (_jsxs("span", { ...dataProps(rest), className: `inline-flex items-center gap-1 text-small font-bold ${mono ? "font-mono" : ""}`, style: { color }, children: [_jsx("svg", { width: "9", height: "9", viewBox: "0 0 10 10", "aria-hidden": true, children: _jsx("path", { d: rising ? "M5 1L9 8H1Z" : "M5 9L1 2H9Z", style: { fill: color } }) }), value] }));
19
20
  }
20
21
  /**
21
22
  * Solid square status mark used in dense tables. Uses `fg` rather than `mark`
22
23
  * so a single 10px square still reads at rest — bars can afford to be quieter,
23
24
  * a lone dot cannot.
24
25
  */
25
- export function Dot({ state, live = false, severity, }) {
26
+ export function Dot({ state, live = false, severity, ...rest }) {
26
27
  const h = toneOf(state);
27
28
  const pulses = useLiveClaim(live ? rankOf(state, severity) : null);
28
- return (_jsx("span", { className: `inline-block size-2.5 shrink-0 ${pulses ? "tamga-live" : ""}`, style: { background: h.fg }, "aria-hidden": true }));
29
+ return (_jsx("span", { ...dataProps(rest), className: `inline-block size-2.5 shrink-0 ${pulses ? "tamga-live" : ""}`, style: { background: h.fg }, "aria-hidden": true }));
29
30
  }
@@ -19,7 +19,7 @@ export type Bar = {
19
19
  */
20
20
  note?: string;
21
21
  };
22
- export declare function BarChart({ bars, formatValue, labelWidth, className, }: {
22
+ export declare function BarChart({ bars, formatValue, labelWidth, className, ...rest }: {
23
23
  bars: readonly Bar[];
24
24
  formatValue?: (v: number) => string;
25
25
  /**
@@ -28,5 +28,7 @@ export declare function BarChart({ bars, formatValue, labelWidth, className, }:
28
28
  */
29
29
  labelWidth?: string;
30
30
  className?: string;
31
+ /** `data-*` hooks pass through. TR: `data-*` kancaları geçiyor. */
32
+ [k: `data-${string}`]: unknown;
31
33
  }): import("react").JSX.Element;
32
34
  //# sourceMappingURL=bar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bar.d.ts","sourceRoot":"","sources":["../../src/components/bar.tsx"],"names":[],"mappings":"AAKA;;;;GAIG;AAEH,MAAM,MAAM,GAAG,GAAG;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;;;;;OAUG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AASF,wBAAgB,QAAQ,CAAC,EACvB,IAAI,EACJ,WAAoB,EACpB,UAAoB,EACpB,SAAS,GACV,EAAE;IACD,IAAI,EAAE,SAAS,GAAG,EAAE,CAAC;IACrB,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IACpC;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,+BA4DA"}
1
+ {"version":3,"file":"bar.d.ts","sourceRoot":"","sources":["../../src/components/bar.tsx"],"names":[],"mappings":"AAMA;;;;GAIG;AAEH,MAAM,MAAM,GAAG,GAAG;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;;;;;OAUG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AASF,wBAAgB,QAAQ,CAAC,EACvB,IAAI,EACJ,WAAoB,EACpB,UAAoB,EACpB,SAAS,EACT,GAAG,IAAI,EACR,EAAE;IACD,IAAI,EAAE,SAAS,GAAG,EAAE,CAAC;IACrB,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IACpC;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mEAAmE;IACnE,CAAC,CAAC,EAAE,QAAQ,MAAM,EAAE,GAAG,OAAO,CAAC;CAChC,+BA4DA"}
@@ -2,6 +2,7 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useState } from "react";
4
4
  import { cn } from "../lib/cn.js";
5
+ import { dataProps } from "../lib/data-props.js";
5
6
  /** Sayıyı ızgara çizgisine yuvarlar: 87 → 100, 412 → 500. */
6
7
  function niceMax(v) {
7
8
  if (v <= 0)
@@ -9,14 +10,14 @@ function niceMax(v) {
9
10
  const mag = 10 ** Math.floor(Math.log10(v));
10
11
  return Math.ceil(v / mag) * mag;
11
12
  }
12
- export function BarChart({ bars, formatValue = String, labelWidth = "10rem", className, }) {
13
+ export function BarChart({ bars, formatValue = String, labelWidth = "10rem", className, ...rest }) {
13
14
  const enBuyuk = niceMax(Math.max(0, ...bars.map((b) => b.value)));
14
15
  /* SATIRIN TAMAMI VURGULANIYOR, yalnız çubuk değil: uzun bir listede gözün
15
16
  kaydığı şey satır. Ad solda, sayı sağda, arada bir metre uzunluğunda
16
17
  çubuk var; hangi adın hangi sayıya ait olduğunu takip etmek zorlaşıyor ve
17
18
  satır zemini o izi tutuyor. */
18
19
  const [uzerinde, setUzerinde] = useState(null);
19
- return (_jsxs("div", { className: cn("flex flex-col gap-0.5", className), onMouseLeave: () => setUzerinde(null), children: [bars.map((b) => {
20
+ return (_jsxs("div", { ...dataProps(rest), className: cn("flex flex-col gap-0.5", className), onMouseLeave: () => setUzerinde(null), children: [bars.map((b) => {
20
21
  const oran = enBuyuk > 0 ? b.value / enBuyuk : 0;
21
22
  const secili = uzerinde === b.label;
22
23
  return (_jsxs("div", { className: "grid cursor-default items-center gap-3 rounded-(--radius-mark) px-1.5 py-1 transition-[background] duration-(--duration-press)", style: {
@@ -25,7 +25,7 @@ export type Series = {
25
25
  */
26
26
  tone?: Tone;
27
27
  };
28
- export declare function LineChart({ series, labels, height, formatValue, className, }: {
28
+ export declare function LineChart({ series, labels, height, formatValue, className, ...rest }: {
29
29
  series: readonly Series[];
30
30
  /**
31
31
  * The marks under the X axis. The caller formats the numbers. TR: X ekseninin altındaki
@@ -39,5 +39,7 @@ export declare function LineChart({ series, labels, height, formatValue, classNa
39
39
  */
40
40
  formatValue?: (v: number) => string;
41
41
  className?: string;
42
+ /** `data-*` hooks pass through. TR: `data-*` kancaları geçiyor. */
43
+ [k: `data-${string}`]: unknown;
42
44
  }): import("react").JSX.Element;
43
45
  //# sourceMappingURL=chart.d.ts.map