@kapiuara/ui 0.12.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 +13 -14
- package/dist/components/data/KapiBarChart.js +54 -52
- 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 +9 -10
- package/dist/components/data/KapiLineChart.js +59 -56
- 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 -360
- 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 +1 -1
- 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 +7 -6
- package/dist/components/inputs/KapiFacetedSearch.js +130 -167
- 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 +9 -8
- package/dist/components/inputs/KapiSearchChip.js +46 -42
- 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 -57
- 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/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/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 +67 -59
- 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 +16 -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 -179
- package/dist/kapi.css +1 -1
- package/dist/kapi.layered.css +1 -1
- package/package.json +14 -6
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type CSSProperties, type ReactNode, type Ref } from "react";
|
|
2
|
+
import { type IndexedRow, type KapiSelectOption } from "./selectLogic.js";
|
|
3
|
+
import type { KapiSelectRenderContext } from "./KapiSelect.js";
|
|
4
|
+
export type KapiSelectMenuProps<T> = {
|
|
5
|
+
/** `.kapi` donde se portalea (escapa tablas y overflow). */
|
|
6
|
+
root: Element;
|
|
7
|
+
ref: Ref<HTMLDivElement>;
|
|
8
|
+
/** Lado donde quedó el menú, para el radio y la sombra. */
|
|
9
|
+
side: "top" | "bottom";
|
|
10
|
+
/** Dentro de un `KapiInputGroup`: el menú abraza al grupo entero. */
|
|
11
|
+
hug: boolean;
|
|
12
|
+
style: CSSProperties;
|
|
13
|
+
listboxId: string;
|
|
14
|
+
optionId: (index: number) => string;
|
|
15
|
+
multiple: boolean;
|
|
16
|
+
"aria-label": string | undefined;
|
|
17
|
+
/** Opciones y grupos ya indexados en el orden de navegación. */
|
|
18
|
+
rows: IndexedRow<T>[];
|
|
19
|
+
/** Fila "Crear …", siempre última (`createIndex`). */
|
|
20
|
+
createRow: KapiSelectOption<T> | null;
|
|
21
|
+
createIndex: number;
|
|
22
|
+
/** Con carga en curso la lista se oculta y solo queda el mensaje. */
|
|
23
|
+
loading: boolean;
|
|
24
|
+
/** Sin filas que mostrar (la lista queda `hidden`). */
|
|
25
|
+
empty: boolean;
|
|
26
|
+
message: ReactNode;
|
|
27
|
+
active: number;
|
|
28
|
+
values: readonly string[];
|
|
29
|
+
renderOption: ((opt: KapiSelectOption<T>, context: KapiSelectRenderContext) => ReactNode) | undefined;
|
|
30
|
+
/** Texto buscado, para el contexto de `renderOption`. */
|
|
31
|
+
query: string;
|
|
32
|
+
/** Sólo dibuja las filas a la vista (ver `KapiSelect` `virtual`). */
|
|
33
|
+
virtual: boolean;
|
|
34
|
+
onHover: (index: number) => void;
|
|
35
|
+
onChoose: (option: KapiSelectOption<T>, shift: boolean) => void;
|
|
36
|
+
};
|
|
37
|
+
/** Listbox portaleado de `KapiSelect`: grupos, fila de crear y mensaje de estado. Solo dibuja. */
|
|
38
|
+
export declare const KapiSelectMenu: <T>({ root, ref, side, hug, style, listboxId, optionId, multiple, "aria-label": ariaLabel, rows, createRow, createIndex, loading, empty, message, active, values, renderOption, query, virtual, onHover, onChoose }: KapiSelectMenuProps<T>) => import("react").ReactPortal;
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { flattenMenuRows as e } from "./selectLogic.js";
|
|
3
|
+
import { useVirtualList as t } from "../../hooks/useVirtualList.js";
|
|
4
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
5
|
+
import { memo as i, useCallback as a, useLayoutEffect as o, useMemo as s, useRef as c } from "react";
|
|
6
|
+
import { Check as l } from "lucide-react";
|
|
7
|
+
import { createPortal as u } from "react-dom";
|
|
8
|
+
//#region src/components/inputs/KapiSelectMenu.tsx
|
|
9
|
+
var d = 38, f = 264, p = 4, m = i(({ option: e, index: t, id: i, selected: a, active: o, create: s, vindex: c, setSize: u, renderOption: d, query: f, onHover: p, onChoose: m }) => /* @__PURE__ */ r("li", {
|
|
10
|
+
id: i,
|
|
11
|
+
role: "option",
|
|
12
|
+
"aria-selected": a,
|
|
13
|
+
"aria-disabled": e.disabled || void 0,
|
|
14
|
+
"data-kapisel-index": t,
|
|
15
|
+
"data-vindex": c,
|
|
16
|
+
"aria-setsize": c === void 0 ? void 0 : u,
|
|
17
|
+
"aria-posinset": c === void 0 ? void 0 : t + 1,
|
|
18
|
+
className: [
|
|
19
|
+
"kapisel__opt",
|
|
20
|
+
o && "kapisel__opt--active",
|
|
21
|
+
a && "kapisel__opt--selected",
|
|
22
|
+
s && "kapisel__opt--create",
|
|
23
|
+
e.disabled && "kapisel__opt--disabled"
|
|
24
|
+
].filter(Boolean).join(" "),
|
|
25
|
+
onMouseMove: () => {
|
|
26
|
+
!e.disabled && !o && p(t);
|
|
27
|
+
},
|
|
28
|
+
onClick: (t) => m(e, t.shiftKey),
|
|
29
|
+
children: [/* @__PURE__ */ n("span", {
|
|
30
|
+
className: "kapisel__opt-body",
|
|
31
|
+
children: d && !s ? d(e, {
|
|
32
|
+
selected: a,
|
|
33
|
+
active: o,
|
|
34
|
+
disabled: e.disabled === !0,
|
|
35
|
+
query: f
|
|
36
|
+
}) : e.label
|
|
37
|
+
}), a && /* @__PURE__ */ n(l, {
|
|
38
|
+
className: "kapisel__check",
|
|
39
|
+
size: 15,
|
|
40
|
+
strokeWidth: 2.4,
|
|
41
|
+
"aria-hidden": "true"
|
|
42
|
+
})]
|
|
43
|
+
})), h = ({ root: i, ref: l, side: h, hug: g, style: _, listboxId: v, optionId: y, multiple: b, "aria-label": x, rows: S, createRow: C, createIndex: w, loading: T, empty: E, message: D, active: O, values: k, renderOption: A, query: j, virtual: M, onHover: N, onChoose: P }) => {
|
|
44
|
+
let F = c(null), I = s(() => M ? e(S, C, w) : null, [
|
|
45
|
+
M,
|
|
46
|
+
S,
|
|
47
|
+
C,
|
|
48
|
+
w
|
|
49
|
+
]), L = s(() => I?.rows.map((e) => e.key), [I]), R = t({
|
|
50
|
+
enabled: M && !T,
|
|
51
|
+
count: I?.rows.length ?? 0,
|
|
52
|
+
scrollRef: F,
|
|
53
|
+
estimate: d,
|
|
54
|
+
measure: !0,
|
|
55
|
+
keys: L,
|
|
56
|
+
overscan: p,
|
|
57
|
+
fallbackViewHeight: f
|
|
58
|
+
}), { scrollToIndex: z } = R, B = O >= 0 ? I?.rowOf[O] : void 0;
|
|
59
|
+
o(() => {
|
|
60
|
+
B !== void 0 && z(B);
|
|
61
|
+
}, [B, z]);
|
|
62
|
+
let V = s(() => new Set(k), [k]), H = c({
|
|
63
|
+
onHover: N,
|
|
64
|
+
onChoose: P
|
|
65
|
+
});
|
|
66
|
+
o(() => {
|
|
67
|
+
H.current = {
|
|
68
|
+
onHover: N,
|
|
69
|
+
onChoose: P
|
|
70
|
+
};
|
|
71
|
+
});
|
|
72
|
+
let U = a((e) => H.current.onHover(e), []), W = a((e, t) => H.current.onChoose(e, t), []), G = w + 1, K = ({ option: e, index: t }, r) => {
|
|
73
|
+
let i = e === C, a = A && !i ? A : void 0;
|
|
74
|
+
return /* @__PURE__ */ n(m, {
|
|
75
|
+
option: e,
|
|
76
|
+
index: t,
|
|
77
|
+
id: y(t),
|
|
78
|
+
selected: V.has(e.value),
|
|
79
|
+
active: t === O,
|
|
80
|
+
create: i,
|
|
81
|
+
vindex: r,
|
|
82
|
+
setSize: r === void 0 ? void 0 : G,
|
|
83
|
+
renderOption: a,
|
|
84
|
+
query: a ? j : "",
|
|
85
|
+
onHover: U,
|
|
86
|
+
onChoose: W
|
|
87
|
+
}, `${e.value}-${t}`);
|
|
88
|
+
};
|
|
89
|
+
return u(/* @__PURE__ */ r("div", {
|
|
90
|
+
ref: l,
|
|
91
|
+
className: `kapisel__menu kapisel__menu--${h}${g ? " kapisel__menu--hug" : ""}`,
|
|
92
|
+
style: _,
|
|
93
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
94
|
+
children: [/* @__PURE__ */ r("ul", {
|
|
95
|
+
id: v,
|
|
96
|
+
role: "listbox",
|
|
97
|
+
"aria-multiselectable": b || void 0,
|
|
98
|
+
"aria-label": x,
|
|
99
|
+
className: M ? "kapisel__list kapisel__list--virtual" : "kapisel__list",
|
|
100
|
+
hidden: E || T,
|
|
101
|
+
ref: F,
|
|
102
|
+
onScroll: M ? R.onScroll : void 0,
|
|
103
|
+
children: [
|
|
104
|
+
!T && I && ((e, t, i, a, o) => {
|
|
105
|
+
let s = [];
|
|
106
|
+
a > 0 && s.push(/* @__PURE__ */ n("li", {
|
|
107
|
+
role: "presentation",
|
|
108
|
+
"aria-hidden": !0,
|
|
109
|
+
style: { height: a }
|
|
110
|
+
}, "pad-top"));
|
|
111
|
+
let c = t;
|
|
112
|
+
for (; c < i;) {
|
|
113
|
+
let t = e[c];
|
|
114
|
+
if (t.group === null) {
|
|
115
|
+
t.kind === "option" && s.push(K(t.item, c)), c += 1;
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
let a = t.group, o = null, l = [];
|
|
119
|
+
for (; c < i && e[c].group?.key === a.key;) {
|
|
120
|
+
let t = e[c];
|
|
121
|
+
t.kind === "header" ? o = /* @__PURE__ */ n("div", {
|
|
122
|
+
className: "kapisel__group-label",
|
|
123
|
+
"aria-hidden": "true",
|
|
124
|
+
"data-vindex": c,
|
|
125
|
+
children: a.label
|
|
126
|
+
}, "h") : l.push(K(t.item, c)), c += 1;
|
|
127
|
+
}
|
|
128
|
+
s.push(/* @__PURE__ */ r("li", {
|
|
129
|
+
role: "presentation",
|
|
130
|
+
className: "kapisel__group",
|
|
131
|
+
children: [o, l.length > 0 && /* @__PURE__ */ n("ul", {
|
|
132
|
+
role: "group",
|
|
133
|
+
"aria-label": a.label,
|
|
134
|
+
className: "kapisel__group-list",
|
|
135
|
+
children: l
|
|
136
|
+
})]
|
|
137
|
+
}, a.key));
|
|
138
|
+
}
|
|
139
|
+
return o > 0 && s.push(/* @__PURE__ */ n("li", {
|
|
140
|
+
role: "presentation",
|
|
141
|
+
"aria-hidden": !0,
|
|
142
|
+
style: { height: o }
|
|
143
|
+
}, "pad-bottom")), s;
|
|
144
|
+
})(I.rows, R.start, R.end, R.padTop, R.padBottom),
|
|
145
|
+
!T && !I && S.map((e) => e.kind === "option" ? K(e.item) : /* @__PURE__ */ r("li", {
|
|
146
|
+
role: "presentation",
|
|
147
|
+
className: "kapisel__group",
|
|
148
|
+
children: [/* @__PURE__ */ n("div", {
|
|
149
|
+
className: "kapisel__group-label",
|
|
150
|
+
"aria-hidden": "true",
|
|
151
|
+
children: e.label
|
|
152
|
+
}), /* @__PURE__ */ n("ul", {
|
|
153
|
+
role: "group",
|
|
154
|
+
"aria-label": e.label,
|
|
155
|
+
className: "kapisel__group-list",
|
|
156
|
+
children: e.items.map((e) => K(e))
|
|
157
|
+
})]
|
|
158
|
+
}, e.key)),
|
|
159
|
+
!I && C && K({
|
|
160
|
+
option: C,
|
|
161
|
+
index: w
|
|
162
|
+
})
|
|
163
|
+
]
|
|
164
|
+
}), D != null && D !== !1 && D !== "" && /* @__PURE__ */ n("div", {
|
|
165
|
+
className: "kapisel__status",
|
|
166
|
+
role: "status",
|
|
167
|
+
"aria-live": "polite",
|
|
168
|
+
children: D
|
|
169
|
+
})]
|
|
170
|
+
}), i);
|
|
171
|
+
};
|
|
172
|
+
//#endregion
|
|
173
|
+
export { h as KapiSelectMenu };
|
|
@@ -1,42 +1,60 @@
|
|
|
1
1
|
import { type InputHTMLAttributes, type ReactNode, type Ref } from "react";
|
|
2
|
-
import "./inputsExtra.css";
|
|
3
2
|
export type KapiSliderTone = "primary" | "success" | "warning" | "danger";
|
|
4
3
|
export type KapiSliderProps = Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "size" | "value" | "defaultValue" | "onChange" | "min" | "max" | "step"> & {
|
|
5
|
-
/** Valor actual
|
|
6
|
-
value
|
|
4
|
+
/** Valor actual; con él, el control es controlado. */
|
|
5
|
+
value?: number | undefined;
|
|
6
|
+
/** Valor inicial sin controlar (sin `value`): el control guarda los cambios. Sin ninguno de los dos arranca en `min`. */
|
|
7
|
+
defaultValue?: number | undefined;
|
|
7
8
|
/** Se llama con el número nuevo al mover el control. */
|
|
8
|
-
onChange
|
|
9
|
+
onChange?: ((value: number) => void) | undefined;
|
|
9
10
|
/** Mínimo del rango. */
|
|
10
|
-
min?: number;
|
|
11
|
+
min?: number | undefined;
|
|
11
12
|
/** Máximo del rango. */
|
|
12
|
-
max?: number;
|
|
13
|
+
max?: number | undefined;
|
|
13
14
|
/** Paso entre valores. */
|
|
14
|
-
step?: number;
|
|
15
|
+
step?: number | undefined;
|
|
15
16
|
/** Color of the filled track and the thumb. */
|
|
16
|
-
tone?: KapiSliderTone;
|
|
17
|
-
/**
|
|
17
|
+
tone?: KapiSliderTone | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Etiqueta arriba del slider, en la misma fila que `showValue` (por eso no es el `<label>` de un
|
|
20
|
+
* `KapiField`: el valor va a su derecha). Lo nombra con `for`.
|
|
21
|
+
*/
|
|
18
22
|
label?: ReactNode;
|
|
23
|
+
/** Ayuda / mensaje de error bajo el slider (lo envuelve en un `KapiField` sin etiqueta). */
|
|
24
|
+
help?: ReactNode | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Solo lectura: se enfoca y muestra el valor, pero no se mueve (`aria-readonly`). Sin la prop, lo
|
|
27
|
+
* toma del `KapiField`.
|
|
28
|
+
*/
|
|
29
|
+
readOnly?: boolean | undefined;
|
|
19
30
|
/** Show the current value at the right of the label row. */
|
|
20
|
-
showValue?: boolean;
|
|
31
|
+
showValue?: boolean | undefined;
|
|
21
32
|
/** Format the shown value (e.g. `(v) => `${v}%``). */
|
|
22
|
-
formatValue?: (value: number) => string;
|
|
23
|
-
/** Marks the slider invalid (`aria-invalid`). Without it, taken from the wrapping `KapiField` (`
|
|
24
|
-
invalid?: boolean;
|
|
25
|
-
/** Class of the wrapper. `className` goes to the `<input>`. */
|
|
26
|
-
|
|
33
|
+
formatValue?: ((value: number) => string) | undefined;
|
|
34
|
+
/** Marks the slider invalid (`aria-invalid`). Without it, taken from the wrapping `KapiField` (`invalid`). */
|
|
35
|
+
invalid?: boolean | undefined;
|
|
36
|
+
/** Class of the slider wrapper (label row + range). `className` goes to the `<input>`. */
|
|
37
|
+
fieldClassName?: string | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Class of the slider wrapper.
|
|
40
|
+
* @deprecated Use `fieldClassName`.
|
|
41
|
+
*/
|
|
42
|
+
wrapperClassName?: string | undefined;
|
|
27
43
|
/** Ref to the `<input type="range">`. */
|
|
28
|
-
ref?: Ref<HTMLInputElement
|
|
44
|
+
ref?: Ref<HTMLInputElement> | undefined;
|
|
29
45
|
};
|
|
30
46
|
/** Wrapper classes. Pure and exported. */
|
|
31
|
-
export declare const sliderClasses: ({ tone, disabled, className }?: {
|
|
47
|
+
export declare const sliderClasses: ({ tone, disabled, readOnly, className }?: {
|
|
32
48
|
tone?: KapiSliderTone | undefined;
|
|
33
49
|
disabled?: boolean | undefined;
|
|
50
|
+
readOnly?: boolean | undefined;
|
|
34
51
|
className?: string | undefined;
|
|
35
52
|
}) => string;
|
|
36
53
|
/**
|
|
37
|
-
* Range slider of the design system. Controlled
|
|
54
|
+
* Range slider of the design system. Controlled with `value`, or uncontrolled with `defaultValue`;
|
|
55
|
+
* emits a number already snapped to `step`.
|
|
38
56
|
* The filled track is driven by the `--kapi-slider-pct` custom property.
|
|
39
57
|
* `name` goes to the native range, so a native `<form>` submits the number. Inside a `KapiField`
|
|
40
58
|
* (and without its own `label`) it takes the field id, help, `aria-invalid` and `aria-required`.
|
|
41
59
|
*/
|
|
42
|
-
export declare const KapiSlider: ({ value, onChange, min, max, step, tone, label, showValue, formatValue, wrapperClassName, className, style: styleProp, disabled, id, ref, invalid, required, "aria-describedby": describedBy, "aria-invalid": ariaInvalid, "aria-required": ariaRequired, ...rest }: KapiSliderProps) =>
|
|
60
|
+
export declare const KapiSlider: ({ value: valueProp, defaultValue, onChange, min, max, step, tone, label, help, readOnly: readOnlyProp, showValue, formatValue, fieldClassName, wrapperClassName, className, style: styleProp, disabled, id, ref, invalid, required, "aria-describedby": describedBy, "aria-invalid": ariaInvalid, "aria-required": ariaRequired, ...rest }: KapiSliderProps) => ReactNode;
|
|
@@ -1,70 +1,83 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
2
|
+
import "#kapi-css/components/inputs/inputsExtra.css";
|
|
3
|
+
import { nativeFieldProps as e, resolveFieldClassName as t, resolveReadOnly as n } from "./fieldLogic.js";
|
|
4
|
+
import { useOwnField as r } from "./ownField.js";
|
|
4
5
|
/* empty css */
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { useControllableState as i } from "../../hooks/useControllableState.js";
|
|
7
|
+
import { clampToStep as a, percentOf as o } from "./sliderLogic.js";
|
|
8
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
9
|
+
import "react";
|
|
8
10
|
//#region src/components/inputs/KapiSlider.tsx
|
|
9
|
-
var
|
|
11
|
+
var l = ({ tone: e = "primary", disabled: t = !1, readOnly: n = !1, className: r = "" } = {}) => [
|
|
10
12
|
"kapi-slider",
|
|
11
13
|
e !== "primary" && `kapi-slider--${e}`,
|
|
12
14
|
t && "kapi-slider--disabled",
|
|
13
|
-
n
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
required:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}),
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
15
|
+
n && "kapi-slider--readonly",
|
|
16
|
+
r
|
|
17
|
+
].filter(Boolean).join(" "), u = ({ value: u, defaultValue: d, onChange: f, min: p = 0, max: m = 100, step: h = 1, tone: g, label: _, help: v, readOnly: y, showValue: b, formatValue: x, fieldClassName: S, wrapperClassName: C, className: w, style: T, disabled: E, id: D, ref: O, invalid: k, required: A, "aria-describedby": j, "aria-invalid": M, "aria-required": N, ...P }) => {
|
|
18
|
+
let F = r({
|
|
19
|
+
id: D,
|
|
20
|
+
help: v,
|
|
21
|
+
required: A,
|
|
22
|
+
invalid: k,
|
|
23
|
+
readOnly: y
|
|
24
|
+
}), I = F.autoId, L = n(y, F.field), [R, z] = i(u, d ?? p, f), B = e(F.wraps || _ == null ? F.field : null, {
|
|
25
|
+
id: D,
|
|
26
|
+
describedBy: j,
|
|
27
|
+
invalid: k,
|
|
28
|
+
required: A,
|
|
29
|
+
ariaInvalid: M,
|
|
30
|
+
ariaRequired: N
|
|
31
|
+
}), V = B.id ?? I, H = a(R, {
|
|
32
|
+
min: p,
|
|
33
|
+
max: m,
|
|
34
|
+
step: h
|
|
35
|
+
}), U = { "--kapi-slider-pct": `${o(H, p, m)}%` }, W = _ != null || b, G = x ? x(H) : void 0;
|
|
36
|
+
return F.wrap(/* @__PURE__ */ c("div", {
|
|
37
|
+
className: l({
|
|
38
|
+
tone: g,
|
|
39
|
+
disabled: E,
|
|
40
|
+
readOnly: L,
|
|
41
|
+
className: t(S, C)
|
|
32
42
|
}),
|
|
33
|
-
children: [
|
|
43
|
+
children: [W && /* @__PURE__ */ c("div", {
|
|
34
44
|
className: "kapi-slider__head",
|
|
35
|
-
children: [
|
|
36
|
-
htmlFor:
|
|
37
|
-
children:
|
|
38
|
-
}),
|
|
39
|
-
htmlFor:
|
|
45
|
+
children: [_ != null && /* @__PURE__ */ s("label", {
|
|
46
|
+
htmlFor: V,
|
|
47
|
+
children: _
|
|
48
|
+
}), b && /* @__PURE__ */ s("output", {
|
|
49
|
+
htmlFor: V,
|
|
40
50
|
className: "kapi-slider__value",
|
|
41
|
-
children:
|
|
51
|
+
children: G ?? H
|
|
42
52
|
})]
|
|
43
|
-
}), /* @__PURE__ */
|
|
44
|
-
...
|
|
45
|
-
...
|
|
46
|
-
ref:
|
|
47
|
-
id:
|
|
48
|
-
required:
|
|
53
|
+
}), /* @__PURE__ */ s("input", {
|
|
54
|
+
...P,
|
|
55
|
+
...B,
|
|
56
|
+
ref: O,
|
|
57
|
+
id: V,
|
|
58
|
+
required: A,
|
|
49
59
|
type: "range",
|
|
50
|
-
className: ["kapi-slider__input",
|
|
51
|
-
min:
|
|
52
|
-
max:
|
|
53
|
-
step:
|
|
54
|
-
value:
|
|
55
|
-
"aria-valuetext":
|
|
56
|
-
|
|
60
|
+
className: ["kapi-slider__input", w].filter(Boolean).join(" "),
|
|
61
|
+
min: p,
|
|
62
|
+
max: m,
|
|
63
|
+
step: h,
|
|
64
|
+
value: H,
|
|
65
|
+
"aria-valuetext": G,
|
|
66
|
+
"aria-readonly": L || void 0,
|
|
67
|
+
disabled: E,
|
|
57
68
|
style: {
|
|
58
|
-
...
|
|
59
|
-
...
|
|
69
|
+
...T,
|
|
70
|
+
...U
|
|
60
71
|
},
|
|
61
|
-
onChange: (e) =>
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
72
|
+
onChange: (e) => {
|
|
73
|
+
L || z(a(Number(e.target.value), {
|
|
74
|
+
min: p,
|
|
75
|
+
max: m,
|
|
76
|
+
step: h
|
|
77
|
+
}));
|
|
78
|
+
}
|
|
66
79
|
})]
|
|
67
|
-
});
|
|
80
|
+
}));
|
|
68
81
|
};
|
|
69
82
|
//#endregion
|
|
70
|
-
export {
|
|
83
|
+
export { u as KapiSlider, l as sliderClasses };
|
|
@@ -1,13 +1,19 @@
|
|
|
1
|
-
import type { InputHTMLAttributes, Ref } from "react";
|
|
1
|
+
import type { InputHTMLAttributes, ReactNode, Ref } from "react";
|
|
2
2
|
export type KapiSwitchProps = Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "size" | "children"> & {
|
|
3
|
-
/**
|
|
4
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Texto al lado del interruptor, dentro de su propio `<label>` (como `KapiCheckbox`): lo nombra y un
|
|
5
|
+
* clic en el texto lo alterna. Sin `label`, pasa `aria-label` o envuélvelo en un `KapiField`.
|
|
6
|
+
*/
|
|
7
|
+
label?: ReactNode | undefined;
|
|
8
|
+
/** Marca el control como inválido (`aria-invalid`). Sin la prop, lo toma del `KapiField` (`invalid`). */
|
|
9
|
+
invalid?: boolean | undefined;
|
|
5
10
|
/** Ref al `<input>`. */
|
|
6
|
-
ref?: Ref<HTMLInputElement
|
|
11
|
+
ref?: Ref<HTMLInputElement> | undefined;
|
|
7
12
|
};
|
|
8
13
|
/**
|
|
9
|
-
* Interruptor (`.kapi-switch`).
|
|
10
|
-
*
|
|
14
|
+
* Interruptor (`.kapi-switch`). Con `label`, el texto va al lado dentro de la misma etiqueta (no hace
|
|
15
|
+
* falta anidar otro `<label>`); sin él, pasa `aria-label` o envuélvelo en un `KapiField`, que le da id
|
|
16
|
+
* (lo nombra su label), ayuda, `aria-invalid` y `aria-required`.
|
|
11
17
|
* Props nativas al `<input role="switch">`; `className` a la etiqueta contenedora.
|
|
12
18
|
*/
|
|
13
|
-
export declare const KapiSwitch: ({ className, ref, invalid, id, required, "aria-describedby": describedBy, "aria-invalid": ariaInvalid, "aria-required": ariaRequired, ...rest }: KapiSwitchProps) => import("react").JSX.Element;
|
|
19
|
+
export declare const KapiSwitch: ({ label, className, ref, invalid, id, required, "aria-describedby": describedBy, "aria-invalid": ariaInvalid, "aria-required": ariaRequired, ...rest }: KapiSwitchProps) => import("react").JSX.Element;
|
|
@@ -1,28 +1,37 @@
|
|
|
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";
|
|
4
|
-
|
|
5
|
+
/* empty css */
|
|
6
|
+
import { joinClasses as n } from "../rootProps.js";
|
|
7
|
+
import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
8
|
//#region src/components/inputs/KapiSwitch.tsx
|
|
6
|
-
var
|
|
7
|
-
let
|
|
8
|
-
id:
|
|
9
|
-
describedBy:
|
|
10
|
-
invalid:
|
|
11
|
-
required:
|
|
12
|
-
ariaInvalid:
|
|
13
|
-
ariaRequired:
|
|
14
|
-
})
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
9
|
+
var o = ({ label: o, className: s, ref: c, invalid: l, id: u, required: d, "aria-describedby": f, "aria-invalid": p, "aria-required": m, ...h }) => {
|
|
10
|
+
let g = e(t(), {
|
|
11
|
+
id: u,
|
|
12
|
+
describedBy: f,
|
|
13
|
+
invalid: l,
|
|
14
|
+
required: d,
|
|
15
|
+
ariaInvalid: p,
|
|
16
|
+
ariaRequired: m
|
|
17
|
+
}), _ = /* @__PURE__ */ a(r, { children: [/* @__PURE__ */ i("input", {
|
|
18
|
+
ref: c,
|
|
19
|
+
type: "checkbox",
|
|
20
|
+
role: "switch",
|
|
21
|
+
...h,
|
|
22
|
+
...g,
|
|
23
|
+
required: d
|
|
24
|
+
}), /* @__PURE__ */ i("span", { className: "kapi-switch__track" })] });
|
|
25
|
+
return o == null ? /* @__PURE__ */ i("label", {
|
|
26
|
+
className: n("kapi-switch", s),
|
|
27
|
+
children: _
|
|
28
|
+
}) : /* @__PURE__ */ a("label", {
|
|
29
|
+
className: n("kapi-switchfield", s),
|
|
30
|
+
children: [/* @__PURE__ */ i("span", {
|
|
31
|
+
className: "kapi-switch",
|
|
32
|
+
children: _
|
|
33
|
+
}), o]
|
|
25
34
|
});
|
|
26
35
|
};
|
|
27
36
|
//#endregion
|
|
28
|
-
export {
|
|
37
|
+
export { o as KapiSwitch };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { type FocusEvent, type HTMLAttributes, type Ref } from "react";
|
|
2
|
-
import "
|
|
3
|
-
import type { KapiLabelsOverride } from "../labelsLogic";
|
|
1
|
+
import { type FocusEvent, type HTMLAttributes, type ReactNode, type Ref } from "react";
|
|
2
|
+
import type { KapiLabelsOverride } from "../labelsLogic.js";
|
|
4
3
|
export type KapiTagInputSize = "sm" | "md" | "lg";
|
|
5
4
|
export type KapiTagInputLabels = {
|
|
6
5
|
/** Prefijo del botón × de cada etiqueta ("Quitar ana@x.com"). */
|
|
@@ -19,54 +18,66 @@ type InputOwnedKeys = "id" | "aria-label" | "aria-labelledby" | "aria-describedb
|
|
|
19
18
|
*/
|
|
20
19
|
export type KapiTagInputProps = Omit<HTMLAttributes<HTMLDivElement>, "children" | "onChange" | "onBlur" | "defaultValue" | InputOwnedKeys> & {
|
|
21
20
|
/** Controlado: etiquetas actuales. */
|
|
22
|
-
value?: string[];
|
|
21
|
+
value?: readonly string[] | undefined;
|
|
23
22
|
/** Etiquetas iniciales cuando no es controlado. */
|
|
24
|
-
defaultValue?: string[];
|
|
23
|
+
defaultValue?: readonly string[] | undefined;
|
|
25
24
|
/** Nueva lista de etiquetas. */
|
|
26
|
-
onChange?: (values: string[]) => void;
|
|
25
|
+
onChange?: ((values: string[]) => void) | undefined;
|
|
27
26
|
/**
|
|
28
27
|
* Mensaje de error si el texto no sirve como etiqueta; `null` si sirve. Sólo un mensaje no vacío rechaza
|
|
29
28
|
* (`""` cuenta como válido). Una inválida no se agrega.
|
|
30
29
|
*/
|
|
31
|
-
validate?: (tag: string) => string | null;
|
|
30
|
+
validate?: ((tag: string) => string | null) | undefined;
|
|
32
31
|
/** Tope de etiquetas. */
|
|
33
|
-
maxTags?: number;
|
|
32
|
+
maxTags?: number | undefined;
|
|
34
33
|
/** Deja repetir etiquetas. Default `false`. */
|
|
35
|
-
allowDuplicates?: boolean;
|
|
34
|
+
allowDuplicates?: boolean | undefined;
|
|
36
35
|
/** Al comparar duplicados, distingue mayúsculas. Default `false`. */
|
|
37
|
-
caseSensitive?: boolean;
|
|
36
|
+
caseSensitive?: boolean | undefined;
|
|
38
37
|
/** Texto de ejemplo; se oculta cuando ya hay etiquetas. */
|
|
39
|
-
placeholder?: string;
|
|
38
|
+
placeholder?: string | undefined;
|
|
40
39
|
/** Deshabilita el control entero (texto y etiquetas). */
|
|
41
|
-
disabled?: boolean;
|
|
40
|
+
disabled?: boolean | undefined;
|
|
42
41
|
/** Escala compartida con inputs y selects. Default `md`. */
|
|
43
|
-
size?: KapiTagInputSize;
|
|
42
|
+
size?: KapiTagInputSize | undefined;
|
|
44
43
|
/** Con `name`, cada etiqueta viaja en el form como un `<input type="hidden">` con ese nombre. */
|
|
45
|
-
name?: string;
|
|
44
|
+
name?: string | undefined;
|
|
46
45
|
/** `id` del `<input>` de texto. */
|
|
47
|
-
id?: string;
|
|
46
|
+
id?: string | undefined;
|
|
48
47
|
/** Marca el control inválido (`aria-invalid`). Sin la prop, lo toma del `KapiField`. */
|
|
49
|
-
invalid?: boolean;
|
|
48
|
+
invalid?: boolean | undefined;
|
|
50
49
|
/** Marca el control obligatorio (`aria-required`). Sin la prop, lo toma del `KapiField`. */
|
|
51
|
-
required?: boolean;
|
|
50
|
+
required?: boolean | undefined;
|
|
51
|
+
/** Etiqueta del campo: con `label` o `help` el control se envuelve en un `KapiField`, como `KapiInput`. */
|
|
52
|
+
label?: ReactNode | undefined;
|
|
53
|
+
/** Ayuda / mensaje de error bajo el control (lo envuelve en un `KapiField`). */
|
|
54
|
+
help?: ReactNode | undefined;
|
|
55
|
+
/** Clase del `KapiField` propio (con `label` o `help`). `className` va al contenedor. */
|
|
56
|
+
fieldClassName?: string | undefined;
|
|
57
|
+
/**
|
|
58
|
+
* Solo lectura: el texto se enfoca y las etiquetas se ven y se copian, pero no se agregan ni se quitan.
|
|
59
|
+
* Sin la prop, lo toma del `KapiField`.
|
|
60
|
+
*/
|
|
61
|
+
readOnly?: boolean | undefined;
|
|
52
62
|
/** Nombre accesible del `<input>` de texto. */
|
|
53
|
-
"aria-label"?: string;
|
|
63
|
+
"aria-label"?: string | undefined;
|
|
54
64
|
/** `id` del elemento que nombra al `<input>` de texto. */
|
|
55
|
-
"aria-labelledby"?: string;
|
|
65
|
+
"aria-labelledby"?: string | undefined;
|
|
56
66
|
/** `id` del elemento que describe al `<input>` de texto (se suma al del mensaje de error propio). */
|
|
57
|
-
"aria-describedby"?: string;
|
|
67
|
+
"aria-describedby"?: string | undefined;
|
|
58
68
|
/** Se dispara cuando el foco sale de todo el control (ir del texto a un × no cuenta). */
|
|
59
|
-
onBlur?: (event: FocusEvent<HTMLElement>) => void;
|
|
69
|
+
onBlur?: ((event: FocusEvent<HTMLElement>) => void) | undefined;
|
|
60
70
|
/** Ref al `<input>` de texto. */
|
|
61
|
-
ref?: Ref<HTMLInputElement
|
|
71
|
+
ref?: Ref<HTMLInputElement> | undefined;
|
|
62
72
|
/** Textos fijos (clave `tagInput`). */
|
|
63
73
|
labels?: KapiLabelsOverride<KapiTagInputLabels> | undefined;
|
|
64
74
|
};
|
|
65
75
|
/** Clases del contenedor. Pura y exportada para testear. */
|
|
66
|
-
export declare const tagInputClasses: ({ size, invalid, disabled, className }: {
|
|
76
|
+
export declare const tagInputClasses: ({ size, invalid, disabled, readOnly, className }: {
|
|
67
77
|
size?: KapiTagInputSize | undefined;
|
|
68
78
|
invalid?: boolean | undefined;
|
|
69
79
|
disabled?: boolean | undefined;
|
|
80
|
+
readOnly?: boolean | undefined;
|
|
70
81
|
className?: string | undefined;
|
|
71
82
|
}) => string;
|
|
72
83
|
/**
|
|
@@ -75,5 +86,5 @@ export declare const tagInputClasses: ({ size, invalid, disabled, className }: {
|
|
|
75
86
|
* texto vacío quita la última. `validate`, `maxTags` y los duplicados rechazan con un mensaje y dejan el
|
|
76
87
|
* texto para corregirlo.
|
|
77
88
|
*/
|
|
78
|
-
export declare function KapiTagInput({ value, defaultValue, onChange, validate, maxTags, allowDuplicates, caseSensitive, placeholder, disabled, size, name, id, invalid, required, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, onBlur, ref, labels, className, onClick, ...rest }: KapiTagInputProps):
|
|
89
|
+
export declare function KapiTagInput({ value, defaultValue, onChange, validate, maxTags, allowDuplicates, caseSensitive, placeholder, disabled, size, name, id, invalid, required, label, help, fieldClassName, readOnly: readOnlyProp, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, onBlur, ref, labels, className, onClick, ...rest }: KapiTagInputProps): ReactNode;
|
|
79
90
|
export {};
|