@forgedevstack/bear 1.1.8 → 1.2.0

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 (104) hide show
  1. package/README.md +4 -4
  2. package/dist/components/AlertDialog/AlertDialog.cjs +1 -1
  3. package/dist/components/AlertDialog/AlertDialog.const.cjs +1 -1
  4. package/dist/components/AlertDialog/AlertDialog.const.d.ts +2 -2
  5. package/dist/components/AlertDialog/AlertDialog.const.js +4 -4
  6. package/dist/components/AlertDialog/AlertDialog.js +76 -62
  7. package/dist/components/BearLogo/BearLogo.d.ts +2 -7
  8. package/dist/components/BearLogo/BearLogo.types.d.ts +15 -0
  9. package/dist/components/BearLogo/EmberLogo.d.ts +1 -8
  10. package/dist/components/BearLogo/index.d.ts +1 -2
  11. package/dist/components/Biometric/Biometric.cjs +1 -0
  12. package/dist/components/Biometric/Biometric.d.ts +3 -0
  13. package/dist/components/Biometric/Biometric.js +123 -0
  14. package/dist/components/Biometric/Biometric.types.d.ts +35 -0
  15. package/dist/components/Biometric/BiometricIcon.cjs +1 -0
  16. package/dist/components/Biometric/BiometricIcon.d.ts +3 -0
  17. package/dist/components/Biometric/BiometricIcon.js +45 -0
  18. package/dist/components/Biometric/index.d.ts +3 -0
  19. package/dist/components/Biometric/useBiometric.cjs +1 -0
  20. package/dist/components/Biometric/useBiometric.d.ts +2 -0
  21. package/dist/components/Biometric/useBiometric.js +21 -0
  22. package/dist/components/Calendar/Calendar.cjs +1 -1
  23. package/dist/components/Calendar/Calendar.js +3 -2
  24. package/dist/components/CloseButton/CloseButton.cjs +1 -0
  25. package/dist/components/CloseButton/CloseButton.d.ts +4 -0
  26. package/dist/components/CloseButton/CloseButton.js +60 -0
  27. package/dist/components/CloseButton/CloseButton.types.d.ts +15 -0
  28. package/dist/components/CloseButton/index.d.ts +2 -0
  29. package/dist/components/DatePicker/DatePicker.cjs +1 -1
  30. package/dist/components/DatePicker/DatePicker.js +12 -11
  31. package/dist/components/DateRangePicker/DateRangePicker.cjs +1 -1
  32. package/dist/components/DateRangePicker/DateRangePicker.const.cjs +1 -1
  33. package/dist/components/DateRangePicker/DateRangePicker.const.js +12 -13
  34. package/dist/components/DateRangePicker/DateRangePicker.js +107 -81
  35. package/dist/components/Dropdown/Dropdown.cjs +1 -1
  36. package/dist/components/Dropdown/Dropdown.js +48 -44
  37. package/dist/components/Icon/icons/commerce.cjs +1 -0
  38. package/dist/components/Icon/icons/commerce.d.ts +25 -0
  39. package/dist/components/Icon/icons/commerce.js +124 -0
  40. package/dist/components/Icon/icons/device.cjs +1 -0
  41. package/dist/components/Icon/icons/device.d.ts +27 -0
  42. package/dist/components/Icon/icons/device.js +122 -0
  43. package/dist/components/Icon/icons/file.cjs +1 -0
  44. package/dist/components/Icon/icons/file.d.ts +25 -0
  45. package/dist/components/Icon/icons/file.js +120 -0
  46. package/dist/components/Icon/icons/social.cjs +1 -0
  47. package/dist/components/Icon/icons/social.d.ts +24 -0
  48. package/dist/components/Icon/icons/social.js +89 -0
  49. package/dist/components/Icon/index.cjs +1 -1
  50. package/dist/components/Icon/index.d.ts +93 -56
  51. package/dist/components/Icon/index.js +38 -26
  52. package/dist/components/Input/Input.cjs +1 -1
  53. package/dist/components/Input/Input.js +153 -101
  54. package/dist/components/Input/Input.types.d.ts +8 -2
  55. package/dist/components/Input/index.d.ts +1 -1
  56. package/dist/components/Overlay/Overlay.cjs +1 -0
  57. package/dist/components/Overlay/Overlay.d.ts +4 -0
  58. package/dist/components/Overlay/Overlay.js +38 -0
  59. package/dist/components/Overlay/Overlay.types.d.ts +23 -0
  60. package/dist/components/Overlay/index.d.ts +2 -0
  61. package/dist/components/Popover/Popover.cjs +1 -1
  62. package/dist/components/Popover/Popover.js +76 -76
  63. package/dist/components/Portal/Portal.cjs +1 -0
  64. package/dist/components/Portal/Portal.d.ts +11 -0
  65. package/dist/components/Portal/Portal.js +12 -0
  66. package/dist/components/Portal/index.d.ts +2 -0
  67. package/dist/components/Select/Select.cjs +1 -1
  68. package/dist/components/Select/Select.js +41 -38
  69. package/dist/components/Tabs/TabList.cjs +1 -0
  70. package/dist/components/Tabs/TabList.d.ts +3 -0
  71. package/dist/components/Tabs/TabList.js +69 -0
  72. package/dist/components/Tabs/TabPanel.cjs +1 -0
  73. package/dist/components/Tabs/TabPanel.d.ts +3 -0
  74. package/dist/components/Tabs/TabPanel.js +13 -0
  75. package/dist/components/Tabs/Tabs.cjs +1 -1
  76. package/dist/components/Tabs/Tabs.d.ts +2 -27
  77. package/dist/components/Tabs/Tabs.js +42 -61
  78. package/dist/components/Tabs/Tabs.types.d.ts +4 -0
  79. package/dist/components/Tabs/index.d.ts +3 -1
  80. package/dist/components/ThemeIcon/ThemeIcon.cjs +1 -0
  81. package/dist/components/ThemeIcon/ThemeIcon.d.ts +4 -0
  82. package/dist/components/ThemeIcon/ThemeIcon.js +54 -0
  83. package/dist/components/ThemeIcon/ThemeIcon.types.d.ts +22 -0
  84. package/dist/components/ThemeIcon/index.d.ts +2 -0
  85. package/dist/components/VisuallyHidden/VisuallyHidden.cjs +1 -0
  86. package/dist/components/VisuallyHidden/VisuallyHidden.d.ts +6 -0
  87. package/dist/components/VisuallyHidden/VisuallyHidden.js +22 -0
  88. package/dist/components/VisuallyHidden/index.d.ts +2 -0
  89. package/dist/components/index.cjs +1 -1
  90. package/dist/components/index.d.ts +15 -2
  91. package/dist/components/index.js +329 -312
  92. package/dist/hooks/bearStyled.cjs +1 -1
  93. package/dist/hooks/bearStyled.d.ts +31 -9
  94. package/dist/hooks/bearStyled.js +17 -12
  95. package/dist/hooks/useMediaQuery/useMediaQuery.d.ts +9 -1
  96. package/dist/hooks/useResponsive.cjs +1 -1
  97. package/dist/hooks/useResponsive.d.ts +2 -17
  98. package/dist/hooks/useResponsive.js +47 -41
  99. package/dist/index.cjs +1 -1
  100. package/dist/index.js +408 -391
  101. package/dist/styles/_effects.css +9 -0
  102. package/dist/styles.css +1 -1
  103. package/dist/types/theme.types.d.ts +1 -0
  104. package/package.json +1 -1
@@ -1,48 +1,60 @@
1
1
  import "react/jsx-runtime";
2
2
  import "react";
3
3
  import * as o from "./icons/action.js";
4
- import { EditIcon as a } from "./icons/action.js";
4
+ import { EditIcon as C } from "./icons/action.js";
5
5
  import * as n from "./icons/navigation.js";
6
- import { CloseIcon as I, ChevronDownIcon as h, ChevronRightIcon as C, ChevronLeftIcon as f, ChevronsLeftIcon as v, ChevronsRightIcon as p } from "./icons/navigation.js";
6
+ import { CloseIcon as p, ChevronDownIcon as v, ChevronRightIcon as $, ChevronLeftIcon as d, ChevronsLeftIcon as g, ChevronsRightIcon as l } from "./icons/navigation.js";
7
7
  import * as t from "./icons/content.js";
8
- import * as c from "./icons/communication.js";
9
- import * as r from "./icons/status.js";
10
- import { CheckIcon as $ } from "./icons/status.js";
11
- import * as s from "./icons/media.js";
12
- import * as i from "./icons/editor.js";
8
+ import * as r from "./icons/communication.js";
9
+ import * as c from "./icons/status.js";
10
+ import { CheckIcon as L } from "./icons/status.js";
11
+ import * as i from "./icons/media.js";
12
+ import * as s from "./icons/editor.js";
13
13
  import * as e from "./icons/misc.js";
14
- import { XIcon as g } from "./icons/misc.js";
14
+ import { XIcon as R } from "./icons/misc.js";
15
15
  import * as m from "./icons/bear.js";
16
- const l = $, w = I, D = a, X = h, B = C, M = f, b = v, x = p, A = g, N = {
16
+ import * as a from "./icons/file.js";
17
+ import * as I from "./icons/social.js";
18
+ import * as f from "./icons/device.js";
19
+ import * as h from "./icons/commerce.js";
20
+ const B = L, M = p, S = C, b = v, x = $, A = d, F = g, N = l, j = R, q = {
17
21
  // Flat access to common icons (shortcuts)
18
22
  ...o,
19
23
  ...n,
20
24
  ...t,
21
- ...c,
22
25
  ...r,
23
- ...s,
26
+ ...c,
24
27
  ...i,
28
+ ...s,
25
29
  ...e,
26
30
  ...m,
31
+ ...a,
32
+ ...I,
33
+ ...f,
34
+ ...h,
27
35
  Action: o,
28
36
  Navigation: n,
29
37
  Content: t,
30
- Communication: c,
31
- Status: r,
32
- Media: s,
33
- Editor: i,
38
+ Communication: r,
39
+ Status: c,
40
+ Media: i,
41
+ Editor: s,
34
42
  Misc: e,
35
- Bear: m
43
+ Bear: m,
44
+ File: a,
45
+ Social: I,
46
+ Device: f,
47
+ Commerce: h
36
48
  };
37
49
  export {
38
- N as BearIcons,
39
- l as CheckIcon,
40
- X as ChevronDownIcon,
41
- M as ChevronLeftIcon,
42
- B as ChevronRightIcon,
43
- b as ChevronsLeftIcon,
44
- x as ChevronsRightIcon,
45
- w as CloseIcon,
46
- D as EditIcon,
47
- A as XIcon
50
+ q as BearIcons,
51
+ B as CheckIcon,
52
+ b as ChevronDownIcon,
53
+ A as ChevronLeftIcon,
54
+ x as ChevronRightIcon,
55
+ F as ChevronsLeftIcon,
56
+ N as ChevronsRightIcon,
57
+ M as CloseIcon,
58
+ S as EditIcon,
59
+ j as XIcon
48
60
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),s=require("react"),d=require("../../utils/cn.cjs"),ae=require("../../context/BearProvider.cjs"),L=require("./components/ClearIcon/ClearIcon.cjs"),te=require("./Input.utils.cjs"),se=require("../Form/Form.utils.cjs"),be={sm:"bear-h-8 bear-text-sm bear-px-3",md:"bear-h-10 bear-text-base bear-px-4",lg:"bear-h-12 bear-text-lg bear-px-5"},P=s.forwardRef(({label:B,helperText:T,error:f,success:j,size:V="md",leftAddon:x,rightAddon:b,fullWidth:D=!1,clearable:G=!1,onClear:m,showCharCount:N=!1,charCountMax:H,autoFormat:g,validation:t,validateOnBlur:J,validateOnChange:w=!1,className:K,disabled:p,value:_,defaultValue:y,maxLength:v,onChange:l,onBlur:n,...Q},U)=>{var F;const h=s.useContext(ae.BearContext),e=(F=h==null?void 0:h.components)==null?void 0:F.Input,W=e==null?void 0:e.root,X=e==null?void 0:e.input,Y=e==null?void 0:e.label,Z=e==null?void 0:e.helper,$=e==null?void 0:e.prefix,q=e==null?void 0:e.suffix,[S,C]=s.useState(null),E=s.useRef(!1),R=t?J??!0:!1,M=f||S,c=!!M,O=!!j&&!c,u=H??v,I=typeof _=="string"?_.length:typeof y=="string"?y.length:0,A=u!=null&&I>u,k=G&&!p&&I>0,z=M||j||T,i=s.useCallback(async a=>{if(!t)return;E.current=!0;const o=await se.validateFieldValue(a,t);E.current=!1,C(o)},[t]);s.useEffect(()=>{f&&C(null)},[f]);const ee=s.useCallback(a=>{if(g){const o=te.applyAutoFormat(a.target.value,g);o!==a.target.value&&(a.target.value=o)}l==null||l(a),w&&t&&i(a.target.value)},[g,l,w,t,i]),re=s.useCallback(a=>{n==null||n(a),R&&t&&i(a.target.value)},[n,R,t,i]);return r.jsxs("div",{className:d.cn("Bear-Input bear-flex bear-flex-col bear-gap-1.5",D&&"bear-w-full"),style:W,children:[B&&r.jsx("label",{className:"Bear-Input__label bear-text-sm bear-font-medium bear-text-gray-700 dark:bear-text-gray-300",style:Y,children:B}),r.jsxs("div",{className:"Bear-Input__wrapper bear-relative bear-flex bear-items-center",children:[x&&r.jsx("div",{className:"Bear-Input__addon Bear-Input__addon--left bear-absolute bear-left-3 bear-text-gray-500 dark:bear-text-gray-400",style:$,children:x}),r.jsx("input",{ref:U,disabled:p,value:_,defaultValue:y,maxLength:v,"aria-invalid":c||void 0,onChange:ee,onBlur:re,className:d.cn("Bear-Input__field","bear-w-full bear-rounded-lg bear-border bear-outline-none bear-transition-all bear-duration-200","bear-bg-white bear-text-gray-900 placeholder:bear-text-gray-400","bear-border-gray-300 focus:bear-ring-2 focus:bear-ring-offset-2 focus:bear-ring-offset-white","dark:bear-bg-gray-800 dark:bear-text-white dark:placeholder:bear-text-gray-500 dark:bear-border-gray-600 dark:focus:bear-ring-offset-gray-900",c?"Bear-Input__field--error bear-border-red-500 focus:bear-ring-red-500":O?"Bear-Input__field--success bear-border-green-500 focus:bear-ring-green-500":"focus:bear-border-bear-500 focus:bear-ring-bear-500 dark:focus:bear-border-bear-500 dark:focus:bear-ring-bear-500",p&&"Bear-Input__field--disabled bear-opacity-50 bear-cursor-not-allowed",x&&"bear-pl-10",(b||k)&&"bear-pr-10",be[V],K),style:X,...Q}),k&&!b&&r.jsx("div",{className:"Bear-Input__addon Bear-Input__addon--right bear-absolute bear-right-3 bear-text-gray-500 dark:bear-text-gray-400",style:q,children:r.jsx(L.ClearIcon,{onClick:m})}),b&&r.jsxs("div",{className:"Bear-Input__addon Bear-Input__addon--right bear-absolute bear-right-3 bear-flex bear-items-center bear-gap-1.5 bear-text-gray-500 dark:bear-text-gray-400",style:q,children:[k&&r.jsx(L.ClearIcon,{onClick:m}),b]})]}),r.jsxs("div",{className:"Bear-Input__footer bear-flex bear-items-center bear-justify-between bear-gap-2",children:[z?r.jsx("p",{className:d.cn("Bear-Input__helper bear-text-sm bear-flex-1",c?"Bear-Input__helper--error bear-text-red-500":O?"Bear-Input__helper--success bear-text-green-500":"bear-text-gray-500 dark:bear-text-gray-400"),style:Z,children:z}):N?r.jsx("span",{}):null,N&&u!=null&&r.jsxs("span",{className:d.cn("Bear-Input__char-count bear-text-xs bear-tabular-nums bear-shrink-0",A?"bear-text-red-500":"bear-text-gray-400 dark:bear-text-gray-500"),children:[I,"/",u]})]})]})});P.displayName="Input";exports.Input=P;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),s=require("react"),b=require("../../utils/cn.cjs"),se=require("../../context/BearProvider.cjs"),ne=require("./components/ClearIcon/ClearIcon.cjs"),le=require("./Input.utils.cjs"),be=require("../Form/Form.utils.cjs"),ce={sm:"bear-h-8",md:"bear-h-10",lg:"bear-h-12"},oe={sm:"bear-text-sm bear-px-3",md:"bear-text-base bear-px-4",lg:"bear-text-lg bear-px-5"},T=s.forwardRef(({label:y,helperText:F,error:x,success:w,size:B="md",InputProps:n,leftAddon:H,rightAddon:S,fullWidth:V=!1,clearable:D=!1,onClear:G,showCharCount:j=!1,charCountMax:J,autoFormat:h,validation:t,validateOnBlur:K,validateOnChange:I=!1,className:Q,disabled:p,value:g,defaultValue:m,maxLength:k,onChange:c,onBlur:o,...U},W)=>{var O;const _=s.useContext(se.BearContext),e=(O=_==null?void 0:_.components)==null?void 0:O.Input,X=e==null?void 0:e.root,Y=e==null?void 0:e.input,Z=e==null?void 0:e.label,$=e==null?void 0:e.helper,z=e==null?void 0:e.prefix,P=e==null?void 0:e.suffix,[ee,N]=s.useState(null),C=s.useRef(!1),q=t?K??!0:!1,R=x||ee,l=!!R,i=!!w&&!l,u=J??k,v=typeof g=="string"?g.length:typeof m=="string"?m.length:0,E=u!=null&&v>u,re=D&&!p&&v>0,A=(n==null?void 0:n.startAdornment)??H,M=(n==null?void 0:n.endAdornment)??S,L=R||w||F,d=s.useCallback(async a=>{if(!t)return;C.current=!0;const f=await be.validateFieldValue(a,t);C.current=!1,N(f)},[t]);s.useEffect(()=>{x&&N(null)},[x]);const ae=s.useCallback(a=>{if(h){const f=le.applyAutoFormat(a.target.value,h);f!==a.target.value&&(a.target.value=f)}c==null||c(a),I&&t&&d(a.target.value)},[h,c,I,t,d]),te=s.useCallback(a=>{o==null||o(a),q&&t&&d(a.target.value)},[o,q,t,d]);return r.jsxs("div",{className:b.cn("Bear-Input bear-flex bear-flex-col bear-gap-1.5",V&&"bear-w-full"),style:X,children:[y&&r.jsx("label",{className:"Bear-Input__label bear-text-sm bear-font-medium",style:{color:"var(--bear-text-secondary)",...Z},children:y}),r.jsxs("div",{className:b.cn("Bear-Input__wrapper bear-flex bear-items-center bear-rounded-lg bear-border bear-overflow-hidden bear-transition-all bear-duration-200","focus-within:bear-ring-2 focus-within:bear-ring-offset-2","focus-within:bear-ring-offset-[var(--bear-bg-primary)]",l?"Bear-Input__wrapper--error bear-border-red-500 focus-within:bear-ring-red-500":i?"Bear-Input__wrapper--success bear-border-green-500 focus-within:bear-ring-green-500":"focus-within:bear-border-bear-500 focus-within:bear-ring-bear-500 dark:focus-within:bear-border-bear-500 dark:focus-within:bear-ring-bear-500",p&&"bear-opacity-50 bear-cursor-not-allowed",ce[B]),style:{backgroundColor:"var(--bear-bg-primary)",borderColor:l||i?void 0:"var(--bear-border-default)"},children:[A&&r.jsx("div",{className:"Bear-Input__addon Bear-Input__addon--left bear-flex bear-items-center bear-self-stretch bear-shrink-0 bear-px-3 bear-text-sm bear-font-medium bear-select-none bear-pointer-events-none",style:{backgroundColor:"var(--bear-bg-tertiary)",borderRight:"1px solid var(--bear-border-default)",color:"var(--bear-text-secondary)",...z},children:A}),r.jsx("input",{ref:W,disabled:p,value:g,defaultValue:m,maxLength:k,"aria-invalid":l||void 0,onChange:ae,onBlur:te,className:b.cn("Bear-Input__field","bear-flex-1 bear-min-w-0 bear-h-full bear-border-0 bear-outline-none bear-bg-transparent","placeholder:opacity-100 placeholder:[color:var(--bear-text-muted)]",oe[B],Q),style:{color:"var(--bear-text-primary)",...Y},...U}),re&&r.jsx("div",{className:"Bear-Input__clear bear-flex bear-items-center bear-self-stretch bear-shrink-0 bear-px-2 bear-cursor-pointer",style:{color:"var(--bear-text-muted)"},children:r.jsx(ne.ClearIcon,{onClick:G})}),M&&r.jsx("div",{className:"Bear-Input__addon Bear-Input__addon--right bear-flex bear-items-center bear-self-stretch bear-shrink-0 bear-px-3 bear-gap-1.5",style:{backgroundColor:"var(--bear-bg-tertiary)",borderLeft:"1px solid var(--bear-border-default)",color:"var(--bear-text-secondary)",...P},children:M})]}),r.jsxs("div",{className:"Bear-Input__footer bear-flex bear-items-center bear-justify-between bear-gap-2",children:[L?r.jsx("p",{className:b.cn("Bear-Input__helper bear-text-sm bear-flex-1",l&&"Bear-Input__helper--error bear-text-red-500",i&&"Bear-Input__helper--success bear-text-green-500"),style:{...l||i?{}:{color:"var(--bear-text-muted)"},...$},children:L}):j?r.jsx("span",{}):null,j&&u!=null&&r.jsxs("span",{className:b.cn("Bear-Input__char-count bear-text-xs bear-tabular-nums bear-shrink-0",E&&"bear-text-red-500"),style:E?void 0:{color:"var(--bear-text-muted)"},children:[v,"/",u]})]})]})});T.displayName="Input";exports.Input=T;
@@ -1,127 +1,179 @@
1
- import { jsxs as s, jsx as t } from "react/jsx-runtime";
2
- import { forwardRef as ae, useContext as te, useState as se, useRef as be, useCallback as B, useEffect as le } from "react";
3
- import { cn as f } from "../../utils/cn.js";
4
- import { BearContext as ne } from "../../context/BearProvider.js";
5
- import { ClearIcon as D } from "./components/ClearIcon/ClearIcon.js";
6
- import { applyAutoFormat as ce } from "./Input.utils.js";
7
- import { validateFieldValue as ie } from "../Form/Form.utils.js";
1
+ import { jsxs as u, jsx as t } from "react/jsx-runtime";
2
+ import { forwardRef as se, useContext as be, useState as le, useRef as ne, useCallback as w, useEffect as oe } from "react";
3
+ import { cn as l } from "../../utils/cn.js";
4
+ import { BearContext as ie } from "../../context/BearProvider.js";
5
+ import { ClearIcon as ce } from "./components/ClearIcon/ClearIcon.js";
6
+ import { applyAutoFormat as de } from "./Input.utils.js";
7
+ import { validateFieldValue as fe } from "../Form/Form.utils.js";
8
8
  const ue = {
9
- sm: "bear-h-8 bear-text-sm bear-px-3",
10
- md: "bear-h-10 bear-text-base bear-px-4",
11
- lg: "bear-h-12 bear-text-lg bear-px-5"
12
- }, oe = ae(
9
+ sm: "bear-h-8",
10
+ md: "bear-h-10",
11
+ lg: "bear-h-12"
12
+ }, pe = {
13
+ sm: "bear-text-sm bear-px-3",
14
+ md: "bear-text-base bear-px-4",
15
+ lg: "bear-text-lg bear-px-5"
16
+ }, xe = se(
13
17
  ({
14
- label: k,
15
- helperText: F,
16
- error: d,
17
- success: N,
18
- size: G = "md",
19
- leftAddon: p,
20
- rightAddon: b,
21
- fullWidth: H = !1,
22
- clearable: J = !1,
23
- onClear: w,
24
- showCharCount: v = !1,
18
+ label: y,
19
+ helperText: V,
20
+ error: p,
21
+ success: B,
22
+ size: k = "md",
23
+ InputProps: s,
24
+ leftAddon: q,
25
+ rightAddon: D,
26
+ fullWidth: F = !1,
27
+ clearable: G = !1,
28
+ onClear: J,
29
+ showCharCount: I = !1,
25
30
  charCountMax: K,
26
- autoFormat: g,
31
+ autoFormat: x,
27
32
  validation: a,
28
33
  validateOnBlur: Q,
29
- validateOnChange: E = !1,
30
- className: T,
31
- disabled: x,
32
- value: _,
33
- defaultValue: y,
34
- maxLength: j,
35
- onChange: l,
36
- onBlur: n,
37
- ...U
38
- }, W) => {
39
- var q;
40
- const h = te(ne), e = (q = h == null ? void 0 : h.components) == null ? void 0 : q.Input, X = e == null ? void 0 : e.root, Y = e == null ? void 0 : e.input, Z = e == null ? void 0 : e.label, $ = e == null ? void 0 : e.helper, P = e == null ? void 0 : e.prefix, M = e == null ? void 0 : e.suffix, [S, R] = se(null), z = be(!1), C = a ? Q ?? !0 : !1, L = d || S, c = !!L, O = !!N && !c, i = K ?? j, m = typeof _ == "string" ? _.length : typeof y == "string" ? y.length : 0, A = i != null && m > i, I = J && !x && m > 0, V = L || N || F, u = B(async (r) => {
34
+ validateOnChange: N = !1,
35
+ className: U,
36
+ disabled: m,
37
+ value: h,
38
+ defaultValue: g,
39
+ maxLength: C,
40
+ onChange: n,
41
+ onBlur: o,
42
+ ...W
43
+ }, X) => {
44
+ var T;
45
+ const _ = be(ie), e = (T = _ == null ? void 0 : _.components) == null ? void 0 : T.Input, Y = e == null ? void 0 : e.root, Z = e == null ? void 0 : e.input, $ = e == null ? void 0 : e.label, z = e == null ? void 0 : e.helper, S = e == null ? void 0 : e.prefix, P = e == null ? void 0 : e.suffix, [ee, E] = le(null), j = ne(!1), A = a ? Q ?? !0 : !1, R = p || ee, b = !!R, i = !!B && !b, c = K ?? C, v = typeof h == "string" ? h.length : typeof g == "string" ? g.length : 0, L = c != null && v > c, re = G && !m && v > 0, M = (s == null ? void 0 : s.startAdornment) ?? q, H = (s == null ? void 0 : s.endAdornment) ?? D, O = R || B || V, d = w(async (r) => {
41
46
  if (!a) return;
42
- z.current = !0;
43
- const o = await ie(r, a);
44
- z.current = !1, R(o);
47
+ j.current = !0;
48
+ const f = await fe(r, a);
49
+ j.current = !1, E(f);
45
50
  }, [a]);
46
- le(() => {
47
- d && R(null);
48
- }, [d]);
49
- const ee = B(
51
+ oe(() => {
52
+ p && E(null);
53
+ }, [p]);
54
+ const ae = w(
50
55
  (r) => {
51
- if (g) {
52
- const o = ce(r.target.value, g);
53
- o !== r.target.value && (r.target.value = o);
56
+ if (x) {
57
+ const f = de(r.target.value, x);
58
+ f !== r.target.value && (r.target.value = f);
54
59
  }
55
- l == null || l(r), E && a && u(r.target.value);
60
+ n == null || n(r), N && a && d(r.target.value);
56
61
  },
57
- [g, l, E, a, u]
58
- ), re = B(
62
+ [x, n, N, a, d]
63
+ ), te = w(
59
64
  (r) => {
60
- n == null || n(r), C && a && u(r.target.value);
65
+ o == null || o(r), A && a && d(r.target.value);
61
66
  },
62
- [n, C, a, u]
67
+ [o, A, a, d]
63
68
  );
64
- return /* @__PURE__ */ s("div", { className: f("Bear-Input bear-flex bear-flex-col bear-gap-1.5", H && "bear-w-full"), style: X, children: [
65
- k && /* @__PURE__ */ t("label", { className: "Bear-Input__label bear-text-sm bear-font-medium bear-text-gray-700 dark:bear-text-gray-300", style: Z, children: k }),
66
- /* @__PURE__ */ s("div", { className: "Bear-Input__wrapper bear-relative bear-flex bear-items-center", children: [
67
- p && /* @__PURE__ */ t("div", { className: "Bear-Input__addon Bear-Input__addon--left bear-absolute bear-left-3 bear-text-gray-500 dark:bear-text-gray-400", style: P, children: p }),
68
- /* @__PURE__ */ t(
69
- "input",
70
- {
71
- ref: W,
72
- disabled: x,
73
- value: _,
74
- defaultValue: y,
75
- maxLength: j,
76
- "aria-invalid": c || void 0,
77
- onChange: ee,
78
- onBlur: re,
79
- className: f(
80
- "Bear-Input__field",
81
- "bear-w-full bear-rounded-lg bear-border bear-outline-none bear-transition-all bear-duration-200",
82
- "bear-bg-white bear-text-gray-900 placeholder:bear-text-gray-400",
83
- "bear-border-gray-300 focus:bear-ring-2 focus:bear-ring-offset-2 focus:bear-ring-offset-white",
84
- "dark:bear-bg-gray-800 dark:bear-text-white dark:placeholder:bear-text-gray-500 dark:bear-border-gray-600 dark:focus:bear-ring-offset-gray-900",
85
- c ? "Bear-Input__field--error bear-border-red-500 focus:bear-ring-red-500" : O ? "Bear-Input__field--success bear-border-green-500 focus:bear-ring-green-500" : "focus:bear-border-bear-500 focus:bear-ring-bear-500 dark:focus:bear-border-bear-500 dark:focus:bear-ring-bear-500",
86
- x && "Bear-Input__field--disabled bear-opacity-50 bear-cursor-not-allowed",
87
- p && "bear-pl-10",
88
- (b || I) && "bear-pr-10",
89
- ue[G],
90
- T
69
+ return /* @__PURE__ */ u("div", { className: l("Bear-Input bear-flex bear-flex-col bear-gap-1.5", F && "bear-w-full"), style: Y, children: [
70
+ y && /* @__PURE__ */ t("label", { className: "Bear-Input__label bear-text-sm bear-font-medium", style: { color: "var(--bear-text-secondary)", ...$ }, children: y }),
71
+ /* @__PURE__ */ u(
72
+ "div",
73
+ {
74
+ className: l(
75
+ "Bear-Input__wrapper bear-flex bear-items-center bear-rounded-lg bear-border bear-overflow-hidden bear-transition-all bear-duration-200",
76
+ "focus-within:bear-ring-2 focus-within:bear-ring-offset-2",
77
+ "focus-within:bear-ring-offset-[var(--bear-bg-primary)]",
78
+ b ? "Bear-Input__wrapper--error bear-border-red-500 focus-within:bear-ring-red-500" : i ? "Bear-Input__wrapper--success bear-border-green-500 focus-within:bear-ring-green-500" : "focus-within:bear-border-bear-500 focus-within:bear-ring-bear-500 dark:focus-within:bear-border-bear-500 dark:focus-within:bear-ring-bear-500",
79
+ m && "bear-opacity-50 bear-cursor-not-allowed",
80
+ ue[k]
81
+ ),
82
+ style: {
83
+ backgroundColor: "var(--bear-bg-primary)",
84
+ borderColor: b || i ? void 0 : "var(--bear-border-default)"
85
+ },
86
+ children: [
87
+ M && /* @__PURE__ */ t(
88
+ "div",
89
+ {
90
+ className: "Bear-Input__addon Bear-Input__addon--left bear-flex bear-items-center bear-self-stretch bear-shrink-0 bear-px-3 bear-text-sm bear-font-medium bear-select-none bear-pointer-events-none",
91
+ style: {
92
+ backgroundColor: "var(--bear-bg-tertiary)",
93
+ borderRight: "1px solid var(--bear-border-default)",
94
+ color: "var(--bear-text-secondary)",
95
+ ...S
96
+ },
97
+ children: M
98
+ }
91
99
  ),
92
- style: Y,
93
- ...U
94
- }
95
- ),
96
- I && !b && /* @__PURE__ */ t("div", { className: "Bear-Input__addon Bear-Input__addon--right bear-absolute bear-right-3 bear-text-gray-500 dark:bear-text-gray-400", style: M, children: /* @__PURE__ */ t(D, { onClick: w }) }),
97
- b && /* @__PURE__ */ s("div", { className: "Bear-Input__addon Bear-Input__addon--right bear-absolute bear-right-3 bear-flex bear-items-center bear-gap-1.5 bear-text-gray-500 dark:bear-text-gray-400", style: M, children: [
98
- I && /* @__PURE__ */ t(D, { onClick: w }),
99
- b
100
- ] })
101
- ] }),
102
- /* @__PURE__ */ s("div", { className: "Bear-Input__footer bear-flex bear-items-center bear-justify-between bear-gap-2", children: [
103
- V ? /* @__PURE__ */ t(
100
+ /* @__PURE__ */ t(
101
+ "input",
102
+ {
103
+ ref: X,
104
+ disabled: m,
105
+ value: h,
106
+ defaultValue: g,
107
+ maxLength: C,
108
+ "aria-invalid": b || void 0,
109
+ onChange: ae,
110
+ onBlur: te,
111
+ className: l(
112
+ "Bear-Input__field",
113
+ "bear-flex-1 bear-min-w-0 bear-h-full bear-border-0 bear-outline-none bear-bg-transparent",
114
+ "placeholder:opacity-100 placeholder:[color:var(--bear-text-muted)]",
115
+ pe[k],
116
+ U
117
+ ),
118
+ style: {
119
+ color: "var(--bear-text-primary)",
120
+ ...Z
121
+ },
122
+ ...W
123
+ }
124
+ ),
125
+ re && /* @__PURE__ */ t(
126
+ "div",
127
+ {
128
+ className: "Bear-Input__clear bear-flex bear-items-center bear-self-stretch bear-shrink-0 bear-px-2 bear-cursor-pointer",
129
+ style: { color: "var(--bear-text-muted)" },
130
+ children: /* @__PURE__ */ t(ce, { onClick: J })
131
+ }
132
+ ),
133
+ H && /* @__PURE__ */ t(
134
+ "div",
135
+ {
136
+ className: "Bear-Input__addon Bear-Input__addon--right bear-flex bear-items-center bear-self-stretch bear-shrink-0 bear-px-3 bear-gap-1.5",
137
+ style: {
138
+ backgroundColor: "var(--bear-bg-tertiary)",
139
+ borderLeft: "1px solid var(--bear-border-default)",
140
+ color: "var(--bear-text-secondary)",
141
+ ...P
142
+ },
143
+ children: H
144
+ }
145
+ )
146
+ ]
147
+ }
148
+ ),
149
+ /* @__PURE__ */ u("div", { className: "Bear-Input__footer bear-flex bear-items-center bear-justify-between bear-gap-2", children: [
150
+ O ? /* @__PURE__ */ t(
104
151
  "p",
105
152
  {
106
- className: f(
153
+ className: l(
107
154
  "Bear-Input__helper bear-text-sm bear-flex-1",
108
- c ? "Bear-Input__helper--error bear-text-red-500" : O ? "Bear-Input__helper--success bear-text-green-500" : "bear-text-gray-500 dark:bear-text-gray-400"
155
+ b && "Bear-Input__helper--error bear-text-red-500",
156
+ i && "Bear-Input__helper--success bear-text-green-500"
109
157
  ),
110
- style: $,
111
- children: V
158
+ style: {
159
+ ...b || i ? {} : { color: "var(--bear-text-muted)" },
160
+ ...z
161
+ },
162
+ children: O
112
163
  }
113
- ) : v ? /* @__PURE__ */ t("span", {}) : null,
114
- v && i != null && /* @__PURE__ */ s(
164
+ ) : I ? /* @__PURE__ */ t("span", {}) : null,
165
+ I && c != null && /* @__PURE__ */ u(
115
166
  "span",
116
167
  {
117
- className: f(
168
+ className: l(
118
169
  "Bear-Input__char-count bear-text-xs bear-tabular-nums bear-shrink-0",
119
- A ? "bear-text-red-500" : "bear-text-gray-400 dark:bear-text-gray-500"
170
+ L && "bear-text-red-500"
120
171
  ),
172
+ style: L ? void 0 : { color: "var(--bear-text-muted)" },
121
173
  children: [
122
- m,
174
+ v,
123
175
  "/",
124
- i
176
+ c
125
177
  ]
126
178
  }
127
179
  )
@@ -129,7 +181,7 @@ const ue = {
129
181
  ] });
130
182
  }
131
183
  );
132
- oe.displayName = "Input";
184
+ xe.displayName = "Input";
133
185
  export {
134
- oe as Input
186
+ xe as Input
135
187
  };
@@ -1,6 +1,10 @@
1
1
  import { InputHTMLAttributes, ReactNode } from 'react';
2
2
  import { ValidationRule } from '../Form/Form.types';
3
3
  export type AutoFormatType = 'capitalize' | 'uppercase' | 'lowercase' | 'titleCase' | 'sentenceCase' | 'none';
4
+ export interface InputPropsInput {
5
+ startAdornment?: ReactNode;
6
+ endAdornment?: ReactNode;
7
+ }
4
8
  export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size'> {
5
9
  /** Input label */
6
10
  label?: string;
@@ -12,9 +16,11 @@ export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>,
12
16
  success?: string;
13
17
  /** Input size */
14
18
  size?: 'sm' | 'md' | 'lg';
15
- /** Left addon */
19
+ /** Start/end slots (takes precedence over leftAddon/rightAddon when set) */
20
+ InputProps?: InputPropsInput;
21
+ /** Left addon (legacy; use InputProps.startAdornment for start slot) */
16
22
  leftAddon?: ReactNode;
17
- /** Right addon */
23
+ /** Right addon (legacy; use InputProps.endAdornment for end slot) */
18
24
  rightAddon?: ReactNode;
19
25
  /** Whether input is full width */
20
26
  fullWidth?: boolean;
@@ -1,2 +1,2 @@
1
1
  export { Input } from './Input';
2
- export type { InputProps, AutoFormatType } from './Input.types';
2
+ export type { InputProps, InputPropsInput, AutoFormatType } from './Input.types';
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),d=require("../../utils/cn.cjs");require("react");const b=({visible:r=!0,opacity:t=.6,color:a="#000",blur:e,zIndex:i=40,fixed:n=!1,children:o,onClick:s,className:l,testId:u})=>r?c.jsx("div",{className:d.cn("Bear-Overlay",n?"bear-fixed":"bear-absolute","bear-inset-0 bear-transition-opacity",l),style:{backgroundColor:a,opacity:t,zIndex:i,backdropFilter:e?`blur(${e}px)`:void 0},onClick:s,"aria-hidden":"true","data-testid":u,children:o}):null;exports.Overlay=b;
@@ -0,0 +1,4 @@
1
+ import { FC } from 'react';
2
+ import { OverlayProps } from './Overlay.types';
3
+ export declare const Overlay: FC<OverlayProps>;
4
+ export default Overlay;
@@ -0,0 +1,38 @@
1
+ import { jsx as b } from "react/jsx-runtime";
2
+ import { cn as p } from "../../utils/cn.js";
3
+ import "react";
4
+ const f = ({
5
+ visible: e = !0,
6
+ opacity: a = 0.6,
7
+ color: t = "#000",
8
+ blur: r,
9
+ zIndex: i = 40,
10
+ fixed: o = !1,
11
+ children: l,
12
+ onClick: n,
13
+ className: s,
14
+ testId: d
15
+ }) => e ? /* @__PURE__ */ b(
16
+ "div",
17
+ {
18
+ className: p(
19
+ "Bear-Overlay",
20
+ o ? "bear-fixed" : "bear-absolute",
21
+ "bear-inset-0 bear-transition-opacity",
22
+ s
23
+ ),
24
+ style: {
25
+ backgroundColor: t,
26
+ opacity: a,
27
+ zIndex: i,
28
+ backdropFilter: r ? `blur(${r}px)` : void 0
29
+ },
30
+ onClick: n,
31
+ "aria-hidden": "true",
32
+ "data-testid": d,
33
+ children: l
34
+ }
35
+ ) : null;
36
+ export {
37
+ f as Overlay
38
+ };
@@ -0,0 +1,23 @@
1
+ import { ReactNode } from 'react';
2
+ export interface OverlayProps {
3
+ /** Whether the overlay is visible */
4
+ visible?: boolean;
5
+ /** Overlay opacity (0–1) */
6
+ opacity?: number;
7
+ /** Background color */
8
+ color?: string;
9
+ /** Apply backdrop blur */
10
+ blur?: number;
11
+ /** z-index value */
12
+ zIndex?: number;
13
+ /** Fixed positioning (covers viewport) */
14
+ fixed?: boolean;
15
+ /** Content to render on top of the overlay */
16
+ children?: ReactNode;
17
+ /** Click handler */
18
+ onClick?: () => void;
19
+ /** Additional class name */
20
+ className?: string;
21
+ /** Test ID */
22
+ testId?: string;
23
+ }
@@ -0,0 +1,2 @@
1
+ export { Overlay, default } from './Overlay';
2
+ export * from './Overlay.types';
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),a=require("react"),u=require("../../utils/cn.cjs"),S=({children:p,content:v,placement:b="bottom",trigger:l="click",open:c,onOpenChange:o,className:h,contentClassName:y,arrow:x=!0,closeOnClickOutside:f=!0,closeOnEscape:d=!0,offset:m=8})=>{const[g,k]=a.useState(!1),s=a.useRef(null),E=a.useRef(null),t=c!==void 0?c:g,r=a.useCallback(e=>{k(e),o==null||o(e)},[o]);a.useEffect(()=>{if(!f)return;const e=i=>{s.current&&!s.current.contains(i.target)&&r(!1)};return t&&document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[t,f,r]),a.useEffect(()=>{if(!d)return;const e=i=>{i.key==="Escape"&&r(!1)};return t&&document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[t,d,r]);const w=()=>{l==="click"&&r(!t)},z=()=>{l==="hover"&&r(!0)},j=()=>{l==="hover"&&r(!1)},L={top:"bear-bottom-full bear-left-1/2 -bear-translate-x-1/2 bear-mb-2","top-start":"bear-bottom-full bear-left-0 bear-mb-2","top-end":"bear-bottom-full bear-right-0 bear-mb-2",bottom:"bear-top-full bear-left-1/2 -bear-translate-x-1/2 bear-mt-2","bottom-start":"bear-top-full bear-left-0 bear-mt-2","bottom-end":"bear-top-full bear-right-0 bear-mt-2",left:"bear-right-full bear-top-1/2 -bear-translate-y-1/2 bear-mr-2","left-start":"bear-right-full bear-top-0 bear-mr-2","left-end":"bear-right-full bear-bottom-0 bear-mr-2",right:"bear-left-full bear-top-1/2 -bear-translate-y-1/2 bear-ml-2","right-start":"bear-left-full bear-top-0 bear-ml-2","right-end":"bear-left-full bear-bottom-0 bear-ml-2"},R={top:"bear-top-full bear-left-1/2 -bear-translate-x-1/2 bear-border-t-zinc-700 bear-border-x-transparent bear-border-b-transparent",bottom:"bear-bottom-full bear-left-1/2 -bear-translate-x-1/2 bear-border-b-zinc-700 bear-border-x-transparent bear-border-t-transparent",left:"bear-left-full bear-top-1/2 -bear-translate-y-1/2 bear-border-l-zinc-700 bear-border-y-transparent bear-border-r-transparent",right:"bear-right-full bear-top-1/2 -bear-translate-y-1/2 bear-border-r-zinc-700 bear-border-y-transparent bear-border-l-transparent"},M=b.split("-")[0];return n.jsxs("div",{ref:s,className:u.cn("bear-relative bear-inline-block",h),onMouseEnter:z,onMouseLeave:j,children:[n.jsx("div",{onClick:w,className:"bear-cursor-pointer",children:p}),t&&n.jsxs("div",{ref:E,className:u.cn("bear-absolute bear-z-50 bear-bg-zinc-800 bear-border bear-border-zinc-700 bear-rounded-lg bear-shadow-xl bear-p-3",L[b],y),style:{marginTop:b.startsWith("bottom")?m:void 0,marginBottom:b.startsWith("top")?m:void 0},children:[v,x&&n.jsx("div",{className:u.cn("bear-absolute bear-w-0 bear-h-0 bear-border-8",R[M])})]})]})};exports.Popover=S;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),l=require("react"),D=require("react-dom"),p=require("../../utils/cn.cjs"),H=1e4;function X(f,t,a){const e={position:"fixed",zIndex:H},s=f.split("-")[0],r=f.includes("start"),n=f.includes("end");return s==="bottom"?(e.top=t.bottom+a,r?e.left=t.left:n?e.left=t.right:e.left=t.left+t.width/2):s==="top"?(e.bottom=window.innerHeight-t.top+a,r?e.left=t.left:n?e.left=t.right:e.left=t.left+t.width/2):s==="left"?(e.right=window.innerWidth-t.left+a,r?e.top=t.top:n?e.bottom=window.innerHeight-t.bottom:e.top=t.top+t.height/2):(e.left=t.right+a,r?e.top=t.top:n?e.bottom=window.innerHeight-t.bottom:e.top=t.top+t.height/2),s==="bottom"||s==="top"?!r&&!n?e.transform="translateX(-50%)":n&&(e.transform="translateX(-100%)"):!r&&!n?e.transform="translateY(-50%)":n&&(e.transform="translateY(-100%)"),e}const T=({children:f,content:t,placement:a="bottom",trigger:e="click",open:s,onOpenChange:r,className:n,contentClassName:E,arrow:k=!0,closeOnClickOutside:m=!0,closeOnEscape:h=!0,offset:v=8})=>{const[z,R]=l.useState(!1),[S,j]=l.useState({}),d=l.useRef(null),w=l.useRef(null),i=s!==void 0?s:z,b=l.useCallback(o=>{R(o),r==null||r(o)},[r]);l.useEffect(()=>{if(i&&d.current){const o=d.current.getBoundingClientRect();j(X(a,o,v))}},[i,a,v]),l.useEffect(()=>{if(!m)return;const o=c=>{var g,x;const y=c.target;(g=d.current)!=null&&g.contains(y)||(x=w.current)!=null&&x.contains(y)||b(!1)};return i&&document.addEventListener("mousedown",o),()=>document.removeEventListener("mousedown",o)},[i,m,b]),l.useEffect(()=>{if(!h)return;const o=c=>{c.key==="Escape"&&b(!1)};return i&&document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[i,h,b]);const L=()=>{e==="click"&&b(!i)},P=()=>{e==="hover"&&b(!0)},M=()=>{e==="hover"&&b(!1)},N={top:"bear-top-full bear-left-1/2 -bear-translate-x-1/2 bear-border-t-zinc-700 bear-border-x-transparent bear-border-b-transparent",bottom:"bear-bottom-full bear-left-1/2 -bear-translate-x-1/2 bear-border-b-zinc-700 bear-border-x-transparent bear-border-t-transparent",left:"bear-left-full bear-top-1/2 -bear-translate-y-1/2 bear-border-l-zinc-700 bear-border-y-transparent bear-border-r-transparent",right:"bear-right-full bear-top-1/2 -bear-translate-y-1/2 bear-border-r-zinc-700 bear-border-y-transparent bear-border-l-transparent"},q=a.split("-")[0],I=i&&typeof document<"u"&&D.createPortal(u.jsxs("div",{ref:w,"data-bear-popover":!0,className:p.cn("bear-bg-zinc-800 bear-border bear-border-zinc-700 bear-rounded-lg bear-shadow-xl bear-p-3",E),style:S,children:[t,k&&u.jsx("div",{className:p.cn("bear-absolute bear-w-0 bear-h-0 bear-border-8",N[q])})]}),document.body);return u.jsxs("div",{ref:d,className:p.cn("bear-relative bear-inline-block",n),onMouseEnter:P,onMouseLeave:M,children:[u.jsx("div",{onClick:L,className:"bear-cursor-pointer",children:f}),I]})};exports.Popover=T;