@12-apps/ui 6.29.0 → 6.30.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/NATIVE.md +1 -1
- package/components-catalog.md +7 -0
- package/dist/_internal/components/data-display/Avatar/Avatar.js +4 -4
- package/dist/_internal/components/data-display/Avatar/Avatar.view.js +2 -2
- package/dist/_internal/components/data-display/Badge/Badge.js +2 -2
- package/dist/_internal/components/data-display/CardKit/CardKebab.js +3 -3
- package/dist/_internal/components/data-display/CardKit/use-remove-confirm.js +4 -4
- package/dist/_internal/components/data-display/CardKit/use-row-confirm.js +4 -4
- package/dist/_internal/components/data-display/Carousel/Carousel.js +3 -3
- package/dist/_internal/components/data-display/Chart/Chart.js +4 -4
- package/dist/_internal/components/data-display/Chart/SpecChart.js +8 -8
- package/dist/_internal/components/data-display/Chart/chart-context.js +2 -2
- package/dist/_internal/components/data-display/Chart/chart-renderers.js +3 -3
- package/dist/_internal/components/data-display/Chart/chart-spec.js +2 -2
- package/dist/_internal/components/data-display/DataGrid/DataGrid.js +2 -2
- package/dist/_internal/components/data-display/DataViews/DataViewsGrid.js +40 -40
- package/dist/_internal/components/data-display/DataViews/DataViewsTableBase.js +52 -52
- package/dist/_internal/components/data-display/DataViews/DeleteViewDialog.js +6 -6
- package/dist/_internal/components/data-display/DataViews/ManageViewsDialog.js +8 -8
- package/dist/_internal/components/data-display/DataViews/SaveViewModal.js +6 -6
- package/dist/_internal/components/data-display/DataViews/base-card.js +2 -2
- package/dist/_internal/components/data-display/DataViews/base-list-card-geometry.js +5 -5
- package/dist/_internal/components/data-display/DataViews/base-list-card-slots.js +4 -4
- package/dist/_internal/components/data-display/DataViews/base-list-card.js +7 -7
- package/dist/_internal/components/data-display/DataViews/data-views-category-pill.js +4 -4
- package/dist/_internal/components/data-display/DataViews/data-views-columns.js +4 -4
- package/dist/_internal/components/data-display/DataViews/data-views-display-panel.js +7 -7
- package/dist/_internal/components/data-display/DataViews/data-views-display-tabs.js +3 -3
- package/dist/_internal/components/data-display/DataViews/data-views-empty.js +3 -3
- package/dist/_internal/components/data-display/DataViews/data-views-export.js +3 -3
- package/dist/_internal/components/data-display/DataViews/data-views-filter-panel.js +7 -7
- package/dist/_internal/components/data-display/DataViews/data-views-grid-bodies.js +10 -10
- package/dist/_internal/components/data-display/DataViews/data-views-grid-helpers.js +3 -3
- package/dist/_internal/components/data-display/DataViews/data-views-grid-parts.js +35 -35
- package/dist/_internal/components/data-display/DataViews/data-views-inline-bar.js +11 -11
- package/dist/_internal/components/data-display/DataViews/data-views-layout-context.js +2 -2
- package/dist/_internal/components/data-display/DataViews/data-views-more-fields.js +4 -4
- package/dist/_internal/components/data-display/DataViews/data-views-more-filters.js +7 -7
- package/dist/_internal/components/data-display/DataViews/data-views-range-pill.js +2 -2
- package/dist/_internal/components/data-display/DataViews/data-views-scope-tabs.js +3 -3
- package/dist/_internal/components/data-display/DataViews/data-views-select-all-strip.js +3 -3
- package/dist/_internal/components/data-display/DataViews/data-views-shell-toolbar.js +12 -12
- package/dist/_internal/components/data-display/DataViews/data-views-table-parts.js +11 -11
- package/dist/_internal/components/data-display/DataViews/data-views-toolbar.js +11 -11
- package/dist/_internal/components/data-display/DataViews/data-views-view-nav.js +3 -3
- package/dist/_internal/components/data-display/DataViews/list-card-rails.js +3 -3
- package/dist/_internal/components/data-display/DataViews/use-data-views-state.js +7 -7
- package/dist/_internal/components/data-display/DataViews/use-saved-views-controller.js +2 -2
- package/dist/_internal/components/data-display/FleetMap/FleetBody.js +10 -10
- package/dist/_internal/components/data-display/FleetMap/FleetCanvas.js +9 -9
- package/dist/_internal/components/data-display/FleetMap/FleetMap.fixtures.js +2 -2
- package/dist/_internal/components/data-display/FleetMap/FleetMap.js +12 -12
- package/dist/_internal/components/data-display/HoverCard/HoverCard.js +2 -2
- package/dist/_internal/components/data-display/Lightbox/Lightbox.js +6 -6
- package/dist/_internal/components/data-display/MapPreview/MapLayers.js +2 -2
- package/dist/_internal/components/data-display/MapPreview/MapMarkers.js +2 -2
- package/dist/_internal/components/data-display/MapPreview/MapPreview.js +8 -8
- package/dist/_internal/components/data-display/Progress/Progress.js +2 -2
- package/dist/_internal/components/data-display/Sheet/Sheet.hooks.js +2 -2
- package/dist/_internal/components/data-display/Sheet/Sheet.js +4 -4
- package/dist/_internal/components/data-display/Table/Table.js +2 -2
- package/dist/_internal/components/data-display/index.js +56 -56
- package/dist/_internal/components/feedback/ConfirmAction/ConfirmButton.js +3 -3
- package/dist/_internal/components/feedback/Dialog/Dialog.js +2 -2
- package/dist/_internal/components/feedback/Modal/Modal.js +2 -2
- package/dist/_internal/components/feedback/NotificationStatusNotice/NotificationStatusNotice.helpers.js +12 -0
- package/dist/_internal/components/feedback/NotificationStatusNotice/NotificationStatusNotice.js +24 -0
- package/dist/_internal/components/feedback/NotificationStatusNotice/NotificationStatusNotice.js.map +1 -0
- package/dist/_internal/components/feedback/NotificationStatusNotice/NotificationStatusNotice.metrics.js +12 -0
- package/dist/_internal/components/feedback/NotificationStatusNotice/NotificationStatusNotice.metrics.js.map +1 -0
- package/dist/_internal/components/feedback/NotificationStatusNotice/NotificationStatusNotice.types.js +1 -0
- package/dist/_internal/components/feedback/NotificationStatusNotice/NotificationStatusNotice.types.js.map +1 -0
- package/dist/_internal/components/feedback/index.js +35 -19
- package/dist/_internal/components/form/AddressAutocomplete/AddressAutocomplete.hooks.js +2 -2
- package/dist/_internal/components/form/AddressAutocomplete/AddressAutocomplete.js +6 -6
- package/dist/_internal/components/form/AddressAutocomplete/AddressAutocompleteField.js +3 -3
- package/dist/_internal/components/form/Button/Button.js +2 -2
- package/dist/_internal/components/form/Calendar/Calendar.hooks.js +2 -2
- package/dist/_internal/components/form/Calendar/Calendar.js +3 -3
- package/dist/_internal/components/form/CategorySelect/CategorySelect.js +2 -2
- package/dist/_internal/components/form/CodeEditor/CodeEditor.js +2 -2
- package/dist/_internal/components/form/DateRangePicker/DateRangePicker.js +4 -4
- package/dist/_internal/components/form/InputOTP/InputOTP.js +2 -2
- package/dist/_internal/components/form/Menubar/Menubar.js +2 -2
- package/dist/_internal/components/form/UploadButton/UploadButton.js +2 -2
- package/dist/_internal/components/form/index.js +46 -46
- package/dist/_internal/components/form/total-form/Fields/CategoryField.js +3 -3
- package/dist/_internal/components/form/total-form/Fields/index.js +7 -7
- package/dist/_internal/components/form/total-form/SubmitButton.js +3 -3
- package/dist/_internal/components/index.js +173 -161
- package/dist/_internal/components/layout/ScrollArea/ScrollArea.js +1 -1
- package/dist/_internal/components/layout/SettingsLayout/SettingsLayout.js +4 -4
- package/dist/_internal/components/layout/SettingsLayout/SettingsPanel.js +2 -2
- package/dist/_internal/components/layout/index.js +18 -18
- package/dist/_internal/components/navigation/AppHeader/AppHeader.details.js +10 -10
- package/dist/_internal/components/navigation/NavigationMenu/NavigationMegaSection.js +2 -2
- package/dist/_internal/components/navigation/NavigationMenu/NavigationMenu.js +4 -4
- package/dist/_internal/components/navigation/NavigationMenu/NavigationStandardBody.js +2 -2
- package/dist/_internal/components/navigation/index.js +22 -22
- package/dist/_internal/components/utility/InstallPrompt/InstallPrompt.js +3 -3
- package/dist/_internal/components/utility/InstallPrompt/usePwaInstall.js +2 -2
- package/dist/_internal/components/utility/index.js +17 -17
- package/dist/_internal/en-US.data-display.js +2 -2
- package/dist/_internal/en-US.feedback.js +3 -1
- package/dist/_internal/icons/Icon.js +2 -2
- package/dist/_internal/pt-BR.feedback.js +3 -1
- package/dist/_internal/social-login-button/social-login-button.js +4 -4
- package/dist/_internal/user-avatar/user-avatar.js +8 -8
- package/dist/charts.js +17 -17
- package/dist/{chunk-W5CW7JFZ.js → chunk-22ZJH7RY.js} +2 -2
- package/dist/{chunk-JRWPI4XF.js → chunk-23FCBIUN.js} +4 -4
- package/dist/{chunk-HQB5XNK5.js → chunk-2UBFDRL7.js} +2 -2
- package/dist/{chunk-HS2OJI6L.js → chunk-35UG2QDB.js} +7 -7
- package/dist/{chunk-4H4Y2SX3.js → chunk-3MALHTZQ.js} +2 -2
- package/dist/chunk-3MEIGSDK.js +88 -0
- package/dist/chunk-3MEIGSDK.js.map +1 -0
- package/dist/{chunk-PVIAHB7D.js → chunk-3XLDTVLC.js} +6 -6
- package/dist/{chunk-5UC2RNOY.js → chunk-4MXFPDKL.js} +4 -4
- package/dist/{chunk-OJCK5RNJ.js → chunk-4XVH6IWN.js} +2 -2
- package/dist/{chunk-ALAJBLBE.js → chunk-554SVTCN.js} +3 -3
- package/dist/chunk-55FFONIV.js +11 -0
- package/dist/chunk-55FFONIV.js.map +1 -0
- package/dist/{chunk-3BPDHWVF.js → chunk-57W2C7HY.js} +4 -4
- package/dist/{chunk-XGOWREVV.js → chunk-57ZSQB5V.js} +2 -2
- package/dist/{chunk-P3NRT6GV.js → chunk-62NA6IF3.js} +4 -4
- package/dist/{chunk-J2K65BQQ.js → chunk-6FUOUUYO.js} +3 -3
- package/dist/{chunk-MVJYIHPH.js → chunk-6IKX5IIX.js} +3 -3
- package/dist/{chunk-QGAYEBMU.js → chunk-6PKVHFCK.js} +8 -8
- package/dist/chunk-6YIKVXAV.js +1 -0
- package/dist/chunk-6YIKVXAV.js.map +1 -0
- package/dist/{chunk-G5ZVD5IJ.js → chunk-7AR2R7TV.js} +4 -4
- package/dist/{chunk-XBZ43VIV.js → chunk-7IKWIWWV.js} +7 -7
- package/dist/{chunk-YFY3YVV6.js → chunk-7OZBOS75.js} +3 -3
- package/dist/chunk-ASHXIAJO.js +88 -0
- package/dist/chunk-ASHXIAJO.js.map +1 -0
- package/dist/{chunk-NGVGTMHT.js → chunk-B474PL5O.js} +2 -2
- package/dist/{chunk-TX3ZHO5R.js → chunk-BEGWE5O4.js} +4 -4
- package/dist/{chunk-NGM5XKAS.js → chunk-BILJU2DX.js} +5 -5
- package/dist/{chunk-GJUIZ5FN.js → chunk-BKAB4KZK.js} +4 -4
- package/dist/{chunk-HKV4MQ2W.js → chunk-BLBOYCOV.js} +5 -5
- package/dist/{chunk-NY2Y2SHA.js → chunk-CASZGBCA.js} +4 -4
- package/dist/{chunk-UN5INW6K.js → chunk-CZJLWCEG.js} +2 -2
- package/dist/{chunk-WYDGPJ3Z.js → chunk-CZPU5TW3.js} +4 -4
- package/dist/{chunk-TC3EPGGJ.js → chunk-DAPK3ADA.js} +4 -4
- package/dist/{chunk-QZBUGUOY.js → chunk-DFLTUI7W.js} +4 -4
- package/dist/{chunk-PJTSGHTY.js → chunk-DQOLW4B5.js} +2 -2
- package/dist/{chunk-FR6AJSMT.js → chunk-DUWF5LUK.js} +4 -4
- package/dist/{chunk-SHDIZSN5.js → chunk-EXJBPKGW.js} +5 -5
- package/dist/{chunk-MHSTG7FF.js → chunk-EZMCWRXO.js} +2 -2
- package/dist/{chunk-BYMWW65P.js → chunk-FGUK3D54.js} +2 -2
- package/dist/{chunk-PCYGUOWJ.js → chunk-FLIMEQUA.js} +7 -7
- package/dist/{chunk-TEE6HNHS.js → chunk-FRW4SYZD.js} +4 -4
- package/dist/{chunk-R6SBP5M5.js → chunk-GOWBYHYW.js} +4 -4
- package/dist/{chunk-THOPGHTY.js → chunk-HGJHZ5PE.js} +7 -7
- package/dist/{chunk-K4N3V7YE.js → chunk-HR7YTBR7.js} +4 -4
- package/dist/{chunk-PZEC5CQA.js → chunk-HT4B2DJU.js} +4 -4
- package/dist/{chunk-EMAX7RPN.js → chunk-HZ6L7WXE.js} +7 -7
- package/dist/{chunk-BEWD734I.js → chunk-I3FXTIKA.js} +2 -2
- package/dist/{chunk-JE6RZ5L6.js → chunk-IABE56TG.js} +2 -2
- package/dist/{chunk-B443IIQG.js → chunk-IE7ISTLQ.js} +4 -4
- package/dist/{chunk-LKF5KQ2Q.js → chunk-IIUB4IOH.js} +4 -4
- package/dist/{chunk-2ZRZTGWP.js → chunk-ISW5K72V.js} +5 -5
- package/dist/{chunk-JOXBCXVL.js → chunk-J4W4TQPC.js} +9 -9
- package/dist/{chunk-K7DCYV5Q.js → chunk-JGV66VUK.js} +2 -2
- package/dist/{chunk-QPDDS6DQ.js → chunk-JJ3VR7WX.js} +2 -2
- package/dist/{chunk-DVE53B2L.js → chunk-JQL4GG5L.js} +7 -7
- package/dist/chunk-JQRKXMSH.js +1 -0
- package/dist/chunk-JQRKXMSH.js.map +1 -0
- package/dist/{chunk-EZNTM6PT.js → chunk-JYF3HT7M.js} +7 -7
- package/dist/{chunk-H53YNR23.js → chunk-K2EHH7TC.js} +5 -5
- package/dist/{chunk-FOKBP6HR.js → chunk-K2JH7QPR.js} +10 -10
- package/dist/chunk-K4JRHQMI.js +109 -0
- package/dist/chunk-K4JRHQMI.js.map +1 -0
- package/dist/{chunk-VRKS5K4N.js → chunk-K5V3KCFI.js} +4 -4
- package/dist/{chunk-LSJY4LWZ.js → chunk-KFZT3PHA.js} +3 -3
- package/dist/{chunk-DVUPIVI2.js → chunk-KT6HWAEN.js} +4 -4
- package/dist/{chunk-EYC6ERJJ.js → chunk-KUJLZFDW.js} +3 -3
- package/dist/chunk-L7BRU4UF.js +39 -0
- package/dist/chunk-L7BRU4UF.js.map +1 -0
- package/dist/{chunk-O42ZA3TW.js → chunk-MCBG6R5A.js} +2 -2
- package/dist/{chunk-MNSW33DU.js → chunk-MSS6IU5X.js} +3 -3
- package/dist/{chunk-VLHGBFR6.js → chunk-MZQTHSLN.js} +3 -3
- package/dist/{chunk-XELVDPKL.js → chunk-NFAKRI4S.js} +4 -4
- package/dist/{chunk-7TZ6OC5T.js → chunk-OH3YGJT5.js} +2 -2
- package/dist/{chunk-ZTZ6S5Q6.js → chunk-OXQP3N6X.js} +4 -4
- package/dist/{chunk-XSJWN3WH.js → chunk-PMS3H3OO.js} +10 -10
- package/dist/{chunk-IQ7WZ3RN.js → chunk-Q5NAZ7TW.js} +2 -2
- package/dist/{chunk-SOCKK67R.js → chunk-QRX5BYUQ.js} +7 -7
- package/dist/{chunk-OLZTGVBT.js → chunk-REMK55JI.js} +4 -4
- package/dist/{chunk-5GMHJ7Y5.js → chunk-S2GDYA6R.js} +5 -5
- package/dist/{chunk-YEWCIMPZ.js → chunk-SUTNQG7E.js} +15 -4
- package/dist/chunk-SUTNQG7E.js.map +1 -0
- package/dist/{chunk-TTW4MAOJ.js → chunk-UCTJJYVC.js} +5 -5
- package/dist/{chunk-BLT5ZBVL.js → chunk-UEJQQVP2.js} +4 -4
- package/dist/{chunk-236QP424.js → chunk-URVNHKM2.js} +5 -5
- package/dist/{chunk-4OSGKO7E.js → chunk-UVD5NFRF.js} +2 -2
- package/dist/{chunk-TSFFZ3AH.js → chunk-VEGT5PAD.js} +17 -17
- package/dist/{chunk-UKPZVX3J.js → chunk-VJFH2AXT.js} +2 -2
- package/dist/{chunk-XXJRT6BP.js → chunk-VMXDTCYF.js} +6 -6
- package/dist/{chunk-HDNK7BAX.js → chunk-VNEEXUWA.js} +3 -3
- package/dist/{chunk-XOCLWQON.js → chunk-VNGYJXAU.js} +3 -3
- package/dist/{chunk-KW7H5O3K.js → chunk-WREIYOXN.js} +4 -4
- package/dist/{chunk-EPNUVSNK.js → chunk-XFUNJYFT.js} +7 -7
- package/dist/{chunk-QSKJLMNS.js → chunk-Y5UCOBQN.js} +2 -2
- package/dist/{chunk-D6HDJVQW.js → chunk-YANLN6HP.js} +5 -5
- package/dist/{chunk-JVVTSSS4.js → chunk-Z52HVR4J.js} +2 -2
- package/dist/{chunk-WC3W36AM.js → chunk-ZOUWHGV3.js} +4 -4
- package/dist/{chunk-M7E66OSC.js → chunk-ZPIMPOHV.js} +4 -4
- package/dist/{chunk-LCXXPIG3.js → chunk-ZWIDQEJ4.js} +4 -4
- package/dist/{chunk-MRMNVGNX.js → chunk-ZYKDPX3W.js} +2 -2
- package/dist/data-display/Avatar.js +4 -4
- package/dist/data-display/Badge.js +2 -2
- package/dist/data-display/CardKit.js +10 -10
- package/dist/data-display/Carousel.js +3 -3
- package/dist/data-display/Chart.js +17 -17
- package/dist/data-display/DataGrid.js +2 -2
- package/dist/data-display/DataViews.js +69 -69
- package/dist/data-display/FleetMap.js +12 -12
- package/dist/data-display/HoverCard.js +2 -2
- package/dist/data-display/Lightbox.js +6 -6
- package/dist/data-display/MapPreview.js +8 -8
- package/dist/data-display/Progress.js +2 -2
- package/dist/data-display/Sheet.js +4 -4
- package/dist/data-display/Table.js +2 -2
- package/dist/en-US.js +7 -5
- package/dist/feedback/ConfirmAction.js +6 -6
- package/dist/feedback/Dialog.js +2 -2
- package/dist/feedback/Modal.js +2 -2
- package/dist/feedback/NotificationStatusNotice.js +30 -0
- package/dist/feedback/NotificationStatusNotice.js.map +1 -0
- package/dist/form/AddressAutocomplete.js +6 -6
- package/dist/form/Button.js +2 -2
- package/dist/form/Calendar.js +3 -3
- package/dist/form/CategorySelect.js +2 -2
- package/dist/form/CodeEditor.js +2 -2
- package/dist/form/DateRangePicker.js +4 -4
- package/dist/form/InputOTP.js +2 -2
- package/dist/form/Menubar.js +2 -2
- package/dist/form/UploadButton.js +2 -2
- package/dist/form/total-form.js +10 -10
- package/dist/icons.js +2 -2
- package/dist/layout/ContentToolbar.js +3 -3
- package/dist/layout/ScrollArea.js +1 -1
- package/dist/layout/SettingsLayout.js +4 -4
- package/dist/locales.js +10 -10
- package/dist/navigation/AppHeader.js +12 -12
- package/dist/navigation/NavigationMenu.js +4 -4
- package/dist/pt-BR.js +7 -5
- package/dist/social-login-button.js +4 -4
- package/dist/types/components/feedback/NotificationStatusNotice/NotificationStatusNotice.d.ts +13 -0
- package/dist/types/components/feedback/NotificationStatusNotice/NotificationStatusNotice.d.ts.map +1 -0
- package/dist/types/components/feedback/NotificationStatusNotice/NotificationStatusNotice.helpers.d.ts +28 -0
- package/dist/types/components/feedback/NotificationStatusNotice/NotificationStatusNotice.helpers.d.ts.map +1 -0
- package/dist/types/components/feedback/NotificationStatusNotice/NotificationStatusNotice.metrics.d.ts +7 -0
- package/dist/types/components/feedback/NotificationStatusNotice/NotificationStatusNotice.metrics.d.ts.map +1 -0
- package/dist/types/components/feedback/NotificationStatusNotice/NotificationStatusNotice.types.d.ts +64 -0
- package/dist/types/components/feedback/NotificationStatusNotice/NotificationStatusNotice.types.d.ts.map +1 -0
- package/dist/types/components/feedback/NotificationStatusNotice/index.d.ts +4 -0
- package/dist/types/components/feedback/NotificationStatusNotice/index.d.ts.map +1 -0
- package/dist/types/components/feedback/index.d.ts +1 -0
- package/dist/types/components/feedback/index.d.ts.map +1 -1
- package/dist/types/copy/feedback.d.ts +43 -0
- package/dist/types/copy/feedback.d.ts.map +1 -1
- package/dist/types/en-US.feedback.d.ts +2 -1
- package/dist/types/en-US.feedback.d.ts.map +1 -1
- package/dist/types/pt-BR.feedback.d.ts +2 -1
- package/dist/types/pt-BR.feedback.d.ts.map +1 -1
- package/dist/types/social-login-button/social-login-button.d.ts.map +1 -1
- package/dist/user-avatar.js +8 -8
- package/dist/utility/InstallPrompt.js +4 -4
- package/package.json +5 -1
- package/src/components/feedback/NotificationStatusNotice/NotificationStatusNotice.helpers.ts +80 -0
- package/src/components/feedback/NotificationStatusNotice/NotificationStatusNotice.md +106 -0
- package/src/components/feedback/NotificationStatusNotice/NotificationStatusNotice.metrics.ts +8 -0
- package/src/components/feedback/NotificationStatusNotice/NotificationStatusNotice.tsx +134 -0
- package/src/components/feedback/NotificationStatusNotice/NotificationStatusNotice.types.ts +83 -0
- package/src/components/feedback/NotificationStatusNotice/index.ts +16 -0
- package/src/components/feedback/NotificationStatusNotice/tests.md +24 -0
- package/src/components/feedback/NotificationStatusNotice/track.md +34 -0
- package/src/components/feedback/index.ts +1 -0
- package/src/copy/feedback.ts +28 -0
- package/src/en-US.feedback.ts +69 -0
- package/src/pt-BR.feedback.ts +69 -0
- package/src/social-login-button/social-login-button.tsx +43 -0
- package/dist/chunk-E5ACI7EA.js +0 -22
- package/dist/chunk-E5ACI7EA.js.map +0 -1
- package/dist/chunk-IFLZNCAI.js +0 -22
- package/dist/chunk-IFLZNCAI.js.map +0 -1
- package/dist/chunk-SO2J7ULY.js +0 -1
- package/dist/chunk-YEWCIMPZ.js.map +0 -1
- /package/dist/{chunk-SO2J7ULY.js.map → _internal/components/feedback/NotificationStatusNotice/NotificationStatusNotice.helpers.js.map} +0 -0
- /package/dist/{chunk-W5CW7JFZ.js.map → chunk-22ZJH7RY.js.map} +0 -0
- /package/dist/{chunk-JRWPI4XF.js.map → chunk-23FCBIUN.js.map} +0 -0
- /package/dist/{chunk-HQB5XNK5.js.map → chunk-2UBFDRL7.js.map} +0 -0
- /package/dist/{chunk-HS2OJI6L.js.map → chunk-35UG2QDB.js.map} +0 -0
- /package/dist/{chunk-4H4Y2SX3.js.map → chunk-3MALHTZQ.js.map} +0 -0
- /package/dist/{chunk-PVIAHB7D.js.map → chunk-3XLDTVLC.js.map} +0 -0
- /package/dist/{chunk-5UC2RNOY.js.map → chunk-4MXFPDKL.js.map} +0 -0
- /package/dist/{chunk-OJCK5RNJ.js.map → chunk-4XVH6IWN.js.map} +0 -0
- /package/dist/{chunk-ALAJBLBE.js.map → chunk-554SVTCN.js.map} +0 -0
- /package/dist/{chunk-3BPDHWVF.js.map → chunk-57W2C7HY.js.map} +0 -0
- /package/dist/{chunk-XGOWREVV.js.map → chunk-57ZSQB5V.js.map} +0 -0
- /package/dist/{chunk-P3NRT6GV.js.map → chunk-62NA6IF3.js.map} +0 -0
- /package/dist/{chunk-J2K65BQQ.js.map → chunk-6FUOUUYO.js.map} +0 -0
- /package/dist/{chunk-MVJYIHPH.js.map → chunk-6IKX5IIX.js.map} +0 -0
- /package/dist/{chunk-QGAYEBMU.js.map → chunk-6PKVHFCK.js.map} +0 -0
- /package/dist/{chunk-G5ZVD5IJ.js.map → chunk-7AR2R7TV.js.map} +0 -0
- /package/dist/{chunk-XBZ43VIV.js.map → chunk-7IKWIWWV.js.map} +0 -0
- /package/dist/{chunk-YFY3YVV6.js.map → chunk-7OZBOS75.js.map} +0 -0
- /package/dist/{chunk-NGVGTMHT.js.map → chunk-B474PL5O.js.map} +0 -0
- /package/dist/{chunk-TX3ZHO5R.js.map → chunk-BEGWE5O4.js.map} +0 -0
- /package/dist/{chunk-NGM5XKAS.js.map → chunk-BILJU2DX.js.map} +0 -0
- /package/dist/{chunk-GJUIZ5FN.js.map → chunk-BKAB4KZK.js.map} +0 -0
- /package/dist/{chunk-HKV4MQ2W.js.map → chunk-BLBOYCOV.js.map} +0 -0
- /package/dist/{chunk-NY2Y2SHA.js.map → chunk-CASZGBCA.js.map} +0 -0
- /package/dist/{chunk-UN5INW6K.js.map → chunk-CZJLWCEG.js.map} +0 -0
- /package/dist/{chunk-WYDGPJ3Z.js.map → chunk-CZPU5TW3.js.map} +0 -0
- /package/dist/{chunk-TC3EPGGJ.js.map → chunk-DAPK3ADA.js.map} +0 -0
- /package/dist/{chunk-QZBUGUOY.js.map → chunk-DFLTUI7W.js.map} +0 -0
- /package/dist/{chunk-PJTSGHTY.js.map → chunk-DQOLW4B5.js.map} +0 -0
- /package/dist/{chunk-FR6AJSMT.js.map → chunk-DUWF5LUK.js.map} +0 -0
- /package/dist/{chunk-SHDIZSN5.js.map → chunk-EXJBPKGW.js.map} +0 -0
- /package/dist/{chunk-MHSTG7FF.js.map → chunk-EZMCWRXO.js.map} +0 -0
- /package/dist/{chunk-BYMWW65P.js.map → chunk-FGUK3D54.js.map} +0 -0
- /package/dist/{chunk-PCYGUOWJ.js.map → chunk-FLIMEQUA.js.map} +0 -0
- /package/dist/{chunk-TEE6HNHS.js.map → chunk-FRW4SYZD.js.map} +0 -0
- /package/dist/{chunk-R6SBP5M5.js.map → chunk-GOWBYHYW.js.map} +0 -0
- /package/dist/{chunk-THOPGHTY.js.map → chunk-HGJHZ5PE.js.map} +0 -0
- /package/dist/{chunk-K4N3V7YE.js.map → chunk-HR7YTBR7.js.map} +0 -0
- /package/dist/{chunk-PZEC5CQA.js.map → chunk-HT4B2DJU.js.map} +0 -0
- /package/dist/{chunk-EMAX7RPN.js.map → chunk-HZ6L7WXE.js.map} +0 -0
- /package/dist/{chunk-BEWD734I.js.map → chunk-I3FXTIKA.js.map} +0 -0
- /package/dist/{chunk-JE6RZ5L6.js.map → chunk-IABE56TG.js.map} +0 -0
- /package/dist/{chunk-B443IIQG.js.map → chunk-IE7ISTLQ.js.map} +0 -0
- /package/dist/{chunk-LKF5KQ2Q.js.map → chunk-IIUB4IOH.js.map} +0 -0
- /package/dist/{chunk-2ZRZTGWP.js.map → chunk-ISW5K72V.js.map} +0 -0
- /package/dist/{chunk-JOXBCXVL.js.map → chunk-J4W4TQPC.js.map} +0 -0
- /package/dist/{chunk-K7DCYV5Q.js.map → chunk-JGV66VUK.js.map} +0 -0
- /package/dist/{chunk-QPDDS6DQ.js.map → chunk-JJ3VR7WX.js.map} +0 -0
- /package/dist/{chunk-DVE53B2L.js.map → chunk-JQL4GG5L.js.map} +0 -0
- /package/dist/{chunk-EZNTM6PT.js.map → chunk-JYF3HT7M.js.map} +0 -0
- /package/dist/{chunk-H53YNR23.js.map → chunk-K2EHH7TC.js.map} +0 -0
- /package/dist/{chunk-FOKBP6HR.js.map → chunk-K2JH7QPR.js.map} +0 -0
- /package/dist/{chunk-VRKS5K4N.js.map → chunk-K5V3KCFI.js.map} +0 -0
- /package/dist/{chunk-LSJY4LWZ.js.map → chunk-KFZT3PHA.js.map} +0 -0
- /package/dist/{chunk-DVUPIVI2.js.map → chunk-KT6HWAEN.js.map} +0 -0
- /package/dist/{chunk-EYC6ERJJ.js.map → chunk-KUJLZFDW.js.map} +0 -0
- /package/dist/{chunk-O42ZA3TW.js.map → chunk-MCBG6R5A.js.map} +0 -0
- /package/dist/{chunk-MNSW33DU.js.map → chunk-MSS6IU5X.js.map} +0 -0
- /package/dist/{chunk-VLHGBFR6.js.map → chunk-MZQTHSLN.js.map} +0 -0
- /package/dist/{chunk-XELVDPKL.js.map → chunk-NFAKRI4S.js.map} +0 -0
- /package/dist/{chunk-7TZ6OC5T.js.map → chunk-OH3YGJT5.js.map} +0 -0
- /package/dist/{chunk-ZTZ6S5Q6.js.map → chunk-OXQP3N6X.js.map} +0 -0
- /package/dist/{chunk-XSJWN3WH.js.map → chunk-PMS3H3OO.js.map} +0 -0
- /package/dist/{chunk-IQ7WZ3RN.js.map → chunk-Q5NAZ7TW.js.map} +0 -0
- /package/dist/{chunk-SOCKK67R.js.map → chunk-QRX5BYUQ.js.map} +0 -0
- /package/dist/{chunk-OLZTGVBT.js.map → chunk-REMK55JI.js.map} +0 -0
- /package/dist/{chunk-5GMHJ7Y5.js.map → chunk-S2GDYA6R.js.map} +0 -0
- /package/dist/{chunk-TTW4MAOJ.js.map → chunk-UCTJJYVC.js.map} +0 -0
- /package/dist/{chunk-BLT5ZBVL.js.map → chunk-UEJQQVP2.js.map} +0 -0
- /package/dist/{chunk-236QP424.js.map → chunk-URVNHKM2.js.map} +0 -0
- /package/dist/{chunk-4OSGKO7E.js.map → chunk-UVD5NFRF.js.map} +0 -0
- /package/dist/{chunk-TSFFZ3AH.js.map → chunk-VEGT5PAD.js.map} +0 -0
- /package/dist/{chunk-UKPZVX3J.js.map → chunk-VJFH2AXT.js.map} +0 -0
- /package/dist/{chunk-XXJRT6BP.js.map → chunk-VMXDTCYF.js.map} +0 -0
- /package/dist/{chunk-HDNK7BAX.js.map → chunk-VNEEXUWA.js.map} +0 -0
- /package/dist/{chunk-XOCLWQON.js.map → chunk-VNGYJXAU.js.map} +0 -0
- /package/dist/{chunk-KW7H5O3K.js.map → chunk-WREIYOXN.js.map} +0 -0
- /package/dist/{chunk-EPNUVSNK.js.map → chunk-XFUNJYFT.js.map} +0 -0
- /package/dist/{chunk-QSKJLMNS.js.map → chunk-Y5UCOBQN.js.map} +0 -0
- /package/dist/{chunk-D6HDJVQW.js.map → chunk-YANLN6HP.js.map} +0 -0
- /package/dist/{chunk-JVVTSSS4.js.map → chunk-Z52HVR4J.js.map} +0 -0
- /package/dist/{chunk-WC3W36AM.js.map → chunk-ZOUWHGV3.js.map} +0 -0
- /package/dist/{chunk-M7E66OSC.js.map → chunk-ZPIMPOHV.js.map} +0 -0
- /package/dist/{chunk-LCXXPIG3.js.map → chunk-ZWIDQEJ4.js.map} +0 -0
- /package/dist/{chunk-MRMNVGNX.js.map → chunk-ZYKDPX3W.js.map} +0 -0
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import "../chunk-3QQVEYOR.js";
|
|
2
2
|
import {
|
|
3
3
|
InstallPrompt
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-IABE56TG.js";
|
|
5
5
|
import {
|
|
6
6
|
usePwaInstall
|
|
7
|
-
} from "../chunk-
|
|
8
|
-
import "../chunk-GY62N32G.js";
|
|
9
|
-
import "../chunk-WXYLH3QZ.js";
|
|
7
|
+
} from "../chunk-S2GDYA6R.js";
|
|
10
8
|
import {
|
|
11
9
|
PWA_INSTALL_AVAILABLE_EVENT,
|
|
12
10
|
PWA_INSTALL_STASH_KEY,
|
|
@@ -14,6 +12,8 @@ import {
|
|
|
14
12
|
readPwaInstallStash,
|
|
15
13
|
resetPwaInstallStash
|
|
16
14
|
} from "../chunk-UUL44SUX.js";
|
|
15
|
+
import "../chunk-GY62N32G.js";
|
|
16
|
+
import "../chunk-WXYLH3QZ.js";
|
|
17
17
|
import "../chunk-PZ5AY32C.js";
|
|
18
18
|
export {
|
|
19
19
|
InstallPrompt,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@12-apps/ui",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.30.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"packageManager": "pnpm@10.34.5",
|
|
6
6
|
"type": "module",
|
|
@@ -312,6 +312,10 @@
|
|
|
312
312
|
"types": "./dist/types/components/feedback/Modal/index.d.ts",
|
|
313
313
|
"default": "./dist/feedback/Modal.js"
|
|
314
314
|
},
|
|
315
|
+
"./feedback/NotificationStatusNotice": {
|
|
316
|
+
"types": "./dist/types/components/feedback/NotificationStatusNotice/index.d.ts",
|
|
317
|
+
"default": "./dist/feedback/NotificationStatusNotice.js"
|
|
318
|
+
},
|
|
315
319
|
"./feedback/Sonner": {
|
|
316
320
|
"types": "./dist/types/components/feedback/Sonner/index.d.ts",
|
|
317
321
|
"default": "./dist/feedback/Sonner.js"
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { NotificationUnblockCopy } from '../../../copy';
|
|
2
|
+
import type { AlertVariant } from '../../data-display/Alert/Alert.types';
|
|
3
|
+
|
|
4
|
+
import type {
|
|
5
|
+
NotificationBrowser,
|
|
6
|
+
NotificationBrowserFamily,
|
|
7
|
+
NotificationPlatform,
|
|
8
|
+
NotificationStatus,
|
|
9
|
+
} from './NotificationStatusNotice.types';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* How loud each status is.
|
|
13
|
+
*
|
|
14
|
+
* `disabled` and `blocked` are warnings because the reader can do something
|
|
15
|
+
* about them and will miss something if they do not. `unavailable` is only
|
|
16
|
+
* information: there is nothing to act on, and painting it amber would ask the
|
|
17
|
+
* reader to fix what they cannot.
|
|
18
|
+
*/
|
|
19
|
+
export const NOTICE_VARIANT: Record<NotificationStatus, AlertVariant> = {
|
|
20
|
+
enabled: 'success',
|
|
21
|
+
disabled: 'warning',
|
|
22
|
+
blocked: 'warning',
|
|
23
|
+
unavailable: 'info',
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const platformOf = (userAgent: string, maxTouchPoints: number): NotificationPlatform => {
|
|
27
|
+
if (/iphone|ipad|ipod/i.test(userAgent)) return 'ios';
|
|
28
|
+
// iPadOS asks for the desktop site and reports itself as a Mac; the touch
|
|
29
|
+
// points are what give it away.
|
|
30
|
+
if (/macintosh/i.test(userAgent) && maxTouchPoints > 1) return 'ios';
|
|
31
|
+
if (/android/i.test(userAgent)) return 'android';
|
|
32
|
+
return 'desktop';
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Ordered most-specific first: every Chromium browser also says `Chrome`, and
|
|
37
|
+
* every browser on iOS also says `Safari`.
|
|
38
|
+
*/
|
|
39
|
+
const FAMILY_PATTERNS: ReadonlyArray<readonly [NotificationBrowserFamily, RegExp]> = [
|
|
40
|
+
['samsung', /samsungbrowser/i],
|
|
41
|
+
['edge', /edg(e|a|ios)?\//i],
|
|
42
|
+
['opera', /opr\/|opera|opt\//i],
|
|
43
|
+
['firefox', /firefox\/|fxios\//i],
|
|
44
|
+
['chrome', /chrome\/|crios\//i],
|
|
45
|
+
['safari', /safari\//i],
|
|
46
|
+
];
|
|
47
|
+
|
|
48
|
+
const familyOf = (userAgent: string): NotificationBrowserFamily =>
|
|
49
|
+
FAMILY_PATTERNS.find(([, pattern]) => pattern.test(userAgent))?.[0] ?? 'other';
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Which browser, on which platform, the reader is using — enough to pick the
|
|
53
|
+
* steps that lift a notification block there. Pure: pass
|
|
54
|
+
* `navigator.userAgent` and `navigator.maxTouchPoints`.
|
|
55
|
+
*/
|
|
56
|
+
export const detectNotificationBrowser = (
|
|
57
|
+
userAgent: string,
|
|
58
|
+
maxTouchPoints = 0,
|
|
59
|
+
): NotificationBrowser => ({
|
|
60
|
+
family: familyOf(userAgent),
|
|
61
|
+
platform: platformOf(userAgent, maxTouchPoints),
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* The steps that lift a notification block in `browser`, from a
|
|
66
|
+
* `NotificationUnblockCopy` pack (`PT_BR_NOTIFICATION_UNBLOCK_COPY`, …).
|
|
67
|
+
*
|
|
68
|
+
* Every iOS browser shares one list — the switch is in the device's Settings,
|
|
69
|
+
* whichever browser installed the app — and a family or platform the pack does
|
|
70
|
+
* not name falls back to its general `other` steps.
|
|
71
|
+
*/
|
|
72
|
+
export const notificationUnblockSteps = (
|
|
73
|
+
copy: NotificationUnblockCopy,
|
|
74
|
+
browser: NotificationBrowser,
|
|
75
|
+
): readonly string[] => {
|
|
76
|
+
if (browser.platform === 'ios') return copy.ios;
|
|
77
|
+
if (browser.family === 'other') return copy.other;
|
|
78
|
+
const byPlatform: Partial<Record<NotificationPlatform, readonly string[]>> = copy[browser.family];
|
|
79
|
+
return byPlatform[browser.platform] ?? copy.other;
|
|
80
|
+
};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# NotificationStatusNotice
|
|
2
|
+
|
|
3
|
+
Tells a reader whether **this browser** will notify them, and offers the one
|
|
4
|
+
thing they can do about it.
|
|
5
|
+
|
|
6
|
+
| `status` | what it means | what it offers |
|
|
7
|
+
|---|---|---|
|
|
8
|
+
| `enabled` | they will be notified here | nothing |
|
|
9
|
+
| `disabled` | they will not, and this page can ask | an action that calls `onEnable` |
|
|
10
|
+
| `blocked` | they will not, and the browser refused once | a "turn back on" disclosure over the steps for **their** browser |
|
|
11
|
+
| `unavailable` | they will not, and nothing here can change it | nothing |
|
|
12
|
+
|
|
13
|
+
Use it wherever a promise depends on web push — "we will call you when your
|
|
14
|
+
table is ready" — so a reader is never left believing a notification is coming
|
|
15
|
+
that cannot arrive.
|
|
16
|
+
|
|
17
|
+
## Import
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import {
|
|
21
|
+
NotificationStatusNotice,
|
|
22
|
+
detectNotificationBrowser,
|
|
23
|
+
notificationUnblockSteps,
|
|
24
|
+
} from '@12-apps/ui/feedback/NotificationStatusNotice';
|
|
25
|
+
import { PT_BR_NOTIFICATION_UNBLOCK_COPY } from '@12-apps/ui/pt-BR';
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Usage
|
|
29
|
+
|
|
30
|
+
The component owns no words. Map your own permission state onto `status`, and
|
|
31
|
+
pass the sentences:
|
|
32
|
+
|
|
33
|
+
```tsx
|
|
34
|
+
const browser = detectNotificationBrowser(navigator.userAgent, navigator.maxTouchPoints);
|
|
35
|
+
|
|
36
|
+
switch (pushState) {
|
|
37
|
+
case 'offer':
|
|
38
|
+
return (
|
|
39
|
+
<NotificationStatusNotice
|
|
40
|
+
status="disabled"
|
|
41
|
+
title="Suas notificações estão desligadas."
|
|
42
|
+
description="Sem elas, a gente não consegue te avisar no celular."
|
|
43
|
+
enableLabel="Ligar notificações"
|
|
44
|
+
onEnable={requestPermission} // raise the browser prompt HERE — it needs a gesture
|
|
45
|
+
pending={asking}
|
|
46
|
+
/>
|
|
47
|
+
);
|
|
48
|
+
case 'blocked':
|
|
49
|
+
return (
|
|
50
|
+
<NotificationStatusNotice
|
|
51
|
+
status="blocked"
|
|
52
|
+
title="As notificações estão bloqueadas neste navegador."
|
|
53
|
+
stepsToggleLabel="Habilitar novamente"
|
|
54
|
+
steps={notificationUnblockSteps(PT_BR_NOTIFICATION_UNBLOCK_COPY, browser)}
|
|
55
|
+
/>
|
|
56
|
+
);
|
|
57
|
+
// …
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Props
|
|
62
|
+
|
|
63
|
+
Common to every status:
|
|
64
|
+
|
|
65
|
+
| prop | type | |
|
|
66
|
+
|---|---|---|
|
|
67
|
+
| `status` | `'enabled' \| 'disabled' \| 'blocked' \| 'unavailable'` | required; picks the shape below |
|
|
68
|
+
| `title` | `string` | required; the reader's situation in one sentence |
|
|
69
|
+
| `description` | `string` | what that means for them |
|
|
70
|
+
| `dataTestId` | `string` | root test id (default `notification-status-notice`); parts append `-enable`, `-steps-toggle`, `-steps` |
|
|
71
|
+
| `className`, `sx` | | forwarded to the root `Alert` |
|
|
72
|
+
|
|
73
|
+
`disabled` adds `enableLabel`, `onEnable` and `pending` (spinner, and the action
|
|
74
|
+
cannot be pressed twice). `blocked` adds `stepsToggleLabel`, `steps` (ordered)
|
|
75
|
+
and `defaultStepsOpen`.
|
|
76
|
+
|
|
77
|
+
## The unblock steps
|
|
78
|
+
|
|
79
|
+
A web page cannot re-ask after a refusal — `Notification.requestPermission()`
|
|
80
|
+
resolves `denied` at once — so the only way back is the browser's own settings,
|
|
81
|
+
and those differ per browser. `NotificationUnblockCopy` holds one ordered list
|
|
82
|
+
per family and platform, shipped in pt-BR and en-US:
|
|
83
|
+
|
|
84
|
+
- `detectNotificationBrowser(userAgent, maxTouchPoints)` answers
|
|
85
|
+
`{ family, platform }` — Chrome, Edge, Firefox, Safari, Samsung Internet,
|
|
86
|
+
Opera, or `other`; on `ios`, `android` or `desktop`. Most specific first:
|
|
87
|
+
every Chromium browser also says `Chrome`, every iOS browser also says
|
|
88
|
+
`Safari`, and an iPad asking for the desktop site says `Macintosh`.
|
|
89
|
+
- `notificationUnblockSteps(copy, browser)` picks the list. Every iOS browser
|
|
90
|
+
shares one list (web push there belongs to a Home Screen app, switched in the
|
|
91
|
+
device's Settings); a family/platform the pack does not name falls back to
|
|
92
|
+
`other`.
|
|
93
|
+
|
|
94
|
+
Menu labels move between browser versions. The packs follow the current ones
|
|
95
|
+
and say where to look; a host that needs different words passes its own
|
|
96
|
+
`NotificationUnblockCopy`.
|
|
97
|
+
|
|
98
|
+
## Accessibility
|
|
99
|
+
|
|
100
|
+
- The root is a **polite** live region (`role="status"`): a change of status is
|
|
101
|
+
announced without interrupting what the screen reader was saying.
|
|
102
|
+
- The steps sit behind a real `button` with `aria-expanded` and `aria-controls`;
|
|
103
|
+
the list is an `<ol>`, so the order is announced. Enter and Space toggle it.
|
|
104
|
+
- `disabled` and `blocked` are `warning`s — the reader can act, and will miss
|
|
105
|
+
something if they do not. `unavailable` is only `info`: painting amber what
|
|
106
|
+
cannot be fixed asks the reader to fix it.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Theme spacing units between the message and its action. */
|
|
2
|
+
export const NOTICE_ACTION_GAP_UNITS = 1;
|
|
3
|
+
|
|
4
|
+
/** Theme spacing units the numbered steps are indented by. */
|
|
5
|
+
export const NOTICE_STEPS_INDENT_UNITS = 2.5;
|
|
6
|
+
|
|
7
|
+
/** Theme spacing units between two steps. */
|
|
8
|
+
export const NOTICE_STEP_GAP_UNITS = 0.5;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import Box from '@mui/material/Box/index.js';
|
|
2
|
+
import Typography from '@mui/material/Typography/index.js';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
|
|
5
|
+
import { Alert } from '../../data-display/Alert/Alert';
|
|
6
|
+
import { Button } from '../../form/Button/Button';
|
|
7
|
+
import { NOTICE_VARIANT } from './NotificationStatusNotice.helpers';
|
|
8
|
+
import {
|
|
9
|
+
NOTICE_ACTION_GAP_UNITS,
|
|
10
|
+
NOTICE_STEP_GAP_UNITS,
|
|
11
|
+
NOTICE_STEPS_INDENT_UNITS,
|
|
12
|
+
} from './NotificationStatusNotice.metrics';
|
|
13
|
+
import type {
|
|
14
|
+
BlockedNoticeProps,
|
|
15
|
+
DisabledNoticeProps,
|
|
16
|
+
NotificationStatusNoticeProps,
|
|
17
|
+
} from './NotificationStatusNotice.types';
|
|
18
|
+
|
|
19
|
+
const DEFAULT_TEST_ID = 'notification-status-notice';
|
|
20
|
+
|
|
21
|
+
const EnableAction: React.FC<{ props: DisabledNoticeProps; testId: string }> = ({
|
|
22
|
+
props,
|
|
23
|
+
testId,
|
|
24
|
+
}) => (
|
|
25
|
+
<Box sx={{ mt: NOTICE_ACTION_GAP_UNITS }}>
|
|
26
|
+
<Button
|
|
27
|
+
variant="solid"
|
|
28
|
+
color="primary"
|
|
29
|
+
size="sm"
|
|
30
|
+
// `loading` also disables the button, so a second tap cannot ask twice.
|
|
31
|
+
loading={props.pending}
|
|
32
|
+
onClick={props.onEnable}
|
|
33
|
+
dataTestId={`${testId}-enable`}
|
|
34
|
+
>
|
|
35
|
+
{props.enableLabel}
|
|
36
|
+
</Button>
|
|
37
|
+
</Box>
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* The way back from a refusal: a disclosure over the steps, because the steps
|
|
42
|
+
* are long and most readers of a blocked notice will not act on it right now.
|
|
43
|
+
* A real button with `aria-expanded`, so a screen reader hears that it opens
|
|
44
|
+
* something and whether it has.
|
|
45
|
+
*/
|
|
46
|
+
const BlockedSteps: React.FC<{ props: BlockedNoticeProps; testId: string }> = ({
|
|
47
|
+
props,
|
|
48
|
+
testId,
|
|
49
|
+
}) => {
|
|
50
|
+
const [open, setOpen] = React.useState(props.defaultStepsOpen ?? false);
|
|
51
|
+
const listId = React.useId();
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<Box sx={{ mt: NOTICE_ACTION_GAP_UNITS }}>
|
|
55
|
+
<Button
|
|
56
|
+
variant="text"
|
|
57
|
+
color="primary"
|
|
58
|
+
size="sm"
|
|
59
|
+
aria-expanded={open}
|
|
60
|
+
aria-controls={listId}
|
|
61
|
+
onClick={() => setOpen((was) => !was)}
|
|
62
|
+
dataTestId={`${testId}-steps-toggle`}
|
|
63
|
+
>
|
|
64
|
+
{props.stepsToggleLabel}
|
|
65
|
+
</Button>
|
|
66
|
+
<Box
|
|
67
|
+
component="ol"
|
|
68
|
+
id={listId}
|
|
69
|
+
hidden={!open}
|
|
70
|
+
data-testid={`${testId}-steps`}
|
|
71
|
+
sx={{
|
|
72
|
+
m: 0,
|
|
73
|
+
mt: NOTICE_STEP_GAP_UNITS,
|
|
74
|
+
pl: NOTICE_STEPS_INDENT_UNITS,
|
|
75
|
+
display: open ? 'flex' : 'none',
|
|
76
|
+
flexDirection: 'column',
|
|
77
|
+
gap: NOTICE_STEP_GAP_UNITS,
|
|
78
|
+
}}
|
|
79
|
+
>
|
|
80
|
+
{props.steps.map((step, index) => (
|
|
81
|
+
<Typography key={`${index}-${step}`} component="li" variant="body2">
|
|
82
|
+
{step}
|
|
83
|
+
</Typography>
|
|
84
|
+
))}
|
|
85
|
+
</Box>
|
|
86
|
+
</Box>
|
|
87
|
+
);
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
const NoticeAction: React.FC<{ props: NotificationStatusNoticeProps; testId: string }> = ({
|
|
91
|
+
props,
|
|
92
|
+
testId,
|
|
93
|
+
}) => {
|
|
94
|
+
if (props.status === 'disabled') return <EnableAction props={props} testId={testId} />;
|
|
95
|
+
if (props.status === 'blocked') return <BlockedSteps props={props} testId={testId} />;
|
|
96
|
+
return null;
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Tells a reader whether this browser will notify them, and gives them the one
|
|
101
|
+
* thing they can do about it: a tap that asks (`disabled`), the steps that
|
|
102
|
+
* undo a refusal (`blocked`), or nothing when nothing can change (`enabled`,
|
|
103
|
+
* `unavailable`).
|
|
104
|
+
*
|
|
105
|
+
* Every word is the host's. The component decides only the shape and how loud
|
|
106
|
+
* each status is — see `NOTICE_VARIANT`.
|
|
107
|
+
*/
|
|
108
|
+
export const NotificationStatusNotice = React.forwardRef<
|
|
109
|
+
HTMLDivElement,
|
|
110
|
+
NotificationStatusNoticeProps
|
|
111
|
+
>((props, ref) => {
|
|
112
|
+
const testId = props.dataTestId ?? DEFAULT_TEST_ID;
|
|
113
|
+
|
|
114
|
+
return (
|
|
115
|
+
<Alert
|
|
116
|
+
ref={ref}
|
|
117
|
+
variant={NOTICE_VARIANT[props.status]}
|
|
118
|
+
title={props.title}
|
|
119
|
+
description={props.description}
|
|
120
|
+
// A status line, not an interruption: it must not cut across whatever
|
|
121
|
+
// the screen reader is saying about the page it sits on.
|
|
122
|
+
announce="polite"
|
|
123
|
+
showIcon
|
|
124
|
+
data-testid={testId}
|
|
125
|
+
data-status={props.status}
|
|
126
|
+
className={props.className}
|
|
127
|
+
sx={props.sx}
|
|
128
|
+
>
|
|
129
|
+
<NoticeAction props={props} testId={testId} />
|
|
130
|
+
</Alert>
|
|
131
|
+
);
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
NotificationStatusNotice.displayName = 'NotificationStatusNotice';
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type { SxProps, Theme } from '@mui/material/styles/index.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Where a reader stands with this browser's notifications.
|
|
5
|
+
*
|
|
6
|
+
* - `enabled` — they will be notified here.
|
|
7
|
+
* - `disabled` — they are not, and this page CAN ask: one tap raises the
|
|
8
|
+
* browser's own permission prompt.
|
|
9
|
+
* - `blocked` — they are not, and this page can NOT ask: the browser refused
|
|
10
|
+
* once and only the reader can undo that, in the browser's own settings.
|
|
11
|
+
* - `unavailable` — they are not, and nothing will change it here: the browser
|
|
12
|
+
* has no web push, or the host cannot send it.
|
|
13
|
+
*/
|
|
14
|
+
export type NotificationStatus = 'enabled' | 'disabled' | 'blocked' | 'unavailable';
|
|
15
|
+
|
|
16
|
+
interface NotificationStatusNoticeCommon {
|
|
17
|
+
/** The one sentence that states the reader's situation. */
|
|
18
|
+
title: string;
|
|
19
|
+
/** What that situation means for them — e.g. what they will miss. */
|
|
20
|
+
description?: string;
|
|
21
|
+
/** Test id of the root; parts derive from it (`-enable`, `-steps`, …). */
|
|
22
|
+
dataTestId?: string;
|
|
23
|
+
className?: string;
|
|
24
|
+
sx?: SxProps<Theme>;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface EnabledNoticeProps extends NotificationStatusNoticeCommon {
|
|
28
|
+
status: 'enabled';
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface DisabledNoticeProps extends NotificationStatusNoticeCommon {
|
|
32
|
+
status: 'disabled';
|
|
33
|
+
/** The action's label, e.g. "Turn on notifications". */
|
|
34
|
+
enableLabel: string;
|
|
35
|
+
/**
|
|
36
|
+
* Ask for the permission. Call the browser's `requestPermission` from HERE:
|
|
37
|
+
* a browser only shows its prompt inside a user gesture.
|
|
38
|
+
*/
|
|
39
|
+
onEnable: () => void;
|
|
40
|
+
/** The request is in flight — the action shows a spinner and cannot be pressed twice. */
|
|
41
|
+
pending?: boolean;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface BlockedNoticeProps extends NotificationStatusNoticeCommon {
|
|
45
|
+
status: 'blocked';
|
|
46
|
+
/** The disclosure's label, e.g. "Turn them back on". */
|
|
47
|
+
stepsToggleLabel: string;
|
|
48
|
+
/**
|
|
49
|
+
* How to lift the block in THIS reader's browser, one step per entry, in
|
|
50
|
+
* order. The host picks them — `detectNotificationBrowser` says which
|
|
51
|
+
* browser it is looking at — because the words are the host's.
|
|
52
|
+
*/
|
|
53
|
+
steps: readonly string[];
|
|
54
|
+
/** Start with the steps showing. Defaults to collapsed. */
|
|
55
|
+
defaultStepsOpen?: boolean;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface UnavailableNoticeProps extends NotificationStatusNoticeCommon {
|
|
59
|
+
status: 'unavailable';
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export type NotificationStatusNoticeProps =
|
|
63
|
+
| EnabledNoticeProps
|
|
64
|
+
| DisabledNoticeProps
|
|
65
|
+
| BlockedNoticeProps
|
|
66
|
+
| UnavailableNoticeProps;
|
|
67
|
+
|
|
68
|
+
/** The browser families whose permission settings differ enough to need their own steps. */
|
|
69
|
+
export type NotificationBrowserFamily =
|
|
70
|
+
| 'chrome'
|
|
71
|
+
| 'edge'
|
|
72
|
+
| 'firefox'
|
|
73
|
+
| 'safari'
|
|
74
|
+
| 'samsung'
|
|
75
|
+
| 'opera'
|
|
76
|
+
| 'other';
|
|
77
|
+
|
|
78
|
+
export type NotificationPlatform = 'ios' | 'android' | 'desktop';
|
|
79
|
+
|
|
80
|
+
export interface NotificationBrowser {
|
|
81
|
+
family: NotificationBrowserFamily;
|
|
82
|
+
platform: NotificationPlatform;
|
|
83
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export { NotificationStatusNotice } from './NotificationStatusNotice';
|
|
2
|
+
export {
|
|
3
|
+
detectNotificationBrowser,
|
|
4
|
+
notificationUnblockSteps,
|
|
5
|
+
} from './NotificationStatusNotice.helpers';
|
|
6
|
+
export type {
|
|
7
|
+
BlockedNoticeProps,
|
|
8
|
+
DisabledNoticeProps,
|
|
9
|
+
EnabledNoticeProps,
|
|
10
|
+
NotificationBrowser,
|
|
11
|
+
NotificationBrowserFamily,
|
|
12
|
+
NotificationPlatform,
|
|
13
|
+
NotificationStatus,
|
|
14
|
+
NotificationStatusNoticeProps,
|
|
15
|
+
UnavailableNoticeProps,
|
|
16
|
+
} from './NotificationStatusNotice.types';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# NotificationStatusNotice Test Status Tracking
|
|
2
|
+
|
|
3
|
+
## Test Files Status
|
|
4
|
+
|
|
5
|
+
- [x] NotificationStatusNotice.test.stories.tsx created
|
|
6
|
+
- [x] Unit tests: `__tests__/notification-status-notice.test.tsx`, `detect-notification-browser.test.ts`, `notification-unblock-steps.test.ts`
|
|
7
|
+
|
|
8
|
+
## Storybook Tests Status
|
|
9
|
+
|
|
10
|
+
| Test Name | Status | Pass/Fail | Notes |
|
|
11
|
+
| --- | --- | --- | --- |
|
|
12
|
+
| Disabled: the action asks the host | Written | - | role/status, onEnable called once |
|
|
13
|
+
| Blocked: steps open and close from the keyboard | Written | - | Enter opens, Space closes, aria-expanded, order |
|
|
14
|
+
| Enabled and unavailable: no action | Written | - | no button rendered |
|
|
15
|
+
| Disabled + pending: the action is locked | Written | - | action disabled |
|
|
16
|
+
|
|
17
|
+
Legend: Pending | Running | PASS | FAIL
|
|
18
|
+
|
|
19
|
+
## Static Stories Status
|
|
20
|
+
|
|
21
|
+
- [x] Default story (`Disabled`)
|
|
22
|
+
- [x] All variants covered (`Enabled`, `Disabled`, `Blocked`, `Unavailable`, `AllStatuses`)
|
|
23
|
+
- [x] Loading state story (`Pending`)
|
|
24
|
+
- [x] Edge cases (`LongText`, `BlockedOnIphone`)
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# NotificationStatusNotice
|
|
2
|
+
|
|
3
|
+
Tells a reader whether this browser will notify them — enabled, disabled but
|
|
4
|
+
askable, blocked by the browser, or unavailable — and offers the one action
|
|
5
|
+
each status allows. Composes `Alert` and `Button`; every sentence comes from
|
|
6
|
+
the host, and the browser-specific unblock steps from the pt-BR/en-US
|
|
7
|
+
`NotificationUnblockCopy` packs.
|
|
8
|
+
|
|
9
|
+
## Props
|
|
10
|
+
|
|
11
|
+
- `status` — which of the four situations; narrows the props below.
|
|
12
|
+
- `title` / `description` — the host's sentences.
|
|
13
|
+
- `enableLabel` / `onEnable` / `pending` (`disabled`) — the permission request.
|
|
14
|
+
- `stepsToggleLabel` / `steps` / `defaultStepsOpen` (`blocked`) — the disclosure over the unblock steps.
|
|
15
|
+
- `dataTestId`, `className`, `sx` — forwarded to the root.
|
|
16
|
+
|
|
17
|
+
## Lint
|
|
18
|
+
|
|
19
|
+
Clean.
|
|
20
|
+
|
|
21
|
+
## Type Errors
|
|
22
|
+
|
|
23
|
+
None.
|
|
24
|
+
|
|
25
|
+
## Testing Scenarios
|
|
26
|
+
|
|
27
|
+
Each status's shape; `onEnable` once and not while pending; the disclosure by
|
|
28
|
+
click and keyboard; browser detection across Chrome/Edge/Firefox/Safari/Samsung/
|
|
29
|
+
Opera on desktop, Android, iPhone and iPad; the steps fallback; pt-BR and en-US
|
|
30
|
+
packs with the same shape.
|
|
31
|
+
|
|
32
|
+
## Current
|
|
33
|
+
|
|
34
|
+
Web only; no React Native port.
|
package/src/copy/feedback.ts
CHANGED
|
@@ -37,3 +37,31 @@ export interface ChromeCopy {
|
|
|
37
37
|
/** The share affordance in the install prompt. */
|
|
38
38
|
share: string;
|
|
39
39
|
}
|
|
40
|
+
|
|
41
|
+
/** One ordered list of steps a reader follows in their browser. */
|
|
42
|
+
type Steps = readonly string[];
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* How to lift a notification block, per browser — the steps
|
|
46
|
+
* `NotificationStatusNotice` shows in its `blocked` state.
|
|
47
|
+
*
|
|
48
|
+
* Keyed the way `detectNotificationBrowser` answers, and read through
|
|
49
|
+
* `notificationUnblockSteps`, which falls back to `other` for anything a pack
|
|
50
|
+
* does not name. Menu labels move between browser versions; these follow the
|
|
51
|
+
* current ones and say where to look rather than promising an exact word.
|
|
52
|
+
*/
|
|
53
|
+
export interface NotificationUnblockCopy {
|
|
54
|
+
/**
|
|
55
|
+
* Every browser on iOS. Web push there belongs to a Home Screen app, so the
|
|
56
|
+
* switch lives in the device's Settings rather than in any browser.
|
|
57
|
+
*/
|
|
58
|
+
ios: Steps;
|
|
59
|
+
chrome: { desktop: Steps; android: Steps };
|
|
60
|
+
edge: { desktop: Steps; android: Steps };
|
|
61
|
+
firefox: { desktop: Steps; android: Steps };
|
|
62
|
+
opera: { desktop: Steps; android: Steps };
|
|
63
|
+
safari: { desktop: Steps };
|
|
64
|
+
samsung: { android: Steps };
|
|
65
|
+
/** Anything unrecognised — general enough to be true everywhere. */
|
|
66
|
+
other: Steps;
|
|
67
|
+
}
|
package/src/en-US.feedback.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import type {
|
|
6
6
|
ChromeCopy,
|
|
7
|
+
NotificationUnblockCopy,
|
|
7
8
|
TutorialCopy,
|
|
8
9
|
} from './copy';
|
|
9
10
|
|
|
@@ -23,3 +24,71 @@ export const EN_US_CHROME_COPY: ChromeCopy = {
|
|
|
23
24
|
scrollToTop: "Back to top",
|
|
24
25
|
share: "Share",
|
|
25
26
|
};
|
|
27
|
+
|
|
28
|
+
const EN_US_CHROMIUM_DESKTOP = [
|
|
29
|
+
"Click the icon to the left of the site's address.",
|
|
30
|
+
"Open \"Site settings\".",
|
|
31
|
+
"Under \"Notifications\", choose \"Allow\".",
|
|
32
|
+
"Come back to this page and reload it.",
|
|
33
|
+
] as const;
|
|
34
|
+
|
|
35
|
+
const EN_US_CHROMIUM_ANDROID = [
|
|
36
|
+
"Tap the icon to the left of the site's address.",
|
|
37
|
+
"Tap \"Permissions\".",
|
|
38
|
+
"Tap \"Notifications\" and choose \"Allow\".",
|
|
39
|
+
"Come back to this page and reload it.",
|
|
40
|
+
] as const;
|
|
41
|
+
|
|
42
|
+
export const EN_US_NOTIFICATION_UNBLOCK_COPY: NotificationUnblockCopy = {
|
|
43
|
+
ios: [
|
|
44
|
+
"Open the iPhone's Settings.",
|
|
45
|
+
"Tap \"Notifications\".",
|
|
46
|
+
"Find this app in the list and turn on \"Allow Notifications\".",
|
|
47
|
+
],
|
|
48
|
+
chrome: { desktop: EN_US_CHROMIUM_DESKTOP, android: EN_US_CHROMIUM_ANDROID },
|
|
49
|
+
edge: {
|
|
50
|
+
desktop: [
|
|
51
|
+
"Click the lock to the left of the site's address.",
|
|
52
|
+
"Open \"Permissions for this site\".",
|
|
53
|
+
"Under \"Notifications\", choose \"Allow\".",
|
|
54
|
+
"Come back to this page and reload it.",
|
|
55
|
+
],
|
|
56
|
+
android: EN_US_CHROMIUM_ANDROID,
|
|
57
|
+
},
|
|
58
|
+
firefox: {
|
|
59
|
+
desktop: [
|
|
60
|
+
"Click the permissions icon to the left of the site's address.",
|
|
61
|
+
"Next to \"Send notifications\", click the X to clear the block.",
|
|
62
|
+
"Reload the page and turn notifications on again.",
|
|
63
|
+
],
|
|
64
|
+
android: [
|
|
65
|
+
"Open the browser menu and tap \"Settings\".",
|
|
66
|
+
"Tap \"Site permissions\", then \"Notifications\".",
|
|
67
|
+
"Find this site and choose \"Allow\".",
|
|
68
|
+
"Come back to this page and reload it.",
|
|
69
|
+
],
|
|
70
|
+
},
|
|
71
|
+
opera: { desktop: EN_US_CHROMIUM_DESKTOP, android: EN_US_CHROMIUM_ANDROID },
|
|
72
|
+
safari: {
|
|
73
|
+
desktop: [
|
|
74
|
+
"In the Safari menu, open \"Settings\".",
|
|
75
|
+
"Go to the \"Websites\" tab and pick \"Notifications\" in the sidebar.",
|
|
76
|
+
"Find this site and choose \"Allow\".",
|
|
77
|
+
"Come back to this page and reload it.",
|
|
78
|
+
],
|
|
79
|
+
},
|
|
80
|
+
samsung: {
|
|
81
|
+
android: [
|
|
82
|
+
"Open the browser menu and tap \"Settings\".",
|
|
83
|
+
"Tap \"Sites and downloads\", then \"Notifications\".",
|
|
84
|
+
"Find this site and allow notifications.",
|
|
85
|
+
"Come back to this page and reload it.",
|
|
86
|
+
],
|
|
87
|
+
},
|
|
88
|
+
other: [
|
|
89
|
+
"Open the browser's settings.",
|
|
90
|
+
"Look for site permissions, then \"Notifications\".",
|
|
91
|
+
"Allow notifications for this site.",
|
|
92
|
+
"Come back to this page and reload it.",
|
|
93
|
+
],
|
|
94
|
+
};
|