opus-toolkit-components 1.8.1 → 1.8.3

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.
@@ -1,11 +1,12 @@
1
- export interface CookieBannerProps {
2
- logo?: string;
3
- policyTxt?: string;
4
- linkTxt?: string;
5
- isVisible?: boolean;
6
- onAccept?: () => void;
7
- onLearnMore?: () => void;
8
- intent?: string;
9
- }
10
-
11
- export const CookieBanner: React.ComponentType<CookieBannerProps>;
1
+ export interface CookieBannerProps {
2
+ logo?: string;
3
+ policyTxt?: string;
4
+ linkTxt?: string;
5
+ isVisible?: boolean;
6
+ onAccept?: () => void;
7
+ onLearnMore?: () => void;
8
+ intent?: string;
9
+ children?: React.ReactNode;
10
+ }
11
+
12
+ export const CookieBanner: React.ComponentType<CookieBannerProps>;
@@ -1,23 +1,25 @@
1
- export interface DatePickerChangeEvent {
2
- target: {
3
- name: string;
4
- value: string;
5
- };
6
- }
7
-
8
- export interface DatePickerProps extends React.HTMLAttributes<HTMLDivElement> {
9
- initialDate?: string;
10
- label?: string;
11
- isValid?: boolean;
12
- errorMessage?: string;
13
- name?: string;
14
- onChange?: (event: DatePickerChangeEvent) => void;
15
- value?: string;
16
- className?: string;
17
- title?: string;
18
- required?: boolean;
19
- dataCy?: string;
20
- disabled?: boolean;
21
- }
22
-
23
- export const DatePicker: React.ComponentType<DatePickerProps>;
1
+ export interface DatePickerChangeEvent {
2
+ target: {
3
+ name: string;
4
+ value: string;
5
+ };
6
+ }
7
+
8
+ export interface DatePickerProps extends React.HTMLAttributes<HTMLDivElement> {
9
+ initialDate?: string;
10
+ label?: string;
11
+ isValid?: boolean;
12
+ errorMessage?: string;
13
+ name?: string;
14
+ onChange?: (event: DatePickerChangeEvent) => void;
15
+ value?: string;
16
+ className?: string;
17
+ title?: string;
18
+ required?: boolean;
19
+ dataCy?: string;
20
+ disabled?: boolean;
21
+ minDate?: string;
22
+ maxDate?: string;
23
+ }
24
+
25
+ export const DatePicker: React.ComponentType<DatePickerProps>;
@@ -1,48 +1,53 @@
1
- export interface SidebarMenuItem {
2
- key: string | number;
3
- name: string;
4
- icon?: string;
5
- href?: string;
6
- }
7
-
8
- export interface SidebarMenuGroup {
9
- key: string | number;
10
- name: string;
11
- children: SidebarMenuItem[];
12
- }
13
-
14
- export type SidebarMenu = SidebarMenuItem | SidebarMenuGroup;
15
-
16
- export interface SidebarUser {
17
- id: string | number;
18
- name: string;
19
- role: string;
20
- avatar?: string;
21
- }
22
-
23
- export interface SidebarProps extends React.HTMLAttributes<HTMLDivElement> {
24
- menus: SidebarMenu[];
25
- user: SidebarUser;
26
-
27
- /** Currently selected (active) menu item */
28
- activeItem?: string | number | null;
29
- onItemClick?: (key: string | number) => void;
30
-
31
- /** Optional logo override */
32
- logo?: string;
33
-
34
- /** Controlled search input state */
35
- searchValue?: string;
36
- onSearchChange?: (value: string) => void;
37
-
38
- /** Controlled open/closed state for menu groups */
39
- openGroupKey?: string | number | null;
40
-
41
- /**
42
- * Fired when the user clicks a group header.
43
- * Use this to update `openGroupKey` in the parent.
44
- */
45
- onGroupToggle?: (key: string | number) => void;
46
- }
47
-
48
- export const Sidebar: React.FC<SidebarProps>;
1
+ export interface SidebarMenuItem {
2
+ key: string | number;
3
+ name: string;
4
+ icon?: string;
5
+ href?: string;
6
+ }
7
+
8
+ export interface SidebarMenuGroup {
9
+ key: string | number;
10
+ name: string;
11
+ children: SidebarMenuItem[];
12
+ }
13
+
14
+ export type SidebarMenu = SidebarMenuItem | SidebarMenuGroup;
15
+
16
+ export interface SidebarUser {
17
+ id: string | number;
18
+ name: string;
19
+ role: string;
20
+ avatar?: string;
21
+ }
22
+
23
+ export interface SidebarProps extends React.HTMLAttributes<HTMLDivElement> {
24
+ menus: SidebarMenu[];
25
+ user: SidebarUser;
26
+
27
+ /** Currently selected (active) menu item */
28
+ activeItem?: string | number | null;
29
+ onItemClick?: (key: string | number) => void;
30
+
31
+ /** Optional logo override */
32
+ logo?: string;
33
+
34
+ /** Controlled search input state */
35
+ searchValue?: string;
36
+ onSearchChange?: (value: string) => void;
37
+
38
+ /**
39
+ * REQUIRED.
40
+ * Key of the currently expanded group.
41
+ * Set to `null` to collapse all groups.
42
+ */
43
+ openGroupKey: string | number | null;
44
+
45
+ /**
46
+ * REQUIRED.
47
+ * Fired when the open group changes.
48
+ * Receives the NEXT openGroupKey value.
49
+ */
50
+ onGroupToggle: (openGroupKey: string | number | null) => void;
51
+ }
52
+
53
+ export const Sidebar: React.FC<SidebarProps>;
package/lib/main.js CHANGED
@@ -5563,8 +5563,8 @@ __webpack_require__.r(__webpack_exports__);
5563
5563
  * @typedef {Object} SidebarMenuItem
5564
5564
  * @property {string|number} key
5565
5565
  * @property {string} name
5566
- * @property {string} [icon] // optional icon name depending on your app
5567
- * @property {string} [href] // optional link target
5566
+ * @property {string} [icon]
5567
+ * @property {string} [href]
5568
5568
  */
5569
5569
 
5570
5570
  /**
@@ -5586,7 +5586,7 @@ __webpack_require__.r(__webpack_exports__);
5586
5586
  * @property {string|number} id
5587
5587
  * @property {string} name
5588
5588
  * @property {string} role
5589
- * @property {string} [avatar] // optional depending on your design
5589
+ * @property {string} [avatar]
5590
5590
  */
5591
5591
 
5592
5592
  /**
@@ -5609,15 +5609,16 @@ __webpack_require__.r(__webpack_exports__);
5609
5609
  * @property {string} [logo]
5610
5610
  * Optional logo override.
5611
5611
  *
5612
- * @property {string} [searchValue='']
5613
- /**
5614
- * @property {string|number|null} [openGroupKey]
5615
- * Key of the currently expanded group (controlled).
5616
- *
5617
- * @property {(key: string|number) => void} [onGroupToggle]
5618
- * Fired when a group header is clicked.
5612
+ * @property {string} [searchValue]
5613
+ * Controlled search input value.
5619
5614
  *
5620
5615
  * @property {(value: string) => void} [onSearchChange]
5616
+ *
5617
+ * @property {string|number|null} openGroupKey
5618
+ * REQUIRED. Key of the currently expanded group.
5619
+ *
5620
+ * @property {(openGroupKey: string|number|null) => void} onGroupToggle
5621
+ * REQUIRED. Receives the NEXT open group key.
5621
5622
  */
5622
5623
 
5623
5624
  /**
@@ -5639,10 +5640,14 @@ function Sidebar(_ref) {
5639
5640
  onGroupToggle
5640
5641
  } = _ref;
5641
5642
  const [open, setOpen] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
5643
+ const handleGroupToggle = key => {
5644
+ const nextOpenGroupKey = openGroupKey === key ? null : key;
5645
+ onGroupToggle(nextOpenGroupKey);
5646
+ };
5642
5647
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", {
5643
5648
  className: "flex",
5644
5649
  children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("div", {
5645
- className: " ".concat(open ? "w-[20rem]" : "w-[3rem]", " transition-width flex min-h-screen flex-col rounded bg-[--color-primary-bg] text-[--color-text-strong] duration-300 ease-in-out"),
5650
+ className: "".concat(open ? "w-[20rem]" : "w-[3rem]", " transition-width flex min-h-screen flex-col rounded bg-[--color-primary-bg] text-[--color-text-strong] duration-300 ease-in-out"),
5646
5651
  children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("div", {
5647
5652
  className: "flex items-center justify-between p-3 pr-0",
5648
5653
  children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("img", {
@@ -5651,7 +5656,7 @@ function Sidebar(_ref) {
5651
5656
  alt: "C247 Logo",
5652
5657
  className: "sidebar-logo w-75 object-contain"
5653
5658
  }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("button", {
5654
- className: "duration-400 rounded-l-lg bg-[--color-primary-btn] p-2 transition-all ease-in-out hover:bg-[--color-primary-btn-hover] focus:outline-none ".concat(open ? "translate-x-0 opacity-100" : "translate-x-4 opacity-0", " "),
5659
+ className: "duration-400 rounded-l-lg bg-[--color-primary-btn] p-2 transition-all ease-in-out hover:bg-[--color-primary-btn-hover] focus:outline-none ".concat(open ? "translate-x-0 opacity-100" : "translate-x-4 opacity-0"),
5655
5660
  onClick: () => setOpen(!open),
5656
5661
  children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_heroicons_react_24_outline__WEBPACK_IMPORTED_MODULE_1__.ArrowLeftIcon, {
5657
5662
  className: "h-5 w-5 text-[--color-white]"
@@ -5659,7 +5664,7 @@ function Sidebar(_ref) {
5659
5664
  })]
5660
5665
  }), !open && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("button", {
5661
5666
  className: "p-3 transition-all duration-700 ease-in-out focus:outline-none",
5662
- onClick: () => setOpen(!open),
5667
+ onClick: () => setOpen(true),
5663
5668
  children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_heroicons_react_24_outline__WEBPACK_IMPORTED_MODULE_1__.Bars3Icon, {
5664
5669
  className: "h-6 w-6 text-[--color-text-strong] hover:text-[--color-primary-hover]"
5665
5670
  })
@@ -5688,20 +5693,18 @@ function Sidebar(_ref) {
5688
5693
  }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", {
5689
5694
  className: "menu-item-container",
5690
5695
  children: menus.map(menu => menu.children ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_SidebarGroup__WEBPACK_IMPORTED_MODULE_3__["default"], {
5691
- // composite key
5692
5696
  menu: menu,
5693
5697
  open: open,
5694
5698
  activeItem: activeItem,
5695
5699
  onItemClick: onItemClick,
5696
5700
  toggleSidebar: setOpen,
5697
5701
  isOpen: openGroupKey === menu.key,
5698
- onToggle: () => onGroupToggle === null || onGroupToggle === void 0 ? void 0 : onGroupToggle(menu.key)
5702
+ onToggle: () => handleGroupToggle(menu.key)
5699
5703
  }, "group-".concat(menu.key, "-").concat(menu.name)) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_SidebarItem__WEBPACK_IMPORTED_MODULE_2__["default"], {
5700
- // composite key
5701
5704
  menu: menu,
5702
5705
  open: open,
5703
5706
  active: activeItem === menu.key,
5704
- onClick: () => onItemClick(menu.key)
5707
+ onClick: () => onItemClick === null || onItemClick === void 0 ? void 0 : onItemClick(menu.key)
5705
5708
  }, "item-".concat(menu.key, "-").concat(menu.name)))
5706
5709
  })]
5707
5710
  }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_SidebarProfile__WEBPACK_IMPORTED_MODULE_4__["default"], {
@@ -24574,7 +24577,8 @@ const CookieBanner = _ref => {
24574
24577
  isVisible = true,
24575
24578
  onAccept = () => {},
24576
24579
  onLearnMore = () => {},
24577
- intent = "brandSecondary"
24580
+ intent = "brandSecondary",
24581
+ children
24578
24582
  } = _ref;
24579
24583
  const [show, setShow] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
24580
24584
  const [render, setRender] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(isVisible);
@@ -24597,6 +24601,20 @@ const CookieBanner = _ref => {
24597
24601
  }
24598
24602
  }, [imageLoaded, render]);
24599
24603
  if (!render) return null;
24604
+ const defaultActions = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.Fragment, {
24605
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_Buttons_Button__WEBPACK_IMPORTED_MODULE_2__["default"], {
24606
+ rank: "primary",
24607
+ text: "Accept",
24608
+ onClick: onAccept
24609
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_Buttons_Button__WEBPACK_IMPORTED_MODULE_2__["default"], {
24610
+ rank: "secondary",
24611
+ text: linkTxt,
24612
+ onClick: e => {
24613
+ e.preventDefault();
24614
+ onLearnMore();
24615
+ }
24616
+ })]
24617
+ });
24600
24618
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_Cards_Card__WEBPACK_IMPORTED_MODULE_1__["default"], {
24601
24619
  intent: intent,
24602
24620
  className: "items-center justify-between space-x-4 p-4 transition-all duration-300 ease-in-out md:flex ".concat(show ? "translate-y-0 opacity-100" : "translate-y-3 opacity-0", " "),
@@ -24615,20 +24633,9 @@ const CookieBanner = _ref => {
24615
24633
  className: "mr-4",
24616
24634
  children: policyTxt
24617
24635
  })]
24618
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("div", {
24636
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", {
24619
24637
  className: "flex items-center space-x-4",
24620
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_Buttons_Button__WEBPACK_IMPORTED_MODULE_2__["default"], {
24621
- rank: "primary",
24622
- text: "Accept",
24623
- onClick: onAccept
24624
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_Buttons_Button__WEBPACK_IMPORTED_MODULE_2__["default"], {
24625
- rank: "secondary",
24626
- text: linkTxt,
24627
- onClick: e => {
24628
- e.preventDefault();
24629
- onLearnMore();
24630
- }
24631
- })]
24638
+ children: children || defaultActions
24632
24639
  })]
24633
24640
  });
24634
24641
  };
@@ -46828,50 +46835,56 @@ __webpack_require__.r(__webpack_exports__);
46828
46835
 
46829
46836
 
46830
46837
 
46831
- /**
46832
- * Custom change event type used by your date components.
46833
- * @typedef {{ target: { name: string, value: string } }} DatePickerChangeEvent
46838
+ /**
46839
+ * Custom change event type used by your date components.
46840
+ * @typedef {{ target: { name: string, value: string } }} DatePickerChangeEvent
46834
46841
  */
46835
46842
 
46836
- /**
46837
- * Props for DatePicker.
46838
- *
46839
- * @typedef {Object} DatePickerProps
46840
- *
46841
- * @property {string} [initialDate]
46842
- * Initial date value (ISO or human-readable). Converted internally.
46843
- *
46844
- * @property {string} [label]
46845
- * Label above the input.
46846
- *
46847
- * @property {boolean} [isValid]
46848
- * Controls validation styles + error message display.
46849
- *
46850
- * @property {string} [errorMessage]
46851
- * Message shown when isValid = false.
46852
- *
46853
- * @property {string} [name]
46854
- * Input field name and event target name.
46855
- *
46856
- * @property {(event: DatePickerChangeEvent) => void} [onChange]
46857
- * Custom event format with `event.target.name` & `event.target.value` in ISO.
46858
- *
46859
- * @property {string} [value]
46860
- * External controlled value (ISO or slash-format). Normalized automatically.
46861
- *
46862
- * @property {string} [className]
46863
- *
46864
- * @property {string} [title]
46865
- *
46866
- * @property {boolean} [required]
46867
- *
46868
- * @property {string} [dataCy]
46869
- *
46870
- * @property {boolean} [disabled]
46843
+ /**
46844
+ * Props for DatePicker.
46845
+ *
46846
+ * @typedef {Object} DatePickerProps
46847
+ *
46848
+ * @property {string} [initialDate]
46849
+ * Initial date value (ISO or human-readable). Converted internally.
46850
+ *
46851
+ * @property {string} [label]
46852
+ * Label above the input.
46853
+ *
46854
+ * @property {boolean} [isValid]
46855
+ * Controls validation styles + error message display.
46856
+ *
46857
+ * @property {string} [errorMessage]
46858
+ * Message shown when isValid = false.
46859
+ *
46860
+ * @property {string} [name]
46861
+ * Input field name and event target name.
46862
+ *
46863
+ * @property {(event: DatePickerChangeEvent) => void} [onChange]
46864
+ * Custom event format with `event.target.name` & `event.target.value` in ISO.
46865
+ *
46866
+ * @property {string} [value]
46867
+ * External controlled value (ISO or slash-format). Normalized automatically.
46868
+ *
46869
+ * @property {string} [className]
46870
+ *
46871
+ * @property {string} [title]
46872
+ *
46873
+ * @property {boolean} [required]
46874
+ *
46875
+ * @property {string} [dataCy]
46876
+ *
46877
+ * @property {boolean} [disabled]
46878
+ *
46879
+ * @property {string} [minDate]
46880
+ * Minimum selectable date (ISO or slash-format). Normalized automatically.
46881
+ *
46882
+ * @property {string} [maxDate]
46883
+ * Maximum selectable date (ISO or slash-format). Normalized automatically.
46871
46884
  */
46872
46885
 
46873
- /**
46874
- * @param {DatePickerProps & React.HTMLAttributes<HTMLDivElement>} props
46886
+ /**
46887
+ * @param {DatePickerProps & React.HTMLAttributes<HTMLDivElement>} props
46875
46888
  */
46876
46889
 
46877
46890
  function DatePicker(_ref) {
@@ -46887,7 +46900,9 @@ function DatePicker(_ref) {
46887
46900
  title = "",
46888
46901
  required = false,
46889
46902
  dataCy,
46890
- disabled = false
46903
+ disabled = false,
46904
+ minDate,
46905
+ maxDate
46891
46906
  } = _ref;
46892
46907
  const [selectedDate, setSelectedDate] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)("");
46893
46908
  const inputRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
@@ -46917,6 +46932,8 @@ function DatePicker(_ref) {
46917
46932
  setSelectedDate(newDate);
46918
46933
  }
46919
46934
  }, [value, initialDate]);
46935
+ const normalizedMinDate = normalizeToInputFormat(minDate);
46936
+ const normalizedMaxDate = normalizeToInputFormat(maxDate);
46920
46937
  const handleDateChange = e => {
46921
46938
  const rawValue = e.target.value; // yyyy-MM-dd
46922
46939
  setSelectedDate(rawValue);
@@ -46951,6 +46968,8 @@ function DatePicker(_ref) {
46951
46968
  name: name,
46952
46969
  ref: inputRef,
46953
46970
  value: selectedDate,
46971
+ min: normalizedMinDate,
46972
+ max: normalizedMaxDate,
46954
46973
  title: title,
46955
46974
  onChange: handleDateChange,
46956
46975
  required: required,
@@ -50782,14 +50801,12 @@ __webpack_require__.r(__webpack_exports__);
50782
50801
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
50783
50802
  /* harmony export */ "default": () => (/* binding */ SidebarGroup)
50784
50803
  /* harmony export */ });
50785
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9206);
50786
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
50787
- /* harmony import */ var _heroicons_react_24_outline__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(58964);
50788
- /* harmony import */ var _SidebarItem__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(69374);
50789
- /* harmony import */ var _Text_Text__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(21111);
50790
- /* harmony import */ var _Icon_Icon__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(57739);
50791
- /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(94178);
50792
- /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__);
50804
+ /* harmony import */ var _heroicons_react_24_outline__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(58964);
50805
+ /* harmony import */ var _SidebarItem__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(69374);
50806
+ /* harmony import */ var _Text_Text__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(21111);
50807
+ /* harmony import */ var _Icon_Icon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(57739);
50808
+ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(94178);
50809
+ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
50793
50810
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
50794
50811
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
50795
50812
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
@@ -50800,7 +50817,6 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
50800
50817
 
50801
50818
 
50802
50819
 
50803
-
50804
50820
  /**
50805
50821
  * Icon props used by your dynamic Icon component (optional).
50806
50822
  * @typedef {import('../Icon/Icon').IconProps} IconProps
@@ -50845,14 +50861,11 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
50845
50861
  * @property {(open: boolean) => void} toggleSidebar
50846
50862
  * Opens the sidebar when a user clicks a collapsed group.
50847
50863
  *
50848
- *
50849
- * // NEW CONTROLLED STATE PROPS:
50850
- *
50851
50864
  * @property {boolean} isOpen
50852
- * Whether THIS group’s children are currently expanded.
50865
+ * REQUIRED. Whether this group’s children are expanded.
50853
50866
  *
50854
- * @property {(key: string|number) => void} onToggle
50855
- * Fired when the group header is clicked. Parent controls open/close.
50867
+ * @property {() => void} onToggle
50868
+ * REQUIRED. Called when the group header is clicked.
50856
50869
  */
50857
50870
 
50858
50871
  /**
@@ -50871,34 +50884,34 @@ function SidebarGroup(_ref) {
50871
50884
  isOpen,
50872
50885
  onToggle
50873
50886
  } = _ref;
50874
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("div", {
50875
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("div", {
50887
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
50888
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
50876
50889
  className: "group relative flex cursor-pointer items-center justify-between p-4 transition-all duration-500 ease-in-out",
50877
50890
  onClick: () => {
50878
50891
  if (!open) toggleSidebar(true);
50879
- onToggle(menu.key); // let parent handle open/close
50892
+ onToggle(); // Sidebar computes next openGroupKey
50880
50893
  },
50881
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", {
50894
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
50882
50895
  className: "absolute left-0 top-0 h-full w-[5px] rounded-r transition-all duration-300 ease-in-out ".concat(isOpen || activeItem === menu.key ? "bg-[--color-brand-primary]" : "bg-[--color-stroke] group-hover:bg-[--color-brand-primary]")
50883
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("div", {
50896
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
50884
50897
  className: "flex items-center gap-3",
50885
- children: [menu.iconProps && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_Icon_Icon__WEBPACK_IMPORTED_MODULE_4__["default"], _objectSpread({}, menu.iconProps)), !open && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("span", {
50898
+ children: [menu.iconProps && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_Icon_Icon__WEBPACK_IMPORTED_MODULE_3__["default"], _objectSpread({}, menu.iconProps)), !open && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", {
50886
50899
  className: "absolute left-full top-1/2 ml-2 -translate-y-1/2 whitespace-nowrap rounded bg-[--color-primary-bg] px-2 py-1 text-xs text-[--color-text-strong] opacity-0 transition-opacity duration-300 group-hover:opacity-100",
50887
50900
  children: menu.name
50888
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", {
50901
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
50889
50902
  className: "overflow-hidden whitespace-nowrap transition-all duration-500 ease-in-out ".concat(open ? "ml-2 w-auto translate-y-0 opacity-100" : "ml-0 w-0 translate-y-2 opacity-0"),
50890
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_Text_Text__WEBPACK_IMPORTED_MODULE_3__["default"], {
50903
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_Text_Text__WEBPACK_IMPORTED_MODULE_2__["default"], {
50891
50904
  as: "span",
50892
50905
  variant: "label",
50893
50906
  children: menu.name
50894
50907
  })
50895
50908
  })]
50896
- }), open && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_heroicons_react_24_outline__WEBPACK_IMPORTED_MODULE_1__.ChevronDownIcon, {
50909
+ }), open && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_heroicons_react_24_outline__WEBPACK_IMPORTED_MODULE_0__.ChevronDownIcon, {
50897
50910
  className: "h-4 w-4 transition-transform duration-300 ".concat(isOpen ? "rotate-180" : "")
50898
50911
  })]
50899
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", {
50912
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
50900
50913
  className: "ml-10 mt-1 overflow-hidden transition-all duration-300 ease-in-out ".concat(isOpen && open ? "max-h-96 opacity-100" : "max-h-0 opacity-0"),
50901
- children: menu.children.map(child => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_SidebarItem__WEBPACK_IMPORTED_MODULE_2__["default"], {
50914
+ children: menu.children.map(child => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_SidebarItem__WEBPACK_IMPORTED_MODULE_1__["default"], {
50902
50915
  menu: child,
50903
50916
  open: open,
50904
50917
  active: activeItem === child.key,