@godxjp/ui 33.11.2 → 33.12.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/README.md +3 -3
- package/agent/START-HERE.md +7 -7
- package/agent/components/Anchor.json +1 -1
- package/agent/components/AppShell.json +1 -1
- package/agent/components/DataTable.json +1 -1
- package/agent/components/Pagination.json +1 -1
- package/agent/components/ResizablePanel.json +1 -1
- package/agent/components/ScrollArea.json +1 -1
- package/agent/components/Table.json +1 -1
- package/agent/components-index.json +7 -7
- package/agent/components.json +7 -7
- package/agent/index.json +6 -6
- package/agent/llms.txt +6 -6
- package/agent/tokens.json +20 -2
- package/dist/components/data-display/data-table.js +2 -0
- package/dist/components/data-display/table.js +3 -0
- package/dist/components/layout/app-shell.js +16 -6
- package/dist/components/layout/topbar.d.ts +1 -1
- package/dist/components/layout/topbar.js +7 -0
- package/dist/components/navigation/pagination.js +4 -0
- package/dist/contracts/measurement.json +1 -1
- package/dist/lab/anchor.js +11 -1
- package/dist/lib/focus-reveal.d.ts +5 -0
- package/dist/lib/focus-reveal.js +19 -0
- package/dist/lib/hooks.js +5 -2
- package/dist/styles/focus-ring.css +79 -19
- package/dist/styles/layers.json +1 -1
- package/dist/styles/layout.css +4 -4
- package/dist/styles/shell-layout.css +10 -0
- package/dist/styles.css +1 -1
- package/dist/tokens/base.css +2 -0
- package/dist/tokens/components/resizable.css +4 -0
- package/dist/tokens/foundation.css +4 -1
- package/docs/TOKENS.md +41 -23
- package/package.json +2 -2
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
function revealKeyboardFocus(event) {
|
|
2
|
+
const viewport = event.currentTarget;
|
|
3
|
+
const target = event.target;
|
|
4
|
+
if (!(target instanceof HTMLElement) || target === viewport || !viewport.contains(target) || !target.matches(":focus-visible"))
|
|
5
|
+
return;
|
|
6
|
+
const carrier = target.closest(".ui-tag-input,.ui-control-composite-field") ?? target;
|
|
7
|
+
const box = carrier.getBoundingClientRect();
|
|
8
|
+
const frame = viewport.getBoundingClientRect();
|
|
9
|
+
const left = frame.left + viewport.clientLeft;
|
|
10
|
+
const top = frame.top + viewport.clientTop;
|
|
11
|
+
const style = getComputedStyle(viewport);
|
|
12
|
+
const outsideX = /auto|scroll/.test(style.overflowX) && box.width <= viewport.clientWidth && (box.left < left || box.right > left + viewport.clientWidth);
|
|
13
|
+
const outsideY = /auto|scroll/.test(style.overflowY) && box.height <= viewport.clientHeight && (box.top < top || box.bottom > top + viewport.clientHeight);
|
|
14
|
+
if (outsideX || outsideY)
|
|
15
|
+
carrier.scrollIntoView?.({ block: "nearest", inline: "nearest", behavior: "instant" });
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
revealKeyboardFocus
|
|
19
|
+
};
|
package/dist/lib/hooks.js
CHANGED
|
@@ -77,9 +77,12 @@ function useScrollableRegionTabIndex(element) {
|
|
|
77
77
|
const sync = () => {
|
|
78
78
|
const scrolls = element.scrollHeight > element.clientHeight || element.scrollWidth > element.clientWidth;
|
|
79
79
|
const hasFocusableContent = element.querySelector(SCROLLABLE_REGION_FOCUSABLE_SELECTOR) !== null;
|
|
80
|
-
|
|
80
|
+
const hasVisibleBox = element.clientWidth > 0 && element.clientHeight > 0;
|
|
81
|
+
if (!hasVisibleBox) {
|
|
82
|
+
if (element.getAttribute("tabindex") !== "-1") element.setAttribute("tabindex", "-1");
|
|
83
|
+
} else if (scrolls && !hasFocusableContent) {
|
|
81
84
|
if (element.getAttribute("tabindex") !== "0") element.setAttribute("tabindex", "0");
|
|
82
|
-
} else if (element.getAttribute("tabindex")
|
|
85
|
+
} else if (["0", "-1"].includes(element.getAttribute("tabindex") ?? "")) {
|
|
83
86
|
element.removeAttribute("tabindex");
|
|
84
87
|
}
|
|
85
88
|
};
|
|
@@ -4,6 +4,34 @@
|
|
|
4
4
|
:is(
|
|
5
5
|
.ui-focus-ring,
|
|
6
6
|
.ui-focus-ring-outline,
|
|
7
|
+
.ui-flex,
|
|
8
|
+
.ui-table-scroll,
|
|
9
|
+
.ui-pagination-list,
|
|
10
|
+
.react-aria-Menu,
|
|
11
|
+
.ui-chart [tabindex],
|
|
12
|
+
.ui-prose input,
|
|
13
|
+
.ui-auth-legal-footer a[href],
|
|
14
|
+
.ui-auth-shell a[href],
|
|
15
|
+
.app-main a[href],
|
|
16
|
+
.ui-breadcrumb a[href],
|
|
17
|
+
.ui-breadcrumb-link,
|
|
18
|
+
.ui-password-input-toggle,
|
|
19
|
+
.ui-search-select-value-remove,
|
|
20
|
+
.ui-tabs-overflow,
|
|
21
|
+
.ui-resizable-handle,
|
|
22
|
+
.ui-scroll-area,
|
|
23
|
+
.ui-data-table-scroll,
|
|
24
|
+
.ui-resizable-panel,
|
|
25
|
+
.ui-master-detail-master,
|
|
26
|
+
.ui-branch-scope-picker-list,
|
|
27
|
+
.ui-tag-input-chip,
|
|
28
|
+
.ui-attachments-placeholder,
|
|
29
|
+
.ui-block-editor-content,
|
|
30
|
+
.ui-range-timeline,
|
|
31
|
+
.sb-product,
|
|
32
|
+
.ui-logo,
|
|
33
|
+
.ui-logo-lockup,
|
|
34
|
+
[data-slot="anchor-link"],
|
|
7
35
|
[data-interactive] > [data-slot="table-cell"] a[href],
|
|
8
36
|
[data-interactive] > [data-slot="table-cell"] button,
|
|
9
37
|
.ui-data-table-ellipsis[data-truncated],
|
|
@@ -51,6 +79,8 @@
|
|
|
51
79
|
.tb-icon-btn
|
|
52
80
|
):focus-visible,
|
|
53
81
|
|
|
82
|
+
.ui-command-input-wrapper:has(.ui-command-input:focus-visible),
|
|
83
|
+
.ui-attachments:has(.ui-attachments-input:focus-visible),
|
|
54
84
|
.ui-calendar-dropdown-root:has(.ui-calendar-dropdown:focus-visible),
|
|
55
85
|
.ui-checkbox[data-focus-visible],
|
|
56
86
|
.ui-radio[data-focus-visible],
|
|
@@ -70,17 +100,20 @@
|
|
|
70
100
|
var(--focus-outline-color, var(--focus-ring-color, var(--ring))) /
|
|
71
101
|
var(--focus-ring-opacity, 1)
|
|
72
102
|
);
|
|
73
|
-
outline-offset: var(--focus-ring-offset);
|
|
103
|
+
outline-offset: var(--focus-ring-contained-offset, var(--focus-ring-offset));
|
|
74
104
|
|
|
75
105
|
transition:
|
|
76
106
|
outline-offset 0s,
|
|
77
107
|
outline 0s;
|
|
78
108
|
}
|
|
79
109
|
|
|
80
|
-
:root[data-focus-outline="
|
|
110
|
+
:root:not([data-focus-outline="off"])
|
|
81
111
|
:is(
|
|
82
112
|
.ui-focus-ring,
|
|
83
113
|
.ui-focus-ring-outline,
|
|
114
|
+
.ui-logo,
|
|
115
|
+
.ui-logo-lockup,
|
|
116
|
+
[data-slot="anchor-link"],
|
|
84
117
|
.ui-input,
|
|
85
118
|
.ui-control,
|
|
86
119
|
.ui-control-multiline,
|
|
@@ -123,21 +156,22 @@
|
|
|
123
156
|
.tb-icon-btn
|
|
124
157
|
):focus-visible,
|
|
125
158
|
|
|
126
|
-
:root[data-focus-outline="
|
|
127
|
-
:root[data-focus-outline="
|
|
128
|
-
:root[data-focus-outline="
|
|
129
|
-
:root[data-focus-outline="
|
|
130
|
-
:root[data-focus-outline="
|
|
131
|
-
:root[data-focus-outline="
|
|
132
|
-
:root[data-focus-outline="
|
|
133
|
-
:root[data-focus-outline="
|
|
134
|
-
:root[data-focus-outline="
|
|
135
|
-
:root[data-focus-outline="
|
|
136
|
-
:root[data-focus-outline="
|
|
159
|
+
:root:not([data-focus-outline="off"]) .ui-checkbox[data-focus-visible],
|
|
160
|
+
:root:not([data-focus-outline="off"]) .ui-radio[data-focus-visible],
|
|
161
|
+
:root:not([data-focus-outline="off"]) .ui-switch[data-focus-visible],
|
|
162
|
+
:root:not([data-focus-outline="off"]) .ui-slider-thumb[data-focus-visible],
|
|
163
|
+
:root:not([data-focus-outline="off"]) .ui-focus-ring[data-focus-visible],
|
|
164
|
+
:root:not([data-focus-outline="off"]) .ui-control-trigger[data-state="open"],
|
|
165
|
+
:root:not([data-focus-outline="off"]) .ui-tag-input:focus-within,
|
|
166
|
+
:root:not([data-focus-outline="off"]) .ui-control-composite-field:focus-within,
|
|
167
|
+
:root:not([data-focus-outline="off"]) .ui-control-composite-field[data-state="open"],
|
|
168
|
+
:root:not([data-focus-outline="off"]) .ui-otp-slot[data-active="true"],
|
|
169
|
+
:root:not([data-focus-outline="off"])
|
|
137
170
|
.ui-otp-group[data-appearance="grouped"]:has(.ui-otp-slot[data-active="true"]) {
|
|
138
171
|
|
|
139
172
|
--tw-ring-shadow: var(
|
|
140
173
|
--focus-field-shadow,
|
|
174
|
+
inset 0 0 0 calc(-1 * var(--focus-ring-contained-offset, 0px)) hsl(var(--background)),
|
|
141
175
|
0 0 0 var(--focus-ring-glow-width)
|
|
142
176
|
hsl(
|
|
143
177
|
var(
|
|
@@ -149,6 +183,7 @@
|
|
|
149
183
|
);
|
|
150
184
|
box-shadow: var(
|
|
151
185
|
--focus-field-shadow,
|
|
186
|
+
inset 0 0 0 calc(-1 * var(--focus-ring-contained-offset, 0px)) hsl(var(--background)),
|
|
152
187
|
0 0 0 var(--focus-ring-glow-width)
|
|
153
188
|
hsl(
|
|
154
189
|
var(
|
|
@@ -160,7 +195,7 @@
|
|
|
160
195
|
);
|
|
161
196
|
}
|
|
162
197
|
|
|
163
|
-
:root[data-focus-outline="
|
|
198
|
+
:root:not([data-focus-outline="off"])
|
|
164
199
|
:is(
|
|
165
200
|
.ui-input,
|
|
166
201
|
.ui-control,
|
|
@@ -168,10 +203,10 @@
|
|
|
168
203
|
.ui-control-trigger,
|
|
169
204
|
.ui-tag-input
|
|
170
205
|
):focus-visible,
|
|
171
|
-
:root[data-focus-outline="
|
|
172
|
-
:root[data-focus-outline="
|
|
173
|
-
:root[data-focus-outline="
|
|
174
|
-
:root[data-focus-outline="
|
|
206
|
+
:root:not([data-focus-outline="off"]) .ui-control-trigger[data-state="open"],
|
|
207
|
+
:root:not([data-focus-outline="off"]) .ui-tag-input:focus-within,
|
|
208
|
+
:root:not([data-focus-outline="off"]) .ui-control-composite-field:focus-within,
|
|
209
|
+
:root:not([data-focus-outline="off"]) .ui-control-composite-field[data-state="open"] {
|
|
175
210
|
--input: var(--focus-ring-color, var(--ring));
|
|
176
211
|
}
|
|
177
212
|
|
|
@@ -191,10 +226,35 @@
|
|
|
191
226
|
|
|
192
227
|
a.ui-list-row,
|
|
193
228
|
tr.ui-focus-ring,
|
|
194
|
-
.sb-nav-item
|
|
229
|
+
.sb-nav-item,
|
|
230
|
+
.ui-app-setting-picker-icon[data-appearance="bar"],
|
|
231
|
+
.ui-legal-document-toc-link,
|
|
232
|
+
[data-slot="anchor-link"] {
|
|
195
233
|
--focus-ring-offset: calc(-1 * var(--focus-ring-width));
|
|
196
234
|
}
|
|
197
235
|
|
|
236
|
+
:is(
|
|
237
|
+
.ui-pagination,
|
|
238
|
+
.ui-pagination-list,
|
|
239
|
+
[data-slot="card"],
|
|
240
|
+
[data-slot="tabs-list"],
|
|
241
|
+
.ui-topbar,
|
|
242
|
+
.app-topbar,
|
|
243
|
+
.ui-anchor-list,
|
|
244
|
+
.app-main,
|
|
245
|
+
.ui-data-table-scroll,
|
|
246
|
+
.ui-scroll-area,
|
|
247
|
+
.ui-table-scroll,
|
|
248
|
+
.ui-mobile-shell,
|
|
249
|
+
.ui-resizable-panel-group,
|
|
250
|
+
.ui-legal-document-rail,
|
|
251
|
+
.ui-command-input-wrapper,
|
|
252
|
+
.ui-attachments
|
|
253
|
+
) {
|
|
254
|
+
--focus-ring-contained-offset: var(--focus-ring-inset-offset);
|
|
255
|
+
|
|
256
|
+
}
|
|
257
|
+
|
|
198
258
|
.ui-accordion-trigger {
|
|
199
259
|
--focus-ring-offset: var(--accordion-focus-ring-offset);
|
|
200
260
|
}
|
package/dist/styles/layers.json
CHANGED
package/dist/styles/layout.css
CHANGED
|
@@ -647,7 +647,7 @@
|
|
|
647
647
|
}
|
|
648
648
|
|
|
649
649
|
.ui-resizable-handle {
|
|
650
|
-
|
|
650
|
+
inline-size: var(--resizable-handle-size);
|
|
651
651
|
background: hsl(var(--border));
|
|
652
652
|
position: relative;
|
|
653
653
|
flex-shrink: 0;
|
|
@@ -657,9 +657,9 @@
|
|
|
657
657
|
color: hsl(var(--muted-foreground));
|
|
658
658
|
}
|
|
659
659
|
|
|
660
|
-
.ui-resizable-handle[aria-orientation="
|
|
661
|
-
|
|
662
|
-
|
|
660
|
+
.ui-resizable-handle[aria-orientation="horizontal"] {
|
|
661
|
+
inline-size: auto;
|
|
662
|
+
block-size: var(--resizable-handle-size);
|
|
663
663
|
}
|
|
664
664
|
|
|
665
665
|
.ui-resizable-handle:hover,
|
|
@@ -753,6 +753,11 @@
|
|
|
753
753
|
gap: var(--space-3);
|
|
754
754
|
}
|
|
755
755
|
|
|
756
|
+
.app-topbar-rail:has(> .app-topbar-right) {
|
|
757
|
+
overflow-x: auto;
|
|
758
|
+
scrollbar-width: none;
|
|
759
|
+
}
|
|
760
|
+
|
|
756
761
|
.app-topbar-logo,
|
|
757
762
|
.app-topbar-logo > a {
|
|
758
763
|
display: flex;
|
|
@@ -2095,6 +2100,11 @@
|
|
|
2095
2100
|
justify-content: center;
|
|
2096
2101
|
}
|
|
2097
2102
|
|
|
2103
|
+
.ui-topbar[data-overflow="scroll"]
|
|
2104
|
+
> .ui-topbar-center:has(> :is(button, a, [role="button"]):not(.ui-topbar-search, .tb-search)) {
|
|
2105
|
+
min-inline-size: min-content;
|
|
2106
|
+
}
|
|
2107
|
+
|
|
2098
2108
|
.ui-topbar-search,
|
|
2099
2109
|
.ui-topbar-search-panel {
|
|
2100
2110
|
display: flex;
|