@linzjs/lui 23.9.0 → 23.10.0

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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [23.10.0](https://github.com/linz/lui/compare/v23.9.0...v23.10.0) (2025-08-07)
2
+
3
+
4
+ ### Features
5
+
6
+ * **LuiAccordion:** expose the open state of lui accordion ([#1244](https://github.com/linz/lui/issues/1244)) ([d1f5acc](https://github.com/linz/lui/commit/d1f5accd007d250b7ed1bcdfd77b8c707e85de72))
7
+
1
8
  # [23.9.0](https://github.com/linz/lui/compare/v23.8.0...v23.9.0) (2025-08-04)
2
9
 
3
10
 
@@ -7,5 +7,6 @@ export interface ILuiAccordion {
7
7
  iconColor?: string;
8
8
  className?: string;
9
9
  style?: CSSProperties;
10
+ onToggleExpand?: (isOpen: boolean) => void;
10
11
  }
11
12
  export declare const LuiAccordion: (props: ILuiAccordion) => JSX.Element;
package/dist/index.js CHANGED
@@ -30052,7 +30052,7 @@ var css_248z$j = "/**\n @deprecated\n */\n/**\n @deprecated\n */\n/**\n @depr
30052
30052
  styleInject(css_248z$j);
30053
30053
 
30054
30054
  var LuiAccordion = function (props) {
30055
- var _a = props.expanded, expanded = _a === void 0 ? false : _a, heading = props.heading, children = props.children, _b = props.iconColor, iconColor = _b === void 0 ? '#017A76' : _b, className = props.className, _c = props.style, style = _c === void 0 ? {} : _c;
30055
+ var _a = props.expanded, expanded = _a === void 0 ? false : _a, heading = props.heading, children = props.children, _b = props.iconColor, iconColor = _b === void 0 ? '#017A76' : _b, className = props.className, _c = props.style, style = _c === void 0 ? {} : _c, onToggleExpand = props.onToggleExpand;
30056
30056
  var _d = React.useState(expanded), open = _d[0], setOpen = _d[1];
30057
30057
  React__default["default"].useEffect(function () {
30058
30058
  setOpen(expanded);
@@ -30061,6 +30061,9 @@ var LuiAccordion = function (props) {
30061
30061
  //Reason for event.preventDefault() : https://github.com/facebook/react/issues/15486
30062
30062
  event.preventDefault();
30063
30063
  setOpen(!open);
30064
+ if (onToggleExpand) {
30065
+ onToggleExpand(!open);
30066
+ }
30064
30067
  };
30065
30068
  return (React__default["default"].createElement("details", { style: style, className: clsx('lui-accordion', className), open: open },
30066
30069
  React__default["default"].createElement("summary", { onClick: toggle, "data-testid": "lui-accordion-summary-".concat(open) },