@forgedevstack/bear 1.2.4 → 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 (107) 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/Card/Card.types.d.ts +1 -2
  24. package/dist/components/Chat/Chat.const.cjs +1 -1
  25. package/dist/components/Chat/Chat.const.d.ts +1 -1
  26. package/dist/components/Chat/Chat.const.js +1 -1
  27. package/dist/components/Chip/Chip.cjs +1 -1
  28. package/dist/components/Chip/Chip.const.cjs +1 -0
  29. package/dist/components/Chip/Chip.const.d.ts +39 -0
  30. package/dist/components/Chip/Chip.const.js +43 -0
  31. package/dist/components/Chip/Chip.js +44 -65
  32. package/dist/components/ChipGroup/ChipGroup.cjs +1 -0
  33. package/dist/components/ChipGroup/ChipGroup.const.cjs +1 -0
  34. package/dist/components/ChipGroup/ChipGroup.const.d.ts +8 -0
  35. package/dist/components/ChipGroup/ChipGroup.const.js +11 -0
  36. package/dist/components/ChipGroup/ChipGroup.d.ts +3 -0
  37. package/dist/components/ChipGroup/ChipGroup.js +41 -0
  38. package/dist/components/ChipGroup/ChipGroup.types.d.ts +9 -0
  39. package/dist/components/ChipGroup/index.d.ts +2 -0
  40. package/dist/components/ColorSwatch/ColorSwatch.cjs +1 -1
  41. package/dist/components/ColorSwatch/ColorSwatch.js +8 -8
  42. package/dist/components/CommandPalette/CommandPalette.cjs +1 -1
  43. package/dist/components/CommandPalette/CommandPalette.js +71 -71
  44. package/dist/components/DiffSquares/DiffSquares.cjs +1 -1
  45. package/dist/components/DiffSquares/DiffSquares.js +11 -11
  46. package/dist/components/Drawer/Drawer.cjs +1 -1
  47. package/dist/components/Drawer/Drawer.js +57 -56
  48. package/dist/components/Input/Input.cjs +1 -1
  49. package/dist/components/Input/Input.js +63 -62
  50. package/dist/components/List/List.cjs +1 -1
  51. package/dist/components/List/List.js +133 -123
  52. package/dist/components/List/List.types.d.ts +2 -0
  53. package/dist/components/MentionsInput/MentionsInput.cjs +1 -1
  54. package/dist/components/MentionsInput/MentionsInput.js +114 -92
  55. package/dist/components/MentionsInput/MentionsInput.types.d.ts +4 -0
  56. package/dist/components/MessageList/MessageList.cjs +1 -0
  57. package/dist/components/MessageList/MessageList.const.cjs +1 -0
  58. package/dist/components/MessageList/MessageList.const.d.ts +29 -0
  59. package/dist/components/MessageList/MessageList.const.js +36 -0
  60. package/dist/components/MessageList/MessageList.d.ts +3 -0
  61. package/dist/components/MessageList/MessageList.js +194 -0
  62. package/dist/components/MessageList/MessageList.types.d.ts +74 -0
  63. package/dist/components/MessageList/MessageList.utils.cjs +1 -0
  64. package/dist/components/MessageList/MessageList.utils.d.ts +13 -0
  65. package/dist/components/MessageList/MessageList.utils.js +54 -0
  66. package/dist/components/MessageList/index.d.ts +2 -0
  67. package/dist/components/Progress/Progress.cjs +1 -1
  68. package/dist/components/Progress/Progress.const.cjs +1 -0
  69. package/dist/components/Progress/Progress.const.d.ts +16 -1
  70. package/dist/components/Progress/Progress.const.js +19 -0
  71. package/dist/components/Progress/Progress.d.ts +0 -10
  72. package/dist/components/Progress/Progress.js +81 -71
  73. package/dist/components/Progress/Progress.types.d.ts +2 -11
  74. package/dist/components/PropsPlayground/PropsPlayground.cjs +1 -1
  75. package/dist/components/PropsPlayground/PropsPlayground.js +40 -40
  76. package/dist/components/Select/Select.cjs +1 -1
  77. package/dist/components/Select/Select.const.cjs +1 -0
  78. package/dist/components/Select/Select.const.d.ts +9 -0
  79. package/dist/components/Select/Select.const.js +13 -0
  80. package/dist/components/Select/Select.js +144 -68
  81. package/dist/components/Stepper/Stepper.cjs +1 -1
  82. package/dist/components/Stepper/Stepper.js +89 -83
  83. package/dist/components/Toast/Toast.cjs +1 -1
  84. package/dist/components/Toast/Toast.const.cjs +1 -0
  85. package/dist/components/Toast/Toast.const.d.ts +4 -0
  86. package/dist/components/Toast/Toast.const.js +17 -0
  87. package/dist/components/Toast/Toast.d.ts +3 -7
  88. package/dist/components/Toast/Toast.js +101 -89
  89. package/dist/components/Toast/Toast.types.d.ts +9 -0
  90. package/dist/components/Toast/index.d.ts +1 -1
  91. package/dist/components/TreeSelect/TreeSelect.cjs +1 -1
  92. package/dist/components/TreeSelect/TreeSelect.js +22 -22
  93. package/dist/components/index.cjs +1 -1
  94. package/dist/components/index.d.ts +7 -1
  95. package/dist/components/index.js +284 -278
  96. package/dist/context/BearProvider.cjs +1 -1
  97. package/dist/context/BearProvider.d.ts +8 -0
  98. package/dist/context/BearProvider.js +149 -139
  99. package/dist/context/index.cjs +1 -1
  100. package/dist/context/index.d.ts +1 -1
  101. package/dist/context/index.js +12 -10
  102. package/dist/index.cjs +1 -1
  103. package/dist/index.js +392 -384
  104. package/dist/styles/_message-list.css +42 -0
  105. package/dist/styles/main.css +1 -0
  106. package/dist/styles.css +114 -19
  107. package/package.json +15 -2
@@ -20,4 +20,8 @@ export interface MentionsInputProps {
20
20
  size?: 'sm' | 'md' | 'lg';
21
21
  fullWidth?: boolean;
22
22
  className?: string;
23
+ /** Render a textarea instead of a single-line input */
24
+ multiline?: boolean;
25
+ /** Visible rows when multiline */
26
+ rows?: number;
23
27
  }
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),n=require("react"),Z=require("../Avatar/Avatar.cjs"),o=require("../Typography/Typography.cjs"),e=require("./MessageList.const.cjs"),A=require("./MessageList.utils.cjs"),t=require("../../utils/cn.cjs"),J=require("../../utils/generateBearId.utils.cjs"),K=require("../../utils/useBearId.cjs"),Q=({id:x,testId:f,messages:c,currentUserId:j,groupWindowMs:B=e.MESSAGE_LIST_GROUP_WINDOW_MS,showDaySeparators:b=!0,showAvatars:H=!0,showTimestamps:G=!0,autoScroll:R=!0,virtualized:$,height:E=e.MESSAGE_LIST_DEFAULT_HEIGHT,renderMessage:L,emptyState:g,formatDayLabel:T,formatTimestamp:I,translations:w,onNewMessagesClick:d,className:U})=>{const D=K.useBearId("MessageList"),P=J.resolveBearId(x,D),a=n.useRef(null),h=n.useRef(!0),O=n.useRef(null),[q,u]=n.useState(!1),[Y,W]=n.useState(0),[F,p]=n.useState(typeof E=="number"?E:e.MESSAGE_LIST_DEFAULT_HEIGHT),M={...e.MESSAGE_LIST_DEFAULT_TRANSLATIONS,...w},r=A.buildMessageListItems(c,j,B,b),V=S=>(T==null?void 0:T(S))??A.getDefaultDayLabel(S,M),m=S=>(I==null?void 0:I(S))??A.getDefaultTimestamp(S),C=$??c.length>=e.MESSAGE_LIST_VIRTUALIZE_THRESHOLD,y=S=>{const _=a.current;_&&_.scrollTo({top:_.scrollHeight,behavior:S?"smooth":"auto"})},k=()=>{const S=a.current;if(!S)return;W(S.scrollTop),p(S.clientHeight);const i=S.scrollHeight-S.scrollTop-S.clientHeight<=e.MESSAGE_LIST_BOTTOM_THRESHOLD_PX;h.current=i,i&&u(!1)};n.useEffect(()=>{const S=a.current;S&&p(S.clientHeight)},[E]),n.useEffect(()=>{const S=c.length>0?c[c.length-1].id:null,_=O.current===null,i=S!==null&&S!==O.current;if(O.current=S,!!i){if(_||R&&h.current){y(!_);return}u(!0)}},[c,R]);const z=()=>{y(!0),u(!1),d==null||d()},X=S=>s.jsxs("div",{className:t.cn(`${e.MESSAGE_LIST_ROOT_CLASS}__group`,e.MESSAGE_LIST_GROUP_CLASSES,S.isOwn&&e.MESSAGE_LIST_GROUP_OWN_CLASSES),children:[H&&!S.isOwn&&s.jsx(Z.Avatar,{src:S.author.avatar,initials:S.author.name[0],size:"sm",className:"bear-flex-shrink-0"}),s.jsxs("div",{className:t.cn(`${e.MESSAGE_LIST_ROOT_CLASS}__group-body`,e.MESSAGE_LIST_GROUP_BODY_CLASSES,S.isOwn&&e.MESSAGE_LIST_GROUP_BODY_OWN_CLASSES),children:[!S.isOwn&&s.jsxs("div",{className:t.cn(`${e.MESSAGE_LIST_ROOT_CLASS}__meta`,e.MESSAGE_LIST_META_CLASSES),children:[s.jsx(o.Typography,{variant:"caption",component:"span",className:t.cn(`${e.MESSAGE_LIST_ROOT_CLASS}__author`,e.MESSAGE_LIST_AUTHOR_CLASSES),children:S.author.name}),G&&s.jsx(o.Typography,{variant:"caption",component:"span",className:t.cn(`${e.MESSAGE_LIST_ROOT_CLASS}__timestamp`,e.MESSAGE_LIST_TIMESTAMP_CLASSES),children:m(S.messages[0].timestamp)})]}),S.messages.map(_=>s.jsx("div",{className:t.cn(`${e.MESSAGE_LIST_ROOT_CLASS}__bubble`,e.MESSAGE_LIST_BUBBLE_CLASSES,S.isOwn&&`${e.MESSAGE_LIST_ROOT_CLASS}__bubble--own`,S.isOwn&&e.MESSAGE_LIST_BUBBLE_OWN_CLASSES),children:(L==null?void 0:L(_))??_.content},_.id)),S.isOwn&&G&&s.jsx(o.Typography,{variant:"caption",component:"span",className:t.cn(`${e.MESSAGE_LIST_ROOT_CLASS}__timestamp`,e.MESSAGE_LIST_TIMESTAMP_CLASSES),children:m(S.messages[S.messages.length-1].timestamp)})]})]},S.key),N=S=>S.kind==="day"?s.jsxs("div",{className:t.cn(`${e.MESSAGE_LIST_ROOT_CLASS}__day-separator`,e.MESSAGE_LIST_DAY_SEPARATOR_CLASSES),children:[s.jsx("span",{className:t.cn(`${e.MESSAGE_LIST_ROOT_CLASS}__day-line`,e.MESSAGE_LIST_DAY_LINE_CLASSES)}),s.jsx("span",{className:t.cn(`${e.MESSAGE_LIST_ROOT_CLASS}__day-label`,e.MESSAGE_LIST_DAY_LABEL_CLASSES),children:V(S.date)}),s.jsx("span",{className:t.cn(`${e.MESSAGE_LIST_ROOT_CLASS}__day-line`,e.MESSAGE_LIST_DAY_LINE_CLASSES)})]},S.key):X(S),l=C?A.getMessageListWindow(r,Y,F,e.MESSAGE_LIST_OVERSCAN):null,v=l===null?r:r.slice(l.startIndex,l.endIndex+1);return s.jsxs("div",{id:P,"data-testid":f,className:t.cn(e.MESSAGE_LIST_ROOT_CLASS,e.MESSAGE_LIST_BASE_CLASSES,U),style:{height:typeof E=="number"?`${E}px`:E},children:[s.jsxs("div",{ref:a,onScroll:k,className:t.cn(`${e.MESSAGE_LIST_ROOT_CLASS}__scroller`,e.MESSAGE_LIST_SCROLLER_CLASSES),role:"log","aria-live":"polite",children:[r.length===0&&s.jsx("div",{className:t.cn(`${e.MESSAGE_LIST_ROOT_CLASS}__empty`,e.MESSAGE_LIST_EMPTY_CLASSES),children:g??s.jsx(o.Typography,{variant:"body2",component:"span",children:M.emptyLabel})}),C&&l?s.jsx("div",{className:`${e.MESSAGE_LIST_ROOT_CLASS}__virtual`,style:{height:l.totalHeight,position:"relative"},children:s.jsx("div",{style:{transform:`translateY(${l.offsetTop}px)`},children:v.map(S=>N(S))})}):v.map(S=>N(S))]}),q&&s.jsx("button",{type:"button",onClick:z,className:t.cn(`${e.MESSAGE_LIST_ROOT_CLASS}__new-messages`,e.MESSAGE_LIST_NEW_MESSAGES_CLASSES),children:M.newMessages})]})};exports.MessageList=Q;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S="Bear-MessageList",E=400,_=300*1e3,e=40,A=1440*60*1e3,L={newMessages:"New messages",today:"Today",yesterday:"Yesterday",emptyLabel:"No messages yet"},T="bear-relative bear-flex bear-flex-col bear-rounded-xl bear-border bear-overflow-hidden",r="bear-flex-1 bear-overflow-y-auto bear-p-4 bear-flex bear-flex-col bear-gap-3",a="bear-flex bear-items-center bear-gap-3 bear-my-1",M="bear-flex-1 bear-h-px",I="bear-text-xs bear-font-medium bear-whitespace-nowrap",t="bear-flex bear-gap-2",G="bear-flex-row-reverse",b="bear-flex bear-flex-col bear-gap-1 bear-min-w-0 bear-flex-1",s="bear-items-end",o="bear-px-4 bear-py-2 bear-rounded-2xl bear-text-sm bear-max-w-[70%] bear-w-fit",n="bear-self-end",O="bear-flex bear-items-baseline bear-gap-2 bear-mb-1",c="bear-text-xs bear-font-semibold",C="bear-text-xs",R="bear-absolute-x-center bear-bottom-4 bear-flex bear-items-center bear-gap-2 bear-px-4 bear-py-2 bear-rounded-full bear-border-none bear-cursor-pointer bear-shadow-lg bear-text-xs bear-font-medium hover:bear-opacity-90",l="bear-flex-1 bear-flex bear-items-center bear-justify-center bear-text-sm",x=40,P=6,B=36,f=56,U=36,D=12;exports.MESSAGE_LIST_AUTHOR_CLASSES=c;exports.MESSAGE_LIST_BASE_CLASSES=T;exports.MESSAGE_LIST_BOTTOM_THRESHOLD_PX=e;exports.MESSAGE_LIST_BUBBLE_CLASSES=o;exports.MESSAGE_LIST_BUBBLE_ESTIMATE_PX=U;exports.MESSAGE_LIST_BUBBLE_OWN_CLASSES=n;exports.MESSAGE_LIST_DAY_ESTIMATE_PX=B;exports.MESSAGE_LIST_DAY_LABEL_CLASSES=I;exports.MESSAGE_LIST_DAY_LINE_CLASSES=M;exports.MESSAGE_LIST_DAY_SEPARATOR_CLASSES=a;exports.MESSAGE_LIST_DEFAULT_HEIGHT=E;exports.MESSAGE_LIST_DEFAULT_TRANSLATIONS=L;exports.MESSAGE_LIST_EMPTY_CLASSES=l;exports.MESSAGE_LIST_GROUP_BASE_ESTIMATE_PX=f;exports.MESSAGE_LIST_GROUP_BODY_CLASSES=b;exports.MESSAGE_LIST_GROUP_BODY_OWN_CLASSES=s;exports.MESSAGE_LIST_GROUP_CLASSES=t;exports.MESSAGE_LIST_GROUP_OWN_CLASSES=G;exports.MESSAGE_LIST_GROUP_WINDOW_MS=_;exports.MESSAGE_LIST_ITEM_GAP_PX=D;exports.MESSAGE_LIST_META_CLASSES=O;exports.MESSAGE_LIST_MS_PER_DAY=A;exports.MESSAGE_LIST_NEW_MESSAGES_CLASSES=R;exports.MESSAGE_LIST_OVERSCAN=P;exports.MESSAGE_LIST_ROOT_CLASS=S;exports.MESSAGE_LIST_SCROLLER_CLASSES=r;exports.MESSAGE_LIST_TIMESTAMP_CLASSES=C;exports.MESSAGE_LIST_VIRTUALIZE_THRESHOLD=x;
@@ -0,0 +1,29 @@
1
+ import { MessageListTranslations } from './MessageList.types';
2
+ export declare const MESSAGE_LIST_ROOT_CLASS = "Bear-MessageList";
3
+ export declare const MESSAGE_LIST_DEFAULT_HEIGHT = 400;
4
+ export declare const MESSAGE_LIST_GROUP_WINDOW_MS: number;
5
+ export declare const MESSAGE_LIST_BOTTOM_THRESHOLD_PX = 40;
6
+ export declare const MESSAGE_LIST_MS_PER_DAY: number;
7
+ export declare const MESSAGE_LIST_DEFAULT_TRANSLATIONS: MessageListTranslations;
8
+ export declare const MESSAGE_LIST_BASE_CLASSES = "bear-relative bear-flex bear-flex-col bear-rounded-xl bear-border bear-overflow-hidden";
9
+ export declare const MESSAGE_LIST_SCROLLER_CLASSES = "bear-flex-1 bear-overflow-y-auto bear-p-4 bear-flex bear-flex-col bear-gap-3";
10
+ export declare const MESSAGE_LIST_DAY_SEPARATOR_CLASSES = "bear-flex bear-items-center bear-gap-3 bear-my-1";
11
+ export declare const MESSAGE_LIST_DAY_LINE_CLASSES = "bear-flex-1 bear-h-px";
12
+ export declare const MESSAGE_LIST_DAY_LABEL_CLASSES = "bear-text-xs bear-font-medium bear-whitespace-nowrap";
13
+ export declare const MESSAGE_LIST_GROUP_CLASSES = "bear-flex bear-gap-2";
14
+ export declare const MESSAGE_LIST_GROUP_OWN_CLASSES = "bear-flex-row-reverse";
15
+ export declare const MESSAGE_LIST_GROUP_BODY_CLASSES = "bear-flex bear-flex-col bear-gap-1 bear-min-w-0 bear-flex-1";
16
+ export declare const MESSAGE_LIST_GROUP_BODY_OWN_CLASSES = "bear-items-end";
17
+ export declare const MESSAGE_LIST_BUBBLE_CLASSES = "bear-px-4 bear-py-2 bear-rounded-2xl bear-text-sm bear-max-w-[70%] bear-w-fit";
18
+ export declare const MESSAGE_LIST_BUBBLE_OWN_CLASSES = "bear-self-end";
19
+ export declare const MESSAGE_LIST_META_CLASSES = "bear-flex bear-items-baseline bear-gap-2 bear-mb-1";
20
+ export declare const MESSAGE_LIST_AUTHOR_CLASSES = "bear-text-xs bear-font-semibold";
21
+ export declare const MESSAGE_LIST_TIMESTAMP_CLASSES = "bear-text-xs";
22
+ export declare const MESSAGE_LIST_NEW_MESSAGES_CLASSES = "bear-absolute-x-center bear-bottom-4 bear-flex bear-items-center bear-gap-2 bear-px-4 bear-py-2 bear-rounded-full bear-border-none bear-cursor-pointer bear-shadow-lg bear-text-xs bear-font-medium hover:bear-opacity-90";
23
+ export declare const MESSAGE_LIST_EMPTY_CLASSES = "bear-flex-1 bear-flex bear-items-center bear-justify-center bear-text-sm";
24
+ export declare const MESSAGE_LIST_VIRTUALIZE_THRESHOLD = 40;
25
+ export declare const MESSAGE_LIST_OVERSCAN = 6;
26
+ export declare const MESSAGE_LIST_DAY_ESTIMATE_PX = 36;
27
+ export declare const MESSAGE_LIST_GROUP_BASE_ESTIMATE_PX = 56;
28
+ export declare const MESSAGE_LIST_BUBBLE_ESTIMATE_PX = 36;
29
+ export declare const MESSAGE_LIST_ITEM_GAP_PX = 12;
@@ -0,0 +1,36 @@
1
+ const S = "Bear-MessageList", e = 400, E = 3e5, _ = 40, r = 864e5, a = {
2
+ newMessages: "New messages",
3
+ today: "Today",
4
+ yesterday: "Yesterday",
5
+ emptyLabel: "No messages yet"
6
+ }, b = "bear-relative bear-flex bear-flex-col bear-rounded-xl bear-border bear-overflow-hidden", t = "bear-flex-1 bear-overflow-y-auto bear-p-4 bear-flex bear-flex-col bear-gap-3", A = "bear-flex bear-items-center bear-gap-3 bear-my-1", s = "bear-flex-1 bear-h-px", L = "bear-text-xs bear-font-medium bear-whitespace-nowrap", o = "bear-flex bear-gap-2", T = "bear-flex-row-reverse", n = "bear-flex bear-flex-col bear-gap-1 bear-min-w-0 bear-flex-1", M = "bear-items-end", c = "bear-px-4 bear-py-2 bear-rounded-2xl bear-text-sm bear-max-w-[70%] bear-w-fit", I = "bear-self-end", G = "bear-flex bear-items-baseline bear-gap-2 bear-mb-1", x = "bear-text-xs bear-font-semibold", l = "bear-text-xs", f = "bear-absolute-x-center bear-bottom-4 bear-flex bear-items-center bear-gap-2 bear-px-4 bear-py-2 bear-rounded-full bear-border-none bear-cursor-pointer bear-shadow-lg bear-text-xs bear-font-medium hover:bear-opacity-90", O = "bear-flex-1 bear-flex bear-items-center bear-justify-center bear-text-sm", d = 40, m = 6, C = 36, i = 56, p = 36, R = 12;
7
+ export {
8
+ x as MESSAGE_LIST_AUTHOR_CLASSES,
9
+ b as MESSAGE_LIST_BASE_CLASSES,
10
+ _ as MESSAGE_LIST_BOTTOM_THRESHOLD_PX,
11
+ c as MESSAGE_LIST_BUBBLE_CLASSES,
12
+ p as MESSAGE_LIST_BUBBLE_ESTIMATE_PX,
13
+ I as MESSAGE_LIST_BUBBLE_OWN_CLASSES,
14
+ C as MESSAGE_LIST_DAY_ESTIMATE_PX,
15
+ L as MESSAGE_LIST_DAY_LABEL_CLASSES,
16
+ s as MESSAGE_LIST_DAY_LINE_CLASSES,
17
+ A as MESSAGE_LIST_DAY_SEPARATOR_CLASSES,
18
+ e as MESSAGE_LIST_DEFAULT_HEIGHT,
19
+ a as MESSAGE_LIST_DEFAULT_TRANSLATIONS,
20
+ O as MESSAGE_LIST_EMPTY_CLASSES,
21
+ i as MESSAGE_LIST_GROUP_BASE_ESTIMATE_PX,
22
+ n as MESSAGE_LIST_GROUP_BODY_CLASSES,
23
+ M as MESSAGE_LIST_GROUP_BODY_OWN_CLASSES,
24
+ o as MESSAGE_LIST_GROUP_CLASSES,
25
+ T as MESSAGE_LIST_GROUP_OWN_CLASSES,
26
+ E as MESSAGE_LIST_GROUP_WINDOW_MS,
27
+ R as MESSAGE_LIST_ITEM_GAP_PX,
28
+ G as MESSAGE_LIST_META_CLASSES,
29
+ r as MESSAGE_LIST_MS_PER_DAY,
30
+ f as MESSAGE_LIST_NEW_MESSAGES_CLASSES,
31
+ m as MESSAGE_LIST_OVERSCAN,
32
+ S as MESSAGE_LIST_ROOT_CLASS,
33
+ t as MESSAGE_LIST_SCROLLER_CLASSES,
34
+ l as MESSAGE_LIST_TIMESTAMP_CLASSES,
35
+ d as MESSAGE_LIST_VIRTUALIZE_THRESHOLD
36
+ };
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ import { MessageListProps } from './MessageList.types';
3
+ export declare const MessageList: FC<MessageListProps>;
@@ -0,0 +1,194 @@
1
+ import { jsxs as o, jsx as S } from "react/jsx-runtime";
2
+ import { useRef as u, useState as h, useEffect as b } from "react";
3
+ import { Avatar as et } from "../Avatar/Avatar.js";
4
+ import { Typography as E } from "../Typography/Typography.js";
5
+ import { MESSAGE_LIST_DEFAULT_HEIGHT as y, MESSAGE_LIST_VIRTUALIZE_THRESHOLD as st, MESSAGE_LIST_DEFAULT_TRANSLATIONS as St, MESSAGE_LIST_EMPTY_CLASSES as nt, MESSAGE_LIST_ROOT_CLASS as e, MESSAGE_LIST_SCROLLER_CLASSES as lt, MESSAGE_LIST_NEW_MESSAGES_CLASSES as _t, MESSAGE_LIST_BASE_CLASSES as rt, MESSAGE_LIST_GROUP_WINDOW_MS as ot, MESSAGE_LIST_OVERSCAN as at, MESSAGE_LIST_DAY_LINE_CLASSES as C, MESSAGE_LIST_DAY_LABEL_CLASSES as ct, MESSAGE_LIST_DAY_SEPARATOR_CLASSES as it, MESSAGE_LIST_BOTTOM_THRESHOLD_PX as Et, MESSAGE_LIST_AUTHOR_CLASSES as At, MESSAGE_LIST_TIMESTAMP_CLASSES as H, MESSAGE_LIST_META_CLASSES as dt, MESSAGE_LIST_BUBBLE_OWN_CLASSES as Lt, MESSAGE_LIST_BUBBLE_CLASSES as mt, MESSAGE_LIST_GROUP_BODY_OWN_CLASSES as Tt, MESSAGE_LIST_GROUP_BODY_CLASSES as It, MESSAGE_LIST_GROUP_OWN_CLASSES as pt, MESSAGE_LIST_GROUP_CLASSES as ut } from "./MessageList.const.js";
6
+ import { buildMessageListItems as ht, getMessageListWindow as Gt, getDefaultDayLabel as Mt, getDefaultTimestamp as Ot } from "./MessageList.utils.js";
7
+ import { cn as s } from "../../utils/cn.js";
8
+ import { resolveBearId as ft } from "../../utils/generateBearId.utils.js";
9
+ import { useBearId as Nt } from "../../utils/useBearId.js";
10
+ const Ut = ({
11
+ id: w,
12
+ testId: U,
13
+ messages: l,
14
+ currentUserId: D,
15
+ groupWindowMs: P = ot,
16
+ showDaySeparators: x = !0,
17
+ showAvatars: W = !0,
18
+ showTimestamps: G = !0,
19
+ autoScroll: M = !0,
20
+ virtualized: Y,
21
+ height: _ = y,
22
+ renderMessage: A,
23
+ emptyState: F,
24
+ formatDayLabel: d,
25
+ formatTimestamp: L,
26
+ translations: g,
27
+ onNewMessagesClick: m,
28
+ className: V
29
+ }) => {
30
+ const j = Nt("MessageList"), k = ft(w, j), a = u(null), O = u(!0), T = u(null), [z, I] = h(!1), [X, Z] = h(0), [q, f] = h(
31
+ typeof _ == "number" ? _ : y
32
+ ), p = { ...St, ...g }, c = ht(l, D, P, x), J = (t) => (d == null ? void 0 : d(t)) ?? Mt(t, p), N = (t) => (L == null ? void 0 : L(t)) ?? Ot(t), v = Y ?? l.length >= st, R = (t) => {
33
+ const n = a.current;
34
+ n && n.scrollTo({ top: n.scrollHeight, behavior: t ? "smooth" : "auto" });
35
+ }, K = () => {
36
+ const t = a.current;
37
+ if (!t) return;
38
+ Z(t.scrollTop), f(t.clientHeight);
39
+ const i = t.scrollHeight - t.scrollTop - t.clientHeight <= Et;
40
+ O.current = i, i && I(!1);
41
+ };
42
+ b(() => {
43
+ const t = a.current;
44
+ t && f(t.clientHeight);
45
+ }, [_]), b(() => {
46
+ const t = l.length > 0 ? l[l.length - 1].id : null, n = T.current === null, i = t !== null && t !== T.current;
47
+ if (T.current = t, !!i) {
48
+ if (n || M && O.current) {
49
+ R(!n);
50
+ return;
51
+ }
52
+ I(!0);
53
+ }
54
+ }, [l, M]);
55
+ const Q = () => {
56
+ R(!0), I(!1), m == null || m();
57
+ }, tt = (t) => /* @__PURE__ */ o(
58
+ "div",
59
+ {
60
+ className: s(
61
+ `${e}__group`,
62
+ ut,
63
+ t.isOwn && pt
64
+ ),
65
+ children: [
66
+ W && !t.isOwn && /* @__PURE__ */ S(
67
+ et,
68
+ {
69
+ src: t.author.avatar,
70
+ initials: t.author.name[0],
71
+ size: "sm",
72
+ className: "bear-flex-shrink-0"
73
+ }
74
+ ),
75
+ /* @__PURE__ */ o(
76
+ "div",
77
+ {
78
+ className: s(
79
+ `${e}__group-body`,
80
+ It,
81
+ t.isOwn && Tt
82
+ ),
83
+ children: [
84
+ !t.isOwn && /* @__PURE__ */ o("div", { className: s(`${e}__meta`, dt), children: [
85
+ /* @__PURE__ */ S(
86
+ E,
87
+ {
88
+ variant: "caption",
89
+ component: "span",
90
+ className: s(`${e}__author`, At),
91
+ children: t.author.name
92
+ }
93
+ ),
94
+ G && /* @__PURE__ */ S(
95
+ E,
96
+ {
97
+ variant: "caption",
98
+ component: "span",
99
+ className: s(`${e}__timestamp`, H),
100
+ children: N(t.messages[0].timestamp)
101
+ }
102
+ )
103
+ ] }),
104
+ t.messages.map((n) => /* @__PURE__ */ S(
105
+ "div",
106
+ {
107
+ className: s(
108
+ `${e}__bubble`,
109
+ mt,
110
+ t.isOwn && `${e}__bubble--own`,
111
+ t.isOwn && Lt
112
+ ),
113
+ children: (A == null ? void 0 : A(n)) ?? n.content
114
+ },
115
+ n.id
116
+ )),
117
+ t.isOwn && G && /* @__PURE__ */ S(
118
+ E,
119
+ {
120
+ variant: "caption",
121
+ component: "span",
122
+ className: s(`${e}__timestamp`, H),
123
+ children: N(t.messages[t.messages.length - 1].timestamp)
124
+ }
125
+ )
126
+ ]
127
+ }
128
+ )
129
+ ]
130
+ },
131
+ t.key
132
+ ), B = (t) => t.kind === "day" ? /* @__PURE__ */ o(
133
+ "div",
134
+ {
135
+ className: s(
136
+ `${e}__day-separator`,
137
+ it
138
+ ),
139
+ children: [
140
+ /* @__PURE__ */ S("span", { className: s(`${e}__day-line`, C) }),
141
+ /* @__PURE__ */ S("span", { className: s(`${e}__day-label`, ct), children: J(t.date) }),
142
+ /* @__PURE__ */ S("span", { className: s(`${e}__day-line`, C) })
143
+ ]
144
+ },
145
+ t.key
146
+ ) : tt(t), r = v ? Gt(c, X, q, at) : null, $ = r === null ? c : c.slice(r.startIndex, r.endIndex + 1);
147
+ return /* @__PURE__ */ o(
148
+ "div",
149
+ {
150
+ id: k,
151
+ "data-testid": U,
152
+ className: s(e, rt, V),
153
+ style: { height: typeof _ == "number" ? `${_}px` : _ },
154
+ children: [
155
+ /* @__PURE__ */ o(
156
+ "div",
157
+ {
158
+ ref: a,
159
+ onScroll: K,
160
+ className: s(`${e}__scroller`, lt),
161
+ role: "log",
162
+ "aria-live": "polite",
163
+ children: [
164
+ c.length === 0 && /* @__PURE__ */ S("div", { className: s(`${e}__empty`, nt), children: F ?? /* @__PURE__ */ S(E, { variant: "body2", component: "span", children: p.emptyLabel }) }),
165
+ v && r ? /* @__PURE__ */ S(
166
+ "div",
167
+ {
168
+ className: `${e}__virtual`,
169
+ style: { height: r.totalHeight, position: "relative" },
170
+ children: /* @__PURE__ */ S("div", { style: { transform: `translateY(${r.offsetTop}px)` }, children: $.map((t) => B(t)) })
171
+ }
172
+ ) : $.map((t) => B(t))
173
+ ]
174
+ }
175
+ ),
176
+ z && /* @__PURE__ */ S(
177
+ "button",
178
+ {
179
+ type: "button",
180
+ onClick: Q,
181
+ className: s(
182
+ `${e}__new-messages`,
183
+ _t
184
+ ),
185
+ children: p.newMessages
186
+ }
187
+ )
188
+ ]
189
+ }
190
+ );
191
+ };
192
+ export {
193
+ Ut as MessageList
194
+ };
@@ -0,0 +1,74 @@
1
+ import { ReactNode } from 'react';
2
+ export interface MessageListAuthor {
3
+ /** Unique author identifier — used for consecutive message grouping */
4
+ id: string;
5
+ /** Display name */
6
+ name: string;
7
+ /** Avatar image URL */
8
+ avatar?: string;
9
+ }
10
+ export interface MessageListMessage {
11
+ /** Unique message identifier */
12
+ id: string;
13
+ /** Message author */
14
+ author: MessageListAuthor;
15
+ /** Message content */
16
+ content: ReactNode;
17
+ /** Message timestamp — required for grouping and day separators */
18
+ timestamp: Date;
19
+ }
20
+ export interface MessageListTranslations {
21
+ newMessages: string;
22
+ today: string;
23
+ yesterday: string;
24
+ emptyLabel: string;
25
+ }
26
+ export interface MessageListDayItem {
27
+ kind: 'day';
28
+ key: string;
29
+ date: Date;
30
+ }
31
+ export interface MessageListGroupItem {
32
+ kind: 'group';
33
+ key: string;
34
+ author: MessageListAuthor;
35
+ isOwn: boolean;
36
+ messages: MessageListMessage[];
37
+ }
38
+ export type MessageListItem = MessageListDayItem | MessageListGroupItem;
39
+ export interface MessageListProps {
40
+ id?: string;
41
+ testId?: string;
42
+ /** Messages in chronological order (oldest first) */
43
+ messages: MessageListMessage[];
44
+ /** Author id whose messages are aligned right as "own" messages */
45
+ currentUserId?: string;
46
+ /** Max gap in ms between consecutive messages of the same author to stay in one group */
47
+ groupWindowMs?: number;
48
+ /** Show day separator rows between messages of different days */
49
+ showDaySeparators?: boolean;
50
+ /** Show author avatars */
51
+ showAvatars?: boolean;
52
+ /** Show group timestamps */
53
+ showTimestamps?: boolean;
54
+ /** Auto-scroll to bottom on new messages when already at the bottom */
55
+ autoScroll?: boolean;
56
+ /** Enable windowed rendering for long conversations (auto when message count exceeds threshold) */
57
+ virtualized?: boolean;
58
+ /** Height of the scrollable area */
59
+ height?: number | string;
60
+ /** Custom message content renderer */
61
+ renderMessage?: (message: MessageListMessage) => ReactNode;
62
+ /** Content rendered when there are no messages */
63
+ emptyState?: ReactNode;
64
+ /** Custom day separator label formatter */
65
+ formatDayLabel?: (date: Date) => string;
66
+ /** Custom timestamp formatter */
67
+ formatTimestamp?: (date: Date) => string;
68
+ /** Replaceable user-facing strings */
69
+ translations?: Partial<MessageListTranslations>;
70
+ /** Callback when the "new messages" affordance is clicked */
71
+ onNewMessagesClick?: () => void;
72
+ /** Additional CSS class */
73
+ className?: string;
74
+ }
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./MessageList.const.cjs"),S=(e,i)=>e.getFullYear()===i.getFullYear()&&e.getMonth()===i.getMonth()&&e.getDate()===i.getDate(),h=e=>`${e.getFullYear()}-${e.getMonth()}-${e.getDate()}`,M=(e,i)=>{const o=new Date;if(S(e,o))return i.today;const r=new Date(o.getTime()-l.MESSAGE_LIST_MS_PER_DAY);return S(e,r)?i.yesterday:e.toLocaleDateString([],{year:"numeric",month:"long",day:"numeric"})},y=e=>e.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),E=(e,i,o,r)=>{const t=[];let u=null;for(const s of e){const m=u===null||!S(u,s.timestamp);r&&m&&t.push({kind:"day",key:`day-${h(s.timestamp)}`,date:s.timestamp});const a=t[t.length-1],g=a!==void 0&&a.kind==="group"&&a.author.id===s.author.id&&s.timestamp.getTime()-a.messages[a.messages.length-1].timestamp.getTime()<=o;a!==void 0&&a.kind==="group"&&g?a.messages.push(s):t.push({kind:"group",key:`group-${s.id}`,author:s.author,isOwn:s.author.id===i,messages:[s]}),u=s.timestamp}return t},_=e=>e.kind==="day"?l.MESSAGE_LIST_DAY_ESTIMATE_PX+l.MESSAGE_LIST_ITEM_GAP_PX:l.MESSAGE_LIST_GROUP_BASE_ESTIMATE_PX+e.messages.length*l.MESSAGE_LIST_BUBBLE_ESTIMATE_PX+l.MESSAGE_LIST_ITEM_GAP_PX,T=(e,i,o,r)=>{const t=e.map(_),u=t.reduce((n,c)=>n+c,0);let s=0,m=0;for(let n=0;n<t.length;n+=1){if(s+t[n]>i){m=Math.max(0,n-r);break}s+=t[n]}let a=0;for(let n=0;n<m;n+=1)a+=t[n];let g=m,d=a;for(;g<t.length&&d<i+o;)d+=t[g],g+=1;return g=Math.min(t.length-1,g+r),{startIndex:m,endIndex:g,offsetTop:a,totalHeight:u}};exports.buildMessageListItems=E;exports.estimateMessageListItemHeight=_;exports.getDayKey=h;exports.getDefaultDayLabel=M;exports.getDefaultTimestamp=y;exports.getMessageListWindow=T;exports.isSameDay=S;
@@ -0,0 +1,13 @@
1
+ import { MessageListItem, MessageListMessage, MessageListTranslations } from './MessageList.types';
2
+ export declare const isSameDay: (a: Date, b: Date) => boolean;
3
+ export declare const getDayKey: (date: Date) => string;
4
+ export declare const getDefaultDayLabel: (date: Date, translations: MessageListTranslations) => string;
5
+ export declare const getDefaultTimestamp: (date: Date) => string;
6
+ export declare const buildMessageListItems: (messages: MessageListMessage[], currentUserId: string | undefined, groupWindowMs: number, showDaySeparators: boolean) => MessageListItem[];
7
+ export declare const estimateMessageListItemHeight: (item: MessageListItem) => number;
8
+ export declare const getMessageListWindow: (items: MessageListItem[], scrollTop: number, viewportHeight: number, overscan: number) => {
9
+ startIndex: number;
10
+ endIndex: number;
11
+ offsetTop: number;
12
+ totalHeight: number;
13
+ };
@@ -0,0 +1,54 @@
1
+ import { MESSAGE_LIST_DAY_ESTIMATE_PX as c, MESSAGE_LIST_ITEM_GAP_PX as d, MESSAGE_LIST_GROUP_BASE_ESTIMATE_PX as _, MESSAGE_LIST_BUBBLE_ESTIMATE_PX as E, MESSAGE_LIST_MS_PER_DAY as p } from "./MessageList.const.js";
2
+ const u = (e, a) => e.getFullYear() === a.getFullYear() && e.getMonth() === a.getMonth() && e.getDate() === a.getDate(), M = (e) => `${e.getFullYear()}-${e.getMonth()}-${e.getDate()}`, T = (e, a) => {
3
+ const g = /* @__PURE__ */ new Date();
4
+ if (u(e, g))
5
+ return a.today;
6
+ const r = new Date(g.getTime() - p);
7
+ return u(e, r) ? a.yesterday : e.toLocaleDateString([], { year: "numeric", month: "long", day: "numeric" });
8
+ }, D = (e) => e.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }), I = (e, a, g, r) => {
9
+ const t = [];
10
+ let l = null;
11
+ for (const s of e) {
12
+ const m = l === null || !u(l, s.timestamp);
13
+ r && m && t.push({
14
+ kind: "day",
15
+ key: `day-${M(s.timestamp)}`,
16
+ date: s.timestamp
17
+ });
18
+ const n = t[t.length - 1], o = n !== void 0 && n.kind === "group" && n.author.id === s.author.id && s.timestamp.getTime() - n.messages[n.messages.length - 1].timestamp.getTime() <= g;
19
+ n !== void 0 && n.kind === "group" && o ? n.messages.push(s) : t.push({
20
+ kind: "group",
21
+ key: `group-${s.id}`,
22
+ author: s.author,
23
+ isOwn: s.author.id === a,
24
+ messages: [s]
25
+ }), l = s.timestamp;
26
+ }
27
+ return t;
28
+ }, f = (e) => e.kind === "day" ? c + d : _ + e.messages.length * E + d, A = (e, a, g, r) => {
29
+ const t = e.map(f), l = t.reduce((i, S) => i + S, 0);
30
+ let s = 0, m = 0;
31
+ for (let i = 0; i < t.length; i += 1) {
32
+ if (s + t[i] > a) {
33
+ m = Math.max(0, i - r);
34
+ break;
35
+ }
36
+ s += t[i];
37
+ }
38
+ let n = 0;
39
+ for (let i = 0; i < m; i += 1)
40
+ n += t[i];
41
+ let o = m, h = n;
42
+ for (; o < t.length && h < a + g; )
43
+ h += t[o], o += 1;
44
+ return o = Math.min(t.length - 1, o + r), { startIndex: m, endIndex: o, offsetTop: n, totalHeight: l };
45
+ };
46
+ export {
47
+ I as buildMessageListItems,
48
+ f as estimateMessageListItemHeight,
49
+ M as getDayKey,
50
+ T as getDefaultDayLabel,
51
+ D as getDefaultTimestamp,
52
+ A as getMessageListWindow,
53
+ u as isSameDay
54
+ };
@@ -0,0 +1,2 @@
1
+ export { MessageList } from './MessageList';
2
+ export type { MessageListProps, MessageListMessage, MessageListAuthor, MessageListTranslations, MessageListItem, MessageListDayItem, MessageListGroupItem, } from './MessageList.types';
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("../../utils/cn.cjs");require("react");const m={sm:"bear-h-1.5",md:"bear-h-2.5",lg:"bear-h-4"},f={default:"bear-bg-bear-500",success:"bear-bg-green-500",warning:"bear-bg-amber-500",danger:"bear-bg-red-500",info:"bear-bg-blue-500"},x=({value:b,max:n=100,size:l="md",color:o="default",showLabel:i=!1,labelPosition:d="outside",striped:r=!1,animated:c=!1,indeterminate:a=!1,className:g,testId:u})=>{const s=Math.min(100,Math.max(0,b/n*100));return e.jsxs("div",{className:t.cn("bear-w-full",g),"data-testid":u,children:[i&&d==="outside"&&e.jsxs("div",{className:"bear-flex bear-justify-between bear-mb-1",children:[e.jsx("span",{className:"bear-text-sm bear-font-medium bear-text-gray-700 dark:bear-text-gray-200",children:"Progress"}),e.jsxs("span",{className:"bear-text-sm bear-font-medium bear-text-gray-700 dark:bear-text-gray-200",children:[Math.round(s),"%"]})]}),e.jsx("div",{className:t.cn("bear-w-full bear-bg-gray-200 dark:bear-bg-gray-700 bear-rounded-full bear-overflow-hidden",m[l]),children:e.jsx("div",{className:t.cn("bear-h-full bear-rounded-full bear-transition-all bear-duration-300 bear-ease-out","bear-flex bear-items-center bear-justify-center",f[o],r&&"bear-bg-stripes",c&&"bear-animate-stripes",a&&"bear-animate-indeterminate"),style:{width:a?"50%":`${s}%`,backgroundSize:r?"1rem 1rem":void 0,backgroundImage:r?"linear-gradient(45deg, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent)":void 0},role:"progressbar","aria-valuenow":a?void 0:b,"aria-valuemin":0,"aria-valuemax":n,children:i&&d==="inside"&&l==="lg"&&!a&&e.jsxs("span",{className:"bear-text-xs bear-font-medium bear-text-white",children:[Math.round(s),"%"]})})})]})};exports.Progress=x;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),e=require("./Progress.const.cjs"),s=require("../../utils/cn.cjs");require("react");const E=require("../../utils/generateBearId.utils.cjs"),P=require("../../utils/useBearId.cjs"),v=m=>{const{id:_,value:l,max:n=100,bufferValue:d,size:b="md",color:R="default",showLabel:o=!1,label:u=e.PROGRESS_DEFAULT_LABEL,labelPosition:S="outside",striped:i=!1,animated:g=!1,indeterminate:r=!1,className:x,testId:f}=m,O=P.useBearId("Progress"),h=E.resolveBearId(_,O),t=Math.min(100,Math.max(0,l/n*100)),c=d==null?null:Math.min(100,Math.max(t,Math.max(0,d/n*100)));return a.jsxs("div",{id:h,className:s.cn(e.PROGRESS_ROOT_CLASS,"bear-w-full",x),"data-testid":f,children:[o&&S==="outside"&&a.jsxs("div",{className:`${e.PROGRESS_ROOT_CLASS}__label-row bear-flex bear-justify-between bear-mb-1`,children:[a.jsx("span",{className:"bear-text-sm bear-font-medium bear-text-gray-700 dark:bear-text-gray-200",children:u}),a.jsxs("span",{className:"bear-text-sm bear-font-medium bear-text-gray-700 dark:bear-text-gray-200",children:[Math.round(t),"%"]})]}),a.jsxs("div",{className:s.cn(`${e.PROGRESS_ROOT_CLASS}__track`,e.PROGRESS_TRACK_CLASSES,e.PROGRESS_SIZE_CLASSES[b]),children:[c!=null&&!r&&a.jsx("div",{className:s.cn(`${e.PROGRESS_ROOT_CLASS}__buffer`,"bear-absolute bear-inset-y-0 bear-left-0 bear-rounded-full",e.PROGRESS_BUFFER_CLASSES),style:{width:`${c}%`}}),a.jsx("div",{className:s.cn(`${e.PROGRESS_ROOT_CLASS}__bar`,"bear-relative bear-h-full bear-rounded-full bear-transition-all bear-duration-300 bear-ease-out","bear-flex bear-items-center bear-justify-center",e.PROGRESS_COLOR_CLASSES[R],i&&"bear-bg-stripes",g&&"bear-animate-stripes",r&&"bear-animate-indeterminate"),style:{width:r?"50%":`${t}%`,backgroundSize:i?"1rem 1rem":void 0,backgroundImage:i?"linear-gradient(45deg, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent)":void 0},role:"progressbar","aria-valuenow":r?void 0:l,"aria-valuemin":0,"aria-valuemax":n,"aria-label":u,children:o&&S==="inside"&&b==="lg"&&!r&&a.jsxs("span",{className:"bear-text-xs bear-font-medium bear-text-white",children:[Math.round(t),"%"]})})]})]})};exports.Progress=v;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S="Bear-Progress",e={sm:"bear-h-1.5",md:"bear-h-2.5",lg:"bear-h-4"},r={default:"bear-bg-bear-500",success:"bear-bg-green-500",warning:"bear-bg-amber-500",danger:"bear-bg-red-500",info:"bear-bg-blue-500"},b="bear-bg-bear-500/30 dark:bear-bg-bear-400/25",R="bear-w-full bear-bg-gray-200 dark:bear-bg-gray-700 bear-rounded-full bear-overflow-hidden bear-relative",a="Progress";exports.PROGRESS_BUFFER_CLASSES=b;exports.PROGRESS_COLOR_CLASSES=r;exports.PROGRESS_DEFAULT_LABEL=a;exports.PROGRESS_ROOT_CLASS=S;exports.PROGRESS_SIZE_CLASSES=e;exports.PROGRESS_TRACK_CLASSES=R;
@@ -1 +1,16 @@
1
- export declare const P_R_O_G_R_E_S_S_ROOT_CLASS = "Bear-Progress";
1
+ export declare const PROGRESS_ROOT_CLASS = "Bear-Progress";
2
+ export declare const PROGRESS_SIZE_CLASSES: {
3
+ readonly sm: "bear-h-1.5";
4
+ readonly md: "bear-h-2.5";
5
+ readonly lg: "bear-h-4";
6
+ };
7
+ export declare const PROGRESS_COLOR_CLASSES: {
8
+ readonly default: "bear-bg-bear-500";
9
+ readonly success: "bear-bg-green-500";
10
+ readonly warning: "bear-bg-amber-500";
11
+ readonly danger: "bear-bg-red-500";
12
+ readonly info: "bear-bg-blue-500";
13
+ };
14
+ export declare const PROGRESS_BUFFER_CLASSES = "bear-bg-bear-500/30 dark:bear-bg-bear-400/25";
15
+ export declare const PROGRESS_TRACK_CLASSES = "bear-w-full bear-bg-gray-200 dark:bear-bg-gray-700 bear-rounded-full bear-overflow-hidden bear-relative";
16
+ export declare const PROGRESS_DEFAULT_LABEL = "Progress";
@@ -0,0 +1,19 @@
1
+ const r = "Bear-Progress", e = {
2
+ sm: "bear-h-1.5",
3
+ md: "bear-h-2.5",
4
+ lg: "bear-h-4"
5
+ }, b = {
6
+ default: "bear-bg-bear-500",
7
+ success: "bear-bg-green-500",
8
+ warning: "bear-bg-amber-500",
9
+ danger: "bear-bg-red-500",
10
+ info: "bear-bg-blue-500"
11
+ }, a = "bear-bg-bear-500/30 dark:bear-bg-bear-400/25", S = "bear-w-full bear-bg-gray-200 dark:bear-bg-gray-700 bear-rounded-full bear-overflow-hidden bear-relative", g = "Progress";
12
+ export {
13
+ a as PROGRESS_BUFFER_CLASSES,
14
+ b as PROGRESS_COLOR_CLASSES,
15
+ g as PROGRESS_DEFAULT_LABEL,
16
+ r as PROGRESS_ROOT_CLASS,
17
+ e as PROGRESS_SIZE_CLASSES,
18
+ S as PROGRESS_TRACK_CLASSES
19
+ };
@@ -1,13 +1,3 @@
1
1
  import { FC } from 'react';
2
2
  import { ProgressProps } from './Progress.types';
3
- /**
4
- * Progress - Progress bar with multiple variants
5
- *
6
- * @example
7
- * ```tsx
8
- * <Progress value={75} showLabel />
9
- * <Progress value={50} color="success" striped animated />
10
- * <Progress indeterminate />
11
- * ```
12
- */
13
3
  export declare const Progress: FC<ProgressProps>;