@kapiuara/ui 0.0.0-stage → 0.1.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 +764 -2
- package/dist/components/data/KapiPagination.d.ts +36 -0
- package/dist/components/data/KapiPagination.js +102 -0
- package/dist/components/data/KapiTable.d.ts +245 -0
- package/dist/components/data/KapiTable.js +748 -0
- package/dist/components/data/KapiTableFilter.d.ts +48 -0
- package/dist/components/data/KapiTableFilter.js +81 -0
- package/dist/components/data/index.d.ts +10 -0
- package/dist/components/data/tableLogic.d.ts +197 -0
- package/dist/components/data/tableLogic.js +145 -0
- package/dist/components/data/tableResizeLogic.d.ts +28 -0
- package/dist/components/data/tableResizeLogic.js +20 -0
- package/dist/components/display/KapiAnnotation.d.ts +32 -0
- package/dist/components/display/KapiAnnotation.js +130 -0
- package/dist/components/display/KapiAvatar.d.ts +27 -0
- package/dist/components/display/KapiAvatar.js +43 -0
- package/dist/components/display/KapiAvatarGroup.d.ts +19 -0
- package/dist/components/display/KapiAvatarGroup.js +38 -0
- package/dist/components/display/KapiBadge.d.ts +21 -0
- package/dist/components/display/KapiBadge.js +28 -0
- package/dist/components/display/KapiComment.d.ts +27 -0
- package/dist/components/display/KapiComment.js +66 -0
- package/dist/components/display/KapiCommentComposer.d.ts +49 -0
- package/dist/components/display/KapiCommentComposer.js +76 -0
- package/dist/components/display/KapiDescriptionList.d.ts +19 -0
- package/dist/components/display/KapiDescriptionList.js +35 -0
- package/dist/components/display/KapiFileItem.d.ts +39 -0
- package/dist/components/display/KapiFileItem.js +74 -0
- package/dist/components/display/KapiFileViewer.d.ts +51 -0
- package/dist/components/display/KapiFileViewer.js +107 -0
- package/dist/components/display/KapiIconTile.d.ts +16 -0
- package/dist/components/display/KapiIconTile.js +29 -0
- package/dist/components/display/KapiStat.d.ts +24 -0
- package/dist/components/display/KapiStat.js +41 -0
- package/dist/components/display/KapiTag.d.ts +27 -0
- package/dist/components/display/KapiTag.js +44 -0
- package/dist/components/display/KapiTimeline.d.ts +15 -0
- package/dist/components/display/KapiTimeline.js +30 -0
- package/dist/components/display/annotationLogic.d.ts +26 -0
- package/dist/components/display/annotationLogic.js +17 -0
- package/dist/components/display/avatarGroupLogic.d.ts +14 -0
- package/dist/components/display/avatarGroupLogic.js +13 -0
- package/dist/components/display/avatarLogic.d.ts +5 -0
- package/dist/components/display/avatarLogic.js +9 -0
- package/dist/components/display/commentLogic.d.ts +18 -0
- package/dist/components/display/commentLogic.js +7 -0
- package/dist/components/display/fileItemLogic.d.ts +9 -0
- package/dist/components/display/fileItemLogic.js +12 -0
- package/dist/components/display/iconTileLogic.d.ts +13 -0
- package/dist/components/display/iconTileLogic.js +13 -0
- package/dist/components/display/index.d.ts +40 -0
- package/dist/components/display/statLogic.d.ts +10 -0
- package/dist/components/display/statLogic.js +10 -0
- package/dist/components/display/tagLogic.d.ts +11 -0
- package/dist/components/display/tagLogic.js +10 -0
- package/dist/components/display/timelineLogic.d.ts +5 -0
- package/dist/components/display/timelineLogic.js +4 -0
- package/dist/components/feedback/KapiAlert.d.ts +28 -0
- package/dist/components/feedback/KapiAlert.js +53 -0
- package/dist/components/feedback/KapiBulkBar.d.ts +30 -0
- package/dist/components/feedback/KapiBulkBar.js +34 -0
- package/dist/components/feedback/KapiCountdown.d.ts +26 -0
- package/dist/components/feedback/KapiCountdown.js +43 -0
- package/dist/components/feedback/KapiEmpty.d.ts +14 -0
- package/dist/components/feedback/KapiEmpty.js +31 -0
- package/dist/components/feedback/KapiFab.d.ts +34 -0
- package/dist/components/feedback/KapiFab.js +116 -0
- package/dist/components/feedback/KapiOfflineBanner.d.ts +25 -0
- package/dist/components/feedback/KapiOfflineBanner.js +40 -0
- package/dist/components/feedback/KapiProgress.d.ts +24 -0
- package/dist/components/feedback/KapiProgress.js +94 -0
- package/dist/components/feedback/KapiSkeleton.d.ts +12 -0
- package/dist/components/feedback/KapiSkeleton.js +16 -0
- package/dist/components/feedback/KapiToastContainer.d.ts +16 -0
- package/dist/components/feedback/KapiToastContainer.js +81 -0
- package/dist/components/feedback/KapiTour.d.ts +40 -0
- package/dist/components/feedback/KapiTour.js +157 -0
- package/dist/components/feedback/KapiUnsavedBar.d.ts +35 -0
- package/dist/components/feedback/KapiUnsavedBar.js +47 -0
- package/dist/components/feedback/bulkBarLogic.d.ts +2 -0
- package/dist/components/feedback/bulkBarLogic.js +7 -0
- package/dist/components/feedback/countdownLogic.d.ts +74 -0
- package/dist/components/feedback/countdownLogic.js +70 -0
- package/dist/components/feedback/fabLogic.d.ts +17 -0
- package/dist/components/feedback/fabLogic.js +10 -0
- package/dist/components/feedback/index.d.ts +33 -0
- package/dist/components/feedback/offlineBannerLogic.d.ts +10 -0
- package/dist/components/feedback/offlineBannerLogic.js +8 -0
- package/dist/components/feedback/progressLogic.d.ts +17 -0
- package/dist/components/feedback/progressLogic.js +16 -0
- package/dist/components/feedback/toastStore.d.ts +62 -0
- package/dist/components/feedback/toastStore.js +38 -0
- package/dist/components/feedback/tourLogic.d.ts +64 -0
- package/dist/components/feedback/tourLogic.js +31 -0
- package/dist/components/feedback/unsavedBarLogic.d.ts +2 -0
- package/dist/components/feedback/unsavedBarLogic.js +8 -0
- package/dist/components/inputs/KapiAutocomplete.d.ts +81 -0
- package/dist/components/inputs/KapiAutocomplete.js +205 -0
- package/dist/components/inputs/KapiButton.d.ts +23 -0
- package/dist/components/inputs/KapiButton.js +25 -0
- package/dist/components/inputs/KapiCalendar.d.ts +35 -0
- package/dist/components/inputs/KapiCalendar.js +60 -0
- package/dist/components/inputs/KapiCalendarGrid.d.ts +29 -0
- package/dist/components/inputs/KapiCalendarGrid.js +65 -0
- package/dist/components/inputs/KapiCheckCard.d.ts +28 -0
- package/dist/components/inputs/KapiCheckCard.js +41 -0
- package/dist/components/inputs/KapiCheckbox.d.ts +7 -0
- package/dist/components/inputs/KapiCheckbox.js +5 -0
- package/dist/components/inputs/KapiDatePicker.d.ts +46 -0
- package/dist/components/inputs/KapiDatePicker.js +189 -0
- package/dist/components/inputs/KapiDateRangePicker.d.ts +49 -0
- package/dist/components/inputs/KapiDateRangePicker.js +179 -0
- package/dist/components/inputs/KapiFacetedSearch.d.ts +45 -0
- package/dist/components/inputs/KapiFacetedSearch.js +188 -0
- package/dist/components/inputs/KapiField.d.ts +33 -0
- package/dist/components/inputs/KapiField.js +60 -0
- package/dist/components/inputs/KapiFileUpload.d.ts +58 -0
- package/dist/components/inputs/KapiFileUpload.js +134 -0
- package/dist/components/inputs/KapiIconButton.d.ts +13 -0
- package/dist/components/inputs/KapiIconButton.js +16 -0
- package/dist/components/inputs/KapiInput.d.ts +92 -0
- package/dist/components/inputs/KapiInput.js +123 -0
- package/dist/components/inputs/KapiInputGroup.d.ts +37 -0
- package/dist/components/inputs/KapiInputGroup.js +29 -0
- package/dist/components/inputs/KapiMaskedInput.d.ts +52 -0
- package/dist/components/inputs/KapiMaskedInput.js +78 -0
- package/dist/components/inputs/KapiNumberStepper.d.ts +44 -0
- package/dist/components/inputs/KapiNumberStepper.js +100 -0
- package/dist/components/inputs/KapiRadio.d.ts +7 -0
- package/dist/components/inputs/KapiRadio.js +5 -0
- package/dist/components/inputs/KapiRating.d.ts +55 -0
- package/dist/components/inputs/KapiRating.js +99 -0
- package/dist/components/inputs/KapiSegmented.d.ts +41 -0
- package/dist/components/inputs/KapiSegmented.js +83 -0
- package/dist/components/inputs/KapiSelect.d.ts +109 -0
- package/dist/components/inputs/KapiSelect.js +443 -0
- package/dist/components/inputs/KapiSlider.d.ts +42 -0
- package/dist/components/inputs/KapiSlider.js +70 -0
- package/dist/components/inputs/KapiSwitch.d.ts +13 -0
- package/dist/components/inputs/KapiSwitch.js +28 -0
- package/dist/components/inputs/KapiTagInput.d.ts +79 -0
- package/dist/components/inputs/KapiTagInput.js +115 -0
- package/dist/components/inputs/KapiTextarea.d.ts +32 -0
- package/dist/components/inputs/KapiTextarea.js +67 -0
- package/dist/components/inputs/asyncSelectLogic.d.ts +42 -0
- package/dist/components/inputs/asyncSelectLogic.js +46 -0
- package/dist/components/inputs/autocompleteLogic.d.ts +73 -0
- package/dist/components/inputs/autocompleteLogic.js +67 -0
- package/dist/components/inputs/checkControl.d.ts +20 -0
- package/dist/components/inputs/checkControl.js +31 -0
- package/dist/components/inputs/datePickerLogic.d.ts +92 -0
- package/dist/components/inputs/datePickerLogic.js +174 -0
- package/dist/components/inputs/dateRangeLogic.d.ts +31 -0
- package/dist/components/inputs/dateRangeLogic.js +44 -0
- package/dist/components/inputs/facetedSearchLogic.d.ts +69 -0
- package/dist/components/inputs/facetedSearchLogic.js +39 -0
- package/dist/components/inputs/fieldLogic.d.ts +67 -0
- package/dist/components/inputs/fieldLogic.js +35 -0
- package/dist/components/inputs/fileUploadLogic.d.ts +13 -0
- package/dist/components/inputs/fileUploadLogic.js +9 -0
- package/dist/components/inputs/index.d.ts +55 -0
- package/dist/components/inputs/inputGroupLogic.d.ts +22 -0
- package/dist/components/inputs/inputGroupLogic.js +9 -0
- package/dist/components/inputs/inputLogic.d.ts +25 -0
- package/dist/components/inputs/inputLogic.js +10 -0
- package/dist/components/inputs/maskLogic.d.ts +34 -0
- package/dist/components/inputs/maskLogic.js +57 -0
- package/dist/components/inputs/numberStepLogic.d.ts +14 -0
- package/dist/components/inputs/numberStepLogic.js +21 -0
- package/dist/components/inputs/ratingLogic.d.ts +9 -0
- package/dist/components/inputs/ratingLogic.js +22 -0
- package/dist/components/inputs/segmentedLogic.d.ts +6 -0
- package/dist/components/inputs/segmentedLogic.js +14 -0
- package/dist/components/inputs/selectLogic.d.ts +89 -0
- package/dist/components/inputs/selectLogic.js +82 -0
- package/dist/components/inputs/sliderLogic.d.ts +9 -0
- package/dist/components/inputs/sliderLogic.js +17 -0
- package/dist/components/inputs/tagInputLogic.d.ts +40 -0
- package/dist/components/inputs/tagInputLogic.js +40 -0
- package/dist/components/inputs/textareaLogic.d.ts +17 -0
- package/dist/components/inputs/textareaLogic.js +13 -0
- package/dist/components/inputs/useCalendarFocus.d.ts +13 -0
- package/dist/components/inputs/useCalendarFocus.js +25 -0
- package/dist/components/inputs/useDatePopSide.d.ts +15 -0
- package/dist/components/inputs/useDatePopSide.js +20 -0
- package/dist/components/labelsLogic.d.ts +6 -0
- package/dist/components/labelsLogic.js +11 -0
- package/dist/components/layout/KapiAccessCard.d.ts +40 -0
- package/dist/components/layout/KapiAccessCard.js +66 -0
- package/dist/components/layout/KapiAccountMenu.d.ts +61 -0
- package/dist/components/layout/KapiAccountMenu.js +212 -0
- package/dist/components/layout/KapiCard.d.ts +43 -0
- package/dist/components/layout/KapiCard.js +53 -0
- package/dist/components/layout/KapiCluster.d.ts +15 -0
- package/dist/components/layout/KapiCluster.js +21 -0
- package/dist/components/layout/KapiContextSlot.d.ts +45 -0
- package/dist/components/layout/KapiContextSlot.js +92 -0
- package/dist/components/layout/KapiDivider.d.ts +16 -0
- package/dist/components/layout/KapiDivider.js +41 -0
- package/dist/components/layout/KapiGrid.d.ts +19 -0
- package/dist/components/layout/KapiGrid.js +25 -0
- package/dist/components/layout/KapiNotificationBell.d.ts +75 -0
- package/dist/components/layout/KapiNotificationBell.js +196 -0
- package/dist/components/layout/KapiPageHeader.d.ts +28 -0
- package/dist/components/layout/KapiPageHeader.js +47 -0
- package/dist/components/layout/KapiPanelParts.d.ts +35 -0
- package/dist/components/layout/KapiPanelParts.js +63 -0
- package/dist/components/layout/KapiRail.d.ts +40 -0
- package/dist/components/layout/KapiRail.js +102 -0
- package/dist/components/layout/KapiScrollArea.d.ts +40 -0
- package/dist/components/layout/KapiScrollArea.js +49 -0
- package/dist/components/layout/KapiShell.d.ts +40 -0
- package/dist/components/layout/KapiShell.js +48 -0
- package/dist/components/layout/KapiStack.d.ts +11 -0
- package/dist/components/layout/KapiStack.js +19 -0
- package/dist/components/layout/accessCardLogic.d.ts +18 -0
- package/dist/components/layout/accessCardLogic.js +11 -0
- package/dist/components/layout/cardLogic.d.ts +9 -0
- package/dist/components/layout/cardLogic.js +11 -0
- package/dist/components/layout/index.d.ts +33 -0
- package/dist/components/layout/layoutPrimitives.d.ts +51 -0
- package/dist/components/layout/layoutPrimitives.js +58 -0
- package/dist/components/layout/notificationBellLogic.d.ts +20 -0
- package/dist/components/layout/notificationBellLogic.js +14 -0
- package/dist/components/layout/railLogic.d.ts +52 -0
- package/dist/components/layout/railLogic.js +16 -0
- package/dist/components/locale/KapiLocaleProvider.d.ts +29 -0
- package/dist/components/locale/KapiLocaleProvider.js +27 -0
- package/dist/components/locale/index.d.ts +5 -0
- package/dist/components/locale/labelRegistry.d.ts +110 -0
- package/dist/components/locale/linkLabels.d.ts +6 -0
- package/dist/components/locale/linkLabels.js +4 -0
- package/dist/components/navigation/CtxSlidingList.d.ts +11 -0
- package/dist/components/navigation/CtxSlidingList.js +24 -0
- package/dist/components/navigation/KapiAccordion.d.ts +24 -0
- package/dist/components/navigation/KapiAccordion.js +68 -0
- package/dist/components/navigation/KapiBreadcrumb.d.ts +23 -0
- package/dist/components/navigation/KapiBreadcrumb.js +32 -0
- package/dist/components/navigation/KapiCollapsiblePanel.d.ts +63 -0
- package/dist/components/navigation/KapiCollapsiblePanel.js +83 -0
- package/dist/components/navigation/KapiContextPanel.d.ts +117 -0
- package/dist/components/navigation/KapiContextPanel.js +265 -0
- package/dist/components/navigation/KapiFilterChips.d.ts +30 -0
- package/dist/components/navigation/KapiFilterChips.js +40 -0
- package/dist/components/navigation/KapiNavBadge.d.ts +26 -0
- package/dist/components/navigation/KapiNavBadge.js +33 -0
- package/dist/components/navigation/KapiPanelGroup.d.ts +69 -0
- package/dist/components/navigation/KapiPanelGroup.js +149 -0
- package/dist/components/navigation/KapiSteps.d.ts +43 -0
- package/dist/components/navigation/KapiSteps.js +63 -0
- package/dist/components/navigation/KapiTabs.d.ts +56 -0
- package/dist/components/navigation/KapiTabs.js +81 -0
- package/dist/components/navigation/KapiTree.d.ts +56 -0
- package/dist/components/navigation/KapiTree.js +157 -0
- package/dist/components/navigation/KapiWizard.d.ts +49 -0
- package/dist/components/navigation/KapiWizard.js +104 -0
- package/dist/components/navigation/MiniNavItem.d.ts +35 -0
- package/dist/components/navigation/MiniNavItem.js +57 -0
- package/dist/components/navigation/accordionLogic.d.ts +4 -0
- package/dist/components/navigation/accordionLogic.js +4 -0
- package/dist/components/navigation/activeItemLogic.d.ts +7 -0
- package/dist/components/navigation/activeItemLogic.js +4 -0
- package/dist/components/navigation/breadcrumbLogic.d.ts +8 -0
- package/dist/components/navigation/breadcrumbLogic.js +4 -0
- package/dist/components/navigation/contextPanelLogic.d.ts +27 -0
- package/dist/components/navigation/contextPanelLogic.js +11 -0
- package/dist/components/navigation/filterChipsLogic.d.ts +23 -0
- package/dist/components/navigation/filterChipsLogic.js +20 -0
- package/dist/components/navigation/index.d.ts +39 -0
- package/dist/components/navigation/navBadgeLogic.d.ts +26 -0
- package/dist/components/navigation/navBadgeLogic.js +16 -0
- package/dist/components/navigation/panelGroupLogic.d.ts +15 -0
- package/dist/components/navigation/panelGroupLogic.js +13 -0
- package/dist/components/navigation/panelMini.d.ts +13 -0
- package/dist/components/navigation/panelMini.js +9 -0
- package/dist/components/navigation/panelMiniLogic.d.ts +19 -0
- package/dist/components/navigation/panelMiniLogic.js +6 -0
- package/dist/components/navigation/stepsLogic.d.ts +25 -0
- package/dist/components/navigation/stepsLogic.js +10 -0
- package/dist/components/navigation/tabsLogic.d.ts +12 -0
- package/dist/components/navigation/tabsLogic.js +14 -0
- package/dist/components/navigation/treeLogic.d.ts +80 -0
- package/dist/components/navigation/treeLogic.js +91 -0
- package/dist/components/navigation/wizardLogic.d.ts +11 -0
- package/dist/components/navigation/wizardLogic.js +7 -0
- package/dist/components/overlays/KapiCanvasForm.d.ts +42 -0
- package/dist/components/overlays/KapiCanvasForm.js +60 -0
- package/dist/components/overlays/KapiCommandPalette.d.ts +58 -0
- package/dist/components/overlays/KapiCommandPalette.js +152 -0
- package/dist/components/overlays/KapiConfirm.d.ts +48 -0
- package/dist/components/overlays/KapiConfirm.js +94 -0
- package/dist/components/overlays/KapiContextMenu.d.ts +51 -0
- package/dist/components/overlays/KapiContextMenu.js +90 -0
- package/dist/components/overlays/KapiDialogHost.d.ts +23 -0
- package/dist/components/overlays/KapiDialogHost.js +129 -0
- package/dist/components/overlays/KapiDropdown.d.ts +30 -0
- package/dist/components/overlays/KapiDropdown.js +84 -0
- package/dist/components/overlays/KapiLoading.d.ts +14 -0
- package/dist/components/overlays/KapiLoading.js +43 -0
- package/dist/components/overlays/KapiMenuButton.d.ts +25 -0
- package/dist/components/overlays/KapiMenuButton.js +109 -0
- package/dist/components/overlays/KapiModal.d.ts +61 -0
- package/dist/components/overlays/KapiModal.js +106 -0
- package/dist/components/overlays/KapiOffcanvas.d.ts +96 -0
- package/dist/components/overlays/KapiOffcanvas.js +209 -0
- package/dist/components/overlays/KapiOffcanvasStack.d.ts +58 -0
- package/dist/components/overlays/KapiOffcanvasStack.js +84 -0
- package/dist/components/overlays/KapiPhotoView.d.ts +60 -0
- package/dist/components/overlays/KapiPhotoView.js +122 -0
- package/dist/components/overlays/KapiPopover.d.ts +46 -0
- package/dist/components/overlays/KapiPopover.js +68 -0
- package/dist/components/overlays/KapiShapeSheet.d.ts +34 -0
- package/dist/components/overlays/KapiShapeSheet.js +82 -0
- package/dist/components/overlays/KapiSplitModal.d.ts +41 -0
- package/dist/components/overlays/KapiSplitModal.js +125 -0
- package/dist/components/overlays/KapiTooltip.d.ts +38 -0
- package/dist/components/overlays/KapiTooltip.js +105 -0
- package/dist/components/overlays/canvasFormLogic.d.ts +18 -0
- package/dist/components/overlays/canvasFormLogic.js +16 -0
- package/dist/components/overlays/commandPaletteLogic.d.ts +29 -0
- package/dist/components/overlays/commandPaletteLogic.js +19 -0
- package/dist/components/overlays/dialogStore.d.ts +114 -0
- package/dist/components/overlays/dialogStore.js +76 -0
- package/dist/components/overlays/dialogUtils.d.ts +72 -0
- package/dist/components/overlays/dialogUtils.js +62 -0
- package/dist/components/overlays/exitPresenceLogic.d.ts +14 -0
- package/dist/components/overlays/exitPresenceLogic.js +5 -0
- package/dist/components/overlays/index.d.ts +38 -0
- package/dist/components/overlays/menuButtonLogic.d.ts +58 -0
- package/dist/components/overlays/menuButtonLogic.js +9 -0
- package/dist/components/overlays/menuKeyboardLogic.d.ts +25 -0
- package/dist/components/overlays/menuKeyboardLogic.js +30 -0
- package/dist/components/overlays/offcanvasCompanion.d.ts +16 -0
- package/dist/components/overlays/offcanvasCompanion.js +6 -0
- package/dist/components/overlays/offcanvasResize.d.ts +22 -0
- package/dist/components/overlays/offcanvasResize.js +10 -0
- package/dist/components/overlays/offcanvasSide.d.ts +30 -0
- package/dist/components/overlays/offcanvasSide.js +29 -0
- package/dist/components/overlays/offcanvasStack.d.ts +76 -0
- package/dist/components/overlays/offcanvasStack.js +72 -0
- package/dist/components/overlays/overlayPortal.d.ts +9 -0
- package/dist/components/overlays/overlayPortal.js +6 -0
- package/dist/components/overlays/popoverLogic.d.ts +94 -0
- package/dist/components/overlays/popoverLogic.js +47 -0
- package/dist/components/overlays/splitModalLayout.d.ts +8 -0
- package/dist/components/overlays/splitModalLayout.js +5 -0
- package/dist/components/overlays/useExitPresence.d.ts +14 -0
- package/dist/components/overlays/useExitPresence.js +34 -0
- package/dist/components/overlays/useNativeDialog.d.ts +30 -0
- package/dist/components/overlays/useNativeDialog.js +56 -0
- package/dist/components/rootProps.d.ts +17 -0
- package/dist/components/rootProps.js +4 -0
- package/dist/hooks/breakpointOpenLogic.d.ts +7 -0
- package/dist/hooks/breakpointOpenLogic.js +4 -0
- package/dist/hooks/dateFormat.d.ts +12 -0
- package/dist/hooks/dateFormat.js +15 -0
- package/dist/hooks/downloadLogic.d.ts +31 -0
- package/dist/hooks/downloadLogic.js +85 -0
- package/dist/hooks/focusLogic.d.ts +18 -0
- package/dist/hooks/focusLogic.js +17 -0
- package/dist/hooks/growOriginLogic.d.ts +22 -0
- package/dist/hooks/growOriginLogic.js +10 -0
- package/dist/hooks/hotkeyLogic.d.ts +22 -0
- package/dist/hooks/hotkeyLogic.js +32 -0
- package/dist/hooks/index.d.ts +49 -0
- package/dist/hooks/kapiRoot.d.ts +16 -0
- package/dist/hooks/kapiRoot.js +9 -0
- package/dist/hooks/onlineStatusLogic.d.ts +31 -0
- package/dist/hooks/onlineStatusLogic.js +28 -0
- package/dist/hooks/persistentStateLogic.d.ts +12 -0
- package/dist/hooks/persistentStateLogic.js +17 -0
- package/dist/hooks/rafThrottle.d.ts +33 -0
- package/dist/hooks/rafThrottle.js +33 -0
- package/dist/hooks/recentLogic.d.ts +9 -0
- package/dist/hooks/recentLogic.js +10 -0
- package/dist/hooks/reducedMotion.d.ts +13 -0
- package/dist/hooks/reducedMotion.js +5 -0
- package/dist/hooks/rightClick.d.ts +37 -0
- package/dist/hooks/rightClick.js +30 -0
- package/dist/hooks/scrollCollapseLogic.d.ts +12 -0
- package/dist/hooks/scrollCollapseLogic.js +4 -0
- package/dist/hooks/scrollEdgesLogic.d.ts +49 -0
- package/dist/hooks/scrollEdgesLogic.js +19 -0
- package/dist/hooks/slidingIndicatorLogic.d.ts +25 -0
- package/dist/hooks/slidingIndicatorLogic.js +15 -0
- package/dist/hooks/storageLogic.d.ts +15 -0
- package/dist/hooks/storageLogic.js +24 -0
- package/dist/hooks/unsavedGuardLogic.d.ts +17 -0
- package/dist/hooks/unsavedGuardLogic.js +17 -0
- package/dist/hooks/useDragScroll.d.ts +12 -0
- package/dist/hooks/useDragScroll.js +32 -0
- package/dist/hooks/useGlobalRightClick.d.ts +14 -0
- package/dist/hooks/useGlobalRightClick.js +35 -0
- package/dist/hooks/useGrowOrigin.d.ts +13 -0
- package/dist/hooks/useGrowOrigin.js +16 -0
- package/dist/hooks/useHotkey.d.ts +15 -0
- package/dist/hooks/useHotkey.js +31 -0
- package/dist/hooks/useKapiTheme.d.ts +69 -0
- package/dist/hooks/useKapiTheme.js +88 -0
- package/dist/hooks/useMediaQuery.d.ts +6 -0
- package/dist/hooks/useMediaQuery.js +13 -0
- package/dist/hooks/useObjectUrl.d.ts +6 -0
- package/dist/hooks/useObjectUrl.js +19 -0
- package/dist/hooks/useOnlineStatus.d.ts +7 -0
- package/dist/hooks/useOnlineStatus.js +7 -0
- package/dist/hooks/usePersistentState.d.ts +19 -0
- package/dist/hooks/usePersistentState.js +37 -0
- package/dist/hooks/usePlacement.d.ts +36 -0
- package/dist/hooks/usePlacement.js +84 -0
- package/dist/hooks/useRecent.d.ts +17 -0
- package/dist/hooks/useRecent.js +16 -0
- package/dist/hooks/useScrollCollapse.d.ts +10 -0
- package/dist/hooks/useScrollCollapse.js +27 -0
- package/dist/hooks/useScrollEdges.d.ts +32 -0
- package/dist/hooks/useScrollEdges.js +91 -0
- package/dist/hooks/useSlidingIndicator.d.ts +23 -0
- package/dist/hooks/useSlidingIndicator.js +51 -0
- package/dist/hooks/useUnsavedGuard.d.ts +70 -0
- package/dist/hooks/useUnsavedGuard.js +47 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +162 -0
- package/dist/kapi.css +2 -0
- package/dist/kapi.layered.css +4 -0
- package/package.json +86 -4
|
@@ -0,0 +1,443 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { assignRef as e, fieldControlProps as t, focusLeaves as n } from "./fieldLogic.js";
|
|
3
|
+
import { useKapiField as r } from "./KapiField.js";
|
|
4
|
+
import { resolveGroupSize as ee, selectControlId as te } from "./inputGroupLogic.js";
|
|
5
|
+
import { useKapiInputGroup as ne } from "./KapiInputGroup.js";
|
|
6
|
+
import { useLabels as re } from "../locale/KapiLocaleProvider.js";
|
|
7
|
+
import { resolveKapiRoot as ie } from "../../hooks/kapiRoot.js";
|
|
8
|
+
import { SELECT_MENU_PLACEMENT as ae, displayLabel as oe, filterOptions as se, findTypeaheadIndex as ce, flattenOptions as le, indexEntries as ue, initialActiveIndex as de, nextActiveIndex as i, normalizeValue as a, selectedOptions as fe, toggleValue as pe } from "./selectLogic.js";
|
|
9
|
+
import { createLoadSequencer as me, isCreateRow as he, menuItems as ge, mergeKnownOptions as o, selectedFromKnown as _e, withCreated as ve } from "./asyncSelectLogic.js";
|
|
10
|
+
/* empty css */
|
|
11
|
+
import { usePlacement as ye } from "../../hooks/usePlacement.js";
|
|
12
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
13
|
+
import { useCallback as l, useEffect as u, useId as be, useLayoutEffect as xe, useMemo as d, useRef as f, useState as p } from "react";
|
|
14
|
+
import { Check as Se, ChevronDown as Ce, X as we } from "lucide-react";
|
|
15
|
+
import { createPortal as Te } from "react-dom";
|
|
16
|
+
//#region src/components/inputs/KapiSelect.tsx
|
|
17
|
+
var Ee = 6, De = 500, Oe = [], ke = (e, t) => `${e} “${t.trim()}”`, Ae = ({ size: e = "md", open: t, disabled: n, multi: r, className: ee }) => [
|
|
18
|
+
"kapisel",
|
|
19
|
+
`kapisel--${e}`,
|
|
20
|
+
t && "kapisel--open",
|
|
21
|
+
n && "kapisel--disabled",
|
|
22
|
+
r && "kapisel--multi",
|
|
23
|
+
ee
|
|
24
|
+
].filter(Boolean).join(" "), je = {
|
|
25
|
+
clear: "Limpiar selección",
|
|
26
|
+
remove: "Quitar",
|
|
27
|
+
placeholder: "Seleccionar…",
|
|
28
|
+
noOptions: "Sin opciones",
|
|
29
|
+
loading: "Cargando…",
|
|
30
|
+
loadError: "No se pudieron cargar las opciones",
|
|
31
|
+
createError: "No se pudo crear la opción",
|
|
32
|
+
create: "Crear"
|
|
33
|
+
}, Me = (Me) => {
|
|
34
|
+
let { options: m = Oe, loadOptions: h, loadDelay: Ne = 300, onCreate: Pe, value: Fe, defaultValue: Ie, multiple: g = !1, searchable: _ = !0, clearable: Le = !1, disabled: v = !1, loading: Re = !1, placeholder: ze, size: Be, renderOption: Ve, noOptionsMessage: He, loadingMessage: Ue, name: We, id: Ge, className: Ke, style: qe, "aria-label": Je, labels: Ye, ref: y, onBlur: Xe } = Me, Ze = Me.onChange, b = re("select", je, Ye), Qe = ze ?? b.placeholder, $e = He ?? b.noOptions, et = Ue ?? b.loading, tt = ne(), nt = ee(Be, tt?.size) ?? "md", rt = r(), it = be(), x = te({
|
|
35
|
+
id: Ge,
|
|
36
|
+
fieldControlId: rt?.controlId,
|
|
37
|
+
autoId: it,
|
|
38
|
+
inGroup: tt !== null
|
|
39
|
+
}), at = `${x}-listbox`, ot = `${x}-value`, st = (e) => `${x}-opt-${e}`, ct = Fe !== void 0, [lt, ut] = p(() => a(Ie, g)), S = a(ct ? Fe : lt, g), C = d(() => a(S, !0), [S]), [w, T] = p(!1), [E, D] = p(""), [dt, O] = p(-1), k = f(null), A = f(null), ft = f(null), pt = l((t) => {
|
|
40
|
+
A.current = t, e(y, t);
|
|
41
|
+
}, [y]), mt = l((t) => {
|
|
42
|
+
ft.current = t, e(y, t);
|
|
43
|
+
}, [y]), j = f(null), ht = f({
|
|
44
|
+
buffer: "",
|
|
45
|
+
timer: void 0
|
|
46
|
+
}), M = h !== void 0, N = E.trim(), P = w && !v, F = M || Pe !== void 0, [gt, _t] = p(() => F ? o(/* @__PURE__ */ new Map(), m) : /* @__PURE__ */ new Map()), [vt, yt] = p(m);
|
|
47
|
+
F && vt !== m && (yt(m), _t((e) => o(e, m)));
|
|
48
|
+
let I = M && (N !== "" || m.length === 0), [L, bt] = p(null), [R] = p(me), z = L?.query === N, xt = I && P && !z, St = I && z && L.error, B = Re || xt, [Ct, wt] = p(!1), V = f(!1), [Tt, H] = p(!1), Et = B || Ct, U = d(() => F ? _e(gt, S) : fe(m, S), [
|
|
49
|
+
F,
|
|
50
|
+
gt,
|
|
51
|
+
m,
|
|
52
|
+
S
|
|
53
|
+
]), W = d(() => I ? z ? L.entries : [] : M ? m : _ ? se(m, E) : m, [
|
|
54
|
+
I,
|
|
55
|
+
z,
|
|
56
|
+
L,
|
|
57
|
+
M,
|
|
58
|
+
m,
|
|
59
|
+
_,
|
|
60
|
+
E
|
|
61
|
+
]), G = Pe !== void 0 && _ && !Re && !Ct, K = d(() => ge(W, E, G && !xt, ke(b.create, E)), [
|
|
62
|
+
W,
|
|
63
|
+
E,
|
|
64
|
+
G,
|
|
65
|
+
xt,
|
|
66
|
+
b.create
|
|
67
|
+
]), Dt = d(() => ue(W), [W]), q = K.length > 0 && he(K[K.length - 1]) ? K[K.length - 1] : null, J = dt >= 0 && dt < K.length ? dt : -1, Y = U.length > 0, Ot = _ && E !== "", kt = B ? et : Tt ? b.createError : St ? b.loadError : K.length === 0 ? $e : null, At = f(h), X = f({
|
|
68
|
+
current: S,
|
|
69
|
+
query: E,
|
|
70
|
+
createAllowed: G,
|
|
71
|
+
createPrefix: b.create
|
|
72
|
+
});
|
|
73
|
+
u(() => {
|
|
74
|
+
At.current = h, X.current = {
|
|
75
|
+
current: S,
|
|
76
|
+
query: E,
|
|
77
|
+
createAllowed: G,
|
|
78
|
+
createPrefix: b.create
|
|
79
|
+
};
|
|
80
|
+
}), u(() => {
|
|
81
|
+
if (!I || !P || z) return;
|
|
82
|
+
let e = setTimeout(() => {
|
|
83
|
+
let e = At.current;
|
|
84
|
+
if (!e) return;
|
|
85
|
+
let t = R.start(), n;
|
|
86
|
+
try {
|
|
87
|
+
n = e(N, { signal: t.signal });
|
|
88
|
+
} catch (e) {
|
|
89
|
+
n = Promise.reject(e);
|
|
90
|
+
}
|
|
91
|
+
n.then((e) => {
|
|
92
|
+
if (!t.isCurrent()) return;
|
|
93
|
+
_t((t) => o(t, e)), bt({
|
|
94
|
+
query: N,
|
|
95
|
+
entries: e,
|
|
96
|
+
error: !1
|
|
97
|
+
});
|
|
98
|
+
let { createAllowed: n, createPrefix: r } = X.current, ee = ge(e, N, n, ke(r, N));
|
|
99
|
+
O(i(-1, "first", ee));
|
|
100
|
+
}, () => {
|
|
101
|
+
t.isCurrent() && bt({
|
|
102
|
+
query: N,
|
|
103
|
+
entries: [],
|
|
104
|
+
error: !0
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
}, Ne);
|
|
108
|
+
return () => clearTimeout(e);
|
|
109
|
+
}, [
|
|
110
|
+
I,
|
|
111
|
+
P,
|
|
112
|
+
z,
|
|
113
|
+
N,
|
|
114
|
+
Ne,
|
|
115
|
+
R
|
|
116
|
+
]), u(() => (P || (R.cancel(), bt((e) => e?.error ? null : e), H(!1)), () => R.cancel()), [P, R]);
|
|
117
|
+
let jt = () => (_ ? A.current : ft.current)?.focus();
|
|
118
|
+
u(() => () => {
|
|
119
|
+
clearTimeout(ht.current.timer);
|
|
120
|
+
}, []), u(() => {
|
|
121
|
+
v && (T(!1), D(""));
|
|
122
|
+
}, [v]);
|
|
123
|
+
let Z = l((e) => {
|
|
124
|
+
ct || ut(e), Ze?.(e);
|
|
125
|
+
}, [ct, Ze]), Q = l(() => {
|
|
126
|
+
T(!1), D(""), O(-1);
|
|
127
|
+
}, []), $ = (e = "selected") => {
|
|
128
|
+
v || (T(!0), O(de(K, C, e)));
|
|
129
|
+
}, Mt = (e) => {
|
|
130
|
+
g ? (D(""), O(e === null ? -1 : de(le(m), [e], "selected")), A.current?.focus()) : Q();
|
|
131
|
+
}, Nt = (e) => {
|
|
132
|
+
if (V.current) return;
|
|
133
|
+
let t = (t) => {
|
|
134
|
+
t && (_t((e) => o(e, [t])), Z(ve(X.current.current, t.value, g))), X.current.query.trim() === e && Mt(t ? t.value : null);
|
|
135
|
+
};
|
|
136
|
+
H(!1);
|
|
137
|
+
let n = Pe?.(e);
|
|
138
|
+
if (!(n instanceof Promise)) {
|
|
139
|
+
t(n);
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
V.current = !0, wt(!0);
|
|
143
|
+
let r = () => {
|
|
144
|
+
V.current = !1, wt(!1);
|
|
145
|
+
};
|
|
146
|
+
n.then((e) => {
|
|
147
|
+
r(), t(e);
|
|
148
|
+
}, (e) => {
|
|
149
|
+
r(), H(!0), console.error(e);
|
|
150
|
+
});
|
|
151
|
+
}, Pt = (e) => {
|
|
152
|
+
if (e.disabled) return;
|
|
153
|
+
if (he(e)) {
|
|
154
|
+
Nt(N);
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
let t = pe(S, e.value, g);
|
|
158
|
+
!g && t === S ? Q() : (Z(t), Mt(e.value));
|
|
159
|
+
}, Ft = (e) => {
|
|
160
|
+
Z(C.filter((t) => t !== e));
|
|
161
|
+
}, It = () => {
|
|
162
|
+
Z(g ? [] : null), D(""), jt();
|
|
163
|
+
}, { placement: Lt, style: Rt, update: zt } = ye({
|
|
164
|
+
open: P,
|
|
165
|
+
anchor: k,
|
|
166
|
+
floatingRef: j,
|
|
167
|
+
...ae,
|
|
168
|
+
offset: Ee
|
|
169
|
+
});
|
|
170
|
+
xe(() => {
|
|
171
|
+
P && zt();
|
|
172
|
+
}, [
|
|
173
|
+
P,
|
|
174
|
+
K.length,
|
|
175
|
+
kt,
|
|
176
|
+
zt
|
|
177
|
+
]), u(() => {
|
|
178
|
+
if (!P) return;
|
|
179
|
+
let e = (e) => {
|
|
180
|
+
let t = e.target;
|
|
181
|
+
t && (k.current?.contains(t) || j.current?.contains(t)) || Q();
|
|
182
|
+
};
|
|
183
|
+
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
184
|
+
}, [P, Q]), u(() => {
|
|
185
|
+
if (!P || J < 0) return;
|
|
186
|
+
let e = j.current?.querySelector(`[data-kapisel-index="${J}"]`);
|
|
187
|
+
e && typeof e.scrollIntoView == "function" && e.scrollIntoView({ block: "nearest" });
|
|
188
|
+
}, [P, J]);
|
|
189
|
+
let Bt = (e) => {
|
|
190
|
+
if (v) return;
|
|
191
|
+
let t = e.target;
|
|
192
|
+
j.current?.contains(t) || (t.closest("[data-kapisel-action]") ? e.preventDefault() : t === A.current ? w || $() : (e.preventDefault(), jt(), w ? Q() : $()));
|
|
193
|
+
}, Vt = (e) => {
|
|
194
|
+
D(e), T(!0), H(!1), O(M ? -1 : i(-1, "first", ge(se(m, e), e, G, ke(b.create, e))));
|
|
195
|
+
}, Ht = (e) => {
|
|
196
|
+
let t = ht.current;
|
|
197
|
+
clearTimeout(t.timer), t.buffer += e, t.timer = setTimeout(() => {
|
|
198
|
+
t.buffer = "";
|
|
199
|
+
}, De);
|
|
200
|
+
let n = ce(K, t.buffer, w ? J : K.findIndex((e) => C.includes(e.value)));
|
|
201
|
+
n < 0 || (w || T(!0), O(n));
|
|
202
|
+
}, Ut = (e) => {
|
|
203
|
+
if (!v) switch (e.key) {
|
|
204
|
+
case "ArrowDown":
|
|
205
|
+
case "ArrowUp":
|
|
206
|
+
if (e.preventDefault(), !w) {
|
|
207
|
+
$(e.key === "ArrowDown" ? "selected" : "last");
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
O(i(J, e.key === "ArrowDown" ? "next" : "prev", K));
|
|
211
|
+
break;
|
|
212
|
+
case "Home":
|
|
213
|
+
case "End":
|
|
214
|
+
if (!w) break;
|
|
215
|
+
e.preventDefault(), O(i(J, e.key === "Home" ? "first" : "last", K));
|
|
216
|
+
break;
|
|
217
|
+
case "Enter":
|
|
218
|
+
if (w) {
|
|
219
|
+
e.preventDefault();
|
|
220
|
+
let t = J >= 0 ? K[J] : void 0;
|
|
221
|
+
t && Pt(t);
|
|
222
|
+
} else _ || (e.preventDefault(), $());
|
|
223
|
+
break;
|
|
224
|
+
case " ":
|
|
225
|
+
if (_) break;
|
|
226
|
+
if (e.preventDefault(), !w) $();
|
|
227
|
+
else {
|
|
228
|
+
let e = J >= 0 ? K[J] : void 0;
|
|
229
|
+
e && Pt(e);
|
|
230
|
+
}
|
|
231
|
+
break;
|
|
232
|
+
case "Escape":
|
|
233
|
+
w && (e.preventDefault(), e.stopPropagation(), Q());
|
|
234
|
+
break;
|
|
235
|
+
case "Tab":
|
|
236
|
+
w && Q();
|
|
237
|
+
break;
|
|
238
|
+
case "Backspace":
|
|
239
|
+
g && E === "" && C.length > 0 && (e.preventDefault(), Ft(C[C.length - 1]));
|
|
240
|
+
break;
|
|
241
|
+
default: !_ && e.key.length === 1 && !e.ctrlKey && !e.metaKey && !e.altKey && (e.preventDefault(), Ht(e.key));
|
|
242
|
+
}
|
|
243
|
+
}, Wt = (e) => {
|
|
244
|
+
n(e.relatedTarget, k.current, j.current) && (w && Q(), Xe?.(e));
|
|
245
|
+
}, Gt = P ? ie(k.current) : null, Kt = ({ option: e, index: t }) => {
|
|
246
|
+
let n = C.includes(e.value), r = t === J;
|
|
247
|
+
return /* @__PURE__ */ c("li", {
|
|
248
|
+
id: st(t),
|
|
249
|
+
role: "option",
|
|
250
|
+
"aria-selected": n,
|
|
251
|
+
"aria-disabled": e.disabled || void 0,
|
|
252
|
+
"data-kapisel-index": t,
|
|
253
|
+
className: [
|
|
254
|
+
"kapisel__opt",
|
|
255
|
+
r && "kapisel__opt--active",
|
|
256
|
+
n && "kapisel__opt--selected",
|
|
257
|
+
e === q && "kapisel__opt--create",
|
|
258
|
+
e.disabled && "kapisel__opt--disabled"
|
|
259
|
+
].filter(Boolean).join(" "),
|
|
260
|
+
onMouseMove: () => {
|
|
261
|
+
!e.disabled && !r && O(t);
|
|
262
|
+
},
|
|
263
|
+
onClick: () => Pt(e),
|
|
264
|
+
children: [/* @__PURE__ */ s("span", {
|
|
265
|
+
className: "kapisel__opt-body",
|
|
266
|
+
children: Ve && e !== q ? Ve(e) : e.label
|
|
267
|
+
}), n && /* @__PURE__ */ s(Se, {
|
|
268
|
+
className: "kapisel__check",
|
|
269
|
+
size: 15,
|
|
270
|
+
strokeWidth: 2.4,
|
|
271
|
+
"aria-hidden": "true"
|
|
272
|
+
})]
|
|
273
|
+
}, `${e.value}-${t}`);
|
|
274
|
+
}, qt = {
|
|
275
|
+
role: "combobox",
|
|
276
|
+
...t(rt, {
|
|
277
|
+
id: x,
|
|
278
|
+
describedBy: ot,
|
|
279
|
+
labelable: _,
|
|
280
|
+
ariaLabel: Je
|
|
281
|
+
}),
|
|
282
|
+
"aria-haspopup": "listbox",
|
|
283
|
+
"aria-expanded": P,
|
|
284
|
+
"aria-controls": P ? at : void 0,
|
|
285
|
+
"aria-activedescendant": P && J >= 0 ? st(J) : void 0,
|
|
286
|
+
"aria-label": Je,
|
|
287
|
+
"aria-disabled": v || void 0,
|
|
288
|
+
"aria-busy": Et || void 0
|
|
289
|
+
}, Jt = !Y && !Ot && /* @__PURE__ */ s("span", {
|
|
290
|
+
className: "kapisel__placeholder",
|
|
291
|
+
"aria-hidden": "true",
|
|
292
|
+
children: Qe
|
|
293
|
+
});
|
|
294
|
+
return /* @__PURE__ */ c("div", {
|
|
295
|
+
ref: k,
|
|
296
|
+
className: Ae({
|
|
297
|
+
size: nt,
|
|
298
|
+
open: P,
|
|
299
|
+
disabled: v,
|
|
300
|
+
multi: g,
|
|
301
|
+
className: Ke
|
|
302
|
+
}),
|
|
303
|
+
style: qe,
|
|
304
|
+
onMouseDown: Bt,
|
|
305
|
+
children: [
|
|
306
|
+
/* @__PURE__ */ c("div", {
|
|
307
|
+
className: "kapisel__values",
|
|
308
|
+
children: [g && U.map((e) => /* @__PURE__ */ c("span", {
|
|
309
|
+
className: "kapisel__chip",
|
|
310
|
+
children: [/* @__PURE__ */ s("span", {
|
|
311
|
+
className: "kapisel__chip-label",
|
|
312
|
+
children: e.label
|
|
313
|
+
}), /* @__PURE__ */ s("button", {
|
|
314
|
+
type: "button",
|
|
315
|
+
tabIndex: -1,
|
|
316
|
+
"data-kapisel-action": !0,
|
|
317
|
+
className: "kapisel__chip-x",
|
|
318
|
+
"aria-label": `${b.remove} ${e.label}`,
|
|
319
|
+
disabled: v,
|
|
320
|
+
onClick: () => Ft(e.value),
|
|
321
|
+
children: /* @__PURE__ */ s(we, {
|
|
322
|
+
size: 12,
|
|
323
|
+
strokeWidth: 2.6,
|
|
324
|
+
"aria-hidden": "true"
|
|
325
|
+
})
|
|
326
|
+
})]
|
|
327
|
+
}, e.value)), _ ? /* @__PURE__ */ c("div", {
|
|
328
|
+
className: "kapisel__inputwrap",
|
|
329
|
+
children: [
|
|
330
|
+
!g && Y && !Ot && /* @__PURE__ */ s("span", {
|
|
331
|
+
className: "kapisel__single",
|
|
332
|
+
"aria-hidden": "true",
|
|
333
|
+
children: U[0]?.label
|
|
334
|
+
}),
|
|
335
|
+
Jt,
|
|
336
|
+
/* @__PURE__ */ s("input", {
|
|
337
|
+
...qt,
|
|
338
|
+
ref: pt,
|
|
339
|
+
type: "text",
|
|
340
|
+
className: "kapisel__input",
|
|
341
|
+
autoComplete: "off",
|
|
342
|
+
"aria-autocomplete": "list",
|
|
343
|
+
disabled: v,
|
|
344
|
+
value: E,
|
|
345
|
+
onChange: (e) => Vt(e.target.value),
|
|
346
|
+
onKeyDown: Ut,
|
|
347
|
+
onBlur: Wt
|
|
348
|
+
})
|
|
349
|
+
]
|
|
350
|
+
}) : /* @__PURE__ */ c("div", {
|
|
351
|
+
...qt,
|
|
352
|
+
ref: mt,
|
|
353
|
+
className: "kapisel__combo",
|
|
354
|
+
tabIndex: v ? -1 : 0,
|
|
355
|
+
onKeyDown: Ut,
|
|
356
|
+
onBlur: Wt,
|
|
357
|
+
children: [!g && Y && /* @__PURE__ */ s("span", {
|
|
358
|
+
className: "kapisel__single",
|
|
359
|
+
"aria-hidden": "true",
|
|
360
|
+
children: U[0]?.label
|
|
361
|
+
}), Jt]
|
|
362
|
+
})]
|
|
363
|
+
}),
|
|
364
|
+
/* @__PURE__ */ s("span", {
|
|
365
|
+
id: ot,
|
|
366
|
+
className: "kapisel__sr",
|
|
367
|
+
children: oe(U, Qe)
|
|
368
|
+
}),
|
|
369
|
+
Et && /* @__PURE__ */ s("span", {
|
|
370
|
+
className: "kapisel__spinner kapi-spinner kapi-spinner--sm",
|
|
371
|
+
"aria-hidden": "true"
|
|
372
|
+
}),
|
|
373
|
+
Le && Y && !v && /* @__PURE__ */ s("button", {
|
|
374
|
+
type: "button",
|
|
375
|
+
tabIndex: -1,
|
|
376
|
+
"data-kapisel-action": !0,
|
|
377
|
+
className: "kapisel__clear",
|
|
378
|
+
"aria-label": b.clear,
|
|
379
|
+
onClick: It,
|
|
380
|
+
children: /* @__PURE__ */ s(we, {
|
|
381
|
+
size: 15,
|
|
382
|
+
strokeWidth: 2.4,
|
|
383
|
+
"aria-hidden": "true"
|
|
384
|
+
})
|
|
385
|
+
}),
|
|
386
|
+
/* @__PURE__ */ s("span", {
|
|
387
|
+
className: "kapisel__caret",
|
|
388
|
+
"aria-hidden": "true",
|
|
389
|
+
children: /* @__PURE__ */ s(Ce, {
|
|
390
|
+
size: 17,
|
|
391
|
+
strokeWidth: 2.2
|
|
392
|
+
})
|
|
393
|
+
}),
|
|
394
|
+
We && (g ? C.map((e) => /* @__PURE__ */ s("input", {
|
|
395
|
+
type: "hidden",
|
|
396
|
+
name: We,
|
|
397
|
+
value: e
|
|
398
|
+
}, e)) : /* @__PURE__ */ s("input", {
|
|
399
|
+
type: "hidden",
|
|
400
|
+
name: We,
|
|
401
|
+
value: S ?? ""
|
|
402
|
+
})),
|
|
403
|
+
Gt && Te(/* @__PURE__ */ c("div", {
|
|
404
|
+
ref: j,
|
|
405
|
+
className: `kapisel__menu kapisel__menu--${Lt?.side === "top" ? "top" : "bottom"}${tt ? " kapisel__menu--hug" : ""}`,
|
|
406
|
+
style: Rt,
|
|
407
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
408
|
+
children: [/* @__PURE__ */ c("ul", {
|
|
409
|
+
id: at,
|
|
410
|
+
role: "listbox",
|
|
411
|
+
"aria-multiselectable": g || void 0,
|
|
412
|
+
"aria-label": Je,
|
|
413
|
+
className: "kapisel__list",
|
|
414
|
+
hidden: K.length === 0 || B,
|
|
415
|
+
children: [!B && Dt.map((e) => e.kind === "option" ? Kt(e.item) : /* @__PURE__ */ c("li", {
|
|
416
|
+
role: "presentation",
|
|
417
|
+
className: "kapisel__group",
|
|
418
|
+
children: [/* @__PURE__ */ s("div", {
|
|
419
|
+
className: "kapisel__group-label",
|
|
420
|
+
"aria-hidden": "true",
|
|
421
|
+
children: e.label
|
|
422
|
+
}), /* @__PURE__ */ s("ul", {
|
|
423
|
+
role: "group",
|
|
424
|
+
"aria-label": e.label,
|
|
425
|
+
className: "kapisel__group-list",
|
|
426
|
+
children: e.items.map(Kt)
|
|
427
|
+
})]
|
|
428
|
+
}, e.key)), q && Kt({
|
|
429
|
+
option: q,
|
|
430
|
+
index: K.length - 1
|
|
431
|
+
})]
|
|
432
|
+
}), kt && /* @__PURE__ */ s("div", {
|
|
433
|
+
className: "kapisel__status",
|
|
434
|
+
role: "status",
|
|
435
|
+
"aria-live": "polite",
|
|
436
|
+
children: kt
|
|
437
|
+
})]
|
|
438
|
+
}), Gt)
|
|
439
|
+
]
|
|
440
|
+
});
|
|
441
|
+
};
|
|
442
|
+
//#endregion
|
|
443
|
+
export { je as DEFAULT_SELECT_LABELS, Me as KapiSelect, Ae as selectClasses };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type InputHTMLAttributes, type ReactNode, type Ref } from "react";
|
|
2
|
+
import "./inputsExtra.css";
|
|
3
|
+
export type KapiSliderTone = "primary" | "success" | "warning" | "danger";
|
|
4
|
+
export type KapiSliderProps = Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "size" | "value" | "defaultValue" | "onChange" | "min" | "max" | "step"> & {
|
|
5
|
+
/** Valor actual (controlado). */
|
|
6
|
+
value: number;
|
|
7
|
+
/** Se llama con el número nuevo al mover el control. */
|
|
8
|
+
onChange: (value: number) => void;
|
|
9
|
+
/** Mínimo del rango. */
|
|
10
|
+
min?: number;
|
|
11
|
+
/** Máximo del rango. */
|
|
12
|
+
max?: number;
|
|
13
|
+
/** Paso entre valores. */
|
|
14
|
+
step?: number;
|
|
15
|
+
/** Color of the filled track and the thumb. */
|
|
16
|
+
tone?: KapiSliderTone;
|
|
17
|
+
/** Label above the slider. */
|
|
18
|
+
label?: ReactNode;
|
|
19
|
+
/** Show the current value at the right of the label row. */
|
|
20
|
+
showValue?: boolean;
|
|
21
|
+
/** 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` (`status="err"`). */
|
|
24
|
+
invalid?: boolean;
|
|
25
|
+
/** Class of the wrapper. `className` goes to the `<input>`. */
|
|
26
|
+
wrapperClassName?: string;
|
|
27
|
+
/** Ref to the `<input type="range">`. */
|
|
28
|
+
ref?: Ref<HTMLInputElement>;
|
|
29
|
+
};
|
|
30
|
+
/** Wrapper classes. Pure and exported. */
|
|
31
|
+
export declare const sliderClasses: ({ tone, disabled, className }?: {
|
|
32
|
+
tone?: KapiSliderTone | undefined;
|
|
33
|
+
disabled?: boolean | undefined;
|
|
34
|
+
className?: string | undefined;
|
|
35
|
+
}) => string;
|
|
36
|
+
/**
|
|
37
|
+
* Range slider of the design system. Controlled; emits a number already snapped to `step`.
|
|
38
|
+
* The filled track is driven by the `--kapi-slider-pct` custom property.
|
|
39
|
+
* `name` goes to the native range, so a native `<form>` submits the number. Inside a `KapiField`
|
|
40
|
+
* (and without its own `label`) it takes the field id, help, `aria-invalid` and `aria-required`.
|
|
41
|
+
*/
|
|
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) => import("react").JSX.Element;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { nativeFieldProps as e } from "./fieldLogic.js";
|
|
3
|
+
import { useKapiField as t } from "./KapiField.js";
|
|
4
|
+
/* empty css */
|
|
5
|
+
import { clampToStep as n, percentOf as r } from "./sliderLogic.js";
|
|
6
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
7
|
+
import { useId as o } from "react";
|
|
8
|
+
//#region src/components/inputs/KapiSlider.tsx
|
|
9
|
+
var s = ({ tone: e = "primary", disabled: t = !1, className: n = "" } = {}) => [
|
|
10
|
+
"kapi-slider",
|
|
11
|
+
e !== "primary" && `kapi-slider--${e}`,
|
|
12
|
+
t && "kapi-slider--disabled",
|
|
13
|
+
n
|
|
14
|
+
].filter(Boolean).join(" "), c = ({ value: c, onChange: l, min: u = 0, max: d = 100, step: f = 1, tone: p, label: m, showValue: h, formatValue: g, wrapperClassName: _, className: v, style: y, disabled: b, id: x, ref: S, invalid: C, required: w, "aria-describedby": T, "aria-invalid": E, "aria-required": D, ...O }) => {
|
|
15
|
+
let k = o(), A = t(), j = e(m == null ? A : null, {
|
|
16
|
+
id: x,
|
|
17
|
+
describedBy: T,
|
|
18
|
+
invalid: C,
|
|
19
|
+
required: w,
|
|
20
|
+
ariaInvalid: E,
|
|
21
|
+
ariaRequired: D
|
|
22
|
+
}), M = j.id ?? k, N = n(c, {
|
|
23
|
+
min: u,
|
|
24
|
+
max: d,
|
|
25
|
+
step: f
|
|
26
|
+
}), P = { "--kapi-slider-pct": `${r(N, u, d)}%` }, F = m != null || h, I = g ? g(N) : void 0;
|
|
27
|
+
return /* @__PURE__ */ a("div", {
|
|
28
|
+
className: s({
|
|
29
|
+
tone: p,
|
|
30
|
+
disabled: b,
|
|
31
|
+
className: _
|
|
32
|
+
}),
|
|
33
|
+
children: [F && /* @__PURE__ */ a("div", {
|
|
34
|
+
className: "kapi-slider__head",
|
|
35
|
+
children: [m != null && /* @__PURE__ */ i("label", {
|
|
36
|
+
htmlFor: M,
|
|
37
|
+
children: m
|
|
38
|
+
}), h && /* @__PURE__ */ i("output", {
|
|
39
|
+
htmlFor: M,
|
|
40
|
+
className: "kapi-slider__value",
|
|
41
|
+
children: I ?? N
|
|
42
|
+
})]
|
|
43
|
+
}), /* @__PURE__ */ i("input", {
|
|
44
|
+
...O,
|
|
45
|
+
...j,
|
|
46
|
+
ref: S,
|
|
47
|
+
id: M,
|
|
48
|
+
required: w,
|
|
49
|
+
type: "range",
|
|
50
|
+
className: ["kapi-slider__input", v].filter(Boolean).join(" "),
|
|
51
|
+
min: u,
|
|
52
|
+
max: d,
|
|
53
|
+
step: f,
|
|
54
|
+
value: N,
|
|
55
|
+
"aria-valuetext": I,
|
|
56
|
+
disabled: b,
|
|
57
|
+
style: {
|
|
58
|
+
...y,
|
|
59
|
+
...P
|
|
60
|
+
},
|
|
61
|
+
onChange: (e) => l(n(Number(e.target.value), {
|
|
62
|
+
min: u,
|
|
63
|
+
max: d,
|
|
64
|
+
step: f
|
|
65
|
+
}))
|
|
66
|
+
})]
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
//#endregion
|
|
70
|
+
export { c as KapiSlider, s as sliderClasses };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { InputHTMLAttributes, Ref } from "react";
|
|
2
|
+
export type KapiSwitchProps = Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "size" | "children"> & {
|
|
3
|
+
/** Marca el control como inválido (`aria-invalid`). Sin la prop, lo toma del `KapiField` (`status="err"`). */
|
|
4
|
+
invalid?: boolean;
|
|
5
|
+
/** Ref al `<input>`. */
|
|
6
|
+
ref?: Ref<HTMLInputElement>;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Interruptor (`.kapi-switch`). Pasa `aria-label` (no tiene texto propio) o envuélvelo en un `KapiField`,
|
|
10
|
+
* que le da id (lo nombra su label), ayuda, `aria-invalid` y `aria-required`.
|
|
11
|
+
* Props nativas al `<input role="switch">`; `className` a la etiqueta contenedora.
|
|
12
|
+
*/
|
|
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;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { nativeFieldProps as e } from "./fieldLogic.js";
|
|
3
|
+
import { useKapiField as t } from "./KapiField.js";
|
|
4
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/inputs/KapiSwitch.tsx
|
|
6
|
+
var i = ({ className: i, ref: a, invalid: o, id: s, required: c, "aria-describedby": l, "aria-invalid": u, "aria-required": d, ...f }) => {
|
|
7
|
+
let p = e(t(), {
|
|
8
|
+
id: s,
|
|
9
|
+
describedBy: l,
|
|
10
|
+
invalid: o,
|
|
11
|
+
required: c,
|
|
12
|
+
ariaInvalid: u,
|
|
13
|
+
ariaRequired: d
|
|
14
|
+
});
|
|
15
|
+
return /* @__PURE__ */ r("label", {
|
|
16
|
+
className: ["kapi-switch", i].filter(Boolean).join(" "),
|
|
17
|
+
children: [/* @__PURE__ */ n("input", {
|
|
18
|
+
ref: a,
|
|
19
|
+
type: "checkbox",
|
|
20
|
+
role: "switch",
|
|
21
|
+
...f,
|
|
22
|
+
...p,
|
|
23
|
+
required: c
|
|
24
|
+
}), /* @__PURE__ */ n("span", { className: "kapi-switch__track" })]
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
//#endregion
|
|
28
|
+
export { i as KapiSwitch };
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { type FocusEvent, type HTMLAttributes, type Ref } from "react";
|
|
2
|
+
import "./KapiTagInput.css";
|
|
3
|
+
import type { KapiLabelsOverride } from "../labelsLogic";
|
|
4
|
+
export type KapiTagInputSize = "sm" | "md" | "lg";
|
|
5
|
+
export type KapiTagInputLabels = {
|
|
6
|
+
/** Prefijo del botón × de cada etiqueta ("Quitar ana@x.com"). */
|
|
7
|
+
remove: string;
|
|
8
|
+
/** Mensaje al repetir una etiqueta (va seguido de la etiqueta). */
|
|
9
|
+
duplicate: string;
|
|
10
|
+
/** Mensaje al llegar a `maxTags` (va seguido del tope). */
|
|
11
|
+
max: string;
|
|
12
|
+
};
|
|
13
|
+
export declare const DEFAULT_TAG_INPUT_LABELS: KapiTagInputLabels;
|
|
14
|
+
/** Lo que va al `<input>` de texto y no al contenedor. */
|
|
15
|
+
type InputOwnedKeys = "id" | "aria-label" | "aria-labelledby" | "aria-describedby";
|
|
16
|
+
/**
|
|
17
|
+
* Atributos nativos (`className`, `style`, `data-*`…) van al contenedor; `id` y los `aria-*` de nombre y
|
|
18
|
+
* descripción van al `<input>` de texto (el enfocable, el que nombra el `KapiField`).
|
|
19
|
+
*/
|
|
20
|
+
export type KapiTagInputProps = Omit<HTMLAttributes<HTMLDivElement>, "children" | "onChange" | "onBlur" | "defaultValue" | InputOwnedKeys> & {
|
|
21
|
+
/** Controlado: etiquetas actuales. */
|
|
22
|
+
value?: string[];
|
|
23
|
+
/** Etiquetas iniciales cuando no es controlado. */
|
|
24
|
+
defaultValue?: string[];
|
|
25
|
+
/** Nueva lista de etiquetas. */
|
|
26
|
+
onChange?: (values: string[]) => void;
|
|
27
|
+
/**
|
|
28
|
+
* Mensaje de error si el texto no sirve como etiqueta; `null` si sirve. Sólo un mensaje no vacío rechaza
|
|
29
|
+
* (`""` cuenta como válido). Una inválida no se agrega.
|
|
30
|
+
*/
|
|
31
|
+
validate?: (tag: string) => string | null;
|
|
32
|
+
/** Tope de etiquetas. */
|
|
33
|
+
maxTags?: number;
|
|
34
|
+
/** Deja repetir etiquetas. Default `false`. */
|
|
35
|
+
allowDuplicates?: boolean;
|
|
36
|
+
/** Al comparar duplicados, distingue mayúsculas. Default `false`. */
|
|
37
|
+
caseSensitive?: boolean;
|
|
38
|
+
/** Texto de ejemplo; se oculta cuando ya hay etiquetas. */
|
|
39
|
+
placeholder?: string;
|
|
40
|
+
/** Deshabilita el control entero (texto y etiquetas). */
|
|
41
|
+
disabled?: boolean;
|
|
42
|
+
/** Escala compartida con inputs y selects. Default `md`. */
|
|
43
|
+
size?: KapiTagInputSize;
|
|
44
|
+
/** Con `name`, cada etiqueta viaja en el form como un `<input type="hidden">` con ese nombre. */
|
|
45
|
+
name?: string;
|
|
46
|
+
/** `id` del `<input>` de texto. */
|
|
47
|
+
id?: string;
|
|
48
|
+
/** Marca el control inválido (`aria-invalid`). Sin la prop, lo toma del `KapiField`. */
|
|
49
|
+
invalid?: boolean;
|
|
50
|
+
/** Marca el control obligatorio (`aria-required`). Sin la prop, lo toma del `KapiField`. */
|
|
51
|
+
required?: boolean;
|
|
52
|
+
/** Nombre accesible del `<input>` de texto. */
|
|
53
|
+
"aria-label"?: string;
|
|
54
|
+
/** `id` del elemento que nombra al `<input>` de texto. */
|
|
55
|
+
"aria-labelledby"?: string;
|
|
56
|
+
/** `id` del elemento que describe al `<input>` de texto (se suma al del mensaje de error propio). */
|
|
57
|
+
"aria-describedby"?: string;
|
|
58
|
+
/** Se dispara cuando el foco sale de todo el control (ir del texto a un × no cuenta). */
|
|
59
|
+
onBlur?: (event: FocusEvent<HTMLElement>) => void;
|
|
60
|
+
/** Ref al `<input>` de texto. */
|
|
61
|
+
ref?: Ref<HTMLInputElement>;
|
|
62
|
+
/** Textos fijos (clave `tagInput`). */
|
|
63
|
+
labels?: KapiLabelsOverride<KapiTagInputLabels> | undefined;
|
|
64
|
+
};
|
|
65
|
+
/** Clases del contenedor. Pura y exportada para testear. */
|
|
66
|
+
export declare const tagInputClasses: ({ size, invalid, disabled, className }: {
|
|
67
|
+
size?: KapiTagInputSize | undefined;
|
|
68
|
+
invalid?: boolean | undefined;
|
|
69
|
+
disabled?: boolean | undefined;
|
|
70
|
+
className?: string | undefined;
|
|
71
|
+
}) => string;
|
|
72
|
+
/**
|
|
73
|
+
* Campo de varios valores de texto (correos, códigos): cada valor queda como una etiqueta. Se confirma con
|
|
74
|
+
* Enter, coma, pegando una lista (separada por comas o renglones) o al salir del control; Retroceso con el
|
|
75
|
+
* texto vacío quita la última. `validate`, `maxTags` y los duplicados rechazan con un mensaje y dejan el
|
|
76
|
+
* texto para corregirlo.
|
|
77
|
+
*/
|
|
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): import("react").JSX.Element;
|
|
79
|
+
export {};
|