@forgedevstack/bear 1.3.3 → 1.3.4

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 (121) hide show
  1. package/README.md +145 -292
  2. package/dist/components/AlertDialog/AlertDialog.cjs +1 -1
  3. package/dist/components/AlertDialog/AlertDialog.js +67 -84
  4. package/dist/components/BottomSheet/BottomSheet.cjs +1 -1
  5. package/dist/components/BottomSheet/BottomSheet.js +72 -64
  6. package/dist/components/ChipGroup/ChipGroup.cjs +1 -1
  7. package/dist/components/ChipGroup/ChipGroup.const.cjs +1 -1
  8. package/dist/components/ChipGroup/ChipGroup.const.d.ts +2 -0
  9. package/dist/components/ChipGroup/ChipGroup.const.js +6 -4
  10. package/dist/components/ChipGroup/ChipGroup.js +52 -48
  11. package/dist/components/CommandPalette/CommandItem.cjs +1 -0
  12. package/dist/components/CommandPalette/CommandItem.d.ts +6 -0
  13. package/dist/components/CommandPalette/CommandItem.js +39 -0
  14. package/dist/components/CommandPalette/CommandPalette.cjs +1 -1
  15. package/dist/components/CommandPalette/CommandPalette.js +129 -144
  16. package/dist/components/Drawer/Drawer.cjs +1 -1
  17. package/dist/components/Drawer/Drawer.js +72 -66
  18. package/dist/components/EmptyState/EmptyState.cjs +1 -1
  19. package/dist/components/EmptyState/EmptyState.const.cjs +1 -1
  20. package/dist/components/EmptyState/EmptyState.const.d.ts +5 -0
  21. package/dist/components/EmptyState/EmptyState.const.js +30 -15
  22. package/dist/components/EmptyState/EmptyState.js +35 -35
  23. package/dist/components/EmptyState/EmptyState.types.d.ts +2 -2
  24. package/dist/components/HoverCard/HoverCard.cjs +4 -3
  25. package/dist/components/HoverCard/HoverCard.const.cjs +1 -0
  26. package/dist/components/HoverCard/HoverCard.const.d.ts +1 -0
  27. package/dist/components/HoverCard/HoverCard.const.js +10 -0
  28. package/dist/components/HoverCard/HoverCard.js +62 -56
  29. package/dist/components/HoverCard/HoverCard.types.d.ts +7 -0
  30. package/dist/components/Menu/Menu.cjs +1 -1
  31. package/dist/components/Menu/Menu.const.cjs +1 -0
  32. package/dist/components/Menu/Menu.const.d.ts +2 -0
  33. package/dist/components/Menu/Menu.const.js +12 -0
  34. package/dist/components/Menu/Menu.d.ts +3 -9
  35. package/dist/components/Menu/Menu.js +57 -89
  36. package/dist/components/Menu/Menu.types.d.ts +8 -1
  37. package/dist/components/Menu/MenuDivider.cjs +1 -0
  38. package/dist/components/Menu/MenuDivider.d.ts +6 -0
  39. package/dist/components/Menu/MenuDivider.js +7 -0
  40. package/dist/components/Menu/MenuItem.cjs +1 -0
  41. package/dist/components/Menu/MenuItem.d.ts +6 -0
  42. package/dist/components/Menu/MenuItem.js +46 -0
  43. package/dist/components/Modal/Modal.cjs +1 -1
  44. package/dist/components/Modal/Modal.const.cjs +1 -1
  45. package/dist/components/Modal/Modal.const.d.ts +1 -0
  46. package/dist/components/Modal/Modal.const.js +20 -12
  47. package/dist/components/Modal/Modal.js +62 -59
  48. package/dist/components/Modal/Modal.types.d.ts +7 -0
  49. package/dist/components/Popover/Popover.cjs +1 -1
  50. package/dist/components/Popover/Popover.const.cjs +1 -0
  51. package/dist/components/Popover/Popover.const.d.ts +15 -1
  52. package/dist/components/Popover/Popover.const.js +29 -0
  53. package/dist/components/Popover/Popover.js +77 -73
  54. package/dist/components/Popover/Popover.types.d.ts +7 -0
  55. package/dist/components/Select/Select.cjs +1 -1
  56. package/dist/components/Select/Select.const.cjs +1 -1
  57. package/dist/components/Select/Select.const.d.ts +1 -0
  58. package/dist/components/Select/Select.const.js +7 -6
  59. package/dist/components/Select/Select.js +101 -96
  60. package/dist/components/Toast/Toast.cjs +1 -1
  61. package/dist/components/Toast/Toast.const.cjs +1 -1
  62. package/dist/components/Toast/Toast.const.d.ts +2 -0
  63. package/dist/components/Toast/Toast.const.js +11 -8
  64. package/dist/components/Toast/Toast.context.cjs +1 -0
  65. package/dist/components/Toast/Toast.context.d.ts +3 -0
  66. package/dist/components/Toast/Toast.context.js +11 -0
  67. package/dist/components/Toast/Toast.d.ts +4 -3
  68. package/dist/components/Toast/Toast.icons.cjs +1 -0
  69. package/dist/components/Toast/Toast.icons.d.ts +4 -0
  70. package/dist/components/Toast/Toast.icons.js +29 -0
  71. package/dist/components/Toast/Toast.js +32 -160
  72. package/dist/components/Toast/ToastContainer.cjs +1 -0
  73. package/dist/components/Toast/ToastContainer.d.ts +3 -0
  74. package/dist/components/Toast/ToastContainer.js +39 -0
  75. package/dist/components/Toast/ToastItem.cjs +1 -0
  76. package/dist/components/Toast/ToastItem.d.ts +5 -0
  77. package/dist/components/Toast/ToastItem.js +86 -0
  78. package/dist/components/ToggleGroup/ToggleGroup.cjs +1 -0
  79. package/dist/components/ToggleGroup/ToggleGroup.const.cjs +1 -0
  80. package/dist/components/ToggleGroup/ToggleGroup.const.d.ts +15 -0
  81. package/dist/components/ToggleGroup/ToggleGroup.const.js +33 -0
  82. package/dist/components/ToggleGroup/ToggleGroup.context.cjs +1 -0
  83. package/dist/components/ToggleGroup/ToggleGroup.context.d.ts +2 -0
  84. package/dist/components/ToggleGroup/ToggleGroup.context.js +5 -0
  85. package/dist/components/ToggleGroup/ToggleGroup.d.ts +2 -0
  86. package/dist/components/ToggleGroup/ToggleGroup.js +86 -0
  87. package/dist/components/ToggleGroup/ToggleGroup.types.d.ts +48 -0
  88. package/dist/components/ToggleGroup/ToggleGroupItem.cjs +1 -0
  89. package/dist/components/ToggleGroup/ToggleGroupItem.d.ts +2 -0
  90. package/dist/components/ToggleGroup/ToggleGroupItem.js +50 -0
  91. package/dist/components/ToggleGroup/hooks/useToggleGroupContext.cjs +1 -0
  92. package/dist/components/ToggleGroup/hooks/useToggleGroupContext.d.ts +1 -0
  93. package/dist/components/ToggleGroup/hooks/useToggleGroupContext.js +6 -0
  94. package/dist/components/ToggleGroup/index.d.ts +4 -0
  95. package/dist/components/Tooltip/Tooltip.cjs +1 -1
  96. package/dist/components/Tooltip/Tooltip.const.cjs +1 -0
  97. package/dist/components/Tooltip/Tooltip.const.d.ts +8 -0
  98. package/dist/components/Tooltip/Tooltip.const.js +18 -0
  99. package/dist/components/Tooltip/Tooltip.js +59 -61
  100. package/dist/components/Tooltip/Tooltip.types.d.ts +7 -0
  101. package/dist/components/index.cjs +1 -1
  102. package/dist/components/index.d.ts +2 -0
  103. package/dist/components/index.js +428 -418
  104. package/dist/constants/numbers.const.cjs +1 -1
  105. package/dist/constants/numbers.const.d.ts +3 -0
  106. package/dist/constants/numbers.const.js +37 -34
  107. package/dist/hooks/index.cjs +1 -1
  108. package/dist/hooks/index.d.ts +2 -0
  109. package/dist/hooks/index.js +6 -4
  110. package/dist/hooks/useFocusTrap/index.d.ts +2 -0
  111. package/dist/hooks/useFocusTrap/useFocusTrap.cjs +1 -0
  112. package/dist/hooks/useFocusTrap/useFocusTrap.d.ts +3 -0
  113. package/dist/hooks/useFocusTrap/useFocusTrap.js +41 -0
  114. package/dist/hooks/useFocusTrap/useFocusTrap.types.d.ts +8 -0
  115. package/dist/hooks/useFocusTrap/useFocusTrap.utils.cjs +1 -0
  116. package/dist/hooks/useFocusTrap/useFocusTrap.utils.d.ts +1 -0
  117. package/dist/hooks/useFocusTrap/useFocusTrap.utils.js +23 -0
  118. package/dist/index.cjs +1 -1
  119. package/dist/index.js +575 -563
  120. package/dist/styles.css +52 -0
  121. package/package.json +1 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("../Box/Box.cjs"),I=require("../Flex/Flex.cjs"),E=require("../Typography/Typography.cjs"),a=require("../../utils/cn.cjs");require("react");const g=require("../../utils/generateBearId.utils.cjs"),N=require("../../utils/useBearId.cjs"),t=require("./EmptyState.const.cjs"),h=d=>{const{icon:l,title:S,description:r,action:c,secondaryAction:n,className:T,size:_=t.EMPTY_STATE_DEFAULT_SIZE,variant:p=t.EMPTY_STATE_DEFAULT_VARIANT,preset:i=t.EMPTY_STATE_DEFAULT_PRESET,id:m,testId:y}=d,u=N.useBearId("EmptyState"),B=g.resolveBearId(m,u),s=t.EMPTY_STATE_SIZE_CLASSES[_],x=t.EMPTY_STATE_PRESET_ICON[i],A=l??e.jsx(x,{className:"bear-w-full bear-h-full"});return e.jsxs(o.Box,{id:B,"data-testid":y,className:a.cn("Bear-EmptyState",p==="card"&&"Bear-EmptyState--card",`Bear-EmptyState--${i}`,s.padding,T),children:[e.jsx(o.Box,{className:a.cn("Bear-EmptyState__icon",s.icon),children:A}),e.jsx(E.Typography,{className:a.cn("Bear-EmptyState__title",s.title),children:S}),r&&e.jsx(E.Typography,{className:a.cn("Bear-EmptyState__description",s.desc),children:r}),(c||n)&&e.jsxs(I.Flex,{className:"Bear-EmptyState__actions",align:"center",gap:3,children:[c,n]})]})};exports.EmptyState=h;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),T=require("../Box/Box.cjs"),I=require("../Flex/Flex.cjs"),_=require("../Typography/Typography.cjs"),r=require("../../utils/cn.cjs");require("react");const M=require("../../utils/generateBearId.utils.cjs"),g=require("../../utils/useBearId.cjs"),e=require("./EmptyState.const.cjs"),h=d=>{const{icon:l,title:S,description:c,action:n,secondaryAction:i,className:p,size:m=e.EMPTY_STATE_DEFAULT_SIZE,variant:u=e.EMPTY_STATE_DEFAULT_VARIANT,preset:a=e.EMPTY_STATE_DEFAULT_PRESET,id:y,testId:A}=d,P=g.useBearId(e.COMPONENT_NAME_EMPTY_STATE),B=M.resolveBearId(y,P),s=e.EMPTY_STATE_SIZE_CLASSES[m],N=e.EMPTY_STATE_PRESET_ICON[a],x=l??t.jsx(N,{className:"bear-w-full bear-h-full"}),o=e.EMPTY_STATE_PRESET_DEFAULTS[a]??e.EMPTY_STATE_PRESET_DEFAULTS.empty,E=c!==void 0?c:o.description;return t.jsxs(T.Box,{id:B,"data-testid":A,className:r.cn("Bear-EmptyState",u==="card"&&"Bear-EmptyState--card",`Bear-EmptyState--${a}`,s.padding,p),children:[t.jsx(T.Box,{className:r.cn("Bear-EmptyState__icon",s.icon),children:x}),t.jsx(_.Typography,{className:r.cn("Bear-EmptyState__title",s.title),children:S??o.title}),E&&t.jsx(_.Typography,{className:r.cn("Bear-EmptyState__description",s.desc),children:E}),(n||i)&&t.jsxs(I.Flex,{className:"Bear-EmptyState__actions",align:"center",gap:3,children:[n,i]})]})};exports.EmptyState=h;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("../../constants/generals.const.cjs"),e=require("./helpers/EmptyStateErrorSvg.cjs"),T=require("./helpers/EmptyStateInboxSvg.cjs"),t=require("./helpers/EmptyStateSearchSvg.cjs"),S=E.SIZE_MD,_=E.VARIANT_DEFAULT,r=E.EMPTY_STATE_PRESET_EMPTY,a={[E.EMPTY_STATE_PRESET_EMPTY]:T.EmptyStateInboxSvg,[E.EMPTY_STATE_PRESET_INBOX]:T.EmptyStateInboxSvg,[E.EMPTY_STATE_PRESET_SEARCH]:t.EmptyStateSearchSvg,[E.EMPTY_STATE_PRESET_ERROR]:e.EmptyStateErrorSvg},A={sm:{icon:"bear-w-12 bear-h-12",title:"bear-text-lg",desc:"bear-text-sm",padding:"bear-py-6 bear-px-4"},md:{icon:"bear-w-16 bear-h-16",title:"bear-text-xl",desc:"bear-text-base",padding:"bear-py-10 bear-px-6"},lg:{icon:"bear-w-20 bear-h-20",title:"bear-text-2xl",desc:"bear-text-lg",padding:"bear-py-14 bear-px-8"}};exports.EMPTY_STATE_DEFAULT_PRESET=r;exports.EMPTY_STATE_DEFAULT_SIZE=S;exports.EMPTY_STATE_DEFAULT_VARIANT=_;exports.EMPTY_STATE_PRESET_ICON=a;exports.EMPTY_STATE_SIZE_CLASSES=A;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../constants/generals.const.cjs"),r=require("./helpers/EmptyStateErrorSvg.cjs"),e=require("./helpers/EmptyStateInboxSvg.cjs"),E=require("./helpers/EmptyStateSearchSvg.cjs"),T=t.SIZE_MD,o=t.VARIANT_DEFAULT,a=t.EMPTY_STATE_PRESET_EMPTY,S="EmptyState",i={[t.EMPTY_STATE_PRESET_EMPTY]:e.EmptyStateInboxSvg,[t.EMPTY_STATE_PRESET_INBOX]:e.EmptyStateInboxSvg,[t.EMPTY_STATE_PRESET_SEARCH]:E.EmptyStateSearchSvg,[t.EMPTY_STATE_PRESET_ERROR]:r.EmptyStateErrorSvg,"no-data":e.EmptyStateInboxSvg,404:E.EmptyStateSearchSvg,offline:r.EmptyStateErrorSvg,"filter-empty":E.EmptyStateSearchSvg},n={empty:{title:"No items yet",description:"Get started by creating your first item."},inbox:{title:"Your inbox is empty",description:"All caught up! Check back later for new messages."},search:{title:"No results found",description:"Try adjusting your search or filter keywords."},error:{title:"Something went wrong",description:"We encountered an error loading this content."},"no-data":{title:"No data available",description:"There is no data to display right now."},404:{title:"Page not found",description:"The requested page or resource could not be located."},offline:{title:"Connection lost",description:"Please check your internet connection and try again."},"filter-empty":{title:"No matching filters",description:"No records match the selected filter criteria."}},_={sm:{icon:"bear-w-12 bear-h-12",title:"bear-text-lg",desc:"bear-text-sm",padding:"bear-py-6 bear-px-4"},md:{icon:"bear-w-16 bear-h-16",title:"bear-text-xl",desc:"bear-text-base",padding:"bear-py-10 bear-px-6"},lg:{icon:"bear-w-20 bear-h-20",title:"bear-text-2xl",desc:"bear-text-lg",padding:"bear-py-14 bear-px-8"}};exports.COMPONENT_NAME_EMPTY_STATE=S;exports.EMPTY_STATE_DEFAULT_PRESET=a;exports.EMPTY_STATE_DEFAULT_SIZE=T;exports.EMPTY_STATE_DEFAULT_VARIANT=o;exports.EMPTY_STATE_PRESET_DEFAULTS=n;exports.EMPTY_STATE_PRESET_ICON=i;exports.EMPTY_STATE_SIZE_CLASSES=_;
@@ -3,9 +3,14 @@ import { EmptyStatePreset } from './EmptyState.types';
3
3
  export declare const EMPTY_STATE_DEFAULT_SIZE: "md";
4
4
  export declare const EMPTY_STATE_DEFAULT_VARIANT: "default";
5
5
  export declare const EMPTY_STATE_DEFAULT_PRESET: EmptyStatePreset;
6
+ export declare const COMPONENT_NAME_EMPTY_STATE = "EmptyState";
6
7
  export declare const EMPTY_STATE_PRESET_ICON: Record<EmptyStatePreset, ComponentType<{
7
8
  className?: string;
8
9
  }>>;
10
+ export declare const EMPTY_STATE_PRESET_DEFAULTS: Record<EmptyStatePreset, {
11
+ title: string;
12
+ description: string;
13
+ }>;
9
14
  export declare const EMPTY_STATE_SIZE_CLASSES: {
10
15
  readonly sm: {
11
16
  readonly icon: "bear-w-12 bear-h-12";
@@ -1,13 +1,26 @@
1
- import { SIZE_MD as t, VARIANT_DEFAULT as e, EMPTY_STATE_PRESET_EMPTY as T, EMPTY_STATE_PRESET_ERROR as r, EMPTY_STATE_PRESET_SEARCH as S, EMPTY_STATE_PRESET_INBOX as _ } from "../../constants/generals.const.js";
2
- import { EmptyStateErrorSvg as a } from "./helpers/EmptyStateErrorSvg.js";
3
- import { EmptyStateInboxSvg as E } from "./helpers/EmptyStateInboxSvg.js";
4
- import { EmptyStateSearchSvg as b } from "./helpers/EmptyStateSearchSvg.js";
5
- const m = t, i = e, x = T, c = {
6
- [T]: E,
7
- [_]: E,
8
- [S]: b,
9
- [r]: a
10
- }, n = {
1
+ import { SIZE_MD as i, VARIANT_DEFAULT as a, EMPTY_STATE_PRESET_EMPTY as o, EMPTY_STATE_PRESET_ERROR as n, EMPTY_STATE_PRESET_SEARCH as E, EMPTY_STATE_PRESET_INBOX as T } from "../../constants/generals.const.js";
2
+ import { EmptyStateErrorSvg as r } from "./helpers/EmptyStateErrorSvg.js";
3
+ import { EmptyStateInboxSvg as e } from "./helpers/EmptyStateInboxSvg.js";
4
+ import { EmptyStateSearchSvg as t } from "./helpers/EmptyStateSearchSvg.js";
5
+ const S = i, _ = a, p = o, b = "EmptyState", m = {
6
+ [o]: e,
7
+ [T]: e,
8
+ [E]: t,
9
+ [n]: r,
10
+ "no-data": e,
11
+ 404: t,
12
+ offline: r,
13
+ "filter-empty": t
14
+ }, A = {
15
+ empty: { title: "No items yet", description: "Get started by creating your first item." },
16
+ inbox: { title: "Your inbox is empty", description: "All caught up! Check back later for new messages." },
17
+ search: { title: "No results found", description: "Try adjusting your search or filter keywords." },
18
+ error: { title: "Something went wrong", description: "We encountered an error loading this content." },
19
+ "no-data": { title: "No data available", description: "There is no data to display right now." },
20
+ 404: { title: "Page not found", description: "The requested page or resource could not be located." },
21
+ offline: { title: "Connection lost", description: "Please check your internet connection and try again." },
22
+ "filter-empty": { title: "No matching filters", description: "No records match the selected filter criteria." }
23
+ }, P = {
11
24
  sm: {
12
25
  icon: "bear-w-12 bear-h-12",
13
26
  title: "bear-text-lg",
@@ -28,9 +41,11 @@ const m = t, i = e, x = T, c = {
28
41
  }
29
42
  };
30
43
  export {
31
- x as EMPTY_STATE_DEFAULT_PRESET,
32
- m as EMPTY_STATE_DEFAULT_SIZE,
33
- i as EMPTY_STATE_DEFAULT_VARIANT,
34
- c as EMPTY_STATE_PRESET_ICON,
35
- n as EMPTY_STATE_SIZE_CLASSES
44
+ b as COMPONENT_NAME_EMPTY_STATE,
45
+ p as EMPTY_STATE_DEFAULT_PRESET,
46
+ S as EMPTY_STATE_DEFAULT_SIZE,
47
+ _ as EMPTY_STATE_DEFAULT_VARIANT,
48
+ A as EMPTY_STATE_PRESET_DEFAULTS,
49
+ m as EMPTY_STATE_PRESET_ICON,
50
+ P as EMPTY_STATE_SIZE_CLASSES
36
51
  };
@@ -1,50 +1,50 @@
1
- import { jsxs as c, jsx as e } from "react/jsx-runtime";
2
- import { Box as m } from "../Box/Box.js";
3
- import { Flex as N } from "../Flex/Flex.js";
4
- import { Typography as n } from "../Typography/Typography.js";
5
- import { cn as a } from "../../utils/cn.js";
1
+ import { jsxs as m, jsx as e } from "react/jsx-runtime";
2
+ import { Box as n } from "../Box/Box.js";
3
+ import { Flex as h } from "../Flex/Flex.js";
4
+ import { Typography as T } from "../Typography/Typography.js";
5
+ import { cn as r } from "../../utils/cn.js";
6
6
  import "react";
7
- import { resolveBearId as P } from "../../utils/generateBearId.utils.js";
8
- import { useBearId as h } from "../../utils/useBearId.js";
9
- import { EMPTY_STATE_DEFAULT_SIZE as g, EMPTY_STATE_DEFAULT_VARIANT as x, EMPTY_STATE_DEFAULT_PRESET as M, EMPTY_STATE_SIZE_CLASSES as Y, EMPTY_STATE_PRESET_ICON as u } from "./EmptyState.const.js";
10
- const z = (E) => {
7
+ import { resolveBearId as Y } from "../../utils/generateBearId.utils.js";
8
+ import { useBearId as g } from "../../utils/useBearId.js";
9
+ import { EMPTY_STATE_DEFAULT_SIZE as u, EMPTY_STATE_DEFAULT_VARIANT as x, EMPTY_STATE_DEFAULT_PRESET as D, COMPONENT_NAME_EMPTY_STATE as F, EMPTY_STATE_PRESET_DEFAULTS as d, EMPTY_STATE_SIZE_CLASSES as L, EMPTY_STATE_PRESET_ICON as v } from "./EmptyState.const.js";
10
+ const V = (_) => {
11
11
  const {
12
12
  icon: p,
13
- title: d,
14
- description: r,
15
- action: o,
16
- secondaryAction: s,
17
- className: l,
18
- size: _ = g,
19
- variant: T = x,
20
- preset: i = M,
21
- id: S,
22
- testId: y
23
- } = E, A = h("EmptyState"), f = P(S, A), t = Y[_], B = u[i], I = p ?? /* @__PURE__ */ e(B, { className: "bear-w-full bear-h-full" });
24
- return /* @__PURE__ */ c(
25
- m,
13
+ title: l,
14
+ description: o,
15
+ action: s,
16
+ secondaryAction: i,
17
+ className: S,
18
+ size: A = u,
19
+ variant: N = x,
20
+ preset: a = D,
21
+ id: y,
22
+ testId: P
23
+ } = _, f = g(F), B = Y(y, f), t = L[A], I = v[a], M = p ?? /* @__PURE__ */ e(I, { className: "bear-w-full bear-h-full" }), c = d[a] ?? d.empty, E = o !== void 0 ? o : c.description;
24
+ return /* @__PURE__ */ m(
25
+ n,
26
26
  {
27
- id: f,
28
- "data-testid": y,
29
- className: a(
27
+ id: B,
28
+ "data-testid": P,
29
+ className: r(
30
30
  "Bear-EmptyState",
31
- T === "card" && "Bear-EmptyState--card",
32
- `Bear-EmptyState--${i}`,
31
+ N === "card" && "Bear-EmptyState--card",
32
+ `Bear-EmptyState--${a}`,
33
33
  t.padding,
34
- l
34
+ S
35
35
  ),
36
36
  children: [
37
- /* @__PURE__ */ e(m, { className: a("Bear-EmptyState__icon", t.icon), children: I }),
38
- /* @__PURE__ */ e(n, { className: a("Bear-EmptyState__title", t.title), children: d }),
39
- r && /* @__PURE__ */ e(n, { className: a("Bear-EmptyState__description", t.desc), children: r }),
40
- (o || s) && /* @__PURE__ */ c(N, { className: "Bear-EmptyState__actions", align: "center", gap: 3, children: [
41
- o,
42
- s
37
+ /* @__PURE__ */ e(n, { className: r("Bear-EmptyState__icon", t.icon), children: M }),
38
+ /* @__PURE__ */ e(T, { className: r("Bear-EmptyState__title", t.title), children: l ?? c.title }),
39
+ E && /* @__PURE__ */ e(T, { className: r("Bear-EmptyState__description", t.desc), children: E }),
40
+ (s || i) && /* @__PURE__ */ m(h, { className: "Bear-EmptyState__actions", align: "center", gap: 3, children: [
41
+ s,
42
+ i
43
43
  ] })
44
44
  ]
45
45
  }
46
46
  );
47
47
  };
48
48
  export {
49
- z as EmptyState
49
+ V as EmptyState
50
50
  };
@@ -1,10 +1,10 @@
1
1
  import { ReactNode } from 'react';
2
- export type EmptyStatePreset = 'empty' | 'search' | 'inbox' | 'error';
2
+ export type EmptyStatePreset = 'empty' | 'search' | 'inbox' | 'error' | 'no-data' | '404' | 'offline' | 'filter-empty';
3
3
  export interface EmptyStateProps {
4
4
  testId?: string;
5
5
  id?: string;
6
6
  icon?: ReactNode;
7
- title: string;
7
+ title?: string;
8
8
  description?: string;
9
9
  action?: ReactNode;
10
10
  secondaryAction?: ReactNode;
@@ -1,6 +1,7 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("react/jsx-runtime"),o=require("react"),P=require("../Portal/Portal.cjs"),C=11e3,i=288,u=200;function N(e,l,n){let t=0,r=0;const h=i/2;return l==="bottom"?(t=e.bottom+8,r=e.left+e.width/2-h,n==="start"&&(r=e.left),n==="end"&&(r=e.right-i)):l==="top"?(t=e.top-u-8,r=e.left+e.width/2-h,n==="start"&&(r=e.left),n==="end"&&(r=e.right-i)):l==="right"?(r=e.right+8,t=e.top+e.height/2-u/2,n==="start"&&(t=e.top),n==="end"&&(t=e.bottom-u)):(r=e.left-i-8,t=e.top+e.height/2-u/2,n==="start"&&(t=e.top),n==="end"&&(t=e.bottom-u)),r=Math.max(8,Math.min(r,window.innerWidth-i-8)),t=Math.max(8,Math.min(t,window.innerHeight-u-8)),{position:"fixed",zIndex:C,top:t,left:r,width:i}}const T=o.forwardRef(({children:e,cardContent:l,side:n="bottom",align:m="center",openDelay:t=200,closeDelay:r=300,arrow:h=!0,className:x="",...L},H)=>{const[a,p]=o.useState(!1),[S,j]=o.useState({}),d=o.useRef(),c=o.useRef(),f=o.useRef(null),v=o.useRef(null);o.useEffect(()=>{if(!a||!f.current)return;const s=()=>{const w=f.current.getBoundingClientRect();j(N(w,n,m))};return s(),window.addEventListener("resize",s),window.addEventListener("scroll",s,!0),()=>{window.removeEventListener("resize",s),window.removeEventListener("scroll",s,!0)}},[a,n,m]),o.useEffect(()=>{if(!a)return;const s=w=>{var y,M;const R=w.target;(y=f.current)!=null&&y.contains(R)||(M=v.current)!=null&&M.contains(R)||p(!1)};return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[a]);const g=()=>{c.current&&clearTimeout(c.current),d.current=setTimeout(()=>p(!0),t)},E=()=>{d.current&&clearTimeout(d.current),c.current=setTimeout(()=>p(!1),r)};return o.useEffect(()=>()=>{d.current&&clearTimeout(d.current),c.current&&clearTimeout(c.current)},[]),b.jsxs("div",{ref:H,className:`bear-hover-card bear-relative bear-inline-block ${x}`.trim(),onMouseEnter:g,onMouseLeave:E,...L,children:[b.jsx("div",{ref:f,className:"bear-inline-block",children:e}),a&&b.jsx(P.Portal,{children:b.jsx("div",{ref:v,style:S,className:`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("react/jsx-runtime"),s=require("react"),U=require("../Portal/Portal.cjs"),y=require("../../hooks/useFixedAnchorPosition/useFixedAnchorPosition.utils.cjs"),e=require("../../constants/numbers.const.cjs"),w=require("./HoverCard.const.cjs");function C(t,c,o){const a=e.EIGHT;let r=e.ZERO,n=e.ZERO;const T=e.TWO_HUNDRED_EIGHTY_EIGHT/e.TWO;return c==="bottom"?(r=t.bottom+a,n=t.left+t.width/e.TWO-T,o==="start"&&(n=t.left),o==="end"&&(n=t.right-e.TWO_HUNDRED_EIGHTY_EIGHT)):c==="top"?(r=t.top-e.TWO_HUNDRED-a,n=t.left+t.width/e.TWO-T,o==="start"&&(n=t.left),o==="end"&&(n=t.right-e.TWO_HUNDRED_EIGHTY_EIGHT)):c==="right"?(n=t.right+a,r=t.top+t.height/e.TWO-e.TWO_HUNDRED/e.TWO,o==="start"&&(r=t.top),o==="end"&&(r=t.bottom-e.TWO_HUNDRED)):(n=t.left-e.TWO_HUNDRED_EIGHTY_EIGHT-a,r=t.top+t.height/e.TWO-e.TWO_HUNDRED/e.TWO,o==="start"&&(r=t.top),o==="end"&&(r=t.bottom-e.TWO_HUNDRED)),n=Math.max(e.EIGHT,Math.min(n,window.innerWidth-e.TWO_HUNDRED_EIGHTY_EIGHT-e.EIGHT)),r=Math.max(e.EIGHT,Math.min(r,window.innerHeight-e.TWO_HUNDRED-e.EIGHT)),{position:"fixed",zIndex:e.ELEVEN_THOUSAND,top:r,left:n,width:e.TWO_HUNDRED_EIGHTY_EIGHT}}const W=s.forwardRef(({children:t,cardContent:c,side:o="bottom",align:a="center",openDelay:r=200,closeDelay:n=300,arrow:T=!0,className:p="",...m},I)=>{const[u,H]=s.useState(!1),[N,G]=s.useState({}),l=s.useRef(),f=s.useRef(),d=s.useRef(null),b=s.useRef(null);s.useEffect(()=>{if(!u||!d.current)return;const i=()=>{const _=d.current.getBoundingClientRect();G(C(_,o,a))};return i(),window.addEventListener("resize",i),window.addEventListener("scroll",i,!0),()=>{window.removeEventListener("resize",i),window.removeEventListener("scroll",i,!0)}},[u,o,a]),s.useEffect(()=>{if(!u)return;const i=_=>{var D,v;const h=_.target;(D=d.current)!=null&&D.contains(h)||(v=b.current)!=null&&v.contains(h)||H(!1)};return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[u]);const R=()=>{f.current&&clearTimeout(f.current),l.current=setTimeout(()=>H(!0),r)},O=()=>{l.current&&clearTimeout(l.current),f.current=setTimeout(()=>H(!1),n)};s.useEffect(()=>()=>{l.current&&clearTimeout(l.current),f.current&&clearTimeout(f.current)},[]);const{openEffect:g}=y.resolveOverlayEffects(m,"scale"),M=w.HOVER_CARD_EFFECT_CLASS_MAP[g]??w.HOVER_CARD_EFFECT_CLASS_MAP.scale;return E.jsxs("div",{ref:I,className:`bear-hover-card bear-relative bear-inline-block ${p}`.trim(),onMouseEnter:R,onMouseLeave:O,...m,children:[E.jsx("div",{ref:d,className:"bear-inline-block",children:t}),u&&E.jsx(U.Portal,{children:E.jsx("div",{ref:b,style:N,className:`
2
2
  bear-bg-white dark:bear-bg-gray-800 bear-rounded-lg bear-shadow-xl
3
3
  bear-border bear-border-gray-200 dark:bear-border-gray-700 bear-p-4
4
4
  bear-transition-all bear-duration-200
5
- ${a?"bear-opacity-100 bear-scale-100":"bear-opacity-0 bear-scale-95"}
6
- `,onMouseEnter:g,onMouseLeave:E,children:l})})]})});T.displayName="HoverCard";exports.HoverCard=T;
5
+ ${u?"bear-opacity-100 bear-scale-100":"bear-opacity-0 bear-scale-95"}
6
+ ${M}
7
+ `.trim(),onMouseEnter:R,onMouseLeave:O,children:c})})]})});W.displayName="HoverCard";exports.HoverCard=W;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={scale:"animate-scale-in",fade:"animate-fade-in","slide-down":"animate-grow-up",fold:"animate-alert-dialog-in",none:""};exports.HOVER_CARD_EFFECT_CLASS_MAP=e;
@@ -1 +1,2 @@
1
1
  export declare const H_O_V_E_R_C_A_R_D_ROOT_CLASS = "Bear-HoverCard";
2
+ export declare const HOVER_CARD_EFFECT_CLASS_MAP: Record<string, string>;
@@ -0,0 +1,10 @@
1
+ const a = {
2
+ scale: "animate-scale-in",
3
+ fade: "animate-fade-in",
4
+ "slide-down": "animate-grow-up",
5
+ fold: "animate-alert-dialog-in",
6
+ none: ""
7
+ };
8
+ export {
9
+ a as HOVER_CARD_EFFECT_CLASS_MAP
10
+ };
@@ -1,86 +1,92 @@
1
- import { jsxs as C, jsx as w } from "react/jsx-runtime";
2
- import { forwardRef as O, useState as R, useRef as c, useEffect as v } from "react";
3
- import { Portal as P } from "../Portal/Portal.js";
4
- const S = 11e3, a = 288, s = 200;
5
- function z(e, u, n) {
6
- let t = 0, r = 0;
7
- const b = a / 2;
8
- return u === "bottom" ? (t = e.bottom + 8, r = e.left + e.width / 2 - b, n === "start" && (r = e.left), n === "end" && (r = e.right - a)) : u === "top" ? (t = e.top - s - 8, r = e.left + e.width / 2 - b, n === "start" && (r = e.left), n === "end" && (r = e.right - a)) : u === "right" ? (r = e.right + 8, t = e.top + e.height / 2 - s / 2, n === "start" && (t = e.top), n === "end" && (t = e.bottom - s)) : (r = e.left - a - 8, t = e.top + e.height / 2 - s / 2, n === "start" && (t = e.top), n === "end" && (t = e.bottom - s)), r = Math.max(8, Math.min(r, window.innerWidth - a - 8)), t = Math.max(8, Math.min(t, window.innerHeight - s - 8)), {
1
+ import { jsxs as A, jsx as v } from "react/jsx-runtime";
2
+ import { forwardRef as P, useState as _, useRef as h, useEffect as T } from "react";
3
+ import { Portal as z } from "../Portal/Portal.js";
4
+ import { resolveOverlayEffects as G } from "../../hooks/useFixedAnchorPosition/useFixedAnchorPosition.utils.js";
5
+ import { TWO as a, TWO_HUNDRED_EIGHTY_EIGHT as u, TWO_HUNDRED as f, ZERO as x, ELEVEN_THOUSAND as U, EIGHT as m } from "../../constants/numbers.const.js";
6
+ import { HOVER_CARD_EFFECT_CLASS_MAP as N } from "./HoverCard.const.js";
7
+ function $(e, l, o) {
8
+ const i = m;
9
+ let t = x, r = x;
10
+ const p = u / a;
11
+ return l === "bottom" ? (t = e.bottom + i, r = e.left + e.width / a - p, o === "start" && (r = e.left), o === "end" && (r = e.right - u)) : l === "top" ? (t = e.top - f - i, r = e.left + e.width / a - p, o === "start" && (r = e.left), o === "end" && (r = e.right - u)) : l === "right" ? (r = e.right + i, t = e.top + e.height / a - f / a, o === "start" && (t = e.top), o === "end" && (t = e.bottom - f)) : (r = e.left - u - i, t = e.top + e.height / a - f / a, o === "start" && (t = e.top), o === "end" && (t = e.bottom - f)), r = Math.max(m, Math.min(r, window.innerWidth - u - m)), t = Math.max(m, Math.min(t, window.innerHeight - f - m)), {
9
12
  position: "fixed",
10
- zIndex: S,
13
+ zIndex: U,
11
14
  top: t,
12
15
  left: r,
13
- width: a
16
+ width: u
14
17
  };
15
18
  }
16
- const I = O(({
19
+ const j = P(({
17
20
  children: e,
18
- cardContent: u,
19
- side: n = "bottom",
20
- align: m = "center",
21
+ cardContent: l,
22
+ side: o = "bottom",
23
+ align: i = "center",
21
24
  openDelay: t = 200,
22
25
  closeDelay: r = 300,
23
- arrow: b = !0,
24
- className: x = "",
25
- ...H
26
- }, N) => {
27
- const [i, p] = R(!1), [_, k] = R({}), d = c(), l = c(), f = c(null), g = c(null);
28
- v(() => {
29
- if (!i || !f.current) return;
30
- const o = () => {
31
- const h = f.current.getBoundingClientRect();
32
- k(z(h, n, m));
26
+ arrow: p = !0,
27
+ className: C = "",
28
+ ...R
29
+ }, D) => {
30
+ const [s, E] = _(!1), [S, I] = _({}), d = h(), c = h(), b = h(null), g = h(null);
31
+ T(() => {
32
+ if (!s || !b.current) return;
33
+ const n = () => {
34
+ const w = b.current.getBoundingClientRect();
35
+ I($(w, o, i));
33
36
  };
34
- return o(), window.addEventListener("resize", o), window.addEventListener("scroll", o, !0), () => {
35
- window.removeEventListener("resize", o), window.removeEventListener("scroll", o, !0);
37
+ return n(), window.addEventListener("resize", n), window.addEventListener("scroll", n, !0), () => {
38
+ window.removeEventListener("resize", n), window.removeEventListener("scroll", n, !0);
36
39
  };
37
- }, [i, n, m]), v(() => {
38
- if (!i) return;
39
- const o = (h) => {
40
- var T, y;
41
- const M = h.target;
42
- (T = f.current) != null && T.contains(M) || (y = g.current) != null && y.contains(M) || p(!1);
40
+ }, [s, o, i]), T(() => {
41
+ if (!s) return;
42
+ const n = (w) => {
43
+ var H, O;
44
+ const y = w.target;
45
+ (H = b.current) != null && H.contains(y) || (O = g.current) != null && O.contains(y) || E(!1);
43
46
  };
44
- return document.addEventListener("mousedown", o), () => document.removeEventListener("mousedown", o);
45
- }, [i]);
46
- const E = () => {
47
- l.current && clearTimeout(l.current), d.current = setTimeout(() => p(!0), t);
48
- }, L = () => {
49
- d.current && clearTimeout(d.current), l.current = setTimeout(() => p(!1), r);
47
+ return document.addEventListener("mousedown", n), () => document.removeEventListener("mousedown", n);
48
+ }, [s]);
49
+ const L = () => {
50
+ c.current && clearTimeout(c.current), d.current = setTimeout(() => E(!0), t);
51
+ }, M = () => {
52
+ d.current && clearTimeout(d.current), c.current = setTimeout(() => E(!1), r);
50
53
  };
51
- return v(() => () => {
52
- d.current && clearTimeout(d.current), l.current && clearTimeout(l.current);
53
- }, []), /* @__PURE__ */ C(
54
+ T(() => () => {
55
+ d.current && clearTimeout(d.current), c.current && clearTimeout(c.current);
56
+ }, []);
57
+ const { openEffect: W } = G(R, "scale"), k = N[W] ?? N.scale;
58
+ return /* @__PURE__ */ A(
54
59
  "div",
55
60
  {
56
- ref: N,
57
- className: `bear-hover-card bear-relative bear-inline-block ${x}`.trim(),
58
- onMouseEnter: E,
59
- onMouseLeave: L,
60
- ...H,
61
+ ref: D,
62
+ className: `bear-hover-card bear-relative bear-inline-block ${C}`.trim(),
63
+ onMouseEnter: L,
64
+ onMouseLeave: M,
65
+ ...R,
61
66
  children: [
62
- /* @__PURE__ */ w("div", { ref: f, className: "bear-inline-block", children: e }),
63
- i && /* @__PURE__ */ w(P, { children: /* @__PURE__ */ w(
67
+ /* @__PURE__ */ v("div", { ref: b, className: "bear-inline-block", children: e }),
68
+ s && /* @__PURE__ */ v(z, { children: /* @__PURE__ */ v(
64
69
  "div",
65
70
  {
66
71
  ref: g,
67
- style: _,
72
+ style: S,
68
73
  className: `
69
74
  bear-bg-white dark:bear-bg-gray-800 bear-rounded-lg bear-shadow-xl
70
75
  bear-border bear-border-gray-200 dark:bear-border-gray-700 bear-p-4
71
76
  bear-transition-all bear-duration-200
72
- ${i ? "bear-opacity-100 bear-scale-100" : "bear-opacity-0 bear-scale-95"}
73
- `,
74
- onMouseEnter: E,
75
- onMouseLeave: L,
76
- children: u
77
+ ${s ? "bear-opacity-100 bear-scale-100" : "bear-opacity-0 bear-scale-95"}
78
+ ${k}
79
+ `.trim(),
80
+ onMouseEnter: L,
81
+ onMouseLeave: M,
82
+ children: l
77
83
  }
78
84
  ) })
79
85
  ]
80
86
  }
81
87
  );
82
88
  });
83
- I.displayName = "HoverCard";
89
+ j.displayName = "HoverCard";
84
90
  export {
85
- I as HoverCard
91
+ j as HoverCard
86
92
  };
@@ -1,4 +1,5 @@
1
1
  import { HTMLAttributes, ReactNode } from 'react';
2
+ import { OverlayMotionEffect, OverlayEffectConfig } from '../../hooks/useFixedAnchorPosition';
2
3
  export interface HoverCardProps extends Omit<HTMLAttributes<HTMLDivElement>, 'content'> {
3
4
  testId?: string;
4
5
  id?: string;
@@ -9,6 +10,12 @@ export interface HoverCardProps extends Omit<HTMLAttributes<HTMLDivElement>, 'co
9
10
  openDelay?: number;
10
11
  closeDelay?: number;
11
12
  arrow?: boolean;
13
+ /** Transition effect when opening */
14
+ openEffect?: OverlayMotionEffect;
15
+ /** Transition effect when closing */
16
+ closeEffect?: OverlayMotionEffect;
17
+ /** Config for open and close transition effects */
18
+ effect?: OverlayEffectConfig;
12
19
  }
13
20
  export interface HoverCardContentProps extends HTMLAttributes<HTMLDivElement> {
14
21
  children?: ReactNode;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),g=require("react"),p=require("../../utils/cn.cjs"),j=require("../Portal/Portal.cjs"),L=12e3,N=({icon:t,disabled:r=!1,selected:n=!1,divider:l=!1,children:f,onClick:a,className:d,testId:y,...v})=>o.jsxs(o.Fragment,{children:[o.jsxs("div",{role:"menuitem",tabIndex:r?-1:0,className:p.cn("bear-flex bear-items-center bear-gap-3 bear-px-4 bear-py-2 bear-cursor-pointer bear-transition-colors","hover:bear-bg-gray-100 dark:hover:bear-bg-gray-700","focus:bear-outline-none focus:bear-bg-gray-100 dark:focus:bear-bg-gray-700",n&&"bear-bg-primary-50 dark:bear-bg-primary-900/20 bear-text-primary-600",r&&"bear-opacity-50 bear-cursor-not-allowed hover:bear-bg-transparent",d),onClick:r?void 0:a,onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&!r&&(a==null||a())},"data-testid":y,...v,children:[t&&o.jsx("span",{className:"bear-flex-shrink-0 bear-text-gray-500",children:t}),o.jsx("span",{className:"bear-flex-1 bear-text-sm",children:f})]}),l&&o.jsx(k,{})]}),k=({className:t})=>o.jsx("div",{className:p.cn("bear-h-px bear-bg-gray-200 dark:bear-bg-gray-700 bear-my-1",t)}),R=({open:t=!1,anchorEl:r,onClose:n,children:l,position:f="bottom-start",minWidth:a=180,maxHeight:d=300,className:y,testId:v,...m})=>{const c=g.useRef(null),[x,M]=g.useState({top:0,left:0});return g.useLayoutEffect(()=>{if(!t||!r)return;const s=()=>{const e=r.getBoundingClientRect(),h=c.current,w=h?h.offsetHeight:Math.min(d,200);let u=0,i=0;switch(f){case"bottom-start":u=e.bottom+4,i=e.left;break;case"bottom-end":u=e.bottom+4,i=e.right-a;break;case"top-start":u=e.top-w-4,i=e.left;break;case"top-end":u=e.top-w-4,i=e.right-a;break}i=Math.max(8,Math.min(i,window.innerWidth-a-8));const E=window.innerHeight-w-8;u=Math.max(8,Math.min(u,E)),M({top:u,left:i})};s();const b=c.current&&typeof ResizeObserver<"u"?new ResizeObserver(s):null;return c.current&&b&&b.observe(c.current),window.addEventListener("resize",s),window.addEventListener("scroll",s,!0),()=>{b==null||b.disconnect(),window.removeEventListener("resize",s),window.removeEventListener("scroll",s,!0)}},[t,r,f,a,d]),g.useEffect(()=>{if(!t)return;const s=e=>{c.current&&!c.current.contains(e.target)&&r&&!r.contains(e.target)&&(n==null||n())},b=e=>{e.key==="Escape"&&(n==null||n())};return document.addEventListener("mousedown",s),document.addEventListener("keydown",b),()=>{document.removeEventListener("mousedown",s),document.removeEventListener("keydown",b)}},[t,r,n]),t?o.jsx(j.Portal,{children:o.jsx("div",{ref:c,role:"menu",className:p.cn("bear-fixed bear-bg-white dark:bear-bg-gray-800","bear-border bear-border-gray-200 dark:bear-border-gray-700","bear-rounded-lg bear-shadow-lg bear-py-1","bear-overflow-y-auto",y),style:{top:x.top,left:x.left,minWidth:a,maxHeight:d,zIndex:L},"data-testid":v,...m,children:l})}):null};exports.Menu=R;exports.MenuDivider=k;exports.MenuItem=N;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("react/jsx-runtime"),u=require("react"),p=require("../../utils/cn.cjs"),S=require("../../hooks/useFixedAnchorPosition/useFixedAnchorPosition.utils.cjs"),q=require("../Portal/Portal.cjs"),b=require("./Menu.const.cjs"),P=({open:c=!1,anchorEl:n,onClose:s,children:k,position:l="bottom-start",minWidth:d=180,maxHeight:f=300,className:E,testId:m,...v})=>{const i=u.useRef(null),[g,L]=u.useState({top:0,left:0});u.useLayoutEffect(()=>{if(!c||!n)return;const r=()=>{const t=n.getBoundingClientRect(),e=i.current,w=e?e.offsetHeight:Math.min(f,200);let o=0,a=0;switch(l){case"bottom-start":o=t.bottom+4,a=t.left;break;case"bottom-end":o=t.bottom+4,a=t.right-((e==null?void 0:e.offsetWidth)??d);break;case"top-start":o=t.top-w-4,a=t.left;break;case"top-end":o=t.top-w-4,a=t.right-((e==null?void 0:e.offsetWidth)??d);break;case"right-start":o=t.top,a=t.right+4;break;case"left-start":o=t.top,a=t.left-((e==null?void 0:e.offsetWidth)??d)-4;break}L({top:o,left:a})};return r(),window.addEventListener("resize",r),window.addEventListener("scroll",r,!0),()=>{window.removeEventListener("resize",r),window.removeEventListener("scroll",r,!0)}},[c,n,l,d,f]),u.useEffect(()=>{if(!c)return;const r=e=>{i.current&&!i.current.contains(e.target)&&n&&!n.contains(e.target)&&(s==null||s())},t=e=>{e.key==="Escape"&&(s==null||s())};return document.addEventListener("mousedown",r),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("keydown",t)}},[c,n,s]);const{openEffect:M}=S.resolveOverlayEffects(v,"fade"),_=b.MENU_EFFECT_CLASS_MAP[M]??b.MENU_EFFECT_CLASS_MAP.fade;return c?y.jsx(q.Portal,{children:y.jsx("div",{ref:i,role:"menu",className:p.cn("bear-fixed bear-bg-white dark:bear-bg-gray-800","bear-border bear-border-gray-200 dark:bear-border-gray-700","bear-rounded-lg bear-shadow-lg bear-py-1","bear-overflow-y-auto",_,E),style:{top:g.top,left:g.left,minWidth:d,maxHeight:f,zIndex:b.MENU_Z_INDEX},"data-testid":m,...v,children:k})}):null};exports.Menu=P;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../constants/numbers.const.cjs"),n=e.TWELVE_THOUSAND,a={scale:"animate-scale-in",fade:"animate-fade-in","slide-down":"animate-grow-up",fold:"animate-alert-dialog-in",none:""};exports.MENU_EFFECT_CLASS_MAP=a;exports.MENU_Z_INDEX=n;
@@ -1 +1,3 @@
1
1
  export declare const M_E_N_U_ROOT_CLASS = "Bear-Menu";
2
+ export declare const MENU_Z_INDEX = 12000;
3
+ export declare const MENU_EFFECT_CLASS_MAP: Record<string, string>;
@@ -0,0 +1,12 @@
1
+ import { TWELVE_THOUSAND as a } from "../../constants/numbers.const.js";
2
+ const n = a, i = {
3
+ scale: "animate-scale-in",
4
+ fade: "animate-fade-in",
5
+ "slide-down": "animate-grow-up",
6
+ fold: "animate-alert-dialog-in",
7
+ none: ""
8
+ };
9
+ export {
10
+ i as MENU_EFFECT_CLASS_MAP,
11
+ n as MENU_Z_INDEX
12
+ };
@@ -1,13 +1,7 @@
1
1
  import { FC } from 'react';
2
- import { MenuProps, MenuItemProps, MenuDividerProps } from './Menu.types';
3
- /**
4
- * MenuItem component for menu items
5
- */
6
- export declare const MenuItem: FC<MenuItemProps>;
7
- /**
8
- * MenuDivider component for separating menu sections
9
- */
10
- export declare const MenuDivider: FC<MenuDividerProps>;
2
+ import { MenuProps } from './Menu.types';
3
+ export { MenuItem } from './MenuItem';
4
+ export { MenuDivider } from './MenuDivider';
11
5
  /**
12
6
  * Menu component for dropdown menus
13
7
  *