UNPKG

@trussworks/react-uswds

Version:
1 lines 662 kB
{"version":3,"file":"index.cjs","sources":["../node_modules/classnames/index.js","../src/components/Alert/Alert.tsx","../src/components/Accordion/Accordion.tsx","../src/components/Button/Button.tsx","../src/components/ButtonGroup/ButtonGroup.tsx","../src/components/Link/Link.tsx","../src/components/InPageNavigation/InPageNavigation.tsx","../src/components/mediablock/MediaBlockBody/MediaBlockBody.tsx","../src/components/Table/Table.tsx","../src/components/Tag/Tag.tsx","../src/components/Tooltip/utils.ts","../src/components/Tooltip/Tooltip.tsx","../src/components/SideNav/SideNav.tsx","../node_modules/@uswds/uswds/dist/img/usa-icons/accessibility_new.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/accessible_forward.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/account_balance.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/account_box.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/account_circle.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/add.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/add_circle.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/add_circle_outline.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/alarm.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/alternate_email.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/announcement.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/arrow_back.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/arrow_downward.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/arrow_drop_down.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/arrow_drop_up.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/arrow_forward.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/arrow_upward.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/api.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/assessment.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/attach_file.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/attach_money.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/autorenew.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/backpack.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/bathtub.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/bedding.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/bookmark.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/bug_report.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/build.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/calendar_today.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/campaign.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/camping.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/cancel.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/chat.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/check.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/check_box_outline_blank.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/check_circle.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/check_circle_outline.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/checkroom.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/clean_hands.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/clothes.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/close.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/closed_caption.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/cloud.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/code.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/comment.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/connect_without_contact.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/construction.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/construction_worker.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/contact_page.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/content_copy.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/coronavirus.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/credit_card.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/deck.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/delete.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/device_thermostat.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/directions.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/directions_bike.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/directions_bus.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/directions_car.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/directions_walk.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/do_not_disturb.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/do_not_touch.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/drag_handle.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/eco.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/edit.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/electrical_services.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/emoji_events.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/error.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/error_outline.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/event.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/expand_less.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/expand_more.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/facebook.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/fast_forward.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/fast_rewind.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/favorite.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/favorite_border.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/fax.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/file_download.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/file_present.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/file_upload.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/filter_alt.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/filter_list.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/fingerprint.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/first_page.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/flag.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/flickr.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/flight.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/flooding.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/folder.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/folder_open.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/format_quote.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/format_size.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/forum.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/github.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/grid_view.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/group_add.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/groups.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/hearing.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/help.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/help_outline.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/highlight_off.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/history.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/home.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/hospital.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/hotel.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/hourglass_empty.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/hurricane.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/identification.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/image.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/info.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/info_outline.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/insights.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/instagram.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/keyboard.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/label.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/language.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/last_page.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/launch.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/lightbulb.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/lightbulb_outline.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/linkedin.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/link.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/link_off.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/list.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/local_cafe.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/local_fire_department.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/local_gas_station.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/local_grocery_store.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/local_hospital.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/local_laundry_service.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/local_library.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/local_offer.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/local_parking.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/local_pharmacy.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/local_police.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/local_taxi.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/location_city.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/location_on.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/lock.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/lock_open.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/lock_outline.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/login.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/logout.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/loop.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/mail.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/mail_outline.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/map.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/masks.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/medical_services.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/menu.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/military_tech.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/more_horiz.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/more_vert.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/my_location.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/navigate_before.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/navigate_next.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/navigate_far_before.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/navigate_far_next.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/near_me.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/notifications.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/notifications_active.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/notifications_none.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/notifications_off.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/park.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/people.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/person.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/pets.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/phone.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/photo_camera.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/print.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/priority_high.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/public.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/push_pin.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/radio_button_unchecked.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/rain.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/reduce_capacity.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/remove_circle.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/remove.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/report.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/restaurant.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/rss_feed.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/safety_divider.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/sanitizer.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/save_alt.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/severe_weather.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/schedule.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/school.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/science.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/search.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/security.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/send.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/sentiment_dissatisfied.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/sentiment_neutral.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/sentiment_satisfied.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/sentiment_satisfied_alt.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/sentiment_very_dissatisfied.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/settings.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/share.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/shield.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/shopping_basket.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/snow.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/soap.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/social_distance.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/sort_arrow.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/spellcheck.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/star.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/star_half.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/star_outline.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/store.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/support.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/support_agent.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/text_fields.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/thumb_down_alt.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/thumb_up_alt.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/timer.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/toggle_off.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/toggle_on.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/topic.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/tornado.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/translate.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/trending_down.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/trending_up.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/twitter.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/undo.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/unfold_less.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/unfold_more.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/update.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/upload_file.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/verified.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/verified_user.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/visibility.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/visibility_off.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/volume_off.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/warning.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/wash.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/wifi.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/work.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/x.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/youtube.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/zoom_in.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/zoom_out_map.svg?svgr","../node_modules/@uswds/uswds/dist/img/usa-icons/zoom_out.svg?svgr","../src/components/Icon/Icon.tsx","../src/components/Icon/Icons.ts","../src/components/Pagination/Pagination.tsx","../src/components/banner/Banner/Banner.tsx","../src/components/banner/BannerButton/BannerButton.tsx","../src/components/banner/BannerContent/BannerContent.tsx","../src/components/banner/BannerFlag/BannerFlag.tsx","../src/components/banner/BannerGuidance/BannerGuidance.tsx","../src/components/banner/BannerHeader/BannerHeader.tsx","../src/components/banner/BannerIcon/BannerIcon.tsx","../node_modules/@uswds/uswds/dist/img/us_flag_small.png","../node_modules/@uswds/uswds/dist/img/icon-dot-gov.svg","../node_modules/@uswds/uswds/dist/img/icon-https.svg","../src/components/banner/GovBanner/GovBanner.tsx","../src/components/Collection/Collection.tsx","../src/components/Collection/CollectionItem.tsx","../src/components/Collection/CollectionHeading.tsx","../src/components/Collection/CollectionDescription.tsx","../src/components/Collection/CollectionMeta.tsx","../src/components/Collection/CollectionMetaItem.tsx","../src/components/Collection/CollectionMetaItemTag.tsx","../src/components/Collection/CollectionThumbnail.tsx","../src/components/Collection/CollectionCalendarDate.tsx","../src/components/grid/GridContainer/GridContainer.tsx","../src/components/grid/types.ts","../src/components/grid/Grid/Grid.tsx","../src/components/forms/TextInput/TextInput.tsx","../src/components/forms/Textarea/Textarea.tsx","../src/components/forms/CharacterCount/CharacterCount.tsx","../src/components/forms/Checkbox/Checkbox.tsx","../src/components/forms/ComboBox/utils.ts","../src/components/forms/ComboBox/useComboBox.ts","../src/components/forms/ComboBox/ComboBox.tsx","../src/components/forms/Label/RequiredMarker.tsx","../src/components/forms/Label/Label.tsx","../src/components/forms/FormGroup/FormGroup.tsx","../src/components/forms/DateInput/DateInput.tsx","../src/components/forms/DateInputGroup/DateInputGroup.tsx","../src/components/forms/DatePicker/constants.ts","../src/components/forms/DatePicker/i18n.ts","../src/components/forms/DatePicker/utils.tsx","../src/components/forms/DatePicker/Day.tsx","../src/components/forms/DatePicker/MonthPicker.tsx","../src/components/forms/DatePicker/YearPicker.tsx","../src/components/forms/DatePicker/Calendar.tsx","../src/components/forms/DatePicker/DatePicker.tsx","../src/components/forms/DateRangePicker/DateRangePicker.tsx","../src/components/forms/ErrorMessage/ErrorMessage.tsx","../src/components/forms/Fieldset/Fieldset.tsx","../src/components/forms/FileInput/FilePreview.tsx","../src/components/forms/FileInput/utils.ts","../src/components/forms/FileInput/FileInput.tsx","../src/components/forms/Form/Form.tsx","../src/components/forms/InputGroup/InputGroup.tsx","../src/components/forms/InputPrefix/InputPrefix.tsx","../src/components/forms/InputSuffix/InputSuffix.tsx","../src/components/LanguageSelector/LanguageSelectorButton.tsx","../src/components/header/NavList/NavList.tsx","../src/components/header/Menu/Menu.tsx","../src/components/LanguageSelector/LanguageSelectorDropdown.tsx","../src/components/LanguageSelector/LanguageSelector.tsx","../src/components/forms/Radio/Radio.tsx","../src/components/forms/RangeInput/RangeInput.tsx","../src/components/forms/Select/Select.tsx","../src/components/forms/TextInputMask/TextInputMask.tsx","../src/components/forms/TimePicker/utils.ts","../src/components/forms/TimePicker/constants.ts","../src/components/forms/TimePicker/TimePicker.tsx","../src/components/forms/Validation/ValidationChecklist.tsx","../src/components/forms/Validation/ValidationItem.tsx","../src/components/header/NavCloseButton/NavCloseButton.tsx","../src/components/header/ExtendedNav/ExtendedNav.tsx","../src/components/header/Header/Header.tsx","../src/components/header/MegaMenu/MegaMenu.tsx","../src/components/header/NavMenuButton/NavMenuButton.tsx","../src/components/header/NavDropDownButton/NavDropDownButton.tsx","../src/components/header/PrimaryNav/PrimaryNav.tsx","../src/components/header/Title/Title.tsx","../src/components/iconlist/IconList.tsx","../src/components/iconlist/IconListContent/IconListContent.tsx","../src/components/iconlist/IconListIcon/IconListIcon.tsx","../src/components/iconlist/IconListItem/IconListItem.tsx","../src/components/iconlist/IconListTitle/IconListTitle.tsx","../src/components/identifier/Identifier/Identifier.tsx","../src/components/identifier/IdentifierGov/IdentifierGov.tsx","../src/components/identifier/IdentifierIdentity/IdentifierIdentity.tsx","../src/components/identifier/IdentifierLink/IdentifierLink.tsx","../src/components/identifier/IdentifierLinkItem/IdentifierLinkItem.tsx","../src/components/identifier/IdentifierLinks/IdentifierLinks.tsx","../src/components/identifier/IdentifierLogo/IdentifierLogo.tsx","../src/components/identifier/IdentifierLogos/IdentifierLogos.tsx","../src/components/identifier/IdentifierMasthead/IdentifierMasthead.tsx","../src/components/footer/Address/Address.tsx","../src/components/footer/Footer/Footer.tsx","../src/components/footer/FooterExtendedNavList/FooterExtendedNavList.tsx","../src/components/footer/FooterNav/FooterNav.tsx","../src/components/footer/Logo/Logo.tsx","../src/components/footer/SocialLinks/SocialLinks.tsx","../src/components/modal/utils.ts","../src/components/modal/ModalCloseButton/ModalCloseButton.tsx","../src/components/modal/ModalWindow/ModalWindow.tsx","../src/components/modal/ModalWrapper/ModalWrapper.tsx","../src/components/modal/Modal.tsx","../src/components/modal/ModalOpenLink.tsx","../src/components/modal/ModalHeading/ModalHeading.tsx","../src/components/modal/ModalFooter/ModalFooter.tsx","../src/components/modal/ModalToggleButton.tsx","../src/components/card/CardGroup/CardGroup.tsx","../src/components/card/Card/Card.tsx","../src/components/card/CardHeader/CardHeader.tsx","../src/components/card/CardMedia/CardMedia.tsx","../src/components/card/CardBody/CardBody.tsx","../src/components/card/CardFooter/CardFooter.tsx","../src/components/breadcrumb/BreadcrumbBar/BreadcrumbBar.tsx","../src/components/breadcrumb/Breadcrumb/Breadcrumb.tsx","../src/components/breadcrumb/BreadcrumbLink/BreadcrumbLink.tsx","../src/components/stepindicator/StepIndicator/StepIndicator.tsx","../src/components/stepindicator/StepIndicatorStep/StepIndicatorStep.tsx","../src/components/search/SearchField/SearchField.tsx","../src/components/search/SearchButton/SearchButton.tsx","../src/components/search/Search/Search.tsx","../src/components/summarybox/SummaryBox/SummaryBox.tsx","../src/components/summarybox/SummaryBoxHeading/SummaryBoxHeading.tsx","../src/components/summarybox/SummaryBoxContent/SummaryBoxContent.tsx","../src/components/processlist/ProcessList/ProcessList.tsx","../src/components/processlist/ProcessListItem/ProcessListItem.tsx","../src/components/processlist/ProcessListHeading/ProcessListHeading.tsx","../src/components/SiteAlert/SiteAlert.tsx"],"sourcesContent":["/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = '';\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (arg) {\n\t\t\t\tclasses = appendClass(classes, parseValue(arg));\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction parseValue (arg) {\n\t\tif (typeof arg === 'string' || typeof arg === 'number') {\n\t\t\treturn arg;\n\t\t}\n\n\t\tif (typeof arg !== 'object') {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (Array.isArray(arg)) {\n\t\t\treturn classNames.apply(null, arg);\n\t\t}\n\n\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\treturn arg.toString();\n\t\t}\n\n\t\tvar classes = '';\n\n\t\tfor (var key in arg) {\n\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\tclasses = appendClass(classes, key);\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction appendClass (value, newClass) {\n\t\tif (!newClass) {\n\t\t\treturn value;\n\t\t}\n\t\n\t\tif (value) {\n\t\t\treturn value + ' ' + newClass;\n\t\t}\n\t\n\t\treturn value + newClass;\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","import React, { type JSX } from 'react'\nimport classnames from 'classnames'\n\nimport { HeadingLevel } from '../../types/headingLevel'\n\nimport styles from './Alert.module.scss'\n\nexport type AlertProps = {\n type: 'success' | 'warning' | 'error' | 'info'\n heading?: React.ReactNode\n headingLevel: HeadingLevel\n children?: React.ReactNode\n cta?: React.ReactNode\n slim?: boolean\n noIcon?: boolean\n validation?: boolean\n} & React.HTMLAttributes<HTMLDivElement>\n\nexport const Alert = ({\n type,\n heading,\n headingLevel,\n cta,\n children,\n slim,\n noIcon,\n className,\n validation,\n ...props\n}: AlertProps): JSX.Element => {\n const classes = classnames(\n 'usa-alert',\n {\n 'usa-alert--success': type === 'success',\n 'usa-alert--warning': type === 'warning',\n 'usa-alert--error': type === 'error',\n 'usa-alert--info': type === 'info',\n 'usa-alert--slim': slim,\n 'usa-alert--no-icon': noIcon,\n 'usa-alert--validation': validation,\n [styles.alertWithCTA]: !!cta,\n },\n className\n )\n\n const Heading = headingLevel\n\n return (\n <div className={classes} data-testid=\"alert\" {...props}>\n <div className=\"usa-alert__body\">\n {heading && <Heading className=\"usa-alert__heading\">{heading}</Heading>}\n {children &&\n (validation ? (\n children\n ) : (\n <p className=\"usa-alert__text\">{children}</p>\n ))}\n </div>\n {cta && <div>{cta}</div>}\n </div>\n )\n}\n\nexport default Alert\n","import React, { useState, type JSX } from 'react'\nimport classnames from 'classnames'\n\nimport { HeadingLevel } from '../../types/headingLevel'\n\nexport type AccordionItemProps = {\n title: React.ReactNode | string\n content: React.ReactNode\n expanded: boolean\n id: string\n className?: string\n headingLevel: HeadingLevel\n handleToggle?: (event: React.MouseEvent<HTMLButtonElement>) => void\n}\n\nexport type AccordionProps = {\n bordered?: boolean\n multiselectable?: boolean\n items: AccordionItemProps[]\n className?: string\n} & JSX.IntrinsicElements['div']\n\nexport const AccordionItem = ({\n title,\n id,\n content,\n expanded,\n className,\n headingLevel,\n handleToggle,\n}: AccordionItemProps): JSX.Element => {\n const headingClasses = classnames('usa-accordion__heading', className)\n const contentClasses = classnames(\n 'usa-accordion__content',\n 'usa-prose',\n className\n )\n\n const Heading = headingLevel\n\n return (\n <>\n <Heading className={headingClasses}>\n <button\n type=\"button\"\n className=\"usa-accordion__button\"\n aria-expanded={expanded}\n aria-controls={id}\n data-testid={`accordionButton_${id}`}\n onClick={handleToggle}>\n {title}\n </button>\n </Heading>\n <div\n id={id}\n data-testid={`accordionItem_${id}`}\n className={contentClasses}\n hidden={!expanded}>\n {content}\n </div>\n </>\n )\n}\n\nexport const Accordion = ({\n bordered,\n items,\n className,\n multiselectable = false,\n}: AccordionProps): JSX.Element => {\n const [openItems, setOpenState] = useState(\n items.filter((i) => !!i.expanded).map((i) => i.id)\n )\n\n const classes = classnames(\n 'usa-accordion',\n {\n 'usa-accordion--bordered': bordered,\n },\n className\n )\n\n const toggleItem = (itemId: AccordionItemProps['id']): void => {\n const newOpenItems = [...openItems]\n const itemIndex = openItems.indexOf(itemId)\n const isMultiselectable = multiselectable\n\n if (itemIndex > -1) {\n newOpenItems.splice(itemIndex, 1)\n } else {\n if (isMultiselectable) {\n newOpenItems.push(itemId)\n } else {\n newOpenItems.splice(0, newOpenItems.length)\n newOpenItems.push(itemId)\n }\n }\n setOpenState(newOpenItems)\n }\n\n return (\n <div\n className={classes}\n data-testid=\"accordion\"\n data-allow-multiple={multiselectable || undefined}>\n {items.map((item, i) => (\n <AccordionItem\n key={`accordionItem_${i}`}\n {...item}\n expanded={openItems.indexOf(item.id) > -1}\n handleToggle={(e): void => {\n if (item.handleToggle) item.handleToggle(e)\n toggleItem(item.id)\n }}\n />\n ))}\n </div>\n )\n}\n\nexport default Accordion\n","import React, { type JSX } from 'react'\nimport classnames from 'classnames'\n\nexport type ButtonProps = {\n type: 'button' | 'submit' | 'reset'\n children: React.ReactNode\n secondary?: boolean\n base?: boolean\n accentStyle?: 'cool' | 'warm'\n outline?: boolean\n inverse?: boolean\n size?: 'big'\n unstyled?: boolean\n} & JSX.IntrinsicElements['button']\n\nexport const Button = ({\n type,\n children,\n secondary,\n base,\n accentStyle,\n outline,\n inverse,\n size,\n unstyled,\n onClick,\n className,\n ...defaultProps\n}: ButtonProps): JSX.Element => {\n const classes = classnames(\n 'usa-button',\n {\n 'usa-button--secondary': secondary,\n 'usa-button--base': base,\n 'usa-button--accent-cool': accentStyle === 'cool',\n 'usa-button--accent-warm': accentStyle === 'warm',\n 'usa-button--outline': outline,\n 'usa-button--inverse': inverse,\n 'usa-button--big': size === 'big',\n 'usa-button--unstyled': unstyled,\n },\n className\n )\n\n return (\n <button\n type={type}\n className={classes}\n onClick={onClick}\n data-testid=\"button\"\n {...defaultProps}>\n {children}\n </button>\n )\n}\n\nexport default Button\n","import React, { type JSX } from 'react'\nimport classnames from 'classnames'\n\nexport type ButtonGroupProps = {\n children: React.ReactNode\n className?: string\n type?: 'default' | 'segmented'\n} & JSX.IntrinsicElements['ul']\n\nexport const ButtonGroup = ({\n className,\n children,\n type = 'default',\n ...restProps\n}: ButtonGroupProps): JSX.Element => {\n const classes = classnames(\n 'usa-button-group',\n {\n 'usa-button-group--segmented': type == 'segmented',\n },\n className\n )\n\n return (\n <ul className={classes} {...restProps}>\n {React.Children.map(children, (child: React.ReactNode) => {\n return <li className=\"usa-button-group__item\">{child}</li>\n })}\n </ul>\n )\n}\n\nexport default ButtonGroup\n","import React, { type JSX } from 'react'\nimport classnames from 'classnames'\n\n// These props we want to require always, even on custom components\ntype StyledLinkProps<T> = {\n variant?: 'external' | 'unstyled' | 'nav'\n className?: string\n children: React.ReactNode\n allowSpacebarActivation?: boolean\n} & T\n\n// These props are only required on the default Link\ntype WithDefaultLinkProps = {\n href: string\n}\n\n// Add `asCustom` to the provided custom props\ntype WithCustomLinkProps<T> = {\n asCustom: React.FunctionComponent<T>\n}\n\n// Default props means allow the StyledLinkProps as well as any\n// props allowed on the `a` element, plus the required props on\n// WithDefaultLinkProps\nexport type DefaultLinkProps = StyledLinkProps<JSX.IntrinsicElements['a']> &\n WithDefaultLinkProps\n\n// Custom props means allow the StyledLinkProps as well as the custom\n// props, plus the required props on WithCustomLinkProps\nexport type CustomLinkProps<T> = StyledLinkProps<T> & WithCustomLinkProps<T>\n\nexport function isCustomProps<T>(\n props: DefaultLinkProps | CustomLinkProps<T>\n): props is CustomLinkProps<T> {\n return 'asCustom' in props\n}\n// keyboard handler for 'link as a button'\nconst handleKeyDown = (e: React.KeyboardEvent) => {\n if (e.key === ' ' && e.target) {\n e.preventDefault()\n ;(e.target as HTMLElement).click()\n }\n}\n\nfunction linkClasses<T>(\n variant: StyledLinkProps<T>['variant'],\n className: StyledLinkProps<T>['className']\n): string | undefined {\n const unstyled = variant === 'unstyled'\n const isExternalLink = variant === 'external'\n const isNavLink = variant === 'nav'\n\n return unstyled\n ? className\n : classnames(\n 'usa-link',\n { 'usa-link--external': isExternalLink, 'usa-nav__link': isNavLink },\n className\n )\n}\n\nexport function Link(props: DefaultLinkProps): JSX.Element\n\nexport function Link<T>(props: CustomLinkProps<T>): JSX.Element\nexport function Link<\n FCProps extends React.PropsWithChildren<object> = DefaultLinkProps,\n>(props: DefaultLinkProps | CustomLinkProps<FCProps>): JSX.Element {\n if (isCustomProps(props)) {\n const { variant, className, asCustom, children, ...remainingProps } = props\n // 1. We know props is AsCustomProps<FCProps>\n // 2. We know AsCustomProps<FCProps> is\n // FCProps & { variant: ..., className: ..., children: ..., asCustom: ... }\n // 3. Therefore we know that removing those props leaves us\n // with FCProps\n //\n const linkProps: FCProps = remainingProps as unknown as FCProps\n const classes = linkClasses(variant, className)\n return React.createElement(\n asCustom,\n {\n className: classes,\n ...linkProps,\n },\n children\n )\n } else {\n const {\n children,\n className,\n variant,\n allowSpacebarActivation = false,\n ...linkProps\n } = props\n\n const classes = linkClasses(variant, className)\n return (\n <a\n className={classes}\n {...(allowSpacebarActivation && { onKeyDown: handleKeyDown })}\n {...linkProps}>\n {children}\n </a>\n )\n }\n}\n","import React, { useEffect, useState, type JSX } from 'react'\nimport classnames from 'classnames'\nimport { HeadingLevel } from '../../types/headingLevel'\nimport { Link } from '../Link/Link'\nimport styles from './InPageNavigation.module.scss'\n\nexport type InPageNavigationProps = {\n className?: string\n content: JSX.Element\n headingLevel?: HeadingLevel\n mainProps?: JSX.IntrinsicElements['main']\n navProps?: JSX.IntrinsicElements['nav']\n rootMargin?: string\n scrollOffset?: string\n threshold?: number\n title?: string\n} & Omit<JSX.IntrinsicElements['div'], 'content'>\n\nexport const InPageNavigation = ({\n className,\n content,\n headingLevel = 'h4',\n mainProps,\n navProps,\n rootMargin = '0px 0px 0px 0px',\n scrollOffset,\n threshold = 1,\n title = 'On this page',\n ...divProps\n}: InPageNavigationProps): JSX.Element => {\n const asideClasses = classnames('usa-in-page-nav', styles.target, className)\n const { className: navClassName, ...remainingNavProps } = navProps || {}\n const navClasses = classnames('usa-in-page-nav__nav', navClassName)\n const { className: mainClassName, ...remainingMainProps } = mainProps || {}\n const mainClasses = classnames('main-content', mainClassName)\n const Heading = headingLevel\n const offsetStyle = {\n '--margin-offset': scrollOffset,\n } as React.CSSProperties\n const [currentSection, setCurrentSection] = useState('')\n const sectionHeadings: JSX.Element[] = content.props.children.filter(\n (el: JSX.Element) => el.type === 'h2' || el.type === 'h3'\n )\n const handleIntersection = (entries: IntersectionObserverEntry[]) => {\n entries.forEach((entry) => {\n if (entry.isIntersecting) {\n setCurrentSection(entry.target.id)\n }\n })\n }\n const observerOptions = {\n root: null,\n rootMargin: rootMargin,\n threshold: [threshold],\n }\n const observer = new IntersectionObserver(handleIntersection, observerOptions)\n useEffect(() => {\n document.querySelectorAll('h2,h3').forEach((h) => observer.observe(h))\n document.querySelector('html')?.classList.add(styles['smooth-scroll'])\n return () => {\n document.querySelector('html')?.classList.remove(styles['smooth-scroll'])\n }\n })\n\n return (\n <div className=\"usa-in-page-nav-container\" {...divProps}>\n <aside\n className={asideClasses}\n aria-label={title}\n data-testid=\"InPageNavigation\">\n <nav className={navClasses} {...remainingNavProps}>\n <Heading className=\"usa-in-page-nav__heading\" tabIndex={0}>\n {title}\n </Heading>\n <ul className=\"usa-in-page-nav__list\">\n {sectionHeadings.map((el: JSX.Element) => {\n const heading: JSX.Element = el.props.children\n const href: string = el.props.id\n const hClass = classnames('usa-in-page-nav__item', {\n 'usa-in-page-nav__item--sub-item': el.type === 'h3',\n })\n const lClass = classnames('usa-in-page-nav__link', {\n 'usa-current': href === currentSection,\n })\n return (\n <li key={`usa-in-page-nav__item_${heading}`} className={hClass}>\n <Link href={`#${href}`} className={lClass}>\n {heading}\n </Link>\n </li>\n )\n })}\n </ul>\n </nav>\n </aside>\n <main\n id=\"main-content\"\n className={mainClasses}\n {...remainingMainProps}\n style={scrollOffset ? offsetStyle : undefined}>\n {content}\n </main>\n </div>\n )\n}\n\nexport default InPageNavigation\n","import React, { type JSX } from 'react'\nimport classNames from 'classnames'\n\nexport type MediaBlockBodyProps = JSX.IntrinsicElements['div']\n\nexport const MediaBlockBody = ({\n children,\n className,\n ...divProps\n}: MediaBlockBodyProps): JSX.Element => {\n const classes = classNames('usa-media-block__body', className)\n\n return (\n <div className={classes} {...divProps}>\n {children}\n </div>\n )\n}\n","import React, { type JSX } from 'react'\nimport classnames from 'classnames'\n\nimport styles from './Table.module.scss'\n\nexport type TableProps = {\n bordered?: boolean\n caption?: React.ReactNode\n children: React.ReactNode\n className?: string\n fullWidth?: boolean\n fixed?: boolean\n scrollable?: boolean\n striped?: boolean\n compact?: boolean\n stackedStyle?: 'none' | 'default' | 'headers'\n}\n\nexport const Table = ({\n bordered,\n caption,\n children,\n className,\n fullWidth,\n fixed,\n scrollable,\n striped,\n compact,\n stackedStyle = 'none',\n}: TableProps): JSX.Element => {\n const classes = classnames(\n 'usa-table',\n {\n 'usa-table--borderless': !bordered,\n 'width-full': fullWidth,\n [`${styles.fixed}`]: fixed,\n 'usa-table--striped': striped,\n 'usa-table--compact': compact,\n 'usa-table--stacked': stackedStyle === 'default',\n 'usa-table--stacked-header': stackedStyle === 'headers',\n },\n className\n )\n\n if (compact && stackedStyle !== 'none') {\n console.warn(\n 'USWDS states that compact styling is not suitable for use with stacked variants. See USWDS Table component, Table variants for more information: https://designsystem.digital.gov/components/table'\n )\n }\n\n const table = (\n <table className={classes} data-testid=\"table\">\n {caption && <caption>{caption}</caption>}\n {children}\n </table>\n )\n\n /**\n * From https://designsystem.digital.gov/components/table:\n * Scrollable tables need to be focusable. When you use the\n * .usa-table-container--scrollable variant with a table, you must add the\n * tabindex=\"0\" attribute to the scrollable element. This attribute assures\n * that users navigating with a keyboard are able to select and scroll the\n * table. tabindex=\"0\" enables focus on elements that do not get focus by\n * default. This attribute does not change the tab order. It places the\n * element in the logical navigation flow.\n */\n\n return (\n <>\n {scrollable ? (\n <div\n data-testid=\"scrollable-table-container\"\n className=\"usa-table-container--scrollable\"\n // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex\n tabIndex={0}>\n {table}\n </div>\n ) : (\n table\n )}\n </>\n )\n}\n\nexport default Table\n","import React, { type JSX } from 'react'\nimport classnames from 'classnames'\n\nexport type TagProps = {\n children: React.ReactNode\n background?: string\n} & JSX.IntrinsicElements['span']\n\nexport const Tag = ({\n children,\n background,\n className,\n ...spanProps\n}: TagProps): JSX.Element => {\n const style: React.CSSProperties = {}\n if (background) {\n style.background = background\n }\n\n const tagClasses = classnames('usa-tag', className)\n\n return (\n <span\n data-testid=\"tag\"\n className={tagClasses}\n style={{ ...style }}\n {...spanProps}>\n {children}\n </span>\n )\n}\n\nexport default Tag\n","export const isElementInViewport = (\n el: HTMLElement,\n win = window,\n docEl = document.documentElement\n): boolean => {\n const rect = el.getBoundingClientRect()\n return (\n rect.top >= 0 &&\n rect.left >= 0 &&\n rect.bottom <= (win.innerHeight || docEl.clientHeight) &&\n rect.right <= (win.innerWidth || docEl.clientWidth)\n )\n}\n\n// https://github.com/uswds/uswds/blob/v2.11.2/src/js/components/tooltip.js\n\n/**\n * get margin offset calculations\n *\n * @param {HTMLElement} target - this is the tooltip body\n * @param {String} propertyValue - this is the tooltip body\n */\n\nconst offsetMargin = (target: HTMLElement, propertyValue: string) =>\n parseInt(window.getComputedStyle(target).getPropertyValue(propertyValue), 10)\n\n// offsetLeft = the left position, and margin of the element, the left\n// padding, scrollbar and border of the offsetParent element\n// offsetWidth = The offsetWidth property returns the viewable width of an\n// element in pixels, including padding, border and scrollbar, but not\n// the margin.\n\n/**\n * Calculate margin offset\n * tooltip trigger margin(position) offset + tooltipBody offsetWidth\n * @param {String} marginPosition\n * @param {Number} tooltipBodyOffset\n * @param {HTMLElement} trigger\n */\n\nexport const calculateMarginOffset = (\n marginPosition: string,\n tooltipBodyOffset: number,\n trigger: HTMLElement\n): number => {\n const offset =\n offsetMargin(trigger, `margin-${marginPosition}`) > 0\n ? tooltipBodyOffset - offsetMargin(trigger, `margin-${marginPosition}`)\n : tooltipBodyOffset\n\n return offset\n}\n","import React, {\n createElement,\n ForwardRefExoticComponent,\n ReactNode,\n useEffect,\n useRef,\n useState,\n JSX,\n} from 'react'\nimport classnames from 'classnames'\n\nimport { isElementInViewport, calculateMarginOffset } from './utils'\n\ntype TooltipProps<T> = {\n label: ReactNode\n title?: string\n position?: 'top' | 'bottom' | 'left' | 'right' | undefined\n wrapperclasses?: string\n className?: string\n children: ReactNode\n} & T\n\ninterface WithCustomTooltipProps<T> {\n asCustom: ForwardRefExoticComponent<T>\n}\n\nexport type DefaultTooltipProps = TooltipProps<JSX.IntrinsicElements['button']>\n\nexport type CustomTooltipProps<T> = TooltipProps<T> & WithCustomTooltipProps<T>\n\nexport function isCustomProps<T>(\n props: DefaultTooltipProps | CustomTooltipProps<T>\n): props is CustomTooltipProps<T> {\n return 'asCustom' in props\n}\n\nconst TRIANGLE_SIZE = 5\nconst DEFAULT_POSITION = 'top'\n\n// useId was introduced in React 18 - polyfill for older versions\nconst useId = (): string => {\n const id1 = React.useId?.()\n const [id2] = React.useState(`${Math.floor(Math.random() * 900000) + 100000}`)\n return id1 ?? id2\n}\n\nexport function Tooltip(props: DefaultTooltipProps): JSX.Element\nexport function Tooltip<T>(props: CustomTooltipProps<T>): JSX.Element\nexport function Tooltip<\n FCProps extends React.PropsWithChildren<object> = DefaultTooltipProps,\n>({\n position = DEFAULT_POSITION,\n wrapperclasses,\n className,\n ...props\n}: DefaultTooltipProps | CustomTooltipProps<FCProps>): JSX.Element {\n const triggerElementRef = useRef<HTMLElement & HTMLButtonElement>(null)\n const tooltipBodyRef = useRef<HTMLElement>(null)\n const id = useId()\n const tooltipID = `tooltip-${id}`\n\n const [isVisible, setVisible] = useState(false)\n const [isShown, setIsShown] = useState(false)\n const [effectivePosition, setEffectivePosition] = useState<\n 'top' | 'bottom' | 'left' | 'right' | undefined\n >(undefined)\n const [positioningAttempts, setPositionAttempts] = useState(0)\n const [wrapTooltip, setWrapTooltip] = useState(false)\n const [positionStyles, setPositionStyles] = useState({})\n\n const positionTop = (e: HTMLElement, triggerEl: HTMLElement): void => {\n const topMargin = calculateMarginOffset('top', e.offsetHeight, triggerEl)\n const leftMargin = calculateMarginOffset('left', e.offsetWidth, triggerEl)\n\n setEffectivePosition('top')\n setPositionStyles({\n left: `50%`,\n top: `-${TRIANGLE_SIZE}px`,\n margin: `-${topMargin}px 0 0 -${leftMargin / 2}px`,\n })\n }\n\n const positionBottom = (e: HTMLElement, triggerEl: HTMLElement): void => {\n const leftMargin = calculateMarginOffset('left', e.offsetWidth, triggerEl)\n\n setEffectivePosition('bottom')\n setPositionStyles({\n left: `50%`,\n margin: `${TRIANGLE_SIZE}px 0 0 -${leftMargin / 2}px`,\n })\n }\n\n const positionRight = (e: HTMLElement, triggerEl: HTMLElement): void => {\n const topMargin = calculateMarginOffset('top', e.offsetHeight, triggerEl)\n\n setEffectivePosition('right')\n setPositionStyles({\n top: `50%`,\n left: `${triggerEl.offsetLeft + triggerEl.offsetWidth + TRIANGLE_SIZE}px`,\n margin: `-${topMargin / 2}px 0 0 0`,\n })\n }\n\n const positionLeft = (e: HTMLElement, triggerEl: HTMLElement): void => {\n const topMargin = calculateMarginOffset('top', e.offsetHeight, triggerEl)\n const leftMargin = calculateMarginOffset(\n 'left',\n triggerEl.offsetLeft > e.offsetWidth\n ? triggerEl.offsetLeft - e.offsetWidth\n : e.offsetWidth,\n triggerEl\n )\n\n setEffectivePosition('left')\n setPositionStyles({\n top: `50%`,\n left: `-${TRIANGLE_SIZE}px`,\n margin: `-${topMargin / 2}px 0 0 ${\n triggerEl.offsetLeft > e.offsetWidth ? leftMargin : -leftMargin\n }px`,\n })\n }\n\n const positions = [positionTop, positionBottom, positionRight, positionLeft]\n const MAX_ATTEMPTS = positions.length\n\n useEffect(() => {\n // When position/styles change, check if in viewport\n if (isVisible && triggerElementRef.current && tooltipBodyRef.current) {\n const tooltipTrigger = triggerElementRef.current\n const tooltipBody = tooltipBodyRef.current\n\n const isInViewport = isElementInViewport(tooltipBody)\n\n if (isInViewport) {\n // We're good, show the tooltip\n setIsShown(true)\n } else {\n // Try the next position\n const attempt = positioningAttempts\n if (attempt < MAX_ATTEMPTS || wrapTooltip === false) {\n setPositionAttempts((a) => a + 1)\n\n if (attempt < MAX_ATTEMPTS) {\n const pos = positions[parseInt(`${attempt}`)]\n pos(tooltipBody, tooltipTrigger)\n } else {\n // Try wrapping\n setWrapTooltip(true)\n setPositionAttempts(0)\n }\n } else {\n // No visible position found - this may mean your tooltip contents is too long!\n console.warn(\n 'No visible position found - this may mean your tooltip contents is too long!'\n )\n }\n }\n