@sikka/hawa 0.26.27 → 0.26.29
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/tooltip/index.js +1 -0
- package/dist/tooltip/index.js.map +1 -0
- package/dist/tooltip/index.mjs +1 -0
- package/dist/tooltip/index.mjs.map +1 -0
- package/package.json +1 -1
- package/dist/Chip-H5BnuDdx.d.ts +0 -36
- package/dist/Chip-hr2gRBJ-.d.mts +0 -36
- package/dist/DropdownMenu-EUL-D3I3.d.mts +0 -95
- package/dist/DropdownMenu-SPisqCzV.d.ts +0 -95
- package/dist/Radio-K1WGpnGA.d.ts +0 -75
- package/dist/Radio-hsrLKNxE.d.mts +0 -75
- package/dist/Toast-VBd4UvlM.d.mts +0 -26
- package/dist/Toast-pOd4uGZz.d.ts +0 -26
- package/dist/accordion/index.d.mts +0 -51
- package/dist/accordion/index.d.ts +0 -51
- package/dist/accordion/index.js +0 -271
- package/dist/accordion/index.mjs +0 -227
- package/dist/alert/index.d.mts +0 -29
- package/dist/alert/index.d.ts +0 -29
- package/dist/alert/index.js +0 -442
- package/dist/alert/index.mjs +0 -402
- package/dist/appLayout/index.d.mts +0 -126
- package/dist/appLayout/index.d.ts +0 -126
- package/dist/appLayout/index.js +0 -1326
- package/dist/appLayout/index.mjs +0 -1286
- package/dist/appMenubar/index.d.mts +0 -33
- package/dist/appMenubar/index.d.ts +0 -33
- package/dist/appMenubar/index.js +0 -281
- package/dist/appMenubar/index.mjs +0 -224
- package/dist/appStores/index.d.mts +0 -8
- package/dist/appStores/index.d.ts +0 -8
- package/dist/appStores/index.js +0 -75
- package/dist/appStores/index.mjs +0 -38
- package/dist/appTabs/index.d.mts +0 -18
- package/dist/appTabs/index.d.ts +0 -18
- package/dist/appTabs/index.js +0 -92
- package/dist/appTabs/index.mjs +0 -50
- package/dist/appTopbar/index.d.mts +0 -44
- package/dist/appTopbar/index.d.ts +0 -44
- package/dist/appTopbar/index.js +0 -483
- package/dist/appTopbar/index.mjs +0 -441
- package/dist/avatar/index.d.mts +0 -16
- package/dist/avatar/index.d.ts +0 -16
- package/dist/avatar/index.js +0 -162
- package/dist/avatar/index.mjs +0 -122
- package/dist/backToTop/index.d.mts +0 -15
- package/dist/backToTop/index.d.ts +0 -15
- package/dist/backToTop/index.js +0 -398
- package/dist/backToTop/index.mjs +0 -358
- package/dist/badge/index.d.mts +0 -13
- package/dist/badge/index.d.ts +0 -13
- package/dist/badge/index.js +0 -127
- package/dist/badge/index.mjs +0 -84
- package/dist/blocks/auth/index.d.mts +0 -202
- package/dist/blocks/auth/index.d.ts +0 -202
- package/dist/blocks/auth/index.js +0 -4197
- package/dist/blocks/auth/index.mjs +0 -3389
- package/dist/blocks/feedback/index.d.mts +0 -74
- package/dist/blocks/feedback/index.d.ts +0 -74
- package/dist/blocks/feedback/index.js +0 -1544
- package/dist/blocks/feedback/index.mjs +0 -558
- package/dist/blocks/index.d.mts +0 -480
- package/dist/blocks/index.d.ts +0 -480
- package/dist/blocks/index.js +0 -6700
- package/dist/blocks/index.mjs +0 -2550
- package/dist/blocks/misc/index.d.mts +0 -90
- package/dist/blocks/misc/index.d.ts +0 -90
- package/dist/blocks/misc/index.js +0 -1186
- package/dist/blocks/misc/index.mjs +0 -387
- package/dist/blocks/pricing/index.d.mts +0 -93
- package/dist/blocks/pricing/index.d.ts +0 -93
- package/dist/blocks/pricing/index.js +0 -1528
- package/dist/blocks/pricing/index.mjs +0 -677
- package/dist/breadcrumb/index.d.mts +0 -14
- package/dist/breadcrumb/index.d.ts +0 -14
- package/dist/breadcrumb/index.js +0 -63
- package/dist/breadcrumb/index.mjs +0 -26
- package/dist/button/index.d.mts +0 -16
- package/dist/button/index.d.ts +0 -16
- package/dist/button/index.js +0 -301
- package/dist/button/index.mjs +0 -260
- package/dist/card/index.d.mts +0 -17
- package/dist/card/index.d.ts +0 -17
- package/dist/card/index.js +0 -139
- package/dist/card/index.mjs +0 -92
- package/dist/carousel/index.d.mts +0 -15
- package/dist/carousel/index.d.ts +0 -15
- package/dist/carousel/index.js +0 -193
- package/dist/carousel/index.mjs +0 -151
- package/dist/checkbox/index.d.mts +0 -20
- package/dist/checkbox/index.d.ts +0 -20
- package/dist/checkbox/index.js +0 -184
- package/dist/checkbox/index.mjs +0 -142
- package/dist/chip/index.d.mts +0 -36
- package/dist/chip/index.d.ts +0 -36
- package/dist/chip/index.js +0 -129
- package/dist/chip/index.mjs +0 -87
- package/dist/chunk-2R7F2GL7.mjs +0 -82
- package/dist/chunk-4EGKGSGY.mjs +0 -129
- package/dist/chunk-5YXZXYLH.mjs +0 -67
- package/dist/chunk-65TG6EVD.mjs +0 -264
- package/dist/chunk-D22AALLE.mjs +0 -22
- package/dist/chunk-D36MPDGE.mjs +0 -476
- package/dist/chunk-F3DQJHTG.mjs +0 -3113
- package/dist/chunk-FQ6WVEHW.mjs +0 -151
- package/dist/chunk-GVJYACGA.mjs +0 -189
- package/dist/chunk-JNUGOUYJ.mjs +0 -154
- package/dist/chunk-KMCIHW76.mjs +0 -150
- package/dist/chunk-MQUAGP7K.mjs +0 -1098
- package/dist/chunk-NMS5LCSQ.mjs +0 -195
- package/dist/chunk-OY66MBXP.mjs +0 -163
- package/dist/chunk-R4HAAT6R.mjs +0 -131
- package/dist/chunk-SJ2Z6ZOG.mjs +0 -442
- package/dist/chunk-TGZRVRLP.mjs +0 -107
- package/dist/chunk-TWNGV3RE.mjs +0 -10
- package/dist/chunk-WUHNPHD5.mjs +0 -0
- package/dist/chunk-ZFXKCRJC.mjs +0 -11
- package/dist/chunk-ZS3FB3PO.mjs +0 -12
- package/dist/codeBlock/index.d.mts +0 -24
- package/dist/codeBlock/index.d.ts +0 -24
- package/dist/codeBlock/index.js +0 -517
- package/dist/codeBlock/index.mjs +0 -432
- package/dist/collapsible/index.d.mts +0 -8
- package/dist/collapsible/index.d.ts +0 -8
- package/dist/collapsible/index.js +0 -49
- package/dist/collapsible/index.mjs +0 -12
- package/dist/colorPicker/index.d.mts +0 -34
- package/dist/colorPicker/index.d.ts +0 -34
- package/dist/colorPicker/index.js +0 -276
- package/dist/colorPicker/index.mjs +0 -170
- package/dist/combobox/index.d.mts +0 -41
- package/dist/combobox/index.d.ts +0 -41
- package/dist/combobox/index.js +0 -749
- package/dist/combobox/index.mjs +0 -295
- package/dist/command/index.d.mts +0 -48
- package/dist/command/index.d.ts +0 -48
- package/dist/command/index.js +0 -485
- package/dist/command/index.mjs +0 -22
- package/dist/commonTypes-2IGtJ5cq.d.mts +0 -3
- package/dist/commonTypes-2IGtJ5cq.d.ts +0 -3
- package/dist/commonTypes-2k6FnHw5.d.mts +0 -4
- package/dist/commonTypes-2k6FnHw5.d.ts +0 -4
- package/dist/commonTypes-3k5cNB1s.d.mts +0 -4
- package/dist/commonTypes-3k5cNB1s.d.ts +0 -4
- package/dist/commonTypes-CKtkuNFH.d.mts +0 -11
- package/dist/commonTypes-CKtkuNFH.d.ts +0 -11
- package/dist/commonTypes-GhKAraJw.d.mts +0 -4
- package/dist/commonTypes-GhKAraJw.d.ts +0 -4
- package/dist/commonTypes-MxCJyrHv.d.mts +0 -8
- package/dist/commonTypes-MxCJyrHv.d.ts +0 -8
- package/dist/commonTypes-PBumfOBg.d.mts +0 -3
- package/dist/commonTypes-PBumfOBg.d.ts +0 -3
- package/dist/commonTypes-WPhcN3Vr.d.mts +0 -5
- package/dist/commonTypes-WPhcN3Vr.d.ts +0 -5
- package/dist/commonTypes-_11epZYh.d.mts +0 -4
- package/dist/commonTypes-_11epZYh.d.ts +0 -4
- package/dist/commonTypes-ko_NGEoT.d.mts +0 -3
- package/dist/commonTypes-ko_NGEoT.d.ts +0 -3
- package/dist/copyrights/index.d.mts +0 -17
- package/dist/copyrights/index.d.ts +0 -17
- package/dist/copyrights/index.js +0 -45
- package/dist/copyrights/index.mjs +0 -8
- package/dist/count/index.d.mts +0 -11
- package/dist/count/index.d.ts +0 -11
- package/dist/count/index.js +0 -45
- package/dist/count/index.mjs +0 -8
- package/dist/dataTable/index.d.mts +0 -41
- package/dist/dataTable/index.d.ts +0 -41
- package/dist/dataTable/index.js +0 -1313
- package/dist/dataTable/index.mjs +0 -1281
- package/dist/destroyableCard/index.d.mts +0 -12
- package/dist/destroyableCard/index.d.ts +0 -12
- package/dist/destroyableCard/index.js +0 -203
- package/dist/destroyableCard/index.mjs +0 -163
- package/dist/dialog/index.d.mts +0 -57
- package/dist/dialog/index.d.ts +0 -57
- package/dist/dialog/index.js +0 -368
- package/dist/dialog/index.mjs +0 -314
- package/dist/docsLayout/index.d.mts +0 -37
- package/dist/docsLayout/index.d.ts +0 -37
- package/dist/docsLayout/index.js +0 -927
- package/dist/docsLayout/index.mjs +0 -887
- package/dist/docsSidebar/index.d.mts +0 -11
- package/dist/docsSidebar/index.d.ts +0 -11
- package/dist/docsSidebar/index.js +0 -111
- package/dist/docsSidebar/index.mjs +0 -69
- package/dist/dropdownMenu/index.d.mts +0 -96
- package/dist/dropdownMenu/index.d.ts +0 -96
- package/dist/dropdownMenu/index.js +0 -420
- package/dist/dropdownMenu/index.mjs +0 -362
- package/dist/elements/index.d.mts +0 -788
- package/dist/elements/index.d.ts +0 -788
- package/dist/elements/index.js +0 -7832
- package/dist/elements/index.mjs +0 -3415
- package/dist/fileDropzone/index.d.mts +0 -37
- package/dist/fileDropzone/index.d.ts +0 -37
- package/dist/fileDropzone/index.js +0 -665
- package/dist/fileDropzone/index.mjs +0 -625
- package/dist/fileUploader/index.d.mts +0 -5
- package/dist/fileUploader/index.d.ts +0 -5
- package/dist/fileUploader/index.js +0 -62
- package/dist/fileUploader/index.mjs +0 -25
- package/dist/glow/index.d.mts +0 -16
- package/dist/glow/index.d.ts +0 -16
- package/dist/glow/index.js +0 -155
- package/dist/glow/index.mjs +0 -117
- package/dist/hooks/index.d.mts +0 -108
- package/dist/hooks/index.d.ts +0 -108
- package/dist/hooks/index.js +0 -459
- package/dist/hooks/index.mjs +0 -255
- package/dist/index.d.mts +0 -1932
- package/dist/index.d.ts +0 -1932
- package/dist/index.js +0 -12123
- package/dist/index.mjs +0 -11908
- package/dist/input/index.d.mts +0 -43
- package/dist/input/index.d.ts +0 -43
- package/dist/input/index.js +0 -293
- package/dist/input/index.mjs +0 -158
- package/dist/interfaceSettings/index.d.mts +0 -18
- package/dist/interfaceSettings/index.d.ts +0 -18
- package/dist/interfaceSettings/index.js +0 -420
- package/dist/interfaceSettings/index.mjs +0 -283
- package/dist/label/index.d.mts +0 -13
- package/dist/label/index.d.ts +0 -13
- package/dist/label/index.js +0 -142
- package/dist/label/index.mjs +0 -102
- package/dist/layout/index.d.mts +0 -256
- package/dist/layout/index.d.ts +0 -256
- package/dist/layout/index.js +0 -2627
- package/dist/layout/index.mjs +0 -1393
- package/dist/loading/index.d.mts +0 -15
- package/dist/loading/index.d.ts +0 -15
- package/dist/loading/index.js +0 -225
- package/dist/loading/index.mjs +0 -183
- package/dist/logos/index.d.mts +0 -27
- package/dist/logos/index.d.ts +0 -27
- package/dist/logos/index.js +0 -244
- package/dist/logos/index.mjs +0 -207
- package/dist/navbar/index.d.mts +0 -17
- package/dist/navbar/index.d.ts +0 -17
- package/dist/navbar/index.js +0 -166
- package/dist/navbar/index.mjs +0 -126
- package/dist/navigationMenu/index.d.mts +0 -39
- package/dist/navigationMenu/index.d.ts +0 -39
- package/dist/navigationMenu/index.js +0 -221
- package/dist/navigationMenu/index.mjs +0 -169
- package/dist/pagination/index.d.mts +0 -11
- package/dist/pagination/index.d.ts +0 -11
- package/dist/pagination/index.js +0 -160
- package/dist/pagination/index.mjs +0 -118
- package/dist/passwordInput/index.d.mts +0 -13
- package/dist/passwordInput/index.d.ts +0 -13
- package/dist/passwordInput/index.js +0 -577
- package/dist/passwordInput/index.mjs +0 -534
- package/dist/phoneInput/index.d.mts +0 -23
- package/dist/phoneInput/index.d.ts +0 -23
- package/dist/phoneInput/index.js +0 -2085
- package/dist/phoneInput/index.mjs +0 -2045
- package/dist/pinInput/index.d.mts +0 -20
- package/dist/pinInput/index.d.ts +0 -20
- package/dist/pinInput/index.js +0 -131
- package/dist/pinInput/index.mjs +0 -89
- package/dist/popover/index.d.mts +0 -23
- package/dist/popover/index.d.ts +0 -23
- package/dist/popover/index.js +0 -112
- package/dist/popover/index.mjs +0 -68
- package/dist/progress/index.d.mts +0 -6
- package/dist/progress/index.d.ts +0 -6
- package/dist/progress/index.js +0 -71
- package/dist/progress/index.mjs +0 -29
- package/dist/progressCircle/index.d.mts +0 -16
- package/dist/progressCircle/index.d.ts +0 -16
- package/dist/progressCircle/index.js +0 -159
- package/dist/progressCircle/index.mjs +0 -117
- package/dist/radio/index.d.mts +0 -39
- package/dist/radio/index.d.ts +0 -39
- package/dist/radio/index.js +0 -331
- package/dist/radio/index.mjs +0 -291
- package/dist/scrollArea/index.d.mts +0 -10
- package/dist/scrollArea/index.d.ts +0 -10
- package/dist/scrollArea/index.js +0 -90
- package/dist/scrollArea/index.mjs +0 -47
- package/dist/scrollIndicator/index.d.mts +0 -9
- package/dist/scrollIndicator/index.d.ts +0 -9
- package/dist/scrollIndicator/index.js +0 -80
- package/dist/scrollIndicator/index.mjs +0 -43
- package/dist/select/index.d.mts +0 -50
- package/dist/select/index.d.ts +0 -50
- package/dist/select/index.js +0 -325
- package/dist/select/index.mjs +0 -285
- package/dist/separator/index.d.mts +0 -10
- package/dist/separator/index.d.ts +0 -10
- package/dist/separator/index.js +0 -66
- package/dist/separator/index.mjs +0 -24
- package/dist/sheet/index.d.mts +0 -30
- package/dist/sheet/index.d.ts +0 -30
- package/dist/sheet/index.js +0 -201
- package/dist/sheet/index.mjs +0 -150
- package/dist/sidebar/index.d.mts +0 -48
- package/dist/sidebar/index.d.ts +0 -48
- package/dist/sidebar/index.js +0 -341
- package/dist/sidebar/index.mjs +0 -298
- package/dist/signature/index.d.mts +0 -27
- package/dist/signature/index.d.ts +0 -27
- package/dist/signature/index.js +0 -261
- package/dist/signature/index.mjs +0 -219
- package/dist/simpleTable/index.d.mts +0 -30
- package/dist/simpleTable/index.d.ts +0 -30
- package/dist/simpleTable/index.js +0 -253
- package/dist/simpleTable/index.mjs +0 -217
- package/dist/skeleton/index.d.mts +0 -10
- package/dist/skeleton/index.d.ts +0 -10
- package/dist/skeleton/index.js +0 -75
- package/dist/skeleton/index.mjs +0 -33
- package/dist/slider/index.d.mts +0 -6
- package/dist/slider/index.d.ts +0 -6
- package/dist/slider/index.js +0 -66
- package/dist/slider/index.mjs +0 -24
- package/dist/sortButton/index.d.mts +0 -10
- package/dist/sortButton/index.d.ts +0 -10
- package/dist/sortButton/index.js +0 -336
- package/dist/sortButton/index.mjs +0 -42
- package/dist/splitButton/index.d.mts +0 -52
- package/dist/splitButton/index.d.ts +0 -52
- package/dist/splitButton/index.js +0 -692
- package/dist/splitButton/index.mjs +0 -400
- package/dist/stats/index.d.mts +0 -19
- package/dist/stats/index.d.ts +0 -19
- package/dist/stats/index.js +0 -191
- package/dist/stats/index.mjs +0 -154
- package/dist/stopPropagationWrapper/index.d.mts +0 -5
- package/dist/stopPropagationWrapper/index.d.ts +0 -5
- package/dist/stopPropagationWrapper/index.js +0 -48
- package/dist/stopPropagationWrapper/index.mjs +0 -11
- package/dist/switch/index.d.mts +0 -12
- package/dist/switch/index.d.ts +0 -12
- package/dist/switch/index.js +0 -125
- package/dist/switch/index.mjs +0 -83
- package/dist/table/index.d.mts +0 -21
- package/dist/table/index.d.ts +0 -21
- package/dist/table/index.js +0 -172
- package/dist/table/index.mjs +0 -123
- package/dist/tabs/index.d.mts +0 -33
- package/dist/tabs/index.d.ts +0 -33
- package/dist/tabs/index.js +0 -200
- package/dist/tabs/index.mjs +0 -157
- package/dist/textTypes-559CaoOV.d.mts +0 -88
- package/dist/textTypes-559CaoOV.d.ts +0 -88
- package/dist/textarea/index.d.mts +0 -27
- package/dist/textarea/index.d.ts +0 -27
- package/dist/textarea/index.js +0 -229
- package/dist/textarea/index.mjs +0 -189
- package/dist/toast/index.d.mts +0 -26
- package/dist/toast/index.d.ts +0 -26
- package/dist/toast/index.js +0 -197
- package/dist/toast/index.mjs +0 -19
- package/dist/toaster/index.d.mts +0 -9
- package/dist/toaster/index.d.ts +0 -9
- package/dist/toaster/index.js +0 -350
- package/dist/toaster/index.mjs +0 -181
- package/dist/types/index.d.mts +0 -115
- package/dist/types/index.d.ts +0 -115
- package/dist/types/index.js +0 -18
- package/dist/types/index.mjs +0 -0
package/dist/hooks/index.js
DELETED
@@ -1,459 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __create = Object.create;
|
3
|
-
var __defProp = Object.defineProperty;
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
8
|
-
var __export = (target, all) => {
|
9
|
-
for (var name in all)
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
11
|
-
};
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
14
|
-
for (let key of __getOwnPropNames(from))
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
17
|
-
}
|
18
|
-
return to;
|
19
|
-
};
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
26
|
-
mod
|
27
|
-
));
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
29
|
-
|
30
|
-
// hooks/index.ts
|
31
|
-
var hooks_exports = {};
|
32
|
-
__export(hooks_exports, {
|
33
|
-
reducer: () => reducer,
|
34
|
-
toast: () => toast,
|
35
|
-
useBreakpoint: () => useBreakpoint,
|
36
|
-
useClipboard: () => useClipboard,
|
37
|
-
useDialogCarousel: () => useDialogCarousel,
|
38
|
-
useFocusWithin: () => useFocusWithin,
|
39
|
-
useIsomorphicEffect: () => useIsomorphicEffect,
|
40
|
-
useMediaQuery: () => useMediaQuery,
|
41
|
-
useMultiStepDialog: () => useMultiStepDialog,
|
42
|
-
useTabs: () => useTabs,
|
43
|
-
useToast: () => useToast,
|
44
|
-
useWindowSize: () => useWindowSize
|
45
|
-
});
|
46
|
-
module.exports = __toCommonJS(hooks_exports);
|
47
|
-
|
48
|
-
// hooks/useIsomorphicEffect.ts
|
49
|
-
var import_react = require("react");
|
50
|
-
var useIsomorphicEffect = typeof document !== "undefined" ? import_react.useLayoutEffect : import_react.useEffect;
|
51
|
-
|
52
|
-
// hooks/useDiscloser.ts
|
53
|
-
var import_react2 = require("react");
|
54
|
-
|
55
|
-
// hooks/useHover.ts
|
56
|
-
var import_react3 = require("react");
|
57
|
-
|
58
|
-
// hooks/useToast.ts
|
59
|
-
var React3 = __toESM(require("react"));
|
60
|
-
var TOAST_LIMIT = 5;
|
61
|
-
var TOAST_REMOVE_DELAY = 1e5;
|
62
|
-
var count = 0;
|
63
|
-
function genId() {
|
64
|
-
count = (count + 1) % Number.MAX_VALUE;
|
65
|
-
return count.toString();
|
66
|
-
}
|
67
|
-
var toastTimeouts = /* @__PURE__ */ new Map();
|
68
|
-
var addToRemoveQueue = (toastId) => {
|
69
|
-
if (toastTimeouts.has(toastId)) {
|
70
|
-
return;
|
71
|
-
}
|
72
|
-
const timeout = setTimeout(() => {
|
73
|
-
toastTimeouts.delete(toastId);
|
74
|
-
dispatch({
|
75
|
-
type: "REMOVE_TOAST",
|
76
|
-
toastId
|
77
|
-
});
|
78
|
-
}, TOAST_REMOVE_DELAY);
|
79
|
-
toastTimeouts.set(toastId, timeout);
|
80
|
-
};
|
81
|
-
var reducer = (state, action) => {
|
82
|
-
switch (action.type) {
|
83
|
-
case "ADD_TOAST":
|
84
|
-
console.log("adding toast case");
|
85
|
-
return {
|
86
|
-
...state,
|
87
|
-
toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT)
|
88
|
-
};
|
89
|
-
case "UPDATE_TOAST":
|
90
|
-
return {
|
91
|
-
...state,
|
92
|
-
toasts: state.toasts.map(
|
93
|
-
(t) => t.id === action.toast.id ? { ...t, ...action.toast } : t
|
94
|
-
)
|
95
|
-
};
|
96
|
-
case "DISMISS_TOAST": {
|
97
|
-
const { toastId } = action;
|
98
|
-
if (toastId) {
|
99
|
-
addToRemoveQueue(toastId);
|
100
|
-
} else {
|
101
|
-
state.toasts.forEach((toast2) => {
|
102
|
-
addToRemoveQueue(toast2.id);
|
103
|
-
});
|
104
|
-
}
|
105
|
-
return {
|
106
|
-
...state,
|
107
|
-
toasts: state.toasts.map(
|
108
|
-
(t) => t.id === toastId || toastId === void 0 ? { ...t, open: false } : t
|
109
|
-
)
|
110
|
-
};
|
111
|
-
}
|
112
|
-
case "REMOVE_TOAST":
|
113
|
-
if (action.toastId === void 0) {
|
114
|
-
return { ...state, toasts: [] };
|
115
|
-
}
|
116
|
-
return {
|
117
|
-
...state,
|
118
|
-
toasts: state.toasts.filter((t) => t.id !== action.toastId)
|
119
|
-
};
|
120
|
-
}
|
121
|
-
};
|
122
|
-
var listeners = [];
|
123
|
-
var memoryState = { toasts: [] };
|
124
|
-
function dispatch(action) {
|
125
|
-
console.log("dispatching toast");
|
126
|
-
memoryState = reducer(memoryState, action);
|
127
|
-
listeners.forEach((listener) => {
|
128
|
-
console.log("mapping through listerners in dispathc");
|
129
|
-
listener(memoryState);
|
130
|
-
});
|
131
|
-
}
|
132
|
-
function toast({ ...props }) {
|
133
|
-
const id = genId();
|
134
|
-
const update = (props2) => dispatch({
|
135
|
-
type: "UPDATE_TOAST",
|
136
|
-
toast: { ...props2, id }
|
137
|
-
});
|
138
|
-
const dismiss = () => dispatch({ type: "DISMISS_TOAST", toastId: id });
|
139
|
-
dispatch({
|
140
|
-
type: "ADD_TOAST",
|
141
|
-
toast: {
|
142
|
-
...props,
|
143
|
-
id,
|
144
|
-
open: true,
|
145
|
-
onOpenChange: (open) => {
|
146
|
-
if (!open)
|
147
|
-
dismiss();
|
148
|
-
}
|
149
|
-
}
|
150
|
-
});
|
151
|
-
return {
|
152
|
-
id,
|
153
|
-
dismiss,
|
154
|
-
update
|
155
|
-
};
|
156
|
-
}
|
157
|
-
function useToast() {
|
158
|
-
const [state, setState] = React3.useState(memoryState);
|
159
|
-
React3.useEffect(() => {
|
160
|
-
console.log("useToast triggered in useEffect");
|
161
|
-
console.log("toast state", state);
|
162
|
-
console.log("listerners BEFORE", listeners);
|
163
|
-
console.log("TOAST: setState is ", setState);
|
164
|
-
listeners.push(setState);
|
165
|
-
return () => {
|
166
|
-
const index = listeners.indexOf(setState);
|
167
|
-
console.log("listerners AFTER", listeners);
|
168
|
-
if (index > -1) {
|
169
|
-
listeners.splice(index, 1);
|
170
|
-
}
|
171
|
-
};
|
172
|
-
}, [state]);
|
173
|
-
return {
|
174
|
-
...state,
|
175
|
-
toast,
|
176
|
-
dismiss: (toastId) => dispatch({ type: "DISMISS_TOAST", toastId })
|
177
|
-
};
|
178
|
-
}
|
179
|
-
|
180
|
-
// hooks/useCarousel.ts
|
181
|
-
var import_react4 = require("react");
|
182
|
-
|
183
|
-
// hooks/useDialogCarousel.ts
|
184
|
-
var import_react5 = require("react");
|
185
|
-
var import_embla_carousel_auto_height = __toESM(require("embla-carousel-auto-height"));
|
186
|
-
var import_embla_carousel_react = __toESM(require("embla-carousel-react"));
|
187
|
-
var useDialogCarousel = (options) => {
|
188
|
-
const [emblaRef, emblaApi] = (0, import_embla_carousel_react.default)(
|
189
|
-
{ loop: false, watchDrag: false, startIndex: 0, ...options },
|
190
|
-
[(0, import_embla_carousel_auto_height.default)({ destroyHeight: "fit", active: true })]
|
191
|
-
);
|
192
|
-
const [canScrollPrev, setCanScrollPrev] = (0, import_react5.useState)(false);
|
193
|
-
const checkCanScrollPrev = () => {
|
194
|
-
if (emblaApi) {
|
195
|
-
setCanScrollPrev(emblaApi.canScrollPrev());
|
196
|
-
}
|
197
|
-
};
|
198
|
-
const nextStep = () => {
|
199
|
-
if (emblaApi) {
|
200
|
-
console.log("going to NEXT \u{1F449}");
|
201
|
-
emblaApi.scrollNext();
|
202
|
-
}
|
203
|
-
};
|
204
|
-
const prevStep = () => {
|
205
|
-
if (emblaApi) {
|
206
|
-
console.log("going to BACK \u{1F448}");
|
207
|
-
emblaApi.scrollPrev();
|
208
|
-
}
|
209
|
-
};
|
210
|
-
(0, import_react5.useEffect)(() => {
|
211
|
-
checkCanScrollPrev();
|
212
|
-
emblaApi && emblaApi.on("select", checkCanScrollPrev);
|
213
|
-
return () => {
|
214
|
-
emblaApi && emblaApi.off("select", checkCanScrollPrev);
|
215
|
-
};
|
216
|
-
}, [emblaApi]);
|
217
|
-
return {
|
218
|
-
emblaRef,
|
219
|
-
emblaApi,
|
220
|
-
nextStep,
|
221
|
-
prevStep,
|
222
|
-
canScrollPrev
|
223
|
-
};
|
224
|
-
};
|
225
|
-
|
226
|
-
// hooks/useDialogSteps.ts
|
227
|
-
var import_react6 = require("react");
|
228
|
-
var useMultiStepDialog = (initialStep, stepIds, setOpenDialog) => {
|
229
|
-
const [currentStep, setCurrentStep] = (0, import_react6.useState)(initialStep);
|
230
|
-
const [dialogHeight, setDialogHeight] = (0, import_react6.useState)(null);
|
231
|
-
const visibleStepRef = (0, import_react6.useRef)(null);
|
232
|
-
(0, import_react6.useEffect)(() => {
|
233
|
-
if (visibleStepRef.current) {
|
234
|
-
setDialogHeight(visibleStepRef.current.offsetHeight);
|
235
|
-
}
|
236
|
-
}, [currentStep, setOpenDialog]);
|
237
|
-
const handleNext = () => {
|
238
|
-
const currentIndex = stepIds.indexOf(currentStep);
|
239
|
-
if (currentIndex < stepIds.length - 1) {
|
240
|
-
setTimeout(() => {
|
241
|
-
setCurrentStep(stepIds[currentIndex + 1]);
|
242
|
-
}, 100);
|
243
|
-
}
|
244
|
-
};
|
245
|
-
const handleBack = () => {
|
246
|
-
const currentIndex = stepIds.indexOf(currentStep);
|
247
|
-
if (currentIndex > 0) {
|
248
|
-
setTimeout(() => {
|
249
|
-
setCurrentStep(stepIds[currentIndex - 1]);
|
250
|
-
}, 100);
|
251
|
-
}
|
252
|
-
};
|
253
|
-
return {
|
254
|
-
currentStep,
|
255
|
-
dialogHeight,
|
256
|
-
visibleStepRef,
|
257
|
-
handleNext,
|
258
|
-
handleBack
|
259
|
-
};
|
260
|
-
};
|
261
|
-
|
262
|
-
// hooks/useClipboard.ts
|
263
|
-
var import_react7 = require("react");
|
264
|
-
function useClipboard({ timeout = 2e3 } = {}) {
|
265
|
-
const [error, setError] = (0, import_react7.useState)(null);
|
266
|
-
const [copied, setCopied] = (0, import_react7.useState)(false);
|
267
|
-
const [copyTimeout, setCopyTimeout] = (0, import_react7.useState)(null);
|
268
|
-
const handleCopyResult = (value) => {
|
269
|
-
clearTimeout(copyTimeout);
|
270
|
-
setCopyTimeout(setTimeout(() => setCopied(false), timeout));
|
271
|
-
setCopied(value);
|
272
|
-
};
|
273
|
-
const copy = (valueToCopy) => {
|
274
|
-
if ("clipboard" in navigator) {
|
275
|
-
navigator.clipboard.writeText(valueToCopy).then(() => handleCopyResult(true)).catch((err) => setError(err));
|
276
|
-
} else {
|
277
|
-
setError(new Error("useClipboard: navigator.clipboard is not supported"));
|
278
|
-
}
|
279
|
-
};
|
280
|
-
const reset = () => {
|
281
|
-
setCopied(false);
|
282
|
-
setError(null);
|
283
|
-
clearTimeout(copyTimeout);
|
284
|
-
};
|
285
|
-
return { copy, reset, error, copied };
|
286
|
-
}
|
287
|
-
|
288
|
-
// hooks/useBreakpoint.ts
|
289
|
-
var import_react8 = require("react");
|
290
|
-
var useBreakpoint = () => {
|
291
|
-
const [breakpoint, setBreakpoint] = (0, import_react8.useState)(null);
|
292
|
-
(0, import_react8.useEffect)(() => {
|
293
|
-
if (typeof window !== "undefined") {
|
294
|
-
const resize = () => {
|
295
|
-
setBreakpoint(window.innerWidth);
|
296
|
-
};
|
297
|
-
resize();
|
298
|
-
window.addEventListener("resize", resize);
|
299
|
-
return () => {
|
300
|
-
window.removeEventListener("resize", resize);
|
301
|
-
};
|
302
|
-
}
|
303
|
-
}, []);
|
304
|
-
return breakpoint;
|
305
|
-
};
|
306
|
-
|
307
|
-
// hooks/useWindowSize.ts
|
308
|
-
var import_react9 = require("react");
|
309
|
-
var useWindowSize = () => {
|
310
|
-
const [windowSize, setWindowSize] = (0, import_react9.useState)({
|
311
|
-
width: void 0,
|
312
|
-
height: void 0
|
313
|
-
});
|
314
|
-
(0, import_react9.useEffect)(() => {
|
315
|
-
function handleResize() {
|
316
|
-
setWindowSize({
|
317
|
-
width: window.innerWidth,
|
318
|
-
height: window.innerHeight
|
319
|
-
});
|
320
|
-
}
|
321
|
-
window.addEventListener("resize", handleResize);
|
322
|
-
handleResize();
|
323
|
-
return () => window.removeEventListener("resize", handleResize);
|
324
|
-
}, []);
|
325
|
-
return windowSize;
|
326
|
-
};
|
327
|
-
|
328
|
-
// hooks/useFocusWithin.ts
|
329
|
-
var import_react10 = require("react");
|
330
|
-
function containsRelatedTarget(event) {
|
331
|
-
if (event.currentTarget instanceof HTMLElement && event.relatedTarget instanceof HTMLElement) {
|
332
|
-
return event.currentTarget.contains(event.relatedTarget);
|
333
|
-
}
|
334
|
-
return false;
|
335
|
-
}
|
336
|
-
function useFocusWithin({
|
337
|
-
onBlur,
|
338
|
-
onFocus
|
339
|
-
} = {}) {
|
340
|
-
const ref = (0, import_react10.useRef)(null);
|
341
|
-
const [focused, _setFocused] = (0, import_react10.useState)(false);
|
342
|
-
const focusedRef = (0, import_react10.useRef)(false);
|
343
|
-
const setFocused = (value) => {
|
344
|
-
_setFocused(value);
|
345
|
-
focusedRef.current = value;
|
346
|
-
};
|
347
|
-
const handleFocusIn = (event) => {
|
348
|
-
if (!focusedRef.current) {
|
349
|
-
setFocused(true);
|
350
|
-
onFocus == null ? void 0 : onFocus(event);
|
351
|
-
}
|
352
|
-
};
|
353
|
-
const handleFocusOut = (event) => {
|
354
|
-
if (focusedRef.current && !containsRelatedTarget(event)) {
|
355
|
-
setFocused(false);
|
356
|
-
onBlur == null ? void 0 : onBlur(event);
|
357
|
-
}
|
358
|
-
};
|
359
|
-
(0, import_react10.useEffect)(() => {
|
360
|
-
if (ref.current) {
|
361
|
-
ref.current.addEventListener("focusin", handleFocusIn);
|
362
|
-
ref.current.addEventListener("focusout", handleFocusOut);
|
363
|
-
return () => {
|
364
|
-
var _a, _b;
|
365
|
-
(_a = ref.current) == null ? void 0 : _a.removeEventListener("focusin", handleFocusIn);
|
366
|
-
(_b = ref.current) == null ? void 0 : _b.removeEventListener("focusout", handleFocusOut);
|
367
|
-
};
|
368
|
-
}
|
369
|
-
return void 0;
|
370
|
-
}, [handleFocusIn, handleFocusOut]);
|
371
|
-
return { ref, focused };
|
372
|
-
}
|
373
|
-
|
374
|
-
// hooks/useMediaQuery.ts
|
375
|
-
var import_react11 = require("react");
|
376
|
-
function attachMediaListener(query, callback) {
|
377
|
-
try {
|
378
|
-
query.addEventListener("change", callback);
|
379
|
-
return () => query.removeEventListener("change", callback);
|
380
|
-
} catch (e) {
|
381
|
-
query.addListener(callback);
|
382
|
-
return () => query.removeListener(callback);
|
383
|
-
}
|
384
|
-
}
|
385
|
-
function getInitialValue(query, initialValue) {
|
386
|
-
if (typeof initialValue === "boolean") {
|
387
|
-
return initialValue;
|
388
|
-
}
|
389
|
-
if (typeof window !== "undefined" && "matchMedia" in window) {
|
390
|
-
return window.matchMedia(query).matches;
|
391
|
-
}
|
392
|
-
return false;
|
393
|
-
}
|
394
|
-
function useMediaQuery(query, initialValue, { getInitialValueInEffect } = {
|
395
|
-
getInitialValueInEffect: true
|
396
|
-
}) {
|
397
|
-
const [matches, setMatches] = (0, import_react11.useState)(
|
398
|
-
getInitialValueInEffect ? initialValue : getInitialValue(query, initialValue)
|
399
|
-
);
|
400
|
-
const queryRef = (0, import_react11.useRef)();
|
401
|
-
(0, import_react11.useEffect)(() => {
|
402
|
-
if ("matchMedia" in window) {
|
403
|
-
queryRef.current = window.matchMedia(query);
|
404
|
-
setMatches(queryRef.current.matches);
|
405
|
-
return attachMediaListener(
|
406
|
-
queryRef.current,
|
407
|
-
(event) => setMatches(event.matches)
|
408
|
-
);
|
409
|
-
}
|
410
|
-
return void 0;
|
411
|
-
}, [query]);
|
412
|
-
return matches;
|
413
|
-
}
|
414
|
-
|
415
|
-
// hooks/useScrollPosition.ts
|
416
|
-
var import_react12 = require("react");
|
417
|
-
|
418
|
-
// hooks/useTable.ts
|
419
|
-
var import_react13 = require("react");
|
420
|
-
|
421
|
-
// hooks/useTabs.ts
|
422
|
-
var import_react14 = require("react");
|
423
|
-
function useTabs(initialTab = "") {
|
424
|
-
const [activeTab, setActiveTab] = (0, import_react14.useState)(initialTab);
|
425
|
-
(0, import_react14.useEffect)(() => {
|
426
|
-
const handleHashChange = () => {
|
427
|
-
const hash = window.location.hash.substring(1);
|
428
|
-
setActiveTab(hash || initialTab);
|
429
|
-
};
|
430
|
-
window.addEventListener("hashchange", handleHashChange);
|
431
|
-
handleHashChange();
|
432
|
-
return () => {
|
433
|
-
window.removeEventListener("hashchange", handleHashChange);
|
434
|
-
};
|
435
|
-
}, [initialTab]);
|
436
|
-
const handleTabChange = (index) => {
|
437
|
-
setActiveTab(index);
|
438
|
-
window.location.hash = index;
|
439
|
-
};
|
440
|
-
return {
|
441
|
-
activeTab,
|
442
|
-
handleTabChange
|
443
|
-
};
|
444
|
-
}
|
445
|
-
// Annotate the CommonJS export names for ESM import in node:
|
446
|
-
0 && (module.exports = {
|
447
|
-
reducer,
|
448
|
-
toast,
|
449
|
-
useBreakpoint,
|
450
|
-
useClipboard,
|
451
|
-
useDialogCarousel,
|
452
|
-
useFocusWithin,
|
453
|
-
useIsomorphicEffect,
|
454
|
-
useMediaQuery,
|
455
|
-
useMultiStepDialog,
|
456
|
-
useTabs,
|
457
|
-
useToast,
|
458
|
-
useWindowSize
|
459
|
-
});
|
package/dist/hooks/index.mjs
DELETED
@@ -1,255 +0,0 @@
|
|
1
|
-
import {
|
2
|
-
useBreakpoint
|
3
|
-
} from "../chunk-D22AALLE.mjs";
|
4
|
-
import {
|
5
|
-
reducer,
|
6
|
-
toast,
|
7
|
-
useClipboard,
|
8
|
-
useToast
|
9
|
-
} from "../chunk-JNUGOUYJ.mjs";
|
10
|
-
import "../chunk-ZFXKCRJC.mjs";
|
11
|
-
|
12
|
-
// hooks/useIsomorphicEffect.ts
|
13
|
-
import { useEffect, useLayoutEffect } from "react";
|
14
|
-
var useIsomorphicEffect = typeof document !== "undefined" ? useLayoutEffect : useEffect;
|
15
|
-
|
16
|
-
// hooks/useDiscloser.ts
|
17
|
-
import { useState } from "react";
|
18
|
-
|
19
|
-
// hooks/useHover.ts
|
20
|
-
import { useEffect as useEffect2, useRef, useState as useState2 } from "react";
|
21
|
-
|
22
|
-
// hooks/useCarousel.ts
|
23
|
-
import { useState as useState3, useRef as useRef2 } from "react";
|
24
|
-
|
25
|
-
// hooks/useDialogCarousel.ts
|
26
|
-
import { useEffect as useEffect3, useState as useState4 } from "react";
|
27
|
-
import AutoHeight from "embla-carousel-auto-height";
|
28
|
-
import useEmblaCarousel from "embla-carousel-react";
|
29
|
-
var useDialogCarousel = (options) => {
|
30
|
-
const [emblaRef, emblaApi] = useEmblaCarousel(
|
31
|
-
{ loop: false, watchDrag: false, startIndex: 0, ...options },
|
32
|
-
[AutoHeight({ destroyHeight: "fit", active: true })]
|
33
|
-
);
|
34
|
-
const [canScrollPrev, setCanScrollPrev] = useState4(false);
|
35
|
-
const checkCanScrollPrev = () => {
|
36
|
-
if (emblaApi) {
|
37
|
-
setCanScrollPrev(emblaApi.canScrollPrev());
|
38
|
-
}
|
39
|
-
};
|
40
|
-
const nextStep = () => {
|
41
|
-
if (emblaApi) {
|
42
|
-
console.log("going to NEXT \u{1F449}");
|
43
|
-
emblaApi.scrollNext();
|
44
|
-
}
|
45
|
-
};
|
46
|
-
const prevStep = () => {
|
47
|
-
if (emblaApi) {
|
48
|
-
console.log("going to BACK \u{1F448}");
|
49
|
-
emblaApi.scrollPrev();
|
50
|
-
}
|
51
|
-
};
|
52
|
-
useEffect3(() => {
|
53
|
-
checkCanScrollPrev();
|
54
|
-
emblaApi && emblaApi.on("select", checkCanScrollPrev);
|
55
|
-
return () => {
|
56
|
-
emblaApi && emblaApi.off("select", checkCanScrollPrev);
|
57
|
-
};
|
58
|
-
}, [emblaApi]);
|
59
|
-
return {
|
60
|
-
emblaRef,
|
61
|
-
emblaApi,
|
62
|
-
nextStep,
|
63
|
-
prevStep,
|
64
|
-
canScrollPrev
|
65
|
-
};
|
66
|
-
};
|
67
|
-
|
68
|
-
// hooks/useDialogSteps.ts
|
69
|
-
import { useState as useState5, useEffect as useEffect4, useRef as useRef3 } from "react";
|
70
|
-
var useMultiStepDialog = (initialStep, stepIds, setOpenDialog) => {
|
71
|
-
const [currentStep, setCurrentStep] = useState5(initialStep);
|
72
|
-
const [dialogHeight, setDialogHeight] = useState5(null);
|
73
|
-
const visibleStepRef = useRef3(null);
|
74
|
-
useEffect4(() => {
|
75
|
-
if (visibleStepRef.current) {
|
76
|
-
setDialogHeight(visibleStepRef.current.offsetHeight);
|
77
|
-
}
|
78
|
-
}, [currentStep, setOpenDialog]);
|
79
|
-
const handleNext = () => {
|
80
|
-
const currentIndex = stepIds.indexOf(currentStep);
|
81
|
-
if (currentIndex < stepIds.length - 1) {
|
82
|
-
setTimeout(() => {
|
83
|
-
setCurrentStep(stepIds[currentIndex + 1]);
|
84
|
-
}, 100);
|
85
|
-
}
|
86
|
-
};
|
87
|
-
const handleBack = () => {
|
88
|
-
const currentIndex = stepIds.indexOf(currentStep);
|
89
|
-
if (currentIndex > 0) {
|
90
|
-
setTimeout(() => {
|
91
|
-
setCurrentStep(stepIds[currentIndex - 1]);
|
92
|
-
}, 100);
|
93
|
-
}
|
94
|
-
};
|
95
|
-
return {
|
96
|
-
currentStep,
|
97
|
-
dialogHeight,
|
98
|
-
visibleStepRef,
|
99
|
-
handleNext,
|
100
|
-
handleBack
|
101
|
-
};
|
102
|
-
};
|
103
|
-
|
104
|
-
// hooks/useWindowSize.ts
|
105
|
-
import { useEffect as useEffect5, useState as useState6 } from "react";
|
106
|
-
var useWindowSize = () => {
|
107
|
-
const [windowSize, setWindowSize] = useState6({
|
108
|
-
width: void 0,
|
109
|
-
height: void 0
|
110
|
-
});
|
111
|
-
useEffect5(() => {
|
112
|
-
function handleResize() {
|
113
|
-
setWindowSize({
|
114
|
-
width: window.innerWidth,
|
115
|
-
height: window.innerHeight
|
116
|
-
});
|
117
|
-
}
|
118
|
-
window.addEventListener("resize", handleResize);
|
119
|
-
handleResize();
|
120
|
-
return () => window.removeEventListener("resize", handleResize);
|
121
|
-
}, []);
|
122
|
-
return windowSize;
|
123
|
-
};
|
124
|
-
|
125
|
-
// hooks/useFocusWithin.ts
|
126
|
-
import { useRef as useRef4, useState as useState7, useEffect as useEffect6 } from "react";
|
127
|
-
function containsRelatedTarget(event) {
|
128
|
-
if (event.currentTarget instanceof HTMLElement && event.relatedTarget instanceof HTMLElement) {
|
129
|
-
return event.currentTarget.contains(event.relatedTarget);
|
130
|
-
}
|
131
|
-
return false;
|
132
|
-
}
|
133
|
-
function useFocusWithin({
|
134
|
-
onBlur,
|
135
|
-
onFocus
|
136
|
-
} = {}) {
|
137
|
-
const ref = useRef4(null);
|
138
|
-
const [focused, _setFocused] = useState7(false);
|
139
|
-
const focusedRef = useRef4(false);
|
140
|
-
const setFocused = (value) => {
|
141
|
-
_setFocused(value);
|
142
|
-
focusedRef.current = value;
|
143
|
-
};
|
144
|
-
const handleFocusIn = (event) => {
|
145
|
-
if (!focusedRef.current) {
|
146
|
-
setFocused(true);
|
147
|
-
onFocus == null ? void 0 : onFocus(event);
|
148
|
-
}
|
149
|
-
};
|
150
|
-
const handleFocusOut = (event) => {
|
151
|
-
if (focusedRef.current && !containsRelatedTarget(event)) {
|
152
|
-
setFocused(false);
|
153
|
-
onBlur == null ? void 0 : onBlur(event);
|
154
|
-
}
|
155
|
-
};
|
156
|
-
useEffect6(() => {
|
157
|
-
if (ref.current) {
|
158
|
-
ref.current.addEventListener("focusin", handleFocusIn);
|
159
|
-
ref.current.addEventListener("focusout", handleFocusOut);
|
160
|
-
return () => {
|
161
|
-
var _a, _b;
|
162
|
-
(_a = ref.current) == null ? void 0 : _a.removeEventListener("focusin", handleFocusIn);
|
163
|
-
(_b = ref.current) == null ? void 0 : _b.removeEventListener("focusout", handleFocusOut);
|
164
|
-
};
|
165
|
-
}
|
166
|
-
return void 0;
|
167
|
-
}, [handleFocusIn, handleFocusOut]);
|
168
|
-
return { ref, focused };
|
169
|
-
}
|
170
|
-
|
171
|
-
// hooks/useMediaQuery.ts
|
172
|
-
import { useState as useState8, useEffect as useEffect7, useRef as useRef5 } from "react";
|
173
|
-
function attachMediaListener(query, callback) {
|
174
|
-
try {
|
175
|
-
query.addEventListener("change", callback);
|
176
|
-
return () => query.removeEventListener("change", callback);
|
177
|
-
} catch (e) {
|
178
|
-
query.addListener(callback);
|
179
|
-
return () => query.removeListener(callback);
|
180
|
-
}
|
181
|
-
}
|
182
|
-
function getInitialValue(query, initialValue) {
|
183
|
-
if (typeof initialValue === "boolean") {
|
184
|
-
return initialValue;
|
185
|
-
}
|
186
|
-
if (typeof window !== "undefined" && "matchMedia" in window) {
|
187
|
-
return window.matchMedia(query).matches;
|
188
|
-
}
|
189
|
-
return false;
|
190
|
-
}
|
191
|
-
function useMediaQuery(query, initialValue, { getInitialValueInEffect } = {
|
192
|
-
getInitialValueInEffect: true
|
193
|
-
}) {
|
194
|
-
const [matches, setMatches] = useState8(
|
195
|
-
getInitialValueInEffect ? initialValue : getInitialValue(query, initialValue)
|
196
|
-
);
|
197
|
-
const queryRef = useRef5();
|
198
|
-
useEffect7(() => {
|
199
|
-
if ("matchMedia" in window) {
|
200
|
-
queryRef.current = window.matchMedia(query);
|
201
|
-
setMatches(queryRef.current.matches);
|
202
|
-
return attachMediaListener(
|
203
|
-
queryRef.current,
|
204
|
-
(event) => setMatches(event.matches)
|
205
|
-
);
|
206
|
-
}
|
207
|
-
return void 0;
|
208
|
-
}, [query]);
|
209
|
-
return matches;
|
210
|
-
}
|
211
|
-
|
212
|
-
// hooks/useScrollPosition.ts
|
213
|
-
import { useState as useState9, useEffect as useEffect8 } from "react";
|
214
|
-
|
215
|
-
// hooks/useTable.ts
|
216
|
-
import { useState as useState10, useEffect as useEffect9 } from "react";
|
217
|
-
|
218
|
-
// hooks/useTabs.ts
|
219
|
-
import { useEffect as useEffect10, useState as useState11 } from "react";
|
220
|
-
function useTabs(initialTab = "") {
|
221
|
-
const [activeTab, setActiveTab] = useState11(initialTab);
|
222
|
-
useEffect10(() => {
|
223
|
-
const handleHashChange = () => {
|
224
|
-
const hash = window.location.hash.substring(1);
|
225
|
-
setActiveTab(hash || initialTab);
|
226
|
-
};
|
227
|
-
window.addEventListener("hashchange", handleHashChange);
|
228
|
-
handleHashChange();
|
229
|
-
return () => {
|
230
|
-
window.removeEventListener("hashchange", handleHashChange);
|
231
|
-
};
|
232
|
-
}, [initialTab]);
|
233
|
-
const handleTabChange = (index) => {
|
234
|
-
setActiveTab(index);
|
235
|
-
window.location.hash = index;
|
236
|
-
};
|
237
|
-
return {
|
238
|
-
activeTab,
|
239
|
-
handleTabChange
|
240
|
-
};
|
241
|
-
}
|
242
|
-
export {
|
243
|
-
reducer,
|
244
|
-
toast,
|
245
|
-
useBreakpoint,
|
246
|
-
useClipboard,
|
247
|
-
useDialogCarousel,
|
248
|
-
useFocusWithin,
|
249
|
-
useIsomorphicEffect,
|
250
|
-
useMediaQuery,
|
251
|
-
useMultiStepDialog,
|
252
|
-
useTabs,
|
253
|
-
useToast,
|
254
|
-
useWindowSize
|
255
|
-
};
|