@helsenorge/designsystem-react 1.0.0-beta92 → 1.0.0-beta94

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 (98) hide show
  1. package/{Button-2be46c88.js → Button-72f96290.js} +2 -2
  2. package/Button-72f96290.js.map +1 -0
  3. package/{FormGroup-9555dd73.js → FormGroup-68288be3.js} +2 -2
  4. package/FormGroup-68288be3.js.map +1 -0
  5. package/Loader-b3fd59f4.js +2 -0
  6. package/Loader-b3fd59f4.js.map +1 -0
  7. package/Modal-6b4a2c9c.js +2 -0
  8. package/Modal-6b4a2c9c.js.map +1 -0
  9. package/Title-90910763.js +2 -0
  10. package/Title-90910763.js.map +1 -0
  11. package/{Validation-1236e8ef.js → Validation-ef9ee0ae.js} +2 -2
  12. package/Validation-ef9ee0ae.js.map +1 -0
  13. package/components/AnchorLink/index.d.ts +1 -0
  14. package/components/AnchorLink/index.d.ts.map +1 -1
  15. package/components/Avatar/index.d.ts +1 -0
  16. package/components/Avatar/index.d.ts.map +1 -1
  17. package/components/Badge/index.d.ts +1 -0
  18. package/components/Badge/index.d.ts.map +1 -1
  19. package/components/Button/index.d.ts +1 -0
  20. package/components/Button/index.d.ts.map +1 -1
  21. package/components/Button/index.js +1 -1
  22. package/components/ButtonWithModal/index.d.ts +1 -0
  23. package/components/ButtonWithModal/index.d.ts.map +1 -1
  24. package/components/ButtonWithModal/index.js +1 -1
  25. package/components/Checkbox/index.d.ts +1 -0
  26. package/components/Checkbox/index.d.ts.map +1 -1
  27. package/components/Checkbox/index.js +1 -1
  28. package/components/Close/index.d.ts +1 -0
  29. package/components/Close/index.d.ts.map +1 -1
  30. package/components/ExpanderList/index.d.ts +1 -0
  31. package/components/ExpanderList/index.d.ts.map +1 -1
  32. package/components/ExpanderList/index.js +1 -1
  33. package/components/FormExample/index.d.ts +1 -0
  34. package/components/FormExample/index.d.ts.map +1 -1
  35. package/components/FormExample/index.js +1 -1
  36. package/components/FormGroup/index.d.ts +1 -0
  37. package/components/FormGroup/index.d.ts.map +1 -1
  38. package/components/FormGroup/index.js +1 -1
  39. package/components/HighlightBox/HighlightBox.d.ts +24 -0
  40. package/components/HighlightBox/HighlightBox.d.ts.map +1 -0
  41. package/components/HighlightBox/componentdata.json +484 -0
  42. package/components/HighlightBox/index.d.ts +4 -0
  43. package/components/HighlightBox/index.d.ts.map +1 -0
  44. package/components/HighlightBox/index.js +2 -0
  45. package/components/HighlightBox/index.js.map +1 -0
  46. package/components/HighlightBox/styles.module.scss +89 -0
  47. package/components/Icons/Icon.js +1 -1
  48. package/components/LinkList/index.d.ts +1 -0
  49. package/components/LinkList/index.d.ts.map +1 -1
  50. package/components/LinkList/index.js +1 -1
  51. package/components/List/index.d.ts +1 -0
  52. package/components/List/index.d.ts.map +1 -1
  53. package/components/Loader/Loader.d.ts +2 -2
  54. package/components/Loader/componentdata.json +3 -3
  55. package/components/Loader/index.d.ts +1 -0
  56. package/components/Loader/index.d.ts.map +1 -1
  57. package/components/Loader/index.js +1 -1
  58. package/components/Logo/index.d.ts +1 -0
  59. package/components/Logo/index.d.ts.map +1 -1
  60. package/components/Modal/index.d.ts +1 -0
  61. package/components/Modal/index.d.ts.map +1 -1
  62. package/components/Modal/index.js +1 -1
  63. package/components/NotificationPanel/index.d.ts +1 -0
  64. package/components/NotificationPanel/index.d.ts.map +1 -1
  65. package/components/NotificationPanel/index.js +1 -1
  66. package/components/RadioButton/index.d.ts +1 -0
  67. package/components/RadioButton/index.d.ts.map +1 -1
  68. package/components/RadioButton/index.js +1 -1
  69. package/components/Slider/index.d.ts +1 -0
  70. package/components/Slider/index.d.ts.map +1 -1
  71. package/components/Slider/index.js +1 -1
  72. package/components/Spacer/index.d.ts +1 -0
  73. package/components/Spacer/index.d.ts.map +1 -1
  74. package/components/Textarea/index.d.ts +1 -0
  75. package/components/Textarea/index.d.ts.map +1 -1
  76. package/components/Tile/index.d.ts +1 -0
  77. package/components/Tile/index.d.ts.map +1 -1
  78. package/components/Tile/index.js +1 -1
  79. package/components/Title/index.d.ts +1 -0
  80. package/components/Title/index.d.ts.map +1 -1
  81. package/components/Title/index.js +1 -1
  82. package/components/Validation/index.d.ts +1 -0
  83. package/components/Validation/index.d.ts.map +1 -1
  84. package/components/Validation/index.js +1 -1
  85. package/index.d.ts +1 -0
  86. package/index.d.ts.map +1 -1
  87. package/index.js +1 -1
  88. package/package.json +1 -1
  89. package/scss/_title.scss +16 -12
  90. package/Button-2be46c88.js.map +0 -1
  91. package/FormGroup-9555dd73.js.map +0 -1
  92. package/Loader-3589bdb1.js +0 -2
  93. package/Loader-3589bdb1.js.map +0 -1
  94. package/Modal-b68c7a72.js +0 -2
  95. package/Modal-b68c7a72.js.map +0 -1
  96. package/Title-72851d51.js +0 -2
  97. package/Title-72851d51.js.map +0 -1
  98. package/Validation-1236e8ef.js.map +0 -1
@@ -1,2 +1,2 @@
1
- import{_ as t,a as e}from"./_rollupPluginBabelHelpers-d0752906.js";import{_ as n}from"./_tslib-51c8a283.js";import o from"react";import{g as r}from"./color-acb834c6.js";import"./Icon-9b4a8a2d.js";import{I as l}from"./constants-a4b0b501.js";import{L as i}from"./Loader-3589bdb1.js";import{u as a}from"./useHover-037be19d.js";import{u as s}from"./useWindowSize-73b47451.js";import{b as u}from"./grid-11a70eb7.js";import{c as d}from"./index-9b84fabc.js";import c from"./components/Button/styles.module.scss";var b={primary:"blueberry",warning:"banana",danger:"cherry"};var m=function(t,e){return e&&e<u.md&&t?l.Small:t?l.Medium:l.XSmall},f=o.forwardRef((function(u,f){var p,v,_,g=u.children,h=u.className,j=void 0===h?"":h,w=u.fluid,E=void 0!==w&&w,k=u.intent,y=void 0===k?"primary":k,N=u.inverted,I=void 0!==N&&N,C=u.htmlMarkup,H=void 0===C?"button":C,O=u.onClick,S=u.large,z=void 0!==S&&S,B=u.loading,F=void 0!==B&&B,M=u.variant,x=void 0===M?"fill":M,L=u.disabled,R=void 0!==L&&L,X=u.ellipsis,A=void 0!==X&&X,P=u.testId,W=u.href,q=u.target,D=n(u,["children","className","fluid","intent","inverted","htmlMarkup","onClick","large","loading","variant","disabled","ellipsis","testId","href","target"]),G=function(t){var e,n,o,r,l=null,i=null;void 0!==(null===(n=null===(e=t[0])||void 0===e?void 0:e.props)||void 0===n?void 0:n.svgIcon)&&(l=t.shift()),void 0!==(null===(r=null===(o=t[t.length-1])||void 0===o?void 0:o.props)||void 0===r?void 0:r.svgIcon)&&(i=t.pop());var a=t.filter((function(t){return t}));return[l,i,a.length>0?a:null]}(o.Children.toArray(g)),J=t(G,3),K=J[0],Q=J[1],T=J[2],U=a(f),V=U.hoverRef,Y=U.isHovered,Z=function(t,e,n,o,l){return e?r("neutral",600):t&&!o||!t&&o?"white":r(b[n],l?700:600)}("fill"===x,R,y,I,Y),$=s(),tt="fill"===x,et="outline"===x,nt="borderless"===x,ot="warning"===y,rt="danger"===y,lt=!(!K&&!Q||F),it=Object.assign({},D),at=d(c.button,(e(p={},c["button--fluid"],E),e(p,c["button--large"],z),e(p,c["button--warning"],ot),e(p,c["button--danger"],rt),e(p,c["button--inverted"],I),e(p,c["button--fill"],tt),e(p,c["button--outline"],et),e(p,c["button--borderless"],nt),e(p,c["button--with-icon"],lt),e(p,c["button--ellipsis"],A),p),j),st=d(c.button__content,(e(v={},c["button__content--warning"],ot),e(v,c["button__content--danger"],rt),e(v,c["button__content--fill"],tt),e(v,c["button__content--borderless"],nt),e(v,c["button__content--with-icon"],lt),e(v,c["button__content--large"],z),e(v,c["button__content--ellipsis"],A),e(v,c["button__content--inverted"],I),e(v,c["button__content--fluid"],E),v)),ut=d(c["button__left-fluid-content"],(e(_={},c["button__left-fluid-content--with-icon"],lt),e(_,c["button__left-fluid-content--large"],z),_));function dt(t,e,n,r){var l=t&&t.props&&t.props.color?t.props.color:n;return t&&Object.keys(t).length>0?o.cloneElement(t,{size:e,color:l,isHovered:r}):null}var ct=function(){return T?o.createElement("span",{className:st},T):null},bt=function(){return o.createElement("span",{className:c["content-wrapper"]},F?o.createElement("div",{className:c["button__left-fluid-content"]},o.createElement(i,{testId:"test-id-loader",color:"fill"!==x||I?b[y]:"white",size:"tiny"})):o.createElement(o.Fragment,null,E?o.createElement("div",{className:ut},dt(K,m(z,$.width),Z,Y),ct()):o.createElement(o.Fragment,null,dt(K,m(z,$.width),Z,Y),ct()),dt(Q,l.XSmall,Z,Y)))};return o.createElement(o.Fragment,null,"button"===H&&o.createElement("button",Object.assign({onClick:O,disabled:R,"data-testid":P,className:at,ref:V},it),bt()),"a"===H&&o.createElement("a",Object.assign({onClick:O,"data-testid":P,className:at,href:W,target:q,rel:"_blank"===q?"noopener noreferrer":u.rel,ref:V},D),bt()))}));export{f as B};
2
- //# sourceMappingURL=Button-2be46c88.js.map
1
+ import{_ as t,a as e}from"./_rollupPluginBabelHelpers-d0752906.js";import{_ as n}from"./_tslib-51c8a283.js";import o from"react";import{g as r}from"./color-acb834c6.js";import"./Icon-9b4a8a2d.js";import{I as l}from"./constants-a4b0b501.js";import{L as i}from"./Loader-b3fd59f4.js";import{u as a}from"./useHover-037be19d.js";import{u as s}from"./useWindowSize-73b47451.js";import{b as u}from"./grid-11a70eb7.js";import{c as d}from"./index-9b84fabc.js";import c from"./components/Button/styles.module.scss";var m={primary:"blueberry",warning:"banana",danger:"cherry"};var b=function(t,e){return e&&e<u.md&&t?l.Small:t?l.Medium:l.XSmall},f=o.forwardRef((function(u,f){var p,v,_,g=u.children,h=u.className,j=void 0===h?"":h,w=u.fluid,E=void 0!==w&&w,k=u.intent,y=void 0===k?"primary":k,N=u.inverted,I=void 0!==N&&N,C=u.htmlMarkup,H=void 0===C?"button":C,O=u.onClick,S=u.large,z=void 0!==S&&S,B=u.loading,F=void 0!==B&&B,M=u.variant,x=void 0===M?"fill":M,L=u.disabled,R=void 0!==L&&L,X=u.ellipsis,A=void 0!==X&&X,P=u.testId,W=u.href,q=u.target,D=n(u,["children","className","fluid","intent","inverted","htmlMarkup","onClick","large","loading","variant","disabled","ellipsis","testId","href","target"]),G=function(t){var e,n,o,r,l=null,i=null;void 0!==(null===(n=null===(e=t[0])||void 0===e?void 0:e.props)||void 0===n?void 0:n.svgIcon)&&(l=t.shift()),void 0!==(null===(r=null===(o=t[t.length-1])||void 0===o?void 0:o.props)||void 0===r?void 0:r.svgIcon)&&(i=t.pop());var a=t.filter((function(t){return t}));return[l,i,a.length>0?a:null]}(o.Children.toArray(g)),J=t(G,3),K=J[0],Q=J[1],T=J[2],U=a(f),V=U.hoverRef,Y=U.isHovered,Z=function(t,e,n,o,l){return e?r("neutral",600):t&&!o||!t&&o?"white":r(m[n],l?700:600)}("fill"===x,R,y,I,Y),$=s(),tt="fill"===x,et="outline"===x,nt="borderless"===x,ot="warning"===y,rt="danger"===y,lt=!(!K&&!Q||F),it=Object.assign({},D),at=d(c.button,(e(p={},c["button--fluid"],E),e(p,c["button--large"],z),e(p,c["button--warning"],ot),e(p,c["button--danger"],rt),e(p,c["button--inverted"],I),e(p,c["button--fill"],tt),e(p,c["button--outline"],et),e(p,c["button--borderless"],nt),e(p,c["button--with-icon"],lt),e(p,c["button--ellipsis"],A),p),j),st=d(c.button__content,(e(v={},c["button__content--warning"],ot),e(v,c["button__content--danger"],rt),e(v,c["button__content--fill"],tt),e(v,c["button__content--borderless"],nt),e(v,c["button__content--with-icon"],lt),e(v,c["button__content--large"],z),e(v,c["button__content--ellipsis"],A),e(v,c["button__content--inverted"],I),e(v,c["button__content--fluid"],E),v)),ut=d(c["button__left-fluid-content"],(e(_={},c["button__left-fluid-content--with-icon"],lt),e(_,c["button__left-fluid-content--large"],z),_));function dt(t,e,n,r){var l=t&&t.props&&t.props.color?t.props.color:n;return t&&Object.keys(t).length>0?o.cloneElement(t,{size:e,color:l,isHovered:r}):null}var ct=function(){return T?o.createElement("span",{className:st},T):null},mt=function(){return o.createElement("span",{className:c["content-wrapper"]},F?o.createElement("div",{className:c["button__left-fluid-content"]},o.createElement(i,{testId:"test-id-loader",color:"fill"!==x||I?m[y]:"white",size:"tiny"})):o.createElement(o.Fragment,null,E?o.createElement("div",{className:ut},dt(K,b(z,$.width),Z,Y),ct()):o.createElement(o.Fragment,null,dt(K,b(z,$.width),Z,Y),ct()),dt(Q,l.XSmall,Z,Y)))};return o.createElement(o.Fragment,null,"button"===H&&o.createElement("button",Object.assign({onClick:O,disabled:R,"data-testid":P,className:at,ref:V},it),mt()),"a"===H&&o.createElement("a",Object.assign({onClick:O,"data-testid":P,className:at,href:W,target:q,rel:"_blank"===q?"noopener noreferrer":u.rel,ref:V},D),mt()))}));export{f as B,m as i};
2
+ //# sourceMappingURL=Button-72f96290.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Button-72f96290.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- import{a as e}from"./_rollupPluginBabelHelpers-d0752906.js";import r from"react";import{c as a}from"./index-9b84fabc.js";import o from"./components/FormGroup/styles.module.scss";import{C as t}from"./Checkbox-0ba01292.js";import{F as m,a as l}from"./constants-a4b0b501.js";import{T as n}from"./Title-72851d51.js";import{R as i}from"./RadioButton-84ca988e.js";var p=r.forwardRef((function(p,s){var f,d,c,u=p.className,g=p.mode,_=void 0===g?m.OnWhite:g,v=p.variant,b=void 0===v?l.Normal:v,w=p.error,E=p.name,N=_===m.OnDark,h=b===l.BigForm,j=a(o["form-group-wrapper"],(e(f={},o["form-group-wrapper--on-dark"],N),e(f,o["form-group-wrapper--invalid"],w),f),u),k=a(o["form-group-wrapper__title"],(e(d={},o["form-group-wrapper__title--on-dark"],N&&!w),e(d,o["form-group-wrapper__title--bigform"],h),d)),y=a(o["form-group"],e({},o["form-group--invalid"],w)),B=a(o["form-group-wrapper__errors"],e({},o["form-group-wrapper__errors--bigform"],h)),F=a(o["field-set__legend"],(e(c={},o["field-set__legend--on-dark"],N&&!w),e(c,o["field-set__legend--bigform"],h),c));return r.createElement("div",{"data-testid":p.testId,className:j},p.title&&r.createElement(n,{className:k,htmlMarkup:"h4",appearance:"title4",margin:{marginTop:0,marginBottom:2}},p.title),r.createElement("div",{className:y},w&&r.createElement("p",{className:B},w),r.createElement("fieldset",{name:p.title,className:o["field-set"]},p.legend&&r.createElement("legend",{className:F},p.legend),r.Children.map(p.children,(function(e){if(e.type===t){var a=e.type===t;return r.cloneElement(e,{name:null!=E?E:a.valueOf.name,mode:_,variant:b,error:!!w})}if(e.type===i){var o=e.type===i;return r.cloneElement(e,{name:null!=E?E:o.valueOf.name,mode:_,variant:b,error:!!w})}return e})))))}));export{p as F};
2
- //# sourceMappingURL=FormGroup-9555dd73.js.map
1
+ import{a as e}from"./_rollupPluginBabelHelpers-d0752906.js";import r from"react";import{c as a}from"./index-9b84fabc.js";import o from"./components/FormGroup/styles.module.scss";import{C as t}from"./Checkbox-0ba01292.js";import{F as m,a as l}from"./constants-a4b0b501.js";import{T as n}from"./Title-90910763.js";import{R as i}from"./RadioButton-84ca988e.js";var p=r.forwardRef((function(p,s){var f,d,c,u=p.className,g=p.mode,_=void 0===g?m.OnWhite:g,v=p.variant,b=void 0===v?l.Normal:v,w=p.error,E=p.name,N=_===m.OnDark,h=b===l.BigForm,j=a(o["form-group-wrapper"],(e(f={},o["form-group-wrapper--on-dark"],N),e(f,o["form-group-wrapper--invalid"],w),f),u),k=a(o["form-group-wrapper__title"],(e(d={},o["form-group-wrapper__title--on-dark"],N&&!w),e(d,o["form-group-wrapper__title--bigform"],h),d)),y=a(o["form-group"],e({},o["form-group--invalid"],w)),B=a(o["form-group-wrapper__errors"],e({},o["form-group-wrapper__errors--bigform"],h)),F=a(o["field-set__legend"],(e(c={},o["field-set__legend--on-dark"],N&&!w),e(c,o["field-set__legend--bigform"],h),c));return r.createElement("div",{"data-testid":p.testId,className:j},p.title&&r.createElement(n,{className:k,htmlMarkup:"h4",appearance:"title4",margin:{marginTop:0,marginBottom:2}},p.title),r.createElement("div",{className:y},w&&r.createElement("p",{className:B},w),r.createElement("fieldset",{name:p.title,className:o["field-set"]},p.legend&&r.createElement("legend",{className:F},p.legend),r.Children.map(p.children,(function(e){if(e.type===t){var a=e.type===t;return r.cloneElement(e,{name:null!=E?E:a.valueOf.name,mode:_,variant:b,error:!!w})}if(e.type===i){var o=e.type===i;return r.cloneElement(e,{name:null!=E?E:o.valueOf.name,mode:_,variant:b,error:!!w})}return e})))))}));export{p as F};
2
+ //# sourceMappingURL=FormGroup-68288be3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormGroup-68288be3.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import{_ as e,a}from"./_rollupPluginBabelHelpers-d0752906.js";import r,{useState as l,useRef as t,useEffect as o}from"react";import{c as d}from"./index-9b84fabc.js";import{u as n}from"./uuid-8870ab4b.js";import i from"./components/Loader/styles.module.scss";var s;!function(e){e.screen="screen",e.parent="parent"}(s||(s={}));var m=r.forwardRef((function(m,c){var p,u,v,_=m.overlay,b=m.color,y=void 0===b?_?"black":"neutral":b,f=m.size,w=void 0===f?"small":f,E=m.className,N=void 0===E?"":E,g=m.testId,h=m.center,k=m.inline,L=m.ariaLabelledById,x=m.ariaLabel,j=void 0===x?"Laster inn":x,B=l(_!==s.parent&&!k),I=e(B,2),z=I[0],H=I[1],O="small"===w,P="medium"===w,R="large"===w,q=d(i["loader-wrapper"],(a(p={},i["loader-wrapper--center"],h),a(p,i["loader-wrapper--overlay"],_),a(p,i["loader-wrapper--overlay-screen"],_===s.screen),a(p,i["loader-wrapper--overlay-parent"],_===s.parent&&z),a(p,i["loader-wrapper--inline"],k&&z),p)),A=d(i.loader,(a(u={},i["loader--small"],O),a(u,i["loader--medium"],P),a(u,i["loader--large"],R),u),N),C=d(i.loader__dot,(a(v={},i["loader__dot--small"],O),a(v,i["loader__dot--medium"],P),a(v,i["loader__dot--large"],R),a(v,i["loader__dot--banana"],"banana"===y),a(v,i["loader__dot--cherry"],"cherry"===y),a(v,i["loader__dot--kiwi"],"kiwi"===y),a(v,i["loader__dot--neutral"],"neutral"===y),a(v,i["loader__dot--plum"],"plum"===y),a(v,i["loader__dot--black"],"black"===y),a(v,i["loader__dot--white"],"white"===y),v)),D="loader".concat(n()),F=t(null);return o((function(){var e,a,r,l;_===s.parent&&(null===(a=null===(e=F.current)||void 0===e?void 0:e.parentElement)||void 0===a?void 0:a.style)&&(F.current.parentElement.style.position="relative",H(!0)),k&&(null===(l=null===(r=F.current)||void 0===r?void 0:r.parentElement)||void 0===l?void 0:l.style)&&(F.current.parentElement.style.display="flex",H(!0))}),[]),r.createElement("div",{role:"progressbar",className:q,ref:F},z&&r.createElement("div",{"data-testid":g,"aria-labelledby":L||D,className:A},r.createElement("div",{className:C}),r.createElement("div",{className:C}),r.createElement("div",{className:C}),r.createElement("div",{className:C}),!L&&r.createElement("span",{id:D,className:i["loader__hidden-text"]},j)))}));export{m as L,s as O};
2
+ //# sourceMappingURL=Loader-b3fd59f4.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Loader-b3fd59f4.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import{_ as e,a as t}from"./_rollupPluginBabelHelpers-d0752906.js";import a,{useRef as r,useEffect as n,useState as l}from"react";import{c as o}from"./index-9b84fabc.js";import{p as i}from"./palette-f206f488.js";import{B as c}from"./Button-72f96290.js";import{I as s}from"./Icon-9b4a8a2d.js";import{Z as d,I as m}from"./constants-a4b0b501.js";import u from"./components/Modal/styles.module.scss";import{A as v,a as p}from"./AlertSignFill-e607ff43.js";import{T as f}from"./Title-90910763.js";import{u as _}from"./uuid-8870ab4b.js";import{C as E}from"./Close-80751ae6.js";import{createPortal as h}from"react-dom";function b(){var e=r(null);function t(t){var a=e.current,r="Tab"===t.key;if(a&&r){var n=function(e){try{return("string"==typeof e?document.querySelector(e):e).getRootNode().activeElement}catch(t){return console.error("Feil ved å ta tak i active element basert på angitt node: ",e,t),null}}(a),l=null==a?void 0:a.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),o=l[0],i=1===l.length?o:l[l.length-1];t.shiftKey?n===o&&(i.focus(),t.preventDefault()):n===i&&(o.focus(),t.preventDefault())}}function a(t){var a=e.current;if(a){var r=a.querySelectorAll('a[href], button, textarea, input[type="text"], input[type="radio"], input[type="checkbox"], select');1===r.length&&(r[0].focus(),t.preventDefault())}}return n((function(){var r=e.current;return r.addEventListener("keydown",t),r.addEventListener("click",a),function(){r.removeEventListener("keydown",t),r.removeEventListener("click",a)}}),[]),e}var y,g,N=function(t){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=l(!1),o=e(r,2),i=o[0],c=o[1];return n((function(){var e=new IntersectionObserver((function(e){c(e[0].intersectionRatio>=a)}),{threshold:a});return(null==t?void 0:t.current)&&e.observe(t.current),function(){(null==t?void 0:t.current)&&e.unobserve(t.current)}}),[t]),i},x=function(e){e.isExtraSmall;var t=e.isHovered,r=a.createElement("path",{d:"m9.16 23.421 2.883-2.773 8.262 8.584L35.958 12.97l2.882 2.774-18.536 19.257-11.143-11.58zm26.744-13.279-15.6 16.206-8.206-8.529-5.766 5.547 13.973 14.518 21.362-22.193-5.764-5.549z","fill-rule":"evenodd"});return t?a.createElement("path",{d:"m11.128 25.394 2.88-2.771 6.291 6.613 17.071-17.68 2.882 2.775-19.944 20.668-9.18-9.605zM37.318 8.73 20.31 26.345l-6.239-6.558-5.766 5.548 11.996 12.552 22.781-23.609-5.764-5.548z","fill-rule":"evenodd"}):r};function w(e){var t=e.children,r=e.parent,n=e.className,l=e.testId,o=a.useMemo((function(){return document.createElement("div")}),[]);return l&&o.setAttribute("data-testid",l),a.useEffect((function(){var e=r&&r.appendChild?r:document.body,t=["portal-container"];return n&&n.split(" ").forEach((function(e){return t.push(e)})),t.forEach((function(e){return o.classList.add(e)})),e.appendChild(o),function(){e.removeChild(o)}}),[o,r,n]),h(t,o)}!function(e){e.normal="normal",e.warning="warning",e.error="error",e.success="success",e.image="image"}(y||(y={})),function(e){e.large="large",e.medium="medium"}(g||(g={}));var C={variant:y.normal,primaryButtonText:"OK",large:!1,className:"",size:g.large,zIndex:d.Modal},k=function(e,t){var r=function(e){return e===y.error?a.createElement(s,{size:m.Small,svgIcon:v,color:i.cherry500}):e===y.warning?a.createElement(s,{size:m.Small,svgIcon:p,color:i.black}):e===y.success?a.createElement(s,{size:m.Small,svgIcon:x,color:i.kiwi900}):null}(e);return r?a.createElement("div",{className:u.modal__iconWrapper},r):t?a.createElement("div",{className:u.modal__iconWrapper},a.cloneElement(t,{size:m.Small})):null},L=function(r){var l,i,s,d,m=a.useState(0),v=e(m,2),p=v[0],h=v[1],g=a.useState(_()),x=e(g,1)[0],C=a.useRef(null),L=a.useRef(null),B=a.useRef(null),z=N(L),I=a.useRef(null),S=N(I),T=B.current&&B.current.scrollHeight>B.current.clientHeight;function W(e){"Escape"===e.key&&r.onClose&&(e.stopPropagation(),r.onClose())}function j(e){e.target&&A.current===e.target&&r.onClose&&(e.stopPropagation(),r.onClose())}var R=r.variant===y.image,M=null!==(i=r.titleId)&&void 0!==i?i:x,A=a.useRef(null),P=r.secondaryButtonText&&(null===(s=r.secondaryButtonText)||void 0===s?void 0:s.length)>0||r.onSuccess,D=r.ariaLabelledBy?void 0:r.ariaLabel,H=r.ariaLabelledBy?r.ariaLabelledBy:r.ariaLabel?void 0:M;n((function(){var e,t=A.current;return null===(e=C.current)||void 0===e||e.focus(),document.body.style.overflow="hidden",t&&!P&&(t.addEventListener("keydown",W),t.addEventListener("click",j)),function(){document.body.style.removeProperty("overflow"),t&&!P&&(t.removeEventListener("keydown",W),t.removeEventListener("click",j))}}),[]);var q=o((t(l={},u["modal__title--error"],r.variant===y.error),t(l,u["modal__title--success"],r.variant===y.success),l)),F=a.createElement("div",{"data-testid":"dialog-container"},a.createElement("div",{ref:A,className:u["modal-overlay"],"data-testid":r.testId,style:{zIndex:r.zIndex}},a.createElement("div",{className:u.align,ref:b()},a.createElement("div",{className:o(r.className,u.modal,u["modal--".concat(r.variant)],u["modal--".concat(r.size)]),role:"dialog","aria-label":D,"aria-labelledby":H},a.createElement("div",{tabIndex:p,ref:C,onBlur:function(){return h(-1)}}),a.createElement("div",{className:o(u.modal__shadow,u["modal__shadow--top"],t({},u["modal__shadow--show"],!z&&T))}),a.createElement("div",{className:o(u.modal__contentWrapper,t({},u["modal__contentWrapper--image"],R)),ref:B},!r.noCloseButton&&a.createElement("div",{className:u.modal__closeWrapper},a.createElement("div",{className:o(u.modal__closeWrapper__close)},a.createElement(E,{onClick:r.onClose,ariaLabel:r.ariaLabelCloseBtn}))),a.createElement("div",{className:o(u["modal__contentWrapper__scroll--".concat(r.size)],t({},u["modal__contentWrapper__scroll--image"],R))},a.createElement("div",{ref:L}),a.createElement("div",{className:u.modal__contentWrapper__title},k(r.variant,r.icon),a.createElement(f,{id:M,htmlMarkup:"h3",appearance:"title3",className:q},r.title),r.afterTitleChildren&&a.createElement("div",{className:u.modal__afterTitleChildren},r.afterTitleChildren)),R&&a.createElement("div",null,a.createElement("div",{className:u.modal__contentWrapper__imageWrapper},r.children),a.createElement("span",{className:u.modal__contentWrapper__imageDescription},r.description)),!R&&r.children&&a.createElement("div",null,r.children),!R&&!r.children&&a.createElement("p",{className:u.modal__description},r.description),a.createElement("div",{ref:I}))),a.createElement("div",{className:o(u.modal__shadow,u["modal__shadow--bottom"],t({},u["modal__shadow--show"],!S&&T))}),P&&a.createElement("div",{className:o(u["modal__call-to-action"],u["modal__call-to-action--".concat(r.size)])},r.onSuccess&&a.createElement(c,{onClick:r.onSuccess},r.primaryButtonText),r.secondaryButtonText&&(null===(d=r.secondaryButtonText)||void 0===d?void 0:d.length)>0&&a.createElement(c,{variant:"borderless",onClick:r.onClose},r.secondaryButtonText))))));if(r.printable){return a.createElement(w,{className:"print-modal",testId:"print-modal"},a.createElement("style",{media:"print"},"body > *:not(.".concat("print-modal",") {display: none;}")),F)}return F};L.defaultProps=C;export{L as M,y as a,g as b};
2
+ //# sourceMappingURL=Modal-6b4a2c9c.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Modal-6b4a2c9c.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import{a as t}from"./_rollupPluginBabelHelpers-d0752906.js";import e from"react";import{c as r}from"./index-9b84fabc.js";import i from"./components/Title/styles.module.scss";var a=function(t){return Object.prototype.hasOwnProperty.call(t,"marginTop")&&Object.prototype.hasOwnProperty.call(t,"marginBottom")},o=e.forwardRef((function(o,l){var m,n=o.id,c=o.children,s=o.className,p=o.htmlMarkup,d=void 0===p?"h1":p,f=o.appearance,g=void 0===f?"title1":f,u=o.margin,y=void 0===u?0:u,T=o.testId,b=r(i.title,(t(m={},i["title--feature"],"titleFeature"===g),t(m,i["title--title1"],"title1"===g),t(m,i["title--title2"],"title2"===g),t(m,i["title--title3"],"title3"===g),t(m,i["title--title4"],"title4"===g),t(m,i["title--title5"],"title5"===g),m),s),h=d,v=a(y)?{marginTop:"".concat(y.marginTop,"rem"),marginBottom:"".concat(y.marginBottom,"rem")}:{marginTop:"".concat(y,"rem"),marginBottom:"".concat(y,"rem")};return e.createElement(h,{id:n,className:b,style:v,ref:l,"data-testid":T},c)}));export{o as T,a as i};
2
+ //# sourceMappingURL=Title-90910763.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Title-90910763.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- import r from"react";import{c as e}from"./index-9b84fabc.js";import{F as a}from"./FormGroup-9555dd73.js";import t from"./components/Validation/styles.module.scss";var o=r.forwardRef((function(o,m){var s=o.errorSummary,n=o.className,i=e(t.validation,n);return r.createElement(r.Fragment,null,r.createElement("div",{"data-testid":o.testId,className:i},r.Children.map(o.children,(function(e){return e.type===a?r.cloneElement(e,{className:s?t["form-group-wrapper--error-sibling"]:""}):e}))),s&&r.createElement("p",{className:t.validation__errors},s))}));export{o as V};
2
- //# sourceMappingURL=Validation-1236e8ef.js.map
1
+ import r from"react";import{c as e}from"./index-9b84fabc.js";import{F as a}from"./FormGroup-68288be3.js";import t from"./components/Validation/styles.module.scss";var o=r.forwardRef((function(o,m){var s=o.errorSummary,n=o.className,i=e(t.validation,n);return r.createElement(r.Fragment,null,r.createElement("div",{"data-testid":o.testId,className:i},r.Children.map(o.children,(function(e){return e.type===a?r.cloneElement(e,{className:s?t["form-group-wrapper--error-sibling"]:""}):e}))),s&&r.createElement("p",{className:t.validation__errors},s))}));export{o as V};
2
+ //# sourceMappingURL=Validation-ef9ee0ae.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Validation-ef9ee0ae.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,3 +1,4 @@
1
1
  import AnchorLink from './AnchorLink';
2
+ export * from './AnchorLink';
2
3
  export default AnchorLink;
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/AnchorLink/index.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/AnchorLink/index.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,eAAe,UAAU,CAAC"}
@@ -1,3 +1,4 @@
1
1
  import Avatar from './Avatar';
2
+ export * from './Avatar';
2
3
  export default Avatar;
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Avatar/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Avatar/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,eAAe,MAAM,CAAC"}
@@ -1,3 +1,4 @@
1
1
  import Badge from './Badge';
2
+ export * from './Badge';
2
3
  export default Badge;
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,eAAe,KAAK,CAAC"}
@@ -1,3 +1,4 @@
1
1
  import Button from './Button';
2
+ export * from './Button';
2
3
  export default Button;
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Button/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Button/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,eAAe,MAAM,CAAC"}
@@ -1,2 +1,2 @@
1
- import{B as o}from"../../Button-2be46c88.js";export{B as default}from"../../Button-2be46c88.js";import"../../_rollupPluginBabelHelpers-d0752906.js";import"../../_tslib-51c8a283.js";import"react";import"../../color-acb834c6.js";import"../../index-19b48c51.js";import"../../palette-f206f488.js";import"../../grid-11a70eb7.js";import"../../Icon-9b4a8a2d.js";import"../../constants-a4b0b501.js";import"../../Loader-3589bdb1.js";import"../../index-9b84fabc.js";import"../../uuid-8870ab4b.js";import"../Loader/styles.module.scss";import"../../useHover-037be19d.js";import"../../useWindowSize-73b47451.js";import"./styles.module.scss";
1
+ import{B as o}from"../../Button-72f96290.js";export{B as default,i as intentToColor}from"../../Button-72f96290.js";import"../../_rollupPluginBabelHelpers-d0752906.js";import"../../_tslib-51c8a283.js";import"react";import"../../color-acb834c6.js";import"../../index-19b48c51.js";import"../../palette-f206f488.js";import"../../grid-11a70eb7.js";import"../../Icon-9b4a8a2d.js";import"../../constants-a4b0b501.js";import"../../Loader-b3fd59f4.js";import"../../index-9b84fabc.js";import"../../uuid-8870ab4b.js";import"../Loader/styles.module.scss";import"../../useHover-037be19d.js";import"../../useWindowSize-73b47451.js";import"./styles.module.scss";
2
2
  //# sourceMappingURL=index.js.map
@@ -1,3 +1,4 @@
1
1
  import ButtonWithModal from './ButtonWithModal';
2
+ export * from './ButtonWithModal';
2
3
  export default ButtonWithModal;
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ButtonWithModal/index.tsx"],"names":[],"mappings":"AACA,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ButtonWithModal/index.tsx"],"names":[],"mappings":"AACA,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,cAAc,mBAAmB,CAAC;AAClC,eAAe,eAAe,CAAC"}
@@ -1,2 +1,2 @@
1
- import{_ as t}from"../../_rollupPluginBabelHelpers-d0752906.js";import o,{useState as s}from"react";import{B as e}from"../../Button-2be46c88.js";import{M as r}from"../../Modal-b68c7a72.js";import"../../_tslib-51c8a283.js";import"../../color-acb834c6.js";import"../../index-19b48c51.js";import"../../palette-f206f488.js";import"../../grid-11a70eb7.js";import"../../Icon-9b4a8a2d.js";import"../../constants-a4b0b501.js";import"../../Loader-3589bdb1.js";import"../../index-9b84fabc.js";import"../../uuid-8870ab4b.js";import"../Loader/styles.module.scss";import"../../useHover-037be19d.js";import"../../useWindowSize-73b47451.js";import"../Button/styles.module.scss";import"../Modal/styles.module.scss";import"../../AlertSignFill-e607ff43.js";import"../../Title-72851d51.js";import"../Title/styles.module.scss";import"../../Close-80751ae6.js";import"../Close/styles.module.scss";import"../../useBreakpoint-324a9b14.js";import"react-dom";var i=o.forwardRef((function(i,m){var a=s(!1),l=t(a,2),p=l[0],n=l[1];return o.createElement("div",{"data-testid":i.testId},o.createElement(e,{onClick:function(){return n(!0)}},i.buttonText),p&&o.createElement(r,Object.assign({},i,{onClose:function(){return n(!1)}})))}));export default i;
1
+ import{_ as t}from"../../_rollupPluginBabelHelpers-d0752906.js";import o,{useState as s}from"react";import{B as e}from"../../Button-72f96290.js";import{M as r}from"../../Modal-6b4a2c9c.js";import"../../_tslib-51c8a283.js";import"../../color-acb834c6.js";import"../../index-19b48c51.js";import"../../palette-f206f488.js";import"../../grid-11a70eb7.js";import"../../Icon-9b4a8a2d.js";import"../../constants-a4b0b501.js";import"../../Loader-b3fd59f4.js";import"../../index-9b84fabc.js";import"../../uuid-8870ab4b.js";import"../Loader/styles.module.scss";import"../../useHover-037be19d.js";import"../../useWindowSize-73b47451.js";import"../Button/styles.module.scss";import"../Modal/styles.module.scss";import"../../AlertSignFill-e607ff43.js";import"../../Title-90910763.js";import"../Title/styles.module.scss";import"../../Close-80751ae6.js";import"../Close/styles.module.scss";import"../../useBreakpoint-324a9b14.js";import"react-dom";var i=o.forwardRef((function(i,m){var a=s(!1),l=t(a,2),p=l[0],n=l[1];return o.createElement("div",{"data-testid":i.testId},o.createElement(e,{onClick:function(){return n(!0)}},i.buttonText),p&&o.createElement(r,Object.assign({},i,{onClose:function(){return n(!1)}})))}));export default i;
2
2
  //# sourceMappingURL=index.js.map
@@ -1,3 +1,4 @@
1
1
  import Checkbox from './Checkbox';
2
+ export * from './Checkbox';
2
3
  export default Checkbox;
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Checkbox/index.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Checkbox/index.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,eAAe,QAAQ,CAAC"}
@@ -1,2 +1,2 @@
1
- import{C as o}from"../../Checkbox-0ba01292.js";export{C as default}from"../../Checkbox-0ba01292.js";import"../../_rollupPluginBabelHelpers-d0752906.js";import"react";import"../../index-9b84fabc.js";import"../../uuid-8870ab4b.js";import"../../Check-6291ad09.js";import"../../Icon-9b4a8a2d.js";import"../../_tslib-51c8a283.js";import"../../constants-a4b0b501.js";import"../../color-acb834c6.js";import"../../index-19b48c51.js";import"../../palette-f206f488.js";import"../../grid-11a70eb7.js";import"./styles.module.scss";
1
+ import{C as o}from"../../Checkbox-0ba01292.js";export{C as Checkbox,C as default}from"../../Checkbox-0ba01292.js";import"../../_rollupPluginBabelHelpers-d0752906.js";import"react";import"../../index-9b84fabc.js";import"../../uuid-8870ab4b.js";import"../../Check-6291ad09.js";import"../../Icon-9b4a8a2d.js";import"../../_tslib-51c8a283.js";import"../../constants-a4b0b501.js";import"../../color-acb834c6.js";import"../../index-19b48c51.js";import"../../palette-f206f488.js";import"../../grid-11a70eb7.js";import"./styles.module.scss";
2
2
  //# sourceMappingURL=index.js.map
@@ -1,3 +1,4 @@
1
1
  import Close from './Close';
2
+ export * from './Close';
2
3
  export default Close;
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Close/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,SAAS,CAAC;AAE5B,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Close/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,eAAe,KAAK,CAAC"}
@@ -1,3 +1,4 @@
1
1
  import ExpanderList from './ExpanderList';
2
+ export * from './ExpanderList';
2
3
  export default ExpanderList;
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ExpanderList/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ExpanderList/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,cAAc,gBAAgB,CAAC;AAC/B,eAAe,YAAY,CAAC"}
@@ -1,2 +1,2 @@
1
- import{_ as e,a as t}from"../../_rollupPluginBabelHelpers-d0752906.js";import n,{useState as a,useEffect as r}from"react";import{I as i}from"../../Icon-9b4a8a2d.js";import{I as l}from"../../constants-a4b0b501.js";import{u as o}from"../../useHover-037be19d.js";import{u as d,B as s}from"../../useBreakpoint-324a9b14.js";import{c}from"../../index-9b84fabc.js";import m from"./styles.module.scss";import"../../_tslib-51c8a283.js";import"../../useWindowSize-73b47451.js";import"../../grid-11a70eb7.js";var p=function(e){var t=e.isExtraSmall,a=e.isHovered,r=n.createElement("path",{d:"M15.049 30.277l-1.419-1.409 10.371-10.451L34.37 28.868l-1.419 1.409L24 21.257z"}),i=n.createElement("path",{d:"M24.001 10.14L36.37 22.591 34.951 24 25 13.985V35h-2V13.985L13.049 24l-1.419-1.409z"}),l=n.createElement("path",{d:"M32.577 30.115l1.793-1.779-10.371-10.451L13.63 28.336l1.793 1.779 8.576-8.644z"});return t?a?n.createElement("path",{d:"M23.999 9.043L36.897 22.02l-1.794 1.78-9.841-9.9.001 20.205h-2.526L22.736 13.9l-9.839 9.9-1.794-1.78z"}):l:a?i:r},u=function(e){var t=e.isExtraSmall,a=e.isHovered,r=n.createElement("path",{d:"M32.951 18.788l1.419 1.409-10.371 10.451L13.63 20.197l1.419-1.409L24 27.809z"}),i=n.createElement("path",{d:"M25 13v20.083l9.951-10.013 1.419 1.409L23.999 36.93 11.63 24.479l1.419-1.409L23 33.085V13z"}),l=n.createElement("path",{d:"M32.577 17.885l1.793 1.779-10.371 10.451L13.63 19.664l1.793-1.779 8.576 8.644z"});return t?a?n.createElement("path",{d:"M25 13v20.083l9.951-10.013 1.419 1.409L23.999 36.93 11.63 24.479l1.419-1.409L23 33.085V13z"}):l:a?i:r},f=n.forwardRef((function(e,a){var r,f=e.id,v=e.children,x=e.padding,E=void 0===x||x,h=e.color,g=void 0===h?"neutral":h,b=e.className,_=void 0===b?"":b,L=e.icon,k=e.large,j=void 0!==k&&k,z=e.title,N=e.isExpanded,H=void 0!==N&&N,w=e.testId,M=e.handleExpanderClick,I=o(),B=I.hoverRef,C=I.isHovered,S=d(),O=c(m["expander-list-link"],m["expander-list-link--".concat(g)],(t(r={},m["expander-list-link--closed"],!H),t(r,m["expander-list-link--large"],j),r)),V=c(m["expander-list-link__main-content"],E?m["expander-list-link__main-content--padding"]:"");return n.createElement("li",{className:_,ref:a},n.createElement("button",{id:f,onClick:M,"data-testid":w,className:O,ref:B},L&&n.createElement("span",{className:m["expander-list-link__icon"]},n.cloneElement(L,{size:S===s.Xs?l.XSmall:l.Small,isHovered:C})),n.createElement("span",{className:m["expander-list-link__title"]},z),n.createElement("span",{className:m["expander-list-link__chevron"]},n.createElement(i,{size:l.XSmall,svgIcon:H?p:u,isHovered:C}))),H?n.createElement("div",{className:V},v):null)})),v=n.forwardRef((function(i,l){var o=i.children,d=i.childPadding,s=void 0===d||d,p=i.large,u=i.isOpen,v=void 0!==u&&u,x=i.color,E=i.className,h=void 0===E?"":E,g=i.accordion,b=void 0!==g&&g,_=i.topBorder,L=void 0===_||_,k=i.bottomBorder,j=void 0===k||k,z=i.testId,N=a({}),H=e(N,2),w=H[0],M=H[1],I=a(),B=e(I,2),C=B[0],S=B[1],O=n.Children.count(o),V=c(m["expander-list"],h);return r((function(){var e,t,n,a,r;!b||!C||(e=C.getBoundingClientRect(),t=e.top,n=e.left,a=e.bottom,r=e.right,t>=0&&n>=0&&a<=(window.innerHeight||document.documentElement.clientHeight)&&r<=(window.innerWidth||document.documentElement.clientWidth))||C.scrollIntoView()}),[b,C]),r((function(){if(v){var e="expander-0";M((function(n){return b?t({},e,!n[e]):Object.assign(Object.assign({},n),t({},e,!n[e]))}))}}),[v]),n.createElement("ul",{className:V,ref:l,"data-testid":z},n.Children.map(o,(function(e,a){if(e.type===f){var r=w["expander-".concat(a)],i=function(e){var n;return c(m["expander-list__item"],(t(n={},m["expander-list__item--top"],0===e&&L),t(n,m["expander-list__item--no-bottom"],e===O-1&&!j),n))}(a);return n.cloneElement(e,{id:"expander-".concat(a),key:"expander-".concat(a),isExpanded:r,padding:s,color:x,large:p,"aria-expanded":r,className:i,handleExpanderClick:function(e){return function(e,n){M((function(e){return b?t({},n,!e[n]):Object.assign(Object.assign({},e),t({},n,!e[n]))})),S(e.currentTarget)}(e,"expander-".concat(a))}})}return e})))}));v.Expander=f,f.displayName="ExpanderList.Expander";export default v;
1
+ import{_ as e,a as t}from"../../_rollupPluginBabelHelpers-d0752906.js";import n,{useState as a,useEffect as r}from"react";import{I as i}from"../../Icon-9b4a8a2d.js";import{I as l}from"../../constants-a4b0b501.js";import{u as o}from"../../useHover-037be19d.js";import{u as d,B as s}from"../../useBreakpoint-324a9b14.js";import{c}from"../../index-9b84fabc.js";import m from"./styles.module.scss";import"../../_tslib-51c8a283.js";import"../../useWindowSize-73b47451.js";import"../../grid-11a70eb7.js";var p=function(e){var t=e.isExtraSmall,a=e.isHovered,r=n.createElement("path",{d:"M15.049 30.277l-1.419-1.409 10.371-10.451L34.37 28.868l-1.419 1.409L24 21.257z"}),i=n.createElement("path",{d:"M24.001 10.14L36.37 22.591 34.951 24 25 13.985V35h-2V13.985L13.049 24l-1.419-1.409z"}),l=n.createElement("path",{d:"M32.577 30.115l1.793-1.779-10.371-10.451L13.63 28.336l1.793 1.779 8.576-8.644z"});return t?a?n.createElement("path",{d:"M23.999 9.043L36.897 22.02l-1.794 1.78-9.841-9.9.001 20.205h-2.526L22.736 13.9l-9.839 9.9-1.794-1.78z"}):l:a?i:r},u=function(e){var t=e.isExtraSmall,a=e.isHovered,r=n.createElement("path",{d:"M32.951 18.788l1.419 1.409-10.371 10.451L13.63 20.197l1.419-1.409L24 27.809z"}),i=n.createElement("path",{d:"M25 13v20.083l9.951-10.013 1.419 1.409L23.999 36.93 11.63 24.479l1.419-1.409L23 33.085V13z"}),l=n.createElement("path",{d:"M32.577 17.885l1.793 1.779-10.371 10.451L13.63 19.664l1.793-1.779 8.576 8.644z"});return t?a?n.createElement("path",{d:"M25 13v20.083l9.951-10.013 1.419 1.409L23.999 36.93 11.63 24.479l1.419-1.409L23 33.085V13z"}):l:a?i:r},f=n.forwardRef((function(e,a){var r,f=e.id,v=e.children,x=e.padding,E=void 0===x||x,h=e.color,g=void 0===h?"neutral":h,b=e.className,_=void 0===b?"":b,L=e.icon,k=e.large,j=void 0!==k&&k,z=e.title,N=e.isExpanded,H=void 0!==N&&N,w=e.testId,M=e.handleExpanderClick,I=o(),B=I.hoverRef,C=I.isHovered,S=d(),O=c(m["expander-list-link"],m["expander-list-link--".concat(g)],(t(r={},m["expander-list-link--closed"],!H),t(r,m["expander-list-link--large"],j),r)),V=c(m["expander-list-link__main-content"],E?m["expander-list-link__main-content--padding"]:"");return n.createElement("li",{className:_,ref:a},n.createElement("button",{id:f,onClick:M,"data-testid":w,className:O,ref:B},L&&n.createElement("span",{className:m["expander-list-link__icon"]},n.cloneElement(L,{size:S===s.Xs?l.XSmall:l.Small,isHovered:C})),n.createElement("span",{className:m["expander-list-link__title"]},z),n.createElement("span",{className:m["expander-list-link__chevron"]},n.createElement(i,{size:l.XSmall,svgIcon:H?p:u,isHovered:C}))),H?n.createElement("div",{className:V},v):null)})),v=n.forwardRef((function(i,l){var o=i.children,d=i.childPadding,s=void 0===d||d,p=i.large,u=i.isOpen,v=void 0!==u&&u,x=i.color,E=i.className,h=void 0===E?"":E,g=i.accordion,b=void 0!==g&&g,_=i.topBorder,L=void 0===_||_,k=i.bottomBorder,j=void 0===k||k,z=i.testId,N=a({}),H=e(N,2),w=H[0],M=H[1],I=a(),B=e(I,2),C=B[0],S=B[1],O=n.Children.count(o),V=c(m["expander-list"],h);return r((function(){var e,t,n,a,r;!b||!C||(e=C.getBoundingClientRect(),t=e.top,n=e.left,a=e.bottom,r=e.right,t>=0&&n>=0&&a<=(window.innerHeight||document.documentElement.clientHeight)&&r<=(window.innerWidth||document.documentElement.clientWidth))||C.scrollIntoView()}),[b,C]),r((function(){if(v){var e="expander-0";M((function(n){return b?t({},e,!n[e]):Object.assign(Object.assign({},n),t({},e,!n[e]))}))}}),[v]),n.createElement("ul",{className:V,ref:l,"data-testid":z},n.Children.map(o,(function(e,a){if(e.type===f){var r=w["expander-".concat(a)],i=function(e){var n;return c(m["expander-list__item"],(t(n={},m["expander-list__item--top"],0===e&&L),t(n,m["expander-list__item--no-bottom"],e===O-1&&!j),n))}(a);return n.cloneElement(e,{id:"expander-".concat(a),key:"expander-".concat(a),isExpanded:r,padding:s,color:x,large:p,"aria-expanded":r,className:i,handleExpanderClick:function(e){return function(e,n){M((function(e){return b?t({},n,!e[n]):Object.assign(Object.assign({},e),t({},n,!e[n]))})),S(e.currentTarget)}(e,"expander-".concat(a))}})}return e})))}));v.Expander=f,f.displayName="ExpanderList.Expander";export default v;export{v as ExpanderList};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,3 +1,4 @@
1
1
  import FormExample from './FormExample';
2
+ export * from './FormExample';
2
3
  export default FormExample;
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/FormExample/index.tsx"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/FormExample/index.tsx"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,eAAe,WAAW,CAAC"}
@@ -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-1236e8ef.js";import{F as c}from"../../FormGroup-9555dd73.js";import{C as l}from"../../Checkbox-0ba01292.js";import{B as f}from"../../Button-2be46c88.js";import{R as d}from"../../RadioButton-84ca988e.js";import{T as v}from"../../Textarea-9c91191a.js";import"../../index-9b84fabc.js";import"../Validation/styles.module.scss";import"../../_rollupPluginBabelHelpers-d0752906.js";import"../FormGroup/styles.module.scss";import"../../constants-a4b0b501.js";import"../../Title-72851d51.js";import"../Title/styles.module.scss";import"../../uuid-8870ab4b.js";import"../../Check-6291ad09.js";import"../../Icon-9b4a8a2d.js";import"../../_tslib-51c8a283.js";import"../../color-acb834c6.js";import"../../index-19b48c51.js";import"../../palette-f206f488.js";import"../../grid-11a70eb7.js";import"../Checkbox/styles.module.scss";import"../../Loader-3589bdb1.js";import"../Loader/styles.module.scss";import"../../useHover-037be19d.js";import"../../useWindowSize-73b47451.js";import"../Button/styles.module.scss";import"../RadioButton/styles.module.scss";import"../Textarea/styles.module.scss";var m=function(r){return r instanceof HTMLElement},g="blur",p="change",b="input",y="onBlur",h="onChange",O="onSubmit",j="onTouched",V="all",A="max",E="min",w="maxLength",k="minLength",S="pattern",D="required",F="validate";var x=function(r){return null==r},R=function(r){return"object"==typeof r},C=function(r){return!x(r)&&!Array.isArray(r)&&R(r)&&!(r instanceof Date)},N=function(r){return/^\w*$/.test(r)},B=function(r){return r.filter(Boolean)},L=function(r){return B(r.replace(/["|']/g,"").replace(/\[/g,".").replace(/\]/g,"").split("."))};function T(r,e,t){for(var n=-1,i=N(e)?[e]:L(e),a=i.length,u=a-1;++n<a;){var o=i[n],s=t;if(n!==u){var c=r[o];s=C(c)||Array.isArray(c)?c:isNaN(+i[n+1])?{}:[]}r[o]=s,r=r[o]}return r}var q=function(r,e){for(var t in void 0===e&&(e={}),r)N(t)?e[t]=r[t]:T(e,t,r[t]);return e},M=function(r){return void 0===r},W=function(r,e,t){void 0===r&&(r={});var n=B(e.split(/[,[\].]+?/)).reduce((function(r,e){return x(r)?r:r[e]}),r);return M(n)||n===r?M(r[e])?t:r[e]:n},H=function(r,e){m(r)&&r.removeEventListener&&(r.removeEventListener(b,e),r.removeEventListener(p,e),r.removeEventListener(g,e))},_={isValid:!1,value:null},P=function(r){return Array.isArray(r)?r.reduce((function(r,e){return e&&e.ref.checked?{isValid:!0,value:e.ref.value}:r}),_):_},z=function(r){return"radio"===r.type},U=function(r){return"file"===r.type},$=function(r){return"checkbox"===r.type},G=function(r){return"select-multiple"===r.type},I={value:!1,isValid:!1},J={value:!0,isValid:!0},K=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&&!M(a.value)?M(i)||""===i?J:{value:i,isValid:!0}:J:I}return I};function Q(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 U(l)?l.files:z(l)?P(u.options).value:G(l)?(a=l.options,[].concat(a).filter((function(r){return r.selected})).map((function(r){return r.value}))):$(l)?K(u.options).value:i?s:f?""===s?NaN:+s:d?l.valueAsDate:v?v(s):s}if(t)return W(t.current,e)}function X(r){return!r||r instanceof HTMLElement&&r.nodeType!==Node.DOCUMENT_NODE&&X(r.parentNode)}var Y=function(r){return C(r)&&!Object.keys(r).length},Z=function(r){return"boolean"==typeof r};function rr(r,e){var t,n=N(e)?[e]:L(e),i=1==n.length?r:function(r,e){for(var t=e.slice(0,-1).length,n=0;n<t;)r=M(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&&(C(s)&&Y(s)||Array.isArray(s)&&!s.filter((function(r){return C(r)&&!Y(r)||Z(r)})).length)&&(t?delete t[f]:delete r[f]),t=s}}return r}var er=function(r,e){return r&&r.ref===e};var tr=function(r){return x(r)||!R(r)};function nr(r,e){if(tr(r)||tr(e))return e;for(var t in e){var n=r[t],i=e[t];try{r[t]=C(n)&&C(i)||Array.isArray(n)&&Array.isArray(i)?nr(n,i):i}catch(r){}}return r}function ir(r,e,t){if(tr(r)||tr(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((C(c)||Array.isArray(c))&&(C(l)||Array.isArray(l))?!ir(c,l,t):c!==l)return!1}}}return!0}function ar(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]=[],ar(r[u][o],W(e[u]||{},o,[]),t[u][o],t[u],o)):ir(W(e[u]||{},o),r[u][o])?T(t[u]||{},o):t[u]=Object.assign(Object.assign({},t[u]),((a={})[o]=!0,a));n&&!t.length&&delete n[i]}return t}var ur=function(r){return"string"==typeof r},or=function(r,e,t,n,i){var a={},u=function(e){(M(i)||(ur(i)?e.startsWith(i):Array.isArray(i)&&i.find((function(r){return e.startsWith(r)}))))&&(a[e]=Q(r,e,void 0,n))};for(var o in r.current)u(o);return t?q(a):nr(e,q(a))},sr=function(r){return r instanceof RegExp},cr=function(r){return C(r)&&!sr(r)?r:{value:r,message:""}},lr=function(r){return"function"==typeof r},fr=function(r){return ur(r)||o(r)};function dr(r,e,t){if(void 0===t&&(t="validate"),fr(r)||Z(r)&&!r)return{type:t,message:fr(r)?r:"",ref:e}}var vr=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))}):{}},mr=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=$(i),y=p||b,h=""===a,O=vr.bind(null,m,e,g),j=function(r,e,t,n,a){void 0===n&&(n=w),void 0===a&&(a=k);var u=r?e:t;g[m]=Object.assign({type:r?n:a,message:u,ref:i},O(r?n:a,u))};if(o&&(!p&&!b&&(h||x(a))||Z(a)&&!a||b&&!K(u).isValid||p&&!P(u).isValid)){var V=fr(o)?{value:!!o,message:o}:cr(o),R=V.value,N=V.message;if(R&&(g[m]=Object.assign({type:D,message:N,ref:y?((r.current[m].options||[])[0]||{}).ref:i},O(D,N)),!e))return g}if(!(x(l)&&x(f)||""===a)){var B,L,T=cr(f),q=cr(l);if(isNaN(a)){var M=i.valueAsDate||new Date(a);ur(T.value)&&(B=M>new Date(T.value)),ur(q.value)&&(L=M<new Date(q.value))}else{var W=i.valueAsNumber||parseFloat(a);x(T.value)||(B=W>T.value),x(q.value)||(L=W<q.value)}if((B||L)&&(j(!!B,T.message,q.message,A,E),!e))return g}if(ur(a)&&!h&&(s||c)){var H=cr(s),_=cr(c),U=!x(H.value)&&a.length>H.value,G=!x(_.value)&&a.length<_.value;if((U||G)&&(j(U,H.message,_.message),!e))return g}if(ur(a)&&d&&!h){var I=cr(d),J=I.value,X=I.message;if(sr(J)&&!J.test(a)&&(g[m]=Object.assign({type:S,message:X,ref:i},O(S,X)),!e))return g}if(v){var rr=Q(r,m,n,!1,!0),er=y&&u?u[0].ref:i;if(lr(v)){var tr=dr(await v(rr),er);if(tr&&(g[m]=Object.assign(Object.assign({},tr),O(F,tr.message)),!e))return g}else if(C(v)){for(var nr={},ir=0,ar=Object.entries(v);ir<ar.length;ir+=1){var or=ar[ir],mr=or[0],gr=or[1];if(!Y(nr)&&!e)break;var pr=dr(await gr(rr),er,mr);pr&&(nr=Object.assign(Object.assign({},pr),O(mr,pr.message)),e&&(g[m]=nr))}if(!Y(nr)&&(g[m]=Object.assign({ref:er},nr),!e))return g}}return g},gr=function(r,e,t){for(var n in void 0===t&&(t=[]),e){var i=r+(C(e)?"."+n:"["+n+"]");tr(e[n])?t.push(i):gr(i,e[n],t)}return t},pr=function(r,e,t,n,i){var a=void 0;return t.add(e),Y(r)||(a=W(r,e),(C(a)||Array.isArray(a))&&gr(e,a).forEach((function(r){return t.add(r)}))),M(a)?i?n:W(n,e):a},br=function(r){return r.substring(0,r.indexOf("["))},yr=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 hr="undefined"!=typeof window&&"undefined"!=typeof document;function Or(r){var e,t;if(tr(r)||hr&&(r instanceof File||m(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,Or(r.get(s)))}return t}for(var c in t=Array.isArray(r)?[]:{},r)t[c]=Or(r[c]);return t}var jr,Vr=function(r){return{isOnSubmit:!r||r===O,isOnBlur:r===y,isOnChange:r===h,isOnAll:r===V,isOnTouch:r===j}},Ar=function(r){return z(r)||$(r)},Er="undefined"==typeof window,wr=hr?"Proxy"in window:"undefined"!=typeof Proxy;function kr(r){void 0===r&&(r={});var e=r.mode;void 0===e&&(e=O);var o=r.reValidateMode;void 0===o&&(o=h);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,y=n({}),j=n({}),A=n({}),E=n(new Set),w=n({}),k=n({}),S=n({}),D=n({}),F=n(l),R=n(!1),L=n(!1),_=n(),P=n({}),I=n({}),J=n(c),K=n(s),Z=n(new Set),sr=n(Vr(e)),cr=sr.current,fr=cr.isOnSubmit,dr=cr.isOnTouch,vr=v===V,jr=i({isDirty:!1,isValidating:!1,dirtyFields:{},isSubmitted:!1,submitCount:0,touched:{},isSubmitting:!1,isSubmitSuccessful:!1,isValid:!fr,errors:{}}),kr=jr[0],Sr=jr[1],Dr=n({isDirty:!wr,dirtyFields:!wr,touched:!wr||dr,isValidating:!wr,isSubmitting:!wr,isValid:!wr}),Fr=n(kr),xr=n(),Rr=n(Vr(o)).current,Cr=Rr.isOnBlur,Nr=Rr.isOnChange;J.current=c,K.current=s,Fr.current=kr,P.current=d?{}:Y(P.current)?Or(l):P.current;var Br=t((function(r){void 0===r&&(r={}),R.current||(Fr.current=Object.assign(Object.assign({},Fr.current),r),Sr(Fr.current))}),[]),Lr=function(){return Dr.current.isValidating&&Br({isValidating:!0})},Tr=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=M(n),o=W(e,t);return u&&!!o||!u&&!ir(o,n,!0)||u&&W(a,t)&&!W(i,t)}({errors:Fr.current.errors,error:e,name:r,validFields:D.current,fieldsWithValidation:S.current}),u=W(Fr.current.errors,r);e?(rr(D.current,r),a=a||!u||!ir(u,e,!0),T(Fr.current.errors,r,e)):((W(S.current,r)||K.current)&&(T(D.current,r,!0),a=a||u),rr(Fr.current.errors,r)),(a&&!x(t)||!Y(n)||Dr.current.isValidating)&&Br(Object.assign(Object.assign(Object.assign({},n),K.current?{isValid:!!i}:{}),{isValidating:!1}))}),[]),qr=t((function(r,e){var t=y.current[r],n=t.ref,i=t.options,a=hr&&m(n)&&x(e)?"":e;z(n)?(i||[]).forEach((function(r){var e=r.ref;return e.checked=e.value===a})):U(n)&&!ur(a)?n.files=a:G(n)?[].concat(n.options).forEach((function(r){return r.selected=a.includes(r.value)})):$(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}),[]),Mr=t((function(r,e){if(Dr.current.isDirty){var t=Jr();return r&&e&&T(t,r,e),!ir(t,F.current)}return!1}),[]),Wr=t((function(r,e){if(void 0===e&&(e=!0),Dr.current.isDirty||Dr.current.dirtyFields){var t=!ir(W(F.current,r),Q(y,r,P)),n=W(Fr.current.dirtyFields,r),i=Fr.current.isDirty;t?T(Fr.current.dirtyFields,r,!0):rr(Fr.current.dirtyFields,r);var a={isDirty:Mr(),dirtyFields:Fr.current.dirtyFields},u=Dr.current.isDirty&&i!==a.isDirty||Dr.current.dirtyFields&&n!==W(Fr.current.dirtyFields,r);return u&&e&&Br(a),u?a:{}}return{}}),[]),Hr=t((async function(r,e){if("production"!==process.env.NODE_ENV&&!y.current[r])return console.warn("📋 Field is missing with `name` attribute: ",r),!1;var t=(await mr(y,vr,y.current[r],P))[r];return Tr(r,t,e),M(t)}),[Tr,vr]),_r=t((async function(r){var e=(await K.current(Jr(),J.current,vr)).errors,t=Fr.current.isValid;if(Array.isArray(r)){var n=r.map((function(r){var t=W(e,r);return t?T(Fr.current.errors,r,t):rr(Fr.current.errors,r),!t})).every(Boolean);return Br({isValid:Y(e),isValidating:!1}),n}var i=W(e,r);return Tr(r,i,t!==Y(e),{},Y(e)),!i}),[Tr,vr]),Pr=t((async function(r){var e=r||Object.keys(y.current);if(Lr(),K.current)return _r(e);if(Array.isArray(e)){!r&&(Fr.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)}),[_r,Hr]),zr=t((function(r,e,t){var n=t.shouldDirty,i=t.shouldValidate,a={};T(a,r,e);for(var u=0,o=gr(r,e);u<o.length;u+=1){var s=o[u];y.current[s]&&(qr(s,W(a,s)),n&&Wr(s),i&&Pr(s))}}),[Pr,qr,Wr]),Ur=t((function(r,e,t){var n,i;if(!d&&!tr(e)&&T(P.current,r,Array.isArray(e)?[].concat(e):Object.assign({},e)),y.current[r])qr(r,e),t.shouldDirty&&Wr(r),t.shouldValidate&&Pr(r);else if(!tr(e)&&(zr(r,e,t),Z.current.has(r))){var a=br(r)||r;T(j.current,r,e),I.current[a](((n={})[a]=W(j.current,a),n)),(Dr.current.isDirty||Dr.current.dirtyFields)&&t.shouldDirty&&(T(Fr.current.dirtyFields,r,function(r,e,t){return nr(ar(r,e,t.slice(0,r.length)),ar(e,r,t.slice(0,r.length)))}(e,W(F.current,r,[]),W(Fr.current.dirtyFields,r,[]))),Br({isDirty:!ir(Object.assign(Object.assign({},Jr()),(i={},i[r]=e,i)),F.current)}))}!d&&T(P.current,r,e)}),[Wr,qr,zr]),$r=function(r){return L.current||E.current.has(r)||E.current.has((r.match(/\w+/)||[])[0])},Gr=function(r){var e=!0;if(!Y(w.current))for(var t in w.current)r&&w.current[t].size&&!w.current[t].has(r)&&!w.current[t].has(br(r))||(k.current[t](),e=!1);return e};function Ir(r){var e;if(!d){for(var t=Or(r),n=0,i=Z.current;n<i.length;n+=1){var a=i[n];N(a)&&!t[a]&&(t=Object.assign(Object.assign({},t),((e={})[a]=[],e)))}return t}return r}function Jr(r){if(ur(r))return Q(y,r,P);if(Array.isArray(r)){for(var e={},t=0,n=r;t<n.length;t+=1){var i=n[t];T(e,i,Q(y,i,P))}return e}return Ir(or(y,Or(P.current),d))}_.current=_.current?_.current:async function(r){var e,t,n=r.type,i=r.target,a=i.name,u=y.current[a];if(u){var o=n===g,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:!!W(Fr.current.touched,a),isSubmitted:Fr.current.isSubmitted},sr.current)),c=Wr(a,!1),l=!Y(c)||!o&&$r(a);if(o&&!W(Fr.current.touched,a)&&Dr.current.touched&&(T(Fr.current.touched,a,!0),c=Object.assign(Object.assign({},c),{touched:Fr.current.touched})),!d&&$(i)&&T(P.current,a,Q(y,a)),s)return!o&&Gr(a),(!Y(c)||l&&Y(c))&&Br(c);if(Lr(),K.current){var f=(await K.current(Jr(),J.current,vr)).errors,v=Fr.current.isValid;if(e=W(f,a),$(i)&&!e&&K.current){var m=br(a),p=W(f,m,{});p.type&&p.message&&(e=p),m&&(p||W(Fr.current.errors,m))&&(a=m)}v!==(t=Y(f))&&(l=!0)}else e=(await mr(y,vr,u,P))[a];!o&&Gr(a),Tr(a,e,l,c,t)}};var Kr=t((async function(r){void 0===r&&(r={});var e=Y(y.current)?F.current:{},t=(await K.current(Object.assign(Object.assign(Object.assign({},e),Jr()),r),J.current,vr)||{}).errors,n=Y(t);Fr.current.isValid!==n&&Br({isValid:n})}),[vr]),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=Q(r,o,n);!M(c)&&T(n.current,o,c)}u.type&&s?z(u)||$(u)?Array.isArray(s.options)&&s.options.length?(B(s.options).forEach((function(r,t){void 0===r&&(r={}),(X(r.ref)&&er(r,r.ref)||a)&&(H(r.ref,e),rr(s.options,"["+t+"]"))})),s.options&&!B(s.options).length&&delete r.current[o]):delete r.current[o]:(X(u)&&er(s,u)||a)&&(H(u,e),delete r.current[o]):delete r.current[o]}(y,_.current,r,P,d,e),d&&(rr(D.current,r.ref.name),rr(S.current,r.ref.name))}),[d]),Xr=t((function(r){if(L.current)Br();else{for(var e=0,t=E.current;e<t.length;e+=1){if(t[e].startsWith(r)){Br();break}}Gr(r)}}),[]),Yr=t((function(r,e){r&&(Qr(r,e),d&&!B(r.options||[]).length&&(rr(Fr.current.errors,r.ref.name),T(Fr.current.dirtyFields,r.ref.name,!0),Br({isDirty:Mr()}),Dr.current.isValid&&K.current&&Kr(),Xr(r.ref.name)))}),[Kr,Qr]);var Zr=t((function(r,e,t){var n=t?w.current[t]:E.current,i=or(y,Or(P.current),d,!1,r);if(ur(r)){var a=br(r)||r;return Z.current.has(a)&&(i=Object.assign(Object.assign({},A.current),i)),pr(i,r,n,M(W(F.current,r))?e:W(F.current,r),!0)}var u=M(e)?F.current:e;return Array.isArray(r)?r.reduce((function(r,e){var t;return Object.assign(Object.assign({},r),((t={})[e]=pr(i,e,n,u),t))}),{}):(L.current=M(t),q(!Y(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(Z.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=y.current,s=Ar(r),c=yr(Z.current,n),l=function(e){return hr&&(!m(r)||e===r)},f=o[n],v=!0;if(f&&(s?Array.isArray(f.options)&&B(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:B(f&&f.options||[]).concat([{ref:r}]),ref:{type:i,name:n}},e):Object.assign({},u):u,o[n]=f;var h=M(W(P.current,n));Y(F.current)&&h||(t=W(h?F.current:P.current,n),(v=M(t))||c||qr(n,t)),Y(e)||(T(S.current,n,!0),!fr&&Dr.current.isValid&&mr(y,vr,f,P).then((function(r){var e=Fr.current.isValid;Y(r)?T(D.current,n,!0):rr(D.current,n),e!==Y(r)&&Br()}))),!d||c&&v||!c&&rr(Fr.current.dirtyFields,n),i&&function(r,e,t){var n=r.ref;m(n)&&t&&(n.addEventListener(e?p:b,t),n.addEventListener(g,t))}(s&&f.options?f.options[f.options.length-1]:f,s||"select-one"===r.type,_.current)}}var ee=t((function(r,e){return async function(t){t&&t.preventDefault&&(t.preventDefault(),t.persist());var n={},i=Ir(or(y,Or(P.current),d,!0));Dr.current.isSubmitting&&Br({isSubmitting:!0});try{if(K.current){var a=await K.current(i,J.current,vr),u=a.errors,o=a.values;Fr.current.errors=n=u,i=o}else for(var s=0,c=Object.values(y.current);s<c.length;s+=1){var l=c[s];if(l){var v=l.ref.name,m=await mr(y,vr,l,P);m[v]?(T(n,v,m[v]),rr(D.current,v)):W(S.current,v)&&(rr(Fr.current.errors,v),T(D.current,v,!0))}}Y(n)&&Object.keys(Fr.current.errors).every((function(r){return r in y.current}))?(Br({errors:{},isSubmitting:!0}),await r(i,t)):(Fr.current.errors=Object.assign(Object.assign({},Fr.current.errors),n),e&&await e(Fr.current.errors,t),f&&function(r,e){for(var t in r)if(W(e,t)){var n=r[t];if(n){if(n.ref.focus&&M(n.ref.focus()))break;if(n.options){n.options[0].ref.focus();break}}}}(y.current,Fr.current.errors))}finally{Fr.current.isSubmitting=!1,Br({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Y(Fr.current.errors),submitCount:Fr.current.submitCount+1})}}}),[f,vr]);a((function(){s&&Dr.current.isValid&&Kr(),xr.current=xr.current||!hr?xr.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&&X(o.ref)&&e(i)}else i&&X(i.ref)&&e(i)}}));return t.observe(window.document,{childList:!0,subtree:!0}),t}(y,Yr)}),[Yr,F.current]),a((function(){return function(){xr.current&&xr.current.disconnect(),R.current=!0,"production"===process.env.NODE_ENV&&Object.values(y.current).forEach((function(r){return Yr(r,!0)}))}}),[]),!s&&Dr.current.isValid&&(kr.isValid=ir(D.current,S.current)&&Y(Fr.current.errors));var te={trigger:Pr,setValue:t((function(r,e,t){Ur(r,e,t||{}),$r(r)&&Br(),Gr(r)}),[Ur,Pr]),getValues:t(Jr,[]),register:t((function(r,e){if(!Er)if(ur(r))re({name:r},e);else{if(!C(r)||!("name"in r))return function(e){return e&&re(e,r)};re(r,e)}}),[F.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(y.current[n],!0)}}),[]),formState:wr?new Proxy(kr,{get:function(r,e){if("production"!==process.env.NODE_ENV&&"isValid"===e&&fr&&console.warn("📋 `formState.isValid` is applicable with `onTouched`, `onChange` or `onBlur` mode. https://react-hook-form.com/api#formState"),e in r)return Dr.current[e]=!0,r[e]}}):kr},ne=u((function(){return Object.assign({isFormDirty:Mr,updateWatchedValue:Xr,shouldUnregister:d,updateFormState:Br,removeFieldEventListener:Qr,watchInternal:Zr,mode:sr.current,reValidateMode:{isReValidateOnBlur:Cr,isReValidateOnChange:Nr},validateResolver:s?Kr:void 0,fieldsRef:y,resetFieldArrayFunctionRef:I,useWatchFieldsRef:w,useWatchRenderFunctionsRef:k,fieldArrayDefaultValuesRef:j,validFieldsRef:D,fieldsWithValidationRef:S,fieldArrayNamesRef:Z,readFormStateRef:Dr,formStateRef:Fr,defaultValuesRef:F,shallowFieldsStateRef:P,fieldArrayValuesRef:A},te)}),[F.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={}),hr)for(var t=0,n=Object.values(y.current);t<n.length;t+=1){var i=n[t];if(i){var a=i.ref,u=i.options,o=Ar(a)&&Array.isArray(u)?u[0].ref:a;if(m(o))try{o.closest("form").reset();break}catch(r){}}}y.current={},F.current=Object.assign({},r||F.current),r&&Gr(""),Object.values(I.current).forEach((function(r){return lr(r)&&r()})),P.current=d?{}:Or(r||F.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||(D.current={},S.current={}),j.current={},E.current=new Set,L.current=!1,Br({submitCount:u?Fr.current.submitCount:0,isDirty:!!t&&Fr.current.isDirty,isSubmitted:!!n&&Fr.current.isSubmitted,isValid:!!a&&Fr.current.isValid,dirtyFields:o?Fr.current.dirtyFields:{},touched:i?Fr.current.touched:{},errors:e?Fr.current.errors:{},isSubmitting:!1,isSubmitSuccessful:!1})}(e)}),[]),clearErrors:t((function(r){r&&(Array.isArray(r)?r:[r]).forEach((function(r){return y.current[r]&&N(r)?delete Fr.current.errors[r]:rr(Fr.current.errors,r)})),Br({errors:r?Fr.current.errors:{}})}),[]),setError:t((function(r,e){var t=(y.current[r]||{}).ref;T(Fr.current.errors,r,Object.assign(Object.assign({},e),{ref:t})),Br({isValid:!1}),e.shouldFocus&&t&&t.focus&&t.focus()}),[]),errors:kr.errors},te)}e(null).displayName="RHFContext",function(r){r.formgroup="formgroup",r.checkbox="checkbox",r.radiobutton="radiobutton",r.textarea="textarea"}(jr||(jr={}));export default function(e){var t=e.exampleType,n=void 0===t?jr.formgroup:t,i=kr(),a=i.register,u=i.handleSubmit,o=i.errors,m=o.formgroup1||o.formgroup2||o.formgroup3||o.formgroup4,g="Du må velge et alternativ",p=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:m?"Sjekk at alt er riktig utfylt":void 0},n===jr.formgroup?[r.createElement(c,{key:0,title:"One amazing title",legend:"Check out these checkboxes!",error:o.formgroup1?o.formgroup1.message:void 0,variant:e.variant,name:"formgroup1"},r.createElement(l,{label:"Checkbox 1",ref:a({required:g})}),r.createElement(l,{label:"Checkbox 2",ref:a({required:g})}),r.createElement(l,{label:"Checkbox 3",ref:a({required:g})})),r.createElement(c,{key:1,legend:"Select two options!",error:o.formgroup2?o.formgroup2.message:void 0,variant:e.variant,name:"formgroup2"},r.createElement(l,{label:"Checkbox 4",ref:a({validate:p})}),r.createElement(l,{label:"Checkbox 5",ref:a({validate:p})}),r.createElement(l,{label:"Checkbox 6",ref:a({validate:p})})),r.createElement(c,{key:2,legend:"Select two options!",error:o.formgroup3?o.formgroup3.message:void 0,variant:e.variant,name:"formgroup3"},r.createElement(d,{label:"Radiobutton 1",ref:a({required:g})}),r.createElement(d,{label:"Radiobutton 2",ref:a({required:g})}),r.createElement(d,{label:"Radiobutton 3",ref:a({required:g})})),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",name:"formgroup4",ref:a({maxLength:{value:40,message:"Det kan ikke legges inn mer enn 40 tegn"}})}))]:n===jr.checkbox?r.createElement(c,{name:"formgroup1",error:o.formgroup1?o.formgroup1.message:void 0},r.createElement(l,{name:"formgroup1",label:"Checkbox 1",error:o.formgroup1,variant:e.variant,ref:a({required:g})})):n===jr.radiobutton?r.createElement(c,{name:"formgroup3",error:o.formgroup3?o.formgroup3.message:void 0},r.createElement(d,{name:"formgroup3",label:"Radiobutton 1",error:o.formgroup3,variant:e.variant,ref:a({required:g})})):n===jr.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",name:"formgroup4",ref:a({maxLength:{value:40,message:"Det kan ikke legges inn mer enn 40 tegn"}})})):void 0),r.createElement(f,null,"Submit"))}
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-ef9ee0ae.js";import{F as c}from"../../FormGroup-68288be3.js";import{C as l}from"../../Checkbox-0ba01292.js";import{B as f}from"../../Button-72f96290.js";import{R as d}from"../../RadioButton-84ca988e.js";import{T as v}from"../../Textarea-9c91191a.js";import"../../index-9b84fabc.js";import"../Validation/styles.module.scss";import"../../_rollupPluginBabelHelpers-d0752906.js";import"../FormGroup/styles.module.scss";import"../../constants-a4b0b501.js";import"../../Title-90910763.js";import"../Title/styles.module.scss";import"../../uuid-8870ab4b.js";import"../../Check-6291ad09.js";import"../../Icon-9b4a8a2d.js";import"../../_tslib-51c8a283.js";import"../../color-acb834c6.js";import"../../index-19b48c51.js";import"../../palette-f206f488.js";import"../../grid-11a70eb7.js";import"../Checkbox/styles.module.scss";import"../../Loader-b3fd59f4.js";import"../Loader/styles.module.scss";import"../../useHover-037be19d.js";import"../../useWindowSize-73b47451.js";import"../Button/styles.module.scss";import"../RadioButton/styles.module.scss";import"../Textarea/styles.module.scss";var m=function(r){return r instanceof HTMLElement},g="blur",p="change",b="input",y="onBlur",h="onChange",O="onSubmit",j="onTouched",V="all",A="max",E="min",w="maxLength",k="minLength",S="pattern",D="required",x="validate";var F=function(r){return null==r},R=function(r){return"object"==typeof r},C=function(r){return!F(r)&&!Array.isArray(r)&&R(r)&&!(r instanceof Date)},N=function(r){return/^\w*$/.test(r)},B=function(r){return r.filter(Boolean)},L=function(r){return B(r.replace(/["|']/g,"").replace(/\[/g,".").replace(/\]/g,"").split("."))};function T(r,e,t){for(var n=-1,i=N(e)?[e]:L(e),a=i.length,u=a-1;++n<a;){var o=i[n],s=t;if(n!==u){var c=r[o];s=C(c)||Array.isArray(c)?c:isNaN(+i[n+1])?{}:[]}r[o]=s,r=r[o]}return r}var q=function(r,e){for(var t in void 0===e&&(e={}),r)N(t)?e[t]=r[t]:T(e,t,r[t]);return e},M=function(r){return void 0===r},W=function(r,e,t){void 0===r&&(r={});var n=B(e.split(/[,[\].]+?/)).reduce((function(r,e){return F(r)?r:r[e]}),r);return M(n)||n===r?M(r[e])?t:r[e]:n},H=function(r,e){m(r)&&r.removeEventListener&&(r.removeEventListener(b,e),r.removeEventListener(p,e),r.removeEventListener(g,e))},_={isValid:!1,value:null},P=function(r){return Array.isArray(r)?r.reduce((function(r,e){return e&&e.ref.checked?{isValid:!0,value:e.ref.value}:r}),_):_},z=function(r){return"radio"===r.type},U=function(r){return"file"===r.type},$=function(r){return"checkbox"===r.type},G=function(r){return"select-multiple"===r.type},I={value:!1,isValid:!1},J={value:!0,isValid:!0},K=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&&!M(a.value)?M(i)||""===i?J:{value:i,isValid:!0}:J:I}return I};function Q(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 U(l)?l.files:z(l)?P(u.options).value:G(l)?(a=l.options,[].concat(a).filter((function(r){return r.selected})).map((function(r){return r.value}))):$(l)?K(u.options).value:i?s:f?""===s?NaN:+s:d?l.valueAsDate:v?v(s):s}if(t)return W(t.current,e)}function X(r){return!r||r instanceof HTMLElement&&r.nodeType!==Node.DOCUMENT_NODE&&X(r.parentNode)}var Y=function(r){return C(r)&&!Object.keys(r).length},Z=function(r){return"boolean"==typeof r};function rr(r,e){var t,n=N(e)?[e]:L(e),i=1==n.length?r:function(r,e){for(var t=e.slice(0,-1).length,n=0;n<t;)r=M(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&&(C(s)&&Y(s)||Array.isArray(s)&&!s.filter((function(r){return C(r)&&!Y(r)||Z(r)})).length)&&(t?delete t[f]:delete r[f]),t=s}}return r}var er=function(r,e){return r&&r.ref===e};var tr=function(r){return F(r)||!R(r)};function nr(r,e){if(tr(r)||tr(e))return e;for(var t in e){var n=r[t],i=e[t];try{r[t]=C(n)&&C(i)||Array.isArray(n)&&Array.isArray(i)?nr(n,i):i}catch(r){}}return r}function ir(r,e,t){if(tr(r)||tr(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((C(c)||Array.isArray(c))&&(C(l)||Array.isArray(l))?!ir(c,l,t):c!==l)return!1}}}return!0}function ar(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]=[],ar(r[u][o],W(e[u]||{},o,[]),t[u][o],t[u],o)):ir(W(e[u]||{},o),r[u][o])?T(t[u]||{},o):t[u]=Object.assign(Object.assign({},t[u]),((a={})[o]=!0,a));n&&!t.length&&delete n[i]}return t}var ur=function(r){return"string"==typeof r},or=function(r,e,t,n,i){var a={},u=function(e){(M(i)||(ur(i)?e.startsWith(i):Array.isArray(i)&&i.find((function(r){return e.startsWith(r)}))))&&(a[e]=Q(r,e,void 0,n))};for(var o in r.current)u(o);return t?q(a):nr(e,q(a))},sr=function(r){return r instanceof RegExp},cr=function(r){return C(r)&&!sr(r)?r:{value:r,message:""}},lr=function(r){return"function"==typeof r},fr=function(r){return ur(r)||o(r)};function dr(r,e,t){if(void 0===t&&(t="validate"),fr(r)||Z(r)&&!r)return{type:t,message:fr(r)?r:"",ref:e}}var vr=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))}):{}},mr=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=$(i),y=p||b,h=""===a,O=vr.bind(null,m,e,g),j=function(r,e,t,n,a){void 0===n&&(n=w),void 0===a&&(a=k);var u=r?e:t;g[m]=Object.assign({type:r?n:a,message:u,ref:i},O(r?n:a,u))};if(o&&(!p&&!b&&(h||F(a))||Z(a)&&!a||b&&!K(u).isValid||p&&!P(u).isValid)){var V=fr(o)?{value:!!o,message:o}:cr(o),R=V.value,N=V.message;if(R&&(g[m]=Object.assign({type:D,message:N,ref:y?((r.current[m].options||[])[0]||{}).ref:i},O(D,N)),!e))return g}if(!(F(l)&&F(f)||""===a)){var B,L,T=cr(f),q=cr(l);if(isNaN(a)){var M=i.valueAsDate||new Date(a);ur(T.value)&&(B=M>new Date(T.value)),ur(q.value)&&(L=M<new Date(q.value))}else{var W=i.valueAsNumber||parseFloat(a);F(T.value)||(B=W>T.value),F(q.value)||(L=W<q.value)}if((B||L)&&(j(!!B,T.message,q.message,A,E),!e))return g}if(ur(a)&&!h&&(s||c)){var H=cr(s),_=cr(c),U=!F(H.value)&&a.length>H.value,G=!F(_.value)&&a.length<_.value;if((U||G)&&(j(U,H.message,_.message),!e))return g}if(ur(a)&&d&&!h){var I=cr(d),J=I.value,X=I.message;if(sr(J)&&!J.test(a)&&(g[m]=Object.assign({type:S,message:X,ref:i},O(S,X)),!e))return g}if(v){var rr=Q(r,m,n,!1,!0),er=y&&u?u[0].ref:i;if(lr(v)){var tr=dr(await v(rr),er);if(tr&&(g[m]=Object.assign(Object.assign({},tr),O(x,tr.message)),!e))return g}else if(C(v)){for(var nr={},ir=0,ar=Object.entries(v);ir<ar.length;ir+=1){var or=ar[ir],mr=or[0],gr=or[1];if(!Y(nr)&&!e)break;var pr=dr(await gr(rr),er,mr);pr&&(nr=Object.assign(Object.assign({},pr),O(mr,pr.message)),e&&(g[m]=nr))}if(!Y(nr)&&(g[m]=Object.assign({ref:er},nr),!e))return g}}return g},gr=function(r,e,t){for(var n in void 0===t&&(t=[]),e){var i=r+(C(e)?"."+n:"["+n+"]");tr(e[n])?t.push(i):gr(i,e[n],t)}return t},pr=function(r,e,t,n,i){var a=void 0;return t.add(e),Y(r)||(a=W(r,e),(C(a)||Array.isArray(a))&&gr(e,a).forEach((function(r){return t.add(r)}))),M(a)?i?n:W(n,e):a},br=function(r){return r.substring(0,r.indexOf("["))},yr=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 hr="undefined"!=typeof window&&"undefined"!=typeof document;function Or(r){var e,t;if(tr(r)||hr&&(r instanceof File||m(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,Or(r.get(s)))}return t}for(var c in t=Array.isArray(r)?[]:{},r)t[c]=Or(r[c]);return t}var jr,Vr=function(r){return{isOnSubmit:!r||r===O,isOnBlur:r===y,isOnChange:r===h,isOnAll:r===V,isOnTouch:r===j}},Ar=function(r){return z(r)||$(r)},Er="undefined"==typeof window,wr=hr?"Proxy"in window:"undefined"!=typeof Proxy;function kr(r){void 0===r&&(r={});var e=r.mode;void 0===e&&(e=O);var o=r.reValidateMode;void 0===o&&(o=h);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,y=n({}),j=n({}),A=n({}),E=n(new Set),w=n({}),k=n({}),S=n({}),D=n({}),x=n(l),R=n(!1),L=n(!1),_=n(),P=n({}),I=n({}),J=n(c),K=n(s),Z=n(new Set),sr=n(Vr(e)),cr=sr.current,fr=cr.isOnSubmit,dr=cr.isOnTouch,vr=v===V,jr=i({isDirty:!1,isValidating:!1,dirtyFields:{},isSubmitted:!1,submitCount:0,touched:{},isSubmitting:!1,isSubmitSuccessful:!1,isValid:!fr,errors:{}}),kr=jr[0],Sr=jr[1],Dr=n({isDirty:!wr,dirtyFields:!wr,touched:!wr||dr,isValidating:!wr,isSubmitting:!wr,isValid:!wr}),xr=n(kr),Fr=n(),Rr=n(Vr(o)).current,Cr=Rr.isOnBlur,Nr=Rr.isOnChange;J.current=c,K.current=s,xr.current=kr,P.current=d?{}:Y(P.current)?Or(l):P.current;var Br=t((function(r){void 0===r&&(r={}),R.current||(xr.current=Object.assign(Object.assign({},xr.current),r),Sr(xr.current))}),[]),Lr=function(){return Dr.current.isValidating&&Br({isValidating:!0})},Tr=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=M(n),o=W(e,t);return u&&!!o||!u&&!ir(o,n,!0)||u&&W(a,t)&&!W(i,t)}({errors:xr.current.errors,error:e,name:r,validFields:D.current,fieldsWithValidation:S.current}),u=W(xr.current.errors,r);e?(rr(D.current,r),a=a||!u||!ir(u,e,!0),T(xr.current.errors,r,e)):((W(S.current,r)||K.current)&&(T(D.current,r,!0),a=a||u),rr(xr.current.errors,r)),(a&&!F(t)||!Y(n)||Dr.current.isValidating)&&Br(Object.assign(Object.assign(Object.assign({},n),K.current?{isValid:!!i}:{}),{isValidating:!1}))}),[]),qr=t((function(r,e){var t=y.current[r],n=t.ref,i=t.options,a=hr&&m(n)&&F(e)?"":e;z(n)?(i||[]).forEach((function(r){var e=r.ref;return e.checked=e.value===a})):U(n)&&!ur(a)?n.files=a:G(n)?[].concat(n.options).forEach((function(r){return r.selected=a.includes(r.value)})):$(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}),[]),Mr=t((function(r,e){if(Dr.current.isDirty){var t=Jr();return r&&e&&T(t,r,e),!ir(t,x.current)}return!1}),[]),Wr=t((function(r,e){if(void 0===e&&(e=!0),Dr.current.isDirty||Dr.current.dirtyFields){var t=!ir(W(x.current,r),Q(y,r,P)),n=W(xr.current.dirtyFields,r),i=xr.current.isDirty;t?T(xr.current.dirtyFields,r,!0):rr(xr.current.dirtyFields,r);var a={isDirty:Mr(),dirtyFields:xr.current.dirtyFields},u=Dr.current.isDirty&&i!==a.isDirty||Dr.current.dirtyFields&&n!==W(xr.current.dirtyFields,r);return u&&e&&Br(a),u?a:{}}return{}}),[]),Hr=t((async function(r,e){if("production"!==process.env.NODE_ENV&&!y.current[r])return console.warn("📋 Field is missing with `name` attribute: ",r),!1;var t=(await mr(y,vr,y.current[r],P))[r];return Tr(r,t,e),M(t)}),[Tr,vr]),_r=t((async function(r){var e=(await K.current(Jr(),J.current,vr)).errors,t=xr.current.isValid;if(Array.isArray(r)){var n=r.map((function(r){var t=W(e,r);return t?T(xr.current.errors,r,t):rr(xr.current.errors,r),!t})).every(Boolean);return Br({isValid:Y(e),isValidating:!1}),n}var i=W(e,r);return Tr(r,i,t!==Y(e),{},Y(e)),!i}),[Tr,vr]),Pr=t((async function(r){var e=r||Object.keys(y.current);if(Lr(),K.current)return _r(e);if(Array.isArray(e)){!r&&(xr.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)}),[_r,Hr]),zr=t((function(r,e,t){var n=t.shouldDirty,i=t.shouldValidate,a={};T(a,r,e);for(var u=0,o=gr(r,e);u<o.length;u+=1){var s=o[u];y.current[s]&&(qr(s,W(a,s)),n&&Wr(s),i&&Pr(s))}}),[Pr,qr,Wr]),Ur=t((function(r,e,t){var n,i;if(!d&&!tr(e)&&T(P.current,r,Array.isArray(e)?[].concat(e):Object.assign({},e)),y.current[r])qr(r,e),t.shouldDirty&&Wr(r),t.shouldValidate&&Pr(r);else if(!tr(e)&&(zr(r,e,t),Z.current.has(r))){var a=br(r)||r;T(j.current,r,e),I.current[a](((n={})[a]=W(j.current,a),n)),(Dr.current.isDirty||Dr.current.dirtyFields)&&t.shouldDirty&&(T(xr.current.dirtyFields,r,function(r,e,t){return nr(ar(r,e,t.slice(0,r.length)),ar(e,r,t.slice(0,r.length)))}(e,W(x.current,r,[]),W(xr.current.dirtyFields,r,[]))),Br({isDirty:!ir(Object.assign(Object.assign({},Jr()),(i={},i[r]=e,i)),x.current)}))}!d&&T(P.current,r,e)}),[Wr,qr,zr]),$r=function(r){return L.current||E.current.has(r)||E.current.has((r.match(/\w+/)||[])[0])},Gr=function(r){var e=!0;if(!Y(w.current))for(var t in w.current)r&&w.current[t].size&&!w.current[t].has(r)&&!w.current[t].has(br(r))||(k.current[t](),e=!1);return e};function Ir(r){var e;if(!d){for(var t=Or(r),n=0,i=Z.current;n<i.length;n+=1){var a=i[n];N(a)&&!t[a]&&(t=Object.assign(Object.assign({},t),((e={})[a]=[],e)))}return t}return r}function Jr(r){if(ur(r))return Q(y,r,P);if(Array.isArray(r)){for(var e={},t=0,n=r;t<n.length;t+=1){var i=n[t];T(e,i,Q(y,i,P))}return e}return Ir(or(y,Or(P.current),d))}_.current=_.current?_.current:async function(r){var e,t,n=r.type,i=r.target,a=i.name,u=y.current[a];if(u){var o=n===g,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:!!W(xr.current.touched,a),isSubmitted:xr.current.isSubmitted},sr.current)),c=Wr(a,!1),l=!Y(c)||!o&&$r(a);if(o&&!W(xr.current.touched,a)&&Dr.current.touched&&(T(xr.current.touched,a,!0),c=Object.assign(Object.assign({},c),{touched:xr.current.touched})),!d&&$(i)&&T(P.current,a,Q(y,a)),s)return!o&&Gr(a),(!Y(c)||l&&Y(c))&&Br(c);if(Lr(),K.current){var f=(await K.current(Jr(),J.current,vr)).errors,v=xr.current.isValid;if(e=W(f,a),$(i)&&!e&&K.current){var m=br(a),p=W(f,m,{});p.type&&p.message&&(e=p),m&&(p||W(xr.current.errors,m))&&(a=m)}v!==(t=Y(f))&&(l=!0)}else e=(await mr(y,vr,u,P))[a];!o&&Gr(a),Tr(a,e,l,c,t)}};var Kr=t((async function(r){void 0===r&&(r={});var e=Y(y.current)?x.current:{},t=(await K.current(Object.assign(Object.assign(Object.assign({},e),Jr()),r),J.current,vr)||{}).errors,n=Y(t);xr.current.isValid!==n&&Br({isValid:n})}),[vr]),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=Q(r,o,n);!M(c)&&T(n.current,o,c)}u.type&&s?z(u)||$(u)?Array.isArray(s.options)&&s.options.length?(B(s.options).forEach((function(r,t){void 0===r&&(r={}),(X(r.ref)&&er(r,r.ref)||a)&&(H(r.ref,e),rr(s.options,"["+t+"]"))})),s.options&&!B(s.options).length&&delete r.current[o]):delete r.current[o]:(X(u)&&er(s,u)||a)&&(H(u,e),delete r.current[o]):delete r.current[o]}(y,_.current,r,P,d,e),d&&(rr(D.current,r.ref.name),rr(S.current,r.ref.name))}),[d]),Xr=t((function(r){if(L.current)Br();else{for(var e=0,t=E.current;e<t.length;e+=1){if(t[e].startsWith(r)){Br();break}}Gr(r)}}),[]),Yr=t((function(r,e){r&&(Qr(r,e),d&&!B(r.options||[]).length&&(rr(xr.current.errors,r.ref.name),T(xr.current.dirtyFields,r.ref.name,!0),Br({isDirty:Mr()}),Dr.current.isValid&&K.current&&Kr(),Xr(r.ref.name)))}),[Kr,Qr]);var Zr=t((function(r,e,t){var n=t?w.current[t]:E.current,i=or(y,Or(P.current),d,!1,r);if(ur(r)){var a=br(r)||r;return Z.current.has(a)&&(i=Object.assign(Object.assign({},A.current),i)),pr(i,r,n,M(W(x.current,r))?e:W(x.current,r),!0)}var u=M(e)?x.current:e;return Array.isArray(r)?r.reduce((function(r,e){var t;return Object.assign(Object.assign({},r),((t={})[e]=pr(i,e,n,u),t))}),{}):(L.current=M(t),q(!Y(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(Z.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=y.current,s=Ar(r),c=yr(Z.current,n),l=function(e){return hr&&(!m(r)||e===r)},f=o[n],v=!0;if(f&&(s?Array.isArray(f.options)&&B(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:B(f&&f.options||[]).concat([{ref:r}]),ref:{type:i,name:n}},e):Object.assign({},u):u,o[n]=f;var h=M(W(P.current,n));Y(x.current)&&h||(t=W(h?x.current:P.current,n),(v=M(t))||c||qr(n,t)),Y(e)||(T(S.current,n,!0),!fr&&Dr.current.isValid&&mr(y,vr,f,P).then((function(r){var e=xr.current.isValid;Y(r)?T(D.current,n,!0):rr(D.current,n),e!==Y(r)&&Br()}))),!d||c&&v||!c&&rr(xr.current.dirtyFields,n),i&&function(r,e,t){var n=r.ref;m(n)&&t&&(n.addEventListener(e?p:b,t),n.addEventListener(g,t))}(s&&f.options?f.options[f.options.length-1]:f,s||"select-one"===r.type,_.current)}}var ee=t((function(r,e){return async function(t){t&&t.preventDefault&&(t.preventDefault(),t.persist());var n={},i=Ir(or(y,Or(P.current),d,!0));Dr.current.isSubmitting&&Br({isSubmitting:!0});try{if(K.current){var a=await K.current(i,J.current,vr),u=a.errors,o=a.values;xr.current.errors=n=u,i=o}else for(var s=0,c=Object.values(y.current);s<c.length;s+=1){var l=c[s];if(l){var v=l.ref.name,m=await mr(y,vr,l,P);m[v]?(T(n,v,m[v]),rr(D.current,v)):W(S.current,v)&&(rr(xr.current.errors,v),T(D.current,v,!0))}}Y(n)&&Object.keys(xr.current.errors).every((function(r){return r in y.current}))?(Br({errors:{},isSubmitting:!0}),await r(i,t)):(xr.current.errors=Object.assign(Object.assign({},xr.current.errors),n),e&&await e(xr.current.errors,t),f&&function(r,e){for(var t in r)if(W(e,t)){var n=r[t];if(n){if(n.ref.focus&&M(n.ref.focus()))break;if(n.options){n.options[0].ref.focus();break}}}}(y.current,xr.current.errors))}finally{xr.current.isSubmitting=!1,Br({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Y(xr.current.errors),submitCount:xr.current.submitCount+1})}}}),[f,vr]);a((function(){s&&Dr.current.isValid&&Kr(),Fr.current=Fr.current||!hr?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&&X(o.ref)&&e(i)}else i&&X(i.ref)&&e(i)}}));return t.observe(window.document,{childList:!0,subtree:!0}),t}(y,Yr)}),[Yr,x.current]),a((function(){return function(){Fr.current&&Fr.current.disconnect(),R.current=!0,"production"===process.env.NODE_ENV&&Object.values(y.current).forEach((function(r){return Yr(r,!0)}))}}),[]),!s&&Dr.current.isValid&&(kr.isValid=ir(D.current,S.current)&&Y(xr.current.errors));var te={trigger:Pr,setValue:t((function(r,e,t){Ur(r,e,t||{}),$r(r)&&Br(),Gr(r)}),[Ur,Pr]),getValues:t(Jr,[]),register:t((function(r,e){if(!Er)if(ur(r))re({name:r},e);else{if(!C(r)||!("name"in r))return function(e){return e&&re(e,r)};re(r,e)}}),[x.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(y.current[n],!0)}}),[]),formState:wr?new Proxy(kr,{get:function(r,e){if("production"!==process.env.NODE_ENV&&"isValid"===e&&fr&&console.warn("📋 `formState.isValid` is applicable with `onTouched`, `onChange` or `onBlur` mode. https://react-hook-form.com/api#formState"),e in r)return Dr.current[e]=!0,r[e]}}):kr},ne=u((function(){return Object.assign({isFormDirty:Mr,updateWatchedValue:Xr,shouldUnregister:d,updateFormState:Br,removeFieldEventListener:Qr,watchInternal:Zr,mode:sr.current,reValidateMode:{isReValidateOnBlur:Cr,isReValidateOnChange:Nr},validateResolver:s?Kr:void 0,fieldsRef:y,resetFieldArrayFunctionRef:I,useWatchFieldsRef:w,useWatchRenderFunctionsRef:k,fieldArrayDefaultValuesRef:j,validFieldsRef:D,fieldsWithValidationRef:S,fieldArrayNamesRef:Z,readFormStateRef:Dr,formStateRef:xr,defaultValuesRef:x,shallowFieldsStateRef:P,fieldArrayValuesRef:A},te)}),[x.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={}),hr)for(var t=0,n=Object.values(y.current);t<n.length;t+=1){var i=n[t];if(i){var a=i.ref,u=i.options,o=Ar(a)&&Array.isArray(u)?u[0].ref:a;if(m(o))try{o.closest("form").reset();break}catch(r){}}}y.current={},x.current=Object.assign({},r||x.current),r&&Gr(""),Object.values(I.current).forEach((function(r){return lr(r)&&r()})),P.current=d?{}:Or(r||x.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||(D.current={},S.current={}),j.current={},E.current=new Set,L.current=!1,Br({submitCount:u?xr.current.submitCount:0,isDirty:!!t&&xr.current.isDirty,isSubmitted:!!n&&xr.current.isSubmitted,isValid:!!a&&xr.current.isValid,dirtyFields:o?xr.current.dirtyFields:{},touched:i?xr.current.touched:{},errors:e?xr.current.errors:{},isSubmitting:!1,isSubmitSuccessful:!1})}(e)}),[]),clearErrors:t((function(r){r&&(Array.isArray(r)?r:[r]).forEach((function(r){return y.current[r]&&N(r)?delete xr.current.errors[r]:rr(xr.current.errors,r)})),Br({errors:r?xr.current.errors:{}})}),[]),setError:t((function(r,e){var t=(y.current[r]||{}).ref;T(xr.current.errors,r,Object.assign(Object.assign({},e),{ref:t})),Br({isValid:!1}),e.shouldFocus&&t&&t.focus&&t.focus()}),[]),errors:kr.errors},te)}e(null).displayName="RHFContext",function(r){r.formgroup="formgroup",r.checkbox="checkbox",r.radiobutton="radiobutton",r.textarea="textarea"}(jr||(jr={}));var Sr=function(e){var t=e.exampleType,n=void 0===t?jr.formgroup:t,i=kr(),a=i.register,u=i.handleSubmit,o=i.errors,m=o.formgroup1||o.formgroup2||o.formgroup3||o.formgroup4,g="Du må velge et alternativ",p=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:m?"Sjekk at alt er riktig utfylt":void 0},n===jr.formgroup?[r.createElement(c,{key:0,title:"One amazing title",legend:"Check out these checkboxes!",error:o.formgroup1?o.formgroup1.message:void 0,variant:e.variant,name:"formgroup1"},r.createElement(l,{label:"Checkbox 1",ref:a({required:g})}),r.createElement(l,{label:"Checkbox 2",ref:a({required:g})}),r.createElement(l,{label:"Checkbox 3",ref:a({required:g})})),r.createElement(c,{key:1,legend:"Select two options!",error:o.formgroup2?o.formgroup2.message:void 0,variant:e.variant,name:"formgroup2"},r.createElement(l,{label:"Checkbox 4",ref:a({validate:p})}),r.createElement(l,{label:"Checkbox 5",ref:a({validate:p})}),r.createElement(l,{label:"Checkbox 6",ref:a({validate:p})})),r.createElement(c,{key:2,legend:"Select two options!",error:o.formgroup3?o.formgroup3.message:void 0,variant:e.variant,name:"formgroup3"},r.createElement(d,{label:"Radiobutton 1",ref:a({required:g})}),r.createElement(d,{label:"Radiobutton 2",ref:a({required:g})}),r.createElement(d,{label:"Radiobutton 3",ref:a({required:g})})),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",name:"formgroup4",ref:a({maxLength:{value:40,message:"Det kan ikke legges inn mer enn 40 tegn"}})}))]:n===jr.checkbox?r.createElement(c,{name:"formgroup1",error:o.formgroup1?o.formgroup1.message:void 0},r.createElement(l,{name:"formgroup1",label:"Checkbox 1",error:o.formgroup1,variant:e.variant,ref:a({required:g})})):n===jr.radiobutton?r.createElement(c,{name:"formgroup3",error:o.formgroup3?o.formgroup3.message:void 0},r.createElement(d,{name:"formgroup3",label:"Radiobutton 1",error:o.formgroup3,variant:e.variant,ref:a({required:g})})):n===jr.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",name:"formgroup4",ref:a({maxLength:{value:40,message:"Det kan ikke legges inn mer enn 40 tegn"}})})):void 0),r.createElement(f,null,"Submit"))};export default Sr;export{Sr as FormExample,jr as FormExampleVariants};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,3 +1,4 @@
1
1
  import FormGroup from './FormGroup';
2
+ export * from './FormGroup';
2
3
  export default FormGroup;
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/FormGroup/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/FormGroup/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,eAAe,SAAS,CAAC"}
@@ -1,2 +1,2 @@
1
- import{F as o}from"../../FormGroup-9555dd73.js";export{F as default}from"../../FormGroup-9555dd73.js";import"../../_rollupPluginBabelHelpers-d0752906.js";import"react";import"../../index-9b84fabc.js";import"./styles.module.scss";import"../../Checkbox-0ba01292.js";import"../../uuid-8870ab4b.js";import"../../Check-6291ad09.js";import"../../Icon-9b4a8a2d.js";import"../../_tslib-51c8a283.js";import"../../constants-a4b0b501.js";import"../../color-acb834c6.js";import"../../index-19b48c51.js";import"../../palette-f206f488.js";import"../../grid-11a70eb7.js";import"../Checkbox/styles.module.scss";import"../../Title-72851d51.js";import"../Title/styles.module.scss";import"../../RadioButton-84ca988e.js";import"../RadioButton/styles.module.scss";
1
+ import{F as o}from"../../FormGroup-68288be3.js";export{F as FormGroup,F as default}from"../../FormGroup-68288be3.js";import"../../_rollupPluginBabelHelpers-d0752906.js";import"react";import"../../index-9b84fabc.js";import"./styles.module.scss";import"../../Checkbox-0ba01292.js";import"../../uuid-8870ab4b.js";import"../../Check-6291ad09.js";import"../../Icon-9b4a8a2d.js";import"../../_tslib-51c8a283.js";import"../../constants-a4b0b501.js";import"../../color-acb834c6.js";import"../../index-19b48c51.js";import"../../palette-f206f488.js";import"../../grid-11a70eb7.js";import"../Checkbox/styles.module.scss";import"../../Title-90910763.js";import"../Title/styles.module.scss";import"../../RadioButton-84ca988e.js";import"../RadioButton/styles.module.scss";
2
2
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+ import { PaletteNames } from '../../theme/palette';
3
+ export declare type HighlightBoxColors = Extract<PaletteNames, 'white' | 'blueberry' | 'cherry' | 'neutral' | 'kiwi' | 'plum'>;
4
+ export declare enum HighlightBoxSize {
5
+ medium = "medium",
6
+ large = "large",
7
+ fluid = "fluid"
8
+ }
9
+ export declare type HighlightBoxTags = Exclude<keyof HTMLElementTagNameMap, 'dir' | 'font' | 'frame' | 'frameset' | 'marquee' | 'applet' | 'basefont'>;
10
+ interface HighlightBoxProps {
11
+ /** What's in the box? */
12
+ children: React.ReactNode;
13
+ /** Changes the background color. Default: white */
14
+ color?: HighlightBoxColors;
15
+ /** Changes the size. Default: medium */
16
+ size?: keyof typeof HighlightBoxSize;
17
+ /** Changes the underlying element. Default: div */
18
+ htmlMarkup?: HighlightBoxTags;
19
+ /** Sets the data-testid attribute. */
20
+ testId?: string;
21
+ }
22
+ declare const HighlightBox: React.FC<HighlightBoxProps>;
23
+ export default HighlightBox;
24
+ //# sourceMappingURL=HighlightBox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HighlightBox.d.ts","sourceRoot":"","sources":["../../../src/components/HighlightBox/HighlightBox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAInD,oBAAY,kBAAkB,GAAG,OAAO,CAAC,YAAY,EAAE,OAAO,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC,CAAC;AAEvH,oBAAY,gBAAgB;IAC1B,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,KAAK,UAAU;CAChB;AAED,oBAAY,gBAAgB,GAAG,OAAO,CACpC,MAAM,qBAAqB,EAC3B,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,GAAG,QAAQ,GAAG,UAAU,CAC1E,CAAC;AAEF,UAAU,iBAAiB;IACzB,yBAAyB;IACzB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,mDAAmD;IACnD,KAAK,CAAC,EAAE,kBAAkB,CAAC;IAC3B,wCAAwC;IACxC,IAAI,CAAC,EAAE,MAAM,OAAO,gBAAgB,CAAC;IACrC,mDAAmD;IACnD,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAwB7C,CAAC;AAEF,eAAe,YAAY,CAAC"}