@forgedevstack/bear 1.2.5 → 1.2.7

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 (148) hide show
  1. package/README.md +20 -1
  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 +66 -42
  7. package/dist/components/AppBar/AppBar.types.d.ts +9 -3
  8. package/dist/components/Autocomplete/Autocomplete.cjs +1 -1
  9. package/dist/components/Autocomplete/Autocomplete.js +32 -32
  10. package/dist/components/Backdrop/Backdrop.cjs +1 -0
  11. package/dist/components/Backdrop/Backdrop.const.cjs +1 -0
  12. package/dist/components/Backdrop/Backdrop.const.d.ts +8 -0
  13. package/dist/components/Backdrop/Backdrop.const.js +11 -0
  14. package/dist/components/Backdrop/Backdrop.d.ts +3 -0
  15. package/dist/components/Backdrop/Backdrop.js +50 -0
  16. package/dist/components/Backdrop/Backdrop.types.d.ts +14 -0
  17. package/dist/components/Backdrop/index.d.ts +2 -0
  18. package/dist/components/BottomNavigation/BottomNavigation.cjs +1 -1
  19. package/dist/components/BottomNavigation/BottomNavigation.const.cjs +1 -0
  20. package/dist/components/BottomNavigation/BottomNavigation.const.d.ts +8 -1
  21. package/dist/components/BottomNavigation/BottomNavigation.const.js +11 -0
  22. package/dist/components/BottomNavigation/BottomNavigation.js +64 -46
  23. package/dist/components/Breadcrumbs/Breadcrumbs.cjs +1 -1
  24. package/dist/components/Breadcrumbs/Breadcrumbs.js +65 -64
  25. package/dist/components/Button/Button.cjs +1 -1
  26. package/dist/components/Button/Button.js +48 -48
  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 +49 -0
  30. package/dist/components/Chip/Chip.const.js +53 -0
  31. package/dist/components/Chip/Chip.js +46 -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 +11 -0
  35. package/dist/components/ChipGroup/ChipGroup.const.js +14 -0
  36. package/dist/components/ChipGroup/ChipGroup.d.ts +3 -0
  37. package/dist/components/ChipGroup/ChipGroup.js +95 -0
  38. package/dist/components/ChipGroup/ChipGroup.types.d.ts +14 -0
  39. package/dist/components/ChipGroup/index.d.ts +2 -0
  40. package/dist/components/Drawer/Drawer.cjs +1 -1
  41. package/dist/components/Drawer/Drawer.js +68 -64
  42. package/dist/components/EmptyState/EmptyState.cjs +1 -1
  43. package/dist/components/EmptyState/EmptyState.const.cjs +1 -0
  44. package/dist/components/EmptyState/EmptyState.const.d.ts +26 -1
  45. package/dist/components/EmptyState/EmptyState.const.js +29 -0
  46. package/dist/components/EmptyState/EmptyState.js +49 -31
  47. package/dist/components/Input/Input.cjs +1 -1
  48. package/dist/components/Input/Input.const.cjs +1 -1
  49. package/dist/components/Input/Input.const.d.ts +10 -0
  50. package/dist/components/Input/Input.const.js +16 -6
  51. package/dist/components/Input/Input.js +108 -107
  52. package/dist/components/List/List.cjs +1 -1
  53. package/dist/components/List/List.js +133 -123
  54. package/dist/components/List/List.types.d.ts +2 -0
  55. package/dist/components/MessageList/MessageList.cjs +1 -1
  56. package/dist/components/MessageList/MessageList.const.cjs +1 -1
  57. package/dist/components/MessageList/MessageList.const.d.ts +6 -0
  58. package/dist/components/MessageList/MessageList.const.js +26 -20
  59. package/dist/components/MessageList/MessageList.d.ts +0 -16
  60. package/dist/components/MessageList/MessageList.js +133 -115
  61. package/dist/components/MessageList/MessageList.types.d.ts +4 -0
  62. package/dist/components/MessageList/MessageList.utils.cjs +1 -1
  63. package/dist/components/MessageList/MessageList.utils.d.ts +7 -0
  64. package/dist/components/MessageList/MessageList.utils.js +47 -28
  65. package/dist/components/Modal/Modal.cjs +1 -1
  66. package/dist/components/Modal/Modal.const.cjs +1 -1
  67. package/dist/components/Modal/Modal.const.js +7 -8
  68. package/dist/components/Modal/Modal.js +60 -55
  69. package/dist/components/PageHeader/PageHeader.cjs +1 -0
  70. package/dist/components/PageHeader/PageHeader.const.cjs +1 -0
  71. package/dist/components/PageHeader/PageHeader.const.d.ts +6 -0
  72. package/dist/components/PageHeader/PageHeader.const.js +9 -0
  73. package/dist/components/PageHeader/PageHeader.d.ts +3 -0
  74. package/dist/components/PageHeader/PageHeader.js +57 -0
  75. package/dist/components/PageHeader/PageHeader.types.d.ts +10 -0
  76. package/dist/components/PageHeader/index.d.ts +2 -0
  77. package/dist/components/Progress/Progress.cjs +1 -1
  78. package/dist/components/Progress/Progress.const.cjs +1 -0
  79. package/dist/components/Progress/Progress.const.d.ts +16 -1
  80. package/dist/components/Progress/Progress.const.js +19 -0
  81. package/dist/components/Progress/Progress.d.ts +0 -10
  82. package/dist/components/Progress/Progress.js +81 -71
  83. package/dist/components/Progress/Progress.types.d.ts +2 -11
  84. package/dist/components/PropsPlayground/PropsPlayground.cjs +1 -1
  85. package/dist/components/PropsPlayground/PropsPlayground.js +40 -40
  86. package/dist/components/Select/Select.cjs +1 -1
  87. package/dist/components/Select/Select.const.cjs +1 -0
  88. package/dist/components/Select/Select.const.d.ts +9 -0
  89. package/dist/components/Select/Select.const.js +13 -0
  90. package/dist/components/Select/Select.js +151 -66
  91. package/dist/components/Select/Select.types.d.ts +3 -1
  92. package/dist/components/Snackbar/Snackbar.cjs +1 -1
  93. package/dist/components/Snackbar/Snackbar.js +62 -60
  94. package/dist/components/Snackbar/Snackbar.types.d.ts +2 -0
  95. package/dist/components/Stepper/Stepper.cjs +1 -1
  96. package/dist/components/Stepper/Stepper.js +89 -83
  97. package/dist/components/Tabs/Tabs.cjs +1 -1
  98. package/dist/components/Tabs/Tabs.const.cjs +1 -0
  99. package/dist/components/Tabs/Tabs.const.d.ts +2 -0
  100. package/dist/components/Tabs/Tabs.const.js +5 -0
  101. package/dist/components/Tabs/Tabs.js +40 -35
  102. package/dist/components/Tabs/Tabs.types.d.ts +1 -0
  103. package/dist/components/Toast/Toast.cjs +1 -1
  104. package/dist/components/Toast/Toast.const.cjs +1 -0
  105. package/dist/components/Toast/Toast.const.d.ts +4 -0
  106. package/dist/components/Toast/Toast.const.js +9 -0
  107. package/dist/components/Toast/Toast.d.ts +0 -1
  108. package/dist/components/Toast/Toast.js +111 -101
  109. package/dist/components/index.cjs +1 -1
  110. package/dist/components/index.d.ts +6 -0
  111. package/dist/components/index.js +285 -279
  112. package/dist/context/BearProvider.cjs +1 -1
  113. package/dist/context/BearProvider.d.ts +8 -0
  114. package/dist/context/BearProvider.js +149 -139
  115. package/dist/context/index.cjs +1 -1
  116. package/dist/context/index.d.ts +1 -1
  117. package/dist/context/index.js +12 -10
  118. package/dist/hooks/index.cjs +1 -1
  119. package/dist/hooks/index.d.ts +3 -0
  120. package/dist/hooks/index.js +45 -41
  121. package/dist/hooks/useBreakpoint/index.d.ts +4 -0
  122. package/dist/hooks/useBreakpoint/useBreakpoint.cjs +1 -0
  123. package/dist/hooks/useBreakpoint/useBreakpoint.const.cjs +1 -0
  124. package/dist/hooks/useBreakpoint/useBreakpoint.const.d.ts +8 -0
  125. package/dist/hooks/useBreakpoint/useBreakpoint.const.js +10 -0
  126. package/dist/hooks/useBreakpoint/useBreakpoint.d.ts +2 -0
  127. package/dist/hooks/useBreakpoint/useBreakpoint.js +26 -0
  128. package/dist/hooks/useBreakpoint/useBreakpoint.types.d.ts +12 -0
  129. package/dist/index.cjs +1 -1
  130. package/dist/index.js +464 -443
  131. package/dist/styles.css +67 -23
  132. package/dist/utils/generateBearId.const.cjs +1 -1
  133. package/dist/utils/generateBearId.const.d.ts +4 -2
  134. package/dist/utils/generateBearId.const.js +6 -4
  135. package/dist/utils/generateBearId.utils.cjs +1 -1
  136. package/dist/utils/generateBearId.utils.js +33 -21
  137. package/dist/utils/index.cjs +1 -1
  138. package/dist/utils/index.d.ts +4 -1
  139. package/dist/utils/index.js +27 -18
  140. package/dist/utils/liveRegion.const.cjs +1 -0
  141. package/dist/utils/liveRegion.const.d.ts +5 -0
  142. package/dist/utils/liveRegion.const.js +17 -0
  143. package/dist/utils/liveRegion.utils.cjs +1 -0
  144. package/dist/utils/liveRegion.utils.d.ts +7 -0
  145. package/dist/utils/liveRegion.utils.js +10 -0
  146. package/dist/utils/useBearId.cjs +1 -1
  147. package/dist/utils/useBearId.js +5 -4
  148. package/package.json +1 -1
@@ -1,99 +1,101 @@
1
- import { jsxs as n, Fragment as T, jsx as r } from "react/jsx-runtime";
2
- import { createPortal as w } from "react-dom";
3
- import { cn as z } from "../../utils/cn.js";
1
+ import { jsxs as n, Fragment as z, jsx as r } from "react/jsx-runtime";
2
+ import { createPortal as L } from "react-dom";
3
+ import { cn as U } from "../../utils/cn.js";
4
4
  import "react";
5
- import { resolveBearId as L } from "../../utils/generateBearId.utils.js";
6
- import { useBearId as U } from "../../utils/useBearId.js";
7
- import { Paper as X } from "../Paper/Paper.js";
5
+ import { resolveBearId as X } from "../../utils/generateBearId.utils.js";
6
+ import { useBearId as Z } from "../../utils/useBearId.js";
7
+ import { getBearLiveRegionProps as j } from "../../utils/liveRegion.utils.js";
8
+ import { Paper as H } from "../Paper/Paper.js";
8
9
  import { Flex as d } from "../Flex/Flex.js";
9
- import { Typography as S } from "../Typography/Typography.js";
10
- import { Progress as Z } from "../Progress/Progress.js";
11
- import { CloseButton as j } from "../CloseButton/CloseButton.js";
12
- import { SNACKBAR_DEFAULT_AUTO_HIDE_MS as H, SNACKBAR_DEFAULT_OFFSET_X as G, SNACKBAR_DEFAULT_OFFSET_Y as M, SNACKBAR_BACKDROP_Z_INDEX as V, SNACKBAR_SIZE_PADDING as Y, SNACKBAR_SURFACE_CLASSES as q, SNACKBAR_ROOT_CLASS as J, SNACKBAR_Z_INDEX as Q } from "./Snackbar.const.js";
13
- import { useSnackbar as W } from "./hooks/useSnackbar.js";
14
- const $ = (i, o, a, t) => {
15
- const e = { zIndex: Q };
10
+ import { Typography as A } from "../Typography/Typography.js";
11
+ import { Progress as G } from "../Progress/Progress.js";
12
+ import { CloseButton as M } from "../CloseButton/CloseButton.js";
13
+ import { SNACKBAR_DEFAULT_AUTO_HIDE_MS as V, SNACKBAR_DEFAULT_OFFSET_X as Y, SNACKBAR_DEFAULT_OFFSET_Y as q, SNACKBAR_BACKDROP_Z_INDEX as J, SNACKBAR_SIZE_PADDING as Q, SNACKBAR_SURFACE_CLASSES as W, SNACKBAR_ROOT_CLASS as $, SNACKBAR_Z_INDEX as ee } from "./Snackbar.const.js";
14
+ import { useSnackbar as re } from "./hooks/useSnackbar.js";
15
+ const oe = (i, o, a, t) => {
16
+ const e = { zIndex: ee };
16
17
  return i === "top" ? e.top = t : e.bottom = t, o === "left" ? (e.left = a, e.right = "auto") : o === "right" ? (e.right = a, e.left = "auto") : (e.left = "50%", e.right = "auto", e.transform = "translateX(-50%)"), e;
17
- }, be = (i) => {
18
+ }, ge = (i) => {
18
19
  const {
19
20
  open: o,
20
21
  message: a,
21
22
  description: t,
22
- action: e,
23
- autoHideDuration: g = H,
23
+ severity: e = "default",
24
+ action: m,
25
+ autoHideDuration: h = V,
24
26
  onClose: l,
25
- anchorOrigin: m = { vertical: "bottom", horizontal: "center" },
26
- offsetX: A = G,
27
- offsetY: h = M,
28
- size: B = "md",
29
- progress: N = null,
30
- progressPosition: u = "bottom",
31
- progressColor: C = "default",
32
- countdownProgress: k = !1,
27
+ anchorOrigin: f = { vertical: "bottom", horizontal: "center" },
28
+ offsetX: B = Y,
29
+ offsetY: N = q,
30
+ size: C = "md",
31
+ progress: k = null,
32
+ progressPosition: p = "bottom",
33
+ progressColor: v = "default",
34
+ countdownProgress: R = !1,
33
35
  showCloseButton: O,
34
36
  closeOnClickOutside: x,
35
37
  container: D,
36
38
  id: I,
37
- testId: R,
38
- className: v
39
- } = i, E = U("Snackbar"), y = L(I, E), b = D ?? (typeof document < "u" ? document.body : null), s = !!l, F = O ?? s, f = x ?? s, { surfaceRef: K, progressValue: p } = W({
39
+ testId: y,
40
+ className: E
41
+ } = i, F = Z("Snackbar"), P = X(I, F), u = D ?? (typeof document < "u" ? document.body : null), s = !!l, K = O ?? s, b = x ?? s, { surfaceRef: T, progressValue: _ } = re({
40
42
  open: o,
41
- autoHideDuration: g,
43
+ autoHideDuration: h,
42
44
  onClose: l,
43
- countdownProgress: k,
44
- staticProgress: N,
45
- closeOnClickOutside: f
45
+ countdownProgress: R,
46
+ staticProgress: k,
47
+ closeOnClickOutside: b
46
48
  });
47
- if (!o || !b)
49
+ if (!o || !u)
48
50
  return null;
49
- const c = typeof p == "number", _ = c ? /* @__PURE__ */ r(
50
- Z,
51
+ const g = j(e), c = typeof _ == "number", S = c ? /* @__PURE__ */ r(
52
+ G,
51
53
  {
52
- value: p,
54
+ value: _,
53
55
  size: "sm",
54
- color: C,
56
+ color: v,
55
57
  className: "Bear-Snackbar__progress"
56
58
  }
57
- ) : null, P = /* @__PURE__ */ n(T, { children: [
58
- f && s && /* @__PURE__ */ r(
59
+ ) : null, w = /* @__PURE__ */ n(z, { children: [
60
+ b && s && /* @__PURE__ */ r(
59
61
  "div",
60
62
  {
61
63
  className: "Bear-Snackbar__backdrop bear-fixed bear-inset-0",
62
- style: { zIndex: V },
64
+ style: { zIndex: J },
63
65
  "aria-hidden": !0
64
66
  }
65
67
  ),
66
68
  /* @__PURE__ */ n(
67
- X,
69
+ H,
68
70
  {
69
- ref: K,
70
- id: y,
71
- "data-testid": R,
72
- role: "status",
73
- "aria-live": "polite",
71
+ ref: T,
72
+ id: P,
73
+ "data-testid": y,
74
+ role: g.role,
75
+ "aria-live": g["aria-live"],
74
76
  elevation: 4,
75
77
  rounded: "lg",
76
78
  padding: "none",
77
79
  background: "transparent",
78
- className: z(
79
- J,
80
- q,
80
+ className: U(
81
+ $,
82
+ W,
81
83
  "bear-fixed bear-flex bear-flex-col bear-overflow-hidden",
82
84
  "bear-border bear-border-[var(--bear-border-default)]",
83
- Y[B],
84
- v
85
+ Q[C],
86
+ E
85
87
  ),
86
- style: $(m.vertical, m.horizontal, A, h),
88
+ style: oe(f.vertical, f.horizontal, B, N),
87
89
  children: [
88
- c && u === "top" && _,
90
+ c && p === "top" && S,
89
91
  /* @__PURE__ */ n(d, { className: "Bear-Snackbar__content bear-w-full", align: "center", gap: 3, children: [
90
92
  /* @__PURE__ */ n(d, { direction: "column", className: "Bear-Snackbar__text bear-flex-1 bear-min-w-0", gap: 1, children: [
91
- a && /* @__PURE__ */ r(S, { variant: "body2", className: "Bear-Snackbar__message", children: a }),
92
- t && /* @__PURE__ */ r(S, { variant: "caption", color: "muted", className: "Bear-Snackbar__description", children: t })
93
+ a && /* @__PURE__ */ r(A, { variant: "body2", className: "Bear-Snackbar__message", children: a }),
94
+ t && /* @__PURE__ */ r(A, { variant: "caption", color: "muted", className: "Bear-Snackbar__description", children: t })
93
95
  ] }),
94
- e && /* @__PURE__ */ r(d, { className: "Bear-Snackbar__action bear-shrink-0", align: "center", children: e }),
95
- F && s && /* @__PURE__ */ r(
96
- j,
96
+ m && /* @__PURE__ */ r(d, { className: "Bear-Snackbar__action bear-shrink-0", align: "center", children: m }),
97
+ K && s && /* @__PURE__ */ r(
98
+ M,
97
99
  {
98
100
  size: "sm",
99
101
  onClick: l,
@@ -102,13 +104,13 @@ const $ = (i, o, a, t) => {
102
104
  }
103
105
  )
104
106
  ] }),
105
- c && u === "bottom" && _
107
+ c && p === "bottom" && S
106
108
  ]
107
109
  }
108
110
  )
109
111
  ] });
110
- return w(P, b);
112
+ return L(w, u);
111
113
  };
112
114
  export {
113
- be as Snackbar
115
+ ge as Snackbar
114
116
  };
@@ -5,10 +5,12 @@ export type SnackbarAnchorOriginHorizontal = 'left' | 'center' | 'right';
5
5
  export type SnackbarProgressPosition = 'top' | 'bottom';
6
6
  export type SnackbarSize = Extract<BearSize, 'sm' | 'md' | 'lg'>;
7
7
  export type SnackbarProgressColor = 'default' | 'success' | 'warning' | 'danger' | 'info';
8
+ export type SnackbarSeverity = 'success' | 'info' | 'warning' | 'error' | 'default';
8
9
  export interface SnackbarProps {
9
10
  open: boolean;
10
11
  message?: ReactNode;
11
12
  description?: ReactNode;
13
+ severity?: SnackbarSeverity;
12
14
  action?: ReactNode;
13
15
  autoHideDuration?: number | null;
14
16
  onClose?: () => void;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),d=require("react"),J=require("../../context/BearProvider.cjs"),Q=require("../../utils/maxVisible.utils.cjs"),c=require("../../utils/cn.cjs"),F=require("../Typography/Typography.cjs"),ee=require("../Dropdown/Dropdown.cjs"),re=require("../Icon/index.cjs"),r=require("./Stepper.const.cjs"),m=require("./Stepper.utils.cjs"),ne=1200,te=16,se=640,H=3,oe=()=>n.jsx("svg",{width:r.CHECK_ICON_SIZE,height:r.CHECK_ICON_SIZE,viewBox:r.CHECK_ICON_VIEWBOX,fill:"none",stroke:"currentColor",strokeWidth:"3",children:n.jsx("polyline",{points:r.CHECK_ICON_POINTS})}),ie=()=>n.jsxs("svg",{width:r.ERROR_ICON_SIZE,height:r.ERROR_ICON_SIZE,viewBox:r.ERROR_ICON_VIEWBOX,fill:"none",stroke:"currentColor",strokeWidth:"3",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),U=d.forwardRef(({steps:o,activeStep:_,onStepClick:S,orientation:W=r.DEFAULT_ORIENTATION,size:A=r.DEFAULT_SIZE,showNumbers:D=r.DEFAULT_SHOW_NUMBERS,clickable:g=r.DEFAULT_CLICKABLE,showConnectors:M=r.DEFAULT_SHOW_CONNECTORS,connectorStyle:R=r.DEFAULT_CONNECTOR_STYLE,alternativeLabel:L=r.DEFAULT_ALTERNATIVE_LABEL,completedIcon:V,errorIcon:q,labelTypographyProps:Z,descriptionTypographyProps:z,maxVisibleSteps:C,testId:K,className:k,...X},$)=>{const f=J.useBearThemeOptional(),[O,G]=d.useState(()=>typeof window<"u"?window.innerWidth:ne);d.useEffect(()=>{const e=()=>G(window.innerWidth);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);const h=d.useMemo(()=>{if(C!=null)return Q.resolveMaxVisible(C,{width:O,theme:f});if(O<se&&o.length>H)return H},[C,O,f,o.length]),E=W==="horizontal",p=r.STEP_INDICATOR_SIZES[A],v=r.STEP_LABEL_SIZES[A],T=E&&h!=null&&o.length>h,{visibleIndices:j,leftHidden:x,rightHidden:N}=d.useMemo(()=>{if(!T||h==null)return{visibleIndices:o.map((a,I)=>I),leftHidden:[],rightHidden:[]};const e=h,t=Math.floor(e/2),s=Math.max(0,Math.min(_-t,o.length-e)),i=Array.from({length:e},(a,I)=>s+I),l=[],y=[];for(let a=0;a<s;a++)l.push(a);for(let a=s+e;a<o.length;a++)y.push(a);return{visibleIndices:i,leftHidden:l,rightHidden:y}},[T,h,o,_]),b=(e,t,s)=>{const i=r.STEP_STATUS_CLASSES[s],l=m.resolveIndicatorContent(e,t,s,D,V,q,n.jsx(oe,{}),n.jsx(ie,{}));return n.jsx("div",{className:c.cn(r.STEP_INDICATOR_BASE,p,i.indicator,g&&!e.disabled&&"cursor-pointer hover:scale-105"),onClick:()=>{g&&!e.disabled&&S&&S(t)},children:l})},u=(e,t)=>{if(!M||t)return null;const s=e<_;return E?n.jsx("div",{className:c.cn("Bear-Stepper__connector flex-1 self-center mx-1","h-0.5 min-w-[12px] transition-colors",s?r.CONNECTOR_STATUS.completed:r.CONNECTOR_STATUS.pending,R==="dashed"&&"border-t-2 border-dashed bg-transparent")}):n.jsx("div",{className:c.cn(r.CONNECTOR_BASE,r.CONNECTOR_VERTICAL,s?r.CONNECTOR_STATUS.completed:r.CONNECTOR_STATUS.pending,R==="dashed"&&"border-t-2 border-dashed bg-transparent")})},w=(e,t)=>{const s=r.STEP_STATUS_CLASSES[t],i={...Z,...e.labelTypographyProps},l={...z,...e.descriptionTypographyProps};return n.jsxs(n.Fragment,{children:[n.jsx(F.Typography,{variant:"body2",...i,className:c.cn(r.STEP_LABEL_BASE,v.label,s.label,i==null?void 0:i.className),children:e.label}),e.description&&n.jsx(F.Typography,{variant:"caption",...l,className:c.cn(r.STEP_DESCRIPTION_CLASSES,v.description,l==null?void 0:l.className),children:e.description})]})},B=(e,t)=>{const s=m.resolveStepStatus(e,t,_);return n.jsxs("div",{className:c.cn("Bear-Stepper__content flex shrink-0",L?"flex-col items-center":"items-center gap-2"),children:[b(e,t,s),n.jsx("div",{className:c.cn(L&&"text-center mt-2","whitespace-nowrap"),children:w(e,s)})]})},Y=(e,t)=>{const s=m.resolveStepStatus(e,t,_);return n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"flex-shrink-0 mr-4",children:b(e,t,s)}),n.jsxs("div",{className:"flex-1 pt-0.5",children:[w(e,s),e.content&&s==="active"&&n.jsx("div",{className:"mt-4",children:e.content})]})]})},P=(e,t)=>n.jsx("div",{className:"Bear-Stepper__overflow shrink-0",children:n.jsx(ee.Dropdown,{placement:"bottom-start",closeOnSelect:!0,trigger:n.jsx("button",{type:"button",className:c.cn(r.STEP_INDICATOR_BASE,p,r.STEP_STATUS_CLASSES.pending.indicator,"bear-cursor-pointer bear-border-0"),"aria-label":t==="left"?r.OVERFLOW_LEFT_LABEL:r.OVERFLOW_RIGHT_LABEL,children:n.jsx(re.BearIcons.MoreHorizIcon,{size:te})}),items:e.map(s=>({key:`step-${s}`,label:o[s].label,disabled:o[s].disabled,onClick:()=>{o[s].disabled||S==null||S(s)}}))})},`overflow-${t}`);return n.jsxs("div",{ref:$,className:c.cn(r.STEPPER_BASE_CLASSES,E?r.STEPPER_HORIZONTAL_CLASSES:r.STEPPER_VERTICAL_CLASSES,k),"data-testid":K,...X,children:[E&&!T&&o.map((e,t)=>n.jsxs(d.Fragment,{children:[B(e,t),u(t,t===o.length-1)]},t)),E&&T&&n.jsxs(n.Fragment,{children:[x.length>0&&n.jsxs(n.Fragment,{children:[P(x,"left"),u(-1,!1)]}),j.map((e,t)=>{const s=o[e],i=t===j.length-1&&N.length===0;return n.jsxs(d.Fragment,{children:[B(s,e),u(e,i)]},e)}),N.length>0&&P(N,"right")]}),!E&&o.map((e,t)=>n.jsxs("div",{className:c.cn("Bear-Stepper__step",r.STEP_WRAPPER_VERTICAL),children:[Y(e,t),u(t,t===o.length-1)]},t))]})});U.displayName="Stepper";exports.Stepper=U;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),E=require("react"),H=require("../../context/BearProvider.cjs"),ee=require("../../utils/maxVisible.utils.cjs"),c=require("../../utils/cn.cjs"),U=require("../Typography/Typography.cjs"),re=require("../Dropdown/Dropdown.cjs"),ne=require("../Icon/index.cjs"),r=require("./Stepper.const.cjs"),m=require("./Stepper.utils.cjs"),te=1200,se=16,oe=640,W=3,ie=()=>n.jsx("svg",{width:r.CHECK_ICON_SIZE,height:r.CHECK_ICON_SIZE,viewBox:r.CHECK_ICON_VIEWBOX,fill:"none",stroke:"currentColor",strokeWidth:"3",children:n.jsx("polyline",{points:r.CHECK_ICON_POINTS})}),ce=()=>n.jsxs("svg",{width:r.ERROR_ICON_SIZE,height:r.ERROR_ICON_SIZE,viewBox:r.ERROR_ICON_VIEWBOX,fill:"none",stroke:"currentColor",strokeWidth:"3",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),D=E.forwardRef(({steps:o,activeStep:_,onStepClick:S,orientation:M=r.DEFAULT_ORIENTATION,size:A=r.DEFAULT_SIZE,showNumbers:V=r.DEFAULT_SHOW_NUMBERS,clickable:g=r.DEFAULT_CLICKABLE,showConnectors:q=r.DEFAULT_SHOW_CONNECTORS,connectorStyle:R=r.DEFAULT_CONNECTOR_STYLE,alternativeLabel:L=r.DEFAULT_ALTERNATIVE_LABEL,completedIcon:Z,errorIcon:z,labelTypographyProps:K,descriptionTypographyProps:k,maxVisibleSteps:C,testId:X,className:$,...G},Y)=>{const f=H.useBearThemeOptional(),{direction:p}=H.useBearDirectionOptional(),[O,J]=E.useState(()=>typeof window<"u"?window.innerWidth:te);E.useEffect(()=>{const e=()=>J(window.innerWidth);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);const h=E.useMemo(()=>{if(C!=null)return ee.resolveMaxVisible(C,{width:O,theme:f});if(O<oe&&o.length>W)return W},[C,O,f,o.length]),d=M==="horizontal",v=r.STEP_INDICATOR_SIZES[A],x=r.STEP_LABEL_SIZES[A],T=d&&h!=null&&o.length>h,{visibleIndices:j,leftHidden:b,rightHidden:N}=E.useMemo(()=>{if(!T||h==null)return{visibleIndices:o.map((a,I)=>I),leftHidden:[],rightHidden:[]};const e=h,t=Math.floor(e/2),s=Math.max(0,Math.min(_-t,o.length-e)),i=Array.from({length:e},(a,I)=>s+I),l=[],F=[];for(let a=0;a<s;a++)l.push(a);for(let a=s+e;a<o.length;a++)F.push(a);return{visibleIndices:i,leftHidden:l,rightHidden:F}},[T,h,o,_]),w=(e,t,s)=>{const i=r.STEP_STATUS_CLASSES[s],l=m.resolveIndicatorContent(e,t,s,V,Z,z,n.jsx(ie,{}),n.jsx(ce,{}));return n.jsx("div",{className:c.cn(r.STEP_INDICATOR_BASE,v,i.indicator,g&&!e.disabled&&"cursor-pointer hover:scale-105"),onClick:()=>{g&&!e.disabled&&S&&S(t)},children:l})},u=(e,t)=>{if(!q||t)return null;const s=e<_;return d?n.jsx("div",{className:c.cn("Bear-Stepper__connector flex-1 self-center mx-1","h-0.5 min-w-[12px] transition-colors",s?r.CONNECTOR_STATUS.completed:r.CONNECTOR_STATUS.pending,R==="dashed"&&"border-t-2 border-dashed bg-transparent")}):n.jsx("div",{className:c.cn(r.CONNECTOR_BASE,r.CONNECTOR_VERTICAL,s?r.CONNECTOR_STATUS.completed:r.CONNECTOR_STATUS.pending,R==="dashed"&&"border-t-2 border-dashed bg-transparent")})},B=(e,t)=>{const s=r.STEP_STATUS_CLASSES[t],i={...K,...e.labelTypographyProps},l={...k,...e.descriptionTypographyProps};return n.jsxs(n.Fragment,{children:[n.jsx(U.Typography,{variant:"body2",...i,className:c.cn(r.STEP_LABEL_BASE,x.label,s.label,i==null?void 0:i.className),children:e.label}),e.description&&n.jsx(U.Typography,{variant:"caption",...l,className:c.cn(r.STEP_DESCRIPTION_CLASSES,x.description,l==null?void 0:l.className),children:e.description})]})},P=(e,t)=>{const s=m.resolveStepStatus(e,t,_);return n.jsxs("div",{className:c.cn("Bear-Stepper__content flex shrink-0",L?"flex-col items-center":"items-center gap-2"),children:[w(e,t,s),n.jsx("div",{className:c.cn(L&&"text-center mt-2","whitespace-nowrap"),children:B(e,s)})]})},Q=(e,t)=>{const s=m.resolveStepStatus(e,t,_);return n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"flex-shrink-0 mr-4",children:w(e,t,s)}),n.jsxs("div",{className:"flex-1 pt-0.5",children:[B(e,s),e.content&&s==="active"&&n.jsx("div",{className:"mt-4",children:e.content})]})]})},y=(e,t)=>n.jsx("div",{className:"Bear-Stepper__overflow shrink-0",children:n.jsx(re.Dropdown,{placement:"bottom-start",closeOnSelect:!0,trigger:n.jsx("button",{type:"button",className:c.cn(r.STEP_INDICATOR_BASE,v,r.STEP_STATUS_CLASSES.pending.indicator,"bear-cursor-pointer bear-border-0"),"aria-label":t==="left"?r.OVERFLOW_LEFT_LABEL:r.OVERFLOW_RIGHT_LABEL,children:n.jsx(ne.BearIcons.MoreHorizIcon,{size:se})}),items:e.map(s=>({key:`step-${s}`,label:o[s].label,disabled:o[s].disabled,onClick:()=>{o[s].disabled||S==null||S(s)}}))})},`overflow-${t}`);return n.jsxs("div",{ref:Y,dir:p,className:c.cn(r.STEPPER_BASE_CLASSES,d?r.STEPPER_HORIZONTAL_CLASSES:r.STEPPER_VERTICAL_CLASSES,p==="rtl"&&d&&"bear-flex-row-reverse",$),"data-testid":X,...G,children:[d&&!T&&o.map((e,t)=>n.jsxs(E.Fragment,{children:[P(e,t),u(t,t===o.length-1)]},t)),d&&T&&n.jsxs(n.Fragment,{children:[b.length>0&&n.jsxs(n.Fragment,{children:[y(b,"left"),u(-1,!1)]}),j.map((e,t)=>{const s=o[e],i=t===j.length-1&&N.length===0;return n.jsxs(E.Fragment,{children:[P(s,e),u(e,i)]},e)}),N.length>0&&y(N,"right")]}),!d&&o.map((e,t)=>n.jsxs("div",{className:c.cn("Bear-Stepper__step",r.STEP_WRAPPER_VERTICAL),children:[Q(e,t),u(t,t===o.length-1)]},t))]})});D.displayName="Stepper";exports.Stepper=D;
@@ -1,75 +1,75 @@
1
1
  import { jsxs as i, Fragment as f, jsx as t } from "react/jsx-runtime";
2
- import D, { forwardRef as oe, useState as ie, useEffect as le, useMemo as U } from "react";
3
- import { useBearThemeOptional as se } from "../../context/BearProvider.js";
4
- import { resolveMaxVisible as ae } from "../../utils/maxVisible.utils.js";
2
+ import U, { forwardRef as ie, useState as le, useEffect as se, useMemo as V } from "react";
3
+ import { useBearThemeOptional as ae, useBearDirectionOptional as ce } from "../../context/BearProvider.js";
4
+ import { resolveMaxVisible as de } from "../../utils/maxVisible.utils.js";
5
5
  import { cn as s } from "../../utils/cn.js";
6
- import { Typography as V } from "../Typography/Typography.js";
7
- import { Dropdown as ce } from "../Dropdown/Dropdown.js";
8
- import { BearIcons as de } from "../Icon/index.js";
9
- import { STEP_WRAPPER_VERTICAL as Ee, STEPPER_HORIZONTAL_CLASSES as he, STEPPER_VERTICAL_CLASSES as _e, STEPPER_BASE_CLASSES as me, DEFAULT_ORIENTATION as Te, DEFAULT_SIZE as fe, DEFAULT_SHOW_NUMBERS as Se, DEFAULT_CLICKABLE as Ie, DEFAULT_SHOW_CONNECTORS as Oe, DEFAULT_CONNECTOR_STYLE as Ce, DEFAULT_ALTERNATIVE_LABEL as Ne, CONNECTOR_STATUS as S, CONNECTOR_VERTICAL as ue, CONNECTOR_BASE as Ae, OVERFLOW_LEFT_LABEL as Le, OVERFLOW_RIGHT_LABEL as ge, STEP_STATUS_CLASSES as u, STEP_INDICATOR_SIZES as Re, STEP_INDICATOR_BASE as M, STEP_LABEL_SIZES as pe, STEP_LABEL_BASE as ve, STEP_DESCRIPTION_CLASSES as we, ERROR_ICON_VIEWBOX as be, ERROR_ICON_SIZE as z, CHECK_ICON_VIEWBOX as Be, CHECK_ICON_SIZE as Z, CHECK_ICON_POINTS as Pe } from "./Stepper.const.js";
10
- import { resolveStepStatus as K, resolveIndicatorContent as ye } from "./Stepper.utils.js";
11
- const He = 1200, We = 16, Fe = 640, k = 3, De = () => /* @__PURE__ */ t("svg", { width: Z, height: Z, viewBox: Be, fill: "none", stroke: "currentColor", strokeWidth: "3", children: /* @__PURE__ */ t("polyline", { points: Pe }) }), Ue = () => /* @__PURE__ */ i("svg", { width: z, height: z, viewBox: be, fill: "none", stroke: "currentColor", strokeWidth: "3", children: [
6
+ import { Typography as M } from "../Typography/Typography.js";
7
+ import { Dropdown as Ee } from "../Dropdown/Dropdown.js";
8
+ import { BearIcons as he } from "../Icon/index.js";
9
+ import { STEP_WRAPPER_VERTICAL as _e, STEPPER_HORIZONTAL_CLASSES as me, STEPPER_VERTICAL_CLASSES as Te, STEPPER_BASE_CLASSES as fe, DEFAULT_ORIENTATION as Se, DEFAULT_SIZE as Ie, DEFAULT_SHOW_NUMBERS as Oe, DEFAULT_CLICKABLE as Ce, DEFAULT_SHOW_CONNECTORS as Ne, DEFAULT_CONNECTOR_STYLE as ue, DEFAULT_ALTERNATIVE_LABEL as Ae, CONNECTOR_STATUS as S, CONNECTOR_VERTICAL as Le, CONNECTOR_BASE as ge, OVERFLOW_LEFT_LABEL as Re, OVERFLOW_RIGHT_LABEL as pe, STEP_STATUS_CLASSES as u, STEP_INDICATOR_SIZES as ve, STEP_INDICATOR_BASE as z, STEP_LABEL_SIZES as we, STEP_LABEL_BASE as be, STEP_DESCRIPTION_CLASSES as Be, ERROR_ICON_VIEWBOX as Pe, ERROR_ICON_SIZE as Z, CHECK_ICON_VIEWBOX as ye, CHECK_ICON_SIZE as K, CHECK_ICON_POINTS as He } from "./Stepper.const.js";
10
+ import { resolveStepStatus as k, resolveIndicatorContent as We } from "./Stepper.utils.js";
11
+ const Fe = 1200, De = 16, Ue = 640, x = 3, Ve = () => /* @__PURE__ */ t("svg", { width: K, height: K, viewBox: ye, fill: "none", stroke: "currentColor", strokeWidth: "3", children: /* @__PURE__ */ t("polyline", { points: He }) }), Me = () => /* @__PURE__ */ i("svg", { width: Z, height: Z, viewBox: Pe, fill: "none", stroke: "currentColor", strokeWidth: "3", children: [
12
12
  /* @__PURE__ */ t("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
13
13
  /* @__PURE__ */ t("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
14
- ] }), Ve = oe(
14
+ ] }), ze = ie(
15
15
  ({
16
16
  steps: o,
17
17
  activeStep: E,
18
18
  onStepClick: h,
19
- orientation: X = Te,
20
- size: A = fe,
21
- showNumbers: j = Se,
22
- clickable: L = Ie,
23
- showConnectors: x = Oe,
24
- connectorStyle: g = Ce,
25
- alternativeLabel: R = Ne,
26
- completedIcon: $,
27
- errorIcon: G,
28
- labelTypographyProps: Y,
29
- descriptionTypographyProps: q,
19
+ orientation: X = Se,
20
+ size: A = Ie,
21
+ showNumbers: j = Oe,
22
+ clickable: L = Ce,
23
+ showConnectors: $ = Ne,
24
+ connectorStyle: g = ue,
25
+ alternativeLabel: R = Ae,
26
+ completedIcon: G,
27
+ errorIcon: Y,
28
+ labelTypographyProps: q,
29
+ descriptionTypographyProps: J,
30
30
  maxVisibleSteps: I,
31
- testId: J,
32
- className: Q,
33
- ...ee
34
- }, re) => {
35
- const p = se(), [O, ne] = ie(() => typeof window < "u" ? window.innerWidth : He);
36
- le(() => {
37
- const e = () => ne(window.innerWidth);
31
+ testId: Q,
32
+ className: ee,
33
+ ...re
34
+ }, ne) => {
35
+ const p = ae(), { direction: v } = ce(), [O, te] = le(() => typeof window < "u" ? window.innerWidth : Fe);
36
+ se(() => {
37
+ const e = () => te(window.innerWidth);
38
38
  return window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
39
39
  }, []);
40
- const _ = U(() => {
40
+ const _ = V(() => {
41
41
  if (I != null)
42
- return ae(I, { width: O, theme: p });
43
- if (O < Fe && o.length > k)
44
- return k;
45
- }, [I, O, p, o.length]), d = X === "horizontal", v = Re[A], w = pe[A], m = d && _ != null && o.length > _, { visibleIndices: b, leftHidden: B, rightHidden: C } = U(() => {
42
+ return de(I, { width: O, theme: p });
43
+ if (O < Ue && o.length > x)
44
+ return x;
45
+ }, [I, O, p, o.length]), d = X === "horizontal", w = ve[A], b = we[A], m = d && _ != null && o.length > _, { visibleIndices: B, leftHidden: P, rightHidden: C } = V(() => {
46
46
  if (!m || _ == null)
47
47
  return {
48
48
  visibleIndices: o.map((c, N) => N),
49
49
  leftHidden: [],
50
50
  rightHidden: []
51
51
  };
52
- const e = _, r = Math.floor(e / 2), n = Math.max(0, Math.min(E - r, o.length - e)), l = Array.from({ length: e }, (c, N) => n + N), a = [], F = [];
52
+ const e = _, r = Math.floor(e / 2), n = Math.max(0, Math.min(E - r, o.length - e)), l = Array.from({ length: e }, (c, N) => n + N), a = [], D = [];
53
53
  for (let c = 0; c < n; c++) a.push(c);
54
- for (let c = n + e; c < o.length; c++) F.push(c);
55
- return { visibleIndices: l, leftHidden: a, rightHidden: F };
56
- }, [m, _, o, E]), P = (e, r, n) => {
57
- const l = u[n], a = ye(
54
+ for (let c = n + e; c < o.length; c++) D.push(c);
55
+ return { visibleIndices: l, leftHidden: a, rightHidden: D };
56
+ }, [m, _, o, E]), y = (e, r, n) => {
57
+ const l = u[n], a = We(
58
58
  e,
59
59
  r,
60
60
  n,
61
61
  j,
62
- $,
63
62
  G,
64
- /* @__PURE__ */ t(De, {}),
65
- /* @__PURE__ */ t(Ue, {})
63
+ Y,
64
+ /* @__PURE__ */ t(Ve, {}),
65
+ /* @__PURE__ */ t(Me, {})
66
66
  );
67
67
  return /* @__PURE__ */ t(
68
68
  "div",
69
69
  {
70
70
  className: s(
71
- M,
72
- v,
71
+ z,
72
+ w,
73
73
  l.indicator,
74
74
  L && !e.disabled && "cursor-pointer hover:scale-105"
75
75
  ),
@@ -80,7 +80,7 @@ const He = 1200, We = 16, Fe = 640, k = 3, De = () => /* @__PURE__ */ t("svg", {
80
80
  }
81
81
  );
82
82
  }, T = (e, r) => {
83
- if (!x || r) return null;
83
+ if (!$ || r) return null;
84
84
  const n = e < E;
85
85
  return d ? /* @__PURE__ */ t(
86
86
  "div",
@@ -96,52 +96,52 @@ const He = 1200, We = 16, Fe = 640, k = 3, De = () => /* @__PURE__ */ t("svg", {
96
96
  "div",
97
97
  {
98
98
  className: s(
99
- Ae,
100
- ue,
99
+ ge,
100
+ Le,
101
101
  n ? S.completed : S.pending,
102
102
  g === "dashed" && "border-t-2 border-dashed bg-transparent"
103
103
  )
104
104
  }
105
105
  );
106
- }, y = (e, r) => {
107
- const n = u[r], l = { ...Y, ...e.labelTypographyProps }, a = { ...q, ...e.descriptionTypographyProps };
106
+ }, H = (e, r) => {
107
+ const n = u[r], l = { ...q, ...e.labelTypographyProps }, a = { ...J, ...e.descriptionTypographyProps };
108
108
  return /* @__PURE__ */ i(f, { children: [
109
109
  /* @__PURE__ */ t(
110
- V,
110
+ M,
111
111
  {
112
112
  variant: "body2",
113
113
  ...l,
114
- className: s(ve, w.label, n.label, l == null ? void 0 : l.className),
114
+ className: s(be, b.label, n.label, l == null ? void 0 : l.className),
115
115
  children: e.label
116
116
  }
117
117
  ),
118
118
  e.description && /* @__PURE__ */ t(
119
- V,
119
+ M,
120
120
  {
121
121
  variant: "caption",
122
122
  ...a,
123
- className: s(we, w.description, a == null ? void 0 : a.className),
123
+ className: s(Be, b.description, a == null ? void 0 : a.className),
124
124
  children: e.description
125
125
  }
126
126
  )
127
127
  ] });
128
- }, H = (e, r) => {
129
- const n = K(e, r, E);
128
+ }, W = (e, r) => {
129
+ const n = k(e, r, E);
130
130
  return /* @__PURE__ */ i("div", { className: s("Bear-Stepper__content flex shrink-0", R ? "flex-col items-center" : "items-center gap-2"), children: [
131
- P(e, r, n),
132
- /* @__PURE__ */ t("div", { className: s(R && "text-center mt-2", "whitespace-nowrap"), children: y(e, n) })
131
+ y(e, r, n),
132
+ /* @__PURE__ */ t("div", { className: s(R && "text-center mt-2", "whitespace-nowrap"), children: H(e, n) })
133
133
  ] });
134
- }, te = (e, r) => {
135
- const n = K(e, r, E);
134
+ }, oe = (e, r) => {
135
+ const n = k(e, r, E);
136
136
  return /* @__PURE__ */ i(f, { children: [
137
- /* @__PURE__ */ t("div", { className: "flex-shrink-0 mr-4", children: P(e, r, n) }),
137
+ /* @__PURE__ */ t("div", { className: "flex-shrink-0 mr-4", children: y(e, r, n) }),
138
138
  /* @__PURE__ */ i("div", { className: "flex-1 pt-0.5", children: [
139
- y(e, n),
139
+ H(e, n),
140
140
  e.content && n === "active" && /* @__PURE__ */ t("div", { className: "mt-4", children: e.content })
141
141
  ] })
142
142
  ] });
143
- }, W = (e, r) => /* @__PURE__ */ t("div", { className: "Bear-Stepper__overflow shrink-0", children: /* @__PURE__ */ t(
144
- ce,
143
+ }, F = (e, r) => /* @__PURE__ */ t("div", { className: "Bear-Stepper__overflow shrink-0", children: /* @__PURE__ */ t(
144
+ Ee,
145
145
  {
146
146
  placement: "bottom-start",
147
147
  closeOnSelect: !0,
@@ -150,13 +150,13 @@ const He = 1200, We = 16, Fe = 640, k = 3, De = () => /* @__PURE__ */ t("svg", {
150
150
  {
151
151
  type: "button",
152
152
  className: s(
153
- M,
154
- v,
153
+ z,
154
+ w,
155
155
  u.pending.indicator,
156
156
  "bear-cursor-pointer bear-border-0"
157
157
  ),
158
- "aria-label": r === "left" ? Le : ge,
159
- children: /* @__PURE__ */ t(de.MoreHorizIcon, { size: We })
158
+ "aria-label": r === "left" ? Re : pe,
159
+ children: /* @__PURE__ */ t(he.MoreHorizIcon, { size: De })
160
160
  }
161
161
  ),
162
162
  items: e.map((n) => ({
@@ -172,31 +172,37 @@ const He = 1200, We = 16, Fe = 640, k = 3, De = () => /* @__PURE__ */ t("svg", {
172
172
  return /* @__PURE__ */ i(
173
173
  "div",
174
174
  {
175
- ref: re,
176
- className: s(me, d ? he : _e, Q),
177
- "data-testid": J,
178
- ...ee,
175
+ ref: ne,
176
+ dir: v,
177
+ className: s(
178
+ fe,
179
+ d ? me : Te,
180
+ v === "rtl" && d && "bear-flex-row-reverse",
181
+ ee
182
+ ),
183
+ "data-testid": Q,
184
+ ...re,
179
185
  children: [
180
- d && !m && o.map((e, r) => /* @__PURE__ */ i(D.Fragment, { children: [
181
- H(e, r),
186
+ d && !m && o.map((e, r) => /* @__PURE__ */ i(U.Fragment, { children: [
187
+ W(e, r),
182
188
  T(r, r === o.length - 1)
183
189
  ] }, r)),
184
190
  d && m && /* @__PURE__ */ i(f, { children: [
185
- B.length > 0 && /* @__PURE__ */ i(f, { children: [
186
- W(B, "left"),
191
+ P.length > 0 && /* @__PURE__ */ i(f, { children: [
192
+ F(P, "left"),
187
193
  T(-1, !1)
188
194
  ] }),
189
- b.map((e, r) => {
190
- const n = o[e], l = r === b.length - 1 && C.length === 0;
191
- return /* @__PURE__ */ i(D.Fragment, { children: [
192
- H(n, e),
195
+ B.map((e, r) => {
196
+ const n = o[e], l = r === B.length - 1 && C.length === 0;
197
+ return /* @__PURE__ */ i(U.Fragment, { children: [
198
+ W(n, e),
193
199
  T(e, l)
194
200
  ] }, e);
195
201
  }),
196
- C.length > 0 && W(C, "right")
202
+ C.length > 0 && F(C, "right")
197
203
  ] }),
198
- !d && o.map((e, r) => /* @__PURE__ */ i("div", { className: s("Bear-Stepper__step", Ee), children: [
199
- te(e, r),
204
+ !d && o.map((e, r) => /* @__PURE__ */ i("div", { className: s("Bear-Stepper__step", _e), children: [
205
+ oe(e, r),
200
206
  T(r, r === o.length - 1)
201
207
  ] }, r))
202
208
  ]
@@ -204,7 +210,7 @@ const He = 1200, We = 16, Fe = 640, k = 3, De = () => /* @__PURE__ */ t("svg", {
204
210
  );
205
211
  }
206
212
  );
207
- Ve.displayName = "Stepper";
213
+ ze.displayName = "Stepper";
208
214
  export {
209
- Ve as Stepper
215
+ ze as Stepper
210
216
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),u=require("react"),b=require("../../utils/cn.cjs"),x=u.createContext(null),T=({children:o,value:n,defaultTab:e,variant:c="line",onChange:a,className:l,testId:d})=>{const[t,r]=u.useState(e),i=n!==void 0,v=i?n:t,m=p=>{i||r(p),a==null||a(p)};return s.jsx(x.Provider,{value:{activeTab:v,setActiveTab:m,variant:c},children:s.jsx("div",{className:b.cn("Bear-Tabs",l),"data-testid":d,children:o})})},y=({id:o,children:n,disabled:e=!1,icon:c})=>{const a=u.useContext(x);if(!a)throw new Error("Tab must be used within Tabs");const{activeTab:l,setActiveTab:d,variant:t}=a,r=l===o,i="bear-flex bear-items-center bear-gap-2 bear-px-4 bear-py-2 bear-text-sm bear-font-medium bear-transition-colors",v={line:b.cn("bear-border-b-2 bear--mb-px",r?"bear-border-primary-500 bear-text-primary-600 dark:bear-text-primary-400":"bear-border-transparent hover:bear-border-[var(--bear-border-default)]"),pills:b.cn("bear-rounded-md",r&&"bear-shadow-sm"),enclosed:b.cn("bear-rounded-t-lg bear-border bear-border-transparent",r&&"bear--mb-px")},m=e?void 0:r?t==="pills"?{backgroundColor:"var(--bear-bg-primary)",color:"var(--bear-text-primary)"}:t==="enclosed"?{backgroundColor:"var(--bear-bg-primary)",borderColor:"var(--bear-border-default)",borderBottomColor:"var(--bear-bg-primary)",color:"var(--bear-text-primary)"}:void 0:{color:"var(--bear-text-muted)"};return s.jsxs("button",{role:"tab","aria-selected":r,disabled:e,onClick:()=>!e&&d(o),className:b.cn("Bear-Tabs__tab",r&&"Bear-Tabs__tab--active",i,v[t],!r&&"hover:bear-bg-[var(--bear-bg-tertiary)] hover:bear-text-[var(--bear-text-primary)]",e&&"Bear-Tabs__tab--disabled bear-opacity-50 bear-cursor-not-allowed"),style:m,children:[c&&s.jsx("span",{className:"Bear-Tabs__tab-icon",children:c}),s.jsx("span",{className:"Bear-Tabs__tab-label",children:n})]})};exports.Tab=y;exports.Tabs=T;exports.TabsContext=x;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),p=require("react"),t=require("../../utils/cn.cjs"),S=require("../../utils/generateBearId.utils.cjs"),g=require("../../utils/useBearId.cjs"),f=require("../../context/BearProvider.cjs"),B=require("./Tabs.const.cjs"),x=p.createContext(null),I=({children:b,value:n,defaultTab:r,variant:c="line",onChange:a,className:i,testId:l,id:s})=>{const d=g.useBearId("Tabs"),e=S.resolveBearId(s,d),{density:u}=f.useBearDensityOptional(),m=u==="compact",[v,T]=p.useState(r),_=n!==void 0,C=_?n:v,A=y=>{_||T(y),a==null||a(y)};return o.jsx(x.Provider,{value:{activeTab:C,setActiveTab:A,variant:c,compact:m},children:o.jsx("div",{id:e,"data-testid":l,className:t.cn("Bear-Tabs",i),children:b})})},j=({id:b,children:n,disabled:r=!1,icon:c})=>{const a=p.useContext(x);if(!a)throw new Error("Tab must be used within Tabs");const{activeTab:i,setActiveTab:l,variant:s,compact:d}=a,e=i===b,u=d?B.TABS_TAB_PADDING_COMPACT_CLASSES:B.TABS_TAB_PADDING_CLASSES,m=t.cn("bear-flex bear-items-center bear-gap-2 bear-text-sm bear-font-medium bear-transition-colors",u),v={line:t.cn("bear-border-b-2 bear--mb-px",e?"bear-border-primary-500 bear-text-primary-600 dark:bear-text-primary-400":"bear-border-transparent hover:bear-border-[var(--bear-border-default)]"),pills:t.cn("bear-rounded-md",e&&"bear-shadow-sm"),enclosed:t.cn("bear-rounded-t-lg bear-border bear-border-transparent",e&&"bear--mb-px")},T=r?void 0:e?s==="pills"?{backgroundColor:"var(--bear-bg-primary)",color:"var(--bear-text-primary)"}:s==="enclosed"?{backgroundColor:"var(--bear-bg-primary)",borderColor:"var(--bear-border-default)",borderBottomColor:"var(--bear-bg-primary)",color:"var(--bear-text-primary)"}:void 0:{color:"var(--bear-text-muted)"};return o.jsxs("button",{role:"tab","aria-selected":e,disabled:r,onClick:()=>!r&&l(b),className:t.cn("Bear-Tabs__tab",e&&"Bear-Tabs__tab--active",m,v[s],!e&&"hover:bear-bg-[var(--bear-bg-tertiary)] hover:bear-text-[var(--bear-text-primary)]",r&&"Bear-Tabs__tab--disabled bear-opacity-50 bear-cursor-not-allowed"),style:T,children:[c&&o.jsx("span",{className:"Bear-Tabs__tab-icon",children:c}),o.jsx("span",{className:"Bear-Tabs__tab-label",children:n})]})};exports.Tab=j;exports.Tabs=I;exports.TabsContext=x;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A="bear-px-4 bear-py-2",S="bear-px-3 bear-py-1";exports.TABS_TAB_PADDING_CLASSES=A;exports.TABS_TAB_PADDING_COMPACT_CLASSES=S;
@@ -1 +1,3 @@
1
1
  export declare const T_A_B_S_ROOT_CLASS = "Bear-Tabs";
2
+ export declare const TABS_TAB_PADDING_CLASSES = "bear-px-4 bear-py-2";
3
+ export declare const TABS_TAB_PADDING_COMPACT_CLASSES = "bear-px-3 bear-py-1";
@@ -0,0 +1,5 @@
1
+ const A = "bear-px-4 bear-py-2", S = "bear-px-3 bear-py-1";
2
+ export {
3
+ A as TABS_TAB_PADDING_CLASSES,
4
+ S as TABS_TAB_PADDING_COMPACT_CLASSES
5
+ };