tamga-ui 0.7.2 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +81 -0
- package/dist/blocks/filter-bar.d.ts +47 -10
- package/dist/blocks/filter-bar.d.ts.map +1 -1
- package/dist/blocks/filter-bar.js +63 -11
- package/dist/blocks/index.d.ts +1 -1
- package/dist/blocks/index.d.ts.map +1 -1
- package/dist/components/a11y.d.ts.map +1 -1
- package/dist/components/a11y.js +5 -0
- package/dist/components/advanced-input.d.ts +3 -1
- package/dist/components/advanced-input.d.ts.map +1 -1
- package/dist/components/advanced-input.js +2 -2
- package/dist/components/combobox.d.ts +3 -1
- package/dist/components/combobox.d.ts.map +1 -1
- package/dist/components/combobox.js +2 -2
- package/dist/components/data-table.d.ts.map +1 -1
- package/dist/components/data-table.js +1 -1
- 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 +6 -6
- package/dist/components/progress.d.ts +13 -1
- package/dist/components/progress.d.ts.map +1 -1
- package/dist/components/progress.js +3 -3
- package/dist/components/select-panel.d.ts +69 -0
- package/dist/components/select-panel.d.ts.map +1 -0
- package/dist/components/select-panel.js +68 -0
- package/dist/fonts.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/kit.css +207 -1
- package/dist/styles.css +1 -1
- package/dist/theme.css +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,87 @@ 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.8.0
|
|
9
|
+
|
|
10
|
+
> A choice panel opened from a button, and a filter bar made of chips.
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **`SelectPanel`** · a choice panel opened from an ordinary button, like GitHub Primer's: the
|
|
15
|
+
trigger shows the chosen value or the placeholder with a caret (`aria-haspopup="listbox"`,
|
|
16
|
+
`aria-expanded`, the given `aria-label`); the panel has a `title`, an optional search box
|
|
17
|
+
(`searchable`: focus lands there on open, the list filters as you type, `labels.noMatch` when
|
|
18
|
+
nothing matches, the down arrow enters the list), the options with a check beside the chosen
|
|
19
|
+
one and an optional tone square. `allLabel` adds a first "All" option worth the empty value,
|
|
20
|
+
checked when the value is empty, kept at the top while searching. Arrows move, Enter chooses,
|
|
21
|
+
Esc closes and focus returns to the trigger. `multiple` takes an array, shows a summary like
|
|
22
|
+
"Atlas Lojistik +2" and keeps the panel open, with `labels.clear` under the list. `prefix`
|
|
23
|
+
("Status:"), `caret`, `variant` and `size` shape the trigger for a filter chip. `Combobox`'s
|
|
24
|
+
trigger is a text box and people expected to type into it.
|
|
25
|
+
- **`FilterBar` `look="chips"`** · one line: a fixed search box (17.5rem), then a chip-button
|
|
26
|
+
per top field that always reads name and value together: "Status: All" empty (outlined,
|
|
27
|
+
small, the value faint), "Status: Critical" set (soft) with its own remove button named
|
|
28
|
+
`labels.remove(label)`. Each chip opens a `SelectPanel` whose first option is `labels.all`;
|
|
29
|
+
`searchable` fields search in the panel; `panelTitle` names the panel, else the label.
|
|
30
|
+
`labels.clearAll` closes the row once a filter is set. No separate applied-filters row: the
|
|
31
|
+
chip is the summary. Text and date-range fields keep their boxes. On a narrow screen the
|
|
32
|
+
0.7.3 behaviour holds: search and "Filter · N", the sheet with every field (as panels,
|
|
33
|
+
"All" when empty, titled `labels.filter`), and the set chips in a horizontally scrolling row.
|
|
34
|
+
`fields` is the default and unchanged. The drawer's "+ Filter" chip is left for later.
|
|
35
|
+
|
|
36
|
+
### Fixed
|
|
37
|
+
|
|
38
|
+
- **`SortHeader`'s unsorted glyph carried a grey square**: `Icon` defaults to `duotone`, and
|
|
39
|
+
Phosphor's two-way arrow puts a 20% filled rectangle behind the down arrow in that weight.
|
|
40
|
+
The glyph is drawn `regular`.
|
|
41
|
+
- **A table's header row inside an open card painted over the card's rounded corners**
|
|
42
|
+
(`ListTemplate`'s list card is `tamga-card-open`, so nothing is clipped): the first and last
|
|
43
|
+
header cells now take the card's corner radius. The selector is a descendant one, so a
|
|
44
|
+
`ScrollX` or scroll wrapper around the table is fine; it assumes the table is the card's first
|
|
45
|
+
content.
|
|
46
|
+
|
|
47
|
+
## 0.7.3
|
|
48
|
+
|
|
49
|
+
> What the first real consumer found: the filter bar's names, its phone layout, its option values, a thin progress bar, one card instead of two.
|
|
50
|
+
|
|
51
|
+
### Added
|
|
52
|
+
|
|
53
|
+
- **`FilterBar` on a narrow screen** (below `sm`) collapses to the search box and a "Filter · N"
|
|
54
|
+
button beside it; N counts the applied filters other than the search, and is omitted at zero.
|
|
55
|
+
The button opens the existing sheet, where the top fields come first as an untitled group,
|
|
56
|
+
then the drawer groups, with the same "Clear" and "Apply" in the footer. Applied chips and
|
|
57
|
+
"Clear all" stay visible. With an empty drawer the button is still drawn on narrow screens,
|
|
58
|
+
since it is the only way to the top fields. The switch is a CSS breakpoint, both views are in
|
|
59
|
+
the DOM and one is hidden, so the server's output matches the browser's. The kit writes no
|
|
60
|
+
word: `labels.filter` is optional and falls back to `allFilters`. The row's parts are kit
|
|
61
|
+
classes (`.tamga-filter-ara`, `.tamga-filter-alan`), not utilities: a utility's `display` would
|
|
62
|
+
beat the component layer's `display: none`, as it did in the first cut, measured in Chrome at
|
|
63
|
+
390px (`pnpm olc:filtre` repeats the measurement).
|
|
64
|
+
- **`FilterBar` options with a value and a label** · `options` and `optionSource` take
|
|
65
|
+
`{ value, label }` pairs beside plain strings. `values` holds the value, the box and the chip
|
|
66
|
+
show the label, `tones` is keyed by the value. Plain `string[]` works as before.
|
|
67
|
+
- **`Progress` `size="sm"`** · a 4px line for a table cell: no edge, no shadow, no stripes, no
|
|
68
|
+
label line; width from `className`; `role="progressbar"`, value and `ariaLabel` unchanged.
|
|
69
|
+
`tone` colours the fill from the kit's roles, else the accent. `md` is today's bar, locked
|
|
70
|
+
pixel for pixel by test.
|
|
71
|
+
- **`aria-label`** on `Combobox`, `MultiSelect`, `DatePicker` and `DateTimePicker`, for a box
|
|
72
|
+
with no bound visible label.
|
|
73
|
+
|
|
74
|
+
### Fixed
|
|
75
|
+
|
|
76
|
+
- **`FilterBar` fields had no accessible name**: the label was a `<span>` beside the control,
|
|
77
|
+
so a screen reader read every box as "All" (WCAG 4.1.2, 2.5.3) and tests could not find a
|
|
78
|
+
field by role. Every control carries `aria-label={field.label}`; the date range's two boxes
|
|
79
|
+
are "<label> <rangeStart>" and "<label> <rangeEnd>", on top and in the drawer.
|
|
80
|
+
|
|
81
|
+
- **`FilterBar` inside `ListTemplate` drew a card inside the template's card** and, in the slot's
|
|
82
|
+
flex row, shrank to its content. The bar's box is now a kit class, `.tamga-filter-bar` (the
|
|
83
|
+
same 16px padding and 14px gap as before, so a bar on its own is pixel-identical);
|
|
84
|
+
`[data-filters] > .tamga-filter-bar` drops border, ground, shadow and padding and takes
|
|
85
|
+
`flex: 1 1 100%`. The padding moved from a Tailwind utility to the class on purpose: the
|
|
86
|
+
utilities layer comes after the components layer, so `padding: 0` could never have beaten
|
|
87
|
+
`p-4`.
|
|
88
|
+
|
|
8
89
|
## 0.7.2
|
|
9
90
|
|
|
10
91
|
> The current rail item is drawn whole.
|
|
@@ -20,12 +20,25 @@ export type FilterFieldKind = "text" | "select"
|
|
|
20
20
|
| "multi"
|
|
21
21
|
/** İKİ TARİH: başlangıç ve bitiş. Tek bir kutu bir aralık soramaz. */
|
|
22
22
|
| "dateRange";
|
|
23
|
+
/**
|
|
24
|
+
* An option whose stored VALUE differs from its shown LABEL: the address carries `critical`, the
|
|
25
|
+
* box shows "Kritik". A plain string is both at once. TR: Saklanan DEĞERİ ile görünen ADI
|
|
26
|
+
* farklı seçenek: adres `critical` taşır, kutu "Kritik" gösterir. Düz dizgi ikisi birden.
|
|
27
|
+
*/
|
|
28
|
+
export type FilterOption = {
|
|
29
|
+
value: string;
|
|
30
|
+
label: string;
|
|
31
|
+
};
|
|
23
32
|
export type FilterField = {
|
|
24
33
|
key: string;
|
|
25
34
|
label: string;
|
|
26
35
|
kind: FilterFieldKind;
|
|
27
|
-
/**
|
|
28
|
-
|
|
36
|
+
/**
|
|
37
|
+
* Plain strings, or `{ value, label }` pairs. Falls back to `optionSource[key]`; with neither,
|
|
38
|
+
* the list is empty. TR: Düz dizgiler ya da `{ value, label }` çiftleri. Verilmezse
|
|
39
|
+
* `optionSource[key]`; ikisi de yoksa liste boş.
|
|
40
|
+
*/
|
|
41
|
+
options?: readonly (string | FilterOption)[];
|
|
29
42
|
/**
|
|
30
43
|
* Start a new row before this field. TR: Bu alandan önce yeni bir satır başlat.
|
|
31
44
|
*
|
|
@@ -41,6 +54,11 @@ export type FilterField = {
|
|
|
41
54
|
* · ve bunu yalnız çağıran biliyor. Verilirse kırılma her genişlikte duruyor.
|
|
42
55
|
*/
|
|
43
56
|
break?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* `look="chips"` only: the line at the top of the chip's panel, "Choose a customer"; absent,
|
|
59
|
+
* the label. TR: Yalnız `look="chips"`: çipin panelinin başlığı, "Müşteri seçin"; yoksa ad.
|
|
60
|
+
*/
|
|
61
|
+
panelTitle?: string;
|
|
44
62
|
/**
|
|
45
63
|
* A glyph before the value, naming what this filter is about. TR: Değerin
|
|
46
64
|
* önünde, bu filtrenin neyle ilgili olduğunu söyleyen glif.
|
|
@@ -55,11 +73,12 @@ export type FilterField = {
|
|
|
55
73
|
* A tone per option, for a filter whose items ARE states. TR: Öğeleri birer
|
|
56
74
|
* DURUM olan filtrede, seçenek başına ton.
|
|
57
75
|
*
|
|
58
|
-
* Keyed by the option's
|
|
59
|
-
* table's chip draws, so the eye matches the
|
|
60
|
-
* either. Only where the option really is a
|
|
61
|
-
*
|
|
62
|
-
*
|
|
76
|
+
* Keyed by the option's VALUE (its text, for a plain string). The swatch it
|
|
77
|
+
* draws is the same square the table's chip draws, so the eye matches the
|
|
78
|
+
* list to the rows without reading either. Only where the option really is a
|
|
79
|
+
* state. TR: Anahtar seçeneğin DEĞERİ (düz dizgide metni). Çizdiği kare,
|
|
80
|
+
* tablodaki çipin çizdiği karenin aynısı · göz listeyi satırlara okumadan
|
|
81
|
+
* eşliyor. Yalnız seçenek gerçekten bir durumsa.
|
|
63
82
|
*/
|
|
64
83
|
tones?: Record<string, Tone>;
|
|
65
84
|
};
|
|
@@ -82,6 +101,12 @@ export type FilterBarLabels = {
|
|
|
82
101
|
*/
|
|
83
102
|
all: string;
|
|
84
103
|
allFilters: string;
|
|
104
|
+
/**
|
|
105
|
+
* The narrow screen's button, "Filter"; the count of applied filters follows it. Absent,
|
|
106
|
+
* `allFilters` is used. TR: Dar ekranın düğmesi, "Filtrele"; uygulanan filtre sayısı peşine
|
|
107
|
+
* gelir. Yoksa `allFilters`.
|
|
108
|
+
*/
|
|
109
|
+
filter?: string;
|
|
85
110
|
clearAll: string;
|
|
86
111
|
clear: string;
|
|
87
112
|
apply: string;
|
|
@@ -114,8 +139,8 @@ export type FilterBarProps = {
|
|
|
114
139
|
top: readonly FilterField[];
|
|
115
140
|
/** The groups inside the drawer. Grouped, not a flat pile. TR: Çekmecedeki gruplar. Düz bir yığın değil, gruplu. */
|
|
116
141
|
drawer: readonly FilterGroup[];
|
|
117
|
-
/** Where the option lists come from; this will arrive from the server. TR: Seçim listelerinin kaynağı; sunucudan gelecek. */
|
|
118
|
-
optionSource?: Record<string, string[]>;
|
|
142
|
+
/** Where the option lists come from; this will arrive from the server. Strings or `{ value, label }` pairs. TR: Seçim listelerinin kaynağı; sunucudan gelecek. Dizgiler ya da `{ value, label }` çiftleri. */
|
|
143
|
+
optionSource?: Record<string, readonly (string | FilterOption)[]>;
|
|
119
144
|
/**
|
|
120
145
|
* THE KEY THE SEARCH BOX WRITES TO. TR: ARAMA KUTUSUNUN YAZDIĞI ANAHTAR.
|
|
121
146
|
*
|
|
@@ -153,7 +178,19 @@ export type FilterBarProps = {
|
|
|
153
178
|
extra?: ReactNode;
|
|
154
179
|
/** For `DatePicker`'s calendar: "tr-TR", "en-GB". TR: `DatePicker`ın takvimi için: "tr-TR", "en-GB". */
|
|
155
180
|
locale?: string;
|
|
181
|
+
/**
|
|
182
|
+
* `fields` the boxes with a label above each (today's layout). `chips` one line: a fixed
|
|
183
|
+
* search box, then a chip-button per top field that always reads name and value together,
|
|
184
|
+
* "Status: All" empty and "Status: Critical" set, with its own remove; each chip opens a
|
|
185
|
+
* `SelectPanel` whose first option is "All". No separate applied-filters row: the chip is the
|
|
186
|
+
* summary. Text and date-range fields keep their boxes. TR: `fields` her birinin üstünde adı
|
|
187
|
+
* olan kutular (bugünkü düzen). `chips` tek satır: sabit arama kutusu, sonra her üst alan için
|
|
188
|
+
* adı ve değeri hep birlikte okunan bir çip-düğme, boşken "Durum: Tümü", doluyken "Durum:
|
|
189
|
+
* Kritik" ve kendi kaldırması; her çip ilk seçeneği "Tümü" olan bir `SelectPanel` açar. Ayrı bir
|
|
190
|
+
* uygulanan-filtreler satırı yok: çip özetin kendisi. Metin ve tarih aralığı kutu kalır.
|
|
191
|
+
*/
|
|
192
|
+
look?: "fields" | "chips";
|
|
156
193
|
labels: FilterBarLabels;
|
|
157
194
|
};
|
|
158
|
-
export declare function FilterBar({ values, onChange, top, drawer, optionSource, searchKey, fileSearchKey, onFile, fileAccept, extra, locale, labels, }: FilterBarProps): import("react").JSX.Element;
|
|
195
|
+
export declare function FilterBar({ values, onChange, top, drawer, optionSource, searchKey, fileSearchKey, onFile, fileAccept, extra, locale, look, labels, }: FilterBarProps): import("react").JSX.Element;
|
|
159
196
|
//# sourceMappingURL=filter-bar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter-bar.d.ts","sourceRoot":"","sources":["../../src/blocks/filter-bar.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,OAAO,C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GAAG,EAAE,SAAS,WAAW,EAAE,CAAC;IAC5B,oHAAoH;IACpH,MAAM,EAAE,SAAS,WAAW,EAAE,CAAC;IAC/B,8MAA8M;IAC9M,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM,GAAG,YAAY,CAAC,EAAE,CAAC,CAAC;IAClE;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uKAAuK;IACvK,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;;;;;;OAUG;IACH,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,KAAK,IAAI,CAAC;IACrC;;;;;;;;OAQG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+IAA+I;IAC/I,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,wGAAwG;IACxG,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;;;;;;OAUG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC1B,MAAM,EAAE,eAAe,CAAC;CACzB,CAAC;AAEF,wBAAgB,SAAS,CAAC,EACxB,MAAM,EACN,QAAQ,EACR,GAAG,EACH,MAAM,EACN,YAAiB,EACjB,SAAe,EACf,aAAa,EACb,MAAM,EACN,UAAU,EACV,KAAK,EACL,MAAgB,EAChB,IAAe,EACf,MAAM,GACP,EAAE,cAAc,+BA4ThB"}
|
|
@@ -9,33 +9,39 @@ import { Icon } from "../components/icon.js";
|
|
|
9
9
|
import { Close, Customize, Search, Upload } from "../components/icons.js";
|
|
10
10
|
import { Input } from "../components/input.js";
|
|
11
11
|
import { Select, Sheet } from "../components/primitives.js";
|
|
12
|
+
import { SelectPanel } from "../components/select-panel.js";
|
|
12
13
|
/* Tarih aralığı İKİ ANAHTAR tutuyor. Tek bir dizgeye sıkıştırmak, sunucuya iki
|
|
13
14
|
ayrı parametre giderken burada tekrar ayrıştırmak demekti. */
|
|
14
15
|
export const rangeStart = (key) => `${key}Start`;
|
|
15
16
|
export const rangeEnd = (key) => `${key}End`;
|
|
16
|
-
function FieldControl({ field, values, write, optionSource, locale, labels, }) {
|
|
17
|
-
const options = field
|
|
17
|
+
function FieldControl({ field, values, write, optionSource, locale, labels, panel = false, }) {
|
|
18
|
+
const options = secenekler(field, optionSource);
|
|
19
|
+
if (panel && (field.kind === "select" || field.kind === "searchable" || field.kind === "multi")) {
|
|
20
|
+
return _jsx(PanelAlani, { field: field, values: values, write: write, optionSource: optionSource, labels: labels });
|
|
21
|
+
}
|
|
22
|
+
/* HER KONTROLÜN ADI VAR: alanın adı bir <span>, kontrole bağlı değil; ekran
|
|
23
|
+
okuyucu beş kutuyu da "Tümü" diye okuyordu. */
|
|
18
24
|
if (field.kind === "dateRange") {
|
|
19
|
-
return (_jsxs("div", { className: "grid gap-2 sm:grid-cols-2", children: [_jsx(DatePicker, { locale: locale, value: values[rangeStart(field.key)] || undefined, onChange: (v) => write(rangeStart(field.key), v ?? ""), placeholder: labels.rangeStart, labels: labels.calendar }), _jsx(DatePicker, { locale: locale, value: values[rangeEnd(field.key)] || undefined, onChange: (v) => write(rangeEnd(field.key), v ?? ""), placeholder: labels.rangeEnd, labels: labels.calendar })] }));
|
|
25
|
+
return (_jsxs("div", { className: "grid gap-2 sm:grid-cols-2", children: [_jsx(DatePicker, { locale: locale, "aria-label": `${field.label} ${labels.rangeStart}`, value: values[rangeStart(field.key)] || undefined, onChange: (v) => write(rangeStart(field.key), v ?? ""), placeholder: labels.rangeStart, labels: labels.calendar }), _jsx(DatePicker, { locale: locale, "aria-label": `${field.label} ${labels.rangeEnd}`, value: values[rangeEnd(field.key)] || undefined, onChange: (v) => write(rangeEnd(field.key), v ?? ""), placeholder: labels.rangeEnd, labels: labels.calendar })] }));
|
|
20
26
|
}
|
|
21
27
|
if (field.kind === "multi") {
|
|
22
28
|
/* Değerler virgülle tek bir dizgede: filtre durumunun tamamı
|
|
23
29
|
`Record<string,string>` ve bir alanın tipi yüzünden o sözleşmeyi
|
|
24
30
|
değiştirmek, her ekranı ilgilendirirdi. */
|
|
25
31
|
const selected = (values[field.key] ?? "").split(",").filter(Boolean);
|
|
26
|
-
return (_jsx(MultiSelect, { className: "w-full",
|
|
32
|
+
return (_jsx(MultiSelect, { className: "w-full", "aria-label": field.label, options: options, value: selected, onChange: (next) => write(field.key, next.join(",")), placeholder: labels.all, labels: {
|
|
27
33
|
empty: labels.noMatch,
|
|
28
34
|
remove: labels.remove,
|
|
29
35
|
open: labels.open(field.label),
|
|
30
36
|
} }));
|
|
31
37
|
}
|
|
32
38
|
if (field.kind === "searchable") {
|
|
33
|
-
return (_jsx(Combobox, { className: "w-full",
|
|
39
|
+
return (_jsx(Combobox, { className: "w-full", "aria-label": field.label, options: options, value: values[field.key] || undefined, onChange: (v) => write(field.key, v ?? ""), placeholder: labels.all, labels: { empty: labels.noMatch, clear: labels.clear, open: labels.open(field.label) } }));
|
|
34
40
|
}
|
|
35
41
|
if (field.kind === "select") {
|
|
36
|
-
return (_jsx(Select, { className: "w-full", icon: field.icon, options: [
|
|
42
|
+
return (_jsx(Select, { className: "w-full", "aria-label": field.label, icon: field.icon, options: [
|
|
37
43
|
labels.all,
|
|
38
|
-
...options.map((o) => (
|
|
44
|
+
...options.map((o) => ({ value: o.value, label: o.label, tone: field.tones?.[o.value] })),
|
|
39
45
|
],
|
|
40
46
|
/* BOŞ FİLTRE "TÜMÜ"NÜN KENDİSİ · liste açıldığında onay işareti orada
|
|
41
47
|
duruyor. Ama DOLU DEĞİL: `set` ayrı geçiliyor, yoksa "Tümü" yazan
|
|
@@ -44,14 +50,49 @@ function FieldControl({ field, values, write, optionSource, locale, labels, }) {
|
|
|
44
50
|
prop: "listede hangisi seçili" ve "bu filtre uygulanmış mı". */
|
|
45
51
|
value: values[field.key] || labels.all, set: Boolean(values[field.key]), onChange: (v) => write(field.key, v === labels.all ? "" : v), placeholder: labels.all }));
|
|
46
52
|
}
|
|
47
|
-
return (_jsx(Input, { full: true, value: values[field.key] ?? "", onChange: (e) => write(field.key, e.target.value) }));
|
|
53
|
+
return (_jsx(Input, { full: true, "aria-label": field.label, value: values[field.key] ?? "", onChange: (e) => write(field.key, e.target.value) }));
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* ÇİP-DÜĞME VE PANEL: tetik "Durum: Tümü ▾" ya da "Durum: Kritik"; paneli
|
|
57
|
+
* `SelectPanel`, ilk seçeneği "Tümü" (geri dönüş yolu gidiş yoluyla aynı yerde).
|
|
58
|
+
* Çipte boşken kenarlı küçük, doluyken yumuşak ve oksuz; ✕ ayrı düğme.
|
|
59
|
+
*/
|
|
60
|
+
function PanelAlani({ field, values, write, optionSource, labels, cip = false, }) {
|
|
61
|
+
const options = secenekler(field, optionSource).map((o) => ({ ...o, tone: field.tones?.[o.value] }));
|
|
62
|
+
const ortak = {
|
|
63
|
+
title: field.panelTitle ?? field.label,
|
|
64
|
+
"aria-label": field.label,
|
|
65
|
+
prefix: `${field.label}:`,
|
|
66
|
+
placeholder: labels.all,
|
|
67
|
+
searchable: field.kind === "searchable",
|
|
68
|
+
labels: { noMatch: labels.noMatch, search: labels.search, clear: labels.clear },
|
|
69
|
+
size: cip ? "sm" : "base",
|
|
70
|
+
className: cip ? undefined : "tamga-select-panel-tam",
|
|
71
|
+
};
|
|
72
|
+
if (field.kind === "multi") {
|
|
73
|
+
const selected = (values[field.key] ?? "").split(",").filter(Boolean);
|
|
74
|
+
const dolu = selected.length > 0;
|
|
75
|
+
return (_jsx(SelectPanel, { multiple: true, ...ortak, options: options, value: selected, onChange: (n) => write(field.key, n.join(",")), variant: cip && dolu ? "soft" : "secondary", caret: !(cip && dolu) }));
|
|
76
|
+
}
|
|
77
|
+
const v = values[field.key] ?? "";
|
|
78
|
+
return (_jsx(SelectPanel, { ...ortak, allLabel: labels.all, options: options, value: v, onChange: (n) => write(field.key, n), variant: cip && v ? "soft" : "secondary", caret: !(cip && v) }));
|
|
48
79
|
}
|
|
49
|
-
|
|
80
|
+
/** Seçenekler tek biçimde: düz dizgi, değeri de adı da kendisi olan bir çift. */
|
|
81
|
+
function secenekler(field, optionSource) {
|
|
82
|
+
const ham = field.options?.length ? field.options : (optionSource[field.key] ?? []);
|
|
83
|
+
return ham.map((o) => (typeof o === "string" ? { value: o, label: o } : o));
|
|
84
|
+
}
|
|
85
|
+
export function FilterBar({ values, onChange, top, drawer, optionSource = {}, searchKey = "q", fileSearchKey, onFile, fileAccept, extra, locale = "en-GB", look = "fields", labels, }) {
|
|
86
|
+
const cipler = look === "chips";
|
|
50
87
|
const [drawerOpen, setDrawerOpen] = useState(false);
|
|
51
88
|
const formId = useId();
|
|
52
89
|
const active = Object.entries(values).filter(([, v]) => v);
|
|
53
90
|
const drawerKeys = new Set(drawer.flatMap((g) => g.fields.map((f) => f.key)));
|
|
54
91
|
const hiddenActive = active.filter(([k]) => drawerKeys.has(k)).length;
|
|
92
|
+
/* Dar ekranın sayısı: aramadan başka her uygulanmış filtre · arama kutusu
|
|
93
|
+
orada da görünür, sayılmasına gerek yok. */
|
|
94
|
+
const darAktif = active.filter(([k]) => k !== searchKey).length;
|
|
95
|
+
const darMetin = `${labels.filter ?? labels.allFilters}${darAktif > 0 ? ` · ${darAktif}` : ""}`;
|
|
55
96
|
function write(key, value) {
|
|
56
97
|
const next = { ...values };
|
|
57
98
|
if (value)
|
|
@@ -75,10 +116,21 @@ export function FilterBar({ values, onChange, top, drawer, optionSource = {}, se
|
|
|
75
116
|
return labels.search;
|
|
76
117
|
return key === fileSearchKey ? (labels.fileSearch?.label ?? key) : key;
|
|
77
118
|
};
|
|
78
|
-
|
|
119
|
+
/* Çip DEĞERİ değil ADI gösteriyor: `critical` saklanır, "Kritik" okunur. */
|
|
120
|
+
const valueText = (key, value) => {
|
|
121
|
+
const field = allFields.find((f) => f.key === key);
|
|
122
|
+
if (!field || (field.kind !== "select" && field.kind !== "searchable" && field.kind !== "multi"))
|
|
123
|
+
return value;
|
|
124
|
+
const adlar = new Map(secenekler(field, optionSource).map((o) => [o.value, o.label]));
|
|
125
|
+
return value.split(",").map((v) => adlar.get(v) ?? v).join(field.kind === "multi" ? ", " : ",");
|
|
126
|
+
};
|
|
127
|
+
const ustAlanlar = (sinif) => top.map((field) => (_jsxs("div", { className: `tamga-filter-alan ${field.kind === "dateRange" ? "sm:col-span-2" : ""}`, children: [_jsx("span", { className: sinif, children: field.label }), _jsx(FieldControl, { field: field, values: values, write: write, optionSource: optionSource, locale: locale, labels: labels, panel: cipler })] }, field.key)));
|
|
128
|
+
const aramaKutusu = (_jsxs("span", { className: "relative flex items-center", children: [_jsx(Icon, { icon: Search, size: "xs", "aria-hidden": true, className: "pointer-events-none absolute left-2.5 text-ink-faint" }), _jsx(Input, { type: "search", full: true, leading: true, placeholder: labels.search, value: values[searchKey] ?? "", onChange: (e) => write(searchKey, e.target.value) })] }));
|
|
129
|
+
const cekmeceDugmesi = (drawer.length > 0 || top.length > 0) && (_jsxs(Button, { className: drawer.length > 0 ? "ml-auto" : "tamga-filter-dar ml-auto", onClick: () => setDrawerOpen(true), children: [_jsx(Icon, { icon: Customize, size: "xs" }), _jsxs("span", { className: "tamga-filter-genis", children: [labels.allFilters, hiddenActive > 0 && _jsx("span", { className: "tamga-count ml-1 tabular-nums", children: hiddenActive })] }), _jsx("span", { className: "tamga-filter-dar", children: darMetin })] }));
|
|
130
|
+
return (_jsxs("div", { className: "tamga-card tamga-card-open tamga-filter-bar", children: [cipler ? (_jsxs("div", { className: "tamga-filter-cips", children: [_jsxs("label", { className: "tamga-filter-ara-sabit", children: [_jsx("span", { className: "text-small font-bold text-ink-faint", children: labels.search }), aramaKutusu] }), _jsxs("span", { className: "tamga-filter-cip-sira", children: [top.map((field) => field.kind === "select" || field.kind === "searchable" || field.kind === "multi" ? (_jsxs("span", { className: "tamga-filter-cip", "data-set": values[field.key] ? "true" : undefined, children: [_jsx(PanelAlani, { field: field, values: values, write: write, optionSource: optionSource, labels: labels, cip: true }), values[field.key] ? (_jsx("button", { type: "button", className: "tamga-filter-cip-x", "aria-label": labels.remove(field.label), onClick: () => write(field.key, ""), children: _jsx(Icon, { icon: Close, size: "xs" }) })) : null] }, field.key)) : (_jsxs("div", { className: "tamga-filter-genis tamga-filter-alan", "data-range": field.kind === "dateRange" || undefined, children: [_jsx("span", { className: "text-small font-bold text-ink-faint", children: field.label }), _jsx(FieldControl, { field: field, values: values, write: write, optionSource: optionSource, locale: locale, labels: labels })] }, field.key))), darAktif > 0 ? (_jsx(Button, { variant: "link", size: "sm", onClick: () => onChange({}), children: labels.clearAll })) : null] }), cekmeceDugmesi, extra] })) : (_jsxs("div", { className: "tamga-filter-row", children: [_jsxs("label", { className: "tamga-filter-ara", children: [_jsx("span", { className: "text-small font-bold text-ink-faint", children: labels.search }), aramaKutusu] }), top.map((field) => (_jsxs(Fragment, { children: [field.break ? _jsx("span", { "aria-hidden": true, className: "tamga-filter-genis tamga-filter-kir" }) : null, _jsxs("div", { className: `tamga-filter-genis tamga-filter-alan ${field.kind === "dateRange" ? "" : "tamga-filter-cap"}`, "data-range": field.kind === "dateRange" || undefined, children: [_jsx("span", { className: "text-small font-bold text-ink-faint", children: field.label }), _jsx(FieldControl, { field: field, values: values, write: write, optionSource: optionSource, locale: locale, labels: labels })] })] }, field.key))), cekmeceDugmesi, extra] })), !cipler && active.length > 0 && (_jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [active.map(([key, value]) => (_jsxs("span", { className: "tamga-token", children: [_jsxs("span", { className: "font-normal text-ink-faint", children: [labelFor(key), ":"] }), valueText(key, value), _jsx("button", { type: "button", className: "tamga-token-x", "aria-label": labels.remove(labelFor(key)), onClick: () => write(key, ""), children: _jsx(Icon, { icon: Close, size: "xs" }) })] }, key))), _jsx(Button, { variant: "link", size: "sm", onClick: () => onChange({}), children: labels.clearAll })] })), _jsx(Sheet, { open: drawerOpen, onClose: () => setDrawerOpen(false), title: cipler ? (labels.filter ?? labels.allFilters) : labels.allFilters, closeLabel: labels.calendar.clear, footer: _jsxs(_Fragment, { children: [_jsx(Button, { type: "button", onClick: () => onChange({}), children: labels.clear }), _jsx(Button, { type: "submit", form: formId, variant: "primary", children: labels.apply })] }), children: _jsxs("form", { id: formId, onSubmit: (e) => {
|
|
79
131
|
e.preventDefault();
|
|
80
132
|
setDrawerOpen(false);
|
|
81
|
-
}, className: "flex flex-col", children: [drawer.map((group) => (_jsxs("div", { className: "flex flex-col gap-3.5 border-b border-dashed border-line py-4.5 last:border-b-0", children: [_jsx("p", { className: "text-caption font-extrabold uppercase tracking-label text-ink-faint", children: group.title }), _jsx("div", { className: "grid gap-3 sm:grid-cols-[repeat(2,minmax(0,1fr))]", children: group.fields.map((field) => (_jsxs("div", { className: `flex flex-col gap-1.5 ${field.kind === "dateRange" ? "sm:col-span-2" : ""}`, children: [_jsx("span", { className: "text-small text-ink-soft", children: field.label }), _jsx(FieldControl, { field: field, values: values, write: write, optionSource: optionSource, locale: locale, labels: labels })] }, field.key))) })] }, group.title))), fileSearchKey && labels.fileSearch && (_jsxs("div", { children: [_jsx("p", { className: "mb-3 text-micro font-semibold uppercase tracking-wide text-ink-faint", children: labels.fileSearch.title }), _jsx("p", { className: "mb-3 text-small leading-relaxed text-ink-soft", children: labels.fileSearch.help }), values[fileSearchKey] ? (_jsxs("span", { className: "flex items-center gap-2", children: [_jsx("span", { className: "truncate text-small text-ink", children: values[fileSearchKey] }), _jsx(Button, { type: "button", size: "sm", onClick: () => {
|
|
133
|
+
}, className: "flex flex-col", children: [top.length > 0 && (_jsx("div", { className: "tamga-filter-dar tamga-filter-grup border-b border-dashed border-line py-4.5 last:border-b-0", children: _jsx("div", { className: "grid gap-3 sm:grid-cols-[repeat(2,minmax(0,1fr))]", children: ustAlanlar("text-small text-ink-soft") }) })), drawer.map((group) => (_jsxs("div", { className: "flex flex-col gap-3.5 border-b border-dashed border-line py-4.5 last:border-b-0", children: [_jsx("p", { className: "text-caption font-extrabold uppercase tracking-label text-ink-faint", children: group.title }), _jsx("div", { className: "grid gap-3 sm:grid-cols-[repeat(2,minmax(0,1fr))]", children: group.fields.map((field) => (_jsxs("div", { className: `flex flex-col gap-1.5 ${field.kind === "dateRange" ? "sm:col-span-2" : ""}`, children: [_jsx("span", { className: "text-small text-ink-soft", children: field.label }), _jsx(FieldControl, { field: field, values: values, write: write, optionSource: optionSource, locale: locale, labels: labels, panel: cipler })] }, field.key))) })] }, group.title))), fileSearchKey && labels.fileSearch && (_jsxs("div", { children: [_jsx("p", { className: "mb-3 text-micro font-semibold uppercase tracking-wide text-ink-faint", children: labels.fileSearch.title }), _jsx("p", { className: "mb-3 text-small leading-relaxed text-ink-soft", children: labels.fileSearch.help }), values[fileSearchKey] ? (_jsxs("span", { className: "flex items-center gap-2", children: [_jsx("span", { className: "truncate text-small text-ink", children: values[fileSearchKey] }), _jsx(Button, { type: "button", size: "sm", onClick: () => {
|
|
82
134
|
write(fileSearchKey, "");
|
|
83
135
|
onFile?.(null);
|
|
84
136
|
}, children: labels.fileSearch.remove })] })) : (_jsxs("label", { className: `${buttonVariants({})} cursor-pointer`, children: [_jsx(Icon, { icon: Upload, size: "xs" }), labels.fileSearch.choose, _jsx("input", { type: "file", accept: fileAccept, className: "sr-only", onChange: (e) => {
|
package/dist/blocks/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Gerekçe: docs/gerekce/08-blok-ve-sablon.md
|
|
7
7
|
*/
|
|
8
|
-
export { FilterBar, rangeStart, rangeEnd, type FilterBarLabels, type FilterBarProps, type FilterField, type FilterFieldKind, type FilterGroup, type FilterValues, } from "./filter-bar.js";
|
|
8
|
+
export { FilterBar, rangeStart, rangeEnd, type FilterBarLabels, type FilterBarProps, type FilterField, type FilterFieldKind, type FilterOption, type FilterGroup, type FilterValues, } from "./filter-bar.js";
|
|
9
9
|
export { SaveBar } from "./save-bar.js";
|
|
10
10
|
export { CountRow } from "./count-row.js";
|
|
11
11
|
export { DangerZone, type DangerAction } from "./danger-zone.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/blocks/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EACL,SAAS,EACT,UAAU,EACV,QAAQ,EACR,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,YAAY,GAClB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/blocks/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EACL,SAAS,EACT,UAAU,EACV,QAAQ,EACR,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,YAAY,GAClB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"a11y.d.ts","sourceRoot":"","sources":["../../src/components/a11y.ts"],"names":[],"mappings":"AAkCA;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,WAAW,EAAE,IAAI,EAAE,OAAO,uCA0DhE;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,EAC1B,IAAI,EACJ,YAAY,EACZ,OAAO,GACR,EAAE;IACD,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAClD,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,
|
|
1
|
+
{"version":3,"file":"a11y.d.ts","sourceRoot":"","sources":["../../src/components/a11y.ts"],"names":[],"mappings":"AAkCA;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,WAAW,EAAE,IAAI,EAAE,OAAO,uCA0DhE;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,EAC1B,IAAI,EACJ,YAAY,EACZ,OAAO,GACR,EAAE;IACD,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAClD,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,QA8DA;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,WAAW,GAAG,cAAc,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,IAAI,uCAgBlG"}
|
package/dist/components/a11y.js
CHANGED
|
@@ -119,6 +119,11 @@ export function useListKeys({ open, containerRef, onClose, }) {
|
|
|
119
119
|
if (list.length === 0)
|
|
120
120
|
return;
|
|
121
121
|
const i = list.indexOf(document.activeElement);
|
|
122
|
+
/* Bir yazı kutusunun içindeyken (panelin araması) Space, Home ve End
|
|
123
|
+
metnin; yalnız oklar listeye iner. */
|
|
124
|
+
const yazida = e.target?.tagName === "INPUT";
|
|
125
|
+
if (yazida && (e.key === " " || e.key === "Home" || e.key === "End"))
|
|
126
|
+
return;
|
|
122
127
|
switch (e.key) {
|
|
123
128
|
case "ArrowDown":
|
|
124
129
|
e.preventDefault();
|
|
@@ -72,7 +72,7 @@ export declare function TagsInput({ value, onChange, placeholder, labels, max, c
|
|
|
72
72
|
/** `data-*` hooks pass through. TR: `data-*` kancaları geçiyor. */
|
|
73
73
|
[k: `data-${string}`]: unknown;
|
|
74
74
|
}): import("react").JSX.Element;
|
|
75
|
-
export declare function MultiSelect({ options, value, onChange, placeholder, labels, className, ...rest }: {
|
|
75
|
+
export declare function MultiSelect({ options, value, onChange, placeholder, labels, "aria-label": ariaLabel, className, ...rest }: {
|
|
76
76
|
options: readonly ({
|
|
77
77
|
value: string;
|
|
78
78
|
label: string;
|
|
@@ -86,6 +86,8 @@ export declare function MultiSelect({ options, value, onChange, placeholder, lab
|
|
|
86
86
|
remove: (label: string) => string;
|
|
87
87
|
open: string;
|
|
88
88
|
};
|
|
89
|
+
/** The box's accessible name; falls back to `labels.open`. TR: Kutunun erişilebilir adı; yoksa `labels.open`. */
|
|
90
|
+
"aria-label"?: string;
|
|
89
91
|
className?: string;
|
|
90
92
|
/** `data-*` hooks pass through. TR: `data-*` kancaları geçiyor. */
|
|
91
93
|
[k: `data-${string}`]: unknown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"advanced-input.d.ts","sourceRoot":"","sources":["../../src/components/advanced-input.tsx"],"names":[],"mappings":"AAgBA;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,EAC5B,MAAM,EACN,QAAQ,EACR,OAAe,EACf,SAAS,EACT,GAAG,KAAK,EACT,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,GAAG;IAC/C,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACvC;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACzD;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,+BA+CA;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,MAAM,EACN,YAAgB,EAChB,SAAS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nE,CAAC,CAAC,EAAE,QAAQ,MAAM,EAAE,GAAG,OAAO,CAAC;CAChC,+BAkKA;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,EAC5B,IAAI,EACJ,YAAY,EACZ,IAAI,EACJ,EAAE,EACF,YAAY,EACZ,UAAU,EACV,MAAM,EACN,OAAO,EACP,SAAS,EACT,GAAG,IAAI,EACR,EAAE;IACD,mGAAmG;IACnG,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACxB,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACvC,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC;;;;;OAKG;IACH,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;QAC5B,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;IACF;;;;;OAKG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mEAAmE;IACnE,CAAC,CAAC,EAAE,QAAQ,MAAM,EAAE,GAAG,OAAO,CAAC;CAChC,+BA0DA"}
|
|
@@ -114,7 +114,7 @@ export function TagsInput({ value, onChange, placeholder, labels, max, className
|
|
|
114
114
|
YETMİYOR: uzun etiketlerde dört çip de üç satırı aşıyor, o yüzden kutunun
|
|
115
115
|
ayrıca bir tavanı var (aşağıda) ve orada kayıyor. */
|
|
116
116
|
const GORUNEN_CIP = 4;
|
|
117
|
-
export function MultiSelect({ options, value, onChange, placeholder, labels, className, ...rest }) {
|
|
117
|
+
export function MultiSelect({ options, value, onChange, placeholder, labels, "aria-label": ariaLabel, className, ...rest }) {
|
|
118
118
|
const id = useId();
|
|
119
119
|
const [open, setOpen] = useState(false);
|
|
120
120
|
const [query, setQuery] = useState("");
|
|
@@ -173,7 +173,7 @@ export function MultiSelect({ options, value, onChange, placeholder, labels, cla
|
|
|
173
173
|
setQuery(e.target.value);
|
|
174
174
|
setActive(0);
|
|
175
175
|
setOpen(true);
|
|
176
|
-
}, onKeyDown: tus, onFocus: () => setOpen(true), role: "combobox", "aria-expanded": open, "aria-controls": id, "aria-label": labels.open, className: "min-w-24 flex-1 bg-transparent text-body text-ink outline-none" })] }), open ? (_jsx("div", { id: id, role: "listbox", "aria-multiselectable": true, className: "tamga-overlay tamga-menu absolute z-30 mt-2 max-h-64 w-full overflow-y-auto", children: shown.length === 0 ? (_jsx("p", { className: "px-4 py-3 text-small text-ink-faint", children: labels.empty })) : (shown.map(({ value: v, label: etiket, hint, ...rest }, i) => {
|
|
176
|
+
}, onKeyDown: tus, onFocus: () => setOpen(true), role: "combobox", "aria-expanded": open, "aria-controls": id, "aria-label": ariaLabel ?? labels.open, className: "min-w-24 flex-1 bg-transparent text-body text-ink outline-none" })] }), open ? (_jsx("div", { id: id, role: "listbox", "aria-multiselectable": true, className: "tamga-overlay tamga-menu absolute z-30 mt-2 max-h-64 w-full overflow-y-auto", children: shown.length === 0 ? (_jsx("p", { className: "px-4 py-3 text-small text-ink-faint", children: labels.empty })) : (shown.map(({ value: v, label: etiket, hint, ...rest }, i) => {
|
|
177
177
|
const on = value.includes(v);
|
|
178
178
|
return (_jsxs("button", { ...rest, type: "button", role: "option", "aria-selected": on, "data-selected": on, "data-active": i === active || undefined, className: "tamga-option w-full", onMouseEnter: () => setActive(i),
|
|
179
179
|
/* ODAK GİRDİDE KALIYOR, ve Safari'de bu bir SÜS DEĞİL: Safari
|
|
@@ -9,7 +9,7 @@ export type ComboOption<T extends string> = {
|
|
|
9
9
|
/** Etiketin altındaki ikinci satır: SKU, e-posta, kategori. */
|
|
10
10
|
hint?: string;
|
|
11
11
|
} & Record<string, unknown>;
|
|
12
|
-
export declare function Combobox<T extends string>({ options, value, onChange, onSearch, placeholder, labels, disabled, invalid, className, ...rest }: {
|
|
12
|
+
export declare function Combobox<T extends string>({ options, value, onChange, onSearch, placeholder, labels, disabled, invalid, "aria-label": ariaLabel, className, ...rest }: {
|
|
13
13
|
options: readonly ComboOption<T>[];
|
|
14
14
|
value?: T;
|
|
15
15
|
onChange?: (next: T | undefined) => void;
|
|
@@ -26,6 +26,8 @@ export declare function Combobox<T extends string>({ options, value, onChange, o
|
|
|
26
26
|
};
|
|
27
27
|
disabled?: boolean;
|
|
28
28
|
invalid?: boolean;
|
|
29
|
+
/** The box's accessible name when no visible label is bound to it. TR: Bağlı görünür bir etiket yoksa kutunun erişilebilir adı. */
|
|
30
|
+
"aria-label"?: string;
|
|
29
31
|
className?: string;
|
|
30
32
|
/** `data-*` hooks pass through. TR: `data-*` kancaları geçiyor. */
|
|
31
33
|
[k: `data-${string}`]: unknown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["../../src/components/combobox.tsx"],"names":[],"mappings":"AAQA;;;;GAIG;AAEH,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,MAAM,IAAI;IAC1C,KAAK,EAAE,CAAC,CAAC;IACT,KAAK,EAAE,MAAM,CAAC;IACd,+DAA+D;IAC/D,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAuB5B,wBAAgB,QAAQ,CAAC,CAAC,SAAS,MAAM,EAAE,EACzC,OAAO,EACP,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,MAAM,EACN,QAAgB,EAChB,OAAe,EACf,SAAS,EACT,GAAG,IAAI,EACR,EAAE;IACD,OAAO,EAAE,SAAS,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;IACnC,KAAK,CAA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GG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,mIAAmI;IACnI,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mEAAmE;IACnE,CAAC,CAAC,EAAE,QAAQ,MAAM,EAAE,GAAG,OAAO,CAAC;CAChC,+BA0IA"}
|
|
@@ -21,7 +21,7 @@ function vurgula(metin, q) {
|
|
|
21
21
|
return metin;
|
|
22
22
|
return (_jsxs(_Fragment, { children: [metin.slice(0, i), _jsx("b", { className: "font-bold text-ink", children: metin.slice(i, i + arama.length) }), metin.slice(i + arama.length)] }));
|
|
23
23
|
}
|
|
24
|
-
export function Combobox({ options, value, onChange, onSearch, placeholder, labels, disabled = false, invalid = false, className, ...rest }) {
|
|
24
|
+
export function Combobox({ options, value, onChange, onSearch, placeholder, labels, disabled = false, invalid = false, "aria-label": ariaLabel, className, ...rest }) {
|
|
25
25
|
const id = useId();
|
|
26
26
|
const [open, setOpen] = useState(false);
|
|
27
27
|
const [query, setQuery] = useState("");
|
|
@@ -51,7 +51,7 @@ export function Combobox({ options, value, onChange, onSearch, placeholder, labe
|
|
|
51
51
|
setQuery("");
|
|
52
52
|
setOpen(false);
|
|
53
53
|
}
|
|
54
|
-
return (_jsxs("div", { ...dataProps(rest), ref: box, className: cn("relative", className), children: [_jsxs("span", { className: "relative flex items-center", children: [_jsx(Icon, { icon: Search, size: "xs", className: "pointer-events-none absolute left-3 text-ink-faint" }), _jsx("input", { type: "text", role: "combobox", "aria-expanded": open, "aria-controls": `${id}-list`, "aria-autocomplete": "list", "aria-activedescendant": open && shown[active] ? `${id}-opt-${active}` : undefined, "aria-invalid": invalid || undefined, disabled: disabled, placeholder: selected ? selected.label : placeholder, value: query, onFocus: () => setOpen(true), onChange: (e) => {
|
|
54
|
+
return (_jsxs("div", { ...dataProps(rest), ref: box, className: cn("relative", className), children: [_jsxs("span", { className: "relative flex items-center", children: [_jsx(Icon, { icon: Search, size: "xs", className: "pointer-events-none absolute left-3 text-ink-faint" }), _jsx("input", { type: "text", role: "combobox", "aria-expanded": open, "aria-controls": `${id}-list`, "aria-autocomplete": "list", "aria-activedescendant": open && shown[active] ? `${id}-opt-${active}` : undefined, "aria-label": ariaLabel, "aria-invalid": invalid || undefined, disabled: disabled, placeholder: selected ? selected.label : placeholder, value: query, onFocus: () => setOpen(true), onChange: (e) => {
|
|
55
55
|
setQuery(e.target.value);
|
|
56
56
|
setOpen(true);
|
|
57
57
|
onSearch?.(e.target.value);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-table.d.ts","sourceRoot":"","sources":["../../src/components/data-table.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAOvC;;;;GAIG;AAEH,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,MAAM,CAAC;AAE3C;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,SAAS,EACT,MAAM,EACN,KAAc,EACd,SAAS,EACT,GAAG,IAAI,EACR,EAAE;IACD,QAAQ,EAAE,SAAS,CAAC;IACpB,2FAA2F;IAC3F,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;IACvC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,UAA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,KAAK,IAAI,CAAC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,mEAAmE;IACnE,CAAC,CAAC,EAAE,QAAQ,MAAM,EAAE,GAAG,OAAO,CAAC;CAChC,+BAUA;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,OAAO,EACP,QAAQ,EACR,MAAM,EACN,SAAS,EACT,GAAG,IAAI,EACR,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;;OAIG;IACH,MAAM,EAAE;QAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,SAAS,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mEAAmE;IACnE,CAAC,CAAC,EAAE,QAAQ,MAAM,EAAE,GAAG,OAAO,CAAC;CAChC,sCAsBA"}
|
|
@@ -14,7 +14,7 @@ import { Checkbox } from "./checkbox.js";
|
|
|
14
14
|
*/
|
|
15
15
|
export function SortHeader({ children, direction, onSort, align = "left", className, ...rest }) {
|
|
16
16
|
const next = direction === "asc" ? "desc" : "asc";
|
|
17
|
-
return (_jsx("th", { scope: "col", "aria-sort": direction ? (direction === "asc" ? "ascending" : "descending") : "none", className: cn(align === "right" && "text-right", className), ...rest, children: _jsxs("button", { type: "button", onClick: () => onSort?.(next), className: cn("inline-flex items-center gap-1.5", align === "right" && "flex-row-reverse", direction ? "text-ink" : undefined), children: [children, direction ? (_jsx(Icon, { icon: CaretDown, size: "xs", className: cn("text-accent", direction === "asc" && "rotate-180") })) : (_jsx(Icon, { icon: Sort, size: "xs", className: "text-ink-faint" }))] }) }));
|
|
17
|
+
return (_jsx("th", { scope: "col", "aria-sort": direction ? (direction === "asc" ? "ascending" : "descending") : "none", className: cn(align === "right" && "text-right", className), ...rest, children: _jsxs("button", { type: "button", onClick: () => onSort?.(next), className: cn("inline-flex items-center gap-1.5", align === "right" && "flex-row-reverse", direction ? "text-ink" : undefined), children: [children, direction ? (_jsx(Icon, { icon: CaretDown, size: "xs", className: cn("text-accent", direction === "asc" && "rotate-180") })) : (_jsx(Icon, { icon: Sort, size: "xs", weight: "regular", className: "text-ink-faint" }))] }) }));
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
20
|
* Baş onay kutusu — ve `indeterminate` neden önemli.
|
|
@@ -85,9 +85,11 @@ export declare function Calendar({ locale, timeZone, value: hamDeger, range, min
|
|
|
85
85
|
* demektir (`15/04/2026` · `04/15/2026` · `2026-04-15`) ve yanlış okunan bir
|
|
86
86
|
* tarih sessizce yanlış veri üretir. Takvim tek doğru giriş yolu.
|
|
87
87
|
*/
|
|
88
|
-
export declare function DatePicker({ id, locale, timeZone, value: hamDeger, onChange, placeholder, labels, min, max, invalid, disabled, className, ...rest }: {
|
|
88
|
+
export declare function DatePicker({ id, "aria-label": ariaLabel, locale, timeZone, value: hamDeger, onChange, placeholder, labels, min, max, invalid, disabled, className, ...rest }: {
|
|
89
89
|
/** Reaches the field, so `Field htmlFor` can bind. TR: Alana iner, `Field htmlFor` bağlanabilir. */
|
|
90
90
|
id?: string;
|
|
91
|
+
/** The field's accessible name when no visible label is bound to it. TR: Bağlı görünür bir etiket yoksa alanın erişilebilir adı. */
|
|
92
|
+
"aria-label"?: string;
|
|
91
93
|
locale: string;
|
|
92
94
|
/** Which day is "today"; see `Calendar`. TR: "Bugün" hangi gün; bkz. `Calendar`. */
|
|
93
95
|
timeZone?: string;
|
|
@@ -120,9 +122,11 @@ export declare function DatePicker({ id, locale, timeZone, value: hamDeger, onCh
|
|
|
120
122
|
* aday an sınırı deliyorsa en yakın geçerli saate kısılır ve seçimler ona
|
|
121
123
|
* çekilir. Gerekçe: docs/gerekce/01-form-ve-girdi.md
|
|
122
124
|
*/
|
|
123
|
-
export declare function DateTimePicker({ id, locale, timeZone, value, onChange, placeholder, labels, min, max, minuteStep, invalid, disabled, className, ...rest }: {
|
|
125
|
+
export declare function DateTimePicker({ id, "aria-label": ariaLabel, locale, timeZone, value, onChange, placeholder, labels, min, max, minuteStep, invalid, disabled, className, ...rest }: {
|
|
124
126
|
/** Reaches the field, so `Field htmlFor` can bind. TR: Alana iner, `Field htmlFor` bağlanabilir. */
|
|
125
127
|
id?: string;
|
|
128
|
+
/** The field's accessible name when no visible label is bound to it. TR: Bağlı görünür bir etiket yoksa alanın erişilebilir adı. */
|
|
129
|
+
"aria-label"?: string;
|
|
126
130
|
locale: string;
|
|
127
131
|
/**
|
|
128
132
|
* The IANA zone the clock is shown and picked in, e.g. the workspace's `Europe/Istanbul`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-picker.d.ts","sourceRoot":"","sources":["../../src/components/date-picker.tsx"],"names":[],"mappings":"AAWA;;;;GAIG;AAEH;;;;;GAKG;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC;AAE7B;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC;AAEjC,MAAM,MAAM,SAAS,GAAG;IAAE,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,EAAE,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAIzD,2EAA2E;AAC3E,MAAM,MAAM,KAAK,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC;AAI/E,eAAO,MAAM,eAAe,QAAO,MAA0D,CAAC;AAmC9F;;;GAGG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,EAAE,CASpD;AAED;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,EA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,CAAC;CAChC,+BAgKA"}
|
|
@@ -255,8 +255,8 @@ export function Calendar({ locale, timeZone, value: hamDeger, range, min: hamMin
|
|
|
255
255
|
}) }, si)))] })] }));
|
|
256
256
|
}
|
|
257
257
|
/* ── Ortak alan: salt okunur girdi + temizle/aç düğmeleri ── */
|
|
258
|
-
function Alan({ id, shown, placeholder, disabled, invalid, open, hasValue, labels, onToggle, onClear, }) {
|
|
259
|
-
return (_jsxs("span", { className: "relative flex items-center", children: [_jsx(Icon, { icon: CalendarPlus, size: "xs", className: "pointer-events-none absolute left-3 text-ink-faint" }), _jsx("input", { id: id, type: "text", readOnly: true, disabled: disabled, value: shown, placeholder: placeholder, onClick: () => !disabled && onToggle(), className: "tamga-input w-full cursor-pointer pr-16 pl-9", "aria-haspopup": "dialog", "aria-expanded": open, "aria-invalid": invalid || undefined }), _jsxs("span", { className: "absolute right-1.5 flex gap-0.5", children: [hasValue ? (_jsx("button", { type: "button", className: "tamga-mini-btn", "data-inset": "true", "aria-label": labels.clear, disabled: disabled, onClick: () => !disabled && onClear(), children: _jsx(Icon, { icon: Close, size: "xs" }) })) : null, _jsx("button", { type: "button", className: "tamga-mini-btn", "data-inset": "true", "aria-label": labels.open, disabled: disabled, onClick: () => !disabled && onToggle(), children: _jsx(Icon, { icon: CalendarPlus, size: "xs" }) })] })] }));
|
|
258
|
+
function Alan({ id, ariaLabel, shown, placeholder, disabled, invalid, open, hasValue, labels, onToggle, onClear, }) {
|
|
259
|
+
return (_jsxs("span", { className: "relative flex items-center", children: [_jsx(Icon, { icon: CalendarPlus, size: "xs", className: "pointer-events-none absolute left-3 text-ink-faint" }), _jsx("input", { id: id, type: "text", readOnly: true, disabled: disabled, value: shown, placeholder: placeholder, onClick: () => !disabled && onToggle(), className: "tamga-input w-full cursor-pointer pr-16 pl-9", "aria-haspopup": "dialog", "aria-expanded": open, "aria-label": ariaLabel, "aria-invalid": invalid || undefined }), _jsxs("span", { className: "absolute right-1.5 flex gap-0.5", children: [hasValue ? (_jsx("button", { type: "button", className: "tamga-mini-btn", "data-inset": "true", "aria-label": labels.clear, disabled: disabled, onClick: () => !disabled && onClear(), children: _jsx(Icon, { icon: Close, size: "xs" }) })) : null, _jsx("button", { type: "button", className: "tamga-mini-btn", "data-inset": "true", "aria-label": labels.open, disabled: disabled, onClick: () => !disabled && onToggle(), children: _jsx(Icon, { icon: CalendarPlus, size: "xs" }) })] })] }));
|
|
260
260
|
}
|
|
261
261
|
/**
|
|
262
262
|
* Alan + açılan takvim.
|
|
@@ -265,7 +265,7 @@ function Alan({ id, shown, placeholder, disabled, invalid, open, hasValue, label
|
|
|
265
265
|
* demektir (`15/04/2026` · `04/15/2026` · `2026-04-15`) ve yanlış okunan bir
|
|
266
266
|
* tarih sessizce yanlış veri üretir. Takvim tek doğru giriş yolu.
|
|
267
267
|
*/
|
|
268
|
-
export function DatePicker({ id, locale, timeZone, value: hamDeger, onChange, placeholder, labels, min, max, invalid = false, disabled = false, className, ...rest }) {
|
|
268
|
+
export function DatePicker({ id, "aria-label": ariaLabel, locale, timeZone, value: hamDeger, onChange, placeholder, labels, min, max, invalid = false, disabled = false, className, ...rest }) {
|
|
269
269
|
const [open, setOpen] = useState(false);
|
|
270
270
|
/* Takvim dışarı tıklayınca ve Escape ile kapanıyor; kutu tetiği de kapsıyor. */
|
|
271
271
|
const kapat = useCallback(() => setOpen(false), []);
|
|
@@ -275,7 +275,7 @@ export function DatePicker({ id, locale, timeZone, value: hamDeger, onChange, pl
|
|
|
275
275
|
const shown = value
|
|
276
276
|
? new Intl.DateTimeFormat(locale, { dateStyle: "medium", timeZone: "UTC" }).format(new Date(`${value}T00:00:00Z`))
|
|
277
277
|
: "";
|
|
278
|
-
return (_jsxs("div", { ref: kutu, ...dataProps(rest), className: cn("relative", className), children: [_jsx(Alan, { id: id, shown: shown, placeholder: placeholder, disabled: disabled, invalid: invalid, open: open, hasValue: Boolean(value), labels: labels, onToggle: () => setOpen((v) => !v), onClear: () => onChange?.(undefined) }), open ? (_jsx("div", { className: "tamga-overlay absolute z-30 mt-2 p-3", onClick: (e) => e.stopPropagation(), children: _jsx(Calendar, { locale: locale, timeZone: timeZone, value: value, min: min, max: max, labels: labels, onSelect: (d) => { onChange?.(d); setOpen(false); } }) })) : null] }));
|
|
278
|
+
return (_jsxs("div", { ref: kutu, ...dataProps(rest), className: cn("relative", className), children: [_jsx(Alan, { id: id, ariaLabel: ariaLabel, shown: shown, placeholder: placeholder, disabled: disabled, invalid: invalid, open: open, hasValue: Boolean(value), labels: labels, onToggle: () => setOpen((v) => !v), onClear: () => onChange?.(undefined) }), open ? (_jsx("div", { className: "tamga-overlay absolute z-30 mt-2 p-3", onClick: (e) => e.stopPropagation(), children: _jsx(Calendar, { locale: locale, timeZone: timeZone, value: value, min: min, max: max, labels: labels, onSelect: (d) => { onChange?.(d); setOpen(false); } }) })) : null] }));
|
|
279
279
|
}
|
|
280
280
|
/**
|
|
281
281
|
* Tarih + saat. AYRI BİR BİLEŞEN, `DatePicker`a bir prop değil: dönen değerin
|
|
@@ -286,7 +286,7 @@ export function DatePicker({ id, locale, timeZone, value: hamDeger, onChange, pl
|
|
|
286
286
|
* aday an sınırı deliyorsa en yakın geçerli saate kısılır ve seçimler ona
|
|
287
287
|
* çekilir. Gerekçe: docs/gerekce/01-form-ve-girdi.md
|
|
288
288
|
*/
|
|
289
|
-
export function DateTimePicker({ id, locale, timeZone, value, onChange, placeholder, labels, min, max, minuteStep = 5, invalid = false, disabled = false, className, ...rest }) {
|
|
289
|
+
export function DateTimePicker({ id, "aria-label": ariaLabel, locale, timeZone, value, onChange, placeholder, labels, min, max, minuteStep = 5, invalid = false, disabled = false, className, ...rest }) {
|
|
290
290
|
const tz = useMemo(() => dilim(timeZone), [timeZone]);
|
|
291
291
|
const [open, setOpen] = useState(false);
|
|
292
292
|
const kapat = useCallback(() => setOpen(false), []);
|
|
@@ -384,7 +384,7 @@ export function DateTimePicker({ id, locale, timeZone, value, onChange, placehol
|
|
|
384
384
|
}, [locale, onIki, labels.am, labels.pm]);
|
|
385
385
|
const saatEtiketi = (h) => (donem ? String(h % 12 === 0 ? 12 : h % 12) : p2(h));
|
|
386
386
|
const shown = an ? new Intl.DateTimeFormat(locale, { dateStyle: "medium", timeStyle: "short", timeZone: tz }).format(an) : "";
|
|
387
|
-
return (_jsxs("div", { ref: kutu, ...dataProps(rest), className: cn("relative", className), children: [_jsx(Alan, { id: id, shown: shown, placeholder: placeholder, disabled: disabled, invalid: invalid, open: open, hasValue: Boolean(value), labels: labels, onToggle: () => setOpen((v) => !v), onClear: () => onChange?.(undefined) }), open ? (_jsxs("div", { className: "tamga-overlay absolute z-30 mt-2 p-3", onClick: (e) => e.stopPropagation(), children: [_jsx(Calendar, { locale: locale, timeZone: tz, value: gun, min: minGun, max: maxGun, labels: labels,
|
|
387
|
+
return (_jsxs("div", { ref: kutu, ...dataProps(rest), className: cn("relative", className), children: [_jsx(Alan, { id: id, ariaLabel: ariaLabel, shown: shown, placeholder: placeholder, disabled: disabled, invalid: invalid, open: open, hasValue: Boolean(value), labels: labels, onToggle: () => setOpen((v) => !v), onClear: () => onChange?.(undefined) }), open ? (_jsxs("div", { className: "tamga-overlay absolute z-30 mt-2 p-3", onClick: (e) => e.stopPropagation(), children: [_jsx(Calendar, { locale: locale, timeZone: tz, value: gun, min: minGun, max: maxGun, labels: labels,
|
|
388
388
|
/* Gün seçilince takvim AÇIK KALIYOR: saat daha seçilecek. */
|
|
389
389
|
onSelect: (d) => yay(d, saat, dakika) }), _jsxs("div", { className: "mt-3 flex items-center gap-2 border-t border-line pt-3", children: [_jsx(Select, { "aria-label": labels.hour, placeholder: labels.hour, disabled: !g, value: String(saat), onChange: (v) => yay(g, Number(v), dakika), options: (donem ? saatler.filter((h) => (saat < 12 ? h < 12 : h >= 12)) : saatler).map((h) => ({ value: String(h), label: saatEtiketi(h) })) }), _jsx(Select, { "aria-label": labels.minute, placeholder: labels.minute, disabled: !g, value: String(dakika), onChange: (v) => yay(g, saat, Number(v)), options: dakikalar.map((m) => ({ value: String(m), label: p2(m) })) }), donem ? (_jsx(Select, { "aria-label": labels.period, placeholder: labels.period, disabled: !g, value: saat < 12 ? "am" : "pm", onChange: (v) => yay(g, v === "am" ? saat % 12 : (saat % 12) + 12, dakika), options: [{ value: "am", label: donem.am }, { value: "pm", label: donem.pm }] })) : null] })] })) : null] }));
|
|
390
390
|
}
|
|
@@ -8,7 +8,7 @@ import { type Tone } from "./tone.js";
|
|
|
8
8
|
*
|
|
9
9
|
* Gerekçe: docs/gerekce/03-grafik-ve-olcum.md
|
|
10
10
|
*/
|
|
11
|
-
export declare function Progress({ value, look, blocks, segments, label, valueText, ariaLabel, className, ...rest }: {
|
|
11
|
+
export declare function Progress({ value, look, blocks, segments, label, valueText, ariaLabel, size, tone, className, ...rest }: {
|
|
12
12
|
/**
|
|
13
13
|
* 0–100; clamped, so a bad number cannot paint outside the track. `split` ignores it and reads
|
|
14
14
|
* `segments` instead. TR: 0–100; sınırlanıyor, yani kötü bir sayı yolun dışına boyayamıyor.
|
|
@@ -54,6 +54,18 @@ export declare function Progress({ value, look, blocks, segments, label, valueTe
|
|
|
54
54
|
* bir etiket yoksa erişilebilir ad
|
|
55
55
|
*/
|
|
56
56
|
ariaLabel?: string;
|
|
57
|
+
/**
|
|
58
|
+
* `md` the page's bar: 16px, edged, striped, with the label line. `sm` a 4px line for a table
|
|
59
|
+
* cell: no edge, no label line; width is the caller's (`className`). Only for `bar`. TR: `md`
|
|
60
|
+
* sayfanın çubuğu: 16px, kenarlı, çizgili, etiket satırlı. `sm` tablo hücresi için 4px'lik
|
|
61
|
+
* çizgi: kenarsız, etiketsiz; genişlik çağıranın (`className`). Yalnız `bar` için.
|
|
62
|
+
*/
|
|
63
|
+
size?: "md" | "sm";
|
|
64
|
+
/**
|
|
65
|
+
* The fill's colour from the kit's tone roles; absent, the accent. TR: Dolgunun rengi kitin
|
|
66
|
+
* ton rollerinden; yoksa vurgu.
|
|
67
|
+
*/
|
|
68
|
+
tone?: Tone;
|
|
57
69
|
className?: string;
|
|
58
70
|
/** `data-*` hooks pass through. TR: `data-*` kancaları geçiyor. */
|
|
59
71
|
[k: `data-${string}`]: unknown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../src/components/progress.tsx"],"names":[],"mappings":"AACA,OAAO,EAAqB,KAAK,IAAI,EAAE,MAAM,WAAW,CAAC;AACzD;;;;;;;;GAQG;AAEH,wBAAgB,QAAQ,CAAC,EACvB,KAAS,EACT,IAAY,EACZ,MAAW,EACX,QAAQ,EACR,KAAK,EACL,SAAS,EACT,SAAS,EACT,SAAc,EACd,GAAG,IAAI,EACR,EAAE;IACD;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;;;;OAQG;IACH,IAAI,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,OAAO,CAAC;IAClC,wGAAwG;IACxG,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,IAAI,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC;IACjG;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;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,+BAqFA"}
|
|
1
|
+
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../src/components/progress.tsx"],"names":[],"mappings":"AACA,OAAO,EAAqB,KAAK,IAAI,EAAE,MAAM,WAAW,CAAC;AACzD;;;;;;;;GAQG;AAEH,wBAAgB,QAAQ,CAAC,EACvB,KAAS,EACT,IAAY,EACZ,MAAW,EACX,QAAQ,EACR,KAAK,EACL,SAAS,EACT,SAAS,EACT,IAAW,EACX,IAAI,EACJ,SAAc,EACd,GAAG,IAAI,EACR,EAAE;IACD;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;;;;OAQG;IACH,IAAI,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,OAAO,CAAC;IAClC,wGAAwG;IACxG,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,IAAI,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC;IACjG;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB;;;OAGG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mEAAmE;IACnE,CAAC,CAAC,EAAE,QAAQ,MAAM,EAAE,GAAG,OAAO,CAAC;CAChC,+BAqFA"}
|
|
@@ -11,9 +11,9 @@ import { toneOf, yiginRenk } from "./tone.js";
|
|
|
11
11
|
*
|
|
12
12
|
* Gerekçe: docs/gerekce/03-grafik-ve-olcum.md
|
|
13
13
|
*/
|
|
14
|
-
export function Progress({ value = 0, look = "bar", blocks = 10, segments, label, valueText, ariaLabel, className = "", ...rest }) {
|
|
14
|
+
export function Progress({ value = 0, look = "bar", blocks = 10, segments, label, valueText, ariaLabel, size = "md", tone, className = "", ...rest }) {
|
|
15
15
|
const pct = Math.max(0, Math.min(100, value));
|
|
16
|
-
const ust = label || valueText ? (_jsxs("div", { className: "tamga-progress-ust", children: [_jsx("span", { children: label }), _jsx("span", { className: "tamga-progress-deger", children: valueText ?? `%${Math.round(pct)}` })] })) : null;
|
|
16
|
+
const ust = (label || valueText) && size === "md" ? (_jsxs("div", { className: "tamga-progress-ust", children: [_jsx("span", { children: label }), _jsx("span", { className: "tamga-progress-deger", children: valueText ?? `%${Math.round(pct)}` })] })) : null;
|
|
17
17
|
if (look === "blocks") {
|
|
18
18
|
/* SON DOLU HÜCRE AÇIK TONDA: "burada duruyoruz" diyen tek işaret o · hepsi
|
|
19
19
|
aynı dolulukta olduğunda saymak gerekiyor, oysa sayı zaten üstte yazılı. */
|
|
@@ -25,5 +25,5 @@ export function Progress({ value = 0, look = "bar", blocks = 10, segments, label
|
|
|
25
25
|
const toplam = paylar.reduce((n, p) => n + p.value, 0) || 1;
|
|
26
26
|
return (_jsxs("div", { ...dataProps(rest), className: className, children: [ust, _jsx("div", { className: "tamga-progress-split", role: "img", "aria-label": label ?? ariaLabel ?? "Progress", children: paylar.map(({ value: v, tone, label: _etiket, ...kanca }, i) => (_createElement("span", { ...kanca, key: i, style: { width: `${(v / toplam) * 100}%`, background: tone ? toneOf(tone).mark : yiginRenk(i) } }))) }), paylar.some((p) => p.label) ? (_jsx("div", { className: "tamga-progress-lejant", children: paylar.map((p, i) => (p.label ? _jsx("span", { children: p.label }, i) : null)) })) : null] }));
|
|
27
27
|
}
|
|
28
|
-
return (_jsxs("div", { ...dataProps(rest), className: className, children: [ust, _jsx("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}%` } }) })] }));
|
|
28
|
+
return (_jsxs("div", { ...dataProps(rest), className: className, children: [ust, _jsx("div", { className: size === "sm" ? "tamga-progress tamga-progress-sm" : "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: tone ? { width: `${pct}%`, background: toneOf(tone).mark } : { width: `${pct}%` } }) })] }));
|
|
29
29
|
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { Tone } from "./tone.js";
|
|
2
|
+
/**
|
|
3
|
+
* SelectPanel · düğmeden açılan seçim paneli: başlık, isteğe bağlı arama,
|
|
4
|
+
* seçenekler. Tetik bir DÜĞME, metin kutusu değil: `Combobox`un kutusu
|
|
5
|
+
* "buraya yaz" diyordu ve bir seçim yapıldığı anlaşılmıyordu.
|
|
6
|
+
*
|
|
7
|
+
* Gerekçe: docs/gerekce/01-form-ve-girdi.md
|
|
8
|
+
*/
|
|
9
|
+
export type SelectPanelOption = {
|
|
10
|
+
value: string;
|
|
11
|
+
label: string;
|
|
12
|
+
/** A state's colour square before the label, as in `Select`. TR: Etiketin önünde durum karesi, `Select`teki gibi. */
|
|
13
|
+
tone?: Tone;
|
|
14
|
+
/** The quiet second text beside the label: "2-3 days". TR: Etiketin yanındaki sessiz ikinci metin: "2-3 gün". */
|
|
15
|
+
hint?: string;
|
|
16
|
+
} & Record<string, unknown>;
|
|
17
|
+
type Ortak = {
|
|
18
|
+
options: readonly SelectPanelOption[];
|
|
19
|
+
/** The line at the top of the panel: "Choose a carrier". TR: Panelin üstündeki satır: "Kargo seçin". */
|
|
20
|
+
title: string;
|
|
21
|
+
/** The trigger's text when nothing is chosen. TR: Hiçbir şey seçili değilken tetiğin metni. */
|
|
22
|
+
placeholder: string;
|
|
23
|
+
/** The trigger's accessible name; the visible text is a value, not a name. TR: Tetiğin erişilebilir adı; görünen metin bir değer, ad değil. */
|
|
24
|
+
"aria-label": string;
|
|
25
|
+
/**
|
|
26
|
+
* A search box under the title; focus lands there on open, the list filters as you type.
|
|
27
|
+
* TR: Başlığın altında arama kutusu; açılınca odak orada, yazdıkça liste süzülür.
|
|
28
|
+
*/
|
|
29
|
+
searchable?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Single choice only: a first option named like this, worth the empty value. Chosen, the
|
|
32
|
+
* value empties; while searching it stays at the top. The way back sits where the way in
|
|
33
|
+
* was. TR: Yalnız tek seçimde: bu adla, boş değerli bir ilk seçenek. Seçilince değer boşalır;
|
|
34
|
+
* ararken de başta kalır. Geri dönüş yolu gidiş yoluyla aynı yerde.
|
|
35
|
+
*/
|
|
36
|
+
allLabel?: string;
|
|
37
|
+
/** Text before the value in the trigger: "Status:". TR: Tetikte değerin önündeki metin: "Durum:". */
|
|
38
|
+
prefix?: string;
|
|
39
|
+
/** The caret at the trigger's end; off for a chip that carries its own remove button. TR: Tetiğin ucundaki ok; kendi kaldırma düğmesini taşıyan çipte kapalı. */
|
|
40
|
+
caret?: boolean;
|
|
41
|
+
/** The trigger's look, from `Button`. TR: Tetiğin görünümü, `Button`dan. */
|
|
42
|
+
variant?: "secondary" | "soft" | "ghost";
|
|
43
|
+
/** The trigger's size, from `Button`. TR: Tetiğin boyu, `Button`dan. */
|
|
44
|
+
size?: "base" | "sm";
|
|
45
|
+
disabled?: boolean;
|
|
46
|
+
labels: {
|
|
47
|
+
/** Shown when the search matches nothing. TR: Arama hiçbir şeyle eşleşmeyince. */
|
|
48
|
+
noMatch: string;
|
|
49
|
+
/** The search box's name and placeholder; falls back to `title`. TR: Arama kutusunun adı ve yer tutucusu; yoksa `title`. */
|
|
50
|
+
search?: string;
|
|
51
|
+
/** Multiple only: the button under the list that empties the choice. TR: Yalnız çoklu: listenin altında seçimi boşaltan düğme. */
|
|
52
|
+
clear?: string;
|
|
53
|
+
};
|
|
54
|
+
className?: string;
|
|
55
|
+
/** `data-*` hooks pass through. TR: `data-*` kancaları geçiyor. */
|
|
56
|
+
[k: `data-${string}`]: unknown;
|
|
57
|
+
};
|
|
58
|
+
export type SelectPanelProps = Ortak & ({
|
|
59
|
+
multiple?: false;
|
|
60
|
+
value?: string;
|
|
61
|
+
onChange: (next: string) => void;
|
|
62
|
+
} | {
|
|
63
|
+
multiple: true;
|
|
64
|
+
value: readonly string[];
|
|
65
|
+
onChange: (next: string[]) => void;
|
|
66
|
+
});
|
|
67
|
+
export declare function SelectPanel({ options, title, placeholder, "aria-label": ariaLabel, searchable, allLabel, prefix, caret, variant, size, disabled, labels, className, multiple, value, onChange, ...rest }: SelectPanelProps): import("react").JSX.Element;
|
|
68
|
+
export {};
|
|
69
|
+
//# sourceMappingURL=select-panel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select-panel.d.ts","sourceRoot":"","sources":["../../src/components/select-panel.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGtC;;;;;;GAMG;AAEH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,qHAAqH;IACrH,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,iHAAiH;IACjH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE5B,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,SAAS,iBAAiB,EAAE,CAAC;IACtC,wGAAwG;IACxG,KAAK,EAAE,MAAM,CAAC;IACd,+FAA+F;IAC/F,WAAW,EAAE,MAAM,CAAC;IACpB,+IAA+I;IAC/I,YAAY,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qGAAqG;IACrG,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iKAAiK;IACjK,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,4EAA4E;IAC5E,OAAO,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,OAAO,CAAC;IACzC,wEAAwE;IACxE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE;QACN,kFAAkF;QAClF,OAAO,EAAE,MAAM,CAAC;QAChB,4HAA4H;QAC5H,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,kIAAkI;QAClI,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mEAAmE;IACnE,CAAC,CAAC,EAAE,QAAQ,MAAM,EAAE,GAAG,OAAO,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAClC,CACI;IAAE,QAAQ,CAAC,EAAE,KAAK,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;CAAE,GAEtE;IAAE,QAAQ,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;CAAE,CACnF,CAAC;AAEJ,wBAAgB,WAAW,CAAC,EAC1B,OAAO,EACP,KAAK,EACL,WAAW,EACX,YAAY,EAAE,SAAS,EACvB,UAAkB,EAClB,QAAQ,EACR,MAAM,EACN,KAAY,EACZ,OAAqB,EACrB,IAAa,EACb,QAAgB,EAChB,MAAM,EACN,SAAS,EACT,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,GAAG,IAAI,EACR,EAAE,gBAAgB,+BAoIlB"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { createElement as _createElement } from "react";
|
|
4
|
+
import { useCallback, useEffect, useId, useRef, useState } from "react";
|
|
5
|
+
import { useDismiss, useListKeys } from "./a11y.js";
|
|
6
|
+
import { buttonVariants } from "./button.js";
|
|
7
|
+
import { cn } from "../lib/cn.js";
|
|
8
|
+
import { dataProps } from "../lib/data-props.js";
|
|
9
|
+
import { Icon } from "./icon.js";
|
|
10
|
+
import { CaretDown, Check, Search } from "./icons.js";
|
|
11
|
+
import { Input } from "./input.js";
|
|
12
|
+
import { toneOf } from "./tone.js";
|
|
13
|
+
export function SelectPanel({ options, title, placeholder, "aria-label": ariaLabel, searchable = false, allLabel, prefix, caret = true, variant = "secondary", size = "base", disabled = false, labels, className, multiple, value, onChange, ...rest }) {
|
|
14
|
+
const id = useId();
|
|
15
|
+
const [open, setOpen] = useState(false);
|
|
16
|
+
const [sorgu, setSorgu] = useState("");
|
|
17
|
+
const tetik = useRef(null);
|
|
18
|
+
const liste = useRef(null);
|
|
19
|
+
const arama = useRef(null);
|
|
20
|
+
const kapat = useCallback(() => setOpen(false), []);
|
|
21
|
+
const kutu = useDismiss(open, kapat);
|
|
22
|
+
/* Klavyeyle kapanınca odak tetiğe döner: panel kaybolup odak gövdeye düşerse
|
|
23
|
+
ekran okuyucu kullanıcısı nerede olduğunu kaybediyor. */
|
|
24
|
+
const kapatOdakla = useCallback(() => {
|
|
25
|
+
setOpen(false);
|
|
26
|
+
tetik.current?.focus();
|
|
27
|
+
}, []);
|
|
28
|
+
useListKeys({ open, containerRef: kutu, onClose: kapatOdakla });
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
if (!open) {
|
|
31
|
+
setSorgu("");
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
if (searchable)
|
|
35
|
+
arama.current?.focus();
|
|
36
|
+
else
|
|
37
|
+
liste.current?.querySelector("[data-tamga-option]")?.focus();
|
|
38
|
+
}, [open, searchable]);
|
|
39
|
+
const secili = multiple ? value : value ? [value] : [];
|
|
40
|
+
const seciliSecenekler = secili
|
|
41
|
+
.map((v) => options.find((o) => o.value === v))
|
|
42
|
+
.filter((o) => Boolean(o));
|
|
43
|
+
const q = sorgu.trim().toLocaleLowerCase();
|
|
44
|
+
const gorunen = q ? options.filter((o) => o.label.toLocaleLowerCase().includes(q)) : options;
|
|
45
|
+
const sec = (v) => {
|
|
46
|
+
if (multiple) {
|
|
47
|
+
const simdiki = value;
|
|
48
|
+
onChange(simdiki.includes(v) ? simdiki.filter((x) => x !== v) : [...simdiki, v]);
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
onChange(v);
|
|
52
|
+
kapatOdakla();
|
|
53
|
+
};
|
|
54
|
+
const ozet = seciliSecenekler.length === 0
|
|
55
|
+
? null
|
|
56
|
+
: multiple && seciliSecenekler.length > 1
|
|
57
|
+
? `${seciliSecenekler[0].label} +${seciliSecenekler.length - 1}`
|
|
58
|
+
: seciliSecenekler[0].label;
|
|
59
|
+
const secenek = (o, kanca = {}) => {
|
|
60
|
+
const isaretli = secili.includes(o.value) || (o.value === "" && secili.length === 0);
|
|
61
|
+
return (_createElement("button", { ...kanca, key: o.value || "*", type: "button", role: "option", "aria-selected": isaretli, "data-tamga-option": true, "data-selected": isaretli, className: "tamga-option", onClick: () => sec(o.value) },
|
|
62
|
+
o.tone ? _jsx("span", { "aria-hidden": true, className: "tamga-mark shrink-0", style: { background: toneOf(o.tone).mark } }) : null,
|
|
63
|
+
_jsx("span", { className: "min-w-0 flex-1 truncate", children: o.label }),
|
|
64
|
+
o.hint ? _jsx("span", { className: "shrink-0 text-small text-ink-faint", children: o.hint }) : null,
|
|
65
|
+
isaretli ? _jsx(Icon, { icon: Check, size: "xs", weight: "bold", className: "shrink-0 text-[var(--color-accent-line)]" }) : null));
|
|
66
|
+
};
|
|
67
|
+
return (_jsxs("div", { ...dataProps(rest), ref: kutu, className: cn("tamga-select-panel", className), children: [_jsxs("button", { ref: tetik, type: "button", className: cn(buttonVariants({ variant, size }), "tamga-select-panel-tetik"), "aria-haspopup": "listbox", "aria-expanded": open, "aria-controls": open ? `${id}-liste` : undefined, "aria-label": ariaLabel, "data-set": ozet ? "true" : undefined, disabled: disabled || undefined, onClick: () => setOpen((o) => !o), children: [prefix ? _jsx("span", { className: "tamga-select-panel-onek", children: prefix }) : null, _jsx("span", { className: cn("min-w-0 truncate", ozet ? "" : "tamga-select-panel-bos"), children: ozet ?? placeholder }), caret ? _jsx(Icon, { icon: CaretDown, size: "xs", weight: "bold", className: "shrink-0" }) : null] }), open ? (_jsxs("div", { className: "tamga-overlay tamga-menu tamga-select-panel-kutu", children: [_jsx("span", { className: "tamga-menu-baslik", children: title }), searchable ? (_jsxs("span", { className: "tamga-select-panel-arama", children: [_jsx(Icon, { icon: Search, size: "xs", "aria-hidden": true, className: "pointer-events-none absolute left-2.5 text-ink-faint" }), _jsx(Input, { ref: arama, type: "search", full: true, leading: true, size: "sm", "aria-label": labels.search ?? title, placeholder: labels.search ?? title, value: sorgu, onChange: (e) => setSorgu(e.target.value) })] })) : null, _jsxs("div", { ref: liste, id: `${id}-liste`, role: "listbox", "aria-label": title, "aria-multiselectable": multiple || undefined, className: "tamga-select-panel-liste", children: [allLabel && !multiple ? secenek({ value: "", label: allLabel }) : null, gorunen.map(({ value: v, label, tone, hint, ...kanca }) => secenek({ value: v, label, tone, hint }, kanca)), gorunen.length === 0 ? _jsx("span", { className: "tamga-select-panel-yok", children: labels.noMatch }) : null] }), multiple && labels.clear ? (_jsx("span", { className: "tamga-select-panel-alt", children: _jsx("button", { type: "button", className: "tamga-link", onClick: () => onChange([]), children: labels.clear }) })) : null] })) : null] }));
|
|
68
|
+
}
|
package/dist/fonts.css
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export { type Tone, type ToneStyle, tones, toneOf, TONE_RANK, rankOf, neutral, a
|
|
|
10
10
|
export { useFocusTrap, useListKeys } from "./components/a11y.js";
|
|
11
11
|
export { Button, buttonVariants, type ButtonProps, IconButton, iconButtonVariants, MiniButton, } from "./components/button.js";
|
|
12
12
|
export { Input, InputGroup, inputVariants, type InputProps, Textarea, type TextareaProps } from "./components/input.js";
|
|
13
|
+
export { SelectPanel, type SelectPanelOption, type SelectPanelProps } from "./components/select-panel.js";
|
|
13
14
|
export { Checkbox } from "./components/checkbox.js";
|
|
14
15
|
export { RadioGroup } from "./components/radio-group.js";
|
|
15
16
|
export { Switch } from "./components/switch.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EACL,KAAK,IAAI,EACT,KAAK,SAAS,EACd,KAAK,EACL,MAAM,EACN,SAAS,EACT,MAAM,EACN,OAAO,EACP,MAAM,GACP,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGjE,OAAO,EACL,MAAM,EACN,cAAc,EACd,KAAK,WAAW,EAChB,UAAU,EACV,kBAAkB,EAClB,UAAU,GACX,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,KAAK,UAAU,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EACL,KAAK,IAAI,EACT,KAAK,SAAS,EACd,KAAK,EACL,MAAM,EACN,SAAS,EACT,MAAM,EACN,OAAO,EACP,MAAM,GACP,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGjE,OAAO,EACL,MAAM,EACN,cAAc,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E,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,KAAK,GAAG,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,KAAK,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAChF,OAAO,EAAE,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,0BAA0B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -12,6 +12,7 @@ export { useFocusTrap, useListKeys } from "./components/a11y.js";
|
|
|
12
12
|
/* --- controls ---------------------------------------------------------- */
|
|
13
13
|
export { Button, buttonVariants, IconButton, iconButtonVariants, MiniButton, } from "./components/button.js";
|
|
14
14
|
export { Input, InputGroup, inputVariants, Textarea } from "./components/input.js";
|
|
15
|
+
export { SelectPanel } from "./components/select-panel.js";
|
|
15
16
|
/* --- seçim kontrolleri -------------------------------------------------- */
|
|
16
17
|
export { Checkbox } from "./components/checkbox.js";
|
|
17
18
|
export { RadioGroup } from "./components/radio-group.js";
|
package/dist/kit.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! tamga-ui 0.
|
|
1
|
+
/*! tamga-ui 0.8.0 · MIT · https://tamga.org.tr */
|
|
2
2
|
:root {
|
|
3
3
|
|
|
4
4
|
--overlay-gap: 8px;
|
|
@@ -1101,6 +1101,142 @@
|
|
|
1101
1101
|
cursor: pointer;
|
|
1102
1102
|
}
|
|
1103
1103
|
|
|
1104
|
+
.tamga-filter-bar {
|
|
1105
|
+
display: flex;
|
|
1106
|
+
flex-direction: column;
|
|
1107
|
+
gap: 14px;
|
|
1108
|
+
padding: 16px;
|
|
1109
|
+
}
|
|
1110
|
+
|
|
1111
|
+
[data-filters] > .tamga-filter-bar {
|
|
1112
|
+
flex: 1 1 100%;
|
|
1113
|
+
padding: 0;
|
|
1114
|
+
border: 0;
|
|
1115
|
+
border-radius: 0;
|
|
1116
|
+
background: none;
|
|
1117
|
+
box-shadow: none;
|
|
1118
|
+
}
|
|
1119
|
+
|
|
1120
|
+
.tamga-filter-ara,
|
|
1121
|
+
.tamga-filter-alan {
|
|
1122
|
+
display: flex;
|
|
1123
|
+
flex-direction: column;
|
|
1124
|
+
gap: 6px;
|
|
1125
|
+
min-width: 0;
|
|
1126
|
+
}
|
|
1127
|
+
.tamga-filter-ara {
|
|
1128
|
+
flex: 2 1 18.75rem;
|
|
1129
|
+
}
|
|
1130
|
+
.tamga-filter-alan {
|
|
1131
|
+
flex: 1 1 10rem;
|
|
1132
|
+
}
|
|
1133
|
+
.tamga-filter-alan[data-range] {
|
|
1134
|
+
flex-basis: 20rem;
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
.tamga-filter-kir {
|
|
1138
|
+
height: 0;
|
|
1139
|
+
flex-basis: 100%;
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
.tamga-filter-grup {
|
|
1143
|
+
display: flex;
|
|
1144
|
+
flex-direction: column;
|
|
1145
|
+
gap: 14px;
|
|
1146
|
+
}
|
|
1147
|
+
|
|
1148
|
+
.tamga-filter-cips {
|
|
1149
|
+
display: flex;
|
|
1150
|
+
flex-wrap: wrap;
|
|
1151
|
+
align-items: flex-end;
|
|
1152
|
+
gap: 8px;
|
|
1153
|
+
}
|
|
1154
|
+
.tamga-filter-ara-sabit {
|
|
1155
|
+
display: flex;
|
|
1156
|
+
flex-direction: column;
|
|
1157
|
+
gap: 6px;
|
|
1158
|
+
min-width: 0;
|
|
1159
|
+
max-width: 100%;
|
|
1160
|
+
flex: 0 0 17.5rem;
|
|
1161
|
+
}
|
|
1162
|
+
.tamga-filter-cip-sira {
|
|
1163
|
+
display: contents;
|
|
1164
|
+
}
|
|
1165
|
+
.tamga-filter-cip {
|
|
1166
|
+
display: inline-flex;
|
|
1167
|
+
align-items: center;
|
|
1168
|
+
gap: 4px;
|
|
1169
|
+
max-width: 100%;
|
|
1170
|
+
}
|
|
1171
|
+
.tamga-filter-cip-x {
|
|
1172
|
+
display: grid;
|
|
1173
|
+
place-items: center;
|
|
1174
|
+
width: calc(var(--control) - 8px);
|
|
1175
|
+
height: calc(var(--control) - 8px);
|
|
1176
|
+
flex-shrink: 0;
|
|
1177
|
+
border: 1.5px solid var(--color-edge-strong);
|
|
1178
|
+
border-radius: var(--radius-ctl);
|
|
1179
|
+
background: var(--color-accent-soft);
|
|
1180
|
+
color: var(--color-accent-soft-ink);
|
|
1181
|
+
box-shadow: 3px 3px 0 var(--color-edge-strong);
|
|
1182
|
+
cursor: pointer;
|
|
1183
|
+
}
|
|
1184
|
+
.tamga-filter-cip-x:hover {
|
|
1185
|
+
transform: translate(-1px, -1px);
|
|
1186
|
+
box-shadow: 4px 4px 0 var(--color-edge-strong);
|
|
1187
|
+
}
|
|
1188
|
+
.tamga-filter-cip-x:active {
|
|
1189
|
+
transform: translate(3px, 3px);
|
|
1190
|
+
box-shadow: 0 0 0 var(--color-edge-strong);
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
.tamga-select-panel-tam,
|
|
1194
|
+
.tamga-select-panel-tam > .tamga-select-panel-tetik {
|
|
1195
|
+
display: flex;
|
|
1196
|
+
width: 100%;
|
|
1197
|
+
}
|
|
1198
|
+
.tamga-select-panel-tam > .tamga-select-panel-tetik {
|
|
1199
|
+
justify-content: flex-start;
|
|
1200
|
+
}
|
|
1201
|
+
.tamga-select-panel-tam > .tamga-select-panel-tetik > .tamga-select-panel-bos,
|
|
1202
|
+
.tamga-select-panel-tam > .tamga-select-panel-tetik > span:not(.tamga-select-panel-onek) {
|
|
1203
|
+
flex: 1;
|
|
1204
|
+
text-align: start;
|
|
1205
|
+
}
|
|
1206
|
+
|
|
1207
|
+
@media (max-width: 39.9375rem) {
|
|
1208
|
+
.tamga-filter-genis {
|
|
1209
|
+
display: none;
|
|
1210
|
+
}
|
|
1211
|
+
.tamga-filter-row > .tamga-filter-ara {
|
|
1212
|
+
flex-basis: 0;
|
|
1213
|
+
}
|
|
1214
|
+
|
|
1215
|
+
.tamga-filter-cips > .tamga-filter-ara-sabit {
|
|
1216
|
+
flex: 1 1 0;
|
|
1217
|
+
}
|
|
1218
|
+
.tamga-filter-cips .tamga-filter-cip:not([data-set]) {
|
|
1219
|
+
display: none;
|
|
1220
|
+
}
|
|
1221
|
+
.tamga-filter-cip-sira {
|
|
1222
|
+
display: flex;
|
|
1223
|
+
order: 2;
|
|
1224
|
+
flex: 1 1 100%;
|
|
1225
|
+
flex-wrap: nowrap;
|
|
1226
|
+
gap: 8px;
|
|
1227
|
+
overflow-x: auto;
|
|
1228
|
+
scrollbar-width: none;
|
|
1229
|
+
}
|
|
1230
|
+
.tamga-filter-cip-sira:empty {
|
|
1231
|
+
display: none;
|
|
1232
|
+
}
|
|
1233
|
+
}
|
|
1234
|
+
@media (min-width: 40rem) {
|
|
1235
|
+
.tamga-filter-dar {
|
|
1236
|
+
display: none;
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1239
|
+
|
|
1104
1240
|
.tamga-filter-row {
|
|
1105
1241
|
--filter-gap: 12px;
|
|
1106
1242
|
display: flex;
|
|
@@ -3006,6 +3142,16 @@
|
|
|
3006
3142
|
transition: width var(--duration-base) var(--ease-standard);
|
|
3007
3143
|
}
|
|
3008
3144
|
|
|
3145
|
+
.tamga-progress-sm {
|
|
3146
|
+
height: 4px;
|
|
3147
|
+
border: 0;
|
|
3148
|
+
box-shadow: none;
|
|
3149
|
+
}
|
|
3150
|
+
.tamga-progress-sm > .tamga-progress-fill {
|
|
3151
|
+
background: var(--color-accent);
|
|
3152
|
+
border-right: 0;
|
|
3153
|
+
}
|
|
3154
|
+
|
|
3009
3155
|
.tamga-progress-bloklar {
|
|
3010
3156
|
display: grid;
|
|
3011
3157
|
gap: 4px;
|
|
@@ -3077,6 +3223,59 @@
|
|
|
3077
3223
|
padding: 5px;
|
|
3078
3224
|
}
|
|
3079
3225
|
|
|
3226
|
+
.tamga-select-panel {
|
|
3227
|
+
position: relative;
|
|
3228
|
+
display: inline-flex;
|
|
3229
|
+
max-width: 100%;
|
|
3230
|
+
}
|
|
3231
|
+
.tamga-select-panel-tetik {
|
|
3232
|
+
max-width: 100%;
|
|
3233
|
+
}
|
|
3234
|
+
.tamga-select-panel-onek {
|
|
3235
|
+
font-weight: var(--weight-body);
|
|
3236
|
+
}
|
|
3237
|
+
.tamga-select-panel-bos {
|
|
3238
|
+
color: var(--color-ink-faint);
|
|
3239
|
+
font-weight: var(--weight-body);
|
|
3240
|
+
}
|
|
3241
|
+
.tamga-select-panel-kutu {
|
|
3242
|
+
position: absolute;
|
|
3243
|
+
left: 0;
|
|
3244
|
+
top: var(--overlay-below);
|
|
3245
|
+
z-index: 40;
|
|
3246
|
+
display: flex;
|
|
3247
|
+
flex-direction: column;
|
|
3248
|
+
gap: 2px;
|
|
3249
|
+
min-width: 15rem;
|
|
3250
|
+
max-width: 22rem;
|
|
3251
|
+
}
|
|
3252
|
+
.tamga-select-panel-arama {
|
|
3253
|
+
position: relative;
|
|
3254
|
+
display: flex;
|
|
3255
|
+
align-items: center;
|
|
3256
|
+
padding: 2px 5px 6px;
|
|
3257
|
+
}
|
|
3258
|
+
.tamga-select-panel-liste {
|
|
3259
|
+
display: flex;
|
|
3260
|
+
flex-direction: column;
|
|
3261
|
+
gap: 2px;
|
|
3262
|
+
max-height: 18rem;
|
|
3263
|
+
overflow-y: auto;
|
|
3264
|
+
}
|
|
3265
|
+
.tamga-select-panel-yok {
|
|
3266
|
+
display: block;
|
|
3267
|
+
padding: 8px 10px;
|
|
3268
|
+
font-size: var(--text-small);
|
|
3269
|
+
color: var(--color-ink-faint);
|
|
3270
|
+
}
|
|
3271
|
+
.tamga-select-panel-alt {
|
|
3272
|
+
display: flex;
|
|
3273
|
+
justify-content: flex-end;
|
|
3274
|
+
padding: 6px 10px 4px;
|
|
3275
|
+
border-top: 1px dashed var(--color-line);
|
|
3276
|
+
font-size: var(--text-small);
|
|
3277
|
+
}
|
|
3278
|
+
|
|
3080
3279
|
.tamga-option {
|
|
3081
3280
|
display: flex;
|
|
3082
3281
|
width: 100%;
|
|
@@ -3431,6 +3630,13 @@
|
|
|
3431
3630
|
letter-spacing: inherit;
|
|
3432
3631
|
}
|
|
3433
3632
|
|
|
3633
|
+
.tamga-card .tamga-table thead th:first-child {
|
|
3634
|
+
border-start-start-radius: calc(var(--radius-card) - 1px);
|
|
3635
|
+
}
|
|
3636
|
+
.tamga-card .tamga-table thead th:last-child {
|
|
3637
|
+
border-start-end-radius: calc(var(--radius-card) - 1px);
|
|
3638
|
+
}
|
|
3639
|
+
|
|
3434
3640
|
.tamga-table tbody tr {
|
|
3435
3641
|
|
|
3436
3642
|
font-size: 14px;
|
package/dist/styles.css
CHANGED
package/dist/theme.css
CHANGED