@civicactions/cmsds-open-data-components 3.6.0-rc.2 → 3.7.0-alpha.2

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/main.js CHANGED
@@ -1,14 +1,14 @@
1
1
  import "./main.css";
2
2
  import {jsxs as $hgUW1$jsxs, jsx as $hgUW1$jsx, Fragment as $hgUW1$Fragment} from "react/jsx-runtime";
3
- import $hgUW1$react, {createContext as $hgUW1$createContext, useState as $hgUW1$useState, useRef as $hgUW1$useRef, useEffect as $hgUW1$useEffect, useMemo as $hgUW1$useMemo, useContext as $hgUW1$useContext, useCallback as $hgUW1$useCallback} from "react";
4
- import {NavLink as $hgUW1$NavLink, useNavigate as $hgUW1$useNavigate, useLocation as $hgUW1$useLocation, useSearchParams as $hgUW1$useSearchParams, Link as $hgUW1$Link} from "react-router-dom";
5
- import {Button as $hgUW1$Button, Accordion as $hgUW1$Accordion, AccordionItem as $hgUW1$AccordionItem, CloseIconThin as $hgUW1$CloseIconThin, ArrowIcon as $hgUW1$ArrowIcon, Dialog as $hgUW1$Dialog, TextField as $hgUW1$TextField, Spinner as $hgUW1$Spinner, Dropdown as $hgUW1$Dropdown, Alert as $hgUW1$Alert, Pagination as $hgUW1$Pagination, Choice as $hgUW1$Choice, Tabs as $hgUW1$Tabs, TabPanel as $hgUW1$TabPanel, Table as $hgUW1$Table, TableBody as $hgUW1$TableBody, TableRow as $hgUW1$TableRow, TableCell as $hgUW1$TableCell, TableHead as $hgUW1$TableHead, Tooltip as $hgUW1$Tooltip, TooltipIcon as $hgUW1$TooltipIcon, Badge as $hgUW1$Badge} from "@cmsgov/design-system";
6
- import {useMediaQuery as $hgUW1$useMediaQuery} from "react-responsive";
3
+ import $hgUW1$react, {useState as $hgUW1$useState, useRef as $hgUW1$useRef, useEffect as $hgUW1$useEffect, createContext as $hgUW1$createContext, useMemo as $hgUW1$useMemo, useContext as $hgUW1$useContext, useCallback as $hgUW1$useCallback} from "react";
4
+ import {Button as $hgUW1$Button, Accordion as $hgUW1$Accordion, AccordionItem as $hgUW1$AccordionItem, TextField as $hgUW1$TextField, Spinner as $hgUW1$Spinner, Dropdown as $hgUW1$Dropdown, Alert as $hgUW1$Alert, Pagination as $hgUW1$Pagination, Dialog as $hgUW1$Dialog, Choice as $hgUW1$Choice, Tabs as $hgUW1$Tabs, TabPanel as $hgUW1$TabPanel, Table as $hgUW1$Table, TableBody as $hgUW1$TableBody, TableRow as $hgUW1$TableRow, TableCell as $hgUW1$TableCell, TableHead as $hgUW1$TableHead, Tooltip as $hgUW1$Tooltip, TooltipIcon as $hgUW1$TooltipIcon, Badge as $hgUW1$Badge} from "@cmsgov/design-system";
5
+ import {NavLink as $hgUW1$NavLink, useLocation as $hgUW1$useLocation, useSearchParams as $hgUW1$useSearchParams, Link as $hgUW1$Link, useNavigate as $hgUW1$useNavigate} from "react-router-dom";
7
6
  import $hgUW1$qs from "qs";
8
7
  import $hgUW1$swaggeruireact from "swagger-ui-react";
9
8
  import "swagger-ui-react/swagger-ui.css";
10
9
  import $hgUW1$axios from "axios";
11
10
  import {useQuery as $hgUW1$useQuery, QueryClient as $hgUW1$QueryClient, QueryClientProvider as $hgUW1$QueryClientProvider} from "@tanstack/react-query";
11
+ import {useMediaQuery as $hgUW1$useMediaQuery} from "react-responsive";
12
12
  import $hgUW1$dompurify from "dompurify";
13
13
  import $hgUW1$lodashtruncate from "lodash.truncate";
14
14
  import $hgUW1$proptypes from "prop-types";
@@ -21,294 +21,81 @@ import $hgUW1$reactdatepicker from "react-datepicker";
21
21
  import "react-datepicker/dist/react-datepicker.css";
22
22
  import {usePopper as $hgUW1$usePopper} from "react-popper";
23
23
 
24
- // Components
25
-
26
-
27
-
28
-
29
-
30
-
31
- const $3c72c298c3a7f21f$var$HeaderTagline = (props)=>{
32
- return /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
33
- className: "dkan-c-cms-topnav--tagline ds-u-valign--middle ds-u-padding-left--2",
34
- children: props.tagline
35
- });
36
- };
37
- var $3c72c298c3a7f21f$export$2e2bcd8739ae039 = $3c72c298c3a7f21f$var$HeaderTagline;
38
-
39
-
40
-
41
-
42
24
 
43
- const $1555e1cb3eb7b3e3$var$HeaderNavIconLink = (props)=>{
44
- const { url: url, urlTitle: urlTitle, logoFilePath: logoFilePath, logoAltText: logoAltText, backArrow: backArrow } = props;
45
- return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
46
- className: `dkan-c-header-nav-icon-link ${backArrow ? "show-back-arrow" : ""} ds-u-valign--middle `,
47
- children: /*#__PURE__*/ (0, $hgUW1$jsx)("a", {
48
- href: url,
49
- title: urlTitle,
50
- children: /*#__PURE__*/ (0, $hgUW1$jsx)("img", {
51
- src: logoFilePath,
52
- alt: logoAltText
53
- })
54
- })
55
- });
56
- };
57
- var $1555e1cb3eb7b3e3$export$2e2bcd8739ae039 = $1555e1cb3eb7b3e3$var$HeaderNavIconLink;
58
-
59
-
60
-
61
- const $a8accc31bf9e0bda$var$CMSTopNav = (props)=>{
62
- const { links: links, org: org } = props;
63
- const { urlTitle: urlTitle, logoAltText: logoAltText = "", logoFilePath: logoFilePath = "", tagline: tagline, url: url } = org;
64
- return /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
65
- className: "dkan-c-cms-topnav ds-u-display--flex ds-u-padding-x--5 ds-u-align-items--center ds-u-justify-content--center ds-u-lg-justify-content--start",
66
- children: [
67
- /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
68
- className: "ds-l-col--12 ds-l-md-col--5 ds-l-lg-col--7 ds-u-display--flex ds-u-align-items--center ds-u-justify-content--center ds-u-md-justify-content--start",
69
- children: [
70
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $1555e1cb3eb7b3e3$export$2e2bcd8739ae039), {
71
- url: url,
72
- urlTitle: urlTitle,
73
- logoAltText: logoAltText,
74
- logoFilePath: logoFilePath
75
- }),
76
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $3c72c298c3a7f21f$export$2e2bcd8739ae039), {
77
- tagline: tagline
78
- })
79
- ]
80
- }),
81
- /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
82
- className: "ds-l-col--7 ds-l-lg-col--5 ds-u-display--none ds-u-md-display--inline-flex ds-u-align-items--center ds-u-justify-content--end",
83
- children: /*#__PURE__*/ (0, $hgUW1$jsx)("nav", {
84
- className: "dkan-c-cms-topnav--menu",
85
- children: /*#__PURE__*/ (0, $hgUW1$jsx)("ul", {
86
- className: "ds-u-justify-content--end ds-u-md-align-items--center ds-u-flex-direction--column ds-u-md-flex-direction--row",
87
- children: links.map((link)=>{
88
- return /*#__PURE__*/ (0, $hgUW1$jsx)("li", {
89
- className: "ds-u-margin-x--05 ds-u-font-size--sm",
90
- children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$NavLink), {
91
- to: link.url,
92
- children: /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
93
- children: link.label
94
- })
95
- })
96
- });
97
- })
98
- })
99
- })
100
- })
101
- ]
102
- });
103
- };
104
- var $a8accc31bf9e0bda$export$2e2bcd8739ae039 = $a8accc31bf9e0bda$var$CMSTopNav;
25
+ function $parcel$interopDefault(a) {
26
+ return a && a.__esModule ? a.default : a;
27
+ }
28
+ // Components
105
29
 
106
30
 
107
31
 
108
32
 
109
- class $c49454ea7d1c4579$var$ErrorBoundary extends (0, $hgUW1$react).Component {
110
- constructor(props){
111
- super(props);
112
- this.state = {
113
- hasError: false,
114
- error: undefined
115
- };
116
- }
117
- static getDerivedStateFromError(error) {
118
- // Update state so the next render will show the fallback UI.
119
- return {
120
- hasError: true,
121
- error: error
122
- };
123
- }
124
- componentDidCatch(error, info) {
125
- // TODO report to logging solution
126
- console.error({
127
- error: error,
128
- info: info
129
- });
130
- }
131
- render() {
132
- if (this.props.component) {
133
- if (this.state.hasError) return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Fragment), {
134
- children: /*#__PURE__*/ (0, $hgUW1$jsx)("p", {
135
- children: "We're sorry, the site has encountered an unexpected error."
136
- })
137
- });
138
- return this.props.children;
139
- }
140
- return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Fragment), {
141
- children: /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
142
- className: "ds-l-container",
143
- children: [
144
- /*#__PURE__*/ (0, $hgUW1$jsx)("h2", {
145
- className: "ds-text-heading--2xl",
146
- children: "Error"
147
- }),
148
- /*#__PURE__*/ (0, $hgUW1$jsx)("p", {
149
- children: "We're sorry, the site has encountered an unexpected error."
150
- })
151
- ]
152
- })
153
- });
154
- }
155
- }
156
- var $c49454ea7d1c4579$export$2e2bcd8739ae039 = $c49454ea7d1c4579$var$ErrorBoundary;
157
33
 
158
34
 
159
35
 
160
36
 
161
37
 
162
- const $046ded0064bd0a3d$var$FAQAccordion = (props)=>{
163
- const { faqs: faqs } = props;
164
- const [expanded, setExpanded] = (0, $hgUW1$react).useState(false);
165
- const [faqItems, setFaqItems] = (0, $hgUW1$react).useState(faqs);
166
- function toggleAll() {
167
- if (expanded) {
168
- const newFaqs = faqItems.map((item)=>({
169
- ...item,
170
- open: false
171
- }));
172
- setFaqItems(newFaqs);
173
- setExpanded(false);
174
- } else {
175
- const newFaqs = faqItems.map((item)=>({
176
- ...item,
177
- open: true
178
- }));
179
- setFaqItems(newFaqs);
180
- setExpanded(true);
181
- }
182
- }
183
- function toggleAccordionItem(id) {
184
- const currentFaqIndex = faqItems.findIndex((item)=>item.id === id);
185
- const updatedFaq = {
186
- ...faqItems[currentFaqIndex],
187
- open: !faqItems[currentFaqIndex].open
188
- };
189
- const newFaqs = [
190
- ...faqItems.slice(0, currentFaqIndex),
191
- updatedFaq,
192
- ...faqItems.slice(currentFaqIndex + 1)
193
- ];
194
- setFaqItems(newFaqs);
195
- const openCount = newFaqs.filter((item)=>item.open === true).length;
196
- if (openCount > 0 && openCount == newFaqs.length) setExpanded(true);
197
- else setExpanded(false);
198
- }
199
- return /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
200
- children: [
201
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
202
- className: "ds-u-margin-y--2 ds-u-float--right",
203
- type: "button",
204
- variation: "ghost",
205
- onClick: ()=>toggleAll(),
206
- children: `${expanded ? "Collapse" : "Expand"} all FAQs`
207
- }),
208
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Accordion), {
209
- children: faqItems.map((faq)=>/*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$AccordionItem), {
210
- heading: faq.title,
211
- isControlledOpen: faq.open,
212
- onChange: ()=>toggleAccordionItem(faq.id),
213
- children: faq.body
214
- }, faq.id))
215
- })
216
- ]
38
+ const $24918217e48ac525$var$NavLink = ({ link: link, className: className = null, wrapLabel: wrapLabel = false, clickHandler: clickHandler })=>{
39
+ const innerHtml = wrapLabel ? /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
40
+ children: link.label
41
+ }) : link.label;
42
+ return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$NavLink), {
43
+ className: ({ isActive: isActive })=>isActive ? `dc-c-active-link ${className}` : `${className}`,
44
+ to: link.url,
45
+ onClick: clickHandler ? clickHandler : undefined,
46
+ children: innerHtml
217
47
  });
48
+ // }
218
49
  };
219
- var $046ded0064bd0a3d$export$2e2bcd8739ae039 = $046ded0064bd0a3d$var$FAQAccordion;
220
-
221
-
222
-
223
-
224
-
225
-
226
-
227
- const $11500a65bd7d9cf1$var$HeaderContext = /*#__PURE__*/ (0, $hgUW1$createContext)({
228
- mobileMenuOpen: false,
229
- setMobileMenuOpen: (el)=>{},
230
- menuRef: null,
231
- isMobile: false,
232
- onDark: true
233
- });
234
- var $11500a65bd7d9cf1$export$2e2bcd8739ae039 = $11500a65bd7d9cf1$var$HeaderContext;
235
-
236
-
237
-
238
-
239
-
240
-
50
+ var $24918217e48ac525$export$2e2bcd8739ae039 = $24918217e48ac525$var$NavLink;
241
51
 
242
52
 
243
- const $4f153ca537d853e5$var$SubMenu = ({ link: link, linkClasses: linkClasses, subLinkClasses: subLinkClasses, wrapLabel: wrapLabel = true })=>{
244
- const [isExpanded, setIsExpanded] = (0, $hgUW1$useState)(false);
245
- const headerContext = (0, $hgUW1$react).useContext((0, $11500a65bd7d9cf1$export$2e2bcd8739ae039));
53
+ const $4f153ca537d853e5$var$SubMenu = ({ link: link, linkClasses: linkClasses, wrapLabel: wrapLabel })=>{
54
+ const [isExpanded, setIsExapanded] = (0, $hgUW1$useState)(false);
246
55
  const innerHtml = wrapLabel ? /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
247
56
  children: link.label
248
57
  }) : link.label;
249
58
  const menu = (0, $hgUW1$useRef)();
250
59
  (0, $hgUW1$useEffect)(()=>{
251
- let currentMenu = null;
252
- if (menu.current) currentMenu = menu.current;
253
60
  function handleClickOutside(event) {
254
- if (currentMenu && !currentMenu.contains(event.target)) setIsExpanded(false);
61
+ if (menu.current && !menu.current.contains(event.target)) setIsExapanded(false);
255
62
  }
256
63
  function handleFocusOut(event) {
257
- if (currentMenu && !currentMenu.contains(event.relatedTarget)) setIsExpanded(false);
64
+ if (menu.current && !menu.current.contains(event.relatedTarget)) setIsExapanded(false);
258
65
  }
259
66
  document.addEventListener("mousedown", handleClickOutside);
260
- currentMenu?.addEventListener("focusout", handleFocusOut);
67
+ menu.current.addEventListener("focusout", handleFocusOut);
261
68
  return ()=>{
262
69
  document.removeEventListener("mousedown", handleClickOutside);
263
- if (currentMenu) currentMenu.removeEventListener("focusout", handleFocusOut);
70
+ if (menu.current) menu.current.removeEventListener("focusout", handleFocusOut);
264
71
  };
265
72
  }, [
73
+ menu,
266
74
  isExpanded
267
75
  ]);
268
76
  return /*#__PURE__*/ (0, $hgUW1$jsxs)("li", {
269
- className: `dkan-c-nav-submenu has-submenu${isExpanded ? " open" : ""}`,
77
+ className: `has-submenu ${isExpanded ? "open" : ""}`,
270
78
  ref: menu,
271
79
  children: [
272
- /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Button), {
80
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
81
+ size: "small",
273
82
  variation: "ghost",
274
- onDark: headerContext.onDark,
275
- className: `${linkClasses}`,
83
+ onDark: true,
84
+ className: linkClasses,
276
85
  "aria-haspopup": "true",
277
86
  "aria-expanded": isExpanded,
278
87
  onClick: (e)=>{
279
88
  e.preventDefault();
280
- setIsExpanded(!isExpanded);
89
+ setIsExapanded(!isExpanded);
281
90
  },
282
- children: [
283
- innerHtml,
284
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$ArrowIcon), {
285
- className: "ds-u-margin-left--1",
286
- direction: isExpanded ? "down" : "right"
287
- })
288
- ]
91
+ children: innerHtml
289
92
  }),
290
93
  /*#__PURE__*/ (0, $hgUW1$jsx)("ul", {
291
- className: "dkan-c-site-menu--sub-menu",
94
+ className: "dc-c-site-menu--sub-menu",
292
95
  children: link.submenu.map((s)=>/*#__PURE__*/ (0, $hgUW1$jsx)("li", {
293
- children: s.external || s.drupalPage ? /*#__PURE__*/ (0, $hgUW1$jsxs)("a", {
294
- href: s.url,
295
- className: `ds-u-display-flex ds-u-align-items--center ${subLinkClasses}`,
296
- children: [
297
- s.icon ?? null,
298
- /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
299
- children: s.label
300
- })
301
- ]
302
- }) : /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$NavLink), {
303
- to: s.url,
304
- className: `ds-u-display-flex ds-u-align-items--center ${subLinkClasses}`,
305
- onClick: ()=>setIsExpanded(!isExpanded),
306
- children: [
307
- s.icon ?? null,
308
- /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
309
- children: s.label
310
- })
311
- ]
96
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $24918217e48ac525$export$2e2bcd8739ae039), {
97
+ link: s,
98
+ wrapLabel: wrapLabel
312
99
  })
313
100
  }, s.id))
314
101
  })
@@ -319,217 +106,13 @@ var $4f153ca537d853e5$export$2e2bcd8739ae039 = $4f153ca537d853e5$var$SubMenu;
319
106
 
320
107
 
321
108
 
322
-
323
-
324
-
325
-
326
- const $fea9297ba4dd394c$var$HeaderSearch = (props)=>{
327
- const { headingText: headingText = "Dataset Search" } = props;
328
- const navigate = (0, $hgUW1$useNavigate)();
329
- const [modalSearchTerm, setModalSearchTerm] = (0, $hgUW1$useState)("");
330
- const [modalSearch, setModalSearch] = (0, $hgUW1$useState)(false);
331
- function searchForDataset(e) {
332
- e.preventDefault();
333
- if (window) {
334
- if (window.location.pathname !== "/datasets") navigate(`/datasets?fulltext=${modalSearchTerm}`);
335
- else {
336
- window.location.search = `fulltext=${modalSearchTerm}`;
337
- setModalSearch(false);
338
- }
339
- }
340
- }
341
- return /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
342
- className: "dkan-c-main-navigation--search",
343
- children: [
344
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
345
- variation: "ghost",
346
- onDark: true,
347
- className: "ds-u-border--0 dkan-c-header-search--modal-button",
348
- onClick: ()=>setModalSearch(true),
349
- children: /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
350
- children: "Search"
351
- })
352
- }),
353
- modalSearch && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Dialog), {
354
- className: "dc-c-search-dialog",
355
- onExit: ()=>setModalSearch(false),
356
- heading: `${headingText}`,
357
- actions: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Fragment), {
358
- children: /*#__PURE__*/ (0, $hgUW1$jsxs)("form", {
359
- className: "ds-u-display--flex ds-u-align-items--stretch ds-u-flex-wrap--nowrap",
360
- onSubmit: (e)=>{
361
- searchForDataset(e);
362
- },
363
- children: [
364
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TextField), {
365
- value: modalSearchTerm,
366
- fieldClassName: "ds-u-display--inline-block",
367
- className: "ds-l-col--9",
368
- label: "Search Term",
369
- name: "search-modal",
370
- labelClassName: "ds-u-visibility--screen-reader",
371
- onChange: (e)=>setModalSearchTerm(e.target.value)
372
- }),
373
- /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Button), {
374
- type: "submit",
375
- className: "ds-l-col--3",
376
- children: [
377
- /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
378
- className: "fas fa-search small-text ds-u-sm-display--none"
379
- }),
380
- /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
381
- className: "full-text ds-u-display--none ds-u-sm-display--inline-block",
382
- children: "Search"
383
- })
384
- ]
385
- })
386
- ]
387
- })
388
- })
389
- })
390
- ]
391
- });
392
- };
393
- var $fea9297ba4dd394c$export$2e2bcd8739ae039 = $fea9297ba4dd394c$var$HeaderSearch;
394
-
395
-
396
-
397
- const $b939b31651e82908$var$HeaderNav = (props)=>{
398
- const headerContext = (0, $hgUW1$react).useContext((0, $11500a65bd7d9cf1$export$2e2bcd8739ae039));
399
- const { links: links, topNavLinks: topNavLinks, wrapperClasses: wrapperClasses, searchInMobile: searchInMobile } = props;
400
- const navMenuOpenClass = `dkan-c-nav-menu--${headerContext.mobileMenuOpen ? "open" : "close"}`;
401
- const isMobileClass = `dkan-c-nav-menu--${headerContext.isMobile ? "mobile" : "desktop"}`;
402
- const linkClasses = "dkan-c-header--link ds-c-button ds-c-button--ghost";
403
- const listClasses = "dkan-c-header--link-list ";
404
- return /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
405
- className: `dkan-c-nav-menu ${wrapperClasses} ${navMenuOpenClass} ${isMobileClass}`,
406
- ref: headerContext.menuRef,
407
- children: [
408
- /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Button), {
409
- variation: "ghost",
410
- onDark: true,
411
- className: "dkan-c-nav-menu--mobile-close-button",
412
- onClick: ()=>headerContext.setMobileMenuOpen(false),
413
- children: [
414
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$CloseIconThin), {}),
415
- /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
416
- className: "ds-u-margin-left--1",
417
- children: "Close"
418
- })
419
- ]
420
- }),
421
- /*#__PURE__*/ (0, $hgUW1$jsx)("nav", {
422
- className: "dkan-c-main-nav",
423
- children: /*#__PURE__*/ (0, $hgUW1$jsx)("ul", {
424
- className: listClasses,
425
- children: links.map((link)=>{
426
- if (link.submenu) return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $4f153ca537d853e5$export$2e2bcd8739ae039), {
427
- link: link,
428
- wrapLabel: true,
429
- subLinkClasses: linkClasses,
430
- linkClasses: linkClasses
431
- }, link.id);
432
- return /*#__PURE__*/ (0, $hgUW1$jsx)("li", {
433
- children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$NavLink), {
434
- to: link.url,
435
- className: linkClasses,
436
- children: /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
437
- children: link.label
438
- })
439
- })
440
- });
441
- })
442
- })
443
- }),
444
- topNavLinks && /*#__PURE__*/ (0, $hgUW1$jsx)("nav", {
445
- className: "dkan-c-top-nav",
446
- children: /*#__PURE__*/ (0, $hgUW1$jsx)("ul", {
447
- className: listClasses,
448
- children: topNavLinks.map((link)=>{
449
- return /*#__PURE__*/ (0, $hgUW1$jsx)("li", {
450
- children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$NavLink), {
451
- to: link.url,
452
- className: linkClasses,
453
- children: /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
454
- children: link.label
455
- })
456
- })
457
- });
458
- })
459
- })
460
- }),
461
- searchInMobile && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $fea9297ba4dd394c$export$2e2bcd8739ae039), {})
462
- ]
463
- });
464
- };
465
- var $b939b31651e82908$export$2e2bcd8739ae039 = $b939b31651e82908$var$HeaderNav;
466
-
467
-
468
-
469
-
470
-
471
-
472
-
473
- const $9a8892c5ac150556$var$HeaderSiteTitle = (props)=>{
474
- const inverse = props.inverse;
475
- const { logoFilePath: logoFilePath, logoAltText: logoAltText, urlTitle: urlTitle } = props.org;
476
- const classList = "ds-u-padding-y--3 dc-c-site-title print-padding-top--0 print-padding-bottom--0 ds-u-text-align--center ds-u-md-text-align--left";
477
- if (logoFilePath) return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
478
- className: classList,
479
- children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$NavLink), {
480
- to: "/",
481
- children: /*#__PURE__*/ (0, $hgUW1$jsx)("img", {
482
- src: logoFilePath,
483
- alt: logoAltText
484
- })
485
- })
486
- });
487
- return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
488
- className: classList,
489
- children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$NavLink), {
490
- to: "/",
491
- className: `${inverse ? "ds-c-link--inverse " : ""} ds-u-font-size--2xl ds-u-lg-font-size--3xl`,
492
- children: urlTitle
493
- })
494
- });
495
- };
496
- var $9a8892c5ac150556$export$2e2bcd8739ae039 = $9a8892c5ac150556$var$HeaderSiteTitle;
497
-
498
-
499
-
500
-
501
-
502
-
503
-
504
-
505
- const $403833a4b442d5df$var$MobileMenuButton = (props)=>{
506
- const headerContext = (0, $hgUW1$react).useContext((0, $11500a65bd7d9cf1$export$2e2bcd8739ae039));
507
- const { wrapperClasses: wrapperClasses } = props;
508
- return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
509
- "aria-haspopup": "true",
510
- "aria-expanded": headerContext.mobileMenuOpen,
511
- className: `dkan-c-mobile-menu-button ${wrapperClasses} dkan-c-mobile-menu-button--${headerContext.mobileMenuOpen ? "close" : "open"}`,
512
- onClick: ()=>headerContext.setMobileMenuOpen(!headerContext.mobileMenuOpen),
513
- children: /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
514
- children: "Menu"
515
- })
516
- });
517
- };
518
- var $403833a4b442d5df$export$2e2bcd8739ae039 = $403833a4b442d5df$var$MobileMenuButton;
519
-
520
-
521
-
522
-
523
-
524
-
525
- const $f57121650539d8c5$var$NavBar = (props)=>{
526
- const { links: links, menuName: menuName, menuId: menuId, menuClasses: menuClasses, linkClasses: linkClasses, subLinkClasses: subLinkClasses, wrapLabel: wrapLabel = false } = props;
109
+ const $f57121650539d8c5$var$NavBar = ({ links: links, menuName: menuName, menuId: menuId, menuClasses: menuClasses, linkClasses: linkClasses, wrapLabel: wrapLabel = false, clickHandler: clickHandler })=>{
527
110
  return /*#__PURE__*/ (0, $hgUW1$jsxs)("nav", {
528
- className: `dkan-c-${menuId}-menu`,
529
- "aria-labelledby": `dkan-c-${menuId}-menu--heading`,
111
+ className: `dc-c-${menuId}-menu`,
112
+ "aria-labelledby": `dc-c-${menuId}-menu--heading`,
530
113
  children: [
531
114
  /*#__PURE__*/ (0, $hgUW1$jsx)("h2", {
532
- id: `dkan-c-${menuId}-menu--heading`,
115
+ id: `dc-c-${menuId}-menu--heading`,
533
116
  className: "ds-u-visibility--screen-reader",
534
117
  children: menuName
535
118
  }),
@@ -539,16 +122,14 @@ const $f57121650539d8c5$var$NavBar = (props)=>{
539
122
  if (link.submenu) return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $4f153ca537d853e5$export$2e2bcd8739ae039), {
540
123
  link: link,
541
124
  wrapLabel: wrapLabel,
542
- subLinkClasses: subLinkClasses,
543
125
  linkClasses: linkClasses
544
126
  }, link.id);
545
127
  else return /*#__PURE__*/ (0, $hgUW1$jsx)("li", {
546
- children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$NavLink), {
547
- to: link,
128
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $24918217e48ac525$export$2e2bcd8739ae039), {
129
+ link: link,
548
130
  className: linkClasses,
549
- children: /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
550
- children: link.label
551
- })
131
+ wrapLabel: wrapLabel,
132
+ clickHandler: clickHandler
552
133
  })
553
134
  }, link.id);
554
135
  })
@@ -563,115 +144,54 @@ var $f57121650539d8c5$export$2e2bcd8739ae039 = $f57121650539d8c5$var$NavBar;
563
144
 
564
145
 
565
146
 
566
-
567
-
568
-
569
- const $953b286f7778640e$var$SidebarNavigation = (props)=>{
570
- const { title: title, links: links, mobileMax: mobileMax } = props;
571
- const active = (0, $hgUW1$useLocation)().pathname;
572
- const [menuOpen, setMenuOpen] = (0, $hgUW1$useState)(false);
573
- const styleClasses = "dkan-c--sidebar-nav-wrapper ds-u-border--1 ds-u-border--color-gray-lightest ds-u-padding--2";
574
- const mobileClass = `dkan-c-sidebar-nav--${mobileMax ? "mobile" : "desktop"}`;
575
- return /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
576
- className: `dkan-c-sidebar-nav ${mobileClass}`,
577
- children: [
578
- /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
579
- className: "dkan-c-sidebar-nav--mobile-header ds-u-align-items--center ds-u-justify-content--between ds-u-padding-y--2 ds-u-fill--primary-darker ds-u-color--white",
147
+ class $c49454ea7d1c4579$var$ErrorBoundary extends (0, $hgUW1$react).Component {
148
+ constructor(props){
149
+ super(props);
150
+ this.state = {
151
+ hasError: false,
152
+ error: undefined
153
+ };
154
+ }
155
+ static getDerivedStateFromError(error) {
156
+ // Update state so the next render will show the fallback UI.
157
+ return {
158
+ hasError: true,
159
+ error: error
160
+ };
161
+ }
162
+ componentDidCatch(error, info) {
163
+ // TODO report to logging solution
164
+ console.error({
165
+ error: error,
166
+ info: info
167
+ });
168
+ }
169
+ render() {
170
+ if (this.props.component) {
171
+ if (this.state.hasError) return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Fragment), {
172
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)("p", {
173
+ children: "We're sorry, the site has encountered an unexpected error."
174
+ })
175
+ });
176
+ return this.props.children;
177
+ }
178
+ return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Fragment), {
179
+ children: /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
180
+ className: "ds-l-container",
580
181
  children: [
581
- /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
582
- className: "ds-u-margin-left--2 ds-u-margin-y--0 ds-text-heading--xl",
583
- children: "Pages in this section"
182
+ /*#__PURE__*/ (0, $hgUW1$jsx)("h2", {
183
+ className: "ds-text-heading--2xl",
184
+ children: "Error"
584
185
  }),
585
- /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Button), {
586
- "aria-haspopup": "true",
587
- variation: "ghost",
588
- "aria-expanded": `${menuOpen ? "true" : "false"}`,
589
- onDark: true,
590
- onClick: ()=>setMenuOpen(!menuOpen),
591
- children: [
592
- /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
593
- className: "ds-u-visibility--screen-reader",
594
- children: "Toggle menu"
595
- }),
596
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$ArrowIcon), {
597
- direction: menuOpen ? "up" : "down"
598
- })
599
- ]
186
+ /*#__PURE__*/ (0, $hgUW1$jsx)("p", {
187
+ children: "We're sorry, the site has encountered an unexpected error."
600
188
  })
601
189
  ]
602
- }),
603
- /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
604
- className: ``,
605
- children: /*#__PURE__*/ (0, $hgUW1$jsxs)("nav", {
606
- className: `${styleClasses} dkan-c-sidebar-nav-menu dkan-c-sidebar-nav-menu--${menuOpen ? "open" : "close"}`,
607
- children: [
608
- /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
609
- className: "ds-u-padding--2 ds-u-border-bottom--1 ds-u-border--color-gray-lightest",
610
- children: /*#__PURE__*/ (0, $hgUW1$jsx)("h3", {
611
- className: "ds-text-heading--lg",
612
- children: title
613
- })
614
- }),
615
- /*#__PURE__*/ (0, $hgUW1$jsx)("ul", {
616
- className: "ds-u-padding-bottom--2",
617
- children: links.map(({ url: url, label: label })=>/*#__PURE__*/ (0, $hgUW1$jsx)("li", {
618
- className: `ds-u-padding--1 ds-u-padding-top--2 ds-u-border-bottom--1 ds-u-border--color-gray-lightest ${active === url ? "active" : ""}`,
619
- children: /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
620
- className: "ds-u-display--flex ds-u-padding-y--1",
621
- children: [
622
- /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
623
- className: "dkan-c-sidebar-nav-link-status"
624
- }),
625
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$NavLink), {
626
- to: url,
627
- className: "dkan-c-sidebar-nav-link ds-u-margin-left--2",
628
- children: label
629
- })
630
- ]
631
- })
632
- }, `${url}${label}`))
633
- })
634
- ]
635
- })
636
190
  })
637
- ]
638
- });
639
- };
640
- var $953b286f7778640e$export$2e2bcd8739ae039 = $953b286f7778640e$var$SidebarNavigation;
641
-
642
-
643
-
644
-
645
-
646
-
647
- const $b0968edc60d7d3a4$var$SidebarPage = (props)=>{
648
- const { links: links, menuTitle: menuTitle, mobileMaxWidth: mobileMaxWidth = 768, children: children } = props;
649
- const mobileMax = (0, $hgUW1$useMediaQuery)({
650
- query: `(max-width: ${mobileMaxWidth}px)`
651
- });
652
- return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
653
- className: `${mobileMax ? "a" : "ds-l-container"}`,
654
- children: /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
655
- className: `${mobileMax ? "a" : "ds-l-row"}`,
656
- children: [
657
- /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
658
- className: `${mobileMax ? "a" : "ds-l-col--4"}`,
659
- children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $953b286f7778640e$export$2e2bcd8739ae039), {
660
- links: links,
661
- title: menuTitle,
662
- mobileMax: mobileMax
663
- })
664
- }),
665
- /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
666
- className: `${mobileMax ? "ds-l-container" : " ds-l-md-col--8"}`,
667
- children: children
668
- })
669
- ]
670
- })
671
- });
672
- };
673
- var $b0968edc60d7d3a4$export$2e2bcd8739ae039 = $b0968edc60d7d3a4$var$SidebarPage;
674
-
191
+ });
192
+ }
193
+ }
194
+ var $c49454ea7d1c4579$export$2e2bcd8739ae039 = $c49454ea7d1c4579$var$ErrorBoundary;
675
195
 
676
196
 
677
197
 
@@ -1731,7 +1251,6 @@ var $e873081a6e8f024e$export$2e2bcd8739ae039 = (0, $61ff88fb3f6ee2c8$export$2e2b
1731
1251
 
1732
1252
 
1733
1253
 
1734
-
1735
1254
  const $b4aa9c66f2e86959$var$useMetastoreDataset = (datasetId, rootAPIUrl, additionalParams = {})=>{
1736
1255
  const [dataset, setDataset] = (0, $hgUW1$useState)({
1737
1256
  title: "",
@@ -4138,7 +3657,7 @@ function $ee4ad47aa483e5b5$var$updateQueryForDatastore(condition) {
4138
3657
  if (Array.isArray(cond.value)) cond.value = cond.value.map((v)=>v.trim().replace(/(^\%+|\%+$)/gm, ""));
4139
3658
  return cond;
4140
3659
  }
4141
- const $ee4ad47aa483e5b5$var$QueryBuilder = ({ resource: resource, id: id, includeSearchParams: includeSearchParams = true, customColumns: customColumns, isModal: isModal = false })=>{
3660
+ const $ee4ad47aa483e5b5$var$QueryBuilder = ({ resource: resource, id: id, includeSearchParams: includeSearchParams = false, customColumns: customColumns, isModal: isModal = false })=>{
4142
3661
  const { conditions: conditions, schema: schema, setConditions: setConditions } = resource;
4143
3662
  const fields = Object.keys(schema[id].fields);
4144
3663
  const [queryConditions, setQueryConditions] = (0, $hgUW1$useState)([]);
@@ -4410,6 +3929,42 @@ const $39bc4d98030a5599$var$DataTableStateWrapper = ()=>{
4410
3929
  var $39bc4d98030a5599$export$2e2bcd8739ae039 = $39bc4d98030a5599$var$DataTableStateWrapper;
4411
3930
 
4412
3931
 
3932
+
3933
+
3934
+
3935
+ const $2bd73bb95b0c04ed$var$DatasetDescription = ({ distribution: distribution, dataset: dataset, resource: resource, customDescription: customDescription, dynamicDescription: dynamicDescription, updateAriaLive: updateAriaLive })=>{
3936
+ const [description, setDescription] = (0, $hgUW1$useState)("");
3937
+ if (!distribution && !dataset?.identifier) return null;
3938
+ (0, $hgUW1$useEffect)(()=>{
3939
+ if (!dynamicDescription && description !== "") return;
3940
+ let newDescription = "";
3941
+ if (customDescription) newDescription = customDescription(dataset, distribution, resource);
3942
+ else {
3943
+ if (distribution.data && distribution.data.description) newDescription = distribution.data.description;
3944
+ else if (dataset.description) newDescription = dataset.description;
3945
+ }
3946
+ if (description !== newDescription && updateAriaLive) updateAriaLive(newDescription);
3947
+ setDescription(newDescription);
3948
+ }, [
3949
+ resource,
3950
+ distribution,
3951
+ dataset,
3952
+ customDescription,
3953
+ dynamicDescription
3954
+ ]);
3955
+ return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3956
+ className: "ds-u-measure--wide ds-u-margin-bottom--7",
3957
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3958
+ className: "ds-u-margin-top--0 dc-c-metadata-description",
3959
+ dangerouslySetInnerHTML: {
3960
+ __html: (0, $hgUW1$dompurify).sanitize(description)
3961
+ }
3962
+ })
3963
+ });
3964
+ };
3965
+ var $2bd73bb95b0c04ed$export$2e2bcd8739ae039 = $2bd73bb95b0c04ed$var$DatasetDescription;
3966
+
3967
+
4413
3968
  const $a0f13962e513caa1$export$a7997ae78b143b = /*#__PURE__*/ (0, $hgUW1$createContext)({
4414
3969
  id: null
4415
3970
  });
@@ -4430,7 +3985,7 @@ const $a0f13962e513caa1$var$getDataDictionary = (dataDictionaryUrl, additionalPa
4430
3985
  dataDictionaryLoading: isPending
4431
3986
  };
4432
3987
  };
4433
- const $a0f13962e513caa1$var$Dataset = ({ id: id, rootUrl: rootUrl, additionalParams: additionalParams, customColumns: customColumns, setDatasetTitle: setDatasetTitle, customMetadataMapping: customMetadataMapping, apiPageUrl: apiPageUrl = "/api", dataDictionaryUrl: dataDictionaryUrl, borderlessTabs: borderlessTabs = false, defaultPageSize: defaultPageSize = 25, dataDictionaryCSV: dataDictionaryCSV = false, dataDictionaryBanner: dataDictionaryBanner = false, disableTableControls: disableTableControls = false })=>{
3988
+ const $a0f13962e513caa1$var$Dataset = ({ id: id, rootUrl: rootUrl, additionalParams: additionalParams, customColumns: customColumns, setDatasetTitle: setDatasetTitle, customMetadataMapping: customMetadataMapping, apiPageUrl: apiPageUrl = "/api", dataDictionaryUrl: dataDictionaryUrl, borderlessTabs: borderlessTabs = false, defaultPageSize: defaultPageSize = 25, dataDictionaryCSV: dataDictionaryCSV = false, dataDictionaryBanner: dataDictionaryBanner = false, disableTableControls: disableTableControls = false, customDescription: customDescription, dynamicDescription: dynamicDescription, updateAriaLive: updateAriaLive })=>{
4434
3989
  const options = location.search ? {
4435
3990
  ...(0, $hgUW1$qs).parse(location.search, {
4436
3991
  ignoreQueryPrefix: true
@@ -4546,14 +4101,13 @@ const $a0f13962e513caa1$var$Dataset = ({ id: id, rootUrl: rootUrl, additionalPar
4546
4101
  }),
4547
4102
  /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
4548
4103
  className: "ds-l-md-col--9",
4549
- children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
4550
- className: "ds-u-measure--wide ds-u-margin-bottom--7",
4551
- children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
4552
- className: "dc-c-metadata-description ds-u-margin--0",
4553
- dangerouslySetInnerHTML: {
4554
- __html: (0, $hgUW1$dompurify).sanitize(dataset.description)
4555
- }
4556
- })
4104
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $2bd73bb95b0c04ed$export$2e2bcd8739ae039), {
4105
+ distribution: distribution,
4106
+ dataset: dataset,
4107
+ resource: resource,
4108
+ customDescription: customDescription,
4109
+ dynamicDescription: dynamicDescription,
4110
+ updateAriaLive: updateAriaLive
4557
4111
  })
4558
4112
  })
4559
4113
  ]
@@ -4648,27 +4202,224 @@ const $a0f13962e513caa1$var$Dataset = ({ id: id, rootUrl: rootUrl, additionalPar
4648
4202
  "API"
4649
4203
  ]
4650
4204
  }),
4651
- className: borderlessTabs ? "ds-u-border--0 ds-u-padding-x--0" : "",
4652
- children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $cf6eaefd6b928de3$export$2e2bcd8739ae039), {
4653
- id: id,
4654
- rootUrl: rootUrl,
4655
- apiUrl: apiPageUrl,
4656
- additionalParams: additionalParams
4205
+ className: borderlessTabs ? "ds-u-border--0 ds-u-padding-x--0" : "",
4206
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $cf6eaefd6b928de3$export$2e2bcd8739ae039), {
4207
+ id: id,
4208
+ rootUrl: rootUrl,
4209
+ apiUrl: apiPageUrl,
4210
+ additionalParams: additionalParams
4211
+ })
4212
+ })
4213
+ ]
4214
+ })
4215
+ })
4216
+ })
4217
+ ]
4218
+ })
4219
+ });
4220
+ };
4221
+ $a0f13962e513caa1$var$Dataset.propTypes = {
4222
+ id: (0, $hgUW1$proptypes).string.isRequired,
4223
+ rootUrl: (0, $hgUW1$proptypes).string.isRequired
4224
+ };
4225
+ var $a0f13962e513caa1$export$2e2bcd8739ae039 = (0, $61ff88fb3f6ee2c8$export$2e2bcd8739ae039)($a0f13962e513caa1$var$Dataset);
4226
+
4227
+
4228
+
4229
+
4230
+
4231
+
4232
+
4233
+
4234
+
4235
+
4236
+
4237
+
4238
+
4239
+
4240
+
4241
+
4242
+ const $e5bfafc6d4e6f207$var$SearchModal = ({ headingText: headingText = "Dataset Search", buttonSize: buttonSize = null, inversedSearchButton: inversedSearchButton = true })=>{
4243
+ const navigate = (0, $hgUW1$useNavigate)();
4244
+ const [modalSearchTerm, setModalSearchTerm] = (0, $hgUW1$useState)("");
4245
+ const [modalSearch, setModalSearch] = (0, $hgUW1$useState)(false);
4246
+ const mobile = (0, $hgUW1$useMediaQuery)({
4247
+ minWidth: 0,
4248
+ maxWidth: 543
4249
+ });
4250
+ function searchForDataset(e) {
4251
+ e.preventDefault();
4252
+ if (window) {
4253
+ if (window.location.pathname !== "/datasets") navigate(`/datasets?fulltext=${modalSearchTerm}`);
4254
+ else {
4255
+ window.location.search = `fulltext=${modalSearchTerm}`;
4256
+ setModalSearch(false);
4257
+ }
4258
+ }
4259
+ }
4260
+ return /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Fragment), {
4261
+ children: [
4262
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
4263
+ variation: "ghost",
4264
+ onDark: inversedSearchButton,
4265
+ size: buttonSize,
4266
+ className: "ds-u-border--0 dc-c-search-modal--button",
4267
+ onClick: ()=>setModalSearch(true),
4268
+ children: mobile ? /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
4269
+ className: "ds-u-visibility--screen-reader",
4270
+ children: "Search"
4271
+ }) : /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Fragment), {
4272
+ children: "Search"
4273
+ })
4274
+ }),
4275
+ modalSearch && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Dialog), {
4276
+ className: "dc-c-search-dialog",
4277
+ onExit: ()=>setModalSearch(false),
4278
+ heading: `${headingText}`,
4279
+ actions: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Fragment), {
4280
+ children: /*#__PURE__*/ (0, $hgUW1$jsxs)("form", {
4281
+ className: "ds-u-display--flex ds-u-align-items--stretch ds-u-flex-wrap--nowrap",
4282
+ onSubmit: (e)=>{
4283
+ searchForDataset(e);
4284
+ },
4285
+ children: [
4286
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TextField), {
4287
+ value: modalSearchTerm,
4288
+ fieldClassName: "ds-u-display--inline-block",
4289
+ className: "ds-l-col--9",
4290
+ label: "Search Term",
4291
+ name: "search-modal",
4292
+ labelClassName: "ds-u-visibility--screen-reader",
4293
+ onChange: (e)=>setModalSearchTerm(e.target.value)
4294
+ }),
4295
+ /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Button), {
4296
+ type: "submit",
4297
+ className: "ds-l-col--3",
4298
+ children: [
4299
+ /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
4300
+ className: "fas fa-search small-text ds-u-sm-display--none"
4301
+ }),
4302
+ /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
4303
+ className: "full-text ds-u-display--none ds-u-sm-display--inline-block",
4304
+ children: "Search"
4305
+ })
4306
+ ]
4307
+ })
4308
+ ]
4309
+ })
4310
+ })
4311
+ })
4312
+ ]
4313
+ });
4314
+ };
4315
+ var $e5bfafc6d4e6f207$export$2e2bcd8739ae039 = $e5bfafc6d4e6f207$var$SearchModal;
4316
+
4317
+
4318
+ var $52466563e0d69ea8$exports = {};
4319
+ $52466563e0d69ea8$exports = new URL("CMSGovLogo-O.90ce815c.png", import.meta.url).toString();
4320
+
4321
+
4322
+ const $2db98b8f69058a30$var$DesktopHeader = ({ siteName: siteName, headerClasses: headerClasses, linkClasses: linkClasses = "ds-u-xl-margin-right--4 ds-u-margin-right--3 ds-u-padding-y--3", links: links, org: org = {
4323
+ tagline: "The Centers for Medicare & Medicaid Services",
4324
+ url: "https://cms.gov",
4325
+ urlTitle: "CMS.gov Centers for Medicare & Medicaid Services",
4326
+ logo: (0, (/*@__PURE__*/$parcel$interopDefault($52466563e0d69ea8$exports))),
4327
+ logoAltText: "CMS.gov Centers for Medicare & Medicaid Services"
4328
+ }, searchModalText: searchModalText, customSearch: customSearch = false, includeTopNav: includeTopNav = true, inversedModalButton: inversedModalButton, inversedSearchButton: inversedSearchButton })=>{
4329
+ const { url: url, tagline: tagline, logo: logo, urlTitle: urlTitle, logoAltText: logoAltText } = org;
4330
+ const headerClassString = headerClasses ?? "dc-c-header ds-base";
4331
+ return /*#__PURE__*/ (0, $hgUW1$jsxs)("header", {
4332
+ className: headerClassString,
4333
+ "aria-label": "Site header",
4334
+ children: [
4335
+ includeTopNav && /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
4336
+ className: "dc-c-cmsheader ds-u-display--flex ds-u-padding-x--5 ds-u-align-items--center",
4337
+ children: [
4338
+ /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
4339
+ className: "ds-l-sm-col--12 ds-l-lg-col--8",
4340
+ children: [
4341
+ /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
4342
+ className: "cms-link-container",
4343
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)("a", {
4344
+ href: url,
4345
+ title: urlTitle,
4346
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)("img", {
4347
+ src: logo,
4348
+ alt: logoAltText
4657
4349
  })
4658
4350
  })
4659
- ]
4351
+ }),
4352
+ /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
4353
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
4354
+ className: "cms-text-container",
4355
+ children: tagline
4356
+ })
4357
+ })
4358
+ ]
4359
+ }),
4360
+ /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
4361
+ className: "ds-u-margin-left--auto",
4362
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $f57121650539d8c5$export$2e2bcd8739ae039), {
4363
+ links: links.topnav,
4364
+ menuName: "CMS Main Header",
4365
+ menuId: "cmsheader",
4366
+ menuClasses: "ds-u-display--flex ds-u-flex-direction--row dc-c-header--links ds-u-font-size--sm"
4660
4367
  })
4661
4368
  })
4369
+ ]
4370
+ }),
4371
+ /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
4372
+ className: "dc-c-main-navigation",
4373
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
4374
+ className: "ds-l-container",
4375
+ children: /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
4376
+ className: "ds-l-row ds-u-align-items--center",
4377
+ children: [
4378
+ /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
4379
+ className: "ds-u-margin-right--5 ds-u-padding-y--3 dc-c-site-title",
4380
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$NavLink), {
4381
+ className: "ds-c-link--inverse ds-text-heading--3xl",
4382
+ to: "/",
4383
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
4384
+ className: "",
4385
+ children: siteName
4386
+ })
4387
+ })
4388
+ }),
4389
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $f57121650539d8c5$export$2e2bcd8739ae039), {
4390
+ links: links.main,
4391
+ wrapLabel: true,
4392
+ menuName: "CMS Site Main Nav",
4393
+ menuId: "site",
4394
+ menuClasses: "ds-u-display--flex ds-u-flex-direction--row dc-c-header--links ds-u-align-items--center",
4395
+ linkClasses: linkClasses
4396
+ }),
4397
+ /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
4398
+ className: "dc-c-main-navigation--search ds-u-margin-left--auto ds-u-lg-padding-left--1 ds-u-xl-padding-left--3",
4399
+ children: customSearch ? customSearch : /*#__PURE__*/ (0, $hgUW1$jsx)((0, $e5bfafc6d4e6f207$export$2e2bcd8739ae039), {
4400
+ searchModalText: searchModalText,
4401
+ inversedModalButton: inversedModalButton,
4402
+ inversedSearchButton: inversedSearchButton
4403
+ })
4404
+ })
4405
+ ]
4406
+ })
4662
4407
  })
4663
- ]
4664
- })
4408
+ })
4409
+ ]
4665
4410
  });
4666
4411
  };
4667
- $a0f13962e513caa1$var$Dataset.propTypes = {
4668
- id: (0, $hgUW1$proptypes).string.isRequired,
4669
- rootUrl: (0, $hgUW1$proptypes).string.isRequired
4412
+ $2db98b8f69058a30$var$DesktopHeader.propTypes = {
4413
+ siteName: (0, $hgUW1$proptypes).node.isRequired,
4414
+ includeTopNav: (0, $hgUW1$proptypes).bool,
4415
+ linkClasses: (0, $hgUW1$proptypes).string,
4416
+ includeSearch: (0, $hgUW1$proptypes).bool
4670
4417
  };
4671
- var $a0f13962e513caa1$export$2e2bcd8739ae039 = (0, $61ff88fb3f6ee2c8$export$2e2bcd8739ae039)($a0f13962e513caa1$var$Dataset);
4418
+ var $2db98b8f69058a30$export$2e2bcd8739ae039 = $2db98b8f69058a30$var$DesktopHeader;
4419
+
4420
+
4421
+
4422
+
4672
4423
 
4673
4424
 
4674
4425
 
@@ -4677,131 +4428,264 @@ var $a0f13962e513caa1$export$2e2bcd8739ae039 = (0, $61ff88fb3f6ee2c8$export$2e2b
4677
4428
 
4678
4429
 
4679
4430
 
4680
- const $b9af6ce5e2c06331$var$Header = (props)=>{
4681
- const { topNav: topNav, children: children, mobileMaxWidth: mobileMaxWidth = 768, onDark: onDark = false } = props;
4682
- const [mobileMenuOpen, setMobileMenuOpen] = (0, $hgUW1$react).useState(false);
4683
- const mobileMax = (0, $hgUW1$useMediaQuery)({
4684
- query: `(max-width: ${mobileMaxWidth}px)`
4431
+ var $972485213997ff8b$exports = {};
4432
+ $972485213997ff8b$exports = new URL("CMSgov@2x-white-O.78cd05d3.png", import.meta.url).toString();
4433
+
4434
+
4435
+
4436
+ let $caaccb8ea608e518$var$mobileHeaderMenuClassName = "dc-c-mobile-header--menu";
4437
+ const $caaccb8ea608e518$var$MobileHeader = ({ siteName: siteName, links: links, org: org = {
4438
+ tagline: "The Centers for Medicare and Medicaid Services",
4439
+ url: "https://cms.gov",
4440
+ urlTitle: "CMS.gov Centers for Medicare & Medicaid Services",
4441
+ logo: (0, (/*@__PURE__*/$parcel$interopDefault($52466563e0d69ea8$exports))),
4442
+ logoAltText: "CMS.gov Centers for Medicare & Medicaid Services",
4443
+ inverseLogo: (0, (/*@__PURE__*/$parcel$interopDefault($972485213997ff8b$exports)))
4444
+ }, searchModalText: searchModalText, customSearch: customSearch = false, includeTopNav: includeTopNav = true, inversedModalButton: inversedModalButton, inversedSearchButton: inversedSearchButton, includeSearch: includeSearch = true })=>{
4445
+ const { url: url, logo: logo, urlTitle: urlTitle, logoAltText: logoAltText, inverseLogo: inverseLogo } = org;
4446
+ const [menuOpen, setMenuOpen] = (0, $hgUW1$useState)(false);
4447
+ const mobile = (0, $hgUW1$useMediaQuery)({
4448
+ minWidth: 0,
4449
+ maxWidth: 543
4450
+ });
4451
+ const tablet = (0, $hgUW1$useMediaQuery)({
4452
+ minWidth: 544,
4453
+ maxWidth: 1023
4685
4454
  });
4686
4455
  const menu = (0, $hgUW1$useRef)(null);
4687
- function closeMobileMenu() {
4688
- const mobileMenuButtonElement = document.querySelector(".dkan-c-mobile-menu-button");
4689
- if (!mobileMenuButtonElement) return;
4690
- mobileMenuButtonElement.focus();
4691
- }
4692
- // Close mobile menu with escape.
4693
- function handleMenuClose(event) {
4694
- if (event.key === "Escape" && mobileMenuOpen) setMobileMenuOpen(false);
4695
- }
4696
- function handleClick(event) {
4697
- // Links are wrapped in spans, this checks if the parent is an A, also check if in the search modal.
4698
- if (menu.current && !menu.current.contains(event.target)) {
4699
- setMobileMenuOpen(false);
4700
- closeMobileMenu();
4701
- }
4702
- }
4703
- const getFocusableElements = (container)=>{
4704
- const allSelectors = container.querySelectorAll('a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])');
4705
- const visibleSelectors = Array.from(allSelectors).filter((el)=>{
4706
- return el.offsetWidth > 0 || el.offsetHeight > 0;
4707
- });
4708
- return {
4709
- selectors: {
4710
- all: allSelectors,
4711
- visible: visibleSelectors
4712
- }
4713
- };
4714
- };
4715
- function handleFocusIn() {
4716
- if (menu.current) {
4717
- if (!mobileMenuOpen) return;
4718
- const focusableEls = getFocusableElements(menu.current).selectors.visible;
4719
- if (focusableEls.length <= 0) return;
4720
- const firstEl = focusableEls[0];
4721
- firstEl?.focus();
4722
- }
4723
- }
4724
- const trapFocus = (event)=>{
4725
- if (menu.current && mobileMenuOpen) {
4456
+ (0, $hgUW1$useEffect)(()=>{
4457
+ const trapFocus = (event, container)=>{
4726
4458
  const focusableEls = getFocusableElements(menu.current).selectors.visible;
4727
4459
  const firstEl = focusableEls[0];
4728
4460
  const lastEl = focusableEls[focusableEls.length - 1];
4729
4461
  if (event.key === "Tab") {
4730
4462
  if (event.shiftKey && document.activeElement === firstEl) {
4731
- lastEl?.focus();
4463
+ lastEl.focus();
4732
4464
  event.preventDefault();
4733
4465
  } else if (!event.shiftKey && document.activeElement === lastEl) {
4734
- firstEl?.focus();
4466
+ firstEl.focus();
4735
4467
  event.preventDefault();
4736
4468
  }
4737
4469
  }
4470
+ };
4471
+ function handleFocusIn(event) {
4472
+ if (!menuOpen) return;
4473
+ const mobileHeaderMenu = document.querySelector(`.${$caaccb8ea608e518$var$mobileHeaderMenuClassName}`);
4474
+ if (!mobileHeaderMenu) return;
4475
+ // Select the first tabbable element in the `mobileHeaderMenu`
4476
+ const firstTabbableElement = mobileHeaderMenu.querySelector('a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])');
4477
+ if (!firstTabbableElement) return;
4478
+ firstTabbableElement.focus();
4479
+ }
4480
+ function handleClick(event) {
4481
+ // Links are wrapped in spans, this checks if the parent is an A, also check if in the search modal.
4482
+ if (event.target.closest(".dc-c-search-dialog")) {
4483
+ document.querySelector(".dc-c-mobile-menu--open").focus();
4484
+ setMenuOpen(false);
4485
+ }
4486
+ }
4487
+ function handleMenuClose(event) {
4488
+ // Close upon user hitting escape
4489
+ if (event.keyCode === 27 && menuOpen) {
4490
+ setMenuOpen(false);
4491
+ document.querySelector(".dc-c-mobile-menu--open").focus();
4492
+ }
4738
4493
  }
4739
- };
4740
- (0, $hgUW1$useEffect)(()=>{
4741
- document.addEventListener("keyup", handleMenuClose);
4742
4494
  document.addEventListener("mousedown", handleClick);
4743
- if (mobileMenuOpen) handleFocusIn();
4744
- else closeMobileMenu();
4745
- if (menu.current) menu.current.addEventListener("keydown", (evt)=>trapFocus(evt));
4495
+ document.addEventListener("keyup", handleMenuClose);
4496
+ handleFocusIn();
4497
+ menu.current.addEventListener("keydown", (evt)=>trapFocus(evt, menu.current));
4746
4498
  return ()=>{
4747
4499
  document.removeEventListener("keyup", handleMenuClose);
4748
- document.addEventListener("mousedown", handleClick);
4500
+ document.removeEventListener("mousedown", handleClick);
4749
4501
  if (menu.current) menu.current.removeEventListener("keydown", trapFocus);
4750
4502
  };
4751
4503
  }, [
4752
- mobileMenuOpen
4504
+ menuOpen
4753
4505
  ]);
4754
- return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $11500a65bd7d9cf1$export$2e2bcd8739ae039).Provider, {
4755
- value: {
4756
- mobileMenuOpen: mobileMenuOpen,
4757
- setMobileMenuOpen: setMobileMenuOpen,
4758
- menuRef: menu,
4759
- isMobile: mobileMax,
4760
- onDark: onDark
4761
- },
4762
- children: /*#__PURE__*/ (0, $hgUW1$jsxs)("header", {
4763
- "aria-label": "Site header",
4764
- className: `dkan-c-header dkan-c-header--${mobileMax ? "mobile" : "desktop"}`,
4765
- children: [
4766
- topNav && topNav,
4767
- /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
4768
- className: "dkan-c-main-navigation print-margin-left--2",
4769
- children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
4770
- className: "ds-l-container",
4771
- children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
4772
- className: "dkan-c-header--wrapper ds-l-row ds-u-align-items--center",
4773
- children: children
4506
+ const closeMobileMenu = (e)=>{
4507
+ document.querySelector(".dc-c-mobile-menu--open").focus();
4508
+ setMenuOpen(false);
4509
+ };
4510
+ const getFocusableElements = (container)=>{
4511
+ const allSelectors = container.querySelectorAll('a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])');
4512
+ const visibleSelectors = Array.from(allSelectors).filter((el)=>{
4513
+ return el.offsetWidth > 0 || el.offsetHeight > 0;
4514
+ });
4515
+ return {
4516
+ selectors: {
4517
+ all: allSelectors,
4518
+ visible: visibleSelectors
4519
+ }
4520
+ };
4521
+ };
4522
+ const handleMobileLinkClick = (e)=>{
4523
+ if (e.target.closest("a").getAttribute("href") === window.location.pathname) setMenuOpen(false);
4524
+ };
4525
+ return /*#__PURE__*/ (0, $hgUW1$jsxs)("header", {
4526
+ className: `dc-c-header dc-c-mobile-header ${menuOpen ? "menu-open" : ""}`,
4527
+ "aria-label": "Site header",
4528
+ children: [
4529
+ includeTopNav && /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
4530
+ className: `dc-c-cmsheader ds-u-display--flex ds-u-padding-x--1 ds-u-align-items--center ${mobile ? "ds-u-justify-content--center" : "ds-u-justify-content--between"}`,
4531
+ children: [
4532
+ /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
4533
+ className: "cms-link-container",
4534
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)("a", {
4535
+ href: url,
4536
+ title: urlTitle,
4537
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)("img", {
4538
+ src: menuOpen ? inverseLogo : logo,
4539
+ alt: logoAltText
4540
+ })
4541
+ })
4542
+ }),
4543
+ tablet && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
4544
+ className: "ds-u-margin-left--auto",
4545
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $f57121650539d8c5$export$2e2bcd8739ae039), {
4546
+ links: links.topnav,
4547
+ menuName: "CMS Main Header",
4548
+ menuId: "cmsheader",
4549
+ menuClasses: "ds-u-display--flex ds-u-flex-direction--row dc-c-header--links ds-u-font-size--sm ds-u-margin-bottom--2"
4774
4550
  })
4775
4551
  })
4776
- })
4777
- ]
4778
- })
4552
+ ]
4553
+ }),
4554
+ /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
4555
+ className: "dc-c-main-navigation ds-u-display--flex ds-u-justify-content--between ds-u-align-items--center",
4556
+ children: [
4557
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
4558
+ variation: "ghost",
4559
+ onDark: true,
4560
+ size: "small",
4561
+ className: "dc-c-mobile-menu--open",
4562
+ onClick: ()=>setMenuOpen(true),
4563
+ children: mobile ? /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
4564
+ className: "ds-u-visibility--screen-reader",
4565
+ children: "Menu"
4566
+ }) : /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Fragment), {
4567
+ children: "Menu"
4568
+ })
4569
+ }),
4570
+ /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
4571
+ className: "ds-u-padding-y--3 dc-c-site-title",
4572
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$NavLink), {
4573
+ className: "ds-c-link--inverse ds-text-heading--3xl",
4574
+ to: "/",
4575
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
4576
+ className: "",
4577
+ children: siteName
4578
+ })
4579
+ })
4580
+ }),
4581
+ includeSearch && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
4582
+ className: "dc-c-mobile-menu--search",
4583
+ children: customSearch ? customSearch : /*#__PURE__*/ (0, $hgUW1$jsx)((0, $e5bfafc6d4e6f207$export$2e2bcd8739ae039), {
4584
+ searchFunc: (e)=>{
4585
+ e.preventDefault();
4586
+ },
4587
+ searchModalText: searchModalText,
4588
+ buttonSize: "small",
4589
+ inversedModalButton: inversedModalButton,
4590
+ inversedSearchButton: inversedSearchButton
4591
+ })
4592
+ })
4593
+ ]
4594
+ }),
4595
+ /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
4596
+ className: $caaccb8ea608e518$var$mobileHeaderMenuClassName,
4597
+ "data-testid": "mobile-menu",
4598
+ ref: menu,
4599
+ children: [
4600
+ /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
4601
+ className: `ds-u-display--flex ${$caaccb8ea608e518$var$mobileHeaderMenuClassName}-close ds-u-justify-content--between`,
4602
+ children: [
4603
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
4604
+ variation: "ghost",
4605
+ onDark: true,
4606
+ size: "small",
4607
+ className: "dc-c-mobile-menu--close ds-u-margin-left--1 ds-u-padding-left--0",
4608
+ onClick: ()=>closeMobileMenu(),
4609
+ children: "Close"
4610
+ }),
4611
+ tablet && includeSearch && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
4612
+ className: "dc-c-mobile-menu--search",
4613
+ children: customSearch ? customSearch : /*#__PURE__*/ (0, $hgUW1$jsx)((0, $e5bfafc6d4e6f207$export$2e2bcd8739ae039), {
4614
+ searchFunc: (e)=>{
4615
+ e.preventDefault();
4616
+ },
4617
+ searchModalText: searchModalText,
4618
+ buttonSize: "small"
4619
+ })
4620
+ })
4621
+ ]
4622
+ }),
4623
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $f57121650539d8c5$export$2e2bcd8739ae039), {
4624
+ links: links.main,
4625
+ wrapLabel: true,
4626
+ menuName: "Main Nav",
4627
+ menuId: "site",
4628
+ menuClasses: "dc-c-header--links dc-c-header--mobile-links",
4629
+ linkClasses: "ds-u-margin-left--1 ds-u-padding-bottom--2 ds-text-heading--md",
4630
+ clickHandler: handleMobileLinkClick
4631
+ }),
4632
+ mobile && /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
4633
+ className: "cms-mobile-header--container",
4634
+ children: [
4635
+ /*#__PURE__*/ (0, $hgUW1$jsx)("span", {}),
4636
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $f57121650539d8c5$export$2e2bcd8739ae039), {
4637
+ links: links.topnav,
4638
+ menuName: "CMS Main Header",
4639
+ menuId: "cms-mobile-header",
4640
+ linkClasses: "ds-u-margin-left--1 ds-u-margin-bottom--2",
4641
+ menuClasses: "dc-c-header--links ds-u-font-size--sm ds-u-margin-bottom--2"
4642
+ })
4643
+ ]
4644
+ })
4645
+ ]
4646
+ })
4647
+ ]
4779
4648
  });
4780
4649
  };
4781
- var $b9af6ce5e2c06331$export$2e2bcd8739ae039 = $b9af6ce5e2c06331$var$Header;
4650
+ var $caaccb8ea608e518$export$2e2bcd8739ae039 = $caaccb8ea608e518$var$MobileHeader;
4651
+
4782
4652
 
4783
4653
 
4784
4654
 
4785
4655
 
4656
+ const $a5a6a06d249c33b8$var$Header = ({ mobileMaxWidth: mobileMaxWidth = 1023, desktopMinWidth: desktopMinWidth = 1024, siteName: siteName, links: links, org: org, includeTopNav: includeTopNav = true })=>{
4657
+ const mobile = (0, $hgUW1$useMediaQuery)({
4658
+ minWidth: 0,
4659
+ maxWidth: mobileMaxWidth
4660
+ });
4661
+ const desktop = (0, $hgUW1$useMediaQuery)({
4662
+ minWidth: desktopMinWidth
4663
+ });
4664
+ return /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Fragment), {
4665
+ children: [
4666
+ desktop && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $2db98b8f69058a30$export$2e2bcd8739ae039), {
4667
+ siteName: siteName,
4668
+ links: links,
4669
+ org: org,
4670
+ includeTopNav: includeTopNav
4671
+ }),
4672
+ mobile && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $caaccb8ea608e518$export$2e2bcd8739ae039), {
4673
+ siteName: siteName,
4674
+ links: links,
4675
+ org: org,
4676
+ includeTopNav: includeTopNav
4677
+ })
4678
+ ]
4679
+ });
4680
+ };
4681
+ var $a5a6a06d249c33b8$export$2e2bcd8739ae039 = $a5a6a06d249c33b8$var$Header;
4682
+
4786
4683
 
4787
4684
 
4788
4685
 
4789
4686
 
4790
4687
 
4791
4688
 
4792
- const $24918217e48ac525$var$NavLink = ({ link: link, className: className = null, wrapLabel: wrapLabel = false, clickHandler: clickHandler })=>{
4793
- const innerHtml = wrapLabel ? /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
4794
- children: link.label
4795
- }) : link.label;
4796
- return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$NavLink), {
4797
- className: ({ isActive: isActive })=>isActive ? `dc-c-active-link ${className}` : `${className}`,
4798
- to: link.url,
4799
- onClick: clickHandler ? clickHandler : undefined,
4800
- children: innerHtml
4801
- });
4802
- // }
4803
- };
4804
- var $24918217e48ac525$export$2e2bcd8739ae039 = $24918217e48ac525$var$NavLink;
4805
4689
 
4806
4690
 
4807
4691
  const $a6df0aa147323304$var$Footer = ({ links: links, showEmail: showEmail = true, emailTitle: emailTitle = "Get Email Updates", emailBody: emailBody = "Sign up to get the latest information from CMS by choosing the topics and frequency of emails that are best for you.", emailLink: emailLink = "", emailButton: emailButton = "Sign up for email updates", socialMediaLinks: socialMediaLinks = null, hhsLogo: hhsLogo, cmsLogo: cmsLogo, trademarkContent: trademarkContent = /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
@@ -5426,7 +5310,6 @@ var $669d2782ec2e2250$export$2e2bcd8739ae039 = $669d2782ec2e2250$var$SpecsAndLim
5426
5310
 
5427
5311
 
5428
5312
 
5429
-
5430
5313
  const $efc410f5f7ac5ef3$var$useSearchAPI = (rootUrl, initialSearchParams = {}, additionalParams = {})=>{
5431
5314
  const defaultSort = "";
5432
5315
  const defaultFulltext = "";
@@ -6296,28 +6179,8 @@ var $3b6ca952e79f0695$export$2e2bcd8739ae039 = $3b6ca952e79f0695$var$QueryBuilde
6296
6179
 
6297
6180
 
6298
6181
 
6299
- const $de780c924c98fa31$var$FilteredResourceDescription = ({ distribution: distribution, dataset: dataset })=>{
6300
- if (!distribution && !dataset) return null;
6301
- let description = "";
6302
- if (distribution.data && distribution.data.description) description = distribution.data.description;
6303
- else if (dataset.description) description = dataset.description;
6304
- return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
6305
- className: "ds-u-measure--wide ds-u-margin-bottom--7",
6306
- children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
6307
- className: "ds-u-margin-top--0 dc-c-metadata-description",
6308
- dangerouslySetInnerHTML: {
6309
- __html: (0, $hgUW1$dompurify).sanitize(description)
6310
- }
6311
- })
6312
- });
6313
- };
6314
- var $de780c924c98fa31$export$2e2bcd8739ae039 = $de780c924c98fa31$var$FilteredResourceDescription;
6315
-
6316
-
6317
-
6318
-
6319
6182
 
6320
- const $dd6eb2b30d7ad75d$var$FilteredResourceBody = ({ id: id, dataset: dataset, distIndex: distIndex, location: location, additionalParams: additionalParams, customColumns: customColumns, columnSettings: columnSettings, columnWidths: columnWidths, customTitle: customTitle, rootUrl: rootUrl })=>{
6183
+ const $dd6eb2b30d7ad75d$var$FilteredResourceBody = ({ id: id, dataset: dataset, distIndex: distIndex, location: location, additionalParams: additionalParams, customColumns: customColumns, columnSettings: columnSettings, columnWidths: columnWidths, customTitle: customTitle, customDescription: customDescription, dynamicDescription: dynamicDescription, rootUrl: rootUrl, updateAriaLive: updateAriaLive })=>{
6321
6184
  const [tablePadding, setTablePadding] = (0, $hgUW1$react).useState("ds-u-padding-y--1");
6322
6185
  let apiDocs = (0, $hgUW1$useRef)();
6323
6186
  let distribution = {};
@@ -6383,9 +6246,13 @@ const $dd6eb2b30d7ad75d$var$FilteredResourceBody = ({ id: id, dataset: dataset,
6383
6246
  }),
6384
6247
  /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
6385
6248
  className: "ds-l-md-col--9",
6386
- children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $de780c924c98fa31$export$2e2bcd8739ae039), {
6249
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $2bd73bb95b0c04ed$export$2e2bcd8739ae039), {
6387
6250
  distribution: distribution,
6388
- dataset: dataset
6251
+ dataset: dataset,
6252
+ resource: resource,
6253
+ customDescription: customDescription,
6254
+ dynamicDescription: dynamicDescription,
6255
+ updateAriaLive: updateAriaLive
6389
6256
  })
6390
6257
  }),
6391
6258
  Object.keys(resource).length && resource.columns && Object.keys(resource.schema).length && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
@@ -6468,7 +6335,7 @@ var $dd6eb2b30d7ad75d$export$2e2bcd8739ae039 = $dd6eb2b30d7ad75d$var$FilteredRes
6468
6335
 
6469
6336
 
6470
6337
 
6471
- const $f61ecf9f84951a61$var$FilteredResource = ({ id: id, dist_id: dist_id, location: location, apiDocPage: apiDocPage, additionalParams: additionalParams, customColumns: customColumns, setDatasetTitle: setDatasetTitle, columnSettings: columnSettings, columnWidths: columnWidths, customTitle: customTitle, rootUrl: rootUrl })=>{
6338
+ const $f61ecf9f84951a61$var$FilteredResource = ({ id: id, dist_id: dist_id, location: location, apiDocPage: apiDocPage, additionalParams: additionalParams, customColumns: customColumns, setDatasetTitle: setDatasetTitle, columnSettings: columnSettings, columnWidths: columnWidths, customTitle: customTitle, customDescription: customDescription, dynamicDescription: dynamicDescription, rootUrl: rootUrl, updateAriaLive: updateAriaLive })=>{
6472
6339
  const [ready, setReady] = (0, $hgUW1$useState)(false);
6473
6340
  const [error, setError] = (0, $hgUW1$useState)(false);
6474
6341
  const { dataset: dataset } = (0, $b4aa9c66f2e86959$export$2e2bcd8739ae039)(id, rootUrl, additionalParams);
@@ -6531,7 +6398,10 @@ const $f61ecf9f84951a61$var$FilteredResource = ({ id: id, dist_id: dist_id, loca
6531
6398
  columnSettings: columnSettings,
6532
6399
  columnWidths: columnWidths,
6533
6400
  customTitle: customTitle,
6534
- rootUrl: rootUrl
6401
+ customDescription: customDescription,
6402
+ dynamicDescription: dynamicDescription,
6403
+ rootUrl: rootUrl,
6404
+ updateAriaLive: updateAriaLive
6535
6405
  })
6536
6406
  })
6537
6407
  });
@@ -6584,5 +6454,5 @@ var $90fb213ab8eeb2e7$export$2e2bcd8739ae039 = $90fb213ab8eeb2e7$var$useScrollTo
6584
6454
 
6585
6455
 
6586
6456
 
6587
- export {$a8accc31bf9e0bda$export$2e2bcd8739ae039 as CMSTopNav, $c49454ea7d1c4579$export$2e2bcd8739ae039 as ErrorBoundary, $046ded0064bd0a3d$export$2e2bcd8739ae039 as FAQAccordion, $b939b31651e82908$export$2e2bcd8739ae039 as HeaderNav, $1555e1cb3eb7b3e3$export$2e2bcd8739ae039 as HeaderNavIconLink, $fea9297ba4dd394c$export$2e2bcd8739ae039 as HeaderSearch, $9a8892c5ac150556$export$2e2bcd8739ae039 as HeaderSiteTitle, $3c72c298c3a7f21f$export$2e2bcd8739ae039 as HeaderTagline, $403833a4b442d5df$export$2e2bcd8739ae039 as MobileMenuButton, $f57121650539d8c5$export$2e2bcd8739ae039 as NavBar, $953b286f7778640e$export$2e2bcd8739ae039 as SidebarNavigation, $b0968edc60d7d3a4$export$2e2bcd8739ae039 as SidebarPage, $4f153ca537d853e5$export$2e2bcd8739ae039 as SubMenu, $c96c4b9ef7203c1f$export$2e2bcd8739ae039 as APIPage, $026cb986f9fea2b1$export$2e2bcd8739ae039 as PageNotFound, $e873081a6e8f024e$export$2e2bcd8739ae039 as DatasetSearch, $a0f13962e513caa1$export$2e2bcd8739ae039 as Dataset, $a35cf16d1488f54e$export$2e2bcd8739ae039 as DatasetTable, $b9af6ce5e2c06331$export$2e2bcd8739ae039 as Header, $a6df0aa147323304$export$2e2bcd8739ae039 as Footer, $669d2782ec2e2250$export$2e2bcd8739ae039 as SpecsAndLimits, $11500a65bd7d9cf1$export$2e2bcd8739ae039 as HeaderContext, $efc410f5f7ac5ef3$export$2e2bcd8739ae039 as useSearchAPI, $1d3d480a9cfaabe0$export$2e2bcd8739ae039 as useDatastore, $aa4450dcbeef3ac0$export$385a5aba38cc3325 as transformTableSortToQuerySort, $59a079354baa335c$export$2e2bcd8739ae039 as Hero, $52c6454cae137465$export$2e2bcd8739ae039 as DatasetSearchListItem, $789279954d8eff7f$export$2e2bcd8739ae039 as ApiDocumentation, $af099c546cb226c7$export$2e2bcd8739ae039 as ResourceHeader, $626282d9a03c51d5$export$2e2bcd8739ae039 as ResourcePreview, $072291d44ce1834a$export$2e2bcd8739ae039 as ResourceFooter, $ec3e23baa005dc03$export$2e2bcd8739ae039 as Breadcrumb, $bd76a91923d7e8a7$export$2e2bcd8739ae039 as TransformedDate, $d98f94c79ddf4e0e$export$2e2bcd8739ae039 as DataTable, $5644ebd2c3dbfd7b$export$eea3a12df15499ca as buildRows, $f61ecf9f84951a61$export$2e2bcd8739ae039 as FilteredResource, $bef7bff2823feea2$export$2e2bcd8739ae039 as QueryTitle, $7264a673914aa746$export$2b9377795161999 as buildOperatorOptions, $7264a673914aa746$export$e284ae5d89467c8f as convertUTCToLocalDate, $7264a673914aa746$export$6b5e57d20078142b as cleanText, $7264a673914aa746$export$8049e8f40a9bdfb8 as buildCustomColHeaders, $eb7821d186b1a389$export$2e2bcd8739ae039 as useAddLoginLink, $90fb213ab8eeb2e7$export$2e2bcd8739ae039 as useScrollToTop, $b4aa9c66f2e86959$export$2e2bcd8739ae039 as useMetastoreDataset, $61ff88fb3f6ee2c8$export$2e2bcd8739ae039 as withQueryProvider, $6da0396069e23175$export$bc27cf7ecf44639d as defaultMetadataMapping, $2ed0091f7e32d1e6$export$2e2bcd8739ae039 as DataTablePageResults, $1a2bf34e2a8f6b80$export$59a943b34a82e690 as truncateText};
6457
+ export {$f57121650539d8c5$export$2e2bcd8739ae039 as NavBar, $c49454ea7d1c4579$export$2e2bcd8739ae039 as ErrorBoundary, $c96c4b9ef7203c1f$export$2e2bcd8739ae039 as APIPage, $026cb986f9fea2b1$export$2e2bcd8739ae039 as PageNotFound, $e873081a6e8f024e$export$2e2bcd8739ae039 as DatasetSearch, $a0f13962e513caa1$export$2e2bcd8739ae039 as Dataset, $a35cf16d1488f54e$export$2e2bcd8739ae039 as DatasetTable, $a5a6a06d249c33b8$export$2e2bcd8739ae039 as Header, $a6df0aa147323304$export$2e2bcd8739ae039 as Footer, $669d2782ec2e2250$export$2e2bcd8739ae039 as SpecsAndLimits, $efc410f5f7ac5ef3$export$2e2bcd8739ae039 as useSearchAPI, $1d3d480a9cfaabe0$export$2e2bcd8739ae039 as useDatastore, $aa4450dcbeef3ac0$export$385a5aba38cc3325 as transformTableSortToQuerySort, $59a079354baa335c$export$2e2bcd8739ae039 as Hero, $52c6454cae137465$export$2e2bcd8739ae039 as DatasetSearchListItem, $789279954d8eff7f$export$2e2bcd8739ae039 as ApiDocumentation, $af099c546cb226c7$export$2e2bcd8739ae039 as ResourceHeader, $626282d9a03c51d5$export$2e2bcd8739ae039 as ResourcePreview, $072291d44ce1834a$export$2e2bcd8739ae039 as ResourceFooter, $ec3e23baa005dc03$export$2e2bcd8739ae039 as Breadcrumb, $bd76a91923d7e8a7$export$2e2bcd8739ae039 as TransformedDate, $d98f94c79ddf4e0e$export$2e2bcd8739ae039 as DataTable, $5644ebd2c3dbfd7b$export$eea3a12df15499ca as buildRows, $f61ecf9f84951a61$export$2e2bcd8739ae039 as FilteredResource, $bef7bff2823feea2$export$2e2bcd8739ae039 as QueryTitle, $7264a673914aa746$export$2b9377795161999 as buildOperatorOptions, $7264a673914aa746$export$e284ae5d89467c8f as convertUTCToLocalDate, $7264a673914aa746$export$6b5e57d20078142b as cleanText, $7264a673914aa746$export$8049e8f40a9bdfb8 as buildCustomColHeaders, $eb7821d186b1a389$export$2e2bcd8739ae039 as useAddLoginLink, $90fb213ab8eeb2e7$export$2e2bcd8739ae039 as useScrollToTop, $b4aa9c66f2e86959$export$2e2bcd8739ae039 as useMetastoreDataset, $61ff88fb3f6ee2c8$export$2e2bcd8739ae039 as withQueryProvider, $6da0396069e23175$export$bc27cf7ecf44639d as defaultMetadataMapping, $2ed0091f7e32d1e6$export$2e2bcd8739ae039 as DataTablePageResults, $1a2bf34e2a8f6b80$export$59a943b34a82e690 as truncateText};
6588
6458
  //# sourceMappingURL=main.js.map