@abgov/react-components 7.2.0-dev.12 → 7.2.0-dev.13

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/index.d.ts CHANGED
@@ -62,6 +62,7 @@ export * from './lib/side-menu/side-menu';
62
62
  export * from './lib/skeleton/skeleton';
63
63
  export * from './lib/spacer/spacer';
64
64
  export * from './lib/spinner/spinner';
65
+ export * from './lib/scroll-panel/scroll-panel';
65
66
  export * from './lib/table/table';
66
67
  export * from './lib/table/table-sort-header';
67
68
  export * from './lib/tabs/tabs';
@@ -80,3 +81,4 @@ export * from './lib/work-side-menu-item/work-side-menu-item';
80
81
  export * from './lib/work-side-notification-item/work-side-notification-item';
81
82
  export * from './lib/work-side-notification-panel/work-side-notification-panel';
82
83
  export * from './lib/theme/theme-context';
84
+ export * from './lib/workspace-layout/workspace-layout';
package/index.js CHANGED
@@ -412,6 +412,9 @@ function GoabDataGrid({
412
412
  }
413
413
  );
414
414
  }
415
+ const GoabWorkspaceLayoutScrollState = {
416
+ NO_SCROLL: "no-scroll"
417
+ };
415
418
  function dispatch(el, eventName, detail, opts) {
416
419
  if (!el) {
417
420
  console.error("dispatch element is null");
@@ -3962,6 +3965,21 @@ function GoabSpinner({
3962
3965
  }
3963
3966
  );
3964
3967
  }
3968
+ function GoabScrollPanel({
3969
+ header,
3970
+ children,
3971
+ footer,
3972
+ height,
3973
+ testId,
3974
+ ...rest
3975
+ }) {
3976
+ const hostStyle = height ? { height } : void 0;
3977
+ return /* @__PURE__ */ jsxRuntime.jsxs("goa-scroll-panel", { height, testid: testId, style: hostStyle, ...rest, children: [
3978
+ header && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "header", children: header }),
3979
+ children,
3980
+ footer && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "footer", children: footer })
3981
+ ] });
3982
+ }
3965
3983
  function GoabTable({ onSort, onMultiSort, sortMode, ...props }) {
3966
3984
  const ref = react.useRef(null);
3967
3985
  react.useEffect(() => {
@@ -4505,6 +4523,50 @@ function useTheme() {
4505
4523
  }
4506
4524
  return ctx;
4507
4525
  }
4526
+ const GoabWorkspaceLayoutScrollStateDefault = {
4527
+ scrollPosition: GoabWorkspaceLayoutScrollState.NO_SCROLL,
4528
+ isScrollable: false
4529
+ };
4530
+ const GoabWorkspaceLayoutScrollStateContext = react.createContext(
4531
+ GoabWorkspaceLayoutScrollStateDefault
4532
+ );
4533
+ function useGoabWorkspaceLayoutScrollState() {
4534
+ return react.useContext(GoabWorkspaceLayoutScrollStateContext);
4535
+ }
4536
+ function GoabWorkspaceLayout({
4537
+ sideMenu,
4538
+ pageHeader,
4539
+ pageFooter,
4540
+ pushDrawer,
4541
+ children,
4542
+ testId,
4543
+ onScrollStateChange,
4544
+ ...rest
4545
+ }) {
4546
+ const ref = react.useRef(null);
4547
+ const [scrollState, setScrollState] = react.useState(GoabWorkspaceLayoutScrollStateDefault);
4548
+ react.useEffect(() => {
4549
+ const el = ref.current;
4550
+ if (!el) return;
4551
+ const listener = (e) => {
4552
+ const detail = e.detail;
4553
+ setScrollState({
4554
+ scrollPosition: detail.state,
4555
+ isScrollable: detail.isScrollable
4556
+ });
4557
+ onScrollStateChange == null ? void 0 : onScrollStateChange({ ...detail, event: e });
4558
+ };
4559
+ el.addEventListener("_scrollStateChange", listener);
4560
+ return () => el.removeEventListener("_scrollStateChange", listener);
4561
+ }, [onScrollStateChange]);
4562
+ return /* @__PURE__ */ jsxRuntime.jsx(GoabWorkspaceLayoutScrollStateContext.Provider, { value: scrollState, children: /* @__PURE__ */ jsxRuntime.jsxs("goa-workspace-layout", { ref, testid: testId, ...rest, children: [
4563
+ sideMenu && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "side-menu", children: sideMenu }),
4564
+ pageHeader && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "page-header", children: pageHeader }),
4565
+ children,
4566
+ pageFooter && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "page-footer", children: pageFooter }),
4567
+ pushDrawer && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "push-drawer", children: pushDrawer })
4568
+ ] }) });
4569
+ }
4508
4570
  exports.GoALinkButton = GoALinkButton;
4509
4571
  exports.GoabAccordion = GoabAccordion;
4510
4572
  exports.GoabAppFooter = GoabAppFooter;
@@ -4579,6 +4641,7 @@ exports.GoabPublicSubformIndex = GoabPublicSubformIndex;
4579
4641
  exports.GoabPushDrawer = GoabPushDrawer;
4580
4642
  exports.GoabRadioGroup = GoabRadioGroup;
4581
4643
  exports.GoabRadioItem = GoabRadioItem;
4644
+ exports.GoabScrollPanel = GoabScrollPanel;
4582
4645
  exports.GoabSideMenu = GoabSideMenu;
4583
4646
  exports.GoabSideMenuGroup = GoabSideMenuGroup;
4584
4647
  exports.GoabSideMenuHeading = GoabSideMenuHeading;
@@ -4602,6 +4665,8 @@ exports.GoabWorkSideMenuGroup = GoabWorkSideMenuGroup;
4602
4665
  exports.GoabWorkSideMenuItem = GoabWorkSideMenuItem;
4603
4666
  exports.GoabWorkSideNotificationItem = GoabWorkSideNotificationItem;
4604
4667
  exports.GoabWorkSideNotificationPanel = GoabWorkSideNotificationPanel;
4668
+ exports.GoabWorkspaceLayout = GoabWorkspaceLayout;
4669
+ exports.useGoabWorkspaceLayoutScrollState = useGoabWorkspaceLayoutScrollState;
4605
4670
  exports.usePublicFormController = usePublicFormController;
4606
4671
  exports.useTheme = useTheme;
4607
4672
  //# sourceMappingURL=index.js.map