se-design 1.0.2 → 1.0.8-5.dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/colors.css +26 -13
- package/dist/assets/icons/ai-off.svg +6 -0
- package/dist/assets/icons/ai-re-run.svg +5 -0
- package/dist/assets/icons/arrow-head.svg +8 -0
- package/dist/assets/icons/center-align.svg +3 -0
- package/dist/assets/icons/chat.svg +4 -0
- package/dist/assets/icons/checkbox-disabled-minus.svg +1 -1
- package/dist/assets/icons/checkbox-disabled-tick.svg +1 -1
- package/dist/assets/icons/checkbox-fill.svg +1 -1
- package/dist/assets/icons/checkbox-hover-fill.svg +2 -2
- package/dist/assets/icons/checkbox-hover-minus.svg +1 -1
- package/dist/assets/icons/checkbox-hover-tick.svg +1 -1
- package/dist/assets/icons/checkbox-minus.svg +1 -1
- package/dist/assets/icons/checkbox-tick.svg +1 -1
- package/dist/assets/icons/combobox-field.svg +6 -0
- package/dist/assets/icons/command.svg +1 -1
- package/dist/assets/icons/csv-file.svg +4 -4
- package/dist/assets/icons/doc-file.svg +6 -0
- package/dist/assets/icons/envelope.svg +4 -0
- package/dist/assets/icons/file-filled-checked.svg +8 -0
- package/dist/assets/icons/filter.svg +3 -0
- package/dist/assets/icons/google-drive.svg +8 -0
- package/dist/assets/icons/home.svg +3 -2
- package/dist/assets/icons/left-align.svg +3 -0
- package/dist/assets/icons/library.svg +6 -0
- package/dist/assets/icons/minus.svg +3 -0
- package/dist/assets/icons/office-building.svg +9 -0
- package/dist/assets/icons/photo.svg +5 -3
- package/dist/assets/icons/plus.svg +4 -0
- package/dist/assets/icons/reports.svg +4 -0
- package/dist/assets/icons/repository.svg +4 -0
- package/dist/assets/icons/right-align.svg +3 -0
- package/dist/assets/icons/sort-asc.svg +3 -4
- package/dist/assets/icons/sort-desc.svg +2 -3
- package/dist/assets/icons/tag.svg +2 -2
- package/dist/assets/icons/upload-csv.svg +37 -0
- package/dist/assets/icons/views.svg +7 -0
- package/dist/assets/icons/warning.svg +10 -0
- package/dist/assets/style.css +1 -1
- package/dist/assets/typographyMixin.scss +8 -0
- package/dist/components/AccessibleDiv/index.d.ts +46 -0
- package/dist/components/Accordion/index.d.ts +2 -0
- package/dist/components/AutoCompleteInput/index.d.ts +37 -7
- package/dist/components/Avatar/index.d.ts +1 -0
- package/dist/components/Badge/index.d.ts +2 -0
- package/dist/components/Banner/index.d.ts +17 -4
- package/dist/components/BottomSheet/index.d.ts +14 -0
- package/dist/components/BreadCrumbs/index.d.ts +5 -0
- package/dist/components/Button/index.d.ts +51 -7
- package/dist/components/Checkbox/index.d.ts +36 -0
- package/dist/components/CustomAccordion/index.d.ts +6 -0
- package/dist/components/CustomModal/index.d.ts +56 -1
- package/dist/components/DatePicker/index.d.ts +7 -0
- package/dist/components/DatePicker/useDatePickerA11y.d.ts +47 -0
- package/dist/components/Dropdown/index.d.ts +24 -0
- package/dist/components/DropdownWithInputTags/index.d.ts +14 -2
- package/dist/components/GuidedTour/index.d.ts +27 -0
- package/dist/components/Header/index.d.ts +3 -2
- package/dist/components/Icon/index.d.ts +45 -4
- package/dist/components/InfoBar/index.d.ts +10 -0
- package/dist/components/InfoTooltip/index.d.ts +21 -0
- package/dist/components/Input/index.d.ts +38 -6
- package/dist/components/InputWithIcon/index.d.ts +36 -2
- package/dist/components/KebabMenu/index.d.ts +1 -0
- package/dist/components/LabelChip/index.d.ts +3 -0
- package/dist/components/Link/index.d.ts +64 -0
- package/dist/components/MenuItem/index.d.ts +13 -3
- package/dist/components/MenuList/index.d.ts +3 -2
- package/dist/components/MessageBar/index.d.ts +20 -1
- package/dist/components/Modal/index.d.ts +3 -0
- package/dist/components/NavigationBar/TabButton.d.ts +20 -0
- package/dist/components/NavigationBar/index.d.ts +8 -1
- package/dist/components/OTPInput/index.d.ts +1 -0
- package/dist/components/OnboardingTour/index.d.ts +35 -0
- package/dist/components/Pagination/index.d.ts +2 -0
- package/dist/components/Paywall/index.d.ts +47 -0
- package/dist/components/PhoneInput/index.d.ts +27 -0
- package/dist/components/Popover/index.d.ts +19 -3
- package/dist/components/Radio/index.d.ts +7 -0
- package/dist/components/RadioGroup/index.d.ts +18 -0
- package/dist/components/ShimmerLoader/index.d.ts +4 -2
- package/dist/components/SidebarOverlay/index.d.ts +36 -0
- package/dist/components/SkipLinksBar/index.d.ts +11 -0
- package/dist/components/SnackBar/index.d.ts +5 -2
- package/dist/components/Spinner/index.d.ts +13 -1
- package/dist/components/TableLayout/index.d.ts +18 -0
- package/dist/components/Tabs/index.d.ts +6 -1
- package/dist/components/TimePicker/index.d.ts +14 -0
- package/dist/components/Toggle/index.d.ts +25 -1
- package/dist/components/Tooltip/index.d.ts +19 -2
- package/dist/components/index.d.ts +10 -0
- package/dist/index.js +152 -103
- package/dist/index.js.map +1 -1
- package/dist/index10.js +23 -48
- package/dist/index10.js.map +1 -1
- package/dist/index100.js +1 -1
- package/dist/index100.js.map +1 -1
- package/dist/index101.js +1 -1
- package/dist/index101.js.map +1 -1
- package/dist/index102.js +1 -1
- package/dist/index102.js.map +1 -1
- package/dist/index103.js +1 -1
- package/dist/index103.js.map +1 -1
- package/dist/index104.js +1 -1
- package/dist/index104.js.map +1 -1
- package/dist/index105.js +1 -1
- package/dist/index105.js.map +1 -1
- package/dist/index106.js +1 -1
- package/dist/index106.js.map +1 -1
- package/dist/index107.js +1 -1
- package/dist/index107.js.map +1 -1
- package/dist/index108.js +1 -1
- package/dist/index108.js.map +1 -1
- package/dist/index109.js +2 -2
- package/dist/index109.js.map +1 -1
- package/dist/index11.js +74 -18
- package/dist/index11.js.map +1 -1
- package/dist/index110.js +1 -1
- package/dist/index110.js.map +1 -1
- package/dist/index111.js +1 -1
- package/dist/index111.js.map +1 -1
- package/dist/index112.js +1 -1
- package/dist/index112.js.map +1 -1
- package/dist/index113.js +2 -2
- package/dist/index113.js.map +1 -1
- package/dist/index114.js +1 -1
- package/dist/index114.js.map +1 -1
- package/dist/index115.js +2 -2
- package/dist/index115.js.map +1 -1
- package/dist/index116.js +1 -1
- package/dist/index116.js.map +1 -1
- package/dist/index117.js +2 -2
- package/dist/index117.js.map +1 -1
- package/dist/index118.js +1 -1
- package/dist/index118.js.map +1 -1
- package/dist/index119.js +2 -2
- package/dist/index119.js.map +1 -1
- package/dist/index12.js +76 -11
- package/dist/index12.js.map +1 -1
- package/dist/index120.js +1 -1
- package/dist/index120.js.map +1 -1
- package/dist/index121.js +1 -1
- package/dist/index121.js.map +1 -1
- package/dist/index122.js +1 -1
- package/dist/index122.js.map +1 -1
- package/dist/index123.js +1 -1
- package/dist/index123.js.map +1 -1
- package/dist/index124.js +1 -1
- package/dist/index124.js.map +1 -1
- package/dist/index125.js +2 -2
- package/dist/index125.js.map +1 -1
- package/dist/index126.js +2 -2
- package/dist/index126.js.map +1 -1
- package/dist/index127.js +2 -2
- package/dist/index127.js.map +1 -1
- package/dist/index128.js +1 -1
- package/dist/index128.js.map +1 -1
- package/dist/index129.js +1 -1
- package/dist/index129.js.map +1 -1
- package/dist/index13.js +64 -5
- package/dist/index13.js.map +1 -1
- package/dist/index130.js +2 -2
- package/dist/index130.js.map +1 -1
- package/dist/index131.js +1 -1
- package/dist/index131.js.map +1 -1
- package/dist/index132.js +1 -1
- package/dist/index132.js.map +1 -1
- package/dist/index133.js +1 -1
- package/dist/index133.js.map +1 -1
- package/dist/index134.js +1 -1
- package/dist/index134.js.map +1 -1
- package/dist/index135.js +2 -2
- package/dist/index135.js.map +1 -1
- package/dist/index136.js +2 -2
- package/dist/index136.js.map +1 -1
- package/dist/index137.js +1 -1
- package/dist/index137.js.map +1 -1
- package/dist/index138.js +1 -1
- package/dist/index138.js.map +1 -1
- package/dist/index139.js +1 -1
- package/dist/index139.js.map +1 -1
- package/dist/index14.js +15 -138
- package/dist/index14.js.map +1 -1
- package/dist/index140.js +2 -2
- package/dist/index140.js.map +1 -1
- package/dist/index141.js +1 -1
- package/dist/index141.js.map +1 -1
- package/dist/index142.js +1 -1
- package/dist/index142.js.map +1 -1
- package/dist/index143.js +1 -1
- package/dist/index143.js.map +1 -1
- package/dist/index144.js +2 -2
- package/dist/index144.js.map +1 -1
- package/dist/index145.js +1 -1
- package/dist/index145.js.map +1 -1
- package/dist/index146.js +2 -2
- package/dist/index146.js.map +1 -1
- package/dist/index147.js +1 -1
- package/dist/index147.js.map +1 -1
- package/dist/index148.js +1 -1
- package/dist/index148.js.map +1 -1
- package/dist/index149.js +1 -1
- package/dist/index149.js.map +1 -1
- package/dist/index15.js +10 -54
- package/dist/index15.js.map +1 -1
- package/dist/index150.js +1 -1
- package/dist/index150.js.map +1 -1
- package/dist/index151.js +1 -1
- package/dist/index151.js.map +1 -1
- package/dist/index152.js +2 -2
- package/dist/index152.js.map +1 -1
- package/dist/index153.js +1 -1
- package/dist/index153.js.map +1 -1
- package/dist/index154.js +2 -2
- package/dist/index154.js.map +1 -1
- package/dist/index155.js +2 -149
- package/dist/index155.js.map +1 -1
- package/dist/index156.js +5 -0
- package/dist/index156.js.map +1 -0
- package/dist/index157.js +5 -0
- package/dist/index157.js.map +1 -0
- package/dist/index158.js +5 -0
- package/dist/index158.js.map +1 -0
- package/dist/index159.js +5 -0
- package/dist/index159.js.map +1 -0
- package/dist/index16.js +216 -54
- package/dist/index16.js.map +1 -1
- package/dist/index160.js +5 -0
- package/dist/index160.js.map +1 -0
- package/dist/index161.js +5 -0
- package/dist/index161.js.map +1 -0
- package/dist/index162.js +5 -0
- package/dist/index162.js.map +1 -0
- package/dist/index163.js +5 -0
- package/dist/index163.js.map +1 -0
- package/dist/index164.js +5 -0
- package/dist/index164.js.map +1 -0
- package/dist/index165.js +5 -0
- package/dist/index165.js.map +1 -0
- package/dist/index166.js +5 -0
- package/dist/index166.js.map +1 -0
- package/dist/index167.js +2 -12
- package/dist/index167.js.map +1 -1
- package/dist/index168.js +5 -0
- package/dist/index168.js.map +1 -0
- package/dist/index169.js +5 -0
- package/dist/index169.js.map +1 -0
- package/dist/index17.js +60 -250
- package/dist/index17.js.map +1 -1
- package/dist/index170.js +5 -0
- package/dist/index170.js.map +1 -0
- package/dist/index171.js +5 -0
- package/dist/index171.js.map +1 -0
- package/dist/index172.js +5 -0
- package/dist/index172.js.map +1 -0
- package/dist/index173.js +5 -0
- package/dist/index173.js.map +1 -0
- package/dist/index174.js +5 -0
- package/dist/index174.js.map +1 -0
- package/dist/index175.js +1 -1232
- package/dist/index175.js.map +1 -1
- package/dist/index176.js +5 -0
- package/dist/index176.js.map +1 -0
- package/dist/index177.js +5 -0
- package/dist/index177.js.map +1 -0
- package/dist/index178.js +5 -0
- package/dist/index178.js.map +1 -0
- package/dist/index179.js +2 -4
- package/dist/index179.js.map +1 -1
- package/dist/index18.js +128 -11
- package/dist/index18.js.map +1 -1
- package/dist/index180.js +5 -0
- package/dist/index180.js.map +1 -0
- package/dist/index181.js +5 -0
- package/dist/index181.js.map +1 -0
- package/dist/index182.js +5 -0
- package/dist/index182.js.map +1 -0
- package/dist/index183.js +2 -10
- package/dist/index183.js.map +1 -1
- package/dist/index184.js +1 -9
- package/dist/index184.js.map +1 -1
- package/dist/index185.js +2 -5
- package/dist/index185.js.map +1 -1
- package/dist/index186.js +2 -170
- package/dist/index186.js.map +1 -1
- package/dist/index187.js +2 -11
- package/dist/index187.js.map +1 -1
- package/dist/index188.js +1 -5
- package/dist/index188.js.map +1 -1
- package/dist/index189.js +2 -6
- package/dist/index189.js.map +1 -1
- package/dist/index19.js +360 -32
- package/dist/index19.js.map +1 -1
- package/dist/index190.js +2 -38
- package/dist/index190.js.map +1 -1
- package/dist/index191.js +2 -2
- package/dist/index191.js.map +1 -1
- package/dist/index192.js +2 -8
- package/dist/index192.js.map +1 -1
- package/dist/index193.js +2 -327
- package/dist/index193.js.map +1 -1
- package/dist/index194.js +2 -50
- package/dist/index194.js.map +1 -1
- package/dist/index195.js +2 -2
- package/dist/index195.js.map +1 -1
- package/dist/index196.js +2 -76
- package/dist/index196.js.map +1 -1
- package/dist/index197.js +2 -93
- package/dist/index197.js.map +1 -1
- package/dist/index198.js +2 -52
- package/dist/index198.js.map +1 -1
- package/dist/index199.js +2 -8
- package/dist/index199.js.map +1 -1
- package/dist/index20.js +18 -55
- package/dist/index20.js.map +1 -1
- package/dist/index200.js +2 -5
- package/dist/index200.js.map +1 -1
- package/dist/index201.js +2 -52
- package/dist/index201.js.map +1 -1
- package/dist/index202.js +2 -2
- package/dist/index202.js.map +1 -1
- package/dist/index203.js +149 -2
- package/dist/index203.js.map +1 -1
- package/dist/index204.js +12 -0
- package/dist/index204.js.map +1 -0
- package/dist/index205.js +9 -0
- package/dist/index205.js.map +1 -0
- package/dist/index206.js +8 -0
- package/dist/index206.js.map +1 -0
- package/dist/index207.js +46 -0
- package/dist/index207.js.map +1 -0
- package/dist/index208.js +24 -0
- package/dist/index208.js.map +1 -0
- package/dist/index21.js +33 -45
- package/dist/index21.js.map +1 -1
- package/dist/index215.js +31 -0
- package/dist/index215.js.map +1 -0
- package/dist/index216.js +75 -0
- package/dist/index216.js.map +1 -0
- package/dist/index22.js +64 -21
- package/dist/index22.js.map +1 -1
- package/dist/index224.js +15 -0
- package/dist/index224.js.map +1 -0
- package/dist/index23.js +84 -189
- package/dist/index23.js.map +1 -1
- package/dist/index232.js +1236 -0
- package/dist/index232.js.map +1 -0
- package/dist/index235.js +46 -0
- package/dist/index235.js.map +1 -0
- package/dist/index24.js +21 -45
- package/dist/index24.js.map +1 -1
- package/dist/index244.js +173 -0
- package/dist/index244.js.map +1 -0
- package/dist/index245.js +7 -0
- package/dist/index245.js.map +1 -0
- package/dist/index247.js +22 -0
- package/dist/index247.js.map +1 -0
- package/dist/index248.js +13 -0
- package/dist/index248.js.map +1 -0
- package/dist/index249.js +13 -0
- package/dist/index249.js.map +1 -0
- package/dist/index25.js +384 -18
- package/dist/index25.js.map +1 -1
- package/dist/index250.js +8 -0
- package/dist/index250.js.map +1 -0
- package/dist/index251.js +173 -0
- package/dist/index251.js.map +1 -0
- package/dist/index252.js +14 -0
- package/dist/index252.js.map +1 -0
- package/dist/index253.js +9 -0
- package/dist/index253.js.map +1 -0
- package/dist/index254.js +9 -0
- package/dist/index254.js.map +1 -0
- package/dist/index255.js +41 -0
- package/dist/index255.js.map +1 -0
- package/dist/index256.js +5 -0
- package/dist/index256.js.map +1 -0
- package/dist/index257.js +11 -0
- package/dist/index257.js.map +1 -0
- package/dist/index258.js +330 -0
- package/dist/index258.js.map +1 -0
- package/dist/index259.js +53 -0
- package/dist/index259.js.map +1 -0
- package/dist/index26.js +46 -51
- package/dist/index26.js.map +1 -1
- package/dist/index260.js +5 -0
- package/dist/index260.js.map +1 -0
- package/dist/index261.js +79 -0
- package/dist/index261.js.map +1 -0
- package/dist/index262.js +96 -0
- package/dist/index262.js.map +1 -0
- package/dist/index263.js +55 -0
- package/dist/index263.js.map +1 -0
- package/dist/index264.js +11 -0
- package/dist/index264.js.map +1 -0
- package/dist/index265.js +8 -0
- package/dist/index265.js.map +1 -0
- package/dist/index266.js +55 -0
- package/dist/index266.js.map +1 -0
- package/dist/index267.js +5 -0
- package/dist/index267.js.map +1 -0
- package/dist/index268.js +5 -0
- package/dist/index268.js.map +1 -0
- package/dist/index27.js +22 -74
- package/dist/index27.js.map +1 -1
- package/dist/index28.js +108 -83
- package/dist/index28.js.map +1 -1
- package/dist/index29.js +148 -49
- package/dist/index29.js.map +1 -1
- package/dist/index3.js +69 -65
- package/dist/index3.js.map +1 -1
- package/dist/index30.js +133 -95
- package/dist/index30.js.map +1 -1
- package/dist/index31.js +77 -77
- package/dist/index31.js.map +1 -1
- package/dist/index32.js +99 -32
- package/dist/index32.js.map +1 -1
- package/dist/index33.js +75 -36
- package/dist/index33.js.map +1 -1
- package/dist/index34.js +42 -46
- package/dist/index34.js.map +1 -1
- package/dist/index35.js +72 -56
- package/dist/index35.js.map +1 -1
- package/dist/index36.js +99 -169
- package/dist/index36.js.map +1 -1
- package/dist/index37.js +51 -38
- package/dist/index37.js.map +1 -1
- package/dist/index38.js +306 -82
- package/dist/index38.js.map +1 -1
- package/dist/index39.js +70 -31
- package/dist/index39.js.map +1 -1
- package/dist/index4.js +108 -42
- package/dist/index4.js.map +1 -1
- package/dist/index40.js +82 -50
- package/dist/index40.js.map +1 -1
- package/dist/index41.js +27 -67
- package/dist/index41.js.map +1 -1
- package/dist/index42.js +45 -51
- package/dist/index42.js.map +1 -1
- package/dist/index43.js +109 -94
- package/dist/index43.js.map +1 -1
- package/dist/index44.js +54 -92
- package/dist/index44.js.map +1 -1
- package/dist/index45.js +143 -35
- package/dist/index45.js.map +1 -1
- package/dist/index46.js +194 -30
- package/dist/index46.js.map +1 -1
- package/dist/index47.js +36 -30
- package/dist/index47.js.map +1 -1
- package/dist/index48.js +34 -53
- package/dist/index48.js.map +1 -1
- package/dist/index49.js +142 -359
- package/dist/index49.js.map +1 -1
- package/dist/index5.js +41 -232
- package/dist/index5.js.map +1 -1
- package/dist/index50.js +82 -61
- package/dist/index50.js.map +1 -1
- package/dist/index51.js +458 -35
- package/dist/index51.js.map +1 -1
- package/dist/index52.js +98 -38
- package/dist/index52.js.map +1 -1
- package/dist/index53.js +42 -84
- package/dist/index53.js.map +1 -1
- package/dist/index54.js +36 -140
- package/dist/index54.js.map +1 -1
- package/dist/index55.js +88 -136
- package/dist/index55.js.map +1 -1
- package/dist/index56.js +166 -0
- package/dist/index56.js.map +1 -0
- package/dist/index57.js +149 -2
- package/dist/index57.js.map +1 -1
- package/dist/index58.js +33 -2
- package/dist/index58.js.map +1 -1
- package/dist/index59.js +86 -2
- package/dist/index59.js.map +1 -1
- package/dist/index6.js +328 -50
- package/dist/index6.js.map +1 -1
- package/dist/index60.js +119 -2
- package/dist/index60.js.map +1 -1
- package/dist/index61.js +78 -2
- package/dist/index61.js.map +1 -1
- package/dist/index62.js +152 -2
- package/dist/index62.js.map +1 -1
- package/dist/index63.js +318 -2
- package/dist/index63.js.map +1 -1
- package/dist/index64.js +47 -2
- package/dist/index64.js.map +1 -1
- package/dist/index65.js +145 -2
- package/dist/index65.js.map +1 -1
- package/dist/index66.js +12 -2
- package/dist/index66.js.map +1 -1
- package/dist/index67.js +46 -2
- package/dist/index67.js.map +1 -1
- package/dist/index68.js +103 -2
- package/dist/index68.js.map +1 -1
- package/dist/index69.js +19 -2
- package/dist/index69.js.map +1 -1
- package/dist/index7.js +44 -51
- package/dist/index7.js.map +1 -1
- package/dist/index70.js +66 -2
- package/dist/index70.js.map +1 -1
- package/dist/index71.js +27 -2
- package/dist/index71.js.map +1 -1
- package/dist/index72.js +108 -2
- package/dist/index72.js.map +1 -1
- package/dist/index73.js +62 -2
- package/dist/index73.js.map +1 -1
- package/dist/index74.js +21 -2
- package/dist/index74.js.map +1 -1
- package/dist/index75.js +171 -2
- package/dist/index75.js.map +1 -1
- package/dist/index76.js +18 -2
- package/dist/index76.js.map +1 -1
- package/dist/index77.js +11 -2
- package/dist/index77.js.map +1 -1
- package/dist/index78.js +5 -2
- package/dist/index78.js.map +1 -1
- package/dist/index79.js +56 -2
- package/dist/index79.js.map +1 -1
- package/dist/index8.js +48 -18
- package/dist/index8.js.map +1 -1
- package/dist/index80.js +27 -2
- package/dist/index80.js.map +1 -1
- package/dist/index81.js +9 -2
- package/dist/index81.js.map +1 -1
- package/dist/index83.js +2 -2
- package/dist/index83.js.map +1 -1
- package/dist/index84.js +2 -2
- package/dist/index84.js.map +1 -1
- package/dist/index85.js +1 -1
- package/dist/index85.js.map +1 -1
- package/dist/index86.js +2 -2
- package/dist/index86.js.map +1 -1
- package/dist/index87.js +1 -1
- package/dist/index87.js.map +1 -1
- package/dist/index88.js +1 -1
- package/dist/index88.js.map +1 -1
- package/dist/index89.js +1 -1
- package/dist/index89.js.map +1 -1
- package/dist/index9.js +91 -59
- package/dist/index9.js.map +1 -1
- package/dist/index90.js +1 -1
- package/dist/index90.js.map +1 -1
- package/dist/index91.js +2 -2
- package/dist/index91.js.map +1 -1
- package/dist/index92.js +2 -2
- package/dist/index92.js.map +1 -1
- package/dist/index93.js +2 -2
- package/dist/index93.js.map +1 -1
- package/dist/index94.js +1 -1
- package/dist/index94.js.map +1 -1
- package/dist/index95.js +2 -2
- package/dist/index95.js.map +1 -1
- package/dist/index96.js +1 -1
- package/dist/index96.js.map +1 -1
- package/dist/index97.js +1 -1
- package/dist/index97.js.map +1 -1
- package/dist/index98.js +1 -1
- package/dist/index98.js.map +1 -1
- package/dist/index99.js +2 -2
- package/dist/index99.js.map +1 -1
- package/package.json +1 -1
- package/dist/index82.js +0 -5
- package/dist/index82.js.map +0 -1
package/dist/index75.js
CHANGED
|
@@ -1,5 +1,174 @@
|
|
|
1
|
-
|
|
1
|
+
var m = Object.defineProperty;
|
|
2
|
+
var g = (r, e, t) => e in r ? m(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
|
+
var o = (r, e, t) => g(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
const u = "sr-only", h = "data-batch-id", f = "data-modal-announcer";
|
|
5
|
+
let c = null;
|
|
6
|
+
function p() {
|
|
7
|
+
return c || (c = new T()), c;
|
|
8
|
+
}
|
|
9
|
+
class T {
|
|
10
|
+
constructor() {
|
|
11
|
+
o(this, "container", null);
|
|
12
|
+
o(this, "assertiveLog", null);
|
|
13
|
+
o(this, "politeLog", null);
|
|
14
|
+
o(this, "cleanupTimers", /* @__PURE__ */ new Map());
|
|
15
|
+
o(this, "delayTimers", /* @__PURE__ */ new Map());
|
|
16
|
+
o(this, "pendingRafByBatchId", /* @__PURE__ */ new Map());
|
|
17
|
+
o(this, "ready", !1);
|
|
18
|
+
o(this, "pendingQueue", []);
|
|
19
|
+
typeof document > "u" || (this.container = document.createElement("div"), this.container.dataset.liveAnnouncer = "true", this.container.className = u, this.assertiveLog = this.createLog("assertive"), this.politeLog = this.createLog("polite"), this.container.appendChild(this.assertiveLog), this.container.appendChild(this.politeLog), document.body.prepend(this.container), this.isTestEnvironment() ? this.ready = !0 : setTimeout(() => {
|
|
20
|
+
this.ready = !0, this.flushPendingQueue();
|
|
21
|
+
}, 100));
|
|
22
|
+
}
|
|
23
|
+
// -----------------------------------------------------------------------
|
|
24
|
+
// Public
|
|
25
|
+
// -----------------------------------------------------------------------
|
|
26
|
+
announce(e, t = {}) {
|
|
27
|
+
const i = {
|
|
28
|
+
assertiveness: t.assertiveness ?? "polite",
|
|
29
|
+
timeout: t.timeout ?? 7e3,
|
|
30
|
+
batchId: t.batchId ?? "",
|
|
31
|
+
delay: t.delay ?? 0
|
|
32
|
+
};
|
|
33
|
+
if (i.batchId) {
|
|
34
|
+
const n = this.delayTimers.get(i.batchId);
|
|
35
|
+
n && (clearTimeout(n), this.delayTimers.delete(i.batchId));
|
|
36
|
+
}
|
|
37
|
+
if (!this.ready) {
|
|
38
|
+
this.pendingQueue.push({
|
|
39
|
+
message: e,
|
|
40
|
+
options: i
|
|
41
|
+
});
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
if (i.delay > 0) {
|
|
45
|
+
const n = i.batchId || `__delay_${Date.now()}_${Math.random()}`, a = setTimeout(() => {
|
|
46
|
+
this.delayTimers.delete(n), this.doAnnounce(e, i);
|
|
47
|
+
}, i.delay);
|
|
48
|
+
this.delayTimers.set(n, a);
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
this.doAnnounce(e, i);
|
|
52
|
+
}
|
|
53
|
+
clear(e) {
|
|
54
|
+
(!e || e === "assertive") && this.clearLog(this.assertiveLog), (!e || e === "polite") && this.clearLog(this.politeLog);
|
|
55
|
+
}
|
|
56
|
+
destroy() {
|
|
57
|
+
this.cleanupTimers.forEach((e) => clearTimeout(e)), this.cleanupTimers.clear(), this.delayTimers.forEach((e) => clearTimeout(e)), this.delayTimers.clear(), this.pendingRafByBatchId.forEach((e) => cancelAnimationFrame(e)), this.pendingRafByBatchId.clear(), this.container?.remove(), this.container = null, this.assertiveLog = null, this.politeLog = null, this.ready = !1, this.pendingQueue = [], c === this && (c = null);
|
|
58
|
+
}
|
|
59
|
+
isAttached() {
|
|
60
|
+
return this.container?.isConnected ?? !1;
|
|
61
|
+
}
|
|
62
|
+
// -----------------------------------------------------------------------
|
|
63
|
+
// Private
|
|
64
|
+
// -----------------------------------------------------------------------
|
|
65
|
+
createLog(e) {
|
|
66
|
+
const t = document.createElement("div");
|
|
67
|
+
return t.setAttribute("role", "log"), t.setAttribute("aria-live", e), t.setAttribute("aria-relevant", "additions"), t;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Returns the appropriate log element for the current context.
|
|
71
|
+
* When an aria-modal dialog is active, announcements must be made from
|
|
72
|
+
* within the modal (screen readers ignore content outside aria-modal).
|
|
73
|
+
* A live region is lazily created inside the modal and cleaned up when
|
|
74
|
+
* the modal is removed from the DOM.
|
|
75
|
+
*/
|
|
76
|
+
getLogForContext(e) {
|
|
77
|
+
const t = this.findVisibleModal();
|
|
78
|
+
if (!t)
|
|
79
|
+
return e === "assertive" ? this.assertiveLog : this.politeLog;
|
|
80
|
+
let i = t.querySelector(`[${f}]`);
|
|
81
|
+
if (!i) {
|
|
82
|
+
i = document.createElement("div"), i.setAttribute(f, "true"), i.className = u;
|
|
83
|
+
const s = this.createLog("assertive"), d = this.createLog("polite");
|
|
84
|
+
i.appendChild(s), i.appendChild(d), t.appendChild(i);
|
|
85
|
+
}
|
|
86
|
+
const n = i.querySelectorAll('[role="log"]'), a = n[0], l = n[1];
|
|
87
|
+
return e === "assertive" ? a : l;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Returns the first aria-modal element that is actually visible.
|
|
91
|
+
* A modal is considered hidden if:
|
|
92
|
+
* - it or an ancestor has aria-hidden="true", or
|
|
93
|
+
* - its computed visibility is "hidden" (se-design Modal uses the
|
|
94
|
+
* `invisible` CSS class on the wrapper when closed).
|
|
95
|
+
*/
|
|
96
|
+
findVisibleModal() {
|
|
97
|
+
const e = document.querySelectorAll('[aria-modal="true"]');
|
|
98
|
+
for (const t of e) {
|
|
99
|
+
const i = t;
|
|
100
|
+
if (!i.closest('[aria-hidden="true"]') && getComputedStyle(i).visibility !== "hidden")
|
|
101
|
+
return i;
|
|
102
|
+
}
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
doAnnounce(e, t) {
|
|
106
|
+
const i = this.getLogForContext(t.assertiveness);
|
|
107
|
+
if (!i) return;
|
|
108
|
+
let n = !1;
|
|
109
|
+
if (t.batchId) {
|
|
110
|
+
const s = i.querySelector(`[${h}="${CSS.escape(t.batchId)}"]`);
|
|
111
|
+
s && (this.removeNode(s), n = !0);
|
|
112
|
+
}
|
|
113
|
+
const a = document.createElement("div");
|
|
114
|
+
a.textContent = e, t.batchId && a.setAttribute(h, t.batchId);
|
|
115
|
+
const l = () => {
|
|
116
|
+
if (i.isConnected && (i.appendChild(a), e !== "")) {
|
|
117
|
+
const s = setTimeout(() => {
|
|
118
|
+
this.removeNode(a);
|
|
119
|
+
}, t.timeout);
|
|
120
|
+
this.cleanupTimers.set(a, s);
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
if (n) {
|
|
124
|
+
const s = this.pendingRafByBatchId.get(t.batchId);
|
|
125
|
+
s !== void 0 && cancelAnimationFrame(s);
|
|
126
|
+
const d = requestAnimationFrame(() => {
|
|
127
|
+
this.pendingRafByBatchId.delete(t.batchId), l();
|
|
128
|
+
});
|
|
129
|
+
this.pendingRafByBatchId.set(t.batchId, d);
|
|
130
|
+
} else
|
|
131
|
+
l();
|
|
132
|
+
}
|
|
133
|
+
removeNode(e) {
|
|
134
|
+
const t = this.cleanupTimers.get(e);
|
|
135
|
+
t && (clearTimeout(t), this.cleanupTimers.delete(e)), e.remove();
|
|
136
|
+
}
|
|
137
|
+
clearLog(e) {
|
|
138
|
+
e && (Array.from(e.children).forEach((t) => {
|
|
139
|
+
const i = this.cleanupTimers.get(t);
|
|
140
|
+
i && (clearTimeout(i), this.cleanupTimers.delete(t));
|
|
141
|
+
}), e.innerHTML = "");
|
|
142
|
+
}
|
|
143
|
+
flushPendingQueue() {
|
|
144
|
+
this.pendingQueue.splice(0).forEach(({
|
|
145
|
+
message: t,
|
|
146
|
+
options: i
|
|
147
|
+
}) => this.doAnnounce(t, i));
|
|
148
|
+
}
|
|
149
|
+
isTestEnvironment() {
|
|
150
|
+
try {
|
|
151
|
+
if (typeof IS_REACT_ACT_ENVIRONMENT == "boolean" && IS_REACT_ACT_ENVIRONMENT || typeof jest < "u" || typeof vitest < "u") return !0;
|
|
152
|
+
} catch {
|
|
153
|
+
}
|
|
154
|
+
return !1;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
function A(r, e) {
|
|
158
|
+
const t = typeof e == "string" ? {
|
|
159
|
+
assertiveness: e
|
|
160
|
+
} : e ?? {};
|
|
161
|
+
p().announce(r, t);
|
|
162
|
+
}
|
|
163
|
+
function L(r) {
|
|
164
|
+
c?.clear(r);
|
|
165
|
+
}
|
|
166
|
+
function I() {
|
|
167
|
+
c?.destroy();
|
|
168
|
+
}
|
|
2
169
|
export {
|
|
3
|
-
|
|
170
|
+
A as announce,
|
|
171
|
+
L as clearAnnouncer,
|
|
172
|
+
I as destroyAnnouncer
|
|
4
173
|
};
|
|
5
174
|
//# sourceMappingURL=index75.js.map
|
package/dist/index75.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index75.js","sources":["../src/assets/icons/checkbox-tick.svg?url"],"sourcesContent":["export default \"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%204C0%201.79086%201.79086%200%204%200H12C14.2091%200%2016%201.79086%2016%204V12C16%2014.2091%2014.2091%2016%2012%2016H4C1.79086%2016%200%2014.2091%200%2012V4Z'%20fill='%231088E7'/%3e%3cpath%20d='M11.8082%205.5L6.89749%2010.5L4.66534%208.22727'%20stroke='white'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e\""],"names":["__vite_glob_0_18"],"mappings":"AAAA,MAAeA,IAAA;"}
|
|
1
|
+
{"version":3,"file":"index75.js","sources":["../src/utils/a11y/liveAnnouncer/LiveAnnouncer.ts"],"sourcesContent":["/**\n * LiveAnnouncer — singleton vanilla-DOM announcer for screen readers.\n *\n * Architecture:\n * - Prepends a visually-hidden container to document.body on first use.\n * - Two <div role=\"log\" aria-live=\"...\"> regions: one polite, one assertive.\n * - Each announce() appends a NEW child node (aria-relevant=\"additions\" makes\n * screen readers announce only additions, never re-read existing content).\n * - Child nodes auto-remove after a timeout (default 7 s) to keep the DOM clean.\n * - batchId option: if a node with the same batchId already exists in a log,\n * it is replaced — so only the final value is announced (e.g. \"N results\").\n *\n * No React dependency. No role=\"status\" or role=\"alert\" (avoids double-announce\n * bugs on iOS VoiceOver).\n */\n\nexport type Assertiveness = 'assertive' | 'polite';\n\nexport interface AnnounceOptions {\n /** Default: 'polite' */\n assertiveness?: Assertiveness;\n /** Auto-clear timeout in ms. Default: 7000 */\n timeout?: number;\n /**\n * When provided, any pending node with the same batchId is replaced rather\n * than appending a second node. Useful for rapidly-updating counts\n * (e.g. search results, selection count).\n */\n batchId?: string;\n /**\n * Delay in ms before the announcement is made. Useful when focus changes\n * would otherwise swallow the announcement (e.g. after adding a tag in\n * a combobox). A subsequent call with the same batchId cancels any\n * pending delayed announcement.\n */\n delay?: number;\n}\n\nconst DEFAULT_TIMEOUT = 7000;\nconst SAFARI_INIT_DELAY = 100;\n\nconst SR_ONLY_CLASS = 'sr-only';\n\n/** Attribute used to find batchId nodes for replacement. */\nconst BATCH_ATTR = 'data-batch-id';\n\n/** Attribute used to identify announcer containers injected into modals. */\nconst MODAL_ANNOUNCER_ATTR = 'data-modal-announcer';\n\n// ---------------------------------------------------------------------------\n// Singleton\n// ---------------------------------------------------------------------------\n\nlet instance: LiveAnnouncer | null = null;\n\n/**\n * Get or create the singleton LiveAnnouncer.\n * Safe to call multiple times — returns the same instance.\n */\nfunction getInstance(): LiveAnnouncer {\n if (!instance) {\n instance = new LiveAnnouncer();\n }\n return instance;\n}\n\n// ---------------------------------------------------------------------------\n// Class\n// ---------------------------------------------------------------------------\n\nclass LiveAnnouncer {\n private container: HTMLDivElement | null = null;\n private assertiveLog: HTMLDivElement | null = null;\n private politeLog: HTMLDivElement | null = null;\n private cleanupTimers: Map<HTMLElement, ReturnType<typeof setTimeout>> = new Map();\n private delayTimers: Map<string, ReturnType<typeof setTimeout>> = new Map();\n private pendingRafByBatchId: Map<string, number> = new Map();\n private ready = false;\n private pendingQueue: Array<{ message: string; options: Required<AnnounceOptions> }> = [];\n\n constructor() {\n if (typeof document === 'undefined') return;\n\n this.container = document.createElement('div');\n this.container.dataset.liveAnnouncer = 'true';\n this.container.className = SR_ONLY_CLASS;\n\n this.assertiveLog = this.createLog('assertive');\n this.politeLog = this.createLog('polite');\n\n this.container.appendChild(this.assertiveLog);\n this.container.appendChild(this.politeLog);\n\n // Prepend so screen readers encounter it early in the DOM.\n document.body.prepend(this.container);\n\n // Safari/VoiceOver ignores content injected within ~100 ms of the live\n // region being added to the DOM. Delay readiness accordingly.\n // In test environments, skip the delay.\n if (this.isTestEnvironment()) {\n this.ready = true;\n } else {\n setTimeout(() => {\n this.ready = true;\n this.flushPendingQueue();\n }, SAFARI_INIT_DELAY);\n }\n }\n\n // -----------------------------------------------------------------------\n // Public\n // -----------------------------------------------------------------------\n\n announce(message: string, options: AnnounceOptions = {}): void {\n const resolved: Required<AnnounceOptions> = {\n assertiveness: options.assertiveness ?? 'polite',\n timeout: options.timeout ?? DEFAULT_TIMEOUT,\n batchId: options.batchId ?? '',\n delay: options.delay ?? 0,\n };\n\n // Cancel any pending delayed announcement with the same batchId.\n if (resolved.batchId) {\n const pendingTimer = this.delayTimers.get(resolved.batchId);\n if (pendingTimer) {\n clearTimeout(pendingTimer);\n this.delayTimers.delete(resolved.batchId);\n }\n }\n\n if (!this.ready) {\n this.pendingQueue.push({ message, options: resolved });\n return;\n }\n\n if (resolved.delay > 0) {\n const key = resolved.batchId || `__delay_${Date.now()}_${Math.random()}`;\n const timer = setTimeout(() => {\n this.delayTimers.delete(key);\n this.doAnnounce(message, resolved);\n }, resolved.delay);\n this.delayTimers.set(key, timer);\n return;\n }\n\n this.doAnnounce(message, resolved);\n }\n\n clear(assertiveness?: Assertiveness): void {\n if (!assertiveness || assertiveness === 'assertive') {\n this.clearLog(this.assertiveLog);\n }\n if (!assertiveness || assertiveness === 'polite') {\n this.clearLog(this.politeLog);\n }\n }\n\n destroy(): void {\n // Cancel all pending auto-clear timers.\n this.cleanupTimers.forEach((timer) => clearTimeout(timer));\n this.cleanupTimers.clear();\n // Cancel all pending delayed announcements.\n this.delayTimers.forEach((timer) => clearTimeout(timer));\n this.delayTimers.clear();\n // Cancel any pending rAF deferred appends.\n this.pendingRafByBatchId.forEach((rafId) => cancelAnimationFrame(rafId));\n this.pendingRafByBatchId.clear();\n\n this.container?.remove();\n this.container = null;\n this.assertiveLog = null;\n this.politeLog = null;\n this.ready = false;\n this.pendingQueue = [];\n\n if (instance === this) {\n instance = null;\n }\n }\n\n isAttached(): boolean {\n return this.container?.isConnected ?? false;\n }\n\n // -----------------------------------------------------------------------\n // Private\n // -----------------------------------------------------------------------\n\n private createLog(ariaLive: Assertiveness): HTMLDivElement {\n const log = document.createElement('div');\n log.setAttribute('role', 'log');\n log.setAttribute('aria-live', ariaLive);\n log.setAttribute('aria-relevant', 'additions');\n return log;\n }\n\n /**\n * Returns the appropriate log element for the current context.\n * When an aria-modal dialog is active, announcements must be made from\n * within the modal (screen readers ignore content outside aria-modal).\n * A live region is lazily created inside the modal and cleaned up when\n * the modal is removed from the DOM.\n */\n private getLogForContext(assertiveness: Assertiveness): HTMLDivElement | null {\n // Find the first *visible* aria-modal dialog. Hidden modals (e.g. pre-\n // rendered paywall, upload-contacts) must be skipped — otherwise the\n // announcement lands inside a hidden container and is never read.\n const modal = this.findVisibleModal();\n if (!modal) {\n return assertiveness === 'assertive' ? this.assertiveLog : this.politeLog;\n }\n\n // Find or create a live region container inside the modal.\n let modalAnnouncer = modal.querySelector(`[${MODAL_ANNOUNCER_ATTR}]`) as HTMLDivElement | null;\n if (!modalAnnouncer) {\n modalAnnouncer = document.createElement('div');\n modalAnnouncer.setAttribute(MODAL_ANNOUNCER_ATTR, 'true');\n modalAnnouncer.className = SR_ONLY_CLASS;\n\n const assertiveLog = this.createLog('assertive');\n const politeLog = this.createLog('polite');\n modalAnnouncer.appendChild(assertiveLog);\n modalAnnouncer.appendChild(politeLog);\n\n modal.appendChild(modalAnnouncer);\n }\n\n const logs = modalAnnouncer.querySelectorAll('[role=\"log\"]');\n const assertiveLog = logs[0] as HTMLDivElement | null;\n const politeLog = logs[1] as HTMLDivElement | null;\n\n return assertiveness === 'assertive' ? assertiveLog : politeLog;\n }\n\n /**\n * Returns the first aria-modal element that is actually visible.\n * A modal is considered hidden if:\n * - it or an ancestor has aria-hidden=\"true\", or\n * - its computed visibility is \"hidden\" (se-design Modal uses the\n * `invisible` CSS class on the wrapper when closed).\n */\n private findVisibleModal(): HTMLElement | null {\n const modals = document.querySelectorAll('[aria-modal=\"true\"]');\n for (const m of modals) {\n const el = m as HTMLElement;\n if (el.closest('[aria-hidden=\"true\"]')) continue;\n if (getComputedStyle(el).visibility === 'hidden') continue;\n return el;\n }\n return null;\n }\n\n private doAnnounce(message: string, options: Required<AnnounceOptions>): void {\n const log = this.getLogForContext(options.assertiveness);\n if (!log) return;\n\n // batchId dedup: remove any existing node with the same batchId.\n let hadExisting = false;\n if (options.batchId) {\n const existing = log.querySelector(`[${BATCH_ATTR}=\"${CSS.escape(options.batchId)}\"]`) as HTMLElement | null;\n if (existing) {\n this.removeNode(existing);\n hadExisting = true;\n }\n }\n\n const node = document.createElement('div');\n node.textContent = message;\n\n if (options.batchId) {\n node.setAttribute(BATCH_ATTR, options.batchId);\n }\n\n const appendNode = () => {\n // Guard: destroy() may have been called during the rAF window\n if (!log.isConnected) return;\n log.appendChild(node);\n // Auto-remove after timeout to keep the DOM clean.\n if (message !== '') {\n const timer = setTimeout(() => {\n this.removeNode(node);\n }, options.timeout);\n this.cleanupTimers.set(node, timer);\n }\n };\n\n // When replacing a batched node, defer the append by one animation frame.\n // Remove + append in the same tick looks like a mutation to screen readers\n // (aria-relevant=\"additions\" is not triggered), so the announcement is missed.\n // Deferring ensures the SR sees a clean addition event.\n // Cancel any pending rAF for this batchId to avoid duplicate nodes if two\n // announce() calls fire before the first rAF runs.\n if (hadExisting) {\n const pendingRaf = this.pendingRafByBatchId.get(options.batchId);\n if (pendingRaf !== undefined) {\n cancelAnimationFrame(pendingRaf);\n }\n const rafId = requestAnimationFrame(() => {\n this.pendingRafByBatchId.delete(options.batchId);\n appendNode();\n });\n this.pendingRafByBatchId.set(options.batchId, rafId);\n } else {\n appendNode();\n }\n }\n\n private removeNode(node: HTMLElement): void {\n const timer = this.cleanupTimers.get(node);\n if (timer) {\n clearTimeout(timer);\n this.cleanupTimers.delete(node);\n }\n node.remove();\n }\n\n private clearLog(log: HTMLDivElement | null): void {\n if (!log) return;\n // Cancel timers for all children in this log.\n Array.from(log.children).forEach((child) => {\n const timer = this.cleanupTimers.get(child as HTMLElement);\n if (timer) {\n clearTimeout(timer);\n this.cleanupTimers.delete(child as HTMLElement);\n }\n });\n log.innerHTML = '';\n }\n\n private flushPendingQueue(): void {\n const queued = this.pendingQueue.splice(0);\n queued.forEach(({ message, options }) => this.doAnnounce(message, options));\n }\n\n private isTestEnvironment(): boolean {\n try {\n // React 18+ test flag\n // @ts-expect-error – global test flag\n if (typeof IS_REACT_ACT_ENVIRONMENT === 'boolean' && IS_REACT_ACT_ENVIRONMENT) return true;\n // Jest / Vitest\n // @ts-expect-error – jest global may not be typed\n if (typeof jest !== 'undefined') return true;\n // @ts-expect-error – Vitest global\n if (typeof vitest !== 'undefined') return true;\n } catch {\n // ignore\n }\n return false;\n }\n}\n\n// ---------------------------------------------------------------------------\n// Public imperative API (module-level)\n// ---------------------------------------------------------------------------\n\n/**\n * Announce a message to screen readers.\n *\n * Works anywhere — React components, event handlers, thunks, vanilla JS.\n * The singleton live region is lazily created on first call.\n *\n * @example\n * announce('5 results found');\n * announce('Error: upload failed', { assertiveness: 'assertive' });\n * announce('3 items selected', { batchId: 'selection-count' });\n * announce('Invalid email', { assertiveness: 'assertive', delay: 300 });\n */\nexport function announce(message: string, options?: AnnounceOptions): void;\nexport function announce(message: string, assertiveness?: Assertiveness): void;\nexport function announce(\n message: string,\n optionsOrAssertiveness?: AnnounceOptions | Assertiveness\n): void {\n const options: AnnounceOptions =\n typeof optionsOrAssertiveness === 'string'\n ? { assertiveness: optionsOrAssertiveness }\n : optionsOrAssertiveness ?? {};\n\n getInstance().announce(message, options);\n}\n\n/**\n * Clear all pending announcements.\n * @param assertiveness — if omitted, clears both polite and assertive logs.\n */\nexport function clearAnnouncer(assertiveness?: Assertiveness): void {\n instance?.clear(assertiveness);\n}\n\n/**\n * Remove the live-region container from the DOM and reset the singleton.\n * Typically called when the host app unmounts (via LiveAnnouncerProvider).\n */\nexport function destroyAnnouncer(): void {\n instance?.destroy();\n}\n\n/**\n * Check whether the live-region container is currently in the DOM.\n */\nexport function isAnnouncerAttached(): boolean {\n return instance?.isAttached() ?? false;\n}\n"],"names":["SR_ONLY_CLASS","BATCH_ATTR","MODAL_ANNOUNCER_ATTR","instance","getInstance","LiveAnnouncer","constructor","container","assertiveLog","politeLog","cleanupTimers","Map","delayTimers","pendingRafByBatchId","ready","pendingQueue","document","createElement","dataset","liveAnnouncer","className","createLog","appendChild","body","prepend","isTestEnvironment","setTimeout","flushPendingQueue","SAFARI_INIT_DELAY","announce","message","options","resolved","assertiveness","timeout","DEFAULT_TIMEOUT","batchId","delay","pendingTimer","get","clearTimeout","delete","push","key","Date","now","Math","random","timer","doAnnounce","set","clear","clearLog","destroy","forEach","rafId","cancelAnimationFrame","remove","isAttached","isConnected","ariaLive","log","setAttribute","getLogForContext","modal","findVisibleModal","modalAnnouncer","querySelector","logs","querySelectorAll","modals","m","el","closest","getComputedStyle","visibility","hadExisting","existing","CSS","escape","removeNode","node","textContent","appendNode","pendingRaf","undefined","requestAnimationFrame","Array","from","children","child","innerHTML","queued","splice","IS_REACT_ACT_ENVIRONMENT","jest","vitest","optionsOrAssertiveness","clearAnnouncer","destroyAnnouncer"],"mappings":";;;AAyCA,MAAMA,IAAgB,WAGhBC,IAAa,iBAGbC,IAAuB;AAM7B,IAAIC,IAAiC;AAMrC,SAASC,IAA6B;AACpC,SAAKD,MACHA,IAAW,IAAIE,EAAAA,IAEVF;AACT;AAMA,MAAME,EAAc;AAAA,EAUlBC,cAAc;AATNC,IAAAA,EAAAA,mBAAmC;AACnCC,IAAAA,EAAAA,sBAAsC;AACtCC,IAAAA,EAAAA,mBAAmC;AACnCC,IAAAA,EAAAA,2CAAqEC,IAAAA;AACrEC,IAAAA,EAAAA,yCAA8DD,IAAAA;AAC9DE,IAAAA,EAAAA,iDAA+CF,IAAAA;AAC/CG,IAAAA,EAAAA,eAAQ;AACRC,IAAAA,EAAAA,sBAA+E,CAAA;AAGrF,IAAI,OAAOC,WAAa,QAExB,KAAKT,YAAYS,SAASC,cAAc,KAAK,GAC7C,KAAKV,UAAUW,QAAQC,gBAAgB,QACvC,KAAKZ,UAAUa,YAAYpB,GAE3B,KAAKQ,eAAe,KAAKa,UAAU,WAAW,GAC9C,KAAKZ,YAAY,KAAKY,UAAU,QAAQ,GAExC,KAAKd,UAAUe,YAAY,KAAKd,YAAY,GAC5C,KAAKD,UAAUe,YAAY,KAAKb,SAAS,GAGzCO,SAASO,KAAKC,QAAQ,KAAKjB,SAAS,GAKhC,KAAKkB,sBACP,KAAKX,QAAQ,KAEbY,WAAW,MAAM;AACf,WAAKZ,QAAQ,IACb,KAAKa,kBAAAA;AAAAA,IACP,GAAGC,GAAiB;AAAA,EAExB;AAAA;AAAA;AAAA;AAAA,EAMAC,SAASC,GAAiBC,IAA2B,IAAU;AAC7D,UAAMC,IAAsC;AAAA,MAC1CC,eAAeF,EAAQE,iBAAiB;AAAA,MACxCC,SAASH,EAAQG,WAAWC;AAAAA,MAC5BC,SAASL,EAAQK,WAAW;AAAA,MAC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@
|
|
|
1
|
-
|
|
1
|
+
import o, { useEffect as t, useMemo as c, createContext as u } from "react";
|
|
2
|
+
import { announce as e, destroyAnnouncer as a, clearAnnouncer as l } from "./index75.js";
|
|
3
|
+
const i = /* @__PURE__ */ u(null), f = ({
|
|
4
|
+
children: n
|
|
5
|
+
}) => {
|
|
6
|
+
t(() => (e(""), () => {
|
|
7
|
+
a();
|
|
8
|
+
}), []);
|
|
9
|
+
const r = c(() => ({
|
|
10
|
+
announce: e,
|
|
11
|
+
clear: l
|
|
12
|
+
}), []);
|
|
13
|
+
return /* @__PURE__ */ o.createElement(i.Provider, {
|
|
14
|
+
value: r
|
|
15
|
+
}, n);
|
|
16
|
+
};
|
|
2
17
|
export {
|
|
3
|
-
|
|
18
|
+
i as LiveAnnouncerContext,
|
|
19
|
+
f as LiveAnnouncerProvider
|
|
4
20
|
};
|
|
5
21
|
//# sourceMappingURL=index76.js.map
|
package/dist/index76.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index76.js","sources":["../src/
|
|
1
|
+
{"version":3,"file":"index76.js","sources":["../src/utils/a11y/liveAnnouncer/LiveAnnouncerProvider.tsx"],"sourcesContent":["import React, { createContext, useEffect, useMemo } from 'react';\nimport {\n announce,\n clearAnnouncer,\n destroyAnnouncer,\n type AnnounceOptions,\n type Assertiveness,\n} from './LiveAnnouncer';\n\n// ---------------------------------------------------------------------------\n// Context\n// ---------------------------------------------------------------------------\n\nexport interface LiveAnnouncerContextValue {\n announce: (message: string, options?: AnnounceOptions) => void;\n clear: (assertiveness?: Assertiveness) => void;\n}\n\nexport const LiveAnnouncerContext = createContext<LiveAnnouncerContextValue | null>(null);\n\n// ---------------------------------------------------------------------------\n// Provider\n// ---------------------------------------------------------------------------\n\nexport interface LiveAnnouncerProviderProps {\n children: React.ReactNode;\n}\n\n/**\n * Mounts the singleton live-region container on mount and tears it down on\n * unmount. Provides `{ announce, clear }` via React context so descendants\n * can use the `useLiveAnnouncer` hook.\n *\n * Optional — `announce()` works without a provider (the singleton auto-creates\n * on first call). The provider simply gives you explicit lifecycle control.\n *\n * @example\n * <LiveAnnouncerProvider>\n * <App />\n * </LiveAnnouncerProvider>\n */\nexport const LiveAnnouncerProvider: React.FC<LiveAnnouncerProviderProps> = ({ children }) => {\n // Trigger singleton creation on mount (if not already created).\n // The announce import already lazily creates, but calling it with an empty\n // string ensures the container is in the DOM before any child renders.\n useEffect(() => {\n // Force singleton init by importing — the constructor runs on getInstance().\n // We don't announce anything; just ensure the container exists.\n announce('');\n return () => {\n destroyAnnouncer();\n };\n }, []);\n\n const value = useMemo<LiveAnnouncerContextValue>(\n () => ({ announce, clear: clearAnnouncer }),\n []\n );\n\n return (\n <LiveAnnouncerContext.Provider value={value}>\n {children}\n </LiveAnnouncerContext.Provider>\n );\n};\n"],"names":["React__default","useEffect","useMemo","createContext","announce","destroyAnnouncer","clearAnnouncer","LiveAnnouncerContext","LiveAnnouncerProvider","children","value","clear","React","createElement","Provider"],"mappings":"AAkBO,OAAAA,KAAA,aAAAC,GAAA,WAAAC,GAAA,iBAAAC,SAAA;AAAA,SAAA,YAAAC,GAAA,oBAAAC,GAAA,kBAAAC,SAAA;AAAA,MAAMC,sBAAuE,IAAI,GAuB3EC,IAA8DA,CAAC;AAAA,EAAEC,UAAAA;AAAS,MAAM;AAI3FR,EAAAA,EAAU,OAGRG,EAAS,EAAE,GACJ,MAAM;AACXC,IAAAA,EAAAA;AAAAA,EACF,IACC,CAAA,CAAE;AAEL,QAAMK,IAAQR,EACZ,OAAO;AAAA,IAAEE,UAAAA;AAAAA,IAAUO,OAAOL;AAAAA,EAAAA,IAC1B,CAAA,CACF;AAEA,SACEM,gBAAAA,EAAAC,cAACN,EAAqBO,UAAQ;AAAA,IAACJ,OAAAA;AAAAA,EAAAA,GAC5BD,CAC4B;AAEnC;"}
|
package/dist/index77.js
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
import { useContext as t, useMemo as c } from "react";
|
|
2
|
+
import { clearAnnouncer as u, announce as m } from "./index75.js";
|
|
3
|
+
import { LiveAnnouncerContext as a } from "./index76.js";
|
|
4
|
+
function l() {
|
|
5
|
+
const o = t(a), e = c(() => ({
|
|
6
|
+
announce: (n, r) => m(n, r ?? {}),
|
|
7
|
+
clear: (n) => u(n)
|
|
8
|
+
}), []);
|
|
9
|
+
return o ?? e;
|
|
10
|
+
}
|
|
2
11
|
export {
|
|
3
|
-
|
|
12
|
+
l as useLiveAnnouncer
|
|
4
13
|
};
|
|
5
14
|
//# sourceMappingURL=index77.js.map
|
package/dist/index77.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index77.js","sources":["../src/
|
|
1
|
+
{"version":3,"file":"index77.js","sources":["../src/utils/a11y/liveAnnouncer/useLiveAnnouncer.ts"],"sourcesContent":["import { useContext, useMemo } from 'react';\nimport {\n announce,\n clearAnnouncer,\n type AnnounceOptions,\n type Assertiveness,\n} from './LiveAnnouncer';\nimport { LiveAnnouncerContext, type LiveAnnouncerContextValue } from './LiveAnnouncerProvider';\n\n/**\n * React hook that returns `{ announce, clear }`.\n *\n * Uses the LiveAnnouncerProvider context if available; otherwise falls back\n * to the module-level singleton (which auto-creates on first call).\n *\n * @example\n * const { announce } = useLiveAnnouncer();\n * announce('Document saved');\n * announce('Upload failed', { assertiveness: 'assertive' });\n * announce('5 results', { batchId: 'search-count' });\n */\nexport function useLiveAnnouncer(): LiveAnnouncerContextValue {\n const fromContext = useContext(LiveAnnouncerContext);\n\n const fallback = useMemo<LiveAnnouncerContextValue>(\n () => ({\n announce: (message: string, options?: AnnounceOptions) => announce(message, options ?? {}),\n clear: (assertiveness?: Assertiveness) => clearAnnouncer(assertiveness),\n }),\n []\n );\n\n return fromContext ?? fallback;\n}\n"],"names":["useContext","useMemo","clearAnnouncer","announce","LiveAnnouncerContext","useLiveAnnouncer","fromContext","fallback","message","options","clear","assertiveness"],"mappings":"AAqBO,SAAA,cAAAA,GAAA,WAAAC,SAAA;AAAA,SAAA,kBAAAC,GAAA,YAAAC,SAAA;AAAA,SAAA,wBAAAC,SAAA;AAAA,SAASC,IAA8C;AAC5D,QAAMC,IAAcN,EAAWI,CAAoB,GAE7CG,IAAWN,EACf,OAAO;AAAA,IACLE,UAAUA,CAACK,GAAiBC,MAA8BN,EAASK,GAASC,KAAW,EAAE;AAAA,IACzFC,OAAOA,CAACC,MAAkCT,EAAeS,CAAa;AAAA,EAAA,IAExE,CAAA,CACF;AAEA,SAAOL,KAAeC;AACxB;"}
|
package/dist/index78.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
const
|
|
1
|
+
const t = () => typeof navigator < "u" && /Android/i.test(navigator.userAgent), o = (i) => {
|
|
2
|
+
const r = "pointerType" in i ? i.pointerType : void 0;
|
|
3
|
+
return r === "" && i.isTrusted ? !0 : t() && r ? i.type === "click" && i.buttons === 1 : i.detail === 0 && !r;
|
|
4
|
+
};
|
|
2
5
|
export {
|
|
3
|
-
|
|
6
|
+
o as isVirtualClick
|
|
4
7
|
};
|
|
5
8
|
//# sourceMappingURL=index78.js.map
|
package/dist/index78.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index78.js","sources":["../src/
|
|
1
|
+
{"version":3,"file":"index78.js","sources":["../src/utils/virtualClick.ts"],"sourcesContent":["/**\n * Input/virtual click detection helpers.\n */\n\nconst isAndroid = () =>\n typeof navigator !== 'undefined' && /Android/i.test(navigator.userAgent);\n\nexport const isVirtualClick = (event: MouseEvent | PointerEvent): boolean => {\n const pointerType = 'pointerType' in event ? event.pointerType : undefined;\n\n // JAWS/NVDA with Firefox.\n if (pointerType === '' && event.isTrusted) {\n return true;\n }\n\n // Android TalkBack's detail value varies depending on listener type.\n if (isAndroid() && pointerType) {\n return event.type === 'click' && event.buttons === 1;\n }\n\n // Most browsers: virtual click has detail === 0 and no pointerType.\n return event.detail === 0 && !pointerType;\n};\n\n\n"],"names":["isAndroid","navigator","test","userAgent","isVirtualClick","event","pointerType","undefined","isTrusted","type","buttons","detail"],"mappings":"AAIA,MAAMA,IAAYA,MAChB,OAAOC,YAAc,OAAe,WAAWC,KAAKD,UAAUE,SAAS,GAE5DC,IAAiBA,CAACC,MAA8C;AAC3E,QAAMC,IAAc,iBAAiBD,IAAQA,EAAMC,cAAcC;AAGjE,SAAID,MAAgB,MAAMD,EAAMG,YACvB,KAILR,EAAAA,KAAeM,IACVD,EAAMI,SAAS,WAAWJ,EAAMK,YAAY,IAI9CL,EAAMM,WAAW,KAAK,CAACL;AAChC;"}
|
package/dist/index79.js
CHANGED
|
@@ -1,5 +1,59 @@
|
|
|
1
|
-
|
|
1
|
+
import { useState as w, useEffect as x, useCallback as k } from "react";
|
|
2
|
+
import { useScrollActiveIntoView as v } from "./index247.js";
|
|
3
|
+
function y({
|
|
4
|
+
items: u,
|
|
5
|
+
isOpen: t,
|
|
6
|
+
onSelect: l,
|
|
7
|
+
onClose: i,
|
|
8
|
+
onOpen: n,
|
|
9
|
+
loop: c = !0,
|
|
10
|
+
disabled: b = !1,
|
|
11
|
+
listboxRef: D,
|
|
12
|
+
optionSelector: d = '[role="option"]',
|
|
13
|
+
keepHighlightOnSelect: h = !1,
|
|
14
|
+
closeOnTab: g = !0
|
|
15
|
+
}) {
|
|
16
|
+
const [f, a] = w(-1);
|
|
17
|
+
x(() => {
|
|
18
|
+
t || a(-1);
|
|
19
|
+
}, [t]), v({
|
|
20
|
+
containerRef: D,
|
|
21
|
+
activeIndex: f,
|
|
22
|
+
itemSelector: d,
|
|
23
|
+
enabled: t
|
|
24
|
+
});
|
|
25
|
+
const m = k((r) => {
|
|
26
|
+
if (b) {
|
|
27
|
+
r.key === "Escape" && t && (r.preventDefault(), i());
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const e = u.length;
|
|
31
|
+
switch (r.key) {
|
|
32
|
+
case "ArrowDown":
|
|
33
|
+
r.preventDefault(), r.stopPropagation(), !t && e > 0 ? (n?.(), a(0)) : t && e > 0 && a((o) => c ? (o + 1) % e : Math.min(o + 1, e - 1));
|
|
34
|
+
break;
|
|
35
|
+
case "ArrowUp":
|
|
36
|
+
r.preventDefault(), r.stopPropagation(), t && e > 0 && a((o) => o === -1 ? e - 1 : c ? (o - 1 + e) % e : Math.max(o - 1, 0));
|
|
37
|
+
break;
|
|
38
|
+
case "Enter":
|
|
39
|
+
r.preventDefault(), t ? f >= 0 && u[f] && (l(u[f], f), h || a(-1)) : (n?.(), a(0));
|
|
40
|
+
break;
|
|
41
|
+
case "Escape":
|
|
42
|
+
t && (r.preventDefault(), i(), a(-1));
|
|
43
|
+
break;
|
|
44
|
+
case "Tab":
|
|
45
|
+
t && g && (i(), a(-1));
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
}, [b, u, t, f, l, i, n, c, h, g]), s = k((r, e) => `${r}-option-${e}`, []);
|
|
49
|
+
return {
|
|
50
|
+
highlightedIndex: f,
|
|
51
|
+
setHighlightedIndex: a,
|
|
52
|
+
handleKeyDown: m,
|
|
53
|
+
getOptionId: s
|
|
54
|
+
};
|
|
55
|
+
}
|
|
2
56
|
export {
|
|
3
|
-
|
|
57
|
+
y as useComboboxNavigation
|
|
4
58
|
};
|
|
5
59
|
//# sourceMappingURL=index79.js.map
|
package/dist/index79.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index79.js","sources":["../src/
|
|
1
|
+
{"version":3,"file":"index79.js","sources":["../src/utils/a11y/useComboboxNavigation.ts"],"sourcesContent":["import { useCallback, useState, useEffect } from 'react';\nimport type { RefObject } from 'react';\nimport { useScrollActiveIntoView } from './useScrollActiveIntoView';\n\nexport interface UseComboboxNavigationOptions<T = any> {\n /**\n * Array of items to navigate through\n */\n items: T[];\n \n /**\n * Whether the dropdown is currently open\n */\n isOpen: boolean;\n \n /**\n * Callback when an item is selected (Enter key)\n */\n onSelect: (item: T, index: number) => void;\n \n /**\n * Callback to close the dropdown\n */\n onClose: () => void;\n \n /**\n * Optional: Callback to open the dropdown\n */\n onOpen?: () => void;\n \n /**\n * Whether to wrap around at the ends of the list.\n * Default: true\n */\n loop?: boolean;\n \n /**\n * Whether keyboard navigation is disabled\n * (e.g., for custom rendered content)\n */\n disabled?: boolean;\n\n /**\n * Whether to keep the highlighted index after selecting an item.\n * Useful for multi-select where the dropdown stays open after selection.\n * Default: false\n */\n keepHighlightOnSelect?: boolean;\n\n /**\n * Whether Tab should close the dropdown.\n * Set to false when Tab should move focus to elements within the popup (e.g. CTAs).\n * Default: true\n */\n closeOnTab?: boolean;\n\n /**\n * Ref to the listbox container for scroll management\n */\n listboxRef?: RefObject<HTMLElement | null>;\n \n /**\n * CSS selector for option elements (default: '[role=\"option\"]')\n */\n optionSelector?: string;\n}\n\nexport interface UseComboboxNavigationReturn {\n /**\n * Currently highlighted index (-1 if none)\n */\n highlightedIndex: number;\n \n /**\n * Set the highlighted index manually\n */\n setHighlightedIndex: (index: number | ((prev: number) => number)) => void;\n \n /**\n * Keyboard event handler for the combobox input\n */\n handleKeyDown: (e: React.KeyboardEvent) => void;\n \n /**\n * Generate stable ID for an option\n */\n getOptionId: (listboxId: string, index: number) => string;\n \n}\n\n/**\n * Hook for managing combobox keyboard navigation with aria-activedescendant.\n * \n * Implements WAI-ARIA 1.2 Combobox pattern:\n * - Arrow Up/Down to navigate options\n * - Enter to select highlighted option\n * - Escape to close dropdown\n * - Tab to close and move focus\n * - Auto-scrolls highlighted option into view\n * \n * @example\n * ```tsx\n * const { \n * highlightedIndex, \n * handleKeyDown, \n * getOptionId \n * } = useComboboxNavigation({\n * items: suggestions,\n * isOpen: isDropdownOpen,\n * onSelect: (item, idx) => handleSelect(item),\n * onClose: () => setIsOpen(false),\n * listboxRef\n * });\n * \n * <input\n * role=\"combobox\"\n * onKeyDown={handleKeyDown}\n * aria-activedescendant={highlightedIndex >= 0 ? getOptionId(listboxId, highlightedIndex) : undefined}\n * />\n * ```\n */\nexport function useComboboxNavigation<T = any>({\n items,\n isOpen,\n onSelect,\n onClose,\n onOpen,\n loop = true,\n disabled = false,\n listboxRef,\n optionSelector = '[role=\"option\"]',\n keepHighlightOnSelect = false,\n closeOnTab = true\n}: UseComboboxNavigationOptions<T>): UseComboboxNavigationReturn {\n const [highlightedIndex, setHighlightedIndex] = useState<number>(-1);\n \n // Reset highlighted index when dropdown closes\n useEffect(() => {\n if (!isOpen) {\n setHighlightedIndex(-1);\n }\n }, [isOpen]);\n \n // Auto-scroll highlighted item into view\n useScrollActiveIntoView({\n containerRef: listboxRef,\n activeIndex: highlightedIndex,\n itemSelector: optionSelector,\n enabled: isOpen\n });\n \n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (disabled) {\n // For disabled navigation, still handle Escape\n if (e.key === 'Escape' && isOpen) {\n e.preventDefault();\n onClose();\n }\n return;\n }\n \n const itemCount = items.length;\n \n switch (e.key) {\n case 'ArrowDown':\n e.preventDefault();\n e.stopPropagation();\n if (!isOpen && itemCount > 0) {\n // Open dropdown and highlight first item\n onOpen?.();\n setHighlightedIndex(0);\n } else if (isOpen && itemCount > 0) {\n // Navigate down\n setHighlightedIndex((prev) => {\n if (loop) {\n return (prev + 1) % itemCount;\n }\n return Math.min(prev + 1, itemCount - 1);\n });\n }\n break;\n\n case 'ArrowUp':\n e.preventDefault();\n e.stopPropagation();\n if (isOpen && itemCount > 0) {\n // Navigate up\n setHighlightedIndex((prev) => {\n // If nothing highlighted, go to last item\n if (prev === -1) {\n return itemCount - 1;\n }\n if (loop) {\n return (prev - 1 + itemCount) % itemCount;\n }\n return Math.max(prev - 1, 0);\n });\n }\n break;\n \n case 'Enter':\n e.preventDefault();\n if (!isOpen) {\n onOpen?.();\n setHighlightedIndex(0);\n } else if (highlightedIndex >= 0 && items[highlightedIndex]) {\n onSelect(items[highlightedIndex], highlightedIndex);\n if (!keepHighlightOnSelect) {\n setHighlightedIndex(-1);\n }\n }\n break;\n\n case 'Escape':\n if (isOpen) {\n e.preventDefault();\n onClose();\n setHighlightedIndex(-1);\n }\n break;\n \n case 'Tab':\n // closeOnTab=true (default): close dropdown and let focus move to next element\n // closeOnTab=false: keep dropdown open so Tab reaches CTAs (Clear/Apply)\n if (isOpen && closeOnTab) {\n onClose();\n setHighlightedIndex(-1);\n }\n break;\n }\n },\n [disabled, items, isOpen, highlightedIndex, onSelect, onClose, onOpen, loop, keepHighlightOnSelect, closeOnTab]\n );\n \n const getOptionId = useCallback(\n (listboxId: string, index: number) => `${listboxId}-option-${index}`,\n []\n );\n \n return {\n highlightedIndex,\n setHighlightedIndex,\n handleKeyDown,\n getOptionId\n };\n}\n"],"names":["useState","useEffect","useCallback","useScrollActiveIntoView","useComboboxNavigation","items","isOpen","onSelect","onClose","onOpen","loop","disabled","listboxRef","optionSelector","keepHighlightOnSelect","closeOnTab","highlightedIndex","setHighlightedIndex","containerRef","activeIndex","itemSelector","enabled","handleKeyDown","e","key","preventDefault","itemCount","length","stopPropagation","prev","Math","min","max","getOptionId","listboxId","index"],"mappings":"AAyHO,SAAA,YAAAA,GAAA,aAAAC,GAAA,eAAAC,SAAA;AAAA,SAAA,2BAAAC,SAAA;AAAA,SAASC,EAA+B;AAAA,EAC7CC,OAAAA;AAAAA,EACAC,QAAAA;AAAAA,EACAC,UAAAA;AAAAA,EACAC,SAAAA;AAAAA,EACAC,QAAAA;AAAAA,EACAC,MAAAA,IAAO;AAAA,EACPC,UAAAA,IAAW;AAAA,EACXC,YAAAA;AAAAA,EACAC,gBAAAA,IAAiB;AAAA,EACjBC,uBAAAA,IAAwB;AAAA,EACxBC,YAAAA,IAAa;AACkB,GAAgC;AAC/D,QAAM,CAACC,GAAkBC,CAAmB,IAAIjB,EAAiB,EAAE;AAGnEC,EAAAA,EAAU,MAAM;AACd,IAAKK,KACHW,EAAoB,EAAE;AAAA,EAE1B,GAAG,CAACX,CAAM,CAAC,GAGXH,EAAwB;AAAA,IACtBe,cAAcN;AAAAA,IACdO,aAAaH;AAAAA,IACbI,cAAcP;AAAAA,IACdQ,SAASf;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CAACgC,GAAmBC,MAAkB,GAAGD,CAAS,WAAWC,CAAK,IAClE,CAAA,CACF;AAEA,SAAO;AAAA,IACLnB,kBAAAA;AAAAA,IACAC,qBAAAA;AAAAA,IACAK,eAAAA;AAAAA,IACAW,aAAAA;AAAAA,EAAAA;AAEJ;"}
|
package/dist/index8.js
CHANGED
|
@@ -1,26 +1,56 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import t, { useState as u } from "react";
|
|
2
|
+
import { MenuList as d } from "./index18.js";
|
|
3
|
+
function l() {
|
|
4
|
+
return l = Object.assign ? Object.assign.bind() : function(o) {
|
|
5
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
6
|
+
var n = arguments[e];
|
|
7
|
+
for (var a in n) ({}).hasOwnProperty.call(n, a) && (o[a] = n[a]);
|
|
8
|
+
}
|
|
9
|
+
return o;
|
|
10
|
+
}, l.apply(null, arguments);
|
|
11
|
+
}
|
|
12
|
+
const g = (o) => {
|
|
3
13
|
const {
|
|
4
14
|
label: e,
|
|
5
|
-
|
|
6
|
-
textColor: t = "var(--color-gray-700)",
|
|
7
|
-
bgColor: r = "var(--color-blue-300)",
|
|
8
|
-
textTransform: l = "none",
|
|
9
|
-
fontWeight: n = "",
|
|
10
|
-
automationId: s = ""
|
|
11
|
-
} = o;
|
|
12
|
-
return /* @__PURE__ */ c.createElement("span", {
|
|
13
|
-
className: `se-design-badge inline-block px-1 text-sm rounded leading-5 ${a}`,
|
|
14
|
-
style: {
|
|
15
|
-
color: t,
|
|
16
|
-
backgroundColor: r,
|
|
17
|
-
textTransform: l,
|
|
18
|
-
fontWeight: n
|
|
15
|
+
onDropdownClick: n = () => {
|
|
19
16
|
},
|
|
17
|
+
menuItems: a = [],
|
|
18
|
+
automationId: s = "",
|
|
19
|
+
...i
|
|
20
|
+
} = o, [r, m] = u(!1), c = () => {
|
|
21
|
+
m(!r), n();
|
|
22
|
+
};
|
|
23
|
+
return /* @__PURE__ */ t.createElement("div", {
|
|
24
|
+
className: "se-design-split-button flex items-center relative",
|
|
20
25
|
"data-automation-id": s
|
|
21
|
-
},
|
|
26
|
+
}, /* @__PURE__ */ t.createElement("button", l({
|
|
27
|
+
type: "button",
|
|
28
|
+
className: "px-8 py-2.5 rounded-l text-sm bg-[var(--color-blue-500)] text-[var(--color-white)] border-r border-[var(--color-white)]"
|
|
29
|
+
}, i), e), /* @__PURE__ */ t.createElement("button", {
|
|
30
|
+
type: "button",
|
|
31
|
+
className: "bg-[var(--color-blue-500)] rounded-r",
|
|
32
|
+
onClick: c,
|
|
33
|
+
"data-automation-id": "split-button-dropdown-button"
|
|
34
|
+
}, /* @__PURE__ */ t.createElement("svg", {
|
|
35
|
+
className: `${r ? "rotate-180" : ""} transition-all`,
|
|
36
|
+
width: "35",
|
|
37
|
+
height: "40",
|
|
38
|
+
viewBox: "0 0 35 40",
|
|
39
|
+
fill: "none",
|
|
40
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
41
|
+
}, /* @__PURE__ */ t.createElement("path", {
|
|
42
|
+
d: "M0 0H32C33.6569 0 35 1.34315 35 3V37C35 38.6569 33.6569 40 32 40H0V0Z",
|
|
43
|
+
fill: "transparent"
|
|
44
|
+
}), /* @__PURE__ */ t.createElement("path", {
|
|
45
|
+
d: "M18 23.5L14 19.5L22 19.5L18 23.5Z",
|
|
46
|
+
fill: "white"
|
|
47
|
+
}))), r && /* @__PURE__ */ t.createElement("div", {
|
|
48
|
+
className: "absolute top-full mt-1 w-max"
|
|
49
|
+
}, /* @__PURE__ */ t.createElement(d, {
|
|
50
|
+
items: a
|
|
51
|
+
})));
|
|
22
52
|
};
|
|
23
53
|
export {
|
|
24
|
-
|
|
54
|
+
g as SplitButton
|
|
25
55
|
};
|
|
26
56
|
//# sourceMappingURL=index8.js.map
|
package/dist/index8.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index8.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"index8.js","sources":["../src/components/SplitButton/index.tsx"],"sourcesContent":["import React, { FC, useState } from 'react';\nimport { MenuItemProps } from 'src/components/MenuItem';\nimport { MenuList } from 'src/components/MenuList';\n\nexport interface SplitButtonProps {\n /**\n * Button contents\n */\n label: string;\n /**\n * Optional click handler\n */\n onClick?: () => void;\n /**\n * Optional click handler for dropdown\n */\n onDropdownClick?: () => void;\n menuItems?: MenuItemProps[];\n /**\n * Automation ID for testing\n */\n automationId?: string;\n}\n\nexport const SplitButton: FC<SplitButtonProps> = (props) => {\n const { label, onDropdownClick = () => {}, menuItems = [], automationId = '', ...remainingProps } = props;\n const [isOpen, setIsOpen] = useState(false);\n\n const handleDropdownClick = () => {\n setIsOpen(!isOpen);\n onDropdownClick();\n };\n\n return (\n <div className={'se-design-split-button flex items-center relative'} data-automation-id={automationId}>\n <button\n type=\"button\"\n className=\"px-8 py-2.5 rounded-l text-sm bg-[var(--color-blue-500)] text-[var(--color-white)] border-r border-[var(--color-white)]\"\n {...remainingProps}\n >\n {label}\n </button>\n <button type=\"button\" className=\"bg-[var(--color-blue-500)] rounded-r\" onClick={handleDropdownClick} data-automation-id=\"split-button-dropdown-button\">\n <svg\n className={`${isOpen ? 'rotate-180' : ''} transition-all`}\n width=\"35\"\n height=\"40\"\n viewBox=\"0 0 35 40\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M0 0H32C33.6569 0 35 1.34315 35 3V37C35 38.6569 33.6569 40 32 40H0V0Z\" fill=\"transparent\" />\n <path d=\"M18 23.5L14 19.5L22 19.5L18 23.5Z\" fill=\"white\" />\n </svg>\n </button>\n {isOpen && (\n <div className=\"absolute top-full mt-1 w-max\">\n <MenuList items={menuItems} />\n </div>\n )}\n </div>\n );\n};\n"],"names":["SplitButton","props","label","onDropdownClick","menuItems","automationId","remainingProps","isOpen","setIsOpen","useState","handleDropdownClick","React","createElement","className","_extends","type","onClick","width","height","viewBox","fill","xmlns","d","MenuList","items"],"mappings":";;;;;;;;;;;AAwBO,MAAM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/index80.js
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
|
-
|
|
1
|
+
import * as e from "react";
|
|
2
|
+
function m({
|
|
3
|
+
disabled: r = !1,
|
|
4
|
+
onFocusIn: n,
|
|
5
|
+
onFocusOut: u,
|
|
6
|
+
onEscape: c,
|
|
7
|
+
closeOnEscape: a = !0
|
|
8
|
+
}) {
|
|
9
|
+
const f = e.useCallback((t) => {
|
|
10
|
+
r || n?.();
|
|
11
|
+
}, [r, n]), o = e.useRef(null), i = e.useCallback((t) => {
|
|
12
|
+
if (r) return;
|
|
13
|
+
o.current = t.currentTarget;
|
|
14
|
+
const s = t.relatedTarget;
|
|
15
|
+
s && t.currentTarget.contains(s) || requestAnimationFrame(() => {
|
|
16
|
+
o.current?.contains(document.activeElement) || u?.();
|
|
17
|
+
});
|
|
18
|
+
}, [r, u]), l = e.useCallback((t) => {
|
|
19
|
+
r || !a || t.key !== "Escape" || (t.preventDefault(), c?.());
|
|
20
|
+
}, [r, a, c]);
|
|
21
|
+
return {
|
|
22
|
+
onFocusCapture: f,
|
|
23
|
+
onBlurCapture: i,
|
|
24
|
+
onKeyDownCapture: l
|
|
25
|
+
};
|
|
26
|
+
}
|
|
2
27
|
export {
|
|
3
|
-
|
|
28
|
+
m as useDismissOnFocusOut
|
|
4
29
|
};
|
|
5
30
|
//# sourceMappingURL=index80.js.map
|
package/dist/index80.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index80.js","sources":["../src/
|
|
1
|
+
{"version":3,"file":"index80.js","sources":["../src/utils/a11y/useDismissOnFocusOut.ts"],"sourcesContent":["import * as React from 'react';\n\nexport type UseDismissOnFocusOutOptions = {\n /**\n * Disable all handlers (no-ops). Useful when a component provides alternate\n * focus/keyboard behavior (e.g., disabled-trigger tooltip wrapper).\n */\n disabled?: boolean;\n /**\n * Called when focus enters anywhere within the target.\n */\n onFocusIn?: () => void;\n /**\n * Called when focus leaves the target (i.e., focus moves to an element\n * outside the currentTarget).\n */\n onFocusOut?: () => void;\n /**\n * Called when Escape is pressed while focus is within the target.\n */\n onEscape?: () => void;\n /**\n * Whether Escape should trigger dismissal. Default: true.\n */\n closeOnEscape?: boolean;\n};\n\nexport type UseDismissOnFocusOutReturn<T extends HTMLElement = HTMLElement> = {\n onFocusCapture: (e: React.FocusEvent<T>) => void;\n onBlurCapture: (e: React.FocusEvent<T>) => void;\n onKeyDownCapture: (e: React.KeyboardEvent<T>) => void;\n};\n\n/**\n * Returns capture-phase handlers to \"show on focus within\" and \"dismiss on focus out\",\n * with optional Escape-to-dismiss.\n *\n * Intended for non-interactive surfaces like tooltips where content should remain\n * visible while focus stays within the wrapper.\n */\nexport function useDismissOnFocusOut<T extends HTMLElement = HTMLElement>({\n disabled = false,\n onFocusIn,\n onFocusOut,\n onEscape,\n closeOnEscape = true\n}: UseDismissOnFocusOutOptions): UseDismissOnFocusOutReturn<T> {\n const onFocusCapture = React.useCallback(\n (_e: React.FocusEvent<T>) => {\n if (disabled) return;\n onFocusIn?.();\n },\n [disabled, onFocusIn]\n );\n\n const containerRef = React.useRef<T | null>(null);\n\n const onBlurCapture = React.useCallback(\n (e: React.FocusEvent<T>) => {\n if (disabled) return;\n\n // Capture the container element for the async check — e.currentTarget\n // is only valid synchronously during this event handler.\n containerRef.current = e.currentTarget;\n\n const nextFocused = e.relatedTarget as Node | null;\n if (nextFocused && e.currentTarget.contains(nextFocused)) return;\n\n // Defer the close check: when focus transitions between elements inside\n // the container (e.g. a React re-render replaces a focused DOM node),\n // relatedTarget can be null transiently. By the next frame the browser\n // has settled activeElement, so we re-check containment before closing.\n requestAnimationFrame(() => {\n if (containerRef.current?.contains(document.activeElement)) return;\n onFocusOut?.();\n });\n },\n [disabled, onFocusOut]\n );\n\n const onKeyDownCapture = React.useCallback(\n (e: React.KeyboardEvent<T>) => {\n if (disabled || !closeOnEscape || e.key !== 'Escape') return;\n\n e.preventDefault();\n onEscape?.();\n },\n [disabled, closeOnEscape, onEscape]\n );\n\n return { onFocusCapture, onBlurCapture, onKeyDownCapture };\n}\n\n"],"names":["React","useDismissOnFocusOut","disabled","onFocusIn","onFocusOut","onEscape","closeOnEscape","onFocusCapture","useCallback","_e","containerRef","useRef","onBlurCapture","e","current","currentTarget","nextFocused","relatedTarget","contains","requestAnimationFrame","document","activeElement","onKeyDownCapture","key","preventDefault"],"mappings":"AAwCO,YAAAA,OAAA;AAAA,SAASC,EAA0D;AAAA,EACxEC,UAAAA,IAAW;AAAA,EACXC,WAAAA;AAAAA,EACAC,YAAAA;AAAAA,EACAC,UAAAA;AAAAA,EACAC,eAAAA,IAAgB;AACW,GAAkC;AAC7D,QAAMC,IAAiBP,EAAMQ,YAC3B,CAACC,MAA4B;AAC3B,IAAIP,KACJC,IAAAA;AAAAA,EACF,GACA,CAACD,GAAUC,CAAS,CACtB,GAEMO,IAAeV,EAAMW,OAAiB,IAAI,GAE1CC,IAAgBZ,EAAMQ,YAC1B,CAACK,MAA2B;AAC1B,QAAIX,EAAU;AAIdQ,IAAAA,EAAaI,UAAUD,EAAEE;AAEzB,UAAMC,IAAcH,EAAEI;AACtB,IAAID,KAAeH,EAAEE,cAAcG,SAASF,CAAW,KAMvDG,sBAAsB,MAAM;AAC1B,MAAIT,EAAaI,SAASI,SAASE,SAASC,aAAa,KACzDjB,IAAAA;AAAAA,IACF,CAAC;AAAA,EACH,GACA,CAACF,GAAUE,CAAU,CACvB,GAEMkB,IAAmBtB,EAAMQ,YAC7B,CAACK,MAA8B;AAC7B,IAAIX,KAAY,CAACI,KAAiBO,EAAEU,QAAQ,aAE5CV,EAAEW,eAAAA,GACFnB,IAAAA;AAAAA,EACF,GACA,CAACH,GAAUI,GAAeD,CAAQ,CACpC;AAEA,SAAO;AAAA,IAAEE,gBAAAA;AAAAA,IAAgBK,eAAAA;AAAAA,IAAeU,kBAAAA;AAAAA,EAAAA;AAC1C;"}
|
package/dist/index81.js
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
function f({
|
|
2
|
+
ariaLabel: e,
|
|
3
|
+
ariaLabelledBy: i,
|
|
4
|
+
ariaDescribedBy: r
|
|
5
|
+
}) {
|
|
6
|
+
const t = {};
|
|
7
|
+
return i ? t["aria-labelledby"] = i : e && (t["aria-label"] = e), r && (t["aria-describedby"] = r), t;
|
|
8
|
+
}
|
|
2
9
|
export {
|
|
3
|
-
|
|
10
|
+
f as getA11yNameAttributes
|
|
4
11
|
};
|
|
5
12
|
//# sourceMappingURL=index81.js.map
|
package/dist/index81.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index81.js","sources":["../src/
|
|
1
|
+
{"version":3,"file":"index81.js","sources":["../src/utils/a11y/accessibleName.ts"],"sourcesContent":["/**\n * Accessible name/description utilities following WCAG precedence rules.\n * \n * **When to use:**\n * - `ariaLabelledBy`: visible label exists (preferred - keeps SR and visual text in sync)\n * - `ariaLabel`: no visible label (e.g., icon-only buttons)\n * - `ariaDescribedBy`: additional context needed (warnings, hints, constraints)\n * \n * **Precedence:** ariaLabelledBy > ariaLabel > visible text content\n * \n * @example Icon-only button\n * ```tsx\n * <Button iconProps={{ name: 'close' }} ariaLabel=\"Close dialog\" />\n * ```\n * \n * @example Disambiguate generic labels\n * ```tsx\n * <Button label=\"Edit\" ariaLabel=\"Edit name\" />\n * <Button label=\"Edit\" ariaLabel=\"Edit email\" />\n * ```\n */\n\nexport type AccessibleNameInput = {\n /** Accessible name when no visible label exists (icon-only buttons). */\n ariaLabel?: string;\n /** ID(s) of visible element(s) that label this control. Preferred over ariaLabel. */\n ariaLabelledBy?: string;\n /** ID(s) of element(s) providing additional description (additive). */\n ariaDescribedBy?: string;\n};\n\n/**\n * Returns ARIA attributes with correct precedence.\n * Prefer ariaLabelledBy > ariaLabel. ariaDescribedBy is always additive.\n */\nexport function getA11yNameAttributes({\n ariaLabel,\n ariaLabelledBy,\n ariaDescribedBy\n}: AccessibleNameInput): Record<string, string> {\n const props: Record<string, string> = {};\n\n if (ariaLabelledBy) props['aria-labelledby'] = ariaLabelledBy;\n else if (ariaLabel) props['aria-label'] = ariaLabel;\n\n if (ariaDescribedBy) props['aria-describedby'] = ariaDescribedBy;\n\n return props;\n}\n"],"names":["getA11yNameAttributes","ariaLabel","ariaLabelledBy","ariaDescribedBy","props"],"mappings":"AAmCO,SAASA,EAAsB;AAAA,EACpCC,WAAAA;AAAAA,EACAC,gBAAAA;AAAAA,EACAC,iBAAAA;AACmB,GAA2B;AAC9C,QAAMC,IAAgC,CAAA;AAEtC,SAAIF,IAAgBE,EAAM,iBAAiB,IAAIF,IACtCD,MAAWG,EAAM,YAAY,IAAIH,IAEtCE,MAAiBC,EAAM,kBAAkB,IAAID,IAE1CC;AACT;"}
|