@pathscale/ui 1.1.37 → 1.1.39
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/dist/components/accordion/Accordion.classes.d.ts +38 -0
- package/dist/components/accordion/Accordion.classes.js +39 -0
- package/dist/components/accordion/Accordion.css +158 -0
- package/dist/components/accordion/Accordion.d.ts +46 -22
- package/dist/components/accordion/Accordion.js +334 -154
- package/dist/components/accordion/index.d.ts +1 -1
- package/dist/components/accordion/index.js +7 -1
- package/dist/components/calendar/Calendar.classes.d.ts +62 -0
- package/dist/components/calendar/Calendar.classes.js +63 -0
- package/dist/components/calendar/Calendar.css +258 -0
- package/dist/components/calendar/Calendar.d.ts +24 -22
- package/dist/components/calendar/Calendar.js +304 -167
- package/dist/components/calendar/index.d.ts +1 -1
- package/dist/components/chatbubble/ChatBubble.classes.d.ts +24 -0
- package/dist/components/chatbubble/ChatBubble.classes.js +25 -0
- package/dist/components/chatbubble/ChatBubble.css +164 -0
- package/dist/components/chatbubble/ChatBubble.d.ts +1 -1
- package/dist/components/chatbubble/ChatBubble.js +3 -6
- package/dist/components/chatbubble/ChatBubbleAvatar.js +2 -1
- package/dist/components/chatbubble/ChatBubbleFooter.d.ts +1 -1
- package/dist/components/chatbubble/ChatBubbleFooter.js +11 -3
- package/dist/components/chatbubble/ChatBubbleHeader.d.ts +1 -1
- package/dist/components/chatbubble/ChatBubbleHeader.js +11 -3
- package/dist/components/chatbubble/ChatBubbleMessage.d.ts +1 -1
- package/dist/components/chatbubble/ChatBubbleMessage.js +13 -14
- package/dist/components/chatbubble/ChatBubbleTime.d.ts +1 -1
- package/dist/components/chatbubble/ChatBubbleTime.js +11 -3
- package/dist/components/color-field/ColorField.d.ts +1 -1
- package/dist/components/color-field/ColorField.js +3 -3
- package/dist/components/color-picker/ColorPicker.js +5 -5
- package/dist/components/color-wheel-flower/ColorWheelFlower.classes.d.ts +33 -0
- package/dist/components/color-wheel-flower/ColorWheelFlower.classes.js +34 -0
- package/dist/components/{colorpicker → color-wheel-flower}/ColorWheelFlower.js +52 -27
- package/dist/components/color-wheel-flower/index.d.ts +5 -0
- package/dist/components/color-wheel-flower/index.js +6 -0
- package/dist/components/date-picker/DatePicker.classes.d.ts +30 -0
- package/dist/components/date-picker/DatePicker.classes.js +31 -0
- package/dist/components/date-picker/DatePicker.css +143 -0
- package/dist/components/date-picker/DatePicker.d.ts +24 -0
- package/dist/components/date-picker/DatePicker.js +180 -0
- package/dist/components/date-picker/index.d.ts +1 -0
- package/dist/components/date-picker/index.js +3 -0
- package/dist/components/date-range-picker/DateRangePicker.classes.d.ts +33 -0
- package/dist/components/date-range-picker/DateRangePicker.classes.js +34 -0
- package/dist/components/date-range-picker/DateRangePicker.css +149 -0
- package/dist/components/date-range-picker/DateRangePicker.d.ts +28 -0
- package/dist/components/date-range-picker/DateRangePicker.js +230 -0
- package/dist/components/date-range-picker/index.d.ts +1 -0
- package/dist/components/date-range-picker/index.js +3 -0
- package/dist/components/flex/Flex.classes.d.ts +65 -0
- package/dist/components/flex/Flex.classes.js +66 -0
- package/dist/components/flex/Flex.css +5 -0
- package/dist/components/flex/Flex.d.ts +1 -0
- package/dist/components/flex/Flex.js +7 -66
- package/dist/components/floating-dock/FloatingDock.classes.d.ts +25 -0
- package/dist/components/floating-dock/FloatingDock.classes.js +26 -0
- package/dist/components/floating-dock/FloatingDock.css +14 -0
- package/dist/components/floating-dock/FloatingDock.js +76 -51
- package/dist/components/footer/Footer.classes.d.ts +9 -0
- package/dist/components/footer/Footer.classes.js +10 -0
- package/dist/components/footer/Footer.js +2 -6
- package/dist/components/footer/FooterTitle.js +2 -1
- package/dist/components/footer/footer.css +45 -45
- package/dist/components/glass-panel/GlassPanel.classes.d.ts +44 -0
- package/dist/components/glass-panel/GlassPanel.classes.js +45 -0
- package/dist/components/glass-panel/GlassPanel.css +170 -0
- package/dist/components/glass-panel/GlassPanel.d.ts +1 -0
- package/dist/components/glass-panel/GlassPanel.js +20 -58
- package/dist/components/glow-card/GlowCard.classes.d.ts +4 -0
- package/dist/components/glow-card/GlowCard.classes.js +5 -0
- package/dist/components/glow-card/GlowCard.css +4 -0
- package/dist/components/glow-card/GlowCard.js +2 -1
- package/dist/components/grid/Grid.classes.d.ts +54 -0
- package/dist/components/grid/Grid.classes.js +55 -0
- package/dist/components/grid/Grid.css +5 -0
- package/dist/components/grid/Grid.d.ts +1 -0
- package/dist/components/grid/Grid.js +3 -52
- package/dist/components/icon/Icon.classes.d.ts +3 -0
- package/dist/components/icon/Icon.classes.js +4 -0
- package/dist/components/icon/Icon.css +10 -0
- package/dist/components/icon/Icon.d.ts +1 -0
- package/dist/components/icon/Icon.js +8 -4
- package/dist/components/immersive-landing/ImmersiveLanding.classes.d.ts +83 -0
- package/dist/components/immersive-landing/ImmersiveLanding.classes.js +84 -0
- package/dist/components/immersive-landing/ImmersiveLanding.css +562 -0
- package/dist/components/immersive-landing/ImmersiveLanding.d.ts +1 -0
- package/dist/components/immersive-landing/ImmersiveLanding.js +23 -2
- package/dist/components/immersive-landing/ImmersiveLandingArrows.js +11 -11
- package/dist/components/immersive-landing/ImmersiveLandingNavigation.js +38 -27
- package/dist/components/immersive-landing/ImmersiveLandingPage.js +4 -2
- package/dist/components/immersive-landing/components/CookieConsent.js +91 -20
- package/dist/components/immersive-landing/components/FirefoxPWABanner.js +33 -8
- package/dist/components/immersive-landing/components/PWAInstallPrompt.js +37 -11
- package/dist/components/immersive-landing/index.d.ts +1 -0
- package/dist/components/immersive-landing/index.js +1 -0
- package/dist/components/kbd/Kbd.classes.d.ts +11 -0
- package/dist/components/kbd/Kbd.classes.js +12 -0
- package/dist/components/kbd/Kbd.css +60 -0
- package/dist/components/kbd/Kbd.d.ts +28 -4
- package/dist/components/kbd/Kbd.js +139 -10
- package/dist/components/kbd/index.d.ts +1 -1
- package/dist/components/kbd/index.js +6 -1
- package/dist/components/language-switcher/LanguageSwitcher.classes.d.ts +9 -0
- package/dist/components/language-switcher/LanguageSwitcher.classes.js +10 -0
- package/dist/components/language-switcher/LanguageSwitcher.css +56 -0
- package/dist/components/language-switcher/LanguageSwitcher.d.ts +1 -0
- package/dist/components/language-switcher/LanguageSwitcher.js +15 -7
- package/dist/components/link/Link.classes.d.ts +19 -0
- package/dist/components/link/Link.classes.js +20 -0
- package/dist/components/link/Link.css +131 -0
- package/dist/components/link/Link.d.ts +20 -11
- package/dist/components/link/Link.js +84 -43
- package/dist/components/link/index.d.ts +1 -1
- package/dist/components/link/index.js +3 -1
- package/dist/components/live-chat/LiveChat.classes.d.ts +41 -0
- package/dist/components/live-chat/LiveChat.classes.js +42 -0
- package/dist/components/live-chat/LiveChat.css +324 -0
- package/dist/components/live-chat/LiveChatBubble.d.ts +1 -0
- package/dist/components/live-chat/LiveChatBubble.js +15 -6
- package/dist/components/live-chat/LiveChatPanel.d.ts +1 -0
- package/dist/components/live-chat/LiveChatPanel.js +102 -123
- package/dist/components/modal/Modal.classes.d.ts +86 -0
- package/dist/components/modal/Modal.classes.js +87 -0
- package/dist/components/modal/Modal.css +320 -0
- package/dist/components/modal/Modal.d.ts +83 -27
- package/dist/components/modal/Modal.js +613 -97
- package/dist/components/modal/index.d.ts +1 -6
- package/dist/components/modal/index.js +11 -1
- package/dist/components/navbar/Navbar.classes.d.ts +23 -22
- package/dist/components/navbar/Navbar.classes.js +23 -25
- package/dist/components/navbar/Navbar.css +110 -0
- package/dist/components/navbar/Navbar.d.ts +1 -1
- package/dist/components/navbar/Navbar.js +2 -2
- package/dist/components/navbar/NavbarRow.js +1 -1
- package/dist/components/navbar/NavbarSection.js +1 -1
- package/dist/components/navbar/NavbarStack.js +4 -4
- package/dist/components/noise-background/NoiseBackground.classes.d.ts +15 -0
- package/dist/components/noise-background/NoiseBackground.classes.js +16 -0
- package/dist/components/noise-background/NoiseBackground.css +66 -0
- package/dist/components/noise-background/NoiseBackground.d.ts +1 -0
- package/dist/components/noise-background/NoiseBackground.js +29 -14
- package/dist/components/slider/Slider.classes.d.ts +13 -0
- package/dist/components/slider/Slider.classes.js +14 -0
- package/dist/components/{range-slider/range.css → slider/Slider.css} +3 -17
- package/dist/components/{range-slider/RangeSlider.d.ts → slider/Slider.d.ts} +5 -5
- package/dist/components/{range-slider/RangeSlider.js → slider/Slider.js} +28 -24
- package/dist/components/slider/index.d.ts +2 -0
- package/dist/components/slider/index.js +3 -0
- package/dist/components/table/index.d.ts +0 -2
- package/dist/components/table/index.js +1 -3
- package/dist/components/theme-color-picker/ThemeColorPicker.js +6 -6
- package/dist/components/toast/Toast.classes.d.ts +67 -0
- package/dist/components/toast/Toast.classes.js +68 -0
- package/dist/components/toast/Toast.css +344 -0
- package/dist/components/toast/Toast.d.ts +156 -20
- package/dist/components/toast/Toast.js +795 -31
- package/dist/components/toast/index.d.ts +1 -1
- package/dist/components/toast/index.js +17 -1
- package/dist/hooks/date/date.utils.d.ts +30 -0
- package/dist/hooks/date/date.utils.js +112 -0
- package/dist/hooks/date/index.d.ts +6 -0
- package/dist/hooks/date/index.js +6 -0
- package/dist/hooks/date/useCalendarNavigation.d.ts +21 -0
- package/dist/hooks/date/useCalendarNavigation.js +70 -0
- package/dist/hooks/date/useCalendarState.d.ts +45 -0
- package/dist/hooks/date/useCalendarState.js +66 -0
- package/dist/hooks/date/useDateSelection.d.ts +12 -0
- package/dist/hooks/date/useDateSelection.js +22 -0
- package/dist/hooks/date/usePickerOpenState.d.ts +15 -0
- package/dist/hooks/date/usePickerOpenState.js +50 -0
- package/dist/hooks/date/useRangeSelection.d.ts +26 -0
- package/dist/hooks/date/useRangeSelection.js +74 -0
- package/dist/hooks/form/useForm.d.ts +2 -2
- package/dist/hooks/form/useForm.js +11 -6
- package/dist/index.d.ts +56 -101
- package/dist/index.js +47 -109
- package/dist/purge-manifest.json +1708 -208
- package/dist/styles/icons/generated-icons.css +1 -1
- package/package.json +11 -5
- package/dist/components/accordion/collapse.css +0 -248
- package/dist/components/background/Background.d.ts +0 -5
- package/dist/components/background/Background.js +0 -22
- package/dist/components/background/index.d.ts +0 -1
- package/dist/components/background/index.js +0 -3
- package/dist/components/bottom-sheet/BottomSheet.d.ts +0 -11
- package/dist/components/bottom-sheet/BottomSheet.js +0 -109
- package/dist/components/bottom-sheet/index.d.ts +0 -2
- package/dist/components/bottom-sheet/index.js +0 -3
- package/dist/components/browsermockup/BrowserMockup.d.ts +0 -10
- package/dist/components/browsermockup/BrowserMockup.js +0 -55
- package/dist/components/browsermockup/index.d.ts +0 -2
- package/dist/components/browsermockup/index.js +0 -3
- package/dist/components/calendar/input.css +0 -277
- package/dist/components/carousel/Carousel.d.ts +0 -16
- package/dist/components/carousel/Carousel.js +0 -70
- package/dist/components/carousel/CarouselItem.d.ts +0 -6
- package/dist/components/carousel/CarouselItem.js +0 -27
- package/dist/components/carousel/carousel.css +0 -39
- package/dist/components/carousel/index.d.ts +0 -3
- package/dist/components/carousel/index.js +0 -3
- package/dist/components/chatbubble/chat.css +0 -153
- package/dist/components/codemockup/CodeMockup.d.ts +0 -5
- package/dist/components/codemockup/CodeMockup.js +0 -33
- package/dist/components/codemockup/CodeMockupLine.d.ts +0 -12
- package/dist/components/codemockup/CodeMockupLine.js +0 -53
- package/dist/components/codemockup/index.d.ts +0 -2
- package/dist/components/codemockup/index.js +0 -5
- package/dist/components/collapse/Collapse.d.ts +0 -21
- package/dist/components/collapse/Collapse.js +0 -104
- package/dist/components/collapse/CollapseContent.d.ts +0 -4
- package/dist/components/collapse/CollapseContent.js +0 -15
- package/dist/components/collapse/CollapseDetails.d.ts +0 -17
- package/dist/components/collapse/CollapseDetails.js +0 -33
- package/dist/components/collapse/CollapseTitle.d.ts +0 -9
- package/dist/components/collapse/CollapseTitle.js +0 -47
- package/dist/components/collapse/collapse.css +0 -248
- package/dist/components/collapse/index.d.ts +0 -4
- package/dist/components/collapse/index.js +0 -10
- package/dist/components/colorpicker/AlphaSlider.d.ts +0 -7
- package/dist/components/colorpicker/AlphaSlider.js +0 -107
- package/dist/components/colorpicker/ColorInput.d.ts +0 -7
- package/dist/components/colorpicker/ColorInput.js +0 -88
- package/dist/components/colorpicker/ColorPicker.d.ts +0 -18
- package/dist/components/colorpicker/ColorPicker.js +0 -264
- package/dist/components/colorpicker/ColorPickerFlowerSelector.d.ts +0 -3
- package/dist/components/colorpicker/ColorPickerFlowerSelector.js +0 -9
- package/dist/components/colorpicker/ColorPickerGradientSelector.d.ts +0 -3
- package/dist/components/colorpicker/ColorPickerGradientSelector.js +0 -9
- package/dist/components/colorpicker/ColorPickerWheelSelector.d.ts +0 -3
- package/dist/components/colorpicker/ColorPickerWheelSelector.js +0 -9
- package/dist/components/colorpicker/ColorPreview.d.ts +0 -11
- package/dist/components/colorpicker/ColorPreview.js +0 -47
- package/dist/components/colorpicker/ColorSwatches.d.ts +0 -8
- package/dist/components/colorpicker/ColorSwatches.js +0 -67
- package/dist/components/colorpicker/ColorWheel.d.ts +0 -7
- package/dist/components/colorpicker/ColorWheel.js +0 -106
- package/dist/components/colorpicker/HueSlider.d.ts +0 -7
- package/dist/components/colorpicker/HueSlider.js +0 -105
- package/dist/components/colorpicker/LightnessSlider.d.ts +0 -7
- package/dist/components/colorpicker/LightnessSlider.js +0 -111
- package/dist/components/colorpicker/SaturationBrightness.d.ts +0 -7
- package/dist/components/colorpicker/SaturationBrightness.js +0 -120
- package/dist/components/colorpicker/index.d.ts +0 -26
- package/dist/components/colorpicker/index.js +0 -31
- package/dist/components/confirm-dialog/ConfirmDialog.d.ts +0 -15
- package/dist/components/confirm-dialog/ConfirmDialog.js +0 -102
- package/dist/components/confirm-dialog/index.d.ts +0 -2
- package/dist/components/confirm-dialog/index.js +0 -3
- package/dist/components/connectionstatus/ConnectionStatus.d.ts +0 -59
- package/dist/components/connectionstatus/ConnectionStatus.js +0 -197
- package/dist/components/connectionstatus/index.d.ts +0 -2
- package/dist/components/connectionstatus/index.js +0 -3
- package/dist/components/copy-button/CopyButton.d.ts +0 -11
- package/dist/components/copy-button/CopyButton.js +0 -70
- package/dist/components/copy-button/index.d.ts +0 -2
- package/dist/components/copy-button/index.js +0 -3
- package/dist/components/countdown/Countdown.d.ts +0 -8
- package/dist/components/countdown/Countdown.js +0 -37
- package/dist/components/countdown/countdown.css +0 -58
- package/dist/components/countdown/index.d.ts +0 -1
- package/dist/components/countdown/index.js +0 -3
- package/dist/components/diff/Diff.d.ts +0 -8
- package/dist/components/diff/Diff.js +0 -29
- package/dist/components/diff/diff.css +0 -162
- package/dist/components/diff/index.d.ts +0 -1
- package/dist/components/diff/index.js +0 -3
- package/dist/components/divider/Divider.d.ts +0 -21
- package/dist/components/divider/Divider.js +0 -41
- package/dist/components/divider/Divider.styles.d.ts +0 -25
- package/dist/components/divider/Divider.styles.js +0 -71
- package/dist/components/divider/index.d.ts +0 -3
- package/dist/components/divider/index.js +0 -3
- package/dist/components/dock/Dock.d.ts +0 -15
- package/dist/components/dock/Dock.js +0 -40
- package/dist/components/dock/DockItem.d.ts +0 -9
- package/dist/components/dock/DockItem.js +0 -45
- package/dist/components/dock/DockLabel.d.ts +0 -6
- package/dist/components/dock/DockLabel.js +0 -22
- package/dist/components/dock/dock.css +0 -147
- package/dist/components/dock/index.d.ts +0 -3
- package/dist/components/dock/index.js +0 -3
- package/dist/components/dropdown-select/DropdownSelect.d.ts +0 -22
- package/dist/components/dropdown-select/DropdownSelect.js +0 -296
- package/dist/components/dropdown-select/index.d.ts +0 -2
- package/dist/components/dropdown-select/index.js +0 -3
- package/dist/components/fileinput/FileInput.d.ts +0 -15
- package/dist/components/fileinput/FileInput.js +0 -51
- package/dist/components/fileinput/index.d.ts +0 -1
- package/dist/components/fileinput/index.js +0 -3
- package/dist/components/fileinput/input.css +0 -277
- package/dist/components/form-actions/FormActions.d.ts +0 -14
- package/dist/components/form-actions/FormActions.js +0 -142
- package/dist/components/form-actions/index.d.ts +0 -2
- package/dist/components/form-actions/index.js +0 -3
- package/dist/components/hero/Hero.d.ts +0 -11
- package/dist/components/hero/Hero.js +0 -47
- package/dist/components/hero/HeroContent.d.ts +0 -6
- package/dist/components/hero/HeroContent.js +0 -31
- package/dist/components/hero/HeroOverlay.d.ts +0 -6
- package/dist/components/hero/HeroOverlay.js +0 -39
- package/dist/components/hero/hero.css +0 -38
- package/dist/components/hero/index.d.ts +0 -4
- package/dist/components/hero/index.js +0 -3
- package/dist/components/indicator/Indicator.d.ts +0 -31
- package/dist/components/indicator/Indicator.js +0 -76
- package/dist/components/indicator/index.d.ts +0 -2
- package/dist/components/indicator/index.js +0 -3
- package/dist/components/indicator/indicator.css +0 -70
- package/dist/components/kbd/kbd.css +0 -55
- package/dist/components/link/link.css +0 -153
- package/dist/components/mask/Mask.d.ts +0 -15
- package/dist/components/mask/Mask.js +0 -62
- package/dist/components/mask/index.d.ts +0 -3
- package/dist/components/mask/index.js +0 -3
- package/dist/components/mask/mask.css +0 -89
- package/dist/components/modal/ModalActions.d.ts +0 -3
- package/dist/components/modal/ModalActions.js +0 -14
- package/dist/components/modal/ModalBody.d.ts +0 -3
- package/dist/components/modal/ModalBody.js +0 -14
- package/dist/components/modal/ModalHeader.d.ts +0 -3
- package/dist/components/modal/ModalHeader.js +0 -15
- package/dist/components/modal/ModalLegacy.d.ts +0 -8
- package/dist/components/modal/ModalLegacy.js +0 -36
- package/dist/components/modal/modal.css +0 -170
- package/dist/components/navbar/navbar.css +0 -33
- package/dist/components/phonemockup/PhoneMockup.d.ts +0 -8
- package/dist/components/phonemockup/PhoneMockup.js +0 -44
- package/dist/components/phonemockup/index.d.ts +0 -1
- package/dist/components/phonemockup/index.js +0 -3
- package/dist/components/props-table/PropsTable.d.ts +0 -14
- package/dist/components/props-table/PropsTable.js +0 -56
- package/dist/components/props-table/index.d.ts +0 -2
- package/dist/components/props-table/index.js +0 -3
- package/dist/components/range/Range.d.ts +0 -13
- package/dist/components/range/Range.js +0 -85
- package/dist/components/range/index.d.ts +0 -1
- package/dist/components/range/index.js +0 -3
- package/dist/components/range/range.css +0 -174
- package/dist/components/range-slider/index.d.ts +0 -2
- package/dist/components/range-slider/index.js +0 -3
- package/dist/components/rating/Rating.d.ts +0 -24
- package/dist/components/rating/Rating.js +0 -54
- package/dist/components/rating/RatingHidden.d.ts +0 -4
- package/dist/components/rating/RatingHidden.js +0 -29
- package/dist/components/rating/RatingItem.d.ts +0 -9
- package/dist/components/rating/RatingItem.js +0 -62
- package/dist/components/rating/index.d.ts +0 -4
- package/dist/components/rating/index.js +0 -3
- package/dist/components/rating/rating.css +0 -106
- package/dist/components/showcase/ShowcaseBlock.d.ts +0 -10
- package/dist/components/showcase/ShowcaseBlock.js +0 -48
- package/dist/components/showcase/index.d.ts +0 -2
- package/dist/components/showcase/index.js +0 -3
- package/dist/components/showcase-section/ShowcaseSection.d.ts +0 -8
- package/dist/components/showcase-section/ShowcaseSection.js +0 -73
- package/dist/components/showcase-section/index.d.ts +0 -2
- package/dist/components/showcase-section/index.js +0 -3
- package/dist/components/skip-link/SkipLink.d.ts +0 -7
- package/dist/components/skip-link/SkipLink.js +0 -34
- package/dist/components/skip-link/index.d.ts +0 -2
- package/dist/components/skip-link/index.js +0 -3
- package/dist/components/stack/Stack.d.ts +0 -18
- package/dist/components/stack/Stack.js +0 -53
- package/dist/components/stack/index.d.ts +0 -2
- package/dist/components/stack/index.js +0 -3
- package/dist/components/stack/stack.css +0 -90
- package/dist/components/stat-card/StatCard.d.ts +0 -22
- package/dist/components/stat-card/StatCard.js +0 -46
- package/dist/components/stat-card/StatCardSection.d.ts +0 -5
- package/dist/components/stat-card/StatCardSection.js +0 -39
- package/dist/components/stat-card/index.d.ts +0 -1
- package/dist/components/stat-card/index.js +0 -3
- package/dist/components/stats/Stat.d.ts +0 -13
- package/dist/components/stats/Stat.js +0 -51
- package/dist/components/stats/StatSection.d.ts +0 -6
- package/dist/components/stats/StatSection.js +0 -29
- package/dist/components/stats/Stats.d.ts +0 -15
- package/dist/components/stats/Stats.js +0 -29
- package/dist/components/stats/index.d.ts +0 -1
- package/dist/components/stats/index.js +0 -3
- package/dist/components/stats/stat.css +0 -67
- package/dist/components/status/Status.d.ts +0 -8
- package/dist/components/status/Status.js +0 -30
- package/dist/components/status/index.d.ts +0 -2
- package/dist/components/status/index.js +0 -3
- package/dist/components/steps/Step.d.ts +0 -20
- package/dist/components/steps/Step.js +0 -88
- package/dist/components/steps/Steps.d.ts +0 -18
- package/dist/components/steps/Steps.js +0 -80
- package/dist/components/steps/index.d.ts +0 -3
- package/dist/components/steps/index.js +0 -3
- package/dist/components/steps/step.css +0 -179
- package/dist/components/streaming-table/StreamingTable.d.ts +0 -28
- package/dist/components/streaming-table/StreamingTable.js +0 -304
- package/dist/components/streaming-table/createRowStore.d.ts +0 -7
- package/dist/components/streaming-table/createRowStore.js +0 -18
- package/dist/components/streaming-table/createStreamingTableStore.d.ts +0 -13
- package/dist/components/streaming-table/createStreamingTableStore.js +0 -68
- package/dist/components/streaming-table/index.d.ts +0 -5
- package/dist/components/streaming-table/index.js +0 -5
- package/dist/components/streaming-table/types.d.ts +0 -46
- package/dist/components/streaming-table/types.js +0 -0
- package/dist/components/svgbackground/SvgBackground.d.ts +0 -21
- package/dist/components/svgbackground/SvgBackground.js +0 -413
- package/dist/components/svgbackground/index.d.ts +0 -2
- package/dist/components/svgbackground/index.js +0 -3
- package/dist/components/swap/Swap.d.ts +0 -13
- package/dist/components/swap/Swap.js +0 -57
- package/dist/components/swap/index.d.ts +0 -1
- package/dist/components/swap/index.js +0 -3
- package/dist/components/swap/swap.css +0 -92
- package/dist/components/switch-field/SwitchField.d.ts +0 -19
- package/dist/components/switch-field/SwitchField.js +0 -71
- package/dist/components/switch-field/index.d.ts +0 -2
- package/dist/components/switch-field/index.js +0 -3
- package/dist/components/table/EnhancedTable.d.ts +0 -46
- package/dist/components/table/EnhancedTable.js +0 -740
- package/dist/components/timeline/Timeline.d.ts +0 -12
- package/dist/components/timeline/Timeline.js +0 -42
- package/dist/components/timeline/TimelineEnd.d.ts +0 -6
- package/dist/components/timeline/TimelineEnd.js +0 -28
- package/dist/components/timeline/TimelineItem.d.ts +0 -8
- package/dist/components/timeline/TimelineItem.js +0 -47
- package/dist/components/timeline/TimelineMiddle.d.ts +0 -4
- package/dist/components/timeline/TimelineMiddle.js +0 -25
- package/dist/components/timeline/TimelineStart.d.ts +0 -6
- package/dist/components/timeline/TimelineStart.js +0 -28
- package/dist/components/timeline/index.d.ts +0 -5
- package/dist/components/timeline/index.js +0 -11
- package/dist/components/timeline/timeline.css +0 -286
- package/dist/components/toast/toast.css +0 -58
- package/dist/components/toastcontainer/ToastContainer.d.ts +0 -3
- package/dist/components/toastcontainer/ToastContainer.js +0 -15
- package/dist/components/toastcontainer/ToastStack.d.ts +0 -17
- package/dist/components/toastcontainer/ToastStack.js +0 -181
- package/dist/components/toastcontainer/index.d.ts +0 -3
- package/dist/components/toastcontainer/index.js +0 -5
- package/dist/components/windowmockup/WindowMockup.d.ts +0 -11
- package/dist/components/windowmockup/WindowMockup.js +0 -85
- package/dist/components/windowmockup/index.d.ts +0 -1
- package/dist/components/windowmockup/index.js +0 -3
- package/dist/stores/index.d.ts +0 -1
- package/dist/stores/index.js +0 -1
- package/dist/stores/toastStore.d.ts +0 -24
- package/dist/stores/toastStore.js +0 -64
- /package/dist/components/{colorpicker → color-wheel-flower}/ColorUtils.d.ts +0 -0
- /package/dist/components/{colorpicker → color-wheel-flower}/ColorUtils.js +0 -0
- /package/dist/components/{colorpicker → color-wheel-flower}/ColorWheelFlower.css +0 -0
- /package/dist/components/{colorpicker → color-wheel-flower}/ColorWheelFlower.d.ts +0 -0
- /package/dist/components/{colorpicker/colorpickerContext.d.ts → color-wheel-flower/colorWheelFlowerContext.d.ts} +0 -0
- /package/dist/components/{colorpicker/colorpickerContext.js → color-wheel-flower/colorWheelFlowerContext.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default, type
|
|
1
|
+
export { default, ToastRoot, ToastProvider, ToastContent, ToastIndicator, ToastTitle, ToastDescription, ToastActionButton, ToastCloseButton, ToastQueue, toast, toastQueue, DEFAULT_GAP, DEFAULT_MAX_VISIBLE_TOAST, DEFAULT_SCALE_FACTOR, DEFAULT_TOAST_TIMEOUT, DEFAULT_TOAST_WIDTH, type ToastPlacement, type ToastVariant, type ToastActionProps, type ToastContentValue, type ToastQueueAddOptions, type ToastQueueItem, type ToastQueueOptions, type ToastRenderFn, type ToastRootProps, type ToastProviderProps, type ToastContentProps, type ToastIndicatorProps, type ToastTitleProps, type ToastDescriptionProps, type ToastActionButtonProps, type ToastCloseButtonProps, type HeroUIToastOptions, type ToastPromiseOptions, type ToastFunction, } from "./Toast";
|
|
@@ -1,3 +1,19 @@
|
|
|
1
1
|
import * as __WEBPACK_EXTERNAL_MODULE__Toast_js_72ea0bce__ from "./Toast.js";
|
|
2
|
+
var __webpack_exports__DEFAULT_GAP = __WEBPACK_EXTERNAL_MODULE__Toast_js_72ea0bce__.DEFAULT_GAP;
|
|
3
|
+
var __webpack_exports__DEFAULT_MAX_VISIBLE_TOAST = __WEBPACK_EXTERNAL_MODULE__Toast_js_72ea0bce__.DEFAULT_MAX_VISIBLE_TOAST;
|
|
4
|
+
var __webpack_exports__DEFAULT_SCALE_FACTOR = __WEBPACK_EXTERNAL_MODULE__Toast_js_72ea0bce__.DEFAULT_SCALE_FACTOR;
|
|
5
|
+
var __webpack_exports__DEFAULT_TOAST_TIMEOUT = __WEBPACK_EXTERNAL_MODULE__Toast_js_72ea0bce__.DEFAULT_TOAST_TIMEOUT;
|
|
6
|
+
var __webpack_exports__DEFAULT_TOAST_WIDTH = __WEBPACK_EXTERNAL_MODULE__Toast_js_72ea0bce__.DEFAULT_TOAST_WIDTH;
|
|
7
|
+
var __webpack_exports__ToastActionButton = __WEBPACK_EXTERNAL_MODULE__Toast_js_72ea0bce__.ToastActionButton;
|
|
8
|
+
var __webpack_exports__ToastCloseButton = __WEBPACK_EXTERNAL_MODULE__Toast_js_72ea0bce__.ToastCloseButton;
|
|
9
|
+
var __webpack_exports__ToastContent = __WEBPACK_EXTERNAL_MODULE__Toast_js_72ea0bce__.ToastContent;
|
|
10
|
+
var __webpack_exports__ToastDescription = __WEBPACK_EXTERNAL_MODULE__Toast_js_72ea0bce__.ToastDescription;
|
|
11
|
+
var __webpack_exports__ToastIndicator = __WEBPACK_EXTERNAL_MODULE__Toast_js_72ea0bce__.ToastIndicator;
|
|
12
|
+
var __webpack_exports__ToastProvider = __WEBPACK_EXTERNAL_MODULE__Toast_js_72ea0bce__.ToastProvider;
|
|
13
|
+
var __webpack_exports__ToastQueue = __WEBPACK_EXTERNAL_MODULE__Toast_js_72ea0bce__.ToastQueue;
|
|
14
|
+
var __webpack_exports__ToastRoot = __WEBPACK_EXTERNAL_MODULE__Toast_js_72ea0bce__.ToastRoot;
|
|
15
|
+
var __webpack_exports__ToastTitle = __WEBPACK_EXTERNAL_MODULE__Toast_js_72ea0bce__.ToastTitle;
|
|
2
16
|
var __webpack_exports__default = __WEBPACK_EXTERNAL_MODULE__Toast_js_72ea0bce__["default"];
|
|
3
|
-
|
|
17
|
+
var __webpack_exports__toast = __WEBPACK_EXTERNAL_MODULE__Toast_js_72ea0bce__.toast;
|
|
18
|
+
var __webpack_exports__toastQueue = __WEBPACK_EXTERNAL_MODULE__Toast_js_72ea0bce__.toastQueue;
|
|
19
|
+
export { __webpack_exports__DEFAULT_GAP as DEFAULT_GAP, __webpack_exports__DEFAULT_MAX_VISIBLE_TOAST as DEFAULT_MAX_VISIBLE_TOAST, __webpack_exports__DEFAULT_SCALE_FACTOR as DEFAULT_SCALE_FACTOR, __webpack_exports__DEFAULT_TOAST_TIMEOUT as DEFAULT_TOAST_TIMEOUT, __webpack_exports__DEFAULT_TOAST_WIDTH as DEFAULT_TOAST_WIDTH, __webpack_exports__ToastActionButton as ToastActionButton, __webpack_exports__ToastCloseButton as ToastCloseButton, __webpack_exports__ToastContent as ToastContent, __webpack_exports__ToastDescription as ToastDescription, __webpack_exports__ToastIndicator as ToastIndicator, __webpack_exports__ToastProvider as ToastProvider, __webpack_exports__ToastQueue as ToastQueue, __webpack_exports__ToastRoot as ToastRoot, __webpack_exports__ToastTitle as ToastTitle, __webpack_exports__default as default, __webpack_exports__toast as toast, __webpack_exports__toastQueue as toastQueue };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare const DAYS_PER_WEEK = 7;
|
|
2
|
+
export declare const CALENDAR_GRID_DAYS = 42;
|
|
3
|
+
export type DateRangeValue = {
|
|
4
|
+
start: Date;
|
|
5
|
+
end: Date;
|
|
6
|
+
};
|
|
7
|
+
export declare const createCalendarDate: (year: number, monthIndex: number, day: number) => Date;
|
|
8
|
+
export declare const normalizeDate: (value: Date | null | undefined) => Date | null;
|
|
9
|
+
export declare const getToday: () => Date;
|
|
10
|
+
export declare const parseDate: (value: string | null | undefined) => Date | null;
|
|
11
|
+
export declare const formatDate: (value: Date | null | undefined, locale?: string, options?: Intl.DateTimeFormatOptions) => string;
|
|
12
|
+
export declare const toISODate: (value: Date | null | undefined) => string;
|
|
13
|
+
export declare const compareDates: (left: Date, right: Date) => number;
|
|
14
|
+
export declare const compareMonths: (left: Date, right: Date) => number;
|
|
15
|
+
export declare const isSameDay: (left: Date, right: Date) => boolean;
|
|
16
|
+
export declare const isSameMonth: (left: Date, right: Date) => boolean;
|
|
17
|
+
export declare const startOfMonth: (date: Date) => Date;
|
|
18
|
+
export declare const addDays: (date: Date, amount: number) => Date;
|
|
19
|
+
export declare const addMonths: (date: Date, amount: number) => Date;
|
|
20
|
+
export declare const shiftDateByMonths: (date: Date, amount: number) => Date;
|
|
21
|
+
export declare const buildCalendarGrid: (monthStart: Date, weekStartsOn?: number) => Date[];
|
|
22
|
+
export declare const splitWeeks: <T>(items: T[], daysPerWeek?: number) => T[][];
|
|
23
|
+
export declare const normalizeRange: (start: Date | null | undefined, end: Date | null | undefined) => {
|
|
24
|
+
start: Date | null;
|
|
25
|
+
end: Date | null;
|
|
26
|
+
};
|
|
27
|
+
export declare const createPreviewRange: (start: Date | null | undefined, end: Date | null | undefined, preview: Date | null | undefined) => {
|
|
28
|
+
start: Date | null;
|
|
29
|
+
end: Date | null;
|
|
30
|
+
};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
const DAYS_PER_WEEK = 7;
|
|
2
|
+
const CALENDAR_GRID_DAYS = 42;
|
|
3
|
+
const ISO_DATE_PATTERN = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
4
|
+
const createCalendarDate = (year, monthIndex, day)=>new Date(year, monthIndex, day, 12, 0, 0, 0);
|
|
5
|
+
const normalizeDate = (value)=>{
|
|
6
|
+
if (!(value instanceof Date)) return null;
|
|
7
|
+
if (Number.isNaN(value.getTime())) return null;
|
|
8
|
+
return createCalendarDate(value.getFullYear(), value.getMonth(), value.getDate());
|
|
9
|
+
};
|
|
10
|
+
const getToday = ()=>{
|
|
11
|
+
const now = new Date();
|
|
12
|
+
return createCalendarDate(now.getFullYear(), now.getMonth(), now.getDate());
|
|
13
|
+
};
|
|
14
|
+
const parseDate = (value)=>{
|
|
15
|
+
if (!value) return null;
|
|
16
|
+
const match = ISO_DATE_PATTERN.exec(value);
|
|
17
|
+
if (!match) return null;
|
|
18
|
+
const year = Number(match[1]);
|
|
19
|
+
const month = Number(match[2]);
|
|
20
|
+
const day = Number(match[3]);
|
|
21
|
+
if (!Number.isFinite(year) || !Number.isFinite(month) || !Number.isFinite(day)) return null;
|
|
22
|
+
const parsed = createCalendarDate(year, month - 1, day);
|
|
23
|
+
if (parsed.getFullYear() !== year || parsed.getMonth() !== month - 1 || parsed.getDate() !== day) return null;
|
|
24
|
+
return parsed;
|
|
25
|
+
};
|
|
26
|
+
const formatDate = (value, locale = "en-US", options = {
|
|
27
|
+
day: "numeric",
|
|
28
|
+
month: "short",
|
|
29
|
+
year: "numeric"
|
|
30
|
+
})=>{
|
|
31
|
+
const date = normalizeDate(value);
|
|
32
|
+
if (!date) return "";
|
|
33
|
+
return new Intl.DateTimeFormat(locale, options).format(date);
|
|
34
|
+
};
|
|
35
|
+
const pad = (value)=>String(value).padStart(2, "0");
|
|
36
|
+
const toISODate = (value)=>{
|
|
37
|
+
const date = normalizeDate(value);
|
|
38
|
+
if (!date) return "";
|
|
39
|
+
return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}`;
|
|
40
|
+
};
|
|
41
|
+
const toDateKey = (date)=>10000 * date.getFullYear() + (date.getMonth() + 1) * 100 + date.getDate();
|
|
42
|
+
const compareDates = (left, right)=>toDateKey(left) - toDateKey(right);
|
|
43
|
+
const compareMonths = (left, right)=>(left.getFullYear() - right.getFullYear()) * 12 + (left.getMonth() - right.getMonth());
|
|
44
|
+
const isSameDay = (left, right)=>0 === compareDates(left, right);
|
|
45
|
+
const isSameMonth = (left, right)=>left.getFullYear() === right.getFullYear() && left.getMonth() === right.getMonth();
|
|
46
|
+
const startOfMonth = (date)=>createCalendarDate(date.getFullYear(), date.getMonth(), 1);
|
|
47
|
+
const addDays = (date, amount)=>createCalendarDate(date.getFullYear(), date.getMonth(), date.getDate() + amount);
|
|
48
|
+
const addMonths = (date, amount)=>createCalendarDate(date.getFullYear(), date.getMonth() + amount, 1);
|
|
49
|
+
const shiftDateByMonths = (date, amount)=>{
|
|
50
|
+
const base = createCalendarDate(date.getFullYear(), date.getMonth() + amount, 1);
|
|
51
|
+
const maxDay = new Date(base.getFullYear(), base.getMonth() + 1, 0).getDate();
|
|
52
|
+
return createCalendarDate(base.getFullYear(), base.getMonth(), Math.min(date.getDate(), maxDay));
|
|
53
|
+
};
|
|
54
|
+
const buildCalendarGrid = (monthStart, weekStartsOn = 0)=>{
|
|
55
|
+
const monthFirstDay = startOfMonth(monthStart);
|
|
56
|
+
const offset = (monthFirstDay.getDay() - weekStartsOn + DAYS_PER_WEEK) % DAYS_PER_WEEK;
|
|
57
|
+
const gridStart = addDays(monthFirstDay, -offset);
|
|
58
|
+
return Array.from({
|
|
59
|
+
length: CALENDAR_GRID_DAYS
|
|
60
|
+
}, (_, index)=>addDays(gridStart, index));
|
|
61
|
+
};
|
|
62
|
+
const splitWeeks = (items, daysPerWeek = DAYS_PER_WEEK)=>{
|
|
63
|
+
const weeks = [];
|
|
64
|
+
for(let index = 0; index < items.length; index += daysPerWeek)weeks.push(items.slice(index, index + daysPerWeek));
|
|
65
|
+
return weeks;
|
|
66
|
+
};
|
|
67
|
+
const normalizeRange = (start, end)=>{
|
|
68
|
+
const normalizedStart = normalizeDate(start);
|
|
69
|
+
const normalizedEnd = normalizeDate(end);
|
|
70
|
+
if (!normalizedStart && !normalizedEnd) return {
|
|
71
|
+
start: null,
|
|
72
|
+
end: null
|
|
73
|
+
};
|
|
74
|
+
if (normalizedStart && !normalizedEnd) return {
|
|
75
|
+
start: normalizedStart,
|
|
76
|
+
end: null
|
|
77
|
+
};
|
|
78
|
+
if (!normalizedStart && normalizedEnd) return {
|
|
79
|
+
start: normalizedEnd,
|
|
80
|
+
end: null
|
|
81
|
+
};
|
|
82
|
+
if (!normalizedStart || !normalizedEnd) return {
|
|
83
|
+
start: null,
|
|
84
|
+
end: null
|
|
85
|
+
};
|
|
86
|
+
if (compareDates(normalizedStart, normalizedEnd) <= 0) return {
|
|
87
|
+
start: normalizedStart,
|
|
88
|
+
end: normalizedEnd
|
|
89
|
+
};
|
|
90
|
+
return {
|
|
91
|
+
start: normalizedEnd,
|
|
92
|
+
end: normalizedStart
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
const createPreviewRange = (start, end, preview)=>{
|
|
96
|
+
const normalizedStart = normalizeDate(start);
|
|
97
|
+
const normalizedEnd = normalizeDate(end);
|
|
98
|
+
const normalizedPreview = normalizeDate(preview);
|
|
99
|
+
if (!normalizedStart || normalizedEnd || !normalizedPreview) return {
|
|
100
|
+
start: null,
|
|
101
|
+
end: null
|
|
102
|
+
};
|
|
103
|
+
if (compareDates(normalizedPreview, normalizedStart) < 0) return {
|
|
104
|
+
start: normalizedPreview,
|
|
105
|
+
end: normalizedStart
|
|
106
|
+
};
|
|
107
|
+
return {
|
|
108
|
+
start: normalizedStart,
|
|
109
|
+
end: normalizedPreview
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
export { CALENDAR_GRID_DAYS, DAYS_PER_WEEK, addDays, addMonths, buildCalendarGrid, compareDates, compareMonths, createCalendarDate, createPreviewRange, formatDate, getToday, isSameDay, isSameMonth, normalizeDate, normalizeRange, parseDate, shiftDateByMonths, splitWeeks, startOfMonth, toISODate };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type Accessor } from "solid-js";
|
|
2
|
+
type CalendarNavigationOptions = {
|
|
3
|
+
initialFocusedDate: Accessor<Date>;
|
|
4
|
+
minDate: Accessor<Date | null>;
|
|
5
|
+
maxDate: Accessor<Date | null>;
|
|
6
|
+
isDateDisabled: (date: Date) => boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare const useCalendarNavigation: (options: CalendarNavigationOptions) => {
|
|
9
|
+
visibleMonth: Accessor<Date>;
|
|
10
|
+
focusedDate: Accessor<Date>;
|
|
11
|
+
setFocusedDate: import("solid-js").Setter<Date>;
|
|
12
|
+
clampVisibleMonth: (nextVisibleMonth: Date) => Date;
|
|
13
|
+
setVisibleMonthFromDate: (date: Date) => void;
|
|
14
|
+
findNearestEnabledDate: (startDate: Date, direction: 1 | -1) => Date;
|
|
15
|
+
moveFocusToDate: (date: Date, direction: 1 | -1) => Date;
|
|
16
|
+
navigateMonth: (direction: -1 | 1) => Date | null;
|
|
17
|
+
canNavigatePrevious: Accessor<boolean>;
|
|
18
|
+
canNavigateNext: Accessor<boolean>;
|
|
19
|
+
syncFocusedDate: (value: Date | null) => void;
|
|
20
|
+
};
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import * as __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__ from "solid-js";
|
|
2
|
+
import * as __WEBPACK_EXTERNAL_MODULE__date_utils_js_7a3c9532__ from "./date.utils.js";
|
|
3
|
+
const useCalendarNavigation = (options)=>{
|
|
4
|
+
const [visibleMonth, setVisibleMonth] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)((0, __WEBPACK_EXTERNAL_MODULE__date_utils_js_7a3c9532__.startOfMonth)(options.initialFocusedDate()));
|
|
5
|
+
const [focusedDate, setFocusedDate] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)(options.initialFocusedDate());
|
|
6
|
+
const clampVisibleMonth = (nextVisibleMonth)=>{
|
|
7
|
+
const min = options.minDate();
|
|
8
|
+
const max = options.maxDate();
|
|
9
|
+
if (min && (0, __WEBPACK_EXTERNAL_MODULE__date_utils_js_7a3c9532__.compareMonths)(nextVisibleMonth, (0, __WEBPACK_EXTERNAL_MODULE__date_utils_js_7a3c9532__.startOfMonth)(min)) < 0) return (0, __WEBPACK_EXTERNAL_MODULE__date_utils_js_7a3c9532__.startOfMonth)(min);
|
|
10
|
+
if (max && (0, __WEBPACK_EXTERNAL_MODULE__date_utils_js_7a3c9532__.compareMonths)(nextVisibleMonth, (0, __WEBPACK_EXTERNAL_MODULE__date_utils_js_7a3c9532__.startOfMonth)(max)) > 0) return (0, __WEBPACK_EXTERNAL_MODULE__date_utils_js_7a3c9532__.startOfMonth)(max);
|
|
11
|
+
return nextVisibleMonth;
|
|
12
|
+
};
|
|
13
|
+
const setVisibleMonthFromDate = (date)=>{
|
|
14
|
+
const nextMonth = (0, __WEBPACK_EXTERNAL_MODULE__date_utils_js_7a3c9532__.startOfMonth)(date);
|
|
15
|
+
if (!(0, __WEBPACK_EXTERNAL_MODULE__date_utils_js_7a3c9532__.isSameMonth)(nextMonth, visibleMonth())) setVisibleMonth(clampVisibleMonth(nextMonth));
|
|
16
|
+
};
|
|
17
|
+
const findNearestEnabledDate = (startDate, direction)=>{
|
|
18
|
+
let current = startDate;
|
|
19
|
+
for(let index = 0; index < 400; index += 1){
|
|
20
|
+
if (!options.isDateDisabled(current)) return current;
|
|
21
|
+
current = (0, __WEBPACK_EXTERNAL_MODULE__date_utils_js_7a3c9532__.addDays)(current, direction);
|
|
22
|
+
}
|
|
23
|
+
return startDate;
|
|
24
|
+
};
|
|
25
|
+
const moveFocusToDate = (date, direction)=>{
|
|
26
|
+
const nextFocus = options.isDateDisabled(date) ? findNearestEnabledDate(date, direction) : date;
|
|
27
|
+
setFocusedDate(nextFocus);
|
|
28
|
+
setVisibleMonthFromDate(nextFocus);
|
|
29
|
+
return nextFocus;
|
|
30
|
+
};
|
|
31
|
+
const navigateMonth = (direction)=>{
|
|
32
|
+
const nextMonth = clampVisibleMonth((0, __WEBPACK_EXTERNAL_MODULE__date_utils_js_7a3c9532__.addMonths)(visibleMonth(), direction));
|
|
33
|
+
if ((0, __WEBPACK_EXTERNAL_MODULE__date_utils_js_7a3c9532__.isSameMonth)(nextMonth, visibleMonth())) return null;
|
|
34
|
+
setVisibleMonth(nextMonth);
|
|
35
|
+
const nextFocus = findNearestEnabledDate((0, __WEBPACK_EXTERNAL_MODULE__date_utils_js_7a3c9532__.shiftDateByMonths)(focusedDate(), direction), direction);
|
|
36
|
+
setFocusedDate(nextFocus);
|
|
37
|
+
return nextFocus;
|
|
38
|
+
};
|
|
39
|
+
const canNavigatePrevious = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createMemo)(()=>{
|
|
40
|
+
const previousMonth = (0, __WEBPACK_EXTERNAL_MODULE__date_utils_js_7a3c9532__.addMonths)(visibleMonth(), -1);
|
|
41
|
+
const min = options.minDate();
|
|
42
|
+
if (!min) return true;
|
|
43
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__date_utils_js_7a3c9532__.compareMonths)(previousMonth, (0, __WEBPACK_EXTERNAL_MODULE__date_utils_js_7a3c9532__.startOfMonth)(min)) >= 0;
|
|
44
|
+
});
|
|
45
|
+
const canNavigateNext = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createMemo)(()=>{
|
|
46
|
+
const nextMonth = (0, __WEBPACK_EXTERNAL_MODULE__date_utils_js_7a3c9532__.addMonths)(visibleMonth(), 1);
|
|
47
|
+
const max = options.maxDate();
|
|
48
|
+
if (!max) return true;
|
|
49
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__date_utils_js_7a3c9532__.compareMonths)(nextMonth, (0, __WEBPACK_EXTERNAL_MODULE__date_utils_js_7a3c9532__.startOfMonth)(max)) <= 0;
|
|
50
|
+
});
|
|
51
|
+
const syncFocusedDate = (value)=>{
|
|
52
|
+
if (!value) return;
|
|
53
|
+
setFocusedDate(value);
|
|
54
|
+
setVisibleMonthFromDate(value);
|
|
55
|
+
};
|
|
56
|
+
return {
|
|
57
|
+
visibleMonth,
|
|
58
|
+
focusedDate,
|
|
59
|
+
setFocusedDate,
|
|
60
|
+
clampVisibleMonth,
|
|
61
|
+
setVisibleMonthFromDate,
|
|
62
|
+
findNearestEnabledDate,
|
|
63
|
+
moveFocusToDate,
|
|
64
|
+
navigateMonth,
|
|
65
|
+
canNavigatePrevious,
|
|
66
|
+
canNavigateNext,
|
|
67
|
+
syncFocusedDate
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
export { useCalendarNavigation };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { type Accessor } from "solid-js";
|
|
2
|
+
export type CalendarSelectionMode = "single" | "range";
|
|
3
|
+
type CalendarStateOptions = {
|
|
4
|
+
selectionMode: Accessor<CalendarSelectionMode>;
|
|
5
|
+
locale: Accessor<string>;
|
|
6
|
+
weekdayFormat: Accessor<"narrow" | "short" | "long">;
|
|
7
|
+
visibleMonth: Accessor<Date>;
|
|
8
|
+
focusedDate: Accessor<Date>;
|
|
9
|
+
selectedDate: Accessor<Date | null>;
|
|
10
|
+
rangeStart: Accessor<Date | null>;
|
|
11
|
+
rangeEnd: Accessor<Date | null>;
|
|
12
|
+
rangePreview: Accessor<Date | null>;
|
|
13
|
+
isDateDisabled: (date: Date) => boolean;
|
|
14
|
+
isDateUnavailable: (date: Date) => boolean;
|
|
15
|
+
};
|
|
16
|
+
export type CalendarCellState = {
|
|
17
|
+
isOutsideMonth: boolean;
|
|
18
|
+
isSelected: boolean;
|
|
19
|
+
isRangeStart: boolean;
|
|
20
|
+
isRangeEnd: boolean;
|
|
21
|
+
isInCommittedRange: boolean;
|
|
22
|
+
isInPreviewRange: boolean;
|
|
23
|
+
isInRange: boolean;
|
|
24
|
+
isToday: boolean;
|
|
25
|
+
isUnavailable: boolean;
|
|
26
|
+
isDisabled: boolean;
|
|
27
|
+
isFocused: boolean;
|
|
28
|
+
isAriaSelected: boolean;
|
|
29
|
+
};
|
|
30
|
+
export declare const useCalendarState: (options: CalendarStateOptions) => {
|
|
31
|
+
monthFormatter: Accessor<Intl.DateTimeFormat>;
|
|
32
|
+
dayLabelFormatter: Accessor<Intl.DateTimeFormat>;
|
|
33
|
+
weekdayLabels: Accessor<string[]>;
|
|
34
|
+
calendarWeeks: Accessor<Date[][]>;
|
|
35
|
+
normalizedRange: Accessor<{
|
|
36
|
+
start: Date | null;
|
|
37
|
+
end: Date | null;
|
|
38
|
+
}>;
|
|
39
|
+
previewRange: Accessor<{
|
|
40
|
+
start: Date | null;
|
|
41
|
+
end: Date | null;
|
|
42
|
+
}>;
|
|
43
|
+
getCellState: (date: Date) => CalendarCellState;
|
|
44
|
+
};
|
|
45
|
+
export {};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import * as __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__ from "solid-js";
|
|
2
|
+
import * as __WEBPACK_EXTERNAL_MODULE__date_utils_js_7a3c9532__ from "./date.utils.js";
|
|
3
|
+
const useCalendarState = (options)=>{
|
|
4
|
+
const monthFormatter = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createMemo)(()=>new Intl.DateTimeFormat(options.locale(), {
|
|
5
|
+
month: "long",
|
|
6
|
+
year: "numeric"
|
|
7
|
+
}));
|
|
8
|
+
const dayLabelFormatter = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createMemo)(()=>new Intl.DateTimeFormat(options.locale(), {
|
|
9
|
+
dateStyle: "full"
|
|
10
|
+
}));
|
|
11
|
+
const weekdayFormatter = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createMemo)(()=>new Intl.DateTimeFormat(options.locale(), {
|
|
12
|
+
weekday: options.weekdayFormat()
|
|
13
|
+
}));
|
|
14
|
+
const weekdayLabels = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createMemo)(()=>{
|
|
15
|
+
const firstSunday = new Date(2024, 0, 7, 12, 0, 0, 0);
|
|
16
|
+
return Array.from({
|
|
17
|
+
length: 7
|
|
18
|
+
}, (_, index)=>weekdayFormatter().format((0, __WEBPACK_EXTERNAL_MODULE__date_utils_js_7a3c9532__.addDays)(firstSunday, index)));
|
|
19
|
+
});
|
|
20
|
+
const calendarWeeks = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createMemo)(()=>(0, __WEBPACK_EXTERNAL_MODULE__date_utils_js_7a3c9532__.splitWeeks)((0, __WEBPACK_EXTERNAL_MODULE__date_utils_js_7a3c9532__.buildCalendarGrid)(options.visibleMonth(), 0)));
|
|
21
|
+
const normalizedRange = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createMemo)(()=>(0, __WEBPACK_EXTERNAL_MODULE__date_utils_js_7a3c9532__.normalizeRange)(options.rangeStart(), options.rangeEnd()));
|
|
22
|
+
const previewRange = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createMemo)(()=>(0, __WEBPACK_EXTERNAL_MODULE__date_utils_js_7a3c9532__.createPreviewRange)(normalizedRange().start, normalizedRange().end, options.rangePreview()));
|
|
23
|
+
const todayDate = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createMemo)(()=>(0, __WEBPACK_EXTERNAL_MODULE__date_utils_js_7a3c9532__.getToday)());
|
|
24
|
+
const getCellState = (date)=>{
|
|
25
|
+
const mode = options.selectionMode();
|
|
26
|
+
const selectedDate = options.selectedDate();
|
|
27
|
+
const normalized = normalizedRange();
|
|
28
|
+
const preview = previewRange();
|
|
29
|
+
const isOutsideMonth = !(0, __WEBPACK_EXTERNAL_MODULE__date_utils_js_7a3c9532__.isSameMonth)(date, options.visibleMonth());
|
|
30
|
+
const isSelected = "single" === mode && null !== selectedDate && (0, __WEBPACK_EXTERNAL_MODULE__date_utils_js_7a3c9532__.isSameDay)(date, selectedDate);
|
|
31
|
+
const isRangeStart = "range" === mode && null !== normalized.start && (0, __WEBPACK_EXTERNAL_MODULE__date_utils_js_7a3c9532__.isSameDay)(date, normalized.start);
|
|
32
|
+
const isRangeEnd = "range" === mode && null !== normalized.end && (0, __WEBPACK_EXTERNAL_MODULE__date_utils_js_7a3c9532__.isSameDay)(date, normalized.end);
|
|
33
|
+
const isInCommittedRange = "range" === mode && null !== normalized.start && null !== normalized.end && (0, __WEBPACK_EXTERNAL_MODULE__date_utils_js_7a3c9532__.compareDates)(date, normalized.start) >= 0 && (0, __WEBPACK_EXTERNAL_MODULE__date_utils_js_7a3c9532__.compareDates)(date, normalized.end) <= 0;
|
|
34
|
+
const isInPreviewRange = "range" === mode && null !== preview.start && null !== preview.end && (0, __WEBPACK_EXTERNAL_MODULE__date_utils_js_7a3c9532__.compareDates)(date, preview.start) >= 0 && (0, __WEBPACK_EXTERNAL_MODULE__date_utils_js_7a3c9532__.compareDates)(date, preview.end) <= 0;
|
|
35
|
+
const isInRange = isInCommittedRange || isInPreviewRange;
|
|
36
|
+
const isToday = (0, __WEBPACK_EXTERNAL_MODULE__date_utils_js_7a3c9532__.isSameDay)(date, todayDate());
|
|
37
|
+
const isUnavailable = options.isDateUnavailable(date);
|
|
38
|
+
const isDisabled = options.isDateDisabled(date);
|
|
39
|
+
const isFocused = (0, __WEBPACK_EXTERNAL_MODULE__date_utils_js_7a3c9532__.isSameDay)(date, options.focusedDate());
|
|
40
|
+
const isAriaSelected = "range" === mode ? isRangeStart || isRangeEnd || isInRange : isSelected;
|
|
41
|
+
return {
|
|
42
|
+
isOutsideMonth,
|
|
43
|
+
isSelected,
|
|
44
|
+
isRangeStart,
|
|
45
|
+
isRangeEnd,
|
|
46
|
+
isInCommittedRange,
|
|
47
|
+
isInPreviewRange,
|
|
48
|
+
isInRange,
|
|
49
|
+
isToday,
|
|
50
|
+
isUnavailable,
|
|
51
|
+
isDisabled,
|
|
52
|
+
isFocused,
|
|
53
|
+
isAriaSelected
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
return {
|
|
57
|
+
monthFormatter,
|
|
58
|
+
dayLabelFormatter,
|
|
59
|
+
weekdayLabels,
|
|
60
|
+
calendarWeeks,
|
|
61
|
+
normalizedRange,
|
|
62
|
+
previewRange,
|
|
63
|
+
getCellState
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
export { useCalendarState };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type Accessor } from "solid-js";
|
|
2
|
+
type DateSelectionOptions = {
|
|
3
|
+
value: Accessor<Date | undefined>;
|
|
4
|
+
defaultValue: Accessor<Date | undefined>;
|
|
5
|
+
onChange: Accessor<((value: Date) => void) | undefined>;
|
|
6
|
+
};
|
|
7
|
+
export declare const useDateSelection: (options: DateSelectionOptions) => {
|
|
8
|
+
isControlled: Accessor<boolean>;
|
|
9
|
+
selectedDate: Accessor<Date | null>;
|
|
10
|
+
setSelectedDate: (value: Date) => void;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__ from "solid-js";
|
|
2
|
+
import * as __WEBPACK_EXTERNAL_MODULE__date_utils_js_7a3c9532__ from "./date.utils.js";
|
|
3
|
+
const useDateSelection = (options)=>{
|
|
4
|
+
const [internalValue, setInternalValue] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)((0, __WEBPACK_EXTERNAL_MODULE__date_utils_js_7a3c9532__.normalizeDate)(options.defaultValue()));
|
|
5
|
+
const isControlled = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createMemo)(()=>void 0 !== options.value());
|
|
6
|
+
const selectedDate = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createMemo)(()=>{
|
|
7
|
+
if (isControlled()) return (0, __WEBPACK_EXTERNAL_MODULE__date_utils_js_7a3c9532__.normalizeDate)(options.value());
|
|
8
|
+
return internalValue();
|
|
9
|
+
});
|
|
10
|
+
const setSelectedDate = (value)=>{
|
|
11
|
+
const normalized = (0, __WEBPACK_EXTERNAL_MODULE__date_utils_js_7a3c9532__.normalizeDate)(value);
|
|
12
|
+
if (!normalized) return;
|
|
13
|
+
if (!isControlled()) setInternalValue(normalized);
|
|
14
|
+
options.onChange()?.(normalized);
|
|
15
|
+
};
|
|
16
|
+
return {
|
|
17
|
+
isControlled,
|
|
18
|
+
selectedDate,
|
|
19
|
+
setSelectedDate
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export { useDateSelection };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type Accessor } from "solid-js";
|
|
2
|
+
type PickerOpenStateOptions = {
|
|
3
|
+
isOpen: Accessor<boolean | undefined>;
|
|
4
|
+
defaultOpen: Accessor<boolean | undefined>;
|
|
5
|
+
onOpenChange: Accessor<((value: boolean) => void) | undefined>;
|
|
6
|
+
isDisabled: Accessor<boolean>;
|
|
7
|
+
};
|
|
8
|
+
export declare const usePickerOpenState: (options: PickerOpenStateOptions) => {
|
|
9
|
+
isOpen: Accessor<boolean>;
|
|
10
|
+
isControlled: Accessor<boolean>;
|
|
11
|
+
setOpen: (nextOpen: boolean) => void;
|
|
12
|
+
toggleOpen: () => void;
|
|
13
|
+
setRootRef: import("solid-js").Setter<HTMLElement | undefined>;
|
|
14
|
+
};
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__ from "solid-js";
|
|
2
|
+
const usePickerOpenState = (options)=>{
|
|
3
|
+
const [internalOpen, setInternalOpen] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)(Boolean(options.defaultOpen()));
|
|
4
|
+
const [rootRef, setRootRef] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)(void 0);
|
|
5
|
+
const isControlled = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createMemo)(()=>void 0 !== options.isOpen());
|
|
6
|
+
const isOpen = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createMemo)(()=>isControlled() ? Boolean(options.isOpen()) : internalOpen());
|
|
7
|
+
const setOpen = (nextOpen)=>{
|
|
8
|
+
if (nextOpen && options.isDisabled()) return;
|
|
9
|
+
const previous = isOpen();
|
|
10
|
+
if (!isControlled()) setInternalOpen(nextOpen);
|
|
11
|
+
if (previous !== nextOpen) options.onOpenChange()?.(nextOpen);
|
|
12
|
+
};
|
|
13
|
+
const toggleOpen = ()=>{
|
|
14
|
+
setOpen(!isOpen());
|
|
15
|
+
};
|
|
16
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.onMount)(()=>{
|
|
17
|
+
const handlePointerDown = (event)=>{
|
|
18
|
+
if (!isOpen()) return;
|
|
19
|
+
const root = rootRef();
|
|
20
|
+
if (!root) return;
|
|
21
|
+
if (root.contains(event.target)) return;
|
|
22
|
+
setOpen(false);
|
|
23
|
+
};
|
|
24
|
+
const handleGlobalKeyDown = (event)=>{
|
|
25
|
+
if (!isOpen()) return;
|
|
26
|
+
if ("Escape" !== event.key) return;
|
|
27
|
+
event.preventDefault();
|
|
28
|
+
setOpen(false);
|
|
29
|
+
};
|
|
30
|
+
document.addEventListener("pointerdown", handlePointerDown);
|
|
31
|
+
document.addEventListener("keydown", handleGlobalKeyDown);
|
|
32
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.onCleanup)(()=>{
|
|
33
|
+
document.removeEventListener("pointerdown", handlePointerDown);
|
|
34
|
+
document.removeEventListener("keydown", handleGlobalKeyDown);
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createEffect)(()=>{
|
|
38
|
+
if (!options.isDisabled()) return;
|
|
39
|
+
if (!isOpen()) return;
|
|
40
|
+
setOpen(false);
|
|
41
|
+
});
|
|
42
|
+
return {
|
|
43
|
+
isOpen,
|
|
44
|
+
isControlled,
|
|
45
|
+
setOpen,
|
|
46
|
+
toggleOpen,
|
|
47
|
+
setRootRef
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
export { usePickerOpenState };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type Accessor } from "solid-js";
|
|
2
|
+
import { type DateRangeValue } from "./date.utils";
|
|
3
|
+
export type ControlledDateRangeValue = DateRangeValue | null;
|
|
4
|
+
type RangeSelectionOptions = {
|
|
5
|
+
value: Accessor<ControlledDateRangeValue | undefined>;
|
|
6
|
+
defaultValue: Accessor<ControlledDateRangeValue | undefined>;
|
|
7
|
+
onChange: Accessor<((value: ControlledDateRangeValue) => void) | undefined>;
|
|
8
|
+
};
|
|
9
|
+
export declare const useRangeSelection: (options: RangeSelectionOptions) => {
|
|
10
|
+
isControlled: Accessor<boolean>;
|
|
11
|
+
isSelectingEnd: Accessor<boolean>;
|
|
12
|
+
committedRange: Accessor<ControlledDateRangeValue>;
|
|
13
|
+
hoveredDate: Accessor<Date | null>;
|
|
14
|
+
rangeStart: Accessor<Date | null>;
|
|
15
|
+
rangeEnd: Accessor<Date | null>;
|
|
16
|
+
previewRange: Accessor<{
|
|
17
|
+
start: Date | null;
|
|
18
|
+
end: Date | null;
|
|
19
|
+
}>;
|
|
20
|
+
focusDate: Accessor<Date | null>;
|
|
21
|
+
selectDate: (value: Date) => void;
|
|
22
|
+
setCommittedRange: (nextValue: ControlledDateRangeValue) => void;
|
|
23
|
+
setHoverDate: (value: Date | undefined) => void;
|
|
24
|
+
clearPendingSelection: () => void;
|
|
25
|
+
};
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import * as __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__ from "solid-js";
|
|
2
|
+
import * as __WEBPACK_EXTERNAL_MODULE__date_utils_js_7a3c9532__ from "./date.utils.js";
|
|
3
|
+
const normalizeCompleteRange = (value)=>{
|
|
4
|
+
if (!value) return null;
|
|
5
|
+
const normalized = (0, __WEBPACK_EXTERNAL_MODULE__date_utils_js_7a3c9532__.normalizeRange)(value.start, value.end);
|
|
6
|
+
if (!normalized.start || !normalized.end) return null;
|
|
7
|
+
return {
|
|
8
|
+
start: normalized.start,
|
|
9
|
+
end: normalized.end
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
const useRangeSelection = (options)=>{
|
|
13
|
+
const [internalCommittedRange, setInternalCommittedRange] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)(normalizeCompleteRange(options.defaultValue()));
|
|
14
|
+
const [pendingStartDate, setPendingStartDate] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)(null);
|
|
15
|
+
const [hoveredDate, setHoveredDate] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)(null);
|
|
16
|
+
const isControlled = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createMemo)(()=>void 0 !== options.value());
|
|
17
|
+
const committedRange = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createMemo)(()=>{
|
|
18
|
+
if (isControlled()) return normalizeCompleteRange(options.value());
|
|
19
|
+
return internalCommittedRange();
|
|
20
|
+
});
|
|
21
|
+
const isSelectingEnd = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createMemo)(()=>null !== pendingStartDate());
|
|
22
|
+
const rangeStart = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createMemo)(()=>pendingStartDate() ?? committedRange()?.start ?? null);
|
|
23
|
+
const rangeEnd = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createMemo)(()=>pendingStartDate() ? null : committedRange()?.end ?? null);
|
|
24
|
+
const previewRange = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createMemo)(()=>(0, __WEBPACK_EXTERNAL_MODULE__date_utils_js_7a3c9532__.createPreviewRange)(rangeStart(), rangeEnd(), hoveredDate()));
|
|
25
|
+
const focusDate = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createMemo)(()=>rangeEnd() ?? rangeStart() ?? null);
|
|
26
|
+
const setCommittedRange = (nextValue)=>{
|
|
27
|
+
const normalized = normalizeCompleteRange(nextValue);
|
|
28
|
+
if (!isControlled()) setInternalCommittedRange(normalized);
|
|
29
|
+
options.onChange()?.(normalized);
|
|
30
|
+
};
|
|
31
|
+
const clearPendingSelection = ()=>{
|
|
32
|
+
setPendingStartDate(null);
|
|
33
|
+
setHoveredDate(null);
|
|
34
|
+
};
|
|
35
|
+
const setHoverDate = (value)=>{
|
|
36
|
+
if (!isSelectingEnd()) return void setHoveredDate(null);
|
|
37
|
+
setHoveredDate((0, __WEBPACK_EXTERNAL_MODULE__date_utils_js_7a3c9532__.normalizeDate)(value));
|
|
38
|
+
};
|
|
39
|
+
const selectDate = (value)=>{
|
|
40
|
+
const normalized = (0, __WEBPACK_EXTERNAL_MODULE__date_utils_js_7a3c9532__.normalizeDate)(value);
|
|
41
|
+
if (!normalized) return;
|
|
42
|
+
const pendingStart = pendingStartDate();
|
|
43
|
+
if (!pendingStart) {
|
|
44
|
+
setPendingStartDate(normalized);
|
|
45
|
+
setHoveredDate(null);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
if ((0, __WEBPACK_EXTERNAL_MODULE__date_utils_js_7a3c9532__.compareDates)(normalized, pendingStart) < 0) {
|
|
49
|
+
setPendingStartDate(normalized);
|
|
50
|
+
setHoveredDate(null);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
setCommittedRange({
|
|
54
|
+
start: pendingStart,
|
|
55
|
+
end: normalized
|
|
56
|
+
});
|
|
57
|
+
clearPendingSelection();
|
|
58
|
+
};
|
|
59
|
+
return {
|
|
60
|
+
isControlled,
|
|
61
|
+
isSelectingEnd,
|
|
62
|
+
committedRange,
|
|
63
|
+
hoveredDate,
|
|
64
|
+
rangeStart,
|
|
65
|
+
rangeEnd,
|
|
66
|
+
previewRange,
|
|
67
|
+
focusDate,
|
|
68
|
+
selectDate,
|
|
69
|
+
setCommittedRange,
|
|
70
|
+
setHoverDate,
|
|
71
|
+
clearPendingSelection
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
export { useRangeSelection };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { type GenericSchema } from "valibot";
|
|
1
2
|
import type { ObjectSetter, Paths } from "@felte/common";
|
|
2
3
|
import type { Accessor } from "solid-js";
|
|
3
|
-
import type { z } from "zod";
|
|
4
4
|
type AnyValues = Record<string, unknown>;
|
|
5
5
|
export type FormPathQuery<TValues extends AnyValues = AnyValues> = string | ((data: TValues) => unknown);
|
|
6
6
|
export type FormDirective = (element: HTMLFormElement, accessor?: Accessor<unknown>) => void | (() => void);
|
|
7
7
|
export type UseFormOptions<TValues extends AnyValues = AnyValues> = {
|
|
8
|
-
schema?:
|
|
8
|
+
schema?: GenericSchema;
|
|
9
9
|
initialValues?: TValues;
|
|
10
10
|
onSubmit?: (values: TValues) => void | Promise<void>;
|
|
11
11
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as __WEBPACK_EXTERNAL_MODULE__felte_solid_6a709b1d__ from "@felte/solid";
|
|
2
|
-
import * as
|
|
2
|
+
import * as __WEBPACK_EXTERNAL_MODULE_valibot__ from "valibot";
|
|
3
3
|
const FORM_CONTROLLER_REGISTRY = new WeakMap();
|
|
4
4
|
const getClosestFormElement = (element)=>{
|
|
5
5
|
if (!element) return;
|
|
@@ -19,11 +19,16 @@ const useForm = (options = {})=>{
|
|
|
19
19
|
await options.onSubmit?.(values);
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
|
-
if (options.schema) formConfig.
|
|
23
|
-
(0,
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
|
|
22
|
+
if (options.schema) formConfig.validate = (values)=>{
|
|
23
|
+
const result = (0, __WEBPACK_EXTERNAL_MODULE_valibot__.safeParse)(options.schema, values);
|
|
24
|
+
if (result.success) return;
|
|
25
|
+
const errors = {};
|
|
26
|
+
for (const issue of result.issues)if (issue.path) {
|
|
27
|
+
const path = issue.path.map((p)=>p.key).join(".");
|
|
28
|
+
if (!errors[path]) errors[path] = issue.message;
|
|
29
|
+
}
|
|
30
|
+
return errors;
|
|
31
|
+
};
|
|
27
32
|
const { form: felteForm, errors, touched, data, isValid, isSubmitting, setData, setErrors, setWarnings, setTouched, reset } = (0, __WEBPACK_EXTERNAL_MODULE__felte_solid_6a709b1d__.createForm)(formConfig);
|
|
28
33
|
let controller;
|
|
29
34
|
const directive = (element, accessor)=>{
|