@abgov/react-components 6.3.0-alpha.4 → 6.3.0-alpha.6

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.
Files changed (87) hide show
  1. package/experimental/form/form-summary.d.ts +1 -1
  2. package/experimental/form/form.d.ts +2 -2
  3. package/experimental/form/task-list.d.ts +2 -2
  4. package/experimental/form/task.d.ts +1 -1
  5. package/experimental/resizable-panel/ResizablePanel.d.ts +1 -1
  6. package/experimental.js +1 -1
  7. package/experimental.js.map +1 -1
  8. package/experimental.mjs +2 -2
  9. package/experimental.mjs.map +1 -1
  10. package/{icon-BPmPItnm.js → icon-CK55b563.js} +5 -4
  11. package/icon-CK55b563.js.map +1 -0
  12. package/{icon-BNGrU_R_.mjs → icon-CoYGOp1V.mjs} +5 -4
  13. package/icon-CoYGOp1V.mjs.map +1 -0
  14. package/index.js +68 -71
  15. package/index.js.map +1 -1
  16. package/index.mjs +68 -71
  17. package/index.mjs.map +1 -1
  18. package/lib/accordion/accordion.d.ts +4 -4
  19. package/lib/app-header/app-header.d.ts +5 -4
  20. package/lib/app-header-menu/app-header-menu.d.ts +1 -1
  21. package/lib/badge/badge.d.ts +3 -2
  22. package/lib/block/block.d.ts +1 -1
  23. package/lib/button/button.d.ts +4 -4
  24. package/lib/button-group/button-group.d.ts +2 -1
  25. package/lib/calendar/calendar.d.ts +3 -2
  26. package/lib/callout/callout.d.ts +1 -1
  27. package/lib/card/card-actions.d.ts +3 -2
  28. package/lib/card/card-content.d.ts +3 -2
  29. package/lib/card/card-group.d.ts +3 -2
  30. package/lib/card/card-image.d.ts +3 -2
  31. package/lib/card/card.d.ts +2 -1
  32. package/lib/checkbox/checkbox.d.ts +7 -6
  33. package/lib/chip/chip.d.ts +6 -6
  34. package/lib/circular-progress/circular-progress.d.ts +1 -1
  35. package/lib/container/container.d.ts +2 -2
  36. package/lib/date-picker/date-picker.d.ts +6 -5
  37. package/lib/details/details.d.ts +2 -2
  38. package/lib/divider/divider.d.ts +1 -1
  39. package/lib/drawer/drawer.d.ts +6 -6
  40. package/lib/dropdown/dropdown-item.d.ts +2 -2
  41. package/lib/dropdown/dropdown.d.ts +9 -8
  42. package/lib/fieldset/fieldset.d.ts +4 -4
  43. package/lib/file-upload-card/file-upload-card.d.ts +2 -2
  44. package/lib/file-upload-input/file-upload-input.d.ts +2 -2
  45. package/lib/filter-chip/filter-chip.d.ts +3 -3
  46. package/lib/footer/footer.d.ts +2 -2
  47. package/lib/footer-meta-section/footer-meta-section.d.ts +1 -1
  48. package/lib/footer-nav-section/footer-nav-section.d.ts +1 -1
  49. package/lib/form-item/form-item.d.ts +2 -1
  50. package/lib/form-step/form-step.d.ts +1 -1
  51. package/lib/form-stepper/form-stepper.d.ts +2 -2
  52. package/lib/grid/grid.d.ts +2 -1
  53. package/lib/hero-banner/hero-banner-actions.d.ts +2 -1
  54. package/lib/hero-banner/hero-banner.d.ts +3 -2
  55. package/lib/icon/icon.d.ts +6 -4
  56. package/lib/icon-button/icon-button.d.ts +4 -3
  57. package/lib/input/input.d.ts +8 -7
  58. package/lib/link/link.d.ts +1 -1
  59. package/lib/link-button/link-button.d.ts +1 -1
  60. package/lib/microsite-header/microsite-header.d.ts +4 -3
  61. package/lib/modal/modal.d.ts +6 -6
  62. package/lib/notification/notification.d.ts +2 -2
  63. package/lib/one-column-layout/one-column-layout.d.ts +2 -2
  64. package/lib/page-block/page-block.d.ts +2 -2
  65. package/lib/pages/pages.d.ts +2 -2
  66. package/lib/pagination/pagination.d.ts +2 -2
  67. package/lib/popover/popover.d.ts +4 -4
  68. package/lib/radio-group/radio-group.d.ts +5 -4
  69. package/lib/radio-group/radio.d.ts +8 -8
  70. package/lib/side-menu/side-menu.d.ts +2 -2
  71. package/lib/side-menu-group/side-menu-group.d.ts +2 -2
  72. package/lib/side-menu-heading/side-menu-heading.d.ts +1 -1
  73. package/lib/skeleton/skeleton.d.ts +1 -1
  74. package/lib/spacer/spacer.d.ts +1 -1
  75. package/lib/spinner/spinner.d.ts +3 -2
  76. package/lib/tab/tab.d.ts +3 -2
  77. package/lib/table/table-sort-header.d.ts +2 -1
  78. package/lib/table/table.d.ts +3 -3
  79. package/lib/tabs/tabs.d.ts +3 -3
  80. package/lib/text/text.d.ts +2 -2
  81. package/lib/textarea/textarea.d.ts +5 -4
  82. package/lib/three-column-layout/three-column-layout.d.ts +1 -1
  83. package/lib/tooltip/tooltip.d.ts +2 -2
  84. package/lib/two-column-layout/two-column-layout.d.ts +1 -1
  85. package/package.json +4 -4
  86. package/icon-BNGrU_R_.mjs.map +0 -1
  87. package/icon-BPmPItnm.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- declare global {
2
+ declare module "react" {
3
3
  namespace JSX {
4
4
  interface IntrinsicElements {
5
5
  "goa-simple-form-summary": React.HTMLAttributes<HTMLElement>;
@@ -2,11 +2,11 @@ import { Margins, GoabFormStorageType, GoabFormOnMountDetail, GoabFormOnStateCha
2
2
  import { ReactNode } from 'react';
3
3
 
4
4
  interface WCProps extends Margins {
5
- ref?: React.MutableRefObject<HTMLElement | undefined>;
5
+ ref?: React.RefObject<HTMLElement | null>;
6
6
  name: string;
7
7
  storage: GoabFormStorageType;
8
8
  }
9
- declare global {
9
+ declare module "react" {
10
10
  namespace JSX {
11
11
  interface IntrinsicElements {
12
12
  "goa-simple-form": WCProps & React.HTMLAttributes<HTMLElement>;
@@ -4,7 +4,7 @@ import { ReactNode } from 'react';
4
4
  interface WCProps extends Margins {
5
5
  heading: string;
6
6
  }
7
- declare global {
7
+ declare module "react" {
8
8
  namespace JSX {
9
9
  interface IntrinsicElements {
10
10
  "goa-public-form-task-list": WCProps & React.HTMLAttributes<HTMLElement>;
@@ -15,5 +15,5 @@ type GoabPublicFormTaskListProps = {
15
15
  heading: string;
16
16
  children: ReactNode;
17
17
  };
18
- export declare function GoabPublicFormTaskList({ heading, children }: GoabPublicFormTaskListProps): import("react/jsx-runtime").JSX.Element;
18
+ export declare function GoabPublicFormTaskList({ heading, children, }: GoabPublicFormTaskListProps): import("react/jsx-runtime").JSX.Element;
19
19
  export default GoabPublicFormTaskList;
@@ -4,7 +4,7 @@ import { ReactNode } from 'react';
4
4
  interface WCProps extends Margins {
5
5
  status: "completed" | "not-started" | "cannot-start";
6
6
  }
7
- declare global {
7
+ declare module "react" {
8
8
  namespace JSX {
9
9
  interface IntrinsicElements {
10
10
  "goa-public-form-task": WCProps & React.HTMLAttributes<HTMLElement>;
@@ -1,4 +1,4 @@
1
- import { ReactNode } from 'react';
1
+ import { ReactNode, JSX } from 'react';
2
2
 
3
3
  export type ResizableProps = {
4
4
  minWidth?: number;
package/experimental.js CHANGED
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const react = require("react");
5
- const icon = require("./icon-BPmPItnm.js");
5
+ const icon = require("./icon-CK55b563.js");
6
6
  const panel = "_panel_m3z4m_1";
7
7
  const panelBackground = "_panelBackground_m3z4m_8";
8
8
  const children = "_children_m3z4m_12";
@@ -1 +1 @@
1
- {"version":3,"file":"experimental.js","sources":["../../../libs/react-components/src/experimental/resizable-panel/ResizablePanel.tsx"],"sourcesContent":["import { ReactNode, useEffect, useRef, useState } from \"react\";\nimport Css from \"./ResizablePanel.module.css\";\nimport { GoabIcon } from \"../../lib/icon/icon\";\n\nexport type ResizableProps = {\n minWidth?: number;\n children: ReactNode;\n};\n\ntype MouseState = \"static\" | \"active\";\n\nexport function ResizablePanel(props: ResizableProps): JSX.Element {\n // element refs\n const bgRef = useRef<HTMLDivElement | null>(null);\n const sectionRef = useRef<HTMLElement | null>(null);\n const widthRef = useRef<HTMLDivElement | null>(null);\n const handleRef = useRef<HTMLDivElement | null>(null);\n\n // value refs\n const maxWidth = useRef<number>(0);\n const resizeBarState = useRef<MouseState>(\"static\");\n\n // state\n const [width, setWidth] = useState<string>();\n\n useEffect(() => {\n maxWidth.current = bgRef.current?.getBoundingClientRect().width ?? 0;\n }, []);\n\n function resetMouseState() {\n resizeBarState.current = \"static\";\n }\n\n function onMouseDown(_: React.MouseEvent) {\n resizeBarState.current = \"active\";\n window.addEventListener(\"mouseup\", resetMouseState);\n }\n\n function onMouseUp(_: React.MouseEvent) {\n resizeBarState.current = \"static\";\n window.removeEventListener(\"mouseup\", resetMouseState);\n }\n\n function onMouseMove(e: React.MouseEvent) {\n if (resizeBarState.current === \"static\") {\n return;\n }\n\n const sectionEl = sectionRef.current;\n const xOffset = sectionEl?.getBoundingClientRect().x || 0;\n const mouseX = e.clientX;\n const minWidth = props.minWidth || 0;\n\n if (mouseX <= 0) {\n return;\n }\n\n // mouse direction\n const newXPos = handleRef.current?.getBoundingClientRect().x ?? 0;\n\n // set width of preview area\n const calcWidth = Math.max(\n newXPos - xOffset,\n Math.min(mouseX - xOffset, maxWidth.current),\n );\n const elementWidth = Math.max(minWidth, calcWidth - 64); // 4rem padding\n\n // prevent dragging bar more than allowed\n if (elementWidth <= minWidth) {\n return;\n }\n\n // set resizable area width\n sectionEl?.setAttribute(\"style\", `width: ${calcWidth}px;`);\n // set displayed px width\n widthRef.current?.setAttribute(\n \"style\",\n `right: ${maxWidth.current - calcWidth + 32}px`,\n );\n setWidth(`${Math.round(elementWidth)}px`);\n }\n\n return (\n <div\n ref={bgRef}\n className={Css.panelBackground}\n onMouseDown={onMouseDown}\n onMouseMove={onMouseMove}\n onMouseUp={onMouseUp}\n >\n <section ref={sectionRef} className={Css.panel}>\n <div className={Css.children}>{props.children}</div>\n <div ref={handleRef} className={Css.handle}>\n <GoabIcon type=\"reorder-two\" />\n </div>\n </section>\n <div ref={widthRef} className={Css.width}>\n {width}\n </div>\n </div>\n );\n}\n\nexport default ResizablePanel;\n"],"names":["useRef","width","useState","useEffect","jsxs","jsx","GoabIcon"],"mappings":";;;;;;;;;;;;;;;;;AAWO,SAAS,eAAe,OAAoC;AAE3D,QAAA,QAAQA,aAA8B,IAAI;AAC1C,QAAA,aAAaA,aAA2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AA,IAAC;AAAA,IAAA;AAAA,MACC,KAAK;AAAA,MACL,WAAW,IAAI;AAAA,MACf;AAAA,MACA;AAAA,MACA;AAAA,MAEA,UAAA;AAAA,QAAAA,gCAAC,WAAQ,EAAA,KAAK,YAAY,WAAW,IAAI,OACvC,UAAA;AAAA,UAAAC,+BAAC,OAAI,EAAA,WAAW,IAAI,UAAW,gBAAM,UAAS;AAAA,UAC9CA,2BAAA,IAAC,OAAI,EAAA,KAAK,WAAW,WAAW,IAAI,QAClC,UAACA,2BAAAA,IAAAC,KAAAA,UAAA,EAAS,MAAK,cAAA,CAAc,EAC/B,CAAA;AAAA,QAAA,GACF;AAAA,uCACC,OAAI,EAAA,KAAK,UAAU,WAAW,IAAI,OAChC,UACHL,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;;;"}
1
+ {"version":3,"file":"experimental.js","sources":["../../../libs/react-components/src/experimental/resizable-panel/ResizablePanel.tsx"],"sourcesContent":["import { ReactNode, useEffect, useRef, useState, type JSX } from \"react\";\nimport Css from \"./ResizablePanel.module.css\";\nimport { GoabIcon } from \"../../lib/icon/icon\";\n\nexport type ResizableProps = {\n minWidth?: number;\n children: ReactNode;\n};\n\ntype MouseState = \"static\" | \"active\";\n\nexport function ResizablePanel(props: ResizableProps): JSX.Element {\n // element refs\n const bgRef = useRef<HTMLDivElement | null>(null);\n const sectionRef = useRef<HTMLElement | null>(null);\n const widthRef = useRef<HTMLDivElement | null>(null);\n const handleRef = useRef<HTMLDivElement | null>(null);\n\n // value refs\n const maxWidth = useRef<number>(0);\n const resizeBarState = useRef<MouseState>(\"static\");\n\n // state\n const [width, setWidth] = useState<string>();\n\n useEffect(() => {\n maxWidth.current = bgRef.current?.getBoundingClientRect().width ?? 0;\n }, []);\n\n function resetMouseState() {\n resizeBarState.current = \"static\";\n }\n\n function onMouseDown(_: React.MouseEvent) {\n resizeBarState.current = \"active\";\n window.addEventListener(\"mouseup\", resetMouseState);\n }\n\n function onMouseUp(_: React.MouseEvent) {\n resizeBarState.current = \"static\";\n window.removeEventListener(\"mouseup\", resetMouseState);\n }\n\n function onMouseMove(e: React.MouseEvent) {\n if (resizeBarState.current === \"static\") {\n return;\n }\n\n const sectionEl = sectionRef.current;\n const xOffset = sectionEl?.getBoundingClientRect().x || 0;\n const mouseX = e.clientX;\n const minWidth = props.minWidth || 0;\n\n if (mouseX <= 0) {\n return;\n }\n\n // mouse direction\n const newXPos = handleRef.current?.getBoundingClientRect().x ?? 0;\n\n // set width of preview area\n const calcWidth = Math.max(\n newXPos - xOffset,\n Math.min(mouseX - xOffset, maxWidth.current),\n );\n const elementWidth = Math.max(minWidth, calcWidth - 64); // 4rem padding\n\n // prevent dragging bar more than allowed\n if (elementWidth <= minWidth) {\n return;\n }\n\n // set resizable area width\n sectionEl?.setAttribute(\"style\", `width: ${calcWidth}px;`);\n // set displayed px width\n widthRef.current?.setAttribute(\n \"style\",\n `right: ${maxWidth.current - calcWidth + 32}px`,\n );\n setWidth(`${Math.round(elementWidth)}px`);\n }\n\n return (\n <div\n ref={bgRef}\n className={Css.panelBackground}\n onMouseDown={onMouseDown}\n onMouseMove={onMouseMove}\n onMouseUp={onMouseUp}\n >\n <section ref={sectionRef} className={Css.panel}>\n <div className={Css.children}>{props.children}</div>\n <div ref={handleRef} className={Css.handle}>\n <GoabIcon type=\"reorder-two\" />\n </div>\n </section>\n <div ref={widthRef} className={Css.width}>\n {width}\n </div>\n </div>\n );\n}\n\nexport default ResizablePanel;\n"],"names":["useRef","width","useState","useEffect","jsxs","jsx","GoabIcon"],"mappings":";;;;;;;;;;;;;;;;;AAWO,SAAS,eAAe,OAAoC;AAE3D,QAAA,QAAQA,aAA8B,IAAI;AAC1C,QAAA,aAAaA,aAA2B,IAAI;AAC5C,QAAA,WAAWA,aAA8B,IAAI;AAC7C,QAAA,YAAYA,aAA8B,IAAI;AAG9C,QAAA,WAAWA,aAAe,CAAC;AAC3B,QAAA,iBAAiBA,aAAmB,QAAQ;AAGlD,QAAM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WAAW,IAAI,OACvC,UAAA;AAAA,UAAAC,+BAAC,OAAI,EAAA,WAAW,IAAI,UAAW,gBAAM,UAAS;AAAA,UAC9CA,2BAAA,IAAC,OAAI,EAAA,KAAK,WAAW,WAAW,IAAI,QAClC,UAACA,2BAAAA,IAAAC,KAAAA,UAAA,EAAS,MAAK,cAAA,CAAc,EAC/B,CAAA;AAAA,QAAA,GACF;AAAA,uCACC,OAAI,EAAA,KAAK,UAAU,WAAW,IAAI,OAChC,UACHL,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;;;"}
package/experimental.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { useRef, useState, useEffect } from "react";
3
- import { a as GoabIcon } from "./icon-BNGrU_R_.mjs";
4
- import { G } from "./icon-BNGrU_R_.mjs";
3
+ import { a as GoabIcon } from "./icon-CoYGOp1V.mjs";
4
+ import { G } from "./icon-CoYGOp1V.mjs";
5
5
  const panel = "_panel_m3z4m_1";
6
6
  const panelBackground = "_panelBackground_m3z4m_8";
7
7
  const children = "_children_m3z4m_12";
@@ -1 +1 @@
1
- {"version":3,"file":"experimental.mjs","sources":["../../../libs/react-components/src/experimental/resizable-panel/ResizablePanel.tsx"],"sourcesContent":["import { ReactNode, useEffect, useRef, useState } from \"react\";\nimport Css from \"./ResizablePanel.module.css\";\nimport { GoabIcon } from \"../../lib/icon/icon\";\n\nexport type ResizableProps = {\n minWidth?: number;\n children: ReactNode;\n};\n\ntype MouseState = \"static\" | \"active\";\n\nexport function ResizablePanel(props: ResizableProps): JSX.Element {\n // element refs\n const bgRef = useRef<HTMLDivElement | null>(null);\n const sectionRef = useRef<HTMLElement | null>(null);\n const widthRef = useRef<HTMLDivElement | null>(null);\n const handleRef = useRef<HTMLDivElement | null>(null);\n\n // value refs\n const maxWidth = useRef<number>(0);\n const resizeBarState = useRef<MouseState>(\"static\");\n\n // state\n const [width, setWidth] = useState<string>();\n\n useEffect(() => {\n maxWidth.current = bgRef.current?.getBoundingClientRect().width ?? 0;\n }, []);\n\n function resetMouseState() {\n resizeBarState.current = \"static\";\n }\n\n function onMouseDown(_: React.MouseEvent) {\n resizeBarState.current = \"active\";\n window.addEventListener(\"mouseup\", resetMouseState);\n }\n\n function onMouseUp(_: React.MouseEvent) {\n resizeBarState.current = \"static\";\n window.removeEventListener(\"mouseup\", resetMouseState);\n }\n\n function onMouseMove(e: React.MouseEvent) {\n if (resizeBarState.current === \"static\") {\n return;\n }\n\n const sectionEl = sectionRef.current;\n const xOffset = sectionEl?.getBoundingClientRect().x || 0;\n const mouseX = e.clientX;\n const minWidth = props.minWidth || 0;\n\n if (mouseX <= 0) {\n return;\n }\n\n // mouse direction\n const newXPos = handleRef.current?.getBoundingClientRect().x ?? 0;\n\n // set width of preview area\n const calcWidth = Math.max(\n newXPos - xOffset,\n Math.min(mouseX - xOffset, maxWidth.current),\n );\n const elementWidth = Math.max(minWidth, calcWidth - 64); // 4rem padding\n\n // prevent dragging bar more than allowed\n if (elementWidth <= minWidth) {\n return;\n }\n\n // set resizable area width\n sectionEl?.setAttribute(\"style\", `width: ${calcWidth}px;`);\n // set displayed px width\n widthRef.current?.setAttribute(\n \"style\",\n `right: ${maxWidth.current - calcWidth + 32}px`,\n );\n setWidth(`${Math.round(elementWidth)}px`);\n }\n\n return (\n <div\n ref={bgRef}\n className={Css.panelBackground}\n onMouseDown={onMouseDown}\n onMouseMove={onMouseMove}\n onMouseUp={onMouseUp}\n >\n <section ref={sectionRef} className={Css.panel}>\n <div className={Css.children}>{props.children}</div>\n <div ref={handleRef} className={Css.handle}>\n <GoabIcon type=\"reorder-two\" />\n </div>\n </section>\n <div ref={widthRef} className={Css.width}>\n {width}\n </div>\n </div>\n );\n}\n\nexport default ResizablePanel;\n"],"names":["width"],"mappings":";;;;;;;;;;;;;;;;AAWO,SAAS,eAAe,OAAoC;AAE3D,QAAA,QAAQ,OAA8B,IAAI;AAC1C,QAAA,aAAa,OAA2B,I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KAAK;AAAA,MACL,WAAW,IAAI;AAAA,MACf;AAAA,MACA;AAAA,MACA;AAAA,MAEA,UAAA;AAAA,QAAA,qBAAC,WAAQ,EAAA,KAAK,YAAY,WAAW,IAAI,OACvC,UAAA;AAAA,UAAA,oBAAC,OAAI,EAAA,WAAW,IAAI,UAAW,gBAAM,UAAS;AAAA,UAC9C,oBAAC,OAAI,EAAA,KAAK,WAAW,WAAW,IAAI,QAClC,UAAC,oBAAA,UAAA,EAAS,MAAK,cAAA,CAAc,EAC/B,CAAA;AAAA,QAAA,GACF;AAAA,4BACC,OAAI,EAAA,KAAK,UAAU,WAAW,IAAI,OAChC,UACHA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"experimental.mjs","sources":["../../../libs/react-components/src/experimental/resizable-panel/ResizablePanel.tsx"],"sourcesContent":["import { ReactNode, useEffect, useRef, useState, type JSX } from \"react\";\nimport Css from \"./ResizablePanel.module.css\";\nimport { GoabIcon } from \"../../lib/icon/icon\";\n\nexport type ResizableProps = {\n minWidth?: number;\n children: ReactNode;\n};\n\ntype MouseState = \"static\" | \"active\";\n\nexport function ResizablePanel(props: ResizableProps): JSX.Element {\n // element refs\n const bgRef = useRef<HTMLDivElement | null>(null);\n const sectionRef = useRef<HTMLElement | null>(null);\n const widthRef = useRef<HTMLDivElement | null>(null);\n const handleRef = useRef<HTMLDivElement | null>(null);\n\n // value refs\n const maxWidth = useRef<number>(0);\n const resizeBarState = useRef<MouseState>(\"static\");\n\n // state\n const [width, setWidth] = useState<string>();\n\n useEffect(() => {\n maxWidth.current = bgRef.current?.getBoundingClientRect().width ?? 0;\n }, []);\n\n function resetMouseState() {\n resizeBarState.current = \"static\";\n }\n\n function onMouseDown(_: React.MouseEvent) {\n resizeBarState.current = \"active\";\n window.addEventListener(\"mouseup\", resetMouseState);\n }\n\n function onMouseUp(_: React.MouseEvent) {\n resizeBarState.current = \"static\";\n window.removeEventListener(\"mouseup\", resetMouseState);\n }\n\n function onMouseMove(e: React.MouseEvent) {\n if (resizeBarState.current === \"static\") {\n return;\n }\n\n const sectionEl = sectionRef.current;\n const xOffset = sectionEl?.getBoundingClientRect().x || 0;\n const mouseX = e.clientX;\n const minWidth = props.minWidth || 0;\n\n if (mouseX <= 0) {\n return;\n }\n\n // mouse direction\n const newXPos = handleRef.current?.getBoundingClientRect().x ?? 0;\n\n // set width of preview area\n const calcWidth = Math.max(\n newXPos - xOffset,\n Math.min(mouseX - xOffset, maxWidth.current),\n );\n const elementWidth = Math.max(minWidth, calcWidth - 64); // 4rem padding\n\n // prevent dragging bar more than allowed\n if (elementWidth <= minWidth) {\n return;\n }\n\n // set resizable area width\n sectionEl?.setAttribute(\"style\", `width: ${calcWidth}px;`);\n // set displayed px width\n widthRef.current?.setAttribute(\n \"style\",\n `right: ${maxWidth.current - calcWidth + 32}px`,\n );\n setWidth(`${Math.round(elementWidth)}px`);\n }\n\n return (\n <div\n ref={bgRef}\n className={Css.panelBackground}\n onMouseDown={onMouseDown}\n onMouseMove={onMouseMove}\n onMouseUp={onMouseUp}\n >\n <section ref={sectionRef} className={Css.panel}>\n <div className={Css.children}>{props.children}</div>\n <div ref={handleRef} className={Css.handle}>\n <GoabIcon type=\"reorder-two\" />\n </div>\n </section>\n <div ref={widthRef} className={Css.width}>\n {width}\n </div>\n </div>\n );\n}\n\nexport default ResizablePanel;\n"],"names":["width"],"mappings":";;;;;;;;;;;;;;;;AAWO,SAAS,eAAe,OAAoC;AAE3D,QAAA,QAAQ,OAA8B,IAAI;AAC1C,QAAA,aAAa,OAA2B,IAAI;AAC5C,QAAA,WAAW,OAA8B,IAAI;AAC7C,QAAA,YAAY,OAA8B,IAAI;AAG9C,QAAA,WAAW,OAAe,CAAC;AAC3B,QAAA,iBAAiB,OAAmB,QAAQ;AAGlD,QAAM,CAACA,QAAO,QAAQ,IAAI,SAAiB;AAE3C,YAAU,MAAM;;AACd,aAAS,YAAU,WAAM,YAAN,mBAAe,wBAAwB,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,WAAW,WAAW,IAAI,QAClC,UAAC,oBAAA,UAAA,EAAS,MAAK,cAAA,CAAc,EAC/B,CAAA;AAAA,QAAA,GACF;AAAA,4BACC,OAAI,EAAA,KAAK,UAAU,WAAW,IAAI,OAChC,UACHA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -2,8 +2,8 @@
2
2
  const jsxRuntime = require("react/jsx-runtime");
3
3
  const react = require("react");
4
4
  function GoabDrawer({
5
- open,
6
5
  position,
6
+ open,
7
7
  heading,
8
8
  maxSize,
9
9
  testId,
@@ -27,8 +27,8 @@ function GoabDrawer({
27
27
  "goa-drawer",
28
28
  {
29
29
  ref: el,
30
- open: open ? true : void 0,
31
30
  position,
31
+ open: open ? true : void 0,
32
32
  heading: typeof heading === "string" ? heading : void 0,
33
33
  maxsize: maxSize,
34
34
  testid: testId,
@@ -45,6 +45,7 @@ function GoabIcon({
45
45
  theme,
46
46
  size,
47
47
  inverted,
48
+ // TODO: change to boolean only
48
49
  fillColor,
49
50
  opacity,
50
51
  title,
@@ -61,7 +62,7 @@ function GoabIcon({
61
62
  type,
62
63
  theme,
63
64
  size,
64
- inverted,
65
+ inverted: typeof inverted === "boolean" ? inverted ? "true" : void 0 : inverted,
65
66
  fillcolor: fillColor,
66
67
  opacity,
67
68
  title,
@@ -76,4 +77,4 @@ function GoabIcon({
76
77
  }
77
78
  exports.GoabDrawer = GoabDrawer;
78
79
  exports.GoabIcon = GoabIcon;
79
- //# sourceMappingURL=icon-BPmPItnm.js.map
80
+ //# sourceMappingURL=icon-CK55b563.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icon-CK55b563.js","sources":["../../../libs/react-components/src/lib/drawer/drawer.tsx","../../../libs/react-components/src/lib/icon/icon.tsx"],"sourcesContent":["import { ReactNode, useEffect, useRef, type JSX } from \"react\";\nimport { GoabDrawerPosition, GoabDrawerSize } from \"@abgov/ui-components-common\";\n\ninterface WCProps {\n position: GoabDrawerPosition;\n open?: boolean;\n heading?: string;\n maxsize?: GoabDrawerSize;\n testid?: string;\n ref: React.RefObject<HTMLElement | null>;\n}\n\ndeclare module \"react\" {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace JSX {\n interface IntrinsicElements {\n \"goa-drawer\": WCProps & React.HTMLAttributes<HTMLElement>;\n }\n }\n}\n\nexport interface GoabDrawerProps {\n position: GoabDrawerPosition;\n open?: boolean;\n heading?: string | ReactNode;\n maxSize?: GoabDrawerSize;\n testId?: string;\n actions?: ReactNode;\n children: ReactNode;\n onClose: () => void;\n}\n\nexport function GoabDrawer({\n position,\n open,\n heading,\n maxSize,\n testId,\n actions,\n children,\n onClose,\n}: GoabDrawerProps): JSX.Element {\n const el = useRef<HTMLElement>(null);\n\n useEffect(() => {\n if (!el?.current || !onClose) {\n return;\n }\n el.current?.addEventListener(\"_close\", onClose);\n return () => {\n el.current?.removeEventListener(\"_close\", onClose);\n };\n }, [el, onClose]);\n\n return (\n <goa-drawer\n ref={el}\n position={position}\n open={open ? true : undefined}\n heading={typeof heading === \"string\" ? heading : undefined}\n maxsize={maxSize}\n testid={testId}\n >\n {heading && typeof heading !== \"string\" && <div slot=\"heading\">{heading}</div>}\n {actions && <div slot=\"actions\">{actions}</div>}\n {children}\n </goa-drawer>\n );\n}\n\nexport default GoabDrawer;\n","import {\n GoabIconFilledType,\n GoabIconSize,\n GoabIconTheme,\n GoabIconType,\n Margins,\n} from \"@abgov/ui-components-common\";\n\nimport type { JSX } from \"react\";\n\ninterface IonIconProps {\n name: GoabIconType | GoabIconFilledType;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\ninterface IonIconElement extends HTMLElement {}\n\ndeclare module \"react\" {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace JSX {\n interface IntrinsicElements {\n \"ion-icon\": IonIconProps & React.HTMLAttributes<IonIconElement>;\n }\n }\n}\n\ndeclare module \"react\" {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace JSX {\n interface IntrinsicElements {\n \"goa-icon\": WCProps & React.HTMLAttributes<IonIconElement>;\n }\n }\n}\n\nexport interface GoabIconProps extends Margins {\n type: GoabIconType;\n size?: GoabIconSize;\n theme?: GoabIconTheme;\n inverted?: string | boolean; // TODO: Change type to only boolean\n fillColor?: string;\n opacity?: number;\n title?: string;\n ariaLabel?: string;\n testId?: string;\n}\n\ninterface WCProps extends Margins {\n type: GoabIconType;\n theme?: GoabIconTheme;\n size?: GoabIconSize;\n inverted?: string;\n fillcolor?: string;\n opacity?: number;\n title?: string;\n arialabel?: string;\n testid?: string;\n}\n\nexport function GoabIcon({\n type,\n theme,\n size,\n inverted, // TODO: change to boolean only\n fillColor,\n opacity,\n title,\n ariaLabel,\n mt,\n mr,\n mb,\n ml,\n testId,\n}: GoabIconProps): JSX.Element {\n return (\n <goa-icon\n type={type}\n theme={theme}\n size={size}\n inverted={\n typeof inverted === \"boolean\" ? (inverted ? \"true\" : undefined) : inverted\n }\n fillcolor={fillColor}\n opacity={opacity}\n title={title}\n arialabel={ariaLabel}\n mt={mt}\n mr={mr}\n mb={mb}\n ml={ml}\n testid={testId}\n />\n );\n}\n"],"names":["useRef","useEffect","_a","jsxs","jsx"],"mappings":";;;AAgCO,SAAS,WAAW;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAiC;AACzB,QAAA,KAAKA,aAAoB,IAAI;AAEnCC,QAAAA,UAAU,MAAM;;AACd,QAAI,EAAC,yBAAI,YAAW,CAAC,SAAS;AAC5B;AAAA,IACF;AACG,aAAA,YAAA,mBAAS,iBAAiB,UAAU;AACvC,WAAO,MAAM;;AACR,OAAAC,MAAA,GAAA,YAAA,gBAAAA,IAAS,oBAAoB,UAAU;AAAA,IAAO;AAAA,EACnD,GACC,CAAC,IAAI,OAAO,CAAC;AAGd,SAAAC,2BAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAK;AAAA,MACL;AAAA,MACA,MAAM,OAAO,OAAO;AAAA,MACpB,SAAS,OAAO,YAAY,WAAW,UAAU;AAAA,MACjD,SAAS;AAAA,MACT,QAAQ;AAAA,MAEP,UAAA;AAAA,QAAA,WAAW,OAAO,YAAY,2CAAa,OAAI,EAAA,MAAK,WAAW,UAAQ,SAAA;AAAA,QACvE,WAAWC,2BAAA,IAAC,OAAI,EAAA,MAAK,WAAW,UAAQ,SAAA;AAAA,QACxC;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGP;ACTO,SAAS,SAAS;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAA+B;AAE3B,SAAAA,2BAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA,UACE,OAAO,aAAa,YAAa,WAAW,SAAS,SAAa;AAAA,MAEpE,WAAW;AAAA,MACX;AAAA,MACA;AAAA,MACA,WAAW;AAAA,MACX;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,QAAQ;AAAA,IAAA;AAAA,EAAA;AAGd;;;"}
@@ -1,8 +1,8 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { useRef, useEffect } from "react";
3
3
  function GoabDrawer({
4
- open,
5
4
  position,
5
+ open,
6
6
  heading,
7
7
  maxSize,
8
8
  testId,
@@ -26,8 +26,8 @@ function GoabDrawer({
26
26
  "goa-drawer",
27
27
  {
28
28
  ref: el,
29
- open: open ? true : void 0,
30
29
  position,
30
+ open: open ? true : void 0,
31
31
  heading: typeof heading === "string" ? heading : void 0,
32
32
  maxsize: maxSize,
33
33
  testid: testId,
@@ -44,6 +44,7 @@ function GoabIcon({
44
44
  theme,
45
45
  size,
46
46
  inverted,
47
+ // TODO: change to boolean only
47
48
  fillColor,
48
49
  opacity,
49
50
  title,
@@ -60,7 +61,7 @@ function GoabIcon({
60
61
  type,
61
62
  theme,
62
63
  size,
63
- inverted,
64
+ inverted: typeof inverted === "boolean" ? inverted ? "true" : void 0 : inverted,
64
65
  fillcolor: fillColor,
65
66
  opacity,
66
67
  title,
@@ -77,4 +78,4 @@ export {
77
78
  GoabDrawer as G,
78
79
  GoabIcon as a
79
80
  };
80
- //# sourceMappingURL=icon-BNGrU_R_.mjs.map
81
+ //# sourceMappingURL=icon-CoYGOp1V.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icon-CoYGOp1V.mjs","sources":["../../../libs/react-components/src/lib/drawer/drawer.tsx","../../../libs/react-components/src/lib/icon/icon.tsx"],"sourcesContent":["import { ReactNode, useEffect, useRef, type JSX } from \"react\";\nimport { GoabDrawerPosition, GoabDrawerSize } from \"@abgov/ui-components-common\";\n\ninterface WCProps {\n position: GoabDrawerPosition;\n open?: boolean;\n heading?: string;\n maxsize?: GoabDrawerSize;\n testid?: string;\n ref: React.RefObject<HTMLElement | null>;\n}\n\ndeclare module \"react\" {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace JSX {\n interface IntrinsicElements {\n \"goa-drawer\": WCProps & React.HTMLAttributes<HTMLElement>;\n }\n }\n}\n\nexport interface GoabDrawerProps {\n position: GoabDrawerPosition;\n open?: boolean;\n heading?: string | ReactNode;\n maxSize?: GoabDrawerSize;\n testId?: string;\n actions?: ReactNode;\n children: ReactNode;\n onClose: () => void;\n}\n\nexport function GoabDrawer({\n position,\n open,\n heading,\n maxSize,\n testId,\n actions,\n children,\n onClose,\n}: GoabDrawerProps): JSX.Element {\n const el = useRef<HTMLElement>(null);\n\n useEffect(() => {\n if (!el?.current || !onClose) {\n return;\n }\n el.current?.addEventListener(\"_close\", onClose);\n return () => {\n el.current?.removeEventListener(\"_close\", onClose);\n };\n }, [el, onClose]);\n\n return (\n <goa-drawer\n ref={el}\n position={position}\n open={open ? true : undefined}\n heading={typeof heading === \"string\" ? heading : undefined}\n maxsize={maxSize}\n testid={testId}\n >\n {heading && typeof heading !== \"string\" && <div slot=\"heading\">{heading}</div>}\n {actions && <div slot=\"actions\">{actions}</div>}\n {children}\n </goa-drawer>\n );\n}\n\nexport default GoabDrawer;\n","import {\n GoabIconFilledType,\n GoabIconSize,\n GoabIconTheme,\n GoabIconType,\n Margins,\n} from \"@abgov/ui-components-common\";\n\nimport type { JSX } from \"react\";\n\ninterface IonIconProps {\n name: GoabIconType | GoabIconFilledType;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\ninterface IonIconElement extends HTMLElement {}\n\ndeclare module \"react\" {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace JSX {\n interface IntrinsicElements {\n \"ion-icon\": IonIconProps & React.HTMLAttributes<IonIconElement>;\n }\n }\n}\n\ndeclare module \"react\" {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace JSX {\n interface IntrinsicElements {\n \"goa-icon\": WCProps & React.HTMLAttributes<IonIconElement>;\n }\n }\n}\n\nexport interface GoabIconProps extends Margins {\n type: GoabIconType;\n size?: GoabIconSize;\n theme?: GoabIconTheme;\n inverted?: string | boolean; // TODO: Change type to only boolean\n fillColor?: string;\n opacity?: number;\n title?: string;\n ariaLabel?: string;\n testId?: string;\n}\n\ninterface WCProps extends Margins {\n type: GoabIconType;\n theme?: GoabIconTheme;\n size?: GoabIconSize;\n inverted?: string;\n fillcolor?: string;\n opacity?: number;\n title?: string;\n arialabel?: string;\n testid?: string;\n}\n\nexport function GoabIcon({\n type,\n theme,\n size,\n inverted, // TODO: change to boolean only\n fillColor,\n opacity,\n title,\n ariaLabel,\n mt,\n mr,\n mb,\n ml,\n testId,\n}: GoabIconProps): JSX.Element {\n return (\n <goa-icon\n type={type}\n theme={theme}\n size={size}\n inverted={\n typeof inverted === \"boolean\" ? (inverted ? \"true\" : undefined) : inverted\n }\n fillcolor={fillColor}\n opacity={opacity}\n title={title}\n arialabel={ariaLabel}\n mt={mt}\n mr={mr}\n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AAA,MACA;AAAA,MACA,QAAQ;AAAA,IAAA;AAAA,EAAA;AAGd;"}
package/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const react = require("react");
5
- const icon = require("./icon-BPmPItnm.js");
5
+ const icon = require("./icon-CK55b563.js");
6
6
  function GoabAccordion({
7
7
  open,
8
8
  heading,
@@ -37,7 +37,7 @@ function GoabAccordion({
37
37
  "goa-accordion",
38
38
  {
39
39
  ref,
40
- open,
40
+ open: open ? "true" : void 0,
41
41
  headingsize: headingSize,
42
42
  heading,
43
43
  secondarytext: secondaryText,
@@ -90,7 +90,7 @@ function GoabAppHeader({
90
90
  fullmenubreakpoint: fullMenuBreakpoint,
91
91
  maxcontentwidth: maxContentWidth,
92
92
  testid: testId,
93
- hasmenuclickhandler: !!onMenuClick,
93
+ hasmenuclickhandler: onMenuClick ? "true" : "false",
94
94
  children
95
95
  }
96
96
  );
@@ -122,7 +122,7 @@ function GoabBadge({
122
122
  {
123
123
  type,
124
124
  content,
125
- icon: icon2,
125
+ icon: icon2 ? "true" : void 0,
126
126
  testid: testId,
127
127
  arialabel: ariaLabel,
128
128
  mt,
@@ -249,8 +249,8 @@ function GoabBlock(props) {
249
249
  );
250
250
  }
251
251
  function GoabButton({
252
- disabled = false,
253
- type = "primary",
252
+ disabled,
253
+ type,
254
254
  size,
255
255
  variant,
256
256
  leadingIcon,
@@ -288,7 +288,7 @@ function GoabButton({
288
288
  type,
289
289
  size,
290
290
  variant,
291
- disabled: disabled || void 0,
291
+ disabled: disabled ? "true" : void 0,
292
292
  leadingicon: leadingIcon,
293
293
  trailingicon: trailingIcon,
294
294
  width,
@@ -439,11 +439,11 @@ function GoabCheckbox({
439
439
  ref: el,
440
440
  id,
441
441
  name,
442
- error,
443
- checked: checked || false,
444
- disabled,
442
+ error: error ? "true" : void 0,
443
+ checked: checked ? "true" : void 0,
444
+ disabled: disabled ? "true" : void 0,
445
445
  text,
446
- value,
446
+ value: typeof value === "boolean" ? value ? "true" : void 0 : value,
447
447
  arialabel: ariaLabel,
448
448
  description: typeof description === "string" ? description : void 0,
449
449
  maxwidth: maxWidth,
@@ -459,10 +459,10 @@ function GoabCheckbox({
459
459
  );
460
460
  }
461
461
  const GoabChip = ({
462
- leadingIcon = "",
463
- iconTheme = "outline",
464
- deletable = false,
465
- error = false,
462
+ leadingIcon,
463
+ iconTheme,
464
+ deletable,
465
+ error,
466
466
  variant,
467
467
  content,
468
468
  onClick,
@@ -491,8 +491,8 @@ const GoabChip = ({
491
491
  ref: el,
492
492
  leadingicon: leadingIcon,
493
493
  icontheme: iconTheme,
494
- error,
495
- deletable,
494
+ error: error ? "true" : void 0,
495
+ deletable: deletable ? "true" : void 0,
496
496
  content,
497
497
  variant,
498
498
  mt,
@@ -514,7 +514,7 @@ const GoabCircularProgress = ({
514
514
  return /* @__PURE__ */ jsxRuntime.jsx(
515
515
  "goa-circular-progress",
516
516
  {
517
- visible: visible ? "true" : "false",
517
+ visible: visible ? "true" : void 0,
518
518
  message: message2,
519
519
  progress,
520
520
  variant,
@@ -597,8 +597,8 @@ function GoabDatePicker({
597
597
  ref,
598
598
  name,
599
599
  value: (value == null ? void 0 : value.toISOString()) || "",
600
- error,
601
- disabled,
600
+ error: error ? "true" : void 0,
601
+ disabled: disabled ? "true" : void 0,
602
602
  min: min == null ? void 0 : min.toISOString(),
603
603
  max: max == null ? void 0 : max.toISOString(),
604
604
  testid: testId,
@@ -606,7 +606,7 @@ function GoabDatePicker({
606
606
  mr,
607
607
  mb,
608
608
  ml,
609
- relative
609
+ relative: relative ? "true" : void 0
610
610
  }
611
611
  );
612
612
  }
@@ -615,7 +615,7 @@ function GoabDetails(props) {
615
615
  "goa-details",
616
616
  {
617
617
  heading: props.heading,
618
- open: props.open,
618
+ open: props.open ? "true" : void 0,
619
619
  maxwidth: props.maxWidth,
620
620
  testid: props.testId,
621
621
  mt: props.mt,
@@ -671,21 +671,21 @@ function GoabDropdown(props) {
671
671
  value: stringify(props.value),
672
672
  arialabel: props.ariaLabel,
673
673
  arialabelledby: props.ariaLabelledBy,
674
- disabled: props.disabled,
675
- error: props.error,
676
- filterable: props.filterable,
674
+ disabled: props.disabled ? "true" : void 0,
675
+ error: props.error ? "true" : void 0,
676
+ filterable: props.filterable ? "true" : void 0,
677
677
  leadingicon: props.leadingIcon,
678
678
  maxheight: props.maxHeight,
679
679
  mb: props.mb,
680
680
  ml: props.ml,
681
681
  mr: props.mr,
682
682
  mt: props.mt,
683
- multiselect: props.multiselect,
684
- native: props.native,
683
+ multiselect: props.multiselect ? "true" : void 0,
684
+ native: props.native ? "true" : void 0,
685
685
  placeholder: props.placeholder,
686
686
  testid: props.testId,
687
687
  width: props.width,
688
- relative: props.relative,
688
+ relative: props.relative ? "true" : void 0,
689
689
  id: props.id,
690
690
  children: props.children
691
691
  }
@@ -697,7 +697,13 @@ function GoabDropdownOption(props) {
697
697
  }, []);
698
698
  return /* @__PURE__ */ jsxRuntime.jsx(GoabDropdownItem, { ...props });
699
699
  }
700
- function GoabDropdownItem({ value, label, filter, name, mountType = "append" }) {
700
+ function GoabDropdownItem({
701
+ value,
702
+ label,
703
+ filter,
704
+ name,
705
+ mountType = "append"
706
+ }) {
701
707
  return /* @__PURE__ */ jsxRuntime.jsx(
702
708
  "goa-dropdown-item",
703
709
  {
@@ -724,28 +730,28 @@ function GoabFieldset({
724
730
  }) {
725
731
  const ref = react.useRef(null);
726
732
  react.useEffect(() => {
727
- var _a;
733
+ if (!ref.current) return;
734
+ const current = ref.current;
728
735
  const _continue = (e) => {
729
736
  const event = e.detail;
730
737
  return onContinue == null ? void 0 : onContinue(event);
731
738
  };
732
739
  if (onContinue) {
733
- (_a = ref.current) == null ? void 0 : _a.addEventListener("_continue", _continue);
740
+ current.addEventListener("_continue", _continue);
734
741
  }
735
742
  return () => {
736
- var _a2;
737
743
  if (onContinue) {
738
- (_a2 = ref.current) == null ? void 0 : _a2.removeEventListener("_continue", _continue);
744
+ current.removeEventListener("_continue", _continue);
739
745
  }
740
746
  };
741
- }, [ref.current, onContinue]);
747
+ }, [ref, onContinue]);
742
748
  return /* @__PURE__ */ jsxRuntime.jsx(
743
749
  "goa-public-form-page",
744
750
  {
745
751
  ref,
746
752
  id,
747
- first,
748
- last,
753
+ first: first ? "true" : void 0,
754
+ last: last ? "true" : void 0,
749
755
  heading,
750
756
  buttontext: buttonText,
751
757
  mt,
@@ -835,14 +841,7 @@ function GoabAppFooterMetaSection({
835
841
  testId,
836
842
  children
837
843
  }) {
838
- return /* @__PURE__ */ jsxRuntime.jsx(
839
- "goa-app-footer-meta-section",
840
- {
841
- testid: testId,
842
- slot: "meta",
843
- children
844
- }
845
- );
844
+ return /* @__PURE__ */ jsxRuntime.jsx("goa-app-footer-meta-section", { testid: testId, slot: "meta", children });
846
845
  }
847
846
  function GoabAppFooterNavSection({
848
847
  heading,
@@ -1031,7 +1030,7 @@ function GoabIconButton({
1031
1030
  {
1032
1031
  ref,
1033
1032
  icon: icon2,
1034
- disabled,
1033
+ disabled: disabled ? "true" : void 0,
1035
1034
  variant,
1036
1035
  size,
1037
1036
  title,
@@ -2729,7 +2728,7 @@ function GoabInput({
2729
2728
  {
2730
2729
  ref,
2731
2730
  debounce,
2732
- focused,
2731
+ focused: focused ? "true" : void 0,
2733
2732
  type,
2734
2733
  name,
2735
2734
  autocapitalize: autoCapitalize,
@@ -2737,10 +2736,10 @@ function GoabInput({
2737
2736
  leadingicon: leadingIcon,
2738
2737
  trailingicon: trailingIcon,
2739
2738
  variant,
2740
- disabled,
2741
- readonly,
2739
+ disabled: disabled ? "true" : void 0,
2740
+ readonly: readonly ? "true" : void 0,
2742
2741
  placeholder,
2743
- error,
2742
+ error: error ? "true" : void 0,
2744
2743
  testid: testId,
2745
2744
  value,
2746
2745
  width,
@@ -2755,7 +2754,7 @@ function GoabInput({
2755
2754
  mr,
2756
2755
  mb,
2757
2756
  ml,
2758
- handletrailingiconclick: !!onTrailingIconClick,
2757
+ handletrailingiconclick: onTrailingIconClick ? "true" : "false",
2759
2758
  trailingiconarialabel: trailingIconAriaLabel,
2760
2759
  children: [
2761
2760
  leadingContent && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "leadingContent", children: leadingContent }),
@@ -2991,7 +2990,7 @@ function GoabMicrositeHeader({
2991
2990
  maxcontentwidth: maxContentWidth,
2992
2991
  feedbackurltarget: feedbackUrlTarget,
2993
2992
  headerurltarget: headerUrlTarget,
2994
- hasfeedbackhandler: !!onFeedbackClick,
2993
+ hasfeedbackhandler: onFeedbackClick ? "true" : "false",
2995
2994
  children: version && typeof version !== "string" && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "version", children: version })
2996
2995
  }
2997
2996
  );
@@ -3026,8 +3025,8 @@ function GoabModal({
3026
3025
  "goa-modal",
3027
3026
  {
3028
3027
  ref: el,
3029
- open,
3030
- closable: !!onClose,
3028
+ open: open ? "true" : void 0,
3029
+ closable: onClose ? "true" : "false",
3031
3030
  maxwidth: maxWidth,
3032
3031
  transition,
3033
3032
  calloutvariant: calloutVariant,
@@ -3095,7 +3094,7 @@ function GoabPages(props) {
3095
3094
  );
3096
3095
  }
3097
3096
  function GoabPagination({ onChange, ...props }) {
3098
- const ref = react.useRef();
3097
+ const ref = react.useRef(null);
3099
3098
  react.useEffect(() => {
3100
3099
  if (!ref.current) {
3101
3100
  return;
@@ -3146,9 +3145,9 @@ function GoabPopover({
3146
3145
  testid: testId,
3147
3146
  maxwidth: maxWidth,
3148
3147
  minwidth: minWidth,
3149
- padded,
3148
+ padded: typeof padded === "undefined" ? void 0 : padded ? "true" : "false",
3150
3149
  position,
3151
- relative,
3150
+ relative: relative ? "true" : void 0,
3152
3151
  mt,
3153
3152
  mr,
3154
3153
  mb,
@@ -3169,7 +3168,6 @@ function GoabRadioItem({
3169
3168
  disabled,
3170
3169
  checked,
3171
3170
  error,
3172
- testId,
3173
3171
  ariaLabel,
3174
3172
  children,
3175
3173
  mt,
@@ -3185,9 +3183,9 @@ function GoabRadioItem({
3185
3183
  value,
3186
3184
  description: typeof description === "string" ? description : void 0,
3187
3185
  maxwidth: maxWidth,
3188
- error,
3189
- disabled,
3190
- checked,
3186
+ error: error ? "true" : void 0,
3187
+ disabled: disabled ? "true" : void 0,
3188
+ checked: checked ? "true" : void 0,
3191
3189
  arialabel: ariaLabel,
3192
3190
  mt,
3193
3191
  mr,
@@ -3205,8 +3203,8 @@ function GoabRadioGroup({
3205
3203
  value,
3206
3204
  children,
3207
3205
  orientation,
3208
- disabled = false,
3209
- error = false,
3206
+ disabled,
3207
+ error,
3210
3208
  testId,
3211
3209
  ariaLabel,
3212
3210
  mt,
@@ -3240,8 +3238,8 @@ function GoabRadioGroup({
3240
3238
  name,
3241
3239
  value,
3242
3240
  orientation,
3243
- disabled,
3244
- error,
3241
+ disabled: disabled ? "true" : void 0,
3242
+ error: error ? "true" : void 0,
3245
3243
  arialabel: ariaLabel,
3246
3244
  mt,
3247
3245
  mr,
@@ -3324,7 +3322,7 @@ function GoabSpinner({
3324
3322
  type,
3325
3323
  size,
3326
3324
  progress,
3327
- invert,
3325
+ invert: invert ? "true" : void 0,
3328
3326
  testid: testId
3329
3327
  }
3330
3328
  );
@@ -3350,7 +3348,6 @@ function GoabTable({ onSort, ...props }) {
3350
3348
  {
3351
3349
  ref,
3352
3350
  width: props.width,
3353
- stickyheader: false,
3354
3351
  variant: props.variant,
3355
3352
  testid: props.testId,
3356
3353
  mt: props.mt,
@@ -3470,13 +3467,13 @@ function GoabTextArea({
3470
3467
  placeholder,
3471
3468
  value,
3472
3469
  rows,
3473
- readOnly,
3474
- disabled,
3470
+ readOnly: readOnly ? "true" : void 0,
3471
+ disabled: disabled ? "true" : void 0,
3475
3472
  countby: countBy,
3476
3473
  maxcount: maxCount,
3477
3474
  width,
3478
3475
  maxwidth: maxWidth,
3479
- error,
3476
+ error: error ? "true" : void 0,
3480
3477
  testid: testId,
3481
3478
  arialabel: ariaLabel,
3482
3479
  mt,
@@ -3537,7 +3534,7 @@ function GoabTwoColumnLayout(props) {
3537
3534
  }
3538
3535
  const GoabFilterChip = ({
3539
3536
  iconTheme = "outline",
3540
- error = false,
3537
+ error,
3541
3538
  content,
3542
3539
  onClick,
3543
3540
  mt,
@@ -3561,7 +3558,7 @@ const GoabFilterChip = ({
3561
3558
  {
3562
3559
  ref: el,
3563
3560
  icontheme: iconTheme,
3564
- error,
3561
+ error: error ? "true" : void 0,
3565
3562
  content,
3566
3563
  mt,
3567
3564
  mr,