@sikka/hawa 0.14.14-next → 0.14.15-next
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/index.css +10 -0
- package/dist/index.d.mts +10 -33
- package/dist/index.d.ts +10 -33
- package/dist/index.js +114 -47
- package/dist/index.mjs +110 -40
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -888,6 +888,10 @@ input[type="number"]::-webkit-inner-spin-button,
|
|
|
888
888
|
margin-top: 0.25rem;
|
|
889
889
|
margin-bottom: 0.25rem;
|
|
890
890
|
}
|
|
891
|
+
.hawa-my-10 {
|
|
892
|
+
margin-top: 2.5rem;
|
|
893
|
+
margin-bottom: 2.5rem;
|
|
894
|
+
}
|
|
891
895
|
.hawa-my-2 {
|
|
892
896
|
margin-top: 0.5rem;
|
|
893
897
|
margin-bottom: 0.5rem;
|
|
@@ -1189,6 +1193,9 @@ input[type="number"]::-webkit-inner-spin-button,
|
|
|
1189
1193
|
.hawa-w-1\/2 {
|
|
1190
1194
|
width: 50%;
|
|
1191
1195
|
}
|
|
1196
|
+
.hawa-w-1\/6 {
|
|
1197
|
+
width: 16.666667%;
|
|
1198
|
+
}
|
|
1192
1199
|
.hawa-w-10 {
|
|
1193
1200
|
width: 2.5rem;
|
|
1194
1201
|
}
|
|
@@ -1808,6 +1815,9 @@ input[type="number"]::-webkit-inner-spin-button,
|
|
|
1808
1815
|
.hawa-border-r-0 {
|
|
1809
1816
|
border-right-width: 0px;
|
|
1810
1817
|
}
|
|
1818
|
+
.hawa-border-r-4 {
|
|
1819
|
+
border-right-width: 4px;
|
|
1820
|
+
}
|
|
1811
1821
|
.hawa-border-t {
|
|
1812
1822
|
border-top-width: 1px;
|
|
1813
1823
|
}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
|
-
import React__default, { FC, ReactNode, ChangeEvent, InputHTMLAttributes, PropsWithChildren, RefObject } from 'react';
|
|
2
|
+
import React__default, { FC, ReactNode, ChangeEvent, InputHTMLAttributes, PropsWithChildren, RefObject, useEffect } from 'react';
|
|
3
3
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
4
4
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
5
5
|
import { VariantProps } from 'class-variance-authority';
|
|
@@ -1023,8 +1023,8 @@ type AppTopbarType = {
|
|
|
1023
1023
|
size?: number;
|
|
1024
1024
|
username?: string;
|
|
1025
1025
|
email?: string;
|
|
1026
|
-
profileMenuItems
|
|
1027
|
-
avatarImage
|
|
1026
|
+
profileMenuItems?: MenuItemType[];
|
|
1027
|
+
avatarImage?: string;
|
|
1028
1028
|
};
|
|
1029
1029
|
declare const AppTopbar: React__default.FC<AppTopbarType>;
|
|
1030
1030
|
|
|
@@ -1066,24 +1066,17 @@ type AppTabsType = {
|
|
|
1066
1066
|
declare const AppTabs: React__default.FC<AppTabsType>;
|
|
1067
1067
|
|
|
1068
1068
|
type AppLayoutTypes = {
|
|
1069
|
+
pages?: any[];
|
|
1069
1070
|
/** The direction of the layout */
|
|
1070
1071
|
direction?: DirectionType;
|
|
1071
|
-
/** The title of the current selected page, make sure it's the same as the drawerItem slug */
|
|
1072
|
-
currentPage: string;
|
|
1073
1072
|
/** Specifies the title of the page. */
|
|
1074
1073
|
pageTitle?: string;
|
|
1075
1074
|
/** Specifies the symbol for the logo. */
|
|
1076
1075
|
logoSymbol?: any;
|
|
1077
1076
|
/** Specifies the link for the logo. */
|
|
1078
1077
|
logoLink?: string;
|
|
1079
|
-
/** Specifies the text for the logo. */
|
|
1080
|
-
logoText?: any;
|
|
1081
1078
|
/** Specifies the content to be displayed in the layout. */
|
|
1082
1079
|
children?: any;
|
|
1083
|
-
/** Specifies the username to be displayed. */
|
|
1084
|
-
username?: string;
|
|
1085
|
-
/** Specifies the user email to be displayed. */
|
|
1086
|
-
email?: string;
|
|
1087
1080
|
/** Specifies the image for the avatar. */
|
|
1088
1081
|
avatarImage?: any;
|
|
1089
1082
|
/**
|
|
@@ -1093,19 +1086,6 @@ type AppLayoutTypes = {
|
|
|
1093
1086
|
* - 'large': Large.
|
|
1094
1087
|
*/
|
|
1095
1088
|
drawerSize?: "sm" | "md" | "large";
|
|
1096
|
-
/** Specifies the menu items for the profile menu. */
|
|
1097
|
-
/**
|
|
1098
|
-
* Specifies the width of the profile menu.
|
|
1099
|
-
* - 'default': Default width.
|
|
1100
|
-
* - 'sm': Small width.
|
|
1101
|
-
* - 'lg': Large width.
|
|
1102
|
-
* - 'parent': Inherits width from parent element.
|
|
1103
|
-
*/
|
|
1104
|
-
profileMenuWidth: "default" | "sm" | "lg" | "parent";
|
|
1105
|
-
/** Event handler for settings button click. */
|
|
1106
|
-
onSettingsClick?: () => void;
|
|
1107
|
-
/** Event handler for drawer expansion. */
|
|
1108
|
-
onDrawerExpand?: (e: any) => void;
|
|
1109
1089
|
/** Specifies whether to keep the drawer open. */
|
|
1110
1090
|
keepOpen: boolean;
|
|
1111
1091
|
setKeepOpen: (value: boolean) => void;
|
|
@@ -1115,18 +1095,13 @@ type AppLayoutTypes = {
|
|
|
1115
1095
|
clickedItem?: any;
|
|
1116
1096
|
/** Event handler for logo button click. */
|
|
1117
1097
|
onLogoClick?: () => void;
|
|
1118
|
-
/** Text labels for various UI elements. */
|
|
1119
|
-
texts?: {
|
|
1120
|
-
/** Label for expand sidebar button. */
|
|
1121
|
-
expandSidebar?: string;
|
|
1122
|
-
/** Label for collapse sidebar button. */
|
|
1123
|
-
collapseSidebar?: string;
|
|
1124
|
-
};
|
|
1125
1098
|
};
|
|
1126
1099
|
declare const DocsLayout: React__default.FunctionComponent<AppLayoutTypes>;
|
|
1127
1100
|
|
|
1128
1101
|
type DocsSidebarType = {
|
|
1129
|
-
|
|
1102
|
+
pages: any[];
|
|
1103
|
+
currentPage?: string;
|
|
1104
|
+
direction?: DirectionType;
|
|
1130
1105
|
};
|
|
1131
1106
|
declare const DocsSidebar: React__default.FC<DocsSidebarType>;
|
|
1132
1107
|
|
|
@@ -1660,6 +1635,8 @@ type UsageCardTypes = {
|
|
|
1660
1635
|
};
|
|
1661
1636
|
declare const Usage: FC<UsageCardTypes>;
|
|
1662
1637
|
|
|
1638
|
+
declare const useIsomorphicEffect: typeof useEffect;
|
|
1639
|
+
|
|
1663
1640
|
type ToasterToast = ToastProps & {
|
|
1664
1641
|
id: string;
|
|
1665
1642
|
title?: React$1.ReactNode;
|
|
@@ -1739,4 +1716,4 @@ declare function useTabs(initialTab?: string): {
|
|
|
1739
1716
|
handleTabChange: (index: any) => void;
|
|
1740
1717
|
};
|
|
1741
1718
|
|
|
1742
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionRoot, AccordionTrigger, ActionCard, AdCard, Alert, Announcement, AppLanding, AppLayout, AppLayoutSidebarItemProps, AppStores, AppTabs, AppTopbar, BackToTop, Badge, BadgedComponent, Breadcrumb, Button, ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CheckEmail, Checkbox, Chip, ChipColors, ChipTypes, CodeBlock, CodeConfirmation, ColorPicker, Combobox, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ComparingPlans, Copyrights, Count, DataTable, DestroyableCard, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, DocsLayout, DocsSidebar, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRoot, DropdownMenuSeparator, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, FeedbackEmoji, FeedbackForm, FeedbackRating, FileDropzone, HorizontalPricing, Input, InterfaceSettings, ItemCard, Label, LabelProps, LandingCard, LeadGenerator, LegalTexts, Loading, LoginForm, Logos, MenuItemType, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, NavMenuItem, Navbar, NavigationMenu, NavigationMenuLink, NewPasswordForm, NoPermission, NotFound, PhoneInput, PinInput, Popover, PopoverContent, PopoverTrigger, PricingCard, PricingPlans, Progress, ProgressCircle, Radio, RadioOptionsTypes, RegisterForm, ResetPasswordForm, ScrollArea, ScrollBar, ScrollIndicator, Select, SelectOptionProps, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, SidebarGroup, SidebarItem, SimpleTable, Skeleton, Slider, SortButton, SplitButton, Stats, StopPropagationWrapper, SubItem$1 as SubItem, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Testimonial, Textarea, TextareaProps, Toast$1 as Toast, ToastAction, ToastActionElement, ToastClose, ToastDescription, ToastProps, ToastProvider, ToastTitle, ToastViewport, Toaster, Tooltip, Usage, UseFocusWithinOptions, UseMediaQueryOptions, UserReferralSource, buttonVariants, reducer, toast, useBreakpoint, useClipboard, useFocusWithin, useMediaQuery, useTabs, useToast, useWindowSize };
|
|
1719
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionRoot, AccordionTrigger, ActionCard, AdCard, Alert, Announcement, AppLanding, AppLayout, AppLayoutSidebarItemProps, AppStores, AppTabs, AppTopbar, BackToTop, Badge, BadgedComponent, Breadcrumb, Button, ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CheckEmail, Checkbox, Chip, ChipColors, ChipTypes, CodeBlock, CodeConfirmation, ColorPicker, Combobox, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ComparingPlans, Copyrights, Count, DataTable, DestroyableCard, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, DocsLayout, DocsSidebar, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRoot, DropdownMenuSeparator, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, FeedbackEmoji, FeedbackForm, FeedbackRating, FileDropzone, HorizontalPricing, Input, InterfaceSettings, ItemCard, Label, LabelProps, LandingCard, LeadGenerator, LegalTexts, Loading, LoginForm, Logos, MenuItemType, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, NavMenuItem, Navbar, NavigationMenu, NavigationMenuLink, NewPasswordForm, NoPermission, NotFound, PhoneInput, PinInput, Popover, PopoverContent, PopoverTrigger, PricingCard, PricingPlans, Progress, ProgressCircle, Radio, RadioOptionsTypes, RegisterForm, ResetPasswordForm, ScrollArea, ScrollBar, ScrollIndicator, Select, SelectOptionProps, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, SidebarGroup, SidebarItem, SimpleTable, Skeleton, Slider, SortButton, SplitButton, Stats, StopPropagationWrapper, SubItem$1 as SubItem, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Testimonial, Textarea, TextareaProps, Toast$1 as Toast, ToastAction, ToastActionElement, ToastClose, ToastDescription, ToastProps, ToastProvider, ToastTitle, ToastViewport, Toaster, Tooltip, Usage, UseFocusWithinOptions, UseMediaQueryOptions, UserReferralSource, buttonVariants, reducer, toast, useBreakpoint, useClipboard, useFocusWithin, useIsomorphicEffect, useMediaQuery, useTabs, useToast, useWindowSize };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
|
-
import React__default, { FC, ReactNode, ChangeEvent, InputHTMLAttributes, PropsWithChildren, RefObject } from 'react';
|
|
2
|
+
import React__default, { FC, ReactNode, ChangeEvent, InputHTMLAttributes, PropsWithChildren, RefObject, useEffect } from 'react';
|
|
3
3
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
4
4
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
5
5
|
import { VariantProps } from 'class-variance-authority';
|
|
@@ -1023,8 +1023,8 @@ type AppTopbarType = {
|
|
|
1023
1023
|
size?: number;
|
|
1024
1024
|
username?: string;
|
|
1025
1025
|
email?: string;
|
|
1026
|
-
profileMenuItems
|
|
1027
|
-
avatarImage
|
|
1026
|
+
profileMenuItems?: MenuItemType[];
|
|
1027
|
+
avatarImage?: string;
|
|
1028
1028
|
};
|
|
1029
1029
|
declare const AppTopbar: React__default.FC<AppTopbarType>;
|
|
1030
1030
|
|
|
@@ -1066,24 +1066,17 @@ type AppTabsType = {
|
|
|
1066
1066
|
declare const AppTabs: React__default.FC<AppTabsType>;
|
|
1067
1067
|
|
|
1068
1068
|
type AppLayoutTypes = {
|
|
1069
|
+
pages?: any[];
|
|
1069
1070
|
/** The direction of the layout */
|
|
1070
1071
|
direction?: DirectionType;
|
|
1071
|
-
/** The title of the current selected page, make sure it's the same as the drawerItem slug */
|
|
1072
|
-
currentPage: string;
|
|
1073
1072
|
/** Specifies the title of the page. */
|
|
1074
1073
|
pageTitle?: string;
|
|
1075
1074
|
/** Specifies the symbol for the logo. */
|
|
1076
1075
|
logoSymbol?: any;
|
|
1077
1076
|
/** Specifies the link for the logo. */
|
|
1078
1077
|
logoLink?: string;
|
|
1079
|
-
/** Specifies the text for the logo. */
|
|
1080
|
-
logoText?: any;
|
|
1081
1078
|
/** Specifies the content to be displayed in the layout. */
|
|
1082
1079
|
children?: any;
|
|
1083
|
-
/** Specifies the username to be displayed. */
|
|
1084
|
-
username?: string;
|
|
1085
|
-
/** Specifies the user email to be displayed. */
|
|
1086
|
-
email?: string;
|
|
1087
1080
|
/** Specifies the image for the avatar. */
|
|
1088
1081
|
avatarImage?: any;
|
|
1089
1082
|
/**
|
|
@@ -1093,19 +1086,6 @@ type AppLayoutTypes = {
|
|
|
1093
1086
|
* - 'large': Large.
|
|
1094
1087
|
*/
|
|
1095
1088
|
drawerSize?: "sm" | "md" | "large";
|
|
1096
|
-
/** Specifies the menu items for the profile menu. */
|
|
1097
|
-
/**
|
|
1098
|
-
* Specifies the width of the profile menu.
|
|
1099
|
-
* - 'default': Default width.
|
|
1100
|
-
* - 'sm': Small width.
|
|
1101
|
-
* - 'lg': Large width.
|
|
1102
|
-
* - 'parent': Inherits width from parent element.
|
|
1103
|
-
*/
|
|
1104
|
-
profileMenuWidth: "default" | "sm" | "lg" | "parent";
|
|
1105
|
-
/** Event handler for settings button click. */
|
|
1106
|
-
onSettingsClick?: () => void;
|
|
1107
|
-
/** Event handler for drawer expansion. */
|
|
1108
|
-
onDrawerExpand?: (e: any) => void;
|
|
1109
1089
|
/** Specifies whether to keep the drawer open. */
|
|
1110
1090
|
keepOpen: boolean;
|
|
1111
1091
|
setKeepOpen: (value: boolean) => void;
|
|
@@ -1115,18 +1095,13 @@ type AppLayoutTypes = {
|
|
|
1115
1095
|
clickedItem?: any;
|
|
1116
1096
|
/** Event handler for logo button click. */
|
|
1117
1097
|
onLogoClick?: () => void;
|
|
1118
|
-
/** Text labels for various UI elements. */
|
|
1119
|
-
texts?: {
|
|
1120
|
-
/** Label for expand sidebar button. */
|
|
1121
|
-
expandSidebar?: string;
|
|
1122
|
-
/** Label for collapse sidebar button. */
|
|
1123
|
-
collapseSidebar?: string;
|
|
1124
|
-
};
|
|
1125
1098
|
};
|
|
1126
1099
|
declare const DocsLayout: React__default.FunctionComponent<AppLayoutTypes>;
|
|
1127
1100
|
|
|
1128
1101
|
type DocsSidebarType = {
|
|
1129
|
-
|
|
1102
|
+
pages: any[];
|
|
1103
|
+
currentPage?: string;
|
|
1104
|
+
direction?: DirectionType;
|
|
1130
1105
|
};
|
|
1131
1106
|
declare const DocsSidebar: React__default.FC<DocsSidebarType>;
|
|
1132
1107
|
|
|
@@ -1660,6 +1635,8 @@ type UsageCardTypes = {
|
|
|
1660
1635
|
};
|
|
1661
1636
|
declare const Usage: FC<UsageCardTypes>;
|
|
1662
1637
|
|
|
1638
|
+
declare const useIsomorphicEffect: typeof useEffect;
|
|
1639
|
+
|
|
1663
1640
|
type ToasterToast = ToastProps & {
|
|
1664
1641
|
id: string;
|
|
1665
1642
|
title?: React$1.ReactNode;
|
|
@@ -1739,4 +1716,4 @@ declare function useTabs(initialTab?: string): {
|
|
|
1739
1716
|
handleTabChange: (index: any) => void;
|
|
1740
1717
|
};
|
|
1741
1718
|
|
|
1742
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionRoot, AccordionTrigger, ActionCard, AdCard, Alert, Announcement, AppLanding, AppLayout, AppLayoutSidebarItemProps, AppStores, AppTabs, AppTopbar, BackToTop, Badge, BadgedComponent, Breadcrumb, Button, ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CheckEmail, Checkbox, Chip, ChipColors, ChipTypes, CodeBlock, CodeConfirmation, ColorPicker, Combobox, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ComparingPlans, Copyrights, Count, DataTable, DestroyableCard, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, DocsLayout, DocsSidebar, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRoot, DropdownMenuSeparator, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, FeedbackEmoji, FeedbackForm, FeedbackRating, FileDropzone, HorizontalPricing, Input, InterfaceSettings, ItemCard, Label, LabelProps, LandingCard, LeadGenerator, LegalTexts, Loading, LoginForm, Logos, MenuItemType, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, NavMenuItem, Navbar, NavigationMenu, NavigationMenuLink, NewPasswordForm, NoPermission, NotFound, PhoneInput, PinInput, Popover, PopoverContent, PopoverTrigger, PricingCard, PricingPlans, Progress, ProgressCircle, Radio, RadioOptionsTypes, RegisterForm, ResetPasswordForm, ScrollArea, ScrollBar, ScrollIndicator, Select, SelectOptionProps, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, SidebarGroup, SidebarItem, SimpleTable, Skeleton, Slider, SortButton, SplitButton, Stats, StopPropagationWrapper, SubItem$1 as SubItem, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Testimonial, Textarea, TextareaProps, Toast$1 as Toast, ToastAction, ToastActionElement, ToastClose, ToastDescription, ToastProps, ToastProvider, ToastTitle, ToastViewport, Toaster, Tooltip, Usage, UseFocusWithinOptions, UseMediaQueryOptions, UserReferralSource, buttonVariants, reducer, toast, useBreakpoint, useClipboard, useFocusWithin, useMediaQuery, useTabs, useToast, useWindowSize };
|
|
1719
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionRoot, AccordionTrigger, ActionCard, AdCard, Alert, Announcement, AppLanding, AppLayout, AppLayoutSidebarItemProps, AppStores, AppTabs, AppTopbar, BackToTop, Badge, BadgedComponent, Breadcrumb, Button, ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CheckEmail, Checkbox, Chip, ChipColors, ChipTypes, CodeBlock, CodeConfirmation, ColorPicker, Combobox, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ComparingPlans, Copyrights, Count, DataTable, DestroyableCard, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, DocsLayout, DocsSidebar, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRoot, DropdownMenuSeparator, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, FeedbackEmoji, FeedbackForm, FeedbackRating, FileDropzone, HorizontalPricing, Input, InterfaceSettings, ItemCard, Label, LabelProps, LandingCard, LeadGenerator, LegalTexts, Loading, LoginForm, Logos, MenuItemType, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, NavMenuItem, Navbar, NavigationMenu, NavigationMenuLink, NewPasswordForm, NoPermission, NotFound, PhoneInput, PinInput, Popover, PopoverContent, PopoverTrigger, PricingCard, PricingPlans, Progress, ProgressCircle, Radio, RadioOptionsTypes, RegisterForm, ResetPasswordForm, ScrollArea, ScrollBar, ScrollIndicator, Select, SelectOptionProps, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, SidebarGroup, SidebarItem, SimpleTable, Skeleton, Slider, SortButton, SplitButton, Stats, StopPropagationWrapper, SubItem$1 as SubItem, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Testimonial, Textarea, TextareaProps, Toast$1 as Toast, ToastAction, ToastActionElement, ToastClose, ToastDescription, ToastProps, ToastProvider, ToastTitle, ToastViewport, Toaster, Tooltip, Usage, UseFocusWithinOptions, UseMediaQueryOptions, UserReferralSource, buttonVariants, reducer, toast, useBreakpoint, useClipboard, useFocusWithin, useIsomorphicEffect, useMediaQuery, useTabs, useToast, useWindowSize };
|
package/dist/index.js
CHANGED
|
@@ -862,6 +862,9 @@ __export(components_exports, {
|
|
|
862
862
|
useFocusWithin: function() {
|
|
863
863
|
return useFocusWithin;
|
|
864
864
|
},
|
|
865
|
+
useIsomorphicEffect: function() {
|
|
866
|
+
return useIsomorphicEffect;
|
|
867
|
+
},
|
|
865
868
|
useMediaQuery: function() {
|
|
866
869
|
return useMediaQuery;
|
|
867
870
|
},
|
|
@@ -7688,43 +7691,68 @@ var useBreakpoint = function() {
|
|
|
7688
7691
|
};
|
|
7689
7692
|
// components/layout/DocsSidebar.tsx
|
|
7690
7693
|
var import_react41 = __toESM(require("react"));
|
|
7691
|
-
var DocsSidebar = function(
|
|
7692
|
-
var
|
|
7693
|
-
|
|
7694
|
-
|
|
7695
|
-
|
|
7696
|
-
|
|
7697
|
-
|
|
7698
|
-
|
|
7699
|
-
|
|
7700
|
-
|
|
7701
|
-
|
|
7702
|
-
|
|
7703
|
-
|
|
7704
|
-
|
|
7694
|
+
var DocsSidebar = function(param) {
|
|
7695
|
+
var propCurrentPage = param.currentPage, pages = param.pages, direction = param.direction;
|
|
7696
|
+
var _import_react41_default_useState = _sliced_to_array(import_react41.default.useState(pages[0]), 2), activePage = _import_react41_default_useState[0], setActivePage = _import_react41_default_useState[1];
|
|
7697
|
+
var handlePageClick = function(page, event) {
|
|
7698
|
+
event.preventDefault();
|
|
7699
|
+
setTimeout(function() {
|
|
7700
|
+
setActivePage(page);
|
|
7701
|
+
}, 50);
|
|
7702
|
+
var element = document.getElementById(page);
|
|
7703
|
+
element === null || element === void 0 ? void 0 : element.scrollIntoView({
|
|
7704
|
+
behavior: "smooth",
|
|
7705
|
+
block: "start"
|
|
7706
|
+
});
|
|
7707
|
+
};
|
|
7708
|
+
var getCurrentSection = function() {
|
|
7709
|
+
for(var i = pages.length - 1; i >= 0; i--){
|
|
7710
|
+
var page = pages[i];
|
|
7711
|
+
var element = document.getElementById(page);
|
|
7712
|
+
var rect = element === null || element === void 0 ? void 0 : element.getBoundingClientRect();
|
|
7713
|
+
if (rect) {
|
|
7714
|
+
if (rect.top < window.innerHeight && rect.bottom >= 0) {
|
|
7715
|
+
return page;
|
|
7716
|
+
}
|
|
7717
|
+
}
|
|
7718
|
+
}
|
|
7719
|
+
return pages[0];
|
|
7720
|
+
};
|
|
7721
|
+
import_react41.default.useEffect(function() {
|
|
7722
|
+
var handleScroll = function() {
|
|
7723
|
+
setActivePage(getCurrentSection());
|
|
7724
|
+
};
|
|
7725
|
+
window.addEventListener("scroll", handleScroll);
|
|
7726
|
+
return function() {
|
|
7727
|
+
window.removeEventListener("scroll", handleScroll);
|
|
7728
|
+
};
|
|
7729
|
+
}, []);
|
|
7730
|
+
var selectedStyles = {
|
|
7731
|
+
rtl: "hawa-border-r-4 hawa-border-primary hawa-border-collapse hawa-bg-gray-200",
|
|
7732
|
+
ltr: "hawa-border-l-4 hawa-border-primary hawa-border-collapse hawa-bg-gray-200"
|
|
7705
7733
|
};
|
|
7706
7734
|
return /* @__PURE__ */ import_react41.default.createElement("div", {
|
|
7707
|
-
className: "hawa-flex hawa-flex-col hawa-overflow-x-clip"
|
|
7735
|
+
className: "hawa-flex hawa-flex-col hawa-overflow-x-clip",
|
|
7736
|
+
dir: direction
|
|
7708
7737
|
}, pages.map(function(page, index) {
|
|
7709
|
-
return /* @__PURE__ */ import_react41.default.createElement("
|
|
7738
|
+
return /* @__PURE__ */ import_react41.default.createElement("div", {
|
|
7710
7739
|
key: index,
|
|
7711
|
-
className: cn("hawa-py-1 hawa-text-xs hawa-cursor-pointer hawa-whitespace-nowrap hawa-px-3 hover:hawa-bg-gray-100 hawa-transition-all",
|
|
7712
|
-
onClick: function() {
|
|
7713
|
-
return handlePageClick(page);
|
|
7740
|
+
className: cn("hawa-py-1 hawa-text-xs hawa-cursor-pointer hawa-whitespace-nowrap hawa-px-3 hover:hawa-bg-gray-100 hawa-transition-all", (propCurrentPage || activePage) === page ? selectedStyles[direction || "rtl"] : ""),
|
|
7741
|
+
onClick: function(event) {
|
|
7742
|
+
return handlePageClick(page, event);
|
|
7714
7743
|
}
|
|
7715
7744
|
}, page);
|
|
7716
7745
|
}));
|
|
7717
7746
|
};
|
|
7718
7747
|
// components/layout/DocsLayout.tsx
|
|
7719
7748
|
var DocsLayout = function(_param) {
|
|
7720
|
-
var _param_direction = _param.direction, direction = _param_direction === void 0 ? "ltr" : _param_direction, _param_drawerSize = _param.drawerSize, drawerSize = _param_drawerSize === void 0 ? "md" : _param_drawerSize,
|
|
7749
|
+
var _param_direction = _param.direction, direction = _param_direction === void 0 ? "ltr" : _param_direction, _param_drawerSize = _param.drawerSize, drawerSize = _param_drawerSize === void 0 ? "md" : _param_drawerSize, DrawerFooterActions = _param.DrawerFooterActions, clickedItem = _param.clickedItem, keepOpen = _param.keepOpen, pages = _param.pages, setKeepOpen = _param.setKeepOpen, props = _object_without_properties(_param, [
|
|
7721
7750
|
"direction",
|
|
7722
7751
|
"drawerSize",
|
|
7723
|
-
"onSettingsClick",
|
|
7724
7752
|
"DrawerFooterActions",
|
|
7725
|
-
"currentPage",
|
|
7726
7753
|
"clickedItem",
|
|
7727
7754
|
"keepOpen",
|
|
7755
|
+
"pages",
|
|
7728
7756
|
"setKeepOpen"
|
|
7729
7757
|
]);
|
|
7730
7758
|
var closeDrawerWidth = 0;
|
|
@@ -7747,7 +7775,8 @@ var DocsLayout = function(_param) {
|
|
|
7747
7775
|
if (typeof window == "undefined") {
|
|
7748
7776
|
size = 1200;
|
|
7749
7777
|
}
|
|
7750
|
-
var _ref = _sliced_to_array((0, import_react42.useState)(
|
|
7778
|
+
var _ref = _sliced_to_array((0, import_react42.useState)("Introduction"), 2), currentPage = _ref[0], setCurrentPage = _ref[1];
|
|
7779
|
+
var _ref1 = _sliced_to_array((0, import_react42.useState)(true), 2), openSideMenu = _ref1[0], setOpenSideMenu = _ref1[1];
|
|
7751
7780
|
(0, import_react42.useEffect)(function() {
|
|
7752
7781
|
var handleClickOutside = function(event) {
|
|
7753
7782
|
if (ref.current && !ref.current.contains(event.target) && !openSideMenu) {
|
|
@@ -7773,6 +7802,35 @@ var DocsLayout = function(_param) {
|
|
|
7773
7802
|
}, [
|
|
7774
7803
|
keepOpen
|
|
7775
7804
|
]);
|
|
7805
|
+
var observerRef = import_react42.default.useRef(null);
|
|
7806
|
+
var handleIntersection = function(entries) {
|
|
7807
|
+
var entry = entries.find(function(entry2) {
|
|
7808
|
+
return entry2.isIntersecting;
|
|
7809
|
+
});
|
|
7810
|
+
if (entry) {
|
|
7811
|
+
setCurrentPage(entry.target.id);
|
|
7812
|
+
}
|
|
7813
|
+
};
|
|
7814
|
+
(0, import_react42.useEffect)(function() {
|
|
7815
|
+
observerRef.current = new IntersectionObserver(handleIntersection, {
|
|
7816
|
+
threshold: 0.5
|
|
7817
|
+
});
|
|
7818
|
+
import_react42.default.Children.forEach(props.children, function(child) {
|
|
7819
|
+
if (child && child.props.id) {
|
|
7820
|
+
var element = document.getElementById(child.props.id);
|
|
7821
|
+
if (element && observerRef.current) {
|
|
7822
|
+
observerRef.current.observe(element);
|
|
7823
|
+
}
|
|
7824
|
+
}
|
|
7825
|
+
});
|
|
7826
|
+
return function() {
|
|
7827
|
+
if (observerRef.current) {
|
|
7828
|
+
observerRef.current.disconnect();
|
|
7829
|
+
}
|
|
7830
|
+
};
|
|
7831
|
+
}, [
|
|
7832
|
+
props.children
|
|
7833
|
+
]);
|
|
7776
7834
|
var drawerSizeCondition = drawerSizeStyle[openSideMenu ? "opened" : "closed"][drawerSize];
|
|
7777
7835
|
return /* @__PURE__ */ import_react42.default.createElement("div", {
|
|
7778
7836
|
className: "hawa-fixed"
|
|
@@ -7806,7 +7864,10 @@ var DocsLayout = function(_param) {
|
|
|
7806
7864
|
})))), /* @__PURE__ */ import_react42.default.createElement(SheetContent, {
|
|
7807
7865
|
side: isRTL ? "right" : "left",
|
|
7808
7866
|
className: "hawa-pt-10"
|
|
7809
|
-
},
|
|
7867
|
+
}, /* @__PURE__ */ import_react42.default.createElement(DocsSidebar, {
|
|
7868
|
+
direction: direction,
|
|
7869
|
+
pages: pages || []
|
|
7870
|
+
})))), /* @__PURE__ */ import_react42.default.createElement("div", {
|
|
7810
7871
|
className: cn("hawa-flex hawa-gap-2 dark:hawa-text-white", isRTL ? "hawa-flex-row-reverse" : "hawa-flex-row")
|
|
7811
7872
|
}, /* @__PURE__ */ import_react42.default.createElement(Button, {
|
|
7812
7873
|
variant: "ghost",
|
|
@@ -7816,7 +7877,6 @@ var DocsLayout = function(_param) {
|
|
|
7816
7877
|
})))), /* @__PURE__ */ import_react42.default.createElement("div", {
|
|
7817
7878
|
className: cn("hawa-fixed hawa-bg-primary-foreground hawa-z-40 hawa-flex hawa-flex-col hawa-justify-between hawa-overflow-x-clip hawa-transition-all", isRTL ? "hawa-right-0 hawa-top-0 hawa-h-full" : "hawa-left-0 hawa-top-0 hawa-h-full", "hawa-fixed hawa-p-0 hawa-py-2 hawa-overflow-x-clip hawa-transition-all", "hawa-top-14", openSideMenu ? "hawa-overflow-auto" : "hawa-overflow-hidden"),
|
|
7818
7879
|
style: {
|
|
7819
|
-
// height: "calc(100%)",
|
|
7820
7880
|
width: size > 600 ? openSideMenu ? "".concat(drawerSizeStyle["opened"][drawerSize], "px") : "".concat(drawerSizeStyle["closed"][drawerSize], "px") : openSideMenu ? "".concat(drawerSizeStyle["opened"][drawerSize], "px") : "0px"
|
|
7821
7881
|
},
|
|
7822
7882
|
onMouseEnter: function() {
|
|
@@ -7828,7 +7888,11 @@ var DocsLayout = function(_param) {
|
|
|
7828
7888
|
}
|
|
7829
7889
|
},
|
|
7830
7890
|
ref: ref
|
|
7831
|
-
}, /* @__PURE__ */ import_react42.default.createElement(DocsSidebar,
|
|
7891
|
+
}, /* @__PURE__ */ import_react42.default.createElement(DocsSidebar, {
|
|
7892
|
+
direction: direction,
|
|
7893
|
+
pages: pages || [],
|
|
7894
|
+
currentPage: currentPage
|
|
7895
|
+
})), /* @__PURE__ */ import_react42.default.createElement("div", {
|
|
7832
7896
|
className: "hawa-fixed hawa-overflow-y-auto hawa-transition-all ",
|
|
7833
7897
|
style: isRTL ? {
|
|
7834
7898
|
height: "calc(100% - 56px)",
|
|
@@ -7838,7 +7902,6 @@ var DocsLayout = function(_param) {
|
|
|
7838
7902
|
} : {
|
|
7839
7903
|
height: "calc(100% - 56px)",
|
|
7840
7904
|
width: "calc(100% - ".concat(drawerSizeCondition, "px)"),
|
|
7841
|
-
// width: `calc(100% - ${0}px)`,
|
|
7842
7905
|
left: "".concat(drawerSizeCondition, "px"),
|
|
7843
7906
|
right: "".concat(drawerSizeCondition, "px"),
|
|
7844
7907
|
top: "56px"
|
|
@@ -9860,20 +9923,23 @@ var Usage = function(props) {
|
|
|
9860
9923
|
value: (_props_percent = props.percent) !== null && _props_percent !== void 0 ? _props_percent : 0
|
|
9861
9924
|
}));
|
|
9862
9925
|
};
|
|
9863
|
-
// components/hooks/
|
|
9926
|
+
// components/hooks/useIsomorphicEffect.ts
|
|
9864
9927
|
var import_react67 = require("react");
|
|
9865
|
-
|
|
9928
|
+
var useIsomorphicEffect = typeof document !== "undefined" ? import_react67.useLayoutEffect : import_react67.useEffect;
|
|
9929
|
+
// components/hooks/useDiscloser.ts
|
|
9866
9930
|
var import_react68 = require("react");
|
|
9867
|
-
// components/hooks/
|
|
9931
|
+
// components/hooks/useHover.ts
|
|
9868
9932
|
var import_react69 = require("react");
|
|
9869
|
-
// components/hooks/
|
|
9933
|
+
// components/hooks/useCarousel.ts
|
|
9870
9934
|
var import_react70 = require("react");
|
|
9935
|
+
// components/hooks/useWindowSize.ts
|
|
9936
|
+
var import_react71 = require("react");
|
|
9871
9937
|
var useWindowSize = function() {
|
|
9872
|
-
var _ref = _sliced_to_array((0,
|
|
9938
|
+
var _ref = _sliced_to_array((0, import_react71.useState)({
|
|
9873
9939
|
width: void 0,
|
|
9874
9940
|
height: void 0
|
|
9875
9941
|
}), 2), windowSize = _ref[0], setWindowSize = _ref[1];
|
|
9876
|
-
(0,
|
|
9942
|
+
(0, import_react71.useEffect)(function() {
|
|
9877
9943
|
var handleResize = function handleResize() {
|
|
9878
9944
|
setWindowSize({
|
|
9879
9945
|
width: window.innerWidth,
|
|
@@ -9889,7 +9955,7 @@ var useWindowSize = function() {
|
|
|
9889
9955
|
return windowSize;
|
|
9890
9956
|
};
|
|
9891
9957
|
// components/hooks/useFocusWithin.ts
|
|
9892
|
-
var
|
|
9958
|
+
var import_react72 = require("react");
|
|
9893
9959
|
function containsRelatedTarget(event) {
|
|
9894
9960
|
if (_instanceof(event.currentTarget, HTMLElement) && _instanceof(event.relatedTarget, HTMLElement)) {
|
|
9895
9961
|
return event.currentTarget.contains(event.relatedTarget);
|
|
@@ -9898,9 +9964,9 @@ function containsRelatedTarget(event) {
|
|
|
9898
9964
|
}
|
|
9899
9965
|
function useFocusWithin() {
|
|
9900
9966
|
var _ref = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, onBlur = _ref.onBlur, onFocus = _ref.onFocus;
|
|
9901
|
-
var ref = (0,
|
|
9902
|
-
var _ref1 = _sliced_to_array((0,
|
|
9903
|
-
var focusedRef = (0,
|
|
9967
|
+
var ref = (0, import_react72.useRef)(null);
|
|
9968
|
+
var _ref1 = _sliced_to_array((0, import_react72.useState)(false), 2), focused = _ref1[0], _setFocused = _ref1[1];
|
|
9969
|
+
var focusedRef = (0, import_react72.useRef)(false);
|
|
9904
9970
|
var setFocused = function(value) {
|
|
9905
9971
|
_setFocused(value);
|
|
9906
9972
|
focusedRef.current = value;
|
|
@@ -9917,7 +9983,7 @@ function useFocusWithin() {
|
|
|
9917
9983
|
onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
|
|
9918
9984
|
}
|
|
9919
9985
|
};
|
|
9920
|
-
(0,
|
|
9986
|
+
(0, import_react72.useEffect)(function() {
|
|
9921
9987
|
if (ref.current) {
|
|
9922
9988
|
ref.current.addEventListener("focusin", handleFocusIn);
|
|
9923
9989
|
ref.current.addEventListener("focusout", handleFocusOut);
|
|
@@ -9938,7 +10004,7 @@ function useFocusWithin() {
|
|
|
9938
10004
|
};
|
|
9939
10005
|
}
|
|
9940
10006
|
// components/hooks/useMediaQuery.ts
|
|
9941
|
-
var
|
|
10007
|
+
var import_react73 = require("react");
|
|
9942
10008
|
function attachMediaListener(query, callback) {
|
|
9943
10009
|
try {
|
|
9944
10010
|
query.addEventListener("change", callback);
|
|
@@ -9965,9 +10031,9 @@ function useMediaQuery(query, initialValue) {
|
|
|
9965
10031
|
var getInitialValueInEffect = (arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
|
|
9966
10032
|
getInitialValueInEffect: true
|
|
9967
10033
|
}).getInitialValueInEffect;
|
|
9968
|
-
var _ref = _sliced_to_array((0,
|
|
9969
|
-
var queryRef = (0,
|
|
9970
|
-
(0,
|
|
10034
|
+
var _ref = _sliced_to_array((0, import_react73.useState)(getInitialValueInEffect ? initialValue : getInitialValue(query, initialValue)), 2), matches = _ref[0], setMatches = _ref[1];
|
|
10035
|
+
var queryRef = (0, import_react73.useRef)();
|
|
10036
|
+
(0, import_react73.useEffect)(function() {
|
|
9971
10037
|
if ("matchMedia" in window) {
|
|
9972
10038
|
queryRef.current = window.matchMedia(query);
|
|
9973
10039
|
setMatches(queryRef.current.matches);
|
|
@@ -9982,15 +10048,15 @@ function useMediaQuery(query, initialValue) {
|
|
|
9982
10048
|
return matches;
|
|
9983
10049
|
}
|
|
9984
10050
|
// components/hooks/useScrollPosition.ts
|
|
9985
|
-
var import_react73 = require("react");
|
|
9986
|
-
// components/hooks/useTable.ts
|
|
9987
10051
|
var import_react74 = require("react");
|
|
9988
|
-
// components/hooks/
|
|
10052
|
+
// components/hooks/useTable.ts
|
|
9989
10053
|
var import_react75 = require("react");
|
|
10054
|
+
// components/hooks/useTabs.ts
|
|
10055
|
+
var import_react76 = require("react");
|
|
9990
10056
|
function useTabs() {
|
|
9991
10057
|
var initialTab = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
|
|
9992
|
-
var _ref = _sliced_to_array((0,
|
|
9993
|
-
(0,
|
|
10058
|
+
var _ref = _sliced_to_array((0, import_react76.useState)(initialTab), 2), activeTab = _ref[0], setActiveTab = _ref[1];
|
|
10059
|
+
(0, import_react76.useEffect)(function() {
|
|
9994
10060
|
var handleHashChange = function() {
|
|
9995
10061
|
var hash = window.location.hash.substring(1);
|
|
9996
10062
|
setActiveTab(hash || initialTab);
|
|
@@ -10186,6 +10252,7 @@ function useTabs() {
|
|
|
10186
10252
|
useBreakpoint: useBreakpoint,
|
|
10187
10253
|
useClipboard: useClipboard,
|
|
10188
10254
|
useFocusWithin: useFocusWithin,
|
|
10255
|
+
useIsomorphicEffect: useIsomorphicEffect,
|
|
10189
10256
|
useMediaQuery: useMediaQuery,
|
|
10190
10257
|
useTabs: useTabs,
|
|
10191
10258
|
useToast: useToast,
|
package/dist/index.mjs
CHANGED
|
@@ -7708,41 +7708,75 @@ var useBreakpoint = () => {
|
|
|
7708
7708
|
|
|
7709
7709
|
// components/layout/DocsSidebar.tsx
|
|
7710
7710
|
import React67 from "react";
|
|
7711
|
-
var DocsSidebar = ({
|
|
7712
|
-
|
|
7713
|
-
|
|
7714
|
-
|
|
7715
|
-
|
|
7716
|
-
|
|
7717
|
-
|
|
7718
|
-
|
|
7719
|
-
|
|
7720
|
-
|
|
7721
|
-
|
|
7711
|
+
var DocsSidebar = ({
|
|
7712
|
+
currentPage: propCurrentPage,
|
|
7713
|
+
pages,
|
|
7714
|
+
direction
|
|
7715
|
+
}) => {
|
|
7716
|
+
const [activePage, setActivePage] = React67.useState(pages[0]);
|
|
7717
|
+
const handlePageClick = (page, event) => {
|
|
7718
|
+
event.preventDefault();
|
|
7719
|
+
setTimeout(() => {
|
|
7720
|
+
setActivePage(page);
|
|
7721
|
+
}, 50);
|
|
7722
|
+
const element = document.getElementById(page);
|
|
7723
|
+
element?.scrollIntoView({ behavior: "smooth", block: "start" });
|
|
7722
7724
|
};
|
|
7723
|
-
|
|
7724
|
-
|
|
7725
|
+
const getCurrentSection = () => {
|
|
7726
|
+
for (let i = pages.length - 1; i >= 0; i--) {
|
|
7727
|
+
const page = pages[i];
|
|
7728
|
+
const element = document.getElementById(page);
|
|
7729
|
+
const rect = element?.getBoundingClientRect();
|
|
7730
|
+
if (rect) {
|
|
7731
|
+
if (rect.top < window.innerHeight && rect.bottom >= 0) {
|
|
7732
|
+
return page;
|
|
7733
|
+
}
|
|
7734
|
+
}
|
|
7735
|
+
}
|
|
7736
|
+
return pages[0];
|
|
7737
|
+
};
|
|
7738
|
+
React67.useEffect(() => {
|
|
7739
|
+
const handleScroll = () => {
|
|
7740
|
+
setActivePage(getCurrentSection());
|
|
7741
|
+
};
|
|
7742
|
+
window.addEventListener("scroll", handleScroll);
|
|
7743
|
+
return () => {
|
|
7744
|
+
window.removeEventListener("scroll", handleScroll);
|
|
7745
|
+
};
|
|
7746
|
+
}, []);
|
|
7747
|
+
let selectedStyles = {
|
|
7748
|
+
rtl: "hawa-border-r-4 hawa-border-primary hawa-border-collapse hawa-bg-gray-200",
|
|
7749
|
+
ltr: "hawa-border-l-4 hawa-border-primary hawa-border-collapse hawa-bg-gray-200"
|
|
7750
|
+
};
|
|
7751
|
+
return /* @__PURE__ */ React67.createElement(
|
|
7752
|
+
"div",
|
|
7725
7753
|
{
|
|
7726
|
-
|
|
7727
|
-
|
|
7728
|
-
"hawa-py-1 hawa-text-xs hawa-cursor-pointer hawa-whitespace-nowrap hawa-px-3 hover:hawa-bg-gray-100 hawa-transition-all",
|
|
7729
|
-
currentPage === page ? "hawa-border-l-4 hawa-border-primary hawa-border-collapse" : ""
|
|
7730
|
-
),
|
|
7731
|
-
onClick: () => handlePageClick(page)
|
|
7754
|
+
className: "hawa-flex hawa-flex-col hawa-overflow-x-clip",
|
|
7755
|
+
dir: direction
|
|
7732
7756
|
},
|
|
7733
|
-
page
|
|
7734
|
-
|
|
7757
|
+
pages.map((page, index) => /* @__PURE__ */ React67.createElement(
|
|
7758
|
+
"div",
|
|
7759
|
+
{
|
|
7760
|
+
key: index,
|
|
7761
|
+
className: cn(
|
|
7762
|
+
"hawa-py-1 hawa-text-xs hawa-cursor-pointer hawa-whitespace-nowrap hawa-px-3 hover:hawa-bg-gray-100 hawa-transition-all",
|
|
7763
|
+
(propCurrentPage || activePage) === page ? selectedStyles[direction || "rtl"] : ""
|
|
7764
|
+
),
|
|
7765
|
+
onClick: (event) => handlePageClick(page, event)
|
|
7766
|
+
},
|
|
7767
|
+
page
|
|
7768
|
+
))
|
|
7769
|
+
);
|
|
7735
7770
|
};
|
|
7736
7771
|
|
|
7737
7772
|
// components/layout/DocsLayout.tsx
|
|
7738
7773
|
var DocsLayout = ({
|
|
7739
7774
|
direction = "ltr",
|
|
7740
7775
|
drawerSize = "md",
|
|
7741
|
-
onSettingsClick,
|
|
7742
7776
|
DrawerFooterActions,
|
|
7743
|
-
currentPage,
|
|
7744
7777
|
clickedItem,
|
|
7745
7778
|
keepOpen,
|
|
7779
|
+
pages,
|
|
7746
7780
|
setKeepOpen,
|
|
7747
7781
|
...props
|
|
7748
7782
|
}) => {
|
|
@@ -7766,6 +7800,7 @@ var DocsLayout = ({
|
|
|
7766
7800
|
if (typeof window == "undefined") {
|
|
7767
7801
|
size = 1200;
|
|
7768
7802
|
}
|
|
7803
|
+
const [currentPage, setCurrentPage] = useState27("Introduction");
|
|
7769
7804
|
const [openSideMenu, setOpenSideMenu] = useState27(true);
|
|
7770
7805
|
useEffect19(() => {
|
|
7771
7806
|
const handleClickOutside = (event) => {
|
|
@@ -7788,6 +7823,32 @@ var DocsLayout = ({
|
|
|
7788
7823
|
window.removeEventListener("resize", handleResize);
|
|
7789
7824
|
};
|
|
7790
7825
|
}, [keepOpen]);
|
|
7826
|
+
const observerRef = React68.useRef(null);
|
|
7827
|
+
const handleIntersection = (entries) => {
|
|
7828
|
+
const entry = entries.find((entry2) => entry2.isIntersecting);
|
|
7829
|
+
if (entry) {
|
|
7830
|
+
setCurrentPage(entry.target.id);
|
|
7831
|
+
}
|
|
7832
|
+
};
|
|
7833
|
+
useEffect19(() => {
|
|
7834
|
+
observerRef.current = new IntersectionObserver(handleIntersection, {
|
|
7835
|
+
threshold: 0.5
|
|
7836
|
+
// Adjust threshold as needed to determine when a section is in view
|
|
7837
|
+
});
|
|
7838
|
+
React68.Children.forEach(props.children, (child) => {
|
|
7839
|
+
if (child && child.props.id) {
|
|
7840
|
+
const element = document.getElementById(child.props.id);
|
|
7841
|
+
if (element && observerRef.current) {
|
|
7842
|
+
observerRef.current.observe(element);
|
|
7843
|
+
}
|
|
7844
|
+
}
|
|
7845
|
+
});
|
|
7846
|
+
return () => {
|
|
7847
|
+
if (observerRef.current) {
|
|
7848
|
+
observerRef.current.disconnect();
|
|
7849
|
+
}
|
|
7850
|
+
};
|
|
7851
|
+
}, [props.children]);
|
|
7791
7852
|
let drawerSizeCondition = drawerSizeStyle[openSideMenu ? "opened" : "closed"][drawerSize];
|
|
7792
7853
|
return /* @__PURE__ */ React68.createElement("div", { className: "hawa-fixed" }, /* @__PURE__ */ React68.createElement(
|
|
7793
7854
|
"div",
|
|
@@ -7846,8 +7907,7 @@ var DocsLayout = ({
|
|
|
7846
7907
|
side: isRTL ? "right" : "left",
|
|
7847
7908
|
className: "hawa-pt-10"
|
|
7848
7909
|
},
|
|
7849
|
-
|
|
7850
|
-
/* @__PURE__ */ React68.createElement(DocsSidebar, null)
|
|
7910
|
+
/* @__PURE__ */ React68.createElement(DocsSidebar, { direction, pages: pages || [] })
|
|
7851
7911
|
))
|
|
7852
7912
|
)
|
|
7853
7913
|
),
|
|
@@ -7872,7 +7932,6 @@ var DocsLayout = ({
|
|
|
7872
7932
|
openSideMenu ? "hawa-overflow-auto" : "hawa-overflow-hidden"
|
|
7873
7933
|
),
|
|
7874
7934
|
style: {
|
|
7875
|
-
// height: "calc(100%)",
|
|
7876
7935
|
width: size > 600 ? openSideMenu ? `${drawerSizeStyle["opened"][drawerSize]}px` : `${drawerSizeStyle["closed"][drawerSize]}px` : openSideMenu ? `${drawerSizeStyle["opened"][drawerSize]}px` : "0px"
|
|
7877
7936
|
},
|
|
7878
7937
|
onMouseEnter: () => {
|
|
@@ -7885,8 +7944,15 @@ var DocsLayout = ({
|
|
|
7885
7944
|
},
|
|
7886
7945
|
ref
|
|
7887
7946
|
},
|
|
7888
|
-
/* @__PURE__ */ React68.createElement(
|
|
7889
|
-
|
|
7947
|
+
/* @__PURE__ */ React68.createElement(
|
|
7948
|
+
DocsSidebar,
|
|
7949
|
+
{
|
|
7950
|
+
direction,
|
|
7951
|
+
pages: pages || [],
|
|
7952
|
+
currentPage
|
|
7953
|
+
}
|
|
7954
|
+
)
|
|
7955
|
+
), /* @__PURE__ */ React68.createElement(
|
|
7890
7956
|
"div",
|
|
7891
7957
|
{
|
|
7892
7958
|
className: "hawa-fixed hawa-overflow-y-auto hawa-transition-all ",
|
|
@@ -7898,7 +7964,6 @@ var DocsLayout = ({
|
|
|
7898
7964
|
} : {
|
|
7899
7965
|
height: "calc(100% - 56px)",
|
|
7900
7966
|
width: `calc(100% - ${drawerSizeCondition}px)`,
|
|
7901
|
-
// width: `calc(100% - ${0}px)`,
|
|
7902
7967
|
left: `${drawerSizeCondition}px`,
|
|
7903
7968
|
right: `${drawerSizeCondition}px`,
|
|
7904
7969
|
top: "56px"
|
|
@@ -9883,23 +9948,27 @@ var Usage = (props) => {
|
|
|
9883
9948
|
))), /* @__PURE__ */ React92.createElement("div", { className: "hawa-bg-white-100 hawa-flex hawa-flex-row" }, /* @__PURE__ */ React92.createElement("div", null, props.currentUsage), /* @__PURE__ */ React92.createElement("div", null, " (", props.percent, "%)")), /* @__PURE__ */ React92.createElement(Progress, { value: props.percent ?? 0 }));
|
|
9884
9949
|
};
|
|
9885
9950
|
|
|
9951
|
+
// components/hooks/useIsomorphicEffect.ts
|
|
9952
|
+
import { useEffect as useEffect23, useLayoutEffect } from "react";
|
|
9953
|
+
var useIsomorphicEffect = typeof document !== "undefined" ? useLayoutEffect : useEffect23;
|
|
9954
|
+
|
|
9886
9955
|
// components/hooks/useDiscloser.ts
|
|
9887
9956
|
import { useState as useState37 } from "react";
|
|
9888
9957
|
|
|
9889
9958
|
// components/hooks/useHover.ts
|
|
9890
|
-
import { useEffect as
|
|
9959
|
+
import { useEffect as useEffect24, useRef as useRef13, useState as useState38 } from "react";
|
|
9891
9960
|
|
|
9892
9961
|
// components/hooks/useCarousel.ts
|
|
9893
9962
|
import { useState as useState39, useRef as useRef14 } from "react";
|
|
9894
9963
|
|
|
9895
9964
|
// components/hooks/useWindowSize.ts
|
|
9896
|
-
import { useEffect as
|
|
9965
|
+
import { useEffect as useEffect25, useState as useState40 } from "react";
|
|
9897
9966
|
var useWindowSize = () => {
|
|
9898
9967
|
const [windowSize, setWindowSize] = useState40({
|
|
9899
9968
|
width: void 0,
|
|
9900
9969
|
height: void 0
|
|
9901
9970
|
});
|
|
9902
|
-
|
|
9971
|
+
useEffect25(() => {
|
|
9903
9972
|
function handleResize() {
|
|
9904
9973
|
setWindowSize({
|
|
9905
9974
|
width: window.innerWidth,
|
|
@@ -9914,7 +9983,7 @@ var useWindowSize = () => {
|
|
|
9914
9983
|
};
|
|
9915
9984
|
|
|
9916
9985
|
// components/hooks/useFocusWithin.ts
|
|
9917
|
-
import { useRef as useRef15, useState as useState41, useEffect as
|
|
9986
|
+
import { useRef as useRef15, useState as useState41, useEffect as useEffect26 } from "react";
|
|
9918
9987
|
function containsRelatedTarget(event) {
|
|
9919
9988
|
if (event.currentTarget instanceof HTMLElement && event.relatedTarget instanceof HTMLElement) {
|
|
9920
9989
|
return event.currentTarget.contains(event.relatedTarget);
|
|
@@ -9944,7 +10013,7 @@ function useFocusWithin({
|
|
|
9944
10013
|
onBlur?.(event);
|
|
9945
10014
|
}
|
|
9946
10015
|
};
|
|
9947
|
-
|
|
10016
|
+
useEffect26(() => {
|
|
9948
10017
|
if (ref.current) {
|
|
9949
10018
|
ref.current.addEventListener("focusin", handleFocusIn);
|
|
9950
10019
|
ref.current.addEventListener("focusout", handleFocusOut);
|
|
@@ -9959,7 +10028,7 @@ function useFocusWithin({
|
|
|
9959
10028
|
}
|
|
9960
10029
|
|
|
9961
10030
|
// components/hooks/useMediaQuery.ts
|
|
9962
|
-
import { useState as useState42, useEffect as
|
|
10031
|
+
import { useState as useState42, useEffect as useEffect27, useRef as useRef16 } from "react";
|
|
9963
10032
|
function attachMediaListener(query, callback) {
|
|
9964
10033
|
try {
|
|
9965
10034
|
query.addEventListener("change", callback);
|
|
@@ -9985,7 +10054,7 @@ function useMediaQuery(query, initialValue, { getInitialValueInEffect } = {
|
|
|
9985
10054
|
getInitialValueInEffect ? initialValue : getInitialValue(query, initialValue)
|
|
9986
10055
|
);
|
|
9987
10056
|
const queryRef = useRef16();
|
|
9988
|
-
|
|
10057
|
+
useEffect27(() => {
|
|
9989
10058
|
if ("matchMedia" in window) {
|
|
9990
10059
|
queryRef.current = window.matchMedia(query);
|
|
9991
10060
|
setMatches(queryRef.current.matches);
|
|
@@ -10000,16 +10069,16 @@ function useMediaQuery(query, initialValue, { getInitialValueInEffect } = {
|
|
|
10000
10069
|
}
|
|
10001
10070
|
|
|
10002
10071
|
// components/hooks/useScrollPosition.ts
|
|
10003
|
-
import { useState as useState43, useEffect as
|
|
10072
|
+
import { useState as useState43, useEffect as useEffect28 } from "react";
|
|
10004
10073
|
|
|
10005
10074
|
// components/hooks/useTable.ts
|
|
10006
|
-
import { useState as useState44, useEffect as
|
|
10075
|
+
import { useState as useState44, useEffect as useEffect29 } from "react";
|
|
10007
10076
|
|
|
10008
10077
|
// components/hooks/useTabs.ts
|
|
10009
|
-
import { useEffect as
|
|
10078
|
+
import { useEffect as useEffect30, useState as useState45 } from "react";
|
|
10010
10079
|
function useTabs(initialTab = "") {
|
|
10011
10080
|
const [activeTab, setActiveTab] = useState45(initialTab);
|
|
10012
|
-
|
|
10081
|
+
useEffect30(() => {
|
|
10013
10082
|
const handleHashChange = () => {
|
|
10014
10083
|
const hash = window.location.hash.substring(1);
|
|
10015
10084
|
setActiveTab(hash || initialTab);
|
|
@@ -10202,6 +10271,7 @@ export {
|
|
|
10202
10271
|
useBreakpoint,
|
|
10203
10272
|
useClipboard,
|
|
10204
10273
|
useFocusWithin,
|
|
10274
|
+
useIsomorphicEffect,
|
|
10205
10275
|
useMediaQuery,
|
|
10206
10276
|
useTabs,
|
|
10207
10277
|
useToast,
|