@kapiuara/ui 0.11.0 → 0.13.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/README.md +1197 -49
- package/dist/components/chat/KapiChatDivider.d.ts +1 -2
- package/dist/components/chat/KapiChatDivider.js +1 -0
- package/dist/components/chat/KapiChatList.d.ts +10 -6
- package/dist/components/chat/KapiChatList.js +12 -11
- package/dist/components/chat/KapiChatThread.d.ts +2 -3
- package/dist/components/chat/KapiChatThread.js +73 -52
- package/dist/components/chat/KapiComposer.d.ts +3 -4
- package/dist/components/chat/KapiComposer.js +2 -1
- package/dist/components/chat/KapiMessageBubble.d.ts +3 -4
- package/dist/components/chat/KapiMessageBubble.js +1 -0
- package/dist/components/chat/KapiTypingIndicator.d.ts +2 -3
- package/dist/components/chat/KapiTypingIndicator.js +1 -0
- package/dist/components/chat/chatLogic.d.ts +6 -0
- package/dist/components/chat/chatLogic.js +2 -2
- package/dist/components/chat/index.d.ts +18 -14
- package/dist/components/data/KapiBarChart.d.ts +23 -15
- package/dist/components/data/KapiBarChart.js +54 -51
- package/dist/components/data/KapiDataTable.d.ts +56 -0
- package/dist/components/data/KapiDataTable.js +143 -0
- package/dist/components/data/KapiEventCalendar.d.ts +9 -4
- package/dist/components/data/KapiEventCalendar.js +100 -96
- package/dist/components/data/KapiHeatmap.d.ts +8 -9
- package/dist/components/data/KapiHeatmap.js +64 -63
- package/dist/components/data/KapiLineChart.d.ts +19 -11
- package/dist/components/data/KapiLineChart.js +59 -55
- package/dist/components/data/KapiPagination.d.ts +6 -4
- package/dist/components/data/KapiPagination.js +2 -1
- package/dist/components/data/KapiPaginationFooter.d.ts +2 -3
- package/dist/components/data/KapiPaginationFooter.js +7 -4
- package/dist/components/data/KapiSparkline.d.ts +8 -9
- package/dist/components/data/KapiSparkline.js +1 -0
- package/dist/components/data/KapiTable.d.ts +7 -337
- package/dist/components/data/KapiTable.js +417 -692
- package/dist/components/data/KapiTableFilter.d.ts +16 -10
- package/dist/components/data/KapiTableFilter.js +50 -48
- package/dist/components/data/KapiTableRow.d.ts +55 -0
- package/dist/components/data/KapiTableRow.js +103 -0
- package/dist/components/data/KapiTableToolbar.d.ts +37 -0
- package/dist/components/data/KapiTableToolbar.js +237 -0
- package/dist/components/data/chartFrame.d.ts +18 -2
- package/dist/components/data/chartFrame.js +54 -55
- package/dist/components/data/datasetSelectionLogic.d.ts +7 -4
- package/dist/components/data/datasetSelectionLogic.js +3 -2
- package/dist/components/data/eventCalendarLogic.d.ts +7 -3
- package/dist/components/data/eventCalendarLogic.js +5 -4
- package/dist/components/data/index.d.ts +108 -30
- package/dist/components/data/rowClickLogic.d.ts +51 -0
- package/dist/components/data/rowClickLogic.js +56 -0
- package/dist/components/data/tableCells.d.ts +38 -0
- package/dist/components/data/tableCells.js +121 -0
- package/dist/components/data/tableHeaderMenu.d.ts +21 -0
- package/dist/components/data/tableHeaderMenu.js +45 -0
- package/dist/components/data/tableLabels.d.ts +76 -0
- package/dist/components/data/tableLabels.js +48 -0
- package/dist/components/data/tableLogic.d.ts +119 -21
- package/dist/components/data/tableLogic.js +121 -84
- package/dist/components/data/tablePaginationLogic.d.ts +15 -0
- package/dist/components/data/tablePaginationLogic.js +15 -0
- package/dist/components/data/tableResizeLogic.d.ts +12 -4
- package/dist/components/data/tableResizeLogic.js +14 -10
- package/dist/components/data/tableTypes.d.ts +509 -0
- package/dist/components/data/useColumnResize.d.ts +28 -0
- package/dist/components/data/useColumnResize.js +116 -0
- package/dist/components/data/useRowKeyWarning.d.ts +10 -0
- package/dist/components/data/useRowKeyWarning.js +29 -0
- package/dist/components/data/useTableEdges.d.ts +15 -0
- package/dist/components/data/useTableEdges.js +26 -0
- package/dist/components/data/useTableSelection.d.ts +51 -0
- package/dist/components/data/useTableSelection.js +80 -0
- package/dist/components/display/KapiAnnotation.d.ts +10 -9
- package/dist/components/display/KapiAnnotation.js +98 -101
- package/dist/components/display/KapiAvatar.d.ts +19 -13
- package/dist/components/display/KapiAvatar.js +26 -24
- package/dist/components/display/KapiAvatarGroup.d.ts +26 -10
- package/dist/components/display/KapiAvatarGroup.js +26 -24
- package/dist/components/display/KapiBadge.d.ts +23 -12
- package/dist/components/display/KapiBadge.js +20 -15
- package/dist/components/display/KapiComment.d.ts +1 -2
- package/dist/components/display/KapiComment.js +3 -2
- package/dist/components/display/KapiCommentComposer.d.ts +2 -3
- package/dist/components/display/KapiCommentComposer.js +3 -2
- package/dist/components/display/KapiDescriptionList.d.ts +6 -5
- package/dist/components/display/KapiDescriptionList.js +1 -0
- package/dist/components/display/KapiFileItem.d.ts +2 -3
- package/dist/components/display/KapiFileItem.js +3 -2
- package/dist/components/display/KapiFileViewer.d.ts +8 -9
- package/dist/components/display/KapiFileViewer.js +1 -0
- package/dist/components/display/KapiIconTile.d.ts +7 -6
- package/dist/components/display/KapiIconTile.js +1 -0
- package/dist/components/display/KapiStat.d.ts +9 -8
- package/dist/components/display/KapiStat.js +1 -0
- package/dist/components/display/KapiTag.d.ts +5 -4
- package/dist/components/display/KapiTag.js +1 -0
- package/dist/components/display/KapiTimeline.d.ts +6 -5
- package/dist/components/display/KapiTimeline.js +1 -0
- package/dist/components/display/KapiTruncate.d.ts +1 -2
- package/dist/components/display/KapiTruncate.js +1 -0
- package/dist/components/display/fileItemLogic.d.ts +1 -1
- package/dist/components/display/iconTileLogic.d.ts +2 -2
- package/dist/components/display/index.d.ts +86 -44
- package/dist/components/display/statLogic.d.ts +1 -1
- package/dist/components/feedback/KapiAlert.d.ts +30 -7
- package/dist/components/feedback/KapiAlert.js +47 -23
- package/dist/components/feedback/KapiBulkBar.d.ts +11 -6
- package/dist/components/feedback/KapiBulkBar.js +6 -3
- package/dist/components/feedback/KapiCountdown.d.ts +15 -12
- package/dist/components/feedback/KapiCountdown.js +17 -16
- package/dist/components/feedback/KapiEmpty.d.ts +3 -2
- package/dist/components/feedback/KapiEmpty.js +1 -0
- package/dist/components/feedback/KapiFab.d.ts +39 -9
- package/dist/components/feedback/KapiFab.js +172 -91
- package/dist/components/feedback/KapiOfflineBanner.d.ts +7 -6
- package/dist/components/feedback/KapiOfflineBanner.js +1 -0
- package/dist/components/feedback/KapiProgress.d.ts +8 -7
- package/dist/components/feedback/KapiProgress.js +1 -0
- package/dist/components/feedback/KapiSkeleton.d.ts +6 -4
- package/dist/components/feedback/KapiToastContainer.d.ts +16 -8
- package/dist/components/feedback/KapiToastContainer.js +118 -63
- package/dist/components/feedback/KapiTour.d.ts +6 -7
- package/dist/components/feedback/KapiTour.js +91 -86
- package/dist/components/feedback/KapiUnsavedBar.d.ts +15 -8
- package/dist/components/feedback/KapiUnsavedBar.js +8 -4
- package/dist/components/feedback/bulkBarLogic.d.ts +6 -1
- package/dist/components/feedback/bulkBarLogic.js +7 -4
- package/dist/components/feedback/countdownLogic.d.ts +19 -11
- package/dist/components/feedback/fabLogic.d.ts +28 -0
- package/dist/components/feedback/fabLogic.js +18 -2
- package/dist/components/feedback/index.d.ts +65 -33
- package/dist/components/feedback/toastLayer.d.ts +18 -0
- package/dist/components/feedback/toastLayer.js +22 -0
- package/dist/components/feedback/toastStore.d.ts +97 -9
- package/dist/components/feedback/toastStore.js +132 -29
- package/dist/components/feedback/tourLogic.d.ts +4 -16
- package/dist/components/feedback/unsavedBarLogic.d.ts +7 -1
- package/dist/components/feedback/unsavedBarLogic.js +9 -5
- package/dist/components/inputs/KapiAutocomplete.d.ts +73 -48
- package/dist/components/inputs/KapiAutocomplete.js +128 -146
- package/dist/components/inputs/KapiButton.d.ts +30 -11
- package/dist/components/inputs/KapiButton.js +34 -27
- package/dist/components/inputs/KapiCalendar.d.ts +14 -8
- package/dist/components/inputs/KapiCalendar.js +36 -34
- package/dist/components/inputs/KapiCalendarGrid.d.ts +11 -6
- package/dist/components/inputs/KapiCalendarGrid.js +44 -38
- package/dist/components/inputs/KapiCheckCard.d.ts +2 -3
- package/dist/components/inputs/KapiCheckCard.js +1 -0
- package/dist/components/inputs/KapiCheckbox.d.ts +1 -1
- package/dist/components/inputs/KapiChecklist.d.ts +77 -0
- package/dist/components/inputs/KapiChecklist.js +175 -0
- package/dist/components/inputs/KapiDatePicker.d.ts +60 -22
- package/dist/components/inputs/KapiDatePicker.js +122 -100
- package/dist/components/inputs/KapiDateRangePicker.d.ts +44 -10
- package/dist/components/inputs/KapiDateRangePicker.js +148 -120
- package/dist/components/inputs/KapiFacetedSearch.d.ts +16 -8
- package/dist/components/inputs/KapiFacetedSearch.js +131 -168
- package/dist/components/inputs/KapiField.d.ts +16 -8
- package/dist/components/inputs/KapiField.js +44 -43
- package/dist/components/inputs/KapiFileUpload.d.ts +15 -16
- package/dist/components/inputs/KapiFileUpload.js +1 -0
- package/dist/components/inputs/KapiIconButton.d.ts +1 -1
- package/dist/components/inputs/KapiInput.d.ts +13 -12
- package/dist/components/inputs/KapiInput.js +70 -70
- package/dist/components/inputs/KapiInputGroup.d.ts +13 -10
- package/dist/components/inputs/KapiInputGroup.js +21 -19
- package/dist/components/inputs/KapiMaskedInput.d.ts +15 -15
- package/dist/components/inputs/KapiMaskedInput.js +51 -48
- package/dist/components/inputs/KapiNumberStepper.d.ts +30 -18
- package/dist/components/inputs/KapiNumberStepper.js +80 -65
- package/dist/components/inputs/KapiRadio.d.ts +1 -1
- package/dist/components/inputs/KapiRating.d.ts +40 -23
- package/dist/components/inputs/KapiRating.js +80 -65
- package/dist/components/inputs/KapiSearchChip.d.ts +80 -0
- package/dist/components/inputs/KapiSearchChip.js +77 -0
- package/dist/components/inputs/KapiSegmented.d.ts +49 -16
- package/dist/components/inputs/KapiSegmented.js +72 -51
- package/dist/components/inputs/KapiSelect.d.ts +120 -39
- package/dist/components/inputs/KapiSelect.js +309 -379
- package/dist/components/inputs/KapiSelectMenu.d.ts +38 -0
- package/dist/components/inputs/KapiSelectMenu.js +173 -0
- package/dist/components/inputs/KapiSlider.d.ts +37 -19
- package/dist/components/inputs/KapiSlider.js +67 -54
- package/dist/components/inputs/KapiSwitch.d.ts +13 -7
- package/dist/components/inputs/KapiSwitch.js +30 -21
- package/dist/components/inputs/KapiTagInput.d.ts +35 -24
- package/dist/components/inputs/KapiTagInput.js +77 -66
- package/dist/components/inputs/KapiTextarea.d.ts +12 -11
- package/dist/components/inputs/KapiTextarea.js +71 -49
- package/dist/components/inputs/asyncSelectLogic.d.ts +8 -4
- package/dist/components/inputs/asyncSelectLogic.js +13 -12
- package/dist/components/inputs/autocompleteLogic.d.ts +2 -29
- package/dist/components/inputs/autocompleteLogic.js +6 -6
- package/dist/components/inputs/checkControl.d.ts +3 -3
- package/dist/components/inputs/checkControl.js +2 -0
- package/dist/components/inputs/checklistLogic.d.ts +33 -0
- package/dist/components/inputs/checklistLogic.js +16 -0
- package/dist/components/inputs/datePickerLogic.d.ts +63 -13
- package/dist/components/inputs/datePickerLogic.js +119 -50
- package/dist/components/inputs/dateRangeLogic.d.ts +8 -3
- package/dist/components/inputs/dateRangeLogic.js +49 -43
- package/dist/components/inputs/facetedSearchLogic.d.ts +1 -3
- package/dist/components/inputs/facetedSearchLogic.js +4 -5
- package/dist/components/inputs/fieldLogic.d.ts +37 -1
- package/dist/components/inputs/fieldLogic.js +36 -19
- package/dist/components/inputs/index.d.ts +118 -55
- package/dist/components/inputs/inputGroupLogic.d.ts +1 -1
- package/dist/components/inputs/inputLogic.d.ts +1 -1
- package/dist/components/inputs/maskLogic.d.ts +3 -2
- package/dist/components/inputs/maskLogic.js +12 -10
- package/dist/components/inputs/ownField.d.ts +37 -0
- package/dist/components/inputs/ownField.js +37 -0
- package/dist/components/inputs/searchChipLogic.d.ts +33 -0
- package/dist/components/inputs/searchChipLogic.js +13 -0
- package/dist/components/inputs/segmentedLogic.d.ts +4 -3
- package/dist/components/inputs/segmentedLogic.js +7 -11
- package/dist/components/inputs/selectKeyLogic.d.ts +45 -0
- package/dist/components/inputs/selectKeyLogic.js +52 -0
- package/dist/components/inputs/selectLogic.d.ts +79 -22
- package/dist/components/inputs/selectLogic.js +87 -51
- package/dist/components/inputs/useCalendarFocus.js +13 -12
- package/dist/components/inputs/useSelectCreate.d.ts +22 -0
- package/dist/components/inputs/useSelectCreate.js +35 -0
- package/dist/components/inputs/useSelectSource.d.ts +39 -0
- package/dist/components/inputs/useSelectSource.js +42 -0
- package/dist/components/labelsLogic.d.ts +11 -1
- package/dist/components/layout/KapiAccessCard.d.ts +11 -12
- package/dist/components/layout/KapiAccessCard.js +41 -37
- package/dist/components/layout/KapiAccountMenu.d.ts +23 -8
- package/dist/components/layout/KapiAccountMenu.js +124 -104
- package/dist/components/layout/KapiCard.d.ts +14 -7
- package/dist/components/layout/KapiCard.js +1 -0
- package/dist/components/layout/KapiCluster.d.ts +8 -7
- package/dist/components/layout/KapiCluster.js +1 -0
- package/dist/components/layout/KapiContextSlot.d.ts +10 -11
- package/dist/components/layout/KapiContextSlot.js +97 -92
- package/dist/components/layout/KapiDivider.d.ts +3 -2
- package/dist/components/layout/KapiDivider.js +1 -0
- package/dist/components/layout/KapiGrid.d.ts +8 -7
- package/dist/components/layout/KapiGrid.js +1 -0
- package/dist/components/layout/KapiMasonry.d.ts +1 -2
- package/dist/components/layout/KapiMasonry.js +1 -0
- package/dist/components/layout/KapiNotificationBell.d.ts +14 -15
- package/dist/components/layout/KapiNotificationBell.js +113 -116
- package/dist/components/layout/KapiPageHeader.d.ts +14 -6
- package/dist/components/layout/KapiPageHeader.js +99 -87
- package/dist/components/layout/KapiPanelParts.d.ts +11 -7
- package/dist/components/layout/KapiPanelParts.js +1 -0
- package/dist/components/layout/KapiRail.d.ts +17 -11
- package/dist/components/layout/KapiRail.js +96 -83
- package/dist/components/layout/KapiRailAccount.d.ts +26 -0
- package/dist/components/layout/KapiRailAccount.js +37 -0
- package/dist/components/layout/KapiRoot.d.ts +85 -0
- package/dist/components/layout/KapiRoot.js +58 -0
- package/dist/components/layout/KapiScrollArea.d.ts +2 -3
- package/dist/components/layout/KapiScrollArea.js +1 -0
- package/dist/components/layout/KapiShell.d.ts +15 -10
- package/dist/components/layout/KapiShell.js +51 -46
- package/dist/components/layout/KapiStack.d.ts +6 -5
- package/dist/components/layout/KapiStack.js +1 -0
- package/dist/components/layout/KapiThemeScript.d.ts +23 -0
- package/dist/components/layout/KapiThemeScript.js +13 -0
- package/dist/components/layout/accessCardLogic.d.ts +2 -2
- package/dist/components/layout/index.d.ts +55 -35
- package/dist/components/layout/notificationBellLogic.d.ts +1 -1
- package/dist/components/layout/railContext.d.ts +6 -0
- package/dist/components/layout/railContext.js +6 -0
- package/dist/components/layout/railLogic.d.ts +14 -14
- package/dist/components/layout/useMasonrySpans.js +31 -30
- package/dist/components/layout/useRailOverflow.js +30 -29
- package/dist/components/locale/KapiLocaleProvider.d.ts +33 -4
- package/dist/components/locale/KapiLocaleProvider.js +28 -17
- package/dist/components/locale/index.d.ts +7 -5
- package/dist/components/locale/labelRegistry.d.ts +68 -58
- package/dist/components/locale/localeLogic.d.ts +20 -0
- package/dist/components/locale/localeLogic.js +30 -0
- package/dist/components/navigation/CtxSlidingList.d.ts +5 -3
- package/dist/components/navigation/CtxSlidingList.js +15 -14
- package/dist/components/navigation/KapiAccordion.d.ts +9 -8
- package/dist/components/navigation/KapiAccordion.js +29 -29
- package/dist/components/navigation/KapiBreadcrumb.d.ts +4 -5
- package/dist/components/navigation/KapiBreadcrumb.js +1 -0
- package/dist/components/navigation/KapiCollapsiblePanel.d.ts +22 -16
- package/dist/components/navigation/KapiCollapsiblePanel.js +46 -43
- package/dist/components/navigation/KapiContextPanel.d.ts +31 -32
- package/dist/components/navigation/KapiContextPanel.js +119 -108
- package/dist/components/navigation/KapiFilterChips.d.ts +15 -10
- package/dist/components/navigation/KapiFilterChips.js +27 -22
- package/dist/components/navigation/KapiNavBadge.d.ts +7 -5
- package/dist/components/navigation/KapiNavBadge.js +12 -10
- package/dist/components/navigation/KapiPanelGroup.d.ts +22 -23
- package/dist/components/navigation/KapiPanelGroup.js +62 -60
- package/dist/components/navigation/KapiSteps.d.ts +4 -5
- package/dist/components/navigation/KapiSteps.js +1 -0
- package/dist/components/navigation/KapiTabs.d.ts +34 -16
- package/dist/components/navigation/KapiTabs.js +58 -49
- package/dist/components/navigation/KapiTree.d.ts +58 -18
- package/dist/components/navigation/KapiTree.js +135 -83
- package/dist/components/navigation/KapiWizard.d.ts +21 -11
- package/dist/components/navigation/KapiWizard.js +79 -72
- package/dist/components/navigation/MiniNavItem.d.ts +3 -4
- package/dist/components/navigation/MiniNavItem.js +1 -0
- package/dist/components/navigation/breadcrumbLogic.d.ts +1 -1
- package/dist/components/navigation/contextPanelLogic.d.ts +9 -5
- package/dist/components/navigation/filterChipsLogic.d.ts +13 -7
- package/dist/components/navigation/filterChipsLogic.js +12 -14
- package/dist/components/navigation/index.d.ts +75 -39
- package/dist/components/navigation/panelGroupLogic.d.ts +5 -1
- package/dist/components/navigation/panelMini.d.ts +1 -1
- package/dist/components/navigation/panelMini.js +1 -1
- package/dist/components/navigation/tabsLogic.d.ts +3 -2
- package/dist/components/navigation/tabsLogic.js +8 -12
- package/dist/components/navigation/treeLogic.d.ts +5 -5
- package/dist/components/navigation/treeLogic.js +3 -9
- package/dist/components/overlays/KapiCanvasForm.d.ts +8 -8
- package/dist/components/overlays/KapiCanvasForm.js +1 -1
- package/dist/components/overlays/KapiCommandPalette.d.ts +14 -10
- package/dist/components/overlays/KapiCommandPalette.js +70 -67
- package/dist/components/overlays/KapiConfirm.d.ts +28 -11
- package/dist/components/overlays/KapiConfirm.js +47 -44
- package/dist/components/overlays/KapiContextMenu.d.ts +77 -16
- package/dist/components/overlays/KapiContextMenu.js +55 -70
- package/dist/components/overlays/KapiDialogHost.d.ts +5 -7
- package/dist/components/overlays/KapiDialogHost.js +67 -64
- package/dist/components/overlays/KapiDropdown.d.ts +43 -21
- package/dist/components/overlays/KapiDropdown.js +31 -80
- package/dist/components/overlays/KapiLoading.d.ts +10 -5
- package/dist/components/overlays/KapiLoading.js +28 -25
- package/dist/components/overlays/KapiMenuButton.d.ts +48 -17
- package/dist/components/overlays/KapiMenuButton.js +73 -95
- package/dist/components/overlays/KapiModal.d.ts +16 -8
- package/dist/components/overlays/KapiModal.js +72 -65
- package/dist/components/overlays/KapiOffcanvas.d.ts +23 -13
- package/dist/components/overlays/KapiOffcanvas.js +159 -143
- package/dist/components/overlays/KapiOffcanvasStack.d.ts +4 -4
- package/dist/components/overlays/KapiOffcanvasStack.js +63 -52
- package/dist/components/overlays/KapiPhotoView.d.ts +7 -8
- package/dist/components/overlays/KapiPhotoView.js +67 -64
- package/dist/components/overlays/KapiPopover.d.ts +18 -17
- package/dist/components/overlays/KapiPopover.js +32 -42
- package/dist/components/overlays/KapiShapeSheet.d.ts +18 -12
- package/dist/components/overlays/KapiShapeSheet.js +51 -45
- package/dist/components/overlays/KapiSplitModal.d.ts +12 -11
- package/dist/components/overlays/KapiSplitModal.js +78 -68
- package/dist/components/overlays/KapiTooltip.d.ts +20 -10
- package/dist/components/overlays/KapiTooltip.js +91 -68
- package/dist/components/overlays/commandPaletteLogic.d.ts +2 -4
- package/dist/components/overlays/commandPaletteLogic.js +2 -2
- package/dist/components/overlays/dialogStore.d.ts +41 -20
- package/dist/components/overlays/dialogStore.js +4 -4
- package/dist/components/overlays/dialogUtils.d.ts +22 -0
- package/dist/components/overlays/dialogUtils.js +6 -2
- package/dist/components/overlays/index.d.ts +48 -38
- package/dist/components/overlays/menuButtonLogic.d.ts +33 -31
- package/dist/components/overlays/menuButtonLogic.js +9 -3
- package/dist/components/overlays/menuKeyboardLogic.d.ts +42 -8
- package/dist/components/overlays/menuKeyboardLogic.js +46 -15
- package/dist/components/overlays/menuList.d.ts +91 -0
- package/dist/components/overlays/menuList.js +223 -0
- package/dist/components/overlays/modalStack.d.ts +21 -0
- package/dist/components/overlays/modalStack.js +23 -0
- package/dist/components/overlays/offcanvasCompanion.d.ts +1 -1
- package/dist/components/overlays/offcanvasResize.d.ts +1 -1
- package/dist/components/overlays/offcanvasSide.d.ts +12 -1
- package/dist/components/overlays/offcanvasSide.js +4 -4
- package/dist/components/overlays/popoverLogic.d.ts +12 -12
- package/dist/components/overlays/useExitPresence.js +23 -22
- package/dist/components/overlays/useNativeDialog.d.ts +15 -4
- package/dist/components/overlays/useNativeDialog.js +52 -33
- package/dist/components/rootProps.d.ts +6 -4
- package/dist/components/tone.d.ts +55 -0
- package/dist/components/tone.js +92 -0
- package/dist/css/base.css +1 -0
- package/dist/css/components/chat/chat.css +1 -0
- package/dist/css/components/data/KapiBarChart.css +1 -0
- package/dist/css/components/data/KapiEventCalendar.css +1 -0
- package/dist/css/components/data/KapiHeatmap.css +1 -0
- package/dist/css/components/data/KapiLineChart.css +1 -0
- package/dist/css/components/data/KapiSparkline.css +1 -0
- package/dist/css/components/data/KapiTable.css +1 -0
- package/dist/css/components/data/KapiTableFilter.css +1 -0
- package/dist/css/components/display/KapiAnnotation.css +1 -0
- package/dist/css/components/display/KapiComment.css +1 -0
- package/dist/css/components/display/KapiFileItem.css +1 -0
- package/dist/css/components/display/KapiFileViewer.css +1 -0
- package/dist/css/components/display/KapiTruncate.css +1 -0
- package/dist/css/components/display/display.css +1 -0
- package/dist/css/components/feedback/KapiBulkBar.css +1 -0
- package/dist/css/components/feedback/KapiOfflineBanner.css +1 -0
- package/dist/css/components/feedback/KapiUnsavedBar.css +1 -0
- package/dist/css/components/feedback/feedback.css +1 -0
- package/dist/css/components/inputs/KapiAutocomplete.css +1 -0
- package/dist/css/components/inputs/KapiButton.css +1 -0
- package/dist/css/components/inputs/KapiChecklist.css +1 -0
- package/dist/css/components/inputs/KapiDatePicker.css +1 -0
- package/dist/css/components/inputs/KapiFacetedSearch.css +1 -0
- package/dist/css/components/inputs/KapiFileUpload.css +1 -0
- package/dist/css/components/inputs/KapiInputGroup.css +1 -0
- package/dist/css/components/inputs/KapiSearchChip.css +1 -0
- package/dist/css/components/inputs/KapiSelect.css +1 -0
- package/dist/css/components/inputs/KapiTagInput.css +1 -0
- package/dist/css/components/inputs/checkControl.css +1 -0
- package/dist/css/components/inputs/inputsExtra.css +1 -0
- package/dist/css/components/layout/KapiAccessCard.css +1 -0
- package/dist/css/components/layout/KapiAccountMenu.css +1 -0
- package/dist/css/components/layout/KapiCard.css +1 -0
- package/dist/css/components/layout/KapiDivider.css +1 -0
- package/dist/css/components/layout/KapiMasonry.css +1 -0
- package/dist/css/components/layout/KapiNotificationBell.css +1 -0
- package/dist/css/components/layout/KapiPageHeader.css +1 -0
- package/dist/css/components/layout/KapiPanelParts.css +1 -0
- package/dist/css/components/layout/KapiRail.css +1 -0
- package/dist/css/components/layout/KapiRoot.css +1 -0
- package/dist/css/components/layout/KapiScrollArea.css +1 -0
- package/dist/css/components/layout/layout-primitives.css +1 -0
- package/dist/css/components/navigation/KapiFilterChips.css +1 -0
- package/dist/css/components/navigation/KapiNavBadge.css +1 -0
- package/dist/css/components/navigation/KapiSteps.css +1 -0
- package/dist/css/components/navigation/navigation.css +1 -0
- package/dist/css/components/overlays/KapiCommandPalette.css +1 -0
- package/dist/css/components/overlays/KapiConfirm.css +1 -0
- package/dist/css/components/overlays/KapiModal.css +1 -0
- package/dist/css/components/overlays/KapiOffcanvas.css +1 -0
- package/dist/css/components/overlays/KapiPopover.css +1 -0
- package/dist/css/components/overlays/KapiSplitModal.css +1 -0
- package/dist/css/components/overlays/overlays.css +1 -0
- package/dist/css/none.js +1 -0
- package/dist/hooks/dataColorLogic.d.ts +1 -1
- package/dist/hooks/dateFormat.js +13 -13
- package/dist/hooks/directionLogic.d.ts +32 -0
- package/dist/hooks/directionLogic.js +7 -0
- package/dist/hooks/fieldErrorsLogic.d.ts +35 -0
- package/dist/hooks/fieldErrorsLogic.js +13 -0
- package/dist/hooks/focusLogic.js +8 -7
- package/dist/hooks/hotkeyLogic.d.ts +5 -1
- package/dist/hooks/hotkeyLogic.js +2 -2
- package/dist/hooks/index.d.ts +122 -57
- package/dist/hooks/kapiRoot.d.ts +11 -4
- package/dist/hooks/kapiRoot.js +18 -5
- package/dist/hooks/mergeRefs.d.ts +9 -0
- package/dist/hooks/mergeRefs.js +15 -0
- package/dist/hooks/onlineStatusLogic.d.ts +4 -4
- package/dist/hooks/ownerDocument.d.ts +26 -0
- package/dist/hooks/ownerDocument.js +24 -0
- package/dist/hooks/portalRoot.d.ts +19 -0
- package/dist/hooks/portalRoot.js +10 -0
- package/dist/hooks/rafThrottle.d.ts +12 -4
- package/dist/hooks/rafThrottle.js +43 -10
- package/dist/hooks/rangeSelectLogic.d.ts +47 -0
- package/dist/hooks/rangeSelectLogic.js +29 -0
- package/dist/hooks/recentLogic.d.ts +3 -3
- package/dist/hooks/reducedMotion.js +11 -3
- package/dist/hooks/rightClick.d.ts +5 -1
- package/dist/hooks/rightClick.js +16 -15
- package/dist/hooks/scrollCollapseLogic.d.ts +2 -2
- package/dist/hooks/seriesPaletteLogic.d.ts +1 -1
- package/dist/hooks/shallowStable.d.ts +12 -0
- package/dist/hooks/shallowStable.js +17 -0
- package/dist/hooks/slidingIndicatorLogic.d.ts +4 -0
- package/dist/hooks/themeColorsLogic.d.ts +1 -1
- package/dist/hooks/themeDeriveLogic.d.ts +1 -2
- package/dist/hooks/themeRadiiLogic.d.ts +1 -1
- package/dist/hooks/themeScript.d.ts +10 -0
- package/dist/hooks/themeScript.js +5 -0
- package/dist/hooks/useAsyncLoader.d.ts +51 -0
- package/dist/hooks/useAsyncLoader.js +77 -0
- package/dist/hooks/useAsyncTasks.d.ts +19 -0
- package/dist/hooks/useAsyncTasks.js +37 -0
- package/dist/hooks/useBottomBarInset.d.ts +7 -0
- package/dist/hooks/useBottomBarInset.js +25 -0
- package/dist/hooks/useControllableState.d.ts +21 -0
- package/dist/hooks/useControllableState.js +17 -0
- package/dist/hooks/useDismiss.d.ts +40 -0
- package/dist/hooks/useDismiss.js +42 -0
- package/dist/hooks/useDragScroll.d.ts +10 -0
- package/dist/hooks/useDragScroll.js +36 -25
- package/dist/hooks/useFieldErrors.d.ts +39 -0
- package/dist/hooks/useFieldErrors.js +29 -0
- package/dist/hooks/useFocusReturn.d.ts +25 -0
- package/dist/hooks/useFocusReturn.js +31 -0
- package/dist/hooks/useGrowOrigin.d.ts +2 -2
- package/dist/hooks/useHotkey.d.ts +3 -3
- package/dist/hooks/useHydrated.d.ts +2 -0
- package/dist/hooks/useHydrated.js +6 -0
- package/dist/hooks/useKapiTheme.d.ts +3 -2
- package/dist/hooks/useKapiTheme.js +111 -68
- package/dist/hooks/useMediaQuery.d.ts +5 -1
- package/dist/hooks/useMediaQuery.js +5 -9
- package/dist/hooks/useOnlineStatus.d.ts +1 -1
- package/dist/hooks/useOutsidePress.d.ts +9 -0
- package/dist/hooks/useOutsidePress.js +11 -0
- package/dist/hooks/usePersistentState.d.ts +2 -2
- package/dist/hooks/usePersistentState.js +21 -21
- package/dist/hooks/usePlacement.d.ts +6 -5
- package/dist/hooks/usePlacement.js +68 -65
- package/dist/hooks/useRangeSelect.d.ts +24 -0
- package/dist/hooks/useRangeSelect.js +26 -0
- package/dist/hooks/useRecent.d.ts +3 -3
- package/dist/hooks/useScrollCollapse.d.ts +1 -1
- package/dist/hooks/useScrollEdges.d.ts +9 -8
- package/dist/hooks/useScrollEdges.js +62 -57
- package/dist/hooks/useSlidingIndicator.d.ts +1 -1
- package/dist/hooks/useSlidingIndicator.js +38 -33
- package/dist/hooks/useSubmitDraft.js +18 -19
- package/dist/hooks/useTypeahead.d.ts +9 -0
- package/dist/hooks/useTypeahead.js +20 -0
- package/dist/hooks/useUnsavedGuard.d.ts +7 -4
- package/dist/hooks/useUnsavedGuard.js +1 -0
- package/dist/hooks/useVirtualList.d.ts +36 -0
- package/dist/hooks/useVirtualList.js +126 -0
- package/dist/hooks/viewportInsetLogic.d.ts +37 -0
- package/dist/hooks/viewportInsetLogic.js +20 -0
- package/dist/hooks/virtualListLogic.d.ts +88 -0
- package/dist/hooks/virtualListLogic.js +80 -0
- package/dist/index.d.ts +13 -13
- package/dist/index.js +196 -178
- package/dist/kapi.css +1 -1
- package/dist/kapi.layered.css +1 -1
- package/package.json +14 -6
|
@@ -1,115 +1,126 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import "#kapi-css/components/inputs/KapiTagInput.css";
|
|
3
|
+
import { assignRef as e, fieldControlProps as t, focusLeaves as n, joinIds as r, resolveReadOnly as i } from "./fieldLogic.js";
|
|
4
|
+
import { useOwnField as ee } from "./ownField.js";
|
|
5
|
+
import { useLabels as te } from "../locale/KapiLocaleProvider.js";
|
|
5
6
|
import { joinClasses as a } from "../rootProps.js";
|
|
7
|
+
import { useControllableState as o } from "../../hooks/useControllableState.js";
|
|
6
8
|
/* empty css */
|
|
7
|
-
import { addTags as
|
|
8
|
-
import { KapiTag as
|
|
9
|
-
import { jsx as
|
|
10
|
-
import { useCallback as
|
|
9
|
+
import { addTags as s, hasSeparator as c, removeTagAt as l, spliceText as ne, splitDraft as re, splitTags as u } from "./tagInputLogic.js";
|
|
10
|
+
import { KapiTag as ie } from "../display/KapiTag.js";
|
|
11
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
12
|
+
import { useCallback as p, useId as m, useRef as h, useState as g } from "react";
|
|
11
13
|
//#region src/components/inputs/KapiTagInput.tsx
|
|
12
14
|
var _ = {
|
|
13
15
|
remove: "Quitar",
|
|
14
16
|
duplicate: "Ya está en la lista:",
|
|
15
17
|
max: "Llegaste al máximo de"
|
|
16
|
-
}, v = ({ size: e = "md", invalid: t, disabled: n,
|
|
17
|
-
function y({ value: a, defaultValue: y = [], onChange:
|
|
18
|
-
let z =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
}, v = ({ size: e = "md", invalid: t, disabled: n, readOnly: r, className: i }) => a("kapi-taginput", e !== "md" && `kapi-taginput--${e}`, t && "kapi-taginput--err", n && "kapi-taginput--disabled", r && "kapi-taginput--readonly", i);
|
|
19
|
+
function y({ value: a, defaultValue: y = [], onChange: ae, validate: oe, maxTags: b, allowDuplicates: x, caseSensitive: S, placeholder: C, disabled: w = !1, size: T = "md", name: E, id: D, invalid: O, required: k, label: se, help: ce, fieldClassName: le, readOnly: A, "aria-label": ue, "aria-labelledby": j, "aria-describedby": M, onBlur: N, ref: P, labels: F, className: I, onClick: L, ...R }) {
|
|
20
|
+
let z = te("tagInput", _, F), B = ee({
|
|
21
|
+
id: D,
|
|
22
|
+
label: se,
|
|
23
|
+
help: ce,
|
|
24
|
+
required: k,
|
|
25
|
+
invalid: O,
|
|
26
|
+
readOnly: A,
|
|
27
|
+
fieldClassName: le
|
|
28
|
+
}), V = B.field, H = i(A, V), U = m(), [W, G] = o(a, y, ae), [K, q] = g(""), [J, Y] = g(null), X = h(null), Z = h(null), de = p((t) => {
|
|
29
|
+
Z.current = t, e(P, t);
|
|
30
|
+
}, [P]), fe = (e) => e.reason === "invalid" ? e.message : e.reason === "duplicate" ? `${z.duplicate} ${e.tag}` : `${z.max} ${b}`, Q = (e, t = "") => {
|
|
31
|
+
let { values: n, rejected: r } = s(W, e, {
|
|
32
|
+
validate: oe,
|
|
33
|
+
maxTags: b,
|
|
34
|
+
allowDuplicates: x,
|
|
35
|
+
caseSensitive: S
|
|
28
36
|
});
|
|
29
|
-
n.length !==
|
|
30
|
-
},
|
|
37
|
+
n.length !== W.length && G(n), Y(r[0] ? fe(r[0]) : null), q([...r.map((e) => e.tag), t].filter(Boolean).join(", "));
|
|
38
|
+
}, pe = (e) => {
|
|
31
39
|
let t = e.target.value;
|
|
32
|
-
if (
|
|
33
|
-
|
|
40
|
+
if (Y(null), !c(t)) {
|
|
41
|
+
q(t);
|
|
34
42
|
return;
|
|
35
43
|
}
|
|
36
|
-
let { complete: n, tail: r } =
|
|
44
|
+
let { complete: n, tail: r } = re(t);
|
|
37
45
|
Q(n, r);
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
},
|
|
46
|
+
}, me = (e) => {
|
|
47
|
+
w || H || (e.key === "Enter" && K.trim() ? (e.preventDefault(), Q(u(K))) : e.key === "Backspace" && K === "" && W.length > 0 && (e.preventDefault(), Y(null), G(l(W, W.length - 1))));
|
|
48
|
+
}, he = (e) => {
|
|
49
|
+
if (H) return;
|
|
41
50
|
let t = e.clipboardData.getData("text");
|
|
42
|
-
if (!
|
|
51
|
+
if (!c(t)) return;
|
|
43
52
|
e.preventDefault();
|
|
44
|
-
let n = e.currentTarget, r =
|
|
53
|
+
let n = e.currentTarget, r = ne(K, n.selectionStart ?? K.length, n.selectionEnd ?? K.length, t);
|
|
45
54
|
Q(u(r));
|
|
46
|
-
},
|
|
47
|
-
n(e.relatedTarget,
|
|
48
|
-
},
|
|
49
|
-
L?.(e), !(e.defaultPrevented ||
|
|
50
|
-
},
|
|
51
|
-
|
|
52
|
-
}, $ =
|
|
53
|
-
return /* @__PURE__ */
|
|
55
|
+
}, ge = (e) => {
|
|
56
|
+
n(e.relatedTarget, X.current) && (K.trim() && !H && Q(u(K)), N?.(e));
|
|
57
|
+
}, _e = (e) => {
|
|
58
|
+
L?.(e), !(e.defaultPrevented || w) && (e.target.closest("button, input") || Z.current?.focus());
|
|
59
|
+
}, ve = (e) => {
|
|
60
|
+
Y(null), G(l(W, e)), Z.current?.focus();
|
|
61
|
+
}, $ = J !== null || (O ?? V?.invalid ?? !1);
|
|
62
|
+
return B.wrap(/* @__PURE__ */ f("div", {
|
|
54
63
|
...R,
|
|
55
|
-
ref:
|
|
64
|
+
ref: X,
|
|
56
65
|
className: v({
|
|
57
|
-
size:
|
|
66
|
+
size: T,
|
|
58
67
|
invalid: $,
|
|
59
|
-
disabled:
|
|
68
|
+
disabled: w,
|
|
69
|
+
readOnly: H,
|
|
60
70
|
className: I
|
|
61
71
|
}),
|
|
62
|
-
onClick:
|
|
63
|
-
onBlur:
|
|
72
|
+
onClick: _e,
|
|
73
|
+
onBlur: ge,
|
|
64
74
|
children: [
|
|
65
|
-
/* @__PURE__ */
|
|
75
|
+
/* @__PURE__ */ f("div", {
|
|
66
76
|
className: "kapi-taginput__box",
|
|
67
|
-
children: [
|
|
77
|
+
children: [W.length > 0 && /* @__PURE__ */ d("ul", {
|
|
68
78
|
className: "kapi-taginput__tags",
|
|
69
|
-
children:
|
|
79
|
+
children: W.map((e, t) => /* @__PURE__ */ d("li", {
|
|
70
80
|
className: "kapi-taginput__item",
|
|
71
|
-
children: /* @__PURE__ */
|
|
81
|
+
children: /* @__PURE__ */ d(ie, {
|
|
72
82
|
tone: "primary",
|
|
73
|
-
size:
|
|
74
|
-
onRemove:
|
|
83
|
+
size: T === "sm" ? "sm" : "md",
|
|
84
|
+
onRemove: w || H ? void 0 : () => ve(t),
|
|
75
85
|
removeLabel: `${z.remove} ${e}`,
|
|
76
86
|
children: e
|
|
77
87
|
})
|
|
78
88
|
}, `${t}-${e}`))
|
|
79
|
-
}), /* @__PURE__ */
|
|
80
|
-
ref:
|
|
89
|
+
}), /* @__PURE__ */ d("input", {
|
|
90
|
+
ref: de,
|
|
81
91
|
type: "text",
|
|
82
92
|
className: "kapi-taginput__input",
|
|
83
|
-
...t(
|
|
84
|
-
id:
|
|
85
|
-
describedBy: r(
|
|
93
|
+
...t(V, {
|
|
94
|
+
id: D,
|
|
95
|
+
describedBy: r(J !== null && U, M),
|
|
86
96
|
invalid: $,
|
|
87
97
|
required: k
|
|
88
98
|
}),
|
|
89
|
-
"aria-label":
|
|
99
|
+
"aria-label": ue,
|
|
90
100
|
"aria-labelledby": j,
|
|
91
|
-
placeholder:
|
|
92
|
-
value:
|
|
93
|
-
disabled:
|
|
101
|
+
placeholder: W.length ? void 0 : C,
|
|
102
|
+
value: K,
|
|
103
|
+
disabled: w,
|
|
104
|
+
readOnly: H || void 0,
|
|
94
105
|
enterKeyHint: "enter",
|
|
95
|
-
onChange:
|
|
96
|
-
onKeyDown:
|
|
97
|
-
onPaste:
|
|
106
|
+
onChange: pe,
|
|
107
|
+
onKeyDown: me,
|
|
108
|
+
onPaste: he
|
|
98
109
|
})]
|
|
99
110
|
}),
|
|
100
|
-
|
|
101
|
-
id:
|
|
111
|
+
J !== null && /* @__PURE__ */ d("span", {
|
|
112
|
+
id: U,
|
|
102
113
|
className: "kapi-taginput__error",
|
|
103
114
|
role: "alert",
|
|
104
|
-
children:
|
|
115
|
+
children: J
|
|
105
116
|
}),
|
|
106
|
-
|
|
117
|
+
E && W.map((e, t) => /* @__PURE__ */ d("input", {
|
|
107
118
|
type: "hidden",
|
|
108
|
-
name:
|
|
119
|
+
name: E,
|
|
109
120
|
value: e
|
|
110
121
|
}, `${t}-${e}`))
|
|
111
122
|
]
|
|
112
|
-
});
|
|
123
|
+
}));
|
|
113
124
|
}
|
|
114
125
|
//#endregion
|
|
115
126
|
export { _ as DEFAULT_TAG_INPUT_LABELS, y as KapiTagInput, v as tagInputClasses };
|
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import { type ReactNode, type Ref, type TextareaHTMLAttributes } from "react";
|
|
2
|
-
import "./
|
|
3
|
-
import { type KapiFieldStatus } from "./KapiField";
|
|
2
|
+
import type { KapiFieldStatus } from "./KapiField.js";
|
|
4
3
|
export type KapiTextareaFieldProps = TextareaHTMLAttributes<HTMLTextAreaElement> & {
|
|
5
|
-
/**
|
|
6
|
-
|
|
4
|
+
/** Marks the field invalid: red border, `aria-invalid` and the help in the error color. Wins over `status`. */
|
|
5
|
+
invalid?: boolean | undefined;
|
|
6
|
+
/** Non-error validation: green (`ok`) or busy (`pending`) border. The `err` value is deprecated: use `invalid`. */
|
|
7
|
+
status?: KapiFieldStatus | undefined;
|
|
7
8
|
/** Label. With `label` or `help` the control is wrapped in a `KapiField`. */
|
|
8
9
|
label?: ReactNode;
|
|
9
10
|
/** Adds the required asterisk to the label. */
|
|
10
|
-
required?: boolean;
|
|
11
|
-
/** Help / error message below the control (takes the color of `status`). */
|
|
11
|
+
required?: boolean | undefined;
|
|
12
|
+
/** Help / error message below the control (takes the color of `invalid` or `status`). */
|
|
12
13
|
help?: ReactNode;
|
|
13
14
|
/** Class of the wrapping `KapiField` (if any). `className` goes to the control. */
|
|
14
|
-
fieldClassName?: string;
|
|
15
|
+
fieldClassName?: string | undefined;
|
|
15
16
|
/** Grow with the content instead of showing a scrollbar. */
|
|
16
|
-
autosize?: boolean;
|
|
17
|
+
autosize?: boolean | undefined;
|
|
17
18
|
/** With `autosize`: max visible rows before it scrolls (default: unlimited). */
|
|
18
|
-
maxRows?: number;
|
|
19
|
+
maxRows?: number | undefined;
|
|
19
20
|
/** Ref to the `<textarea>`. */
|
|
20
|
-
ref?: Ref<HTMLTextAreaElement
|
|
21
|
+
ref?: Ref<HTMLTextAreaElement> | undefined;
|
|
21
22
|
};
|
|
22
23
|
/** Control classes. Pure and exported: this is what gets tested (not the markup). */
|
|
23
24
|
export declare const textareaClasses: ({ status, autosize, className }?: {
|
|
@@ -29,4 +30,4 @@ export declare const textareaClasses: ({ status, autosize, className }?: {
|
|
|
29
30
|
* Multiline text field of the design system (`.kapi-input` + `.kapi-textarea`). Works controlled or not.
|
|
30
31
|
* With `autosize` it grows with its content, optionally up to `maxRows`.
|
|
31
32
|
*/
|
|
32
|
-
export declare const KapiTextarea: ({ status, label, required, help, fieldClassName, autosize, maxRows, className, id, rows, onInput, ref, ...rest }: KapiTextareaFieldProps) =>
|
|
33
|
+
export declare const KapiTextarea: ({ invalid: invalidProp, status: statusProp, label, required, help, fieldClassName, autosize, maxRows, className, id, rows, onInput, ref, ...rest }: KapiTextareaFieldProps) => ReactNode;
|
|
@@ -1,67 +1,89 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
2
|
+
import "#kapi-css/components/inputs/inputsExtra.css";
|
|
3
|
+
import { fieldControlProps as e, joinIds as t, resolveValidation as n } from "./fieldLogic.js";
|
|
4
|
+
import { useOwnField as r } from "./ownField.js";
|
|
4
5
|
/* empty css */
|
|
5
6
|
import { inputClasses as i } from "./KapiInput.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { computedStyleOf as a } from "../../hooks/ownerDocument.js";
|
|
8
|
+
import { rafThrottle as o } from "../../hooks/rafThrottle.js";
|
|
9
|
+
import { autosizeHeight as s, rowsToHeight as c } from "./textareaLogic.js";
|
|
10
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
11
|
+
import { useCallback as u, useEffect as d, useLayoutEffect as f, useRef as p } from "react";
|
|
9
12
|
//#region src/components/inputs/KapiTextarea.tsx
|
|
10
|
-
var
|
|
13
|
+
var m = ({ status: e, autosize: t = !1, className: n = "" } = {}) => i({
|
|
11
14
|
status: e,
|
|
12
15
|
className: [
|
|
13
16
|
"kapi-textarea",
|
|
14
17
|
t && "kapi-textarea--auto",
|
|
15
18
|
n
|
|
16
19
|
].filter(Boolean).join(" ")
|
|
17
|
-
}),
|
|
18
|
-
let
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
}), h = ({ invalid: i, status: h, label: g, required: _, help: v, fieldClassName: y, autosize: b, maxRows: x, className: S, id: C, rows: w = 3, onInput: T, ref: E, ...D }) => {
|
|
21
|
+
let { invalid: O, status: k } = n(i, h), A = r({
|
|
22
|
+
id: C,
|
|
23
|
+
label: g,
|
|
24
|
+
help: v,
|
|
25
|
+
required: _,
|
|
26
|
+
invalid: i,
|
|
27
|
+
status: h,
|
|
28
|
+
fieldClassName: y
|
|
29
|
+
}), { controlId: j, helpId: M } = A, N = p(null), P = u((e) => {
|
|
30
|
+
N.current = e, typeof E == "function" ? E(e) : E && (E.current = e);
|
|
31
|
+
}, [E]), F = p(null), I = u(() => {
|
|
32
|
+
let e = N.current;
|
|
33
|
+
if (!e || !b) return;
|
|
34
|
+
let t = a(e), n = (e) => parseFloat(e) || 0;
|
|
35
|
+
F.current = Math.max(0, e.clientWidth - n(t.paddingLeft) - n(t.paddingRight));
|
|
36
|
+
let r = n(t.lineHeight) || n(t.fontSize) * 1.5, i = n(t.borderTopWidth) + n(t.borderBottomWidth), o = n(t.paddingTop) + n(t.paddingBottom) + i;
|
|
24
37
|
e.style.height = "auto";
|
|
25
|
-
let { height:
|
|
26
|
-
minHeight:
|
|
27
|
-
maxHeight:
|
|
38
|
+
let { height: l, overflowing: u } = s(e.scrollHeight + i, {
|
|
39
|
+
minHeight: c(w, r, o),
|
|
40
|
+
maxHeight: x ? c(x, r, o) : void 0
|
|
28
41
|
});
|
|
29
|
-
e.style.height = `${
|
|
42
|
+
e.style.height = `${l}px`, e.style.overflowY = u ? "auto" : "hidden";
|
|
30
43
|
}, [
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
]);
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
b,
|
|
45
|
+
x,
|
|
46
|
+
w
|
|
47
|
+
]), L = D.value;
|
|
48
|
+
f(() => {
|
|
49
|
+
I();
|
|
50
|
+
}, [I, L]);
|
|
51
|
+
let R = p(I);
|
|
52
|
+
R.current = I, d(() => {
|
|
53
|
+
let e = N.current;
|
|
54
|
+
if (!e || !b || typeof ResizeObserver > "u") return;
|
|
55
|
+
let t = null, n = o(() => R.current()), r = new ResizeObserver((e) => {
|
|
56
|
+
let r = e[e.length - 1]?.contentRect.width;
|
|
57
|
+
if (r === void 0 || r === t) return;
|
|
58
|
+
let i = t === null;
|
|
59
|
+
t = r;
|
|
60
|
+
let a = F.current;
|
|
61
|
+
i && a !== null && Math.abs(r - a) < 1 || n();
|
|
62
|
+
});
|
|
63
|
+
return r.observe(e), () => {
|
|
64
|
+
r.disconnect(), n.cancel();
|
|
65
|
+
};
|
|
66
|
+
}, [b]);
|
|
67
|
+
let z = (e) => {
|
|
68
|
+
I(), T?.(e);
|
|
69
|
+
}, B = /* @__PURE__ */ l("textarea", {
|
|
70
|
+
...D,
|
|
71
|
+
ref: P,
|
|
72
|
+
...e(A.outer, {
|
|
73
|
+
id: j,
|
|
74
|
+
describedBy: t(M, D["aria-describedby"]),
|
|
75
|
+
invalid: O
|
|
45
76
|
}),
|
|
46
|
-
rows:
|
|
47
|
-
required:
|
|
48
|
-
className:
|
|
49
|
-
status:
|
|
50
|
-
autosize:
|
|
51
|
-
className:
|
|
77
|
+
rows: w,
|
|
78
|
+
required: _,
|
|
79
|
+
className: m({
|
|
80
|
+
status: k,
|
|
81
|
+
autosize: b,
|
|
82
|
+
className: S
|
|
52
83
|
}),
|
|
53
|
-
onInput:
|
|
84
|
+
onInput: z
|
|
54
85
|
});
|
|
55
|
-
return
|
|
56
|
-
label: p,
|
|
57
|
-
htmlFor: O,
|
|
58
|
-
required: m,
|
|
59
|
-
help: h,
|
|
60
|
-
helpId: k,
|
|
61
|
-
status: i,
|
|
62
|
-
className: g,
|
|
63
|
-
children: P
|
|
64
|
-
}) : P;
|
|
86
|
+
return A.wrap(B);
|
|
65
87
|
};
|
|
66
88
|
//#endregion
|
|
67
|
-
export {
|
|
89
|
+
export { h as KapiTextarea, m as textareaClasses };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type KapiSelectEntry, type KapiSelectOption, type KapiSelectValue } from "./selectLogic";
|
|
1
|
+
import { type KapiSelectEntry, type KapiSelectOption, type KapiSelectValue, type KapiSelectValueInput } from "./selectLogic.js";
|
|
2
2
|
/** Opciones conocidas por valor: así los seleccionados conservan su label aunque salgan de la lista. */
|
|
3
3
|
export type KapiKnownOptions<T = unknown> = ReadonlyMap<string, KapiSelectOption<T>>;
|
|
4
4
|
/**
|
|
@@ -7,14 +7,18 @@ export type KapiKnownOptions<T = unknown> = ReadonlyMap<string, KapiSelectOption
|
|
|
7
7
|
*/
|
|
8
8
|
export declare const mergeKnownOptions: <T>(known: KapiKnownOptions<T>, entries: readonly KapiSelectEntry<T>[]) => KapiKnownOptions<T>;
|
|
9
9
|
/** Opciones seleccionadas resueltas desde la caché, en el orden del valor (los valores desconocidos se omiten). */
|
|
10
|
-
export declare const selectedFromKnown: <T>(known: KapiKnownOptions<T>, value:
|
|
10
|
+
export declare const selectedFromKnown: <T>(known: KapiKnownOptions<T>, value: KapiSelectValueInput | undefined) => KapiSelectOption<T>[];
|
|
11
11
|
/**
|
|
12
12
|
* Ofrecer "Crear …": la búsqueda (sin espacios de borde) no está vacía y ninguna opción visible tiene
|
|
13
13
|
* exactamente ese label (sin distinguir mayúsculas ni acentos).
|
|
14
14
|
*/
|
|
15
15
|
export declare const showCreateOption: <T>(entries: readonly KapiSelectEntry<T>[], query: string) => boolean;
|
|
16
|
-
/**
|
|
17
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Valor tras crear una opción: simple → la creada; múltiple → se agrega (nunca se quita si ya estaba).
|
|
18
|
+
* Si ya estaba devuelve una copia: el resultado se emite por `onChange` como arreglo mutable, y el de
|
|
19
|
+
* entrada puede ser el `as const` del consumidor.
|
|
20
|
+
*/
|
|
21
|
+
export declare const withCreated: (value: KapiSelectValueInput | undefined, createdValue: string, multiple: boolean) => KapiSelectValue;
|
|
18
22
|
export type KapiLoadRequest = {
|
|
19
23
|
/** Señal para cancelar el pedido (se aborta al empezar otro, al cerrar o al desmontar). */
|
|
20
24
|
signal: AbortSignal;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { normalizeText as e } from "../overlays/menuKeyboardLogic.js";
|
|
2
|
+
import { flattenOptions as t, normalizeValue as n, toggleValue as r } from "./selectLogic.js";
|
|
2
3
|
import { createRequestTracker as i } from "./autocompleteLogic.js";
|
|
3
4
|
//#region src/components/inputs/asyncSelectLogic.ts
|
|
4
|
-
var a = (e, t) => e === t || e.label === t.label && e.disabled === t.disabled && e.data === t.data, o = (
|
|
5
|
+
var a = (e, t) => e === t || e.label === t.label && e.disabled === t.disabled && e.data === t.data, o = (e, n) => {
|
|
5
6
|
let r = null;
|
|
6
|
-
for (let i of
|
|
7
|
-
let
|
|
8
|
-
|
|
7
|
+
for (let i of t(n)) {
|
|
8
|
+
let t = (r ?? e).get(i.value);
|
|
9
|
+
t && a(t, i) || (r ??= new Map(e), r.set(i.value, i));
|
|
9
10
|
}
|
|
10
|
-
return r ??
|
|
11
|
+
return r ?? e;
|
|
11
12
|
}, s = (e, t) => {
|
|
12
13
|
let r = [];
|
|
13
14
|
for (let i of n(t, !0)) {
|
|
@@ -16,9 +17,9 @@ var a = (e, t) => e === t || e.label === t.label && e.disabled === t.disabled &&
|
|
|
16
17
|
}
|
|
17
18
|
return r;
|
|
18
19
|
}, c = (n, r) => {
|
|
19
|
-
let i =
|
|
20
|
-
return i ? !
|
|
21
|
-
}, l = (e, t, i) => i && n(e, !0).includes(t) ? n(e, !0) : r(e, t, i), u = () => {
|
|
20
|
+
let i = e(r.trim());
|
|
21
|
+
return i ? !t(n).some((t) => e(t.label.trim()) === i) : !1;
|
|
22
|
+
}, l = (e, t, i) => i && n(e, !0).includes(t) ? [...n(e, !0)] : r(e, t, i), u = () => {
|
|
22
23
|
let e = i(), t = null;
|
|
23
24
|
return {
|
|
24
25
|
start: () => {
|
|
@@ -35,9 +36,9 @@ var a = (e, t) => e === t || e.label === t.label && e.disabled === t.disabled &&
|
|
|
35
36
|
t?.abort(), t = null, e.cancel();
|
|
36
37
|
}
|
|
37
38
|
};
|
|
38
|
-
}, d = "\0kapisel-create", f = (e) => e.value === d, p = (
|
|
39
|
-
let a = e
|
|
40
|
-
return r && c(
|
|
39
|
+
}, d = "\0kapisel-create", f = (e) => e.value === d, p = (e, n, r, i) => {
|
|
40
|
+
let a = t(e);
|
|
41
|
+
return r && c(e, n) ? [...a, {
|
|
41
42
|
value: d,
|
|
42
43
|
label: i
|
|
43
44
|
}] : a;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** Pure logic for KapiAutocomplete: filtering, keyboard navigation, open rules, highlight, stale guard. */
|
|
1
2
|
/** Lowercase + strip diacritics so "ingenieria" matches "Ingeniería". */
|
|
2
3
|
export declare const normalizeText: (text: string) => string;
|
|
3
4
|
/**
|
|
@@ -6,8 +7,6 @@ export declare const normalizeText: (text: string) => string;
|
|
|
6
7
|
* `Infinity` means no cap.
|
|
7
8
|
*/
|
|
8
9
|
export declare const filterOptions: <T>(options: readonly T[], query: string, getLabel: (option: T) => string, limit?: number) => T[];
|
|
9
|
-
/** Next/previous active index with wrap. From "none" (-1): down -> first, up -> last. */
|
|
10
|
-
export declare const moveActiveIndex: (current: number, count: number, direction: 1 | -1) => number;
|
|
11
10
|
/** Keep the active index valid when the list changes: -1 when empty, otherwise clamped into range. */
|
|
12
11
|
export declare const clampActiveIndex: (index: number, count: number) => number;
|
|
13
12
|
/** The dropdown opens only while the input is focused, not dismissed, and the query is long enough. */
|
|
@@ -15,7 +14,7 @@ export declare const shouldOpen: ({ focused, dismissed, query, minChars }: {
|
|
|
15
14
|
focused: boolean;
|
|
16
15
|
dismissed: boolean;
|
|
17
16
|
query: string;
|
|
18
|
-
minChars?: number;
|
|
17
|
+
minChars?: number | undefined;
|
|
19
18
|
}) => boolean;
|
|
20
19
|
export type HighlightPart = {
|
|
21
20
|
text: string;
|
|
@@ -35,20 +34,6 @@ export type RequestTracker = {
|
|
|
35
34
|
};
|
|
36
35
|
/** Monotonic request-id tracker: guards against out-of-order async responses. */
|
|
37
36
|
export declare const createRequestTracker: () => RequestTracker;
|
|
38
|
-
export type MenuPosition = {
|
|
39
|
-
top: number;
|
|
40
|
-
left: number;
|
|
41
|
-
width: number;
|
|
42
|
-
};
|
|
43
|
-
/**
|
|
44
|
-
* Viewport-space (`position: fixed`) box for a portaled menu anchored under an input.
|
|
45
|
-
* `gap` is the vertical space between the input's bottom edge and the menu. Width never goes negative.
|
|
46
|
-
*/
|
|
47
|
-
export declare const menuPositionFrom: (rect: {
|
|
48
|
-
left: number;
|
|
49
|
-
bottom: number;
|
|
50
|
-
width: number;
|
|
51
|
-
}, gap?: number) => MenuPosition;
|
|
52
37
|
/** Engine options for the autocomplete menu: below the input, input width, flips up, no clamping. */
|
|
53
38
|
export declare const AUTOCOMPLETE_MENU_PLACEMENT: {
|
|
54
39
|
readonly side: "bottom";
|
|
@@ -57,17 +42,5 @@ export declare const AUTOCOMPLETE_MENU_PLACEMENT: {
|
|
|
57
42
|
readonly shift: false;
|
|
58
43
|
readonly width: "anchor";
|
|
59
44
|
};
|
|
60
|
-
/**
|
|
61
|
-
* Menu box under the input that flips above when it does not fit below and there is more room above
|
|
62
|
-
* (unmeasured height 0 never flips). Same engine options the component uses through `usePlacement`.
|
|
63
|
-
*/
|
|
64
|
-
export declare const placeAutocompleteMenu: (rect: {
|
|
65
|
-
top: number;
|
|
66
|
-
bottom: number;
|
|
67
|
-
left: number;
|
|
68
|
-
width: number;
|
|
69
|
-
}, menuHeight: number, viewportHeight: number, gap?: number) => MenuPosition & {
|
|
70
|
-
side: "top" | "bottom";
|
|
71
|
-
};
|
|
72
45
|
/** Text shown as the default label for string-ish options. */
|
|
73
46
|
export declare const defaultGetLabel: (option: unknown) => string;
|
|
@@ -8,7 +8,7 @@ var e = (e) => e.normalize("NFD").replace(/[̀-ͯ]/g, "").toLowerCase(), t = (t,
|
|
|
8
8
|
t === 0 ? s.push(n) : t > 0 && c.push(n);
|
|
9
9
|
}
|
|
10
10
|
return [...s, ...c].slice(0, o);
|
|
11
|
-
}, n = (e, t
|
|
11
|
+
}, n = (e, t) => t <= 0 || e < 0 ? -1 : Math.min(e, t - 1), r = ({ focused: e, dismissed: t, query: n, minChars: r = 0 }) => e && !t && n.trim().length >= r, i = (t, n) => {
|
|
12
12
|
let r = e(n.trim());
|
|
13
13
|
if (!r || !t) return [{
|
|
14
14
|
text: t,
|
|
@@ -40,22 +40,22 @@ var e = (e) => e.normalize("NFD").replace(/[̀-ͯ]/g, "").toLowerCase(), t = (t,
|
|
|
40
40
|
match: !1
|
|
41
41
|
}
|
|
42
42
|
].filter((e) => e.text !== "");
|
|
43
|
-
},
|
|
43
|
+
}, a = (e, t) => e === t, o = () => {
|
|
44
44
|
let e = 0;
|
|
45
45
|
return {
|
|
46
46
|
next: () => ++e,
|
|
47
47
|
cancel: () => {
|
|
48
48
|
e++;
|
|
49
49
|
},
|
|
50
|
-
isCurrent: (t) =>
|
|
50
|
+
isCurrent: (t) => a(t, e)
|
|
51
51
|
};
|
|
52
|
-
},
|
|
52
|
+
}, s = {
|
|
53
53
|
side: "bottom",
|
|
54
54
|
align: "start",
|
|
55
55
|
flip: "auto",
|
|
56
56
|
shift: !1,
|
|
57
57
|
width: "anchor"
|
|
58
|
-
},
|
|
58
|
+
}, c = (e) => {
|
|
59
59
|
if (typeof e == "string") return e;
|
|
60
60
|
if (e && typeof e == "object" && "label" in e) {
|
|
61
61
|
let t = e.label;
|
|
@@ -64,4 +64,4 @@ var e = (e) => e.normalize("NFD").replace(/[̀-ͯ]/g, "").toLowerCase(), t = (t,
|
|
|
64
64
|
return String(e);
|
|
65
65
|
};
|
|
66
66
|
//#endregion
|
|
67
|
-
export {
|
|
67
|
+
export { s as AUTOCOMPLETE_MENU_PLACEMENT, n as clampActiveIndex, o as createRequestTracker, c as defaultGetLabel, t as filterOptions, i as highlightParts, a as isLatestRequest, e as normalizeText, r as shouldOpen };
|
|
@@ -2,10 +2,10 @@ import type { InputHTMLAttributes, ReactNode, Ref } from "react";
|
|
|
2
2
|
export type KapiCheckControlProps = Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "size" | "children"> & {
|
|
3
3
|
/** Texto al lado del control. Sin `label`, pasa `aria-label`. */
|
|
4
4
|
label?: ReactNode;
|
|
5
|
-
/** Marca el control como inválido (`aria-invalid`). Sin la prop, lo toma del `KapiField` (`
|
|
6
|
-
invalid?: boolean;
|
|
5
|
+
/** Marca el control como inválido (`aria-invalid`). Sin la prop, lo toma del `KapiField` (`invalid`). */
|
|
6
|
+
invalid?: boolean | undefined;
|
|
7
7
|
/** Ref al `<input>`. */
|
|
8
|
-
ref?: Ref<HTMLInputElement
|
|
8
|
+
ref?: Ref<HTMLInputElement> | undefined;
|
|
9
9
|
};
|
|
10
10
|
/** Clases del `<label>` `.kapi-check`. Pura y exportada para testear. */
|
|
11
11
|
export declare const checkClasses: (className?: string) => string;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import "#kapi-css/components/inputs/checkControl.css";
|
|
2
3
|
import { nativeFieldProps as e } from "./fieldLogic.js";
|
|
3
4
|
import { useKapiField as t } from "./KapiField.js";
|
|
5
|
+
/* empty css */
|
|
4
6
|
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
5
7
|
//#region src/components/inputs/checkControl.tsx
|
|
6
8
|
var i = (e = "") => ["kapi-check", e].filter(Boolean).join(" "), a = (a, o) => {
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
/** Ítem de `KapiChecklist`. */
|
|
3
|
+
export type KapiChecklistItem<Id extends string = string> = {
|
|
4
|
+
/** Identificador estable; es lo que viaja en `value` / `onChange`. */
|
|
5
|
+
id: Id;
|
|
6
|
+
/** Lo que se ve en la fila. */
|
|
7
|
+
label: ReactNode;
|
|
8
|
+
/** Texto para buscar y para el nombre accesible cuando `label` no es texto. */
|
|
9
|
+
text?: string | undefined;
|
|
10
|
+
/** Línea secundaria bajo la etiqueta. */
|
|
11
|
+
description?: ReactNode | undefined;
|
|
12
|
+
/** No se puede marcar ni desmarcar (el teclado lo saltea y los tramos lo respetan). */
|
|
13
|
+
disabled?: boolean | undefined;
|
|
14
|
+
};
|
|
15
|
+
type ItemLike = {
|
|
16
|
+
id: string;
|
|
17
|
+
label: ReactNode;
|
|
18
|
+
text?: string | undefined;
|
|
19
|
+
disabled?: boolean | undefined;
|
|
20
|
+
};
|
|
21
|
+
/** Texto buscable de un ítem: `text` si está, si no la etiqueta cuando es texto o número. */
|
|
22
|
+
export declare const checklistItemText: (item: ItemLike) => string;
|
|
23
|
+
/** Ítems que contienen la consulta (sin mayúsculas ni acentos), en su orden original. */
|
|
24
|
+
export declare const filterChecklistItems: <I extends ItemLike>(items: readonly I[], query: string) => I[];
|
|
25
|
+
/** La selección como lista, en el orden de los ítems (descarta ids que ya no están). */
|
|
26
|
+
export declare const orderedChecklistValue: <Id extends string>(items: readonly {
|
|
27
|
+
id: Id;
|
|
28
|
+
}[], selected: ReadonlySet<string>) => Id[];
|
|
29
|
+
/** Marca o desmarca `ids` en bloque ("Marcar todo"); los deshabilitados quedan como estaban. */
|
|
30
|
+
export declare const setChecklistItems: (items: readonly ItemLike[], selected: ReadonlySet<string>, ids: readonly string[], select: boolean) => Set<string>;
|
|
31
|
+
/** Cuántos de los ítems habilitados dados están marcados: ninguno, algunos o todos. */
|
|
32
|
+
export declare const checklistBulkState: (items: readonly ItemLike[], selected: ReadonlySet<string>) => "none" | "some" | "all";
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { normalizeText as e } from "../overlays/menuKeyboardLogic.js";
|
|
2
|
+
//#region src/components/inputs/checklistLogic.ts
|
|
3
|
+
var t = (e) => e.text === void 0 ? typeof e.label == "string" || typeof e.label == "number" ? String(e.label) : "" : e.text, n = (n, r) => {
|
|
4
|
+
let i = e(r.trim());
|
|
5
|
+
return i ? n.filter((n) => e(t(n)).includes(i)) : [...n];
|
|
6
|
+
}, r = (e, t) => e.filter((e) => t.has(e.id)).map((e) => e.id), i = (e, t, n, r) => {
|
|
7
|
+
let i = new Set(e.filter((e) => e.disabled).map((e) => e.id)), a = new Set(t);
|
|
8
|
+
return n.forEach((e) => {
|
|
9
|
+
i.has(e) || (r ? a.add(e) : a.delete(e));
|
|
10
|
+
}), a;
|
|
11
|
+
}, a = (e, t) => {
|
|
12
|
+
let n = e.filter((e) => !e.disabled), r = n.filter((e) => t.has(e.id)).length;
|
|
13
|
+
return r === 0 ? "none" : r === n.length ? "all" : "some";
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { a as checklistBulkState, t as checklistItemText, n as filterChecklistItems, r as orderedChecklistValue, i as setChecklistItems };
|