@helsenorge/designsystem-react 1.5.1 → 1.7.0

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 (274) hide show
  1. package/{AlertSignFill-32815dfb.js → AlertSignFill-cf9edefa.js} +2 -2
  2. package/AlertSignFill-cf9edefa.js.map +1 -0
  3. package/{AlertSignStroke-06b89e43.js → AlertSignStroke-95b64a4c.js} +2 -2
  4. package/AlertSignStroke-95b64a4c.js.map +1 -0
  5. package/{AnchorLink-b55324d8.js → AnchorLink-fd609d98.js} +2 -2
  6. package/AnchorLink-fd609d98.js.map +1 -0
  7. package/{ArrowDown-e4000940.js → ArrowDown-168cb53d.js} +2 -2
  8. package/ArrowDown-168cb53d.js.map +1 -0
  9. package/{ArrowRight-f1bcf554.js → ArrowRight-0504624c.js} +2 -2
  10. package/ArrowRight-0504624c.js.map +1 -0
  11. package/{ArrowUp-2fd4d8a8.js → ArrowUp-df3a43f8.js} +2 -2
  12. package/ArrowUp-df3a43f8.js.map +1 -0
  13. package/{ArrowUpRight-ea4dab8b.js → ArrowUpRight-516d81f4.js} +2 -2
  14. package/ArrowUpRight-516d81f4.js.map +1 -0
  15. package/{Button-15cf6cc9.js → Button-61d349a0.js} +2 -2
  16. package/Button-61d349a0.js.map +1 -0
  17. package/{Calendar-6ccf9f02.js → Calendar-64c156c4.js} +2 -2
  18. package/Calendar-64c156c4.js.map +1 -0
  19. package/{Check-4ff5dbe8.js → Check-3e3f92b1.js} +2 -2
  20. package/Check-3e3f92b1.js.map +1 -0
  21. package/{Checkbox-2d678536.js → Checkbox-2ed9547d.js} +2 -2
  22. package/Checkbox-2ed9547d.js.map +1 -0
  23. package/{ChevronDown-e437ddc7.js → ChevronDown-3d01aa5d.js} +2 -2
  24. package/ChevronDown-3d01aa5d.js.map +1 -0
  25. package/{ChevronRight-cd70885b.js → ChevronRight-61f74a50.js} +2 -2
  26. package/ChevronRight-61f74a50.js.map +1 -0
  27. package/{ChevronUp-e7ceb743.js → ChevronUp-1ed3fb8f.js} +2 -2
  28. package/ChevronUp-1ed3fb8f.js.map +1 -0
  29. package/Close-e6e01a80.js +2 -0
  30. package/Close-e6e01a80.js.map +1 -0
  31. package/FormGroup-5f9a5195.js +2 -0
  32. package/FormGroup-5f9a5195.js.map +1 -0
  33. package/{Group-e9b91287.js → Group-e05c4cc2.js} +2 -2
  34. package/Group-e05c4cc2.js.map +1 -0
  35. package/{HelpBubble-9c8f6161.js → HelpBubble-e987089a.js} +2 -2
  36. package/HelpBubble-e987089a.js.map +1 -0
  37. package/{Hospital-96388194.js → Hospital-464037d0.js} +2 -2
  38. package/Hospital-464037d0.js.map +1 -0
  39. package/{Icon-2146c8a0.js → Icon-b0039bef.js} +2 -2
  40. package/Icon-b0039bef.js.map +1 -0
  41. package/{InfoSignStroke-a21c471c.js → InfoSignStroke-350e7d59.js} +2 -2
  42. package/InfoSignStroke-350e7d59.js.map +1 -0
  43. package/{Input-c9637ae4.js → Input-ce2b32bf.js} +2 -2
  44. package/Input-ce2b32bf.js.map +1 -0
  45. package/{Modal-0e776e4c.js → Modal-9de3ca1c.js} +2 -2
  46. package/Modal-9de3ca1c.js.map +1 -0
  47. package/{NoAccess-3808472f.js → NoAccess-73de80ea.js} +2 -2
  48. package/NoAccess-73de80ea.js.map +1 -0
  49. package/{Panel-b7aeac58.js → Panel-a2897f00.js} +2 -2
  50. package/Panel-a2897f00.js.map +1 -0
  51. package/{Pencil-05761ee3.js → Pencil-d177a46c.js} +2 -2
  52. package/Pencil-d177a46c.js.map +1 -0
  53. package/{PlusSmall-cc27eeac.js → PlusSmall-bd2ab6fe.js} +2 -2
  54. package/PlusSmall-bd2ab6fe.js.map +1 -0
  55. package/TableExpandedRow-3d9f2b42.js +2 -0
  56. package/TableExpandedRow-3d9f2b42.js.map +1 -0
  57. package/TableExpanderCell-81812919.js +2 -0
  58. package/TableExpanderCell-81812919.js.map +1 -0
  59. package/TableHeadCell-e2216d20.js +2 -0
  60. package/TableHeadCell-e2216d20.js.map +1 -0
  61. package/TableRow-f648816e.js +2 -0
  62. package/TableRow-f648816e.js.map +1 -0
  63. package/Textarea-eac02cd5.js +2 -0
  64. package/Textarea-eac02cd5.js.map +1 -0
  65. package/{Tooltip-7baa1692.js → Tooltip-389fb355.js} +2 -2
  66. package/Tooltip-389fb355.js.map +1 -0
  67. package/{Undo-f1200d5b.js → Undo-b0a5cf5c.js} +2 -2
  68. package/Undo-b0a5cf5c.js.map +1 -0
  69. package/{Validation-842a5d4e.js → Validation-e96418a9.js} +2 -2
  70. package/Validation-e96418a9.js.map +1 -0
  71. package/{Watch-83bd08c2.js → Watch-bb5c0df7.js} +2 -2
  72. package/Watch-bb5c0df7.js.map +1 -0
  73. package/{X-a44ae29d.js → X-3ef80a67.js} +2 -2
  74. package/X-3ef80a67.js.map +1 -0
  75. package/__mocks__/IntersectionObserver.d.ts +1 -0
  76. package/__mocks__/IntersectionObserver.d.ts.map +1 -1
  77. package/__mocks__/IntersectionObserver.js +1 -1
  78. package/__mocks__/ResizeObserver.d.ts +1 -0
  79. package/__mocks__/ResizeObserver.d.ts.map +1 -1
  80. package/__mocks__/ResizeObserver.js +1 -1
  81. package/components/AnchorLink/index.js +1 -1
  82. package/components/Avatar/index.js +1 -1
  83. package/components/Button/index.js +1 -1
  84. package/components/ButtonWithModal/index.js +1 -1
  85. package/components/Checkbox/index.js +1 -1
  86. package/components/Close/index.js +1 -1
  87. package/components/Dropdown/index.js +1 -1
  88. package/components/Expander/index.js +1 -1
  89. package/components/ExpanderList/ExpanderList.d.ts +3 -1
  90. package/components/ExpanderList/ExpanderList.d.ts.map +1 -1
  91. package/components/ExpanderList/componentdata.json +19 -0
  92. package/components/ExpanderList/index.js +1 -1
  93. package/components/ExpanderList/styles.module.scss +10 -0
  94. package/components/ExpanderList/styles.module.scss.d.ts +2 -0
  95. package/components/FormExample/index.js +1 -1
  96. package/components/FormGroup/FormGroup.d.ts.map +1 -1
  97. package/components/FormGroup/index.js +1 -1
  98. package/components/HelpBubble/index.js +1 -1
  99. package/components/HelpBubbleExample/index.js +1 -1
  100. package/components/HighlightBox/index.js +1 -1
  101. package/components/Icons/AcupunctureBack.js +1 -1
  102. package/components/Icons/AlarmClock.js +1 -1
  103. package/components/Icons/AlertSignFill.js +1 -1
  104. package/components/Icons/AlertSignStroke.js +1 -1
  105. package/components/Icons/Archive.js +1 -1
  106. package/components/Icons/ArrowDown.js +1 -1
  107. package/components/Icons/ArrowLeft.js +1 -1
  108. package/components/Icons/ArrowRight.js +1 -1
  109. package/components/Icons/ArrowUp.js +1 -1
  110. package/components/Icons/ArrowUpRight.js +1 -1
  111. package/components/Icons/Attachment.js +1 -1
  112. package/components/Icons/Avatar.js +1 -1
  113. package/components/Icons/Bus.js +1 -1
  114. package/components/Icons/Calendar.js +1 -1
  115. package/components/Icons/CalendarChange.js +1 -1
  116. package/components/Icons/CalendarCheck.js +1 -1
  117. package/components/Icons/CalendarSave.js +1 -1
  118. package/components/Icons/Change.js +1 -1
  119. package/components/Icons/Check.js +1 -1
  120. package/components/Icons/CheckFill.js +1 -1
  121. package/components/Icons/ChevronDown.js +1 -1
  122. package/components/Icons/ChevronLeft.js +1 -1
  123. package/components/Icons/ChevronRight.js +1 -1
  124. package/components/Icons/ChevronUp.js +1 -1
  125. package/components/Icons/ChevronsDown.js +1 -1
  126. package/components/Icons/ChevronsUp.js +1 -1
  127. package/components/Icons/Contacts.js +1 -1
  128. package/components/Icons/Copy.js +1 -1
  129. package/components/Icons/Download.js +1 -1
  130. package/components/Icons/EChat.js +1 -1
  131. package/components/Icons/EnterFullScreen.js +1 -1
  132. package/components/Icons/Envelope.js +1 -1
  133. package/components/Icons/Eraser.js +1 -1
  134. package/components/Icons/ErrorSignFill.js +1 -1
  135. package/components/Icons/ErrorSignStroke.js +1 -1
  136. package/components/Icons/ExitFullScreen.js +1 -1
  137. package/components/Icons/Eye.js +1 -1
  138. package/components/Icons/Form.js +1 -1
  139. package/components/Icons/Forward.js +1 -1
  140. package/components/Icons/Gallery.js +1 -1
  141. package/components/Icons/Globe.js +1 -1
  142. package/components/Icons/Group.js +1 -1
  143. package/components/Icons/Heart.js +1 -1
  144. package/components/Icons/HelpSign.js +1 -1
  145. package/components/Icons/History.js +1 -1
  146. package/components/Icons/Home.js +1 -1
  147. package/components/Icons/Hospital.js +1 -1
  148. package/components/Icons/Hourglass.js +1 -1
  149. package/components/Icons/Icon.js +1 -1
  150. package/components/Icons/InfoSignFill.js +1 -1
  151. package/components/Icons/InfoSignStroke.js +1 -1
  152. package/components/Icons/Journal.js +1 -1
  153. package/components/Icons/List.js +1 -1
  154. package/components/Icons/Location.js +1 -1
  155. package/components/Icons/Lock.js +1 -1
  156. package/components/Icons/Medicine.js +1 -1
  157. package/components/Icons/Menu.js +1 -1
  158. package/components/Icons/Minus.js +1 -1
  159. package/components/Icons/MobilePhone.js +1 -1
  160. package/components/Icons/NoAccess.js +1 -1
  161. package/components/Icons/NoEye.js +1 -1
  162. package/components/Icons/NoFilter.js +1 -1
  163. package/components/Icons/PaperPlane.js +1 -1
  164. package/components/Icons/Pause.js +1 -1
  165. package/components/Icons/Pencil.js +1 -1
  166. package/components/Icons/Play.js +1 -1
  167. package/components/Icons/PlusLarge.js +1 -1
  168. package/components/Icons/PlusSmall.js +1 -1
  169. package/components/Icons/Printer.js +1 -1
  170. package/components/Icons/QrCode.js +1 -1
  171. package/components/Icons/Receptionist.js +1 -1
  172. package/components/Icons/Referral.js +1 -1
  173. package/components/Icons/Refresh.js +1 -1
  174. package/components/Icons/Reply.js +1 -1
  175. package/components/Icons/Save.js +1 -1
  176. package/components/Icons/Search.js +1 -1
  177. package/components/Icons/SectionSign.js +1 -1
  178. package/components/Icons/Settings.js +1 -1
  179. package/components/Icons/Share.js +1 -1
  180. package/components/Icons/SpeechBubble.js +1 -1
  181. package/components/Icons/Stopwatch.js +1 -1
  182. package/components/Icons/SupportingPerson.js +1 -1
  183. package/components/Icons/Syringe.js +1 -1
  184. package/components/Icons/TimePassing.js +1 -1
  185. package/components/Icons/Toolbox.js +1 -1
  186. package/components/Icons/TrashCan.js +1 -1
  187. package/components/Icons/Undo.js +1 -1
  188. package/components/Icons/Upload.js +1 -1
  189. package/components/Icons/Vaccine.js +1 -1
  190. package/components/Icons/VerticalDots.js +1 -1
  191. package/components/Icons/VideoCamera.js +1 -1
  192. package/components/Icons/VideoChat.js +1 -1
  193. package/components/Icons/Wallet.js +1 -1
  194. package/components/Icons/Watch.js +1 -1
  195. package/components/Icons/X.js +1 -1
  196. package/components/Icons/Zoom.js +1 -1
  197. package/components/Icons/index.js +1 -1
  198. package/components/Input/index.js +1 -1
  199. package/components/Input/styles.module.scss +0 -1
  200. package/components/LinkList/index.js +1 -1
  201. package/components/Modal/index.js +1 -1
  202. package/components/NotificationPanel/NotificationPanel.d.ts +2 -0
  203. package/components/NotificationPanel/NotificationPanel.d.ts.map +1 -1
  204. package/components/NotificationPanel/componentdata.json +19 -0
  205. package/components/NotificationPanel/index.js +1 -1
  206. package/components/Panel/index.js +1 -1
  207. package/components/PanelList/index.js +1 -1
  208. package/components/StatusDot/index.js +1 -1
  209. package/components/Table/TableExpandedRow.js +1 -1
  210. package/components/Table/TableExpanderCell.js +1 -1
  211. package/components/Table/TableHeadCell.js +1 -1
  212. package/components/Table/TableRow.js +1 -1
  213. package/components/Table/index.js +1 -1
  214. package/components/Tag/index.js +1 -1
  215. package/components/Textarea/Textarea.d.ts.map +1 -1
  216. package/components/Textarea/index.js +1 -1
  217. package/components/Tile/index.js +1 -1
  218. package/components/Tooltip/index.js +1 -1
  219. package/components/TooltipExample/index.js +1 -1
  220. package/components/Validation/index.js +1 -1
  221. package/hooks/useUuid.d.ts +2 -2
  222. package/hooks/useUuid.d.ts.map +1 -1
  223. package/index.js +1 -1
  224. package/package.json +1 -1
  225. package/scss/_input.scss +1 -0
  226. package/{useUuid-3b1e73f2.js → useUuid-187c55e5.js} +2 -2
  227. package/useUuid-187c55e5.js.map +1 -0
  228. package/utils/refs.d.ts +15 -0
  229. package/utils/refs.d.ts.map +1 -0
  230. package/AlertSignFill-32815dfb.js.map +0 -1
  231. package/AlertSignStroke-06b89e43.js.map +0 -1
  232. package/AnchorLink-b55324d8.js.map +0 -1
  233. package/ArrowDown-e4000940.js.map +0 -1
  234. package/ArrowRight-f1bcf554.js.map +0 -1
  235. package/ArrowUp-2fd4d8a8.js.map +0 -1
  236. package/ArrowUpRight-ea4dab8b.js.map +0 -1
  237. package/Button-15cf6cc9.js.map +0 -1
  238. package/Calendar-6ccf9f02.js.map +0 -1
  239. package/Check-4ff5dbe8.js.map +0 -1
  240. package/Checkbox-2d678536.js.map +0 -1
  241. package/ChevronDown-e437ddc7.js.map +0 -1
  242. package/ChevronRight-cd70885b.js.map +0 -1
  243. package/ChevronUp-e7ceb743.js.map +0 -1
  244. package/Close-53f0e814.js +0 -2
  245. package/Close-53f0e814.js.map +0 -1
  246. package/FormGroup-2d1fe7a1.js +0 -2
  247. package/FormGroup-2d1fe7a1.js.map +0 -1
  248. package/Group-e9b91287.js.map +0 -1
  249. package/HelpBubble-9c8f6161.js.map +0 -1
  250. package/Hospital-96388194.js.map +0 -1
  251. package/Icon-2146c8a0.js.map +0 -1
  252. package/InfoSignStroke-a21c471c.js.map +0 -1
  253. package/Input-c9637ae4.js.map +0 -1
  254. package/Modal-0e776e4c.js.map +0 -1
  255. package/NoAccess-3808472f.js.map +0 -1
  256. package/Panel-b7aeac58.js.map +0 -1
  257. package/Pencil-05761ee3.js.map +0 -1
  258. package/PlusSmall-cc27eeac.js.map +0 -1
  259. package/TableExpandedRow-00d5b26d.js +0 -2
  260. package/TableExpandedRow-00d5b26d.js.map +0 -1
  261. package/TableExpanderCell-1b3f70b9.js +0 -2
  262. package/TableExpanderCell-1b3f70b9.js.map +0 -1
  263. package/TableHeadCell-1b56a690.js +0 -2
  264. package/TableHeadCell-1b56a690.js.map +0 -1
  265. package/TableRow-04925958.js +0 -2
  266. package/TableRow-04925958.js.map +0 -1
  267. package/Textarea-2dae99aa.js +0 -2
  268. package/Textarea-2dae99aa.js.map +0 -1
  269. package/Tooltip-7baa1692.js.map +0 -1
  270. package/Undo-f1200d5b.js.map +0 -1
  271. package/Validation-842a5d4e.js.map +0 -1
  272. package/Watch-83bd08c2.js.map +0 -1
  273. package/X-a44ae29d.js.map +0 -1
  274. package/useUuid-3b1e73f2.js.map +0 -1
@@ -0,0 +1,2 @@
1
+ import{d as e}from"./_rollupPluginBabelHelpers-0f007973.js";import a from"react";import{c as l}from"./index-d1c0552c.js";import o from"./components/Table/styles.module.scss";import{B as t}from"./Button-61d349a0.js";import{I as r}from"./Icon-b0039bef.js";import"./constants-cd62f8dd.js";import{C as n}from"./ChevronUp-1ed3fb8f.js";import{C as s}from"./ChevronDown-3d01aa5d.js";var d=function(d){var m,i=d.rowKey,c=d.hideDetailsText,p=d.showDetailsText,b=d.expandable,f=d.expanded,x=d.onClick,_=d.className,u=d.children,j=l(o["table-row"],(e(m={},o["table__row--expandable"],b),e(m,o["table__row--expanded"],f),m),_),v=null;if(b){var C=l(o.table__cell,o["table__expander-cell-mobile"],e({},o["table__expander-cell-mobile--expanded"],f)),w=l(o["table__expander-button-mobile"],e({},o["table__expander-button-mobile--expanded"],f));v=a.createElement("td",{key:"expandableMobile",className:C},a.createElement(t,{"aria-expanded":f,variant:"borderless",className:w,onClick:function(){x&&x()}},a.createElement(r,{svgIcon:f?n:s})," ",f?c:p))}return a.createElement("tr",{className:j,onClick:x,key:i},u,v)};export{d as T};
2
+ //# sourceMappingURL=TableRow-f648816e.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableRow-f648816e.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import{_ as e,d as a}from"./_rollupPluginBabelHelpers-0f007973.js";import{_ as t}from"./_tslib-b219470a.js";import r,{useState as n,useRef as l,useEffect as o}from"react";import{c as i}from"./index-d1c0552c.js";import c from"./components/Textarea/styles.module.scss";import{F as d,A as s}from"./constants-cd62f8dd.js";import{u as m}from"./uuid-11037462.js";import{A as p}from"./Input-ce2b32bf.js";var u=r.forwardRef((function(u,v){var x,f,w,b=u.maxCharacters,h=u.maxText,_=u.width,g=u.testId,E=u.defaultValue,T=u.marginBottom,j=u.transparent,C=u.mode,y=u.label,N=u.textareaId,I=void 0===N?m():N,R=u.minRows,k=void 0===R?3:R,B=u.maxRows,L=void 0===B?10:B,H=u.grow,V=u.errorText,A=u.afterLabelChildren,F=u.belowLabelChildren,W=t(u,["maxCharacters","maxText","width","testId","defaultValue","marginBottom","transparent","mode","label","textareaId","minRows","maxRows","grow","errorText","afterLabelChildren","belowLabelChildren"]),M=n(k),O=e(M,2),P=O[0],q=O[1],z=n(E||""),D=e(z,2),G=D[0],J=D[1],K=l(null),Q=function(e){var a=e.rows;e.rows=k;var t=Math.floor((e.scrollHeight-16)/28);t===a&&(e.rows=t),t>=L&&(e.rows=L,e.scrollTop=e.scrollHeight),q(t<L?t:L)},S=C===d.ondark,U=C===d.onblueberry,X=b&&G.length>b,Y=C===d.oninvalid||V||X,Z=i(c.textarea,(a(x={},c["textarea--gutterBottom"],T),a(x,c["textarea--invalid"],V),x)),$=i(c["textarea__label-wrapper"],a({},c["textarea__label-wrapper--on-dark"],S)),ee=i(c["content-wrapper"],(a(f={},c["content-wrapper--transparent"],j),a(f,c["content-wrapper--on-blueberry"],U),a(f,c["content-wrapper--on-dark"],S),a(f,c["content-wrapper--invalid"],Y),a(f,c["content-wrapper--disabled"],u.disabled),f)),ae=i(c["content-wrapper__input"],a({},c["content-wrapper__input--disabled"],u.disabled)),te=i(c["textarea__counter-wrapper"],(a(w={},c["textarea__counter-wrapper--on-dark"],S),a(w,c["textarea__counter-wrapper--invalid"],Y),w));o((function(){var e,a,t;if(H&&(null===(e=K.current)||void 0===e?void 0:e.children)&&(null===(a=K.current)||void 0===a?void 0:a.children[0])){var r=null===(t=K.current)||void 0===t?void 0:t.children[0];Q(r)}}),[]);var re=0;b&&(re=G.length/b);var ne=re>.95?"polite":"off",le=_?"calc(".concat(_*p,"px + ").concat("2rem"," + ").concat("16px"," + ").concat("4px",")"):void 0;return r.createElement("div",{"data-testid":g,"data-analyticsid":s.Textarea,className:Z},y&&r.createElement("div",{className:$},r.createElement("label",{htmlFor:I},y),A&&r.createElement("div",{className:c["textarea__after-label-children"]},A)),F&&r.createElement("div",null,F),r.createElement("div",{className:ee,ref:K,style:{maxWidth:le}},r.createElement("textarea",Object.assign({rows:P,defaultValue:E,id:I,className:ae,ref:v,onChange:function(e){H&&Q(e.target),J(e.target.value)},"aria-invalid":!!Y},W))),b&&r.createElement("div",{"aria-live":ne,"aria-atomic":"true",className:te,style:{maxWidth:le}},r.createElement("p",null,"".concat(G.length,"/").concat(b," ").concat(h||"tegn"))))}));export{u as T};
2
+ //# sourceMappingURL=Textarea-eac02cd5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Textarea-eac02cd5.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- import{_ as e}from"./_rollupPluginBabelHelpers-0f007973.js";import n,{useRef as t,useContext as r,useState as o,useEffect as u}from"react";import{A as c}from"./constants-cd62f8dd.js";import{u as i}from"./useUuid-3b1e73f2.js";import{H as a}from"./HelpBubble-9c8f6161.js";import s from"./components/Tooltip/styles.module.scss";var l=function(r){var l=r.children,f=r.description,m=r.testId,b="help-bubble-".concat(i()),v=t(null),E=t(!0),y=d(),B=p(),T=o(!1),h=e(T,2),w=h[0],j=h[1],x=o(!1),C=e(x,2),k=C[0],H=C[1],I=o(null),L=e(I,2),P=L[0],g=L[1];u((function(){E.current||B(),E.current&&(E.current=!1)}),[w]);var F=function(){k||j(!1)},M=function(){y||g(window.setTimeout((function(){H(!0)}),200))},_=function(){H(!1),P&&clearTimeout(P)};u((function(){return document.addEventListener("mouseup",F),function(){document.removeEventListener("mouseup",F),P&&clearTimeout(P)}}),[]);return n.createElement(n.Fragment,null,n.createElement("span",{className:s.word,ref:v,tabIndex:0,onClick:function(){return j(!w),void H(!1)},onMouseEnter:function(){return M()},onMouseLeave:function(){return _()},onFocus:function(){return M()},onBlur:function(){return _()},onKeyDown:function(e){"Enter"===e.key&&(j(!k&&!w),H(!1)),"Escape"===e.key&&(j(!1),H(!1))},"aria-describedby":b,"data-testid":m,"data-analyticsid":c.Tooltip},l),n.createElement(a,{helpBubbleId:b,controllerRef:v,showBubble:w||k,noCloseButton:!0},f))},f=n.createContext(!1),m=n.createContext((function(){})),d=function(){return r(f)},p=function(){return r(m)},b=function(t){var r=t.children,u=o(!1),c=e(u,2),i=c[0],a=c[1];return n.createElement(f.Provider,{value:i},n.createElement(m.Provider,{value:function(){a((function(e){return!e}))}},r))};export{l as T,p as a,b,d as u};
2
- //# sourceMappingURL=Tooltip-7baa1692.js.map
1
+ import{_ as e}from"./_rollupPluginBabelHelpers-0f007973.js";import n,{useRef as t,useContext as r,useState as o,useEffect as u}from"react";import{A as c}from"./constants-cd62f8dd.js";import{u as i}from"./useUuid-187c55e5.js";import{H as a}from"./HelpBubble-e987089a.js";import s from"./components/Tooltip/styles.module.scss";var l=function(r){var l=r.children,f=r.description,m=r.testId,b="help-bubble-".concat(i()),v=t(null),E=t(!0),y=d(),B=p(),T=o(!1),h=e(T,2),w=h[0],j=h[1],x=o(!1),C=e(x,2),k=C[0],H=C[1],I=o(null),L=e(I,2),P=L[0],g=L[1];u((function(){E.current||B(),E.current&&(E.current=!1)}),[w]);var F=function(){k||j(!1)},M=function(){y||g(window.setTimeout((function(){H(!0)}),200))},_=function(){H(!1),P&&clearTimeout(P)};u((function(){return document.addEventListener("mouseup",F),function(){document.removeEventListener("mouseup",F),P&&clearTimeout(P)}}),[]);return n.createElement(n.Fragment,null,n.createElement("span",{className:s.word,ref:v,tabIndex:0,onClick:function(){return j(!w),void H(!1)},onMouseEnter:function(){return M()},onMouseLeave:function(){return _()},onFocus:function(){return M()},onBlur:function(){return _()},onKeyDown:function(e){"Enter"===e.key&&(j(!k&&!w),H(!1)),"Escape"===e.key&&(j(!1),H(!1))},"aria-describedby":b,"data-testid":m,"data-analyticsid":c.Tooltip},l),n.createElement(a,{helpBubbleId:b,controllerRef:v,showBubble:w||k,noCloseButton:!0},f))},f=n.createContext(!1),m=n.createContext((function(){})),d=function(){return r(f)},p=function(){return r(m)},b=function(t){var r=t.children,u=o(!1),c=e(u,2),i=c[0],a=c[1];return n.createElement(f.Provider,{value:i},n.createElement(m.Provider,{value:function(){a((function(e){return!e}))}},r))};export{l as T,p as a,b,d as u};
2
+ //# sourceMappingURL=Tooltip-389fb355.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tooltip-389fb355.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- import e from"react";import{g as l}from"./Icon-2146c8a0.js";var c=function(c){var a=c.size,t=c.isHovered;return l(a,t,e.createElement("path",{fillRule:"evenodd",d:"M37.976 24.195c0 7.782-6.331 14.112-14.113 14.112-6.675 0-12.49-4.74-13.825-11.27l1.273-.26c1.213 5.928 6.492 10.23 12.552 10.23 7.065 0 12.813-5.747 12.813-12.812 0-7.065-5.748-12.813-12.813-12.813-3.885 0-7.554 1.796-9.977 4.812h4.92v1.299H11.97l-.337-7.12 1.299-.061.223 4.72c2.669-3.11 6.578-4.95 10.707-4.95 7.782 0 14.113 6.33 14.113 14.113"}),e.createElement("path",{fillRule:"evenodd",d:"M34.02 34.213a14.132 14.132 0 01-10.002 4.125 14.03 14.03 0 01-7.743-2.317l.716-1.085c5.049 3.333 11.823 2.644 16.11-1.642 4.995-4.996 4.995-13.124 0-18.12-4.996-4.995-13.124-4.994-18.12 0-2.747 2.747-4.071 6.611-3.653 10.457l3.479-3.479.919.92-4.833 4.832-5.272-4.796.875-.962 3.496 3.181c-.313-4.087 1.15-8.153 4.07-11.072 5.502-5.502 14.455-5.503 19.958 0 5.502 5.502 5.502 14.456 0 19.958"}),e.createElement("path",{fillRule:"evenodd",d:"M38.21 24.195c0 7.911-6.436 14.347-14.347 14.347-6.784 0-12.696-4.82-14.055-11.457l1.732-.355c1.192 5.82 6.374 10.043 12.323 10.043 6.936 0 12.579-5.642 12.579-12.578 0-6.936-5.643-12.579-12.579-12.579-3.65 0-7.109 1.61-9.486 4.342h4.428v1.77h-7.058l-.346-7.343 1.766-.085.195 4.13a14.384 14.384 0 0110.501-4.582c7.911 0 14.347 6.436 14.347 14.347"}),e.createElement("path",{fillRule:"evenodd",d:"M34.186 34.38a14.37 14.37 0 01-10.169 4.192c-2.73 0-5.474-.772-7.87-2.355l.973-1.475c4.957 3.271 11.608 2.593 15.815-1.613 4.905-4.905 4.905-12.885 0-17.788-4.903-4.905-12.884-4.905-17.788 0-2.581 2.58-3.888 6.165-3.637 9.777l3.13-3.132 1.251 1.252-4.99 4.99-5.438-4.947 1.19-1.307 3.058 2.781a14.382 14.382 0 014.186-10.665c5.593-5.593 14.695-5.594 20.289 0 5.593 5.594 5.593 14.695 0 20.29"}),e.createElement("path",{fillRule:"evenodd",d:"M38.726 24.194c0 8.196-6.668 14.864-14.864 14.864-7.028 0-13.152-4.992-14.56-11.87l2.744-.56c1.14 5.578 6.11 9.628 11.816 9.628 6.652 0 12.064-5.41 12.064-12.062 0-6.652-5.412-12.062-12.064-12.062-3.1 0-6.05 1.218-8.272 3.312h5.248v2.802h-9.516l-.004-9.89h2.802v4.624a14.893 14.893 0 0 1 9.742-3.648c8.196 0 14.864 6.666 14.864 14.862"}),e.createElement("path",{fillRule:"evenodd",d:"M32.733 36.266a14.834 14.834 0 0 1-8.726 2.824 14.835 14.835 0 0 1-10.028-3.876l1.89-2.066c4.198 3.844 10.6 4.204 15.22.852 5.382-3.906 6.584-11.464 2.678-16.848a11.986 11.986 0 0 0-7.87-4.826c-3.184-.51-6.37.258-8.978 2.15-2.51 1.822-4.184 4.54-4.75 7.54l4.248-3.082 1.644 2.266-7.702 5.59-5.812-8.002 2.266-1.646 2.718 3.744a14.89 14.89 0 0 1 5.744-8.676c6.63-4.816 15.944-3.336 20.756 3.298 4.814 6.634 3.334 15.944-3.298 20.758"}))};export{c as U};
2
- //# sourceMappingURL=Undo-f1200d5b.js.map
1
+ import e from"react";import{g as l}from"./Icon-b0039bef.js";var c=function(c){var a=c.size,t=c.isHovered;return l(a,t,e.createElement("path",{fillRule:"evenodd",d:"M37.976 24.195c0 7.782-6.331 14.112-14.113 14.112-6.675 0-12.49-4.74-13.825-11.27l1.273-.26c1.213 5.928 6.492 10.23 12.552 10.23 7.065 0 12.813-5.747 12.813-12.812 0-7.065-5.748-12.813-12.813-12.813-3.885 0-7.554 1.796-9.977 4.812h4.92v1.299H11.97l-.337-7.12 1.299-.061.223 4.72c2.669-3.11 6.578-4.95 10.707-4.95 7.782 0 14.113 6.33 14.113 14.113"}),e.createElement("path",{fillRule:"evenodd",d:"M34.02 34.213a14.132 14.132 0 01-10.002 4.125 14.03 14.03 0 01-7.743-2.317l.716-1.085c5.049 3.333 11.823 2.644 16.11-1.642 4.995-4.996 4.995-13.124 0-18.12-4.996-4.995-13.124-4.994-18.12 0-2.747 2.747-4.071 6.611-3.653 10.457l3.479-3.479.919.92-4.833 4.832-5.272-4.796.875-.962 3.496 3.181c-.313-4.087 1.15-8.153 4.07-11.072 5.502-5.502 14.455-5.503 19.958 0 5.502 5.502 5.502 14.456 0 19.958"}),e.createElement("path",{fillRule:"evenodd",d:"M38.21 24.195c0 7.911-6.436 14.347-14.347 14.347-6.784 0-12.696-4.82-14.055-11.457l1.732-.355c1.192 5.82 6.374 10.043 12.323 10.043 6.936 0 12.579-5.642 12.579-12.578 0-6.936-5.643-12.579-12.579-12.579-3.65 0-7.109 1.61-9.486 4.342h4.428v1.77h-7.058l-.346-7.343 1.766-.085.195 4.13a14.384 14.384 0 0110.501-4.582c7.911 0 14.347 6.436 14.347 14.347"}),e.createElement("path",{fillRule:"evenodd",d:"M34.186 34.38a14.37 14.37 0 01-10.169 4.192c-2.73 0-5.474-.772-7.87-2.355l.973-1.475c4.957 3.271 11.608 2.593 15.815-1.613 4.905-4.905 4.905-12.885 0-17.788-4.903-4.905-12.884-4.905-17.788 0-2.581 2.58-3.888 6.165-3.637 9.777l3.13-3.132 1.251 1.252-4.99 4.99-5.438-4.947 1.19-1.307 3.058 2.781a14.382 14.382 0 014.186-10.665c5.593-5.593 14.695-5.594 20.289 0 5.593 5.594 5.593 14.695 0 20.29"}),e.createElement("path",{fillRule:"evenodd",d:"M38.726 24.194c0 8.196-6.668 14.864-14.864 14.864-7.028 0-13.152-4.992-14.56-11.87l2.744-.56c1.14 5.578 6.11 9.628 11.816 9.628 6.652 0 12.064-5.41 12.064-12.062 0-6.652-5.412-12.062-12.064-12.062-3.1 0-6.05 1.218-8.272 3.312h5.248v2.802h-9.516l-.004-9.89h2.802v4.624a14.893 14.893 0 0 1 9.742-3.648c8.196 0 14.864 6.666 14.864 14.862"}),e.createElement("path",{fillRule:"evenodd",d:"M32.733 36.266a14.834 14.834 0 0 1-8.726 2.824 14.835 14.835 0 0 1-10.028-3.876l1.89-2.066c4.198 3.844 10.6 4.204 15.22.852 5.382-3.906 6.584-11.464 2.678-16.848a11.986 11.986 0 0 0-7.87-4.826c-3.184-.51-6.37.258-8.978 2.15-2.51 1.822-4.184 4.54-4.75 7.54l4.248-3.082 1.644 2.266-7.702 5.59-5.812-8.002 2.266-1.646 2.718 3.744a14.89 14.89 0 0 1 5.744-8.676c6.63-4.816 15.944-3.336 20.756 3.298 4.814 6.634 3.334 15.944-3.298 20.758"}))};export{c as U};
2
+ //# sourceMappingURL=Undo-b0a5cf5c.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Undo-b0a5cf5c.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- import r from"react";import{c as a}from"./index-d1c0552c.js";import{F as e}from"./FormGroup-2d1fe7a1.js";import t from"./components/Validation/styles.module.scss";import{A as o}from"./constants-cd62f8dd.js";var s=r.forwardRef((function(s,m){var n=s.errorSummary,i=s.className,l=a(t.validation,i);return r.createElement(r.Fragment,null,r.createElement("div",{"data-testid":s.testId,"data-analyticsid":o.Validation,className:l},r.Children.map(s.children,(function(a){return a.type===e?r.cloneElement(a,{className:n?t["form-group-wrapper--error-sibling"]:""}):a}))),n&&r.createElement("p",{className:t.validation__errors},n))}));export{s as V};
2
- //# sourceMappingURL=Validation-842a5d4e.js.map
1
+ import r from"react";import{c as a}from"./index-d1c0552c.js";import{F as e}from"./FormGroup-5f9a5195.js";import t from"./components/Validation/styles.module.scss";import{A as o}from"./constants-cd62f8dd.js";var s=r.forwardRef((function(s,m){var n=s.errorSummary,i=s.className,l=a(t.validation,i);return r.createElement(r.Fragment,null,r.createElement("div",{"data-testid":s.testId,"data-analyticsid":o.Validation,className:l},r.Children.map(s.children,(function(a){return a.type===e?r.cloneElement(a,{className:n?t["form-group-wrapper--error-sibling"]:""}):a}))),n&&r.createElement("p",{className:t.validation__errors},n))}));export{s as V};
2
+ //# sourceMappingURL=Validation-e96418a9.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Validation-e96418a9.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- import e from"react";import{g as l}from"./Icon-2146c8a0.js";var t=function(t){var c=t.size,v=t.isHovered;return l(c,v,e.createElement("path",{fillRule:"evenodd",d:"M36.763 24c0-7.037-5.725-12.763-12.762-12.763-7.039 0-12.764 5.726-12.764 12.763S16.962 36.762 24 36.762 36.764 31.037 36.764 24zm1.4 0c0 7.809-6.353 14.162-14.162 14.162-7.81 0-14.164-6.353-14.164-14.162 0-7.81 6.354-14.163 14.163-14.163 7.81 0 14.163 6.353 14.163 14.163zM24.5 23.5h4.584v1H23.5v-7.126h1V23.5z"}),e.createElement("path",{fillRule:"evenodd",d:"M36.763 24c0-7.037-5.725-12.763-12.762-12.763-7.039 0-12.764 5.726-12.764 12.763S16.962 36.762 24 36.762 36.764 31.037 36.764 24zm1.4 0c0 7.809-6.353 14.162-14.162 14.162-7.81 0-14.164-6.353-14.164-14.162 0-7.81 6.354-14.163 14.163-14.163 7.81 0 14.163 6.353 14.163 14.163zM24.5 23.793l3.448 3.449-.707.707-3.742-3.742v-6.833h1v6.419z"}),e.createElement("path",{fillRule:"evenodd",d:"M24 36.577c-6.936 0-12.579-5.642-12.579-12.577 0-6.936 5.643-12.579 12.579-12.579 6.936 0 12.579 5.643 12.579 12.579 0 6.935-5.643 12.577-12.579 12.577zm0-26.924C16.089 9.653 9.653 16.09 9.653 24S16.09 38.346 24 38.346 38.347 31.91 38.347 24c0-7.911-6.436-14.347-14.347-14.347zm.632 7.722h-1.264v7.257h5.717v-1.264h-4.453v-5.993z"}),e.createElement("path",{fillRule:"evenodd",d:"M36.578 24c0-6.936-5.643-12.579-12.579-12.579-6.934 0-12.577 5.643-12.577 12.579 0 6.935 5.643 12.577 12.577 12.577 6.936 0 12.579-5.642 12.579-12.577zm1.768 0c0 7.911-6.435 14.346-14.347 14.346-7.91 0-14.345-6.435-14.345-14.346 0-7.911 6.435-14.347 14.345-14.347 7.912 0 14.347 6.436 14.347 14.347zm-13.715-.261l3.412 3.41-.893.893-3.782-3.78v-6.887h1.263v6.364z"}))};export{t as W};
2
- //# sourceMappingURL=Watch-83bd08c2.js.map
1
+ import e from"react";import{g as l}from"./Icon-b0039bef.js";var t=function(t){var v=t.size,c=t.isHovered;return l(v,c,e.createElement("path",{fillRule:"evenodd",d:"M36.763 24c0-7.037-5.725-12.763-12.762-12.763-7.039 0-12.764 5.726-12.764 12.763S16.962 36.762 24 36.762 36.764 31.037 36.764 24zm1.4 0c0 7.809-6.353 14.162-14.162 14.162-7.81 0-14.164-6.353-14.164-14.162 0-7.81 6.354-14.163 14.163-14.163 7.81 0 14.163 6.353 14.163 14.163zM24.5 23.5h4.584v1H23.5v-7.126h1V23.5z"}),e.createElement("path",{fillRule:"evenodd",d:"M36.763 24c0-7.037-5.725-12.763-12.762-12.763-7.039 0-12.764 5.726-12.764 12.763S16.962 36.762 24 36.762 36.764 31.037 36.764 24zm1.4 0c0 7.809-6.353 14.162-14.162 14.162-7.81 0-14.164-6.353-14.164-14.162 0-7.81 6.354-14.163 14.163-14.163 7.81 0 14.163 6.353 14.163 14.163zM24.5 23.793l3.448 3.449-.707.707-3.742-3.742v-6.833h1v6.419z"}),e.createElement("path",{fillRule:"evenodd",d:"M24 36.577c-6.936 0-12.579-5.642-12.579-12.577 0-6.936 5.643-12.579 12.579-12.579 6.936 0 12.579 5.643 12.579 12.579 0 6.935-5.643 12.577-12.579 12.577zm0-26.924C16.089 9.653 9.653 16.09 9.653 24S16.09 38.346 24 38.346 38.347 31.91 38.347 24c0-7.911-6.436-14.347-14.347-14.347zm.632 7.722h-1.264v7.257h5.717v-1.264h-4.453v-5.993z"}),e.createElement("path",{fillRule:"evenodd",d:"M36.578 24c0-6.936-5.643-12.579-12.579-12.579-6.934 0-12.577 5.643-12.577 12.579 0 6.935 5.643 12.577 12.577 12.577 6.936 0 12.579-5.642 12.579-12.577zm1.768 0c0 7.911-6.435 14.346-14.347 14.346-7.91 0-14.345-6.435-14.345-14.346 0-7.911 6.435-14.347 14.345-14.347 7.912 0 14.347 6.436 14.347 14.347zm-13.715-.261l3.412 3.41-.893.893-3.782-3.78v-6.887h1.263v6.364z"}))};export{t as W};
2
+ //# sourceMappingURL=Watch-bb5c0df7.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Watch-bb5c0df7.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- import e from"react";import{g as t}from"./Icon-2146c8a0.js";var l=function(l){var a=l.size,r=l.isHovered;return t(a,r,e.createElement("path",{d:"M25.403 24l10.259-10.259-1.403-1.403L24 22.597l-10.259-10.26-1.403 1.403L22.597 24 12.338 34.26l1.403 1.403L24 25.403l10.259 10.259 1.403-1.403z"}),e.createElement("path",{d:"M24 22.597L12.327 10.924l-1.403 1.402L22.597 24 10.923 35.674l1.403 1.402L24 25.403l11.674 11.673 1.403-1.402L25.403 24l11.673-11.674-1.403-1.402z"}),e.createElement("path",{d:"M25.773 24l10.432-10.432-1.772-1.773-10.432 10.433-10.433-10.433-1.773 1.772L22.229 24 11.795 34.433l1.773 1.772 10.433-10.433 10.432 10.433 1.772-1.773z"}),e.createElement("path",{d:"M24 22.227L11.781 10.008l-1.772 1.772 12.219 12.219-12.22 12.22 1.772 1.772L24 25.771l12.22 12.22 1.772-1.772-12.22-12.22L37.991 11.78l-1.772-1.772z"}),e.createElement("path",{d:"M36.3746 13.6056 34.3946 11.6256 24.0006 22.0196 13.6066 11.6256 11.6266 13.6056 22.0206 23.9996 11.6266 34.3936 13.6066 36.3736 24.0006 25.9796 34.3946 36.3736 36.3746 34.3936 25.9806 23.9996"}),e.createElement("path",{d:"M39.0362 10.9454 37.0562 8.9654 24.0002 22.0194 10.9442 8.9654 8.9642 10.9454 22.0202 23.9994 8.9642 37.0554 10.9442 39.0354 24.0002 25.9814 37.0562 39.0354 39.0362 37.0554 25.9802 23.9994"}))};export{l as X};
2
- //# sourceMappingURL=X-a44ae29d.js.map
1
+ import e from"react";import{g as t}from"./Icon-b0039bef.js";var l=function(l){var r=l.size,a=l.isHovered;return t(r,a,e.createElement("path",{d:"M25.403 24l10.259-10.259-1.403-1.403L24 22.597l-10.259-10.26-1.403 1.403L22.597 24 12.338 34.26l1.403 1.403L24 25.403l10.259 10.259 1.403-1.403z"}),e.createElement("path",{d:"M24 22.597L12.327 10.924l-1.403 1.402L22.597 24 10.923 35.674l1.403 1.402L24 25.403l11.674 11.673 1.403-1.402L25.403 24l11.673-11.674-1.403-1.402z"}),e.createElement("path",{d:"M25.773 24l10.432-10.432-1.772-1.773-10.432 10.433-10.433-10.433-1.773 1.772L22.229 24 11.795 34.433l1.773 1.772 10.433-10.433 10.432 10.433 1.772-1.773z"}),e.createElement("path",{d:"M24 22.227L11.781 10.008l-1.772 1.772 12.219 12.219-12.22 12.22 1.772 1.772L24 25.771l12.22 12.22 1.772-1.772-12.22-12.22L37.991 11.78l-1.772-1.772z"}),e.createElement("path",{d:"M36.3746 13.6056 34.3946 11.6256 24.0006 22.0196 13.6066 11.6256 11.6266 13.6056 22.0206 23.9996 11.6266 34.3936 13.6066 36.3736 24.0006 25.9796 34.3946 36.3736 36.3746 34.3936 25.9806 23.9996"}),e.createElement("path",{d:"M39.0362 10.9454 37.0562 8.9654 24.0002 22.0194 10.9442 8.9654 8.9642 10.9454 22.0202 23.9994 8.9642 37.0554 10.9442 39.0354 24.0002 25.9814 37.0562 39.0354 39.0362 37.0554 25.9802 23.9994"}))};export{l as X};
2
+ //# sourceMappingURL=X-3ef80a67.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"X-3ef80a67.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,6 +1,7 @@
1
1
  declare class IntersectionObserver {
2
2
  observe(): void;
3
3
  unobserve(): void;
4
+ disconnect(): void;
4
5
  }
5
6
  export default IntersectionObserver;
6
7
  //# sourceMappingURL=IntersectionObserver.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"IntersectionObserver.d.ts","sourceRoot":"","sources":["../../src/__mocks__/IntersectionObserver.ts"],"names":[],"mappings":"AAAA,cAAM,oBAAoB;IACxB,OAAO,IAAI,IAAI;IAGf,SAAS,IAAI,IAAI;CAGlB;AAMD,eAAe,oBAAoB,CAAC"}
1
+ {"version":3,"file":"IntersectionObserver.d.ts","sourceRoot":"","sources":["../../src/__mocks__/IntersectionObserver.ts"],"names":[],"mappings":"AAAA,cAAM,oBAAoB;IACxB,OAAO,IAAI,IAAI;IAGf,SAAS,IAAI,IAAI;IAGjB,UAAU,IAAI,IAAI;CAGnB;AAMD,eAAe,oBAAoB,CAAC"}
@@ -1,2 +1,2 @@
1
- import{b as e,c as n}from"../_rollupPluginBabelHelpers-0f007973.js";var r=function(){function r(){n(this,r)}return e(r,[{key:"observe",value:function(){}},{key:"unobserve",value:function(){}}]),r}();Object.defineProperty(window,"IntersectionObserver",{value:r});export{r as default};
1
+ import{b as e,c as n}from"../_rollupPluginBabelHelpers-0f007973.js";var o=function(){function o(){n(this,o)}return e(o,[{key:"observe",value:function(){}},{key:"unobserve",value:function(){}},{key:"disconnect",value:function(){}}]),o}();Object.defineProperty(window,"IntersectionObserver",{value:o});export{o as default};
2
2
  //# sourceMappingURL=IntersectionObserver.js.map
@@ -1,6 +1,7 @@
1
1
  declare class ResizeObserver {
2
2
  observe(): void;
3
3
  unobserve(): void;
4
+ disconnect(): void;
4
5
  }
5
6
  export default ResizeObserver;
6
7
  //# sourceMappingURL=ResizeObserver.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ResizeObserver.d.ts","sourceRoot":"","sources":["../../src/__mocks__/ResizeObserver.ts"],"names":[],"mappings":"AAAA,cAAM,cAAc;IAClB,OAAO;IAGP,SAAS;CAGV;AAMD,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"ResizeObserver.d.ts","sourceRoot":"","sources":["../../src/__mocks__/ResizeObserver.ts"],"names":[],"mappings":"AAAA,cAAM,cAAc;IAClB,OAAO;IAGP,SAAS;IAGT,UAAU;CAGX;AAMD,eAAe,cAAc,CAAC"}
@@ -1,2 +1,2 @@
1
- import{b as e,c as r}from"../_rollupPluginBabelHelpers-0f007973.js";var n=function(){function n(){r(this,n)}return e(n,[{key:"observe",value:function(){}},{key:"unobserve",value:function(){}}]),n}();Object.defineProperty(window,"ResizeObserver",{value:n});export{n as default};
1
+ import{b as e,c as n}from"../_rollupPluginBabelHelpers-0f007973.js";var o=function(){function o(){n(this,o)}return e(o,[{key:"observe",value:function(){}},{key:"unobserve",value:function(){}},{key:"disconnect",value:function(){}}]),o}();Object.defineProperty(window,"ResizeObserver",{value:o});export{o as default};
2
2
  //# sourceMappingURL=ResizeObserver.js.map
@@ -1,2 +1,2 @@
1
- export{A as default}from"../../AnchorLink-b55324d8.js";import"../../_rollupPluginBabelHelpers-0f007973.js";import"react";import"../../Icon-2146c8a0.js";import"../../_tslib-b219470a.js";import"../../index-d1c0552c.js";import"../../constants-cd62f8dd.js";import"../../useUuid-3b1e73f2.js";import"../../uuid-11037462.js";import"../../ArrowUpRight-ea4dab8b.js";import"../../color-e7d082c1.js";import"../../index-d1c9177a.js";import"../../palette-f206f488.js";import"../../grid-c105cad1.js";import"../../useHover-18479690.js";import"./styles.module.scss";
1
+ export{A as default}from"../../AnchorLink-fd609d98.js";import"../../_rollupPluginBabelHelpers-0f007973.js";import"react";import"../../Icon-b0039bef.js";import"../../_tslib-b219470a.js";import"../../index-d1c0552c.js";import"../../constants-cd62f8dd.js";import"../../useUuid-187c55e5.js";import"../../uuid-11037462.js";import"../../ArrowUpRight-516d81f4.js";import"../../color-e7d082c1.js";import"../../index-d1c9177a.js";import"../../palette-f206f488.js";import"../../grid-c105cad1.js";import"../../useHover-18479690.js";import"./styles.module.scss";
2
2
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- import a from"react";import{I as r}from"../../Icon-2146c8a0.js";import{A as e,I as t}from"../../constants-cd62f8dd.js";import{C as s}from"../../Check-4ff5dbe8.js";import{c as o}from"../../index-d1c0552c.js";import l from"./styles.module.scss";import{p as i}from"../../palette-f206f488.js";import"../../_tslib-b219470a.js";import"../../useUuid-3b1e73f2.js";import"../../_rollupPluginBabelHelpers-0f007973.js";import"../../uuid-11037462.js";var c=a.forwardRef((function(c,m){var d=c.children,f=c.className,p=void 0===f?"":f,n=c.selected,u=void 0!==n&&n,b=c.variant,v=void 0===b?"normal":b,j=c.testId,I=d.charAt(0).toLocaleUpperCase()+d.substring(1,2);return a.createElement("span",{className:o(l.avatar,u&&l["avatar--selected"],"black"===v&&l["avatar--black"],p),ref:m,"data-testid":j,"data-analyticsid":e.Avatar},u?a.createElement(r,{svgIcon:s,size:t.Small,color:"black"===v?i.neutral900:i.blueberry600}):I)}));export{c as default};
1
+ import a from"react";import{I as e}from"../../Icon-b0039bef.js";import{A as r,I as t}from"../../constants-cd62f8dd.js";import{C as s}from"../../Check-3e3f92b1.js";import{c as o}from"../../index-d1c0552c.js";import l from"./styles.module.scss";import{p as i}from"../../palette-f206f488.js";import"../../_tslib-b219470a.js";import"../../useUuid-187c55e5.js";import"../../_rollupPluginBabelHelpers-0f007973.js";import"../../uuid-11037462.js";var c=a.forwardRef((function(c,m){var d=c.children,p=c.className,f=void 0===p?"":p,n=c.selected,u=void 0!==n&&n,b=c.variant,v=void 0===b?"normal":b,j=c.testId,I=d.charAt(0).toLocaleUpperCase()+d.substring(1,2);return a.createElement("span",{className:o(l.avatar,u&&l["avatar--selected"],"black"===v&&l["avatar--black"],f),ref:m,"data-testid":j,"data-analyticsid":r.Avatar},u?a.createElement(e,{svgIcon:s,size:t.Small,color:"black"===v?i.neutral900:i.blueberry600}):I)}));export{c as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- export{B as default,i as intentToColor}from"../../Button-15cf6cc9.js";import"../../_rollupPluginBabelHelpers-0f007973.js";import"../../_tslib-b219470a.js";import"react";import"../../constants-cd62f8dd.js";import"../../color-e7d082c1.js";import"../../index-d1c9177a.js";import"../../palette-f206f488.js";import"../../grid-c105cad1.js";import"../../Icon-2146c8a0.js";import"../../index-d1c0552c.js";import"../../useUuid-3b1e73f2.js";import"../../uuid-11037462.js";import"../../Loader-55fc2157.js";import"../Loader/styles.module.scss";import"../../useHover-18479690.js";import"../../useBreakpoint-a74f5af5.js";import"./styles.module.scss";
1
+ export{B as default,i as intentToColor}from"../../Button-61d349a0.js";import"../../_rollupPluginBabelHelpers-0f007973.js";import"../../_tslib-b219470a.js";import"react";import"../../constants-cd62f8dd.js";import"../../color-e7d082c1.js";import"../../index-d1c9177a.js";import"../../palette-f206f488.js";import"../../grid-c105cad1.js";import"../../Icon-b0039bef.js";import"../../index-d1c0552c.js";import"../../useUuid-187c55e5.js";import"../../uuid-11037462.js";import"../../Loader-55fc2157.js";import"../Loader/styles.module.scss";import"../../useHover-18479690.js";import"../../useBreakpoint-a74f5af5.js";import"./styles.module.scss";
2
2
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- import{_ as t}from"../../_rollupPluginBabelHelpers-0f007973.js";import s,{useState as e}from"react";import{B as o}from"../../Button-15cf6cc9.js";import{M as r}from"../../Modal-0e776e4c.js";import"../../_tslib-b219470a.js";import"../../constants-cd62f8dd.js";import"../../color-e7d082c1.js";import"../../index-d1c9177a.js";import"../../palette-f206f488.js";import"../../grid-c105cad1.js";import"../../Icon-2146c8a0.js";import"../../index-d1c0552c.js";import"../../useUuid-3b1e73f2.js";import"../../uuid-11037462.js";import"../../Loader-55fc2157.js";import"../Loader/styles.module.scss";import"../../useHover-18479690.js";import"../../useBreakpoint-a74f5af5.js";import"../Button/styles.module.scss";import"../Modal/styles.module.scss";import"../../AlertSignStroke-06b89e43.js";import"../../AlertSignFill-32815dfb.js";import"../../useFocusTrap-4a5fb65d.js";import"../../useIsVisible-c8ddd04f.js";import"../../Title-8a664c4e.js";import"../Title/styles.module.scss";import"../../Close-53f0e814.js";import"../../X-a44ae29d.js";import"../Close/styles.module.scss";import"../../CheckOutline-86cddefd.js";import"../../index-9af65d13.js";import"react-dom";var i=s.forwardRef((function(i,m){var d=e(!1),p=t(d,2),a=p[0],c=p[1];return s.createElement("div",{"data-testid":i.testId},s.createElement(o,{onClick:function(){return c(!0)}},i.buttonText),a&&s.createElement(r,Object.assign({},i,{onClose:function(){return c(!1)}})))}));export{i as default};
1
+ import{_ as t}from"../../_rollupPluginBabelHelpers-0f007973.js";import e,{useState as s}from"react";import{B as o}from"../../Button-61d349a0.js";import{M as r}from"../../Modal-9de3ca1c.js";import"../../_tslib-b219470a.js";import"../../constants-cd62f8dd.js";import"../../color-e7d082c1.js";import"../../index-d1c9177a.js";import"../../palette-f206f488.js";import"../../grid-c105cad1.js";import"../../Icon-b0039bef.js";import"../../index-d1c0552c.js";import"../../useUuid-187c55e5.js";import"../../uuid-11037462.js";import"../../Loader-55fc2157.js";import"../Loader/styles.module.scss";import"../../useHover-18479690.js";import"../../useBreakpoint-a74f5af5.js";import"../Button/styles.module.scss";import"../Modal/styles.module.scss";import"../../AlertSignStroke-95b64a4c.js";import"../../AlertSignFill-cf9edefa.js";import"../../useFocusTrap-4a5fb65d.js";import"../../useIsVisible-c8ddd04f.js";import"../../Title-8a664c4e.js";import"../Title/styles.module.scss";import"../../Close-e6e01a80.js";import"../../X-3ef80a67.js";import"../Close/styles.module.scss";import"../../CheckOutline-86cddefd.js";import"../../index-9af65d13.js";import"react-dom";var i=e.forwardRef((function(i,m){var d=s(!1),a=t(d,2),p=a[0],c=a[1];return e.createElement("div",{"data-testid":i.testId},e.createElement(o,{onClick:function(){return c(!0)}},i.buttonText),p&&e.createElement(r,Object.assign({},i,{onClose:function(){return c(!1)}})))}));export{i as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- export{C as Checkbox,C as default}from"../../Checkbox-2d678536.js";import"../../_rollupPluginBabelHelpers-0f007973.js";import"react";import"../../index-d1c0552c.js";import"../../uuid-11037462.js";import"../../Check-4ff5dbe8.js";import"../../Icon-2146c8a0.js";import"../../_tslib-b219470a.js";import"../../constants-cd62f8dd.js";import"../../useUuid-3b1e73f2.js";import"../../color-e7d082c1.js";import"../../index-d1c9177a.js";import"../../palette-f206f488.js";import"../../grid-c105cad1.js";import"./styles.module.scss";
1
+ export{C as Checkbox,C as default}from"../../Checkbox-2ed9547d.js";import"../../_rollupPluginBabelHelpers-0f007973.js";import"react";import"../../index-d1c0552c.js";import"../../uuid-11037462.js";import"../../Check-3e3f92b1.js";import"../../Icon-b0039bef.js";import"../../_tslib-b219470a.js";import"../../constants-cd62f8dd.js";import"../../useUuid-187c55e5.js";import"../../color-e7d082c1.js";import"../../index-d1c9177a.js";import"../../palette-f206f488.js";import"../../grid-c105cad1.js";import"./styles.module.scss";
2
2
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- export{C as default}from"../../Close-53f0e814.js";import"../../_rollupPluginBabelHelpers-0f007973.js";import"react";import"../../palette-f206f488.js";import"../../Icon-2146c8a0.js";import"../../_tslib-b219470a.js";import"../../index-d1c0552c.js";import"../../constants-cd62f8dd.js";import"../../useUuid-3b1e73f2.js";import"../../uuid-11037462.js";import"../../X-a44ae29d.js";import"./styles.module.scss";import"../../useBreakpoint-a74f5af5.js";import"../../grid-c105cad1.js";
1
+ export{C as default}from"../../Close-e6e01a80.js";import"../../_rollupPluginBabelHelpers-0f007973.js";import"react";import"../../palette-f206f488.js";import"../../Icon-b0039bef.js";import"../../_tslib-b219470a.js";import"../../index-d1c0552c.js";import"../../constants-cd62f8dd.js";import"../../useUuid-187c55e5.js";import"../../uuid-11037462.js";import"../../X-3ef80a67.js";import"./styles.module.scss";import"../../useBreakpoint-a74f5af5.js";import"../../grid-c105cad1.js";
2
2
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- import{_ as e,d as o}from"../../_rollupPluginBabelHelpers-0f007973.js";import r,{useRef as t,useState as n}from"react";import{c as a}from"../../index-d1c0552c.js";import{I as l}from"../../Icon-2146c8a0.js";import{K as d,A as s,I as i}from"../../constants-cd62f8dd.js";import{t as c}from"../../index-d1c9177a.js";import"../../useBreakpoint-a74f5af5.js";import{u}from"../../useHover-18479690.js";import{a as p,u as m,b as f,c as _}from"../../useOutsideEvent-404d4313.js";import{u as v}from"../../useUuid-3b1e73f2.js";import g from"./styles.module.scss";import{P as w}from"../../PlusSmall-cc27eeac.js";import{B as b}from"../../Button-15cf6cc9.js";import"../../_tslib-b219470a.js";import"../../palette-f206f488.js";import"../../grid-c105cad1.js";import"../../usePrevious-ae293b10.js";import"../../uuid-11037462.js";import"../../color-e7d082c1.js";import"../../Loader-55fc2157.js";import"../Loader/styles.module.scss";import"../Button/styles.module.scss";var y;!function(e){e.onwhite="onwhite",e.ongrey="ongrey",e.onblueberry="onblueberry",e.oncherry="oncherry"}(y||(y={}));var h=function(h){var j,E=h.label,k=h.placeholder,x=h.closeText,N=void 0===x?"Lukk":x,I=h.noCloseButton,B=void 0!==I&&I,H=h.onToggle,A=h.open,C=void 0!==A&&A,D=h.children,P=h.mode,L=void 0===P?y.onwhite:P,U=h.transparent,R=void 0!==U&&U,S=h.fluid,T=void 0!==S&&S,z=h.testId,K=h.disabled,O=t(null),V=t(null),X=u(),q=X.hoverRef,F=X.isHovered,G=p(!K&&C,H),J=G.value,M=G.toggleValue,Q=t(r.Children.map(D,(function(){return r.createRef()}))),W=n(),Y=e(W,2),Z=Y[0],$=Y[1],ee=(m(q)||{}).width,oe=v(),re=v(),te=v(),ne=function(){var e;M(),null===(e=V.current)||void 0===e||e.focus()},ae=function(){var e;M(),null===(e=q.current)||void 0===e||e.focus()};f("keydown",O,[d.ArrowDown,d.ArrowUp,d.End,d.Enter,d.Escape,d.Home],(function(e){var o;if(e.preventDefault(),Q.current)if(J)if(e.key===d.Escape&&J)ae();else{var r=Q.current.findIndex((function(o){return o.current===e.target})),t=r;e.key===d.Home?t=0:e.key===d.End?t=Q.current.length-1:e.key===d.ArrowDown&&r<Q.current.length-1?t=r+1:e.key===d.ArrowUp&&r>0?t=r-1:e.key===d.Enter&&-1!==r&&(t=r),-1!==t&&(null===(o=Q.current[t].current)||void 0===o||o.focus(),$(t))}else ne()})),_(O,(function(){return J&&ae()}));var le=a(g.dropdown__toggle,!K&&(o(j={},g["dropdown__toggle--on-white"],L===y.onwhite),o(j,g["dropdown__toggle--on-grey"],L===y.ongrey),o(j,g["dropdown__toggle--on-blueberry"],L===y.onblueberry),o(j,g["dropdown__toggle--on-cherry"],L===y.oncherry),o(j,g["dropdown__toggle--transparent"],R),o(j,g["dropdown__toggle--fluid"],T),o(j,g["dropdown__toggle--open"],J),j)),de=a(g.dropdown__content,J&&g["dropdown__content--open"]);return r.createElement("div",{className:g.dropdown,ref:O},r.createElement("span",{id:oe,className:g.dropdown__label},E),r.createElement("button",{type:"button",onClick:function(){return!J&&ne()},className:le,ref:q,"data-testid":z,"data-analyticsid":s.Dropdown,disabled:K,"aria-labelledby":re,"aria-haspopup":"listbox","aria-expanded":J},r.createElement("span",{id:re,className:g.dropdown__toggle__label},k),r.createElement(l,{color:K?c.palette.neutral500:c.palette.blueberry600,svgIcon:w,className:g.dropdown__icon,isHovered:F,size:i.XSmall})),r.createElement("div",{className:de,style:{width:T?"100%":"".concat(ee,"px")}},r.createElement("ul",{className:g.dropdown__options,role:"listbox","aria-labelledby":oe,tabIndex:-1,"aria-activedescendant":void 0!==Z?"".concat(te,"-").concat(Z):void 0,ref:V},r.Children.map(D,(function(e,o){var t;return r.createElement("li",{className:g.dropdown__input,role:"option",id:"".concat(te,"-").concat(o)},r.cloneElement(e,{ref:null===(t=Q.current)||void 0===t?void 0:t[o]}))}))),!B&&r.createElement("div",{className:g.dropdown__close},r.createElement(b,{onClick:ae,fluid:!0,"aria-expanded":J},N))))};export{y as DropdownMode,h as default};
1
+ import{_ as e,d as o}from"../../_rollupPluginBabelHelpers-0f007973.js";import r,{useRef as t,useState as n}from"react";import{c as a}from"../../index-d1c0552c.js";import{I as l}from"../../Icon-b0039bef.js";import{K as d,A as s,I as i}from"../../constants-cd62f8dd.js";import{t as c}from"../../index-d1c9177a.js";import"../../useBreakpoint-a74f5af5.js";import{u}from"../../useHover-18479690.js";import{a as p,u as m,b as f,c as _}from"../../useOutsideEvent-404d4313.js";import{u as v}from"../../useUuid-187c55e5.js";import b from"./styles.module.scss";import{P as g}from"../../PlusSmall-bd2ab6fe.js";import{B as w}from"../../Button-61d349a0.js";import"../../_tslib-b219470a.js";import"../../palette-f206f488.js";import"../../grid-c105cad1.js";import"../../usePrevious-ae293b10.js";import"../../uuid-11037462.js";import"../../color-e7d082c1.js";import"../../Loader-55fc2157.js";import"../Loader/styles.module.scss";import"../Button/styles.module.scss";var y;!function(e){e.onwhite="onwhite",e.ongrey="ongrey",e.onblueberry="onblueberry",e.oncherry="oncherry"}(y||(y={}));var h=function(h){var j,E=h.label,k=h.placeholder,x=h.closeText,N=void 0===x?"Lukk":x,I=h.noCloseButton,B=void 0!==I&&I,H=h.onToggle,A=h.open,C=void 0!==A&&A,D=h.children,P=h.mode,L=void 0===P?y.onwhite:P,U=h.transparent,R=void 0!==U&&U,S=h.fluid,T=void 0!==S&&S,z=h.testId,K=h.disabled,O=t(null),V=t(null),X=u(),q=X.hoverRef,F=X.isHovered,G=p(!K&&C,H),J=G.value,M=G.toggleValue,Q=t(r.Children.map(D,(function(){return r.createRef()}))),W=n(),Y=e(W,2),Z=Y[0],$=Y[1],ee=(m(q)||{}).width,oe=v(),re=v(),te=v(),ne=function(){var e;M(),null===(e=V.current)||void 0===e||e.focus()},ae=function(){var e;M(),null===(e=q.current)||void 0===e||e.focus()};f("keydown",O,[d.ArrowDown,d.ArrowUp,d.End,d.Enter,d.Escape,d.Home],(function(e){var o;if(e.preventDefault(),Q.current)if(J)if(e.key===d.Escape&&J)ae();else{var r=Q.current.findIndex((function(o){return o.current===e.target})),t=r;e.key===d.Home?t=0:e.key===d.End?t=Q.current.length-1:e.key===d.ArrowDown&&r<Q.current.length-1?t=r+1:e.key===d.ArrowUp&&r>0?t=r-1:e.key===d.Enter&&-1!==r&&(t=r),-1!==t&&(null===(o=Q.current[t].current)||void 0===o||o.focus(),$(t))}else ne()})),_(O,(function(){return J&&ae()}));var le=a(b.dropdown__toggle,!K&&(o(j={},b["dropdown__toggle--on-white"],L===y.onwhite),o(j,b["dropdown__toggle--on-grey"],L===y.ongrey),o(j,b["dropdown__toggle--on-blueberry"],L===y.onblueberry),o(j,b["dropdown__toggle--on-cherry"],L===y.oncherry),o(j,b["dropdown__toggle--transparent"],R),o(j,b["dropdown__toggle--fluid"],T),o(j,b["dropdown__toggle--open"],J),j)),de=a(b.dropdown__content,J&&b["dropdown__content--open"]);return r.createElement("div",{className:b.dropdown,ref:O},r.createElement("span",{id:oe,className:b.dropdown__label},E),r.createElement("button",{type:"button",onClick:function(){return!J&&ne()},className:le,ref:q,"data-testid":z,"data-analyticsid":s.Dropdown,disabled:K,"aria-labelledby":re,"aria-haspopup":"listbox","aria-expanded":J},r.createElement("span",{id:re,className:b.dropdown__toggle__label},k),r.createElement(l,{color:K?c.palette.neutral500:c.palette.blueberry600,svgIcon:g,className:b.dropdown__icon,isHovered:F,size:i.XSmall})),r.createElement("div",{className:de,style:{width:T?"100%":"".concat(ee,"px")}},r.createElement("ul",{className:b.dropdown__options,role:"listbox","aria-labelledby":oe,tabIndex:-1,"aria-activedescendant":void 0!==Z?"".concat(te,"-").concat(Z):void 0,ref:V},r.Children.map(D,(function(e,o){var t;return r.createElement("li",{className:b.dropdown__input,role:"option",id:"".concat(te,"-").concat(o)},r.cloneElement(e,{ref:null===(t=Q.current)||void 0===t?void 0:t[o]}))}))),!B&&r.createElement("div",{className:b.dropdown__close},r.createElement(w,{onClick:ae,fluid:!0,"aria-expanded":J},N))))};export{y as DropdownMode,h as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- import{_ as e}from"../../_rollupPluginBabelHelpers-0f007973.js";import t,{useState as r,useRef as n,useEffect as a}from"react";import{I as o}from"../../Icon-2146c8a0.js";import{Z as s,A as i,I as d}from"../../constants-cd62f8dd.js";import{u as c}from"../../useHover-18479690.js";import{u as l}from"../../usePrevious-ae293b10.js";import p from"./styles.module.scss";import{c as m}from"../../index-d1c0552c.js";import{C as u}from"../../ChevronDown-e437ddc7.js";import{C as _}from"../../ChevronUp-e7ceb743.js";import{B as f}from"../../Button-15cf6cc9.js";import{a as x}from"../../useSticky-f8ffc6d8.js";import"../../_tslib-b219470a.js";import"../../useUuid-3b1e73f2.js";import"../../uuid-11037462.js";import"../../color-e7d082c1.js";import"../../index-d1c9177a.js";import"../../palette-f206f488.js";import"../../grid-c105cad1.js";import"../../Loader-55fc2157.js";import"../Loader/styles.module.scss";import"../../useBreakpoint-a74f5af5.js";import"../Button/styles.module.scss";import"../../debounce-fb23662f.js";var g;!function(e){e.small="small",e.large="large"}(g||(g={}));var v=function(v){var j=v.title,b=v.children,E=v.size,y=void 0===E?g.small:E,I=v.color,h=v.svgIcon,C=v.expanded,k=void 0!==C&&C,N=v.noNestedLine,H=void 0!==N&&N,z=v.sticky,B=void 0!==z&&z,w=v.testId,L=v.onExpand,S=v.renderChildrenWhenClosed,W=void 0!==S&&S,X=r(k),P=e(X,2),T=P[0],U=P[1],A=l(T),D=n(null),O=n(null),Z=c(O).isHovered,q=x(D,O),F=q.isOutsideWindow,G=q.isLeavingWindow,J=q.offsetHeight,K=q.contentWidth,M=B&&T&&F;a((function(){k!==T&&U(k)}),[k]),a((function(){L&&T!==!!A&&L(T)}),[T,L]);var Q=function(e){return t.createElement("span",{className:m(p.expander__icon,p["expander__icon--".concat(e)])},t.createElement(o,{svgIcon:T?_:u,size:d.XSmall,isHovered:Z}))},R=m(p.expander__trigger,p["expander__trigger--".concat(y)],y===g.large&&p["expander__trigger--".concat(I||"neutral")],y===g.large&&h&&p["expander__trigger--icon"],T&&p["expander__trigger--expanded"],M&&!G&&p["expander__trigger--sticky"],M&&G&&p["expander__trigger--absolute"]),V=m(p.expander__button,T&&p["expander__button--expanded"],M&&!G&&p["expander__button--sticky"],M&&G&&p["expander__button--absolute"]);return t.createElement("div",{className:p.expander,ref:D,style:{paddingTop:M&&J?"".concat(J,"px"):void 0}},y===g.large?t.createElement("button",{type:"button",className:R,style:{zIndex:Z||M?s.ExpanderTrigger:void 0,width:M&&K?"".concat(K,"px"):void 0},"aria-expanded":T,ref:O,onClick:function(){return U(!T)},"data-testid":w,"data-analyticsid":i.Expander},y===g.small&&Q("left"),h&&t.createElement("span",{className:m(p.expander__icon,p["expander__icon--left"])},t.createElement(o,{svgIcon:h,size:d.XSmall,isHovered:Z})),j,y===g.large&&Q("right")):t.createElement(f,{variant:"borderless",className:V,"aria-expanded":T,ref:O,onClick:function(){return U(!T)},testId:w,"data-analyticsid":i.Expander},t.createElement(o,{svgIcon:T?_:u,size:d.XSmall}),j),function(){if(!W&&!T)return null;var e=m(p.expander__content,p["expander__content--".concat(y)],y===g.large&&p["expander__content--".concat(I||"neutral")],y===g.large&&h&&p["expander__content--icon"],T&&p["expander__content--expanded"],y===g.small&&!H&&p["expander__content--nested-line"]);return t.createElement("div",{className:e},b)}())};export{g as ExpanderSize,v as default};
1
+ import{_ as e}from"../../_rollupPluginBabelHelpers-0f007973.js";import t,{useState as r,useRef as n,useEffect as a}from"react";import{I as o}from"../../Icon-b0039bef.js";import{Z as s,A as i,I as d}from"../../constants-cd62f8dd.js";import{u as c}from"../../useHover-18479690.js";import{u as l}from"../../usePrevious-ae293b10.js";import p from"./styles.module.scss";import{c as m}from"../../index-d1c0552c.js";import{C as u}from"../../ChevronDown-3d01aa5d.js";import{C as _}from"../../ChevronUp-1ed3fb8f.js";import{B as f}from"../../Button-61d349a0.js";import{a as x}from"../../useSticky-f8ffc6d8.js";import"../../_tslib-b219470a.js";import"../../useUuid-187c55e5.js";import"../../uuid-11037462.js";import"../../color-e7d082c1.js";import"../../index-d1c9177a.js";import"../../palette-f206f488.js";import"../../grid-c105cad1.js";import"../../Loader-55fc2157.js";import"../Loader/styles.module.scss";import"../../useBreakpoint-a74f5af5.js";import"../Button/styles.module.scss";import"../../debounce-fb23662f.js";var g;!function(e){e.small="small",e.large="large"}(g||(g={}));var v=function(v){var j=v.title,b=v.children,E=v.size,y=void 0===E?g.small:E,I=v.color,h=v.svgIcon,C=v.expanded,k=void 0!==C&&C,N=v.noNestedLine,H=void 0!==N&&N,z=v.sticky,B=void 0!==z&&z,w=v.testId,L=v.onExpand,S=v.renderChildrenWhenClosed,W=void 0!==S&&S,X=r(k),P=e(X,2),T=P[0],U=P[1],A=l(T),D=n(null),O=n(null),Z=c(O).isHovered,q=x(D,O),F=q.isOutsideWindow,G=q.isLeavingWindow,J=q.offsetHeight,K=q.contentWidth,M=B&&T&&F;a((function(){k!==T&&U(k)}),[k]),a((function(){L&&T!==!!A&&L(T)}),[T,L]);var Q=function(e){return t.createElement("span",{className:m(p.expander__icon,p["expander__icon--".concat(e)])},t.createElement(o,{svgIcon:T?_:u,size:d.XSmall,isHovered:Z}))},R=m(p.expander__trigger,p["expander__trigger--".concat(y)],y===g.large&&p["expander__trigger--".concat(I||"neutral")],y===g.large&&h&&p["expander__trigger--icon"],T&&p["expander__trigger--expanded"],M&&!G&&p["expander__trigger--sticky"],M&&G&&p["expander__trigger--absolute"]),V=m(p.expander__button,T&&p["expander__button--expanded"],M&&!G&&p["expander__button--sticky"],M&&G&&p["expander__button--absolute"]);return t.createElement("div",{className:p.expander,ref:D,style:{paddingTop:M&&J?"".concat(J,"px"):void 0}},y===g.large?t.createElement("button",{type:"button",className:R,style:{zIndex:Z||M?s.ExpanderTrigger:void 0,width:M&&K?"".concat(K,"px"):void 0},"aria-expanded":T,ref:O,onClick:function(){return U(!T)},"data-testid":w,"data-analyticsid":i.Expander},y===g.small&&Q("left"),h&&t.createElement("span",{className:m(p.expander__icon,p["expander__icon--left"])},t.createElement(o,{svgIcon:h,size:d.XSmall,isHovered:Z})),j,y===g.large&&Q("right")):t.createElement(f,{variant:"borderless",className:V,"aria-expanded":T,ref:O,onClick:function(){return U(!T)},testId:w,"data-analyticsid":i.Expander},t.createElement(o,{svgIcon:T?_:u,size:d.XSmall}),j),function(){if(!W&&!T)return null;var e=m(p.expander__content,p["expander__content--".concat(y)],y===g.large&&p["expander__content--".concat(I||"neutral")],y===g.large&&h&&p["expander__content--icon"],T&&p["expander__content--expanded"],y===g.small&&!H&&p["expander__content--nested-line"]);return t.createElement("div",{className:e},b)}())};export{g as ExpanderSize,v as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -27,6 +27,8 @@ interface ExpanderListProps {
27
27
  renderChildrenWhenClosed?: boolean;
28
28
  /** Toggles the top border of the first child element. */
29
29
  topBorder?: boolean;
30
+ /** Stick expander trigger to top of screen while scrolling down */
31
+ sticky?: boolean;
30
32
  /** Sets the data-testid attribute. */
31
33
  testId?: string;
32
34
  }
@@ -45,7 +47,7 @@ declare type ExpanderProps = Modify<React.HTMLAttributes<HTMLButtonElement>, {
45
47
  handleExpanderClick?: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
46
48
  /** Called when expander is open/closed. */
47
49
  onExpand?: (isExpanded: boolean) => void;
48
- }> & Pick<ExpanderListProps, 'renderChildrenWhenClosed'>;
50
+ }> & Pick<ExpanderListProps, 'renderChildrenWhenClosed' | 'sticky'>;
49
51
  export declare const ExpanderList: ExpanderListCompound;
50
52
  export default ExpanderList;
51
53
  //# sourceMappingURL=ExpanderList.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExpanderList.d.ts","sourceRoot":"","sources":["../../../src/components/ExpanderList/ExpanderList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAenD,oBAAY,kBAAkB,GAAG,YAAY,CAAC;AAC9C,oBAAY,YAAY,GAAG,KAAK,CAAC,yBAAyB,CAAC,aAAa,GAAG,KAAK,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC,CAAC;AAE/G,MAAM,WAAW,oBAAqB,SAAQ,KAAK,CAAC,yBAAyB,CAAC,iBAAiB,GAAG,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC;IACtI,QAAQ,EAAE,YAAY,CAAC;CACxB;AAED,UAAU,iBAAiB;IACzB,yDAAyD;IACzD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,2DAA2D;IAC3D,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,gCAAgC;IAChC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,wCAAwC;IACxC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uDAAuD;IACvD,KAAK,CAAC,EAAE,kBAAkB,CAAC;IAC3B,6BAA6B;IAC7B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,wCAAwC;IACxC,qGAAqG;IACrG,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,sGAAsG;IACtG,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,yDAAyD;IACzD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,aAAK,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC;AAEzC,aAAK,aAAa,GAAG,MAAM,CACzB,KAAK,CAAC,cAAc,CAAC,iBAAiB,CAAC,EACvC;IACE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,GAAG,CAAC,OAAO,GAAG,MAAM,CAAC;IAC5B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,kBAAkB,CAAC;IAC3B,IAAI,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mBAAmB,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;IACjF,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;CAC1C,CACF,GACC,IAAI,CAAC,iBAAiB,EAAE,0BAA0B,CAAC,CAAC;AAoGtD,eAAO,MAAM,YAAY,sBA2FC,CAAC;AAK3B,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"ExpanderList.d.ts","sourceRoot":"","sources":["../../../src/components/ExpanderList/ExpanderList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAE3D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAkBnD,oBAAY,kBAAkB,GAAG,YAAY,CAAC;AAC9C,oBAAY,YAAY,GAAG,KAAK,CAAC,yBAAyB,CAAC,aAAa,GAAG,KAAK,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC,CAAC;AAE/G,MAAM,WAAW,oBAAqB,SAAQ,KAAK,CAAC,yBAAyB,CAAC,iBAAiB,GAAG,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC;IACtI,QAAQ,EAAE,YAAY,CAAC;CACxB;AAED,UAAU,iBAAiB;IACzB,yDAAyD;IACzD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,2DAA2D;IAC3D,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,gCAAgC;IAChC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,wCAAwC;IACxC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uDAAuD;IACvD,KAAK,CAAC,EAAE,kBAAkB,CAAC;IAC3B,6BAA6B;IAC7B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,wCAAwC;IACxC,qGAAqG;IACrG,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,sGAAsG;IACtG,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,yDAAyD;IACzD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,mEAAmE;IACnE,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,aAAK,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC;AAEzC,aAAK,aAAa,GAAG,MAAM,CACzB,KAAK,CAAC,cAAc,CAAC,iBAAiB,CAAC,EACvC;IACE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,GAAG,CAAC,OAAO,GAAG,MAAM,CAAC;IAC5B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,kBAAkB,CAAC;IAC3B,IAAI,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mBAAmB,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;IACjF,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;CAC1C,CACF,GACC,IAAI,CAAC,iBAAiB,EAAE,0BAA0B,GAAG,QAAQ,CAAC,CAAC;AAoHjE,eAAO,MAAM,YAAY,sBA6FC,CAAC;AAK3B,eAAe,YAAY,CAAC"}
@@ -220,6 +220,25 @@
220
220
  "name": "boolean"
221
221
  }
222
222
  },
223
+ "sticky": {
224
+ "defaultValue": null,
225
+ "description": "Stick expander trigger to top of screen while scrolling down",
226
+ "name": "sticky",
227
+ "parent": {
228
+ "fileName": "src/components/ExpanderList/ExpanderList.tsx",
229
+ "name": "ExpanderListProps"
230
+ },
231
+ "declarations": [
232
+ {
233
+ "fileName": "src/components/ExpanderList/ExpanderList.tsx",
234
+ "name": "ExpanderListProps"
235
+ }
236
+ ],
237
+ "required": false,
238
+ "type": {
239
+ "name": "boolean"
240
+ }
241
+ },
223
242
  "testId": {
224
243
  "defaultValue": null,
225
244
  "description": "Sets the data-testid attribute.",
@@ -1,2 +1,2 @@
1
- import{_ as e,a as n,d as t}from"../../_rollupPluginBabelHelpers-0f007973.js";import i,{useState as r,useEffect as a}from"react";import{I as o}from"../../Icon-2146c8a0.js";import{A as d,I as l}from"../../constants-cd62f8dd.js";import{C as s}from"../../ChevronUp-e7ceb743.js";import{C as c}from"../../ChevronDown-e437ddc7.js";import{u as p}from"../../useHover-18479690.js";import{u as m}from"../../usePrevious-ae293b10.js";import{u,B as f}from"../../useBreakpoint-a74f5af5.js";import{c as v}from"../../index-d1c0552c.js";import x from"./styles.module.scss";import{u as _}from"../../useUuid-3b1e73f2.js";import"../../_tslib-b219470a.js";import"../../grid-c105cad1.js";import"../../uuid-11037462.js";var g=i.forwardRef((function(_,g){var h,j,E=_.id,b=_.children,k=_.padding,C=void 0===k||k,N=_.color,w=void 0===N?"neutral":N,y=_.className,H=void 0===y?"":y,I=_.icon,O=_.large,B=void 0!==O&&O,W=_.title,R=_.expanded,L=void 0!==R&&R,P=_.testId,S=_.handleExpanderClick,z=_.onExpand,U=_.renderChildrenWhenClosed,V=r(L),X=e(V,2),A=X[0],D=X[1],T=m(A),q=p(),F=q.hoverRef,G=q.isHovered,J=u(),K="object"===n(W),M=v(H,t({},x["expander-list__item--jsx"],K)),Q=v(x["expander-list-link"],x["expander-list-link--".concat(w)],(t(h={},x["expander-list-link--closed"],!A),t(h,x["expander-list-link--large"],B),t(h,x["expander-list-link--jsx"],K),h)),Y=v(x["expander-list-link__title"],(t(j={},x["expander-list-link__title--string"],!K),t(j,x["expander-list-link__title--jsx"],K),j));a((function(){L!==A&&D(L)}),[L]),a((function(){z&&A!==!!T&&z(A)}),[A,z]);return i.createElement("li",{className:M,ref:g},i.createElement("button",{type:"button",id:E,onClick:S,"data-testid":P,"data-analyticsid":d.ExpanderListExpander,className:Q,ref:F,"aria-expanded":A},I&&i.createElement("span",{className:x["expander-list-link__icon"]},i.cloneElement(I,{size:J===f.xs?l.XSmall:l.Small,isHovered:G})),i.createElement("span",{className:Y},W),i.createElement("span",{className:x["expander-list-link__chevron"]},i.createElement(o,{size:l.XSmall,svgIcon:A?s:c,isHovered:G}))),function(){if(!U&&!A)return null;var e=v(x["expander-list-link__main-content"],A&&x["expander-list-link__main-content--expanded"],C?x["expander-list-link__main-content--padding"]:"");return i.createElement("div",{className:e},b)}())})),h=function(e){return i.isValidElement(e)&&e.type===g},j=i.forwardRef((function(n,o){var l=n.children,s=n.childPadding,c=void 0===s||s,p=n.large,m=n.isOpen,u=void 0!==m&&m,f=n.renderChildrenWhenClosed,g=void 0!==f&&f,j=n.color,E=n.className,b=void 0===E?"":E,k=n.accordion,C=void 0!==k&&k,N=n.topBorder,w=void 0===N||N,y=n.bottomBorder,H=void 0===y||y,I=n.testId,O=r(),B=e(O,2),W=B[0],R=B[1],L=r(),P=e(L,2),S=P[0],z=P[1],U=_(),V=i.Children.count(l),X=v(x["expander-list"],b);var A=function(e){return"".concat(U,"-").concat(e)};return a((function(){var e,n,t,i,r;!C||!S||(e=S.getBoundingClientRect(),n=e.top,t=e.left,i=e.bottom,r=e.right,n>=0&&t>=0&&i<=(window.innerHeight||document.documentElement.clientHeight)&&r<=(window.innerWidth||document.documentElement.clientWidth))||S.scrollIntoView()}),[C,S]),a((function(){if(u){var e=A(0);R((function(n){return C?t({},e,!(null==n?void 0:n[e])):Object.assign(Object.assign({},n),t({},e,!(null==n?void 0:n[e])))}))}}),[u]),a((function(){var e;if(!u){var n=null===(e=i.Children.map(l,(function(e){if(h(e))return e})))||void 0===e?void 0:e.reduce((function(e,n,t){return void 0!==n.props.expanded&&(e[A(t)]=n.props.expanded),e}),{});R(Object.assign(Object.assign({},W),n))}}),[l]),i.createElement("ul",{className:X,ref:o,"data-testid":I,"data-analyticsid":d.ExpanderList},i.Children.map(l,(function(e,n){if(h(e)){var r=A(n),a=null==W?void 0:W[r],o=function(e){var n;return v(x["expander-list__item"],(t(n={},x["expander-list__item--top"],0===e&&w),t(n,x["expander-list__item--no-bottom"],e===V-1&&!H),n))}(n);return i.cloneElement(e,{id:r,key:n,expanded:a,padding:c,color:j,large:p,"aria-expanded":a,className:o,handleExpanderClick:function(e){return function(e,n){R((function(e){return C?t({},n,!(null==e?void 0:e[n])):Object.assign(Object.assign({},e),t({},n,!(null==e?void 0:e[n])))})),z(e.currentTarget)}(e,"".concat(U,"-").concat(n))},renderChildrenWhenClosed:g})}return e})))}));j.Expander=g,g.displayName="ExpanderList.Expander";export{j as ExpanderList,j as default};
1
+ import{_ as e,a as n,d as t}from"../../_rollupPluginBabelHelpers-0f007973.js";import i,{useState as r,useRef as a,useEffect as o}from"react";import{I as d}from"../../Icon-b0039bef.js";import{A as s,Z as l,I as c}from"../../constants-cd62f8dd.js";import{C as p}from"../../ChevronUp-1ed3fb8f.js";import{C as u}from"../../ChevronDown-3d01aa5d.js";import{u as m}from"../../useHover-18479690.js";import{u as f}from"../../usePrevious-ae293b10.js";import{u as v,B as x}from"../../useBreakpoint-a74f5af5.js";import{c as g}from"../../index-d1c0552c.js";import _ from"./styles.module.scss";import{u as h}from"../../useUuid-187c55e5.js";import{a as j}from"../../useSticky-f8ffc6d8.js";import"../../_tslib-b219470a.js";import"../../grid-c105cad1.js";import"../../uuid-11037462.js";import"../../debounce-fb23662f.js";var k=i.forwardRef((function(h,k){var E,b,C=h.id,y=h.children,w=h.padding,N=void 0===w||w,H=h.color,I=void 0===H?"neutral":H,O=h.className,W=void 0===O?"":O,B=h.icon,L=h.large,S=void 0!==L&&L,z=h.title,P=h.expanded,R=void 0!==P&&P,T=h.sticky,U=h.testId,V=h.handleExpanderClick,X=h.onExpand,A=h.renderChildrenWhenClosed,D=r(R),Z=e(D,2),q=Z[0],F=Z[1],G=f(q),J=a(null),K=a(null),M=m(K).isHovered,Q=v(),Y=j(J,K),$=Y.isOutsideWindow,ee=Y.isLeavingWindow,ne=Y.offsetHeight,te=Y.contentWidth,ie=T&&q&&$,re="object"===n(z),ae=g(W,t({},_["expander-list__item--jsx"],re)),oe=g(_["expander-list-link"],_["expander-list-link--".concat(I)],(t(E={},_["expander-list-link--closed"],!q),t(E,_["expander-list-link--large"],S),t(E,_["expander-list-link--jsx"],re),t(E,_["expander-list-link--sticky"],ie&&!ee),t(E,_["expander-list-link--absolute"],ie&&ee),E)),de=g(_["expander-list-link__title"],(t(b={},_["expander-list-link__title--string"],!re),t(b,_["expander-list-link__title--jsx"],re),b));o((function(){R!==q&&F(R)}),[R]),o((function(){X&&q!==!!G&&X(q)}),[q,X]);var se;return i.createElement("li",{className:ae,ref:(se=[k,J],function(e){se.forEach((function(n){"function"==typeof n?n(e):null!=n&&(n.current=e)}))}),style:{paddingTop:ie&&ne?"".concat(ne,"px"):void 0}},i.createElement("button",{type:"button",id:C,onClick:V,"data-testid":U,"data-analyticsid":s.ExpanderListExpander,className:oe,ref:K,"aria-expanded":q,style:{zIndex:M||ie?l.ExpanderTrigger:void 0,width:ie&&te?"".concat(te,"px"):void 0}},B&&i.createElement("span",{className:_["expander-list-link__icon"]},i.cloneElement(B,{size:Q===x.xs?c.XSmall:c.Small,isHovered:M})),i.createElement("span",{className:de},z),i.createElement("span",{className:_["expander-list-link__chevron"]},i.createElement(d,{size:c.XSmall,svgIcon:q?p:u,isHovered:M}))),function(){if(!A&&!q)return null;var e=g(_["expander-list-link__main-content"],q&&_["expander-list-link__main-content--expanded"],N?_["expander-list-link__main-content--padding"]:"");return i.createElement("div",{className:e},y)}())})),E=function(e){return i.isValidElement(e)&&e.type===k},b=i.forwardRef((function(n,a){var d=n.children,l=n.childPadding,c=void 0===l||l,p=n.large,u=n.isOpen,m=void 0!==u&&u,f=n.renderChildrenWhenClosed,v=void 0!==f&&f,x=n.color,j=n.className,k=void 0===j?"":j,b=n.accordion,C=void 0!==b&&b,y=n.topBorder,w=void 0===y||y,N=n.bottomBorder,H=void 0===N||N,I=n.sticky,O=void 0!==I&&I,W=n.testId,B=r(),L=e(B,2),S=L[0],z=L[1],P=r(),R=e(P,2),T=R[0],U=R[1],V=h(),X=i.Children.count(d),A=g(_["expander-list"],k);var D=function(e){return"".concat(V,"-").concat(e)};return o((function(){var e,n,t,i,r;!C||!T||(e=T.getBoundingClientRect(),n=e.top,t=e.left,i=e.bottom,r=e.right,n>=0&&t>=0&&i<=(window.innerHeight||document.documentElement.clientHeight)&&r<=(window.innerWidth||document.documentElement.clientWidth))||T.scrollIntoView()}),[C,T]),o((function(){if(m){var e=D(0);z((function(n){return C?t({},e,!(null==n?void 0:n[e])):Object.assign(Object.assign({},n),t({},e,!(null==n?void 0:n[e])))}))}}),[m]),o((function(){var e;if(!m){var n=null===(e=i.Children.map(d,(function(e){if(E(e))return e})))||void 0===e?void 0:e.reduce((function(e,n,t){return void 0!==n.props.expanded&&(e[D(t)]=n.props.expanded),e}),{});z(Object.assign(Object.assign({},S),n))}}),[d]),i.createElement("ul",{className:A,ref:a,"data-testid":W,"data-analyticsid":s.ExpanderList},i.Children.map(d,(function(e,n){if(E(e)){var r=D(n),a=null==S?void 0:S[r],o=function(e){var n;return g(_["expander-list__item"],(t(n={},_["expander-list__item--top"],0===e&&w),t(n,_["expander-list__item--no-bottom"],e===X-1&&!H),n))}(n);return i.cloneElement(e,{id:r,key:n,expanded:a,padding:c,color:x,large:p,sticky:O,"aria-expanded":a,className:o,handleExpanderClick:function(e){return function(e,n){z((function(e){return C?t({},n,!(null==e?void 0:e[n])):Object.assign(Object.assign({},e),t({},n,!(null==e?void 0:e[n])))})),U(e.currentTarget)}(e,"".concat(V,"-").concat(n))},renderChildrenWhenClosed:v})}return e})))}));b.Expander=k,k.displayName="ExpanderList.Expander";export{b as ExpanderList,b as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -12,6 +12,7 @@
12
12
  &__item {
13
13
  border: 0;
14
14
  border-bottom: 1px solid $neutral500;
15
+ position: relative;
15
16
 
16
17
  &--top {
17
18
  border-top: 1px solid $neutral500;
@@ -122,6 +123,15 @@
122
123
  }
123
124
  }
124
125
 
126
+ &--sticky {
127
+ position: fixed;
128
+ top: 0;
129
+ }
130
+ &--absolute {
131
+ position: absolute;
132
+ bottom: 0;
133
+ }
134
+
125
135
  &__title {
126
136
  color: $black;
127
137
  display: flex;
@@ -12,6 +12,7 @@ export type Styles = {
12
12
  'expander-list-link__title': string;
13
13
  'expander-list-link__title--jsx': string;
14
14
  'expander-list-link__title--string': string;
15
+ 'expander-list-link--absolute': string;
15
16
  'expander-list-link--banana': string;
16
17
  'expander-list-link--blueberry': string;
17
18
  'expander-list-link--cherry': string;
@@ -21,6 +22,7 @@ export type Styles = {
21
22
  'expander-list-link--large': string;
22
23
  'expander-list-link--neutral': string;
23
24
  'expander-list-link--plum': string;
25
+ 'expander-list-link--sticky': string;
24
26
  'expander-list-link--white': string;
25
27
  };
26
28
 
@@ -1,2 +1,2 @@
1
- import r,{createContext as e,useCallback as t,useRef as n,useState as i,useEffect as a,useMemo as u,isValidElement as o}from"react";import{V as s}from"../../Validation-842a5d4e.js";import{F as c}from"../../FormGroup-2d1fe7a1.js";import{C as l}from"../../Checkbox-2d678536.js";import{B as f}from"../../Button-15cf6cc9.js";import{R as d}from"../../RadioButton-086ba976.js";import{T as v}from"../../Textarea-2dae99aa.js";import{I as m}from"../../Input-c9637ae4.js";import{H as g}from"../../Hospital-96388194.js";import{F as p,a as y}from"../../FormLayout-55252dcd.js";import"../../index-d1c0552c.js";import"../Validation/styles.module.scss";import"../../constants-cd62f8dd.js";import"../../_rollupPluginBabelHelpers-0f007973.js";import"../FormGroup/styles.module.scss";import"../../Title-8a664c4e.js";import"../Title/styles.module.scss";import"../../uuid-11037462.js";import"../../Check-4ff5dbe8.js";import"../../Icon-2146c8a0.js";import"../../_tslib-b219470a.js";import"../../useUuid-3b1e73f2.js";import"../../color-e7d082c1.js";import"../../index-d1c9177a.js";import"../../palette-f206f488.js";import"../../grid-c105cad1.js";import"../Checkbox/styles.module.scss";import"../../Loader-55fc2157.js";import"../Loader/styles.module.scss";import"../../useHover-18479690.js";import"../../useBreakpoint-a74f5af5.js";import"../Button/styles.module.scss";import"../RadioButton/styles.module.scss";import"../Textarea/styles.module.scss";import"../Input/styles.module.scss";import"../FormLayout/styles.module.scss";var b=function(r){return r instanceof HTMLElement},h="blur",j="change",O="input",V="onBlur",k="onChange",E="onSubmit",A="onTouched",x="all",w="max",S="min",D="maxLength",F="minLength",R="pattern",C="required",N="validate";var B=function(r){return null==r},L=function(r){return"object"==typeof r},I=function(r){return!B(r)&&!Array.isArray(r)&&L(r)&&!(r instanceof Date)},T=function(r){return/^\w*$/.test(r)},q=function(r){return r.filter(Boolean)},M=function(r){return q(r.replace(/["|']/g,"").replace(/\[/g,".").replace(/\]/g,"").split("."))};function H(r,e,t){for(var n=-1,i=T(e)?[e]:M(e),a=i.length,u=a-1;++n<a;){var o=i[n],s=t;if(n!==u){var c=r[o];s=I(c)||Array.isArray(c)?c:isNaN(+i[n+1])?{}:[]}r[o]=s,r=r[o]}return r}var W=function(r,e){for(var t in void 0===e&&(e={}),r)T(t)?e[t]=r[t]:H(e,t,r[t]);return e},_=function(r){return void 0===r},P=function(r,e,t){void 0===r&&(r={});var n=q(e.split(/[,[\].]+?/)).reduce((function(r,e){return B(r)?r:r[e]}),r);return _(n)||n===r?_(r[e])?t:r[e]:n},U=function(r,e){b(r)&&r.removeEventListener&&(r.removeEventListener(O,e),r.removeEventListener(j,e),r.removeEventListener(h,e))},G={isValid:!1,value:null},$=function(r){return Array.isArray(r)?r.reduce((function(r,e){return e&&e.ref.checked?{isValid:!0,value:e.ref.value}:r}),G):G},z=function(r){return"radio"===r.type},J=function(r){return"file"===r.type},K=function(r){return"checkbox"===r.type},Q=function(r){return"select-multiple"===r.type},X={value:!1,isValid:!1},Y={value:!0,isValid:!0},Z=function(r){if(Array.isArray(r)){if(r.length>1){var e=r.filter((function(r){return r&&r.ref.checked})).map((function(r){return r.ref.value}));return{value:e,isValid:!!e.length}}var t=r[0].ref,n=t.checked,i=t.value,a=t.attributes;return n?a&&!_(a.value)?_(i)||""===i?Y:{value:i,isValid:!0}:Y:X}return X};function rr(r,e,t,n,i){var a,u=r.current[e];if(u){var o=u.ref,s=o.value,c=o.disabled,l=u.ref,f=u.valueAsNumber,d=u.valueAsDate,v=u.setValueAs;if(c&&n)return;return J(l)?l.files:z(l)?$(u.options).value:Q(l)?(a=l.options,[].concat(a).filter((function(r){return r.selected})).map((function(r){return r.value}))):K(l)?Z(u.options).value:i?s:f?""===s?NaN:+s:d?l.valueAsDate:v?v(s):s}if(t)return P(t.current,e)}function er(r){return!r||r instanceof HTMLElement&&r.nodeType!==Node.DOCUMENT_NODE&&er(r.parentNode)}var tr=function(r){return I(r)&&!Object.keys(r).length},nr=function(r){return"boolean"==typeof r};function ir(r,e){var t,n=T(e)?[e]:M(e),i=1==n.length?r:function(r,e){for(var t=e.slice(0,-1).length,n=0;n<t;)r=_(r)?n++:r[e[n++]];return r}(r,n),a=n[n.length-1];i&&delete i[a];for(var u=0;u<n.slice(0,-1).length;u++){var o=-1,s=void 0,c=n.slice(0,-(u+1)),l=c.length-1;for(u>0&&(t=r);++o<c.length;){var f=c[o];s=s?s[f]:r[f],l===o&&(I(s)&&tr(s)||Array.isArray(s)&&!s.filter((function(r){return I(r)&&!tr(r)||nr(r)})).length)&&(t?delete t[f]:delete r[f]),t=s}}return r}var ar=function(r,e){return r&&r.ref===e};var ur=function(r){return B(r)||!L(r)};function or(r,e){if(ur(r)||ur(e))return e;for(var t in e){var n=r[t],i=e[t];try{r[t]=I(n)&&I(i)||Array.isArray(n)&&Array.isArray(i)?or(n,i):i}catch(r){}}return r}function sr(r,e,t){if(ur(r)||ur(e)||r instanceof Date||e instanceof Date)return r===e;if(!o(r)){var n=Object.keys(r),i=Object.keys(e);if(n.length!==i.length)return!1;for(var a=0,u=n;a<u.length;a+=1){var s=u[a],c=r[s];if(!t||"ref"!==s){var l=e[s];if((I(c)||Array.isArray(c))&&(I(l)||Array.isArray(l))?!sr(c,l,t):c!==l)return!1}}}return!0}function cr(r,e,t,n,i){for(var a,u=-1;++u<r.length;){for(var o in r[u])Array.isArray(r[u][o])?(!t[u]&&(t[u]={}),t[u][o]=[],cr(r[u][o],P(e[u]||{},o,[]),t[u][o],t[u],o)):sr(P(e[u]||{},o),r[u][o])?H(t[u]||{},o):t[u]=Object.assign(Object.assign({},t[u]),((a={})[o]=!0,a));n&&!t.length&&delete n[i]}return t}var lr=function(r){return"string"==typeof r},fr=function(r,e,t,n,i){var a={},u=function(e){(_(i)||(lr(i)?e.startsWith(i):Array.isArray(i)&&i.find((function(r){return e.startsWith(r)}))))&&(a[e]=rr(r,e,void 0,n))};for(var o in r.current)u(o);return t?W(a):or(e,W(a))},dr=function(r){return r instanceof RegExp},vr=function(r){return I(r)&&!dr(r)?r:{value:r,message:""}},mr=function(r){return"function"==typeof r},gr=function(r){return lr(r)||o(r)};function pr(r,e,t){if(void 0===t&&(t="validate"),gr(r)||nr(r)&&!r)return{type:t,message:gr(r)?r:"",ref:e}}var yr=function(r,e,t,n,i){var a;return e?Object.assign(Object.assign({},t[r]),{types:Object.assign(Object.assign({},t[r]&&t[r].types?t[r].types:{}),(a={},a[n]=i||!0,a))}):{}},br=async function(r,e,t,n){var i=t.ref,a=t.ref.value,u=t.options,o=t.required,s=t.maxLength,c=t.minLength,l=t.min,f=t.max,d=t.pattern,v=t.validate,m=i.name,g={},p=z(i),y=K(i),b=p||y,h=""===a,j=yr.bind(null,m,e,g),O=function(r,e,t,n,a){void 0===n&&(n=D),void 0===a&&(a=F);var u=r?e:t;g[m]=Object.assign({type:r?n:a,message:u,ref:i},j(r?n:a,u))};if(o&&(!p&&!y&&(h||B(a))||nr(a)&&!a||y&&!Z(u).isValid||p&&!$(u).isValid)){var V=gr(o)?{value:!!o,message:o}:vr(o),k=V.value,E=V.message;if(k&&(g[m]=Object.assign({type:C,message:E,ref:b?((r.current[m].options||[])[0]||{}).ref:i},j(C,E)),!e))return g}if(!(B(l)&&B(f)||""===a)){var A,x,L=vr(f),T=vr(l);if(isNaN(a)){var q=i.valueAsDate||new Date(a);lr(L.value)&&(A=q>new Date(L.value)),lr(T.value)&&(x=q<new Date(T.value))}else{var M=i.valueAsNumber||parseFloat(a);B(L.value)||(A=M>L.value),B(T.value)||(x=M<T.value)}if((A||x)&&(O(!!A,L.message,T.message,w,S),!e))return g}if(lr(a)&&!h&&(s||c)){var H=vr(s),W=vr(c),_=!B(H.value)&&a.length>H.value,P=!B(W.value)&&a.length<W.value;if((_||P)&&(O(_,H.message,W.message),!e))return g}if(lr(a)&&d&&!h){var U=vr(d),G=U.value,J=U.message;if(dr(G)&&!G.test(a)&&(g[m]=Object.assign({type:R,message:J,ref:i},j(R,J)),!e))return g}if(v){var Q=rr(r,m,n,!1,!0),X=b&&u?u[0].ref:i;if(mr(v)){var Y=pr(await v(Q),X);if(Y&&(g[m]=Object.assign(Object.assign({},Y),j(N,Y.message)),!e))return g}else if(I(v)){for(var er={},ir=0,ar=Object.entries(v);ir<ar.length;ir+=1){var ur=ar[ir],or=ur[0],sr=ur[1];if(!tr(er)&&!e)break;var cr=pr(await sr(Q),X,or);cr&&(er=Object.assign(Object.assign({},cr),j(or,cr.message)),e&&(g[m]=er))}if(!tr(er)&&(g[m]=Object.assign({ref:X},er),!e))return g}}return g},hr=function(r,e,t){for(var n in void 0===t&&(t=[]),e){var i=r+(I(e)?"."+n:"["+n+"]");ur(e[n])?t.push(i):hr(i,e[n],t)}return t},jr=function(r,e,t,n,i){var a=void 0;return t.add(e),tr(r)||(a=P(r,e),(I(a)||Array.isArray(a))&&hr(e,a).forEach((function(r){return t.add(r)}))),_(a)?i?n:P(n,e):a},Or=function(r){return r.substring(0,r.indexOf("["))},Vr=function(r,e){return[].concat(r).some((function(r){return function(r,e){return RegExp(("^"+e+"([|.)\\d+").replace(/\[/g,"\\[").replace(/\]/g,"\\]")).test(r)}(e,r)}))};var kr="undefined"!=typeof window&&"undefined"!=typeof document;function Er(r){var e,t;if(ur(r)||kr&&(r instanceof File||b(r)))return r;if(!["Set","Map","Object","Date","Array"].includes(null===(e=r.constructor)||void 0===e?void 0:e.name))return r;if(r instanceof Date)return t=new Date(r.getTime());if(r instanceof Set){t=new Set;for(var n=0,i=r;n<i.length;n+=1){var a=i[n];t.add(a)}return t}if(r instanceof Map){t=new Map;for(var u=0,o=r.keys();u<o.length;u+=1){var s=o[u];t.set(s,Er(r.get(s)))}return t}for(var c in t=Array.isArray(r)?[]:{},r)t[c]=Er(r[c]);return t}var Ar,xr=function(r){return{isOnSubmit:!r||r===E,isOnBlur:r===V,isOnChange:r===k,isOnAll:r===x,isOnTouch:r===A}},wr=function(r){return z(r)||K(r)},Sr="undefined"==typeof window,Dr=kr?"Proxy"in window:"undefined"!=typeof Proxy;function Fr(r){void 0===r&&(r={});var e=r.mode;void 0===e&&(e=E);var o=r.reValidateMode;void 0===o&&(o=k);var s=r.resolver,c=r.context,l=r.defaultValues;void 0===l&&(l={});var f=r.shouldFocusError;void 0===f&&(f=!0);var d=r.shouldUnregister;void 0===d&&(d=!0);var v=r.criteriaMode,m=n({}),g=n({}),p=n({}),y=n(new Set),V=n({}),A=n({}),w=n({}),S=n({}),D=n(l),F=n(!1),R=n(!1),C=n(),N=n({}),L=n({}),M=n(c),G=n(s),$=n(new Set),X=n(xr(e)),Y=X.current,Z=Y.isOnSubmit,nr=Y.isOnTouch,dr=v===x,vr=i({isDirty:!1,isValidating:!1,dirtyFields:{},isSubmitted:!1,submitCount:0,touched:{},isSubmitting:!1,isSubmitSuccessful:!1,isValid:!Z,errors:{}}),gr=vr[0],pr=vr[1],yr=n({isDirty:!Dr,dirtyFields:!Dr,touched:!Dr||nr,isValidating:!Dr,isSubmitting:!Dr,isValid:!Dr}),Ar=n(gr),Fr=n(),Rr=n(xr(o)).current,Cr=Rr.isOnBlur,Nr=Rr.isOnChange;M.current=c,G.current=s,Ar.current=gr,N.current=d?{}:tr(N.current)?Er(l):N.current;var Br=t((function(r){void 0===r&&(r={}),F.current||(Ar.current=Object.assign(Object.assign({},Ar.current),r),pr(Ar.current))}),[]),Lr=function(){return yr.current.isValidating&&Br({isValidating:!0})},Ir=t((function(r,e,t,n,i){void 0===t&&(t=!1),void 0===n&&(n={});var a=t||function(r){var e=r.errors,t=r.name,n=r.error,i=r.validFields,a=r.fieldsWithValidation,u=_(n),o=P(e,t);return u&&!!o||!u&&!sr(o,n,!0)||u&&P(a,t)&&!P(i,t)}({errors:Ar.current.errors,error:e,name:r,validFields:S.current,fieldsWithValidation:w.current}),u=P(Ar.current.errors,r);e?(ir(S.current,r),a=a||!u||!sr(u,e,!0),H(Ar.current.errors,r,e)):((P(w.current,r)||G.current)&&(H(S.current,r,!0),a=a||u),ir(Ar.current.errors,r)),(a&&!B(t)||!tr(n)||yr.current.isValidating)&&Br(Object.assign(Object.assign(Object.assign({},n),G.current?{isValid:!!i}:{}),{isValidating:!1}))}),[]),Tr=t((function(r,e){var t=m.current[r],n=t.ref,i=t.options,a=kr&&b(n)&&B(e)?"":e;z(n)?(i||[]).forEach((function(r){var e=r.ref;return e.checked=e.value===a})):J(n)&&!lr(a)?n.files=a:Q(n)?[].concat(n.options).forEach((function(r){return r.selected=a.includes(r.value)})):K(n)&&i?i.length>1?i.forEach((function(r){var e=r.ref;return e.checked=Array.isArray(a)?!!a.find((function(r){return r===e.value})):a===e.value})):i[0].ref.checked=!!a:n.value=a}),[]),qr=t((function(r,e){if(yr.current.isDirty){var t=Jr();return r&&e&&H(t,r,e),!sr(t,D.current)}return!1}),[]),Mr=t((function(r,e){if(void 0===e&&(e=!0),yr.current.isDirty||yr.current.dirtyFields){var t=!sr(P(D.current,r),rr(m,r,N)),n=P(Ar.current.dirtyFields,r),i=Ar.current.isDirty;t?H(Ar.current.dirtyFields,r,!0):ir(Ar.current.dirtyFields,r);var a={isDirty:qr(),dirtyFields:Ar.current.dirtyFields},u=yr.current.isDirty&&i!==a.isDirty||yr.current.dirtyFields&&n!==P(Ar.current.dirtyFields,r);return u&&e&&Br(a),u?a:{}}return{}}),[]),Hr=t((async function(r,e){if("production"!==process.env.NODE_ENV&&!m.current[r])return console.warn("📋 Field is missing with `name` attribute: ",r),!1;var t=(await br(m,dr,m.current[r],N))[r];return Ir(r,t,e),_(t)}),[Ir,dr]),Wr=t((async function(r){var e=(await G.current(Jr(),M.current,dr)).errors,t=Ar.current.isValid;if(Array.isArray(r)){var n=r.map((function(r){var t=P(e,r);return t?H(Ar.current.errors,r,t):ir(Ar.current.errors,r),!t})).every(Boolean);return Br({isValid:tr(e),isValidating:!1}),n}var i=P(e,r);return Ir(r,i,t!==tr(e),{},tr(e)),!i}),[Ir,dr]),_r=t((async function(r){var e=r||Object.keys(m.current);if(Lr(),G.current)return Wr(e);if(Array.isArray(e)){!r&&(Ar.current.errors={});var t=await Promise.all(e.map((async function(r){return await Hr(r,null)})));return Br({isValidating:!1}),t.every(Boolean)}return await Hr(e)}),[Wr,Hr]),Pr=t((function(r,e,t){var n=t.shouldDirty,i=t.shouldValidate,a={};H(a,r,e);for(var u=0,o=hr(r,e);u<o.length;u+=1){var s=o[u];m.current[s]&&(Tr(s,P(a,s)),n&&Mr(s),i&&_r(s))}}),[_r,Tr,Mr]),Ur=t((function(r,e,t){var n,i;if(!d&&!ur(e)&&H(N.current,r,Array.isArray(e)?[].concat(e):Object.assign({},e)),m.current[r])Tr(r,e),t.shouldDirty&&Mr(r),t.shouldValidate&&_r(r);else if(!ur(e)&&(Pr(r,e,t),$.current.has(r))){var a=Or(r)||r;H(g.current,r,e),L.current[a](((n={})[a]=P(g.current,a),n)),(yr.current.isDirty||yr.current.dirtyFields)&&t.shouldDirty&&(H(Ar.current.dirtyFields,r,function(r,e,t){return or(cr(r,e,t.slice(0,r.length)),cr(e,r,t.slice(0,r.length)))}(e,P(D.current,r,[]),P(Ar.current.dirtyFields,r,[]))),Br({isDirty:!sr(Object.assign(Object.assign({},Jr()),(i={},i[r]=e,i)),D.current)}))}!d&&H(N.current,r,e)}),[Mr,Tr,Pr]),Gr=function(r){return R.current||y.current.has(r)||y.current.has((r.match(/\w+/)||[])[0])},$r=function(r){var e=!0;if(!tr(V.current))for(var t in V.current)r&&V.current[t].size&&!V.current[t].has(r)&&!V.current[t].has(Or(r))||(A.current[t](),e=!1);return e};function zr(r){var e;if(!d){for(var t=Er(r),n=0,i=$.current;n<i.length;n+=1){var a=i[n];T(a)&&!t[a]&&(t=Object.assign(Object.assign({},t),((e={})[a]=[],e)))}return t}return r}function Jr(r){if(lr(r))return rr(m,r,N);if(Array.isArray(r)){for(var e={},t=0,n=r;t<n.length;t+=1){var i=n[t];H(e,i,rr(m,i,N))}return e}return zr(fr(m,Er(N.current),d))}C.current=C.current?C.current:async function(r){var e,t,n=r.type,i=r.target,a=i.name,u=m.current[a];if(u){var o=n===h,s=function(r){var e=r.isOnBlur,t=r.isOnChange,n=r.isOnTouch,i=r.isTouched,a=r.isReValidateOnBlur,u=r.isReValidateOnChange,o=r.isBlurEvent,s=r.isSubmitted;return!r.isOnAll&&(!s&&n?!(i||o):(s?a:e)?!o:!(s?u:t)||o)}(Object.assign({isBlurEvent:o,isReValidateOnChange:Nr,isReValidateOnBlur:Cr,isTouched:!!P(Ar.current.touched,a),isSubmitted:Ar.current.isSubmitted},X.current)),c=Mr(a,!1),l=!tr(c)||!o&&Gr(a);if(o&&!P(Ar.current.touched,a)&&yr.current.touched&&(H(Ar.current.touched,a,!0),c=Object.assign(Object.assign({},c),{touched:Ar.current.touched})),!d&&K(i)&&H(N.current,a,rr(m,a)),s)return!o&&$r(a),(!tr(c)||l&&tr(c))&&Br(c);if(Lr(),G.current){var f=(await G.current(Jr(),M.current,dr)).errors,v=Ar.current.isValid;if(e=P(f,a),K(i)&&!e&&G.current){var g=Or(a),p=P(f,g,{});p.type&&p.message&&(e=p),g&&(p||P(Ar.current.errors,g))&&(a=g)}v!==(t=tr(f))&&(l=!0)}else e=(await br(m,dr,u,N))[a];!o&&$r(a),Ir(a,e,l,c,t)}};var Kr=t((async function(r){void 0===r&&(r={});var e=tr(m.current)?D.current:{},t=(await G.current(Object.assign(Object.assign(Object.assign({},e),Jr()),r),M.current,dr)||{}).errors,n=tr(t);Ar.current.isValid!==n&&Br({isValid:n})}),[dr]),Qr=t((function(r,e){!function(r,e,t,n,i,a){var u=t.ref,o=t.ref.name,s=r.current[o];if(!i){var c=rr(r,o,n);!_(c)&&H(n.current,o,c)}u.type&&s?z(u)||K(u)?Array.isArray(s.options)&&s.options.length?(q(s.options).forEach((function(r,t){void 0===r&&(r={}),(er(r.ref)&&ar(r,r.ref)||a)&&(U(r.ref,e),ir(s.options,"["+t+"]"))})),s.options&&!q(s.options).length&&delete r.current[o]):delete r.current[o]:(er(u)&&ar(s,u)||a)&&(U(u,e),delete r.current[o]):delete r.current[o]}(m,C.current,r,N,d,e),d&&(ir(S.current,r.ref.name),ir(w.current,r.ref.name))}),[d]),Xr=t((function(r){if(R.current)Br();else{for(var e=0,t=y.current;e<t.length;e+=1){if(t[e].startsWith(r)){Br();break}}$r(r)}}),[]),Yr=t((function(r,e){r&&(Qr(r,e),d&&!q(r.options||[]).length&&(ir(Ar.current.errors,r.ref.name),H(Ar.current.dirtyFields,r.ref.name,!0),Br({isDirty:qr()}),yr.current.isValid&&G.current&&Kr(),Xr(r.ref.name)))}),[Kr,Qr]);var Zr=t((function(r,e,t){var n=t?V.current[t]:y.current,i=fr(m,Er(N.current),d,!1,r);if(lr(r)){var a=Or(r)||r;return $.current.has(a)&&(i=Object.assign(Object.assign({},p.current),i)),jr(i,r,n,_(P(D.current,r))?e:P(D.current,r),!0)}var u=_(e)?D.current:e;return Array.isArray(r)?r.reduce((function(r,e){var t;return Object.assign(Object.assign({},r),((t={})[e]=jr(i,e,n,u),t))}),{}):(R.current=_(t),W(!tr(i)&&i||u))}),[]);function re(r,e){if(void 0===e&&(e={}),"production"!==process.env.NODE_ENV){if(!r.name)return console.warn("📋 Field is missing `name` attribute",r,"https://react-hook-form.com/api#useForm");if($.current.has(r.name.split(/\[\d+\]$/)[0])&&!RegExp(("^"+r.name.split(/\[\d+\]$/)[0]+"[\\d+].\\w+").replace(/\[/g,"\\[").replace(/\]/g,"\\]")).test(r.name))return console.warn('📋 `name` prop should be in object shape: name="test[index].name"',r,"https://react-hook-form.com/api#useFieldArray")}var t,n=r.name,i=r.type,a=r.value,u=Object.assign({ref:r},e),o=m.current,s=wr(r),c=Vr($.current,n),l=function(e){return kr&&(!b(r)||e===r)},f=o[n],v=!0;if(f&&(s?Array.isArray(f.options)&&q(f.options).find((function(r){return a===r.ref.value&&l(r.ref)})):l(f.ref)))o[n]=Object.assign(Object.assign({},f),e);else{f=i?s?Object.assign({options:q(f&&f.options||[]).concat([{ref:r}]),ref:{type:i,name:n}},e):Object.assign({},u):u,o[n]=f;var g=_(P(N.current,n));tr(D.current)&&g||(t=P(g?D.current:N.current,n),(v=_(t))||c||Tr(n,t)),tr(e)||(H(w.current,n,!0),!Z&&yr.current.isValid&&br(m,dr,f,N).then((function(r){var e=Ar.current.isValid;tr(r)?H(S.current,n,!0):ir(S.current,n),e!==tr(r)&&Br()}))),!d||c&&v||!c&&ir(Ar.current.dirtyFields,n),i&&function(r,e,t){var n=r.ref;b(n)&&t&&(n.addEventListener(e?j:O,t),n.addEventListener(h,t))}(s&&f.options?f.options[f.options.length-1]:f,s||"select-one"===r.type,C.current)}}var ee=t((function(r,e){return async function(t){t&&t.preventDefault&&(t.preventDefault(),t.persist());var n={},i=zr(fr(m,Er(N.current),d,!0));yr.current.isSubmitting&&Br({isSubmitting:!0});try{if(G.current){var a=await G.current(i,M.current,dr),u=a.errors,o=a.values;Ar.current.errors=n=u,i=o}else for(var s=0,c=Object.values(m.current);s<c.length;s+=1){var l=c[s];if(l){var v=l.ref.name,g=await br(m,dr,l,N);g[v]?(H(n,v,g[v]),ir(S.current,v)):P(w.current,v)&&(ir(Ar.current.errors,v),H(S.current,v,!0))}}tr(n)&&Object.keys(Ar.current.errors).every((function(r){return r in m.current}))?(Br({errors:{},isSubmitting:!0}),await r(i,t)):(Ar.current.errors=Object.assign(Object.assign({},Ar.current.errors),n),e&&await e(Ar.current.errors,t),f&&function(r,e){for(var t in r)if(P(e,t)){var n=r[t];if(n){if(n.ref.focus&&_(n.ref.focus()))break;if(n.options){n.options[0].ref.focus();break}}}}(m.current,Ar.current.errors))}finally{Ar.current.isSubmitting=!1,Br({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:tr(Ar.current.errors),submitCount:Ar.current.submitCount+1})}}}),[f,dr]);a((function(){s&&yr.current.isValid&&Kr(),Fr.current=Fr.current||!kr?Fr.current:function(r,e){var t=new MutationObserver((function(){for(var t=0,n=Object.values(r.current);t<n.length;t+=1){var i=n[t];if(i&&i.options)for(var a=0,u=i.options;a<u.length;a+=1){var o=u[a];o&&o.ref&&er(o.ref)&&e(i)}else i&&er(i.ref)&&e(i)}}));return t.observe(window.document,{childList:!0,subtree:!0}),t}(m,Yr)}),[Yr,D.current]),a((function(){return function(){Fr.current&&Fr.current.disconnect(),F.current=!0,"production"===process.env.NODE_ENV&&Object.values(m.current).forEach((function(r){return Yr(r,!0)}))}}),[]),!s&&yr.current.isValid&&(gr.isValid=sr(S.current,w.current)&&tr(Ar.current.errors));var te={trigger:_r,setValue:t((function(r,e,t){Ur(r,e,t||{}),Gr(r)&&Br(),$r(r)}),[Ur,_r]),getValues:t(Jr,[]),register:t((function(r,e){if(!Sr)if(lr(r))re({name:r},e);else{if(!I(r)||!("name"in r))return function(e){return e&&re(e,r)};re(r,e)}}),[D.current]),unregister:t((function(r){for(var e=0,t=Array.isArray(r)?r:[r];e<t.length;e+=1){var n=t[e];Yr(m.current[n],!0)}}),[]),formState:Dr?new Proxy(gr,{get:function(r,e){if("production"!==process.env.NODE_ENV&&"isValid"===e&&Z&&console.warn("📋 `formState.isValid` is applicable with `onTouched`, `onChange` or `onBlur` mode. https://react-hook-form.com/api#formState"),e in r)return yr.current[e]=!0,r[e]}}):gr},ne=u((function(){return Object.assign({isFormDirty:qr,updateWatchedValue:Xr,shouldUnregister:d,updateFormState:Br,removeFieldEventListener:Qr,watchInternal:Zr,mode:X.current,reValidateMode:{isReValidateOnBlur:Cr,isReValidateOnChange:Nr},validateResolver:s?Kr:void 0,fieldsRef:m,resetFieldArrayFunctionRef:L,useWatchFieldsRef:V,useWatchRenderFunctionsRef:A,fieldArrayDefaultValuesRef:g,validFieldsRef:S,fieldsWithValidationRef:w,fieldArrayNamesRef:$,readFormStateRef:yr,formStateRef:Ar,defaultValuesRef:D,shallowFieldsStateRef:N,fieldArrayValuesRef:p},te)}),[D.current,Xr,d,Qr,Zr]);return Object.assign({watch:function(r,e){return Zr(r,e)},control:ne,handleSubmit:ee,reset:t((function(r,e){if(void 0===e&&(e={}),kr)for(var t=0,n=Object.values(m.current);t<n.length;t+=1){var i=n[t];if(i){var a=i.ref,u=i.options,o=wr(a)&&Array.isArray(u)?u[0].ref:a;if(b(o))try{o.closest("form").reset();break}catch(r){}}}m.current={},D.current=Object.assign({},r||D.current),r&&$r(""),Object.values(L.current).forEach((function(r){return mr(r)&&r()})),N.current=d?{}:Er(r||D.current),function(r){var e=r.errors,t=r.isDirty,n=r.isSubmitted,i=r.touched,a=r.isValid,u=r.submitCount,o=r.dirtyFields;a||(S.current={},w.current={}),g.current={},y.current=new Set,R.current=!1,Br({submitCount:u?Ar.current.submitCount:0,isDirty:!!t&&Ar.current.isDirty,isSubmitted:!!n&&Ar.current.isSubmitted,isValid:!!a&&Ar.current.isValid,dirtyFields:o?Ar.current.dirtyFields:{},touched:i?Ar.current.touched:{},errors:e?Ar.current.errors:{},isSubmitting:!1,isSubmitSuccessful:!1})}(e)}),[]),clearErrors:t((function(r){r&&(Array.isArray(r)?r:[r]).forEach((function(r){return m.current[r]&&T(r)?delete Ar.current.errors[r]:ir(Ar.current.errors,r)})),Br({errors:r?Ar.current.errors:{}})}),[]),setError:t((function(r,e){var t=(m.current[r]||{}).ref;H(Ar.current.errors,r,Object.assign(Object.assign({},e),{ref:t})),Br({isValid:!1}),e.shouldFocus&&t&&t.focus&&t.focus()}),[]),errors:gr.errors},te)}e(null).displayName="RHFContext",function(r){r.formgroup="formgroup",r.checkbox="checkbox",r.radiobutton="radiobutton",r.textarea="textarea",r.input="input"}(Ar||(Ar={}));var Rr=function(e){var t=e.exampleType,n=void 0===t?Ar.formgroup:t,i=Fr(),a=i.register,u=i.handleSubmit,o=i.errors,b="formgroup1",h="formgroup2",j="formgroup3",O="formgroup4",V="formgroup5",k=o.formgroup1||o.formgroup2||o.formgroup3||o.formgroup4||o.formgroup5,E="Du må velge et alternativ",A="Det kan ikke legges inn mer enn 40 tegn",x="Du må skrive noe her",w=[r.createElement(l,{key:0,inputId:"checkbox1",label:"Checkbox 1",ref:a({required:E})}),r.createElement(l,{key:1,inputId:"checkbox2",label:"Checkbox 2",ref:a({required:E})}),r.createElement(l,{key:2,inputId:"checkbox3",label:"Checkbox 3",ref:a({required:E})})],S=function(r){return r.length>=2||"Du må velge to alternativ"};return r.createElement("form",{onSubmit:u((function(r){console.log(r)}))},r.createElement(s,{variant:e.variant,errorSummary:k?"Sjekk at alt er riktig utfylt":void 0},n===Ar.formgroup?[r.createElement(c,{key:0,title:"Gruppe tittel",legend:"Velg minst en",error:o.formgroup1?o.formgroup1.message:void 0,variant:e.variant,name:b},r.createElement(p,{maxColumns:y.two},w.map((function(r){return r})))),r.createElement(c,{key:1,legend:"Velg minst to",error:o.formgroup2?o.formgroup2.message:void 0,variant:e.variant,name:h},r.createElement(l,{inputId:"checkbox4",label:"Checkbox 4",ref:a({validate:S})}),r.createElement(l,{inputId:"checkbox5",label:"Checkbox 5",ref:a({validate:S})}),r.createElement(l,{inputId:"checkbox6",label:"Checkbox 6",ref:a({validate:S})})),r.createElement(c,{key:2,legend:"Velg en",error:o.formgroup3?o.formgroup3.message:void 0,variant:e.variant,name:j},r.createElement(d,{inputId:"radiobutton1",label:"Radiobutton 1",ref:a({required:E})}),r.createElement(d,{inputId:"radiobutton2",label:"Radiobutton 2",ref:a({required:E})}),r.createElement(d,{inputId:"radiobutton3",label:"Radiobutton 3",ref:a({required:E})})),r.createElement(c,{key:3,error:o.formgroup4?o.formgroup4.message:void 0},r.createElement(v,{defaultValue:"Dette er en test \n\n Hello \n\n test \n\n test test",grow:!0,maxCharacters:40,minRows:5,label:"Skriv din historie her",textareaId:"textarea1",name:O,ref:a({maxLength:{value:40,message:A}})})),r.createElement(c,{name:V,key:4,variant:e.variant,error:o.formgroup5?o.formgroup5.message:void 0},r.createElement(m,{label:"Skriv inn din tekst",placeholder:"Skriv noe!",icon:g,ref:a({required:x})}))]:n===Ar.checkbox?r.createElement(c,{name:b,error:o.formgroup1?o.formgroup1.message:void 0},r.createElement(l,{name:b,inputId:"checkbox1",label:"Checkbox 1",error:o.formgroup1,variant:e.variant,ref:a({required:E})})):n===Ar.radiobutton?r.createElement(c,{name:j,error:o.formgroup3?o.formgroup3.message:void 0},r.createElement(d,{name:j,inputId:"radiobutton1",label:"Radiobutton 1",error:o.formgroup3,variant:e.variant,ref:a({required:E})})):n===Ar.textarea?r.createElement(c,{error:o.formgroup4?o.formgroup4.message:void 0},r.createElement(v,{defaultValue:"Dette er min historie \n\n Hello \n\n test",grow:!0,maxCharacters:40,minRows:5,label:"Skriv din historie her",textareaId:"textarea1",name:O,ref:a({maxLength:{value:40,message:A}})})):n===Ar.input?r.createElement(c,{name:V,key:4,variant:e.variant,error:o.formgroup5?o.formgroup5.message:void 0},r.createElement(m,{inputId:"input1",label:"Skriv inn din tekst",placeholder:"Skriv noe!",icon:g,ref:a({required:x})})):void 0),r.createElement(f,{type:"submit"},"Send inn"))};export{Rr as FormExample,Ar as FormExampleVariants,Rr as default};
1
+ import r,{createContext as e,useCallback as t,useRef as n,useState as i,useEffect as a,useMemo as u,isValidElement as o}from"react";import{V as s}from"../../Validation-e96418a9.js";import{F as c}from"../../FormGroup-5f9a5195.js";import{C as l}from"../../Checkbox-2ed9547d.js";import{B as f}from"../../Button-61d349a0.js";import{R as d}from"../../RadioButton-086ba976.js";import{T as v}from"../../Textarea-eac02cd5.js";import{I as m}from"../../Input-ce2b32bf.js";import{H as g}from"../../Hospital-464037d0.js";import{F as p,a as b}from"../../FormLayout-55252dcd.js";import"../../index-d1c0552c.js";import"../Validation/styles.module.scss";import"../../constants-cd62f8dd.js";import"../../_rollupPluginBabelHelpers-0f007973.js";import"../FormGroup/styles.module.scss";import"../../Title-8a664c4e.js";import"../Title/styles.module.scss";import"../../uuid-11037462.js";import"../../Check-3e3f92b1.js";import"../../Icon-b0039bef.js";import"../../_tslib-b219470a.js";import"../../useUuid-187c55e5.js";import"../../color-e7d082c1.js";import"../../index-d1c9177a.js";import"../../palette-f206f488.js";import"../../grid-c105cad1.js";import"../Checkbox/styles.module.scss";import"../../Loader-55fc2157.js";import"../Loader/styles.module.scss";import"../../useHover-18479690.js";import"../../useBreakpoint-a74f5af5.js";import"../Button/styles.module.scss";import"../RadioButton/styles.module.scss";import"../Textarea/styles.module.scss";import"../Input/styles.module.scss";import"../FormLayout/styles.module.scss";var y=function(r){return r instanceof HTMLElement},h="blur",j="change",O="input",V="onBlur",k="onChange",E="onSubmit",A="onTouched",x="all",w="max",S="min",D="maxLength",F="minLength",R="pattern",C="required",N="validate";var B=function(r){return null==r},L=function(r){return"object"==typeof r},I=function(r){return!B(r)&&!Array.isArray(r)&&L(r)&&!(r instanceof Date)},T=function(r){return/^\w*$/.test(r)},q=function(r){return r.filter(Boolean)},M=function(r){return q(r.replace(/["|']/g,"").replace(/\[/g,".").replace(/\]/g,"").split("."))};function H(r,e,t){for(var n=-1,i=T(e)?[e]:M(e),a=i.length,u=a-1;++n<a;){var o=i[n],s=t;if(n!==u){var c=r[o];s=I(c)||Array.isArray(c)?c:isNaN(+i[n+1])?{}:[]}r[o]=s,r=r[o]}return r}var W=function(r,e){for(var t in void 0===e&&(e={}),r)T(t)?e[t]=r[t]:H(e,t,r[t]);return e},_=function(r){return void 0===r},P=function(r,e,t){void 0===r&&(r={});var n=q(e.split(/[,[\].]+?/)).reduce((function(r,e){return B(r)?r:r[e]}),r);return _(n)||n===r?_(r[e])?t:r[e]:n},U=function(r,e){y(r)&&r.removeEventListener&&(r.removeEventListener(O,e),r.removeEventListener(j,e),r.removeEventListener(h,e))},G={isValid:!1,value:null},$=function(r){return Array.isArray(r)?r.reduce((function(r,e){return e&&e.ref.checked?{isValid:!0,value:e.ref.value}:r}),G):G},z=function(r){return"radio"===r.type},J=function(r){return"file"===r.type},K=function(r){return"checkbox"===r.type},Q=function(r){return"select-multiple"===r.type},X={value:!1,isValid:!1},Y={value:!0,isValid:!0},Z=function(r){if(Array.isArray(r)){if(r.length>1){var e=r.filter((function(r){return r&&r.ref.checked})).map((function(r){return r.ref.value}));return{value:e,isValid:!!e.length}}var t=r[0].ref,n=t.checked,i=t.value,a=t.attributes;return n?a&&!_(a.value)?_(i)||""===i?Y:{value:i,isValid:!0}:Y:X}return X};function rr(r,e,t,n,i){var a,u=r.current[e];if(u){var o=u.ref,s=o.value,c=o.disabled,l=u.ref,f=u.valueAsNumber,d=u.valueAsDate,v=u.setValueAs;if(c&&n)return;return J(l)?l.files:z(l)?$(u.options).value:Q(l)?(a=l.options,[].concat(a).filter((function(r){return r.selected})).map((function(r){return r.value}))):K(l)?Z(u.options).value:i?s:f?""===s?NaN:+s:d?l.valueAsDate:v?v(s):s}if(t)return P(t.current,e)}function er(r){return!r||r instanceof HTMLElement&&r.nodeType!==Node.DOCUMENT_NODE&&er(r.parentNode)}var tr=function(r){return I(r)&&!Object.keys(r).length},nr=function(r){return"boolean"==typeof r};function ir(r,e){var t,n=T(e)?[e]:M(e),i=1==n.length?r:function(r,e){for(var t=e.slice(0,-1).length,n=0;n<t;)r=_(r)?n++:r[e[n++]];return r}(r,n),a=n[n.length-1];i&&delete i[a];for(var u=0;u<n.slice(0,-1).length;u++){var o=-1,s=void 0,c=n.slice(0,-(u+1)),l=c.length-1;for(u>0&&(t=r);++o<c.length;){var f=c[o];s=s?s[f]:r[f],l===o&&(I(s)&&tr(s)||Array.isArray(s)&&!s.filter((function(r){return I(r)&&!tr(r)||nr(r)})).length)&&(t?delete t[f]:delete r[f]),t=s}}return r}var ar=function(r,e){return r&&r.ref===e};var ur=function(r){return B(r)||!L(r)};function or(r,e){if(ur(r)||ur(e))return e;for(var t in e){var n=r[t],i=e[t];try{r[t]=I(n)&&I(i)||Array.isArray(n)&&Array.isArray(i)?or(n,i):i}catch(r){}}return r}function sr(r,e,t){if(ur(r)||ur(e)||r instanceof Date||e instanceof Date)return r===e;if(!o(r)){var n=Object.keys(r),i=Object.keys(e);if(n.length!==i.length)return!1;for(var a=0,u=n;a<u.length;a+=1){var s=u[a],c=r[s];if(!t||"ref"!==s){var l=e[s];if((I(c)||Array.isArray(c))&&(I(l)||Array.isArray(l))?!sr(c,l,t):c!==l)return!1}}}return!0}function cr(r,e,t,n,i){for(var a,u=-1;++u<r.length;){for(var o in r[u])Array.isArray(r[u][o])?(!t[u]&&(t[u]={}),t[u][o]=[],cr(r[u][o],P(e[u]||{},o,[]),t[u][o],t[u],o)):sr(P(e[u]||{},o),r[u][o])?H(t[u]||{},o):t[u]=Object.assign(Object.assign({},t[u]),((a={})[o]=!0,a));n&&!t.length&&delete n[i]}return t}var lr=function(r){return"string"==typeof r},fr=function(r,e,t,n,i){var a={},u=function(e){(_(i)||(lr(i)?e.startsWith(i):Array.isArray(i)&&i.find((function(r){return e.startsWith(r)}))))&&(a[e]=rr(r,e,void 0,n))};for(var o in r.current)u(o);return t?W(a):or(e,W(a))},dr=function(r){return r instanceof RegExp},vr=function(r){return I(r)&&!dr(r)?r:{value:r,message:""}},mr=function(r){return"function"==typeof r},gr=function(r){return lr(r)||o(r)};function pr(r,e,t){if(void 0===t&&(t="validate"),gr(r)||nr(r)&&!r)return{type:t,message:gr(r)?r:"",ref:e}}var br=function(r,e,t,n,i){var a;return e?Object.assign(Object.assign({},t[r]),{types:Object.assign(Object.assign({},t[r]&&t[r].types?t[r].types:{}),(a={},a[n]=i||!0,a))}):{}},yr=async function(r,e,t,n){var i=t.ref,a=t.ref.value,u=t.options,o=t.required,s=t.maxLength,c=t.minLength,l=t.min,f=t.max,d=t.pattern,v=t.validate,m=i.name,g={},p=z(i),b=K(i),y=p||b,h=""===a,j=br.bind(null,m,e,g),O=function(r,e,t,n,a){void 0===n&&(n=D),void 0===a&&(a=F);var u=r?e:t;g[m]=Object.assign({type:r?n:a,message:u,ref:i},j(r?n:a,u))};if(o&&(!p&&!b&&(h||B(a))||nr(a)&&!a||b&&!Z(u).isValid||p&&!$(u).isValid)){var V=gr(o)?{value:!!o,message:o}:vr(o),k=V.value,E=V.message;if(k&&(g[m]=Object.assign({type:C,message:E,ref:y?((r.current[m].options||[])[0]||{}).ref:i},j(C,E)),!e))return g}if(!(B(l)&&B(f)||""===a)){var A,x,L=vr(f),T=vr(l);if(isNaN(a)){var q=i.valueAsDate||new Date(a);lr(L.value)&&(A=q>new Date(L.value)),lr(T.value)&&(x=q<new Date(T.value))}else{var M=i.valueAsNumber||parseFloat(a);B(L.value)||(A=M>L.value),B(T.value)||(x=M<T.value)}if((A||x)&&(O(!!A,L.message,T.message,w,S),!e))return g}if(lr(a)&&!h&&(s||c)){var H=vr(s),W=vr(c),_=!B(H.value)&&a.length>H.value,P=!B(W.value)&&a.length<W.value;if((_||P)&&(O(_,H.message,W.message),!e))return g}if(lr(a)&&d&&!h){var U=vr(d),G=U.value,J=U.message;if(dr(G)&&!G.test(a)&&(g[m]=Object.assign({type:R,message:J,ref:i},j(R,J)),!e))return g}if(v){var Q=rr(r,m,n,!1,!0),X=y&&u?u[0].ref:i;if(mr(v)){var Y=pr(await v(Q),X);if(Y&&(g[m]=Object.assign(Object.assign({},Y),j(N,Y.message)),!e))return g}else if(I(v)){for(var er={},ir=0,ar=Object.entries(v);ir<ar.length;ir+=1){var ur=ar[ir],or=ur[0],sr=ur[1];if(!tr(er)&&!e)break;var cr=pr(await sr(Q),X,or);cr&&(er=Object.assign(Object.assign({},cr),j(or,cr.message)),e&&(g[m]=er))}if(!tr(er)&&(g[m]=Object.assign({ref:X},er),!e))return g}}return g},hr=function(r,e,t){for(var n in void 0===t&&(t=[]),e){var i=r+(I(e)?"."+n:"["+n+"]");ur(e[n])?t.push(i):hr(i,e[n],t)}return t},jr=function(r,e,t,n,i){var a=void 0;return t.add(e),tr(r)||(a=P(r,e),(I(a)||Array.isArray(a))&&hr(e,a).forEach((function(r){return t.add(r)}))),_(a)?i?n:P(n,e):a},Or=function(r){return r.substring(0,r.indexOf("["))},Vr=function(r,e){return[].concat(r).some((function(r){return function(r,e){return RegExp(("^"+e+"([|.)\\d+").replace(/\[/g,"\\[").replace(/\]/g,"\\]")).test(r)}(e,r)}))};var kr="undefined"!=typeof window&&"undefined"!=typeof document;function Er(r){var e,t;if(ur(r)||kr&&(r instanceof File||y(r)))return r;if(!["Set","Map","Object","Date","Array"].includes(null===(e=r.constructor)||void 0===e?void 0:e.name))return r;if(r instanceof Date)return t=new Date(r.getTime());if(r instanceof Set){t=new Set;for(var n=0,i=r;n<i.length;n+=1){var a=i[n];t.add(a)}return t}if(r instanceof Map){t=new Map;for(var u=0,o=r.keys();u<o.length;u+=1){var s=o[u];t.set(s,Er(r.get(s)))}return t}for(var c in t=Array.isArray(r)?[]:{},r)t[c]=Er(r[c]);return t}var Ar,xr=function(r){return{isOnSubmit:!r||r===E,isOnBlur:r===V,isOnChange:r===k,isOnAll:r===x,isOnTouch:r===A}},wr=function(r){return z(r)||K(r)},Sr="undefined"==typeof window,Dr=kr?"Proxy"in window:"undefined"!=typeof Proxy;function Fr(r){void 0===r&&(r={});var e=r.mode;void 0===e&&(e=E);var o=r.reValidateMode;void 0===o&&(o=k);var s=r.resolver,c=r.context,l=r.defaultValues;void 0===l&&(l={});var f=r.shouldFocusError;void 0===f&&(f=!0);var d=r.shouldUnregister;void 0===d&&(d=!0);var v=r.criteriaMode,m=n({}),g=n({}),p=n({}),b=n(new Set),V=n({}),A=n({}),w=n({}),S=n({}),D=n(l),F=n(!1),R=n(!1),C=n(),N=n({}),L=n({}),M=n(c),G=n(s),$=n(new Set),X=n(xr(e)),Y=X.current,Z=Y.isOnSubmit,nr=Y.isOnTouch,dr=v===x,vr=i({isDirty:!1,isValidating:!1,dirtyFields:{},isSubmitted:!1,submitCount:0,touched:{},isSubmitting:!1,isSubmitSuccessful:!1,isValid:!Z,errors:{}}),gr=vr[0],pr=vr[1],br=n({isDirty:!Dr,dirtyFields:!Dr,touched:!Dr||nr,isValidating:!Dr,isSubmitting:!Dr,isValid:!Dr}),Ar=n(gr),Fr=n(),Rr=n(xr(o)).current,Cr=Rr.isOnBlur,Nr=Rr.isOnChange;M.current=c,G.current=s,Ar.current=gr,N.current=d?{}:tr(N.current)?Er(l):N.current;var Br=t((function(r){void 0===r&&(r={}),F.current||(Ar.current=Object.assign(Object.assign({},Ar.current),r),pr(Ar.current))}),[]),Lr=function(){return br.current.isValidating&&Br({isValidating:!0})},Ir=t((function(r,e,t,n,i){void 0===t&&(t=!1),void 0===n&&(n={});var a=t||function(r){var e=r.errors,t=r.name,n=r.error,i=r.validFields,a=r.fieldsWithValidation,u=_(n),o=P(e,t);return u&&!!o||!u&&!sr(o,n,!0)||u&&P(a,t)&&!P(i,t)}({errors:Ar.current.errors,error:e,name:r,validFields:S.current,fieldsWithValidation:w.current}),u=P(Ar.current.errors,r);e?(ir(S.current,r),a=a||!u||!sr(u,e,!0),H(Ar.current.errors,r,e)):((P(w.current,r)||G.current)&&(H(S.current,r,!0),a=a||u),ir(Ar.current.errors,r)),(a&&!B(t)||!tr(n)||br.current.isValidating)&&Br(Object.assign(Object.assign(Object.assign({},n),G.current?{isValid:!!i}:{}),{isValidating:!1}))}),[]),Tr=t((function(r,e){var t=m.current[r],n=t.ref,i=t.options,a=kr&&y(n)&&B(e)?"":e;z(n)?(i||[]).forEach((function(r){var e=r.ref;return e.checked=e.value===a})):J(n)&&!lr(a)?n.files=a:Q(n)?[].concat(n.options).forEach((function(r){return r.selected=a.includes(r.value)})):K(n)&&i?i.length>1?i.forEach((function(r){var e=r.ref;return e.checked=Array.isArray(a)?!!a.find((function(r){return r===e.value})):a===e.value})):i[0].ref.checked=!!a:n.value=a}),[]),qr=t((function(r,e){if(br.current.isDirty){var t=Jr();return r&&e&&H(t,r,e),!sr(t,D.current)}return!1}),[]),Mr=t((function(r,e){if(void 0===e&&(e=!0),br.current.isDirty||br.current.dirtyFields){var t=!sr(P(D.current,r),rr(m,r,N)),n=P(Ar.current.dirtyFields,r),i=Ar.current.isDirty;t?H(Ar.current.dirtyFields,r,!0):ir(Ar.current.dirtyFields,r);var a={isDirty:qr(),dirtyFields:Ar.current.dirtyFields},u=br.current.isDirty&&i!==a.isDirty||br.current.dirtyFields&&n!==P(Ar.current.dirtyFields,r);return u&&e&&Br(a),u?a:{}}return{}}),[]),Hr=t((async function(r,e){if("production"!==process.env.NODE_ENV&&!m.current[r])return console.warn("📋 Field is missing with `name` attribute: ",r),!1;var t=(await yr(m,dr,m.current[r],N))[r];return Ir(r,t,e),_(t)}),[Ir,dr]),Wr=t((async function(r){var e=(await G.current(Jr(),M.current,dr)).errors,t=Ar.current.isValid;if(Array.isArray(r)){var n=r.map((function(r){var t=P(e,r);return t?H(Ar.current.errors,r,t):ir(Ar.current.errors,r),!t})).every(Boolean);return Br({isValid:tr(e),isValidating:!1}),n}var i=P(e,r);return Ir(r,i,t!==tr(e),{},tr(e)),!i}),[Ir,dr]),_r=t((async function(r){var e=r||Object.keys(m.current);if(Lr(),G.current)return Wr(e);if(Array.isArray(e)){!r&&(Ar.current.errors={});var t=await Promise.all(e.map((async function(r){return await Hr(r,null)})));return Br({isValidating:!1}),t.every(Boolean)}return await Hr(e)}),[Wr,Hr]),Pr=t((function(r,e,t){var n=t.shouldDirty,i=t.shouldValidate,a={};H(a,r,e);for(var u=0,o=hr(r,e);u<o.length;u+=1){var s=o[u];m.current[s]&&(Tr(s,P(a,s)),n&&Mr(s),i&&_r(s))}}),[_r,Tr,Mr]),Ur=t((function(r,e,t){var n,i;if(!d&&!ur(e)&&H(N.current,r,Array.isArray(e)?[].concat(e):Object.assign({},e)),m.current[r])Tr(r,e),t.shouldDirty&&Mr(r),t.shouldValidate&&_r(r);else if(!ur(e)&&(Pr(r,e,t),$.current.has(r))){var a=Or(r)||r;H(g.current,r,e),L.current[a](((n={})[a]=P(g.current,a),n)),(br.current.isDirty||br.current.dirtyFields)&&t.shouldDirty&&(H(Ar.current.dirtyFields,r,function(r,e,t){return or(cr(r,e,t.slice(0,r.length)),cr(e,r,t.slice(0,r.length)))}(e,P(D.current,r,[]),P(Ar.current.dirtyFields,r,[]))),Br({isDirty:!sr(Object.assign(Object.assign({},Jr()),(i={},i[r]=e,i)),D.current)}))}!d&&H(N.current,r,e)}),[Mr,Tr,Pr]),Gr=function(r){return R.current||b.current.has(r)||b.current.has((r.match(/\w+/)||[])[0])},$r=function(r){var e=!0;if(!tr(V.current))for(var t in V.current)r&&V.current[t].size&&!V.current[t].has(r)&&!V.current[t].has(Or(r))||(A.current[t](),e=!1);return e};function zr(r){var e;if(!d){for(var t=Er(r),n=0,i=$.current;n<i.length;n+=1){var a=i[n];T(a)&&!t[a]&&(t=Object.assign(Object.assign({},t),((e={})[a]=[],e)))}return t}return r}function Jr(r){if(lr(r))return rr(m,r,N);if(Array.isArray(r)){for(var e={},t=0,n=r;t<n.length;t+=1){var i=n[t];H(e,i,rr(m,i,N))}return e}return zr(fr(m,Er(N.current),d))}C.current=C.current?C.current:async function(r){var e,t,n=r.type,i=r.target,a=i.name,u=m.current[a];if(u){var o=n===h,s=function(r){var e=r.isOnBlur,t=r.isOnChange,n=r.isOnTouch,i=r.isTouched,a=r.isReValidateOnBlur,u=r.isReValidateOnChange,o=r.isBlurEvent,s=r.isSubmitted;return!r.isOnAll&&(!s&&n?!(i||o):(s?a:e)?!o:!(s?u:t)||o)}(Object.assign({isBlurEvent:o,isReValidateOnChange:Nr,isReValidateOnBlur:Cr,isTouched:!!P(Ar.current.touched,a),isSubmitted:Ar.current.isSubmitted},X.current)),c=Mr(a,!1),l=!tr(c)||!o&&Gr(a);if(o&&!P(Ar.current.touched,a)&&br.current.touched&&(H(Ar.current.touched,a,!0),c=Object.assign(Object.assign({},c),{touched:Ar.current.touched})),!d&&K(i)&&H(N.current,a,rr(m,a)),s)return!o&&$r(a),(!tr(c)||l&&tr(c))&&Br(c);if(Lr(),G.current){var f=(await G.current(Jr(),M.current,dr)).errors,v=Ar.current.isValid;if(e=P(f,a),K(i)&&!e&&G.current){var g=Or(a),p=P(f,g,{});p.type&&p.message&&(e=p),g&&(p||P(Ar.current.errors,g))&&(a=g)}v!==(t=tr(f))&&(l=!0)}else e=(await yr(m,dr,u,N))[a];!o&&$r(a),Ir(a,e,l,c,t)}};var Kr=t((async function(r){void 0===r&&(r={});var e=tr(m.current)?D.current:{},t=(await G.current(Object.assign(Object.assign(Object.assign({},e),Jr()),r),M.current,dr)||{}).errors,n=tr(t);Ar.current.isValid!==n&&Br({isValid:n})}),[dr]),Qr=t((function(r,e){!function(r,e,t,n,i,a){var u=t.ref,o=t.ref.name,s=r.current[o];if(!i){var c=rr(r,o,n);!_(c)&&H(n.current,o,c)}u.type&&s?z(u)||K(u)?Array.isArray(s.options)&&s.options.length?(q(s.options).forEach((function(r,t){void 0===r&&(r={}),(er(r.ref)&&ar(r,r.ref)||a)&&(U(r.ref,e),ir(s.options,"["+t+"]"))})),s.options&&!q(s.options).length&&delete r.current[o]):delete r.current[o]:(er(u)&&ar(s,u)||a)&&(U(u,e),delete r.current[o]):delete r.current[o]}(m,C.current,r,N,d,e),d&&(ir(S.current,r.ref.name),ir(w.current,r.ref.name))}),[d]),Xr=t((function(r){if(R.current)Br();else{for(var e=0,t=b.current;e<t.length;e+=1){if(t[e].startsWith(r)){Br();break}}$r(r)}}),[]),Yr=t((function(r,e){r&&(Qr(r,e),d&&!q(r.options||[]).length&&(ir(Ar.current.errors,r.ref.name),H(Ar.current.dirtyFields,r.ref.name,!0),Br({isDirty:qr()}),br.current.isValid&&G.current&&Kr(),Xr(r.ref.name)))}),[Kr,Qr]);var Zr=t((function(r,e,t){var n=t?V.current[t]:b.current,i=fr(m,Er(N.current),d,!1,r);if(lr(r)){var a=Or(r)||r;return $.current.has(a)&&(i=Object.assign(Object.assign({},p.current),i)),jr(i,r,n,_(P(D.current,r))?e:P(D.current,r),!0)}var u=_(e)?D.current:e;return Array.isArray(r)?r.reduce((function(r,e){var t;return Object.assign(Object.assign({},r),((t={})[e]=jr(i,e,n,u),t))}),{}):(R.current=_(t),W(!tr(i)&&i||u))}),[]);function re(r,e){if(void 0===e&&(e={}),"production"!==process.env.NODE_ENV){if(!r.name)return console.warn("📋 Field is missing `name` attribute",r,"https://react-hook-form.com/api#useForm");if($.current.has(r.name.split(/\[\d+\]$/)[0])&&!RegExp(("^"+r.name.split(/\[\d+\]$/)[0]+"[\\d+].\\w+").replace(/\[/g,"\\[").replace(/\]/g,"\\]")).test(r.name))return console.warn('📋 `name` prop should be in object shape: name="test[index].name"',r,"https://react-hook-form.com/api#useFieldArray")}var t,n=r.name,i=r.type,a=r.value,u=Object.assign({ref:r},e),o=m.current,s=wr(r),c=Vr($.current,n),l=function(e){return kr&&(!y(r)||e===r)},f=o[n],v=!0;if(f&&(s?Array.isArray(f.options)&&q(f.options).find((function(r){return a===r.ref.value&&l(r.ref)})):l(f.ref)))o[n]=Object.assign(Object.assign({},f),e);else{f=i?s?Object.assign({options:q(f&&f.options||[]).concat([{ref:r}]),ref:{type:i,name:n}},e):Object.assign({},u):u,o[n]=f;var g=_(P(N.current,n));tr(D.current)&&g||(t=P(g?D.current:N.current,n),(v=_(t))||c||Tr(n,t)),tr(e)||(H(w.current,n,!0),!Z&&br.current.isValid&&yr(m,dr,f,N).then((function(r){var e=Ar.current.isValid;tr(r)?H(S.current,n,!0):ir(S.current,n),e!==tr(r)&&Br()}))),!d||c&&v||!c&&ir(Ar.current.dirtyFields,n),i&&function(r,e,t){var n=r.ref;y(n)&&t&&(n.addEventListener(e?j:O,t),n.addEventListener(h,t))}(s&&f.options?f.options[f.options.length-1]:f,s||"select-one"===r.type,C.current)}}var ee=t((function(r,e){return async function(t){t&&t.preventDefault&&(t.preventDefault(),t.persist());var n={},i=zr(fr(m,Er(N.current),d,!0));br.current.isSubmitting&&Br({isSubmitting:!0});try{if(G.current){var a=await G.current(i,M.current,dr),u=a.errors,o=a.values;Ar.current.errors=n=u,i=o}else for(var s=0,c=Object.values(m.current);s<c.length;s+=1){var l=c[s];if(l){var v=l.ref.name,g=await yr(m,dr,l,N);g[v]?(H(n,v,g[v]),ir(S.current,v)):P(w.current,v)&&(ir(Ar.current.errors,v),H(S.current,v,!0))}}tr(n)&&Object.keys(Ar.current.errors).every((function(r){return r in m.current}))?(Br({errors:{},isSubmitting:!0}),await r(i,t)):(Ar.current.errors=Object.assign(Object.assign({},Ar.current.errors),n),e&&await e(Ar.current.errors,t),f&&function(r,e){for(var t in r)if(P(e,t)){var n=r[t];if(n){if(n.ref.focus&&_(n.ref.focus()))break;if(n.options){n.options[0].ref.focus();break}}}}(m.current,Ar.current.errors))}finally{Ar.current.isSubmitting=!1,Br({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:tr(Ar.current.errors),submitCount:Ar.current.submitCount+1})}}}),[f,dr]);a((function(){s&&br.current.isValid&&Kr(),Fr.current=Fr.current||!kr?Fr.current:function(r,e){var t=new MutationObserver((function(){for(var t=0,n=Object.values(r.current);t<n.length;t+=1){var i=n[t];if(i&&i.options)for(var a=0,u=i.options;a<u.length;a+=1){var o=u[a];o&&o.ref&&er(o.ref)&&e(i)}else i&&er(i.ref)&&e(i)}}));return t.observe(window.document,{childList:!0,subtree:!0}),t}(m,Yr)}),[Yr,D.current]),a((function(){return function(){Fr.current&&Fr.current.disconnect(),F.current=!0,"production"===process.env.NODE_ENV&&Object.values(m.current).forEach((function(r){return Yr(r,!0)}))}}),[]),!s&&br.current.isValid&&(gr.isValid=sr(S.current,w.current)&&tr(Ar.current.errors));var te={trigger:_r,setValue:t((function(r,e,t){Ur(r,e,t||{}),Gr(r)&&Br(),$r(r)}),[Ur,_r]),getValues:t(Jr,[]),register:t((function(r,e){if(!Sr)if(lr(r))re({name:r},e);else{if(!I(r)||!("name"in r))return function(e){return e&&re(e,r)};re(r,e)}}),[D.current]),unregister:t((function(r){for(var e=0,t=Array.isArray(r)?r:[r];e<t.length;e+=1){var n=t[e];Yr(m.current[n],!0)}}),[]),formState:Dr?new Proxy(gr,{get:function(r,e){if("production"!==process.env.NODE_ENV&&"isValid"===e&&Z&&console.warn("📋 `formState.isValid` is applicable with `onTouched`, `onChange` or `onBlur` mode. https://react-hook-form.com/api#formState"),e in r)return br.current[e]=!0,r[e]}}):gr},ne=u((function(){return Object.assign({isFormDirty:qr,updateWatchedValue:Xr,shouldUnregister:d,updateFormState:Br,removeFieldEventListener:Qr,watchInternal:Zr,mode:X.current,reValidateMode:{isReValidateOnBlur:Cr,isReValidateOnChange:Nr},validateResolver:s?Kr:void 0,fieldsRef:m,resetFieldArrayFunctionRef:L,useWatchFieldsRef:V,useWatchRenderFunctionsRef:A,fieldArrayDefaultValuesRef:g,validFieldsRef:S,fieldsWithValidationRef:w,fieldArrayNamesRef:$,readFormStateRef:br,formStateRef:Ar,defaultValuesRef:D,shallowFieldsStateRef:N,fieldArrayValuesRef:p},te)}),[D.current,Xr,d,Qr,Zr]);return Object.assign({watch:function(r,e){return Zr(r,e)},control:ne,handleSubmit:ee,reset:t((function(r,e){if(void 0===e&&(e={}),kr)for(var t=0,n=Object.values(m.current);t<n.length;t+=1){var i=n[t];if(i){var a=i.ref,u=i.options,o=wr(a)&&Array.isArray(u)?u[0].ref:a;if(y(o))try{o.closest("form").reset();break}catch(r){}}}m.current={},D.current=Object.assign({},r||D.current),r&&$r(""),Object.values(L.current).forEach((function(r){return mr(r)&&r()})),N.current=d?{}:Er(r||D.current),function(r){var e=r.errors,t=r.isDirty,n=r.isSubmitted,i=r.touched,a=r.isValid,u=r.submitCount,o=r.dirtyFields;a||(S.current={},w.current={}),g.current={},b.current=new Set,R.current=!1,Br({submitCount:u?Ar.current.submitCount:0,isDirty:!!t&&Ar.current.isDirty,isSubmitted:!!n&&Ar.current.isSubmitted,isValid:!!a&&Ar.current.isValid,dirtyFields:o?Ar.current.dirtyFields:{},touched:i?Ar.current.touched:{},errors:e?Ar.current.errors:{},isSubmitting:!1,isSubmitSuccessful:!1})}(e)}),[]),clearErrors:t((function(r){r&&(Array.isArray(r)?r:[r]).forEach((function(r){return m.current[r]&&T(r)?delete Ar.current.errors[r]:ir(Ar.current.errors,r)})),Br({errors:r?Ar.current.errors:{}})}),[]),setError:t((function(r,e){var t=(m.current[r]||{}).ref;H(Ar.current.errors,r,Object.assign(Object.assign({},e),{ref:t})),Br({isValid:!1}),e.shouldFocus&&t&&t.focus&&t.focus()}),[]),errors:gr.errors},te)}e(null).displayName="RHFContext",function(r){r.formgroup="formgroup",r.checkbox="checkbox",r.radiobutton="radiobutton",r.textarea="textarea",r.input="input"}(Ar||(Ar={}));var Rr=function(e){var t=e.exampleType,n=void 0===t?Ar.formgroup:t,i=Fr(),a=i.register,u=i.handleSubmit,o=i.errors,y="formgroup1",h="formgroup2",j="formgroup3",O="formgroup4",V="formgroup5",k=o.formgroup1||o.formgroup2||o.formgroup3||o.formgroup4||o.formgroup5,E="Du må velge et alternativ",A="Det kan ikke legges inn mer enn 40 tegn",x="Du må skrive noe her",w=[r.createElement(l,{key:0,inputId:"checkbox1",label:"Checkbox 1",ref:a({required:E})}),r.createElement(l,{key:1,inputId:"checkbox2",label:"Checkbox 2",ref:a({required:E})}),r.createElement(l,{key:2,inputId:"checkbox3",label:"Checkbox 3",ref:a({required:E})})],S=function(r){return r.length>=2||"Du må velge to alternativ"};return r.createElement("form",{onSubmit:u((function(r){console.log(r)}))},r.createElement(s,{variant:e.variant,errorSummary:k?"Sjekk at alt er riktig utfylt":void 0},n===Ar.formgroup?[r.createElement(c,{key:0,title:"Gruppe tittel",legend:"Velg minst en",error:o.formgroup1?o.formgroup1.message:void 0,variant:e.variant,name:y},r.createElement(p,{maxColumns:b.two},w.map((function(r){return r})))),r.createElement(c,{key:1,legend:"Velg minst to",error:o.formgroup2?o.formgroup2.message:void 0,variant:e.variant,name:h},r.createElement(l,{inputId:"checkbox4",label:"Checkbox 4",ref:a({validate:S})}),r.createElement(l,{inputId:"checkbox5",label:"Checkbox 5",ref:a({validate:S})}),r.createElement(l,{inputId:"checkbox6",label:"Checkbox 6",ref:a({validate:S})})),r.createElement(c,{key:2,legend:"Velg en",error:o.formgroup3?o.formgroup3.message:void 0,variant:e.variant,name:j},r.createElement(d,{inputId:"radiobutton1",label:"Radiobutton 1",ref:a({required:E})}),r.createElement(d,{inputId:"radiobutton2",label:"Radiobutton 2",ref:a({required:E})}),r.createElement(d,{inputId:"radiobutton3",label:"Radiobutton 3",ref:a({required:E})})),r.createElement(c,{key:3,error:o.formgroup4?o.formgroup4.message:void 0},r.createElement(v,{defaultValue:"Dette er en test \n\n Hello \n\n test \n\n test test",grow:!0,maxCharacters:40,minRows:5,label:"Skriv din historie her",textareaId:"textarea1",name:O,ref:a({maxLength:{value:40,message:A}})})),r.createElement(c,{name:V,key:4,variant:e.variant,error:o.formgroup5?o.formgroup5.message:void 0},r.createElement(m,{label:"Skriv inn din tekst",placeholder:"Skriv noe!",icon:g,ref:a({required:x})}))]:n===Ar.checkbox?r.createElement(c,{name:y,error:o.formgroup1?o.formgroup1.message:void 0},r.createElement(l,{name:y,inputId:"checkbox1",label:"Checkbox 1",error:o.formgroup1,variant:e.variant,ref:a({required:E})})):n===Ar.radiobutton?r.createElement(c,{name:j,error:o.formgroup3?o.formgroup3.message:void 0},r.createElement(d,{name:j,inputId:"radiobutton1",label:"Radiobutton 1",error:o.formgroup3,variant:e.variant,ref:a({required:E})})):n===Ar.textarea?r.createElement(c,{error:o.formgroup4?o.formgroup4.message:void 0},r.createElement(v,{defaultValue:"Dette er min historie \n\n Hello \n\n test",grow:!0,maxCharacters:40,minRows:5,label:"Skriv din historie her",textareaId:"textarea1",name:O,ref:a({maxLength:{value:40,message:A}})})):n===Ar.input?r.createElement(c,{name:V,key:4,variant:e.variant,error:o.formgroup5?o.formgroup5.message:void 0},r.createElement(m,{inputId:"input1",label:"Skriv inn din tekst",placeholder:"Skriv noe!",icon:g,ref:a({required:x})})):void 0),r.createElement(f,{type:"submit"},"Send inn"))};export{Rr as FormExample,Ar as FormExampleVariants,Rr as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FormGroup.d.ts","sourceRoot":"","sources":["../../../src/components/FormGroup/FormGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAe,QAAQ,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAMrE,oBAAY,aAAa,GAAG,UAAU,GAAG,KAAK,CAAC;AAE/C,MAAM,WAAW,cAAc;IAC7B,iCAAiC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oDAAoD;IACpD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,uCAAuC;IACvC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2CAA2C;IAC3C,IAAI,CAAC,EAAE,MAAM,OAAO,QAAQ,CAAC;IAC7B,2CAA2C;IAC3C,OAAO,CAAC,EAAE,MAAM,OAAO,WAAW,CAAC;IACnC,oBAAoB;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iDAAiD;IACjD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uCAAuC;IACvC,UAAU,CAAC,EAAE,aAAa,CAAC;CAC5B;AAED,eAAO,MAAM,SAAS,uFAqFpB,CAAC;AAEH,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"FormGroup.d.ts","sourceRoot":"","sources":["../../../src/components/FormGroup/FormGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAe,QAAQ,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAMrE,oBAAY,aAAa,GAAG,UAAU,GAAG,KAAK,CAAC;AAE/C,MAAM,WAAW,cAAc;IAC7B,iCAAiC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oDAAoD;IACpD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,uCAAuC;IACvC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2CAA2C;IAC3C,IAAI,CAAC,EAAE,MAAM,OAAO,QAAQ,CAAC;IAC7B,2CAA2C;IAC3C,OAAO,CAAC,EAAE,MAAM,OAAO,WAAW,CAAC;IACnC,oBAAoB;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iDAAiD;IACjD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uCAAuC;IACvC,UAAU,CAAC,EAAE,aAAa,CAAC;CAC5B;AAED,eAAO,MAAM,SAAS,uFAyFpB,CAAC;AAEH,eAAe,SAAS,CAAC"}
@@ -1,2 +1,2 @@
1
- export{F as FormGroup,F as default}from"../../FormGroup-2d1fe7a1.js";import"../../_rollupPluginBabelHelpers-0f007973.js";import"react";import"../../index-d1c0552c.js";import"./styles.module.scss";import"../../Checkbox-2d678536.js";import"../../uuid-11037462.js";import"../../Check-4ff5dbe8.js";import"../../Icon-2146c8a0.js";import"../../_tslib-b219470a.js";import"../../constants-cd62f8dd.js";import"../../useUuid-3b1e73f2.js";import"../../color-e7d082c1.js";import"../../index-d1c9177a.js";import"../../palette-f206f488.js";import"../../grid-c105cad1.js";import"../Checkbox/styles.module.scss";import"../../RadioButton-086ba976.js";import"../RadioButton/styles.module.scss";import"../../Input-c9637ae4.js";import"../../useBreakpoint-a74f5af5.js";import"../Input/styles.module.scss";import"../../Title-8a664c4e.js";import"../Title/styles.module.scss";import"../../FormLayout-55252dcd.js";import"../FormLayout/styles.module.scss";
1
+ export{F as FormGroup,F as default}from"../../FormGroup-5f9a5195.js";import"../../_rollupPluginBabelHelpers-0f007973.js";import"react";import"../../index-d1c0552c.js";import"./styles.module.scss";import"../../Checkbox-2ed9547d.js";import"../../uuid-11037462.js";import"../../Check-3e3f92b1.js";import"../../Icon-b0039bef.js";import"../../_tslib-b219470a.js";import"../../constants-cd62f8dd.js";import"../../useUuid-187c55e5.js";import"../../color-e7d082c1.js";import"../../index-d1c9177a.js";import"../../palette-f206f488.js";import"../../grid-c105cad1.js";import"../Checkbox/styles.module.scss";import"../../RadioButton-086ba976.js";import"../RadioButton/styles.module.scss";import"../../Input-ce2b32bf.js";import"../../useBreakpoint-a74f5af5.js";import"../Input/styles.module.scss";import"../../Title-8a664c4e.js";import"../Title/styles.module.scss";import"../../FormLayout-55252dcd.js";import"../FormLayout/styles.module.scss";
2
2
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- export{a as HelpBubbleVariant,H as default}from"../../HelpBubble-9c8f6161.js";import"../../_rollupPluginBabelHelpers-0f007973.js";import"../../index-d1c0552c.js";import"react";import"../../constants-cd62f8dd.js";import"../../AnchorLink-b55324d8.js";import"../../Icon-2146c8a0.js";import"../../_tslib-b219470a.js";import"../../useUuid-3b1e73f2.js";import"../../uuid-11037462.js";import"../../ArrowUpRight-ea4dab8b.js";import"../../color-e7d082c1.js";import"../../index-d1c9177a.js";import"../../palette-f206f488.js";import"../../grid-c105cad1.js";import"../../useHover-18479690.js";import"../AnchorLink/styles.module.scss";import"../../Close-53f0e814.js";import"../../X-a44ae29d.js";import"../Close/styles.module.scss";import"../../useBreakpoint-a74f5af5.js";import"./styles.module.scss";
1
+ export{a as HelpBubbleVariant,H as default}from"../../HelpBubble-e987089a.js";import"../../_rollupPluginBabelHelpers-0f007973.js";import"../../index-d1c0552c.js";import"react";import"../../constants-cd62f8dd.js";import"../../AnchorLink-fd609d98.js";import"../../Icon-b0039bef.js";import"../../_tslib-b219470a.js";import"../../useUuid-187c55e5.js";import"../../uuid-11037462.js";import"../../ArrowUpRight-516d81f4.js";import"../../color-e7d082c1.js";import"../../index-d1c9177a.js";import"../../palette-f206f488.js";import"../../grid-c105cad1.js";import"../../useHover-18479690.js";import"../AnchorLink/styles.module.scss";import"../../Close-e6e01a80.js";import"../../X-3ef80a67.js";import"../Close/styles.module.scss";import"../../useBreakpoint-a74f5af5.js";import"./styles.module.scss";
2
2
  //# sourceMappingURL=index.js.map