@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
package/README.md CHANGED
@@ -6,6 +6,21 @@ Strong, reliable React UI components. Tailwind-powered, zero config required. Th
6
6
 
7
7
  Visit the [Bear UI Portal](https://bearui.com/) to explore all components, view live examples, and browse the documentation.
8
8
 
9
+ ## Sanity / Playwright
10
+
11
+ ```bash
12
+ # Install browsers once (required — missing Chromium yields 0 passes)
13
+ cd portal && npx playwright install chromium
14
+
15
+ # Critical-path smoke (recommended before release)
16
+ cd portal && npm run test:e2e:smoke
17
+
18
+ # Full portal suite
19
+ cd portal && npm run test:e2e
20
+ ```
21
+
22
+ `BEAR_E2E_SMOKE=1` runs `e2e/specs/smoke.spec.ts` only. The e2e webServer builds Bear, then starts the portal on port `5174`.
23
+
9
24
  ## Features
10
25
 
11
26
  - **Tailwind-Powered**: Built with Tailwind CSS, zero config required
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),x=require("../../utils/cn.cjs");require("react");const u=({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-primary-600 bear-text-white",dark:"bear-bg-gray-900 bear-text-white dark:bear-bg-black"},m=n?"bear-shadow-md bear-border-b bear-border-gray-200/10":"";return e.jsx("header",{className:x.cn("Bear-AppBar","bear-w-full bear-h-16 bear-px-4 bear-flex bear-items-center",d[t],o[b],p[r],m,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=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("react/jsx-runtime"),_=require("./AppBar.const.cjs"),N=require("../../context/BearProvider.cjs");require("../../context/defaultTheme.cjs");const e=require("../../utils/cn.cjs");require("react");const l=require("../../utils/generateBearId.utils.cjs"),I=r=>{const{children:t,position:n=_.DEFAULT_APP_BAR_POSITION,variant:E=_.DEFAULT_APP_BAR_VARIANT,color:S=_.DEFAULT_APP_BAR_COLOR,className:s,leftContent:R,rightContent:B,centerContent:a,elevation:i=_.DEFAULT_APP_BAR_ELEVATION,dense:C,disableGutters:c=_.DEFAULT_APP_BAR_DISABLE_GUTTERS,enableColorOnDark:O=_.DEFAULT_APP_BAR_ENABLE_COLOR_ON_DARK,id:o,testId:T}=r,{density:L}=N.useBearDensityOptional(),P=C??L==="compact",d=o||l.generateBearId("AppBar");return A.jsx("header",{id:d,"data-testid":T,className:e.cn(_.APP_BAR_ROOT_CLASS,_.APP_BAR_BASE_CLASS,P?_.APP_BAR_HEIGHT_DENSE:_.APP_BAR_HEIGHT_COMFORTABLE,!c&&(P?_.APP_BAR_GUTTER_X_DENSE:_.APP_BAR_GUTTER_X),_.APP_BAR_POSITION_CLASSES[n],_.APP_BAR_VARIANT_CLASSES[E],_.APP_BAR_COLOR_CLASSES[S],O&&S==="default"&&_.APP_BAR_COLOR_ON_DARK_CLASS,i&&_.APP_BAR_ELEVATION_CLASS,P&&_.APP_BAR_DENSE_MODIFIER_CLASS,s),style:{backgroundColor:S==="primary"?"var(--bear-primary-600)":void 0},children:t??A.jsxs(A.Fragment,{children:[A.jsx("div",{className:e.cn(_.APP_BAR_SECTION_CLASS,_.APP_BAR_SECTION_BASE_CLASS),children:R}),A.jsx("div",{className:e.cn(_.APP_BAR_SECTION_CLASS,_.APP_BAR_SECTION_CENTER_CLASS,_.APP_BAR_SECTION_BASE_CLASS,_.APP_BAR_SECTION_GROW_CLASS),children:a}),A.jsx("div",{className:e.cn(_.APP_BAR_SECTION_CLASS,_.APP_BAR_SECTION_END_CLASS,_.APP_BAR_SECTION_BASE_CLASS),children:B})]})})};exports.AppBar=I;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _="Bear-AppBar",A="Bear-AppBar--dense",e="Bear-AppBar__section",P="Bear-AppBar__section--center",r="Bear-AppBar__section--end",S="sticky",a="default",E="primary",R=!0,t=!1,B=!1,T="bear-h-16",b="bear-h-12",L="bear-px-4",O="bear-px-3",C={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"},s={default:"",transparent:"bear-bg-transparent",blur:"bear-backdrop-blur-md"},c={default:"bear-bg-white bear-text-gray-900 dark:bear-bg-zinc-900 dark:bear-text-white",primary:"bear-bg-primary-600 bear-text-white",dark:"bear-bg-gray-900 bear-text-white dark:bear-bg-black"},n="dark:bear-bg-primary-600 dark:bear-text-white",N="bear-shadow-md bear-border-b bear-border-gray-200/10 dark:bear-border-gray-800/40",o="bear-w-full bear-flex bear-items-center",I="bear-flex bear-items-center bear-gap-4",i="bear-flex-1 bear-justify-center";exports.APP_BAR_BASE_CLASS=o;exports.APP_BAR_COLOR_CLASSES=c;exports.APP_BAR_COLOR_ON_DARK_CLASS=n;exports.APP_BAR_DENSE_MODIFIER_CLASS=A;exports.APP_BAR_ELEVATION_CLASS=N;exports.APP_BAR_GUTTER_X=L;exports.APP_BAR_GUTTER_X_DENSE=O;exports.APP_BAR_HEIGHT_COMFORTABLE=T;exports.APP_BAR_HEIGHT_DENSE=b;exports.APP_BAR_POSITION_CLASSES=C;exports.APP_BAR_ROOT_CLASS=_;exports.APP_BAR_SECTION_BASE_CLASS=I;exports.APP_BAR_SECTION_CENTER_CLASS=P;exports.APP_BAR_SECTION_CLASS=e;exports.APP_BAR_SECTION_END_CLASS=r;exports.APP_BAR_SECTION_GROW_CLASS=i;exports.APP_BAR_VARIANT_CLASSES=s;exports.DEFAULT_APP_BAR_COLOR=E;exports.DEFAULT_APP_BAR_DISABLE_GUTTERS=t;exports.DEFAULT_APP_BAR_ELEVATION=R;exports.DEFAULT_APP_BAR_ENABLE_COLOR_ON_DARK=B;exports.DEFAULT_APP_BAR_POSITION=S;exports.DEFAULT_APP_BAR_VARIANT=a;
@@ -1 +1,36 @@
1
- export declare const A_P_P_B_A_R_ROOT_CLASS = "Bear-AppBar";
1
+ export declare const APP_BAR_ROOT_CLASS = "Bear-AppBar";
2
+ export declare const APP_BAR_DENSE_MODIFIER_CLASS = "Bear-AppBar--dense";
3
+ export declare const APP_BAR_SECTION_CLASS = "Bear-AppBar__section";
4
+ export declare const APP_BAR_SECTION_CENTER_CLASS = "Bear-AppBar__section--center";
5
+ export declare const APP_BAR_SECTION_END_CLASS = "Bear-AppBar__section--end";
6
+ export declare const DEFAULT_APP_BAR_POSITION: "sticky";
7
+ export declare const DEFAULT_APP_BAR_VARIANT: "default";
8
+ export declare const DEFAULT_APP_BAR_COLOR: "primary";
9
+ export declare const DEFAULT_APP_BAR_ELEVATION = true;
10
+ export declare const DEFAULT_APP_BAR_DISABLE_GUTTERS = false;
11
+ export declare const DEFAULT_APP_BAR_ENABLE_COLOR_ON_DARK = false;
12
+ export declare const APP_BAR_HEIGHT_COMFORTABLE = "bear-h-16";
13
+ export declare const APP_BAR_HEIGHT_DENSE = "bear-h-12";
14
+ export declare const APP_BAR_GUTTER_X = "bear-px-4";
15
+ export declare const APP_BAR_GUTTER_X_DENSE = "bear-px-3";
16
+ export declare const APP_BAR_POSITION_CLASSES: {
17
+ readonly fixed: "bear-fixed bear-top-0 bear-left-0 bear-right-0 bear-z-50";
18
+ readonly sticky: "bear-sticky bear-top-0 bear-z-50";
19
+ readonly static: "bear-static";
20
+ readonly relative: "bear-relative";
21
+ };
22
+ export declare const APP_BAR_VARIANT_CLASSES: {
23
+ readonly default: "";
24
+ readonly transparent: "bear-bg-transparent";
25
+ readonly blur: "bear-backdrop-blur-md";
26
+ };
27
+ export declare const APP_BAR_COLOR_CLASSES: {
28
+ readonly default: "bear-bg-white bear-text-gray-900 dark:bear-bg-zinc-900 dark:bear-text-white";
29
+ readonly primary: "bear-bg-primary-600 bear-text-white";
30
+ readonly dark: "bear-bg-gray-900 bear-text-white dark:bear-bg-black";
31
+ };
32
+ export declare const APP_BAR_COLOR_ON_DARK_CLASS = "dark:bear-bg-primary-600 dark:bear-text-white";
33
+ export declare const APP_BAR_ELEVATION_CLASS = "bear-shadow-md bear-border-b bear-border-gray-200/10 dark:bear-border-gray-800/40";
34
+ export declare const APP_BAR_BASE_CLASS = "bear-w-full bear-flex bear-items-center";
35
+ export declare const APP_BAR_SECTION_BASE_CLASS = "bear-flex bear-items-center bear-gap-4";
36
+ export declare const APP_BAR_SECTION_GROW_CLASS = "bear-flex-1 bear-justify-center";
@@ -0,0 +1,39 @@
1
+ const e = "Bear-AppBar", r = "Bear-AppBar--dense", _ = "Bear-AppBar__section", A = "Bear-AppBar__section--center", a = "Bear-AppBar__section--end", t = "sticky", b = "default", P = "primary", S = !0, s = !1, E = !1, R = "bear-h-16", c = "bear-h-12", B = "bear-px-4", n = "bear-px-3", o = {
2
+ fixed: "bear-fixed bear-top-0 bear-left-0 bear-right-0 bear-z-50",
3
+ sticky: "bear-sticky bear-top-0 bear-z-50",
4
+ static: "bear-static",
5
+ relative: "bear-relative"
6
+ }, L = {
7
+ default: "",
8
+ transparent: "bear-bg-transparent",
9
+ blur: "bear-backdrop-blur-md"
10
+ }, T = {
11
+ default: "bear-bg-white bear-text-gray-900 dark:bear-bg-zinc-900 dark:bear-text-white",
12
+ primary: "bear-bg-primary-600 bear-text-white",
13
+ dark: "bear-bg-gray-900 bear-text-white dark:bear-bg-black"
14
+ }, O = "dark:bear-bg-primary-600 dark:bear-text-white", i = "bear-shadow-md bear-border-b bear-border-gray-200/10 dark:bear-border-gray-800/40", C = "bear-w-full bear-flex bear-items-center", p = "bear-flex bear-items-center bear-gap-4", d = "bear-flex-1 bear-justify-center";
15
+ export {
16
+ C as APP_BAR_BASE_CLASS,
17
+ T as APP_BAR_COLOR_CLASSES,
18
+ O as APP_BAR_COLOR_ON_DARK_CLASS,
19
+ r as APP_BAR_DENSE_MODIFIER_CLASS,
20
+ i as APP_BAR_ELEVATION_CLASS,
21
+ B as APP_BAR_GUTTER_X,
22
+ n as APP_BAR_GUTTER_X_DENSE,
23
+ R as APP_BAR_HEIGHT_COMFORTABLE,
24
+ c as APP_BAR_HEIGHT_DENSE,
25
+ o as APP_BAR_POSITION_CLASSES,
26
+ e as APP_BAR_ROOT_CLASS,
27
+ p as APP_BAR_SECTION_BASE_CLASS,
28
+ A as APP_BAR_SECTION_CENTER_CLASS,
29
+ _ as APP_BAR_SECTION_CLASS,
30
+ a as APP_BAR_SECTION_END_CLASS,
31
+ d as APP_BAR_SECTION_GROW_CLASS,
32
+ L as APP_BAR_VARIANT_CLASSES,
33
+ P as DEFAULT_APP_BAR_COLOR,
34
+ s as DEFAULT_APP_BAR_DISABLE_GUTTERS,
35
+ S as DEFAULT_APP_BAR_ELEVATION,
36
+ E as DEFAULT_APP_BAR_ENABLE_COLOR_ON_DARK,
37
+ t as DEFAULT_APP_BAR_POSITION,
38
+ b as DEFAULT_APP_BAR_VARIANT
39
+ };
@@ -1,54 +1,77 @@
1
- import { jsx as e, jsxs as f, Fragment as x } from "react/jsx-runtime";
2
- import { cn as g } from "../../utils/cn.js";
1
+ import { jsx as _, jsxs as l, Fragment as m } from "react/jsx-runtime";
2
+ import { DEFAULT_APP_BAR_POSITION as I, DEFAULT_APP_BAR_VARIANT as p, DEFAULT_APP_BAR_COLOR as D, DEFAULT_APP_BAR_ELEVATION as F, DEFAULT_APP_BAR_DISABLE_GUTTERS as U, DEFAULT_APP_BAR_ENABLE_COLOR_ON_DARK as h, APP_BAR_SECTION_BASE_CLASS as r, APP_BAR_SECTION_CLASS as S, APP_BAR_SECTION_GROW_CLASS as v, APP_BAR_SECTION_CENTER_CLASS as f, APP_BAR_SECTION_END_CLASS as G, APP_BAR_DENSE_MODIFIER_CLASS as u, APP_BAR_ELEVATION_CLASS as y, APP_BAR_COLOR_ON_DARK_CLASS as b, APP_BAR_COLOR_CLASSES as g, APP_BAR_VARIANT_CLASSES as H, APP_BAR_POSITION_CLASSES as V, APP_BAR_GUTTER_X_DENSE as x, APP_BAR_GUTTER_X as j, APP_BAR_HEIGHT_DENSE as k, APP_BAR_HEIGHT_COMFORTABLE as K, APP_BAR_BASE_CLASS as M, APP_BAR_ROOT_CLASS as X } from "./AppBar.const.js";
3
+ import { useBearDensityOptional as W } from "../../context/BearProvider.js";
4
+ import "../../context/defaultTheme.js";
5
+ import { cn as A } from "../../utils/cn.js";
3
6
  import "react";
4
- const u = ({
5
- children: a,
6
- position: t = "sticky",
7
- variant: b = "default",
8
- color: r = "primary",
9
- className: s,
10
- leftContent: i,
11
- rightContent: l,
12
- centerContent: c,
13
- elevation: n = !0
14
- }) => {
15
- const d = {
16
- fixed: "bear-fixed bear-top-0 bear-left-0 bear-right-0 bear-z-50",
17
- sticky: "bear-sticky bear-top-0 bear-z-50",
18
- static: "bear-static",
19
- relative: "bear-relative"
20
- }, o = {
21
- default: "",
22
- transparent: "bear-bg-transparent",
23
- blur: "bear-backdrop-blur-md"
24
- }, p = {
25
- default: "bear-bg-white bear-text-gray-900 dark:bear-bg-zinc-900 dark:bear-text-white",
26
- primary: "bear-bg-primary-600 bear-text-white",
27
- dark: "bear-bg-gray-900 bear-text-white dark:bear-bg-black"
28
- }, m = n ? "bear-shadow-md bear-border-b bear-border-gray-200/10" : "";
29
- return /* @__PURE__ */ e(
7
+ import { generateBearId as q } from "../../utils/generateBearId.utils.js";
8
+ const __ = (t) => {
9
+ const {
10
+ children: E,
11
+ position: R = I,
12
+ variant: o = p,
13
+ color: P = D,
14
+ className: a,
15
+ leftContent: n,
16
+ rightContent: i,
17
+ centerContent: B,
18
+ elevation: s = F,
19
+ dense: C,
20
+ disableGutters: O = U,
21
+ enableColorOnDark: L = h,
22
+ id: T,
23
+ testId: d
24
+ } = t, { density: N } = W(), e = C ?? N === "compact", c = T || q("AppBar");
25
+ return /* @__PURE__ */ _(
30
26
  "header",
31
27
  {
32
- className: g(
33
- "Bear-AppBar",
34
- "bear-w-full bear-h-16 bear-px-4 bear-flex bear-items-center",
35
- d[t],
36
- o[b],
37
- p[r],
38
- m,
39
- s
28
+ id: c,
29
+ "data-testid": d,
30
+ className: A(
31
+ X,
32
+ M,
33
+ e ? k : K,
34
+ !O && (e ? x : j),
35
+ V[R],
36
+ H[o],
37
+ g[P],
38
+ L && P === "default" && b,
39
+ s && y,
40
+ e && u,
41
+ a
40
42
  ),
41
43
  style: {
42
- backgroundColor: r === "primary" ? "var(--bear-primary-600)" : void 0
44
+ backgroundColor: P === "primary" ? "var(--bear-primary-600)" : void 0
43
45
  },
44
- children: a ?? /* @__PURE__ */ f(x, { children: [
45
- /* @__PURE__ */ e("div", { className: "bear-flex bear-items-center bear-gap-4", children: i }),
46
- /* @__PURE__ */ e("div", { className: "bear-flex-1 bear-flex bear-items-center bear-justify-center", children: c }),
47
- /* @__PURE__ */ e("div", { className: "bear-flex bear-items-center bear-gap-4", children: l })
46
+ children: E ?? /* @__PURE__ */ l(m, { children: [
47
+ /* @__PURE__ */ _("div", { className: A(S, r), children: n }),
48
+ /* @__PURE__ */ _(
49
+ "div",
50
+ {
51
+ className: A(
52
+ S,
53
+ f,
54
+ r,
55
+ v
56
+ ),
57
+ children: B
58
+ }
59
+ ),
60
+ /* @__PURE__ */ _(
61
+ "div",
62
+ {
63
+ className: A(
64
+ S,
65
+ G,
66
+ r
67
+ ),
68
+ children: i
69
+ }
70
+ )
48
71
  ] })
49
72
  }
50
73
  );
51
74
  };
52
75
  export {
53
- u as AppBar
76
+ __ as AppBar
54
77
  };
@@ -1,14 +1,20 @@
1
1
  import { ReactNode } from 'react';
2
+ export type AppBarPosition = 'fixed' | 'sticky' | 'static' | 'relative';
3
+ export type AppBarVariant = 'default' | 'transparent' | 'blur';
4
+ export type AppBarColor = 'default' | 'primary' | 'dark';
2
5
  export interface AppBarProps {
3
6
  testId?: string;
4
7
  id?: string;
5
8
  children?: ReactNode;
6
- position?: 'fixed' | 'sticky' | 'static' | 'relative';
7
- variant?: 'default' | 'transparent' | 'blur';
8
- color?: 'default' | 'primary' | 'dark';
9
+ position?: AppBarPosition;
10
+ variant?: AppBarVariant;
11
+ color?: AppBarColor;
9
12
  className?: string;
10
13
  leftContent?: ReactNode;
11
14
  rightContent?: ReactNode;
12
15
  centerContent?: ReactNode;
13
16
  elevation?: boolean;
17
+ dense?: boolean;
18
+ disableGutters?: boolean;
19
+ enableColorOnDark?: boolean;
14
20
  }
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("react/jsx-runtime"),e=require("./Backdrop.const.cjs"),A=require("../../utils/cn.cjs");require("react");const C=require("../../utils/generateBearId.utils.cjs"),I=require("../../utils/useBearId.cjs"),D=n=>{const{id:d,testId:i,open:r=!0,invisible:a=!1,blur:c=!1,zIndex:o=e.BACKDROP_DEFAULT_Z_INDEX,onClick:S,children:t,className:u,...s}=n,B=I.useBearId("Backdrop"),l=C.resolveBearId(d,B);return!r&&!t?null:_.jsx("div",{...s,id:l,"data-testid":i,"aria-hidden":!r,onClick:S,className:A.cn(e.BACKDROP_ROOT_CLASS,e.BACKDROP_BASE_CLASSES,r?e.BACKDROP_VISIBLE_CLASSES:e.BACKDROP_HIDDEN_CLASSES,!a&&e.BACKDROP_TINT_CLASSES,c&&e.BACKDROP_BLUR_CLASSES,u),style:{zIndex:o,...s.style},children:t})};exports.Backdrop=D;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S="Bear-Backdrop",e=11e3,A="bear-fixed bear-inset-0 bear-flex bear-items-center bear-justify-center bear-transition-opacity bear-duration-200",_="bear-opacity-100 bear-pointer-events-auto",r="bear-opacity-0 bear-pointer-events-none",t="bear-bg-black/50 dark:bear-bg-black/60",a="bear-backdrop-blur-sm";exports.BACKDROP_BASE_CLASSES=A;exports.BACKDROP_BLUR_CLASSES=a;exports.BACKDROP_DEFAULT_Z_INDEX=e;exports.BACKDROP_HIDDEN_CLASSES=r;exports.BACKDROP_ROOT_CLASS=S;exports.BACKDROP_TINT_CLASSES=t;exports.BACKDROP_VISIBLE_CLASSES=_;
@@ -0,0 +1,7 @@
1
+ export declare const BACKDROP_ROOT_CLASS = "Bear-Backdrop";
2
+ export declare const BACKDROP_DEFAULT_Z_INDEX = 11000;
3
+ export declare const BACKDROP_BASE_CLASSES = "bear-fixed bear-inset-0 bear-flex bear-items-center bear-justify-center bear-transition-opacity bear-duration-200";
4
+ export declare const BACKDROP_VISIBLE_CLASSES = "bear-opacity-100 bear-pointer-events-auto";
5
+ export declare const BACKDROP_HIDDEN_CLASSES = "bear-opacity-0 bear-pointer-events-none";
6
+ export declare const BACKDROP_TINT_CLASSES = "bear-bg-black/50 dark:bear-bg-black/60";
7
+ export declare const BACKDROP_BLUR_CLASSES = "bear-backdrop-blur-sm";
@@ -0,0 +1,10 @@
1
+ const e = "Bear-Backdrop", a = 11e3, r = "bear-fixed bear-inset-0 bear-flex bear-items-center bear-justify-center bear-transition-opacity bear-duration-200", t = "bear-opacity-100 bear-pointer-events-auto", b = "bear-opacity-0 bear-pointer-events-none", n = "bear-bg-black/50 dark:bear-bg-black/60", o = "bear-backdrop-blur-sm";
2
+ export {
3
+ r as BACKDROP_BASE_CLASSES,
4
+ o as BACKDROP_BLUR_CLASSES,
5
+ a as BACKDROP_DEFAULT_Z_INDEX,
6
+ b as BACKDROP_HIDDEN_CLASSES,
7
+ e as BACKDROP_ROOT_CLASS,
8
+ n as BACKDROP_TINT_CLASSES,
9
+ t as BACKDROP_VISIBLE_CLASSES
10
+ };
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ import { BackdropProps } from './Backdrop.types';
3
+ export declare const Backdrop: FC<BackdropProps>;
@@ -0,0 +1,43 @@
1
+ import { jsx as B } from "react/jsx-runtime";
2
+ import { BACKDROP_DEFAULT_Z_INDEX as C, BACKDROP_BLUR_CLASSES as l, BACKDROP_TINT_CLASSES as c, BACKDROP_VISIBLE_CLASSES as D, BACKDROP_HIDDEN_CLASSES as I, BACKDROP_BASE_CLASSES as p, BACKDROP_ROOT_CLASS as E } from "./Backdrop.const.js";
3
+ import { cn as L } from "../../utils/cn.js";
4
+ import "react";
5
+ import { resolveBearId as O } from "../../utils/generateBearId.utils.js";
6
+ import { useBearId as R } from "../../utils/useBearId.js";
7
+ const k = (o) => {
8
+ const {
9
+ id: s,
10
+ testId: S,
11
+ open: r = !0,
12
+ invisible: d = !1,
13
+ blur: i = !1,
14
+ zIndex: a = C,
15
+ onClick: n,
16
+ children: e,
17
+ className: A,
18
+ ...t
19
+ } = o, _ = R("Backdrop"), m = O(s, _);
20
+ return !r && !e ? null : /* @__PURE__ */ B(
21
+ "div",
22
+ {
23
+ ...t,
24
+ id: m,
25
+ "data-testid": S,
26
+ "aria-hidden": !r,
27
+ onClick: n,
28
+ className: L(
29
+ E,
30
+ p,
31
+ r ? D : I,
32
+ !d && c,
33
+ i && l,
34
+ A
35
+ ),
36
+ style: { zIndex: a, ...t.style },
37
+ children: e
38
+ }
39
+ );
40
+ };
41
+ export {
42
+ k as Backdrop
43
+ };
@@ -0,0 +1,12 @@
1
+ import { HTMLAttributes, ReactNode, MouseEvent } from 'react';
2
+ export interface BackdropProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onClick'> {
3
+ id?: string;
4
+ testId?: string;
5
+ open?: boolean;
6
+ invisible?: boolean;
7
+ blur?: boolean;
8
+ zIndex?: number;
9
+ onClick?: (event: MouseEvent<HTMLDivElement>) => void;
10
+ children?: ReactNode;
11
+ className?: string;
12
+ }
@@ -0,0 +1,2 @@
1
+ export { Backdrop } from './Backdrop';
2
+ export type { BackdropProps } from './Backdrop.types';
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),b=require("../../utils/cn.cjs");require("react");const u=({items:s,value:n,onChange:t,showLabels:i="active",variant:l="default",className:c})=>{const d={default:"bear-bg-zinc-900 bear-border-t bear-border-zinc-800",elevated:"bear-bg-zinc-900 bear-shadow-[0_-4px_20px_rgba(0,0,0,0.3)]",transparent:"bear-bg-zinc-900/80 bear-backdrop-blur-md bear-border-t bear-border-zinc-800/50"},o=e=>i===!0||i==="always"?!0:i==="active"?e:!1;return r.jsx("nav",{className:b.cn("bear-fixed bear-bottom-0 bear-left-0 bear-right-0 bear-z-50 bear-h-16 bear-flex bear-items-center bear-justify-around bear-px-2",d[l],c),children:s.map(e=>{const a=n===e.id;return r.jsxs("button",{onClick:()=>!e.disabled&&(t==null?void 0:t(e.id)),disabled:e.disabled,className:b.cn("bear-flex bear-flex-col bear-items-center bear-justify-center bear-flex-1 bear-h-full bear-py-2 bear-transition-all",a?"bear-text-primary-400":"bear-text-zinc-500 hover:bear-text-zinc-300",e.disabled&&"bear-opacity-50 bear-cursor-not-allowed"),children:[r.jsxs("div",{className:"bear-relative",children:[r.jsx("span",{className:b.cn("bear-transition-transform",a&&"bear-scale-110"),children:e.icon}),e.badge!==void 0&&r.jsx("span",{className:"bear-absolute -bear-top-1 -bear-right-1 bear-min-w-[16px] bear-h-4 bear-px-1 bear-flex bear-items-center bear-justify-center bear-text-xs bear-font-medium bear-bg-primary-500 bear-text-white bear-rounded-full",children:e.badge})]}),o(a)&&r.jsx("span",{className:b.cn("bear-text-xs bear-mt-1 bear-transition-all",a?"bear-font-medium":""),children:e.label})]},e.id)})})};exports.BottomNavigation=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),r=require("./BottomNavigation.const.cjs"),s=require("../../utils/cn.cjs");require("react");const f=require("../../utils/generateBearId.utils.cjs"),m=require("../../utils/useBearId.cjs"),A=b=>{const{items:o,value:l,onChange:n,showLabels:i="active",variant:c="default",className:d,id:u,testId:N}=b,x=m.useBearId("BottomNavigation"),I=f.resolveBearId(u,x),T=e=>i===!0||i==="always"?!0:i==="active"?e:!1;return a.jsx("nav",{id:I,"data-testid":N,className:s.cn(r.BOTTOM_NAVIGATION_ROOT_CLASS,"bear-fixed bear-bottom-0 bear-left-0 bear-right-0 bear-z-50 bear-h-16 bear-flex bear-items-center bear-justify-around bear-px-2",r.BOTTOM_NAVIGATION_VARIANT_CLASSES[c],d),children:o.map(e=>{const t=l===e.id;return a.jsxs("button",{type:"button",onClick:()=>!e.disabled&&(n==null?void 0:n(e.id)),disabled:e.disabled,className:s.cn(`${r.BOTTOM_NAVIGATION_ROOT_CLASS}__item`,"bear-flex bear-flex-col bear-items-center bear-justify-center bear-flex-1 bear-h-full bear-py-2 bear-transition-all",t?r.BOTTOM_NAVIGATION_ACTIVE_CLASSES:r.BOTTOM_NAVIGATION_INACTIVE_CLASSES,e.disabled&&"bear-opacity-50 bear-cursor-not-allowed"),children:[a.jsxs("div",{className:"bear-relative",children:[a.jsx("span",{className:s.cn("bear-transition-transform",t&&"bear-scale-110"),children:e.icon}),e.badge!==void 0&&a.jsx("span",{className:"bear-absolute -bear-top-1 -bear-right-1 bear-min-w-[16px] bear-h-4 bear-px-1 bear-flex bear-items-center bear-justify-center bear-text-xs bear-font-medium bear-bg-primary-500 bear-text-white bear-rounded-full",children:e.badge})]}),T(t)&&a.jsx("span",{className:s.cn("bear-text-xs bear-mt-1 bear-transition-all",t?"bear-font-medium":""),children:e.label})]},e.id)})})};exports.BottomNavigation=A;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r="Bear-BottomNavigation",e={default:"bear-bg-white dark:bear-bg-zinc-900 bear-border-t bear-border-gray-200 dark:bear-border-zinc-800",elevated:"bear-bg-white dark:bear-bg-zinc-900 bear-shadow-[0_-4px_20px_rgba(0,0,0,0.08)] dark:bear-shadow-[0_-4px_20px_rgba(0,0,0,0.3)]",transparent:"bear-bg-white/80 dark:bear-bg-zinc-900/80 bear-backdrop-blur-md bear-border-t bear-border-gray-200/70 dark:bear-border-zinc-800/50"},a="bear-text-primary-600 dark:bear-text-primary-400",b="bear-text-gray-500 hover:bear-text-gray-800 dark:bear-text-zinc-500 dark:hover:bear-text-zinc-300";exports.BOTTOM_NAVIGATION_ACTIVE_CLASSES=a;exports.BOTTOM_NAVIGATION_INACTIVE_CLASSES=b;exports.BOTTOM_NAVIGATION_ROOT_CLASS=r;exports.BOTTOM_NAVIGATION_VARIANT_CLASSES=e;
@@ -1 +1,8 @@
1
- export declare const B_O_T_T_O_M_N_A_V_I_G_A_T_I_O_N_ROOT_CLASS = "Bear-BottomNavigation";
1
+ export declare const BOTTOM_NAVIGATION_ROOT_CLASS = "Bear-BottomNavigation";
2
+ export declare const BOTTOM_NAVIGATION_VARIANT_CLASSES: {
3
+ readonly default: "bear-bg-white dark:bear-bg-zinc-900 bear-border-t bear-border-gray-200 dark:bear-border-zinc-800";
4
+ readonly elevated: "bear-bg-white dark:bear-bg-zinc-900 bear-shadow-[0_-4px_20px_rgba(0,0,0,0.08)] dark:bear-shadow-[0_-4px_20px_rgba(0,0,0,0.3)]";
5
+ readonly transparent: "bear-bg-white/80 dark:bear-bg-zinc-900/80 bear-backdrop-blur-md bear-border-t bear-border-gray-200/70 dark:bear-border-zinc-800/50";
6
+ };
7
+ export declare const BOTTOM_NAVIGATION_ACTIVE_CLASSES = "bear-text-primary-600 dark:bear-text-primary-400";
8
+ export declare const BOTTOM_NAVIGATION_INACTIVE_CLASSES = "bear-text-gray-500 hover:bear-text-gray-800 dark:bear-text-zinc-500 dark:hover:bear-text-zinc-300";
@@ -0,0 +1,11 @@
1
+ const r = "Bear-BottomNavigation", a = {
2
+ default: "bear-bg-white dark:bear-bg-zinc-900 bear-border-t bear-border-gray-200 dark:bear-border-zinc-800",
3
+ elevated: "bear-bg-white dark:bear-bg-zinc-900 bear-shadow-[0_-4px_20px_rgba(0,0,0,0.08)] dark:bear-shadow-[0_-4px_20px_rgba(0,0,0,0.3)]",
4
+ transparent: "bear-bg-white/80 dark:bear-bg-zinc-900/80 bear-backdrop-blur-md bear-border-t bear-border-gray-200/70 dark:bear-border-zinc-800/50"
5
+ }, e = "bear-text-primary-600 dark:bear-text-primary-400", b = "bear-text-gray-500 hover:bear-text-gray-800 dark:bear-text-zinc-500 dark:hover:bear-text-zinc-300";
6
+ export {
7
+ e as BOTTOM_NAVIGATION_ACTIVE_CLASSES,
8
+ b as BOTTOM_NAVIGATION_INACTIVE_CLASSES,
9
+ r as BOTTOM_NAVIGATION_ROOT_CLASS,
10
+ a as BOTTOM_NAVIGATION_VARIANT_CLASSES
11
+ };
@@ -1,50 +1,68 @@
1
- import { jsx as a, jsxs as l } from "react/jsx-runtime";
2
- import { cn as b } from "../../utils/cn.js";
1
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
2
+ import { BOTTOM_NAVIGATION_ACTIVE_CLASSES as A, BOTTOM_NAVIGATION_INACTIVE_CLASSES as I, BOTTOM_NAVIGATION_ROOT_CLASS as o, BOTTOM_NAVIGATION_VARIANT_CLASSES as T } from "./BottomNavigation.const.js";
3
+ import { cn as t } from "../../utils/cn.js";
3
4
  import "react";
4
- const m = ({
5
- items: s,
6
- value: n,
7
- onChange: t,
8
- showLabels: i = "active",
9
- variant: c = "default",
10
- className: d
11
- }) => {
12
- const o = {
13
- default: "bear-bg-zinc-900 bear-border-t bear-border-zinc-800",
14
- elevated: "bear-bg-zinc-900 bear-shadow-[0_-4px_20px_rgba(0,0,0,0.3)]",
15
- transparent: "bear-bg-zinc-900/80 bear-backdrop-blur-md bear-border-t bear-border-zinc-800/50"
16
- }, u = (e) => i === !0 || i === "always" ? !0 : i === "active" ? e : !1;
17
- return /* @__PURE__ */ a("nav", { className: b(
18
- "bear-fixed bear-bottom-0 bear-left-0 bear-right-0 bear-z-50 bear-h-16 bear-flex bear-items-center bear-justify-around bear-px-2",
19
- o[c],
20
- d
21
- ), children: s.map((e) => {
22
- const r = n === e.id;
23
- return /* @__PURE__ */ l(
24
- "button",
25
- {
26
- onClick: () => !e.disabled && (t == null ? void 0 : t(e.id)),
27
- disabled: e.disabled,
28
- className: b(
29
- "bear-flex bear-flex-col bear-items-center bear-justify-center bear-flex-1 bear-h-full bear-py-2 bear-transition-all",
30
- r ? "bear-text-primary-400" : "bear-text-zinc-500 hover:bear-text-zinc-300",
31
- e.disabled && "bear-opacity-50 bear-cursor-not-allowed"
32
- ),
33
- children: [
34
- /* @__PURE__ */ l("div", { className: "bear-relative", children: [
35
- /* @__PURE__ */ a("span", { className: b("bear-transition-transform", r && "bear-scale-110"), children: e.icon }),
36
- e.badge !== void 0 && /* @__PURE__ */ a("span", { className: "bear-absolute -bear-top-1 -bear-right-1 bear-min-w-[16px] bear-h-4 bear-px-1 bear-flex bear-items-center bear-justify-center bear-text-xs bear-font-medium bear-bg-primary-500 bear-text-white bear-rounded-full", children: e.badge })
37
- ] }),
38
- u(r) && /* @__PURE__ */ a("span", { className: b(
39
- "bear-text-xs bear-mt-1 bear-transition-all",
40
- r ? "bear-font-medium" : ""
41
- ), children: e.label })
42
- ]
43
- },
44
- e.id
45
- );
46
- }) });
5
+ import { resolveBearId as h } from "../../utils/generateBearId.utils.js";
6
+ import { useBearId as O } from "../../utils/useBearId.js";
7
+ const V = (l) => {
8
+ const {
9
+ items: n,
10
+ value: d,
11
+ onChange: s,
12
+ showLabels: b = "active",
13
+ variant: c = "default",
14
+ className: m,
15
+ id: f,
16
+ testId: u
17
+ } = l, p = O("BottomNavigation"), N = h(f, p), x = (e) => b === !0 || b === "always" ? !0 : b === "active" ? e : !1;
18
+ return /* @__PURE__ */ r(
19
+ "nav",
20
+ {
21
+ id: N,
22
+ "data-testid": u,
23
+ className: t(
24
+ o,
25
+ "bear-fixed bear-bottom-0 bear-left-0 bear-right-0 bear-z-50 bear-h-16 bear-flex bear-items-center bear-justify-around bear-px-2",
26
+ T[c],
27
+ m
28
+ ),
29
+ children: n.map((e) => {
30
+ const a = d === e.id;
31
+ return /* @__PURE__ */ i(
32
+ "button",
33
+ {
34
+ type: "button",
35
+ onClick: () => !e.disabled && (s == null ? void 0 : s(e.id)),
36
+ disabled: e.disabled,
37
+ className: t(
38
+ `${o}__item`,
39
+ "bear-flex bear-flex-col bear-items-center bear-justify-center bear-flex-1 bear-h-full bear-py-2 bear-transition-all",
40
+ a ? A : I,
41
+ e.disabled && "bear-opacity-50 bear-cursor-not-allowed"
42
+ ),
43
+ children: [
44
+ /* @__PURE__ */ i("div", { className: "bear-relative", children: [
45
+ /* @__PURE__ */ r("span", { className: t("bear-transition-transform", a && "bear-scale-110"), children: e.icon }),
46
+ e.badge !== void 0 && /* @__PURE__ */ r("span", { className: "bear-absolute -bear-top-1 -bear-right-1 bear-min-w-[16px] bear-h-4 bear-px-1 bear-flex bear-items-center bear-justify-center bear-text-xs bear-font-medium bear-bg-primary-500 bear-text-white bear-rounded-full", children: e.badge })
47
+ ] }),
48
+ x(a) && /* @__PURE__ */ r(
49
+ "span",
50
+ {
51
+ className: t(
52
+ "bear-text-xs bear-mt-1 bear-transition-all",
53
+ a ? "bear-font-medium" : ""
54
+ ),
55
+ children: e.label
56
+ }
57
+ )
58
+ ]
59
+ },
60
+ e.id
61
+ );
62
+ })
63
+ }
64
+ );
47
65
  };
48
66
  export {
49
- m as BottomNavigation
67
+ V as BottomNavigation
50
68
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),b=require("react"),F=require("../../context/BearProvider.cjs"),H=require("../../utils/maxVisible.utils.cjs"),R=require("../../utils/cn.cjs"),v=require("../Dropdown/Dropdown.cjs"),u=require("../Icon/index.cjs"),c=require("./Breadcrumbs.const.cjs"),Z=N=>{const{items:n,separator:k,maxItems:p,itemsBeforeCollapse:x=c.BREADCRUMBS_DEFAULTS.ITEMS_BEFORE_COLLAPSE,itemsAfterCollapse:d=c.BREADCRUMBS_DEFAULTS.ITEMS_AFTER_COLLAPSE,className:D,size:h=c.BREADCRUMBS_DEFAULTS.SIZE,showHomeIcon:_=c.BREADCRUMBS_DEFAULTS.SHOW_HOME_ICON,testId:A,"aria-label":z="Breadcrumb"}=N,w=F.useBearThemeOptional(),[i,f]=b.useState(null),[M,E]=b.useState({}),[I,O]=b.useState(()=>typeof window<"u"?window.innerWidth:1200);b.useEffect(()=>{const e=()=>O(window.innerWidth);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),b.useEffect(()=>{f(null),E({})},[n]);const S=b.useMemo(()=>p==null?void 0:H.resolveMaxVisible(p,{width:I,theme:w}),[p,I,w]),U=()=>k||r.jsx(u.BearIcons.ChevronRightIcon,{className:R.cn(c.BREADCRUMBS_ICON_SIZE[h],"bear-text-zinc-500 bear-mx-2")}),y=(e,s,t)=>{const a=r.jsxs("span",{className:"bear-flex bear-items-center bear-gap-1 bear-max-w-[12rem] bear-truncate md:bear-max-w-none",children:[s===0&&_&&r.jsx(u.BearIcons.HomeIcon,{className:c.BREADCRUMBS_ICON_SIZE[h]}),e.icon,e.label]}),o=t?r.jsx("span",{className:"bear-text-zinc-300 bear-font-medium","aria-current":"page",children:a}):e.href?r.jsx("a",{href:e.href,className:"bear-text-zinc-400 hover:bear-text-primary-400 bear-transition-colors bear-truncate",children:a}):e.onClick?r.jsx("button",{type:"button",onClick:e.onClick,className:"bear-text-zinc-400 hover:bear-text-primary-400 bear-transition-colors bear-truncate",children:a}):r.jsx("span",{className:"bear-text-zinc-400 bear-truncate",children:a});if(e.dropdownItems&&e.dropdownItems.length>0&&!t){const m=M[s],j=e.dropdownItems.find(l=>l.key===m);return r.jsx(v.Dropdown,{placement:"bottom-start",closeOnSelect:!0,trigger:r.jsxs("button",{type:"button",className:"bear-inline-flex bear-items-center bear-gap-1 bear-text-zinc-400 hover:bear-text-primary-400 bear-transition-colors","aria-haspopup":"true",children:[a,j&&r.jsx("span",{className:"bear-ml-1 bear-max-w-[8rem] bear-truncate bear-text-xs bear-text-zinc-300",children:j.label}),r.jsx(u.BearIcons.ChevronDownIcon,{size:14})]}),items:e.dropdownItems.map(l=>({key:l.key,label:l.label,disabled:l.disabled,selected:m===l.key,onClick:()=>{var g;E(q=>({...q,[s]:l.key})),(g=l.onClick)==null||g.call(l)}}))})}return o},L=S!=null&&n.length>S,B=x,T=n.length-d;let C=n.map((e,s)=>({type:"item",item:e,index:s}));if(L){const e=n.slice(0,x),s=n.slice(-d),t=n.slice(x,n.length-d);C=[...e.map((a,o)=>({type:"item",item:a,index:o})),...t.length?[{type:"ellipsis",hidden:t}]:[],...s.map((a,o)=>({type:"item",item:a,index:n.length-d+o}))]}const P=i!=null&&i>=B&&i<T;return r.jsx("nav",{"data-testid":A,className:R.cn("bear-flex bear-min-w-0 bear-items-center bear-flex-wrap",c.BREADCRUMBS_SIZE[h],D),"aria-label":z,children:r.jsx("ol",{className:"bear-flex bear-min-w-0 bear-items-center bear-flex-wrap bear-list-none bear-p-0 bear-m-0",children:C.map((e,s)=>r.jsxs("li",{className:"bear-flex bear-min-w-0 bear-items-center",children:[s>0&&r.jsx("span",{"aria-hidden":"true",children:U()}),e.type==="ellipsis"?r.jsxs("span",{className:"bear-inline-flex bear-min-w-0 bear-max-w-full bear-items-center bear-gap-1",children:[r.jsx(v.Dropdown,{placement:"bottom-start",closeOnSelect:!0,trigger:r.jsx("button",{type:"button",className:"bear-inline-flex bear-items-center bear-justify-center bear-rounded bear-px-2 bear-py-1 bear-text-zinc-400 hover:bear-bg-[var(--bear-bg-tertiary)] hover:bear-text-primary-400 bear-transition-colors","aria-label":"Hidden breadcrumbs",children:r.jsx(u.BearIcons.MoreHorizIcon,{size:18})}),items:e.hidden.map((t,a)=>{const o=B+a;return{key:`${t.label}-${a}`,label:t.label,onClick:()=>{var m;f(o),(m=t.onClick)==null||m.call(t)}}})}),P&&i!=null&&r.jsx("span",{className:"bear-min-w-0 bear-max-w-[12rem] bear-truncate md:bear-max-w-none bear-inline-flex bear-items-center",children:y(n[i],i,i===n.length-1)})]}):y(e.item,e.index,e.index===n.length-1)]},s))})})};exports.Breadcrumbs=Z;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),b=require("react"),v=require("../../context/BearProvider.cjs"),Z=require("../../utils/maxVisible.utils.cjs"),w=require("../../utils/cn.cjs"),D=require("../Dropdown/Dropdown.cjs"),d=require("../Icon/index.cjs"),l=require("./Breadcrumbs.const.cjs"),V=_=>{const{items:n,separator:k,maxItems:p,itemsBeforeCollapse:h=l.BREADCRUMBS_DEFAULTS.ITEMS_BEFORE_COLLAPSE,itemsAfterCollapse:u=l.BREADCRUMBS_DEFAULTS.ITEMS_AFTER_COLLAPSE,className:A,size:x=l.BREADCRUMBS_DEFAULTS.SIZE,showHomeIcon:z=l.BREADCRUMBS_DEFAULTS.SHOW_HOME_ICON,testId:M,"aria-label":O="Breadcrumb"}=_,f=v.useBearThemeOptional(),{direction:I}=v.useBearDirectionOptional(),[o,E]=b.useState(null),[U,S]=b.useState({}),[B,L]=b.useState(()=>typeof window<"u"?window.innerWidth:1200);b.useEffect(()=>{const e=()=>L(window.innerWidth);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),b.useEffect(()=>{E(null),S({})},[n]);const C=b.useMemo(()=>p==null?void 0:Z.resolveMaxVisible(p,{width:B,theme:f}),[p,B,f]),T=()=>k||(I==="rtl"?r.jsx(d.BearIcons.ChevronLeftIcon,{className:w.cn(l.BREADCRUMBS_ICON_SIZE[x],"bear-text-zinc-500 bear-mx-2")}):r.jsx(d.BearIcons.ChevronRightIcon,{className:w.cn(l.BREADCRUMBS_ICON_SIZE[x],"bear-text-zinc-500 bear-mx-2")})),y=(e,s,t)=>{const a=r.jsxs("span",{className:"bear-flex bear-items-center bear-gap-1 bear-max-w-[12rem] bear-truncate md:bear-max-w-none",children:[s===0&&z&&r.jsx(d.BearIcons.HomeIcon,{className:l.BREADCRUMBS_ICON_SIZE[x]}),e.icon,e.label]}),c=t?r.jsx("span",{className:"bear-text-zinc-300 bear-font-medium","aria-current":"page",children:a}):e.href?r.jsx("a",{href:e.href,className:"bear-text-zinc-400 hover:bear-text-primary-400 bear-transition-colors bear-truncate",children:a}):e.onClick?r.jsx("button",{type:"button",onClick:e.onClick,className:"bear-text-zinc-400 hover:bear-text-primary-400 bear-transition-colors bear-truncate",children:a}):r.jsx("span",{className:"bear-text-zinc-400 bear-truncate",children:a});if(e.dropdownItems&&e.dropdownItems.length>0&&!t){const m=U[s],N=e.dropdownItems.find(i=>i.key===m);return r.jsx(D.Dropdown,{placement:"bottom-start",closeOnSelect:!0,trigger:r.jsxs("button",{type:"button",className:"bear-inline-flex bear-items-center bear-gap-1 bear-text-zinc-400 hover:bear-text-primary-400 bear-transition-colors","aria-haspopup":"true",children:[a,N&&r.jsx("span",{className:"bear-ml-1 bear-max-w-[8rem] bear-truncate bear-text-xs bear-text-zinc-300",children:N.label}),r.jsx(d.BearIcons.ChevronDownIcon,{size:14})]}),items:e.dropdownItems.map(i=>({key:i.key,label:i.label,disabled:i.disabled,selected:m===i.key,onClick:()=>{var g;S(H=>({...H,[s]:i.key})),(g=i.onClick)==null||g.call(i)}}))})}return c},P=C!=null&&n.length>C,j=h,q=n.length-u;let R=n.map((e,s)=>({type:"item",item:e,index:s}));if(P){const e=n.slice(0,h),s=n.slice(-u),t=n.slice(h,n.length-u);R=[...e.map((a,c)=>({type:"item",item:a,index:c})),...t.length?[{type:"ellipsis",hidden:t}]:[],...s.map((a,c)=>({type:"item",item:a,index:n.length-u+c}))]}const F=o!=null&&o>=j&&o<q;return r.jsx("nav",{dir:I,"data-testid":M,className:w.cn("bear-flex bear-min-w-0 bear-items-center bear-flex-wrap",l.BREADCRUMBS_SIZE[x],A),"aria-label":O,children:r.jsx("ol",{className:"bear-flex bear-min-w-0 bear-items-center bear-flex-wrap bear-list-none bear-p-0 bear-m-0",children:R.map((e,s)=>r.jsxs("li",{className:"bear-flex bear-min-w-0 bear-items-center",children:[s>0&&r.jsx("span",{"aria-hidden":"true",children:T()}),e.type==="ellipsis"?r.jsxs("span",{className:"bear-inline-flex bear-min-w-0 bear-max-w-full bear-items-center bear-gap-1",children:[r.jsx(D.Dropdown,{placement:"bottom-start",closeOnSelect:!0,trigger:r.jsx("button",{type:"button",className:"bear-inline-flex bear-items-center bear-justify-center bear-rounded bear-px-2 bear-py-1 bear-text-zinc-400 hover:bear-bg-[var(--bear-bg-tertiary)] hover:bear-text-primary-400 bear-transition-colors","aria-label":"Hidden breadcrumbs",children:r.jsx(d.BearIcons.MoreHorizIcon,{size:18})}),items:e.hidden.map((t,a)=>{const c=j+a;return{key:`${t.label}-${a}`,label:t.label,onClick:()=>{var m;E(c),(m=t.onClick)==null||m.call(t)}}})}),F&&o!=null&&r.jsx("span",{className:"bear-min-w-0 bear-max-w-[12rem] bear-truncate md:bear-max-w-none bear-inline-flex bear-items-center",children:y(n[o],o,o===n.length-1)})]}):y(e.item,e.index,e.index===n.length-1)]},s))})})};exports.Breadcrumbs=V;