@abgov/react-components 7.2.0-dev.4 → 7.2.0-dev.40

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.js CHANGED
@@ -30,6 +30,8 @@ function GoabAccordion({
30
30
  open,
31
31
  onChange,
32
32
  headingContent,
33
+ headingType,
34
+ actions,
33
35
  children,
34
36
  ...rest
35
37
  }) {
@@ -48,15 +50,41 @@ function GoabAccordion({
48
50
  };
49
51
  }
50
52
  }, [onChange]);
51
- return /* @__PURE__ */ jsxRuntime.jsxs("goa-accordion", { ref, open: open ? "true" : void 0, ..._props, children: [
52
- headingContent && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "headingcontent", children: headingContent }),
53
- children
54
- ] });
53
+ return /* @__PURE__ */ jsxRuntime.jsxs(
54
+ "goa-accordion",
55
+ {
56
+ ref,
57
+ open: open ? "true" : void 0,
58
+ "heading-type": headingType,
59
+ ..._props,
60
+ children: [
61
+ headingContent && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "headingcontent", children: headingContent }),
62
+ actions && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "actions", children: actions }),
63
+ children
64
+ ]
65
+ }
66
+ );
67
+ }
68
+ function renderSlottedItems(children, slot) {
69
+ return react.Children.map(children, (child) => {
70
+ if (!react.isValidElement(child)) {
71
+ return child;
72
+ }
73
+ if (child.type === react.Fragment) {
74
+ const fragment = child;
75
+ return renderSlottedItems(fragment.props.children, slot);
76
+ }
77
+ return react.cloneElement(child, { slot });
78
+ });
55
79
  }
56
80
  function GoabAppHeader({
57
81
  onMenuClick,
58
82
  children,
59
83
  secondaryText,
84
+ banner,
85
+ phase,
86
+ navigation,
87
+ utilities,
60
88
  ...rest
61
89
  }) {
62
90
  const el = react.useRef(null);
@@ -77,7 +105,7 @@ function GoabAppHeader({
77
105
  current.removeEventListener("_menuClick", listener);
78
106
  };
79
107
  }, [el, onMenuClick]);
80
- return /* @__PURE__ */ jsxRuntime.jsx(
108
+ return /* @__PURE__ */ jsxRuntime.jsxs(
81
109
  "goa-app-header",
82
110
  {
83
111
  ref: el,
@@ -85,7 +113,13 @@ function GoabAppHeader({
85
113
  secondarytext: secondaryText,
86
114
  ..._props,
87
115
  version: "2",
88
- children
116
+ children: [
117
+ children,
118
+ banner && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "banner", children: banner }),
119
+ phase && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "phase", children: phase }),
120
+ navigation && renderSlottedItems(navigation, "navigation"),
121
+ utilities && renderSlottedItems(utilities, "utilities")
122
+ ]
89
123
  }
90
124
  );
91
125
  }
@@ -104,6 +138,7 @@ function getIconValue(icon, iconType) {
104
138
  return iconType ? "true" : "false";
105
139
  }
106
140
  function GoabBadge({
141
+ content,
107
142
  icon,
108
143
  iconType,
109
144
  size = "medium",
@@ -116,22 +151,30 @@ function GoabBadge({
116
151
  {
117
152
  icon: getIconValue(icon, iconType),
118
153
  icontype: iconType,
154
+ content: typeof content === "string" ? content : void 0,
119
155
  ..._props,
120
156
  version: "2",
121
157
  size,
122
- emphasis
158
+ emphasis,
159
+ children: typeof content !== "string" && content != null && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "content", children: content })
123
160
  }
124
161
  );
125
162
  }
126
- function GoabBlock({ testId, children, ...rest }) {
163
+ function GoabBlock({
164
+ testId,
165
+ stretch,
166
+ children,
167
+ ...rest
168
+ }) {
127
169
  const _props = transformProps({ testid: testId, ...rest }, kebab);
128
- return /* @__PURE__ */ jsxRuntime.jsx("goa-block", { ..._props, children });
170
+ return /* @__PURE__ */ jsxRuntime.jsx("goa-block", { ..._props, stretch: stretch ? "true" : void 0, children });
129
171
  }
130
172
  function GoabButton({
131
173
  disabled,
132
174
  onClick,
133
175
  actionArgs,
134
176
  actionArg,
177
+ ariaLabel,
135
178
  children,
136
179
  ...rest
137
180
  }) {
@@ -160,6 +203,7 @@ function GoabButton({
160
203
  disabled: disabled ? "true" : void 0,
161
204
  "action-arg": actionArg,
162
205
  "action-args": JSON.stringify(actionArgs),
206
+ arialabel: ariaLabel || void 0,
163
207
  ..._props,
164
208
  version: "2",
165
209
  children
@@ -234,6 +278,8 @@ function GoabCheckbox({
234
278
  description,
235
279
  reveal,
236
280
  onChange,
281
+ onFocus,
282
+ onBlur,
237
283
  name,
238
284
  children,
239
285
  size = "default",
@@ -250,11 +296,23 @@ function GoabCheckbox({
250
296
  const detail = e.detail;
251
297
  onChange == null ? void 0 : onChange({ ...detail, event: e });
252
298
  };
299
+ const focusListener = (e) => {
300
+ const detail = e.detail;
301
+ onFocus == null ? void 0 : onFocus({ ...detail, event: e });
302
+ };
303
+ const blurListener = (e) => {
304
+ const detail = e.detail;
305
+ onBlur == null ? void 0 : onBlur({ ...detail, event: e });
306
+ };
253
307
  current.addEventListener("_change", listener);
308
+ current.addEventListener("_focus", focusListener);
309
+ current.addEventListener("_blur", blurListener);
254
310
  return () => {
255
311
  current.removeEventListener("_change", listener);
312
+ current.removeEventListener("_focus", focusListener);
313
+ current.removeEventListener("_blur", blurListener);
256
314
  };
257
- }, [name, onChange]);
315
+ }, [name, onChange, onFocus, onBlur]);
258
316
  return /* @__PURE__ */ jsxRuntime.jsxs(
259
317
  "goa-checkbox",
260
318
  {
@@ -286,6 +344,8 @@ function GoabCheckboxList({
286
344
  size = "default",
287
345
  children,
288
346
  onChange,
347
+ onFocus,
348
+ onBlur,
289
349
  mt,
290
350
  mr,
291
351
  mb,
@@ -299,11 +359,23 @@ function GoabCheckboxList({
299
359
  const detail = e.detail;
300
360
  onChange == null ? void 0 : onChange({ ...detail, event: e });
301
361
  };
362
+ const focusListener = (e) => {
363
+ const detail = e.detail;
364
+ onFocus == null ? void 0 : onFocus({ ...detail, event: e });
365
+ };
366
+ const blurListener = (e) => {
367
+ const detail = e.detail;
368
+ onBlur == null ? void 0 : onBlur({ ...detail, event: e });
369
+ };
302
370
  current.addEventListener("_change", listener);
371
+ current.addEventListener("_focus", focusListener);
372
+ current.addEventListener("_blur", blurListener);
303
373
  return () => {
304
374
  current.removeEventListener("_change", listener);
375
+ current.removeEventListener("_focus", focusListener);
376
+ current.removeEventListener("_blur", blurListener);
305
377
  };
306
- }, [onChange]);
378
+ }, [onChange, onFocus, onBlur]);
307
379
  return /* @__PURE__ */ jsxRuntime.jsx(
308
380
  "goa-checkbox-list",
309
381
  {
@@ -400,6 +472,9 @@ function GoabDataGrid({
400
472
  }
401
473
  );
402
474
  }
475
+ const GoabWorkspaceLayoutScrollState = {
476
+ NO_SCROLL: "no-scroll"
477
+ };
403
478
  function dispatch(el, eventName, detail, opts) {
404
479
  if (!el) {
405
480
  console.error("dispatch element is null");
@@ -2599,6 +2674,8 @@ function GoabDatePicker({
2599
2674
  disabled,
2600
2675
  relative,
2601
2676
  onChange,
2677
+ onFocus,
2678
+ onBlur,
2602
2679
  ...rest
2603
2680
  }) {
2604
2681
  const ref = react.useRef(null);
@@ -2619,15 +2696,27 @@ function GoabDatePicker({
2619
2696
  const detail = e.detail;
2620
2697
  onChange == null ? void 0 : onChange({ ...detail, event: e });
2621
2698
  };
2699
+ const handleFocus = (e) => {
2700
+ const detail = e.detail;
2701
+ onFocus == null ? void 0 : onFocus({ ...detail, event: e });
2702
+ };
2703
+ const handleBlur = (e) => {
2704
+ const detail = e.detail;
2705
+ onBlur == null ? void 0 : onBlur({ ...detail, event: e });
2706
+ };
2622
2707
  if (onChange) {
2623
2708
  current.addEventListener("_change", handleChange);
2624
2709
  }
2710
+ current.addEventListener("_focus", handleFocus);
2711
+ current.addEventListener("_blur", handleBlur);
2625
2712
  return () => {
2626
2713
  if (onChange) {
2627
2714
  current.removeEventListener("_change", handleChange);
2628
2715
  }
2716
+ current.removeEventListener("_focus", handleFocus);
2717
+ current.removeEventListener("_blur", handleBlur);
2629
2718
  };
2630
- }, [onChange]);
2719
+ }, [onChange, onFocus, onBlur]);
2631
2720
  const formatValue = (val) => {
2632
2721
  if (!val) return "";
2633
2722
  if (val instanceof Date) {
@@ -2723,6 +2812,8 @@ function stringify(value) {
2723
2812
  function GoabDropdown({
2724
2813
  value,
2725
2814
  onChange,
2815
+ onFocus,
2816
+ onBlur,
2726
2817
  disabled,
2727
2818
  error,
2728
2819
  filterable,
@@ -2744,15 +2835,27 @@ function GoabDropdown({
2744
2835
  const detail = e.detail;
2745
2836
  onChange == null ? void 0 : onChange({ ...detail, event: e });
2746
2837
  };
2838
+ const focusListener = (e) => {
2839
+ const detail = e.detail;
2840
+ onFocus == null ? void 0 : onFocus({ ...detail, event: e });
2841
+ };
2842
+ const blurListener = (e) => {
2843
+ const detail = e.detail;
2844
+ onBlur == null ? void 0 : onBlur({ ...detail, event: e });
2845
+ };
2747
2846
  if (onChange) {
2748
2847
  current.addEventListener("_change", handler);
2749
2848
  }
2849
+ current.addEventListener("_focus", focusListener);
2850
+ current.addEventListener("_blur", blurListener);
2750
2851
  return () => {
2751
2852
  if (onChange) {
2752
2853
  current.removeEventListener("_change", handler);
2753
2854
  }
2855
+ current.removeEventListener("_focus", focusListener);
2856
+ current.removeEventListener("_blur", blurListener);
2754
2857
  };
2755
- }, [el, onChange]);
2858
+ }, [el, onChange, onFocus, onBlur]);
2756
2859
  return /* @__PURE__ */ jsxRuntime.jsx(
2757
2860
  "goa-dropdown",
2758
2861
  {
@@ -2781,7 +2884,8 @@ function GoabDropdownItem({
2781
2884
  label,
2782
2885
  filter,
2783
2886
  name,
2784
- mountType = "append"
2887
+ mountType = "append",
2888
+ children
2785
2889
  }) {
2786
2890
  return /* @__PURE__ */ jsxRuntime.jsx(
2787
2891
  "goa-dropdown-item",
@@ -2790,7 +2894,71 @@ function GoabDropdownItem({
2790
2894
  label,
2791
2895
  filter,
2792
2896
  name,
2793
- mount: mountType
2897
+ mount: mountType,
2898
+ children
2899
+ }
2900
+ );
2901
+ }
2902
+ function GoabDropdownMultiselect({
2903
+ name,
2904
+ value = [],
2905
+ placeholder,
2906
+ disabled,
2907
+ error,
2908
+ filterable,
2909
+ leadingIcon,
2910
+ showSelectAll,
2911
+ testId,
2912
+ ariaLabel,
2913
+ ariaLabelledBy,
2914
+ maxHeight,
2915
+ width,
2916
+ size = "default",
2917
+ labelFormat,
2918
+ children,
2919
+ onChange,
2920
+ mt,
2921
+ mr,
2922
+ mb,
2923
+ ml
2924
+ }) {
2925
+ const el = react.useRef(null);
2926
+ react.useEffect(() => {
2927
+ if (!el.current) return;
2928
+ const current = el.current;
2929
+ const listener = (e) => {
2930
+ const detail = e.detail;
2931
+ onChange == null ? void 0 : onChange({ ...detail, event: e });
2932
+ };
2933
+ current.addEventListener("_change", listener);
2934
+ return () => {
2935
+ current.removeEventListener("_change", listener);
2936
+ };
2937
+ }, [onChange]);
2938
+ return /* @__PURE__ */ jsxRuntime.jsx(
2939
+ "goa-dropdown-multiselect",
2940
+ {
2941
+ ref: el,
2942
+ name,
2943
+ value,
2944
+ placeholder,
2945
+ disabled: disabled ? "true" : void 0,
2946
+ error: error ? "true" : void 0,
2947
+ filterable: filterable ? "true" : void 0,
2948
+ "leading-icon": leadingIcon,
2949
+ testid: testId,
2950
+ "aria-label": ariaLabel,
2951
+ "aria-labelledby": ariaLabelledBy,
2952
+ "max-height": maxHeight,
2953
+ width,
2954
+ size,
2955
+ "label-format": labelFormat ? labelFormat : void 0,
2956
+ "show-select-all": showSelectAll ? "true" : void 0,
2957
+ mt,
2958
+ mr,
2959
+ mb,
2960
+ ml,
2961
+ children
2794
2962
  }
2795
2963
  );
2796
2964
  }
@@ -3155,6 +3323,7 @@ function GoabHeroBannerActions({
3155
3323
  }
3156
3324
  function GoabIconButton({
3157
3325
  variant = "color",
3326
+ type = "default",
3158
3327
  size = "medium",
3159
3328
  theme = "outline",
3160
3329
  disabled,
@@ -3165,7 +3334,7 @@ function GoabIconButton({
3165
3334
  ...rest
3166
3335
  }) {
3167
3336
  const ref = react.useRef(null);
3168
- const _props = transformProps({ variant, size, theme, ...rest }, lowercase);
3337
+ const _props = transformProps({ variant, type, size, theme, ...rest }, lowercase);
3169
3338
  react.useEffect(() => {
3170
3339
  if (!ref.current) {
3171
3340
  return;
@@ -3194,12 +3363,13 @@ function GoabIconButton({
3194
3363
  }
3195
3364
  );
3196
3365
  }
3197
- function GoabIcon({ inverted, ...rest }) {
3366
+ function GoabIcon({ inverted, ariaHidden, ...rest }) {
3198
3367
  const _props = transformProps(rest, lowercase);
3199
3368
  return /* @__PURE__ */ jsxRuntime.jsx(
3200
3369
  "goa-icon",
3201
3370
  {
3202
3371
  inverted: typeof inverted === "boolean" ? inverted ? "true" : void 0 : inverted,
3372
+ ariahidden: ariaHidden ? "true" : void 0,
3203
3373
  ..._props
3204
3374
  }
3205
3375
  );
@@ -3821,6 +3991,8 @@ function GoabRadioGroup({
3821
3991
  disabled,
3822
3992
  error,
3823
3993
  onChange,
3994
+ onFocus,
3995
+ onBlur,
3824
3996
  name,
3825
3997
  children,
3826
3998
  size = "default",
@@ -3834,16 +4006,28 @@ function GoabRadioGroup({
3834
4006
  const detail = e.detail;
3835
4007
  onChange == null ? void 0 : onChange({ ...detail, event: e });
3836
4008
  };
4009
+ const focusListener = (e) => {
4010
+ const detail = e.detail;
4011
+ onFocus == null ? void 0 : onFocus({ ...detail, event: e });
4012
+ };
4013
+ const blurListener = (e) => {
4014
+ const detail = e.detail;
4015
+ onBlur == null ? void 0 : onBlur({ ...detail, event: e });
4016
+ };
3837
4017
  const currentEl = el.current;
3838
4018
  if (onChange) {
3839
4019
  currentEl.addEventListener("_change", listener);
3840
4020
  }
4021
+ currentEl.addEventListener("_focus", focusListener);
4022
+ currentEl.addEventListener("_blur", blurListener);
3841
4023
  return () => {
3842
4024
  if (onChange) {
3843
4025
  currentEl.removeEventListener("_change", listener);
3844
4026
  }
4027
+ currentEl.removeEventListener("_focus", focusListener);
4028
+ currentEl.removeEventListener("_blur", blurListener);
3845
4029
  };
3846
- }, [name, onChange]);
4030
+ }, [name, onChange, onFocus, onBlur]);
3847
4031
  return /* @__PURE__ */ jsxRuntime.jsx(
3848
4032
  "goa-radio-group",
3849
4033
  {
@@ -3950,6 +4134,32 @@ function GoabSpinner({
3950
4134
  }
3951
4135
  );
3952
4136
  }
4137
+ function GoabScrollPanel({
4138
+ header,
4139
+ children,
4140
+ footer,
4141
+ height,
4142
+ testId,
4143
+ direction = "vertical",
4144
+ ...rest
4145
+ }) {
4146
+ const hostStyle = height ? { height } : void 0;
4147
+ return /* @__PURE__ */ jsxRuntime.jsxs(
4148
+ "goa-scroll-panel",
4149
+ {
4150
+ height,
4151
+ testid: testId,
4152
+ direction,
4153
+ style: hostStyle,
4154
+ ...rest,
4155
+ children: [
4156
+ header && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "header", children: header }),
4157
+ children,
4158
+ footer && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "footer", children: footer })
4159
+ ]
4160
+ }
4161
+ );
4162
+ }
3953
4163
  function GoabTable({ onSort, onMultiSort, sortMode, ...props }) {
3954
4164
  const ref = react.useRef(null);
3955
4165
  react.useEffect(() => {
@@ -4092,6 +4302,7 @@ function GoabTextArea({
4092
4302
  error,
4093
4303
  onChange,
4094
4304
  onKeyPress,
4305
+ onFocus,
4095
4306
  onBlur,
4096
4307
  ...rest
4097
4308
  }) {
@@ -4110,19 +4321,25 @@ function GoabTextArea({
4110
4321
  const detail = e.detail;
4111
4322
  onKeyPress == null ? void 0 : onKeyPress({ ...detail, event: e });
4112
4323
  };
4324
+ const focusListener = (e) => {
4325
+ const detail = e.detail;
4326
+ onFocus == null ? void 0 : onFocus({ ...detail, event: e });
4327
+ };
4113
4328
  const blurListener = (e) => {
4114
4329
  const detail = e.detail;
4115
4330
  onBlur == null ? void 0 : onBlur({ ...detail, event: e });
4116
4331
  };
4117
4332
  current.addEventListener("_change", changeListener);
4118
4333
  current.addEventListener("_keyPress", keypressListener);
4334
+ current.addEventListener("_focus", focusListener);
4119
4335
  current.addEventListener("_blur", blurListener);
4120
4336
  return () => {
4121
4337
  current.removeEventListener("_change", changeListener);
4122
4338
  current.removeEventListener("_keyPress", keypressListener);
4339
+ current.removeEventListener("_focus", focusListener);
4123
4340
  current.removeEventListener("_blur", blurListener);
4124
4341
  };
4125
- }, [el, onChange, onKeyPress, onBlur]);
4342
+ }, [el, onChange, onKeyPress, onFocus, onBlur]);
4126
4343
  return /* @__PURE__ */ jsxRuntime.jsx(
4127
4344
  "goa-textarea",
4128
4345
  {
@@ -4181,6 +4398,7 @@ function GoabTwoColumnLayout(props) {
4181
4398
  );
4182
4399
  }
4183
4400
  const GoabFilterChip = ({
4401
+ content,
4184
4402
  iconTheme = "outline",
4185
4403
  error,
4186
4404
  onClick,
@@ -4201,9 +4419,11 @@ const GoabFilterChip = ({
4201
4419
  "goa-filter-chip",
4202
4420
  {
4203
4421
  ref: el,
4422
+ content: typeof content === "string" ? content : void 0,
4204
4423
  error: error ? "true" : void 0,
4205
4424
  version: "2",
4206
- ..._props
4425
+ ..._props,
4426
+ children: typeof content !== "string" && content != null && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "content", children: content })
4207
4427
  }
4208
4428
  );
4209
4429
  };
@@ -4304,30 +4524,28 @@ function GoabWorkSideMenu({
4304
4524
  }) {
4305
4525
  const el = react.useRef(null);
4306
4526
  react.useEffect(() => {
4307
- var _a;
4308
- if (!(el == null ? void 0 : el.current) || !onToggle) {
4527
+ const node = el.current;
4528
+ if (!node || !onToggle) {
4309
4529
  return;
4310
4530
  }
4311
- (_a = el.current) == null ? void 0 : _a.addEventListener("_toggle", onToggle);
4531
+ node.addEventListener("_toggle", onToggle);
4312
4532
  return () => {
4313
- var _a2;
4314
- (_a2 = el.current) == null ? void 0 : _a2.removeEventListener("_toggle", onToggle);
4533
+ node.removeEventListener("_toggle", onToggle);
4315
4534
  };
4316
- }, [el, onToggle]);
4535
+ }, [onToggle]);
4317
4536
  react.useEffect(() => {
4318
- var _a;
4319
- if (!(el == null ? void 0 : el.current) || !onNavigate) {
4537
+ const node = el.current;
4538
+ if (!node || !onNavigate) {
4320
4539
  return;
4321
4540
  }
4322
4541
  const handler = (e) => {
4323
4542
  onNavigate(e.detail.url);
4324
4543
  };
4325
- (_a = el.current) == null ? void 0 : _a.addEventListener("_navigate", handler);
4544
+ node.addEventListener("_navigate", handler);
4326
4545
  return () => {
4327
- var _a2;
4328
- (_a2 = el.current) == null ? void 0 : _a2.removeEventListener("_navigate", handler);
4546
+ node.removeEventListener("_navigate", handler);
4329
4547
  };
4330
- }, [el, onNavigate]);
4548
+ }, [onNavigate]);
4331
4549
  return /* @__PURE__ */ jsxRuntime.jsxs(
4332
4550
  "goa-work-side-menu",
4333
4551
  {
@@ -4372,6 +4590,7 @@ function GoabWorkSideMenuItem(props) {
4372
4590
  type: props.type,
4373
4591
  children: [
4374
4592
  props.popoverContent && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "popoverContent", children: props.popoverContent }),
4593
+ props.trailingContent && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "trailingContent", children: props.trailingContent }),
4375
4594
  props.children
4376
4595
  ]
4377
4596
  }
@@ -4449,6 +4668,95 @@ function GoabWorkSideNotificationPanel({
4449
4668
  }
4450
4669
  );
4451
4670
  }
4671
+ const STORAGE_KEY = "goab-theme";
4672
+ const ATTRIBUTE = "data-theme";
4673
+ const GoabThemeContext = react.createContext(null);
4674
+ function readInitialMode(defaultMode) {
4675
+ if (typeof window === "undefined") return defaultMode;
4676
+ try {
4677
+ const stored = window.localStorage.getItem(STORAGE_KEY);
4678
+ if (stored === "light" || stored === "dark") return stored;
4679
+ } catch {
4680
+ }
4681
+ const fromAttribute = document.documentElement.getAttribute(ATTRIBUTE);
4682
+ if (fromAttribute === "light" || fromAttribute === "dark") return fromAttribute;
4683
+ if (window.matchMedia("(prefers-color-scheme: dark)").matches) return "dark";
4684
+ return defaultMode;
4685
+ }
4686
+ function GoabThemeProvider({
4687
+ children,
4688
+ defaultMode = "light"
4689
+ }) {
4690
+ const [mode, setModeState] = react.useState(
4691
+ () => readInitialMode(defaultMode)
4692
+ );
4693
+ react.useEffect(() => {
4694
+ if (typeof document === "undefined") return;
4695
+ document.documentElement.setAttribute(ATTRIBUTE, mode);
4696
+ try {
4697
+ window.localStorage.setItem(STORAGE_KEY, mode);
4698
+ } catch {
4699
+ }
4700
+ }, [mode]);
4701
+ const setMode = react.useCallback((next) => {
4702
+ setModeState(next);
4703
+ }, []);
4704
+ const toggle = react.useCallback(() => {
4705
+ setModeState((prev) => prev === "light" ? "dark" : "light");
4706
+ }, []);
4707
+ return /* @__PURE__ */ jsxRuntime.jsx(GoabThemeContext.Provider, { value: { mode, setMode, toggle }, children });
4708
+ }
4709
+ function useTheme() {
4710
+ const ctx = react.useContext(GoabThemeContext);
4711
+ if (!ctx) {
4712
+ throw new Error("useTheme must be used within a GoabThemeProvider");
4713
+ }
4714
+ return ctx;
4715
+ }
4716
+ const GoabWorkspaceLayoutScrollStateDefault = {
4717
+ scrollPosition: GoabWorkspaceLayoutScrollState.NO_SCROLL,
4718
+ isScrollable: false
4719
+ };
4720
+ const GoabWorkspaceLayoutScrollStateContext = react.createContext(
4721
+ GoabWorkspaceLayoutScrollStateDefault
4722
+ );
4723
+ function useGoabWorkspaceLayoutScrollState() {
4724
+ return react.useContext(GoabWorkspaceLayoutScrollStateContext);
4725
+ }
4726
+ function GoabWorkspaceLayout({
4727
+ sideMenu,
4728
+ pageHeader,
4729
+ pageFooter,
4730
+ pushDrawer,
4731
+ children,
4732
+ testId,
4733
+ onScrollStateChange,
4734
+ ...rest
4735
+ }) {
4736
+ const ref = react.useRef(null);
4737
+ const [scrollState, setScrollState] = react.useState(GoabWorkspaceLayoutScrollStateDefault);
4738
+ react.useEffect(() => {
4739
+ const el = ref.current;
4740
+ if (!el) return;
4741
+ const listener = (e) => {
4742
+ const detail = e.detail;
4743
+ setScrollState({
4744
+ scrollPosition: detail.state,
4745
+ isScrollable: detail.isScrollable
4746
+ });
4747
+ onScrollStateChange == null ? void 0 : onScrollStateChange({ ...detail, event: e });
4748
+ };
4749
+ el.addEventListener("_scrollStateChange", listener);
4750
+ return () => el.removeEventListener("_scrollStateChange", listener);
4751
+ }, [onScrollStateChange]);
4752
+ return /* @__PURE__ */ jsxRuntime.jsx(GoabWorkspaceLayoutScrollStateContext.Provider, { value: scrollState, children: /* @__PURE__ */ jsxRuntime.jsxs("goa-workspace-layout", { ref, testid: testId, ...rest, children: [
4753
+ sideMenu && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "side-menu", children: sideMenu }),
4754
+ pageHeader && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "page-header", children: pageHeader }),
4755
+ children,
4756
+ pageFooter && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "page-footer", children: pageFooter }),
4757
+ pushDrawer && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "push-drawer", children: pushDrawer })
4758
+ ] }) });
4759
+ }
4452
4760
  exports.GoALinkButton = GoALinkButton;
4453
4761
  exports.GoabAccordion = GoabAccordion;
4454
4762
  exports.GoabAppFooter = GoabAppFooter;
@@ -4474,6 +4782,7 @@ exports.GoabDivider = GoabDivider;
4474
4782
  exports.GoabDrawer = GoabDrawer;
4475
4783
  exports.GoabDropdown = GoabDropdown;
4476
4784
  exports.GoabDropdownItem = GoabDropdownItem;
4785
+ exports.GoabDropdownMultiselect = GoabDropdownMultiselect;
4477
4786
  exports.GoabDropdownOption = GoabDropdownOption;
4478
4787
  exports.GoabFieldset = GoabFieldset;
4479
4788
  exports.GoabFileUploadCard = GoabFileUploadCard;
@@ -4523,6 +4832,7 @@ exports.GoabPublicSubformIndex = GoabPublicSubformIndex;
4523
4832
  exports.GoabPushDrawer = GoabPushDrawer;
4524
4833
  exports.GoabRadioGroup = GoabRadioGroup;
4525
4834
  exports.GoabRadioItem = GoabRadioItem;
4835
+ exports.GoabScrollPanel = GoabScrollPanel;
4526
4836
  exports.GoabSideMenu = GoabSideMenu;
4527
4837
  exports.GoabSideMenuGroup = GoabSideMenuGroup;
4528
4838
  exports.GoabSideMenuHeading = GoabSideMenuHeading;
@@ -4537,6 +4847,7 @@ exports.GoabTemporaryNotificationCtrl = GoabTemporaryNotificationCtrl;
4537
4847
  exports.GoabText = GoabText;
4538
4848
  exports.GoabTextArea = GoabTextArea;
4539
4849
  exports.GoabTextarea = GoabTextArea;
4850
+ exports.GoabThemeProvider = GoabThemeProvider;
4540
4851
  exports.GoabThreeColumnLayout = GoabThreeColumnLayout;
4541
4852
  exports.GoabTooltip = GoabTooltip;
4542
4853
  exports.GoabTwoColumnLayout = GoabTwoColumnLayout;
@@ -4545,5 +4856,8 @@ exports.GoabWorkSideMenuGroup = GoabWorkSideMenuGroup;
4545
4856
  exports.GoabWorkSideMenuItem = GoabWorkSideMenuItem;
4546
4857
  exports.GoabWorkSideNotificationItem = GoabWorkSideNotificationItem;
4547
4858
  exports.GoabWorkSideNotificationPanel = GoabWorkSideNotificationPanel;
4859
+ exports.GoabWorkspaceLayout = GoabWorkspaceLayout;
4860
+ exports.useGoabWorkspaceLayoutScrollState = useGoabWorkspaceLayoutScrollState;
4548
4861
  exports.usePublicFormController = usePublicFormController;
4862
+ exports.useTheme = useTheme;
4549
4863
  //# sourceMappingURL=index.js.map