@jirawatpyk/aura-react 5.76.0 → 5.77.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/README.md +4 -0
- package/dist/aura.bundle.js +13 -0
- package/dist/cjs/index.cjs +13 -0
- package/dist/esm/useModal.js +13 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -186,6 +186,10 @@ DataTable with sort and page in the URL (4.17): `onStateChange={({ sort, page })
|
|
|
186
186
|
- **Time zone**: `timeZone` on AuraProvider, DatePicker, DateRangePicker and Calendar decides "today" (the marker, `min`/`max="today"`, the first month shown); or pass `today` as an ISO date. `todayIn('Asia/Bangkok')` is exported from the root and `/server`.
|
|
187
187
|
- **Toasts** queue past three instead of dropping: six in a row all show, in order, three at a time.
|
|
188
188
|
|
|
189
|
+
## 5.77 — Chamber-OS addendum 95 follow-up (#194)
|
|
190
|
+
|
|
191
|
+
- **A confirmation opens at its top on a short screen:** when a Dialog scrolls as one box (5.76) and its first focus lands in the footer — `data-autofocus` on Cancel, or a dialog with nothing to fill in — it no longer scrolls to its end on open: the title, the description and the summary of what is being confirmed are what show first, with Cancel focused below. Tab or a scroll reaches the buttons as before. A field in the body that takes the first focus is still scrolled into view (it is what you type in next). By design the focused Cancel then starts below the fold: focus is in the dialog, on the safe action, and a screen reader reads the title and description first. Above 30rem nothing changes — where the panel can't scroll, the browser keeps the focused button in view as before; a Drawer is unaffected. With `autoFocus={false}`, a footer button you focus yourself scrolls as the browser does.
|
|
192
|
+
|
|
189
193
|
## 5.76 — Chamber-OS addendum 95 (#194)
|
|
190
194
|
|
|
191
195
|
- **A Dialog on a short screen scrolls as one box:** on a screen 30rem tall or less (480px at the default 16px — 400% zoom on a laptop, a phone on its side with the keyboard up), the head, the description, the body and the footer scroll together inside the dialog, with the footer at the end of the content, instead of a fixed head and footer around a body squeezed to nothing. Focus moves (`data-autofocus`, the first field, the focus trap) work as before, and a focused field scrolls into view with 16px to spare (`scroll-padding`). Above 30rem nothing changes: the footer stays fixed under a scrolling body. The same threshold as ActionBar's and AppShell's bars (5.48). Wide content in the body (a long URL, a `<pre>`) still scrolls sideways there. Scrolled to the footer, the × has scrolled away with the head — Escape and Cancel still close. A `position: sticky` element in the body doesn't stick on a short screen (it scrolls with the content). Dialog only: a Drawer keeps its fixed head and footer. A `.aura-dialog` / `.aura-dialog__body` stand-in in your CSS can go.
|
package/dist/aura.bundle.js
CHANGED
|
@@ -5123,6 +5123,7 @@ window.Aura = (() => {
|
|
|
5123
5123
|
prev.current = document.activeElement;
|
|
5124
5124
|
const unlock = lockScroll();
|
|
5125
5125
|
const el = ref.current;
|
|
5126
|
+
let raf = 0;
|
|
5126
5127
|
const inPart = function(scope) {
|
|
5127
5128
|
if (!scope || !el) return [];
|
|
5128
5129
|
const sel = TAB_STOPS.split(",").map(function(s) {
|
|
@@ -5133,8 +5134,20 @@ window.Aura = (() => {
|
|
|
5133
5134
|
if (el && o.autoFocus !== false) {
|
|
5134
5135
|
const auto = el.querySelector("[data-autofocus]");
|
|
5135
5136
|
if (!focusFirst(el, auto, [inPart(o.bodySelector), inPart(o.footSelector)])) el.focus();
|
|
5137
|
+
const foot = o.footSelector ? el.querySelector(o.footSelector) : null, head = el.firstElementChild, first = document.activeElement, panel = el;
|
|
5138
|
+
const toTop = function() {
|
|
5139
|
+
if (foot && foot.contains(first) && document.activeElement === first && panel.scrollTop > 0 && /auto|scroll/.test(getComputedStyle(panel).overflowY) && head && head.getBoundingClientRect().top < panel.getBoundingClientRect().top)
|
|
5140
|
+
panel.scrollTop = 0;
|
|
5141
|
+
};
|
|
5142
|
+
toTop();
|
|
5143
|
+
if (foot && foot.contains(first))
|
|
5144
|
+
raf = requestAnimationFrame(function() {
|
|
5145
|
+
toTop();
|
|
5146
|
+
raf = requestAnimationFrame(toTop);
|
|
5147
|
+
});
|
|
5136
5148
|
}
|
|
5137
5149
|
return function() {
|
|
5150
|
+
cancelAnimationFrame(raf);
|
|
5138
5151
|
unlock();
|
|
5139
5152
|
const l = latest.current;
|
|
5140
5153
|
const ff = l.finalFocus;
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -5105,6 +5105,7 @@ function useModal(open, ref, opts) {
|
|
|
5105
5105
|
prev.current = document.activeElement;
|
|
5106
5106
|
const unlock = lockScroll();
|
|
5107
5107
|
const el = ref.current;
|
|
5108
|
+
let raf = 0;
|
|
5108
5109
|
const inPart = function(scope) {
|
|
5109
5110
|
if (!scope || !el) return [];
|
|
5110
5111
|
const sel = TAB_STOPS.split(",").map(function(s) {
|
|
@@ -5115,8 +5116,20 @@ function useModal(open, ref, opts) {
|
|
|
5115
5116
|
if (el && o.autoFocus !== false) {
|
|
5116
5117
|
const auto = el.querySelector("[data-autofocus]");
|
|
5117
5118
|
if (!focusFirst(el, auto, [inPart(o.bodySelector), inPart(o.footSelector)])) el.focus();
|
|
5119
|
+
const foot = o.footSelector ? el.querySelector(o.footSelector) : null, head = el.firstElementChild, first = document.activeElement, panel = el;
|
|
5120
|
+
const toTop = function() {
|
|
5121
|
+
if (foot && foot.contains(first) && document.activeElement === first && panel.scrollTop > 0 && /auto|scroll/.test(getComputedStyle(panel).overflowY) && head && head.getBoundingClientRect().top < panel.getBoundingClientRect().top)
|
|
5122
|
+
panel.scrollTop = 0;
|
|
5123
|
+
};
|
|
5124
|
+
toTop();
|
|
5125
|
+
if (foot && foot.contains(first))
|
|
5126
|
+
raf = requestAnimationFrame(function() {
|
|
5127
|
+
toTop();
|
|
5128
|
+
raf = requestAnimationFrame(toTop);
|
|
5129
|
+
});
|
|
5118
5130
|
}
|
|
5119
5131
|
return function() {
|
|
5132
|
+
cancelAnimationFrame(raf);
|
|
5120
5133
|
unlock();
|
|
5121
5134
|
const l = latest.current;
|
|
5122
5135
|
const ff = l.finalFocus;
|
package/dist/esm/useModal.js
CHANGED
|
@@ -36,6 +36,7 @@ function useModal(open, ref, opts) {
|
|
|
36
36
|
prev.current = document.activeElement;
|
|
37
37
|
const unlock = lockScroll();
|
|
38
38
|
const el = ref.current;
|
|
39
|
+
let raf = 0;
|
|
39
40
|
const inPart = function(scope) {
|
|
40
41
|
if (!scope || !el) return [];
|
|
41
42
|
const sel = TAB_STOPS.split(",").map(function(s) {
|
|
@@ -46,8 +47,20 @@ function useModal(open, ref, opts) {
|
|
|
46
47
|
if (el && o.autoFocus !== false) {
|
|
47
48
|
const auto = el.querySelector("[data-autofocus]");
|
|
48
49
|
if (!focusFirst(el, auto, [inPart(o.bodySelector), inPart(o.footSelector)])) el.focus();
|
|
50
|
+
const foot = o.footSelector ? el.querySelector(o.footSelector) : null, head = el.firstElementChild, first = document.activeElement, panel = el;
|
|
51
|
+
const toTop = function() {
|
|
52
|
+
if (foot && foot.contains(first) && document.activeElement === first && panel.scrollTop > 0 && /auto|scroll/.test(getComputedStyle(panel).overflowY) && head && head.getBoundingClientRect().top < panel.getBoundingClientRect().top)
|
|
53
|
+
panel.scrollTop = 0;
|
|
54
|
+
};
|
|
55
|
+
toTop();
|
|
56
|
+
if (foot && foot.contains(first))
|
|
57
|
+
raf = requestAnimationFrame(function() {
|
|
58
|
+
toTop();
|
|
59
|
+
raf = requestAnimationFrame(toTop);
|
|
60
|
+
});
|
|
49
61
|
}
|
|
50
62
|
return function() {
|
|
63
|
+
cancelAnimationFrame(raf);
|
|
51
64
|
unlock();
|
|
52
65
|
const l = latest.current;
|
|
53
66
|
const ff = l.finalFocus;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jirawatpyk/aura-react",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.77.0",
|
|
4
4
|
"description": "AURA Design System — React components (Enterprise Standard, Human Creative). Thai-first: Buddhist-era dates, Thai collation.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|