@abgov/react-components 7.2.0-dev.3 → 7.2.0-dev.31

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.mjs CHANGED
@@ -9,7 +9,7 @@ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot
9
9
  var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
10
10
  var _PublicFormController_instances, updateObjectListState_fn, dispatchError_fn;
11
11
  import { jsxs, jsx } from "react/jsx-runtime";
12
- import { useRef, useEffect, useLayoutEffect, useState, useCallback } from "react";
12
+ import { useRef, useEffect, Children, isValidElement, Fragment, cloneElement, useLayoutEffect, useState, useCallback, createContext, useContext } from "react";
13
13
  const lowercase = (input) => input.toLowerCase();
14
14
  const kebab = (input) => input.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
15
15
  function transformProps(props, transform = lowercase) {
@@ -28,6 +28,8 @@ function GoabAccordion({
28
28
  open,
29
29
  onChange,
30
30
  headingContent,
31
+ headingType,
32
+ actions,
31
33
  children,
32
34
  ...rest
33
35
  }) {
@@ -46,15 +48,41 @@ function GoabAccordion({
46
48
  };
47
49
  }
48
50
  }, [onChange]);
49
- return /* @__PURE__ */ jsxs("goa-accordion", { ref, open: open ? "true" : void 0, ..._props, children: [
50
- headingContent && /* @__PURE__ */ jsx("div", { slot: "headingcontent", children: headingContent }),
51
- children
52
- ] });
51
+ return /* @__PURE__ */ jsxs(
52
+ "goa-accordion",
53
+ {
54
+ ref,
55
+ open: open ? "true" : void 0,
56
+ "heading-type": headingType,
57
+ ..._props,
58
+ children: [
59
+ headingContent && /* @__PURE__ */ jsx("div", { slot: "headingcontent", children: headingContent }),
60
+ actions && /* @__PURE__ */ jsx("div", { slot: "actions", children: actions }),
61
+ children
62
+ ]
63
+ }
64
+ );
65
+ }
66
+ function renderSlottedItems(children, slot) {
67
+ return Children.map(children, (child) => {
68
+ if (!isValidElement(child)) {
69
+ return child;
70
+ }
71
+ if (child.type === Fragment) {
72
+ const fragment = child;
73
+ return renderSlottedItems(fragment.props.children, slot);
74
+ }
75
+ return cloneElement(child, { slot });
76
+ });
53
77
  }
54
78
  function GoabAppHeader({
55
79
  onMenuClick,
56
80
  children,
57
81
  secondaryText,
82
+ banner,
83
+ phase,
84
+ navigation,
85
+ utilities,
58
86
  ...rest
59
87
  }) {
60
88
  const el = useRef(null);
@@ -75,7 +103,7 @@ function GoabAppHeader({
75
103
  current.removeEventListener("_menuClick", listener);
76
104
  };
77
105
  }, [el, onMenuClick]);
78
- return /* @__PURE__ */ jsx(
106
+ return /* @__PURE__ */ jsxs(
79
107
  "goa-app-header",
80
108
  {
81
109
  ref: el,
@@ -83,7 +111,13 @@ function GoabAppHeader({
83
111
  secondarytext: secondaryText,
84
112
  ..._props,
85
113
  version: "2",
86
- children
114
+ children: [
115
+ children,
116
+ banner && /* @__PURE__ */ jsx("div", { slot: "banner", children: banner }),
117
+ phase && /* @__PURE__ */ jsx("div", { slot: "phase", children: phase }),
118
+ navigation && renderSlottedItems(navigation, "navigation"),
119
+ utilities && renderSlottedItems(utilities, "utilities")
120
+ ]
87
121
  }
88
122
  );
89
123
  }
@@ -102,6 +136,7 @@ function getIconValue(icon, iconType) {
102
136
  return iconType ? "true" : "false";
103
137
  }
104
138
  function GoabBadge({
139
+ content,
105
140
  icon,
106
141
  iconType,
107
142
  size = "medium",
@@ -114,16 +149,23 @@ function GoabBadge({
114
149
  {
115
150
  icon: getIconValue(icon, iconType),
116
151
  icontype: iconType,
152
+ content: typeof content === "string" ? content : void 0,
117
153
  ..._props,
118
154
  version: "2",
119
155
  size,
120
- emphasis
156
+ emphasis,
157
+ children: typeof content !== "string" && content != null && /* @__PURE__ */ jsx("div", { slot: "content", children: content })
121
158
  }
122
159
  );
123
160
  }
124
- function GoabBlock({ testId, children, ...rest }) {
161
+ function GoabBlock({
162
+ testId,
163
+ stretch,
164
+ children,
165
+ ...rest
166
+ }) {
125
167
  const _props = transformProps({ testid: testId, ...rest }, kebab);
126
- return /* @__PURE__ */ jsx("goa-block", { ..._props, children });
168
+ return /* @__PURE__ */ jsx("goa-block", { ..._props, stretch: stretch ? "true" : void 0, children });
127
169
  }
128
170
  function GoabButton({
129
171
  disabled,
@@ -232,6 +274,8 @@ function GoabCheckbox({
232
274
  description,
233
275
  reveal,
234
276
  onChange,
277
+ onFocus,
278
+ onBlur,
235
279
  name,
236
280
  children,
237
281
  size = "default",
@@ -248,11 +292,23 @@ function GoabCheckbox({
248
292
  const detail = e.detail;
249
293
  onChange == null ? void 0 : onChange({ ...detail, event: e });
250
294
  };
295
+ const focusListener = (e) => {
296
+ const detail = e.detail;
297
+ onFocus == null ? void 0 : onFocus({ ...detail, event: e });
298
+ };
299
+ const blurListener = (e) => {
300
+ const detail = e.detail;
301
+ onBlur == null ? void 0 : onBlur({ ...detail, event: e });
302
+ };
251
303
  current.addEventListener("_change", listener);
304
+ current.addEventListener("_focus", focusListener);
305
+ current.addEventListener("_blur", blurListener);
252
306
  return () => {
253
307
  current.removeEventListener("_change", listener);
308
+ current.removeEventListener("_focus", focusListener);
309
+ current.removeEventListener("_blur", blurListener);
254
310
  };
255
- }, [name, onChange]);
311
+ }, [name, onChange, onFocus, onBlur]);
256
312
  return /* @__PURE__ */ jsxs(
257
313
  "goa-checkbox",
258
314
  {
@@ -284,6 +340,8 @@ function GoabCheckboxList({
284
340
  size = "default",
285
341
  children,
286
342
  onChange,
343
+ onFocus,
344
+ onBlur,
287
345
  mt,
288
346
  mr,
289
347
  mb,
@@ -297,11 +355,23 @@ function GoabCheckboxList({
297
355
  const detail = e.detail;
298
356
  onChange == null ? void 0 : onChange({ ...detail, event: e });
299
357
  };
358
+ const focusListener = (e) => {
359
+ const detail = e.detail;
360
+ onFocus == null ? void 0 : onFocus({ ...detail, event: e });
361
+ };
362
+ const blurListener = (e) => {
363
+ const detail = e.detail;
364
+ onBlur == null ? void 0 : onBlur({ ...detail, event: e });
365
+ };
300
366
  current.addEventListener("_change", listener);
367
+ current.addEventListener("_focus", focusListener);
368
+ current.addEventListener("_blur", blurListener);
301
369
  return () => {
302
370
  current.removeEventListener("_change", listener);
371
+ current.removeEventListener("_focus", focusListener);
372
+ current.removeEventListener("_blur", blurListener);
303
373
  };
304
- }, [onChange]);
374
+ }, [onChange, onFocus, onBlur]);
305
375
  return /* @__PURE__ */ jsx(
306
376
  "goa-checkbox-list",
307
377
  {
@@ -398,6 +468,9 @@ function GoabDataGrid({
398
468
  }
399
469
  );
400
470
  }
471
+ const GoabWorkspaceLayoutScrollState = {
472
+ NO_SCROLL: "no-scroll"
473
+ };
401
474
  function dispatch(el, eventName, detail, opts) {
402
475
  if (!el) {
403
476
  console.error("dispatch element is null");
@@ -2597,6 +2670,8 @@ function GoabDatePicker({
2597
2670
  disabled,
2598
2671
  relative,
2599
2672
  onChange,
2673
+ onFocus,
2674
+ onBlur,
2600
2675
  ...rest
2601
2676
  }) {
2602
2677
  const ref = useRef(null);
@@ -2617,15 +2692,27 @@ function GoabDatePicker({
2617
2692
  const detail = e.detail;
2618
2693
  onChange == null ? void 0 : onChange({ ...detail, event: e });
2619
2694
  };
2695
+ const handleFocus = (e) => {
2696
+ const detail = e.detail;
2697
+ onFocus == null ? void 0 : onFocus({ ...detail, event: e });
2698
+ };
2699
+ const handleBlur = (e) => {
2700
+ const detail = e.detail;
2701
+ onBlur == null ? void 0 : onBlur({ ...detail, event: e });
2702
+ };
2620
2703
  if (onChange) {
2621
2704
  current.addEventListener("_change", handleChange);
2622
2705
  }
2706
+ current.addEventListener("_focus", handleFocus);
2707
+ current.addEventListener("_blur", handleBlur);
2623
2708
  return () => {
2624
2709
  if (onChange) {
2625
2710
  current.removeEventListener("_change", handleChange);
2626
2711
  }
2712
+ current.removeEventListener("_focus", handleFocus);
2713
+ current.removeEventListener("_blur", handleBlur);
2627
2714
  };
2628
- }, [onChange]);
2715
+ }, [onChange, onFocus, onBlur]);
2629
2716
  const formatValue = (val) => {
2630
2717
  if (!val) return "";
2631
2718
  if (val instanceof Date) {
@@ -2721,6 +2808,8 @@ function stringify(value) {
2721
2808
  function GoabDropdown({
2722
2809
  value,
2723
2810
  onChange,
2811
+ onFocus,
2812
+ onBlur,
2724
2813
  disabled,
2725
2814
  error,
2726
2815
  filterable,
@@ -2742,15 +2831,27 @@ function GoabDropdown({
2742
2831
  const detail = e.detail;
2743
2832
  onChange == null ? void 0 : onChange({ ...detail, event: e });
2744
2833
  };
2834
+ const focusListener = (e) => {
2835
+ const detail = e.detail;
2836
+ onFocus == null ? void 0 : onFocus({ ...detail, event: e });
2837
+ };
2838
+ const blurListener = (e) => {
2839
+ const detail = e.detail;
2840
+ onBlur == null ? void 0 : onBlur({ ...detail, event: e });
2841
+ };
2745
2842
  if (onChange) {
2746
2843
  current.addEventListener("_change", handler);
2747
2844
  }
2845
+ current.addEventListener("_focus", focusListener);
2846
+ current.addEventListener("_blur", blurListener);
2748
2847
  return () => {
2749
2848
  if (onChange) {
2750
2849
  current.removeEventListener("_change", handler);
2751
2850
  }
2851
+ current.removeEventListener("_focus", focusListener);
2852
+ current.removeEventListener("_blur", blurListener);
2752
2853
  };
2753
- }, [el, onChange]);
2854
+ }, [el, onChange, onFocus, onBlur]);
2754
2855
  return /* @__PURE__ */ jsx(
2755
2856
  "goa-dropdown",
2756
2857
  {
@@ -2779,7 +2880,8 @@ function GoabDropdownItem({
2779
2880
  label,
2780
2881
  filter,
2781
2882
  name,
2782
- mountType = "append"
2883
+ mountType = "append",
2884
+ children
2783
2885
  }) {
2784
2886
  return /* @__PURE__ */ jsx(
2785
2887
  "goa-dropdown-item",
@@ -2788,7 +2890,71 @@ function GoabDropdownItem({
2788
2890
  label,
2789
2891
  filter,
2790
2892
  name,
2791
- mount: mountType
2893
+ mount: mountType,
2894
+ children
2895
+ }
2896
+ );
2897
+ }
2898
+ function GoabDropdownMultiselect({
2899
+ name,
2900
+ value = [],
2901
+ placeholder,
2902
+ disabled,
2903
+ error,
2904
+ filterable,
2905
+ leadingIcon,
2906
+ showSelectAll,
2907
+ testId,
2908
+ ariaLabel,
2909
+ ariaLabelledBy,
2910
+ maxHeight,
2911
+ width,
2912
+ size = "default",
2913
+ labelFormat,
2914
+ children,
2915
+ onChange,
2916
+ mt,
2917
+ mr,
2918
+ mb,
2919
+ ml
2920
+ }) {
2921
+ const el = useRef(null);
2922
+ useEffect(() => {
2923
+ if (!el.current) return;
2924
+ const current = el.current;
2925
+ const listener = (e) => {
2926
+ const detail = e.detail;
2927
+ onChange == null ? void 0 : onChange({ ...detail, event: e });
2928
+ };
2929
+ current.addEventListener("_change", listener);
2930
+ return () => {
2931
+ current.removeEventListener("_change", listener);
2932
+ };
2933
+ }, [onChange]);
2934
+ return /* @__PURE__ */ jsx(
2935
+ "goa-dropdown-multiselect",
2936
+ {
2937
+ ref: el,
2938
+ name,
2939
+ value,
2940
+ placeholder,
2941
+ disabled: disabled ? "true" : void 0,
2942
+ error: error ? "true" : void 0,
2943
+ filterable: filterable ? "true" : void 0,
2944
+ "leading-icon": leadingIcon,
2945
+ testid: testId,
2946
+ "aria-label": ariaLabel,
2947
+ "aria-labelledby": ariaLabelledBy,
2948
+ "max-height": maxHeight,
2949
+ width,
2950
+ size,
2951
+ "label-format": labelFormat ? labelFormat : void 0,
2952
+ "show-select-all": showSelectAll ? "true" : void 0,
2953
+ mt,
2954
+ mr,
2955
+ mb,
2956
+ ml,
2957
+ children
2792
2958
  }
2793
2959
  );
2794
2960
  }
@@ -3153,6 +3319,7 @@ function GoabHeroBannerActions({
3153
3319
  }
3154
3320
  function GoabIconButton({
3155
3321
  variant = "color",
3322
+ type = "default",
3156
3323
  size = "medium",
3157
3324
  theme = "outline",
3158
3325
  disabled,
@@ -3163,7 +3330,7 @@ function GoabIconButton({
3163
3330
  ...rest
3164
3331
  }) {
3165
3332
  const ref = useRef(null);
3166
- const _props = transformProps({ variant, size, theme, ...rest }, lowercase);
3333
+ const _props = transformProps({ variant, type, size, theme, ...rest }, lowercase);
3167
3334
  useEffect(() => {
3168
3335
  if (!ref.current) {
3169
3336
  return;
@@ -3192,12 +3359,13 @@ function GoabIconButton({
3192
3359
  }
3193
3360
  );
3194
3361
  }
3195
- function GoabIcon({ inverted, ...rest }) {
3362
+ function GoabIcon({ inverted, ariaHidden, ...rest }) {
3196
3363
  const _props = transformProps(rest, lowercase);
3197
3364
  return /* @__PURE__ */ jsx(
3198
3365
  "goa-icon",
3199
3366
  {
3200
3367
  inverted: typeof inverted === "boolean" ? inverted ? "true" : void 0 : inverted,
3368
+ ariahidden: ariaHidden ? "true" : void 0,
3201
3369
  ..._props
3202
3370
  }
3203
3371
  );
@@ -3819,6 +3987,8 @@ function GoabRadioGroup({
3819
3987
  disabled,
3820
3988
  error,
3821
3989
  onChange,
3990
+ onFocus,
3991
+ onBlur,
3822
3992
  name,
3823
3993
  children,
3824
3994
  size = "default",
@@ -3832,16 +4002,28 @@ function GoabRadioGroup({
3832
4002
  const detail = e.detail;
3833
4003
  onChange == null ? void 0 : onChange({ ...detail, event: e });
3834
4004
  };
4005
+ const focusListener = (e) => {
4006
+ const detail = e.detail;
4007
+ onFocus == null ? void 0 : onFocus({ ...detail, event: e });
4008
+ };
4009
+ const blurListener = (e) => {
4010
+ const detail = e.detail;
4011
+ onBlur == null ? void 0 : onBlur({ ...detail, event: e });
4012
+ };
3835
4013
  const currentEl = el.current;
3836
4014
  if (onChange) {
3837
4015
  currentEl.addEventListener("_change", listener);
3838
4016
  }
4017
+ currentEl.addEventListener("_focus", focusListener);
4018
+ currentEl.addEventListener("_blur", blurListener);
3839
4019
  return () => {
3840
4020
  if (onChange) {
3841
4021
  currentEl.removeEventListener("_change", listener);
3842
4022
  }
4023
+ currentEl.removeEventListener("_focus", focusListener);
4024
+ currentEl.removeEventListener("_blur", blurListener);
3843
4025
  };
3844
- }, [name, onChange]);
4026
+ }, [name, onChange, onFocus, onBlur]);
3845
4027
  return /* @__PURE__ */ jsx(
3846
4028
  "goa-radio-group",
3847
4029
  {
@@ -3948,6 +4130,32 @@ function GoabSpinner({
3948
4130
  }
3949
4131
  );
3950
4132
  }
4133
+ function GoabScrollPanel({
4134
+ header,
4135
+ children,
4136
+ footer,
4137
+ height,
4138
+ testId,
4139
+ direction = "vertical",
4140
+ ...rest
4141
+ }) {
4142
+ const hostStyle = height ? { height } : void 0;
4143
+ return /* @__PURE__ */ jsxs(
4144
+ "goa-scroll-panel",
4145
+ {
4146
+ height,
4147
+ testid: testId,
4148
+ direction,
4149
+ style: hostStyle,
4150
+ ...rest,
4151
+ children: [
4152
+ header && /* @__PURE__ */ jsx("div", { slot: "header", children: header }),
4153
+ children,
4154
+ footer && /* @__PURE__ */ jsx("div", { slot: "footer", children: footer })
4155
+ ]
4156
+ }
4157
+ );
4158
+ }
3951
4159
  function GoabTable({ onSort, onMultiSort, sortMode, ...props }) {
3952
4160
  const ref = useRef(null);
3953
4161
  useEffect(() => {
@@ -4001,6 +4209,7 @@ function GoabTableSortHeader({
4001
4209
  name,
4002
4210
  direction,
4003
4211
  "sort-order": sortOrder,
4212
+ version: "2",
4004
4213
  ...rest,
4005
4214
  children
4006
4215
  }
@@ -4089,6 +4298,7 @@ function GoabTextArea({
4089
4298
  error,
4090
4299
  onChange,
4091
4300
  onKeyPress,
4301
+ onFocus,
4092
4302
  onBlur,
4093
4303
  ...rest
4094
4304
  }) {
@@ -4107,19 +4317,25 @@ function GoabTextArea({
4107
4317
  const detail = e.detail;
4108
4318
  onKeyPress == null ? void 0 : onKeyPress({ ...detail, event: e });
4109
4319
  };
4320
+ const focusListener = (e) => {
4321
+ const detail = e.detail;
4322
+ onFocus == null ? void 0 : onFocus({ ...detail, event: e });
4323
+ };
4110
4324
  const blurListener = (e) => {
4111
4325
  const detail = e.detail;
4112
4326
  onBlur == null ? void 0 : onBlur({ ...detail, event: e });
4113
4327
  };
4114
4328
  current.addEventListener("_change", changeListener);
4115
4329
  current.addEventListener("_keyPress", keypressListener);
4330
+ current.addEventListener("_focus", focusListener);
4116
4331
  current.addEventListener("_blur", blurListener);
4117
4332
  return () => {
4118
4333
  current.removeEventListener("_change", changeListener);
4119
4334
  current.removeEventListener("_keyPress", keypressListener);
4335
+ current.removeEventListener("_focus", focusListener);
4120
4336
  current.removeEventListener("_blur", blurListener);
4121
4337
  };
4122
- }, [el, onChange, onKeyPress, onBlur]);
4338
+ }, [el, onChange, onKeyPress, onFocus, onBlur]);
4123
4339
  return /* @__PURE__ */ jsx(
4124
4340
  "goa-textarea",
4125
4341
  {
@@ -4178,6 +4394,7 @@ function GoabTwoColumnLayout(props) {
4178
4394
  );
4179
4395
  }
4180
4396
  const GoabFilterChip = ({
4397
+ content,
4181
4398
  iconTheme = "outline",
4182
4399
  error,
4183
4400
  onClick,
@@ -4198,9 +4415,11 @@ const GoabFilterChip = ({
4198
4415
  "goa-filter-chip",
4199
4416
  {
4200
4417
  ref: el,
4418
+ content: typeof content === "string" ? content : void 0,
4201
4419
  error: error ? "true" : void 0,
4202
4420
  version: "2",
4203
- ..._props
4421
+ ..._props,
4422
+ children: typeof content !== "string" && content != null && /* @__PURE__ */ jsx("div", { slot: "content", children: content })
4204
4423
  }
4205
4424
  );
4206
4425
  };
@@ -4301,30 +4520,28 @@ function GoabWorkSideMenu({
4301
4520
  }) {
4302
4521
  const el = useRef(null);
4303
4522
  useEffect(() => {
4304
- var _a;
4305
- if (!(el == null ? void 0 : el.current) || !onToggle) {
4523
+ const node = el.current;
4524
+ if (!node || !onToggle) {
4306
4525
  return;
4307
4526
  }
4308
- (_a = el.current) == null ? void 0 : _a.addEventListener("_toggle", onToggle);
4527
+ node.addEventListener("_toggle", onToggle);
4309
4528
  return () => {
4310
- var _a2;
4311
- (_a2 = el.current) == null ? void 0 : _a2.removeEventListener("_toggle", onToggle);
4529
+ node.removeEventListener("_toggle", onToggle);
4312
4530
  };
4313
- }, [el, onToggle]);
4531
+ }, [onToggle]);
4314
4532
  useEffect(() => {
4315
- var _a;
4316
- if (!(el == null ? void 0 : el.current) || !onNavigate) {
4533
+ const node = el.current;
4534
+ if (!node || !onNavigate) {
4317
4535
  return;
4318
4536
  }
4319
4537
  const handler = (e) => {
4320
4538
  onNavigate(e.detail.url);
4321
4539
  };
4322
- (_a = el.current) == null ? void 0 : _a.addEventListener("_navigate", handler);
4540
+ node.addEventListener("_navigate", handler);
4323
4541
  return () => {
4324
- var _a2;
4325
- (_a2 = el.current) == null ? void 0 : _a2.removeEventListener("_navigate", handler);
4542
+ node.removeEventListener("_navigate", handler);
4326
4543
  };
4327
- }, [el, onNavigate]);
4544
+ }, [onNavigate]);
4328
4545
  return /* @__PURE__ */ jsxs(
4329
4546
  "goa-work-side-menu",
4330
4547
  {
@@ -4369,6 +4586,7 @@ function GoabWorkSideMenuItem(props) {
4369
4586
  type: props.type,
4370
4587
  children: [
4371
4588
  props.popoverContent && /* @__PURE__ */ jsx("div", { slot: "popoverContent", children: props.popoverContent }),
4589
+ props.trailingContent && /* @__PURE__ */ jsx("div", { slot: "trailingContent", children: props.trailingContent }),
4372
4590
  props.children
4373
4591
  ]
4374
4592
  }
@@ -4446,6 +4664,95 @@ function GoabWorkSideNotificationPanel({
4446
4664
  }
4447
4665
  );
4448
4666
  }
4667
+ const STORAGE_KEY = "goab-theme";
4668
+ const ATTRIBUTE = "data-theme";
4669
+ const GoabThemeContext = createContext(null);
4670
+ function readInitialMode(defaultMode) {
4671
+ if (typeof window === "undefined") return defaultMode;
4672
+ try {
4673
+ const stored = window.localStorage.getItem(STORAGE_KEY);
4674
+ if (stored === "light" || stored === "dark") return stored;
4675
+ } catch {
4676
+ }
4677
+ const fromAttribute = document.documentElement.getAttribute(ATTRIBUTE);
4678
+ if (fromAttribute === "light" || fromAttribute === "dark") return fromAttribute;
4679
+ if (window.matchMedia("(prefers-color-scheme: dark)").matches) return "dark";
4680
+ return defaultMode;
4681
+ }
4682
+ function GoabThemeProvider({
4683
+ children,
4684
+ defaultMode = "light"
4685
+ }) {
4686
+ const [mode, setModeState] = useState(
4687
+ () => readInitialMode(defaultMode)
4688
+ );
4689
+ useEffect(() => {
4690
+ if (typeof document === "undefined") return;
4691
+ document.documentElement.setAttribute(ATTRIBUTE, mode);
4692
+ try {
4693
+ window.localStorage.setItem(STORAGE_KEY, mode);
4694
+ } catch {
4695
+ }
4696
+ }, [mode]);
4697
+ const setMode = useCallback((next) => {
4698
+ setModeState(next);
4699
+ }, []);
4700
+ const toggle = useCallback(() => {
4701
+ setModeState((prev) => prev === "light" ? "dark" : "light");
4702
+ }, []);
4703
+ return /* @__PURE__ */ jsx(GoabThemeContext.Provider, { value: { mode, setMode, toggle }, children });
4704
+ }
4705
+ function useTheme() {
4706
+ const ctx = useContext(GoabThemeContext);
4707
+ if (!ctx) {
4708
+ throw new Error("useTheme must be used within a GoabThemeProvider");
4709
+ }
4710
+ return ctx;
4711
+ }
4712
+ const GoabWorkspaceLayoutScrollStateDefault = {
4713
+ scrollPosition: GoabWorkspaceLayoutScrollState.NO_SCROLL,
4714
+ isScrollable: false
4715
+ };
4716
+ const GoabWorkspaceLayoutScrollStateContext = createContext(
4717
+ GoabWorkspaceLayoutScrollStateDefault
4718
+ );
4719
+ function useGoabWorkspaceLayoutScrollState() {
4720
+ return useContext(GoabWorkspaceLayoutScrollStateContext);
4721
+ }
4722
+ function GoabWorkspaceLayout({
4723
+ sideMenu,
4724
+ pageHeader,
4725
+ pageFooter,
4726
+ pushDrawer,
4727
+ children,
4728
+ testId,
4729
+ onScrollStateChange,
4730
+ ...rest
4731
+ }) {
4732
+ const ref = useRef(null);
4733
+ const [scrollState, setScrollState] = useState(GoabWorkspaceLayoutScrollStateDefault);
4734
+ useEffect(() => {
4735
+ const el = ref.current;
4736
+ if (!el) return;
4737
+ const listener = (e) => {
4738
+ const detail = e.detail;
4739
+ setScrollState({
4740
+ scrollPosition: detail.state,
4741
+ isScrollable: detail.isScrollable
4742
+ });
4743
+ onScrollStateChange == null ? void 0 : onScrollStateChange({ ...detail, event: e });
4744
+ };
4745
+ el.addEventListener("_scrollStateChange", listener);
4746
+ return () => el.removeEventListener("_scrollStateChange", listener);
4747
+ }, [onScrollStateChange]);
4748
+ return /* @__PURE__ */ jsx(GoabWorkspaceLayoutScrollStateContext.Provider, { value: scrollState, children: /* @__PURE__ */ jsxs("goa-workspace-layout", { ref, testid: testId, ...rest, children: [
4749
+ sideMenu && /* @__PURE__ */ jsx("div", { slot: "side-menu", children: sideMenu }),
4750
+ pageHeader && /* @__PURE__ */ jsx("div", { slot: "page-header", children: pageHeader }),
4751
+ children,
4752
+ pageFooter && /* @__PURE__ */ jsx("div", { slot: "page-footer", children: pageFooter }),
4753
+ pushDrawer && /* @__PURE__ */ jsx("div", { slot: "push-drawer", children: pushDrawer })
4754
+ ] }) });
4755
+ }
4449
4756
  export {
4450
4757
  GoALinkButton,
4451
4758
  GoabAccordion,
@@ -4472,6 +4779,7 @@ export {
4472
4779
  GoabDrawer,
4473
4780
  GoabDropdown,
4474
4781
  GoabDropdownItem,
4782
+ GoabDropdownMultiselect,
4475
4783
  GoabDropdownOption,
4476
4784
  GoabFieldset,
4477
4785
  GoabFileUploadCard,
@@ -4521,6 +4829,7 @@ export {
4521
4829
  GoabPushDrawer,
4522
4830
  GoabRadioGroup,
4523
4831
  GoabRadioItem,
4832
+ GoabScrollPanel,
4524
4833
  GoabSideMenu,
4525
4834
  GoabSideMenuGroup,
4526
4835
  GoabSideMenuHeading,
@@ -4535,6 +4844,7 @@ export {
4535
4844
  GoabText,
4536
4845
  GoabTextArea,
4537
4846
  GoabTextArea as GoabTextarea,
4847
+ GoabThemeProvider,
4538
4848
  GoabThreeColumnLayout,
4539
4849
  GoabTooltip,
4540
4850
  GoabTwoColumnLayout,
@@ -4543,6 +4853,9 @@ export {
4543
4853
  GoabWorkSideMenuItem,
4544
4854
  GoabWorkSideNotificationItem,
4545
4855
  GoabWorkSideNotificationPanel,
4546
- usePublicFormController
4856
+ GoabWorkspaceLayout,
4857
+ useGoabWorkspaceLayoutScrollState,
4858
+ usePublicFormController,
4859
+ useTheme
4547
4860
  };
4548
4861
  //# sourceMappingURL=index.mjs.map