@forgedevstack/bear 1.1.4 → 1.1.8

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 (146) hide show
  1. package/README.md +19 -0
  2. package/dist/components/Anchor/Anchor.cjs +1 -1
  3. package/dist/components/Anchor/Anchor.js +37 -45
  4. package/dist/components/Anchor/Anchor.utils.cjs +1 -0
  5. package/dist/components/Anchor/Anchor.utils.d.ts +2 -0
  6. package/dist/components/Anchor/Anchor.utils.js +12 -0
  7. package/dist/components/Autocomplete/Autocomplete.cjs +1 -1
  8. package/dist/components/Autocomplete/Autocomplete.js +60 -67
  9. package/dist/components/Autocomplete/Autocomplete.utils.cjs +1 -0
  10. package/dist/components/Autocomplete/Autocomplete.utils.d.ts +2 -0
  11. package/dist/components/Autocomplete/Autocomplete.utils.js +12 -0
  12. package/dist/components/BackTop/BackTop.cjs +1 -1
  13. package/dist/components/BackTop/BackTop.js +10 -11
  14. package/dist/components/Button/Button.cjs +1 -1
  15. package/dist/components/Button/Button.constants.cjs +2 -2
  16. package/dist/components/Button/Button.constants.d.ts +1 -0
  17. package/dist/components/Button/Button.constants.js +12 -5
  18. package/dist/components/Button/Button.d.ts +0 -27
  19. package/dist/components/Button/Button.js +93 -105
  20. package/dist/components/Button/Button.types.d.ts +1 -0
  21. package/dist/components/Button/Button.utils.cjs +1 -0
  22. package/dist/components/Button/Button.utils.d.ts +2 -0
  23. package/dist/components/Button/Button.utils.js +5 -0
  24. package/dist/components/Button/useSpotlight.cjs +1 -0
  25. package/dist/components/Button/useSpotlight.d.ts +21 -0
  26. package/dist/components/Button/useSpotlight.js +28 -0
  27. package/dist/components/Chart/Chart.cjs +1 -1
  28. package/dist/components/Chart/Chart.const.cjs +1 -0
  29. package/dist/components/Chart/Chart.const.js +21 -0
  30. package/dist/components/Chart/Chart.js +55 -71
  31. package/dist/components/Chart/Chart.utils.cjs +1 -0
  32. package/dist/components/Chart/Chart.utils.js +5 -0
  33. package/dist/components/Confetti/Confetti.cjs +1 -1
  34. package/dist/components/Confetti/Confetti.js +37 -34
  35. package/dist/components/ContextMenu/ContextMenu.cjs +1 -1
  36. package/dist/components/ContextMenu/ContextMenu.js +31 -30
  37. package/dist/components/ContextMenu/ContextMenu.utils.cjs +1 -0
  38. package/dist/components/ContextMenu/ContextMenu.utils.d.ts +5 -0
  39. package/dist/components/ContextMenu/ContextMenu.utils.js +4 -0
  40. package/dist/components/CountdownTimer/CountdownTimer.cjs +1 -1
  41. package/dist/components/CountdownTimer/CountdownTimer.js +62 -71
  42. package/dist/components/CountdownTimer/CountdownTimer.utils.cjs +1 -0
  43. package/dist/components/CountdownTimer/CountdownTimer.utils.d.ts +3 -0
  44. package/dist/components/CountdownTimer/CountdownTimer.utils.js +16 -0
  45. package/dist/components/Dock/Dock.cjs +1 -1
  46. package/dist/components/Dock/Dock.js +38 -43
  47. package/dist/components/Dock/Dock.utils.cjs +1 -0
  48. package/dist/components/Dock/Dock.utils.d.ts +1 -0
  49. package/dist/components/Dock/Dock.utils.js +10 -0
  50. package/dist/components/Dropdown/Dropdown.cjs +1 -1
  51. package/dist/components/Dropdown/Dropdown.js +59 -60
  52. package/dist/components/FileTree/FileTree.cjs +1 -1
  53. package/dist/components/FileTree/FileTree.js +20 -32
  54. package/dist/components/FileTree/FileTree.utils.cjs +1 -0
  55. package/dist/components/FileTree/FileTree.utils.d.ts +4 -0
  56. package/dist/components/FileTree/FileTree.utils.js +15 -0
  57. package/dist/components/GradientText/GradientText.cjs +1 -1
  58. package/dist/components/GradientText/GradientText.js +27 -29
  59. package/dist/components/Icon/icons/bear.cjs +1 -0
  60. package/dist/components/Icon/icons/bear.d.ts +12 -0
  61. package/dist/components/Icon/icons/bear.js +47 -0
  62. package/dist/components/Icon/index.cjs +1 -1
  63. package/dist/components/Icon/index.d.ts +18 -0
  64. package/dist/components/Icon/index.js +17 -15
  65. package/dist/components/InfiniteScroll/InfiniteScroll.cjs +1 -1
  66. package/dist/components/InfiniteScroll/InfiniteScroll.const.cjs +1 -1
  67. package/dist/components/InfiniteScroll/InfiniteScroll.const.js +6 -7
  68. package/dist/components/InfiniteScroll/InfiniteScroll.js +41 -41
  69. package/dist/components/MentionsInput/MentionsInput.cjs +1 -1
  70. package/dist/components/MentionsInput/MentionsInput.js +64 -68
  71. package/dist/components/MentionsInput/MentionsInput.utils.cjs +1 -0
  72. package/dist/components/MentionsInput/MentionsInput.utils.d.ts +2 -0
  73. package/dist/components/MentionsInput/MentionsInput.utils.js +9 -0
  74. package/dist/components/PageNav/PageNav.cjs +1 -0
  75. package/dist/components/PageNav/PageNav.const.cjs +1 -0
  76. package/dist/components/PageNav/PageNav.const.d.ts +22 -0
  77. package/dist/components/PageNav/PageNav.const.js +42 -0
  78. package/dist/components/PageNav/PageNav.d.ts +3 -0
  79. package/dist/components/PageNav/PageNav.js +81 -0
  80. package/dist/components/PageNav/PageNav.types.d.ts +17 -0
  81. package/dist/components/PageNav/index.d.ts +2 -0
  82. package/dist/components/Progress/Progress.cjs +1 -1
  83. package/dist/components/Progress/Progress.js +6 -6
  84. package/dist/components/PropsPlayground/PropsPlayground.cjs +1 -0
  85. package/dist/components/PropsPlayground/PropsPlayground.const.cjs +1 -0
  86. package/dist/components/PropsPlayground/PropsPlayground.const.d.ts +11 -0
  87. package/dist/components/PropsPlayground/PropsPlayground.const.js +23 -0
  88. package/dist/components/PropsPlayground/PropsPlayground.d.ts +3 -0
  89. package/dist/components/PropsPlayground/PropsPlayground.js +221 -0
  90. package/dist/components/PropsPlayground/PropsPlayground.types.d.ts +29 -0
  91. package/dist/components/PropsPlayground/PropsPlayground.utils.cjs +1 -0
  92. package/dist/components/PropsPlayground/PropsPlayground.utils.d.ts +2 -0
  93. package/dist/components/PropsPlayground/PropsPlayground.utils.js +9 -0
  94. package/dist/components/PropsPlayground/index.d.ts +2 -0
  95. package/dist/components/Select/Select.cjs +1 -1
  96. package/dist/components/Select/Select.js +28 -30
  97. package/dist/components/SignPad/SignPad.cjs +1 -1
  98. package/dist/components/SignPad/SignPad.js +24 -24
  99. package/dist/components/Skeleton/Skeleton.cjs +1 -1
  100. package/dist/components/Skeleton/Skeleton.js +89 -94
  101. package/dist/components/Skeleton/Skeleton.utils.cjs +1 -0
  102. package/dist/components/Skeleton/Skeleton.utils.d.ts +1 -0
  103. package/dist/components/Skeleton/Skeleton.utils.js +10 -0
  104. package/dist/components/SliderRange/SliderRange.cjs +1 -1
  105. package/dist/components/SliderRange/SliderRange.js +61 -63
  106. package/dist/components/SliderRange/SliderRange.utils.cjs +1 -0
  107. package/dist/components/SliderRange/SliderRange.utils.d.ts +1 -0
  108. package/dist/components/SliderRange/SliderRange.utils.js +7 -0
  109. package/dist/components/Spotlight/Spotlight.cjs +1 -1
  110. package/dist/components/Spotlight/Spotlight.js +62 -73
  111. package/dist/components/Spotlight/Spotlight.utils.cjs +1 -0
  112. package/dist/components/Spotlight/Spotlight.utils.d.ts +3 -0
  113. package/dist/components/Spotlight/Spotlight.utils.js +18 -0
  114. package/dist/components/Tabs/Tabs.cjs +1 -1
  115. package/dist/components/Tabs/Tabs.js +39 -38
  116. package/dist/components/Tabs/Tabs.types.d.ts +3 -1
  117. package/dist/components/Toast/Toast.cjs +1 -1
  118. package/dist/components/Toast/Toast.js +18 -17
  119. package/dist/components/Toast/Toast.utils.cjs +1 -0
  120. package/dist/components/Toast/Toast.utils.d.ts +1 -0
  121. package/dist/components/Toast/Toast.utils.js +4 -0
  122. package/dist/components/Tooltip/Tooltip.cjs +1 -1
  123. package/dist/components/Tooltip/Tooltip.js +10 -11
  124. package/dist/components/Tour/Tour.cjs +1 -1
  125. package/dist/components/Tour/Tour.js +1 -2
  126. package/dist/components/VirtualList/VirtualList.cjs +1 -1
  127. package/dist/components/VirtualList/VirtualList.js +38 -43
  128. package/dist/components/index.cjs +1 -1
  129. package/dist/components/index.d.ts +4 -0
  130. package/dist/components/index.js +66 -62
  131. package/dist/hooks/index.cjs +1 -1
  132. package/dist/hooks/index.d.ts +2 -0
  133. package/dist/hooks/index.js +60 -58
  134. package/dist/hooks/useResizeObserver/index.d.ts +2 -0
  135. package/dist/hooks/useResizeObserver/useResizeObserver.cjs +1 -0
  136. package/dist/hooks/useResizeObserver/useResizeObserver.d.ts +3 -0
  137. package/dist/hooks/useResizeObserver/useResizeObserver.js +20 -0
  138. package/dist/hooks/useResizeObserver/useResizeObserver.types.d.ts +8 -0
  139. package/dist/icons.cjs +1 -0
  140. package/dist/icons.d.ts +2 -0
  141. package/dist/icons.js +6 -0
  142. package/dist/index.cjs +1 -1
  143. package/dist/index.js +175 -169
  144. package/dist/styles/_base.css +7 -3
  145. package/dist/styles.css +1 -1
  146. package/package.json +6 -1
package/README.md CHANGED
@@ -284,6 +284,25 @@ const buttonProps: ButtonProps = {
284
284
  <Button {...buttonProps} />
285
285
  ```
286
286
 
287
+ ## How Bear Compares
288
+
289
+ | Feature | Bear UI | MUI | Ant Design | Chakra UI |
290
+ |---------|---------|-----|------------|-----------|
291
+ | **Tailwind CSS native** | Yes | No | No | Partial (v3) |
292
+ | **Bundle (tree-shaken)** | ~18 kB | ~80 kB | ~120 kB | ~45 kB |
293
+ | **Dark mode** | `dark:` variants, zero JS | Runtime theme swap | CSS vars + config | ColorMode context |
294
+ | **TypeScript** | 100 % | 100 % | 100 % | 100 % |
295
+ | **Components** | 60+ | 50+ | 60+ | 30+ |
296
+ | **Theming** | BearProvider + Tailwind | Emotion/styled | Less/CSS vars | Styled System |
297
+ | **Modular CSS** | `@BearInclude` PostCSS | N/A | N/A | N/A |
298
+ | **React 18 / 19** | Yes | Yes | Yes | Yes |
299
+ | **Zero runtime CSS-in-JS** | Yes | No (Emotion) | No (Less) | No (Emotion) |
300
+ | **Built-in i18n** | Portal (en/es) | MUI X | ConfigProvider | N/A |
301
+
302
+ ## Contributing
303
+
304
+ See [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines on adding components, coding rules, and the portal development workflow.
305
+
287
306
  ## License
288
307
 
289
308
  MIT
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("react/jsx-runtime"),b=require("react"),p=require("../../utils/cn.cjs"),L=require("../Typography/Typography.cjs"),s=require("./Anchor.const.cjs");function N(E){const c=[],o=d=>{d.forEach(i=>{var l;c.push(i.id),(l=i.children)!=null&&l.length&&o(i.children)})};return o(E),c}const C=E=>{const{links:c,offset:o=s.DEFAULT_OFFSET,affix:d=!1,affixTop:i=s.DEFAULT_AFFIX_TOP,targetOffset:l=s.DEFAULT_TARGET_OFFSET,onClick:u,className:A,testId:I,...m}=E,[v,y]=b.useState(null),f=b.useRef(null),h=N(c),g=b.useCallback(e=>{const n=document.getElementById(e);if(n){const t=n.getBoundingClientRect().top+window.scrollY-l;window.scrollTo({top:t,behavior:"smooth"})}u==null||u(e)},[l,u]);b.useEffect(()=>{if(h.length!==0)return f.current=new IntersectionObserver(e=>{const n=e.filter(t=>t.isIntersecting).sort((t,r)=>{const a=t.boundingClientRect.top,x=r.boundingClientRect.top;return Math.abs(a-o)-Math.abs(x-o)});if(n.length>0){const r=n[0].target.id;h.includes(r)&&y(r)}},{rootMargin:`-${o}px 0px -50% 0px`,threshold:[0,.25,.5,.75,1]}),h.forEach(e=>{var t;const n=document.getElementById(e);n&&((t=f.current)==null||t.observe(n))}),()=>{var e;(e=f.current)==null||e.disconnect(),f.current=null}},[h.join(","),o]);const S=(e,n)=>{var r;const t=v===e.id;return T.jsxs("div",{className:p.cn(n&&s.NESTED_LINK_INDENT),children:[T.jsx("div",{role:"button",tabIndex:0,onClick:()=>g(e.id),onKeyDown:a=>a.key==="Enter"&&g(e.id),className:p.cn(s.LINK_CLASSES,t&&s.ACTIVE_LINK_CLASSES),children:T.jsx(L.Typography,{variant:"body2",className:p.cn(t&&"bear-font-medium"),children:e.label})}),(r=e.children)==null?void 0:r.map(a=>S(a,!0))]},e.id)},_=p.cn(s.ROOT_CLASS,s.ROOT_CLASSES,d&&"bear-sticky",A);return T.jsx("nav",{className:_,style:d?{top:i}:void 0,"data-testid":I,...m,children:c.map(e=>S(e,!1))})};exports.Anchor=C;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),u=require("react"),f=require("../../utils/cn.cjs"),L=require("../Typography/Typography.cjs"),s=require("./Anchor.const.cjs"),N=require("./Anchor.utils.cjs"),C=S=>{const{links:T,offset:c=s.DEFAULT_OFFSET,affix:h=!1,affixTop:g=s.DEFAULT_AFFIX_TOP,targetOffset:b=s.DEFAULT_TARGET_OFFSET,onClick:i,className:m,testId:A,...I}=S,[v,_]=u.useState(null),l=u.useRef(null),a=N.collectIds(T),p=u.useCallback(e=>{const n=document.getElementById(e);if(n){const t=n.getBoundingClientRect().top+window.scrollY-b;window.scrollTo({top:t,behavior:"smooth"})}i==null||i(e)},[b,i]);u.useEffect(()=>{if(a.length!==0)return l.current=new IntersectionObserver(e=>{const n=e.filter(t=>t.isIntersecting).sort((t,o)=>{const r=t.boundingClientRect.top,x=o.boundingClientRect.top;return Math.abs(r-c)-Math.abs(x-c)});if(n.length>0){const o=n[0].target.id;a.includes(o)&&_(o)}},{rootMargin:`-${c}px 0px -50% 0px`,threshold:[0,.25,.5,.75,1]}),a.forEach(e=>{var t;const n=document.getElementById(e);n&&((t=l.current)==null||t.observe(n))}),()=>{var e;(e=l.current)==null||e.disconnect(),l.current=null}},[a.join(","),c]);const E=(e,n)=>{var o;const t=v===e.id;return d.jsxs("div",{className:f.cn(n&&s.NESTED_LINK_INDENT),children:[d.jsx("div",{role:"button",tabIndex:0,onClick:()=>p(e.id),onKeyDown:r=>r.key==="Enter"&&p(e.id),className:f.cn(s.LINK_CLASSES,t&&s.ACTIVE_LINK_CLASSES),children:d.jsx(L.Typography,{variant:"body2",className:f.cn(t&&"bear-font-medium"),children:e.label})}),(o=e.children)==null?void 0:o.map(r=>E(r,!0))]},e.id)},y=f.cn(s.ROOT_CLASS,s.ROOT_CLASSES,h&&"bear-sticky",m);return d.jsx("nav",{className:y,style:h?{top:g}:void 0,"data-testid":A,...I,children:T.map(e=>E(e,!1))})};exports.Anchor=C;
@@ -1,91 +1,83 @@
1
- import { jsx as h, jsxs as L } from "react/jsx-runtime";
1
+ import { jsx as d, jsxs as L } from "react/jsx-runtime";
2
2
  import { useState as N, useRef as C, useCallback as x, useEffect as y } from "react";
3
- import { cn as m } from "../../utils/cn.js";
3
+ import { cn as a } from "../../utils/cn.js";
4
4
  import { Typography as F } from "../Typography/Typography.js";
5
5
  import { DEFAULT_OFFSET as O, DEFAULT_AFFIX_TOP as R, DEFAULT_TARGET_OFFSET as w, ROOT_CLASSES as D, ROOT_CLASS as K, ACTIVE_LINK_CLASSES as j, LINK_CLASSES as B, NESTED_LINK_INDENT as M } from "./Anchor.const.js";
6
- function U(p) {
7
- const r = [], n = (a) => {
8
- a.forEach((c) => {
9
- var i;
10
- r.push(c.id), (i = c.children) != null && i.length && n(c.children);
11
- });
12
- };
13
- return n(p), r;
14
- }
15
- const Y = (p) => {
6
+ import { collectIds as U } from "./Anchor.utils.js";
7
+ const k = (E) => {
16
8
  const {
17
- links: r,
18
- offset: n = O,
19
- affix: a = !1,
20
- affixTop: c = R,
21
- targetOffset: i = w,
22
- onClick: d,
23
- className: b,
9
+ links: f,
10
+ offset: r = O,
11
+ affix: m = !1,
12
+ affixTop: b = R,
13
+ targetOffset: u = w,
14
+ onClick: c,
15
+ className: h,
24
16
  testId: I,
25
17
  ...S
26
- } = p, [g, v] = N(null), f = C(null), u = U(r), E = x(
18
+ } = E, [g, v] = N(null), i = C(null), l = U(f), p = x(
27
19
  (t) => {
28
20
  const o = document.getElementById(t);
29
21
  if (o) {
30
- const e = o.getBoundingClientRect().top + window.scrollY - i;
22
+ const e = o.getBoundingClientRect().top + window.scrollY - u;
31
23
  window.scrollTo({ top: e, behavior: "smooth" });
32
24
  }
33
- d == null || d(t);
25
+ c == null || c(t);
34
26
  },
35
- [i, d]
27
+ [u, c]
36
28
  );
37
29
  y(() => {
38
- if (u.length !== 0)
39
- return f.current = new IntersectionObserver(
30
+ if (l.length !== 0)
31
+ return i.current = new IntersectionObserver(
40
32
  (t) => {
41
33
  const o = t.filter((e) => e.isIntersecting).sort((e, s) => {
42
- const l = e.boundingClientRect.top, _ = s.boundingClientRect.top;
43
- return Math.abs(l - n) - Math.abs(_ - n);
34
+ const n = e.boundingClientRect.top, _ = s.boundingClientRect.top;
35
+ return Math.abs(n - r) - Math.abs(_ - r);
44
36
  });
45
37
  if (o.length > 0) {
46
38
  const s = o[0].target.id;
47
- u.includes(s) && v(s);
39
+ l.includes(s) && v(s);
48
40
  }
49
41
  },
50
- { rootMargin: `-${n}px 0px -50% 0px`, threshold: [0, 0.25, 0.5, 0.75, 1] }
51
- ), u.forEach((t) => {
42
+ { rootMargin: `-${r}px 0px -50% 0px`, threshold: [0, 0.25, 0.5, 0.75, 1] }
43
+ ), l.forEach((t) => {
52
44
  var e;
53
45
  const o = document.getElementById(t);
54
- o && ((e = f.current) == null || e.observe(o));
46
+ o && ((e = i.current) == null || e.observe(o));
55
47
  }), () => {
56
48
  var t;
57
- (t = f.current) == null || t.disconnect(), f.current = null;
49
+ (t = i.current) == null || t.disconnect(), i.current = null;
58
50
  };
59
- }, [u.join(","), n]);
51
+ }, [l.join(","), r]);
60
52
  const T = (t, o) => {
61
53
  var s;
62
54
  const e = g === t.id;
63
- return /* @__PURE__ */ L("div", { className: m(o && M), children: [
64
- /* @__PURE__ */ h(
55
+ return /* @__PURE__ */ L("div", { className: a(o && M), children: [
56
+ /* @__PURE__ */ d(
65
57
  "div",
66
58
  {
67
59
  role: "button",
68
60
  tabIndex: 0,
69
- onClick: () => E(t.id),
70
- onKeyDown: (l) => l.key === "Enter" && E(t.id),
71
- className: m(B, e && j),
72
- children: /* @__PURE__ */ h(F, { variant: "body2", className: m(e && "bear-font-medium"), children: t.label })
61
+ onClick: () => p(t.id),
62
+ onKeyDown: (n) => n.key === "Enter" && p(t.id),
63
+ className: a(B, e && j),
64
+ children: /* @__PURE__ */ d(F, { variant: "body2", className: a(e && "bear-font-medium"), children: t.label })
73
65
  }
74
66
  ),
75
- (s = t.children) == null ? void 0 : s.map((l) => T(l, !0))
67
+ (s = t.children) == null ? void 0 : s.map((n) => T(n, !0))
76
68
  ] }, t.id);
77
- }, A = m(K, D, a && "bear-sticky", b);
78
- return /* @__PURE__ */ h(
69
+ }, A = a(K, D, m && "bear-sticky", h);
70
+ return /* @__PURE__ */ d(
79
71
  "nav",
80
72
  {
81
73
  className: A,
82
- style: a ? { top: c } : void 0,
74
+ style: m ? { top: b } : void 0,
83
75
  "data-testid": I,
84
76
  ...S,
85
- children: r.map((t) => T(t, !1))
77
+ children: f.map((t) => T(t, !1))
86
78
  }
87
79
  );
88
80
  };
89
81
  export {
90
- Y as Anchor
82
+ k as Anchor
91
83
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function r(n){const e=[],l=o=>{o.forEach(c=>{var t;e.push(c.id),(t=c.children)!=null&&t.length&&l(c.children)})};return l(n),e}exports.collectIds=r;
@@ -0,0 +1,2 @@
1
+ import { AnchorLink } from './Anchor.types';
2
+ export declare function collectIds(links: AnchorLink[]): string[];
@@ -0,0 +1,12 @@
1
+ function h(r) {
2
+ const n = [], l = (d) => {
3
+ d.forEach((c) => {
4
+ var o;
5
+ n.push(c.id), (o = c.children) != null && o.length && l(c.children);
6
+ });
7
+ };
8
+ return l(r), n;
9
+ }
10
+ export {
11
+ h as collectIds
12
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),s=require("react"),f=require("../../utils/cn.cjs"),z=(g,b)=>{const t=b.toLowerCase();return g.filter(l=>{var i;return l.label.toLowerCase().includes(t)||l.value.toLowerCase().includes(t)||((i=l.description)==null?void 0:i.toLowerCase().includes(t))})},I=({options:g,value:b="",onChange:t,onSelect:l,placeholder:i="Start typing...",label:w,helperText:k,error:d,disabled:u=!1,freeSolo:p=!1,loading:v=!1,filterOptions:D=z,className:E,testId:L})=>{const[x,n]=s.useState(!1),[o,m]=s.useState(-1),y=s.useRef(null),j=s.useRef(null),h=s.useRef(null),c=D(g,b);s.useEffect(()=>{const e=a=>{y.current&&!y.current.contains(a.target)&&n(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),s.useEffect(()=>{m(-1)},[b]),s.useEffect(()=>{if(o>=0&&h.current){const e=h.current.children[o];e&&e.scrollIntoView({block:"nearest"})}},[o]);const R=e=>{const a=e.target.value;t==null||t(a),n(!0)},N=e=>{var a;t==null||t(e.label),l==null||l(e),n(!1),(a=j.current)==null||a.blur()},A=e=>{if(!x){(e.key==="ArrowDown"||e.key==="ArrowUp")&&(n(!0),e.preventDefault());return}switch(e.key){case"ArrowDown":e.preventDefault(),m(a=>a<c.length-1?a+1:0);break;case"ArrowUp":e.preventDefault(),m(a=>a>0?a-1:c.length-1);break;case"Enter":e.preventDefault(),o>=0&&c[o]?N(c[o]):p&&b&&n(!1);break;case"Escape":n(!1);break}};return r.jsxs("div",{className:f.cn("bear-w-full bear-relative",E),ref:y,"data-testid":L,children:[w&&r.jsx("label",{className:"bear-block bear-text-sm bear-font-medium bear-text-gray-700 dark:bear-text-gray-200 bear-mb-1.5",children:w}),r.jsxs("div",{className:"bear-relative",children:[r.jsx("input",{ref:j,type:"text",value:b,onChange:R,onFocus:()=>n(!0),onKeyDown:A,placeholder:i,disabled:u,className:f.cn("bear-w-full bear-px-4 bear-py-2.5 bear-pr-10 bear-rounded-lg bear-border","bear-bg-white dark:bear-bg-gray-900","bear-text-sm bear-text-gray-900 dark:bear-text-white","placeholder:bear-text-gray-400","bear-transition-colors bear-outline-none",d?"bear-border-red-500 focus:bear-ring-2 focus:bear-ring-red-500/20":"bear-border-gray-300 dark:bear-border-gray-600 focus:bear-border-amber-500 focus:bear-ring-2 focus:bear-ring-amber-500/20",u&&"bear-opacity-50 bear-cursor-not-allowed bear-bg-gray-100 dark:bear-bg-gray-800")}),r.jsx("div",{className:"bear-absolute bear-right-3 bear-top-1/2 bear-transform bear--translate-y-1/2",children:v?r.jsxs("svg",{className:"bear-animate-spin bear-w-4 bear-h-4 bear-text-gray-400",viewBox:"0 0 24 24",fill:"none",children:[r.jsx("circle",{className:"bear-opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.jsx("path",{className:"bear-opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):r.jsx("svg",{className:"bear-w-4 bear-h-4 bear-text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})})]}),x&&!u&&c.length>0&&r.jsx("div",{ref:h,className:"bear-absolute bear-z-50 bear-w-full bear-mt-1 bear-py-1 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-max-h-60 bear-overflow-auto",children:c.map((e,a)=>r.jsxs("button",{type:"button",disabled:e.disabled,onClick:()=>N(e),className:f.cn("bear-w-full bear-px-4 bear-py-2 bear-text-left bear-text-sm bear-transition-colors","bear-text-gray-900 dark:bear-text-white",a===o?"bear-bg-amber-50 dark:bear-bg-amber-900/20":"hover:bear-bg-gray-50 dark:hover:bear-bg-gray-700",e.disabled&&"bear-opacity-50 bear-cursor-not-allowed"),children:[r.jsx("div",{className:"bear-font-medium",children:e.label}),e.description&&r.jsx("div",{className:"bear-text-xs bear-text-gray-500 dark:bear-text-gray-400 bear-mt-0.5",children:e.description})]},e.value))}),x&&!u&&c.length===0&&b&&!v&&r.jsx("div",{className:"bear-absolute bear-z-50 bear-w-full bear-mt-1 bear-py-3 bear-px-4 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-text-sm bear-text-gray-500",children:p?"Press Enter to use this value":"No results found"}),(k||d)&&r.jsx("p",{className:f.cn("bear-mt-1.5 bear-text-xs",d?"bear-text-red-500":"bear-text-gray-500 dark:bear-text-gray-400"),children:d||k})]})};exports.Autocomplete=I;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),t=require("react"),d=require("../../utils/cn.cjs"),I=require("./Autocomplete.utils.cjs"),O=({options:j,value:o="",onChange:n,onSelect:u,placeholder:N="Start typing...",label:y,helperText:h,error:c,disabled:i=!1,freeSolo:p=!1,loading:w=!1,filterOptions:A=I.defaultFilter,className:D,testId:E})=>{const[f,s]=t.useState(!1),[b,g]=t.useState(-1),x=t.useRef(null),k=t.useRef(null),m=t.useRef(null),l=A(j,o);t.useEffect(()=>{const e=a=>{x.current&&!x.current.contains(a.target)&&s(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),t.useEffect(()=>{g(-1)},[o]),t.useEffect(()=>{if(b>=0&&m.current){const e=m.current.children[b];e&&e.scrollIntoView({block:"nearest"})}},[b]);const R=e=>{const a=e.target.value;n==null||n(a),s(!0)},v=e=>{var a;n==null||n(e.label),u==null||u(e),s(!1),(a=k.current)==null||a.blur()},z=e=>{if(!f){(e.key==="ArrowDown"||e.key==="ArrowUp")&&(s(!0),e.preventDefault());return}switch(e.key){case"ArrowDown":e.preventDefault(),g(a=>a<l.length-1?a+1:0);break;case"ArrowUp":e.preventDefault(),g(a=>a>0?a-1:l.length-1);break;case"Enter":e.preventDefault(),b>=0&&l[b]?v(l[b]):p&&o&&s(!1);break;case"Escape":s(!1);break}};return r.jsxs("div",{className:d.cn("bear-w-full bear-relative",D),ref:x,"data-testid":E,children:[y&&r.jsx("label",{className:"bear-block bear-text-sm bear-font-medium bear-text-gray-700 dark:bear-text-gray-200 bear-mb-1.5",children:y}),r.jsxs("div",{className:"bear-relative",children:[r.jsx("input",{ref:k,type:"text",value:o,onChange:R,onFocus:()=>s(!0),onKeyDown:z,placeholder:N,disabled:i,className:d.cn("bear-w-full bear-px-4 bear-py-2.5 bear-pr-10 bear-rounded-lg bear-border","bear-bg-white dark:bear-bg-gray-900","bear-text-sm bear-text-gray-900 dark:bear-text-white","placeholder:bear-text-gray-400","bear-transition-colors bear-outline-none",c?"bear-border-red-500 focus:bear-ring-2 focus:bear-ring-red-500/20":"bear-border-gray-300 dark:bear-border-gray-600 focus:bear-border-amber-500 focus:bear-ring-2 focus:bear-ring-amber-500/20",i&&"bear-opacity-50 bear-cursor-not-allowed bear-bg-gray-100 dark:bear-bg-gray-800")}),r.jsx("div",{className:"bear-absolute bear-right-3 bear-top-1/2 bear-transform bear--translate-y-1/2",children:w?r.jsxs("svg",{className:"bear-animate-spin bear-w-4 bear-h-4 bear-text-gray-400",viewBox:"0 0 24 24",fill:"none",children:[r.jsx("circle",{className:"bear-opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.jsx("path",{className:"bear-opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):r.jsx("svg",{className:"bear-w-4 bear-h-4 bear-text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})})]}),f&&!i&&l.length>0&&r.jsx("div",{ref:m,className:"bear-absolute bear-z-50 bear-w-full bear-mt-1 bear-py-1 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-max-h-60 bear-overflow-auto",children:l.map((e,a)=>r.jsxs("button",{type:"button",disabled:e.disabled,onClick:()=>v(e),className:d.cn("bear-w-full bear-px-4 bear-py-2 bear-text-left bear-text-sm bear-transition-colors","bear-text-gray-900 dark:bear-text-white",a===b?"bear-bg-amber-50 dark:bear-bg-amber-900/20":"hover:bear-bg-gray-50 dark:hover:bear-bg-gray-700",e.disabled&&"bear-opacity-50 bear-cursor-not-allowed"),children:[r.jsx("div",{className:"bear-font-medium",children:e.label}),e.description&&r.jsx("div",{className:"bear-text-xs bear-text-gray-500 dark:bear-text-gray-400 bear-mt-0.5",children:e.description})]},e.value))}),f&&!i&&l.length===0&&o&&!w&&r.jsx("div",{className:"bear-absolute bear-z-50 bear-w-full bear-mt-1 bear-py-3 bear-px-4 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-text-sm bear-text-gray-500",children:p?"Press Enter to use this value":"No results found"}),(h||c)&&r.jsx("p",{className:d.cn("bear-mt-1.5 bear-text-xs",c?"bear-text-red-500":"bear-text-gray-500 dark:bear-text-gray-400"),children:c||h})]})};exports.Autocomplete=O;
@@ -1,119 +1,112 @@
1
- import { jsxs as u, jsx as a } from "react/jsx-runtime";
2
- import { useState as E, useRef as x, useEffect as p } from "react";
3
- import { cn as f } from "../../utils/cn.js";
4
- const C = (g, b) => {
5
- const t = b.toLowerCase();
6
- return g.filter(
7
- (s) => {
8
- var i;
9
- return s.label.toLowerCase().includes(t) || s.value.toLowerCase().includes(t) || ((i = s.description) == null ? void 0 : i.toLowerCase().includes(t));
10
- }
11
- );
12
- }, H = ({
13
- options: g,
14
- value: b = "",
15
- onChange: t,
16
- onSelect: s,
17
- placeholder: i = "Start typing...",
18
- label: k,
19
- helperText: v,
20
- error: c,
21
- disabled: d = !1,
22
- freeSolo: N = !1,
23
- loading: D = !1,
24
- filterOptions: z = C,
25
- className: I,
1
+ import { jsxs as d, jsx as a } from "react/jsx-runtime";
2
+ import { useState as A, useRef as h, useEffect as x } from "react";
3
+ import { cn as c } from "../../utils/cn.js";
4
+ import { defaultFilter as V } from "./Autocomplete.utils.js";
5
+ const M = ({
6
+ options: E,
7
+ value: o = "",
8
+ onChange: l,
9
+ onSelect: u,
10
+ placeholder: z = "Start typing...",
11
+ label: p,
12
+ helperText: w,
13
+ error: n,
14
+ disabled: i = !1,
15
+ freeSolo: k = !1,
16
+ loading: v = !1,
17
+ filterOptions: I = V,
18
+ className: L,
26
19
  testId: O
27
20
  }) => {
28
- const [m, l] = E(!1), [o, y] = E(-1), h = x(null), L = x(null), w = x(null), n = z(g, b);
29
- p(() => {
21
+ const [m, t] = A(!1), [b, f] = A(-1), g = h(null), N = h(null), y = h(null), s = I(E, o);
22
+ x(() => {
30
23
  const e = (r) => {
31
- h.current && !h.current.contains(r.target) && l(!1);
24
+ g.current && !g.current.contains(r.target) && t(!1);
32
25
  };
33
26
  return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
34
- }, []), p(() => {
35
- y(-1);
36
- }, [b]), p(() => {
37
- if (o >= 0 && w.current) {
38
- const e = w.current.children[o];
27
+ }, []), x(() => {
28
+ f(-1);
29
+ }, [o]), x(() => {
30
+ if (b >= 0 && y.current) {
31
+ const e = y.current.children[b];
39
32
  e && e.scrollIntoView({ block: "nearest" });
40
33
  }
41
- }, [o]);
34
+ }, [b]);
42
35
  const R = (e) => {
43
36
  const r = e.target.value;
44
- t == null || t(r), l(!0);
45
- }, A = (e) => {
37
+ l == null || l(r), t(!0);
38
+ }, D = (e) => {
46
39
  var r;
47
- t == null || t(e.label), s == null || s(e), l(!1), (r = L.current) == null || r.blur();
40
+ l == null || l(e.label), u == null || u(e), t(!1), (r = N.current) == null || r.blur();
48
41
  }, j = (e) => {
49
42
  if (!m) {
50
- (e.key === "ArrowDown" || e.key === "ArrowUp") && (l(!0), e.preventDefault());
43
+ (e.key === "ArrowDown" || e.key === "ArrowUp") && (t(!0), e.preventDefault());
51
44
  return;
52
45
  }
53
46
  switch (e.key) {
54
47
  case "ArrowDown":
55
- e.preventDefault(), y(
56
- (r) => r < n.length - 1 ? r + 1 : 0
48
+ e.preventDefault(), f(
49
+ (r) => r < s.length - 1 ? r + 1 : 0
57
50
  );
58
51
  break;
59
52
  case "ArrowUp":
60
- e.preventDefault(), y(
61
- (r) => r > 0 ? r - 1 : n.length - 1
53
+ e.preventDefault(), f(
54
+ (r) => r > 0 ? r - 1 : s.length - 1
62
55
  );
63
56
  break;
64
57
  case "Enter":
65
- e.preventDefault(), o >= 0 && n[o] ? A(n[o]) : N && b && l(!1);
58
+ e.preventDefault(), b >= 0 && s[b] ? D(s[b]) : k && o && t(!1);
66
59
  break;
67
60
  case "Escape":
68
- l(!1);
61
+ t(!1);
69
62
  break;
70
63
  }
71
64
  };
72
- return /* @__PURE__ */ u("div", { className: f("bear-w-full bear-relative", I), ref: h, "data-testid": O, children: [
73
- k && /* @__PURE__ */ a("label", { className: "bear-block bear-text-sm bear-font-medium bear-text-gray-700 dark:bear-text-gray-200 bear-mb-1.5", children: k }),
74
- /* @__PURE__ */ u("div", { className: "bear-relative", children: [
65
+ return /* @__PURE__ */ d("div", { className: c("bear-w-full bear-relative", L), ref: g, "data-testid": O, children: [
66
+ p && /* @__PURE__ */ a("label", { className: "bear-block bear-text-sm bear-font-medium bear-text-gray-700 dark:bear-text-gray-200 bear-mb-1.5", children: p }),
67
+ /* @__PURE__ */ d("div", { className: "bear-relative", children: [
75
68
  /* @__PURE__ */ a(
76
69
  "input",
77
70
  {
78
- ref: L,
71
+ ref: N,
79
72
  type: "text",
80
- value: b,
73
+ value: o,
81
74
  onChange: R,
82
- onFocus: () => l(!0),
75
+ onFocus: () => t(!0),
83
76
  onKeyDown: j,
84
- placeholder: i,
85
- disabled: d,
86
- className: f(
77
+ placeholder: z,
78
+ disabled: i,
79
+ className: c(
87
80
  "bear-w-full bear-px-4 bear-py-2.5 bear-pr-10 bear-rounded-lg bear-border",
88
81
  "bear-bg-white dark:bear-bg-gray-900",
89
82
  "bear-text-sm bear-text-gray-900 dark:bear-text-white",
90
83
  "placeholder:bear-text-gray-400",
91
84
  "bear-transition-colors bear-outline-none",
92
- c ? "bear-border-red-500 focus:bear-ring-2 focus:bear-ring-red-500/20" : "bear-border-gray-300 dark:bear-border-gray-600 focus:bear-border-amber-500 focus:bear-ring-2 focus:bear-ring-amber-500/20",
93
- d && "bear-opacity-50 bear-cursor-not-allowed bear-bg-gray-100 dark:bear-bg-gray-800"
85
+ n ? "bear-border-red-500 focus:bear-ring-2 focus:bear-ring-red-500/20" : "bear-border-gray-300 dark:bear-border-gray-600 focus:bear-border-amber-500 focus:bear-ring-2 focus:bear-ring-amber-500/20",
86
+ i && "bear-opacity-50 bear-cursor-not-allowed bear-bg-gray-100 dark:bear-bg-gray-800"
94
87
  )
95
88
  }
96
89
  ),
97
- /* @__PURE__ */ a("div", { className: "bear-absolute bear-right-3 bear-top-1/2 bear-transform bear--translate-y-1/2", children: D ? /* @__PURE__ */ u("svg", { className: "bear-animate-spin bear-w-4 bear-h-4 bear-text-gray-400", viewBox: "0 0 24 24", fill: "none", children: [
90
+ /* @__PURE__ */ a("div", { className: "bear-absolute bear-right-3 bear-top-1/2 bear-transform bear--translate-y-1/2", children: v ? /* @__PURE__ */ d("svg", { className: "bear-animate-spin bear-w-4 bear-h-4 bear-text-gray-400", viewBox: "0 0 24 24", fill: "none", children: [
98
91
  /* @__PURE__ */ a("circle", { className: "bear-opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
99
92
  /* @__PURE__ */ a("path", { className: "bear-opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })
100
93
  ] }) : /* @__PURE__ */ a("svg", { className: "bear-w-4 bear-h-4 bear-text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ a("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }) })
101
94
  ] }),
102
- m && !d && n.length > 0 && /* @__PURE__ */ a(
95
+ m && !i && s.length > 0 && /* @__PURE__ */ a(
103
96
  "div",
104
97
  {
105
- ref: w,
98
+ ref: y,
106
99
  className: "bear-absolute bear-z-50 bear-w-full bear-mt-1 bear-py-1 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-max-h-60 bear-overflow-auto",
107
- children: n.map((e, r) => /* @__PURE__ */ u(
100
+ children: s.map((e, r) => /* @__PURE__ */ d(
108
101
  "button",
109
102
  {
110
103
  type: "button",
111
104
  disabled: e.disabled,
112
- onClick: () => A(e),
113
- className: f(
105
+ onClick: () => D(e),
106
+ className: c(
114
107
  "bear-w-full bear-px-4 bear-py-2 bear-text-left bear-text-sm bear-transition-colors",
115
108
  "bear-text-gray-900 dark:bear-text-white",
116
- r === o ? "bear-bg-amber-50 dark:bear-bg-amber-900/20" : "hover:bear-bg-gray-50 dark:hover:bear-bg-gray-700",
109
+ r === b ? "bear-bg-amber-50 dark:bear-bg-amber-900/20" : "hover:bear-bg-gray-50 dark:hover:bear-bg-gray-700",
117
110
  e.disabled && "bear-opacity-50 bear-cursor-not-allowed"
118
111
  ),
119
112
  children: [
@@ -125,13 +118,13 @@ const C = (g, b) => {
125
118
  ))
126
119
  }
127
120
  ),
128
- m && !d && n.length === 0 && b && !D && /* @__PURE__ */ a("div", { className: "bear-absolute bear-z-50 bear-w-full bear-mt-1 bear-py-3 bear-px-4 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-text-sm bear-text-gray-500", children: N ? "Press Enter to use this value" : "No results found" }),
129
- (v || c) && /* @__PURE__ */ a("p", { className: f(
121
+ m && !i && s.length === 0 && o && !v && /* @__PURE__ */ a("div", { className: "bear-absolute bear-z-50 bear-w-full bear-mt-1 bear-py-3 bear-px-4 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-text-sm bear-text-gray-500", children: k ? "Press Enter to use this value" : "No results found" }),
122
+ (w || n) && /* @__PURE__ */ a("p", { className: c(
130
123
  "bear-mt-1.5 bear-text-xs",
131
- c ? "bear-text-red-500" : "bear-text-gray-500 dark:bear-text-gray-400"
132
- ), children: c || v })
124
+ n ? "bear-text-red-500" : "bear-text-gray-500 dark:bear-text-gray-400"
125
+ ), children: n || w })
133
126
  ] });
134
127
  };
135
128
  export {
136
- H as Autocomplete
129
+ M as Autocomplete
137
130
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=(r,o)=>{const e=o.toLowerCase();return r.filter(t=>{var l;return t.label.toLowerCase().includes(e)||t.value.toLowerCase().includes(e)||((l=t.description)==null?void 0:l.toLowerCase().includes(e))})};exports.defaultFilter=s;
@@ -0,0 +1,2 @@
1
+ import { AutocompleteOption } from './Autocomplete.types';
2
+ export declare const defaultFilter: (options: AutocompleteOption[], inputValue: string) => AutocompleteOption[];
@@ -0,0 +1,12 @@
1
+ const t = (l, s) => {
2
+ const e = s.toLowerCase();
3
+ return l.filter(
4
+ (o) => {
5
+ var r;
6
+ return o.label.toLowerCase().includes(e) || o.value.toLowerCase().includes(e) || ((r = o.description) == null ? void 0 : r.toLowerCase().includes(e));
7
+ }
8
+ );
9
+ };
10
+ export {
11
+ t as defaultFilter
12
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),s=require("react"),v=require("../../utils/cn.cjs"),y=require("../Button/Button.cjs"),o=require("./BackTop.const.cjs"),I=({bottom:l=o.BACKTOP_DEFAULTS.BOTTOM,right:a=o.BACKTOP_DEFAULTS.RIGHT,visibleAt:b=o.BACKTOP_DEFAULTS.VISIBLE_AT,duration:c=o.BACKTOP_DEFAULTS.DURATION,target:i,children:p,size:u=o.BACKTOP_DEFAULTS.SIZE,variant:h=o.BACKTOP_DEFAULTS.VARIANT,animated:A=o.BACKTOP_DEFAULTS.ANIMATED,className:S,testId:w,onClick:r,...B})=>{const[f,E]=s.useState(!1),t=o.BACKTOP_SIZES[u],n=s.useCallback(()=>i?i():typeof window<"u"?window:null,[i]);s.useEffect(()=>{const e=n();if(!e)return;const T=()=>{const g=e===window?window.scrollY||document.documentElement.scrollTop:e.scrollTop;E(g>=b)};return e.addEventListener("scroll",T,{passive:!0}),T(),()=>{e.removeEventListener("scroll",T)}},[n,b]);const m=s.useCallback(()=>{const e=n();e&&(r==null||r(),e===window?window.scrollTo({top:0,behavior:c>0?"smooth":"auto"}):e.scrollTo({top:0,behavior:c>0?"smooth":"auto"}))},[n,c,r]),L=d.jsx("svg",{width:t.iconSize,height:t.iconSize,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("path",{d:"M18 15l-6-6-6 6"})}),O=u==="sm"?"sm":u==="lg"?"lg":"md";return d.jsx(y.Button,{variant:h,size:O,className:v.cn("Bear-BackTop","!bear-rounded-full !bear-p-0","!bear-fixed !bear-shadow-lg",A&&"bear-transition-all bear-duration-300 bear-ease-out",f?"bear-opacity-100 bear-translate-y-0 bear-scale-100":"bear-opacity-0 bear-translate-y-5 bear-scale-75 bear-pointer-events-none",S),style:{bottom:typeof l=="number"?`${l}px`:l,right:typeof a=="number"?`${a}px`:a,width:t.width,height:t.height,minWidth:t.width,zIndex:9999},onClick:m,"aria-label":"Scroll to top","data-testid":w,...B,children:p||L})};exports.BackTop=I;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),s=require("react"),v=require("../../utils/cn.cjs"),y=require("../Button/Button.cjs"),o=require("./BackTop.const.cjs"),_=({bottom:a=o.BACKTOP_DEFAULTS.BOTTOM,right:l=o.BACKTOP_DEFAULTS.RIGHT,visibleAt:b=o.BACKTOP_DEFAULTS.VISIBLE_AT,duration:c=o.BACKTOP_DEFAULTS.DURATION,target:i,children:p,size:u=o.BACKTOP_DEFAULTS.SIZE,variant:h=o.BACKTOP_DEFAULTS.VARIANT,animated:A=o.BACKTOP_DEFAULTS.ANIMATED,className:S,testId:w,onClick:r,...B})=>{const[f,E]=s.useState(!1),t=o.BACKTOP_SIZES[u],n=s.useCallback(()=>i?i():typeof window<"u"?window:null,[i]);s.useEffect(()=>{const e=n();if(!e)return;const T=()=>{const g=e===window?window.scrollY||document.documentElement.scrollTop:e.scrollTop;E(g>=b)};return e.addEventListener("scroll",T,{passive:!0}),T(),()=>{e.removeEventListener("scroll",T)}},[n,b]);const m=s.useCallback(()=>{const e=n();e&&(r==null||r(),e===window?window.scrollTo({top:0,behavior:c>0?"smooth":"auto"}):e.scrollTo({top:0,behavior:c>0?"smooth":"auto"}))},[n,c,r]),L=d.jsx("svg",{width:t.iconSize,height:t.iconSize,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("path",{d:"M18 15l-6-6-6 6"})}),O=u==="sm"?"sm":u==="lg"?"lg":"md";return d.jsx(y.Button,{variant:h,size:O,className:v.cn("Bear-BackTop","!bear-rounded-full !bear-p-0","!bear-fixed !bear-shadow-lg bear-z-[9999]",A&&"bear-transition-all bear-duration-300 bear-ease-out",f?"bear-opacity-100 bear-translate-y-0 bear-scale-100":"bear-opacity-0 bear-translate-y-5 bear-scale-75 bear-pointer-events-none",S),style:{bottom:typeof a=="number"?`${a}px`:a,right:typeof l=="number"?`${l}px`:l,width:t.width,height:t.height,minWidth:t.width},onClick:m,"aria-label":"Scroll to top","data-testid":w,...B,children:p||L})};exports.BackTop=_;
@@ -18,19 +18,19 @@ const V = ({
18
18
  onClick: r,
19
19
  ...S
20
20
  }) => {
21
- const [I, g] = y(!1), t = z[c], n = b(() => i ? i() : typeof window < "u" ? window : null, [i]);
21
+ const [g, v] = y(!1), t = z[c], n = b(() => i ? i() : typeof window < "u" ? window : null, [i]);
22
22
  A(() => {
23
23
  const e = n();
24
24
  if (!e) return;
25
25
  const d = () => {
26
- const E = e === window ? window.scrollY || document.documentElement.scrollTop : e.scrollTop;
27
- g(E >= u);
26
+ const I = e === window ? window.scrollY || document.documentElement.scrollTop : e.scrollTop;
27
+ v(I >= u);
28
28
  };
29
29
  return e.addEventListener("scroll", d, { passive: !0 }), d(), () => {
30
30
  e.removeEventListener("scroll", d);
31
31
  };
32
32
  }, [n, u]);
33
- const v = b(() => {
33
+ const B = b(() => {
34
34
  const e = n();
35
35
  e && (r == null || r(), e === window ? window.scrollTo({
36
36
  top: 0,
@@ -39,7 +39,7 @@ const V = ({
39
39
  top: 0,
40
40
  behavior: a > 0 ? "smooth" : "auto"
41
41
  }));
42
- }, [n, a, r]), B = /* @__PURE__ */ p(
42
+ }, [n, a, r]), E = /* @__PURE__ */ p(
43
43
  "svg",
44
44
  {
45
45
  width: t.iconSize,
@@ -61,9 +61,9 @@ const V = ({
61
61
  className: x(
62
62
  "Bear-BackTop",
63
63
  "!bear-rounded-full !bear-p-0",
64
- "!bear-fixed !bear-shadow-lg",
64
+ "!bear-fixed !bear-shadow-lg bear-z-[9999]",
65
65
  f && "bear-transition-all bear-duration-300 bear-ease-out",
66
- I ? "bear-opacity-100 bear-translate-y-0 bear-scale-100" : "bear-opacity-0 bear-translate-y-5 bear-scale-75 bear-pointer-events-none",
66
+ g ? "bear-opacity-100 bear-translate-y-0 bear-scale-100" : "bear-opacity-0 bear-translate-y-5 bear-scale-75 bear-pointer-events-none",
67
67
  h
68
68
  ),
69
69
  style: {
@@ -71,14 +71,13 @@ const V = ({
71
71
  right: typeof l == "number" ? `${l}px` : l,
72
72
  width: t.width,
73
73
  height: t.height,
74
- minWidth: t.width,
75
- zIndex: 9999
74
+ minWidth: t.width
76
75
  },
77
- onClick: v,
76
+ onClick: B,
78
77
  "aria-label": "Scroll to top",
79
78
  "data-testid": w,
80
79
  ...S,
81
- children: m || B
80
+ children: m || E
82
81
  }
83
82
  );
84
83
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),r=require("react"),g=require("../../utils/cn.cjs"),ae=require("../Spinner/Spinner.cjs"),w=require("../Typography/Typography.cjs"),oe=require("../../hooks/useBearStyles.cjs");require("../../hooks/useBearComponent/useBearComponent.cjs");const se=require("../../context/BearProvider.cjs"),o=require("./Button.constants.cjs"),O=x=>x in o.BUTTON_VARIANT,E=r.forwardRef((x,l)=>{var k,q;const{variant:e="primary",size:f="md",loading:c=!1,loadingText:_,fullWidth:M=!1,icon:p,iconPosition:C="left",leftIcon:P,rightIcon:U,textVariant:S="inherit",spotlight:u=!1,spotlightColor:z="rgba(255, 255, 255, 0.35)",spotlightSize:h=150,disabled:D,className:L,children:Z,testId:F,bis:H,style:X,onMouseMove:B,onMouseEnter:m,onMouseLeave:y,...Y}=x,W=D||c,v=oe.useBearStyles(H,X),R=P??(p&&C==="left"?p:void 0),$=U??(p&&C==="right"?p:void 0),s=r.useContext(se.BearContext),N=((q=(k=s==null?void 0:s.components)==null?void 0:k.Button)==null?void 0:q.root)||{},j=(s==null?void 0:s.customVariants)||{},T=!O(e)&&e in j,a=T?j[e]:null,b=r.useRef(null),[A,I]=r.useState({x:-1e3,y:-1e3}),[G,V]=r.useState(!1),J=r.useCallback(t=>{if(u&&b.current){const d=b.current.getBoundingClientRect(),re=t.clientX-d.left,ne=t.clientY-d.top;I({x:re,y:ne})}B==null||B(t)},[u,B]),K=r.useCallback(t=>{if(u&&(V(!0),b.current)){const d=b.current.getBoundingClientRect();I({x:t.clientX-d.left,y:t.clientY-d.top})}m==null||m(t)},[u,m]),Q=r.useCallback(t=>{V(!1),I({x:-1e3,y:-1e3}),y==null||y(t)},[y]),i=o.VARIANT_DEFAULTS[e]||o.VARIANT_DEFAULTS.primary,ee=r.useMemo(()=>T&&a?{backgroundColor:`var(--bear-${e}-bg, ${a.bg})`,color:a.text||"#ffffff",borderColor:a.border,"--bear-ring-color":a.ring||a.bg,...N,...v}:{backgroundColor:`var(--bear-btn-${e}-bg, ${i.bg})`,color:e==="outline"||e==="ghost"?`var(--bear-btn-${e}-text, ${i.text||"inherit"})`:"white",borderColor:e==="outline"?`var(--bear-btn-${e}-border, ${i.border||i.bg})`:void 0,"--bear-ring-color":`var(--bear-btn-${e}-ring, ${i.ring})`,...N,...v},[e,i,N,v,T,a]),te=r.useCallback(t=>{b.current=t,typeof l=="function"?l(t):l&&(l.current=t)},[l]);return n.jsxs("button",{ref:te,disabled:W,"aria-busy":c||void 0,style:ee,className:g.cn("Bear-Button","bear-inline-flex bear-items-center bear-justify-center bear-font-medium bear-rounded-lg bear-transition-all bear-duration-200 bear-outline-none bear-relative bear-overflow-hidden",o.BUTTON_SIZE[f],O(e)?o.BUTTON_VARIANT[e]:"bear-btn-custom bear-text-white focus:bear-ring-2 focus:bear-ring-offset-2 disabled:bear-opacity-50 disabled:bear-cursor-not-allowed hover:bear-brightness-110 active:bear-brightness-95",M&&"bear-w-full",c&&"bear-cursor-wait",L),"data-testid":F,onMouseMove:J,onMouseEnter:K,onMouseLeave:Q,...Y,children:[u&&n.jsx("span",{className:"Bear-Button__spotlight","aria-hidden":"true",style:{position:"absolute",pointerEvents:"none",left:0,top:0,width:h,height:h,borderRadius:"50%",background:`radial-gradient(circle at center, ${z} 0%, transparent 70%)`,opacity:G?1:0,transform:`translate(${A.x-h/2}px, ${A.y-h/2}px)`,transition:"opacity 0.15s ease-out",zIndex:1,mixBlendMode:"overlay"}}),c&&n.jsxs("span",{className:g.cn("Bear-Button__loading bear-inline-flex bear-items-center bear-gap-2 bear-relative bear-z-10",!_&&"bear-absolute"),children:[n.jsx(ae.Spinner,{size:f==="xs"?"xs":"sm",className:"Bear-Button__spinner"}),_&&n.jsx(w.Typography,{variant:S,className:"Bear-Button__text",children:_})]}),n.jsxs("span",{className:g.cn("Bear-Button__content bear-inline-flex bear-items-center bear-gap-inherit bear-relative bear-z-10",c&&"bear-invisible"),children:[R&&n.jsx("span",{className:g.cn("Bear-Button__icon Bear-Button__icon--left bear-inline-flex bear-shrink-0",o.BUTTON_ICON_SIZE[f]),children:R}),n.jsx(w.Typography,{variant:S,className:"Bear-Button__text",children:Z}),$&&n.jsx("span",{className:g.cn("Bear-Button__icon Bear-Button__icon--right bear-inline-flex bear-shrink-0",o.BUTTON_ICON_SIZE[f]),children:$})]})]})});E.displayName="Button";exports.Button=E;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),g=require("react"),s=require("../../utils/cn.cjs"),Q=require("../Spinner/Spinner.cjs"),j=require("../Typography/Typography.cjs"),X=require("../../hooks/useBearStyles.cjs");require("../../hooks/useBearComponent/useBearComponent.cjs");const ee=require("../../context/BearProvider.cjs"),n=require("./Button.constants.cjs"),q=require("./Button.utils.cjs"),re=require("./useSpotlight.cjs"),O=g.forwardRef((V,i)=>{var C,$;const{variant:e="primary",size:l="md",loading:c=!1,loadingText:h,fullWidth:E=!1,icon:b,iconPosition:_="left",leftIcon:w,rightIcon:A,textVariant:y="inherit",iconOnly:v=!1,spotlight:x=!1,spotlightColor:R="rgba(255, 255, 255, 0.35)",spotlightSize:u=150,disabled:U,className:k,children:z,testId:L,bis:P,style:Z,onMouseMove:D,onMouseEnter:F,onMouseLeave:H,...W}=V,Y=U||c,p=X.useBearStyles(P,Z),N=w??(b&&_==="left"?b:void 0),T=A??(b&&_==="right"?b:void 0),a=g.useContext(ee.BearContext),f=(($=(C=a==null?void 0:a.components)==null?void 0:C.Button)==null?void 0:$.root)||{},I=(a==null?void 0:a.customVariants)||{},B=!q.isBuiltInVariant(e)&&e in I,t=B?I[e]:null,{spotlightRef:S,position:M,isHovered:G,handlers:m}=re.useSpotlight({enabled:x,onMouseMove:D,onMouseEnter:F,onMouseLeave:H}),o=n.VARIANT_DEFAULTS[e]||n.VARIANT_DEFAULTS.primary,J=g.useMemo(()=>B&&t?{backgroundColor:`var(--bear-${e}-bg, ${t.bg})`,color:t.text||"#ffffff",borderColor:t.border,"--bear-ring-color":t.ring||t.bg,...f,...p}:{backgroundColor:`var(--bear-btn-${e}-bg, ${o.bg})`,color:e==="outline"||e==="ghost"?`var(--bear-btn-${e}-text, ${o.text||"inherit"})`:"white",borderColor:e==="outline"?`var(--bear-btn-${e}-border, ${o.border||o.bg})`:void 0,"--bear-ring-color":`var(--bear-btn-${e}-ring, ${o.ring})`,...f,...p},[e,o,f,p,B,t]),K=g.useCallback(d=>{S.current=d,typeof i=="function"?i(d):i&&(i.current=d)},[i,S]);return r.jsxs("button",{ref:K,disabled:Y,"aria-busy":c||void 0,style:J,className:s.cn("Bear-Button","bear-inline-flex bear-items-center bear-justify-center bear-font-medium bear-rounded-lg bear-transition-all bear-duration-200 bear-outline-none bear-relative bear-overflow-hidden",v?n.BUTTON_ICON_ONLY_SIZE[l]:n.BUTTON_SIZE[l],v&&"bear-rounded-lg",q.isBuiltInVariant(e)?n.BUTTON_VARIANT[e]:"bear-btn-custom bear-text-white focus:bear-ring-2 focus:bear-ring-offset-2 disabled:bear-opacity-50 disabled:bear-cursor-not-allowed hover:bear-brightness-110 active:bear-brightness-95",E&&"bear-w-full",c&&"bear-cursor-wait",k),"data-testid":L,onMouseMove:m.handleMouseMove,onMouseEnter:m.handleMouseEnter,onMouseLeave:m.handleMouseLeave,...W,children:[x&&r.jsx("span",{className:s.cn("Bear-Button__spotlight","bear-absolute bear-left-0 bear-top-0 bear-rounded-full bear-pointer-events-none bear-z-[1]","bear-transition-opacity bear-duration-150 bear-ease-out",G?"bear-opacity-100":"bear-opacity-0"),"aria-hidden":"true",style:{width:u,height:u,background:`radial-gradient(circle at center, ${R} 0%, transparent 70%)`,transform:`translate(${M.x-u/2}px, ${M.y-u/2}px)`,mixBlendMode:"overlay"}}),c&&r.jsxs("span",{className:s.cn("Bear-Button__loading bear-inline-flex bear-items-center bear-gap-2 bear-relative bear-z-10",!h&&"bear-absolute"),children:[r.jsx(Q.Spinner,{size:l==="xs"?"xs":"sm",className:"Bear-Button__spinner"}),h&&r.jsx(j.Typography,{variant:y,className:"Bear-Button__text",children:h})]}),r.jsxs("span",{className:s.cn("Bear-Button__content bear-inline-flex bear-items-center bear-gap-inherit bear-relative bear-z-10",c&&"bear-invisible"),children:[N&&r.jsx("span",{className:s.cn("Bear-Button__icon Bear-Button__icon--left bear-inline-flex bear-shrink-0",n.BUTTON_ICON_SIZE[l]),children:N}),r.jsx(j.Typography,{variant:y,className:"Bear-Button__text",children:z}),T&&r.jsx("span",{className:s.cn("Bear-Button__icon Bear-Button__icon--right bear-inline-flex bear-shrink-0",n.BUTTON_ICON_SIZE[l]),children:T})]})]})});O.displayName="Button";exports.Button=O;
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r={xs:"bear-px-2 bear-py-1 bear-text-xs bear-gap-1",sm:"bear-px-3 bear-py-1.5 bear-text-sm bear-gap-1.5",md:"bear-px-4 bear-py-2 bear-text-sm bear-gap-2",lg:"bear-px-5 bear-py-2.5 bear-text-base bear-gap-2",xl:"bear-px-6 bear-py-3 bear-text-lg bear-gap-2.5"},e={xs:"[&_svg]:bear-w-3 [&_svg]:bear-h-3",sm:"[&_svg]:bear-w-4 [&_svg]:bear-h-4",md:"[&_svg]:bear-w-5 [&_svg]:bear-h-5",lg:"[&_svg]:bear-w-5 [&_svg]:bear-h-5",xl:"[&_svg]:bear-w-6 [&_svg]:bear-h-6"},a={primary:`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r={xs:"bear-px-2 bear-py-1 bear-text-xs bear-gap-1",sm:"bear-px-3 bear-py-1.5 bear-text-sm bear-gap-1.5",md:"bear-px-4 bear-py-2 bear-text-sm bear-gap-2",lg:"bear-px-5 bear-py-2.5 bear-text-base bear-gap-2",xl:"bear-px-6 bear-py-3 bear-text-lg bear-gap-2.5"},e={xs:"bear-w-6 bear-h-6 bear-p-0",sm:"bear-w-8 bear-h-8 bear-p-0",md:"bear-w-10 bear-h-10 bear-p-0",lg:"bear-w-12 bear-h-12 bear-p-0",xl:"bear-w-14 bear-h-14 bear-p-0"},a={xs:"[&_svg]:bear-w-3 [&_svg]:bear-h-3",sm:"[&_svg]:bear-w-4 [&_svg]:bear-h-4",md:"[&_svg]:bear-w-5 [&_svg]:bear-h-5",lg:"[&_svg]:bear-w-5 [&_svg]:bear-h-5",xl:"[&_svg]:bear-w-6 [&_svg]:bear-h-6"},b={primary:`
2
2
  bear-btn-primary
3
3
  bear-text-white bear-relative bear-overflow-hidden
4
4
  focus:bear-ring-2 focus:bear-ring-offset-2
@@ -44,4 +44,4 @@
44
44
  bear-text-white bear-relative bear-overflow-hidden
45
45
  focus:bear-ring-2 focus:bear-ring-offset-2
46
46
  disabled:bear-opacity-50 disabled:bear-cursor-not-allowed
47
- `},b={primary:{bg:"var(--bear-primary-500)",hover:"var(--bear-primary-600)",active:"var(--bear-primary-700)",ring:"var(--bear-primary-500)"},secondary:{bg:"var(--bear-secondary-500)",hover:"var(--bear-secondary-600)",active:"var(--bear-secondary-700)",ring:"var(--bear-secondary-500)"},success:{bg:"var(--bear-success-500)",hover:"var(--bear-success-600)",active:"var(--bear-success-700)",ring:"var(--bear-success-500)"},warning:{bg:"var(--bear-warning-500)",hover:"var(--bear-warning-600)",active:"var(--bear-warning-700)",ring:"var(--bear-warning-500)"},danger:{bg:"var(--bear-danger-500)",hover:"var(--bear-danger-600)",active:"var(--bear-danger-700)",ring:"var(--bear-danger-500)"},info:{bg:"var(--bear-info-500)",hover:"var(--bear-info-600)",active:"var(--bear-info-700)",ring:"var(--bear-info-500)"},error:{bg:"var(--bear-danger-500)",hover:"var(--bear-danger-600)",active:"var(--bear-danger-700)",ring:"var(--bear-danger-500)"},ghost:{bg:"transparent",hover:"var(--bear-neutral-100)",active:"var(--bear-neutral-200)",text:"var(--bear-text-primary)",ring:"var(--bear-neutral-500)"},outline:{bg:"transparent",hover:"var(--bear-primary-50)",active:"var(--bear-primary-100)",border:"var(--bear-primary-500)",text:"var(--bear-primary-500)",ring:"var(--bear-primary-500)"}};exports.BUTTON_ICON_SIZE=e;exports.BUTTON_SIZE=r;exports.BUTTON_VARIANT=a;exports.VARIANT_DEFAULTS=b;
47
+ `},o={primary:{bg:"var(--bear-primary-500)",hover:"var(--bear-primary-600)",active:"var(--bear-primary-700)",ring:"var(--bear-primary-500)"},secondary:{bg:"var(--bear-secondary-500)",hover:"var(--bear-secondary-600)",active:"var(--bear-secondary-700)",ring:"var(--bear-secondary-500)"},success:{bg:"var(--bear-success-500)",hover:"var(--bear-success-600)",active:"var(--bear-success-700)",ring:"var(--bear-success-500)"},warning:{bg:"var(--bear-warning-500)",hover:"var(--bear-warning-600)",active:"var(--bear-warning-700)",ring:"var(--bear-warning-500)"},danger:{bg:"var(--bear-danger-500)",hover:"var(--bear-danger-600)",active:"var(--bear-danger-700)",ring:"var(--bear-danger-500)"},info:{bg:"var(--bear-info-500)",hover:"var(--bear-info-600)",active:"var(--bear-info-700)",ring:"var(--bear-info-500)"},error:{bg:"var(--bear-danger-500)",hover:"var(--bear-danger-600)",active:"var(--bear-danger-700)",ring:"var(--bear-danger-500)"},ghost:{bg:"transparent",hover:"var(--bear-neutral-100)",active:"var(--bear-neutral-200)",text:"var(--bear-text-primary)",ring:"var(--bear-neutral-500)"},outline:{bg:"transparent",hover:"var(--bear-primary-50)",active:"var(--bear-primary-100)",border:"var(--bear-primary-500)",text:"var(--bear-primary-500)",ring:"var(--bear-primary-500)"}};exports.BUTTON_ICON_ONLY_SIZE=e;exports.BUTTON_ICON_SIZE=a;exports.BUTTON_SIZE=r;exports.BUTTON_VARIANT=b;exports.VARIANT_DEFAULTS=o;
@@ -1,5 +1,6 @@
1
1
  import { BearSize, BearVariant } from '../../types';
2
2
  export declare const BUTTON_SIZE: Record<BearSize, string>;
3
+ export declare const BUTTON_ICON_ONLY_SIZE: Record<BearSize, string>;
3
4
  export declare const BUTTON_ICON_SIZE: Record<BearSize, string>;
4
5
  /**
5
6
  * Button variants using CSS variables for full customization
@@ -5,12 +5,18 @@ const r = {
5
5
  lg: "bear-px-5 bear-py-2.5 bear-text-base bear-gap-2",
6
6
  xl: "bear-px-6 bear-py-3 bear-text-lg bear-gap-2.5"
7
7
  }, e = {
8
+ xs: "bear-w-6 bear-h-6 bear-p-0",
9
+ sm: "bear-w-8 bear-h-8 bear-p-0",
10
+ md: "bear-w-10 bear-h-10 bear-p-0",
11
+ lg: "bear-w-12 bear-h-12 bear-p-0",
12
+ xl: "bear-w-14 bear-h-14 bear-p-0"
13
+ }, a = {
8
14
  xs: "[&_svg]:bear-w-3 [&_svg]:bear-h-3",
9
15
  sm: "[&_svg]:bear-w-4 [&_svg]:bear-h-4",
10
16
  md: "[&_svg]:bear-w-5 [&_svg]:bear-h-5",
11
17
  lg: "[&_svg]:bear-w-5 [&_svg]:bear-h-5",
12
18
  xl: "[&_svg]:bear-w-6 [&_svg]:bear-h-6"
13
- }, a = {
19
+ }, b = {
14
20
  primary: `
15
21
  bear-btn-primary
16
22
  bear-text-white bear-relative bear-overflow-hidden
@@ -66,7 +72,7 @@ const r = {
66
72
  focus:bear-ring-2 focus:bear-ring-offset-2
67
73
  disabled:bear-opacity-50 disabled:bear-cursor-not-allowed
68
74
  `
69
- }, b = {
75
+ }, o = {
70
76
  primary: { bg: "var(--bear-primary-500)", hover: "var(--bear-primary-600)", active: "var(--bear-primary-700)", ring: "var(--bear-primary-500)" },
71
77
  secondary: { bg: "var(--bear-secondary-500)", hover: "var(--bear-secondary-600)", active: "var(--bear-secondary-700)", ring: "var(--bear-secondary-500)" },
72
78
  success: { bg: "var(--bear-success-500)", hover: "var(--bear-success-600)", active: "var(--bear-success-700)", ring: "var(--bear-success-500)" },
@@ -78,8 +84,9 @@ const r = {
78
84
  outline: { bg: "transparent", hover: "var(--bear-primary-50)", active: "var(--bear-primary-100)", border: "var(--bear-primary-500)", text: "var(--bear-primary-500)", ring: "var(--bear-primary-500)" }
79
85
  };
80
86
  export {
81
- e as BUTTON_ICON_SIZE,
87
+ e as BUTTON_ICON_ONLY_SIZE,
88
+ a as BUTTON_ICON_SIZE,
82
89
  r as BUTTON_SIZE,
83
- a as BUTTON_VARIANT,
84
- b as VARIANT_DEFAULTS
90
+ b as BUTTON_VARIANT,
91
+ o as VARIANT_DEFAULTS
85
92
  };