tamga-ui 0.5.0 → 0.5.1
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 +30 -0
- package/README.md +0 -4
- package/dist/components/a11y.d.ts.map +1 -1
- package/dist/components/a11y.js +9 -3
- package/dist/fonts.css +1 -1
- package/dist/kit.css +9 -15
- package/dist/styles.css +1 -1
- package/dist/theme.css +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,36 @@ 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.5.1
|
|
9
|
+
|
|
10
|
+
> Three corrections the 0.5.0 port left behind: a menu that stole the page's scroll, and the
|
|
11
|
+
> rail's hover, lift and press.
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- **The rail's hover is a wash again, and the current row lifts.** Hovering a row had it grow a
|
|
16
|
+
border and a base, turning every row into its own button: a rail is a list of eight, and eight
|
|
17
|
+
controls under the pointer is not navigation. Hover is now only the wash the kit already had a
|
|
18
|
+
token for (`--color-nav-hover-bg`), and the current row — which never takes that wash — lifts by
|
|
19
|
+
a pixel over its 3px base, so "you are here" is the one thing standing up. Law 2 is untouched:
|
|
20
|
+
it binds the FILL to an action, not the height, and the current row still speaks with an
|
|
21
|
+
outline. The pressed row travels 2px, which is the 3px of its base measured from where it
|
|
22
|
+
actually rests.
|
|
23
|
+
|
|
24
|
+
- **A pressed segment no longer sinks below its own ground.** The selected tab rests a pixel up so
|
|
25
|
+
its shadow has room, which puts its ground at 1px; it was travelling 2px. The physics gate could
|
|
26
|
+
not see this because it measured the ARRIVAL, not the travel, and every family with a shadow
|
|
27
|
+
used to rest flat — that is fixed too, and the gate found this the moment it could.
|
|
28
|
+
|
|
29
|
+
### Fixed
|
|
30
|
+
|
|
31
|
+
- **A menu that starts open no longer steals the focus.** `DropdownMenu` with `defaultOpen`
|
|
32
|
+
focused its first option on mount, and the browser scrolls whatever it focuses into view: a page
|
|
33
|
+
carrying such a menu opened thousands of pixels down, past its own heading. The rule is no
|
|
34
|
+
longer "is it open" but "was it just opened" — the focus belongs to whoever performed the
|
|
35
|
+
opening. A menu the visitor opens still focuses its first option, so the arrow keys have
|
|
36
|
+
somewhere to start. Covered by a test.
|
|
37
|
+
|
|
8
38
|
## 0.5.0
|
|
9
39
|
|
|
10
40
|
> The Soft Neo Brutalism port: every component, every token and the physics behind them. The
|
package/README.md
CHANGED
|
@@ -26,10 +26,6 @@ Docs: **[tamga.org.tr](https://tamga.org.tr)** · Changelog: [CHANGELOG.md](./CH
|
|
|
26
26
|
npm install tamga-ui
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
> **If a machine is reading this:** the package page (`npmjs.com/...`) returns **403** to
|
|
30
|
-
> non-browser requests. That is npm's bot protection, nothing to do with this package. For
|
|
31
|
-
> versions and metadata use the registry: `https://registry.npmjs.org/tamga-ui` (200, plain JSON).
|
|
32
|
-
|
|
33
29
|
### Local development
|
|
34
30
|
|
|
35
31
|
To link the kit into a consuming project without publishing, while changing the kit itself:
|
|
@@ -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,QA0DA"}
|
package/dist/components/a11y.js
CHANGED
|
@@ -98,16 +98,22 @@ export function useFocusTrap(open) {
|
|
|
98
98
|
* without the hook needing to know what a separator is.
|
|
99
99
|
*/
|
|
100
100
|
export function useListKeys({ open, containerRef, onClose, }) {
|
|
101
|
+
/* Ölçüt "açık mı" değil, "AÇILDI MI": `defaultOpen` ile açık doğan bir menüde
|
|
102
|
+
ilk seçenek odağı alırsa tarayıcı sayfayı ona kaydırıyor.
|
|
103
|
+
Gerekçe: docs/gerekce/07-katman-ve-diyalog.md */
|
|
104
|
+
const acikDogdu = useRef(open);
|
|
101
105
|
useEffect(() => {
|
|
102
|
-
if (!open)
|
|
106
|
+
if (!open) {
|
|
107
|
+
acikDogdu.current = false;
|
|
103
108
|
return;
|
|
109
|
+
}
|
|
104
110
|
const root = containerRef.current;
|
|
105
111
|
if (!root)
|
|
106
112
|
return;
|
|
107
113
|
const items = () => Array.from(root.querySelectorAll("[data-tamga-option]:not([disabled])"));
|
|
108
114
|
/* focus the first option on open, so the arrows have somewhere to start */
|
|
109
|
-
|
|
110
|
-
|
|
115
|
+
if (!acikDogdu.current)
|
|
116
|
+
items()[0]?.focus();
|
|
111
117
|
const onKey = (e) => {
|
|
112
118
|
const list = items();
|
|
113
119
|
if (list.length === 0)
|
package/dist/fonts.css
CHANGED
package/dist/kit.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! tamga-ui 0.5.
|
|
1
|
+
/*! tamga-ui 0.5.1 · MIT · https://tamga.org.tr */
|
|
2
2
|
:root {
|
|
3
3
|
|
|
4
4
|
--overlay-gap: 8px;
|
|
@@ -433,38 +433,31 @@
|
|
|
433
433
|
padding-inline: 10px;
|
|
434
434
|
}
|
|
435
435
|
|
|
436
|
-
.tamga-rail-link:hover {
|
|
436
|
+
.tamga-rail-link:hover:not([data-active="true"]) {
|
|
437
437
|
color: var(--color-nav-hover);
|
|
438
|
-
background: var(--color-
|
|
439
|
-
border-color: var(--color-edge-strong);
|
|
440
|
-
transform: translate(-1px, -1px);
|
|
441
|
-
box-shadow: 4px 4px 0 var(--color-edge-strong);
|
|
438
|
+
background: var(--color-nav-hover-bg);
|
|
442
439
|
}
|
|
443
440
|
|
|
444
441
|
.tamga-rail-link[data-active="true"] {
|
|
445
442
|
background: var(--color-shell);
|
|
446
443
|
border-color: var(--color-edge-strong);
|
|
444
|
+
transform: translate(-1px, -1px);
|
|
447
445
|
box-shadow: 3px 3px 0 var(--color-edge-strong);
|
|
448
446
|
}
|
|
449
447
|
|
|
450
448
|
.tamga-rail-link[data-active="true"] svg {
|
|
451
449
|
color: var(--color-accent);
|
|
452
450
|
}
|
|
453
|
-
|
|
454
|
-
background: var(--color-shell);
|
|
455
|
-
border-color: var(--color-edge-strong);
|
|
456
|
-
transform: translate(-1px, -1px);
|
|
457
|
-
box-shadow: 4px 4px 0 var(--color-edge-strong);
|
|
458
|
-
}
|
|
451
|
+
|
|
459
452
|
.tamga-rail-link[data-active="true"]:active {
|
|
460
|
-
transform: translate(
|
|
453
|
+
transform: translate(2px, 2px);
|
|
461
454
|
box-shadow: 0 0 0 var(--color-edge-strong);
|
|
462
455
|
}
|
|
463
456
|
|
|
464
457
|
.tamga-btn:not(:disabled):active,
|
|
465
458
|
.tamga-icon-btn:not(:disabled):active,
|
|
466
459
|
.tamga-mini-btn:not(:disabled):active,
|
|
467
|
-
|
|
460
|
+
|
|
468
461
|
.tamga-art-tile:active,
|
|
469
462
|
.tamga-art-route:active {
|
|
470
463
|
transition-duration: 0s;
|
|
@@ -2144,8 +2137,9 @@
|
|
|
2144
2137
|
transform: translate(-1px, -1px);
|
|
2145
2138
|
box-shadow: 3px 3px 0 var(--color-edge);
|
|
2146
2139
|
}
|
|
2140
|
+
|
|
2147
2141
|
.tamga-segment > button[data-active="true"]:active {
|
|
2148
|
-
transform: translate(
|
|
2142
|
+
transform: translate(1px, 1px);
|
|
2149
2143
|
box-shadow: 0 0 0 var(--color-edge);
|
|
2150
2144
|
}
|
|
2151
2145
|
|
package/dist/styles.css
CHANGED
package/dist/theme.css
CHANGED