@forgedevstack/bear 1.2.5 → 1.2.6

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 (87) hide show
  1. package/README.md +15 -0
  2. package/dist/components/AppBar/AppBar.cjs +1 -1
  3. package/dist/components/AppBar/AppBar.const.cjs +1 -0
  4. package/dist/components/AppBar/AppBar.const.d.ts +36 -1
  5. package/dist/components/AppBar/AppBar.const.js +39 -0
  6. package/dist/components/AppBar/AppBar.js +65 -42
  7. package/dist/components/AppBar/AppBar.types.d.ts +9 -3
  8. package/dist/components/Backdrop/Backdrop.cjs +1 -0
  9. package/dist/components/Backdrop/Backdrop.const.cjs +1 -0
  10. package/dist/components/Backdrop/Backdrop.const.d.ts +7 -0
  11. package/dist/components/Backdrop/Backdrop.const.js +10 -0
  12. package/dist/components/Backdrop/Backdrop.d.ts +3 -0
  13. package/dist/components/Backdrop/Backdrop.js +43 -0
  14. package/dist/components/Backdrop/Backdrop.types.d.ts +12 -0
  15. package/dist/components/Backdrop/index.d.ts +2 -0
  16. package/dist/components/BottomNavigation/BottomNavigation.cjs +1 -1
  17. package/dist/components/BottomNavigation/BottomNavigation.const.cjs +1 -0
  18. package/dist/components/BottomNavigation/BottomNavigation.const.d.ts +8 -1
  19. package/dist/components/BottomNavigation/BottomNavigation.const.js +11 -0
  20. package/dist/components/BottomNavigation/BottomNavigation.js +64 -46
  21. package/dist/components/Breadcrumbs/Breadcrumbs.cjs +1 -1
  22. package/dist/components/Breadcrumbs/Breadcrumbs.js +65 -64
  23. package/dist/components/Chip/Chip.cjs +1 -1
  24. package/dist/components/Chip/Chip.const.cjs +1 -0
  25. package/dist/components/Chip/Chip.const.d.ts +39 -0
  26. package/dist/components/Chip/Chip.const.js +43 -0
  27. package/dist/components/Chip/Chip.js +44 -65
  28. package/dist/components/ChipGroup/ChipGroup.cjs +1 -0
  29. package/dist/components/ChipGroup/ChipGroup.const.cjs +1 -0
  30. package/dist/components/ChipGroup/ChipGroup.const.d.ts +8 -0
  31. package/dist/components/ChipGroup/ChipGroup.const.js +11 -0
  32. package/dist/components/ChipGroup/ChipGroup.d.ts +3 -0
  33. package/dist/components/ChipGroup/ChipGroup.js +41 -0
  34. package/dist/components/ChipGroup/ChipGroup.types.d.ts +9 -0
  35. package/dist/components/ChipGroup/index.d.ts +2 -0
  36. package/dist/components/Drawer/Drawer.cjs +1 -1
  37. package/dist/components/Drawer/Drawer.js +57 -56
  38. package/dist/components/Input/Input.cjs +1 -1
  39. package/dist/components/Input/Input.js +63 -62
  40. package/dist/components/List/List.cjs +1 -1
  41. package/dist/components/List/List.js +133 -123
  42. package/dist/components/List/List.types.d.ts +2 -0
  43. package/dist/components/MessageList/MessageList.cjs +1 -1
  44. package/dist/components/MessageList/MessageList.const.cjs +1 -1
  45. package/dist/components/MessageList/MessageList.const.d.ts +6 -0
  46. package/dist/components/MessageList/MessageList.const.js +26 -20
  47. package/dist/components/MessageList/MessageList.d.ts +0 -16
  48. package/dist/components/MessageList/MessageList.js +127 -115
  49. package/dist/components/MessageList/MessageList.types.d.ts +2 -0
  50. package/dist/components/MessageList/MessageList.utils.cjs +1 -1
  51. package/dist/components/MessageList/MessageList.utils.d.ts +7 -0
  52. package/dist/components/MessageList/MessageList.utils.js +47 -28
  53. package/dist/components/Progress/Progress.cjs +1 -1
  54. package/dist/components/Progress/Progress.const.cjs +1 -0
  55. package/dist/components/Progress/Progress.const.d.ts +16 -1
  56. package/dist/components/Progress/Progress.const.js +19 -0
  57. package/dist/components/Progress/Progress.d.ts +0 -10
  58. package/dist/components/Progress/Progress.js +81 -71
  59. package/dist/components/Progress/Progress.types.d.ts +2 -11
  60. package/dist/components/PropsPlayground/PropsPlayground.cjs +1 -1
  61. package/dist/components/PropsPlayground/PropsPlayground.js +40 -40
  62. package/dist/components/Select/Select.cjs +1 -1
  63. package/dist/components/Select/Select.const.cjs +1 -0
  64. package/dist/components/Select/Select.const.d.ts +9 -0
  65. package/dist/components/Select/Select.const.js +13 -0
  66. package/dist/components/Select/Select.js +144 -68
  67. package/dist/components/Stepper/Stepper.cjs +1 -1
  68. package/dist/components/Stepper/Stepper.js +89 -83
  69. package/dist/components/Toast/Toast.cjs +1 -1
  70. package/dist/components/Toast/Toast.const.cjs +1 -0
  71. package/dist/components/Toast/Toast.const.d.ts +4 -0
  72. package/dist/components/Toast/Toast.const.js +17 -0
  73. package/dist/components/Toast/Toast.d.ts +0 -1
  74. package/dist/components/Toast/Toast.js +90 -84
  75. package/dist/components/index.cjs +1 -1
  76. package/dist/components/index.d.ts +4 -0
  77. package/dist/components/index.js +277 -273
  78. package/dist/context/BearProvider.cjs +1 -1
  79. package/dist/context/BearProvider.d.ts +8 -0
  80. package/dist/context/BearProvider.js +149 -139
  81. package/dist/context/index.cjs +1 -1
  82. package/dist/context/index.d.ts +1 -1
  83. package/dist/context/index.js +12 -10
  84. package/dist/index.cjs +1 -1
  85. package/dist/index.js +385 -379
  86. package/dist/styles.css +67 -19
  87. package/package.json +1 -1
@@ -1,93 +1,94 @@
1
- import { jsxs as l, jsx as t } from "react/jsx-runtime";
2
- import { useState as d, useEffect as k, useCallback as A } from "react";
1
+ import { jsxs as d, jsx as t } from "react/jsx-runtime";
2
+ import { useState as c, useEffect as x, useCallback as O } from "react";
3
3
  import { createPortal as R } from "react-dom";
4
- import { cn as x } from "../../utils/cn.js";
5
- import { XIcon as D } from "../Icon/index.js";
6
- import { DRAWER_ANIMATION_MS as c, TRANSFORM_OPEN as M, TRANSFORM_CLOSED as O, SIZE_CLASSES as C, POSITION_CLASSES as L, BORDER_SIDE_MAP as T } from "./Drawer.const.js";
7
- import { lockBodyScroll as F } from "./Drawer.utils.js";
8
- const G = ({
9
- isOpen: b,
4
+ import { useBearDirectionOptional as M } from "../../context/BearProvider.js";
5
+ import { cn as S } from "../../utils/cn.js";
6
+ import { XIcon as C } from "../Icon/index.js";
7
+ import { DRAWER_ANIMATION_MS as u, TRANSFORM_OPEN as L, TRANSFORM_CLOSED as T, SIZE_CLASSES as F, POSITION_CLASSES as P, BORDER_SIDE_MAP as j } from "./Drawer.const.js";
8
+ import { lockBodyScroll as B } from "./Drawer.utils.js";
9
+ const U = ({
10
+ isOpen: s,
10
11
  onClose: o,
11
12
  title: n,
12
- children: p,
13
+ children: w,
13
14
  side: y = "right",
14
- anchor: S,
15
- variant: P = "temporary",
16
- size: w = "md",
17
- showCloseButton: u = !0,
18
- closeOnBackdrop: N = !0,
19
- closeOnEscape: m = !0,
20
- className: E,
21
- container: g,
22
- id: j,
23
- testId: $
15
+ anchor: N,
16
+ variant: $ = "temporary",
17
+ size: g = "md",
18
+ showCloseButton: m = !0,
19
+ closeOnBackdrop: E = !0,
20
+ closeOnEscape: f = !0,
21
+ className: I,
22
+ container: _,
23
+ id: q,
24
+ testId: z
24
25
  }) => {
25
- const r = S ?? y, [a, f] = d(b), [v, s] = d(!1), [I, h] = d(!1);
26
- k(() => {
27
- if (b) {
28
- f(!0), s(!1);
29
- const e = requestAnimationFrame(() => h(!0));
26
+ const { direction: h } = M(), i = N ?? y, r = h === "rtl" && (i === "left" || i === "right") ? i === "left" ? "right" : "left" : i, [a, v] = c(s), [k, b] = c(!1), [A, p] = c(!1);
27
+ x(() => {
28
+ if (s) {
29
+ v(!0), b(!1);
30
+ const e = requestAnimationFrame(() => p(!0));
30
31
  return () => cancelAnimationFrame(e);
31
32
  }
32
33
  if (a) {
33
- h(!1), s(!0);
34
+ p(!1), b(!0);
34
35
  const e = setTimeout(() => {
35
- f(!1), s(!1);
36
- }, c);
36
+ v(!1), b(!1);
37
+ }, u);
37
38
  return () => clearTimeout(e);
38
39
  }
39
- }, [b, a]);
40
- const i = A(
40
+ }, [s, a]);
41
+ const l = O(
41
42
  (e) => {
42
- m && e.key === "Escape" && o();
43
+ f && e.key === "Escape" && o();
43
44
  },
44
- [m, o]
45
+ [f, o]
45
46
  );
46
- if (k(() => {
47
+ if (x(() => {
47
48
  if (a) {
48
- document.addEventListener("keydown", i);
49
- const e = F();
49
+ document.addEventListener("keydown", l);
50
+ const e = B();
50
51
  return () => {
51
- document.removeEventListener("keydown", i), e();
52
+ document.removeEventListener("keydown", l), e();
52
53
  };
53
54
  }
54
55
  return () => {
55
- document.removeEventListener("keydown", i);
56
+ document.removeEventListener("keydown", l);
56
57
  };
57
- }, [a, i]), !a) return null;
58
- const _ = /* @__PURE__ */ l("div", { className: "bear-fixed bear-inset-0 bear-z-[11000]", children: [
58
+ }, [a, l]), !a) return null;
59
+ const D = /* @__PURE__ */ d("div", { className: "bear-fixed bear-inset-0 bear-z-[11000]", children: [
59
60
  /* @__PURE__ */ t(
60
61
  "div",
61
62
  {
62
- className: x(
63
+ className: S(
63
64
  "bear-absolute bear-inset-0 bear-bg-black/60 bear-backdrop-blur-sm bear-transition-opacity",
64
- v ? "bear-opacity-0" : "bear-opacity-100"
65
+ k ? "bear-opacity-0" : "bear-opacity-100"
65
66
  ),
66
- style: { transitionDuration: `${c}ms` },
67
- onClick: N ? o : void 0,
67
+ style: { transitionDuration: `${u}ms` },
68
+ onClick: E ? o : void 0,
68
69
  "aria-hidden": "true"
69
70
  }
70
71
  ),
71
- /* @__PURE__ */ l(
72
+ /* @__PURE__ */ d(
72
73
  "div",
73
74
  {
74
75
  role: "dialog",
75
76
  "aria-modal": "true",
76
77
  "aria-labelledby": n ? "drawer-title" : void 0,
77
- className: x(
78
+ className: S(
78
79
  "bear-absolute bear-bg-white dark:bear-bg-neutral-900 bear-shadow-2xl",
79
80
  "bear-border-neutral-200 dark:bear-border-neutral-700",
80
81
  "bear-flex bear-flex-col bear-overflow-hidden",
81
82
  "bear-transform bear-transition-transform",
82
- T[r],
83
- L[r],
84
- C[r][w],
85
- I && !v ? M[r] : O[r],
86
- E
83
+ j[r],
84
+ P[r],
85
+ F[r][g],
86
+ A && !k ? L[r] : T[r],
87
+ I
87
88
  ),
88
- style: { transitionDuration: `${c}ms` },
89
+ style: { transitionDuration: `${u}ms` },
89
90
  children: [
90
- (n || u) && /* @__PURE__ */ l("div", { className: "bear-flex bear-items-center bear-justify-between bear-px-4 bear-py-3 bear-border-b bear-border-neutral-200 dark:bear-border-neutral-700 bear-shrink-0", children: [
91
+ (n || m) && /* @__PURE__ */ d("div", { className: "bear-flex bear-items-center bear-justify-between bear-px-4 bear-py-3 bear-border-b bear-border-neutral-200 dark:bear-border-neutral-700 bear-shrink-0", dir: h, children: [
91
92
  n && /* @__PURE__ */ t(
92
93
  "h2",
93
94
  {
@@ -96,23 +97,23 @@ const G = ({
96
97
  children: n
97
98
  }
98
99
  ),
99
- u && /* @__PURE__ */ t(
100
+ m && /* @__PURE__ */ t(
100
101
  "button",
101
102
  {
102
103
  onClick: o,
103
104
  className: "bear-p-1 bear-rounded-lg bear-text-neutral-500 dark:bear-text-neutral-400 hover:bear-text-neutral-900 dark:hover:bear-text-white hover:bear-bg-neutral-100 dark:hover:bear-bg-neutral-700 bear-transition-colors",
104
105
  "aria-label": "Close drawer",
105
- children: /* @__PURE__ */ t(D, { className: "bear-w-5 bear-h-5" })
106
+ children: /* @__PURE__ */ t(C, { className: "bear-w-5 bear-h-5" })
106
107
  }
107
108
  )
108
109
  ] }),
109
- /* @__PURE__ */ t("div", { className: "bear-flex-1 bear-min-h-0 bear-overflow-y-auto bear-overscroll-contain bear-p-4 bear-text-neutral-700 dark:bear-text-neutral-300", children: p })
110
+ /* @__PURE__ */ t("div", { className: "bear-flex-1 bear-min-h-0 bear-overflow-y-auto bear-overscroll-contain bear-p-4 bear-text-neutral-700 dark:bear-text-neutral-300", children: w })
110
111
  ]
111
112
  }
112
113
  )
113
114
  ] });
114
- return R(_, g ?? document.body);
115
+ return R(D, _ ?? document.body);
115
116
  };
116
117
  export {
117
- G as Drawer
118
+ U as Drawer
118
119
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),o=require("react"),b=require("../../utils/cn.cjs"),Ie=require("../../utils/generateBearId.utils.cjs"),ve=require("../../utils/useBearId.cjs"),me=require("../../context/BearProvider.cjs"),we=require("./components/ClearIcon/ClearIcon.cjs"),Be=require("./Input.utils.cjs"),Ne=require("../Form/Form.utils.cjs"),d=require("./Input.const.cjs"),K=o.forwardRef(({label:C,helperText:Q,error:v,success:k,size:T="md",variant:je,radius:Ce,InputProps:c,leftAddon:V,rightAddon:Y,prefix:ke,suffix:Te,fullWidth:Z=!1,clearable:P=!1,onClear:ee,showCharCount:E=!1,charCountMax:re,autoFormat:m,validation:t,validateOnBlur:ae,validateOnChange:S=!1,loading:Ee,copyable:Se,onCopy:Le,floatingLabel:qe,multiline:i=!1,rows:te,minRows:se=d.INPUT_MULTILINE_MIN_ROWS,maxRows:Ae,readOnly:L,inputRef:s,inputProps:q,id:ne,testId:oe,className:le,disabled:u,value:f,defaultValue:x,maxLength:w,onChange:_,onBlur:h,...A},n)=>{var J;const ce=ve.useBearId("Input"),B=Ie.resolveBearId(ne,ce),N=o.useContext(me.BearContext),r=(J=N==null?void 0:N.components)==null?void 0:J.Input,ie=r==null?void 0:r.root,be=r==null?void 0:r.input,de=r==null?void 0:r.label,ue=r==null?void 0:r.helper,fe=r==null?void 0:r.prefix,xe=r==null?void 0:r.suffix,[_e,U]=o.useState(null),M=o.useRef(!1),he=d.INPUT_TEXT_CLASSES,ge=d.INPUT_WRAPPER_HEIGHT_CLASSES,O=t?ae??!0:!1,R=v||_e,l=!!R,g=!!k&&!l,p=re??w,j=typeof f=="string"?f.length:typeof x=="string"?x.length:0,H=p!=null&&j>p,pe=P&&!u&&j>0,W=(c==null?void 0:c.startAdornment)??V,F=(c==null?void 0:c.endAdornment)??Y,$=R||k||Q,y=o.useCallback(async e=>{if(!t)return;M.current=!0;const I=await Ne.validateFieldValue(e,t);M.current=!1,U(I)},[t]);o.useEffect(()=>{v&&U(null)},[v]);const D=o.useCallback(e=>{if(m&&!i){const I=Be.applyAutoFormat(e.target.value,m);I!==e.target.value&&(e.target.value=I)}_==null||_(e),S&&t&&y(e.target.value)},[m,i,_,S,t,y]),G=o.useCallback(e=>{h==null||h(e),O&&t&&y(e.target.value)},[h,O,t,y]),X=b.cn("Bear-Input__field","bear-flex-1 bear-min-w-0 bear-border-0 bear-outline-none bear-bg-transparent","placeholder:opacity-100 placeholder:[color:var(--bear-text-muted)]",he[T],i&&"bear-resize-y bear-py-2 bear-min-h-0 bear-h-auto",le),z={color:"var(--bear-text-primary)",...be},ye=te??se??d.INPUT_MULTILINE_DEFAULT_ROWS;return a.jsxs("div",{id:B,"data-testid":oe,className:b.cn(d.INPUT_ROOT_CLASS,"bear-flex bear-flex-col bear-gap-1.5",Z&&"bear-w-full"),style:ie,children:[C&&a.jsx("label",{className:"Bear-Input__label bear-text-sm bear-font-medium",style:{color:"var(--bear-text-secondary)",...de},children:C}),a.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":g?"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",u&&"bear-opacity-50 bear-cursor-not-allowed",!i&&ge[T]),style:{backgroundColor:"var(--bear-bg-primary)",borderColor:l||g?void 0:"var(--bear-border-default)"},children:[W&&a.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)",...fe},children:W}),i?a.jsx("textarea",{ref:e=>{typeof n=="function"?n(e):n&&(n.current=e),typeof s=="function"?s(e):s&&(s.current=e)},id:`${B}-field`,disabled:u,readOnly:L,value:f,defaultValue:x,maxLength:w,rows:ye,"aria-invalid":l||void 0,className:X,style:z,...q,...A,onChange:e=>D(e),onBlur:e=>G(e)}):a.jsx("input",{ref:e=>{typeof n=="function"?n(e):n&&(n.current=e),typeof s=="function"?s(e):s&&(s.current=e)},id:`${B}-field`,disabled:u,readOnly:L,value:f,defaultValue:x,maxLength:w,"aria-invalid":l||void 0,onChange:D,onBlur:G,className:X,style:z,...q,...A}),pe&&a.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:a.jsx(we.ClearIcon,{onClick:ee})}),F&&a.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)",...xe},children:F})]}),a.jsxs("div",{className:"Bear-Input__footer bear-flex bear-items-center bear-justify-between bear-gap-2",children:[$?a.jsx("p",{className:b.cn("Bear-Input__helper bear-text-sm bear-flex-1",l&&"Bear-Input__helper--error bear-text-red-500",g&&"Bear-Input__helper--success bear-text-green-500"),style:{...l||g?{}:{color:"var(--bear-text-muted)"},...ue},children:$}):E?a.jsx("span",{}):null,E&&p!=null&&a.jsxs("span",{className:b.cn("Bear-Input__char-count bear-text-xs bear-tabular-nums bear-shrink-0",H&&"bear-text-red-500"),style:H?void 0:{color:"var(--bear-text-muted)"},children:[j,"/",p]})]})]})});K.displayName="Input";exports.Input=K;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),o=require("react"),b=require("../../utils/cn.cjs"),me=require("../../utils/generateBearId.utils.cjs"),we=require("../../utils/useBearId.cjs"),K=require("../../context/BearProvider.cjs"),Be=require("./components/ClearIcon/ClearIcon.cjs"),Ne=require("./Input.utils.cjs"),je=require("../Form/Form.utils.cjs"),d=require("./Input.const.cjs"),Q=o.forwardRef(({label:C,helperText:V,error:v,success:k,size:T="md",variant:Ce,radius:ke,InputProps:l,leftAddon:Y,rightAddon:Z,prefix:Te,suffix:Ee,fullWidth:P=!1,clearable:ee=!1,onClear:re,showCharCount:E=!1,charCountMax:ae,autoFormat:m,validation:t,validateOnBlur:te,validateOnChange:S=!1,loading:Se,copyable:qe,onCopy:Le,floatingLabel:Ae,multiline:c=!1,rows:se,minRows:ne=d.INPUT_MULTILINE_MIN_ROWS,maxRows:Ue,readOnly:q,inputRef:s,inputProps:L,id:oe,testId:ie,className:le,disabled:u,value:f,defaultValue:x,maxLength:w,onChange:_,onBlur:h,...A},n)=>{var J;const ce=we.useBearId("Input"),B=me.resolveBearId(oe,ce),N=o.useContext(K.BearContext),r=(J=N==null?void 0:N.components)==null?void 0:J.Input,be=r==null?void 0:r.root,de=r==null?void 0:r.input,ue=r==null?void 0:r.label,fe=r==null?void 0:r.helper,xe=r==null?void 0:r.prefix,_e=r==null?void 0:r.suffix,[he,U]=o.useState(null),M=o.useRef(!1),pe=d.INPUT_TEXT_CLASSES,ge=d.INPUT_WRAPPER_HEIGHT_CLASSES,O=t?te??!0:!1,R=v||he,i=!!R,p=!!k&&!i,g=ae??w,j=typeof f=="string"?f.length:typeof x=="string"?x.length:0,H=g!=null&&j>g,Ie=ee&&!u&&j>0,{direction:ye}=K.useBearDirectionOptional(),W=(l==null?void 0:l.startAdornment)??Y,D=(l==null?void 0:l.endAdornment)??Z,F=R||k||V,I=o.useCallback(async e=>{if(!t)return;M.current=!0;const y=await je.validateFieldValue(e,t);M.current=!1,U(y)},[t]);o.useEffect(()=>{v&&U(null)},[v]);const $=o.useCallback(e=>{if(m&&!c){const y=Ne.applyAutoFormat(e.target.value,m);y!==e.target.value&&(e.target.value=y)}_==null||_(e),S&&t&&I(e.target.value)},[m,c,_,S,t,I]),G=o.useCallback(e=>{h==null||h(e),O&&t&&I(e.target.value)},[h,O,t,I]),X=b.cn("Bear-Input__field","bear-flex-1 bear-min-w-0 bear-border-0 bear-outline-none bear-bg-transparent","placeholder:opacity-100 placeholder:[color:var(--bear-text-muted)]",pe[T],c&&"bear-resize-y bear-py-2 bear-min-h-0 bear-h-auto",le),z={color:"var(--bear-text-primary)",...de},ve=se??ne??d.INPUT_MULTILINE_DEFAULT_ROWS;return a.jsxs("div",{id:B,"data-testid":ie,className:b.cn(d.INPUT_ROOT_CLASS,"bear-flex bear-flex-col bear-gap-1.5",P&&"bear-w-full"),style:be,children:[C&&a.jsx("label",{className:"Bear-Input__label bear-text-sm bear-font-medium",style:{color:"var(--bear-text-secondary)",...ue},children:C}),a.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)]",i?"Bear-Input__wrapper--error bear-border-red-500 focus-within:bear-ring-red-500":p?"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",u&&"bear-opacity-50 bear-cursor-not-allowed",!c&&ge[T]),dir:ye,style:{backgroundColor:"var(--bear-bg-primary)",borderColor:i||p?void 0:"var(--bear-border-default)"},children:[W&&a.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)",borderInlineEnd:"1px solid var(--bear-border-default)",color:"var(--bear-text-secondary)",...xe},children:W}),c?a.jsx("textarea",{ref:e=>{typeof n=="function"?n(e):n&&(n.current=e),typeof s=="function"?s(e):s&&(s.current=e)},id:`${B}-field`,disabled:u,readOnly:q,value:f,defaultValue:x,maxLength:w,rows:ve,"aria-invalid":i||void 0,className:X,style:z,...L,...A,onChange:e=>$(e),onBlur:e=>G(e)}):a.jsx("input",{ref:e=>{typeof n=="function"?n(e):n&&(n.current=e),typeof s=="function"?s(e):s&&(s.current=e)},id:`${B}-field`,disabled:u,readOnly:q,value:f,defaultValue:x,maxLength:w,"aria-invalid":i||void 0,onChange:$,onBlur:G,className:X,style:z,...L,...A}),Ie&&a.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:a.jsx(Be.ClearIcon,{onClick:re})}),D&&a.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)",borderInlineStart:"1px solid var(--bear-border-default)",color:"var(--bear-text-secondary)",..._e},children:D})]}),a.jsxs("div",{className:"Bear-Input__footer bear-flex bear-items-center bear-justify-between bear-gap-2",children:[F?a.jsx("p",{className:b.cn("Bear-Input__helper bear-text-sm bear-flex-1",i&&"Bear-Input__helper--error bear-text-red-500",p&&"Bear-Input__helper--success bear-text-green-500"),style:{...i||p?{}:{color:"var(--bear-text-muted)"},...fe},children:F}):E?a.jsx("span",{}):null,E&&g!=null&&a.jsxs("span",{className:b.cn("Bear-Input__char-count bear-text-xs bear-tabular-nums bear-shrink-0",H&&"bear-text-red-500"),style:H?void 0:{color:"var(--bear-text-muted)"},children:[j,"/",g]})]})]})});Q.displayName="Input";exports.Input=Q;
@@ -1,44 +1,44 @@
1
1
  import { jsxs as g, jsx as a } from "react/jsx-runtime";
2
- import { forwardRef as ge, useContext as ye, useState as ve, useRef as Ie, useCallback as C, useEffect as we } from "react";
2
+ import { forwardRef as ye, useContext as ve, useState as Ie, useRef as we, useCallback as C, useEffect as Be } from "react";
3
3
  import { cn as b } from "../../utils/cn.js";
4
4
  import { resolveBearId as Ne } from "../../utils/generateBearId.utils.js";
5
- import { useBearId as Be } from "../../utils/useBearId.js";
6
- import { BearContext as Ce } from "../../context/BearProvider.js";
7
- import { ClearIcon as Te } from "./components/ClearIcon/ClearIcon.js";
8
- import { applyAutoFormat as ke } from "./Input.utils.js";
9
- import { validateFieldValue as Ee } from "../Form/Form.utils.js";
10
- import { INPUT_TEXT_CLASSES as Le, INPUT_MULTILINE_MIN_ROWS as Se, INPUT_MULTILINE_DEFAULT_ROWS as Ae, INPUT_WRAPPER_HEIGHT_CLASSES as Ue, INPUT_ROOT_CLASS as Me } from "./Input.const.js";
11
- const Oe = ge(
5
+ import { useBearId as Ce } from "../../utils/useBearId.js";
6
+ import { BearContext as Ee, useBearDirectionOptional as Te } from "../../context/BearProvider.js";
7
+ import { ClearIcon as ke } from "./components/ClearIcon/ClearIcon.js";
8
+ import { applyAutoFormat as Se } from "./Input.utils.js";
9
+ import { validateFieldValue as Le } from "../Form/Form.utils.js";
10
+ import { INPUT_TEXT_CLASSES as Ae, INPUT_MULTILINE_MIN_ROWS as Ue, INPUT_MULTILINE_DEFAULT_ROWS as Me, INPUT_WRAPPER_HEIGHT_CLASSES as Oe, INPUT_ROOT_CLASS as je } from "./Input.const.js";
11
+ const He = ye(
12
12
  ({
13
- label: T,
13
+ label: E,
14
14
  helperText: K,
15
15
  error: y,
16
- success: k,
17
- size: E = "md",
18
- variant: je,
19
- radius: He,
20
- InputProps: l,
16
+ success: T,
17
+ size: k = "md",
18
+ variant: We,
19
+ radius: De,
20
+ InputProps: i,
21
21
  leftAddon: Q,
22
22
  rightAddon: V,
23
23
  prefix: Re,
24
- suffix: We,
24
+ suffix: $e,
25
25
  fullWidth: Y = !1,
26
26
  clearable: Z = !1,
27
27
  onClear: P,
28
- showCharCount: L = !1,
28
+ showCharCount: S = !1,
29
29
  charCountMax: ee,
30
30
  autoFormat: v,
31
31
  validation: t,
32
32
  validateOnBlur: re,
33
- validateOnChange: S = !1,
34
- loading: $e,
35
- copyable: De,
36
- onCopy: Fe,
37
- floatingLabel: Ge,
38
- multiline: i = !1,
33
+ validateOnChange: L = !1,
34
+ loading: Fe,
35
+ copyable: Ge,
36
+ onCopy: Xe,
37
+ floatingLabel: qe,
38
+ multiline: l = !1,
39
39
  rows: ae,
40
- minRows: te = Se,
41
- maxRows: Xe,
40
+ minRows: te = Ue,
41
+ maxRows: ze,
42
42
  readOnly: A,
43
43
  inputRef: s,
44
44
  inputProps: U,
@@ -46,32 +46,32 @@ const Oe = ge(
46
46
  testId: oe,
47
47
  className: ne,
48
48
  disabled: c,
49
- value: f,
50
- defaultValue: d,
49
+ value: d,
50
+ defaultValue: f,
51
51
  maxLength: I,
52
52
  onChange: u,
53
53
  onBlur: _,
54
54
  ...M
55
55
  }, o) => {
56
56
  var J;
57
- const le = Be("Input"), w = Ne(se, le), N = ye(Ce), r = (J = N == null ? void 0 : N.components) == null ? void 0 : J.Input, ie = r == null ? void 0 : r.root, be = r == null ? void 0 : r.input, ce = r == null ? void 0 : r.label, fe = r == null ? void 0 : r.helper, de = r == null ? void 0 : r.prefix, ue = r == null ? void 0 : r.suffix, [_e, O] = ve(null), j = Ie(!1), pe = Le, xe = Ue, H = t ? re ?? !0 : !1, R = y || _e, n = !!R, p = !!k && !n, x = ee ?? I, B = typeof f == "string" ? f.length : typeof d == "string" ? d.length : 0, W = x != null && B > x, me = Z && !c && B > 0, $ = (l == null ? void 0 : l.startAdornment) ?? Q, D = (l == null ? void 0 : l.endAdornment) ?? V, F = R || k || K, m = C(async (e) => {
57
+ const ie = Ce("Input"), w = Ne(se, ie), B = ve(Ee), r = (J = B == null ? void 0 : B.components) == null ? void 0 : J.Input, le = r == null ? void 0 : r.root, be = r == null ? void 0 : r.input, ce = r == null ? void 0 : r.label, de = r == null ? void 0 : r.helper, fe = r == null ? void 0 : r.prefix, ue = r == null ? void 0 : r.suffix, [_e, O] = Ie(null), j = we(!1), pe = Ae, xe = Oe, H = t ? re ?? !0 : !1, W = y || _e, n = !!W, p = !!T && !n, x = ee ?? I, N = typeof d == "string" ? d.length : typeof f == "string" ? f.length : 0, D = x != null && N > x, me = Z && !c && N > 0, { direction: he } = Te(), R = (i == null ? void 0 : i.startAdornment) ?? Q, $ = (i == null ? void 0 : i.endAdornment) ?? V, F = W || T || K, m = C(async (e) => {
58
58
  if (!t) return;
59
59
  j.current = !0;
60
- const h = await Ee(e, t);
60
+ const h = await Le(e, t);
61
61
  j.current = !1, O(h);
62
62
  }, [t]);
63
- we(() => {
63
+ Be(() => {
64
64
  y && O(null);
65
65
  }, [y]);
66
66
  const G = C(
67
67
  (e) => {
68
- if (v && !i) {
69
- const h = ke(e.target.value, v);
68
+ if (v && !l) {
69
+ const h = Se(e.target.value, v);
70
70
  h !== e.target.value && (e.target.value = h);
71
71
  }
72
- u == null || u(e), S && t && m(e.target.value);
72
+ u == null || u(e), L && t && m(e.target.value);
73
73
  },
74
- [v, i, u, S, t, m]
74
+ [v, l, u, L, t, m]
75
75
  ), X = C(
76
76
  (e) => {
77
77
  _ == null || _(e), H && t && m(e.target.value);
@@ -81,22 +81,22 @@ const Oe = ge(
81
81
  "Bear-Input__field",
82
82
  "bear-flex-1 bear-min-w-0 bear-border-0 bear-outline-none bear-bg-transparent",
83
83
  "placeholder:opacity-100 placeholder:[color:var(--bear-text-muted)]",
84
- pe[E],
85
- i && "bear-resize-y bear-py-2 bear-min-h-0 bear-h-auto",
84
+ pe[k],
85
+ l && "bear-resize-y bear-py-2 bear-min-h-0 bear-h-auto",
86
86
  ne
87
87
  ), z = {
88
88
  color: "var(--bear-text-primary)",
89
89
  ...be
90
- }, he = ae ?? te ?? Ae;
90
+ }, ge = ae ?? te ?? Me;
91
91
  return /* @__PURE__ */ g(
92
92
  "div",
93
93
  {
94
94
  id: w,
95
95
  "data-testid": oe,
96
- className: b(Me, "bear-flex bear-flex-col bear-gap-1.5", Y && "bear-w-full"),
97
- style: ie,
96
+ className: b(je, "bear-flex bear-flex-col bear-gap-1.5", Y && "bear-w-full"),
97
+ style: le,
98
98
  children: [
99
- T && /* @__PURE__ */ a("label", { className: "Bear-Input__label bear-text-sm bear-font-medium", style: { color: "var(--bear-text-secondary)", ...ce }, children: T }),
99
+ E && /* @__PURE__ */ a("label", { className: "Bear-Input__label bear-text-sm bear-font-medium", style: { color: "var(--bear-text-secondary)", ...ce }, children: E }),
100
100
  /* @__PURE__ */ g(
101
101
  "div",
102
102
  {
@@ -106,27 +106,28 @@ const Oe = ge(
106
106
  "focus-within:bear-ring-offset-[var(--bear-bg-primary)]",
107
107
  n ? "Bear-Input__wrapper--error bear-border-red-500 focus-within:bear-ring-red-500" : p ? "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",
108
108
  c && "bear-opacity-50 bear-cursor-not-allowed",
109
- !i && xe[E]
109
+ !l && xe[k]
110
110
  ),
111
+ dir: he,
111
112
  style: {
112
113
  backgroundColor: "var(--bear-bg-primary)",
113
114
  borderColor: n || p ? void 0 : "var(--bear-border-default)"
114
115
  },
115
116
  children: [
116
- $ && /* @__PURE__ */ a(
117
+ R && /* @__PURE__ */ a(
117
118
  "div",
118
119
  {
119
120
  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",
120
121
  style: {
121
122
  backgroundColor: "var(--bear-bg-tertiary)",
122
- borderRight: "1px solid var(--bear-border-default)",
123
+ borderInlineEnd: "1px solid var(--bear-border-default)",
123
124
  color: "var(--bear-text-secondary)",
124
- ...de
125
+ ...fe
125
126
  },
126
- children: $
127
+ children: R
127
128
  }
128
129
  ),
129
- i ? /* @__PURE__ */ a(
130
+ l ? /* @__PURE__ */ a(
130
131
  "textarea",
131
132
  {
132
133
  ref: (e) => {
@@ -135,10 +136,10 @@ const Oe = ge(
135
136
  id: `${w}-field`,
136
137
  disabled: c,
137
138
  readOnly: A,
138
- value: f,
139
- defaultValue: d,
139
+ value: d,
140
+ defaultValue: f,
140
141
  maxLength: I,
141
- rows: he,
142
+ rows: ge,
142
143
  "aria-invalid": n || void 0,
143
144
  className: q,
144
145
  style: z,
@@ -156,8 +157,8 @@ const Oe = ge(
156
157
  id: `${w}-field`,
157
158
  disabled: c,
158
159
  readOnly: A,
159
- value: f,
160
- defaultValue: d,
160
+ value: d,
161
+ defaultValue: f,
161
162
  maxLength: I,
162
163
  "aria-invalid": n || void 0,
163
164
  onChange: G,
@@ -173,20 +174,20 @@ const Oe = ge(
173
174
  {
174
175
  className: "Bear-Input__clear bear-flex bear-items-center bear-self-stretch bear-shrink-0 bear-px-2 bear-cursor-pointer",
175
176
  style: { color: "var(--bear-text-muted)" },
176
- children: /* @__PURE__ */ a(Te, { onClick: P })
177
+ children: /* @__PURE__ */ a(ke, { onClick: P })
177
178
  }
178
179
  ),
179
- D && /* @__PURE__ */ a(
180
+ $ && /* @__PURE__ */ a(
180
181
  "div",
181
182
  {
182
183
  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",
183
184
  style: {
184
185
  backgroundColor: "var(--bear-bg-tertiary)",
185
- borderLeft: "1px solid var(--bear-border-default)",
186
+ borderInlineStart: "1px solid var(--bear-border-default)",
186
187
  color: "var(--bear-text-secondary)",
187
188
  ...ue
188
189
  },
189
- children: D
190
+ children: $
190
191
  }
191
192
  )
192
193
  ]
@@ -203,21 +204,21 @@ const Oe = ge(
203
204
  ),
204
205
  style: {
205
206
  ...n || p ? {} : { color: "var(--bear-text-muted)" },
206
- ...fe
207
+ ...de
207
208
  },
208
209
  children: F
209
210
  }
210
- ) : L ? /* @__PURE__ */ a("span", {}) : null,
211
- L && x != null && /* @__PURE__ */ g(
211
+ ) : S ? /* @__PURE__ */ a("span", {}) : null,
212
+ S && x != null && /* @__PURE__ */ g(
212
213
  "span",
213
214
  {
214
215
  className: b(
215
216
  "Bear-Input__char-count bear-text-xs bear-tabular-nums bear-shrink-0",
216
- W && "bear-text-red-500"
217
+ D && "bear-text-red-500"
217
218
  ),
218
- style: W ? void 0 : { color: "var(--bear-text-muted)" },
219
+ style: D ? void 0 : { color: "var(--bear-text-muted)" },
219
220
  children: [
220
- B,
221
+ N,
221
222
  "/",
222
223
  x
223
224
  ]
@@ -229,7 +230,7 @@ const Oe = ge(
229
230
  );
230
231
  }
231
232
  );
232
- Oe.displayName = "Input";
233
+ He.displayName = "Input";
233
234
  export {
234
- Oe as Input
235
+ He as Input
235
236
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),m=require("react"),i=require("../../utils/cn.cjs"),d=require("./List.const.cjs"),u=m.createContext({}),w=()=>m.useContext(u),v=m.forwardRef((r,e)=>{const{variant:b="default",size:a="md",hoverable:n=!1,dense:t=!1,disablePadding:x=!1,className:o,children:y,testId:l,...g}=r;return s.jsx(u.Provider,{value:{dense:t,hoverable:n},children:s.jsx("ul",{ref:e,role:"list",className:i.cn(d.LIST_BASE_CLASSES,!x&&d.LIST_PADDING_CLASSES,d.LIST_SIZE_CLASSES[a],d.LIST_VARIANT_CLASSES[b],o),"data-testid":l,...g,children:y})})});v.displayName="List";const L=m.forwardRef(({primary:r,secondary:e,leading:b,trailing:a,selected:n=!1,disabled:t=!1,clickable:x=!1,divider:o=!1,dense:y,onClick:l,className:g,children:h,testId:S,...I},N)=>{const{dense:j,hoverable:k}=w(),p=y??j,c=x||!!l;return s.jsxs("li",{ref:N,role:c?"button":"listitem",tabIndex:c&&!t?0:void 0,"aria-selected":n,"aria-disabled":t,onClick:t?void 0:l,onKeyDown:f=>{!t&&(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),l==null||l())},className:i.cn("bear-flex bear-items-center bear-gap-3",p?"bear-py-1 bear-px-3":"bear-py-2 bear-px-4",c&&!t&&"bear-cursor-pointer",(k||c)&&!t&&"hover:bear-bg-gray-100 dark:hover:bear-bg-gray-800",n&&"bear-bg-primary-50 dark:bear-bg-primary-900/20",t&&"bear-opacity-50 bear-cursor-not-allowed",o&&"bear-border-b bear-border-gray-200 dark:bear-border-gray-700",g),"data-testid":S,...I,children:[b&&s.jsx("div",{className:"bear-flex-shrink-0 bear-text-gray-500 dark:bear-text-gray-400",children:b}),r||e?s.jsxs("div",{className:"bear-flex-1 bear-min-w-0",children:[r&&s.jsx("div",{className:"bear-text-gray-900 dark:bear-text-gray-100 bear-truncate",children:r}),e&&s.jsx("div",{className:i.cn("bear-text-gray-500 dark:bear-text-gray-400 bear-truncate",p?"bear-text-xs":"bear-text-sm"),children:e})]}):s.jsx("div",{className:"bear-flex-1 bear-min-w-0",children:h}),a&&s.jsx("div",{className:"bear-flex-shrink-0 bear-text-gray-500 dark:bear-text-gray-400",children:a})]})});L.displayName="ListItem";const _=({sticky:r=!1,inset:e=!1,className:b,children:a,testId:n,...t})=>s.jsx("li",{role:"presentation",className:i.cn("bear-py-2 bear-px-4 bear-text-xs bear-font-semibold bear-uppercase bear-tracking-wider","bear-text-gray-500 dark:bear-text-gray-400","bear-bg-gray-50 dark:bear-bg-gray-800/50",r&&"bear-sticky bear-top-0 bear-z-10",e&&"bear-pl-12",b),"data-testid":n,...t,children:a}),A=({primary:r,secondary:e,inset:b=!1,dense:a=!1,className:n,...t})=>s.jsxs("div",{className:i.cn("bear-flex-1 bear-min-w-0",b&&"bear-pl-9",n),...t,children:[r&&s.jsx("div",{className:"bear-text-gray-900 dark:bear-text-gray-100",children:r}),e&&s.jsx("div",{className:i.cn("bear-text-gray-500 dark:bear-text-gray-400",a?"bear-text-xs":"bear-text-sm"),children:e})]}),E=({align:r="center",className:e,children:b,...a})=>s.jsx("div",{className:i.cn("bear-flex-shrink-0 bear-min-w-[36px]","bear-text-gray-500 dark:bear-text-gray-400",r==="top"&&"bear-self-start bear-mt-1",e),...a,children:b}),T=({selected:r=!1,disabled:e=!1,dense:b=!1,onClick:a,className:n,children:t,...x})=>s.jsx("div",{role:"button",tabIndex:e?-1:0,"aria-selected":r,"aria-disabled":e,onClick:e?void 0:a,onKeyDown:o=>{!e&&(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),a==null||a())},className:i.cn("bear-flex bear-items-center bear-gap-3 bear-w-full bear-text-left",b?"bear-py-1 bear-px-3":"bear-py-2 bear-px-4","bear-cursor-pointer bear-transition-colors","hover:bear-bg-gray-100 dark:hover:bear-bg-gray-800",r&&"bear-bg-primary-50 dark:bear-bg-primary-900/20",e&&"bear-opacity-50 bear-cursor-not-allowed bear-pointer-events-none",n),...x,children:t});exports.List=v;exports.ListItem=L;exports.ListItemButton=T;exports.ListItemIcon=E;exports.ListItemText=A;exports.ListSubheader=_;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),g=require("react"),o=require("../../utils/cn.cjs"),m=require("./List.const.cjs"),L=g.createContext({}),A=()=>g.useContext(L),v=g.forwardRef((a,e)=>{const{variant:s="default",size:t="md",hoverable:i=!1,dense:n=!1,disablePadding:b=!1,className:c,children:y,testId:f,...l}=a;return r.jsx(L.Provider,{value:{dense:n,hoverable:i},children:r.jsx("ul",{ref:e,role:"list",className:o.cn(m.LIST_BASE_CLASSES,!b&&m.LIST_PADDING_CLASSES,m.LIST_SIZE_CLASSES[t],m.LIST_VARIANT_CLASSES[s],c),"data-testid":f,...l,children:y})})});v.displayName="List";const I=g.forwardRef(({primary:a,secondary:e,leading:s,trailing:t,secondaryAction:i,selected:n=!1,disabled:b=!1,clickable:c=!1,divider:y=!1,dense:f,onClick:l,className:h,children:S,testId:N,...j},_)=>{const{dense:k,hoverable:w}=A(),p=f??k,d=c||!!l,u=i??t;return r.jsxs("li",{ref:_,role:d?"button":"listitem",tabIndex:d&&!b?0:void 0,"aria-selected":n,"aria-disabled":b,onClick:b?void 0:l,onKeyDown:x=>{!b&&(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),l==null||l())},className:o.cn("Bear-ListItem","bear-flex bear-items-center bear-gap-3",p?"bear-py-1 bear-px-3":"bear-py-2 bear-px-4",d&&!b&&"bear-cursor-pointer",(w||d)&&!b&&"hover:bear-bg-gray-100 dark:hover:bear-bg-gray-800",n&&"bear-bg-primary-50 dark:bear-bg-primary-900/20",b&&"bear-opacity-50 bear-cursor-not-allowed",y&&"bear-border-b bear-border-gray-200 dark:bear-border-gray-700",h),"data-testid":N,...j,children:[s&&r.jsx("div",{className:"Bear-ListItem__leading bear-flex-shrink-0 bear-text-gray-500 dark:bear-text-gray-400",children:s}),a||e?r.jsxs("div",{className:"Bear-ListItem__content bear-flex-1 bear-min-w-0",children:[a&&r.jsx("div",{className:"bear-text-gray-900 dark:bear-text-gray-100 bear-truncate",children:a}),e&&r.jsx("div",{className:o.cn("bear-text-gray-500 dark:bear-text-gray-400 bear-truncate",p?"bear-text-xs":"bear-text-sm"),children:e})]}):r.jsx("div",{className:"Bear-ListItem__content bear-flex-1 bear-min-w-0",children:S}),u&&r.jsx("div",{className:"Bear-ListItem__secondary-action bear-flex-shrink-0 bear-text-gray-500 dark:bear-text-gray-400",onClick:x=>x.stopPropagation(),onKeyDown:x=>x.stopPropagation(),children:u})]})});I.displayName="ListItem";const B=({sticky:a=!1,inset:e=!1,className:s,children:t,testId:i,...n})=>r.jsx("li",{role:"presentation",className:o.cn("bear-py-2 bear-px-4 bear-text-xs bear-font-semibold bear-uppercase bear-tracking-wider","bear-text-gray-500 dark:bear-text-gray-400","bear-bg-gray-50 dark:bear-bg-gray-800/50",a&&"bear-sticky bear-top-0 bear-z-10",e&&"bear-pl-12",s),"data-testid":i,...n,children:t}),D=({primary:a,secondary:e,inset:s=!1,dense:t=!1,className:i,...n})=>r.jsxs("div",{className:o.cn("bear-flex-1 bear-min-w-0",s&&"bear-pl-9",i),...n,children:[a&&r.jsx("div",{className:"bear-text-gray-900 dark:bear-text-gray-100",children:a}),e&&r.jsx("div",{className:o.cn("bear-text-gray-500 dark:bear-text-gray-400",t?"bear-text-xs":"bear-text-sm"),children:e})]}),E=({align:a="center",className:e,children:s,...t})=>r.jsx("div",{className:o.cn("bear-flex-shrink-0 bear-min-w-[36px]","bear-text-gray-500 dark:bear-text-gray-400",a==="top"&&"bear-self-start bear-mt-1",e),...t,children:s}),T=({selected:a=!1,disabled:e=!1,dense:s=!1,onClick:t,className:i,children:n,...b})=>r.jsx("div",{role:"button",tabIndex:e?-1:0,"aria-selected":a,"aria-disabled":e,onClick:e?void 0:t,onKeyDown:c=>{!e&&(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),t==null||t())},className:o.cn("bear-flex bear-items-center bear-gap-3 bear-w-full bear-text-left",s?"bear-py-1 bear-px-3":"bear-py-2 bear-px-4","bear-cursor-pointer bear-transition-colors","hover:bear-bg-gray-100 dark:hover:bear-bg-gray-800",a&&"bear-bg-primary-50 dark:bear-bg-primary-900/20",e&&"bear-opacity-50 bear-cursor-not-allowed bear-pointer-events-none",i),...b,children:n});exports.List=v;exports.ListItem=I;exports.ListItemButton=T;exports.ListItemIcon=E;exports.ListItemText=D;exports.ListSubheader=B;