@forgedevstack/bear 1.1.4 → 1.1.9

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 (179) hide show
  1. package/README.md +21 -2
  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/BearLogo/BearLogo.d.ts +2 -7
  15. package/dist/components/BearLogo/BearLogo.types.d.ts +15 -0
  16. package/dist/components/BearLogo/EmberLogo.d.ts +1 -8
  17. package/dist/components/BearLogo/index.d.ts +1 -2
  18. package/dist/components/Biometric/Biometric.cjs +1 -0
  19. package/dist/components/Biometric/Biometric.d.ts +3 -0
  20. package/dist/components/Biometric/Biometric.js +123 -0
  21. package/dist/components/Biometric/Biometric.types.d.ts +35 -0
  22. package/dist/components/Biometric/BiometricIcon.cjs +1 -0
  23. package/dist/components/Biometric/BiometricIcon.d.ts +3 -0
  24. package/dist/components/Biometric/BiometricIcon.js +45 -0
  25. package/dist/components/Biometric/index.d.ts +3 -0
  26. package/dist/components/Biometric/useBiometric.cjs +1 -0
  27. package/dist/components/Biometric/useBiometric.d.ts +2 -0
  28. package/dist/components/Biometric/useBiometric.js +21 -0
  29. package/dist/components/Button/Button.cjs +1 -1
  30. package/dist/components/Button/Button.constants.cjs +2 -2
  31. package/dist/components/Button/Button.constants.d.ts +1 -0
  32. package/dist/components/Button/Button.constants.js +12 -5
  33. package/dist/components/Button/Button.d.ts +0 -27
  34. package/dist/components/Button/Button.js +93 -105
  35. package/dist/components/Button/Button.types.d.ts +1 -0
  36. package/dist/components/Button/Button.utils.cjs +1 -0
  37. package/dist/components/Button/Button.utils.d.ts +2 -0
  38. package/dist/components/Button/Button.utils.js +5 -0
  39. package/dist/components/Button/useSpotlight.cjs +1 -0
  40. package/dist/components/Button/useSpotlight.d.ts +21 -0
  41. package/dist/components/Button/useSpotlight.js +28 -0
  42. package/dist/components/Chart/Chart.cjs +1 -1
  43. package/dist/components/Chart/Chart.const.cjs +1 -0
  44. package/dist/components/Chart/Chart.const.js +21 -0
  45. package/dist/components/Chart/Chart.js +55 -71
  46. package/dist/components/Chart/Chart.utils.cjs +1 -0
  47. package/dist/components/Chart/Chart.utils.js +5 -0
  48. package/dist/components/Confetti/Confetti.cjs +1 -1
  49. package/dist/components/Confetti/Confetti.js +37 -34
  50. package/dist/components/ContextMenu/ContextMenu.cjs +1 -1
  51. package/dist/components/ContextMenu/ContextMenu.js +31 -30
  52. package/dist/components/ContextMenu/ContextMenu.utils.cjs +1 -0
  53. package/dist/components/ContextMenu/ContextMenu.utils.d.ts +5 -0
  54. package/dist/components/ContextMenu/ContextMenu.utils.js +4 -0
  55. package/dist/components/CountdownTimer/CountdownTimer.cjs +1 -1
  56. package/dist/components/CountdownTimer/CountdownTimer.js +62 -71
  57. package/dist/components/CountdownTimer/CountdownTimer.utils.cjs +1 -0
  58. package/dist/components/CountdownTimer/CountdownTimer.utils.d.ts +3 -0
  59. package/dist/components/CountdownTimer/CountdownTimer.utils.js +16 -0
  60. package/dist/components/DateRangePicker/DateRangePicker.cjs +1 -1
  61. package/dist/components/DateRangePicker/DateRangePicker.const.cjs +1 -1
  62. package/dist/components/DateRangePicker/DateRangePicker.const.js +12 -13
  63. package/dist/components/DateRangePicker/DateRangePicker.js +107 -81
  64. package/dist/components/Dock/Dock.cjs +1 -1
  65. package/dist/components/Dock/Dock.js +38 -43
  66. package/dist/components/Dock/Dock.utils.cjs +1 -0
  67. package/dist/components/Dock/Dock.utils.d.ts +1 -0
  68. package/dist/components/Dock/Dock.utils.js +10 -0
  69. package/dist/components/Dropdown/Dropdown.cjs +1 -1
  70. package/dist/components/Dropdown/Dropdown.js +77 -74
  71. package/dist/components/FileTree/FileTree.cjs +1 -1
  72. package/dist/components/FileTree/FileTree.js +20 -32
  73. package/dist/components/FileTree/FileTree.utils.cjs +1 -0
  74. package/dist/components/FileTree/FileTree.utils.d.ts +4 -0
  75. package/dist/components/FileTree/FileTree.utils.js +15 -0
  76. package/dist/components/GradientText/GradientText.cjs +1 -1
  77. package/dist/components/GradientText/GradientText.js +27 -29
  78. package/dist/components/Icon/icons/bear.cjs +1 -0
  79. package/dist/components/Icon/icons/bear.d.ts +12 -0
  80. package/dist/components/Icon/icons/bear.js +47 -0
  81. package/dist/components/Icon/index.cjs +1 -1
  82. package/dist/components/Icon/index.d.ts +18 -0
  83. package/dist/components/Icon/index.js +17 -15
  84. package/dist/components/InfiniteScroll/InfiniteScroll.cjs +1 -1
  85. package/dist/components/InfiniteScroll/InfiniteScroll.const.cjs +1 -1
  86. package/dist/components/InfiniteScroll/InfiniteScroll.const.js +6 -7
  87. package/dist/components/InfiniteScroll/InfiniteScroll.js +41 -41
  88. package/dist/components/Input/Input.cjs +1 -1
  89. package/dist/components/Input/Input.js +153 -101
  90. package/dist/components/Input/Input.types.d.ts +8 -2
  91. package/dist/components/Input/index.d.ts +1 -1
  92. package/dist/components/MentionsInput/MentionsInput.cjs +1 -1
  93. package/dist/components/MentionsInput/MentionsInput.js +64 -68
  94. package/dist/components/MentionsInput/MentionsInput.utils.cjs +1 -0
  95. package/dist/components/MentionsInput/MentionsInput.utils.d.ts +2 -0
  96. package/dist/components/MentionsInput/MentionsInput.utils.js +9 -0
  97. package/dist/components/PageNav/PageNav.cjs +1 -0
  98. package/dist/components/PageNav/PageNav.const.cjs +1 -0
  99. package/dist/components/PageNav/PageNav.const.d.ts +22 -0
  100. package/dist/components/PageNav/PageNav.const.js +42 -0
  101. package/dist/components/PageNav/PageNav.d.ts +3 -0
  102. package/dist/components/PageNav/PageNav.js +81 -0
  103. package/dist/components/PageNav/PageNav.types.d.ts +17 -0
  104. package/dist/components/PageNav/index.d.ts +2 -0
  105. package/dist/components/Popover/Popover.cjs +1 -1
  106. package/dist/components/Popover/Popover.js +76 -76
  107. package/dist/components/Progress/Progress.cjs +1 -1
  108. package/dist/components/Progress/Progress.js +6 -6
  109. package/dist/components/PropsPlayground/PropsPlayground.cjs +1 -0
  110. package/dist/components/PropsPlayground/PropsPlayground.const.cjs +1 -0
  111. package/dist/components/PropsPlayground/PropsPlayground.const.d.ts +11 -0
  112. package/dist/components/PropsPlayground/PropsPlayground.const.js +23 -0
  113. package/dist/components/PropsPlayground/PropsPlayground.d.ts +3 -0
  114. package/dist/components/PropsPlayground/PropsPlayground.js +221 -0
  115. package/dist/components/PropsPlayground/PropsPlayground.types.d.ts +29 -0
  116. package/dist/components/PropsPlayground/PropsPlayground.utils.cjs +1 -0
  117. package/dist/components/PropsPlayground/PropsPlayground.utils.d.ts +2 -0
  118. package/dist/components/PropsPlayground/PropsPlayground.utils.js +9 -0
  119. package/dist/components/PropsPlayground/index.d.ts +2 -0
  120. package/dist/components/Select/Select.cjs +1 -1
  121. package/dist/components/Select/Select.js +54 -53
  122. package/dist/components/SignPad/SignPad.cjs +1 -1
  123. package/dist/components/SignPad/SignPad.js +24 -24
  124. package/dist/components/Skeleton/Skeleton.cjs +1 -1
  125. package/dist/components/Skeleton/Skeleton.js +89 -94
  126. package/dist/components/Skeleton/Skeleton.utils.cjs +1 -0
  127. package/dist/components/Skeleton/Skeleton.utils.d.ts +1 -0
  128. package/dist/components/Skeleton/Skeleton.utils.js +10 -0
  129. package/dist/components/SliderRange/SliderRange.cjs +1 -1
  130. package/dist/components/SliderRange/SliderRange.js +61 -63
  131. package/dist/components/SliderRange/SliderRange.utils.cjs +1 -0
  132. package/dist/components/SliderRange/SliderRange.utils.d.ts +1 -0
  133. package/dist/components/SliderRange/SliderRange.utils.js +7 -0
  134. package/dist/components/Spotlight/Spotlight.cjs +1 -1
  135. package/dist/components/Spotlight/Spotlight.js +62 -73
  136. package/dist/components/Spotlight/Spotlight.utils.cjs +1 -0
  137. package/dist/components/Spotlight/Spotlight.utils.d.ts +3 -0
  138. package/dist/components/Spotlight/Spotlight.utils.js +18 -0
  139. package/dist/components/Tabs/TabList.cjs +1 -0
  140. package/dist/components/Tabs/TabList.d.ts +3 -0
  141. package/dist/components/Tabs/TabList.js +69 -0
  142. package/dist/components/Tabs/TabPanel.cjs +1 -0
  143. package/dist/components/Tabs/TabPanel.d.ts +3 -0
  144. package/dist/components/Tabs/TabPanel.js +13 -0
  145. package/dist/components/Tabs/Tabs.cjs +1 -1
  146. package/dist/components/Tabs/Tabs.d.ts +2 -27
  147. package/dist/components/Tabs/Tabs.js +43 -61
  148. package/dist/components/Tabs/Tabs.types.d.ts +7 -1
  149. package/dist/components/Tabs/index.d.ts +3 -1
  150. package/dist/components/Toast/Toast.cjs +1 -1
  151. package/dist/components/Toast/Toast.js +18 -17
  152. package/dist/components/Toast/Toast.utils.cjs +1 -0
  153. package/dist/components/Toast/Toast.utils.d.ts +1 -0
  154. package/dist/components/Toast/Toast.utils.js +4 -0
  155. package/dist/components/Tooltip/Tooltip.cjs +1 -1
  156. package/dist/components/Tooltip/Tooltip.js +10 -11
  157. package/dist/components/Tour/Tour.cjs +1 -1
  158. package/dist/components/Tour/Tour.js +1 -2
  159. package/dist/components/VirtualList/VirtualList.cjs +1 -1
  160. package/dist/components/VirtualList/VirtualList.js +38 -43
  161. package/dist/components/index.cjs +1 -1
  162. package/dist/components/index.d.ts +9 -2
  163. package/dist/components/index.js +311 -300
  164. package/dist/hooks/index.cjs +1 -1
  165. package/dist/hooks/index.d.ts +2 -0
  166. package/dist/hooks/index.js +60 -58
  167. package/dist/hooks/useResizeObserver/index.d.ts +2 -0
  168. package/dist/hooks/useResizeObserver/useResizeObserver.cjs +1 -0
  169. package/dist/hooks/useResizeObserver/useResizeObserver.d.ts +3 -0
  170. package/dist/hooks/useResizeObserver/useResizeObserver.js +20 -0
  171. package/dist/hooks/useResizeObserver/useResizeObserver.types.d.ts +8 -0
  172. package/dist/icons.cjs +1 -0
  173. package/dist/icons.d.ts +2 -0
  174. package/dist/icons.js +6 -0
  175. package/dist/index.cjs +1 -1
  176. package/dist/index.js +397 -384
  177. package/dist/styles/_base.css +7 -3
  178. package/dist/styles.css +1 -1
  179. package/package.json +6 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("react"),b=require("../../utils/cn.cjs"),s=require("./InfiniteScroll.const.cjs"),A=m=>{const{onLoadMore:a,hasMore:n,loading:t=!1,threshold:d=s.DEFAULT_THRESHOLD,manual:r=!1,loader:u,endMessage:S,loadMoreLabel:v="Load more",inverse:o=!1,children:I,className:g,testId:j,...x}=m,i=c.useRef(null),f=c.useRef(t);f.current=t;const l=c.useCallback(()=>{f.current||!n||a()},[a,n]);c.useEffect(()=>{if(r||!n)return;const E=i.current;if(!E)return;const L=new IntersectionObserver(_=>{var N;(N=_[0])!=null&&N.isIntersecting&&l()},{threshold:0,rootMargin:`${Math.round(d*100)}px`});return L.observe(E),()=>L.disconnect()},[r,n,l,d]);const h=e.jsx("div",{className:s.LOADER_CLASSES,children:e.jsx("div",{className:s.SPINNER_CLASSES})}),R=e.jsxs(e.Fragment,{children:[o&&n&&!r&&e.jsx("div",{ref:i,style:{height:s.SENTINEL_HEIGHT}}),o&&t&&(u??h),I,!o&&t&&(u??h),!o&&n&&!r&&e.jsx("div",{ref:i,style:{height:s.SENTINEL_HEIGHT}}),n&&r&&!t&&e.jsx("button",{type:"button",onClick:l,className:s.MANUAL_BTN_CLASSES,children:v}),!n&&S&&e.jsx("div",{className:s.END_CLASSES,children:S})]});return e.jsx("div",{className:b.cn(s.ROOT_CLASSES,g),"data-testid":j,...x,children:R})};exports.InfiniteScroll=A;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("react"),g=require("../../utils/cn.cjs"),n=require("./InfiniteScroll.const.cjs"),_=x=>{const{onLoadMore:i,hasMore:s,loading:r=!1,threshold:d=n.DEFAULT_THRESHOLD,manual:t=!1,loader:u,endMessage:S,loadMoreLabel:b="Load more",inverse:o=!1,children:v,className:E,testId:j,...R}=x,a=c.useRef(null),f=c.useRef(r);f.current=r;const l=c.useCallback(()=>{f.current||!s||i()},[i,s]);c.useEffect(()=>{if(t||!s)return;const L=a.current;if(!L)return;const m=new IntersectionObserver(M=>{var N;(N=M[0])!=null&&N.isIntersecting&&l()},{threshold:0,rootMargin:`${Math.round(d*100)}px`});return m.observe(L),()=>m.disconnect()},[t,s,l,d]);const h=e.jsx("div",{className:n.LOADER_CLASSES,children:e.jsx("div",{className:n.SPINNER_CLASSES})}),A=e.jsxs(e.Fragment,{children:[o&&s&&!t&&e.jsx("div",{ref:a,className:"bear-h-px"}),o&&r&&(u??h),v,!o&&r&&(u??h),!o&&s&&!t&&e.jsx("div",{ref:a,className:"bear-h-px"}),s&&t&&!r&&e.jsx("button",{type:"button",onClick:l,className:n.MANUAL_BTN_CLASSES,children:b}),!s&&S&&e.jsx("div",{className:n.END_CLASSES,children:S})]});return e.jsx("div",{className:g.cn(n.ROOT_CLASSES,E),"data-testid":j,...R,children:A})};exports.InfiniteScroll=_;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=.8,r=1,a="Bear-InfiniteScroll bear-relative",t="bear-flex bear-items-center bear-justify-center bear-py-4",b="bear-text-center bear-py-4 bear-text-sm bear-text-gray-400 dark:bear-text-zinc-500",S="bear-w-full bear-py-2.5 bear-text-sm bear-font-medium bear-text-pink-600 dark:bear-text-pink-400 bear-bg-pink-50 dark:bear-bg-pink-900/20 bear-rounded-lg bear-transition-colors hover:bear-bg-pink-100 dark:hover:bear-bg-pink-900/30 bear-cursor-pointer",n="bear-w-5 bear-h-5 bear-border-2 bear-border-pink-200 bear-border-t-pink-500 bear-rounded-full bear-animate-spin";exports.DEFAULT_THRESHOLD=e;exports.END_CLASSES=b;exports.LOADER_CLASSES=t;exports.MANUAL_BTN_CLASSES=S;exports.ROOT_CLASSES=a;exports.SENTINEL_HEIGHT=r;exports.SPINNER_CLASSES=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=.8,r="Bear-InfiniteScroll bear-relative",a="bear-flex bear-items-center bear-justify-center bear-py-4",b="bear-text-center bear-py-4 bear-text-sm bear-text-gray-400 dark:bear-text-zinc-500",t="bear-w-full bear-py-2.5 bear-text-sm bear-font-medium bear-text-pink-600 dark:bear-text-pink-400 bear-bg-pink-50 dark:bear-bg-pink-900/20 bear-rounded-lg bear-transition-colors hover:bear-bg-pink-100 dark:hover:bear-bg-pink-900/30 bear-cursor-pointer",S="bear-w-5 bear-h-5 bear-border-2 bear-border-pink-200 bear-border-t-pink-500 bear-rounded-full bear-animate-spin";exports.DEFAULT_THRESHOLD=e;exports.END_CLASSES=b;exports.LOADER_CLASSES=a;exports.MANUAL_BTN_CLASSES=t;exports.ROOT_CLASSES=r;exports.SPINNER_CLASSES=S;
@@ -1,10 +1,9 @@
1
- const e = 0.8, r = 1, a = "Bear-InfiniteScroll bear-relative", b = "bear-flex bear-items-center bear-justify-center bear-py-4", t = "bear-text-center bear-py-4 bear-text-sm bear-text-gray-400 dark:bear-text-zinc-500", n = "bear-w-full bear-py-2.5 bear-text-sm bear-font-medium bear-text-pink-600 dark:bear-text-pink-400 bear-bg-pink-50 dark:bear-bg-pink-900/20 bear-rounded-lg bear-transition-colors hover:bear-bg-pink-100 dark:hover:bear-bg-pink-900/30 bear-cursor-pointer", o = "bear-w-5 bear-h-5 bear-border-2 bear-border-pink-200 bear-border-t-pink-500 bear-rounded-full bear-animate-spin";
1
+ const e = 0.8, r = "Bear-InfiniteScroll bear-relative", a = "bear-flex bear-items-center bear-justify-center bear-py-4", b = "bear-text-center bear-py-4 bear-text-sm bear-text-gray-400 dark:bear-text-zinc-500", t = "bear-w-full bear-py-2.5 bear-text-sm bear-font-medium bear-text-pink-600 dark:bear-text-pink-400 bear-bg-pink-50 dark:bear-bg-pink-900/20 bear-rounded-lg bear-transition-colors hover:bear-bg-pink-100 dark:hover:bear-bg-pink-900/30 bear-cursor-pointer", n = "bear-w-5 bear-h-5 bear-border-2 bear-border-pink-200 bear-border-t-pink-500 bear-rounded-full bear-animate-spin";
2
2
  export {
3
3
  e as DEFAULT_THRESHOLD,
4
- t as END_CLASSES,
5
- b as LOADER_CLASSES,
6
- n as MANUAL_BTN_CLASSES,
7
- a as ROOT_CLASSES,
8
- r as SENTINEL_HEIGHT,
9
- o as SPINNER_CLASSES
4
+ b as END_CLASSES,
5
+ a as LOADER_CLASSES,
6
+ t as MANUAL_BTN_CLASSES,
7
+ r as ROOT_CLASSES,
8
+ n as SPINNER_CLASSES
10
9
  };
@@ -1,51 +1,51 @@
1
- import { jsx as r, jsxs as C, Fragment as I } from "react/jsx-runtime";
2
- import { useRef as L, useCallback as R, useEffect as T } from "react";
3
- import { cn as O } from "../../utils/cn.js";
4
- import { DEFAULT_THRESHOLD as x, ROOT_CLASSES as D, SENTINEL_HEIGHT as E, MANUAL_BTN_CLASSES as H, END_CLASSES as y, LOADER_CLASSES as j, SPINNER_CLASSES as k } from "./InfiniteScroll.const.js";
5
- const G = (N) => {
1
+ import { jsx as r, jsxs as R, Fragment as _ } from "react/jsx-runtime";
2
+ import { useRef as L, useCallback as g, useEffect as x } from "react";
3
+ import { cn as I } from "../../utils/cn.js";
4
+ import { DEFAULT_THRESHOLD as O, ROOT_CLASSES as D, MANUAL_BTN_CLASSES as T, END_CLASSES as j, LOADER_CLASSES as k, SPINNER_CLASSES as F } from "./InfiniteScroll.const.js";
5
+ const B = (N) => {
6
6
  const {
7
- onLoadMore: i,
7
+ onLoadMore: c,
8
8
  hasMore: e,
9
- loading: t = !1,
10
- threshold: l = x,
11
- manual: n = !1,
12
- loader: c,
9
+ loading: n = !1,
10
+ threshold: l = O,
11
+ manual: s = !1,
12
+ loader: i,
13
13
  endMessage: d,
14
- loadMoreLabel: v = "Load more",
15
- inverse: s = !1,
16
- children: A,
17
- className: g,
18
- testId: M,
19
- ..._
20
- } = N, o = L(null), f = L(t);
21
- f.current = t;
22
- const a = R(() => {
23
- f.current || !e || i();
24
- }, [i, e]);
25
- T(() => {
26
- if (n || !e) return;
27
- const h = o.current;
28
- if (!h) return;
29
- const m = new IntersectionObserver(
30
- (p) => {
31
- var u;
32
- (u = p[0]) != null && u.isIntersecting && a();
14
+ loadMoreLabel: E = "Load more",
15
+ inverse: t = !1,
16
+ children: v,
17
+ className: b,
18
+ testId: p,
19
+ ...A
20
+ } = N, o = L(null), f = L(n);
21
+ f.current = n;
22
+ const a = g(() => {
23
+ f.current || !e || c();
24
+ }, [c, e]);
25
+ x(() => {
26
+ if (s || !e) return;
27
+ const S = o.current;
28
+ if (!S) return;
29
+ const u = new IntersectionObserver(
30
+ (C) => {
31
+ var h;
32
+ (h = C[0]) != null && h.isIntersecting && a();
33
33
  },
34
34
  { threshold: 0, rootMargin: `${Math.round(l * 100)}px` }
35
35
  );
36
- return m.observe(h), () => m.disconnect();
37
- }, [n, e, a, l]);
38
- const S = /* @__PURE__ */ r("div", { className: j, children: /* @__PURE__ */ r("div", { className: k }) }), b = /* @__PURE__ */ C(I, { children: [
39
- s && e && !n && /* @__PURE__ */ r("div", { ref: o, style: { height: E } }),
40
- s && t && (c ?? S),
41
- A,
42
- !s && t && (c ?? S),
43
- !s && e && !n && /* @__PURE__ */ r("div", { ref: o, style: { height: E } }),
44
- e && n && !t && /* @__PURE__ */ r("button", { type: "button", onClick: a, className: H, children: v }),
45
- !e && d && /* @__PURE__ */ r("div", { className: y, children: d })
36
+ return u.observe(S), () => u.disconnect();
37
+ }, [s, e, a, l]);
38
+ const m = /* @__PURE__ */ r("div", { className: k, children: /* @__PURE__ */ r("div", { className: F }) }), M = /* @__PURE__ */ R(_, { children: [
39
+ t && e && !s && /* @__PURE__ */ r("div", { ref: o, className: "bear-h-px" }),
40
+ t && n && (i ?? m),
41
+ v,
42
+ !t && n && (i ?? m),
43
+ !t && e && !s && /* @__PURE__ */ r("div", { ref: o, className: "bear-h-px" }),
44
+ e && s && !n && /* @__PURE__ */ r("button", { type: "button", onClick: a, className: T, children: E }),
45
+ !e && d && /* @__PURE__ */ r("div", { className: j, children: d })
46
46
  ] });
47
- return /* @__PURE__ */ r("div", { className: O(D, g), "data-testid": M, ..._, children: b });
47
+ return /* @__PURE__ */ r("div", { className: I(D, b), "data-testid": p, ...A, children: M });
48
48
  };
49
49
  export {
50
- G as InfiniteScroll
50
+ B as InfiniteScroll
51
51
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),s=require("react"),d=require("../../utils/cn.cjs"),ae=require("../../context/BearProvider.cjs"),L=require("./components/ClearIcon/ClearIcon.cjs"),te=require("./Input.utils.cjs"),se=require("../Form/Form.utils.cjs"),be={sm:"bear-h-8 bear-text-sm bear-px-3",md:"bear-h-10 bear-text-base bear-px-4",lg:"bear-h-12 bear-text-lg bear-px-5"},P=s.forwardRef(({label:B,helperText:T,error:f,success:j,size:V="md",leftAddon:x,rightAddon:b,fullWidth:D=!1,clearable:G=!1,onClear:m,showCharCount:N=!1,charCountMax:H,autoFormat:g,validation:t,validateOnBlur:J,validateOnChange:w=!1,className:K,disabled:p,value:_,defaultValue:y,maxLength:v,onChange:l,onBlur:n,...Q},U)=>{var F;const h=s.useContext(ae.BearContext),e=(F=h==null?void 0:h.components)==null?void 0:F.Input,W=e==null?void 0:e.root,X=e==null?void 0:e.input,Y=e==null?void 0:e.label,Z=e==null?void 0:e.helper,$=e==null?void 0:e.prefix,q=e==null?void 0:e.suffix,[S,C]=s.useState(null),E=s.useRef(!1),R=t?J??!0:!1,M=f||S,c=!!M,O=!!j&&!c,u=H??v,I=typeof _=="string"?_.length:typeof y=="string"?y.length:0,A=u!=null&&I>u,k=G&&!p&&I>0,z=M||j||T,i=s.useCallback(async a=>{if(!t)return;E.current=!0;const o=await se.validateFieldValue(a,t);E.current=!1,C(o)},[t]);s.useEffect(()=>{f&&C(null)},[f]);const ee=s.useCallback(a=>{if(g){const o=te.applyAutoFormat(a.target.value,g);o!==a.target.value&&(a.target.value=o)}l==null||l(a),w&&t&&i(a.target.value)},[g,l,w,t,i]),re=s.useCallback(a=>{n==null||n(a),R&&t&&i(a.target.value)},[n,R,t,i]);return r.jsxs("div",{className:d.cn("Bear-Input bear-flex bear-flex-col bear-gap-1.5",D&&"bear-w-full"),style:W,children:[B&&r.jsx("label",{className:"Bear-Input__label bear-text-sm bear-font-medium bear-text-gray-700 dark:bear-text-gray-300",style:Y,children:B}),r.jsxs("div",{className:"Bear-Input__wrapper bear-relative bear-flex bear-items-center",children:[x&&r.jsx("div",{className:"Bear-Input__addon Bear-Input__addon--left bear-absolute bear-left-3 bear-text-gray-500 dark:bear-text-gray-400",style:$,children:x}),r.jsx("input",{ref:U,disabled:p,value:_,defaultValue:y,maxLength:v,"aria-invalid":c||void 0,onChange:ee,onBlur:re,className:d.cn("Bear-Input__field","bear-w-full bear-rounded-lg bear-border bear-outline-none bear-transition-all bear-duration-200","bear-bg-white bear-text-gray-900 placeholder:bear-text-gray-400","bear-border-gray-300 focus:bear-ring-2 focus:bear-ring-offset-2 focus:bear-ring-offset-white","dark:bear-bg-gray-800 dark:bear-text-white dark:placeholder:bear-text-gray-500 dark:bear-border-gray-600 dark:focus:bear-ring-offset-gray-900",c?"Bear-Input__field--error bear-border-red-500 focus:bear-ring-red-500":O?"Bear-Input__field--success bear-border-green-500 focus:bear-ring-green-500":"focus:bear-border-bear-500 focus:bear-ring-bear-500 dark:focus:bear-border-bear-500 dark:focus:bear-ring-bear-500",p&&"Bear-Input__field--disabled bear-opacity-50 bear-cursor-not-allowed",x&&"bear-pl-10",(b||k)&&"bear-pr-10",be[V],K),style:X,...Q}),k&&!b&&r.jsx("div",{className:"Bear-Input__addon Bear-Input__addon--right bear-absolute bear-right-3 bear-text-gray-500 dark:bear-text-gray-400",style:q,children:r.jsx(L.ClearIcon,{onClick:m})}),b&&r.jsxs("div",{className:"Bear-Input__addon Bear-Input__addon--right bear-absolute bear-right-3 bear-flex bear-items-center bear-gap-1.5 bear-text-gray-500 dark:bear-text-gray-400",style:q,children:[k&&r.jsx(L.ClearIcon,{onClick:m}),b]})]}),r.jsxs("div",{className:"Bear-Input__footer bear-flex bear-items-center bear-justify-between bear-gap-2",children:[z?r.jsx("p",{className:d.cn("Bear-Input__helper bear-text-sm bear-flex-1",c?"Bear-Input__helper--error bear-text-red-500":O?"Bear-Input__helper--success bear-text-green-500":"bear-text-gray-500 dark:bear-text-gray-400"),style:Z,children:z}):N?r.jsx("span",{}):null,N&&u!=null&&r.jsxs("span",{className:d.cn("Bear-Input__char-count bear-text-xs bear-tabular-nums bear-shrink-0",A?"bear-text-red-500":"bear-text-gray-400 dark:bear-text-gray-500"),children:[I,"/",u]})]})]})});P.displayName="Input";exports.Input=P;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),s=require("react"),b=require("../../utils/cn.cjs"),se=require("../../context/BearProvider.cjs"),ne=require("./components/ClearIcon/ClearIcon.cjs"),le=require("./Input.utils.cjs"),be=require("../Form/Form.utils.cjs"),ce={sm:"bear-h-8",md:"bear-h-10",lg:"bear-h-12"},oe={sm:"bear-text-sm bear-px-3",md:"bear-text-base bear-px-4",lg:"bear-text-lg bear-px-5"},T=s.forwardRef(({label:y,helperText:F,error:x,success:w,size:B="md",InputProps:n,leftAddon:H,rightAddon:S,fullWidth:V=!1,clearable:D=!1,onClear:G,showCharCount:j=!1,charCountMax:J,autoFormat:h,validation:t,validateOnBlur:K,validateOnChange:I=!1,className:Q,disabled:p,value:g,defaultValue:m,maxLength:k,onChange:c,onBlur:o,...U},W)=>{var O;const _=s.useContext(se.BearContext),e=(O=_==null?void 0:_.components)==null?void 0:O.Input,X=e==null?void 0:e.root,Y=e==null?void 0:e.input,Z=e==null?void 0:e.label,$=e==null?void 0:e.helper,z=e==null?void 0:e.prefix,P=e==null?void 0:e.suffix,[ee,N]=s.useState(null),C=s.useRef(!1),q=t?K??!0:!1,R=x||ee,l=!!R,i=!!w&&!l,u=J??k,v=typeof g=="string"?g.length:typeof m=="string"?m.length:0,E=u!=null&&v>u,re=D&&!p&&v>0,A=(n==null?void 0:n.startAdornment)??H,M=(n==null?void 0:n.endAdornment)??S,L=R||w||F,d=s.useCallback(async a=>{if(!t)return;C.current=!0;const f=await be.validateFieldValue(a,t);C.current=!1,N(f)},[t]);s.useEffect(()=>{x&&N(null)},[x]);const ae=s.useCallback(a=>{if(h){const f=le.applyAutoFormat(a.target.value,h);f!==a.target.value&&(a.target.value=f)}c==null||c(a),I&&t&&d(a.target.value)},[h,c,I,t,d]),te=s.useCallback(a=>{o==null||o(a),q&&t&&d(a.target.value)},[o,q,t,d]);return r.jsxs("div",{className:b.cn("Bear-Input bear-flex bear-flex-col bear-gap-1.5",V&&"bear-w-full"),style:X,children:[y&&r.jsx("label",{className:"Bear-Input__label bear-text-sm bear-font-medium",style:{color:"var(--bear-text-secondary)",...Z},children:y}),r.jsxs("div",{className:b.cn("Bear-Input__wrapper bear-flex bear-items-center bear-rounded-lg bear-border bear-overflow-hidden bear-transition-all bear-duration-200","focus-within:bear-ring-2 focus-within:bear-ring-offset-2","focus-within:bear-ring-offset-[var(--bear-bg-primary)]",l?"Bear-Input__wrapper--error bear-border-red-500 focus-within:bear-ring-red-500":i?"Bear-Input__wrapper--success bear-border-green-500 focus-within:bear-ring-green-500":"focus-within:bear-border-bear-500 focus-within:bear-ring-bear-500 dark:focus-within:bear-border-bear-500 dark:focus-within:bear-ring-bear-500",p&&"bear-opacity-50 bear-cursor-not-allowed",ce[B]),style:{backgroundColor:"var(--bear-bg-primary)",borderColor:l||i?void 0:"var(--bear-border-default)"},children:[A&&r.jsx("div",{className:"Bear-Input__addon Bear-Input__addon--left bear-flex bear-items-center bear-self-stretch bear-shrink-0 bear-px-3 bear-text-sm bear-font-medium bear-select-none bear-pointer-events-none",style:{backgroundColor:"var(--bear-bg-tertiary)",borderRight:"1px solid var(--bear-border-default)",color:"var(--bear-text-secondary)",...z},children:A}),r.jsx("input",{ref:W,disabled:p,value:g,defaultValue:m,maxLength:k,"aria-invalid":l||void 0,onChange:ae,onBlur:te,className:b.cn("Bear-Input__field","bear-flex-1 bear-min-w-0 bear-h-full bear-border-0 bear-outline-none bear-bg-transparent","placeholder:opacity-100 placeholder:[color:var(--bear-text-muted)]",oe[B],Q),style:{color:"var(--bear-text-primary)",...Y},...U}),re&&r.jsx("div",{className:"Bear-Input__clear bear-flex bear-items-center bear-self-stretch bear-shrink-0 bear-px-2 bear-cursor-pointer",style:{color:"var(--bear-text-muted)"},children:r.jsx(ne.ClearIcon,{onClick:G})}),M&&r.jsx("div",{className:"Bear-Input__addon Bear-Input__addon--right bear-flex bear-items-center bear-self-stretch bear-shrink-0 bear-px-3 bear-gap-1.5",style:{backgroundColor:"var(--bear-bg-tertiary)",borderLeft:"1px solid var(--bear-border-default)",color:"var(--bear-text-secondary)",...P},children:M})]}),r.jsxs("div",{className:"Bear-Input__footer bear-flex bear-items-center bear-justify-between bear-gap-2",children:[L?r.jsx("p",{className:b.cn("Bear-Input__helper bear-text-sm bear-flex-1",l&&"Bear-Input__helper--error bear-text-red-500",i&&"Bear-Input__helper--success bear-text-green-500"),style:{...l||i?{}:{color:"var(--bear-text-muted)"},...$},children:L}):j?r.jsx("span",{}):null,j&&u!=null&&r.jsxs("span",{className:b.cn("Bear-Input__char-count bear-text-xs bear-tabular-nums bear-shrink-0",E&&"bear-text-red-500"),style:E?void 0:{color:"var(--bear-text-muted)"},children:[v,"/",u]})]})]})});T.displayName="Input";exports.Input=T;
@@ -1,127 +1,179 @@
1
- import { jsxs as s, jsx as t } from "react/jsx-runtime";
2
- import { forwardRef as ae, useContext as te, useState as se, useRef as be, useCallback as B, useEffect as le } from "react";
3
- import { cn as f } from "../../utils/cn.js";
4
- import { BearContext as ne } from "../../context/BearProvider.js";
5
- import { ClearIcon as D } from "./components/ClearIcon/ClearIcon.js";
6
- import { applyAutoFormat as ce } from "./Input.utils.js";
7
- import { validateFieldValue as ie } from "../Form/Form.utils.js";
1
+ import { jsxs as u, jsx as t } from "react/jsx-runtime";
2
+ import { forwardRef as se, useContext as be, useState as le, useRef as ne, useCallback as w, useEffect as oe } from "react";
3
+ import { cn as l } from "../../utils/cn.js";
4
+ import { BearContext as ie } from "../../context/BearProvider.js";
5
+ import { ClearIcon as ce } from "./components/ClearIcon/ClearIcon.js";
6
+ import { applyAutoFormat as de } from "./Input.utils.js";
7
+ import { validateFieldValue as fe } from "../Form/Form.utils.js";
8
8
  const ue = {
9
- sm: "bear-h-8 bear-text-sm bear-px-3",
10
- md: "bear-h-10 bear-text-base bear-px-4",
11
- lg: "bear-h-12 bear-text-lg bear-px-5"
12
- }, oe = ae(
9
+ sm: "bear-h-8",
10
+ md: "bear-h-10",
11
+ lg: "bear-h-12"
12
+ }, pe = {
13
+ sm: "bear-text-sm bear-px-3",
14
+ md: "bear-text-base bear-px-4",
15
+ lg: "bear-text-lg bear-px-5"
16
+ }, xe = se(
13
17
  ({
14
- label: k,
15
- helperText: F,
16
- error: d,
17
- success: N,
18
- size: G = "md",
19
- leftAddon: p,
20
- rightAddon: b,
21
- fullWidth: H = !1,
22
- clearable: J = !1,
23
- onClear: w,
24
- showCharCount: v = !1,
18
+ label: y,
19
+ helperText: V,
20
+ error: p,
21
+ success: B,
22
+ size: k = "md",
23
+ InputProps: s,
24
+ leftAddon: q,
25
+ rightAddon: D,
26
+ fullWidth: F = !1,
27
+ clearable: G = !1,
28
+ onClear: J,
29
+ showCharCount: I = !1,
25
30
  charCountMax: K,
26
- autoFormat: g,
31
+ autoFormat: x,
27
32
  validation: a,
28
33
  validateOnBlur: Q,
29
- validateOnChange: E = !1,
30
- className: T,
31
- disabled: x,
32
- value: _,
33
- defaultValue: y,
34
- maxLength: j,
35
- onChange: l,
36
- onBlur: n,
37
- ...U
38
- }, W) => {
39
- var q;
40
- const h = te(ne), e = (q = h == null ? void 0 : h.components) == null ? void 0 : q.Input, X = e == null ? void 0 : e.root, Y = e == null ? void 0 : e.input, Z = e == null ? void 0 : e.label, $ = e == null ? void 0 : e.helper, P = e == null ? void 0 : e.prefix, M = e == null ? void 0 : e.suffix, [S, R] = se(null), z = be(!1), C = a ? Q ?? !0 : !1, L = d || S, c = !!L, O = !!N && !c, i = K ?? j, m = typeof _ == "string" ? _.length : typeof y == "string" ? y.length : 0, A = i != null && m > i, I = J && !x && m > 0, V = L || N || F, u = B(async (r) => {
34
+ validateOnChange: N = !1,
35
+ className: U,
36
+ disabled: m,
37
+ value: h,
38
+ defaultValue: g,
39
+ maxLength: C,
40
+ onChange: n,
41
+ onBlur: o,
42
+ ...W
43
+ }, X) => {
44
+ var T;
45
+ const _ = be(ie), e = (T = _ == null ? void 0 : _.components) == null ? void 0 : T.Input, Y = e == null ? void 0 : e.root, Z = e == null ? void 0 : e.input, $ = e == null ? void 0 : e.label, z = e == null ? void 0 : e.helper, S = e == null ? void 0 : e.prefix, P = e == null ? void 0 : e.suffix, [ee, E] = le(null), j = ne(!1), A = a ? Q ?? !0 : !1, R = p || ee, b = !!R, i = !!B && !b, c = K ?? C, v = typeof h == "string" ? h.length : typeof g == "string" ? g.length : 0, L = c != null && v > c, re = G && !m && v > 0, M = (s == null ? void 0 : s.startAdornment) ?? q, H = (s == null ? void 0 : s.endAdornment) ?? D, O = R || B || V, d = w(async (r) => {
41
46
  if (!a) return;
42
- z.current = !0;
43
- const o = await ie(r, a);
44
- z.current = !1, R(o);
47
+ j.current = !0;
48
+ const f = await fe(r, a);
49
+ j.current = !1, E(f);
45
50
  }, [a]);
46
- le(() => {
47
- d && R(null);
48
- }, [d]);
49
- const ee = B(
51
+ oe(() => {
52
+ p && E(null);
53
+ }, [p]);
54
+ const ae = w(
50
55
  (r) => {
51
- if (g) {
52
- const o = ce(r.target.value, g);
53
- o !== r.target.value && (r.target.value = o);
56
+ if (x) {
57
+ const f = de(r.target.value, x);
58
+ f !== r.target.value && (r.target.value = f);
54
59
  }
55
- l == null || l(r), E && a && u(r.target.value);
60
+ n == null || n(r), N && a && d(r.target.value);
56
61
  },
57
- [g, l, E, a, u]
58
- ), re = B(
62
+ [x, n, N, a, d]
63
+ ), te = w(
59
64
  (r) => {
60
- n == null || n(r), C && a && u(r.target.value);
65
+ o == null || o(r), A && a && d(r.target.value);
61
66
  },
62
- [n, C, a, u]
67
+ [o, A, a, d]
63
68
  );
64
- return /* @__PURE__ */ s("div", { className: f("Bear-Input bear-flex bear-flex-col bear-gap-1.5", H && "bear-w-full"), style: X, children: [
65
- k && /* @__PURE__ */ t("label", { className: "Bear-Input__label bear-text-sm bear-font-medium bear-text-gray-700 dark:bear-text-gray-300", style: Z, children: k }),
66
- /* @__PURE__ */ s("div", { className: "Bear-Input__wrapper bear-relative bear-flex bear-items-center", children: [
67
- p && /* @__PURE__ */ t("div", { className: "Bear-Input__addon Bear-Input__addon--left bear-absolute bear-left-3 bear-text-gray-500 dark:bear-text-gray-400", style: P, children: p }),
68
- /* @__PURE__ */ t(
69
- "input",
70
- {
71
- ref: W,
72
- disabled: x,
73
- value: _,
74
- defaultValue: y,
75
- maxLength: j,
76
- "aria-invalid": c || void 0,
77
- onChange: ee,
78
- onBlur: re,
79
- className: f(
80
- "Bear-Input__field",
81
- "bear-w-full bear-rounded-lg bear-border bear-outline-none bear-transition-all bear-duration-200",
82
- "bear-bg-white bear-text-gray-900 placeholder:bear-text-gray-400",
83
- "bear-border-gray-300 focus:bear-ring-2 focus:bear-ring-offset-2 focus:bear-ring-offset-white",
84
- "dark:bear-bg-gray-800 dark:bear-text-white dark:placeholder:bear-text-gray-500 dark:bear-border-gray-600 dark:focus:bear-ring-offset-gray-900",
85
- c ? "Bear-Input__field--error bear-border-red-500 focus:bear-ring-red-500" : O ? "Bear-Input__field--success bear-border-green-500 focus:bear-ring-green-500" : "focus:bear-border-bear-500 focus:bear-ring-bear-500 dark:focus:bear-border-bear-500 dark:focus:bear-ring-bear-500",
86
- x && "Bear-Input__field--disabled bear-opacity-50 bear-cursor-not-allowed",
87
- p && "bear-pl-10",
88
- (b || I) && "bear-pr-10",
89
- ue[G],
90
- T
69
+ return /* @__PURE__ */ u("div", { className: l("Bear-Input bear-flex bear-flex-col bear-gap-1.5", F && "bear-w-full"), style: Y, children: [
70
+ y && /* @__PURE__ */ t("label", { className: "Bear-Input__label bear-text-sm bear-font-medium", style: { color: "var(--bear-text-secondary)", ...$ }, children: y }),
71
+ /* @__PURE__ */ u(
72
+ "div",
73
+ {
74
+ className: l(
75
+ "Bear-Input__wrapper bear-flex bear-items-center bear-rounded-lg bear-border bear-overflow-hidden bear-transition-all bear-duration-200",
76
+ "focus-within:bear-ring-2 focus-within:bear-ring-offset-2",
77
+ "focus-within:bear-ring-offset-[var(--bear-bg-primary)]",
78
+ b ? "Bear-Input__wrapper--error bear-border-red-500 focus-within:bear-ring-red-500" : i ? "Bear-Input__wrapper--success bear-border-green-500 focus-within:bear-ring-green-500" : "focus-within:bear-border-bear-500 focus-within:bear-ring-bear-500 dark:focus-within:bear-border-bear-500 dark:focus-within:bear-ring-bear-500",
79
+ m && "bear-opacity-50 bear-cursor-not-allowed",
80
+ ue[k]
81
+ ),
82
+ style: {
83
+ backgroundColor: "var(--bear-bg-primary)",
84
+ borderColor: b || i ? void 0 : "var(--bear-border-default)"
85
+ },
86
+ children: [
87
+ M && /* @__PURE__ */ t(
88
+ "div",
89
+ {
90
+ className: "Bear-Input__addon Bear-Input__addon--left bear-flex bear-items-center bear-self-stretch bear-shrink-0 bear-px-3 bear-text-sm bear-font-medium bear-select-none bear-pointer-events-none",
91
+ style: {
92
+ backgroundColor: "var(--bear-bg-tertiary)",
93
+ borderRight: "1px solid var(--bear-border-default)",
94
+ color: "var(--bear-text-secondary)",
95
+ ...S
96
+ },
97
+ children: M
98
+ }
91
99
  ),
92
- style: Y,
93
- ...U
94
- }
95
- ),
96
- I && !b && /* @__PURE__ */ t("div", { className: "Bear-Input__addon Bear-Input__addon--right bear-absolute bear-right-3 bear-text-gray-500 dark:bear-text-gray-400", style: M, children: /* @__PURE__ */ t(D, { onClick: w }) }),
97
- b && /* @__PURE__ */ s("div", { className: "Bear-Input__addon Bear-Input__addon--right bear-absolute bear-right-3 bear-flex bear-items-center bear-gap-1.5 bear-text-gray-500 dark:bear-text-gray-400", style: M, children: [
98
- I && /* @__PURE__ */ t(D, { onClick: w }),
99
- b
100
- ] })
101
- ] }),
102
- /* @__PURE__ */ s("div", { className: "Bear-Input__footer bear-flex bear-items-center bear-justify-between bear-gap-2", children: [
103
- V ? /* @__PURE__ */ t(
100
+ /* @__PURE__ */ t(
101
+ "input",
102
+ {
103
+ ref: X,
104
+ disabled: m,
105
+ value: h,
106
+ defaultValue: g,
107
+ maxLength: C,
108
+ "aria-invalid": b || void 0,
109
+ onChange: ae,
110
+ onBlur: te,
111
+ className: l(
112
+ "Bear-Input__field",
113
+ "bear-flex-1 bear-min-w-0 bear-h-full bear-border-0 bear-outline-none bear-bg-transparent",
114
+ "placeholder:opacity-100 placeholder:[color:var(--bear-text-muted)]",
115
+ pe[k],
116
+ U
117
+ ),
118
+ style: {
119
+ color: "var(--bear-text-primary)",
120
+ ...Z
121
+ },
122
+ ...W
123
+ }
124
+ ),
125
+ re && /* @__PURE__ */ t(
126
+ "div",
127
+ {
128
+ className: "Bear-Input__clear bear-flex bear-items-center bear-self-stretch bear-shrink-0 bear-px-2 bear-cursor-pointer",
129
+ style: { color: "var(--bear-text-muted)" },
130
+ children: /* @__PURE__ */ t(ce, { onClick: J })
131
+ }
132
+ ),
133
+ H && /* @__PURE__ */ t(
134
+ "div",
135
+ {
136
+ className: "Bear-Input__addon Bear-Input__addon--right bear-flex bear-items-center bear-self-stretch bear-shrink-0 bear-px-3 bear-gap-1.5",
137
+ style: {
138
+ backgroundColor: "var(--bear-bg-tertiary)",
139
+ borderLeft: "1px solid var(--bear-border-default)",
140
+ color: "var(--bear-text-secondary)",
141
+ ...P
142
+ },
143
+ children: H
144
+ }
145
+ )
146
+ ]
147
+ }
148
+ ),
149
+ /* @__PURE__ */ u("div", { className: "Bear-Input__footer bear-flex bear-items-center bear-justify-between bear-gap-2", children: [
150
+ O ? /* @__PURE__ */ t(
104
151
  "p",
105
152
  {
106
- className: f(
153
+ className: l(
107
154
  "Bear-Input__helper bear-text-sm bear-flex-1",
108
- c ? "Bear-Input__helper--error bear-text-red-500" : O ? "Bear-Input__helper--success bear-text-green-500" : "bear-text-gray-500 dark:bear-text-gray-400"
155
+ b && "Bear-Input__helper--error bear-text-red-500",
156
+ i && "Bear-Input__helper--success bear-text-green-500"
109
157
  ),
110
- style: $,
111
- children: V
158
+ style: {
159
+ ...b || i ? {} : { color: "var(--bear-text-muted)" },
160
+ ...z
161
+ },
162
+ children: O
112
163
  }
113
- ) : v ? /* @__PURE__ */ t("span", {}) : null,
114
- v && i != null && /* @__PURE__ */ s(
164
+ ) : I ? /* @__PURE__ */ t("span", {}) : null,
165
+ I && c != null && /* @__PURE__ */ u(
115
166
  "span",
116
167
  {
117
- className: f(
168
+ className: l(
118
169
  "Bear-Input__char-count bear-text-xs bear-tabular-nums bear-shrink-0",
119
- A ? "bear-text-red-500" : "bear-text-gray-400 dark:bear-text-gray-500"
170
+ L && "bear-text-red-500"
120
171
  ),
172
+ style: L ? void 0 : { color: "var(--bear-text-muted)" },
121
173
  children: [
122
- m,
174
+ v,
123
175
  "/",
124
- i
176
+ c
125
177
  ]
126
178
  }
127
179
  )
@@ -129,7 +181,7 @@ const ue = {
129
181
  ] });
130
182
  }
131
183
  );
132
- oe.displayName = "Input";
184
+ xe.displayName = "Input";
133
185
  export {
134
- oe as Input
186
+ xe as Input
135
187
  };
@@ -1,6 +1,10 @@
1
1
  import { InputHTMLAttributes, ReactNode } from 'react';
2
2
  import { ValidationRule } from '../Form/Form.types';
3
3
  export type AutoFormatType = 'capitalize' | 'uppercase' | 'lowercase' | 'titleCase' | 'sentenceCase' | 'none';
4
+ export interface InputPropsInput {
5
+ startAdornment?: ReactNode;
6
+ endAdornment?: ReactNode;
7
+ }
4
8
  export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size'> {
5
9
  /** Input label */
6
10
  label?: string;
@@ -12,9 +16,11 @@ export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>,
12
16
  success?: string;
13
17
  /** Input size */
14
18
  size?: 'sm' | 'md' | 'lg';
15
- /** Left addon */
19
+ /** Start/end slots (takes precedence over leftAddon/rightAddon when set) */
20
+ InputProps?: InputPropsInput;
21
+ /** Left addon (legacy; use InputProps.startAdornment for start slot) */
16
22
  leftAddon?: ReactNode;
17
- /** Right addon */
23
+ /** Right addon (legacy; use InputProps.endAdornment for end slot) */
18
24
  rightAddon?: ReactNode;
19
25
  /** Whether input is full width */
20
26
  fullWidth?: boolean;
@@ -1,2 +1,2 @@
1
1
  export { Input } from './Input';
2
- export type { InputProps, AutoFormatType } from './Input.types';
2
+ export type { InputProps, InputPropsInput, AutoFormatType } from './Input.types';
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),t=require("react"),v=require("../../utils/cn.cjs"),P={sm:"bear-h-8 bear-text-sm bear-px-3",md:"bear-h-10 bear-text-base bear-px-4",lg:"bear-h-12 bear-text-lg bear-px-5"},U=(u,g)=>{const a=g.toLowerCase();return u.filter(l=>l.value.toLowerCase().includes(a)||String(l.label).toLowerCase().includes(a))},V=({value:u,defaultValue:g="",onChange:a,onMentionSelect:l,options:S,trigger:c="@",placeholder:D="Type @ to mention...",disabled:k=!1,maxSuggestions:L=5,filterOptions:M=U,size:N="md",fullWidth:T=!1,className:$})=>{const[A,q]=t.useState(g),[d,K]=t.useState(""),[Q,x]=t.useState(!1),[b,h]=t.useState(0),[p,B]=t.useState(null),y=t.useRef(null),z=t.useRef(null),w=t.useRef(null),n=u??A,i=M(S,d).slice(0,L),E=Q&&d.length>=0,I=t.useCallback(()=>{const e=n.lastIndexOf(c);if(e===-1)return{query:"",start:null};const r=n.slice(e+c.length),s=r.indexOf(" ");return{query:s===-1?r:r.slice(0,s),start:e}},[n,c]);t.useEffect(()=>{const{query:e,start:r}=I();K(e),B(r),x(r!==null&&!e.includes(" "))},[n,I]),t.useEffect(()=>{h(0)},[d]),t.useEffect(()=>{if(b>=0&&w.current){const e=w.current.children[b];e==null||e.scrollIntoView({block:"nearest"})}},[b]),t.useEffect(()=>{const e=r=>{y.current&&!y.current.contains(r.target)&&x(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);const R=e=>{const r=new RegExp(`${c}(\\w+)`,"g"),s=[];let f;for(;(f=r.exec(e))!==null;)s.push(f[1]);return[...new Set(s)]},F=e=>{const r=e.target.value;u===void 0&&q(r),a==null||a(r,R(r))},j=e=>{var O;if(p==null)return;const r=n.slice(0,p),s=n.slice(p+c.length+d.length),f=`${c}${e.value}`,m=r+f+" "+s;u===void 0&&q(m),a==null||a(m,R(m)),l==null||l(e),x(!1),(O=z.current)==null||O.focus()},H=e=>{if(!(!E||i.length===0)){if(e.key==="ArrowDown"){e.preventDefault(),h(r=>Math.min(r+1,i.length-1));return}if(e.key==="ArrowUp"){e.preventDefault(),h(r=>Math.max(r-1,0));return}if(e.key==="Enter"||e.key==="Tab"){e.preventDefault();const r=i[b];r&&j(r);return}e.key==="Escape"&&x(!1)}};return o.jsxs("div",{ref:y,className:v.cn("Bear-MentionsInput bear-relative",T&&"bear-w-full",$),children:[o.jsx("input",{ref:z,type:"text",value:n,onChange:F,onKeyDown:H,placeholder:D,disabled:k,className:v.cn("bear-w-full bear-rounded-lg bear-border bear-border-gray-300 dark:bear-border-zinc-600 bear-bg-white dark:bear-bg-zinc-900 bear-text-gray-900 dark:bear-text-white placeholder:bear-text-gray-500 dark:placeholder:bear-text-zinc-500 bear-outline-none bear-transition-colors focus:bear-border-bear-500 focus:bear-ring-2 focus:bear-ring-bear-500/20",k&&"bear-opacity-50 bear-cursor-not-allowed",P[N])}),E&&i.length>0&&o.jsx("div",{ref:w,className:"bear-absolute bear-z-50 bear-mt-1 bear-w-full bear-max-h-48 bear-overflow-auto bear-rounded-lg bear-border bear-border-gray-200 dark:bear-border-zinc-600 bear-bg-white dark:bear-bg-zinc-800 bear-py-1 bear-shadow-lg",children:i.map((e,r)=>o.jsxs("button",{type:"button",className:v.cn("bear-w-full bear-flex bear-items-center bear-gap-2 bear-px-3 bear-py-2 bear-text-left bear-text-gray-800 dark:bear-text-zinc-200 hover:bear-bg-gray-100 dark:hover:bear-bg-zinc-700 bear-transition-colors",r===b&&"bear-bg-gray-100 dark:bear-bg-zinc-700"),onMouseEnter:()=>h(r),onClick:()=>j(e),children:[e.avatar&&o.jsx("span",{className:"bear-shrink-0",children:e.avatar}),o.jsx("span",{children:e.label})]},e.value))})]})};exports.MentionsInput=V;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),t=require("react"),v=require("../../utils/cn.cjs"),P=require("./MentionsInput.utils.cjs"),U={sm:"bear-h-8 bear-text-sm bear-px-3",md:"bear-h-10 bear-text-base bear-px-4",lg:"bear-h-12 bear-text-lg bear-px-5"},V=({value:x,defaultValue:O="",onChange:s,onMentionSelect:h,options:D,trigger:l="@",placeholder:M="Type @ to mention...",disabled:w=!1,maxSuggestions:S=5,filterOptions:N=P.defaultFilter,size:T="md",fullWidth:L=!1,className:$})=>{const[A,k]=t.useState(O),[i,K]=t.useState(""),[Q,f]=t.useState(!1),[u,d]=t.useState(0),[p,B]=t.useState(null),g=t.useRef(null),q=t.useRef(null),y=t.useRef(null),a=x??A,o=N(D,i).slice(0,S),I=Q&&i.length>=0,z=t.useCallback(()=>{const e=a.lastIndexOf(l);if(e===-1)return{query:"",start:null};const r=a.slice(e+l.length),n=r.indexOf(" ");return{query:n===-1?r:r.slice(0,n),start:e}},[a,l]);t.useEffect(()=>{const{query:e,start:r}=z();K(e),B(r),f(r!==null&&!e.includes(" "))},[a,z]),t.useEffect(()=>{d(0)},[i]),t.useEffect(()=>{if(u>=0&&y.current){const e=y.current.children[u];e==null||e.scrollIntoView({block:"nearest"})}},[u]),t.useEffect(()=>{const e=r=>{g.current&&!g.current.contains(r.target)&&f(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);const E=e=>{const r=new RegExp(`${l}(\\w+)`,"g"),n=[];let b;for(;(b=r.exec(e))!==null;)n.push(b[1]);return[...new Set(n)]},F=e=>{const r=e.target.value;x===void 0&&k(r),s==null||s(r,E(r))},R=e=>{var j;if(p==null)return;const r=a.slice(0,p),n=a.slice(p+l.length+i.length),b=`${l}${e.value}`,m=r+b+" "+n;x===void 0&&k(m),s==null||s(m,E(m)),h==null||h(e),f(!1),(j=q.current)==null||j.focus()},H=e=>{if(!(!I||o.length===0)){if(e.key==="ArrowDown"){e.preventDefault(),d(r=>Math.min(r+1,o.length-1));return}if(e.key==="ArrowUp"){e.preventDefault(),d(r=>Math.max(r-1,0));return}if(e.key==="Enter"||e.key==="Tab"){e.preventDefault();const r=o[u];r&&R(r);return}e.key==="Escape"&&f(!1)}};return c.jsxs("div",{ref:g,className:v.cn("Bear-MentionsInput bear-relative",L&&"bear-w-full",$),children:[c.jsx("input",{ref:q,type:"text",value:a,onChange:F,onKeyDown:H,placeholder:M,disabled:w,className:v.cn("bear-w-full bear-rounded-lg bear-border bear-border-gray-300 dark:bear-border-zinc-600 bear-bg-white dark:bear-bg-zinc-900 bear-text-gray-900 dark:bear-text-white placeholder:bear-text-gray-500 dark:placeholder:bear-text-zinc-500 bear-outline-none bear-transition-colors focus:bear-border-bear-500 focus:bear-ring-2 focus:bear-ring-bear-500/20",w&&"bear-opacity-50 bear-cursor-not-allowed",U[T])}),I&&o.length>0&&c.jsx("div",{ref:y,className:"bear-absolute bear-z-50 bear-mt-1 bear-w-full bear-max-h-48 bear-overflow-auto bear-rounded-lg bear-border bear-border-gray-200 dark:bear-border-zinc-600 bear-bg-white dark:bear-bg-zinc-800 bear-py-1 bear-shadow-lg",children:o.map((e,r)=>c.jsxs("button",{type:"button",className:v.cn("bear-w-full bear-flex bear-items-center bear-gap-2 bear-px-3 bear-py-2 bear-text-left bear-text-gray-800 dark:bear-text-zinc-200 hover:bear-bg-gray-100 dark:hover:bear-bg-zinc-700 bear-transition-colors",r===u&&"bear-bg-gray-100 dark:bear-bg-zinc-700"),onMouseEnter:()=>d(r),onClick:()=>R(e),children:[e.avatar&&c.jsx("span",{className:"bear-shrink-0",children:e.avatar}),c.jsx("span",{children:e.label})]},e.value))})]})};exports.MentionsInput=V;