@12-apps/ui 6.100.0 → 6.101.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 +2 -1
- package/components-catalog.md +2 -1
- package/dist/_internal/components/data-display/Alert/Alert.content.js +2 -2
- package/dist/_internal/components/data-display/Alert/Alert.js +4 -4
- package/dist/_internal/components/data-display/Avatar/Avatar.js +2 -2
- package/dist/_internal/components/data-display/Badge/Badge.js +2 -2
- package/dist/_internal/components/data-display/CardKit/card-actions-context.js +5 -5
- package/dist/_internal/components/data-display/CardKit/use-remove-confirm.js +6 -6
- 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 +6 -6
- 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/DataGrid/DataGrid.js +3 -3
- package/dist/_internal/components/data-display/DataViews/DataViewsGrid.js +45 -45
- package/dist/_internal/components/data-display/DataViews/DataViewsTableBase.js +60 -60
- package/dist/_internal/components/data-display/DataViews/DeleteViewDialog.js +4 -4
- package/dist/_internal/components/data-display/DataViews/ManageViewsDialog.js +4 -4
- package/dist/_internal/components/data-display/DataViews/SaveViewModal.js +4 -4
- package/dist/_internal/components/data-display/DataViews/base-list-card-geometry.js +4 -4
- package/dist/_internal/components/data-display/DataViews/base-list-card-layout.js +4 -4
- package/dist/_internal/components/data-display/DataViews/base-list-card-slots.js +3 -3
- package/dist/_internal/components/data-display/DataViews/base-list-card.js +5 -5
- package/dist/_internal/components/data-display/DataViews/data-views-category-pill.js +8 -8
- package/dist/_internal/components/data-display/DataViews/data-views-display-panel.js +1 -1
- package/dist/_internal/components/data-display/DataViews/data-views-filter-panel.js +20 -20
- package/dist/_internal/components/data-display/DataViews/data-views-grid-bodies.js +9 -9
- package/dist/_internal/components/data-display/DataViews/data-views-grid-parts.js +42 -42
- package/dist/_internal/components/data-display/DataViews/data-views-inline-bar.js +24 -24
- package/dist/_internal/components/data-display/DataViews/data-views-more-fields.js +21 -21
- package/dist/_internal/components/data-display/DataViews/data-views-more-filters.js +22 -22
- package/dist/_internal/components/data-display/DataViews/data-views-range-bounds.js +9 -9
- package/dist/_internal/components/data-display/DataViews/data-views-range-calendar.js +6 -6
- package/dist/_internal/components/data-display/DataViews/data-views-range-pill.js +11 -11
- package/dist/_internal/components/data-display/DataViews/data-views-scope-tabs.js +2 -2
- package/dist/_internal/components/data-display/DataViews/data-views-shell-toolbar.js +4 -4
- package/dist/_internal/components/data-display/DataViews/data-views-table-parts.js +10 -10
- package/dist/_internal/components/data-display/DataViews/data-views-toolbar.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 +2 -2
- package/dist/_internal/components/data-display/DayRuler/DayRuler.footer.js +3 -3
- package/dist/_internal/components/data-display/DayRuler/DayRuler.js +10 -10
- package/dist/_internal/components/data-display/DayRuler/DayRuler.keyboard.js +2 -2
- package/dist/_internal/components/data-display/DayRuler/DayRuler.labels.js +2 -2
- package/dist/_internal/components/data-display/DayRuler/DayRuler.parts.js +3 -3
- package/dist/_internal/components/data-display/DayRuler/useRulerDrag.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.js +12 -12
- package/dist/_internal/components/data-display/HoverCard/HoverCard.js +2 -2
- package/dist/_internal/components/data-display/Lightbox/Lightbox.js +7 -7
- package/dist/_internal/components/data-display/Lightbox/LightboxControls.js +2 -2
- package/dist/_internal/components/data-display/Lightbox/LightboxOverlay.js +3 -3
- package/dist/_internal/components/data-display/Lightbox/LightboxThumbnails.js +2 -2
- package/dist/_internal/components/data-display/MapPreview/MapLayers.js +3 -3
- 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/RegionMap/RegionMap.js +1 -1
- package/dist/_internal/components/data-display/ScheduleGrid/ScheduleGrid.js +8 -8
- package/dist/_internal/components/data-display/ScheduleGrid/ScheduleGrid.parts.js +3 -3
- package/dist/_internal/components/data-display/Sheet/Sheet.js +2 -2
- package/dist/_internal/components/data-display/Table/Table.js +3 -3
- package/dist/_internal/components/data-display/index.js +72 -72
- package/dist/_internal/components/feedback/Dialog/Dialog.js +3 -3
- package/dist/_internal/components/feedback/Modal/Modal.js +2 -2
- package/dist/_internal/components/feedback/NotificationStatusNotice/NotificationStatusNotice.js +5 -5
- package/dist/_internal/components/feedback/SequenceResolver/SequenceResolver.frame.js +8 -8
- package/dist/_internal/components/feedback/SequenceResolver/SequenceResolver.header.js +4 -4
- package/dist/_internal/components/feedback/SequenceResolver/SequenceResolver.js +16 -16
- package/dist/_internal/components/feedback/SequenceResolver/SequenceResolver.overview.js +6 -6
- package/dist/_internal/components/feedback/SequenceResolver/SequenceResolver.parts.js +5 -5
- package/dist/_internal/components/feedback/TutorialOverlay/TutorialOverlay.js +2 -2
- package/dist/_internal/components/feedback/UsableModal/UsableModal.js +1 -1
- package/dist/_internal/components/feedback/UsableModal/UsableModal.sheet.js +2 -2
- package/dist/_internal/components/feedback/index.js +21 -21
- package/dist/_internal/components/form/AddressAutocomplete/AddressAutocomplete.hooks.js +2 -2
- package/dist/_internal/components/form/AddressAutocomplete/AddressAutocomplete.js +7 -7
- package/dist/_internal/components/form/AddressAutocomplete/AddressAutocompleteField.js +2 -2
- package/dist/_internal/components/form/Autocomplete/Autocomplete.js +1 -1
- package/dist/_internal/components/form/Calendar/Calendar.js +5 -5
- package/dist/_internal/components/form/Calendar/CalendarSelectorsMonth.js +3 -3
- package/dist/_internal/components/form/CategorySelect/CategoryPanel.js +4 -4
- package/dist/_internal/components/form/CategorySelect/CategorySelect.js +7 -7
- package/dist/_internal/components/form/CodeEditor/CodeEditor.js +2 -2
- package/dist/_internal/components/form/DateRangePicker/DateRangePicker.js +8 -8
- package/dist/_internal/components/form/InputOTP/InputOTP.base.js +1 -0
- package/dist/_internal/components/form/InputOTP/InputOTP.base.js.map +1 -0
- package/dist/_internal/components/form/InputOTP/InputOTP.core.js +16 -0
- package/dist/_internal/components/form/InputOTP/InputOTP.core.js.map +1 -0
- package/dist/_internal/components/form/InputOTP/InputOTP.hooks.js +2 -1
- package/dist/_internal/components/form/InputOTP/InputOTP.js +5 -3
- package/dist/_internal/components/form/InputOTP/InputOTP.metrics.js +12 -0
- package/dist/_internal/components/form/InputOTP/InputOTP.metrics.js.map +1 -0
- package/dist/_internal/components/form/InputOTP/InputOTP.styles.js +2 -1
- package/dist/_internal/components/form/index.js +25 -23
- package/dist/_internal/components/form/total-form/Fields/CategoryField.js +8 -8
- package/dist/_internal/components/form/total-form/Fields/index.js +9 -9
- package/dist/_internal/components/index.js +120 -118
- package/dist/_internal/components/navigation/AppHeader/AppHeader.details.js +6 -6
- package/dist/_internal/components/navigation/SectionNav/SectionNav.bar.js +6 -6
- package/dist/_internal/components/navigation/SectionNav/SectionNav.js +9 -9
- package/dist/_internal/components/navigation/SectionNav/SectionNav.parts.js +3 -3
- package/dist/_internal/components/navigation/SectionNav/SectionNav.primary.js +4 -4
- package/dist/_internal/components/navigation/SectionNav/SectionNav.rail.js +5 -5
- package/dist/_internal/components/navigation/SectionNav/SectionNav.railCreate.js +4 -4
- package/dist/_internal/components/navigation/SectionNav/SectionNav.sheet.js +4 -4
- package/dist/_internal/components/navigation/index.js +15 -15
- package/dist/_internal/user-avatar/user-avatar.js +3 -3
- package/dist/charts.js +6 -6
- package/dist/{chunk-37MJZLQU.js → chunk-24OFA44S.js} +4 -4
- package/dist/{chunk-R775ISK6.js → chunk-2L6TANRY.js} +5 -5
- package/dist/{chunk-B4OZU7J4.js → chunk-423A7NUP.js} +7 -7
- package/dist/{chunk-LFECE4R7.js → chunk-4EDCF7TC.js} +2 -2
- package/dist/{chunk-HI7JPDD6.js → chunk-5357QUVE.js} +2 -2
- package/dist/{chunk-F7JRQ2EI.js → chunk-5YX2VQFP.js} +7 -7
- package/dist/{chunk-QZOQVJ5L.js → chunk-645GGNTW.js} +3 -3
- package/dist/{chunk-N5PVD4J5.js → chunk-6DO672AG.js} +7 -7
- package/dist/{chunk-PGJIWCQR.js → chunk-6EZQLNPK.js} +4 -4
- package/dist/{chunk-YQMJJ7AL.js → chunk-6G2RAZTS.js} +5 -5
- package/dist/{chunk-KNW63H63.js → chunk-6PQZIZMN.js} +5 -5
- package/dist/{chunk-FZZMNKVF.js → chunk-6TAPAIRR.js} +8 -8
- package/dist/{chunk-ERAMSYPR.js → chunk-7N4O632I.js} +2 -2
- package/dist/{chunk-XFOKLWJZ.js → chunk-7S5PXEO7.js} +2 -2
- package/dist/{chunk-UIJLDAV7.js → chunk-AA6YMOEK.js} +2 -2
- package/dist/{chunk-CRD2WCU7.js → chunk-AFWUQJ4P.js} +8 -8
- package/dist/{chunk-SNWCT6JN.js → chunk-AMIUZRDQ.js} +3 -3
- package/dist/{chunk-NQYC7V5N.js → chunk-BAYCMSMI.js} +5 -9
- package/dist/chunk-BAYCMSMI.js.map +1 -0
- package/dist/{chunk-3I7KE2N6.js → chunk-BNV7P52K.js} +2 -2
- package/dist/{chunk-64UNVW6D.js → chunk-BP3ZKIPE.js} +4 -4
- package/dist/{chunk-3V7OTBUZ.js → chunk-BQ2SFA27.js} +2 -2
- package/dist/{chunk-Q5SCBQLY.js → chunk-BXLC3TBQ.js} +8 -8
- package/dist/{chunk-Z5V5E3JW.js → chunk-COKPPU42.js} +11 -11
- package/dist/{chunk-QADTI63U.js → chunk-CZVAVX5L.js} +4 -4
- package/dist/{chunk-WDEVKND3.js → chunk-D2YJPZMU.js} +9 -9
- package/dist/{chunk-OA6T2ME3.js → chunk-DYHOBKPU.js} +5 -5
- package/dist/{chunk-6WAP7BJS.js → chunk-E6SPWZRN.js} +2 -2
- package/dist/{chunk-UTIYB6VE.js → chunk-E73PAU4U.js} +19 -19
- package/dist/{chunk-XR474YYX.js → chunk-EDVAFY76.js} +2 -2
- package/dist/{chunk-MEMVZW64.js → chunk-EPNZQWS4.js} +3 -3
- package/dist/{chunk-GZITNT7O.js → chunk-FGZIEZEP.js} +11 -11
- package/dist/{chunk-4X2TOMK6.js → chunk-FKUVFPQZ.js} +4 -4
- package/dist/{chunk-UN5WU2OX.js → chunk-GDWU7WF4.js} +4 -4
- package/dist/{chunk-643YFWNK.js → chunk-GPWDP5FF.js} +3 -3
- package/dist/{chunk-XA5ES25V.js → chunk-HKQWFICM.js} +2 -2
- package/dist/chunk-IH6DZXTG.js +22 -0
- package/dist/chunk-IH6DZXTG.js.map +1 -0
- package/dist/{chunk-255WTBZ5.js → chunk-IWSTMVCA.js} +4 -4
- package/dist/{chunk-TZC6KIK2.js → chunk-JG733RMP.js} +5 -5
- package/dist/{chunk-7MLT66DE.js → chunk-K33X3PDT.js} +2 -2
- package/dist/{chunk-K3PMMW23.js → chunk-K6VEN5VN.js} +4 -4
- package/dist/{chunk-HOWAMSUY.js → chunk-KAWVH3AA.js} +3 -3
- package/dist/{chunk-IJVBLU25.js → chunk-KJZ4PINO.js} +3 -3
- package/dist/{chunk-REHGWN5M.js → chunk-KXDLLS62.js} +4 -4
- package/dist/{chunk-YQ5GQ32T.js → chunk-KZP5YTE7.js} +2 -2
- package/dist/{chunk-3V3Z4EML.js → chunk-L4FWEI2P.js} +5 -5
- package/dist/{chunk-UKUGSU3Y.js → chunk-L4V7FZJI.js} +2 -2
- package/dist/{chunk-W56KN53D.js → chunk-L6IDPTNX.js} +6 -6
- package/dist/{chunk-24HHUCWB.js → chunk-LDCZPZPD.js} +2 -2
- package/dist/{chunk-KV7LTOWC.js → chunk-M225SD4H.js} +13 -13
- package/dist/{chunk-R6L376KR.js → chunk-M6R32IBO.js} +8 -13
- package/dist/chunk-M6R32IBO.js.map +1 -0
- package/dist/{chunk-FQMLTCXT.js → chunk-MAHY7PK3.js} +4 -4
- package/dist/{chunk-Z2J4MRTF.js → chunk-MKNW4FRR.js} +4 -4
- package/dist/{chunk-ILJ3FXIC.js → chunk-MM3QESLI.js} +2 -2
- package/dist/{chunk-FYJL432J.js → chunk-MQPUS773.js} +6 -6
- package/dist/{chunk-VRSW7PIO.js → chunk-NKBSWAP3.js} +4 -4
- package/dist/{chunk-ULC4SCFC.js → chunk-NLJ7LL6H.js} +4 -4
- package/dist/{chunk-RAQD5QCM.js → chunk-NQ6JP5CC.js} +6 -6
- package/dist/{chunk-IFOHCY4O.js → chunk-OF3KG5EV.js} +2 -2
- package/dist/{chunk-W676GY42.js → chunk-P772HCHI.js} +4 -4
- package/dist/{chunk-CWRQGA2T.js → chunk-POIENBXE.js} +7 -7
- package/dist/{chunk-FW5GTAUY.js → chunk-Q4AX4FOK.js} +11 -11
- package/dist/{chunk-XQAFSC66.js → chunk-Q4FNCT4C.js} +2 -2
- package/dist/{chunk-PIELY4BJ.js → chunk-Q5Z66LKI.js} +1 -1
- package/dist/{chunk-4Y3QLISA.js → chunk-Q7AONB4G.js} +4 -4
- package/dist/{chunk-EZBBLLEU.js → chunk-QQBYZ3B3.js} +4 -4
- package/dist/{chunk-FT3LJZWZ.js → chunk-RWUXMBSO.js} +4 -4
- package/dist/{chunk-KWBMM6MJ.js → chunk-RZKKWIGQ.js} +9 -9
- package/dist/{chunk-RVBLOR32.js → chunk-S7CXVIEF.js} +2 -2
- package/dist/{chunk-WLLUARTC.js → chunk-T2G4LDU5.js} +2 -2
- package/dist/{chunk-OFRQMFWD.js → chunk-T5D3DYVN.js} +2 -2
- package/dist/{chunk-O4UXH7BM.js → chunk-TP6KZ2YR.js} +7 -7
- package/dist/{chunk-HAWOS4SF.js → chunk-TPDN3B5T.js} +2 -2
- package/dist/{chunk-54DOLCJ3.js → chunk-TXIIJW6C.js} +5 -5
- package/dist/{chunk-HN36UVOE.js → chunk-U4Z6GZDW.js} +4 -4
- package/dist/{chunk-J2IQ6FJ5.js → chunk-UKLNLWTP.js} +3 -3
- package/dist/chunk-VAHJCRNW.js +17 -0
- package/dist/chunk-VAHJCRNW.js.map +1 -0
- package/dist/{chunk-MKHNLRVX.js → chunk-VPPD2AJN.js} +7 -7
- package/dist/{chunk-TIM4PXWN.js → chunk-VWRXSBT2.js} +2 -2
- package/dist/{chunk-KVP5A3YK.js → chunk-WDWZKTGA.js} +2 -2
- package/dist/{chunk-FYSS2PYA.js → chunk-WH5ZEBKS.js} +7 -7
- package/dist/{chunk-KAGXV3ID.js → chunk-WMMXOSZG.js} +7 -7
- package/dist/{chunk-4RSFYS2V.js → chunk-X6D5JEUV.js} +6 -6
- package/dist/{chunk-GFYDOH7D.js → chunk-XEPNAU3T.js} +2 -2
- package/dist/{chunk-VMACQT3T.js → chunk-XH7UDC5Y.js} +3 -3
- package/dist/{chunk-PDWQJFMK.js → chunk-XHMHHP7B.js} +10 -10
- package/dist/{chunk-SA3KLZDZ.js → chunk-XNAI7QGU.js} +5 -5
- package/dist/{chunk-7TENMQNQ.js → chunk-XZMSRHFD.js} +4 -4
- package/dist/{chunk-HBHBRRSW.js → chunk-YBAK2WN5.js} +7 -7
- package/dist/{chunk-QLKUWDMQ.js → chunk-YDJ5GAGL.js} +13 -13
- package/dist/{chunk-LOLYBFYY.js → chunk-ZCNR4DN5.js} +5 -5
- package/dist/data-display/Alert.js +4 -4
- package/dist/data-display/Avatar.js +2 -2
- package/dist/data-display/Badge.js +2 -2
- package/dist/data-display/CardKit.js +14 -14
- package/dist/data-display/Carousel.js +3 -3
- package/dist/data-display/Chart.js +6 -6
- package/dist/data-display/DataGrid.js +3 -3
- package/dist/data-display/DataViews.js +74 -74
- package/dist/data-display/DayRuler.js +12 -12
- package/dist/data-display/FleetMap.js +12 -12
- package/dist/data-display/HoverCard.js +2 -2
- package/dist/data-display/Lightbox.js +7 -7
- package/dist/data-display/MapPreview.js +8 -8
- package/dist/data-display/Progress.js +2 -2
- package/dist/data-display/RegionMap.js +4 -4
- package/dist/data-display/ScheduleGrid.js +10 -10
- package/dist/data-display/Sheet.js +2 -2
- package/dist/data-display/Table.js +3 -3
- package/dist/feedback/Dialog.js +3 -3
- package/dist/feedback/Modal.js +2 -2
- package/dist/feedback/NotificationStatusNotice.js +5 -5
- package/dist/feedback/SequenceResolver.js +16 -16
- package/dist/feedback/TutorialOverlay.js +2 -2
- package/dist/feedback/UsableModal.js +1 -1
- package/dist/form/AddressAutocomplete.js +7 -7
- package/dist/form/Autocomplete.js +1 -1
- package/dist/form/Calendar.js +5 -5
- package/dist/form/CategorySelect.js +7 -7
- package/dist/form/CodeEditor.js +2 -2
- package/dist/form/DateRangePicker.js +10 -10
- package/dist/form/InputOTP.js +5 -3
- package/dist/form/total-form.js +9 -9
- package/dist/native/form/InputOTP.js +192 -0
- package/dist/native/form/InputOTP.js.map +1 -0
- package/dist/navigation/AppHeader.js +6 -6
- package/dist/navigation/SectionNav.js +9 -9
- package/dist/types/components/form/InputOTP/InputOTP.base.d.ts +63 -0
- package/dist/types/components/form/InputOTP/InputOTP.base.d.ts.map +1 -0
- package/dist/types/components/form/InputOTP/InputOTP.core.d.ts +38 -0
- package/dist/types/components/form/InputOTP/InputOTP.core.d.ts.map +1 -0
- package/dist/types/components/form/InputOTP/InputOTP.d.ts +1 -2
- package/dist/types/components/form/InputOTP/InputOTP.d.ts.map +1 -1
- package/dist/types/components/form/InputOTP/InputOTP.hooks.d.ts.map +1 -1
- package/dist/types/components/form/InputOTP/InputOTP.metrics.d.ts +15 -0
- package/dist/types/components/form/InputOTP/InputOTP.metrics.d.ts.map +1 -0
- package/dist/types/components/form/InputOTP/InputOTP.styles.d.ts.map +1 -1
- package/dist/types/components/form/InputOTP/InputOTP.types.d.ts +3 -56
- package/dist/types/components/form/InputOTP/InputOTP.types.d.ts.map +1 -1
- package/dist/types-native/components/form/InputOTP/InputOTP.base.d.ts +63 -0
- package/dist/types-native/components/form/InputOTP/InputOTP.base.d.ts.map +1 -0
- package/dist/types-native/components/form/InputOTP/InputOTP.core.d.ts +38 -0
- package/dist/types-native/components/form/InputOTP/InputOTP.core.d.ts.map +1 -0
- package/dist/types-native/components/form/InputOTP/InputOTP.hooks.native.d.ts +28 -0
- package/dist/types-native/components/form/InputOTP/InputOTP.hooks.native.d.ts.map +1 -0
- package/dist/types-native/components/form/InputOTP/InputOTP.metrics.d.ts +15 -0
- package/dist/types-native/components/form/InputOTP/InputOTP.metrics.d.ts.map +1 -0
- package/dist/types-native/components/form/InputOTP/InputOTP.native.d.ts +14 -0
- package/dist/types-native/components/form/InputOTP/InputOTP.native.d.ts.map +1 -0
- package/dist/types-native/components/form/InputOTP/InputOTP.types.native.d.ts +14 -0
- package/dist/types-native/components/form/InputOTP/InputOTP.types.native.d.ts.map +1 -0
- package/dist/types-native/components/form/InputOTP/index.native.d.ts +3 -0
- package/dist/types-native/components/form/InputOTP/index.native.d.ts.map +1 -0
- package/dist/user-avatar.js +3 -3
- package/package.json +5 -1
- package/src/components/form/InputOTP/InputOTP.base.ts +76 -0
- package/src/components/form/InputOTP/InputOTP.core.ts +51 -0
- package/src/components/form/InputOTP/InputOTP.hooks.native.ts +84 -0
- package/src/components/form/InputOTP/InputOTP.hooks.ts +1 -46
- package/src/components/form/InputOTP/InputOTP.metrics.ts +19 -0
- package/src/components/form/InputOTP/InputOTP.native.tsx +154 -0
- package/src/components/form/InputOTP/InputOTP.styles.ts +4 -11
- package/src/components/form/InputOTP/InputOTP.types.native.ts +15 -0
- package/src/components/form/InputOTP/InputOTP.types.ts +3 -68
- package/src/components/form/InputOTP/NATIVE-NOTES.md +8 -0
- package/src/components/form/InputOTP/index.native.ts +2 -0
- package/dist/chunk-NQYC7V5N.js.map +0 -1
- package/dist/chunk-R6L376KR.js.map +0 -1
- /package/dist/{chunk-37MJZLQU.js.map → chunk-24OFA44S.js.map} +0 -0
- /package/dist/{chunk-R775ISK6.js.map → chunk-2L6TANRY.js.map} +0 -0
- /package/dist/{chunk-B4OZU7J4.js.map → chunk-423A7NUP.js.map} +0 -0
- /package/dist/{chunk-LFECE4R7.js.map → chunk-4EDCF7TC.js.map} +0 -0
- /package/dist/{chunk-HI7JPDD6.js.map → chunk-5357QUVE.js.map} +0 -0
- /package/dist/{chunk-F7JRQ2EI.js.map → chunk-5YX2VQFP.js.map} +0 -0
- /package/dist/{chunk-QZOQVJ5L.js.map → chunk-645GGNTW.js.map} +0 -0
- /package/dist/{chunk-N5PVD4J5.js.map → chunk-6DO672AG.js.map} +0 -0
- /package/dist/{chunk-PGJIWCQR.js.map → chunk-6EZQLNPK.js.map} +0 -0
- /package/dist/{chunk-YQMJJ7AL.js.map → chunk-6G2RAZTS.js.map} +0 -0
- /package/dist/{chunk-KNW63H63.js.map → chunk-6PQZIZMN.js.map} +0 -0
- /package/dist/{chunk-FZZMNKVF.js.map → chunk-6TAPAIRR.js.map} +0 -0
- /package/dist/{chunk-ERAMSYPR.js.map → chunk-7N4O632I.js.map} +0 -0
- /package/dist/{chunk-XFOKLWJZ.js.map → chunk-7S5PXEO7.js.map} +0 -0
- /package/dist/{chunk-UIJLDAV7.js.map → chunk-AA6YMOEK.js.map} +0 -0
- /package/dist/{chunk-CRD2WCU7.js.map → chunk-AFWUQJ4P.js.map} +0 -0
- /package/dist/{chunk-SNWCT6JN.js.map → chunk-AMIUZRDQ.js.map} +0 -0
- /package/dist/{chunk-3I7KE2N6.js.map → chunk-BNV7P52K.js.map} +0 -0
- /package/dist/{chunk-64UNVW6D.js.map → chunk-BP3ZKIPE.js.map} +0 -0
- /package/dist/{chunk-3V7OTBUZ.js.map → chunk-BQ2SFA27.js.map} +0 -0
- /package/dist/{chunk-Q5SCBQLY.js.map → chunk-BXLC3TBQ.js.map} +0 -0
- /package/dist/{chunk-Z5V5E3JW.js.map → chunk-COKPPU42.js.map} +0 -0
- /package/dist/{chunk-QADTI63U.js.map → chunk-CZVAVX5L.js.map} +0 -0
- /package/dist/{chunk-WDEVKND3.js.map → chunk-D2YJPZMU.js.map} +0 -0
- /package/dist/{chunk-OA6T2ME3.js.map → chunk-DYHOBKPU.js.map} +0 -0
- /package/dist/{chunk-6WAP7BJS.js.map → chunk-E6SPWZRN.js.map} +0 -0
- /package/dist/{chunk-UTIYB6VE.js.map → chunk-E73PAU4U.js.map} +0 -0
- /package/dist/{chunk-XR474YYX.js.map → chunk-EDVAFY76.js.map} +0 -0
- /package/dist/{chunk-MEMVZW64.js.map → chunk-EPNZQWS4.js.map} +0 -0
- /package/dist/{chunk-GZITNT7O.js.map → chunk-FGZIEZEP.js.map} +0 -0
- /package/dist/{chunk-4X2TOMK6.js.map → chunk-FKUVFPQZ.js.map} +0 -0
- /package/dist/{chunk-UN5WU2OX.js.map → chunk-GDWU7WF4.js.map} +0 -0
- /package/dist/{chunk-643YFWNK.js.map → chunk-GPWDP5FF.js.map} +0 -0
- /package/dist/{chunk-XA5ES25V.js.map → chunk-HKQWFICM.js.map} +0 -0
- /package/dist/{chunk-255WTBZ5.js.map → chunk-IWSTMVCA.js.map} +0 -0
- /package/dist/{chunk-TZC6KIK2.js.map → chunk-JG733RMP.js.map} +0 -0
- /package/dist/{chunk-7MLT66DE.js.map → chunk-K33X3PDT.js.map} +0 -0
- /package/dist/{chunk-K3PMMW23.js.map → chunk-K6VEN5VN.js.map} +0 -0
- /package/dist/{chunk-HOWAMSUY.js.map → chunk-KAWVH3AA.js.map} +0 -0
- /package/dist/{chunk-IJVBLU25.js.map → chunk-KJZ4PINO.js.map} +0 -0
- /package/dist/{chunk-REHGWN5M.js.map → chunk-KXDLLS62.js.map} +0 -0
- /package/dist/{chunk-YQ5GQ32T.js.map → chunk-KZP5YTE7.js.map} +0 -0
- /package/dist/{chunk-3V3Z4EML.js.map → chunk-L4FWEI2P.js.map} +0 -0
- /package/dist/{chunk-UKUGSU3Y.js.map → chunk-L4V7FZJI.js.map} +0 -0
- /package/dist/{chunk-W56KN53D.js.map → chunk-L6IDPTNX.js.map} +0 -0
- /package/dist/{chunk-24HHUCWB.js.map → chunk-LDCZPZPD.js.map} +0 -0
- /package/dist/{chunk-KV7LTOWC.js.map → chunk-M225SD4H.js.map} +0 -0
- /package/dist/{chunk-FQMLTCXT.js.map → chunk-MAHY7PK3.js.map} +0 -0
- /package/dist/{chunk-Z2J4MRTF.js.map → chunk-MKNW4FRR.js.map} +0 -0
- /package/dist/{chunk-ILJ3FXIC.js.map → chunk-MM3QESLI.js.map} +0 -0
- /package/dist/{chunk-FYJL432J.js.map → chunk-MQPUS773.js.map} +0 -0
- /package/dist/{chunk-VRSW7PIO.js.map → chunk-NKBSWAP3.js.map} +0 -0
- /package/dist/{chunk-ULC4SCFC.js.map → chunk-NLJ7LL6H.js.map} +0 -0
- /package/dist/{chunk-RAQD5QCM.js.map → chunk-NQ6JP5CC.js.map} +0 -0
- /package/dist/{chunk-IFOHCY4O.js.map → chunk-OF3KG5EV.js.map} +0 -0
- /package/dist/{chunk-W676GY42.js.map → chunk-P772HCHI.js.map} +0 -0
- /package/dist/{chunk-CWRQGA2T.js.map → chunk-POIENBXE.js.map} +0 -0
- /package/dist/{chunk-FW5GTAUY.js.map → chunk-Q4AX4FOK.js.map} +0 -0
- /package/dist/{chunk-XQAFSC66.js.map → chunk-Q4FNCT4C.js.map} +0 -0
- /package/dist/{chunk-PIELY4BJ.js.map → chunk-Q5Z66LKI.js.map} +0 -0
- /package/dist/{chunk-4Y3QLISA.js.map → chunk-Q7AONB4G.js.map} +0 -0
- /package/dist/{chunk-EZBBLLEU.js.map → chunk-QQBYZ3B3.js.map} +0 -0
- /package/dist/{chunk-FT3LJZWZ.js.map → chunk-RWUXMBSO.js.map} +0 -0
- /package/dist/{chunk-KWBMM6MJ.js.map → chunk-RZKKWIGQ.js.map} +0 -0
- /package/dist/{chunk-RVBLOR32.js.map → chunk-S7CXVIEF.js.map} +0 -0
- /package/dist/{chunk-WLLUARTC.js.map → chunk-T2G4LDU5.js.map} +0 -0
- /package/dist/{chunk-OFRQMFWD.js.map → chunk-T5D3DYVN.js.map} +0 -0
- /package/dist/{chunk-O4UXH7BM.js.map → chunk-TP6KZ2YR.js.map} +0 -0
- /package/dist/{chunk-HAWOS4SF.js.map → chunk-TPDN3B5T.js.map} +0 -0
- /package/dist/{chunk-54DOLCJ3.js.map → chunk-TXIIJW6C.js.map} +0 -0
- /package/dist/{chunk-HN36UVOE.js.map → chunk-U4Z6GZDW.js.map} +0 -0
- /package/dist/{chunk-J2IQ6FJ5.js.map → chunk-UKLNLWTP.js.map} +0 -0
- /package/dist/{chunk-MKHNLRVX.js.map → chunk-VPPD2AJN.js.map} +0 -0
- /package/dist/{chunk-TIM4PXWN.js.map → chunk-VWRXSBT2.js.map} +0 -0
- /package/dist/{chunk-KVP5A3YK.js.map → chunk-WDWZKTGA.js.map} +0 -0
- /package/dist/{chunk-FYSS2PYA.js.map → chunk-WH5ZEBKS.js.map} +0 -0
- /package/dist/{chunk-KAGXV3ID.js.map → chunk-WMMXOSZG.js.map} +0 -0
- /package/dist/{chunk-4RSFYS2V.js.map → chunk-X6D5JEUV.js.map} +0 -0
- /package/dist/{chunk-GFYDOH7D.js.map → chunk-XEPNAU3T.js.map} +0 -0
- /package/dist/{chunk-VMACQT3T.js.map → chunk-XH7UDC5Y.js.map} +0 -0
- /package/dist/{chunk-PDWQJFMK.js.map → chunk-XHMHHP7B.js.map} +0 -0
- /package/dist/{chunk-SA3KLZDZ.js.map → chunk-XNAI7QGU.js.map} +0 -0
- /package/dist/{chunk-7TENMQNQ.js.map → chunk-XZMSRHFD.js.map} +0 -0
- /package/dist/{chunk-HBHBRRSW.js.map → chunk-YBAK2WN5.js.map} +0 -0
- /package/dist/{chunk-QLKUWDMQ.js.map → chunk-YDJ5GAGL.js.map} +0 -0
- /package/dist/{chunk-LOLYBFYY.js.map → chunk-ZCNR4DN5.js.map} +0 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The numbers both renderers read (see `NATIVE.md`, "Numbers").
|
|
3
|
+
*
|
|
4
|
+
* Each box's type size, in design px, per size step; its side is the theme's
|
|
5
|
+
* field height for that step (a square), its weight 600.
|
|
6
|
+
*/
|
|
7
|
+
export declare const OTP_FONT_PX: Record<'xs' | 'sm' | 'md' | 'lg' | 'xl', number>;
|
|
8
|
+
/** The gap between two boxes: MUI's `gap: 1`, one 8px spacing unit. */
|
|
9
|
+
export declare const OTP_GAP_PX = 8;
|
|
10
|
+
/** The border: 1px at rest, 2px focused (MUI's focused outline). */
|
|
11
|
+
export declare const OTP_BORDER: {
|
|
12
|
+
readonly rest: 1;
|
|
13
|
+
readonly focused: 2;
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=InputOTP.metrics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputOTP.metrics.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/InputOTP/InputOTP.metrics.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,EAAE,MAAM,CAMxE,CAAC;AAEF,uEAAuE;AACvE,eAAO,MAAM,UAAU,IAAI,CAAC;AAE5B,oEAAoE;AACpE,eAAO,MAAM,UAAU;;;CAAmC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputOTP.styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/InputOTP/InputOTP.styles.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"InputOTP.styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/InputOTP/InputOTP.styles.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAoDtE,MAAM,WAAW,YAAY;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,SAAS,GAAI,OAAO,KAAK,EAAE,OAAO,YAAY,KAAG,SAkC7D,CAAC"}
|
|
@@ -1,57 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* The variant of the OTP input
|
|
5
|
-
*/
|
|
6
|
-
variant?: 'numeric' | 'alphanumeric' | 'masked';
|
|
7
|
-
/**
|
|
8
|
-
* The color theme of the OTP input
|
|
9
|
-
*/
|
|
10
|
-
color?: ColorValue;
|
|
11
|
-
/**
|
|
12
|
-
* The size of the OTP input
|
|
13
|
-
*/
|
|
14
|
-
size?: SizeValue;
|
|
15
|
-
/**
|
|
16
|
-
* Number of OTP digits
|
|
17
|
-
*/
|
|
18
|
-
length?: number;
|
|
19
|
-
/**
|
|
20
|
-
* Current value
|
|
21
|
-
*/
|
|
22
|
-
value?: string;
|
|
23
|
-
/**
|
|
24
|
-
* Called when value changes
|
|
25
|
-
*/
|
|
26
|
-
onChange?: (value: string) => void;
|
|
27
|
-
/**
|
|
28
|
-
* Called when OTP is complete
|
|
29
|
-
*/
|
|
30
|
-
onComplete?: (value: string) => void;
|
|
31
|
-
/**
|
|
32
|
-
* Whether the input should have glass morphism effect
|
|
33
|
-
*/
|
|
34
|
-
glass?: boolean;
|
|
35
|
-
/**
|
|
36
|
-
* Whether the input should have gradient effects
|
|
37
|
-
*/
|
|
38
|
-
gradient?: boolean;
|
|
39
|
-
/**
|
|
40
|
-
* Whether to auto-focus first input
|
|
41
|
-
*/
|
|
42
|
-
autoFocus?: boolean;
|
|
43
|
-
/**
|
|
44
|
-
* Error state
|
|
45
|
-
*/
|
|
46
|
-
error?: boolean;
|
|
47
|
-
/**
|
|
48
|
-
* Disabled state
|
|
49
|
-
*/
|
|
50
|
-
disabled?: boolean;
|
|
51
|
-
/**
|
|
52
|
-
* Test ID for automated testing
|
|
53
|
-
* Container will have this ID, and individual slots will have {dataTestId}-slot-{index}
|
|
54
|
-
*/
|
|
55
|
-
dataTestId?: string;
|
|
56
|
-
}
|
|
1
|
+
import type { InputOTPBaseProps } from './InputOTP.base';
|
|
2
|
+
/** The web `InputOTP`'s props: the shared contract, nothing MUI adds. */
|
|
3
|
+
export type InputOTPProps = InputOTPBaseProps;
|
|
57
4
|
//# sourceMappingURL=InputOTP.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputOTP.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/InputOTP/InputOTP.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"InputOTP.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/InputOTP/InputOTP.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,yEAAyE;AACzE,MAAM,MAAM,aAAa,GAAG,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { ColorValue, SizeValue } from '../../../tokens/vocabulary';
|
|
2
|
+
/**
|
|
3
|
+
* THE CONTRACT BOTH RENDERERS HONOUR (see `Button.base.ts`).
|
|
4
|
+
*
|
|
5
|
+
* No MUI and no react-native here: this file ships in both declaration
|
|
6
|
+
* outputs, and a native consumer has no `@mui/material` to resolve against.
|
|
7
|
+
*/
|
|
8
|
+
export interface InputOTPBaseProps {
|
|
9
|
+
/**
|
|
10
|
+
* The variant of the OTP input
|
|
11
|
+
*/
|
|
12
|
+
variant?: 'numeric' | 'alphanumeric' | 'masked';
|
|
13
|
+
/**
|
|
14
|
+
* The color theme of the OTP input
|
|
15
|
+
*/
|
|
16
|
+
color?: ColorValue;
|
|
17
|
+
/**
|
|
18
|
+
* The size of the OTP input
|
|
19
|
+
*/
|
|
20
|
+
size?: SizeValue;
|
|
21
|
+
/**
|
|
22
|
+
* Number of OTP digits
|
|
23
|
+
*/
|
|
24
|
+
length?: number;
|
|
25
|
+
/**
|
|
26
|
+
* Current value
|
|
27
|
+
*/
|
|
28
|
+
value?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Called when value changes
|
|
31
|
+
*/
|
|
32
|
+
onChange?: (value: string) => void;
|
|
33
|
+
/**
|
|
34
|
+
* Called when OTP is complete
|
|
35
|
+
*/
|
|
36
|
+
onComplete?: (value: string) => void;
|
|
37
|
+
/**
|
|
38
|
+
* Whether the input should have glass morphism effect
|
|
39
|
+
*/
|
|
40
|
+
glass?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Whether the input should have gradient effects
|
|
43
|
+
*/
|
|
44
|
+
gradient?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Whether to auto-focus first input
|
|
47
|
+
*/
|
|
48
|
+
autoFocus?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Error state
|
|
51
|
+
*/
|
|
52
|
+
error?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Disabled state
|
|
55
|
+
*/
|
|
56
|
+
disabled?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Test ID for automated testing
|
|
59
|
+
* Container will have this ID, and individual slots will have {dataTestId}-slot-{index}
|
|
60
|
+
*/
|
|
61
|
+
dataTestId?: string;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=InputOTP.base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputOTP.base.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/InputOTP/InputOTP.base.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAExE;;;;;GAKG;AAEH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,cAAc,GAAG,QAAQ,CAAC;IAEhD;;OAEG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC;IAEnB;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IAEjB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAEnC;;OAEG;IACH,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAErC;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The digits' arithmetic, shared by both renderers' hooks (`InputOTP.hooks.ts`
|
|
3
|
+
* on the web, `InputOTP.hooks.native.ts` on React Native). Pure: no React, no
|
|
4
|
+
* DOM, no react-native.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* What each variant accepts. `masked` constrains nothing — it only changes what
|
|
8
|
+
* is drawn — so it has no pattern here.
|
|
9
|
+
*/
|
|
10
|
+
export declare const PATTERNS: Record<string, RegExp>;
|
|
11
|
+
/** Whether `text` is something this variant will take. */
|
|
12
|
+
export declare const isAllowed: (variant: string, text: string) => boolean;
|
|
13
|
+
/** The digit array is always `length` long, blank-padded on the right. */
|
|
14
|
+
export declare const padTo: (digits: string[], length: number) => string[];
|
|
15
|
+
/**
|
|
16
|
+
* What a change to the numeric FIRST slot is, now that its `maxLength` is the
|
|
17
|
+
* code's length rather than 1 (FUT-4144).
|
|
18
|
+
*
|
|
19
|
+
* That slot carries `one-time-code`, and the phone's SMS fill (or a password
|
|
20
|
+
* manager) writes the WHOLE code into it as one change, not a paste — kept to
|
|
21
|
+
* one character, the code lost every digit but the last. So:
|
|
22
|
+
*
|
|
23
|
+
* - `overtype`: a keystroke into the already-filled slot (its old character
|
|
24
|
+
* plus the new one). Ignored, exactly as `maxLength={1}` refused it before.
|
|
25
|
+
* - `code`: anything else longer than one character, written in one go.
|
|
26
|
+
* Spread across the slots like a paste.
|
|
27
|
+
*
|
|
28
|
+
* Every other slot and variant keeps `maxLength={1}` and never gets here.
|
|
29
|
+
*/
|
|
30
|
+
export declare function firstSlotFill(variant: string, index: number, inputValue: string, current: string): "overtype" | "code" | null;
|
|
31
|
+
/**
|
|
32
|
+
* The code inside a first-slot fill. A phone that INSERTS the SMS code at the
|
|
33
|
+
* caret rather than replacing the slot leaves the digit already there in
|
|
34
|
+
* front: `4` + `482913` arrives as `4482913`, which spread as-is would give
|
|
35
|
+
* `448291`. Longer than the code and led by that digit: the digit is dropped.
|
|
36
|
+
*/
|
|
37
|
+
export declare const codeOfFill: (inputValue: string, current: string, length: number) => string;
|
|
38
|
+
//# sourceMappingURL=InputOTP.core.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputOTP.core.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/InputOTP/InputOTP.core.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;GAGG;AACH,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAG3C,CAAC;AAEF,0DAA0D;AAC1D,eAAO,MAAM,SAAS,GAAI,SAAS,MAAM,EAAE,MAAM,MAAM,YAA2C,CAAC;AAEnG,0EAA0E;AAC1E,eAAO,MAAM,KAAK,GAAI,QAAQ,MAAM,EAAE,EAAE,QAAQ,MAAM,aACH,CAAC;AAEpD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,8BAIhG;AAED;;;;;GAKG;AACH,eAAO,MAAM,UAAU,GAAI,YAAY,MAAM,EAAE,SAAS,MAAM,EAAE,QAAQ,MAAM,KAAG,MACkC,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** What a box needs from the element behind it: to take the focus. */
|
|
2
|
+
interface Focusable {
|
|
3
|
+
focus: () => void;
|
|
4
|
+
}
|
|
5
|
+
interface NativeOtpInput {
|
|
6
|
+
variant: string;
|
|
7
|
+
length: number;
|
|
8
|
+
value: string;
|
|
9
|
+
onChange?: (value: string) => void;
|
|
10
|
+
onComplete?: (value: string) => void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The native boxes' digits — the web hook's rules (`InputOTP.hooks.ts`) over
|
|
14
|
+
* React Native's events: `onChangeText` carries the box's whole new text and
|
|
15
|
+
* `onKeyPress` carries only the key's name, and there is no paste event at
|
|
16
|
+
* all. A pasted or SMS-filled code arrives as a change of the FIRST box, whose
|
|
17
|
+
* `maxLength` is the code's length plus one for exactly that reason, and is
|
|
18
|
+
* spread across the boxes by the same `firstSlotFill` / `codeOfFill` the web
|
|
19
|
+
* uses.
|
|
20
|
+
*/
|
|
21
|
+
export declare const useNativeOtpDigits: ({ variant, length, value, onChange, onComplete }: NativeOtpInput) => {
|
|
22
|
+
digits: string[];
|
|
23
|
+
boxRefs: import("react").RefObject<(Focusable | null)[]>;
|
|
24
|
+
handleChangeText: (index: number, text: string) => void;
|
|
25
|
+
handleKey: (index: number, key: string) => void;
|
|
26
|
+
};
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=InputOTP.hooks.native.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputOTP.hooks.native.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/InputOTP/InputOTP.hooks.native.ts"],"names":[],"mappings":"AAIA,sEAAsE;AACtE,UAAU,SAAS;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED,UAAU,cAAc;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACtC;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB,GAAI,kDAAkD,cAAc;;;8BA+BvF,MAAM,QAAQ,MAAM;uBAmBpB,MAAM,OAAO,MAAM;CAO9B,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The numbers both renderers read (see `NATIVE.md`, "Numbers").
|
|
3
|
+
*
|
|
4
|
+
* Each box's type size, in design px, per size step; its side is the theme's
|
|
5
|
+
* field height for that step (a square), its weight 600.
|
|
6
|
+
*/
|
|
7
|
+
export declare const OTP_FONT_PX: Record<'xs' | 'sm' | 'md' | 'lg' | 'xl', number>;
|
|
8
|
+
/** The gap between two boxes: MUI's `gap: 1`, one 8px spacing unit. */
|
|
9
|
+
export declare const OTP_GAP_PX = 8;
|
|
10
|
+
/** The border: 1px at rest, 2px focused (MUI's focused outline). */
|
|
11
|
+
export declare const OTP_BORDER: {
|
|
12
|
+
readonly rest: 1;
|
|
13
|
+
readonly focused: 2;
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=InputOTP.metrics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputOTP.metrics.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/InputOTP/InputOTP.metrics.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,EAAE,MAAM,CAMxE,CAAC;AAEF,uEAAuE;AACvE,eAAO,MAAM,UAAU,IAAI,CAAC;AAE5B,oEAAoE;AACpE,eAAO,MAAM,UAAU;;;CAAmC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import type { InputOTPProps } from './InputOTP.types.native';
|
|
4
|
+
/**
|
|
5
|
+
* The native `InputOTP`: one row of boxes, one character each, that moves
|
|
6
|
+
* forward as it is typed, steps back on Backspace in an empty box, and spreads
|
|
7
|
+
* a code the phone fills (or a paste) across every box from the first.
|
|
8
|
+
*
|
|
9
|
+
* The same props as the web one; the row is a `group` named by `aria-label`,
|
|
10
|
+
* each box is `${dataTestId}-slot-${index}`. Gaps against the web:
|
|
11
|
+
* `NATIVE-NOTES.md`.
|
|
12
|
+
*/
|
|
13
|
+
export declare const InputOTP: React.ForwardRefExoticComponent<InputOTPProps & React.RefAttributes<View>>;
|
|
14
|
+
//# sourceMappingURL=InputOTP.native.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputOTP.native.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/InputOTP/InputOTP.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAmC,IAAI,EAAuC,MAAM,cAAc,CAAC;AAI1G,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AA0E7D;;;;;;;;GAQG;AACH,eAAO,MAAM,QAAQ,4EAsDnB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
2
|
+
import type { InputOTPBaseProps } from './InputOTP.base';
|
|
3
|
+
/**
|
|
4
|
+
* The native `InputOTP`'s props: the shared contract, plus the group's
|
|
5
|
+
* accessible name (the web takes it as a plain `aria-label` attribute) and the
|
|
6
|
+
* row's `style`.
|
|
7
|
+
*/
|
|
8
|
+
export interface InputOTPProps extends InputOTPBaseProps {
|
|
9
|
+
/** Names the boxes together, as one group. */
|
|
10
|
+
'aria-label'?: string;
|
|
11
|
+
/** The row's own style; the boxes keep theirs. */
|
|
12
|
+
style?: StyleProp<ViewStyle>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=InputOTP.types.native.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputOTP.types.native.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/InputOTP/InputOTP.types.native.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEzD;;;;GAIG;AACH,MAAM,WAAW,aAAc,SAAQ,iBAAiB;IACtD,8CAA8C;IAC9C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kDAAkD;IAClD,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/InputOTP/index.native.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,YAAY,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC"}
|
package/dist/user-avatar.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
UserAvatar,
|
|
3
3
|
UserMenu
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-4EDCF7TC.js";
|
|
5
5
|
import "./chunk-DQ22UKMZ.js";
|
|
6
6
|
import "./chunk-UDQSIRAP.js";
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-3ZVUNSFF.js";
|
|
7
|
+
import "./chunk-L6IDPTNX.js";
|
|
9
8
|
import "./chunk-EOQ6EKTS.js";
|
|
10
9
|
import "./chunk-6ZZGK5DT.js";
|
|
10
|
+
import "./chunk-3ZVUNSFF.js";
|
|
11
11
|
import "./chunk-MTEQEPNY.js";
|
|
12
12
|
import "./chunk-VUHLNYAE.js";
|
|
13
13
|
import "./chunk-2GSIEDGN.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@12-apps/ui",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.101.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"packageManager": "pnpm@10.34.5",
|
|
6
6
|
"type": "module",
|
|
@@ -433,6 +433,10 @@
|
|
|
433
433
|
"default": "./dist/form/Input/outlined.js"
|
|
434
434
|
},
|
|
435
435
|
"./form/InputOTP": {
|
|
436
|
+
"react-native": {
|
|
437
|
+
"types": "./dist/types-native/components/form/InputOTP/index.native.d.ts",
|
|
438
|
+
"default": "./dist/native/form/InputOTP.js"
|
|
439
|
+
},
|
|
436
440
|
"types": "./dist/types/components/form/InputOTP/index.d.ts",
|
|
437
441
|
"default": "./dist/form/InputOTP.js"
|
|
438
442
|
},
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { ColorValue, SizeValue } from '../../../tokens/vocabulary';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* THE CONTRACT BOTH RENDERERS HONOUR (see `Button.base.ts`).
|
|
5
|
+
*
|
|
6
|
+
* No MUI and no react-native here: this file ships in both declaration
|
|
7
|
+
* outputs, and a native consumer has no `@mui/material` to resolve against.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
export interface InputOTPBaseProps {
|
|
11
|
+
/**
|
|
12
|
+
* The variant of the OTP input
|
|
13
|
+
*/
|
|
14
|
+
variant?: 'numeric' | 'alphanumeric' | 'masked';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The color theme of the OTP input
|
|
18
|
+
*/
|
|
19
|
+
color?: ColorValue;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The size of the OTP input
|
|
23
|
+
*/
|
|
24
|
+
size?: SizeValue;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Number of OTP digits
|
|
28
|
+
*/
|
|
29
|
+
length?: number;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Current value
|
|
33
|
+
*/
|
|
34
|
+
value?: string;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Called when value changes
|
|
38
|
+
*/
|
|
39
|
+
onChange?: (value: string) => void;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Called when OTP is complete
|
|
43
|
+
*/
|
|
44
|
+
onComplete?: (value: string) => void;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Whether the input should have glass morphism effect
|
|
48
|
+
*/
|
|
49
|
+
glass?: boolean;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Whether the input should have gradient effects
|
|
53
|
+
*/
|
|
54
|
+
gradient?: boolean;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Whether to auto-focus first input
|
|
58
|
+
*/
|
|
59
|
+
autoFocus?: boolean;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Error state
|
|
63
|
+
*/
|
|
64
|
+
error?: boolean;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Disabled state
|
|
68
|
+
*/
|
|
69
|
+
disabled?: boolean;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Test ID for automated testing
|
|
73
|
+
* Container will have this ID, and individual slots will have {dataTestId}-slot-{index}
|
|
74
|
+
*/
|
|
75
|
+
dataTestId?: string;
|
|
76
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The digits' arithmetic, shared by both renderers' hooks (`InputOTP.hooks.ts`
|
|
3
|
+
* on the web, `InputOTP.hooks.native.ts` on React Native). Pure: no React, no
|
|
4
|
+
* DOM, no react-native.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* What each variant accepts. `masked` constrains nothing — it only changes what
|
|
9
|
+
* is drawn — so it has no pattern here.
|
|
10
|
+
*/
|
|
11
|
+
export const PATTERNS: Record<string, RegExp> = {
|
|
12
|
+
numeric: /^\d*$/,
|
|
13
|
+
alphanumeric: /^[a-zA-Z0-9]*$/,
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/** Whether `text` is something this variant will take. */
|
|
17
|
+
export const isAllowed = (variant: string, text: string) => (PATTERNS[variant] ?? /.*/).test(text);
|
|
18
|
+
|
|
19
|
+
/** The digit array is always `length` long, blank-padded on the right. */
|
|
20
|
+
export const padTo = (digits: string[], length: number) =>
|
|
21
|
+
Array.from({ length }, (_, i) => digits[i] ?? '');
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* What a change to the numeric FIRST slot is, now that its `maxLength` is the
|
|
25
|
+
* code's length rather than 1 (FUT-4144).
|
|
26
|
+
*
|
|
27
|
+
* That slot carries `one-time-code`, and the phone's SMS fill (or a password
|
|
28
|
+
* manager) writes the WHOLE code into it as one change, not a paste — kept to
|
|
29
|
+
* one character, the code lost every digit but the last. So:
|
|
30
|
+
*
|
|
31
|
+
* - `overtype`: a keystroke into the already-filled slot (its old character
|
|
32
|
+
* plus the new one). Ignored, exactly as `maxLength={1}` refused it before.
|
|
33
|
+
* - `code`: anything else longer than one character, written in one go.
|
|
34
|
+
* Spread across the slots like a paste.
|
|
35
|
+
*
|
|
36
|
+
* Every other slot and variant keeps `maxLength={1}` and never gets here.
|
|
37
|
+
*/
|
|
38
|
+
export function firstSlotFill(variant: string, index: number, inputValue: string, current: string) {
|
|
39
|
+
if (variant !== 'numeric' || index !== 0 || inputValue.length < 2) return null;
|
|
40
|
+
const overtype = inputValue.length === 2 && current !== '' && inputValue.includes(current);
|
|
41
|
+
return overtype ? 'overtype' : 'code';
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* The code inside a first-slot fill. A phone that INSERTS the SMS code at the
|
|
46
|
+
* caret rather than replacing the slot leaves the digit already there in
|
|
47
|
+
* front: `4` + `482913` arrives as `4482913`, which spread as-is would give
|
|
48
|
+
* `448291`. Longer than the code and led by that digit: the digit is dropped.
|
|
49
|
+
*/
|
|
50
|
+
export const codeOfFill = (inputValue: string, current: string, length: number): string =>
|
|
51
|
+
inputValue.length > length && current !== '' && inputValue.startsWith(current) ? inputValue.slice(1) : inputValue;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
|
+
|
|
3
|
+
import { codeOfFill, firstSlotFill, isAllowed, padTo } from './InputOTP.core';
|
|
4
|
+
|
|
5
|
+
/** What a box needs from the element behind it: to take the focus. */
|
|
6
|
+
interface Focusable {
|
|
7
|
+
focus: () => void;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
interface NativeOtpInput {
|
|
11
|
+
variant: string;
|
|
12
|
+
length: number;
|
|
13
|
+
value: string;
|
|
14
|
+
onChange?: (value: string) => void;
|
|
15
|
+
onComplete?: (value: string) => void;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* The native boxes' digits — the web hook's rules (`InputOTP.hooks.ts`) over
|
|
20
|
+
* React Native's events: `onChangeText` carries the box's whole new text and
|
|
21
|
+
* `onKeyPress` carries only the key's name, and there is no paste event at
|
|
22
|
+
* all. A pasted or SMS-filled code arrives as a change of the FIRST box, whose
|
|
23
|
+
* `maxLength` is the code's length plus one for exactly that reason, and is
|
|
24
|
+
* spread across the boxes by the same `firstSlotFill` / `codeOfFill` the web
|
|
25
|
+
* uses.
|
|
26
|
+
*/
|
|
27
|
+
export const useNativeOtpDigits = ({ variant, length, value, onChange, onComplete }: NativeOtpInput) => {
|
|
28
|
+
const [digits, setDigits] = useState<string[]>(() => padTo([], length));
|
|
29
|
+
const boxRefs = useRef<(Focusable | null)[]>([]);
|
|
30
|
+
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
setDigits(padTo(value.split('').slice(0, length), length));
|
|
33
|
+
}, [value, length]);
|
|
34
|
+
|
|
35
|
+
const focusBox = useCallback((index: number) => boxRefs.current[index]?.focus(), []);
|
|
36
|
+
|
|
37
|
+
const publish = useCallback(
|
|
38
|
+
(next: string) => {
|
|
39
|
+
onChange?.(next);
|
|
40
|
+
if (next.length === length) onComplete?.(next);
|
|
41
|
+
},
|
|
42
|
+
[length, onChange, onComplete],
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
/** A whole code laid across the boxes from the first one. */
|
|
46
|
+
const spread = useCallback(
|
|
47
|
+
(text: string) => {
|
|
48
|
+
const code = text.slice(0, length);
|
|
49
|
+
if (!code || !isAllowed(variant, code)) return;
|
|
50
|
+
setDigits(padTo(code.split(''), length));
|
|
51
|
+
publish(code);
|
|
52
|
+
focusBox(Math.min(code.length, length - 1));
|
|
53
|
+
},
|
|
54
|
+
[variant, length, publish, focusBox],
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
const handleChangeText = useCallback(
|
|
58
|
+
(index: number, text: string) => {
|
|
59
|
+
// The web's paste spreads a code for EVERY variant; React Native has no
|
|
60
|
+
// paste event, so a code arrives as a change of the first box, read by
|
|
61
|
+
// the numeric rule for `alphanumeric` too (`masked` shows a bullet, whose
|
|
62
|
+
// text no longer holds the digit it hides: it keeps one character a box).
|
|
63
|
+
const fill = firstSlotFill(variant === 'alphanumeric' ? 'numeric' : variant, index, text, digits[0] ?? '');
|
|
64
|
+
if (fill) return fill === 'code' ? spread(codeOfFill(text, digits[0] ?? '', length)) : undefined;
|
|
65
|
+
if (!isAllowed(variant, text)) return;
|
|
66
|
+
const next = [...digits];
|
|
67
|
+
next[index] = text.slice(-1);
|
|
68
|
+
setDigits(next);
|
|
69
|
+
publish(next.join(''));
|
|
70
|
+
if (text && index < length - 1) focusBox(index + 1);
|
|
71
|
+
},
|
|
72
|
+
[variant, digits, length, publish, focusBox, spread],
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
/** Backspace in a box that is already empty steps back to the one before. */
|
|
76
|
+
const handleKey = useCallback(
|
|
77
|
+
(index: number, key: string) => {
|
|
78
|
+
if (key === 'Backspace' && !digits[index] && index > 0) focusBox(index - 1);
|
|
79
|
+
},
|
|
80
|
+
[digits, focusBox],
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
return { digits, boxRefs, handleChangeText, handleKey };
|
|
84
|
+
};
|
|
@@ -1,51 +1,6 @@
|
|
|
1
1
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* What each variant accepts. `masked` constrains nothing — it only changes what
|
|
6
|
-
* is drawn — so it has no pattern here.
|
|
7
|
-
*/
|
|
8
|
-
const PATTERNS: Record<string, RegExp> = {
|
|
9
|
-
numeric: /^\d*$/,
|
|
10
|
-
alphanumeric: /^[a-zA-Z0-9]*$/,
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
/** Whether `text` is something this variant will take. */
|
|
14
|
-
const isAllowed = (variant: string, text: string) => (PATTERNS[variant] ?? /.*/).test(text);
|
|
15
|
-
|
|
16
|
-
/** The digit array is always `length` long, blank-padded on the right. */
|
|
17
|
-
const padTo = (digits: string[], length: number) =>
|
|
18
|
-
Array.from({ length }, (_, i) => digits[i] ?? '');
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* What a change to the numeric FIRST slot is, now that its `maxLength` is the
|
|
22
|
-
* code's length rather than 1 (FUT-4144).
|
|
23
|
-
*
|
|
24
|
-
* That slot carries `one-time-code`, and the phone's SMS fill (or a password
|
|
25
|
-
* manager) writes the WHOLE code into it as one change, not a paste — kept to
|
|
26
|
-
* one character, the code lost every digit but the last. So:
|
|
27
|
-
*
|
|
28
|
-
* - `overtype`: a keystroke into the already-filled slot (its old character
|
|
29
|
-
* plus the new one). Ignored, exactly as `maxLength={1}` refused it before.
|
|
30
|
-
* - `code`: anything else longer than one character, written in one go.
|
|
31
|
-
* Spread across the slots like a paste.
|
|
32
|
-
*
|
|
33
|
-
* Every other slot and variant keeps `maxLength={1}` and never gets here.
|
|
34
|
-
*/
|
|
35
|
-
function firstSlotFill(variant: string, index: number, inputValue: string, current: string) {
|
|
36
|
-
if (variant !== 'numeric' || index !== 0 || inputValue.length < 2) return null;
|
|
37
|
-
const overtype = inputValue.length === 2 && current !== '' && inputValue.includes(current);
|
|
38
|
-
return overtype ? 'overtype' : 'code';
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* The code inside a first-slot fill. A phone that INSERTS the SMS code at the
|
|
43
|
-
* caret rather than replacing the slot leaves the digit already there in
|
|
44
|
-
* front: `4` + `482913` arrives as `4482913`, which spread as-is would give
|
|
45
|
-
* `448291`. Longer than the code and led by that digit: the digit is dropped.
|
|
46
|
-
*/
|
|
47
|
-
const codeOfFill = (inputValue: string, current: string, length: number): string =>
|
|
48
|
-
inputValue.length > length && current !== '' && inputValue.startsWith(current) ? inputValue.slice(1) : inputValue;
|
|
3
|
+
import { codeOfFill, firstSlotFill, isAllowed, padTo } from './InputOTP.core';
|
|
49
4
|
|
|
50
5
|
interface OtpInput {
|
|
51
6
|
variant: string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The numbers both renderers read (see `NATIVE.md`, "Numbers").
|
|
3
|
+
*
|
|
4
|
+
* Each box's type size, in design px, per size step; its side is the theme's
|
|
5
|
+
* field height for that step (a square), its weight 600.
|
|
6
|
+
*/
|
|
7
|
+
export const OTP_FONT_PX: Record<'xs' | 'sm' | 'md' | 'lg' | 'xl', number> = {
|
|
8
|
+
xs: 12,
|
|
9
|
+
sm: 14,
|
|
10
|
+
md: 16,
|
|
11
|
+
lg: 18,
|
|
12
|
+
xl: 20,
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/** The gap between two boxes: MUI's `gap: 1`, one 8px spacing unit. */
|
|
16
|
+
export const OTP_GAP_PX = 8;
|
|
17
|
+
|
|
18
|
+
/** The border: 1px at rest, 2px focused (MUI's focused outline). */
|
|
19
|
+
export const OTP_BORDER = { rest: 1, focused: 2 } as const;
|