@regardio/react 0.3.3 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/background-slideshow.d.ts +7 -5
- package/dist/components/background-slideshow.js +172 -74
- package/dist/components/blurry-gradient.d.ts +11 -4
- package/dist/components/blurry-gradient.js +121 -5
- package/dist/components/box.d.ts +12 -9
- package/dist/components/box.js +48 -23
- package/dist/components/carousel.d.ts +12 -10
- package/dist/components/carousel.js +146 -66
- package/dist/components/countdown.d.ts +5 -2
- package/dist/components/countdown.js +55 -21
- package/dist/components/definition-list.d.ts +19 -16
- package/dist/components/definition-list.js +83 -51
- package/dist/components/generic-error.d.ts +25 -5
- package/dist/components/generic-error.js +42 -34
- package/dist/components/heading.d.ts +13 -10
- package/dist/components/heading.js +114 -25
- package/dist/components/highlight.d.ts +11 -8
- package/dist/components/highlight.js +65 -17
- package/dist/components/icon-button.d.ts +7 -4
- package/dist/components/icon-button.js +16 -5
- package/dist/components/if.d.ts +6 -4
- package/dist/components/if.js +22 -14
- package/dist/components/iframe.d.ts +6 -4
- package/dist/components/iframe.js +26 -3
- package/dist/components/item.d.ts +17 -14
- package/dist/components/item.js +504 -301
- package/dist/components/leaflet-map.d.ts +5 -4
- package/dist/components/leaflet-map.js +192 -186
- package/dist/components/link.d.ts +24 -16
- package/dist/components/link.js +191 -102
- package/dist/components/list-item.d.ts +11 -8
- package/dist/components/list-item.js +35 -17
- package/dist/components/maptiler-map.d.ts +5 -4
- package/dist/components/maptiler-map.js +125 -112
- package/dist/components/markdown-container.d.ts +10 -8
- package/dist/components/markdown-container.js +181 -82
- package/dist/components/password-input.d.ts +7 -5
- package/dist/components/password-input.js +50 -8
- package/dist/components/picture.d.ts +19 -7
- package/dist/components/picture.js +75 -34
- package/dist/components/protected-email.d.ts +14 -3
- package/dist/components/protected-email.js +29 -15
- package/dist/components/text.d.ts +12 -9
- package/dist/components/text.js +42 -24
- package/dist/components/unordered-list.d.ts +11 -8
- package/dist/components/unordered-list.js +37 -19
- package/dist/hooks/use-current-route-data.d.ts +7 -2
- package/dist/hooks/use-current-route-data.js +13 -9
- package/dist/hooks/use-focus-search.d.ts +6 -3
- package/dist/hooks/use-focus-search.js +17 -13
- package/dist/hooks/use-matches-data.d.ts +9 -2
- package/dist/hooks/use-matches-data.js +12 -8
- package/dist/hooks/use-media-query.d.ts +8 -2
- package/dist/hooks/use-media-query.js +19 -15
- package/dist/hooks/use-mobile.d.ts +3 -2
- package/dist/hooks/use-mobile.js +18 -14
- package/dist/hooks/use-nonce.d.ts +12 -5
- package/dist/hooks/use-nonce.js +11 -7
- package/dist/hooks/use-orientation.d.ts +11 -3
- package/dist/hooks/use-orientation.js +28 -24
- package/dist/hooks/use-user.d.ts +43 -8
- package/dist/hooks/use-user.js +21 -13
- package/dist/utils/author.d.ts +4 -4
- package/dist/utils/author.js +49 -31
- package/dist/utils/cn.d.ts +8 -4
- package/dist/utils/cn.js +12 -8
- package/dist/utils/is-route-active.d.ts +19 -3
- package/dist/utils/is-route-active.js +45 -43
- package/dist/utils/locale.d.ts +66 -4
- package/dist/utils/locale.js +33 -22
- package/dist/utils/text.d.ts +24 -7
- package/dist/utils/text.js +114 -89
- package/package.json +4 -3
- package/dist/components/background-slideshow.d.ts.map +0 -1
- package/dist/components/blurry-gradient.d.ts.map +0 -1
- package/dist/components/box.d.ts.map +0 -1
- package/dist/components/carousel.d.ts.map +0 -1
- package/dist/components/countdown.d.ts.map +0 -1
- package/dist/components/definition-list.d.ts.map +0 -1
- package/dist/components/generic-error.d.ts.map +0 -1
- package/dist/components/heading.d.ts.map +0 -1
- package/dist/components/highlight.d.ts.map +0 -1
- package/dist/components/icon-button.d.ts.map +0 -1
- package/dist/components/if.d.ts.map +0 -1
- package/dist/components/iframe.d.ts.map +0 -1
- package/dist/components/item.d.ts.map +0 -1
- package/dist/components/leaflet-map.d.ts.map +0 -1
- package/dist/components/link.d.ts.map +0 -1
- package/dist/components/link.test.d.ts +0 -2
- package/dist/components/link.test.d.ts.map +0 -1
- package/dist/components/link.test.js +0 -204
- package/dist/components/list-item.d.ts.map +0 -1
- package/dist/components/maptiler-map.d.ts.map +0 -1
- package/dist/components/markdown-container.d.ts.map +0 -1
- package/dist/components/password-input.d.ts.map +0 -1
- package/dist/components/picture.d.ts.map +0 -1
- package/dist/components/protected-email.d.ts.map +0 -1
- package/dist/components/text.d.ts.map +0 -1
- package/dist/components/unordered-list.d.ts.map +0 -1
- package/dist/hooks/use-current-route-data.d.ts.map +0 -1
- package/dist/hooks/use-focus-search.d.ts.map +0 -1
- package/dist/hooks/use-matches-data.d.ts.map +0 -1
- package/dist/hooks/use-media-query.d.ts.map +0 -1
- package/dist/hooks/use-mobile.d.ts.map +0 -1
- package/dist/hooks/use-nonce.d.ts.map +0 -1
- package/dist/hooks/use-nonce.test.d.ts +0 -2
- package/dist/hooks/use-nonce.test.d.ts.map +0 -1
- package/dist/hooks/use-nonce.test.js +0 -27
- package/dist/hooks/use-orientation.d.ts.map +0 -1
- package/dist/hooks/use-user.d.ts.map +0 -1
- package/dist/shadcn/accordion.d.ts +0 -25
- package/dist/shadcn/accordion.d.ts.map +0 -1
- package/dist/shadcn/accordion.js +0 -45
- package/dist/shadcn/alert-dialog.d.ts +0 -73
- package/dist/shadcn/alert-dialog.d.ts.map +0 -1
- package/dist/shadcn/alert-dialog.js +0 -93
- package/dist/shadcn/alert.d.ts +0 -34
- package/dist/shadcn/alert.d.ts.map +0 -1
- package/dist/shadcn/alert.js +0 -42
- package/dist/shadcn/aspect-ratio.d.ts +0 -6
- package/dist/shadcn/aspect-ratio.d.ts.map +0 -1
- package/dist/shadcn/aspect-ratio.js +0 -7
- package/dist/shadcn/avatar.d.ts +0 -16
- package/dist/shadcn/avatar.d.ts.map +0 -1
- package/dist/shadcn/avatar.js +0 -27
- package/dist/shadcn/badge.d.ts +0 -29
- package/dist/shadcn/badge.d.ts.map +0 -1
- package/dist/shadcn/badge.js +0 -29
- package/dist/shadcn/breadcrumb.d.ts +0 -42
- package/dist/shadcn/breadcrumb.d.ts.map +0 -1
- package/dist/shadcn/breadcrumb.js +0 -74
- package/dist/shadcn/button.d.ts +0 -38
- package/dist/shadcn/button.d.ts.map +0 -1
- package/dist/shadcn/button.js +0 -38
- package/dist/shadcn/calendar.d.ts +0 -23
- package/dist/shadcn/calendar.d.ts.map +0 -1
- package/dist/shadcn/calendar.js +0 -163
- package/dist/shadcn/card.d.ts +0 -31
- package/dist/shadcn/card.d.ts.map +0 -1
- package/dist/shadcn/card.js +0 -55
- package/dist/shadcn/carousel.d.ts +0 -51
- package/dist/shadcn/carousel.d.ts.map +0 -1
- package/dist/shadcn/carousel.js +0 -161
- package/dist/shadcn/chart.d.ts +0 -103
- package/dist/shadcn/chart.d.ts.map +0 -1
- package/dist/shadcn/chart.js +0 -248
- package/dist/shadcn/checkbox.d.ts +0 -8
- package/dist/shadcn/checkbox.d.ts.map +0 -1
- package/dist/shadcn/checkbox.js +0 -22
- package/dist/shadcn/collapsible.d.ts +0 -16
- package/dist/shadcn/collapsible.d.ts.map +0 -1
- package/dist/shadcn/collapsible.js +0 -19
- package/dist/shadcn/command.d.ts +0 -61
- package/dist/shadcn/command.d.ts.map +0 -1
- package/dist/shadcn/command.js +0 -123
- package/dist/shadcn/context-menu.d.ts +0 -107
- package/dist/shadcn/context-menu.d.ts.map +0 -1
- package/dist/shadcn/context-menu.js +0 -151
- package/dist/shadcn/dialog.d.ts +0 -57
- package/dist/shadcn/dialog.d.ts.map +0 -1
- package/dist/shadcn/dialog.js +0 -96
- package/dist/shadcn/drawer.d.ts +0 -54
- package/dist/shadcn/drawer.d.ts.map +0 -1
- package/dist/shadcn/drawer.js +0 -96
- package/dist/shadcn/dropdown-menu.d.ts +0 -110
- package/dist/shadcn/dropdown-menu.d.ts.map +0 -1
- package/dist/shadcn/dropdown-menu.js +0 -152
- package/dist/shadcn/form.d.ts +0 -59
- package/dist/shadcn/form.d.ts.map +0 -1
- package/dist/shadcn/form.js +0 -99
- package/dist/shadcn/hover-card.d.ts +0 -20
- package/dist/shadcn/hover-card.d.ts.map +0 -1
- package/dist/shadcn/hover-card.js +0 -26
- package/dist/shadcn/input-otp.d.ts +0 -25
- package/dist/shadcn/input-otp.d.ts.map +0 -1
- package/dist/shadcn/input-otp.js +0 -54
- package/dist/shadcn/input.d.ts +0 -14
- package/dist/shadcn/input.d.ts.map +0 -1
- package/dist/shadcn/input.js +0 -48
- package/dist/shadcn/label.d.ts +0 -8
- package/dist/shadcn/label.d.ts.map +0 -1
- package/dist/shadcn/label.js +0 -16
- package/dist/shadcn/menubar.d.ts +0 -108
- package/dist/shadcn/menubar.d.ts.map +0 -1
- package/dist/shadcn/menubar.js +0 -174
- package/dist/shadcn/navigation-menu.d.ts +0 -79
- package/dist/shadcn/navigation-menu.d.ts.map +0 -1
- package/dist/shadcn/navigation-menu.js +0 -108
- package/dist/shadcn/pagination.d.ts +0 -45
- package/dist/shadcn/pagination.d.ts.map +0 -1
- package/dist/shadcn/pagination.js +0 -83
- package/dist/shadcn/popover.d.ts +0 -19
- package/dist/shadcn/popover.d.ts.map +0 -1
- package/dist/shadcn/popover.js +0 -29
- package/dist/shadcn/progress.d.ts +0 -9
- package/dist/shadcn/progress.d.ts.map +0 -1
- package/dist/shadcn/progress.js +0 -17
- package/dist/shadcn/radio-group.d.ts +0 -12
- package/dist/shadcn/radio-group.d.ts.map +0 -1
- package/dist/shadcn/radio-group.js +0 -32
- package/dist/shadcn/resizable.d.ts +0 -20
- package/dist/shadcn/resizable.d.ts.map +0 -1
- package/dist/shadcn/resizable.js +0 -32
- package/dist/shadcn/scroll-area.d.ts +0 -16
- package/dist/shadcn/scroll-area.d.ts.map +0 -1
- package/dist/shadcn/scroll-area.js +0 -40
- package/dist/shadcn/select.d.ts +0 -63
- package/dist/shadcn/select.d.ts.map +0 -1
- package/dist/shadcn/select.js +0 -120
- package/dist/shadcn/separator.d.ts +0 -10
- package/dist/shadcn/separator.d.ts.map +0 -1
- package/dist/shadcn/separator.js +0 -18
- package/dist/shadcn/sheet.d.ts +0 -48
- package/dist/shadcn/sheet.d.ts.map +0 -1
- package/dist/shadcn/sheet.js +0 -99
- package/dist/shadcn/sidebar.d.ts +0 -200
- package/dist/shadcn/sidebar.d.ts.map +0 -1
- package/dist/shadcn/sidebar.js +0 -528
- package/dist/shadcn/skeleton.d.ts +0 -6
- package/dist/shadcn/skeleton.d.ts.map +0 -1
- package/dist/shadcn/skeleton.js +0 -11
- package/dist/shadcn/slider.d.ts +0 -12
- package/dist/shadcn/slider.d.ts.map +0 -1
- package/dist/shadcn/slider.js +0 -50
- package/dist/shadcn/sonner.d.ts +0 -7
- package/dist/shadcn/sonner.d.ts.map +0 -1
- package/dist/shadcn/sonner.js +0 -20
- package/dist/shadcn/switch.d.ts +0 -8
- package/dist/shadcn/switch.d.ts.map +0 -1
- package/dist/shadcn/switch.js +0 -22
- package/dist/shadcn/table.d.ts +0 -35
- package/dist/shadcn/table.d.ts.map +0 -1
- package/dist/shadcn/table.js +0 -73
- package/dist/shadcn/tabs.d.ts +0 -20
- package/dist/shadcn/tabs.d.ts.map +0 -1
- package/dist/shadcn/tabs.js +0 -40
- package/dist/shadcn/textarea.d.ts +0 -7
- package/dist/shadcn/textarea.d.ts.map +0 -1
- package/dist/shadcn/textarea.js +0 -14
- package/dist/shadcn/toggle-group.d.ts +0 -22
- package/dist/shadcn/toggle-group.d.ts.map +0 -1
- package/dist/shadcn/toggle-group.js +0 -43
- package/dist/shadcn/toggle.d.ts +0 -29
- package/dist/shadcn/toggle.d.ts.map +0 -1
- package/dist/shadcn/toggle.js +0 -31
- package/dist/shadcn/tooltip.d.ts +0 -20
- package/dist/shadcn/tooltip.d.ts.map +0 -1
- package/dist/shadcn/tooltip.js +0 -40
- package/dist/stories/BackgroundSlideshow.stories.d.ts +0 -9
- package/dist/stories/BackgroundSlideshow.stories.d.ts.map +0 -1
- package/dist/stories/BackgroundSlideshow.stories.js +0 -60
- package/dist/stories/BlurryGradient.stories.d.ts +0 -11
- package/dist/stories/BlurryGradient.stories.d.ts.map +0 -1
- package/dist/stories/BlurryGradient.stories.js +0 -53
- package/dist/stories/Box.stories.d.ts +0 -13
- package/dist/stories/Box.stories.d.ts.map +0 -1
- package/dist/stories/Box.stories.js +0 -50
- package/dist/stories/Carousel.stories.d.ts +0 -9
- package/dist/stories/Carousel.stories.d.ts.map +0 -1
- package/dist/stories/Carousel.stories.js +0 -30
- package/dist/stories/Countdown.stories.d.ts +0 -7
- package/dist/stories/Countdown.stories.d.ts.map +0 -1
- package/dist/stories/Countdown.stories.js +0 -11
- package/dist/stories/DefinitionList.stories.d.ts +0 -9
- package/dist/stories/DefinitionList.stories.d.ts.map +0 -1
- package/dist/stories/DefinitionList.stories.js +0 -20
- package/dist/stories/GenericError.stories.d.ts +0 -9
- package/dist/stories/GenericError.stories.d.ts.map +0 -1
- package/dist/stories/GenericError.stories.js +0 -39
- package/dist/stories/Heading.stories.d.ts +0 -15
- package/dist/stories/Heading.stories.d.ts.map +0 -1
- package/dist/stories/Heading.stories.js +0 -61
- package/dist/stories/Highlight.stories.d.ts +0 -8
- package/dist/stories/Highlight.stories.d.ts.map +0 -1
- package/dist/stories/Highlight.stories.js +0 -19
- package/dist/stories/IconButton.stories.d.ts +0 -10
- package/dist/stories/IconButton.stories.d.ts.map +0 -1
- package/dist/stories/IconButton.stories.js +0 -32
- package/dist/stories/If.stories.d.ts +0 -13
- package/dist/stories/If.stories.d.ts.map +0 -1
- package/dist/stories/If.stories.js +0 -54
- package/dist/stories/Iframe.stories.d.ts +0 -8
- package/dist/stories/Iframe.stories.d.ts.map +0 -1
- package/dist/stories/Iframe.stories.js +0 -23
- package/dist/stories/Item.stories.d.ts +0 -10
- package/dist/stories/Item.stories.d.ts.map +0 -1
- package/dist/stories/Item.stories.js +0 -32
- package/dist/stories/Link.stories.d.ts +0 -10
- package/dist/stories/Link.stories.d.ts.map +0 -1
- package/dist/stories/Link.stories.js +0 -36
- package/dist/stories/ListItem.stories.d.ts +0 -9
- package/dist/stories/ListItem.stories.d.ts.map +0 -1
- package/dist/stories/ListItem.stories.js +0 -26
- package/dist/stories/MarkdownContainer.stories.d.ts +0 -11
- package/dist/stories/MarkdownContainer.stories.d.ts.map +0 -1
- package/dist/stories/MarkdownContainer.stories.js +0 -66
- package/dist/stories/PasswordInput.stories.d.ts +0 -9
- package/dist/stories/PasswordInput.stories.d.ts.map +0 -1
- package/dist/stories/PasswordInput.stories.js +0 -27
- package/dist/stories/Picture.stories.d.ts +0 -10
- package/dist/stories/Picture.stories.d.ts.map +0 -1
- package/dist/stories/Picture.stories.js +0 -46
- package/dist/stories/ProtectedEmail.stories.d.ts +0 -10
- package/dist/stories/ProtectedEmail.stories.d.ts.map +0 -1
- package/dist/stories/ProtectedEmail.stories.js +0 -34
- package/dist/stories/Text.stories.d.ts +0 -10
- package/dist/stories/Text.stories.d.ts.map +0 -1
- package/dist/stories/Text.stories.js +0 -31
- package/dist/stories/UnorderedList.stories.d.ts +0 -10
- package/dist/stories/UnorderedList.stories.d.ts.map +0 -1
- package/dist/stories/UnorderedList.stories.js +0 -24
- package/dist/test-setup.d.ts +0 -2
- package/dist/test-setup.d.ts.map +0 -1
- package/dist/test-setup.js +0 -1
- package/dist/utils/author.d.ts.map +0 -1
- package/dist/utils/author.test.d.ts +0 -2
- package/dist/utils/author.test.d.ts.map +0 -1
- package/dist/utils/author.test.js +0 -46
- package/dist/utils/cn.d.ts.map +0 -1
- package/dist/utils/cn.test.d.ts +0 -2
- package/dist/utils/cn.test.d.ts.map +0 -1
- package/dist/utils/cn.test.js +0 -33
- package/dist/utils/is-route-active.d.ts.map +0 -1
- package/dist/utils/is-route-active.test.d.ts +0 -2
- package/dist/utils/is-route-active.test.d.ts.map +0 -1
- package/dist/utils/is-route-active.test.js +0 -61
- package/dist/utils/locale.d.ts.map +0 -1
- package/dist/utils/locale.test.d.ts +0 -2
- package/dist/utils/locale.test.d.ts.map +0 -1
- package/dist/utils/locale.test.js +0 -99
- package/dist/utils/text.d.ts.map +0 -1
- package/dist/utils/text.test.d.ts +0 -2
- package/dist/utils/text.test.d.ts.map +0 -1
- package/dist/utils/text.test.js +0 -122
package/dist/components/text.js
CHANGED
|
@@ -1,27 +1,45 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import { defineConfig } from 'cva';
|
|
2
|
+
import { twMerge } from 'fluid-tailwindcss/tailwind-merge';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
// src/utils/cn.ts
|
|
6
|
+
var { cva, compose } = defineConfig({
|
|
7
|
+
hooks: {
|
|
8
|
+
onComplete: (className) => {
|
|
9
|
+
return twMerge(className);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
var text = cva({
|
|
14
|
+
base: ["relative", "block"],
|
|
15
|
+
defaultVariants: {
|
|
16
|
+
themeColor: "primary",
|
|
17
|
+
variant: "primary"
|
|
18
|
+
},
|
|
19
|
+
variants: {
|
|
20
|
+
themeColor: {
|
|
21
|
+
primary: []
|
|
18
22
|
},
|
|
23
|
+
variant: {
|
|
24
|
+
code: ["font-light", "font-monospace"],
|
|
25
|
+
primary: [],
|
|
26
|
+
subtitle: ["text-lg"]
|
|
27
|
+
}
|
|
28
|
+
}
|
|
19
29
|
});
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
30
|
+
var Text = (props) => {
|
|
31
|
+
const { children, className, variant, themeColor } = props;
|
|
32
|
+
return /* @__PURE__ */ jsx(
|
|
33
|
+
"div",
|
|
34
|
+
{
|
|
35
|
+
className: text({
|
|
36
|
+
className,
|
|
37
|
+
themeColor,
|
|
38
|
+
variant
|
|
39
|
+
}),
|
|
40
|
+
children
|
|
41
|
+
}
|
|
42
|
+
);
|
|
27
43
|
};
|
|
44
|
+
|
|
45
|
+
export { Text };
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as cva from 'cva';
|
|
3
|
+
import { VariantProps } from 'cva';
|
|
4
|
+
import { ComponentProps } from 'react';
|
|
5
|
+
|
|
3
6
|
declare const ul: (props?: ({
|
|
4
7
|
variant?: "primary" | "unstyled" | "inline" | undefined;
|
|
5
8
|
} & ({
|
|
6
|
-
class?:
|
|
9
|
+
class?: cva.ClassValue;
|
|
7
10
|
className?: never;
|
|
8
11
|
} | {
|
|
9
12
|
class?: never;
|
|
10
|
-
className?:
|
|
13
|
+
className?: cva.ClassValue;
|
|
11
14
|
})) | undefined) => string;
|
|
12
|
-
|
|
15
|
+
interface UnorderedListProps extends ComponentProps<'ul'>, VariantProps<typeof ul> {
|
|
13
16
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
declare const UnorderedList: (props: UnorderedListProps) => react_jsx_runtime.JSX.Element;
|
|
18
|
+
|
|
19
|
+
export { UnorderedList, type UnorderedListProps };
|
|
@@ -1,21 +1,39 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
},
|
|
13
|
-
},
|
|
1
|
+
import { defineConfig } from 'cva';
|
|
2
|
+
import { twMerge } from 'fluid-tailwindcss/tailwind-merge';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
// src/utils/cn.ts
|
|
6
|
+
var { cva, compose } = defineConfig({
|
|
7
|
+
hooks: {
|
|
8
|
+
onComplete: (className) => {
|
|
9
|
+
return twMerge(className);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
14
12
|
});
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
var ul = cva({
|
|
14
|
+
defaultVariants: {
|
|
15
|
+
variant: "primary"
|
|
16
|
+
},
|
|
17
|
+
variants: {
|
|
18
|
+
variant: {
|
|
19
|
+
inline: ["flex", "flex-wrap", "list-none"],
|
|
20
|
+
primary: [],
|
|
21
|
+
unstyled: ["list-none", "p-0"]
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
var UnorderedList = (props) => {
|
|
26
|
+
const { children, className, variant } = props;
|
|
27
|
+
return /* @__PURE__ */ jsx(
|
|
28
|
+
"ul",
|
|
29
|
+
{
|
|
30
|
+
className: ul({
|
|
31
|
+
className,
|
|
32
|
+
variant
|
|
33
|
+
}),
|
|
34
|
+
children
|
|
35
|
+
}
|
|
36
|
+
);
|
|
21
37
|
};
|
|
38
|
+
|
|
39
|
+
export { UnorderedList };
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* This base hook is used to access data related to the current route
|
|
3
|
+
* @returns {JSON|undefined} The router data or undefined if not found
|
|
4
|
+
*/
|
|
5
|
+
declare function useCurrentRouteData<HeaderData>(): {} | HeaderData;
|
|
6
|
+
|
|
7
|
+
export { useCurrentRouteData };
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
2
|
import { useLocation, useMatches } from 'react-router';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
|
|
4
|
+
// src/hooks/use-current-route-data.ts
|
|
5
|
+
function useCurrentRouteData() {
|
|
6
|
+
const location = useLocation();
|
|
7
|
+
const matchingRoutes = useMatches();
|
|
8
|
+
const route = useMemo(() => {
|
|
9
|
+
return matchingRoutes.find((route2) => {
|
|
10
|
+
return route2.pathname === location.pathname;
|
|
11
|
+
});
|
|
12
|
+
}, [matchingRoutes, location]);
|
|
13
|
+
return route?.data || void 0;
|
|
12
14
|
}
|
|
15
|
+
|
|
16
|
+
export { useCurrentRouteData };
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
|
|
3
|
+
/** Focuses on the field when user clicks cmd + k or ctrl + k */
|
|
4
|
+
declare function useFocusSearch(ref: RefObject<HTMLInputElement>): void;
|
|
5
|
+
|
|
6
|
+
export { useFocusSearch };
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import { useEffect } from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
2
|
+
|
|
3
|
+
// src/hooks/use-focus-search.ts
|
|
4
|
+
function useFocusSearch(ref) {
|
|
5
|
+
useEffect(() => {
|
|
6
|
+
function handleKeyDown(event) {
|
|
7
|
+
if ((event.metaKey || event.ctrlKey) && event.key === "k") {
|
|
8
|
+
event.preventDefault();
|
|
9
|
+
ref?.current?.focus();
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
13
|
+
return () => {
|
|
14
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
15
|
+
};
|
|
16
|
+
}, [ref]);
|
|
15
17
|
}
|
|
18
|
+
|
|
19
|
+
export { useFocusSearch };
|
|
@@ -1,2 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* This base hook is used in other hooks to quickly search for specific data
|
|
3
|
+
* across all loader data using useMatches.
|
|
4
|
+
* @param {string} id The route id
|
|
5
|
+
* @returns {JSON|undefined} The router data or undefined if not found
|
|
6
|
+
*/
|
|
7
|
+
declare function useMatchesData<T>(id: string): T | undefined;
|
|
8
|
+
|
|
9
|
+
export { useMatchesData };
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
2
|
import { useMatches } from 'react-router';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
|
|
4
|
+
// src/hooks/use-matches-data.ts
|
|
5
|
+
function useMatchesData(id) {
|
|
6
|
+
const matchingRoutes = useMatches();
|
|
7
|
+
const route = useMemo(() => {
|
|
8
|
+
return matchingRoutes.find((route2) => {
|
|
9
|
+
return route2.id === id;
|
|
10
|
+
});
|
|
11
|
+
}, [matchingRoutes, id]);
|
|
12
|
+
return route?.data || void 0;
|
|
11
13
|
}
|
|
14
|
+
|
|
15
|
+
export { useMatchesData };
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* A hook that returns a boolean indicating whether the current viewport matches the provided media query
|
|
3
|
+
* @param query The media query to check against (e.g. '(min-width: 768px)')
|
|
4
|
+
* @returns A boolean indicating whether the media query matches
|
|
5
|
+
*/
|
|
6
|
+
declare function useMediaQuery(query: string): boolean;
|
|
7
|
+
|
|
8
|
+
export { useMediaQuery };
|
|
@@ -1,16 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { useState, useEffect } from 'react';
|
|
2
|
+
|
|
3
|
+
// src/hooks/use-media-query.ts
|
|
4
|
+
function useMediaQuery(query) {
|
|
5
|
+
const [matches, setMatches] = useState(false);
|
|
6
|
+
useEffect(() => {
|
|
7
|
+
const mediaQuery = window.matchMedia(query);
|
|
8
|
+
setMatches(mediaQuery.matches);
|
|
9
|
+
const handleChange = (event) => {
|
|
10
|
+
setMatches(event.matches);
|
|
11
|
+
};
|
|
12
|
+
mediaQuery.addEventListener("change", handleChange);
|
|
13
|
+
return () => {
|
|
14
|
+
mediaQuery.removeEventListener("change", handleChange);
|
|
15
|
+
};
|
|
16
|
+
}, [query]);
|
|
17
|
+
return matches;
|
|
16
18
|
}
|
|
19
|
+
|
|
20
|
+
export { useMediaQuery };
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
declare function useIsMobile(): boolean;
|
|
2
|
+
|
|
3
|
+
export { useIsMobile };
|
package/dist/hooks/use-mobile.js
CHANGED
|
@@ -1,15 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
return
|
|
1
|
+
import { useState, useEffect } from 'react';
|
|
2
|
+
|
|
3
|
+
// src/hooks/use-mobile.ts
|
|
4
|
+
var MOBILE_BREAKPOINT = 768;
|
|
5
|
+
function useIsMobile() {
|
|
6
|
+
const [isMobile, setIsMobile] = useState(void 0);
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
9
|
+
const onChange = () => {
|
|
10
|
+
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
11
|
+
};
|
|
12
|
+
mql.addEventListener("change", onChange);
|
|
13
|
+
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
14
|
+
return () => mql.removeEventListener("change", onChange);
|
|
15
|
+
}, []);
|
|
16
|
+
return !!isMobile;
|
|
15
17
|
}
|
|
18
|
+
|
|
19
|
+
export { useIsMobile };
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
|
|
3
|
+
declare const NonceContext: react.Context<string>;
|
|
4
|
+
declare const NonceProvider: react.Provider<string>;
|
|
5
|
+
declare const useNonce: () => string;
|
|
6
|
+
/**
|
|
7
|
+
* Generate a cryptographically secure nonce for CSP.
|
|
8
|
+
* @returns A base64-encoded random nonce
|
|
9
|
+
*/
|
|
10
|
+
declare function generateNonce(): string;
|
|
11
|
+
|
|
12
|
+
export { NonceContext, NonceProvider, generateNonce, useNonce };
|
package/dist/hooks/use-nonce.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { createContext, useContext } from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
|
|
3
|
+
// src/hooks/use-nonce.ts
|
|
4
|
+
var NonceContext = createContext("");
|
|
5
|
+
var NonceProvider = NonceContext.Provider;
|
|
6
|
+
var useNonce = () => useContext(NonceContext);
|
|
7
|
+
function generateNonce() {
|
|
8
|
+
const array = new Uint8Array(16);
|
|
9
|
+
crypto.getRandomValues(array);
|
|
10
|
+
return btoa(String.fromCharCode(...array));
|
|
9
11
|
}
|
|
12
|
+
|
|
13
|
+
export { NonceContext, NonceProvider, generateNonce, useNonce };
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Orientation type representing device orientation
|
|
3
|
+
*/
|
|
4
|
+
type Orientation = 'portrait' | 'landscape';
|
|
5
|
+
/**
|
|
6
|
+
* Hook that tracks the current device orientation
|
|
7
|
+
* @returns The current orientation ('portrait' or 'landscape')
|
|
8
|
+
*/
|
|
9
|
+
declare function useOrientation(): Orientation;
|
|
10
|
+
|
|
11
|
+
export { type Orientation, useOrientation };
|
|
@@ -1,25 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
import { useState, useEffect } from 'react';
|
|
2
|
+
|
|
3
|
+
// src/hooks/use-orientation.ts
|
|
4
|
+
function useOrientation() {
|
|
5
|
+
const [orientation, setOrientation] = useState(() => {
|
|
6
|
+
if (typeof window !== "undefined") {
|
|
7
|
+
return window.innerHeight > window.innerWidth ? "portrait" : "landscape";
|
|
8
|
+
}
|
|
9
|
+
return "portrait";
|
|
10
|
+
});
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
if (typeof window === "undefined") {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
const handleResize = () => {
|
|
16
|
+
setOrientation(window.innerHeight > window.innerWidth ? "portrait" : "landscape");
|
|
17
|
+
};
|
|
18
|
+
window.addEventListener("resize", handleResize);
|
|
19
|
+
window.addEventListener("orientationchange", handleResize);
|
|
20
|
+
handleResize();
|
|
21
|
+
return () => {
|
|
22
|
+
window.removeEventListener("resize", handleResize);
|
|
23
|
+
window.removeEventListener("orientationchange", handleResize);
|
|
24
|
+
};
|
|
25
|
+
}, []);
|
|
26
|
+
return orientation;
|
|
25
27
|
}
|
|
28
|
+
|
|
29
|
+
export { useOrientation };
|
package/dist/hooks/use-user.d.ts
CHANGED
|
@@ -1,15 +1,50 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as react from 'react';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
import { User } from '@supabase/supabase-js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Context for storing and accessing the current authenticated user
|
|
8
|
+
*/
|
|
9
|
+
interface UserContextType {
|
|
10
|
+
/**
|
|
11
|
+
* The current authenticated user, or null if not authenticated
|
|
12
|
+
*/
|
|
4
13
|
user: User | null;
|
|
14
|
+
/**
|
|
15
|
+
* Whether the user data is currently loading
|
|
16
|
+
*/
|
|
5
17
|
isLoading: boolean;
|
|
6
18
|
}
|
|
7
|
-
|
|
8
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Context for storing and accessing the current authenticated user
|
|
21
|
+
*/
|
|
22
|
+
declare const UserContext: react.Context<UserContextType>;
|
|
23
|
+
/**
|
|
24
|
+
* Props for the UserContextProvider component
|
|
25
|
+
*/
|
|
26
|
+
interface UserContextProviderProps {
|
|
27
|
+
/**
|
|
28
|
+
* The current authenticated user, or null if not authenticated
|
|
29
|
+
*/
|
|
9
30
|
user: User | null;
|
|
31
|
+
/**
|
|
32
|
+
* Whether the user data is currently loading
|
|
33
|
+
*/
|
|
10
34
|
isLoading?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Child components that will have access to the user context
|
|
37
|
+
*/
|
|
11
38
|
children: ReactNode;
|
|
12
39
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
40
|
+
/**
|
|
41
|
+
* Provider component for the UserContext
|
|
42
|
+
*/
|
|
43
|
+
declare function UserContextProvider({ user, isLoading, children, }: UserContextProviderProps): react_jsx_runtime.JSX.Element;
|
|
44
|
+
/**
|
|
45
|
+
* Hook to access the current authenticated user from the UserContext
|
|
46
|
+
* @returns The current user context containing the user object and loading state
|
|
47
|
+
*/
|
|
48
|
+
declare function useUser(): UserContextType;
|
|
49
|
+
|
|
50
|
+
export { UserContext, UserContextProvider, type UserContextProviderProps, type UserContextType, useUser };
|
package/dist/hooks/use-user.js
CHANGED
|
@@ -1,17 +1,25 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
1
|
import { createContext, useContext } from 'react';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
|
|
4
|
+
// src/hooks/use-user.tsx
|
|
5
|
+
var defaultContextValue = {
|
|
6
|
+
isLoading: false,
|
|
7
|
+
user: null
|
|
6
8
|
};
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
var UserContext = createContext(defaultContextValue);
|
|
10
|
+
function UserContextProvider({
|
|
11
|
+
user,
|
|
12
|
+
isLoading = false,
|
|
13
|
+
children
|
|
14
|
+
}) {
|
|
15
|
+
return /* @__PURE__ */ jsx(UserContext.Provider, { value: { isLoading, user }, children });
|
|
10
16
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
function useUser() {
|
|
18
|
+
const context = useContext(UserContext);
|
|
19
|
+
if (context === void 0) {
|
|
20
|
+
throw new Error("useUser must be used within a UserContextProvider");
|
|
21
|
+
}
|
|
22
|
+
return context;
|
|
17
23
|
}
|
|
24
|
+
|
|
25
|
+
export { UserContext, UserContextProvider, useUser };
|
package/dist/utils/author.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ type AuthorInfo = {
|
|
|
3
3
|
email?: string;
|
|
4
4
|
url?: string;
|
|
5
5
|
};
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
declare function parseAuthorString(input: string): AuthorInfo;
|
|
7
|
+
declare function generateLinkFromAuthorString(input: string): React.ReactNode;
|
|
8
|
+
|
|
9
|
+
export { generateLinkFromAuthorString, parseAuthorString };
|