@planningcenter/topbar 12.4.1-qa-981.0 → 12.4.1-qa-983.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/dist/topbar.js +22 -8
- package/dist/topbar.js.map +1 -1
- package/dist/topbar.modern.js +22 -8
- package/dist/topbar.modern.js.map +1 -1
- package/dist/topbar.module.js +22 -8
- package/dist/topbar.module.js.map +1 -1
- package/dist/topbar.umd.js +22 -8
- package/dist/topbar.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/topbar.js
CHANGED
|
@@ -3362,6 +3362,25 @@ function SearchButton({
|
|
|
3362
3362
|
}));
|
|
3363
3363
|
}
|
|
3364
3364
|
|
|
3365
|
+
// With the search's own debounce, about 1.4 seconds after the last keystroke,
|
|
3366
|
+
// as in GOV.UK's accessible-autocomplete.
|
|
3367
|
+
const ANNOUNCEMENT_DELAY_MS = 1100;
|
|
3368
|
+
// Screen readers echo typing themselves, as each person has set them to, so
|
|
3369
|
+
// the message waits until typing settles instead of talking over it. Waiting
|
|
3370
|
+
// also lets VoiceOver finish what focus had to say, since it often skips a
|
|
3371
|
+
// change made as focus moves, as when a tab with cached results is selected,
|
|
3372
|
+
// and only the tab someone stops on when arrowing through them is announced.
|
|
3373
|
+
// The region empties at once, so a message that comes back is read again.
|
|
3374
|
+
function useAnnouncement(message) {
|
|
3375
|
+
const [announcement, setAnnouncement] = React.useState(null);
|
|
3376
|
+
React.useEffect(() => {
|
|
3377
|
+
setAnnouncement(null);
|
|
3378
|
+
const timeout = setTimeout(() => setAnnouncement(message), ANNOUNCEMENT_DELAY_MS);
|
|
3379
|
+
return () => clearTimeout(timeout);
|
|
3380
|
+
}, [message]);
|
|
3381
|
+
return announcement;
|
|
3382
|
+
}
|
|
3383
|
+
|
|
3365
3384
|
// useId isn't available on React 17, which our peer range still supports.
|
|
3366
3385
|
let instanceCount$1 = 0;
|
|
3367
3386
|
function useInstanceId(prefix) {
|
|
@@ -4962,7 +4981,6 @@ function ProductTabs({
|
|
|
4962
4981
|
role: "tablist"
|
|
4963
4982
|
}, products.map(product => (/*#__PURE__*/React.createElement(Tab, {
|
|
4964
4983
|
"aria-controls": `${id}-panel`,
|
|
4965
|
-
"aria-describedby": `${tabId(product.slug)}-description`,
|
|
4966
4984
|
"aria-selected": product === selected,
|
|
4967
4985
|
id: tabId(product.slug),
|
|
4968
4986
|
key: product.slug,
|
|
@@ -4980,11 +4998,6 @@ function ProductTabs({
|
|
|
4980
4998
|
}), showAllNames || product === selected ? product.appName : (/*#__PURE__*/React.createElement("span", {
|
|
4981
4999
|
className: styles$k.visuallyHidden
|
|
4982
5000
|
}, product.appName)))))), /*#__PURE__*/React.createElement("div", {
|
|
4983
|
-
className: styles$k.visuallyHidden
|
|
4984
|
-
}, products.map(product => (/*#__PURE__*/React.createElement("span", {
|
|
4985
|
-
id: `${tabId(product.slug)}-description`,
|
|
4986
|
-
key: product.slug
|
|
4987
|
-
}, "Planning Center ", product.appName)))), /*#__PURE__*/React.createElement("div", {
|
|
4988
5001
|
"aria-labelledby": tabId(selected.slug),
|
|
4989
5002
|
className: styles$k.panel,
|
|
4990
5003
|
id: `${id}-panel`,
|
|
@@ -6079,9 +6092,9 @@ function SearchResults({
|
|
|
6079
6092
|
});
|
|
6080
6093
|
case "done":
|
|
6081
6094
|
if (sections.length === 0) {
|
|
6095
|
+
// The panel's result count announces this, so it isn't read twice.
|
|
6082
6096
|
return /*#__PURE__*/React.createElement(BlankState$1, {
|
|
6083
6097
|
image: /*#__PURE__*/React.createElement(BlankStateNoResults, null),
|
|
6084
|
-
role: "status",
|
|
6085
6098
|
subtitle: "Clear search and try again.",
|
|
6086
6099
|
title: `No results for “${term.trim()}”`
|
|
6087
6100
|
});
|
|
@@ -6135,6 +6148,7 @@ function SearchPanel({
|
|
|
6135
6148
|
highlightedIndex
|
|
6136
6149
|
} = navigation;
|
|
6137
6150
|
const inputRef = React.useRef(null);
|
|
6151
|
+
const resultCount = useAnnouncement(hasTerm && search.status === "done" ? `${items.length === 0 ? "No results" : `${items.length} ${items.length === 1 ? "result" : "results"}`} for “${term.trim()}” in ${product.appName}` : null);
|
|
6138
6152
|
const [announceHighlight, setAnnounceHighlight] = React.useState(false);
|
|
6139
6153
|
// The tabs keep focus while arrowing through results, but only the focused
|
|
6140
6154
|
// input can point screen readers at the highlight, so from the tabs it's
|
|
@@ -6193,7 +6207,7 @@ function SearchPanel({
|
|
|
6193
6207
|
"aria-live": "polite",
|
|
6194
6208
|
className: styles$k.visuallyHidden,
|
|
6195
6209
|
"data-testid": "result-count"
|
|
6196
|
-
},
|
|
6210
|
+
}, resultCount), mobile ? null : /*#__PURE__*/React.createElement(KeyboardHints, {
|
|
6197
6211
|
copied: navigation.copied
|
|
6198
6212
|
}));
|
|
6199
6213
|
}
|