@sikka/hawa 0.7.13-next → 0.7.14-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.d.mts +7 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +41 -15
- package/dist/index.mjs +34 -12
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1378,6 +1378,12 @@ declare function useClipboard({ timeout }?: {
|
|
|
1378
1378
|
|
|
1379
1379
|
declare const useBreakpoint: () => number;
|
|
1380
1380
|
|
|
1381
|
+
interface WindowSize {
|
|
1382
|
+
width: number | undefined;
|
|
1383
|
+
height: number | undefined;
|
|
1384
|
+
}
|
|
1385
|
+
declare const useWindowSize: () => WindowSize;
|
|
1386
|
+
|
|
1381
1387
|
interface UseFocusWithinOptions {
|
|
1382
1388
|
onFocus?(event: FocusEvent): void;
|
|
1383
1389
|
onBlur?(event: FocusEvent): void;
|
|
@@ -1397,4 +1403,4 @@ declare function useTabs(initialTab?: string): {
|
|
|
1397
1403
|
handleTabChange: (index: any) => void;
|
|
1398
1404
|
};
|
|
1399
1405
|
|
|
1400
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActionCard, AdCard, Alert, Announcement, AppLanding, AppLayout, AppStores, BackToTop, Breadcrumb, Button, ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CheckEmail, Checkbox, Chip, CodeBlock, CodeConfirmation, ColorPicker, Combobox, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ComparingPlans, Copyrights, DataTable, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, DropdownMenu, EmptyState, FeedbackEmoji, FeedbackForm, FeedbackRating, FileDropzone, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, HorizontalPricing, Input, InterfaceSettings, Label, LeadGenerator, LegalTexts, Loading, LoginForm, Logos, MenuItemType, NavigationMenu, NewPasswordForm, NoPermission, NotFound, PhoneInput, PinInput, Popover, PopoverContent, PopoverTrigger, PricingCard, PricingPlans, Progress, Radio, RadioOptionsTypes, RegisterForm, ResetPasswordForm, ScrollArea, ScrollBar, Select, Separator, SidebarGroup, SidebarItem, SimpleTable, Skeleton, Slider, SortButton, Stats, SubItem$2 as SubItem, Switch, TChipTypes, 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, useFormField, useMediaQuery, useTabs, useToast };
|
|
1406
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActionCard, AdCard, Alert, Announcement, AppLanding, AppLayout, AppStores, BackToTop, Breadcrumb, Button, ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CheckEmail, Checkbox, Chip, CodeBlock, CodeConfirmation, ColorPicker, Combobox, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ComparingPlans, Copyrights, DataTable, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, DropdownMenu, EmptyState, FeedbackEmoji, FeedbackForm, FeedbackRating, FileDropzone, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, HorizontalPricing, Input, InterfaceSettings, Label, LeadGenerator, LegalTexts, Loading, LoginForm, Logos, MenuItemType, NavigationMenu, NewPasswordForm, NoPermission, NotFound, PhoneInput, PinInput, Popover, PopoverContent, PopoverTrigger, PricingCard, PricingPlans, Progress, Radio, RadioOptionsTypes, RegisterForm, ResetPasswordForm, ScrollArea, ScrollBar, Select, Separator, SidebarGroup, SidebarItem, SimpleTable, Skeleton, Slider, SortButton, Stats, SubItem$2 as SubItem, Switch, TChipTypes, 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, useFormField, useMediaQuery, useTabs, useToast, useWindowSize };
|
package/dist/index.d.ts
CHANGED
|
@@ -1378,6 +1378,12 @@ declare function useClipboard({ timeout }?: {
|
|
|
1378
1378
|
|
|
1379
1379
|
declare const useBreakpoint: () => number;
|
|
1380
1380
|
|
|
1381
|
+
interface WindowSize {
|
|
1382
|
+
width: number | undefined;
|
|
1383
|
+
height: number | undefined;
|
|
1384
|
+
}
|
|
1385
|
+
declare const useWindowSize: () => WindowSize;
|
|
1386
|
+
|
|
1381
1387
|
interface UseFocusWithinOptions {
|
|
1382
1388
|
onFocus?(event: FocusEvent): void;
|
|
1383
1389
|
onBlur?(event: FocusEvent): void;
|
|
@@ -1397,4 +1403,4 @@ declare function useTabs(initialTab?: string): {
|
|
|
1397
1403
|
handleTabChange: (index: any) => void;
|
|
1398
1404
|
};
|
|
1399
1405
|
|
|
1400
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActionCard, AdCard, Alert, Announcement, AppLanding, AppLayout, AppStores, BackToTop, Breadcrumb, Button, ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CheckEmail, Checkbox, Chip, CodeBlock, CodeConfirmation, ColorPicker, Combobox, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ComparingPlans, Copyrights, DataTable, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, DropdownMenu, EmptyState, FeedbackEmoji, FeedbackForm, FeedbackRating, FileDropzone, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, HorizontalPricing, Input, InterfaceSettings, Label, LeadGenerator, LegalTexts, Loading, LoginForm, Logos, MenuItemType, NavigationMenu, NewPasswordForm, NoPermission, NotFound, PhoneInput, PinInput, Popover, PopoverContent, PopoverTrigger, PricingCard, PricingPlans, Progress, Radio, RadioOptionsTypes, RegisterForm, ResetPasswordForm, ScrollArea, ScrollBar, Select, Separator, SidebarGroup, SidebarItem, SimpleTable, Skeleton, Slider, SortButton, Stats, SubItem$2 as SubItem, Switch, TChipTypes, 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, useFormField, useMediaQuery, useTabs, useToast };
|
|
1406
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActionCard, AdCard, Alert, Announcement, AppLanding, AppLayout, AppStores, BackToTop, Breadcrumb, Button, ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CheckEmail, Checkbox, Chip, CodeBlock, CodeConfirmation, ColorPicker, Combobox, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ComparingPlans, Copyrights, DataTable, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, DropdownMenu, EmptyState, FeedbackEmoji, FeedbackForm, FeedbackRating, FileDropzone, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, HorizontalPricing, Input, InterfaceSettings, Label, LeadGenerator, LegalTexts, Loading, LoginForm, Logos, MenuItemType, NavigationMenu, NewPasswordForm, NoPermission, NotFound, PhoneInput, PinInput, Popover, PopoverContent, PopoverTrigger, PricingCard, PricingPlans, Progress, Radio, RadioOptionsTypes, RegisterForm, ResetPasswordForm, ScrollArea, ScrollBar, Select, Separator, SidebarGroup, SidebarItem, SimpleTable, Skeleton, Slider, SortButton, Stats, SubItem$2 as SubItem, Switch, TChipTypes, 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, useFormField, useMediaQuery, useTabs, useToast, useWindowSize };
|
package/dist/index.js
CHANGED
|
@@ -735,6 +735,9 @@ __export(components_exports, {
|
|
|
735
735
|
},
|
|
736
736
|
useToast: function() {
|
|
737
737
|
return useToast;
|
|
738
|
+
},
|
|
739
|
+
useWindowSize: function() {
|
|
740
|
+
return useWindowSize;
|
|
738
741
|
}
|
|
739
742
|
});
|
|
740
743
|
module.exports = __toCommonJS(components_exports);
|
|
@@ -8354,8 +8357,30 @@ var import_react55 = require("react");
|
|
|
8354
8357
|
var import_react56 = require("react");
|
|
8355
8358
|
// components/hooks/useCarousel.ts
|
|
8356
8359
|
var import_react57 = require("react");
|
|
8357
|
-
// components/hooks/
|
|
8360
|
+
// components/hooks/useWindowSize.ts
|
|
8358
8361
|
var import_react58 = require("react");
|
|
8362
|
+
var useWindowSize = function() {
|
|
8363
|
+
var _ref = _sliced_to_array((0, import_react58.useState)({
|
|
8364
|
+
width: void 0,
|
|
8365
|
+
height: void 0
|
|
8366
|
+
}), 2), windowSize = _ref[0], setWindowSize = _ref[1];
|
|
8367
|
+
(0, import_react58.useEffect)(function() {
|
|
8368
|
+
var handleResize = function handleResize() {
|
|
8369
|
+
setWindowSize({
|
|
8370
|
+
width: window.innerWidth,
|
|
8371
|
+
height: window.innerHeight
|
|
8372
|
+
});
|
|
8373
|
+
};
|
|
8374
|
+
window.addEventListener("resize", handleResize);
|
|
8375
|
+
handleResize();
|
|
8376
|
+
return function() {
|
|
8377
|
+
return window.removeEventListener("resize", handleResize);
|
|
8378
|
+
};
|
|
8379
|
+
}, []);
|
|
8380
|
+
return windowSize;
|
|
8381
|
+
};
|
|
8382
|
+
// components/hooks/useFocusWithin.ts
|
|
8383
|
+
var import_react59 = require("react");
|
|
8359
8384
|
function containsRelatedTarget(event) {
|
|
8360
8385
|
if (_instanceof(event.currentTarget, HTMLElement) && _instanceof(event.relatedTarget, HTMLElement)) {
|
|
8361
8386
|
return event.currentTarget.contains(event.relatedTarget);
|
|
@@ -8364,9 +8389,9 @@ function containsRelatedTarget(event) {
|
|
|
8364
8389
|
}
|
|
8365
8390
|
function useFocusWithin() {
|
|
8366
8391
|
var _ref = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, onBlur = _ref.onBlur, onFocus = _ref.onFocus;
|
|
8367
|
-
var ref = (0,
|
|
8368
|
-
var _ref1 = _sliced_to_array((0,
|
|
8369
|
-
var focusedRef = (0,
|
|
8392
|
+
var ref = (0, import_react59.useRef)(null);
|
|
8393
|
+
var _ref1 = _sliced_to_array((0, import_react59.useState)(false), 2), focused = _ref1[0], _setFocused = _ref1[1];
|
|
8394
|
+
var focusedRef = (0, import_react59.useRef)(false);
|
|
8370
8395
|
var setFocused = function(value) {
|
|
8371
8396
|
_setFocused(value);
|
|
8372
8397
|
focusedRef.current = value;
|
|
@@ -8383,7 +8408,7 @@ function useFocusWithin() {
|
|
|
8383
8408
|
onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
|
|
8384
8409
|
}
|
|
8385
8410
|
};
|
|
8386
|
-
(0,
|
|
8411
|
+
(0, import_react59.useEffect)(function() {
|
|
8387
8412
|
if (ref.current) {
|
|
8388
8413
|
ref.current.addEventListener("focusin", handleFocusIn);
|
|
8389
8414
|
ref.current.addEventListener("focusout", handleFocusOut);
|
|
@@ -8404,7 +8429,7 @@ function useFocusWithin() {
|
|
|
8404
8429
|
};
|
|
8405
8430
|
}
|
|
8406
8431
|
// components/hooks/useMediaQuery.ts
|
|
8407
|
-
var
|
|
8432
|
+
var import_react60 = require("react");
|
|
8408
8433
|
function attachMediaListener(query, callback) {
|
|
8409
8434
|
try {
|
|
8410
8435
|
query.addEventListener("change", callback);
|
|
@@ -8431,9 +8456,9 @@ function useMediaQuery(query, initialValue) {
|
|
|
8431
8456
|
var getInitialValueInEffect = (arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
|
|
8432
8457
|
getInitialValueInEffect: true
|
|
8433
8458
|
}).getInitialValueInEffect;
|
|
8434
|
-
var _ref = _sliced_to_array((0,
|
|
8435
|
-
var queryRef = (0,
|
|
8436
|
-
(0,
|
|
8459
|
+
var _ref = _sliced_to_array((0, import_react60.useState)(getInitialValueInEffect ? initialValue : getInitialValue(query, initialValue)), 2), matches = _ref[0], setMatches = _ref[1];
|
|
8460
|
+
var queryRef = (0, import_react60.useRef)();
|
|
8461
|
+
(0, import_react60.useEffect)(function() {
|
|
8437
8462
|
if ("matchMedia" in window) {
|
|
8438
8463
|
queryRef.current = window.matchMedia(query);
|
|
8439
8464
|
setMatches(queryRef.current.matches);
|
|
@@ -8448,15 +8473,15 @@ function useMediaQuery(query, initialValue) {
|
|
|
8448
8473
|
return matches;
|
|
8449
8474
|
}
|
|
8450
8475
|
// components/hooks/useScrollPosition.ts
|
|
8451
|
-
var import_react60 = require("react");
|
|
8452
|
-
// components/hooks/useTable.ts
|
|
8453
8476
|
var import_react61 = require("react");
|
|
8454
|
-
// components/hooks/
|
|
8477
|
+
// components/hooks/useTable.ts
|
|
8455
8478
|
var import_react62 = require("react");
|
|
8479
|
+
// components/hooks/useTabs.ts
|
|
8480
|
+
var import_react63 = require("react");
|
|
8456
8481
|
function useTabs() {
|
|
8457
8482
|
var initialTab = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
|
|
8458
|
-
var _ref = _sliced_to_array((0,
|
|
8459
|
-
(0,
|
|
8483
|
+
var _ref = _sliced_to_array((0, import_react63.useState)(initialTab), 2), activeTab = _ref[0], setActiveTab = _ref[1];
|
|
8484
|
+
(0, import_react63.useEffect)(function() {
|
|
8460
8485
|
var handleHashChange = function() {
|
|
8461
8486
|
var hash = window.location.hash.substring(1);
|
|
8462
8487
|
setActiveTab(hash || initialTab);
|
|
@@ -8609,5 +8634,6 @@ function useTabs() {
|
|
|
8609
8634
|
useFormField: useFormField,
|
|
8610
8635
|
useMediaQuery: useMediaQuery,
|
|
8611
8636
|
useTabs: useTabs,
|
|
8612
|
-
useToast: useToast
|
|
8637
|
+
useToast: useToast,
|
|
8638
|
+
useWindowSize: useWindowSize
|
|
8613
8639
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -8160,8 +8160,29 @@ import { useEffect as useEffect14, useRef as useRef9, useState as useState28 } f
|
|
|
8160
8160
|
// components/hooks/useCarousel.ts
|
|
8161
8161
|
import { useState as useState29, useRef as useRef10 } from "react";
|
|
8162
8162
|
|
|
8163
|
+
// components/hooks/useWindowSize.ts
|
|
8164
|
+
import { useEffect as useEffect15, useState as useState30 } from "react";
|
|
8165
|
+
var useWindowSize = () => {
|
|
8166
|
+
const [windowSize, setWindowSize] = useState30({
|
|
8167
|
+
width: void 0,
|
|
8168
|
+
height: void 0
|
|
8169
|
+
});
|
|
8170
|
+
useEffect15(() => {
|
|
8171
|
+
function handleResize() {
|
|
8172
|
+
setWindowSize({
|
|
8173
|
+
width: window.innerWidth,
|
|
8174
|
+
height: window.innerHeight
|
|
8175
|
+
});
|
|
8176
|
+
}
|
|
8177
|
+
window.addEventListener("resize", handleResize);
|
|
8178
|
+
handleResize();
|
|
8179
|
+
return () => window.removeEventListener("resize", handleResize);
|
|
8180
|
+
}, []);
|
|
8181
|
+
return windowSize;
|
|
8182
|
+
};
|
|
8183
|
+
|
|
8163
8184
|
// components/hooks/useFocusWithin.ts
|
|
8164
|
-
import { useRef as useRef11, useState as
|
|
8185
|
+
import { useRef as useRef11, useState as useState31, useEffect as useEffect16 } from "react";
|
|
8165
8186
|
function containsRelatedTarget(event) {
|
|
8166
8187
|
if (event.currentTarget instanceof HTMLElement && event.relatedTarget instanceof HTMLElement) {
|
|
8167
8188
|
return event.currentTarget.contains(event.relatedTarget);
|
|
@@ -8173,7 +8194,7 @@ function useFocusWithin({
|
|
|
8173
8194
|
onFocus
|
|
8174
8195
|
} = {}) {
|
|
8175
8196
|
const ref = useRef11(null);
|
|
8176
|
-
const [focused, _setFocused] =
|
|
8197
|
+
const [focused, _setFocused] = useState31(false);
|
|
8177
8198
|
const focusedRef = useRef11(false);
|
|
8178
8199
|
const setFocused = (value) => {
|
|
8179
8200
|
_setFocused(value);
|
|
@@ -8191,7 +8212,7 @@ function useFocusWithin({
|
|
|
8191
8212
|
onBlur?.(event);
|
|
8192
8213
|
}
|
|
8193
8214
|
};
|
|
8194
|
-
|
|
8215
|
+
useEffect16(() => {
|
|
8195
8216
|
if (ref.current) {
|
|
8196
8217
|
ref.current.addEventListener("focusin", handleFocusIn);
|
|
8197
8218
|
ref.current.addEventListener("focusout", handleFocusOut);
|
|
@@ -8206,7 +8227,7 @@ function useFocusWithin({
|
|
|
8206
8227
|
}
|
|
8207
8228
|
|
|
8208
8229
|
// components/hooks/useMediaQuery.ts
|
|
8209
|
-
import { useState as
|
|
8230
|
+
import { useState as useState32, useEffect as useEffect17, useRef as useRef12 } from "react";
|
|
8210
8231
|
function attachMediaListener(query, callback) {
|
|
8211
8232
|
try {
|
|
8212
8233
|
query.addEventListener("change", callback);
|
|
@@ -8228,11 +8249,11 @@ function getInitialValue(query, initialValue) {
|
|
|
8228
8249
|
function useMediaQuery(query, initialValue, { getInitialValueInEffect } = {
|
|
8229
8250
|
getInitialValueInEffect: true
|
|
8230
8251
|
}) {
|
|
8231
|
-
const [matches, setMatches] =
|
|
8252
|
+
const [matches, setMatches] = useState32(
|
|
8232
8253
|
getInitialValueInEffect ? initialValue : getInitialValue(query, initialValue)
|
|
8233
8254
|
);
|
|
8234
8255
|
const queryRef = useRef12();
|
|
8235
|
-
|
|
8256
|
+
useEffect17(() => {
|
|
8236
8257
|
if ("matchMedia" in window) {
|
|
8237
8258
|
queryRef.current = window.matchMedia(query);
|
|
8238
8259
|
setMatches(queryRef.current.matches);
|
|
@@ -8247,16 +8268,16 @@ function useMediaQuery(query, initialValue, { getInitialValueInEffect } = {
|
|
|
8247
8268
|
}
|
|
8248
8269
|
|
|
8249
8270
|
// components/hooks/useScrollPosition.ts
|
|
8250
|
-
import { useState as
|
|
8271
|
+
import { useState as useState33, useEffect as useEffect18 } from "react";
|
|
8251
8272
|
|
|
8252
8273
|
// components/hooks/useTable.ts
|
|
8253
|
-
import { useState as
|
|
8274
|
+
import { useState as useState34, useEffect as useEffect19 } from "react";
|
|
8254
8275
|
|
|
8255
8276
|
// components/hooks/useTabs.ts
|
|
8256
|
-
import { useEffect as
|
|
8277
|
+
import { useEffect as useEffect20, useState as useState35 } from "react";
|
|
8257
8278
|
function useTabs(initialTab = "") {
|
|
8258
|
-
const [activeTab, setActiveTab] =
|
|
8259
|
-
|
|
8279
|
+
const [activeTab, setActiveTab] = useState35(initialTab);
|
|
8280
|
+
useEffect20(() => {
|
|
8260
8281
|
const handleHashChange = () => {
|
|
8261
8282
|
const hash = window.location.hash.substring(1);
|
|
8262
8283
|
setActiveTab(hash || initialTab);
|
|
@@ -8406,5 +8427,6 @@ export {
|
|
|
8406
8427
|
useFormField,
|
|
8407
8428
|
useMediaQuery,
|
|
8408
8429
|
useTabs,
|
|
8409
|
-
useToast
|
|
8430
|
+
useToast,
|
|
8431
|
+
useWindowSize
|
|
8410
8432
|
};
|