@regardio/react 0.3.2
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/LICENSE +9 -0
- package/README.md +133 -0
- package/dist/components/background-slideshow.d.ts +22 -0
- package/dist/components/background-slideshow.d.ts.map +1 -0
- package/dist/components/background-slideshow.js +76 -0
- package/dist/components/blurry-gradient.d.ts +9 -0
- package/dist/components/blurry-gradient.d.ts.map +1 -0
- package/dist/components/blurry-gradient.js +6 -0
- package/dist/components/box.d.ts +17 -0
- package/dist/components/box.d.ts.map +1 -0
- package/dist/components/box.js +25 -0
- package/dist/components/carousel.d.ts +26 -0
- package/dist/components/carousel.d.ts.map +1 -0
- package/dist/components/carousel.js +87 -0
- package/dist/components/countdown.d.ts +2 -0
- package/dist/components/countdown.d.ts.map +1 -0
- package/dist/components/countdown.js +48 -0
- package/dist/components/definition-list.d.ts +40 -0
- package/dist/components/definition-list.d.ts.map +1 -0
- package/dist/components/definition-list.js +57 -0
- package/dist/components/generic-error.d.ts +23 -0
- package/dist/components/generic-error.d.ts.map +1 -0
- package/dist/components/generic-error.js +39 -0
- package/dist/components/heading.d.ts +24 -0
- package/dist/components/heading.d.ts.map +1 -0
- package/dist/components/heading.js +29 -0
- package/dist/components/highlight.d.ts +16 -0
- package/dist/components/highlight.d.ts.map +1 -0
- package/dist/components/highlight.js +19 -0
- package/dist/components/icon-button.d.ts +6 -0
- package/dist/components/icon-button.d.ts.map +1 -0
- package/dist/components/icon-button.js +6 -0
- package/dist/components/if.d.ts +8 -0
- package/dist/components/if.d.ts.map +1 -0
- package/dist/components/if.js +16 -0
- package/dist/components/iframe.d.ts +8 -0
- package/dist/components/iframe.d.ts.map +1 -0
- package/dist/components/iframe.js +3 -0
- package/dist/components/item.d.ts +67 -0
- package/dist/components/item.d.ts.map +1 -0
- package/dist/components/item.js +309 -0
- package/dist/components/leaflet-map.d.ts +33 -0
- package/dist/components/leaflet-map.d.ts.map +1 -0
- package/dist/components/leaflet-map.js +195 -0
- package/dist/components/link.d.ts +41 -0
- package/dist/components/link.d.ts.map +1 -0
- package/dist/components/link.js +111 -0
- package/dist/components/link.test.d.ts +2 -0
- package/dist/components/link.test.d.ts.map +1 -0
- package/dist/components/link.test.js +204 -0
- package/dist/components/list-item.d.ts +16 -0
- package/dist/components/list-item.d.ts.map +1 -0
- package/dist/components/list-item.js +19 -0
- package/dist/components/maptiler-map.d.ts +26 -0
- package/dist/components/maptiler-map.d.ts.map +1 -0
- package/dist/components/maptiler-map.js +116 -0
- package/dist/components/markdown-container.d.ts +20 -0
- package/dist/components/markdown-container.d.ts.map +1 -0
- package/dist/components/markdown-container.js +93 -0
- package/dist/components/password-input.d.ts +9 -0
- package/dist/components/password-input.d.ts.map +1 -0
- package/dist/components/password-input.js +13 -0
- package/dist/components/picture.d.ts +26 -0
- package/dist/components/picture.d.ts.map +1 -0
- package/dist/components/picture.js +36 -0
- package/dist/components/protected-email.d.ts +9 -0
- package/dist/components/protected-email.d.ts.map +1 -0
- package/dist/components/protected-email.js +16 -0
- package/dist/components/text.d.ts +17 -0
- package/dist/components/text.d.ts.map +1 -0
- package/dist/components/text.js +27 -0
- package/dist/components/unordered-list.d.ts +16 -0
- package/dist/components/unordered-list.d.ts.map +1 -0
- package/dist/components/unordered-list.js +21 -0
- package/dist/hooks/use-current-route-data.d.ts +2 -0
- package/dist/hooks/use-current-route-data.d.ts.map +1 -0
- package/dist/hooks/use-current-route-data.js +12 -0
- package/dist/hooks/use-focus-search.d.ts +3 -0
- package/dist/hooks/use-focus-search.d.ts.map +1 -0
- package/dist/hooks/use-focus-search.js +15 -0
- package/dist/hooks/use-matches-data.d.ts +2 -0
- package/dist/hooks/use-matches-data.d.ts.map +1 -0
- package/dist/hooks/use-matches-data.js +11 -0
- package/dist/hooks/use-media-query.d.ts +2 -0
- package/dist/hooks/use-media-query.d.ts.map +1 -0
- package/dist/hooks/use-media-query.js +16 -0
- package/dist/hooks/use-mobile.d.ts +2 -0
- package/dist/hooks/use-mobile.d.ts.map +1 -0
- package/dist/hooks/use-mobile.js +15 -0
- package/dist/hooks/use-nonce.d.ts +5 -0
- package/dist/hooks/use-nonce.d.ts.map +1 -0
- package/dist/hooks/use-nonce.js +9 -0
- package/dist/hooks/use-nonce.test.d.ts +2 -0
- package/dist/hooks/use-nonce.test.d.ts.map +1 -0
- package/dist/hooks/use-nonce.test.js +27 -0
- package/dist/hooks/use-orientation.d.ts +3 -0
- package/dist/hooks/use-orientation.d.ts.map +1 -0
- package/dist/hooks/use-orientation.js +25 -0
- package/dist/hooks/use-user.d.ts +15 -0
- package/dist/hooks/use-user.d.ts.map +1 -0
- package/dist/hooks/use-user.js +17 -0
- package/dist/shadcn/accordion.d.ts +25 -0
- package/dist/shadcn/accordion.d.ts.map +1 -0
- package/dist/shadcn/accordion.js +45 -0
- package/dist/shadcn/alert-dialog.d.ts +73 -0
- package/dist/shadcn/alert-dialog.d.ts.map +1 -0
- package/dist/shadcn/alert-dialog.js +93 -0
- package/dist/shadcn/alert.d.ts +34 -0
- package/dist/shadcn/alert.d.ts.map +1 -0
- package/dist/shadcn/alert.js +42 -0
- package/dist/shadcn/aspect-ratio.d.ts +6 -0
- package/dist/shadcn/aspect-ratio.d.ts.map +1 -0
- package/dist/shadcn/aspect-ratio.js +7 -0
- package/dist/shadcn/avatar.d.ts +16 -0
- package/dist/shadcn/avatar.d.ts.map +1 -0
- package/dist/shadcn/avatar.js +27 -0
- package/dist/shadcn/badge.d.ts +29 -0
- package/dist/shadcn/badge.d.ts.map +1 -0
- package/dist/shadcn/badge.js +29 -0
- package/dist/shadcn/breadcrumb.d.ts +42 -0
- package/dist/shadcn/breadcrumb.d.ts.map +1 -0
- package/dist/shadcn/breadcrumb.js +74 -0
- package/dist/shadcn/button.d.ts +38 -0
- package/dist/shadcn/button.d.ts.map +1 -0
- package/dist/shadcn/button.js +38 -0
- package/dist/shadcn/calendar.d.ts +23 -0
- package/dist/shadcn/calendar.d.ts.map +1 -0
- package/dist/shadcn/calendar.js +163 -0
- package/dist/shadcn/card.d.ts +31 -0
- package/dist/shadcn/card.d.ts.map +1 -0
- package/dist/shadcn/card.js +55 -0
- package/dist/shadcn/carousel.d.ts +51 -0
- package/dist/shadcn/carousel.d.ts.map +1 -0
- package/dist/shadcn/carousel.js +161 -0
- package/dist/shadcn/chart.d.ts +103 -0
- package/dist/shadcn/chart.d.ts.map +1 -0
- package/dist/shadcn/chart.js +248 -0
- package/dist/shadcn/checkbox.d.ts +8 -0
- package/dist/shadcn/checkbox.d.ts.map +1 -0
- package/dist/shadcn/checkbox.js +22 -0
- package/dist/shadcn/collapsible.d.ts +16 -0
- package/dist/shadcn/collapsible.d.ts.map +1 -0
- package/dist/shadcn/collapsible.js +19 -0
- package/dist/shadcn/command.d.ts +61 -0
- package/dist/shadcn/command.d.ts.map +1 -0
- package/dist/shadcn/command.js +123 -0
- package/dist/shadcn/context-menu.d.ts +107 -0
- package/dist/shadcn/context-menu.d.ts.map +1 -0
- package/dist/shadcn/context-menu.js +151 -0
- package/dist/shadcn/dialog.d.ts +57 -0
- package/dist/shadcn/dialog.d.ts.map +1 -0
- package/dist/shadcn/dialog.js +96 -0
- package/dist/shadcn/drawer.d.ts +54 -0
- package/dist/shadcn/drawer.d.ts.map +1 -0
- package/dist/shadcn/drawer.js +96 -0
- package/dist/shadcn/dropdown-menu.d.ts +110 -0
- package/dist/shadcn/dropdown-menu.d.ts.map +1 -0
- package/dist/shadcn/dropdown-menu.js +152 -0
- package/dist/shadcn/form.d.ts +59 -0
- package/dist/shadcn/form.d.ts.map +1 -0
- package/dist/shadcn/form.js +99 -0
- package/dist/shadcn/hover-card.d.ts +20 -0
- package/dist/shadcn/hover-card.d.ts.map +1 -0
- package/dist/shadcn/hover-card.js +26 -0
- package/dist/shadcn/input-otp.d.ts +25 -0
- package/dist/shadcn/input-otp.d.ts.map +1 -0
- package/dist/shadcn/input-otp.js +54 -0
- package/dist/shadcn/input.d.ts +14 -0
- package/dist/shadcn/input.d.ts.map +1 -0
- package/dist/shadcn/input.js +48 -0
- package/dist/shadcn/label.d.ts +8 -0
- package/dist/shadcn/label.d.ts.map +1 -0
- package/dist/shadcn/label.js +16 -0
- package/dist/shadcn/menubar.d.ts +108 -0
- package/dist/shadcn/menubar.d.ts.map +1 -0
- package/dist/shadcn/menubar.js +174 -0
- package/dist/shadcn/navigation-menu.d.ts +79 -0
- package/dist/shadcn/navigation-menu.d.ts.map +1 -0
- package/dist/shadcn/navigation-menu.js +108 -0
- package/dist/shadcn/pagination.d.ts +45 -0
- package/dist/shadcn/pagination.d.ts.map +1 -0
- package/dist/shadcn/pagination.js +83 -0
- package/dist/shadcn/popover.d.ts +19 -0
- package/dist/shadcn/popover.d.ts.map +1 -0
- package/dist/shadcn/popover.js +29 -0
- package/dist/shadcn/progress.d.ts +9 -0
- package/dist/shadcn/progress.d.ts.map +1 -0
- package/dist/shadcn/progress.js +17 -0
- package/dist/shadcn/radio-group.d.ts +12 -0
- package/dist/shadcn/radio-group.d.ts.map +1 -0
- package/dist/shadcn/radio-group.js +32 -0
- package/dist/shadcn/resizable.d.ts +20 -0
- package/dist/shadcn/resizable.d.ts.map +1 -0
- package/dist/shadcn/resizable.js +32 -0
- package/dist/shadcn/scroll-area.d.ts +16 -0
- package/dist/shadcn/scroll-area.d.ts.map +1 -0
- package/dist/shadcn/scroll-area.js +40 -0
- package/dist/shadcn/select.d.ts +63 -0
- package/dist/shadcn/select.d.ts.map +1 -0
- package/dist/shadcn/select.js +120 -0
- package/dist/shadcn/separator.d.ts +10 -0
- package/dist/shadcn/separator.d.ts.map +1 -0
- package/dist/shadcn/separator.js +18 -0
- package/dist/shadcn/sheet.d.ts +48 -0
- package/dist/shadcn/sheet.d.ts.map +1 -0
- package/dist/shadcn/sheet.js +99 -0
- package/dist/shadcn/sidebar.d.ts +200 -0
- package/dist/shadcn/sidebar.d.ts.map +1 -0
- package/dist/shadcn/sidebar.js +528 -0
- package/dist/shadcn/skeleton.d.ts +6 -0
- package/dist/shadcn/skeleton.d.ts.map +1 -0
- package/dist/shadcn/skeleton.js +11 -0
- package/dist/shadcn/slider.d.ts +12 -0
- package/dist/shadcn/slider.d.ts.map +1 -0
- package/dist/shadcn/slider.js +50 -0
- package/dist/shadcn/sonner.d.ts +7 -0
- package/dist/shadcn/sonner.d.ts.map +1 -0
- package/dist/shadcn/sonner.js +20 -0
- package/dist/shadcn/switch.d.ts +8 -0
- package/dist/shadcn/switch.d.ts.map +1 -0
- package/dist/shadcn/switch.js +22 -0
- package/dist/shadcn/table.d.ts +35 -0
- package/dist/shadcn/table.d.ts.map +1 -0
- package/dist/shadcn/table.js +73 -0
- package/dist/shadcn/tabs.d.ts +20 -0
- package/dist/shadcn/tabs.d.ts.map +1 -0
- package/dist/shadcn/tabs.js +40 -0
- package/dist/shadcn/textarea.d.ts +7 -0
- package/dist/shadcn/textarea.d.ts.map +1 -0
- package/dist/shadcn/textarea.js +14 -0
- package/dist/shadcn/toggle-group.d.ts +22 -0
- package/dist/shadcn/toggle-group.d.ts.map +1 -0
- package/dist/shadcn/toggle-group.js +43 -0
- package/dist/shadcn/toggle.d.ts +29 -0
- package/dist/shadcn/toggle.d.ts.map +1 -0
- package/dist/shadcn/toggle.js +31 -0
- package/dist/shadcn/tooltip.d.ts +20 -0
- package/dist/shadcn/tooltip.d.ts.map +1 -0
- package/dist/shadcn/tooltip.js +40 -0
- package/dist/stories/BackgroundSlideshow.stories.d.ts +9 -0
- package/dist/stories/BackgroundSlideshow.stories.d.ts.map +1 -0
- package/dist/stories/BackgroundSlideshow.stories.js +60 -0
- package/dist/stories/BlurryGradient.stories.d.ts +11 -0
- package/dist/stories/BlurryGradient.stories.d.ts.map +1 -0
- package/dist/stories/BlurryGradient.stories.js +53 -0
- package/dist/stories/Box.stories.d.ts +13 -0
- package/dist/stories/Box.stories.d.ts.map +1 -0
- package/dist/stories/Box.stories.js +50 -0
- package/dist/stories/Carousel.stories.d.ts +9 -0
- package/dist/stories/Carousel.stories.d.ts.map +1 -0
- package/dist/stories/Carousel.stories.js +30 -0
- package/dist/stories/Countdown.stories.d.ts +7 -0
- package/dist/stories/Countdown.stories.d.ts.map +1 -0
- package/dist/stories/Countdown.stories.js +11 -0
- package/dist/stories/DefinitionList.stories.d.ts +9 -0
- package/dist/stories/DefinitionList.stories.d.ts.map +1 -0
- package/dist/stories/DefinitionList.stories.js +20 -0
- package/dist/stories/GenericError.stories.d.ts +9 -0
- package/dist/stories/GenericError.stories.d.ts.map +1 -0
- package/dist/stories/GenericError.stories.js +39 -0
- package/dist/stories/Heading.stories.d.ts +15 -0
- package/dist/stories/Heading.stories.d.ts.map +1 -0
- package/dist/stories/Heading.stories.js +61 -0
- package/dist/stories/Highlight.stories.d.ts +8 -0
- package/dist/stories/Highlight.stories.d.ts.map +1 -0
- package/dist/stories/Highlight.stories.js +19 -0
- package/dist/stories/IconButton.stories.d.ts +10 -0
- package/dist/stories/IconButton.stories.d.ts.map +1 -0
- package/dist/stories/IconButton.stories.js +32 -0
- package/dist/stories/If.stories.d.ts +13 -0
- package/dist/stories/If.stories.d.ts.map +1 -0
- package/dist/stories/If.stories.js +54 -0
- package/dist/stories/Iframe.stories.d.ts +8 -0
- package/dist/stories/Iframe.stories.d.ts.map +1 -0
- package/dist/stories/Iframe.stories.js +23 -0
- package/dist/stories/Item.stories.d.ts +10 -0
- package/dist/stories/Item.stories.d.ts.map +1 -0
- package/dist/stories/Item.stories.js +32 -0
- package/dist/stories/Link.stories.d.ts +10 -0
- package/dist/stories/Link.stories.d.ts.map +1 -0
- package/dist/stories/Link.stories.js +36 -0
- package/dist/stories/ListItem.stories.d.ts +9 -0
- package/dist/stories/ListItem.stories.d.ts.map +1 -0
- package/dist/stories/ListItem.stories.js +25 -0
- package/dist/stories/MarkdownContainer.stories.d.ts +11 -0
- package/dist/stories/MarkdownContainer.stories.d.ts.map +1 -0
- package/dist/stories/MarkdownContainer.stories.js +66 -0
- package/dist/stories/PasswordInput.stories.d.ts +9 -0
- package/dist/stories/PasswordInput.stories.d.ts.map +1 -0
- package/dist/stories/PasswordInput.stories.js +27 -0
- package/dist/stories/Picture.stories.d.ts +10 -0
- package/dist/stories/Picture.stories.d.ts.map +1 -0
- package/dist/stories/Picture.stories.js +46 -0
- package/dist/stories/ProtectedEmail.stories.d.ts +10 -0
- package/dist/stories/ProtectedEmail.stories.d.ts.map +1 -0
- package/dist/stories/ProtectedEmail.stories.js +34 -0
- package/dist/stories/Text.stories.d.ts +10 -0
- package/dist/stories/Text.stories.d.ts.map +1 -0
- package/dist/stories/Text.stories.js +31 -0
- package/dist/stories/UnorderedList.stories.d.ts +10 -0
- package/dist/stories/UnorderedList.stories.d.ts.map +1 -0
- package/dist/stories/UnorderedList.stories.js +24 -0
- package/dist/test-setup.d.ts +2 -0
- package/dist/test-setup.d.ts.map +1 -0
- package/dist/test-setup.js +1 -0
- package/dist/utils/author.d.ts +9 -0
- package/dist/utils/author.d.ts.map +1 -0
- package/dist/utils/author.js +37 -0
- package/dist/utils/author.test.d.ts +2 -0
- package/dist/utils/author.test.d.ts.map +1 -0
- package/dist/utils/author.test.js +46 -0
- package/dist/utils/cn.d.ts +5 -0
- package/dist/utils/cn.d.ts.map +1 -0
- package/dist/utils/cn.js +10 -0
- package/dist/utils/cn.test.d.ts +2 -0
- package/dist/utils/cn.test.d.ts.map +1 -0
- package/dist/utils/cn.test.js +33 -0
- package/dist/utils/is-route-active.d.ts +3 -0
- package/dist/utils/is-route-active.d.ts.map +1 -0
- package/dist/utils/is-route-active.js +54 -0
- package/dist/utils/is-route-active.test.d.ts +2 -0
- package/dist/utils/is-route-active.test.d.ts.map +1 -0
- package/dist/utils/is-route-active.test.js +61 -0
- package/dist/utils/locale.d.ts +22 -0
- package/dist/utils/locale.d.ts.map +1 -0
- package/dist/utils/locale.js +25 -0
- package/dist/utils/locale.test.d.ts +2 -0
- package/dist/utils/locale.test.d.ts.map +1 -0
- package/dist/utils/locale.test.js +99 -0
- package/dist/utils/text.d.ts +7 -0
- package/dist/utils/text.d.ts.map +1 -0
- package/dist/utils/text.js +102 -0
- package/dist/utils/text.test.d.ts +2 -0
- package/dist/utils/text.test.d.ts.map +1 -0
- package/dist/utils/text.test.js +122 -0
- package/package.json +117 -0
- package/src/components/background-slideshow.tsx +172 -0
- package/src/components/blurry-gradient.tsx +97 -0
- package/src/components/box.tsx +45 -0
- package/src/components/carousel.tsx +197 -0
- package/src/components/countdown.tsx +82 -0
- package/src/components/definition-list.tsx +90 -0
- package/src/components/generic-error.tsx +104 -0
- package/src/components/heading.tsx +60 -0
- package/src/components/highlight.tsx +53 -0
- package/src/components/icon-button.tsx +20 -0
- package/src/components/if.tsx +29 -0
- package/src/components/iframe.tsx +19 -0
- package/src/components/item.tsx +340 -0
- package/src/components/leaflet-map.tsx +294 -0
- package/src/components/link.test.tsx +387 -0
- package/src/components/link.tsx +206 -0
- package/src/components/list-item.tsx +30 -0
- package/src/components/maptiler-map.tsx +181 -0
- package/src/components/markdown-container.tsx +153 -0
- package/src/components/password-input.tsx +49 -0
- package/src/components/picture.tsx +107 -0
- package/src/components/protected-email.tsx +49 -0
- package/src/components/text.tsx +38 -0
- package/src/components/unordered-list.tsx +32 -0
- package/src/hooks/use-current-route-data.ts +18 -0
- package/src/hooks/use-focus-search.ts +20 -0
- package/src/hooks/use-matches-data.ts +19 -0
- package/src/hooks/use-media-query.ts +33 -0
- package/src/hooks/use-mobile.ts +19 -0
- package/src/hooks/use-nonce.test.ts +35 -0
- package/src/hooks/use-nonce.ts +20 -0
- package/src/hooks/use-orientation.ts +48 -0
- package/src/hooks/use-user.tsx +72 -0
- package/src/stories/BackgroundSlideshow.stories.tsx +68 -0
- package/src/stories/BlurryGradient.stories.tsx +62 -0
- package/src/stories/Box.stories.tsx +83 -0
- package/src/stories/Carousel.stories.tsx +95 -0
- package/src/stories/Countdown.stories.tsx +16 -0
- package/src/stories/DefinitionList.stories.tsx +51 -0
- package/src/stories/GenericError.stories.tsx +58 -0
- package/src/stories/Heading.stories.tsx +82 -0
- package/src/stories/Highlight.stories.tsx +28 -0
- package/src/stories/IconButton.stories.tsx +90 -0
- package/src/stories/If.stories.tsx +72 -0
- package/src/stories/Iframe.stories.tsx +29 -0
- package/src/stories/Item.stories.tsx +79 -0
- package/src/stories/Link.stories.tsx +58 -0
- package/src/stories/ListItem.stories.tsx +37 -0
- package/src/stories/MarkdownContainer.stories.tsx +76 -0
- package/src/stories/PasswordInput.stories.tsx +34 -0
- package/src/stories/Picture.stories.tsx +54 -0
- package/src/stories/ProtectedEmail.stories.tsx +57 -0
- package/src/stories/Text.stories.tsx +44 -0
- package/src/stories/UnorderedList.stories.tsx +73 -0
- package/src/styles/storybook.css +1 -0
- package/src/styles/tailwind.css +7 -0
- package/src/test-setup.ts +1 -0
- package/src/utils/author.test.ts +54 -0
- package/src/utils/author.tsx +73 -0
- package/src/utils/cn.test.ts +48 -0
- package/src/utils/cn.ts +14 -0
- package/src/utils/is-route-active.test.ts +80 -0
- package/src/utils/is-route-active.ts +100 -0
- package/src/utils/locale.test.ts +148 -0
- package/src/utils/locale.ts +127 -0
- package/src/utils/text.test.ts +152 -0
- package/src/utils/text.tsx +209 -0
- package/src/vite-env.d.ts +1 -0
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { config, Map as MapTiler, Marker, Popup } from '@maptiler/sdk';
|
|
3
|
+
import { useEffect, useRef } from 'react';
|
|
4
|
+
import '@maptiler/sdk/dist/maptiler-sdk.css';
|
|
5
|
+
export const MapTilerMap = ({ markers, center, zoom = 12, mapStyle = 'streets', apiKey, showPopupsImmediately = false, }) => {
|
|
6
|
+
const mapContainerRef = useRef(null);
|
|
7
|
+
const mapRef = useRef(null);
|
|
8
|
+
const markersRef = useRef([]);
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
if (!mapContainerRef.current || typeof window === 'undefined')
|
|
11
|
+
return;
|
|
12
|
+
config.apiKey = apiKey;
|
|
13
|
+
let calculatedCenter;
|
|
14
|
+
if (center) {
|
|
15
|
+
calculatedCenter = [center.lng, center.lat];
|
|
16
|
+
}
|
|
17
|
+
else if (markers.length > 0) {
|
|
18
|
+
const firstMarker = markers[0];
|
|
19
|
+
if (firstMarker) {
|
|
20
|
+
calculatedCenter = [firstMarker.lng, firstMarker.lat];
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
calculatedCenter = [13.404954, 52.520008];
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
calculatedCenter = [13.404954, 52.520008];
|
|
28
|
+
}
|
|
29
|
+
const map = new MapTiler({
|
|
30
|
+
center: calculatedCenter,
|
|
31
|
+
container: mapContainerRef.current,
|
|
32
|
+
style: `https://api.maptiler.com/maps/${mapStyle}/style.json?key=${apiKey}`,
|
|
33
|
+
zoom: zoom,
|
|
34
|
+
});
|
|
35
|
+
map.on('styleimagemissing', (e) => {
|
|
36
|
+
const id = e.id;
|
|
37
|
+
console.warn(`Missing sprite image: ${id}`);
|
|
38
|
+
});
|
|
39
|
+
mapRef.current = map;
|
|
40
|
+
const newMarkers = [];
|
|
41
|
+
markers.forEach((marker) => {
|
|
42
|
+
const markerInstance = new Marker().setLngLat([marker.lng, marker.lat]).addTo(map);
|
|
43
|
+
let popupContent = '';
|
|
44
|
+
if (marker.htmlContent) {
|
|
45
|
+
popupContent = marker.htmlContent;
|
|
46
|
+
}
|
|
47
|
+
else if (marker.content) {
|
|
48
|
+
popupContent = marker.content;
|
|
49
|
+
}
|
|
50
|
+
if (popupContent) {
|
|
51
|
+
const popup = new Popup({
|
|
52
|
+
closeButton: false,
|
|
53
|
+
offset: marker.offset ? [marker.offset.x, marker.offset.y] : [0, 0],
|
|
54
|
+
}).setHTML(popupContent);
|
|
55
|
+
markerInstance.setPopup(popup);
|
|
56
|
+
if (showPopupsImmediately) {
|
|
57
|
+
markerInstance.togglePopup();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
newMarkers.push(markerInstance);
|
|
61
|
+
});
|
|
62
|
+
markersRef.current = newMarkers;
|
|
63
|
+
return () => {
|
|
64
|
+
if (mapRef.current) {
|
|
65
|
+
mapRef.current.remove();
|
|
66
|
+
mapRef.current = null;
|
|
67
|
+
}
|
|
68
|
+
markersRef.current = [];
|
|
69
|
+
};
|
|
70
|
+
}, [markers, apiKey, mapStyle, zoom, center, showPopupsImmediately]);
|
|
71
|
+
useEffect(() => {
|
|
72
|
+
const map = mapRef.current;
|
|
73
|
+
if (!map)
|
|
74
|
+
return;
|
|
75
|
+
markersRef.current.forEach((marker) => {
|
|
76
|
+
marker.remove();
|
|
77
|
+
});
|
|
78
|
+
markersRef.current = [];
|
|
79
|
+
const newMarkers = [];
|
|
80
|
+
markers.forEach((marker) => {
|
|
81
|
+
const markerInstance = new Marker().setLngLat([marker.lng, marker.lat]).addTo(map);
|
|
82
|
+
let popupContent = '';
|
|
83
|
+
if (marker.htmlContent) {
|
|
84
|
+
popupContent = marker.htmlContent;
|
|
85
|
+
}
|
|
86
|
+
else if (marker.content) {
|
|
87
|
+
popupContent = marker.content;
|
|
88
|
+
}
|
|
89
|
+
if (popupContent) {
|
|
90
|
+
const popup = new Popup({
|
|
91
|
+
closeButton: false,
|
|
92
|
+
offset: marker.offset ? [marker.offset.x, marker.offset.y] : [0, 0],
|
|
93
|
+
}).setHTML(popupContent);
|
|
94
|
+
markerInstance.setPopup(popup);
|
|
95
|
+
if (showPopupsImmediately) {
|
|
96
|
+
markerInstance.togglePopup();
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
newMarkers.push(markerInstance);
|
|
100
|
+
});
|
|
101
|
+
markersRef.current = newMarkers;
|
|
102
|
+
if (markers.length > 1) {
|
|
103
|
+
const lngs = markers.map((m) => m.lng);
|
|
104
|
+
const lats = markers.map((m) => m.lat);
|
|
105
|
+
const minLng = Math.min(...lngs);
|
|
106
|
+
const maxLng = Math.max(...lngs);
|
|
107
|
+
const minLat = Math.min(...lats);
|
|
108
|
+
const maxLat = Math.max(...lats);
|
|
109
|
+
map.fitBounds([
|
|
110
|
+
[minLng, minLat],
|
|
111
|
+
[maxLng, maxLat],
|
|
112
|
+
], { padding: 20 });
|
|
113
|
+
}
|
|
114
|
+
}, [markers, showPopupsImmediately]);
|
|
115
|
+
return (_jsx("div", { className: "h-full w-full", ref: mapContainerRef }));
|
|
116
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type MarkdownToJSX } from 'markdown-to-jsx';
|
|
2
|
+
import type React from 'react';
|
|
3
|
+
export declare function transformLink(to: string | Partial<{
|
|
4
|
+
pathname?: string;
|
|
5
|
+
search?: string;
|
|
6
|
+
hash?: string;
|
|
7
|
+
}> | undefined): string;
|
|
8
|
+
export type MDXComponent<P = object> = React.ComponentType<P>;
|
|
9
|
+
export type MarkdownOverrides = MarkdownToJSX.Options['overrides'];
|
|
10
|
+
export type MarkdownContainerProps = React.PropsWithChildren<{
|
|
11
|
+
characters?: number;
|
|
12
|
+
className?: string;
|
|
13
|
+
locale: string;
|
|
14
|
+
paragraphs?: number;
|
|
15
|
+
sentences?: number;
|
|
16
|
+
mdxComponents?: Record<string, MDXComponent>;
|
|
17
|
+
markdownOverrides?: MarkdownOverrides;
|
|
18
|
+
}>;
|
|
19
|
+
export declare const MarkdownContainer: React.FC<MarkdownContainerProps>;
|
|
20
|
+
//# sourceMappingURL=markdown-container.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown-container.d.ts","sourceRoot":"","sources":["../../src/components/markdown-container.tsx"],"names":[],"mappings":"AACA,OAAiB,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAgB/B,wBAAgB,aAAa,CAC3B,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG,SAAS,GACtF,MAAM,CAkBR;AAED,MAAM,MAAM,YAAY,CAAC,CAAC,GAAG,MAAM,IAAI,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;AAC9D,MAAM,MAAM,iBAAiB,GAAG,aAAa,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;AAEnE,MAAM,MAAM,sBAAsB,GAAG,KAAK,CAAC,iBAAiB,CAAC;IAC3D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IAC7C,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;CACvC,CAAC,CAAC;AAmEH,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAkC9D,CAAC"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { MDXProvider } from '@mdx-js/react';
|
|
3
|
+
import Markdown, {} from 'markdown-to-jsx';
|
|
4
|
+
import { cn } from '../utils/cn';
|
|
5
|
+
import { replaceSpecialChars } from '../utils/text';
|
|
6
|
+
const doubleNewlineRegex = /\n\n+/;
|
|
7
|
+
function processTextOutsideMDXComponents(text, locale) {
|
|
8
|
+
const mdxTagRegex = /(<\/?[A-Za-z][^>]*>)/g;
|
|
9
|
+
return text
|
|
10
|
+
.split(mdxTagRegex)
|
|
11
|
+
.map((part) => (mdxTagRegex.test(part) ? part : replaceSpecialChars(part, locale)))
|
|
12
|
+
.join('');
|
|
13
|
+
}
|
|
14
|
+
export function transformLink(to) {
|
|
15
|
+
const targetDomainSubstring = 'regard';
|
|
16
|
+
if (typeof to === 'string') {
|
|
17
|
+
try {
|
|
18
|
+
const url = new URL(to);
|
|
19
|
+
if (url.hostname.includes(targetDomainSubstring)) {
|
|
20
|
+
return url.pathname + (url.search ?? '') + (url.hash ?? '');
|
|
21
|
+
}
|
|
22
|
+
return to;
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
return to;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
else if (to?.pathname) {
|
|
29
|
+
return to.pathname + (to.search ?? '') + (to.hash ?? '');
|
|
30
|
+
}
|
|
31
|
+
return '';
|
|
32
|
+
}
|
|
33
|
+
const truncateText = (text, maxSentences, maxCharacters, maxParagraphs) => {
|
|
34
|
+
if (maxSentences === undefined && maxCharacters === undefined && maxParagraphs === undefined) {
|
|
35
|
+
return text;
|
|
36
|
+
}
|
|
37
|
+
const paragraphs = text.split(doubleNewlineRegex);
|
|
38
|
+
let truncatedText = '';
|
|
39
|
+
let charCount = 0;
|
|
40
|
+
let sentenceCount = 0;
|
|
41
|
+
let paragraphCount = 0;
|
|
42
|
+
for (const paragraph of paragraphs) {
|
|
43
|
+
if (maxParagraphs !== undefined && paragraphCount >= maxParagraphs) {
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
const sentenceRegex = /(?<!\.\.\.)(?<!\b\w\.)\.(?:\s+|\n+)/g;
|
|
47
|
+
const parts = paragraph.split(sentenceRegex);
|
|
48
|
+
const delimiters = paragraph.match(sentenceRegex) || [];
|
|
49
|
+
for (let i = 0; i < parts.length; i++) {
|
|
50
|
+
const part = parts[i];
|
|
51
|
+
const delimiter = delimiters[i] || '';
|
|
52
|
+
if (part !== undefined) {
|
|
53
|
+
if ((maxSentences === undefined || sentenceCount < maxSentences) &&
|
|
54
|
+
(maxCharacters === undefined ||
|
|
55
|
+
charCount + part.length + delimiter.length <= maxCharacters)) {
|
|
56
|
+
truncatedText += part + delimiter;
|
|
57
|
+
charCount += part.length + delimiter.length;
|
|
58
|
+
if (delimiter.includes('.')) {
|
|
59
|
+
sentenceCount++;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
paragraphCount++;
|
|
68
|
+
if ((maxSentences !== undefined && sentenceCount >= maxSentences) ||
|
|
69
|
+
(maxCharacters !== undefined && charCount >= maxCharacters)) {
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
if (paragraphCount < paragraphs.length) {
|
|
73
|
+
truncatedText += '\n\n';
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return truncatedText.trim();
|
|
77
|
+
};
|
|
78
|
+
export const MarkdownContainer = (props) => {
|
|
79
|
+
const rawText = props.children?.toString() || '';
|
|
80
|
+
let processedText = processTextOutsideMDXComponents(rawText, props.locale);
|
|
81
|
+
const shouldTruncate = Number.isInteger(props.sentences) ||
|
|
82
|
+
Number.isInteger(props.characters) ||
|
|
83
|
+
Number.isInteger(props.paragraphs);
|
|
84
|
+
if (shouldTruncate) {
|
|
85
|
+
processedText = truncateText(processedText, props.sentences, props.characters, props.paragraphs);
|
|
86
|
+
}
|
|
87
|
+
return (_jsx(MDXProvider, { components: props.mdxComponents, children: _jsx(Markdown, { className: cn('markdown', props.className), options: {
|
|
88
|
+
disableParsingRawHTML: false,
|
|
89
|
+
forceWrapper: true,
|
|
90
|
+
tagfilter: false,
|
|
91
|
+
...(props.markdownOverrides ? { overrides: props.markdownOverrides } : {}),
|
|
92
|
+
}, children: processedText }) }));
|
|
93
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Input } from '@base-ui/react/input';
|
|
2
|
+
export interface InputProps extends React.ComponentPropsWithoutRef<typeof Input> {
|
|
3
|
+
}
|
|
4
|
+
export interface PasswordInputProps extends InputProps {
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
declare const PasswordInput: ({ className, ...props }: PasswordInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export { PasswordInput };
|
|
9
|
+
//# sourceMappingURL=password-input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"password-input.d.ts","sourceRoot":"","sources":["../../src/components/password-input.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAI7C,MAAM,WAAW,UAAW,SAAQ,KAAK,CAAC,wBAAwB,CAAC,OAAO,KAAK,CAAC;CAAG;AAEnF,MAAM,WAAW,kBAAmB,SAAQ,UAAU;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,aAAa,GAAI,yBAAyB,kBAAkB,4CAmCjE,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button } from '@base-ui/react/button';
|
|
3
|
+
import { Input } from '@base-ui/react/input';
|
|
4
|
+
import { useState } from 'react';
|
|
5
|
+
import { cn } from '../utils/cn';
|
|
6
|
+
const PasswordInput = ({ className, ...props }) => {
|
|
7
|
+
const [showPassword, setShowPassword] = useState(false);
|
|
8
|
+
const togglePasswordVisibility = () => {
|
|
9
|
+
setShowPassword(!showPassword);
|
|
10
|
+
};
|
|
11
|
+
return (_jsxs("div", { className: 'relative', children: [_jsx(Input, { autoComplete: 'off', className: cn(className), type: showPassword ? 'text' : 'password', ...props }), _jsx(Button, { className: cn('absolute', 'right-[14px]', 'top-[35px]', 'flex', 'h-6', 'w-[20px]', 'cursor-pointer', 'flex-col', 'items-end', 'justify-center', 'text-gray-500'), onClick: togglePasswordVisibility, children: showPassword ? 'Off' : 'On' })] }));
|
|
12
|
+
};
|
|
13
|
+
export { PasswordInput };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
export declare const screenSizeVariants: {
|
|
3
|
+
readonly lg: 1280;
|
|
4
|
+
readonly max: 1920;
|
|
5
|
+
readonly md: 960;
|
|
6
|
+
readonly min: 360;
|
|
7
|
+
readonly sm: 640;
|
|
8
|
+
readonly xl: 1600;
|
|
9
|
+
readonly xs: 480;
|
|
10
|
+
};
|
|
11
|
+
export type ImageFormat = {
|
|
12
|
+
size: string;
|
|
13
|
+
width: number;
|
|
14
|
+
};
|
|
15
|
+
export interface PictureProps {
|
|
16
|
+
alt: string;
|
|
17
|
+
baseUrl: string;
|
|
18
|
+
className?: string;
|
|
19
|
+
formats?: ImageFormat[];
|
|
20
|
+
imgClassName?: string;
|
|
21
|
+
placeholder?: string;
|
|
22
|
+
sizes?: string;
|
|
23
|
+
}
|
|
24
|
+
declare const Picture: React.FC<PictureProps>;
|
|
25
|
+
export { Picture };
|
|
26
|
+
//# sourceMappingURL=picture.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"picture.d.ts","sourceRoot":"","sources":["../../src/components/picture.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,eAAO,MAAM,kBAAkB;;;;;;;;CAQrB,CAAC;AAGX,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,WAAW,EAAE,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAaD,QAAA,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CA8DnC,CAAC;AAEF,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from '../utils/cn';
|
|
3
|
+
export const screenSizeVariants = {
|
|
4
|
+
lg: 1280,
|
|
5
|
+
max: 1920,
|
|
6
|
+
md: 960,
|
|
7
|
+
min: 360,
|
|
8
|
+
sm: 640,
|
|
9
|
+
xl: 1600,
|
|
10
|
+
xs: 480,
|
|
11
|
+
};
|
|
12
|
+
const Picture = ({ alt, baseUrl, className, formats, imgClassName, placeholder = '{format}', sizes = '(max-width: 480px) 480px, (max-width: 768px) 600px, (max-width: 1200px) 1024px, 1920px', }) => {
|
|
13
|
+
const imageFormats = formats || [
|
|
14
|
+
{ size: '480x360', width: 480 },
|
|
15
|
+
{ size: '600x600', width: 600 },
|
|
16
|
+
{ size: '1024x768', width: 1024 },
|
|
17
|
+
{ size: '1920x1440', width: 1920 },
|
|
18
|
+
];
|
|
19
|
+
if (imageFormats.length === 0) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
const isSimpleImage = (imageFormats.length === 1 && imageFormats[0]?.size === '') || !baseUrl.includes(placeholder);
|
|
23
|
+
if (isSimpleImage) {
|
|
24
|
+
return (_jsx("img", { alt: alt, className: cn(className, imgClassName), src: baseUrl }));
|
|
25
|
+
}
|
|
26
|
+
const srcSet = imageFormats
|
|
27
|
+
.map(({ size, width }) => {
|
|
28
|
+
const url = baseUrl.replace(placeholder, size);
|
|
29
|
+
return `${url} ${width}w`;
|
|
30
|
+
})
|
|
31
|
+
.join(', ');
|
|
32
|
+
const defaultFormat = imageFormats[0];
|
|
33
|
+
const defaultSrc = defaultFormat ? baseUrl.replace(placeholder, defaultFormat.size) : baseUrl;
|
|
34
|
+
return (_jsxs("picture", { className: className, children: [_jsx("source", { sizes: sizes, srcSet: srcSet }), _jsx("img", { alt: alt, className: cn(imgClassName), src: defaultSrc })] }));
|
|
35
|
+
};
|
|
36
|
+
export { Picture };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface ProtectedEmailProps {
|
|
2
|
+
username: string;
|
|
3
|
+
domain: string;
|
|
4
|
+
text?: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function ProtectedEmail({ username, domain, text, className }: ProtectedEmailProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=protected-email.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protected-email.d.ts","sourceRoot":"","sources":["../../src/components/protected-email.tsx"],"names":[],"mappings":"AAEA,UAAU,mBAAmB;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAWD,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,mBAAmB,2CA8BxF"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
export function ProtectedEmail({ username, domain, text, className }) {
|
|
4
|
+
const [mounted, setMounted] = useState(false);
|
|
5
|
+
useEffect(() => {
|
|
6
|
+
setMounted(true);
|
|
7
|
+
}, []);
|
|
8
|
+
const fallbackText = text || `${username}(at)${domain}`;
|
|
9
|
+
const handleClick = (e) => {
|
|
10
|
+
if (mounted) {
|
|
11
|
+
window.location.href = `mailto:${username}@${domain}`;
|
|
12
|
+
e.preventDefault();
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
return (_jsx("a", { "aria-label": `Email address: ${username} at ${domain}`, className: className, "data-email-protected": "true", href: mounted ? '#email-protected' : undefined, onClick: handleClick, children: fallbackText }));
|
|
16
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ComponentProps } from 'react';
|
|
2
|
+
import { type VariantProps } from '../utils/cn';
|
|
3
|
+
declare const text: (props?: ({
|
|
4
|
+
themeColor?: "primary" | undefined;
|
|
5
|
+
variant?: "code" | "primary" | "subtitle" | undefined;
|
|
6
|
+
} & ({
|
|
7
|
+
class?: import("cva").ClassValue;
|
|
8
|
+
className?: never;
|
|
9
|
+
} | {
|
|
10
|
+
class?: never;
|
|
11
|
+
className?: import("cva").ClassValue;
|
|
12
|
+
})) | undefined) => string;
|
|
13
|
+
export interface TextProps extends ComponentProps<'p'>, VariantProps<typeof text> {
|
|
14
|
+
}
|
|
15
|
+
export declare const Text: (props: TextProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../src/components/text.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAErD,QAAA,MAAM,IAAI;;;;;;;;;0BAgBR,CAAC;AAEH,MAAM,WAAW,SAAU,SAAQ,cAAc,CAAC,GAAG,CAAC,EAAE,YAAY,CAAC,OAAO,IAAI,CAAC;CAAG;AAEpF,eAAO,MAAM,IAAI,GAAI,OAAO,SAAS,4CAcpC,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cva } from '../utils/cn';
|
|
3
|
+
const text = cva({
|
|
4
|
+
base: ['relative', 'block'],
|
|
5
|
+
defaultVariants: {
|
|
6
|
+
themeColor: 'primary',
|
|
7
|
+
variant: 'primary',
|
|
8
|
+
},
|
|
9
|
+
variants: {
|
|
10
|
+
themeColor: {
|
|
11
|
+
primary: [],
|
|
12
|
+
},
|
|
13
|
+
variant: {
|
|
14
|
+
code: ['font-light', 'font-monospace'],
|
|
15
|
+
primary: [],
|
|
16
|
+
subtitle: ['text-lg'],
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
export const Text = (props) => {
|
|
21
|
+
const { children, className, variant, themeColor } = props;
|
|
22
|
+
return (_jsx("div", { className: text({
|
|
23
|
+
className,
|
|
24
|
+
themeColor,
|
|
25
|
+
variant,
|
|
26
|
+
}), children: children }));
|
|
27
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ComponentProps } from 'react';
|
|
2
|
+
import { type VariantProps } from '../utils/cn';
|
|
3
|
+
declare const ul: (props?: ({
|
|
4
|
+
variant?: "primary" | "unstyled" | "inline" | undefined;
|
|
5
|
+
} & ({
|
|
6
|
+
class?: import("cva").ClassValue;
|
|
7
|
+
className?: never;
|
|
8
|
+
} | {
|
|
9
|
+
class?: never;
|
|
10
|
+
className?: import("cva").ClassValue;
|
|
11
|
+
})) | undefined) => string;
|
|
12
|
+
export interface UnorderedListProps extends ComponentProps<'ul'>, VariantProps<typeof ul> {
|
|
13
|
+
}
|
|
14
|
+
export declare const UnorderedList: (props: UnorderedListProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=unordered-list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unordered-list.d.ts","sourceRoot":"","sources":["../../src/components/unordered-list.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAErD,QAAA,MAAM,EAAE;;;;;;;;0BAWN,CAAC;AAEH,MAAM,WAAW,kBAAmB,SAAQ,cAAc,CAAC,IAAI,CAAC,EAAE,YAAY,CAAC,OAAO,EAAE,CAAC;CAAG;AAE5F,eAAO,MAAM,aAAa,GAAI,OAAO,kBAAkB,4CAatD,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cva } from '../utils/cn';
|
|
3
|
+
const ul = cva({
|
|
4
|
+
defaultVariants: {
|
|
5
|
+
variant: 'primary',
|
|
6
|
+
},
|
|
7
|
+
variants: {
|
|
8
|
+
variant: {
|
|
9
|
+
inline: ['flex', 'flex-wrap', 'list-none'],
|
|
10
|
+
primary: [],
|
|
11
|
+
unstyled: ['list-none', 'p-0'],
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
export const UnorderedList = (props) => {
|
|
16
|
+
const { children, className, variant } = props;
|
|
17
|
+
return (_jsx("ul", { className: ul({
|
|
18
|
+
className,
|
|
19
|
+
variant,
|
|
20
|
+
}), children: children }));
|
|
21
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-current-route-data.d.ts","sourceRoot":"","sources":["../../src/hooks/use-current-route-data.ts"],"names":[],"mappings":"AAOA,wBAAgB,mBAAmB,CAAC,UAAU,qBAU7C"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import { useLocation, useMatches } from 'react-router';
|
|
3
|
+
export function useCurrentRouteData() {
|
|
4
|
+
const location = useLocation();
|
|
5
|
+
const matchingRoutes = useMatches();
|
|
6
|
+
const route = useMemo(() => {
|
|
7
|
+
return matchingRoutes.find((route) => {
|
|
8
|
+
return route.pathname === location.pathname;
|
|
9
|
+
});
|
|
10
|
+
}, [matchingRoutes, location]);
|
|
11
|
+
return route?.data || undefined;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-focus-search.d.ts","sourceRoot":"","sources":["../../src/hooks/use-focus-search.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,wBAAgB,cAAc,CAAC,GAAG,EAAE,SAAS,CAAC,gBAAgB,CAAC,QAe9D"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
export function useFocusSearch(ref) {
|
|
3
|
+
useEffect(() => {
|
|
4
|
+
function handleKeyDown(event) {
|
|
5
|
+
if ((event.metaKey || event.ctrlKey) && event.key === 'k') {
|
|
6
|
+
event.preventDefault();
|
|
7
|
+
ref?.current?.focus();
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
document.addEventListener('keydown', handleKeyDown);
|
|
11
|
+
return () => {
|
|
12
|
+
document.removeEventListener('keydown', handleKeyDown);
|
|
13
|
+
};
|
|
14
|
+
}, [ref]);
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-matches-data.d.ts","sourceRoot":"","sources":["../../src/hooks/use-matches-data.ts"],"names":[],"mappings":"AASA,wBAAgB,cAAc,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS,CAS3D"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import { useMatches } from 'react-router';
|
|
3
|
+
export function useMatchesData(id) {
|
|
4
|
+
const matchingRoutes = useMatches();
|
|
5
|
+
const route = useMemo(() => {
|
|
6
|
+
return matchingRoutes.find((route) => {
|
|
7
|
+
return route.id === id;
|
|
8
|
+
});
|
|
9
|
+
}, [matchingRoutes, id]);
|
|
10
|
+
return route?.data || undefined;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-media-query.d.ts","sourceRoot":"","sources":["../../src/hooks/use-media-query.ts"],"names":[],"mappings":"AAOA,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAyBpD"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
export function useMediaQuery(query) {
|
|
3
|
+
const [matches, setMatches] = useState(false);
|
|
4
|
+
useEffect(() => {
|
|
5
|
+
const mediaQuery = window.matchMedia(query);
|
|
6
|
+
setMatches(mediaQuery.matches);
|
|
7
|
+
const handleChange = (event) => {
|
|
8
|
+
setMatches(event.matches);
|
|
9
|
+
};
|
|
10
|
+
mediaQuery.addEventListener('change', handleChange);
|
|
11
|
+
return () => {
|
|
12
|
+
mediaQuery.removeEventListener('change', handleChange);
|
|
13
|
+
};
|
|
14
|
+
}, [query]);
|
|
15
|
+
return matches;
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-mobile.d.ts","sourceRoot":"","sources":["../../src/hooks/use-mobile.ts"],"names":[],"mappings":"AAIA,wBAAgB,WAAW,YAc1B"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
const MOBILE_BREAKPOINT = 768;
|
|
3
|
+
export function useIsMobile() {
|
|
4
|
+
const [isMobile, setIsMobile] = useState(undefined);
|
|
5
|
+
useEffect(() => {
|
|
6
|
+
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
7
|
+
const onChange = () => {
|
|
8
|
+
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
9
|
+
};
|
|
10
|
+
mql.addEventListener('change', onChange);
|
|
11
|
+
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
12
|
+
return () => mql.removeEventListener('change', onChange);
|
|
13
|
+
}, []);
|
|
14
|
+
return !!isMobile;
|
|
15
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const NonceContext: import("react").Context<string>;
|
|
2
|
+
export declare const NonceProvider: import("react").Provider<string>;
|
|
3
|
+
export declare const useNonce: () => string;
|
|
4
|
+
export declare function generateNonce(): string;
|
|
5
|
+
//# sourceMappingURL=use-nonce.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-nonce.d.ts","sourceRoot":"","sources":["../../src/hooks/use-nonce.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,YAAY,iCAA4B,CAAC;AACtD,eAAO,MAAM,aAAa,kCAAwB,CAAC;AAEnD,eAAO,MAAM,QAAQ,cAAiC,CAAC;AAMvD,wBAAgB,aAAa,IAAI,MAAM,CAItC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createContext, useContext } from 'react';
|
|
2
|
+
export const NonceContext = createContext('');
|
|
3
|
+
export const NonceProvider = NonceContext.Provider;
|
|
4
|
+
export const useNonce = () => useContext(NonceContext);
|
|
5
|
+
export function generateNonce() {
|
|
6
|
+
const array = new Uint8Array(16);
|
|
7
|
+
crypto.getRandomValues(array);
|
|
8
|
+
return btoa(String.fromCharCode(...array));
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-nonce.test.d.ts","sourceRoot":"","sources":["../../src/hooks/use-nonce.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { describe, expect, test } from 'vitest';
|
|
2
|
+
import { generateNonce } from './use-nonce';
|
|
3
|
+
describe('generateNonce', () => {
|
|
4
|
+
test('generates a string', () => {
|
|
5
|
+
const nonce = generateNonce();
|
|
6
|
+
expect(typeof nonce).toBe('string');
|
|
7
|
+
});
|
|
8
|
+
test('generates a non-empty string', () => {
|
|
9
|
+
const nonce = generateNonce();
|
|
10
|
+
expect(nonce.length).toBeGreaterThan(0);
|
|
11
|
+
});
|
|
12
|
+
test('generates base64-encoded string', () => {
|
|
13
|
+
const nonce = generateNonce();
|
|
14
|
+
expect(nonce).toMatch(/^[A-Za-z0-9+/=]+$/);
|
|
15
|
+
});
|
|
16
|
+
test('generates unique nonces', () => {
|
|
17
|
+
const nonces = new Set();
|
|
18
|
+
for (let i = 0; i < 100; i++) {
|
|
19
|
+
nonces.add(generateNonce());
|
|
20
|
+
}
|
|
21
|
+
expect(nonces.size).toBe(100);
|
|
22
|
+
});
|
|
23
|
+
test('generates nonce of expected length', () => {
|
|
24
|
+
const nonce = generateNonce();
|
|
25
|
+
expect(nonce.length).toBe(24);
|
|
26
|
+
});
|
|
27
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-orientation.d.ts","sourceRoot":"","sources":["../../src/hooks/use-orientation.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,WAAW,CAAC;AAMnD,wBAAgB,cAAc,IAAI,WAAW,CAoC5C"}
|