@intlayer/design-system 5.3.13 → 5.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/dist/.vite/manifest.json +74 -60
  2. package/dist/components/Button/Button.d.ts +2 -2
  3. package/dist/components/ClickOutsideDiv/index.cjs +1 -1
  4. package/dist/components/ClickOutsideDiv/index.cjs.map +1 -1
  5. package/dist/components/ClickOutsideDiv/index.d.ts +1 -1
  6. package/dist/components/ClickOutsideDiv/index.d.ts.map +1 -1
  7. package/dist/components/ClickOutsideDiv/index.mjs +1 -1
  8. package/dist/components/ClickOutsideDiv/index.mjs.map +1 -1
  9. package/dist/components/Container/index.d.ts +2 -2
  10. package/dist/components/DropDown/index.cjs +16 -0
  11. package/dist/components/DropDown/index.cjs.map +1 -1
  12. package/dist/components/DropDown/index.d.ts.map +1 -1
  13. package/dist/components/DropDown/index.mjs +16 -0
  14. package/dist/components/DropDown/index.mjs.map +1 -1
  15. package/dist/components/Headers/SectionScroller.cjs +1 -1
  16. package/dist/components/Headers/SectionScroller.cjs.map +1 -1
  17. package/dist/components/Headers/SectionScroller.mjs +1 -1
  18. package/dist/components/Headers/SectionScroller.mjs.map +1 -1
  19. package/dist/components/HeightResizer/index.cjs +96 -0
  20. package/dist/components/HeightResizer/index.cjs.map +1 -0
  21. package/dist/components/HeightResizer/index.d.ts +9 -0
  22. package/dist/components/HeightResizer/index.d.ts.map +1 -0
  23. package/dist/components/HeightResizer/index.mjs +96 -0
  24. package/dist/components/HeightResizer/index.mjs.map +1 -0
  25. package/dist/components/Input/Checkbox.d.ts +1 -1
  26. package/dist/components/Link/Link.d.ts +1 -1
  27. package/dist/components/Navbar/useNavigation.cjs +1 -1
  28. package/dist/components/Navbar/useNavigation.cjs.map +1 -1
  29. package/dist/components/Navbar/useNavigation.mjs +1 -1
  30. package/dist/components/Navbar/useNavigation.mjs.map +1 -1
  31. package/dist/components/PressableSpan/PressableSpan.cjs.map +1 -1
  32. package/dist/components/PressableSpan/PressableSpan.d.ts.map +1 -1
  33. package/dist/components/PressableSpan/PressableSpan.mjs.map +1 -1
  34. package/dist/components/RightDrawer/RightDrawer.cjs.map +1 -1
  35. package/dist/components/RightDrawer/RightDrawer.d.ts +1 -1
  36. package/dist/components/RightDrawer/RightDrawer.d.ts.map +1 -1
  37. package/dist/components/RightDrawer/RightDrawer.mjs.map +1 -1
  38. package/dist/components/Tag/index.d.ts +1 -1
  39. package/dist/components/TextArea/AutoSizeTextArea.cjs +8 -11
  40. package/dist/components/TextArea/AutoSizeTextArea.cjs.map +1 -1
  41. package/dist/components/TextArea/AutoSizeTextArea.d.ts.map +1 -1
  42. package/dist/components/TextArea/AutoSizeTextArea.mjs +9 -12
  43. package/dist/components/TextArea/AutoSizeTextArea.mjs.map +1 -1
  44. package/dist/components/WithResizer/index.cjs +2 -2
  45. package/dist/components/WithResizer/index.cjs.map +1 -1
  46. package/dist/components/WithResizer/index.d.ts +1 -1
  47. package/dist/components/WithResizer/index.d.ts.map +1 -1
  48. package/dist/components/WithResizer/index.mjs +2 -2
  49. package/dist/components/WithResizer/index.mjs.map +1 -1
  50. package/dist/components/index.cjs +137 -135
  51. package/dist/components/index.cjs.map +1 -1
  52. package/dist/components/index.d.ts +37 -36
  53. package/dist/components/index.d.ts.map +1 -1
  54. package/dist/components/index.mjs +62 -60
  55. package/dist/components/index.mjs.map +1 -1
  56. package/dist/hooks/index.cjs +5 -0
  57. package/dist/hooks/index.cjs.map +1 -1
  58. package/dist/hooks/index.mjs +6 -1
  59. package/dist/hooks/intlayerAPIHooks.cjs +1 -1
  60. package/dist/hooks/intlayerAPIHooks.cjs.map +1 -1
  61. package/dist/hooks/intlayerAPIHooks.d.ts +1 -1
  62. package/dist/hooks/intlayerAPIHooks.d.ts.map +1 -1
  63. package/dist/hooks/intlayerAPIHooks.mjs +1 -1
  64. package/dist/hooks/intlayerAPIHooks.mjs.map +1 -1
  65. package/dist/hooks/useAsync/useAsync.cjs +1 -0
  66. package/dist/hooks/useAsync/useAsync.cjs.map +1 -1
  67. package/dist/hooks/useAsync/useAsync.d.ts.map +1 -1
  68. package/dist/hooks/useAsync/useAsync.mjs +1 -0
  69. package/dist/hooks/useAsync/useAsync.mjs.map +1 -1
  70. package/dist/hooks/useDevice.cjs +15 -2
  71. package/dist/hooks/useDevice.cjs.map +1 -1
  72. package/dist/hooks/useDevice.d.ts +9 -0
  73. package/dist/hooks/useDevice.d.ts.map +1 -1
  74. package/dist/hooks/useDevice.mjs +15 -2
  75. package/dist/hooks/useDevice.mjs.map +1 -1
  76. package/dist/hooks/useIntlayerAPI.d.ts +1 -1
  77. package/dist/hooks/useIntlayerAPI.d.ts.map +1 -1
  78. package/dist/hooks/useItemSelector.cjs +6 -2
  79. package/dist/hooks/useItemSelector.cjs.map +1 -1
  80. package/dist/hooks/useItemSelector.d.ts.map +1 -1
  81. package/dist/hooks/useItemSelector.mjs +6 -2
  82. package/dist/hooks/useItemSelector.mjs.map +1 -1
  83. package/dist/hooks/useKeyboardDetector.cjs +3 -1
  84. package/dist/hooks/useKeyboardDetector.cjs.map +1 -1
  85. package/dist/hooks/useKeyboardDetector.d.ts.map +1 -1
  86. package/dist/hooks/useKeyboardDetector.mjs +3 -1
  87. package/dist/hooks/useKeyboardDetector.mjs.map +1 -1
  88. package/dist/hooks/usePersistedStore.cjs +10 -1
  89. package/dist/hooks/usePersistedStore.cjs.map +1 -1
  90. package/dist/hooks/usePersistedStore.d.ts +2 -2
  91. package/dist/hooks/usePersistedStore.d.ts.map +1 -1
  92. package/dist/hooks/usePersistedStore.mjs +10 -1
  93. package/dist/hooks/usePersistedStore.mjs.map +1 -1
  94. package/dist/hooks/useScrollDetection.cjs +4 -2
  95. package/dist/hooks/useScrollDetection.cjs.map +1 -1
  96. package/dist/hooks/useScrollDetection.d.ts.map +1 -1
  97. package/dist/hooks/useScrollDetection.mjs +4 -2
  98. package/dist/hooks/useScrollDetection.mjs.map +1 -1
  99. package/dist/tailwind.css +1 -1
  100. package/package.json +19 -19
@@ -1220,6 +1220,10 @@
1220
1220
  "src": "src/components/DropDown/index.tsx",
1221
1221
  "isEntry": true,
1222
1222
  "imports": [
1223
+ "src/hooks/useDevice.ts",
1224
+ "src/hooks/useScrollBlockage/useScrollBlockageStore.ts",
1225
+ "src/hooks/useAsync/useAsyncStateStore.tsx",
1226
+ "src/components/Toaster/Toast.tsx",
1223
1227
  "src/utils/cn.ts",
1224
1228
  "src/components/MaxHeightSmoother/index.tsx"
1225
1229
  ]
@@ -1572,6 +1576,15 @@
1572
1576
  "src/utils/cn.ts"
1573
1577
  ]
1574
1578
  },
1579
+ "src/components/HeightResizer/index.tsx": {
1580
+ "file": "components/HeightResizer/index.cjs",
1581
+ "name": "components/HeightResizer/index",
1582
+ "src": "src/components/HeightResizer/index.tsx",
1583
+ "isEntry": true,
1584
+ "imports": [
1585
+ "src/utils/cn.ts"
1586
+ ]
1587
+ },
1575
1588
  "src/components/IDE/Code.tsx": {
1576
1589
  "file": "components/IDE/Code.cjs",
1577
1590
  "name": "components/IDE/Code",
@@ -2429,51 +2442,7 @@
2429
2442
  "src": "src/components/index.ts",
2430
2443
  "isEntry": true,
2431
2444
  "imports": [
2432
- "src/components/MaxHeightSmoother/index.tsx",
2433
- "src/components/MaxWidthSmoother/index.tsx",
2434
- "src/components/RightDrawer/RightDrawer.tsx",
2435
- "src/components/RightDrawer/useRightDrawerStore.ts",
2436
- "src/components/PressableSpan/PressableSpan.tsx",
2437
- "src/components/ContentSelector/ContentSelector.tsx",
2438
- "src/components/DictionaryEditor/DictionaryEditor.tsx",
2439
- "src/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.tsx",
2440
- "src/components/DictionaryFieldEditor/DictionaryFieldEditor.tsx",
2441
- "src/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.tsx",
2442
- "src/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.tsx",
2443
- "src/components/DropDown/index.tsx",
2444
- "src/components/ThemeSwitcherDropDown/DesktopThemeSwitcher.tsx",
2445
- "src/components/ThemeSwitcherDropDown/MobileThemeSwitcher.tsx",
2446
- "src/components/ThemeSwitcherDropDown/types.ts",
2447
- "src/components/Button/Button.tsx",
2448
- "src/components/Container/index.tsx",
2449
- "src/components/Footer/index.tsx",
2450
- "src/components/Navbar/index.tsx",
2451
- "src/components/ProfileDropDown/index.tsx",
2452
- "src/components/Avatar/index.tsx",
2453
- "src/components/Logo/index.tsx",
2454
- "src/components/IDE/Code.tsx",
2455
- "src/components/IDE/IDE.tsx",
2456
- "src/components/IDE/FileList.tsx",
2457
- "src/components/Popover/index.tsx",
2458
- "src/components/MarkDownRender/index.tsx",
2459
- "src/components/Headers/index.tsx",
2460
- "src/components/Loader/index.tsx",
2461
- "src/components/WithResizer/index.tsx",
2462
- "src/components/SwitchSelector/index.tsx",
2463
- "src/components/Modal/Modal.tsx",
2464
- "src/components/Breadcrumb/index.tsx",
2465
- "src/components/Flags/Flag.tsx",
2466
- "src/components/InformationTag/index.tsx",
2467
- "src/components/Form/FormBase.tsx",
2468
- "src/components/Form/FormField.tsx",
2469
- "_Form-DJrUK3mm.cjs",
2470
- "src/components/Label/index.tsx",
2471
- "src/components/Input/Input.tsx",
2472
- "src/components/Input/InputPassword.tsx",
2473
- "src/components/Input/Checkbox.tsx",
2474
- "src/components/TextArea/AutoSizeTextArea.tsx",
2475
- "src/components/TextArea/TextArea.tsx",
2476
- "src/components/TextArea/AutocompleteTextArea.tsx",
2445
+ "src/components/Accordion/Accordion.tsx",
2477
2446
  "src/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.tsx",
2478
2447
  "src/components/Auth/SignInForm/SignInForm.tsx",
2479
2448
  "src/components/Auth/SignInForm/useSignInSchema.ts",
@@ -2491,28 +2460,73 @@
2491
2460
  "src/components/Auth/VerifyEmailForm/VerifyEmailForm.tsx",
2492
2461
  "src/components/Auth/DefineNewPasswordForm/DefineNewPasswordForm.tsx",
2493
2462
  "src/components/Auth/DefineNewPasswordForm/useDefineNewPasswordSchema.ts",
2494
- "src/components/Toaster/Toast.tsx",
2495
- "src/components/Toaster/useToast.tsx",
2496
- "src/components/Toaster/Toaster.tsx",
2497
- "src/components/Link/Link.tsx",
2498
- "src/components/TabSelector/TabSelector.tsx",
2463
+ "src/components/Avatar/index.tsx",
2499
2464
  "src/components/Badge/index.tsx",
2500
- "src/components/Select/Multiselect.tsx",
2501
- "src/components/Select/Select.tsx",
2465
+ "src/components/Breadcrumb/index.tsx",
2466
+ "src/components/Button/Button.tsx",
2467
+ "src/components/ClickOutsideDiv/index.tsx",
2502
2468
  "src/components/Command/index.tsx",
2503
- "src/components/Pattern/GridPattern.tsx",
2504
- "src/components/Pattern/DotPattern.tsx",
2505
- "src/components/Pattern/SpotLight.tsx",
2469
+ "src/components/Container/index.tsx",
2470
+ "src/components/ContentSelector/ContentSelector.tsx",
2506
2471
  "src/components/CopyToClipboard/index.tsx",
2472
+ "src/components/DictionaryEditor/DictionaryEditor.tsx",
2473
+ "src/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.tsx",
2474
+ "src/components/DictionaryFieldEditor/DictionaryFieldEditor.tsx",
2475
+ "src/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.tsx",
2476
+ "src/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.tsx",
2477
+ "src/components/DropDown/index.tsx",
2507
2478
  "src/components/EditableField/EditableFieldInput.tsx",
2508
2479
  "src/components/EditableField/EditableFieldTextArea.tsx",
2509
- "src/components/Tag/index.tsx",
2510
- "src/components/Accordion/Accordion.tsx",
2511
- "src/components/LocaleSwitcherDropDown/LocaleSwitcher.tsx",
2480
+ "src/components/Flags/Flag.tsx",
2481
+ "src/components/Footer/index.tsx",
2482
+ "src/components/Form/FormBase.tsx",
2483
+ "src/components/Form/FormField.tsx",
2484
+ "_Form-DJrUK3mm.cjs",
2485
+ "src/components/Headers/index.tsx",
2486
+ "src/components/HeightResizer/index.tsx",
2487
+ "src/components/IDE/Code.tsx",
2488
+ "src/components/IDE/IDE.tsx",
2489
+ "src/components/IDE/FileList.tsx",
2490
+ "src/components/InformationTag/index.tsx",
2491
+ "src/components/Input/Input.tsx",
2492
+ "src/components/Input/InputPassword.tsx",
2493
+ "src/components/Input/Checkbox.tsx",
2494
+ "src/components/KeyboardScreenAdapter/index.tsx",
2495
+ "src/components/Label/index.tsx",
2496
+ "src/components/Link/Link.tsx",
2497
+ "src/components/Loader/index.tsx",
2512
2498
  "src/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.tsx",
2513
2499
  "src/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.tsx",
2514
- "src/components/ClickOutsideDiv/index.tsx",
2515
- "src/components/KeyboardScreenAdapter/index.tsx"
2500
+ "src/components/LocaleSwitcherDropDown/LocaleSwitcher.tsx",
2501
+ "src/components/Logo/index.tsx",
2502
+ "src/components/MarkDownRender/index.tsx",
2503
+ "src/components/MaxHeightSmoother/index.tsx",
2504
+ "src/components/MaxWidthSmoother/index.tsx",
2505
+ "src/components/Modal/Modal.tsx",
2506
+ "src/components/Navbar/index.tsx",
2507
+ "src/components/Pattern/GridPattern.tsx",
2508
+ "src/components/Pattern/DotPattern.tsx",
2509
+ "src/components/Pattern/SpotLight.tsx",
2510
+ "src/components/Popover/index.tsx",
2511
+ "src/components/PressableSpan/PressableSpan.tsx",
2512
+ "src/components/ProfileDropDown/index.tsx",
2513
+ "src/components/RightDrawer/RightDrawer.tsx",
2514
+ "src/components/RightDrawer/useRightDrawerStore.ts",
2515
+ "src/components/Select/Multiselect.tsx",
2516
+ "src/components/Select/Select.tsx",
2517
+ "src/components/SwitchSelector/index.tsx",
2518
+ "src/components/TabSelector/TabSelector.tsx",
2519
+ "src/components/Tag/index.tsx",
2520
+ "src/components/TextArea/AutoSizeTextArea.tsx",
2521
+ "src/components/TextArea/TextArea.tsx",
2522
+ "src/components/TextArea/AutocompleteTextArea.tsx",
2523
+ "src/components/ThemeSwitcherDropDown/DesktopThemeSwitcher.tsx",
2524
+ "src/components/ThemeSwitcherDropDown/MobileThemeSwitcher.tsx",
2525
+ "src/components/ThemeSwitcherDropDown/types.ts",
2526
+ "src/components/Toaster/Toast.tsx",
2527
+ "src/components/Toaster/useToast.tsx",
2528
+ "src/components/Toaster/Toaster.tsx",
2529
+ "src/components/WithResizer/index.tsx"
2516
2530
  ]
2517
2531
  },
2518
2532
  "src/hooks/index.ts": {
@@ -3,8 +3,8 @@ import { LucideIcon } from 'lucide-react';
3
3
  import { ButtonHTMLAttributes, DetailedHTMLProps, FC } from 'react';
4
4
  declare const buttonVariants: (props?: ({
5
5
  size?: "sm" | "md" | "lg" | "xl" | "icon-sm" | "icon-md" | "icon-lg" | "icon-xl" | null | undefined;
6
- color?: "text" | "error" | "primary" | "secondary" | "destructive" | "neutral" | "light" | "dark" | "text-inverse" | "success" | "custom" | null | undefined;
7
- variant?: "default" | "link" | "none" | "input" | "outline" | "invisible-link" | "hoverable" | null | undefined;
6
+ color?: "text" | "primary" | "secondary" | "destructive" | "neutral" | "light" | "dark" | "text-inverse" | "error" | "success" | "custom" | null | undefined;
7
+ variant?: "default" | "link" | "none" | "outline" | "invisible-link" | "hoverable" | "input" | null | undefined;
8
8
  textAlign?: "left" | "right" | "center" | null | undefined;
9
9
  isFullWidth?: boolean | null | undefined;
10
10
  hasIconLeft?: boolean | null | undefined;
@@ -15,7 +15,7 @@ const ClickOutsideDiv = ({
15
15
  onClickOutSide();
16
16
  }
17
17
  };
18
- document.addEventListener("mousedown", handleClick);
18
+ document.addEventListener("mousedown", handleClick, { passive: true });
19
19
  return () => {
20
20
  document.removeEventListener("mousedown", handleClick);
21
21
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../src/components/ClickOutsideDiv/index.tsx"],"sourcesContent":["'use client';\n\nimport {\n type HTMLAttributes,\n type FC,\n type PropsWithChildren,\n useRef,\n useEffect,\n} from 'react';\n\nexport type ClickOutsideDivProps = PropsWithChildren<{\n onClickOutSide: () => void; // note: changed return type to `void`\n}> &\n HTMLAttributes<HTMLDivElement>;\n\nexport const ClickOutsideDiv: FC<ClickOutsideDivProps> = ({\n children,\n onClickOutSide,\n ...props\n}) => {\n const divRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const handleClick = (event: MouseEvent) => {\n // If clicking outside of the referenced element, call onClickOutSide\n if (divRef.current && !divRef.current.contains(event.target as Node)) {\n onClickOutSide();\n }\n };\n\n // Attach the event listener\n document.addEventListener('mousedown', handleClick);\n\n // Clean up on unmount\n return () => {\n document.removeEventListener('mousedown', handleClick);\n };\n }, [onClickOutSide]);\n\n return (\n <div ref={divRef} {...props}>\n {children}\n </div>\n );\n};\n"],"names":["useRef","useEffect"],"mappings":";;;;;AAeO,MAAM,kBAA4C,CAAC;AAAA,EACxD;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACE,QAAA,SAASA,oBAAuB,IAAI;AAE1CC,eAAAA,UAAU,MAAM;AACR,UAAA,cAAc,CAAC,UAAsB;AAErC,UAAA,OAAO,WAAW,CAAC,OAAO,QAAQ,SAAS,MAAM,MAAc,GAAG;AACrD,uBAAA;AAAA,MAAA;AAAA,IAEnB;AAGS,aAAA,iBAAiB,aAAa,WAAW;AAGlD,WAAO,MAAM;AACF,eAAA,oBAAoB,aAAa,WAAW;AAAA,IACvD;AAAA,EAAA,GACC,CAAC,cAAc,CAAC;AAEnB,wCACG,OAAI,EAAA,KAAK,QAAS,GAAG,OACnB,UACH;AAEJ;;"}
1
+ {"version":3,"file":"index.cjs","sources":["../../../src/components/ClickOutsideDiv/index.tsx"],"sourcesContent":["'use client';\n\nimport {\n type FC,\n type HTMLAttributes,\n type PropsWithChildren,\n useEffect,\n useRef,\n} from 'react';\n\nexport type ClickOutsideDivProps = PropsWithChildren<{\n onClickOutSide: () => void; // note: changed return type to `void`\n}> &\n HTMLAttributes<HTMLDivElement>;\n\nexport const ClickOutsideDiv: FC<ClickOutsideDivProps> = ({\n children,\n onClickOutSide,\n ...props\n}) => {\n const divRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const handleClick = (event: MouseEvent) => {\n // If clicking outside of the referenced element, call onClickOutSide\n if (divRef.current && !divRef.current.contains(event.target as Node)) {\n onClickOutSide();\n }\n };\n\n // Attach the event listener\n document.addEventListener('mousedown', handleClick, { passive: true });\n\n // Clean up on unmount\n return () => {\n document.removeEventListener('mousedown', handleClick);\n };\n }, [onClickOutSide]);\n\n return (\n <div ref={divRef} {...props}>\n {children}\n </div>\n );\n};\n"],"names":["useRef","useEffect"],"mappings":";;;;;AAeO,MAAM,kBAA4C,CAAC;AAAA,EACxD;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACE,QAAA,SAASA,oBAAuB,IAAI;AAE1CC,eAAAA,UAAU,MAAM;AACR,UAAA,cAAc,CAAC,UAAsB;AAErC,UAAA,OAAO,WAAW,CAAC,OAAO,QAAQ,SAAS,MAAM,MAAc,GAAG;AACrD,uBAAA;AAAA,MAAA;AAAA,IAEnB;AAGA,aAAS,iBAAiB,aAAa,aAAa,EAAE,SAAS,MAAM;AAGrE,WAAO,MAAM;AACF,eAAA,oBAAoB,aAAa,WAAW;AAAA,IACvD;AAAA,EAAA,GACC,CAAC,cAAc,CAAC;AAEnB,wCACG,OAAI,EAAA,KAAK,QAAS,GAAG,OACnB,UACH;AAEJ;;"}
@@ -1,4 +1,4 @@
1
- import { HTMLAttributes, FC, PropsWithChildren } from 'react';
1
+ import { FC, HTMLAttributes, PropsWithChildren } from 'react';
2
2
  export type ClickOutsideDivProps = PropsWithChildren<{
3
3
  onClickOutSide: () => void;
4
4
  }> & HTMLAttributes<HTMLDivElement>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ClickOutsideDiv/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,EAAE,EACP,KAAK,iBAAiB,EAGvB,MAAM,OAAO,CAAC;AAEf,MAAM,MAAM,oBAAoB,GAAG,iBAAiB,CAAC;IACnD,cAAc,EAAE,MAAM,IAAI,CAAC;CAC5B,CAAC,GACA,cAAc,CAAC,cAAc,CAAC,CAAC;AAEjC,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CA6BpD,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ClickOutsideDiv/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,EAAE,EACP,KAAK,cAAc,EACnB,KAAK,iBAAiB,EAGvB,MAAM,OAAO,CAAC;AAEf,MAAM,MAAM,oBAAoB,GAAG,iBAAiB,CAAC;IACnD,cAAc,EAAE,MAAM,IAAI,CAAC;CAC5B,CAAC,GACA,cAAc,CAAC,cAAc,CAAC,CAAC;AAEjC,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CA6BpD,CAAC"}
@@ -13,7 +13,7 @@ const ClickOutsideDiv = ({
13
13
  onClickOutSide();
14
14
  }
15
15
  };
16
- document.addEventListener("mousedown", handleClick);
16
+ document.addEventListener("mousedown", handleClick, { passive: true });
17
17
  return () => {
18
18
  document.removeEventListener("mousedown", handleClick);
19
19
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../src/components/ClickOutsideDiv/index.tsx"],"sourcesContent":["'use client';\n\nimport {\n type HTMLAttributes,\n type FC,\n type PropsWithChildren,\n useRef,\n useEffect,\n} from 'react';\n\nexport type ClickOutsideDivProps = PropsWithChildren<{\n onClickOutSide: () => void; // note: changed return type to `void`\n}> &\n HTMLAttributes<HTMLDivElement>;\n\nexport const ClickOutsideDiv: FC<ClickOutsideDivProps> = ({\n children,\n onClickOutSide,\n ...props\n}) => {\n const divRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const handleClick = (event: MouseEvent) => {\n // If clicking outside of the referenced element, call onClickOutSide\n if (divRef.current && !divRef.current.contains(event.target as Node)) {\n onClickOutSide();\n }\n };\n\n // Attach the event listener\n document.addEventListener('mousedown', handleClick);\n\n // Clean up on unmount\n return () => {\n document.removeEventListener('mousedown', handleClick);\n };\n }, [onClickOutSide]);\n\n return (\n <div ref={divRef} {...props}>\n {children}\n </div>\n );\n};\n"],"names":[],"mappings":";;;AAeO,MAAM,kBAA4C,CAAC;AAAA,EACxD;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACE,QAAA,SAAS,OAAuB,IAAI;AAE1C,YAAU,MAAM;AACR,UAAA,cAAc,CAAC,UAAsB;AAErC,UAAA,OAAO,WAAW,CAAC,OAAO,QAAQ,SAAS,MAAM,MAAc,GAAG;AACrD,uBAAA;AAAA,MAAA;AAAA,IAEnB;AAGS,aAAA,iBAAiB,aAAa,WAAW;AAGlD,WAAO,MAAM;AACF,eAAA,oBAAoB,aAAa,WAAW;AAAA,IACvD;AAAA,EAAA,GACC,CAAC,cAAc,CAAC;AAEnB,6BACG,OAAI,EAAA,KAAK,QAAS,GAAG,OACnB,UACH;AAEJ;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../../src/components/ClickOutsideDiv/index.tsx"],"sourcesContent":["'use client';\n\nimport {\n type FC,\n type HTMLAttributes,\n type PropsWithChildren,\n useEffect,\n useRef,\n} from 'react';\n\nexport type ClickOutsideDivProps = PropsWithChildren<{\n onClickOutSide: () => void; // note: changed return type to `void`\n}> &\n HTMLAttributes<HTMLDivElement>;\n\nexport const ClickOutsideDiv: FC<ClickOutsideDivProps> = ({\n children,\n onClickOutSide,\n ...props\n}) => {\n const divRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const handleClick = (event: MouseEvent) => {\n // If clicking outside of the referenced element, call onClickOutSide\n if (divRef.current && !divRef.current.contains(event.target as Node)) {\n onClickOutSide();\n }\n };\n\n // Attach the event listener\n document.addEventListener('mousedown', handleClick, { passive: true });\n\n // Clean up on unmount\n return () => {\n document.removeEventListener('mousedown', handleClick);\n };\n }, [onClickOutSide]);\n\n return (\n <div ref={divRef} {...props}>\n {children}\n </div>\n );\n};\n"],"names":[],"mappings":";;;AAeO,MAAM,kBAA4C,CAAC;AAAA,EACxD;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACE,QAAA,SAAS,OAAuB,IAAI;AAE1C,YAAU,MAAM;AACR,UAAA,cAAc,CAAC,UAAsB;AAErC,UAAA,OAAO,WAAW,CAAC,OAAO,QAAQ,SAAS,MAAM,MAAc,GAAG;AACrD,uBAAA;AAAA,MAAA;AAAA,IAEnB;AAGA,aAAS,iBAAiB,aAAa,aAAa,EAAE,SAAS,MAAM;AAGrE,WAAO,MAAM;AACF,eAAA,oBAAoB,aAAa,WAAW;AAAA,IACvD;AAAA,EAAA,GACC,CAAC,cAAc,CAAC;AAEnB,6BACG,OAAI,EAAA,KAAK,QAAS,GAAG,OACnB,UACH;AAEJ;"}
@@ -4,9 +4,9 @@ declare const containerVariants: (props?: ({
4
4
  roundedSize?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "full" | null | undefined;
5
5
  transparency?: "none" | "sm" | "md" | "lg" | "xl" | "full" | null | undefined;
6
6
  padding?: "none" | "sm" | "md" | "lg" | "xl" | null | undefined;
7
- separator?: "x" | "y" | "without" | "both" | null | undefined;
7
+ separator?: "x" | "y" | "both" | "without" | null | undefined;
8
8
  border?: "none" | "with" | null | undefined;
9
- borderColor?: "text" | "error" | "primary" | "secondary" | "neutral" | "success" | "warning" | null | undefined;
9
+ borderColor?: "text" | "primary" | "secondary" | "neutral" | "error" | "success" | "warning" | null | undefined;
10
10
  background?: "none" | "hoverable" | "with" | null | undefined;
11
11
  gap?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | null | undefined;
12
12
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
@@ -1,6 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
+ const hooks_useDevice = require("../../hooks/useDevice.cjs");
5
+ require("react");
6
+ require("../../hooks/useScrollBlockage/useScrollBlockageStore.cjs");
7
+ require("../../hooks/useAsync/useAsyncStateStore.cjs");
8
+ require("@intlayer/editor-react");
9
+ require("@intlayer/api");
10
+ require("@intlayer/config/built");
11
+ require("../Toaster/Toast.cjs");
12
+ require("deepmerge");
4
13
  const utils_cn = require("../../utils/cn.cjs");
5
14
  const components_MaxHeightSmoother_index = require("../MaxHeightSmoother/index.cjs");
6
15
  const DropDown = ({
@@ -29,6 +38,13 @@ const Trigger = ({
29
38
  {
30
39
  className: utils_cn.cn("w-full cursor-pointer", className),
31
40
  "aria-label": `Open panel ${identifier}`,
41
+ onClick: (e) => {
42
+ const isIOS = hooks_useDevice.checkIsIphoneOrSafariDevice();
43
+ if (isIOS) {
44
+ e.currentTarget.focus({ preventScroll: true });
45
+ }
46
+ },
47
+ onBlur: (e) => e.currentTarget.blur(),
32
48
  ...props,
33
49
  children
34
50
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../src/components/DropDown/index.tsx"],"sourcesContent":["import type { FC, HTMLAttributes } from 'react';\nimport { cn } from '../../utils/cn';\nimport { MaxHeightSmoother } from '../MaxHeightSmoother';\n\nexport type DropDownProps = HTMLAttributes<HTMLDivElement> & {\n identifier: string;\n};\n\nexport type DropDownType = FC<DropDownProps> & {\n Trigger: FC<TriggerProps>;\n Panel: FC<PanelProps>;\n};\n\n/**\n * Trigger allowing to open a dropdown menu.\n *\n * Example:\n * ```jsx\n * <DropDown identifier=\"dropdown\">\n * <DropDown.Trigger>\n * Open dropdown\n * </DropDown.Trigger>\n *\n * <DropDown.Panel identifier=\"dropdown\">\n * <div>Content</div>\n * </DropDown.Panel>\n * </DropDown>\n * ```\n *\n * > Note DropDown.Trigger can be replaced by a button. Don't add a button inside the trigger.\n */\nexport const DropDown: DropDownType = ({\n children,\n className,\n identifier,\n ...props\n}) => (\n <div\n className={cn(`group/dropdown relative flex`, className)}\n aria-label={`DropDown ${identifier}`}\n id={`unrollable-panel-button-${identifier}`}\n aria-haspopup\n {...props}\n >\n {children}\n </div>\n);\n\nexport type TriggerProps = HTMLAttributes<HTMLButtonElement> & {\n identifier: string;\n};\n\n/**\n * Trigger allowing to open a dropdown menu.\n *\n * Example:\n * ```jsx\n * <DropDown.Trigger identifier=\"dropdown\">\n * <div>Open dropdown</div>\n * </DropDown.Trigger>\n * ```\n *\n * > Note DropDown.Trigger can be replaced by a button. Don't add a button inside the trigger.\n */\nconst Trigger: FC<TriggerProps> = ({\n children,\n identifier,\n className,\n ...props\n}) => (\n <button\n className={cn('w-full cursor-pointer', className)}\n aria-label={`Open panel ${identifier}`}\n {...props}\n >\n {children}\n </button>\n);\n\nexport type PanelProps = HTMLAttributes<HTMLDivElement> & {\n isFocusable?: boolean;\n isHidden?: boolean;\n isOverable?: boolean;\n identifier: string;\n align?: 'start' | 'end';\n};\n\n/**\n * Component that opens a dropdown menu when the trigger is clicked.\n *\n * Example:\n * ```jsx\n * <DropDown.Panel identifier=\"dropdown\">\n * <div>Content</div>\n * </DropDown.Panel>\n * ```\n */\nconst Panel: FC<PanelProps> = ({\n children,\n isHidden = undefined,\n isOverable = false,\n isFocusable = false,\n align = 'start',\n identifier,\n className,\n ...props\n}) => (\n <div\n className={cn(\n 'absolute top-[calc(100%+0.5rem)] z-[1000] min-w-full',\n align === 'start' && 'left-0',\n align === 'end' && 'right-0',\n className\n )}\n aria-hidden={isHidden}\n role=\"region\"\n aria-labelledby={`unrollable-panel-button-${identifier}`}\n id={`unrollable-panel-${identifier}`}\n >\n <MaxHeightSmoother\n isHidden={isHidden}\n className={cn(\n 'overflow-x-visible',\n isHidden !== false ? 'invisible' : 'visible',\n isOverable &&\n 'group-hover/dropdown:visible group-hover/dropdown:grid-rows-[1fr]',\n isFocusable &&\n 'group-focus-within/dropdown:visible group-focus-within/dropdown:grid-rows-[1fr]'\n )}\n {...props}\n >\n {children}\n </MaxHeightSmoother>\n </div>\n);\n\nDropDown.Trigger = Trigger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ACF;AAGF,SAAS,UAAU;AACnB,SAAS,QAAQ;;"}
1
+ {"version":3,"file":"index.cjs","sources":["../../../src/components/DropDown/index.tsx"],"sourcesContent":["import type { FC, HTMLAttributes } from 'react';\nimport { checkIsIphoneOrSafariDevice } from '../../hooks';\nimport { cn } from '../../utils/cn';\nimport { MaxHeightSmoother } from '../MaxHeightSmoother';\n\nexport type DropDownProps = HTMLAttributes<HTMLDivElement> & {\n identifier: string;\n};\n\nexport type DropDownType = FC<DropDownProps> & {\n Trigger: FC<TriggerProps>;\n Panel: FC<PanelProps>;\n};\n\n/**\n * Trigger allowing to open a dropdown menu.\n *\n * Example:\n * ```jsx\n * <DropDown identifier=\"dropdown\">\n * <DropDown.Trigger>\n * Open dropdown\n * </DropDown.Trigger>\n *\n * <DropDown.Panel identifier=\"dropdown\">\n * <div>Content</div>\n * </DropDown.Panel>\n * </DropDown>\n * ```\n *\n * > Note DropDown.Trigger can be replaced by a button. Don't add a button inside the trigger.\n */\nexport const DropDown: DropDownType = ({\n children,\n className,\n identifier,\n ...props\n}) => (\n <div\n className={cn(`group/dropdown relative flex`, className)}\n aria-label={`DropDown ${identifier}`}\n id={`unrollable-panel-button-${identifier}`}\n aria-haspopup\n {...props}\n >\n {children}\n </div>\n);\n\nexport type TriggerProps = HTMLAttributes<HTMLButtonElement> & {\n identifier: string;\n};\n\n/**\n * Trigger allowing to open a dropdown menu.\n *\n * Example:\n * ```jsx\n * <DropDown.Trigger identifier=\"dropdown\">\n * <div>Open dropdown</div>\n * </DropDown.Trigger>\n * ```\n *\n * > Note DropDown.Trigger can be replaced by a button. Don't add a button inside the trigger.\n */\nconst Trigger: FC<TriggerProps> = ({\n children,\n identifier,\n className,\n ...props\n}) => (\n <button\n className={cn('w-full cursor-pointer', className)}\n aria-label={`Open panel ${identifier}`}\n onClick={(e) => {\n const isIOS = checkIsIphoneOrSafariDevice();\n if (isIOS) {\n (e.currentTarget as HTMLButtonElement).focus({ preventScroll: true });\n }\n }}\n onBlur={(e) => (e.currentTarget as HTMLButtonElement).blur()}\n {...props}\n >\n {children}\n </button>\n);\n\nexport type PanelProps = HTMLAttributes<HTMLDivElement> & {\n isFocusable?: boolean;\n isHidden?: boolean;\n isOverable?: boolean;\n identifier: string;\n align?: 'start' | 'end';\n};\n\n/**\n * Component that opens a dropdown menu when the trigger is clicked.\n *\n * Example:\n * ```jsx\n * <DropDown.Panel identifier=\"dropdown\">\n * <div>Content</div>\n * </DropDown.Panel>\n * ```\n */\nconst Panel: FC<PanelProps> = ({\n children,\n isHidden = undefined,\n isOverable = false,\n isFocusable = false,\n align = 'start',\n identifier,\n className,\n ...props\n}) => (\n <div\n className={cn(\n 'absolute top-[calc(100%+0.5rem)] z-[1000] min-w-full',\n align === 'start' && 'left-0',\n align === 'end' && 'right-0',\n className\n )}\n aria-hidden={isHidden}\n role=\"region\"\n aria-labelledby={`unrollable-panel-button-${identifier}`}\n id={`unrollable-panel-${identifier}`}\n >\n <MaxHeightSmoother\n isHidden={isHidden}\n className={cn(\n 'overflow-x-visible',\n isHidden !== false ? 'invisible' : 'visible',\n isOverable &&\n 'group-hover/dropdown:visible group-hover/dropdown:grid-rows-[1fr]',\n isFocusable &&\n 'group-focus-within/dropdown:visible group-focus-within/dropdown:grid-rows-[1fr]'\n )}\n {...props}\n >\n {children}\n </MaxHeightSmoother>\n </div>\n);\n\nDropDown.Trigger = Trigger;\nDropDown.Panel = Panel;\n"],"names":["jsx","cn","checkIsIphoneOrSafariDevice","MaxHeightSmoother"],"mappings":";;;;;;;;;;;;;;AAgCO,MAAM,WAAyB,CAAC;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MACEA,2BAAA;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAWC,SAAG,GAAA,gCAAgC,SAAS;AAAA,IACvD,cAAY,YAAY,UAAU;AAAA,IAClC,IAAI,2BAA2B,UAAU;AAAA,IACzC,iBAAa;AAAA,IACZ,GAAG;AAAA,IAEH;AAAA,EAAA;AACH;AAmBF,MAAM,UAA4B,CAAC;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MACED,2BAAA;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAWC,SAAAA,GAAG,yBAAyB,SAAS;AAAA,IAChD,cAAY,cAAc,UAAU;AAAA,IACpC,SAAS,CAAC,MAAM;AACd,YAAM,QAAQC,gBAAAA,4BAA4B;AAC1C,UAAI,OAAO;AACR,UAAE,cAAoC,MAAM,EAAE,eAAe,MAAM;AAAA,MAAA;AAAA,IAExE;AAAA,IACA,QAAQ,CAAC,MAAO,EAAE,cAAoC,KAAK;AAAA,IAC1D,GAAG;AAAA,IAEH;AAAA,EAAA;AACH;AAqBF,MAAM,QAAwB,CAAC;AAAA,EAC7B;AAAA,EACA,WAAW;AAAA,EACX,aAAa;AAAA,EACb,cAAc;AAAA,EACd,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA,GAAG;AACL,MACEF,2BAAA;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAWC,SAAA;AAAA,MACT;AAAA,MACA,UAAU,WAAW;AAAA,MACrB,UAAU,SAAS;AAAA,MACnB;AAAA,IACF;AAAA,IACA,eAAa;AAAA,IACb,MAAK;AAAA,IACL,mBAAiB,2BAA2B,UAAU;AAAA,IACtD,IAAI,oBAAoB,UAAU;AAAA,IAElC,UAAAD,2BAAA;AAAA,MAACG,mCAAA;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAWF,SAAA;AAAA,UACT;AAAA,UACA,aAAa,QAAQ,cAAc;AAAA,UACnC,cACE;AAAA,UACF,eACE;AAAA,QACJ;AAAA,QACC,GAAG;AAAA,QAEH;AAAA,MAAA;AAAA,IAAA;AAAA,EACH;AACF;AAGF,SAAS,UAAU;AACnB,SAAS,QAAQ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/DropDown/index.tsx"],"names":[],"mappings":"AAAA,OAA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eAAO,MAAM,QAAQ,EAAE,YAetB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,cAAc,CAAC,iBAAiB,CAAC,GAAG;IAC7D,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAoCF,MAAM,MAAM,UAAU,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IACxD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;CACzB,CAAC"}
@@ -1,4 +1,13 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
+ import { checkIsIphoneOrSafariDevice } from "../../hooks/useDevice.mjs";
3
+ import "react";
4
+ import "../../hooks/useScrollBlockage/useScrollBlockageStore.mjs";
5
+ import "../../hooks/useAsync/useAsyncStateStore.mjs";
6
+ import "@intlayer/editor-react";
7
+ import "@intlayer/api";
8
+ import "@intlayer/config/built";
9
+ import "../Toaster/Toast.mjs";
10
+ import "deepmerge";
2
11
  import { cn } from "../../utils/cn.mjs";
3
12
  import { MaxHeightSmoother } from "../MaxHeightSmoother/index.mjs";
4
13
  const DropDown = ({
@@ -27,6 +36,13 @@ const Trigger = ({
27
36
  {
28
37
  className: cn("w-full cursor-pointer", className),
29
38
  "aria-label": `Open panel ${identifier}`,
39
+ onClick: (e) => {
40
+ const isIOS = checkIsIphoneOrSafariDevice();
41
+ if (isIOS) {
42
+ e.currentTarget.focus({ preventScroll: true });
43
+ }
44
+ },
45
+ onBlur: (e) => e.currentTarget.blur(),
30
46
  ...props,
31
47
  children
32
48
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../src/components/DropDown/index.tsx"],"sourcesContent":["import type { FC, HTMLAttributes } from 'react';\nimport { cn } from '../../utils/cn';\nimport { MaxHeightSmoother } from '../MaxHeightSmoother';\n\nexport type DropDownProps = HTMLAttributes<HTMLDivElement> & {\n identifier: string;\n};\n\nexport type DropDownType = FC<DropDownProps> & {\n Trigger: FC<TriggerProps>;\n Panel: FC<PanelProps>;\n};\n\n/**\n * Trigger allowing to open a dropdown menu.\n *\n * Example:\n * ```jsx\n * <DropDown identifier=\"dropdown\">\n * <DropDown.Trigger>\n * Open dropdown\n * </DropDown.Trigger>\n *\n * <DropDown.Panel identifier=\"dropdown\">\n * <div>Content</div>\n * </DropDown.Panel>\n * </DropDown>\n * ```\n *\n * > Note DropDown.Trigger can be replaced by a button. Don't add a button inside the trigger.\n */\nexport const DropDown: DropDownType = ({\n children,\n className,\n identifier,\n ...props\n}) => (\n <div\n className={cn(`group/dropdown relative flex`, className)}\n aria-label={`DropDown ${identifier}`}\n id={`unrollable-panel-button-${identifier}`}\n aria-haspopup\n {...props}\n >\n {children}\n </div>\n);\n\nexport type TriggerProps = HTMLAttributes<HTMLButtonElement> & {\n identifier: string;\n};\n\n/**\n * Trigger allowing to open a dropdown menu.\n *\n * Example:\n * ```jsx\n * <DropDown.Trigger identifier=\"dropdown\">\n * <div>Open dropdown</div>\n * </DropDown.Trigger>\n * ```\n *\n * > Note DropDown.Trigger can be replaced by a button. Don't add a button inside the trigger.\n */\nconst Trigger: FC<TriggerProps> = ({\n children,\n identifier,\n className,\n ...props\n}) => (\n <button\n className={cn('w-full cursor-pointer', className)}\n aria-label={`Open panel ${identifier}`}\n {...props}\n >\n {children}\n </button>\n);\n\nexport type PanelProps = HTMLAttributes<HTMLDivElement> & {\n isFocusable?: boolean;\n isHidden?: boolean;\n isOverable?: boolean;\n identifier: string;\n align?: 'start' | 'end';\n};\n\n/**\n * Component that opens a dropdown menu when the trigger is clicked.\n *\n * Example:\n * ```jsx\n * <DropDown.Panel identifier=\"dropdown\">\n * <div>Content</div>\n * </DropDown.Panel>\n * ```\n */\nconst Panel: FC<PanelProps> = ({\n children,\n isHidden = undefined,\n isOverable = false,\n isFocusable = false,\n align = 'start',\n identifier,\n className,\n ...props\n}) => (\n <div\n className={cn(\n 'absolute top-[calc(100%+0.5rem)] z-[1000] min-w-full',\n align === 'start' && 'left-0',\n align === 'end' && 'right-0',\n className\n )}\n aria-hidden={isHidden}\n role=\"region\"\n aria-labelledby={`unrollable-panel-button-${identifier}`}\n id={`unrollable-panel-${identifier}`}\n >\n <MaxHeightSmoother\n isHidden={isHidden}\n className={cn(\n 'overflow-x-visible',\n isHidden !== false ? 'invisible' : 'visible',\n isOverable &&\n 'group-hover/dropdown:visible group-hover/dropdown:grid-rows-[1fr]',\n isFocusable &&\n 'group-focus-within/dropdown:visible group-focus-within/dropdown:grid-rows-[1fr]'\n )}\n {...props}\n >\n {children}\n </MaxHeightSmoother>\n </div>\n);\n\nDropDown.Trigger = Trigger;\nDropDown.Panel = Panel;\n"],"names":[],"mappings":";;;AA+BO,MAAM,WAAyB,CAAC;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MACE;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAW,GAAG,gCAAgC,SAAS;AAAA,IACvD,cAAY,YAAY,UAAU;AAAA,IAClC,IAAI,2BAA2B,UAAU;AAAA,IACzC,iBAAa;AAAA,IACZ,GAAG;AAAA,IAEH;AAAA,EAAA;AACH;AAmBF,MAAM,UAA4B,CAAC;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MACE;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAW,GAAG,yBAAyB,SAAS;AAAA,IAChD,cAAY,cAAc,UAAU;AAAA,IACnC,GAAG;AAAA,IAEH;AAAA,EAAA;AACH;AAqBF,MAAM,QAAwB,CAAC;AAAA,EAC7B;AAAA,EACA,WAAW;AAAA,EACX,aAAa;AAAA,EACb,cAAc;AAAA,EACd,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA,GAAG;AACL,MACE;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAW;AAAA,MACT;AAAA,MACA,UAAU,WAAW;AAAA,MACrB,UAAU,SAAS;AAAA,MACnB;AAAA,IACF;AAAA,IACA,eAAa;AAAA,IACb,MAAK;AAAA,IACL,mBAAiB,2BAA2B,UAAU;AAAA,IACtD,IAAI,oBAAoB,UAAU;AAAA,IAElC,UAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAW;AAAA,UACT;AAAA,UACA,aAAa,QAAQ,cAAc;AAAA,UACnC,cACE;AAAA,UACF,eACE;AAAA,QACJ;AAAA,QACC,GAAG;AAAA,QAEH;AAAA,MAAA;AAAA,IAAA;AAAA,EACH;AACF;AAGF,SAAS,UAAU;AACnB,SAAS,QAAQ;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../../src/components/DropDown/index.tsx"],"sourcesContent":["import type { FC, HTMLAttributes } from 'react';\nimport { checkIsIphoneOrSafariDevice } from '../../hooks';\nimport { cn } from '../../utils/cn';\nimport { MaxHeightSmoother } from '../MaxHeightSmoother';\n\nexport type DropDownProps = HTMLAttributes<HTMLDivElement> & {\n identifier: string;\n};\n\nexport type DropDownType = FC<DropDownProps> & {\n Trigger: FC<TriggerProps>;\n Panel: FC<PanelProps>;\n};\n\n/**\n * Trigger allowing to open a dropdown menu.\n *\n * Example:\n * ```jsx\n * <DropDown identifier=\"dropdown\">\n * <DropDown.Trigger>\n * Open dropdown\n * </DropDown.Trigger>\n *\n * <DropDown.Panel identifier=\"dropdown\">\n * <div>Content</div>\n * </DropDown.Panel>\n * </DropDown>\n * ```\n *\n * > Note DropDown.Trigger can be replaced by a button. Don't add a button inside the trigger.\n */\nexport const DropDown: DropDownType = ({\n children,\n className,\n identifier,\n ...props\n}) => (\n <div\n className={cn(`group/dropdown relative flex`, className)}\n aria-label={`DropDown ${identifier}`}\n id={`unrollable-panel-button-${identifier}`}\n aria-haspopup\n {...props}\n >\n {children}\n </div>\n);\n\nexport type TriggerProps = HTMLAttributes<HTMLButtonElement> & {\n identifier: string;\n};\n\n/**\n * Trigger allowing to open a dropdown menu.\n *\n * Example:\n * ```jsx\n * <DropDown.Trigger identifier=\"dropdown\">\n * <div>Open dropdown</div>\n * </DropDown.Trigger>\n * ```\n *\n * > Note DropDown.Trigger can be replaced by a button. Don't add a button inside the trigger.\n */\nconst Trigger: FC<TriggerProps> = ({\n children,\n identifier,\n className,\n ...props\n}) => (\n <button\n className={cn('w-full cursor-pointer', className)}\n aria-label={`Open panel ${identifier}`}\n onClick={(e) => {\n const isIOS = checkIsIphoneOrSafariDevice();\n if (isIOS) {\n (e.currentTarget as HTMLButtonElement).focus({ preventScroll: true });\n }\n }}\n onBlur={(e) => (e.currentTarget as HTMLButtonElement).blur()}\n {...props}\n >\n {children}\n </button>\n);\n\nexport type PanelProps = HTMLAttributes<HTMLDivElement> & {\n isFocusable?: boolean;\n isHidden?: boolean;\n isOverable?: boolean;\n identifier: string;\n align?: 'start' | 'end';\n};\n\n/**\n * Component that opens a dropdown menu when the trigger is clicked.\n *\n * Example:\n * ```jsx\n * <DropDown.Panel identifier=\"dropdown\">\n * <div>Content</div>\n * </DropDown.Panel>\n * ```\n */\nconst Panel: FC<PanelProps> = ({\n children,\n isHidden = undefined,\n isOverable = false,\n isFocusable = false,\n align = 'start',\n identifier,\n className,\n ...props\n}) => (\n <div\n className={cn(\n 'absolute top-[calc(100%+0.5rem)] z-[1000] min-w-full',\n align === 'start' && 'left-0',\n align === 'end' && 'right-0',\n className\n )}\n aria-hidden={isHidden}\n role=\"region\"\n aria-labelledby={`unrollable-panel-button-${identifier}`}\n id={`unrollable-panel-${identifier}`}\n >\n <MaxHeightSmoother\n isHidden={isHidden}\n className={cn(\n 'overflow-x-visible',\n isHidden !== false ? 'invisible' : 'visible',\n isOverable &&\n 'group-hover/dropdown:visible group-hover/dropdown:grid-rows-[1fr]',\n isFocusable &&\n 'group-focus-within/dropdown:visible group-focus-within/dropdown:grid-rows-[1fr]'\n )}\n {...props}\n >\n {children}\n </MaxHeightSmoother>\n </div>\n);\n\nDropDown.Trigger = Trigger;\n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AA,UACnC,cACE;AAAA,UACF,eACE;AAAA,QACJ;AAAA,QACC,GAAG;AAAA,QAEH;AAAA,MAAA;AAAA,IAAA;AAAA,EACH;AACF;AAGF,SAAS,UAAU;AACnB,SAAS,QAAQ;"}
@@ -15,7 +15,7 @@ const SectionScroller = () => {
15
15
  };
16
16
  ReactExports.useEffect(() => {
17
17
  setHash(window.location.hash.slice(1));
18
- window.addEventListener("hashchange", onHashChange);
18
+ window.addEventListener("hashchange", onHashChange, { passive: true });
19
19
  return () => window.removeEventListener("hashchange", onHashChange);
20
20
  }, []);
21
21
  ReactExports.useEffect(() => {
@@ -1 +1 @@
1
- {"version":3,"file":"SectionScroller.cjs","sources":["../../../src/components/Headers/SectionScroller.tsx"],"sourcesContent":["'use client';\n\nimport { useEffect, useState } from 'react';\n\nconst scrollToHash = (id: string) => {\n const element = document.getElementById(id);\n const offset = 150;\n const y =\n (element?.getBoundingClientRect()?.top ?? 0) + window.scrollY - offset;\n\n window.scrollTo({ top: y, behavior: 'smooth' });\n};\n\nexport const SectionScroller = () => {\n const [hash, setHash] = useState<string>();\n\n const onHashChange = () => {\n setHash(window.location.hash.slice(1));\n };\n\n useEffect(() => {\n setHash(window.location.hash.slice(1));\n\n window.addEventListener('hashchange', onHashChange);\n return () => window.removeEventListener('hashchange', onHashChange);\n }, []);\n\n useEffect(() => {\n if (hash) {\n scrollToHash(hash);\n }\n }, [hash]);\n\n return null;\n};\n"],"names":["useState","useEffect"],"mappings":";;;;AAIA,MAAM,eAAe,CAAC,OAAe;AAC7B,QAAA,UAAU,SAAS,eAAe,EAAE;AAC1C,QAAM,SAAS;AACf,QAAM,KACH,SAAS,sBAAA,GAAyB,OAAO,KAAK,OAAO,UAAU;AAElE,SAAO,SAAS,EAAE,KAAK,GAAG,UAAU,UAAU;AAChD;AAEO,MAAM,kBAAkB,MAAM;AACnC,QAAM,CAAC,MAAM,OAAO,IAAIA,sBAAiB;AAEzC,QAAM,eAAe,MAAM;AACzB,YAAQ,OAAO,SAAS,KAAK,MAAM,CAAC,CAAC;AAAA,EACvC;AAEAC,eAAAA,UAAU,MAAM;AACd,YAAQ,OAAO,SAAS,KAAK,MAAM,CAAC,CAAC;AAE9B,WAAA,iBAAiB,cAAc,YAAY;AAClD,WAAO,MAAM,OAAO,oBAAoB,cAAc,YAAY;AAAA,EACpE,GAAG,EAAE;AAELA,eAAAA,UAAU,MAAM;AACd,QAAI,MAAM;AACR,mBAAa,IAAI;AAAA,IAAA;AAAA,EACnB,GACC,CAAC,IAAI,CAAC;AAEF,SAAA;AACT;;"}
1
+ {"version":3,"file":"SectionScroller.cjs","sources":["../../../src/components/Headers/SectionScroller.tsx"],"sourcesContent":["'use client';\n\nimport { useEffect, useState } from 'react';\n\nconst scrollToHash = (id: string) => {\n const element = document.getElementById(id);\n const offset = 150;\n const y =\n (element?.getBoundingClientRect()?.top ?? 0) + window.scrollY - offset;\n\n window.scrollTo({ top: y, behavior: 'smooth' });\n};\n\nexport const SectionScroller = () => {\n const [hash, setHash] = useState<string>();\n\n const onHashChange = () => {\n setHash(window.location.hash.slice(1));\n };\n\n useEffect(() => {\n setHash(window.location.hash.slice(1));\n\n window.addEventListener('hashchange', onHashChange, { passive: true });\n return () => window.removeEventListener('hashchange', onHashChange);\n }, []);\n\n useEffect(() => {\n if (hash) {\n scrollToHash(hash);\n }\n }, [hash]);\n\n return null;\n};\n"],"names":["useState","useEffect"],"mappings":";;;;AAIA,MAAM,eAAe,CAAC,OAAe;AAC7B,QAAA,UAAU,SAAS,eAAe,EAAE;AAC1C,QAAM,SAAS;AACf,QAAM,KACH,SAAS,sBAAA,GAAyB,OAAO,KAAK,OAAO,UAAU;AAElE,SAAO,SAAS,EAAE,KAAK,GAAG,UAAU,UAAU;AAChD;AAEO,MAAM,kBAAkB,MAAM;AACnC,QAAM,CAAC,MAAM,OAAO,IAAIA,sBAAiB;AAEzC,QAAM,eAAe,MAAM;AACzB,YAAQ,OAAO,SAAS,KAAK,MAAM,CAAC,CAAC;AAAA,EACvC;AAEAC,eAAAA,UAAU,MAAM;AACd,YAAQ,OAAO,SAAS,KAAK,MAAM,CAAC,CAAC;AAErC,WAAO,iBAAiB,cAAc,cAAc,EAAE,SAAS,MAAM;AACrE,WAAO,MAAM,OAAO,oBAAoB,cAAc,YAAY;AAAA,EACpE,GAAG,EAAE;AAELA,eAAAA,UAAU,MAAM;AACd,QAAI,MAAM;AACR,mBAAa,IAAI;AAAA,IAAA;AAAA,EACnB,GACC,CAAC,IAAI,CAAC;AAEF,SAAA;AACT;;"}
@@ -13,7 +13,7 @@ const SectionScroller = () => {
13
13
  };
14
14
  useEffect(() => {
15
15
  setHash(window.location.hash.slice(1));
16
- window.addEventListener("hashchange", onHashChange);
16
+ window.addEventListener("hashchange", onHashChange, { passive: true });
17
17
  return () => window.removeEventListener("hashchange", onHashChange);
18
18
  }, []);
19
19
  useEffect(() => {
@@ -1 +1 @@
1
- {"version":3,"file":"SectionScroller.mjs","sources":["../../../src/components/Headers/SectionScroller.tsx"],"sourcesContent":["'use client';\n\nimport { useEffect, useState } from 'react';\n\nconst scrollToHash = (id: string) => {\n const element = document.getElementById(id);\n const offset = 150;\n const y =\n (element?.getBoundingClientRect()?.top ?? 0) + window.scrollY - offset;\n\n window.scrollTo({ top: y, behavior: 'smooth' });\n};\n\nexport const SectionScroller = () => {\n const [hash, setHash] = useState<string>();\n\n const onHashChange = () => {\n setHash(window.location.hash.slice(1));\n };\n\n useEffect(() => {\n setHash(window.location.hash.slice(1));\n\n window.addEventListener('hashchange', onHashChange);\n return () => window.removeEventListener('hashchange', onHashChange);\n }, []);\n\n useEffect(() => {\n if (hash) {\n scrollToHash(hash);\n }\n }, [hash]);\n\n return null;\n};\n"],"names":[],"mappings":";;AAIA,MAAM,eAAe,CAAC,OAAe;AAC7B,QAAA,UAAU,SAAS,eAAe,EAAE;AAC1C,QAAM,SAAS;AACf,QAAM,KACH,SAAS,sBAAA,GAAyB,OAAO,KAAK,OAAO,UAAU;AAElE,SAAO,SAAS,EAAE,KAAK,GAAG,UAAU,UAAU;AAChD;AAEO,MAAM,kBAAkB,MAAM;AACnC,QAAM,CAAC,MAAM,OAAO,IAAI,SAAiB;AAEzC,QAAM,eAAe,MAAM;AACzB,YAAQ,OAAO,SAAS,KAAK,MAAM,CAAC,CAAC;AAAA,EACvC;AAEA,YAAU,MAAM;AACd,YAAQ,OAAO,SAAS,KAAK,MAAM,CAAC,CAAC;AAE9B,WAAA,iBAAiB,cAAc,YAAY;AAClD,WAAO,MAAM,OAAO,oBAAoB,cAAc,YAAY;AAAA,EACpE,GAAG,EAAE;AAEL,YAAU,MAAM;AACd,QAAI,MAAM;AACR,mBAAa,IAAI;AAAA,IAAA;AAAA,EACnB,GACC,CAAC,IAAI,CAAC;AAEF,SAAA;AACT;"}
1
+ {"version":3,"file":"SectionScroller.mjs","sources":["../../../src/components/Headers/SectionScroller.tsx"],"sourcesContent":["'use client';\n\nimport { useEffect, useState } from 'react';\n\nconst scrollToHash = (id: string) => {\n const element = document.getElementById(id);\n const offset = 150;\n const y =\n (element?.getBoundingClientRect()?.top ?? 0) + window.scrollY - offset;\n\n window.scrollTo({ top: y, behavior: 'smooth' });\n};\n\nexport const SectionScroller = () => {\n const [hash, setHash] = useState<string>();\n\n const onHashChange = () => {\n setHash(window.location.hash.slice(1));\n };\n\n useEffect(() => {\n setHash(window.location.hash.slice(1));\n\n window.addEventListener('hashchange', onHashChange, { passive: true });\n return () => window.removeEventListener('hashchange', onHashChange);\n }, []);\n\n useEffect(() => {\n if (hash) {\n scrollToHash(hash);\n }\n }, [hash]);\n\n return null;\n};\n"],"names":[],"mappings":";;AAIA,MAAM,eAAe,CAAC,OAAe;AAC7B,QAAA,UAAU,SAAS,eAAe,EAAE;AAC1C,QAAM,SAAS;AACf,QAAM,KACH,SAAS,sBAAA,GAAyB,OAAO,KAAK,OAAO,UAAU;AAElE,SAAO,SAAS,EAAE,KAAK,GAAG,UAAU,UAAU;AAChD;AAEO,MAAM,kBAAkB,MAAM;AACnC,QAAM,CAAC,MAAM,OAAO,IAAI,SAAiB;AAEzC,QAAM,eAAe,MAAM;AACzB,YAAQ,OAAO,SAAS,KAAK,MAAM,CAAC,CAAC;AAAA,EACvC;AAEA,YAAU,MAAM;AACd,YAAQ,OAAO,SAAS,KAAK,MAAM,CAAC,CAAC;AAErC,WAAO,iBAAiB,cAAc,cAAc,EAAE,SAAS,MAAM;AACrE,WAAO,MAAM,OAAO,oBAAoB,cAAc,YAAY;AAAA,EACpE,GAAG,EAAE;AAEL,YAAU,MAAM;AACd,QAAI,MAAM;AACR,mBAAa,IAAI;AAAA,IAAA;AAAA,EACnB,GACC,CAAC,IAAI,CAAC;AAEF,SAAA;AACT;"}
@@ -0,0 +1,96 @@
1
+ "use client";
2
+ "use strict";
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
+ const jsxRuntime = require("react/jsx-runtime");
5
+ const ReactExports = require("react");
6
+ const utils_cn = require("../../utils/cn.cjs");
7
+ const HeightResizer = ({
8
+ initialHeight,
9
+ maxHeight,
10
+ minHeight = 0,
11
+ children,
12
+ className,
13
+ ...props
14
+ }) => {
15
+ const containerRef = ReactExports.useRef(null);
16
+ const [height, setHeight] = ReactExports.useState(initialHeight);
17
+ const [isResizing, setIsResizing] = ReactExports.useState(false);
18
+ const startResizing = ReactExports.useCallback(
19
+ (mouseDownEvent) => {
20
+ setIsResizing(true);
21
+ mouseDownEvent.preventDefault();
22
+ },
23
+ []
24
+ );
25
+ const stopResizing = ReactExports.useCallback(() => {
26
+ setIsResizing(false);
27
+ }, []);
28
+ const resize = ReactExports.useCallback(
29
+ (mouseMoveEvent) => {
30
+ const container = containerRef.current;
31
+ if (isResizing && container && parent) {
32
+ const { height: containerHeight, top: containerTop } = container.getBoundingClientRect();
33
+ let clientY = 0;
34
+ if (mouseMoveEvent instanceof MouseEvent) {
35
+ clientY = mouseMoveEvent.clientY;
36
+ } else if (mouseMoveEvent instanceof TouchEvent) {
37
+ clientY = mouseMoveEvent.touches[0].clientY;
38
+ }
39
+ const resizeDifference = clientY - containerTop;
40
+ const newHeight = containerHeight - resizeDifference;
41
+ const correctedHeight = Math.max(newHeight, 0);
42
+ setHeight(correctedHeight);
43
+ }
44
+ },
45
+ [isResizing]
46
+ );
47
+ ReactExports.useEffect(() => {
48
+ window.addEventListener("mousemove", resize, { passive: true });
49
+ window.addEventListener("mouseup", stopResizing);
50
+ window.addEventListener("touchmove", resize, { passive: true });
51
+ window.addEventListener("touchend", stopResizing);
52
+ return () => {
53
+ window.removeEventListener("mousemove", resize);
54
+ window.removeEventListener("mouseup", stopResizing);
55
+ window.removeEventListener("touchmove", resize);
56
+ window.removeEventListener("touchend", stopResizing);
57
+ };
58
+ }, [resize, stopResizing]);
59
+ return /* @__PURE__ */ jsxRuntime.jsx(
60
+ "div",
61
+ {
62
+ className: utils_cn.cn(
63
+ minHeight && `max-w-[${maxHeight}px]`,
64
+ maxHeight && `min-w-[${minHeight}px]`,
65
+ "relative h-full w-full max-h-[80%] cursor-ns-resize border-t-[2px] border-neutral-200 transition dark:border-neutral-950",
66
+ 'before:absolute before:top-0 before:z-10 before:left-1/2 before:block before:w-10 before:h-2 before:-translate-y-1/2 before:-translate-x-1/2 before:transform before:cursor-ns-resize before:rounded-full before:bg-neutral-200 before:transition before:content-[""] dark:before:bg-neutral-950',
67
+ "active:border-neutral-400 active:before:bg-neutral-400 dark:active:border-neutral-600 active:dark:before:bg-neutral-600",
68
+ className
69
+ ),
70
+ style: {
71
+ height: `${height}px`
72
+ },
73
+ ref: containerRef,
74
+ onMouseDown: startResizing,
75
+ onTouchStart: startResizing,
76
+ "aria-valuemin": minHeight,
77
+ "aria-valuemax": maxHeight,
78
+ "aria-valuenow": height,
79
+ "aria-label": "Resizable component",
80
+ role: "slider",
81
+ tabIndex: 0,
82
+ ...props,
83
+ children: /* @__PURE__ */ jsxRuntime.jsx(
84
+ "div",
85
+ {
86
+ className: "absolute left-0 top-0 size-full cursor-default overflow-hidden",
87
+ onMouseDown: (e) => e.stopPropagation(),
88
+ onTouchStart: (e) => e.stopPropagation(),
89
+ children
90
+ }
91
+ )
92
+ }
93
+ );
94
+ };
95
+ exports.HeightResizer = HeightResizer;
96
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sources":["../../../src/components/HeightResizer/index.tsx"],"sourcesContent":["'use client';\n\nimport React, {\n DetailedHTMLProps,\n HTMLAttributes,\n useCallback,\n useEffect,\n useRef,\n useState,\n type FC,\n type PropsWithChildren,\n} from 'react';\nimport { cn } from '../../utils/cn';\n\ntype HeightResizerProps = {\n initialHeight: number;\n maxHeight?: number;\n minHeight?: number;\n} & DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>;\n\nexport const HeightResizer: FC<PropsWithChildren<HeightResizerProps>> = ({\n initialHeight,\n maxHeight,\n minHeight = 0,\n children,\n className,\n ...props\n}) => {\n const containerRef = useRef<HTMLDivElement>(null);\n const [height, setHeight] = useState(initialHeight);\n const [isResizing, setIsResizing] = useState(false);\n\n // Handler to start resizing\n const startResizing = useCallback(\n (\n mouseDownEvent:\n | React.MouseEvent<HTMLDivElement>\n | React.TouchEvent<HTMLDivElement>\n ) => {\n setIsResizing(true);\n mouseDownEvent.preventDefault();\n },\n []\n );\n\n // Handler to stop resizing\n const stopResizing = useCallback(() => {\n setIsResizing(false);\n }, []);\n\n // Handler to resize the div\n const resize = useCallback(\n (mouseMoveEvent: MouseEvent | TouchEvent) => {\n const container = containerRef.current;\n if (isResizing && container && parent) {\n const { height: containerHeight, top: containerTop } =\n container.getBoundingClientRect();\n\n let clientY = 0;\n if (mouseMoveEvent instanceof MouseEvent) {\n clientY = mouseMoveEvent.clientY;\n } else if (mouseMoveEvent instanceof TouchEvent) {\n clientY = mouseMoveEvent.touches[0].clientY;\n }\n\n const resizeDifference = clientY - containerTop;\n const newHeight = containerHeight - resizeDifference;\n const correctedHeight = Math.max(newHeight, 0);\n\n setHeight(correctedHeight);\n }\n },\n [isResizing]\n );\n\n // Add event listeners for mouse move and mouse up\n useEffect(() => {\n window.addEventListener('mousemove', resize, { passive: true });\n window.addEventListener('mouseup', stopResizing);\n window.addEventListener('touchmove', resize, { passive: true });\n window.addEventListener('touchend', stopResizing);\n\n return () => {\n window.removeEventListener('mousemove', resize);\n window.removeEventListener('mouseup', stopResizing);\n window.removeEventListener('touchmove', resize);\n window.removeEventListener('touchend', stopResizing);\n };\n }, [resize, stopResizing]);\n\n return (\n <div\n className={cn(\n minHeight && `max-w-[${maxHeight}px]`,\n maxHeight && `min-w-[${minHeight}px]`,\n 'relative h-full w-full max-h-[80%] cursor-ns-resize border-t-[2px] border-neutral-200 transition dark:border-neutral-950',\n 'before:absolute before:top-0 before:z-10 before:left-1/2 before:block before:w-10 before:h-2 before:-translate-y-1/2 before:-translate-x-1/2 before:transform before:cursor-ns-resize before:rounded-full before:bg-neutral-200 before:transition before:content-[\"\"] dark:before:bg-neutral-950',\n 'active:border-neutral-400 active:before:bg-neutral-400 dark:active:border-neutral-600 active:dark:before:bg-neutral-600',\n className\n )}\n style={{\n height: `${height}px`,\n }}\n ref={containerRef}\n onMouseDown={startResizing}\n onTouchStart={startResizing}\n aria-valuemin={minHeight}\n aria-valuemax={maxHeight}\n aria-valuenow={height}\n aria-label=\"Resizable component\"\n role=\"slider\"\n tabIndex={0}\n {...props}\n >\n <div\n className=\"absolute left-0 top-0 size-full cursor-default overflow-hidden\"\n onMouseDown={(e) => e.stopPropagation()}\n onTouchStart={(e) => e.stopPropagation()}\n >\n {children}\n </div>\n </div>\n );\n};\n"],"names":["useRef","useState","useCallback","useEffect","jsx","cn"],"mappings":";;;;;;AAoBO,MAAM,gBAA2D,CAAC;AAAA,EACvE;AAAA,EACA;AAAA,EACA,YAAY;AAAA,EACZ;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACE,QAAA,eAAeA,oBAAuB,IAAI;AAChD,QAAM,CAAC,QAAQ,SAAS,IAAIC,aAAAA,SAAS,aAAa;AAClD,QAA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ACT,aAAa,UAAU,SAAS;AAAA,QAChC,aAAa,UAAU,SAAS;AAAA,QAChC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MACA,OAAO;AAAA,QACL,QAAQ,GAAG,MAAM;AAAA,MACnB;AAAA,MACA,KAAK;AAAA,MACL,aAAa;AAAA,MACb,cAAc;AAAA,MACd,iBAAe;AAAA,MACf,iBAAe;AAAA,MACf,iBAAe;AAAA,MACf,cAAW;AAAA,MACX,MAAK;AAAA,MACL,UAAU;AAAA,MACT,GAAG;AAAA,MAEJ,UAAAD,2BAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAU;AAAA,UACV,aAAa,CAAC,MAAM,EAAE,gBAAgB;AAAA,UACtC,cAAc,CAAC,MAAM,EAAE,gBAAgB;AAAA,UAEtC;AAAA,QAAA;AAAA,MAAA;AAAA,IACH;AAAA,EACF;AAEJ;;"}
@@ -0,0 +1,9 @@
1
+ import { DetailedHTMLProps, HTMLAttributes, FC, PropsWithChildren } from 'react';
2
+ type HeightResizerProps = {
3
+ initialHeight: number;
4
+ maxHeight?: number;
5
+ minHeight?: number;
6
+ } & DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
7
+ export declare const HeightResizer: FC<PropsWithChildren<HeightResizerProps>>;
8
+ export {};
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/HeightResizer/index.tsx"],"names":[],"mappings":"AAEA,OAAc,EACZ,iBAAiB,EACjB,cAAc,EAKd,KAAK,EAAE,EACP,KAAK,iBAAiB,EACvB,MAAM,OAAO,CAAC;AAGf,KAAK,kBAAkB,GAAG;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,iBAAiB,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,cAAc,CAAC,CAAC;AAEtE,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,CAuGnE,CAAC"}