@forgedevstack/bear 1.0.7 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (169) hide show
  1. package/dist/components/Alert/Alert.cjs +1 -1
  2. package/dist/components/Alert/Alert.const.cjs +1 -1
  3. package/dist/components/Alert/Alert.const.d.ts +4 -0
  4. package/dist/components/Alert/Alert.const.js +9 -15
  5. package/dist/components/Alert/Alert.js +43 -38
  6. package/dist/components/AppBar/AppBar.cjs +1 -1
  7. package/dist/components/AppBar/AppBar.js +20 -16
  8. package/dist/components/BackTop/BackTop.cjs +1 -0
  9. package/dist/components/BackTop/BackTop.const.cjs +1 -0
  10. package/dist/components/BackTop/BackTop.const.d.ts +34 -0
  11. package/dist/components/BackTop/BackTop.const.js +29 -0
  12. package/dist/components/BackTop/BackTop.d.ts +21 -0
  13. package/dist/components/BackTop/BackTop.js +87 -0
  14. package/dist/components/BackTop/BackTop.types.d.ts +28 -0
  15. package/dist/components/BackTop/index.d.ts +3 -0
  16. package/dist/components/Badge/Badge.constants.d.ts +4 -4
  17. package/dist/components/Badge/Badge.types.d.ts +3 -3
  18. package/dist/components/BottomSheet/BottomSheet.cjs +1 -1
  19. package/dist/components/BottomSheet/BottomSheet.js +39 -38
  20. package/dist/components/Button/Button.cjs +1 -1
  21. package/dist/components/Button/Button.constants.cjs +38 -48
  22. package/dist/components/Button/Button.constants.d.ts +22 -3
  23. package/dist/components/Button/Button.constants.js +51 -50
  24. package/dist/components/Button/Button.d.ts +14 -7
  25. package/dist/components/Button/Button.js +123 -45
  26. package/dist/components/Button/Button.types.d.ts +22 -4
  27. package/dist/components/Calendar/Calendar.cjs +1 -1
  28. package/dist/components/Calendar/Calendar.js +3 -2
  29. package/dist/components/Card/Card.const.d.ts +2 -2
  30. package/dist/components/Card/Card.types.d.ts +2 -2
  31. package/dist/components/Chat/Chat.cjs +1 -0
  32. package/dist/components/Chat/Chat.const.cjs +1 -0
  33. package/dist/components/Chat/Chat.const.d.ts +26 -0
  34. package/dist/components/Chat/Chat.const.js +29 -0
  35. package/dist/components/Chat/Chat.d.ts +21 -0
  36. package/dist/components/Chat/Chat.js +179 -0
  37. package/dist/components/Chat/Chat.types.d.ts +55 -0
  38. package/dist/components/Chat/index.d.ts +2 -0
  39. package/dist/components/Confetti/Confetti.cjs +1 -0
  40. package/dist/components/Confetti/Confetti.const.cjs +1 -0
  41. package/dist/components/Confetti/Confetti.const.d.ts +16 -0
  42. package/dist/components/Confetti/Confetti.const.js +36 -0
  43. package/dist/components/Confetti/Confetti.d.ts +23 -0
  44. package/dist/components/Confetti/Confetti.js +94 -0
  45. package/dist/components/Confetti/Confetti.types.d.ts +50 -0
  46. package/dist/components/Confetti/index.d.ts +4 -0
  47. package/dist/components/Confetti/useConfetti.cjs +1 -0
  48. package/dist/components/Confetti/useConfetti.d.ts +13 -0
  49. package/dist/components/Confetti/useConfetti.js +12 -0
  50. package/dist/components/DatePicker/DatePicker.cjs +1 -1
  51. package/dist/components/DatePicker/DatePicker.js +3 -2
  52. package/dist/components/DiffViewer/DiffViewer.cjs +1 -0
  53. package/dist/components/DiffViewer/DiffViewer.const.cjs +1 -0
  54. package/dist/components/DiffViewer/DiffViewer.const.d.ts +18 -0
  55. package/dist/components/DiffViewer/DiffViewer.const.js +21 -0
  56. package/dist/components/DiffViewer/DiffViewer.d.ts +18 -0
  57. package/dist/components/DiffViewer/DiffViewer.js +127 -0
  58. package/dist/components/DiffViewer/DiffViewer.types.d.ts +40 -0
  59. package/dist/components/DiffViewer/DiffViewer.utils.cjs +3 -0
  60. package/dist/components/DiffViewer/DiffViewer.utils.d.ts +9 -0
  61. package/dist/components/DiffViewer/DiffViewer.utils.js +39 -0
  62. package/dist/components/DiffViewer/index.d.ts +2 -0
  63. package/dist/components/Drawer/Drawer.cjs +1 -1
  64. package/dist/components/Drawer/Drawer.js +35 -35
  65. package/dist/components/FloatingChat/FloatingChat.cjs +1 -0
  66. package/dist/components/FloatingChat/FloatingChat.const.cjs +1 -0
  67. package/dist/components/FloatingChat/FloatingChat.const.d.ts +12 -0
  68. package/dist/components/FloatingChat/FloatingChat.const.js +15 -0
  69. package/dist/components/FloatingChat/FloatingChat.d.ts +19 -0
  70. package/dist/components/FloatingChat/FloatingChat.js +144 -0
  71. package/dist/components/FloatingChat/FloatingChat.types.d.ts +44 -0
  72. package/dist/components/FloatingChat/index.d.ts +2 -0
  73. package/dist/components/JsonViewer/JsonViewer.cjs +1 -0
  74. package/dist/components/JsonViewer/JsonViewer.const.cjs +1 -0
  75. package/dist/components/JsonViewer/JsonViewer.const.d.ts +4 -0
  76. package/dist/components/JsonViewer/JsonViewer.const.js +24 -0
  77. package/dist/components/JsonViewer/JsonViewer.d.ts +17 -0
  78. package/dist/components/JsonViewer/JsonViewer.js +195 -0
  79. package/dist/components/JsonViewer/JsonViewer.types.d.ts +54 -0
  80. package/dist/components/JsonViewer/index.d.ts +2 -0
  81. package/dist/components/Kanban/Kanban.cjs +1 -1
  82. package/dist/components/Kanban/Kanban.js +18 -17
  83. package/dist/components/QRCode/QRCode.cjs +1 -0
  84. package/dist/components/QRCode/QRCode.const.cjs +1 -0
  85. package/dist/components/QRCode/QRCode.const.d.ts +21 -0
  86. package/dist/components/QRCode/QRCode.const.js +11 -0
  87. package/dist/components/QRCode/QRCode.d.ts +29 -0
  88. package/dist/components/QRCode/QRCode.js +68 -0
  89. package/dist/components/QRCode/QRCode.types.d.ts +32 -0
  90. package/dist/components/QRCode/QRCode.utils.cjs +1 -0
  91. package/dist/components/QRCode/QRCode.utils.d.ts +12 -0
  92. package/dist/components/QRCode/QRCode.utils.js +74 -0
  93. package/dist/components/QRCode/index.d.ts +3 -0
  94. package/dist/components/Spinner/Spinner.types.d.ts +2 -2
  95. package/dist/components/Terminal/Terminal.cjs +1 -0
  96. package/dist/components/Terminal/Terminal.const.cjs +1 -0
  97. package/dist/components/Terminal/Terminal.const.d.ts +32 -0
  98. package/dist/components/Terminal/Terminal.const.js +42 -0
  99. package/dist/components/Terminal/Terminal.d.ts +27 -0
  100. package/dist/components/Terminal/Terminal.js +155 -0
  101. package/dist/components/Terminal/Terminal.types.d.ts +49 -0
  102. package/dist/components/Terminal/index.d.ts +2 -0
  103. package/dist/components/Tour/Tour.cjs +1 -0
  104. package/dist/components/Tour/Tour.const.cjs +1 -0
  105. package/dist/components/Tour/Tour.const.d.ts +25 -0
  106. package/dist/components/Tour/Tour.const.js +38 -0
  107. package/dist/components/Tour/Tour.d.ts +17 -0
  108. package/dist/components/Tour/Tour.js +179 -0
  109. package/dist/components/Tour/Tour.types.d.ts +80 -0
  110. package/dist/components/Tour/index.d.ts +4 -0
  111. package/dist/components/Tour/useTour.cjs +1 -0
  112. package/dist/components/Tour/useTour.d.ts +14 -0
  113. package/dist/components/Tour/useTour.js +27 -0
  114. package/dist/components/Typography/Typography.cjs +1 -1
  115. package/dist/components/Typography/Typography.d.ts +5 -1
  116. package/dist/components/Typography/Typography.js +93 -57
  117. package/dist/components/Typography/Typography.types.d.ts +29 -2
  118. package/dist/components/index.cjs +1 -1
  119. package/dist/components/index.d.ts +19 -1
  120. package/dist/components/index.js +242 -218
  121. package/dist/context/BearProvider.cjs +1 -1
  122. package/dist/context/BearProvider.d.ts +110 -5
  123. package/dist/context/BearProvider.js +198 -53
  124. package/dist/context/defaultTheme.cjs +1 -1
  125. package/dist/context/defaultTheme.js +11 -11
  126. package/dist/hooks/index.cjs +1 -1
  127. package/dist/hooks/index.d.ts +14 -0
  128. package/dist/hooks/index.js +56 -39
  129. package/dist/hooks/useBearComponent/index.d.ts +2 -0
  130. package/dist/hooks/useBearComponent/useBearComponent.cjs +1 -0
  131. package/dist/hooks/useBearComponent/useBearComponent.d.ts +71 -0
  132. package/dist/hooks/useBearComponent/useBearComponent.js +54 -0
  133. package/dist/hooks/useBearComponent/useBearComponent.types.d.ts +40 -0
  134. package/dist/hooks/useIdle/index.d.ts +2 -0
  135. package/dist/hooks/useIdle/useIdle.cjs +1 -0
  136. package/dist/hooks/useIdle/useIdle.d.ts +22 -0
  137. package/dist/hooks/useIdle/useIdle.js +66 -0
  138. package/dist/hooks/useIdle/useIdle.types.d.ts +29 -0
  139. package/dist/hooks/useLongPress/index.d.ts +2 -0
  140. package/dist/hooks/useLongPress/useLongPress.cjs +1 -0
  141. package/dist/hooks/useLongPress/useLongPress.d.ts +17 -0
  142. package/dist/hooks/useLongPress/useLongPress.js +44 -0
  143. package/dist/hooks/useLongPress/useLongPress.types.d.ts +26 -0
  144. package/dist/hooks/useOnline/index.d.ts +2 -0
  145. package/dist/hooks/useOnline/useOnline.cjs +1 -0
  146. package/dist/hooks/useOnline/useOnline.d.ts +16 -0
  147. package/dist/hooks/useOnline/useOnline.js +25 -0
  148. package/dist/hooks/useOnline/useOnline.types.d.ts +15 -0
  149. package/dist/hooks/usePageVisibility/index.d.ts +2 -0
  150. package/dist/hooks/usePageVisibility/usePageVisibility.cjs +1 -0
  151. package/dist/hooks/usePageVisibility/usePageVisibility.d.ts +19 -0
  152. package/dist/hooks/usePageVisibility/usePageVisibility.js +26 -0
  153. package/dist/hooks/usePageVisibility/usePageVisibility.types.d.ts +15 -0
  154. package/dist/hooks/useSpotlight/index.d.ts +2 -0
  155. package/dist/hooks/useSpotlight/useSpotlight.cjs +1 -0
  156. package/dist/hooks/useSpotlight/useSpotlight.d.ts +24 -0
  157. package/dist/hooks/useSpotlight/useSpotlight.js +49 -0
  158. package/dist/hooks/useSpotlight/useSpotlight.types.d.ts +23 -0
  159. package/dist/hooks/useWebSocket/index.d.ts +2 -0
  160. package/dist/hooks/useWebSocket/useWebSocket.cjs +1 -0
  161. package/dist/hooks/useWebSocket/useWebSocket.d.ts +22 -0
  162. package/dist/hooks/useWebSocket/useWebSocket.js +75 -0
  163. package/dist/hooks/useWebSocket/useWebSocket.types.d.ts +44 -0
  164. package/dist/index.cjs +1 -1
  165. package/dist/index.js +324 -283
  166. package/dist/styles.css +1 -1
  167. package/dist/types/component.types.d.ts +125 -42
  168. package/dist/types/theme.types.d.ts +82 -0
  169. package/package.json +1 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),m=require("react"),h=require("../../utils/cn.cjs"),r=require("./Alert.const.cjs"),k={success:e.jsxs("svg",{width:20,height:20,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[e.jsx("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),e.jsx("polyline",{points:"22 4 12 14.01 9 11.01"})]}),info:e.jsxs("svg",{width:20,height:20,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),e.jsx("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]}),warning:e.jsxs("svg",{width:20,height:20,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[e.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"}),e.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),e.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),error:e.jsxs("svg",{width:20,height:20,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("line",{x1:"15",y1:"9",x2:"9",y2:"15"}),e.jsx("line",{x1:"9",y1:"9",x2:"15",y2:"15"})]})},E=()=>e.jsxs("svg",{width:18,height:18,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),L=b=>{const{severity:s=r.ALERT_DEFAULTS.SEVERITY,variant:i=r.ALERT_DEFAULTS.VARIANT,title:a,icon:l=r.ALERT_DEFAULTS.SHOW_ICON,action:c,closable:u=r.ALERT_DEFAULTS.CLOSABLE,onClose:n,children:d,className:j,testId:A,id:y,...v}=b,[_,f]=m.useState(!0);if(!_)return null;const t=r.ALERT_SEVERITY_COLORS[s],o=i==="filled",g=()=>{f(!1),n==null||n()},x=()=>l===!1?null:l!==!0?l:k[s];return e.jsxs("div",{id:y,role:"alert","aria-live":"polite",className:h.cn("Bear-Alert","bear-flex bear-items-start bear-gap-3 bear-p-4 bear-rounded-lg",r.ALERT_VARIANT_CLASSES[i](s),j),style:{backgroundColor:o?void 0:t.bg,borderColor:i==="outlined"?t.border:void 0,color:o?void 0:t.text},"data-testid":A,...v,children:[x()&&e.jsx("span",{className:"Bear-Alert__icon bear-flex-shrink-0 bear-mt-0.5",style:{color:o?"currentColor":t.icon},children:x()}),e.jsxs("div",{className:"Bear-Alert__content bear-flex-1 bear-min-w-0",children:[a&&e.jsx("div",{className:"Bear-Alert__title bear-font-semibold bear-mb-1",children:a}),d&&e.jsx("div",{className:"Bear-Alert__message bear-text-sm",children:d})]}),c&&e.jsx("div",{className:"Bear-Alert__action bear-flex-shrink-0",children:c}),u&&e.jsx("button",{type:"button",onClick:g,className:h.cn("Bear-Alert__close","bear-flex-shrink-0 bear-p-1 bear-rounded hover:bear-bg-black/10 bear-transition-colors","bear-bg-transparent bear-border-none bear-cursor-pointer"),"aria-label":"Close alert",children:e.jsx(E,{})})]})};exports.Alert=L;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),m=require("react"),x=require("../../utils/cn.cjs"),r=require("./Alert.const.cjs"),w={success:e.jsxs("svg",{width:20,height:20,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[e.jsx("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),e.jsx("polyline",{points:"22 4 12 14.01 9 11.01"})]}),info:e.jsxs("svg",{width:20,height:20,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),e.jsx("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]}),warning:e.jsxs("svg",{width:20,height:20,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[e.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"}),e.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),e.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),error:e.jsxs("svg",{width:20,height:20,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("line",{x1:"15",y1:"9",x2:"9",y2:"15"}),e.jsx("line",{x1:"9",y1:"9",x2:"15",y2:"15"})]})},k=()=>e.jsxs("svg",{width:18,height:18,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),C=h=>{const{severity:t=r.ALERT_DEFAULTS.SEVERITY,variant:a=r.ALERT_DEFAULTS.VARIANT,title:l,icon:n=r.ALERT_DEFAULTS.SHOW_ICON,action:c,closable:u=r.ALERT_DEFAULTS.CLOSABLE,onClose:i,children:d,className:v,testId:g,id:j,...f}=h,[y,A]=m.useState(!0);if(!y)return null;const o=a==="filled",s={success:{bg:"var(--bear-success-50)",border:"var(--bear-success-500)",text:"var(--bear-success-800)",icon:"var(--bear-success-600)"},info:{bg:"var(--bear-info-50)",border:"var(--bear-info-500)",text:"var(--bear-info-800)",icon:"var(--bear-info-600)"},warning:{bg:"var(--bear-warning-50)",border:"var(--bear-warning-500)",text:"var(--bear-warning-800)",icon:"var(--bear-warning-600)"},error:{bg:"var(--bear-danger-50)",border:"var(--bear-danger-500)",text:"var(--bear-danger-800)",icon:"var(--bear-danger-600)"}}[t],_=()=>{A(!1),i==null||i()},b=()=>n===!1?null:n!==!0?n:w[t];return e.jsxs("div",{id:j,role:"alert","aria-live":"polite",className:x.cn("Bear-Alert","bear-flex bear-items-start bear-gap-3 bear-p-4 bear-rounded-lg",r.ALERT_VARIANT_CLASSES[a](t),v),style:{backgroundColor:o?void 0:s.bg,borderColor:a==="outlined"?s.border:void 0,color:o?void 0:s.text},"data-testid":g,...f,children:[b()&&e.jsx("span",{className:"Bear-Alert__icon bear-flex-shrink-0 bear-mt-0.5",style:{color:o?"currentColor":s.icon},children:b()}),e.jsxs("div",{className:"Bear-Alert__content bear-flex-1 bear-min-w-0",children:[l&&e.jsx("div",{className:"Bear-Alert__title bear-font-semibold bear-mb-1",children:l}),d&&e.jsx("div",{className:"Bear-Alert__message bear-text-sm",children:d})]}),c&&e.jsx("div",{className:"Bear-Alert__action bear-flex-shrink-0",children:c}),u&&e.jsx("button",{type:"button",onClick:_,className:x.cn("Bear-Alert__close","bear-flex-shrink-0 bear-p-1 bear-rounded hover:bear-bg-black/10 bear-transition-colors","bear-bg-transparent bear-border-none bear-cursor-pointer"),"aria-label":"Close alert",children:e.jsx(k,{})})]})};exports.Alert=C;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../utils/cn.cjs"),b={success:{bg:"rgba(34, 197, 94, 0.1)",border:"#22c55e",text:"#166534",icon:"#22c55e"},info:{bg:"rgba(59, 130, 246, 0.1)",border:"#3b82f6",text:"#1e40af",icon:"#3b82f6"},warning:{bg:"rgba(245, 158, 11, 0.1)",border:"#f59e0b",text:"#92400e",icon:"#f59e0b"},error:{bg:"rgba(239, 68, 68, 0.1)",border:"#ef4444",text:"#991b1b",icon:"#ef4444"}},n={filled:e=>r.cn("bear-text-white",e==="success"&&"bear-bg-green-500",e==="info"&&"bear-bg-blue-500",e==="warning"&&"bear-bg-amber-500",e==="error"&&"bear-bg-red-500"),outlined:()=>"bear-bg-transparent bear-border",standard:()=>""},a={SEVERITY:"info",VARIANT:"standard",SHOW_ICON:!0,CLOSABLE:!1};exports.ALERT_DEFAULTS=a;exports.ALERT_SEVERITY_COLORS=b;exports.ALERT_VARIANT_CLASSES=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../utils/cn.cjs"),a={filled:e=>r.cn("bear-text-white bear-alert-filled",e==="success"&&"bear-alert-filled-success",e==="info"&&"bear-alert-filled-info",e==="warning"&&"bear-alert-filled-warning",e==="error"&&"bear-alert-filled-error"),outlined:()=>"bear-bg-transparent bear-border",standard:()=>""},l={SEVERITY:"info",VARIANT:"standard",SHOW_ICON:!0,CLOSABLE:!1};exports.ALERT_DEFAULTS=l;exports.ALERT_VARIANT_CLASSES=a;
@@ -1,4 +1,8 @@
1
1
  import { AlertSeverity, AlertVariant } from './Alert.types';
2
+ /**
3
+ * Alert severity colors using CSS variables for theme support
4
+ * These map to the theme's success, info, warning, and danger color scales
5
+ */
2
6
  export declare const ALERT_SEVERITY_COLORS: Record<AlertSeverity, {
3
7
  bg: string;
4
8
  border: string;
@@ -1,27 +1,21 @@
1
1
  import { cn as e } from "../../utils/cn.js";
2
- const a = {
3
- success: { bg: "rgba(34, 197, 94, 0.1)", border: "#22c55e", text: "#166534", icon: "#22c55e" },
4
- info: { bg: "rgba(59, 130, 246, 0.1)", border: "#3b82f6", text: "#1e40af", icon: "#3b82f6" },
5
- warning: { bg: "rgba(245, 158, 11, 0.1)", border: "#f59e0b", text: "#92400e", icon: "#f59e0b" },
6
- error: { bg: "rgba(239, 68, 68, 0.1)", border: "#ef4444", text: "#991b1b", icon: "#ef4444" }
7
- }, n = {
2
+ const l = {
8
3
  filled: (r) => e(
9
- "bear-text-white",
10
- r === "success" && "bear-bg-green-500",
11
- r === "info" && "bear-bg-blue-500",
12
- r === "warning" && "bear-bg-amber-500",
13
- r === "error" && "bear-bg-red-500"
4
+ "bear-text-white bear-alert-filled",
5
+ r === "success" && "bear-alert-filled-success",
6
+ r === "info" && "bear-alert-filled-info",
7
+ r === "warning" && "bear-alert-filled-warning",
8
+ r === "error" && "bear-alert-filled-error"
14
9
  ),
15
10
  outlined: () => "bear-bg-transparent bear-border",
16
11
  standard: () => ""
17
- }, o = {
12
+ }, n = {
18
13
  SEVERITY: "info",
19
14
  VARIANT: "standard",
20
15
  SHOW_ICON: !0,
21
16
  CLOSABLE: !1
22
17
  };
23
18
  export {
24
- o as ALERT_DEFAULTS,
25
- a as ALERT_SEVERITY_COLORS,
26
- n as ALERT_VARIANT_CLASSES
19
+ n as ALERT_DEFAULTS,
20
+ l as ALERT_VARIANT_CLASSES
27
21
  };
@@ -1,8 +1,8 @@
1
1
  import { jsxs as r, jsx as e } from "react/jsx-runtime";
2
2
  import { useState as k } from "react";
3
- import { cn as x } from "../../utils/cn.js";
4
- import { ALERT_DEFAULTS as i, ALERT_SEVERITY_COLORS as C, ALERT_VARIANT_CLASSES as B } from "./Alert.const.js";
5
- const w = {
3
+ import { cn as v } from "../../utils/cn.js";
4
+ import { ALERT_DEFAULTS as t, ALERT_VARIANT_CLASSES as C } from "./Alert.const.js";
5
+ const _ = {
6
6
  success: /* @__PURE__ */ r("svg", { width: 20, height: 20, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, "aria-hidden": "true", children: [
7
7
  /* @__PURE__ */ e("path", { d: "M22 11.08V12a10 10 0 1 1-5.93-9.14" }),
8
8
  /* @__PURE__ */ e("polyline", { points: "22 4 12 14.01 9 11.01" })
@@ -22,73 +22,78 @@ const w = {
22
22
  /* @__PURE__ */ e("line", { x1: "15", y1: "9", x2: "9", y2: "15" }),
23
23
  /* @__PURE__ */ e("line", { x1: "9", y1: "9", x2: "15", y2: "15" })
24
24
  ] })
25
- }, N = () => /* @__PURE__ */ r("svg", { width: 18, height: 18, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, "aria-hidden": "true", children: [
25
+ }, B = () => /* @__PURE__ */ r("svg", { width: 18, height: 18, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, "aria-hidden": "true", children: [
26
26
  /* @__PURE__ */ e("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
27
27
  /* @__PURE__ */ e("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
28
- ] }), R = (u) => {
28
+ ] }), W = (x) => {
29
29
  const {
30
- severity: l = i.SEVERITY,
31
- variant: o = i.VARIANT,
30
+ severity: o = t.SEVERITY,
31
+ variant: i = t.VARIANT,
32
32
  title: c,
33
- icon: n = i.SHOW_ICON,
33
+ icon: n = t.SHOW_ICON,
34
34
  action: d,
35
- closable: f = i.CLOSABLE,
36
- onClose: a,
37
- children: h,
38
- className: m,
39
- testId: v,
40
- id: y,
41
- ...g
42
- } = u, [A, _] = k(!0);
43
- if (!A) return null;
44
- const t = C[l], s = o === "filled", p = () => {
45
- _(!1), a == null || a();
46
- }, b = () => n === !1 ? null : n !== !0 ? n : w[l];
35
+ closable: u = t.CLOSABLE,
36
+ onClose: l,
37
+ children: b,
38
+ className: g,
39
+ testId: f,
40
+ id: m,
41
+ ...y
42
+ } = x, [p, w] = k(!0);
43
+ if (!p) return null;
44
+ const s = i === "filled", a = {
45
+ success: { bg: "var(--bear-success-50)", border: "var(--bear-success-500)", text: "var(--bear-success-800)", icon: "var(--bear-success-600)" },
46
+ info: { bg: "var(--bear-info-50)", border: "var(--bear-info-500)", text: "var(--bear-info-800)", icon: "var(--bear-info-600)" },
47
+ warning: { bg: "var(--bear-warning-50)", border: "var(--bear-warning-500)", text: "var(--bear-warning-800)", icon: "var(--bear-warning-600)" },
48
+ error: { bg: "var(--bear-danger-50)", border: "var(--bear-danger-500)", text: "var(--bear-danger-800)", icon: "var(--bear-danger-600)" }
49
+ }[o], A = () => {
50
+ w(!1), l == null || l();
51
+ }, h = () => n === !1 ? null : n !== !0 ? n : _[o];
47
52
  return /* @__PURE__ */ r(
48
53
  "div",
49
54
  {
50
- id: y,
55
+ id: m,
51
56
  role: "alert",
52
57
  "aria-live": "polite",
53
- className: x(
58
+ className: v(
54
59
  "Bear-Alert",
55
60
  "bear-flex bear-items-start bear-gap-3 bear-p-4 bear-rounded-lg",
56
- B[o](l),
57
- m
61
+ C[i](o),
62
+ g
58
63
  ),
59
64
  style: {
60
- backgroundColor: s ? void 0 : t.bg,
61
- borderColor: o === "outlined" ? t.border : void 0,
62
- color: s ? void 0 : t.text
65
+ backgroundColor: s ? void 0 : a.bg,
66
+ borderColor: i === "outlined" ? a.border : void 0,
67
+ color: s ? void 0 : a.text
63
68
  },
64
- "data-testid": v,
65
- ...g,
69
+ "data-testid": f,
70
+ ...y,
66
71
  children: [
67
- b() && /* @__PURE__ */ e(
72
+ h() && /* @__PURE__ */ e(
68
73
  "span",
69
74
  {
70
75
  className: "Bear-Alert__icon bear-flex-shrink-0 bear-mt-0.5",
71
- style: { color: s ? "currentColor" : t.icon },
72
- children: b()
76
+ style: { color: s ? "currentColor" : a.icon },
77
+ children: h()
73
78
  }
74
79
  ),
75
80
  /* @__PURE__ */ r("div", { className: "Bear-Alert__content bear-flex-1 bear-min-w-0", children: [
76
81
  c && /* @__PURE__ */ e("div", { className: "Bear-Alert__title bear-font-semibold bear-mb-1", children: c }),
77
- h && /* @__PURE__ */ e("div", { className: "Bear-Alert__message bear-text-sm", children: h })
82
+ b && /* @__PURE__ */ e("div", { className: "Bear-Alert__message bear-text-sm", children: b })
78
83
  ] }),
79
84
  d && /* @__PURE__ */ e("div", { className: "Bear-Alert__action bear-flex-shrink-0", children: d }),
80
- f && /* @__PURE__ */ e(
85
+ u && /* @__PURE__ */ e(
81
86
  "button",
82
87
  {
83
88
  type: "button",
84
- onClick: p,
85
- className: x(
89
+ onClick: A,
90
+ className: v(
86
91
  "Bear-Alert__close",
87
92
  "bear-flex-shrink-0 bear-p-1 bear-rounded hover:bear-bg-black/10 bear-transition-colors",
88
93
  "bear-bg-transparent bear-border-none bear-cursor-pointer"
89
94
  ),
90
95
  "aria-label": "Close alert",
91
- children: /* @__PURE__ */ e(N, {})
96
+ children: /* @__PURE__ */ e(B, {})
92
97
  }
93
98
  )
94
99
  ]
@@ -96,5 +101,5 @@ const w = {
96
101
  );
97
102
  };
98
103
  export {
99
- R as Alert
104
+ W as Alert
100
105
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),p=require("../../utils/cn.cjs"),u=({children:a,position:t="sticky",variant:r="default",color:b="default",className:s,leftContent:i,rightContent:c,centerContent:l,elevation:n=!0})=>{const d={fixed:"bear-fixed bear-top-0 bear-left-0 bear-right-0 bear-z-50",sticky:"bear-sticky bear-top-0 bear-z-50",static:"bear-static",relative:"bear-relative"},o={default:"bear-bg-white bear-text-gray-900 dark:bear-bg-zinc-900 dark:bear-text-white",transparent:"bear-bg-transparent",blur:"bear-bg-white/80 dark:bear-bg-zinc-900/80 bear-backdrop-blur-md"},x={default:"",primary:"bear-bg-bear-600 bear-text-white",dark:"bear-bg-black bear-text-white"},g=n?"bear-shadow-lg bear-border-b bear-border-gray-200 dark:bear-border-zinc-800":"";return e.jsx("header",{className:p.cn("bear-w-full bear-h-16 bear-px-4 bear-flex bear-items-center",d[t],r!=="transparent"&&o[r],x[b],g,s),children:a??e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"bear-flex bear-items-center bear-gap-4",children:i}),e.jsx("div",{className:"bear-flex-1 bear-flex bear-items-center bear-justify-center",children:l}),e.jsx("div",{className:"bear-flex bear-items-center bear-gap-4",children:c})]})})};exports.AppBar=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),m=require("../../utils/cn.cjs"),g=({children:a,position:t="sticky",variant:b="default",color:r="primary",className:s,leftContent:i,rightContent:l,centerContent:c,elevation:n=!0})=>{const d={fixed:"bear-fixed bear-top-0 bear-left-0 bear-right-0 bear-z-50",sticky:"bear-sticky bear-top-0 bear-z-50",static:"bear-static",relative:"bear-relative"},o={default:"",transparent:"bear-bg-transparent",blur:"bear-backdrop-blur-md"},p={default:"bear-bg-white bear-text-gray-900 dark:bear-bg-zinc-900 dark:bear-text-white",primary:"bear-bg-pink-600 bear-text-white",dark:"bear-bg-gray-900 bear-text-white dark:bear-bg-black"},x=n?"bear-shadow-md bear-border-b bear-border-gray-200/10":"";return e.jsx("header",{className:m.cn("Bear-AppBar","bear-w-full bear-h-16 bear-px-4 bear-flex bear-items-center",d[t],o[b],p[r],x,s),style:{backgroundColor:r==="primary"?"var(--bear-primary-600)":void 0},children:a??e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"bear-flex bear-items-center bear-gap-4",children:i}),e.jsx("div",{className:"bear-flex-1 bear-flex bear-items-center bear-justify-center",children:c}),e.jsx("div",{className:"bear-flex bear-items-center bear-gap-4",children:l})]})})};exports.AppBar=g;
@@ -1,10 +1,10 @@
1
- import { jsx as e, jsxs as m, Fragment as x } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as f, Fragment as x } from "react/jsx-runtime";
2
2
  import { cn as g } from "../../utils/cn.js";
3
- const u = ({
3
+ const k = ({
4
4
  children: a,
5
5
  position: t = "sticky",
6
- variant: r = "default",
7
- color: b = "default",
6
+ variant: b = "default",
7
+ color: r = "primary",
8
8
  className: s,
9
9
  leftContent: i,
10
10
  rightContent: l,
@@ -17,26 +17,30 @@ const u = ({
17
17
  static: "bear-static",
18
18
  relative: "bear-relative"
19
19
  }, o = {
20
- default: "bear-bg-white bear-text-gray-900 dark:bear-bg-zinc-900 dark:bear-text-white",
21
- transparent: "bear-bg-transparent",
22
- blur: "bear-bg-white/80 dark:bear-bg-zinc-900/80 bear-backdrop-blur-md"
23
- }, f = {
24
20
  default: "",
25
- primary: "bear-bg-bear-600 bear-text-white",
26
- dark: "bear-bg-black bear-text-white"
27
- }, p = n ? "bear-shadow-lg bear-border-b bear-border-gray-200 dark:bear-border-zinc-800" : "";
21
+ transparent: "bear-bg-transparent",
22
+ blur: "bear-backdrop-blur-md"
23
+ }, p = {
24
+ default: "bear-bg-white bear-text-gray-900 dark:bear-bg-zinc-900 dark:bear-text-white",
25
+ primary: "bear-bg-pink-600 bear-text-white",
26
+ dark: "bear-bg-gray-900 bear-text-white dark:bear-bg-black"
27
+ }, m = n ? "bear-shadow-md bear-border-b bear-border-gray-200/10" : "";
28
28
  return /* @__PURE__ */ e(
29
29
  "header",
30
30
  {
31
31
  className: g(
32
+ "Bear-AppBar",
32
33
  "bear-w-full bear-h-16 bear-px-4 bear-flex bear-items-center",
33
34
  d[t],
34
- r !== "transparent" && o[r],
35
- f[b],
36
- p,
35
+ o[b],
36
+ p[r],
37
+ m,
37
38
  s
38
39
  ),
39
- children: a ?? /* @__PURE__ */ m(x, { children: [
40
+ style: {
41
+ backgroundColor: r === "primary" ? "var(--bear-primary-600)" : void 0
42
+ },
43
+ children: a ?? /* @__PURE__ */ f(x, { children: [
40
44
  /* @__PURE__ */ e("div", { className: "bear-flex bear-items-center bear-gap-4", children: i }),
41
45
  /* @__PURE__ */ e("div", { className: "bear-flex-1 bear-flex bear-items-center bear-justify-center", children: c }),
42
46
  /* @__PURE__ */ e("div", { className: "bear-flex bear-items-center bear-gap-4", children: l })
@@ -45,5 +49,5 @@ const u = ({
45
49
  );
46
50
  };
47
51
  export {
48
- u as AppBar
52
+ k as AppBar
49
53
  };
@@ -0,0 +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;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i={BOTTOM:40,RIGHT:40,VISIBLE_AT:400,DURATION:300,SIZE:"md",VARIANT:"primary",ANIMATED:!0},t={sm:{width:36,height:36,iconSize:16},md:{width:44,height:44,iconSize:20},lg:{width:52,height:52,iconSize:24}};exports.BACKTOP_DEFAULTS=i;exports.BACKTOP_SIZES=t;
@@ -0,0 +1,34 @@
1
+ /**
2
+ * BackTop component defaults
3
+ * Uses Bear Button for consistent styling
4
+ */
5
+ export declare const BACKTOP_DEFAULTS: {
6
+ readonly BOTTOM: 40;
7
+ readonly RIGHT: 40;
8
+ readonly VISIBLE_AT: 400;
9
+ readonly DURATION: 300;
10
+ readonly SIZE: "md";
11
+ readonly VARIANT: "primary";
12
+ readonly ANIMATED: true;
13
+ };
14
+ /**
15
+ * BackTop size configurations
16
+ * Controls the button dimensions and icon size
17
+ */
18
+ export declare const BACKTOP_SIZES: {
19
+ readonly sm: {
20
+ readonly width: 36;
21
+ readonly height: 36;
22
+ readonly iconSize: 16;
23
+ };
24
+ readonly md: {
25
+ readonly width: 44;
26
+ readonly height: 44;
27
+ readonly iconSize: 20;
28
+ };
29
+ readonly lg: {
30
+ readonly width: 52;
31
+ readonly height: 52;
32
+ readonly iconSize: 24;
33
+ };
34
+ };
@@ -0,0 +1,29 @@
1
+ const i = {
2
+ BOTTOM: 40,
3
+ RIGHT: 40,
4
+ VISIBLE_AT: 400,
5
+ DURATION: 300,
6
+ SIZE: "md",
7
+ VARIANT: "primary",
8
+ ANIMATED: !0
9
+ }, t = {
10
+ sm: {
11
+ width: 36,
12
+ height: 36,
13
+ iconSize: 16
14
+ },
15
+ md: {
16
+ width: 44,
17
+ height: 44,
18
+ iconSize: 20
19
+ },
20
+ lg: {
21
+ width: 52,
22
+ height: 52,
23
+ iconSize: 24
24
+ }
25
+ };
26
+ export {
27
+ i as BACKTOP_DEFAULTS,
28
+ t as BACKTOP_SIZES
29
+ };
@@ -0,0 +1,21 @@
1
+ import { FC } from 'react';
2
+ import { BackTopProps } from './BackTop.types';
3
+ /**
4
+ * BackTop - Scroll to top button
5
+ *
6
+ * @example
7
+ * ```tsx
8
+ * // Basic usage
9
+ * <BackTop />
10
+ *
11
+ * // Custom position and threshold
12
+ * <BackTop bottom={60} right={20} visibleAt={200} />
13
+ *
14
+ * // Custom content
15
+ * <BackTop>
16
+ * <span>↑ Top</span>
17
+ * </BackTop>
18
+ * ```
19
+ */
20
+ export declare const BackTop: FC<BackTopProps>;
21
+ export default BackTop;
@@ -0,0 +1,87 @@
1
+ import { jsx as p } from "react/jsx-runtime";
2
+ import { useState as y, useCallback as b, useEffect as A } from "react";
3
+ import { cn as x } from "../../utils/cn.js";
4
+ import { Button as L } from "../Button/Button.js";
5
+ import { BACKTOP_DEFAULTS as o, BACKTOP_SIZES as z } from "./BackTop.const.js";
6
+ const V = ({
7
+ bottom: s = o.BOTTOM,
8
+ right: l = o.RIGHT,
9
+ visibleAt: u = o.VISIBLE_AT,
10
+ duration: a = o.DURATION,
11
+ target: i,
12
+ children: m,
13
+ size: c = o.SIZE,
14
+ variant: T = o.VARIANT,
15
+ animated: f = o.ANIMATED,
16
+ className: h,
17
+ testId: w,
18
+ onClick: r,
19
+ ...S
20
+ }) => {
21
+ const [I, g] = y(!1), t = z[c], n = b(() => i ? i() : typeof window < "u" ? window : null, [i]);
22
+ A(() => {
23
+ const e = n();
24
+ if (!e) return;
25
+ const d = () => {
26
+ const E = e === window ? window.scrollY || document.documentElement.scrollTop : e.scrollTop;
27
+ g(E >= u);
28
+ };
29
+ return e.addEventListener("scroll", d, { passive: !0 }), d(), () => {
30
+ e.removeEventListener("scroll", d);
31
+ };
32
+ }, [n, u]);
33
+ const v = b(() => {
34
+ const e = n();
35
+ e && (r == null || r(), e === window ? window.scrollTo({
36
+ top: 0,
37
+ behavior: a > 0 ? "smooth" : "auto"
38
+ }) : e.scrollTo({
39
+ top: 0,
40
+ behavior: a > 0 ? "smooth" : "auto"
41
+ }));
42
+ }, [n, a, r]), B = /* @__PURE__ */ p(
43
+ "svg",
44
+ {
45
+ width: t.iconSize,
46
+ height: t.iconSize,
47
+ viewBox: "0 0 24 24",
48
+ fill: "none",
49
+ stroke: "currentColor",
50
+ strokeWidth: 2.5,
51
+ strokeLinecap: "round",
52
+ strokeLinejoin: "round",
53
+ children: /* @__PURE__ */ p("path", { d: "M18 15l-6-6-6 6" })
54
+ }
55
+ );
56
+ return /* @__PURE__ */ p(
57
+ L,
58
+ {
59
+ variant: T,
60
+ size: c === "sm" ? "sm" : c === "lg" ? "lg" : "md",
61
+ className: x(
62
+ "Bear-BackTop",
63
+ "!bear-rounded-full !bear-p-0",
64
+ "!bear-fixed !bear-shadow-lg",
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",
67
+ h
68
+ ),
69
+ style: {
70
+ bottom: typeof s == "number" ? `${s}px` : s,
71
+ right: typeof l == "number" ? `${l}px` : l,
72
+ width: t.width,
73
+ height: t.height,
74
+ minWidth: t.width,
75
+ zIndex: 9999
76
+ },
77
+ onClick: v,
78
+ "aria-label": "Scroll to top",
79
+ "data-testid": w,
80
+ ...S,
81
+ children: m || B
82
+ }
83
+ );
84
+ };
85
+ export {
86
+ V as BackTop
87
+ };
@@ -0,0 +1,28 @@
1
+ import { ReactNode, HTMLAttributes } from 'react';
2
+ import { BearVariant, BearSize } from '../../types';
3
+ export interface BackTopProps extends Omit<HTMLAttributes<HTMLButtonElement>, 'children'> {
4
+ /** Distance from bottom of viewport */
5
+ bottom?: number | string;
6
+ /** Distance from right of viewport */
7
+ right?: number | string;
8
+ /** Show threshold - scroll distance before button appears */
9
+ visibleAt?: number;
10
+ /** Scroll duration in ms */
11
+ duration?: number;
12
+ /** Target element to scroll (defaults to window) */
13
+ target?: () => HTMLElement | null;
14
+ /** Custom icon or content */
15
+ children?: ReactNode;
16
+ /** Button size - uses Bear Button sizes */
17
+ size?: Extract<BearSize, 'sm' | 'md' | 'lg'>;
18
+ /** Button variant - uses Bear Button variants */
19
+ variant?: BearVariant;
20
+ /** Show/hide animation */
21
+ animated?: boolean;
22
+ /** Custom class name */
23
+ className?: string;
24
+ /** Test ID */
25
+ testId?: string;
26
+ /** Callback when clicked */
27
+ onClick?: () => void;
28
+ }
@@ -0,0 +1,3 @@
1
+ export { BackTop, default } from './BackTop';
2
+ export * from './BackTop.types';
3
+ export * from './BackTop.const';
@@ -1,6 +1,6 @@
1
- import { EmberSize, EmberVariant } from '../../types';
1
+ import { BearSize, BearVariant } from '../../types';
2
2
  /** Dot size utility classes (bear-w-1.5 bear-h-1.5). */
3
3
  export declare const BADGE_DOT_SIZE_CLASSES = "bear-w-1.5 bear-h-1.5";
4
- export declare const sizeClasses: Record<Exclude<EmberSize, 'xl'>, string>;
5
- export declare const variantClasses: Record<EmberVariant | 'neutral', string>;
6
- export declare const dotVariantColors: Record<EmberVariant | 'neutral', string>;
4
+ export declare const sizeClasses: Record<Exclude<BearSize, 'xl'>, string>;
5
+ export declare const variantClasses: Record<BearVariant | 'neutral', string>;
6
+ export declare const dotVariantColors: Record<BearVariant | 'neutral', string>;
@@ -1,10 +1,10 @@
1
1
  import { HTMLAttributes } from 'react';
2
- import { EmberSize, EmberVariant } from '../../types';
2
+ import { BearSize, BearVariant } from '../../types';
3
3
  export interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
4
4
  /** Badge variant */
5
- variant?: EmberVariant | 'neutral';
5
+ variant?: BearVariant | 'neutral';
6
6
  /** Badge size */
7
- size?: Exclude<EmberSize, 'xl'>;
7
+ size?: Exclude<BearSize, 'xl'>;
8
8
  /** Whether badge is pill shaped */
9
9
  pill?: boolean;
10
10
  /** Whether badge has a dot indicator */
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),N=require("react-dom"),f=require("../../utils/cn.cjs"),z=require("../Icon/index.cjs"),x=300,S={sm:"bear-max-h-[40%]",md:"bear-max-h-[60%]",lg:"bear-max-h-[80%]",full:"bear-max-h-[95%]"},k=({isOpen:b,onClose:s,title:n,children:h,size:y="md",showCloseButton:l=!0,closeOnBackdrop:v=!0,closeOnEscape:c=!0,showHandle:j=!0,className:g})=>{const[a,d]=r.useState(b),[u,o]=r.useState(!1),[p,m]=r.useState(!1);r.useEffect(()=>{if(b){d(!0),o(!1);const t=requestAnimationFrame(()=>m(!0));return()=>cancelAnimationFrame(t)}if(a){m(!1),o(!0);const t=setTimeout(()=>{d(!1),o(!1)},x);return()=>clearTimeout(t)}},[b,a]);const i=r.useCallback(t=>{c&&t.key==="Escape"&&s()},[c,s]);if(r.useEffect(()=>(a&&(document.addEventListener("keydown",i),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",i),document.body.style.overflow=""}),[a,i]),!a)return null;const w=e.jsxs("div",{className:"bear-fixed bear-inset-0 bear-z-50 bear-flex bear-items-end bear-justify-center",children:[e.jsx("div",{className:f.cn("bear-absolute bear-inset-0 bear-bg-black/60 bear-backdrop-blur-sm bear-transition-opacity",u?"bear-opacity-0":"bear-opacity-100"),style:{transitionDuration:`${x}ms`},onClick:v?s:void 0,"aria-hidden":"true"}),e.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":n?"bottom-sheet-title":void 0,className:f.cn("Bear-BottomSheet bear-relative bear-w-full bear-rounded-t-2xl bear-bg-zinc-900 bear-border-t bear-border-zinc-700 bear-shadow-2xl bear-overflow-hidden bear-transition-transform bear-duration-300",S[y],p&&!u?"bear-translate-y-0":"bear-translate-y-full",g),children:[j&&e.jsx("div",{className:"bear-flex bear-justify-center bear-pt-2 bear-pb-1",children:e.jsx("div",{className:"bear-w-12 bear-h-1 bear-rounded-full bear-bg-zinc-600","aria-hidden":!0})}),(n||l)&&e.jsxs("div",{className:"bear-flex bear-items-center bear-justify-between bear-px-4 bear-py-3 bear-border-b bear-border-zinc-700",children:[n&&e.jsx("h2",{id:"bottom-sheet-title",className:"bear-text-lg bear-font-semibold bear-text-white",children:n}),l&&e.jsx("button",{onClick:s,className:"bear-p-1 bear-rounded-lg bear-text-zinc-400 hover:bear-text-white hover:bear-bg-zinc-700 bear-transition-colors","aria-label":"Close",children:e.jsx(z.XIcon,{className:"bear-w-5 bear-h-5"})})]}),e.jsx("div",{className:"bear-flex-1 bear-overflow-y-auto bear-p-4 bear-text-zinc-300",children:h})]})]});return N.createPortal(w,document.body)};exports.BottomSheet=k;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),p=require("react-dom"),f=require("../../utils/cn.cjs"),N=require("../Icon/index.cjs"),x=300,S={sm:"bear-max-h-[40%]",md:"bear-max-h-[60%]",lg:"bear-max-h-[80%]",full:"bear-max-h-[95%]"},q=({isOpen:n,onClose:s,title:b,children:h,size:v="md",showCloseButton:i=!0,closeOnBackdrop:y=!0,closeOnEscape:d=!0,showHandle:k=!0,className:g})=>{const[a,u]=r.useState(n),[c,o]=r.useState(!1),[j,m]=r.useState(!1);r.useEffect(()=>{if(n){u(!0),o(!1);const t=requestAnimationFrame(()=>m(!0));return()=>cancelAnimationFrame(t)}if(a){m(!1),o(!0);const t=setTimeout(()=>{u(!1),o(!1)},x);return()=>clearTimeout(t)}},[n,a]);const l=r.useCallback(t=>{d&&t.key==="Escape"&&s()},[d,s]);if(r.useEffect(()=>(a&&(document.addEventListener("keydown",l),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",l),document.body.style.overflow=""}),[a,l]),!a)return null;const w=e.jsxs("div",{className:"bear-fixed bear-inset-0 bear-z-50 bear-flex bear-items-end bear-justify-center",children:[e.jsx("div",{className:f.cn("bear-absolute bear-inset-0 bear-bg-black/60 bear-backdrop-blur-sm bear-transition-opacity",c?"bear-opacity-0":"bear-opacity-100"),style:{transitionDuration:`${x}ms`},onClick:y?s:void 0,"aria-hidden":"true"}),e.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":b?"bottom-sheet-title":void 0,className:f.cn("Bear-BottomSheet bear-relative bear-w-full bear-rounded-t-2xl bear-shadow-2xl bear-overflow-hidden bear-transition-transform bear-duration-300","bear-bg-white dark:bear-bg-neutral-900 bear-border-t bear-border-neutral-200 dark:bear-border-neutral-700",S[v],j&&!c?"bear-translate-y-0":"bear-translate-y-full",g),children:[k&&e.jsx("div",{className:"bear-flex bear-justify-center bear-pt-2 bear-pb-1",children:e.jsx("div",{className:"bear-w-12 bear-h-1 bear-rounded-full bear-bg-neutral-300 dark:bear-bg-neutral-600","aria-hidden":!0})}),(b||i)&&e.jsxs("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",children:[b&&e.jsx("h2",{id:"bottom-sheet-title",className:"bear-text-lg bear-font-semibold bear-text-neutral-900 dark:bear-text-white",children:b}),i&&e.jsx("button",{onClick:s,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","aria-label":"Close",children:e.jsx(N.XIcon,{className:"bear-w-5 bear-h-5"})})]}),e.jsx("div",{className:"bear-flex-1 bear-overflow-y-auto bear-p-4 bear-text-neutral-700 dark:bear-text-neutral-300",children:h})]})]});return p.createPortal(w,document.body)};exports.BottomSheet=q;