@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
package/README.md CHANGED
@@ -76,7 +76,7 @@ function App() {
76
76
 
77
77
  ### Form Components
78
78
 
79
- - `Input` - Text input field
79
+ - `Input` / `TextField` - Text input with optional `InputProps.startAdornment` / `endAdornment` for start/end slots
80
80
  - `Select` / `MultiSelect` - Dropdown selection components
81
81
  - `Checkbox` - Checkbox input
82
82
  - `Radio` / `RadioGroup` - Radio button inputs
@@ -116,7 +116,7 @@ function App() {
116
116
  - `DataTable` - Advanced data table with sorting, filtering, and pagination
117
117
  - `Carousel` - Image/content carousel
118
118
  - `Accordion` - Collapsible content sections
119
- - `Tabs` - Tabbed interface
119
+ - `Tabs` / `TabList` / `Tab` / `TabPanel` - Tabbed interface; `TabList` supports `maxVisibleTabs` (overflow dropdown) and `wrap` (auto-break)
120
120
  - `List` - List component with various item types
121
121
  - `Avatar` / `AvatarGroup` - User avatar display
122
122
  - `Chip` - Compact element for input, attribute, or action
@@ -284,6 +284,25 @@ const buttonProps: ButtonProps = {
284
284
  <Button {...buttonProps} />
285
285
  ```
286
286
 
287
+ ## How Bear Compares
288
+
289
+ | Feature | Bear UI | Material UI | 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) | X (add-on) | 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,10 +1,5 @@
1
- import { FC, SVGAttributes } from 'react';
2
- export interface BearLogoProps extends SVGAttributes<SVGElement> {
3
- /** Logo size in pixels */
4
- size?: number;
5
- /** Whether to show animated sparkle */
6
- animated?: boolean;
7
- }
1
+ import { FC } from 'react';
2
+ import { BearLogoProps } from './BearLogo.types';
8
3
  /**
9
4
  * BearLogo - Lotso-inspired pink teddy bear logo from Toy Story
10
5
  * Full body sitting teddy bear with characteristic angry eyebrows
@@ -0,0 +1,15 @@
1
+ import { SVGAttributes } from 'react';
2
+ export interface BearLogoProps extends SVGAttributes<SVGElement> {
3
+ /** Logo size in pixels */
4
+ size?: number;
5
+ /** Whether to show animated sparkle */
6
+ animated?: boolean;
7
+ }
8
+ export interface EmberLogoProps {
9
+ /** Logo size in pixels */
10
+ size?: number;
11
+ /** Additional class names */
12
+ className?: string;
13
+ /** Whether to animate the logo */
14
+ animated?: boolean;
15
+ }
@@ -1,12 +1,5 @@
1
1
  import { FC } from 'react';
2
- export interface EmberLogoProps {
3
- /** Logo size in pixels */
4
- size?: number;
5
- /** Additional class names */
6
- className?: string;
7
- /** Whether to animate the logo */
8
- animated?: boolean;
9
- }
2
+ import { EmberLogoProps } from './BearLogo.types';
10
3
  /**
11
4
  * Ember Logo Component
12
5
  * A stylized flame representing warmth, energy, and the forge
@@ -1,4 +1,3 @@
1
1
  export { BearLogo } from './BearLogo';
2
- export type { BearLogoProps } from './BearLogo';
3
2
  export { EmberLogo } from './EmberLogo';
4
- export type { EmberLogoProps } from './EmberLogo';
3
+ export type { BearLogoProps, EmberLogoProps } from './BearLogo.types';
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),N=require("react"),n=require("../../utils/cn.cjs"),q=require("./BiometricIcon.cjs"),z=require("./useBiometric.cjs"),M={sm:48,md:72,lg:96,xl:128},_={sm:80,md:120,lg:160,xl:200},g={idle:"bear-text-gray-500 dark:bear-text-gray-400",scanning:"bear-text-bear-500 dark:bear-text-bear-400",success:"bear-text-green-500 dark:bear-text-green-400",error:"bear-text-red-500 dark:bear-text-red-400"},i={idle:"var(--bear-border-default)",scanning:"var(--bear-primary-500, #ec4899)",success:"var(--bear-success-500, #22c55e)",error:"var(--bear-danger-500, #ef4444)"},w=({type:b="fingerprint",size:l="md",status:o,label:m,successLabel:p="Verified",errorLabel:x="Try again",scanningLabel:f="Scanning...",onScan:a,onSuccess:y,onError:v,disabled:s=!1,animated:t=!0,className:j,testId:B})=>{const{status:k,scan:u}=z.useBiometric({onSuccess:y,onError:v}),e=o??k,C=M[l],d=_[l],c=e==="scanning"?f:e==="success"?p:e==="error"?x:m,h=N.useCallback(()=>{s||e==="scanning"||(a==null||a(),o===void 0&&u())},[s,e,a,o,u]);return r.jsxs("div",{className:n.cn("Bear-Biometric bear-flex bear-flex-col bear-items-center bear-gap-3",j),"data-testid":B,"data-status":e,"data-type":b,children:[r.jsxs("button",{type:"button",disabled:s||e==="scanning",onClick:h,className:n.cn("Bear-Biometric__trigger bear-relative bear-flex bear-items-center bear-justify-center bear-rounded-full bear-border-0 bear-cursor-pointer bear-outline-none","bear-transition-all bear-duration-300","focus-visible:bear-ring-2 focus-visible:bear-ring-bear-500 focus-visible:bear-ring-offset-2",g[e],s&&"bear-opacity-40 bear-cursor-not-allowed"),style:{width:d,height:d,backgroundColor:"var(--bear-bg-secondary)"},"aria-label":c??"Authenticate",children:[t&&e==="scanning"&&r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"bear-absolute bear-inset-0 bear-rounded-full bear-animate-ping bear-opacity-20",style:{backgroundColor:i[e]}}),r.jsx("span",{className:"bear-absolute bear-inset-2 bear-rounded-full bear-animate-ping bear-opacity-10",style:{backgroundColor:i[e],animationDelay:"0.3s"}})]}),r.jsx("span",{className:n.cn("bear-absolute bear-inset-0 bear-rounded-full bear-border-2 bear-transition-colors bear-duration-300",e==="scanning"&&t&&"bear-animate-spin"),style:{borderColor:i[e],borderStyle:e==="scanning"?"dashed":"solid",animationDuration:e==="scanning"?"3s":void 0}}),t&&e==="success"&&r.jsx("span",{className:"bear-absolute bear-inset-0 bear-rounded-full bear-opacity-10",style:{backgroundColor:i.success}}),r.jsx(q.BiometricIcon,{type:b,size:C,status:e,animated:t})]}),c&&r.jsx("span",{className:n.cn("Bear-Biometric__label bear-text-sm bear-font-medium bear-transition-colors bear-duration-300",g[e]),children:c})]})};exports.Biometric=w;
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ import { BiometricProps } from './Biometric.types';
3
+ export declare const Biometric: FC<BiometricProps>;