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

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,16 +151,23 @@ 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,
@@ -234,6 +276,8 @@ function GoabCheckbox({
234
276
  description,
235
277
  reveal,
236
278
  onChange,
279
+ onFocus,
280
+ onBlur,
237
281
  name,
238
282
  children,
239
283
  size = "default",
@@ -250,11 +294,23 @@ function GoabCheckbox({
250
294
  const detail = e.detail;
251
295
  onChange == null ? void 0 : onChange({ ...detail, event: e });
252
296
  };
297
+ const focusListener = (e) => {
298
+ const detail = e.detail;
299
+ onFocus == null ? void 0 : onFocus({ ...detail, event: e });
300
+ };
301
+ const blurListener = (e) => {
302
+ const detail = e.detail;
303
+ onBlur == null ? void 0 : onBlur({ ...detail, event: e });
304
+ };
253
305
  current.addEventListener("_change", listener);
306
+ current.addEventListener("_focus", focusListener);
307
+ current.addEventListener("_blur", blurListener);
254
308
  return () => {
255
309
  current.removeEventListener("_change", listener);
310
+ current.removeEventListener("_focus", focusListener);
311
+ current.removeEventListener("_blur", blurListener);
256
312
  };
257
- }, [name, onChange]);
313
+ }, [name, onChange, onFocus, onBlur]);
258
314
  return /* @__PURE__ */ jsxRuntime.jsxs(
259
315
  "goa-checkbox",
260
316
  {
@@ -286,6 +342,8 @@ function GoabCheckboxList({
286
342
  size = "default",
287
343
  children,
288
344
  onChange,
345
+ onFocus,
346
+ onBlur,
289
347
  mt,
290
348
  mr,
291
349
  mb,
@@ -299,11 +357,23 @@ function GoabCheckboxList({
299
357
  const detail = e.detail;
300
358
  onChange == null ? void 0 : onChange({ ...detail, event: e });
301
359
  };
360
+ const focusListener = (e) => {
361
+ const detail = e.detail;
362
+ onFocus == null ? void 0 : onFocus({ ...detail, event: e });
363
+ };
364
+ const blurListener = (e) => {
365
+ const detail = e.detail;
366
+ onBlur == null ? void 0 : onBlur({ ...detail, event: e });
367
+ };
302
368
  current.addEventListener("_change", listener);
369
+ current.addEventListener("_focus", focusListener);
370
+ current.addEventListener("_blur", blurListener);
303
371
  return () => {
304
372
  current.removeEventListener("_change", listener);
373
+ current.removeEventListener("_focus", focusListener);
374
+ current.removeEventListener("_blur", blurListener);
305
375
  };
306
- }, [onChange]);
376
+ }, [onChange, onFocus, onBlur]);
307
377
  return /* @__PURE__ */ jsxRuntime.jsx(
308
378
  "goa-checkbox-list",
309
379
  {
@@ -400,6 +470,9 @@ function GoabDataGrid({
400
470
  }
401
471
  );
402
472
  }
473
+ const GoabWorkspaceLayoutScrollState = {
474
+ NO_SCROLL: "no-scroll"
475
+ };
403
476
  function dispatch(el, eventName, detail, opts) {
404
477
  if (!el) {
405
478
  console.error("dispatch element is null");
@@ -2599,6 +2672,8 @@ function GoabDatePicker({
2599
2672
  disabled,
2600
2673
  relative,
2601
2674
  onChange,
2675
+ onFocus,
2676
+ onBlur,
2602
2677
  ...rest
2603
2678
  }) {
2604
2679
  const ref = react.useRef(null);
@@ -2619,15 +2694,27 @@ function GoabDatePicker({
2619
2694
  const detail = e.detail;
2620
2695
  onChange == null ? void 0 : onChange({ ...detail, event: e });
2621
2696
  };
2697
+ const handleFocus = (e) => {
2698
+ const detail = e.detail;
2699
+ onFocus == null ? void 0 : onFocus({ ...detail, event: e });
2700
+ };
2701
+ const handleBlur = (e) => {
2702
+ const detail = e.detail;
2703
+ onBlur == null ? void 0 : onBlur({ ...detail, event: e });
2704
+ };
2622
2705
  if (onChange) {
2623
2706
  current.addEventListener("_change", handleChange);
2624
2707
  }
2708
+ current.addEventListener("_focus", handleFocus);
2709
+ current.addEventListener("_blur", handleBlur);
2625
2710
  return () => {
2626
2711
  if (onChange) {
2627
2712
  current.removeEventListener("_change", handleChange);
2628
2713
  }
2714
+ current.removeEventListener("_focus", handleFocus);
2715
+ current.removeEventListener("_blur", handleBlur);
2629
2716
  };
2630
- }, [onChange]);
2717
+ }, [onChange, onFocus, onBlur]);
2631
2718
  const formatValue = (val) => {
2632
2719
  if (!val) return "";
2633
2720
  if (val instanceof Date) {
@@ -2723,6 +2810,8 @@ function stringify(value) {
2723
2810
  function GoabDropdown({
2724
2811
  value,
2725
2812
  onChange,
2813
+ onFocus,
2814
+ onBlur,
2726
2815
  disabled,
2727
2816
  error,
2728
2817
  filterable,
@@ -2744,15 +2833,27 @@ function GoabDropdown({
2744
2833
  const detail = e.detail;
2745
2834
  onChange == null ? void 0 : onChange({ ...detail, event: e });
2746
2835
  };
2836
+ const focusListener = (e) => {
2837
+ const detail = e.detail;
2838
+ onFocus == null ? void 0 : onFocus({ ...detail, event: e });
2839
+ };
2840
+ const blurListener = (e) => {
2841
+ const detail = e.detail;
2842
+ onBlur == null ? void 0 : onBlur({ ...detail, event: e });
2843
+ };
2747
2844
  if (onChange) {
2748
2845
  current.addEventListener("_change", handler);
2749
2846
  }
2847
+ current.addEventListener("_focus", focusListener);
2848
+ current.addEventListener("_blur", blurListener);
2750
2849
  return () => {
2751
2850
  if (onChange) {
2752
2851
  current.removeEventListener("_change", handler);
2753
2852
  }
2853
+ current.removeEventListener("_focus", focusListener);
2854
+ current.removeEventListener("_blur", blurListener);
2754
2855
  };
2755
- }, [el, onChange]);
2856
+ }, [el, onChange, onFocus, onBlur]);
2756
2857
  return /* @__PURE__ */ jsxRuntime.jsx(
2757
2858
  "goa-dropdown",
2758
2859
  {
@@ -2781,7 +2882,8 @@ function GoabDropdownItem({
2781
2882
  label,
2782
2883
  filter,
2783
2884
  name,
2784
- mountType = "append"
2885
+ mountType = "append",
2886
+ children
2785
2887
  }) {
2786
2888
  return /* @__PURE__ */ jsxRuntime.jsx(
2787
2889
  "goa-dropdown-item",
@@ -2790,7 +2892,71 @@ function GoabDropdownItem({
2790
2892
  label,
2791
2893
  filter,
2792
2894
  name,
2793
- mount: mountType
2895
+ mount: mountType,
2896
+ children
2897
+ }
2898
+ );
2899
+ }
2900
+ function GoabDropdownMultiselect({
2901
+ name,
2902
+ value = [],
2903
+ placeholder,
2904
+ disabled,
2905
+ error,
2906
+ filterable,
2907
+ leadingIcon,
2908
+ showSelectAll,
2909
+ testId,
2910
+ ariaLabel,
2911
+ ariaLabelledBy,
2912
+ maxHeight,
2913
+ width,
2914
+ size = "default",
2915
+ labelFormat,
2916
+ children,
2917
+ onChange,
2918
+ mt,
2919
+ mr,
2920
+ mb,
2921
+ ml
2922
+ }) {
2923
+ const el = react.useRef(null);
2924
+ react.useEffect(() => {
2925
+ if (!el.current) return;
2926
+ const current = el.current;
2927
+ const listener = (e) => {
2928
+ const detail = e.detail;
2929
+ onChange == null ? void 0 : onChange({ ...detail, event: e });
2930
+ };
2931
+ current.addEventListener("_change", listener);
2932
+ return () => {
2933
+ current.removeEventListener("_change", listener);
2934
+ };
2935
+ }, [onChange]);
2936
+ return /* @__PURE__ */ jsxRuntime.jsx(
2937
+ "goa-dropdown-multiselect",
2938
+ {
2939
+ ref: el,
2940
+ name,
2941
+ value,
2942
+ placeholder,
2943
+ disabled: disabled ? "true" : void 0,
2944
+ error: error ? "true" : void 0,
2945
+ filterable: filterable ? "true" : void 0,
2946
+ "leading-icon": leadingIcon,
2947
+ testid: testId,
2948
+ "aria-label": ariaLabel,
2949
+ "aria-labelledby": ariaLabelledBy,
2950
+ "max-height": maxHeight,
2951
+ width,
2952
+ size,
2953
+ "label-format": labelFormat ? labelFormat : void 0,
2954
+ "show-select-all": showSelectAll ? "true" : void 0,
2955
+ mt,
2956
+ mr,
2957
+ mb,
2958
+ ml,
2959
+ children
2794
2960
  }
2795
2961
  );
2796
2962
  }
@@ -3155,6 +3321,7 @@ function GoabHeroBannerActions({
3155
3321
  }
3156
3322
  function GoabIconButton({
3157
3323
  variant = "color",
3324
+ type = "default",
3158
3325
  size = "medium",
3159
3326
  theme = "outline",
3160
3327
  disabled,
@@ -3165,7 +3332,7 @@ function GoabIconButton({
3165
3332
  ...rest
3166
3333
  }) {
3167
3334
  const ref = react.useRef(null);
3168
- const _props = transformProps({ variant, size, theme, ...rest }, lowercase);
3335
+ const _props = transformProps({ variant, type, size, theme, ...rest }, lowercase);
3169
3336
  react.useEffect(() => {
3170
3337
  if (!ref.current) {
3171
3338
  return;
@@ -3194,12 +3361,13 @@ function GoabIconButton({
3194
3361
  }
3195
3362
  );
3196
3363
  }
3197
- function GoabIcon({ inverted, ...rest }) {
3364
+ function GoabIcon({ inverted, ariaHidden, ...rest }) {
3198
3365
  const _props = transformProps(rest, lowercase);
3199
3366
  return /* @__PURE__ */ jsxRuntime.jsx(
3200
3367
  "goa-icon",
3201
3368
  {
3202
3369
  inverted: typeof inverted === "boolean" ? inverted ? "true" : void 0 : inverted,
3370
+ ariahidden: ariaHidden ? "true" : void 0,
3203
3371
  ..._props
3204
3372
  }
3205
3373
  );
@@ -3821,6 +3989,8 @@ function GoabRadioGroup({
3821
3989
  disabled,
3822
3990
  error,
3823
3991
  onChange,
3992
+ onFocus,
3993
+ onBlur,
3824
3994
  name,
3825
3995
  children,
3826
3996
  size = "default",
@@ -3834,16 +4004,28 @@ function GoabRadioGroup({
3834
4004
  const detail = e.detail;
3835
4005
  onChange == null ? void 0 : onChange({ ...detail, event: e });
3836
4006
  };
4007
+ const focusListener = (e) => {
4008
+ const detail = e.detail;
4009
+ onFocus == null ? void 0 : onFocus({ ...detail, event: e });
4010
+ };
4011
+ const blurListener = (e) => {
4012
+ const detail = e.detail;
4013
+ onBlur == null ? void 0 : onBlur({ ...detail, event: e });
4014
+ };
3837
4015
  const currentEl = el.current;
3838
4016
  if (onChange) {
3839
4017
  currentEl.addEventListener("_change", listener);
3840
4018
  }
4019
+ currentEl.addEventListener("_focus", focusListener);
4020
+ currentEl.addEventListener("_blur", blurListener);
3841
4021
  return () => {
3842
4022
  if (onChange) {
3843
4023
  currentEl.removeEventListener("_change", listener);
3844
4024
  }
4025
+ currentEl.removeEventListener("_focus", focusListener);
4026
+ currentEl.removeEventListener("_blur", blurListener);
3845
4027
  };
3846
- }, [name, onChange]);
4028
+ }, [name, onChange, onFocus, onBlur]);
3847
4029
  return /* @__PURE__ */ jsxRuntime.jsx(
3848
4030
  "goa-radio-group",
3849
4031
  {
@@ -3950,6 +4132,32 @@ function GoabSpinner({
3950
4132
  }
3951
4133
  );
3952
4134
  }
4135
+ function GoabScrollPanel({
4136
+ header,
4137
+ children,
4138
+ footer,
4139
+ height,
4140
+ testId,
4141
+ direction = "vertical",
4142
+ ...rest
4143
+ }) {
4144
+ const hostStyle = height ? { height } : void 0;
4145
+ return /* @__PURE__ */ jsxRuntime.jsxs(
4146
+ "goa-scroll-panel",
4147
+ {
4148
+ height,
4149
+ testid: testId,
4150
+ direction,
4151
+ style: hostStyle,
4152
+ ...rest,
4153
+ children: [
4154
+ header && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "header", children: header }),
4155
+ children,
4156
+ footer && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "footer", children: footer })
4157
+ ]
4158
+ }
4159
+ );
4160
+ }
3953
4161
  function GoabTable({ onSort, onMultiSort, sortMode, ...props }) {
3954
4162
  const ref = react.useRef(null);
3955
4163
  react.useEffect(() => {
@@ -4003,6 +4211,7 @@ function GoabTableSortHeader({
4003
4211
  name,
4004
4212
  direction,
4005
4213
  "sort-order": sortOrder,
4214
+ version: "2",
4006
4215
  ...rest,
4007
4216
  children
4008
4217
  }
@@ -4091,6 +4300,7 @@ function GoabTextArea({
4091
4300
  error,
4092
4301
  onChange,
4093
4302
  onKeyPress,
4303
+ onFocus,
4094
4304
  onBlur,
4095
4305
  ...rest
4096
4306
  }) {
@@ -4109,19 +4319,25 @@ function GoabTextArea({
4109
4319
  const detail = e.detail;
4110
4320
  onKeyPress == null ? void 0 : onKeyPress({ ...detail, event: e });
4111
4321
  };
4322
+ const focusListener = (e) => {
4323
+ const detail = e.detail;
4324
+ onFocus == null ? void 0 : onFocus({ ...detail, event: e });
4325
+ };
4112
4326
  const blurListener = (e) => {
4113
4327
  const detail = e.detail;
4114
4328
  onBlur == null ? void 0 : onBlur({ ...detail, event: e });
4115
4329
  };
4116
4330
  current.addEventListener("_change", changeListener);
4117
4331
  current.addEventListener("_keyPress", keypressListener);
4332
+ current.addEventListener("_focus", focusListener);
4118
4333
  current.addEventListener("_blur", blurListener);
4119
4334
  return () => {
4120
4335
  current.removeEventListener("_change", changeListener);
4121
4336
  current.removeEventListener("_keyPress", keypressListener);
4337
+ current.removeEventListener("_focus", focusListener);
4122
4338
  current.removeEventListener("_blur", blurListener);
4123
4339
  };
4124
- }, [el, onChange, onKeyPress, onBlur]);
4340
+ }, [el, onChange, onKeyPress, onFocus, onBlur]);
4125
4341
  return /* @__PURE__ */ jsxRuntime.jsx(
4126
4342
  "goa-textarea",
4127
4343
  {
@@ -4180,6 +4396,7 @@ function GoabTwoColumnLayout(props) {
4180
4396
  );
4181
4397
  }
4182
4398
  const GoabFilterChip = ({
4399
+ content,
4183
4400
  iconTheme = "outline",
4184
4401
  error,
4185
4402
  onClick,
@@ -4200,9 +4417,11 @@ const GoabFilterChip = ({
4200
4417
  "goa-filter-chip",
4201
4418
  {
4202
4419
  ref: el,
4420
+ content: typeof content === "string" ? content : void 0,
4203
4421
  error: error ? "true" : void 0,
4204
4422
  version: "2",
4205
- ..._props
4423
+ ..._props,
4424
+ children: typeof content !== "string" && content != null && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "content", children: content })
4206
4425
  }
4207
4426
  );
4208
4427
  };
@@ -4303,30 +4522,28 @@ function GoabWorkSideMenu({
4303
4522
  }) {
4304
4523
  const el = react.useRef(null);
4305
4524
  react.useEffect(() => {
4306
- var _a;
4307
- if (!(el == null ? void 0 : el.current) || !onToggle) {
4525
+ const node = el.current;
4526
+ if (!node || !onToggle) {
4308
4527
  return;
4309
4528
  }
4310
- (_a = el.current) == null ? void 0 : _a.addEventListener("_toggle", onToggle);
4529
+ node.addEventListener("_toggle", onToggle);
4311
4530
  return () => {
4312
- var _a2;
4313
- (_a2 = el.current) == null ? void 0 : _a2.removeEventListener("_toggle", onToggle);
4531
+ node.removeEventListener("_toggle", onToggle);
4314
4532
  };
4315
- }, [el, onToggle]);
4533
+ }, [onToggle]);
4316
4534
  react.useEffect(() => {
4317
- var _a;
4318
- if (!(el == null ? void 0 : el.current) || !onNavigate) {
4535
+ const node = el.current;
4536
+ if (!node || !onNavigate) {
4319
4537
  return;
4320
4538
  }
4321
4539
  const handler = (e) => {
4322
4540
  onNavigate(e.detail.url);
4323
4541
  };
4324
- (_a = el.current) == null ? void 0 : _a.addEventListener("_navigate", handler);
4542
+ node.addEventListener("_navigate", handler);
4325
4543
  return () => {
4326
- var _a2;
4327
- (_a2 = el.current) == null ? void 0 : _a2.removeEventListener("_navigate", handler);
4544
+ node.removeEventListener("_navigate", handler);
4328
4545
  };
4329
- }, [el, onNavigate]);
4546
+ }, [onNavigate]);
4330
4547
  return /* @__PURE__ */ jsxRuntime.jsxs(
4331
4548
  "goa-work-side-menu",
4332
4549
  {
@@ -4371,6 +4588,7 @@ function GoabWorkSideMenuItem(props) {
4371
4588
  type: props.type,
4372
4589
  children: [
4373
4590
  props.popoverContent && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "popoverContent", children: props.popoverContent }),
4591
+ props.trailingContent && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "trailingContent", children: props.trailingContent }),
4374
4592
  props.children
4375
4593
  ]
4376
4594
  }
@@ -4448,6 +4666,95 @@ function GoabWorkSideNotificationPanel({
4448
4666
  }
4449
4667
  );
4450
4668
  }
4669
+ const STORAGE_KEY = "goab-theme";
4670
+ const ATTRIBUTE = "data-theme";
4671
+ const GoabThemeContext = react.createContext(null);
4672
+ function readInitialMode(defaultMode) {
4673
+ if (typeof window === "undefined") return defaultMode;
4674
+ try {
4675
+ const stored = window.localStorage.getItem(STORAGE_KEY);
4676
+ if (stored === "light" || stored === "dark") return stored;
4677
+ } catch {
4678
+ }
4679
+ const fromAttribute = document.documentElement.getAttribute(ATTRIBUTE);
4680
+ if (fromAttribute === "light" || fromAttribute === "dark") return fromAttribute;
4681
+ if (window.matchMedia("(prefers-color-scheme: dark)").matches) return "dark";
4682
+ return defaultMode;
4683
+ }
4684
+ function GoabThemeProvider({
4685
+ children,
4686
+ defaultMode = "light"
4687
+ }) {
4688
+ const [mode, setModeState] = react.useState(
4689
+ () => readInitialMode(defaultMode)
4690
+ );
4691
+ react.useEffect(() => {
4692
+ if (typeof document === "undefined") return;
4693
+ document.documentElement.setAttribute(ATTRIBUTE, mode);
4694
+ try {
4695
+ window.localStorage.setItem(STORAGE_KEY, mode);
4696
+ } catch {
4697
+ }
4698
+ }, [mode]);
4699
+ const setMode = react.useCallback((next) => {
4700
+ setModeState(next);
4701
+ }, []);
4702
+ const toggle = react.useCallback(() => {
4703
+ setModeState((prev) => prev === "light" ? "dark" : "light");
4704
+ }, []);
4705
+ return /* @__PURE__ */ jsxRuntime.jsx(GoabThemeContext.Provider, { value: { mode, setMode, toggle }, children });
4706
+ }
4707
+ function useTheme() {
4708
+ const ctx = react.useContext(GoabThemeContext);
4709
+ if (!ctx) {
4710
+ throw new Error("useTheme must be used within a GoabThemeProvider");
4711
+ }
4712
+ return ctx;
4713
+ }
4714
+ const GoabWorkspaceLayoutScrollStateDefault = {
4715
+ scrollPosition: GoabWorkspaceLayoutScrollState.NO_SCROLL,
4716
+ isScrollable: false
4717
+ };
4718
+ const GoabWorkspaceLayoutScrollStateContext = react.createContext(
4719
+ GoabWorkspaceLayoutScrollStateDefault
4720
+ );
4721
+ function useGoabWorkspaceLayoutScrollState() {
4722
+ return react.useContext(GoabWorkspaceLayoutScrollStateContext);
4723
+ }
4724
+ function GoabWorkspaceLayout({
4725
+ sideMenu,
4726
+ pageHeader,
4727
+ pageFooter,
4728
+ pushDrawer,
4729
+ children,
4730
+ testId,
4731
+ onScrollStateChange,
4732
+ ...rest
4733
+ }) {
4734
+ const ref = react.useRef(null);
4735
+ const [scrollState, setScrollState] = react.useState(GoabWorkspaceLayoutScrollStateDefault);
4736
+ react.useEffect(() => {
4737
+ const el = ref.current;
4738
+ if (!el) return;
4739
+ const listener = (e) => {
4740
+ const detail = e.detail;
4741
+ setScrollState({
4742
+ scrollPosition: detail.state,
4743
+ isScrollable: detail.isScrollable
4744
+ });
4745
+ onScrollStateChange == null ? void 0 : onScrollStateChange({ ...detail, event: e });
4746
+ };
4747
+ el.addEventListener("_scrollStateChange", listener);
4748
+ return () => el.removeEventListener("_scrollStateChange", listener);
4749
+ }, [onScrollStateChange]);
4750
+ return /* @__PURE__ */ jsxRuntime.jsx(GoabWorkspaceLayoutScrollStateContext.Provider, { value: scrollState, children: /* @__PURE__ */ jsxRuntime.jsxs("goa-workspace-layout", { ref, testid: testId, ...rest, children: [
4751
+ sideMenu && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "side-menu", children: sideMenu }),
4752
+ pageHeader && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "page-header", children: pageHeader }),
4753
+ children,
4754
+ pageFooter && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "page-footer", children: pageFooter }),
4755
+ pushDrawer && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "push-drawer", children: pushDrawer })
4756
+ ] }) });
4757
+ }
4451
4758
  exports.GoALinkButton = GoALinkButton;
4452
4759
  exports.GoabAccordion = GoabAccordion;
4453
4760
  exports.GoabAppFooter = GoabAppFooter;
@@ -4473,6 +4780,7 @@ exports.GoabDivider = GoabDivider;
4473
4780
  exports.GoabDrawer = GoabDrawer;
4474
4781
  exports.GoabDropdown = GoabDropdown;
4475
4782
  exports.GoabDropdownItem = GoabDropdownItem;
4783
+ exports.GoabDropdownMultiselect = GoabDropdownMultiselect;
4476
4784
  exports.GoabDropdownOption = GoabDropdownOption;
4477
4785
  exports.GoabFieldset = GoabFieldset;
4478
4786
  exports.GoabFileUploadCard = GoabFileUploadCard;
@@ -4522,6 +4830,7 @@ exports.GoabPublicSubformIndex = GoabPublicSubformIndex;
4522
4830
  exports.GoabPushDrawer = GoabPushDrawer;
4523
4831
  exports.GoabRadioGroup = GoabRadioGroup;
4524
4832
  exports.GoabRadioItem = GoabRadioItem;
4833
+ exports.GoabScrollPanel = GoabScrollPanel;
4525
4834
  exports.GoabSideMenu = GoabSideMenu;
4526
4835
  exports.GoabSideMenuGroup = GoabSideMenuGroup;
4527
4836
  exports.GoabSideMenuHeading = GoabSideMenuHeading;
@@ -4536,6 +4845,7 @@ exports.GoabTemporaryNotificationCtrl = GoabTemporaryNotificationCtrl;
4536
4845
  exports.GoabText = GoabText;
4537
4846
  exports.GoabTextArea = GoabTextArea;
4538
4847
  exports.GoabTextarea = GoabTextArea;
4848
+ exports.GoabThemeProvider = GoabThemeProvider;
4539
4849
  exports.GoabThreeColumnLayout = GoabThreeColumnLayout;
4540
4850
  exports.GoabTooltip = GoabTooltip;
4541
4851
  exports.GoabTwoColumnLayout = GoabTwoColumnLayout;
@@ -4544,5 +4854,8 @@ exports.GoabWorkSideMenuGroup = GoabWorkSideMenuGroup;
4544
4854
  exports.GoabWorkSideMenuItem = GoabWorkSideMenuItem;
4545
4855
  exports.GoabWorkSideNotificationItem = GoabWorkSideNotificationItem;
4546
4856
  exports.GoabWorkSideNotificationPanel = GoabWorkSideNotificationPanel;
4857
+ exports.GoabWorkspaceLayout = GoabWorkspaceLayout;
4858
+ exports.useGoabWorkspaceLayoutScrollState = useGoabWorkspaceLayoutScrollState;
4547
4859
  exports.usePublicFormController = usePublicFormController;
4860
+ exports.useTheme = useTheme;
4548
4861
  //# sourceMappingURL=index.js.map