@abgov/react-components 6.5.0-alpha.1 → 6.5.0-alpha.2

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 (82) hide show
  1. package/experimental/form/form.d.ts +1 -2
  2. package/experimental/form/task-list.d.ts +1 -2
  3. package/experimental/form/task.d.ts +1 -2
  4. package/experimental/resizable-panel/ResizablePanel.d.ts +0 -1
  5. package/experimental.js.map +1 -1
  6. package/experimental.mjs.map +1 -1
  7. package/icon-CK55b563.js.map +1 -1
  8. package/icon-CoYGOp1V.mjs.map +1 -1
  9. package/index.js +4 -10
  10. package/index.js.map +1 -1
  11. package/index.mjs +4 -10
  12. package/index.mjs.map +1 -1
  13. package/lib/accordion/accordion.d.ts +1 -2
  14. package/lib/app-header/app-header.d.ts +0 -1
  15. package/lib/app-header-menu/app-header-menu.d.ts +1 -2
  16. package/lib/badge/badge.d.ts +1 -2
  17. package/lib/block/block.d.ts +1 -2
  18. package/lib/button/button.d.ts +1 -2
  19. package/lib/button-group/button-group.d.ts +1 -2
  20. package/lib/calendar/calendar.d.ts +1 -2
  21. package/lib/callout/callout.d.ts +0 -1
  22. package/lib/card/card-actions.d.ts +0 -1
  23. package/lib/card/card-content.d.ts +0 -1
  24. package/lib/card/card-group.d.ts +0 -1
  25. package/lib/card/card-image.d.ts +0 -1
  26. package/lib/card/card.d.ts +1 -2
  27. package/lib/checkbox/checkbox.d.ts +1 -2
  28. package/lib/chip/chip.d.ts +0 -1
  29. package/lib/circular-progress/circular-progress.d.ts +0 -1
  30. package/lib/container/container.d.ts +1 -2
  31. package/lib/date-picker/date-picker.d.ts +1 -2
  32. package/lib/details/details.d.ts +1 -2
  33. package/lib/divider/divider.d.ts +0 -1
  34. package/lib/drawer/drawer.d.ts +1 -2
  35. package/lib/dropdown/dropdown-item.d.ts +0 -1
  36. package/lib/dropdown/dropdown.d.ts +1 -2
  37. package/lib/file-upload-card/file-upload-card.d.ts +0 -1
  38. package/lib/file-upload-input/file-upload-input.d.ts +0 -1
  39. package/lib/filter-chip/filter-chip.d.ts +0 -1
  40. package/lib/footer/footer.d.ts +0 -1
  41. package/lib/footer-meta-section/footer-meta-section.d.ts +0 -1
  42. package/lib/footer-nav-section/footer-nav-section.d.ts +0 -1
  43. package/lib/form/fieldset.d.ts +1 -2
  44. package/lib/form/public-form-page.d.ts +4 -4
  45. package/lib/form/public-form.d.ts +2 -3
  46. package/lib/form-item/form-item.d.ts +1 -2
  47. package/lib/form-step/form-step.d.ts +0 -1
  48. package/lib/form-stepper/form-stepper.d.ts +1 -2
  49. package/lib/grid/grid.d.ts +1 -2
  50. package/lib/hero-banner/hero-banner-actions.d.ts +0 -1
  51. package/lib/hero-banner/hero-banner.d.ts +0 -1
  52. package/lib/icon/icon.d.ts +1 -2
  53. package/lib/icon-button/icon-button.d.ts +1 -2
  54. package/lib/input/input.d.ts +1 -2
  55. package/lib/link/link.d.ts +1 -2
  56. package/lib/link-button/link-button.d.ts +1 -2
  57. package/lib/microsite-header/microsite-header.d.ts +1 -2
  58. package/lib/modal/modal.d.ts +1 -2
  59. package/lib/notification/notification.d.ts +0 -1
  60. package/lib/one-column-layout/one-column-layout.d.ts +0 -1
  61. package/lib/page-block/page-block.d.ts +0 -1
  62. package/lib/pages/pages.d.ts +1 -2
  63. package/lib/pagination/pagination.d.ts +0 -1
  64. package/lib/popover/popover.d.ts +1 -2
  65. package/lib/radio-group/radio-group.d.ts +1 -2
  66. package/lib/radio-group/radio.d.ts +1 -2
  67. package/lib/side-menu/side-menu.d.ts +0 -1
  68. package/lib/side-menu-group/side-menu-group.d.ts +1 -2
  69. package/lib/side-menu-heading/side-menu-heading.d.ts +1 -2
  70. package/lib/skeleton/skeleton.d.ts +0 -1
  71. package/lib/spacer/spacer.d.ts +0 -1
  72. package/lib/spinner/spinner.d.ts +1 -2
  73. package/lib/tab/tab.d.ts +0 -1
  74. package/lib/table/table-sort-header.d.ts +1 -2
  75. package/lib/table/table.d.ts +1 -2
  76. package/lib/tabs/tabs.d.ts +1 -2
  77. package/lib/text/text.d.ts +1 -2
  78. package/lib/textarea/textarea.d.ts +1 -2
  79. package/lib/three-column-layout/three-column-layout.d.ts +0 -1
  80. package/lib/tooltip/tooltip.d.ts +1 -2
  81. package/lib/two-column-layout/two-column-layout.d.ts +0 -1
  82. package/package.json +1 -1
@@ -1,6 +1,5 @@
1
- import { Margins, GoabFormStorageType, GoabFormOnMountDetail, GoabFormOnStateChange } from '@abgov/ui-components-common';
2
1
  import { ReactNode } from 'react';
3
-
2
+ import { Margins, GoabFormStorageType, GoabFormOnMountDetail, GoabFormOnStateChange } from '@abgov/ui-components-common';
4
3
  interface WCProps extends Margins {
5
4
  ref?: React.RefObject<HTMLElement | null>;
6
5
  name: string;
@@ -1,6 +1,5 @@
1
- import { Margins } from '@abgov/ui-components-common';
2
1
  import { ReactNode } from 'react';
3
-
2
+ import { Margins } from '@abgov/ui-components-common';
4
3
  interface WCProps extends Margins {
5
4
  heading: string;
6
5
  }
@@ -1,6 +1,5 @@
1
- import { Margins } from '@abgov/ui-components-common';
2
1
  import { ReactNode } from 'react';
3
-
2
+ import { Margins } from '@abgov/ui-components-common';
4
3
  interface WCProps extends Margins {
5
4
  status: "completed" | "not-started" | "cannot-start";
6
5
  }
@@ -1,5 +1,4 @@
1
1
  import { ReactNode, JSX } from 'react';
2
-
3
2
  export type ResizableProps = {
4
3
  minWidth?: number;
5
4
  children: ReactNode;
@@ -1 +1 @@
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,CAACC,QAAO,QAAQ,IAAIC,MAAiB,SAAA;AAE3CC,QAAAA,UAAU,MAAM;;AACd,aAAS,YAAU,WAAM,YAAN,mBAAe,wBAAwB,UAAS;AAAA,EACrE,GAAG,CAAE,CAAA;AAEL,WAAS,kBAAkB;AACzB,mBAAe,UAAU;AAAA,EAC3B;AAEA,WAAS,YAAY,GAAqB;AACxC,mBAAe,UAAU;AAClB,WAAA,iBAAiB,WAAW,eAAe;AAAA,EACpD;AAEA,WAAS,UAAU,GAAqB;AACtC,mBAAe,UAAU;AAClB,WAAA,oBAAoB,WAAW,eAAe;AAAA,EACvD;AAEA,WAAS,YAAY,GAAqB;;AACpC,QAAA,eAAe,YAAY,UAAU;AACvC;AAAA,IACF;AAEA,UAAM,YAAY,WAAW;AAC7B,UAAM,WAAU,uCAAW,wBAAwB,MAAK;AACxD,UAAM,SAAS,EAAE;AACX,UAAA,WAAW,MAAM,YAAY;AAEnC,QAAI,UAAU,GAAG;AACf;AAAA,IACF;AAGA,UAAM,YAAU,eAAU,YAAV,mBAAmB,wBAAwB,MAAK;AAGhE,UAAM,YAAY,KAAK;AAAA,MACrB,UAAU;AAAA,MACV,KAAK,IAAI,SAAS,SAAS,SAAS,OAAO;AAAA,IAAA;AAE7C,UAAM,eAAe,KAAK,IAAI,UAAU,YAAY,EAAE;AAGtD,QAAI,gBAAgB,UAAU;AAC5B;AAAA,IACF;AAGA,2CAAW,aAAa,SAAS,UAAU,SAAS;AAEpD,mBAAS,YAAT,mBAAkB;AAAA,MAChB;AAAA,MACA,UAAU,SAAS,UAAU,YAAY,EAAE;AAAA;AAE7C,aAAS,GAAG,KAAK,MAAM,YAAY,CAAC,IAAI;AAAA,EAC1C;AAGE,SAAAC,2BAAA;AAAA,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,eA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K,MAAM,YAAY,CAAC,IAAI;AAAA,EAAA;AAIxC,SAAAC,2BAAA;AAAA,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,2BAAAA,IAAC,OAAI,EAAA,KAAK,WAAW,WAAW,IAAI,QAClC,UAACA,2BAAA,IAAAC,KAAA,UAAA,EAAS,MAAK,cAAc,CAAA,EAC/B,CAAA;AAAA,QAAA,GACF;AAAA,uCACC,OAAI,EAAA,KAAK,UAAU,WAAW,IAAI,OAChC,UACHL,OAAA,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EACF;AAEJ;;;"}
@@ -1 +1 @@
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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AAA,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,UAAS;AAAA,EACrE,GAAG,EAAE;AAEL,WAAS,kBAAkB;AACzB,mBAAe,UAAU;AAAA,EAAA;AAG3B,WAAS,YAAY,GAAqB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C,OAAI,EAAA,KAAK,UAAU,WAAW,IAAI,OAChC,UACHA,OAAA,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EACF;AAEJ;"}
@@ -1 +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
+ {"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,IAAA;AAEC,aAAA,YAAA,mBAAS,iBAAiB,UAAU;AACvC,WAAO,MAAM;;AACR,OAAAC,MAAA,GAAA,YAAA,gBAAAA,IAAS,oBAAoB,UAAU;AAAA,IAC5C;AAAA,EAAA,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,EACH;AAEJ;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,EACV;AAEJ;;;"}
@@ -1 +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 mb={mb}\n ml={ml}\n testid={testId}\n />\n );\n}\n"],"names":["_a"],"mappings":";;AAgCO,SAAS,WAAW;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAiC;AACzB,QAAA,KAAK,OAAoB,IAAI;AAEnC,YAAU,MAAM;;AACd,QAAI,EAAC,yBAAI,YAAW,CAAC,SAAS;AAC5B;AAAA,IACF;AACG,aAAA,YAAA,mBAAS,iBAAiB,UAAU;AACvC,WAAO,MAAM;;AACR,OAAAA,MAAA,GAAA,YAAA,gBAAAA,IAAS,oBAAoB,UAAU;AAAA,IAAO;AAAA,EACnD,GACC,CAAC,IAAI,OAAO,CAAC;AAGd,SAAA;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,gCAAa,OAAI,EAAA,MAAK,WAAW,UAAQ,SAAA;AAAA,QACvE,WAAW,oBAAC,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,SAAA;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
+ {"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 mb={mb}\n ml={ml}\n testid={testId}\n />\n );\n}\n"],"names":["_a"],"mappings":";;AAgCO,SAAS,WAAW;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAiC;AACzB,QAAA,KAAK,OAAoB,IAAI;AAEnC,YAAU,MAAM;;AACd,QAAI,EAAC,yBAAI,YAAW,CAAC,SAAS;AAC5B;AAAA,IAAA;AAEC,aAAA,YAAA,mBAAS,iBAAiB,UAAU;AACvC,WAAO,MAAM;;AACR,OAAAA,MAAA,GAAA,YAAA,gBAAAA,IAAS,oBAAoB,UAAU;AAAA,IAC5C;AAAA,EAAA,GACC,CAAC,IAAI,OAAO,CAAC;AAGd,SAAA;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,gCAAa,OAAI,EAAA,MAAK,WAAW,UAAQ,SAAA;AAAA,QACvE,WAAW,oBAAC,OAAI,EAAA,MAAK,WAAW,UAAQ,SAAA;AAAA,QACxC;AAAA,MAAA;AAAA,IAAA;AAAA,EACH;AAEJ;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,SAAA;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,EACV;AAEJ;"}
package/index.js CHANGED
@@ -892,11 +892,10 @@ function GoabPublicFormPage({
892
892
  if (!ref.current) return;
893
893
  const current = ref.current;
894
894
  const continueListener = (e) => {
895
- const detail = e.detail;
896
- onContinue == null ? void 0 : onContinue(detail);
895
+ onContinue == null ? void 0 : onContinue(e);
897
896
  };
898
- const backListener = () => {
899
- onBack == null ? void 0 : onBack();
897
+ const backListener = (e) => {
898
+ onBack == null ? void 0 : onBack(e);
900
899
  };
901
900
  const fieldsetChangeListener = (e) => {
902
901
  const detail = e.detail;
@@ -982,10 +981,7 @@ function GoabPublicForm({
982
981
  if (!ref.current) return;
983
982
  const current = ref.current;
984
983
  const initListener = (e) => {
985
- const detail = e.detail;
986
- if (detail == null ? void 0 : detail.el) {
987
- onInit == null ? void 0 : onInit(detail);
988
- }
984
+ onInit == null ? void 0 : onInit(e);
989
985
  };
990
986
  if (onInit && !initialized.current) {
991
987
  current.addEventListener("_init", initListener);
@@ -1932,8 +1928,6 @@ const lightFormatters = {
1932
1928
  }
1933
1929
  };
1934
1930
  const dayPeriodEnum = {
1935
- am: "am",
1936
- pm: "pm",
1937
1931
  midnight: "midnight",
1938
1932
  noon: "noon",
1939
1933
  morning: "morning",