@helsenorge/designsystem-react 1.0.0-beta76 → 1.0.0-beta77

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.
@@ -1,2 +1,2 @@
1
- import{_ as t,a as e}from"./_rollupPluginBabelHelpers-e1c7fe69.js";import{_ as n}from"./_tslib-51c8a283.js";import o from"react";import{g as r}from"./color-acb834c6.js";import{a as i}from"./constants-d1f48e8e.js";import{L as l}from"./Loader-ad8bcd78.js";import{u as a}from"./useHover-57ad4df9.js";import{u as s}from"./useWindowSize-c22d7634.js";import{b as d}from"./grid-11a70eb7.js";import{c as u}from"./index-9b84fabc.js";import c from"./components/Button/styles.module.scss";var b={primary:"blueberry",warning:"banana",danger:"cherry"};var f=function(t,e){return e&&e<d.md&&t?i.Small:t?i.Medium:i.XSmall},m=o.forwardRef((function(d,m){var v,g,_,p=d.children,h=d.className,w=void 0===h?"":h,j=d.fluid,E=void 0!==j&&j,y=d.intent,N=void 0===y?"primary":y,k=d.inverted,C=void 0!==k&&k,I=d.htmlMarkup,H=void 0===I?"button":I,O=d.onClick,S=d.large,z=void 0!==S&&S,B=d.loading,F=void 0!==B&&B,M=d.variant,x=void 0===M?"fill":M,L=d.disabled,R=void 0!==L&&L,X=d.ellipsis,A=void 0!==X&&X,P=d.testId,W=d.href,q=d.target,D=n(d,["children","className","fluid","intent","inverted","htmlMarkup","onClick","large","loading","variant","disabled","ellipsis","testId","href","target"]),G=function(t){var e,n,o,r,i=null,l=null;return void 0!==(null===(n=null===(e=t[0])||void 0===e?void 0:e.props)||void 0===n?void 0:n.svgIcon)&&(i=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)&&(l=t.pop()),[i,l,t]}(o.Children.toArray(p)),J=t(G,3),K=J[0],Q=J[1],T=J[2],U=a(m),V=U.hoverRef,Y=U.isHovered,Z=function(t,e,n,o,i){return e?r("neutral",600):t&&!o||!t&&o?"white":r(b[n],i?700:600)}("fill"===x,R,N,C,Y),$=s(),tt="fill"===x,et="outline"===x,nt="borderless"===x,ot="warning"===N,rt="danger"===N,it=!(!K&&!Q),lt=it&&!F&&!nt,at=it&&!F&&nt,st=Object.assign({},D),dt=u(c.button,(e(v={},c["button--fluid"],E),e(v,c["button--large"],z),e(v,c["button--fill"],tt),e(v,c["button--fill-warning"],tt&&ot),e(v,c["button--fill-danger"],tt&&rt),e(v,c["button--fill-inverted"],tt&&C),e(v,c["button--fill-not-inverted"],tt&&!C),e(v,c["button--outline"],et),e(v,c["button--outline-warning"],et&&ot),e(v,c["button--outline-danger"],et&&rt),e(v,c["button--outline-inverted"],et&&C),e(v,c["button--borderless"],nt),e(v,c["button--borderless-warning"],nt&&ot),e(v,c["button--borderless-danger"],nt&&rt),e(v,c["button--borderless-inverted"],nt&&C),e(v,c["button--with-icon"],lt),e(v,c["button--large-with-icon"],lt&&z),e(v,c["button--ellipsis-with-icon"],lt&&A),e(v,c["button--borderless-with-icon"],at),e(v,c["button--large-borderless-with-icon"],at&&z),v),w),ut=u(c.button__content,(e(g={},c["button__content--fill"],tt),e(g,c["button__content--fill-warning"],tt&&ot),e(g,c["button__content--fill-danger"],tt&&rt),e(g,c["button__content--fill-not-inverted"],tt&&!C),e(g,c["button__content--borderless"],nt),e(g,c["button__content--borderless-warning"],nt&&ot),e(g,c["button__content--borderless-danger"],nt&&rt),e(g,c["button__content--borderless-inverted"],nt&&C),e(g,c["button__content--with-icon"],lt),e(g,c["button__content--large-with-icon"],lt&&z),e(g,c["button__content--ellipsis-with-icon"],lt&&A),e(g,c["button__content--fluid-with-icon"],lt&&E),e(g,c["button__content--large-fluid-with-icon"],lt&&E&&z),g)),ct=u(c["button__left-fluid-content"],(e(_={},c["button__left-fluid-content--with-icon"],it),e(_,c["button__left-fluid-content--large-with-icon"],it&&z),_));function bt(t,e,n,r){var i=t&&t.props&&t.props.color?t.props.color:n;return t&&Object.keys(t).length>0?o.cloneElement(t,{size:e,color:i,isHovered:r}):null}var ft=function(){return o.createElement("span",{className:ut},T)},mt=function(){return o.createElement("span",{className:c["content-wrapper"]},F?o.createElement("div",{className:c["button__left-fluid-content"]},o.createElement(l,{testId:"test-id-loader",color:"fill"!==x||C?b[N]:"white",size:"tiny"})):o.createElement(o.Fragment,null,E?o.createElement("div",{className:ct},bt(K,f(z,$.width),Z,Y),ft()):o.createElement(o.Fragment,null,bt(K,f(z,$.width),Z,Y),ft()),bt(Q,i.XSmall,Z,Y)))};return o.createElement(o.Fragment,null,"button"===H&&o.createElement("button",Object.assign({onClick:O,disabled:R,"data-testid":P,className:dt,ref:V},st),mt()),"a"===H&&o.createElement("a",Object.assign({onClick:O,"data-testid":P,className:dt,href:W,target:q,ref:V},D),mt()))}));export{m as B};
2
- //# sourceMappingURL=Button-79ff79f4.js.map
1
+ import{_ as t,a as e}from"./_rollupPluginBabelHelpers-e1c7fe69.js";import{_ as n}from"./_tslib-51c8a283.js";import o from"react";import{g as r}from"./color-acb834c6.js";import{a as i}from"./constants-d1f48e8e.js";import{L as l}from"./Loader-084dd998.js";import{u as a}from"./useHover-57ad4df9.js";import{u as s}from"./useWindowSize-c22d7634.js";import{b as d}from"./grid-11a70eb7.js";import{c as u}from"./index-9b84fabc.js";import c from"./components/Button/styles.module.scss";var b={primary:"blueberry",warning:"banana",danger:"cherry"};var f=function(t,e){return e&&e<d.md&&t?i.Small:t?i.Medium:i.XSmall},m=o.forwardRef((function(d,m){var v,g,_,p=d.children,h=d.className,w=void 0===h?"":h,j=d.fluid,E=void 0!==j&&j,y=d.intent,N=void 0===y?"primary":y,k=d.inverted,C=void 0!==k&&k,I=d.htmlMarkup,H=void 0===I?"button":I,O=d.onClick,S=d.large,z=void 0!==S&&S,B=d.loading,F=void 0!==B&&B,M=d.variant,x=void 0===M?"fill":M,L=d.disabled,R=void 0!==L&&L,X=d.ellipsis,A=void 0!==X&&X,P=d.testId,W=d.href,q=d.target,D=n(d,["children","className","fluid","intent","inverted","htmlMarkup","onClick","large","loading","variant","disabled","ellipsis","testId","href","target"]),G=function(t){var e,n,o,r,i=null,l=null;return void 0!==(null===(n=null===(e=t[0])||void 0===e?void 0:e.props)||void 0===n?void 0:n.svgIcon)&&(i=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)&&(l=t.pop()),[i,l,t]}(o.Children.toArray(p)),J=t(G,3),K=J[0],Q=J[1],T=J[2],U=a(m),V=U.hoverRef,Y=U.isHovered,Z=function(t,e,n,o,i){return e?r("neutral",600):t&&!o||!t&&o?"white":r(b[n],i?700:600)}("fill"===x,R,N,C,Y),$=s(),tt="fill"===x,et="outline"===x,nt="borderless"===x,ot="warning"===N,rt="danger"===N,it=!(!K&&!Q),lt=it&&!F&&!nt,at=it&&!F&&nt,st=Object.assign({},D),dt=u(c.button,(e(v={},c["button--fluid"],E),e(v,c["button--large"],z),e(v,c["button--fill"],tt),e(v,c["button--fill-warning"],tt&&ot),e(v,c["button--fill-danger"],tt&&rt),e(v,c["button--fill-inverted"],tt&&C),e(v,c["button--fill-not-inverted"],tt&&!C),e(v,c["button--outline"],et),e(v,c["button--outline-warning"],et&&ot),e(v,c["button--outline-danger"],et&&rt),e(v,c["button--outline-inverted"],et&&C),e(v,c["button--borderless"],nt),e(v,c["button--borderless-warning"],nt&&ot),e(v,c["button--borderless-danger"],nt&&rt),e(v,c["button--borderless-inverted"],nt&&C),e(v,c["button--with-icon"],lt),e(v,c["button--large-with-icon"],lt&&z),e(v,c["button--ellipsis-with-icon"],lt&&A),e(v,c["button--borderless-with-icon"],at),e(v,c["button--large-borderless-with-icon"],at&&z),v),w),ut=u(c.button__content,(e(g={},c["button__content--fill"],tt),e(g,c["button__content--fill-warning"],tt&&ot),e(g,c["button__content--fill-danger"],tt&&rt),e(g,c["button__content--fill-not-inverted"],tt&&!C),e(g,c["button__content--borderless"],nt),e(g,c["button__content--borderless-warning"],nt&&ot),e(g,c["button__content--borderless-danger"],nt&&rt),e(g,c["button__content--borderless-inverted"],nt&&C),e(g,c["button__content--with-icon"],lt),e(g,c["button__content--large-with-icon"],lt&&z),e(g,c["button__content--ellipsis-with-icon"],lt&&A),e(g,c["button__content--fluid-with-icon"],lt&&E),e(g,c["button__content--large-fluid-with-icon"],lt&&E&&z),g)),ct=u(c["button__left-fluid-content"],(e(_={},c["button__left-fluid-content--with-icon"],it),e(_,c["button__left-fluid-content--large-with-icon"],it&&z),_));function bt(t,e,n,r){var i=t&&t.props&&t.props.color?t.props.color:n;return t&&Object.keys(t).length>0?o.cloneElement(t,{size:e,color:i,isHovered:r}):null}var ft=function(){return o.createElement("span",{className:ut},T)},mt=function(){return o.createElement("span",{className:c["content-wrapper"]},F?o.createElement("div",{className:c["button__left-fluid-content"]},o.createElement(l,{testId:"test-id-loader",color:"fill"!==x||C?b[N]:"white",size:"tiny"})):o.createElement(o.Fragment,null,E?o.createElement("div",{className:ct},bt(K,f(z,$.width),Z,Y),ft()):o.createElement(o.Fragment,null,bt(K,f(z,$.width),Z,Y),ft()),bt(Q,i.XSmall,Z,Y)))};return o.createElement(o.Fragment,null,"button"===H&&o.createElement("button",Object.assign({onClick:O,disabled:R,"data-testid":P,className:dt,ref:V},st),mt()),"a"===H&&o.createElement("a",Object.assign({onClick:O,"data-testid":P,className:dt,href:W,target:q,ref:V},D),mt()))}));export{m as B};
2
+ //# sourceMappingURL=Button-f5b8067b.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Button-f5b8067b.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import{a as e}from"./_rollupPluginBabelHelpers-e1c7fe69.js";import a from"react";import{c as r}from"./index-9b84fabc.js";import o from"./components/Loader/styles.module.scss";import l from"crypto";var t=new Uint8Array(256),d=t.length;function i(){return d>t.length-16&&(l.randomFillSync(t),d=0),t.slice(d,d+=16)}var n=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var s=[],m=0;m<256;++m)s.push((m+256).toString(16).substr(1));function c(e,a){void 0===a&&(a=0);var r=(s[e[a+0]]+s[e[a+1]]+s[e[a+2]]+s[e[a+3]]+"-"+s[e[a+4]]+s[e[a+5]]+"-"+s[e[a+6]]+s[e[a+7]]+"-"+s[e[a+8]]+s[e[a+9]]+"-"+s[e[a+10]]+s[e[a+11]]+s[e[a+12]]+s[e[a+13]]+s[e[a+14]]+s[e[a+15]]).toLowerCase();if(!function(e){return"string"==typeof e&&n.test(e)}(r))throw TypeError("Stringified UUID is invalid");return r}function f(e,a,r){var o=(e=e||{}).random||(e.rng||i)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,a){r=r||0;for(var l=0;l<16;++l)a[r+l]=o[l];return a}return c(o)}var _=a.forwardRef((function(l,t){var d,i,n,s=l.color,m=void 0===s?"neutral":s,c=l.size,_=void 0===c?"small":c,u=l.className,v=void 0===u?"":u,p=l.testId,b=void 0===p?"":p,y=l.center,g=l.overlay,w=l.ariaLabelledById,h=l.ariaLabel,E=void 0===h?"Laster inn":h,N="small"===_,L="medium"===_,k="large"===_,x=r(o["loader-wrapper"],(e(d={},o["loader-wrapper--center"],y),e(d,o["loader-wrapper--overlay"],g),d)),I=r(o.loader,(e(i={},o["loader--small"],N),e(i,o["loader--medium"],L),e(i,o["loader--large"],k),i),v),S=r(o.loader__dot,(e(n={},o["loader__dot--small"],N),e(n,o["loader__dot--medium"],L),e(n,o["loader__dot--large"],k),e(n,o["loader__dot--banana"],"banana"===m),e(n,o["loader__dot--cherry"],"cherry"===m),e(n,o["loader__dot--kiwi"],"kiwi"===m),e(n,o["loader__dot--neutral"],"neutral"===m),e(n,o["loader__dot--plum"],"plum"===m),e(n,o["loader__dot--black"],"black"===m),e(n,o["loader__dot--white"],"white"===m),n)),U="loader".concat(f());return a.createElement("div",{role:"progressbar",className:x},a.createElement("div",{"data-testid":b,"aria-labelledby":w||U,className:I},a.createElement("div",{className:S}),a.createElement("div",{className:S}),a.createElement("div",{className:S}),a.createElement("div",{className:S}),!w&&a.createElement("span",{id:U,className:o["loader__hidden-text"]},E)))}));export{_ as L,f as v};
2
+ //# sourceMappingURL=Loader-084dd998.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Loader-084dd998.js","sources":["../node_modules/uuid/dist/esm-node/rng.js","../node_modules/uuid/dist/esm-node/regex.js","../node_modules/uuid/dist/esm-node/stringify.js","../node_modules/uuid/dist/esm-node/validate.js","../node_modules/uuid/dist/esm-node/v4.js"],"sourcesContent":["import crypto from 'crypto';\nconst rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate\n\nlet poolPtr = rnds8Pool.length;\nexport default function rng() {\n if (poolPtr > rnds8Pool.length - 16) {\n crypto.randomFillSync(rnds8Pool);\n poolPtr = 0;\n }\n\n return rnds8Pool.slice(poolPtr, poolPtr += 16);\n}","export default /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;","import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nconst byteToHex = [];\n\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).substr(1));\n}\n\nfunction stringify(arr, offset = 0) {\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n const uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;","import REGEX from './regex.js';\n\nfunction validate(uuid) {\n return typeof uuid === 'string' && REGEX.test(uuid);\n}\n\nexport default validate;","import rng from './rng.js';\nimport stringify from './stringify.js';\n\nfunction v4(options, buf, offset) {\n options = options || {};\n const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return stringify(rnds);\n}\n\nexport default v4;"],"names":["const","rnds8Pool","Uint8Array","poolPtr","length","rng","crypto","randomFillSync","slice","byteToHex","i","push","toString","substr","stringify","arr","offset","uuid","toLowerCase","REGEX","test","validate","TypeError","v4","options","buf","rnds","random","let"],"mappings":"qMACAA,IAAMC,EAAY,IAAIC,WAAW,KAE7BC,EAAUF,EAAUG,OACT,SAASC,IAMtB,OALIF,EAAUF,EAAUG,OAAS,KAC/BE,EAAOC,eAAeN,GACtBE,EAAU,GAGLF,EAAUO,MAAML,EAASA,GAAW,ICV7C,MAAe,sHCQf,IAFAH,IAAMS,EAAY,GAETC,EAAI,EAAGA,EAAI,MAAOA,EACzBD,EAAUE,MAAMD,EAAI,KAAOE,SAAS,IAAIC,OAAO,IAGjD,SAASC,EAAUC,EAAKC,kBAAS,GAG/BhB,IAAMiB,GAAQR,EAAUM,EAAIC,EAAS,IAAMP,EAAUM,EAAIC,EAAS,IAAMP,EAAUM,EAAIC,EAAS,IAAMP,EAAUM,EAAIC,EAAS,IAAM,IAAMP,EAAUM,EAAIC,EAAS,IAAMP,EAAUM,EAAIC,EAAS,IAAM,IAAMP,EAAUM,EAAIC,EAAS,IAAMP,EAAUM,EAAIC,EAAS,IAAM,IAAMP,EAAUM,EAAIC,EAAS,IAAMP,EAAUM,EAAIC,EAAS,IAAM,IAAMP,EAAUM,EAAIC,EAAS,KAAOP,EAAUM,EAAIC,EAAS,KAAOP,EAAUM,EAAIC,EAAS,KAAOP,EAAUM,EAAIC,EAAS,KAAOP,EAAUM,EAAIC,EAAS,KAAOP,EAAUM,EAAIC,EAAS,MAAME,cAM3f,ICnBF,SAAkBD,GAChB,MAAuB,iBAATA,GAAqBE,EAAMC,KAAKH,GDkBzCI,CAASJ,GACZ,MAAMK,UAAU,+BAGlB,OAAOL,EEtBT,SAASM,EAAGC,EAASC,EAAKT,GAExBhB,IAAM0B,GADNF,EAAUA,GAAW,IACAG,SAAWH,EAAQnB,KAAOA,KAK/C,GAHAqB,EAAK,GAAe,GAAVA,EAAK,GAAY,GAC3BA,EAAK,GAAe,GAAVA,EAAK,GAAY,IAEvBD,EAAK,CACPT,EAASA,GAAU,EAEnB,IAAKY,IAAIlB,EAAI,EAAGA,EAAI,KAAMA,EACxBe,EAAIT,EAASN,GAAKgB,EAAKhB,GAGzB,OAAOe,EAGT,OAAOX,EAAUY"}
@@ -0,0 +1,2 @@
1
+ import e,{useRef as t,useEffect as r}from"react";import{c as n}from"./index-9b84fabc.js";import{p as a}from"./palette-f206f488.js";import{B as o}from"./Button-f5b8067b.js";import{I as l}from"./constants-d1f48e8e.js";import{X as c,A as i,a as s}from"./AlertSignFill-64bfef57.js";import d from"./components/Modal/styles.module.scss";import{T as u}from"./Title-863af332.js";import{v as m}from"./Loader-084dd998.js";function v(){var e=t(null);function n(t){var r=e.current.querySelectorAll('a[href], button, textarea, input[type="text"], input[type="radio"], input[type="checkbox"], select'),n=r[0],a=1===r.length?n:r[r.length-1];"Tab"===t.key&&(t.shiftKey?document.activeElement===n&&(a.focus(),t.preventDefault()):document.activeElement===a&&(n.focus(),t.preventDefault()))}function a(t){var r=e.current.querySelectorAll('a[href], button, textarea, input[type="text"], input[type="radio"], input[type="checkbox"], select');1===r.length&&(r[0].focus(),t.preventDefault())}return r((function(){var t=e.current;return t.addEventListener("keydown",n),t.addEventListener("click",a),function(){t.removeEventListener("keydown",n),t.removeEventListener("click",a)}}),[]),e}var f;!function(e){e.normal="normal",e.warning="warning",e.error="error"}(f||(f={}));var p={variant:f.normal,primaryButtonText:"OK",large:!1,className:""},y=function(t){return e.createElement("button",{className:d.lukkekryss,"aria-label":t.ariaLabel||"Lukk",onClick:t.onClick,autoFocus:!0,role:"button"},e.createElement(l,{svgIcon:c,color:a.blueberry600,size:42}))},E=e.forwardRef((function(t,c){var p,E,b;function k(e){"Escape"===e.key&&t.onClose&&(e.stopPropagation(),t.onClose())}function g(e){e.target&&C.current===e.target&&t.onClose&&(e.stopPropagation(),t.onClose())}var h,L=null!==(p=t.titleId)&&void 0!==p?p:m(),x=e.useRef(null),C=e.useRef(null),B=t.secondaryButtonText&&(null===(E=t.secondaryButtonText)||void 0===E?void 0:E.length)>0||t.onSuccess,N=t.ariaLabelledBy?void 0:t.ariaLabel,w=t.ariaLabelledBy?t.ariaLabelledBy:t.ariaLabel?void 0:L;return r((function(){var e=x.current,t=C.current;return document.body.style.overflow="hidden",e&&(e.addEventListener("keydown",k),t.addEventListener("click",g)),function(){document.body.style.removeProperty("overflow"),e.removeEventListener("keydown",k),t.removeEventListener("click",g)}})),e.createElement("div",{ref:x,"data-testid":"dialog-container"},e.createElement("div",{ref:C,className:d["modal-overlay"],"data-testid":t.testId},e.createElement("div",{className:d.align,ref:v()},e.createElement("div",{className:n(t.className,d.modal,d[t.variant],t.large?d.large:""),role:"dialog","aria-label":N,"aria-labelledby":w},!t.noCloseButton&&e.createElement("div",{className:d.close},e.createElement(y,{onClick:t.onClose,ariaLabel:t.ariaLabelCloseBtn})),e.createElement("div",{className:d.contentWrapper},e.createElement("div",{className:d.title},t.variant&&((h=t.variant)===f.error?e.createElement("div",null,e.createElement(l,{svgIcon:i,color:a.cherry500,hoverColor:a.cherry500})):h===f.warning?e.createElement("div",null,e.createElement(l,{svgIcon:s,color:a.black,hoverColor:a.black})):null),e.createElement("div",null,e.createElement(u,{id:L,htmlMarkup:"h3",appearance:"title3"},t.title))),e.createElement("div",{className:d.content},t.children&&e.createElement("div",null,t.children),t.description&&!t.children&&e.createElement("p",{className:d.description},t.description)),B&&e.createElement("div",{className:d.actions},t.onSuccess&&e.createElement(o,{onClick:t.onSuccess},t.primaryButtonText),t.secondaryButtonText&&(null===(b=t.secondaryButtonText)||void 0===b?void 0:b.length)>0&&e.createElement(o,{variant:"borderless",onClick:t.onClose},t.secondaryButtonText)))))))}));E.defaultProps=p;export{E as M};
2
+ //# sourceMappingURL=Modal-53dee2d3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Modal-53dee2d3.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- import{B as s}from"../../Button-79ff79f4.js";export{B as default}from"../../Button-79ff79f4.js";import"../../_rollupPluginBabelHelpers-e1c7fe69.js";import"../../_tslib-51c8a283.js";import"react";import"../../color-acb834c6.js";import"../../index-19b48c51.js";import"../../palette-f206f488.js";import"../../grid-11a70eb7.js";import"../../constants-d1f48e8e.js";import"../../Loader-ad8bcd78.js";import"../../index-9b84fabc.js";import"../Loader/styles.module.scss";import"../../useHover-57ad4df9.js";import"../../useWindowSize-c22d7634.js";import"./styles.module.scss";
1
+ import{B as o}from"../../Button-f5b8067b.js";export{B as default}from"../../Button-f5b8067b.js";import"../../_rollupPluginBabelHelpers-e1c7fe69.js";import"../../_tslib-51c8a283.js";import"react";import"../../color-acb834c6.js";import"../../index-19b48c51.js";import"../../palette-f206f488.js";import"../../grid-11a70eb7.js";import"../../constants-d1f48e8e.js";import"../../Loader-084dd998.js";import"../../index-9b84fabc.js";import"../Loader/styles.module.scss";import"crypto";import"../../useHover-57ad4df9.js";import"../../useWindowSize-c22d7634.js";import"./styles.module.scss";
2
2
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- import{_ as t}from"../../_rollupPluginBabelHelpers-e1c7fe69.js";import e,{useState as o}from"react";import{B as r}from"../../Button-79ff79f4.js";import{M as s}from"../../Modal-ab87aab2.js";import"../../_tslib-51c8a283.js";import"../../color-acb834c6.js";import"../../index-19b48c51.js";import"../../palette-f206f488.js";import"../../grid-11a70eb7.js";import"../../constants-d1f48e8e.js";import"../../Loader-ad8bcd78.js";import"../../index-9b84fabc.js";import"../Loader/styles.module.scss";import"../../useHover-57ad4df9.js";import"../../useWindowSize-c22d7634.js";import"../Button/styles.module.scss";import"../../AlertSignFill-64bfef57.js";import"../Modal/styles.module.scss";import"../../Title-863af332.js";import"../Title/styles.module.scss";import"crypto";var i=e.forwardRef((function(i){var m=o(!1),l=t(m,2),a=l[0],n=l[1];return e.createElement("div",null,e.createElement(r,{onClick:function(){return n(!0)}},i.buttonText),a&&e.createElement(s,Object.assign({},i,{onClose:function(){return n(!1)}})))}));export default i;
1
+ import{_ as t}from"../../_rollupPluginBabelHelpers-e1c7fe69.js";import e,{useState as o}from"react";import{B as r}from"../../Button-f5b8067b.js";import{M as s}from"../../Modal-53dee2d3.js";import"../../_tslib-51c8a283.js";import"../../color-acb834c6.js";import"../../index-19b48c51.js";import"../../palette-f206f488.js";import"../../grid-11a70eb7.js";import"../../constants-d1f48e8e.js";import"../../Loader-084dd998.js";import"../../index-9b84fabc.js";import"../Loader/styles.module.scss";import"crypto";import"../../useHover-57ad4df9.js";import"../../useWindowSize-c22d7634.js";import"../Button/styles.module.scss";import"../../AlertSignFill-64bfef57.js";import"../Modal/styles.module.scss";import"../../Title-863af332.js";import"../Title/styles.module.scss";var i=e.forwardRef((function(i){var m=o(!1),l=t(m,2),n=l[0],p=l[1];return e.createElement("div",null,e.createElement(r,{onClick:function(){return p(!0)}},i.buttonText),n&&e.createElement(s,Object.assign({},i,{onClose:function(){return p(!1)}})))}));export default i;
2
2
  //# sourceMappingURL=index.js.map
@@ -11,6 +11,14 @@ interface LoaderProps {
11
11
  size?: LoaderSizes;
12
12
  /** Sets the data-testid attribute. */
13
13
  testId?: string;
14
+ /** Centers the loader in a container */
15
+ center?: boolean;
16
+ /** Loader is displayed with grey background covering the entire screen */
17
+ overlay?: boolean;
18
+ /** individual id for loading icon (aria-labelledby). */
19
+ ariaLabelledById?: string;
20
+ /** individual id for loading icon (aria-labelledby). */
21
+ ariaLabel?: string;
14
22
  }
15
23
  declare const Loader: React.ForwardRefExoticComponent<LoaderProps & React.RefAttributes<HTMLElement>>;
16
24
  export default Loader;
@@ -1 +1 @@
1
- {"version":3,"file":"Loader.d.ts","sourceRoot":"","sources":["../../../src/components/Loader/Loader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAInD,oBAAY,YAAY,GAAG,YAAY,CAAC;AACxC,oBAAY,WAAW,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEhE,UAAU,WAAW;IACnB,mCAAmC;IACnC,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sCAAsC;IACtC,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,QAAA,MAAM,MAAM,iFAmCV,CAAC;AAEH,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"Loader.d.ts","sourceRoot":"","sources":["../../../src/components/Loader/Loader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGnD,oBAAY,YAAY,GAAG,YAAY,CAAC;AACxC,oBAAY,WAAW,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEhE,UAAU,WAAW;IACnB,mCAAmC;IACnC,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sCAAsC;IACtC,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,wCAAwC;IACxC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,0EAA0E;IAC1E,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,0DAA0D;IAC1D,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,0DAA0D;IAC1D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,MAAM,iFA0DV,CAAC;AAEH,eAAe,MAAM,CAAC"}
@@ -123,6 +123,82 @@
123
123
  "type": {
124
124
  "name": "string"
125
125
  }
126
+ },
127
+ "center": {
128
+ "defaultValue": null,
129
+ "description": "Centers the loader in a container",
130
+ "name": "center",
131
+ "parent": {
132
+ "fileName": "src/components/Loader/Loader.tsx",
133
+ "name": "LoaderProps"
134
+ },
135
+ "declarations": [
136
+ {
137
+ "fileName": "src/components/Loader/Loader.tsx",
138
+ "name": "LoaderProps"
139
+ }
140
+ ],
141
+ "required": false,
142
+ "type": {
143
+ "name": "boolean"
144
+ }
145
+ },
146
+ "overlay": {
147
+ "defaultValue": null,
148
+ "description": "Loader is displayed with grey background covering the entire screen",
149
+ "name": "overlay",
150
+ "parent": {
151
+ "fileName": "src/components/Loader/Loader.tsx",
152
+ "name": "LoaderProps"
153
+ },
154
+ "declarations": [
155
+ {
156
+ "fileName": "src/components/Loader/Loader.tsx",
157
+ "name": "LoaderProps"
158
+ }
159
+ ],
160
+ "required": false,
161
+ "type": {
162
+ "name": "boolean"
163
+ }
164
+ },
165
+ "ariaLabelledById": {
166
+ "defaultValue": null,
167
+ "description": "individual id for loading icon (aria-labelledby).",
168
+ "name": "ariaLabelledById",
169
+ "parent": {
170
+ "fileName": "src/components/Loader/Loader.tsx",
171
+ "name": "LoaderProps"
172
+ },
173
+ "declarations": [
174
+ {
175
+ "fileName": "src/components/Loader/Loader.tsx",
176
+ "name": "LoaderProps"
177
+ }
178
+ ],
179
+ "required": false,
180
+ "type": {
181
+ "name": "string"
182
+ }
183
+ },
184
+ "ariaLabel": {
185
+ "defaultValue": null,
186
+ "description": "individual id for loading icon (aria-labelledby).",
187
+ "name": "ariaLabel",
188
+ "parent": {
189
+ "fileName": "src/components/Loader/Loader.tsx",
190
+ "name": "LoaderProps"
191
+ },
192
+ "declarations": [
193
+ {
194
+ "fileName": "src/components/Loader/Loader.tsx",
195
+ "name": "LoaderProps"
196
+ }
197
+ ],
198
+ "required": false,
199
+ "type": {
200
+ "name": "string"
201
+ }
126
202
  }
127
203
  }
128
204
  }
@@ -1,2 +1,2 @@
1
- import{L as e}from"../../Loader-ad8bcd78.js";export{L as default}from"../../Loader-ad8bcd78.js";import"../../_rollupPluginBabelHelpers-e1c7fe69.js";import"react";import"../../index-9b84fabc.js";import"./styles.module.scss";
1
+ import{L as r}from"../../Loader-084dd998.js";export{L as default}from"../../Loader-084dd998.js";import"../../_rollupPluginBabelHelpers-e1c7fe69.js";import"react";import"../../index-9b84fabc.js";import"./styles.module.scss";import"crypto";
2
2
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,5 @@
1
1
  @import '../../scss/_palette.scss';
2
+ @import 'bootstrap/scss/mixins/_screen-reader.scss';
2
3
 
3
4
  @mixin keyframes($name) {
4
5
  @keyframes #{$name} {
@@ -35,6 +36,25 @@
35
36
  @include animate($name, translate, 0.6s, infinite);
36
37
  }
37
38
 
39
+ .loader-wrapper {
40
+ &--center {
41
+ text-align: center;
42
+ }
43
+
44
+ &--overlay {
45
+ z-index: 9999;
46
+ background: $transparentGrey;
47
+ position: fixed;
48
+ top: 0;
49
+ left: 0;
50
+ right: 0;
51
+ bottom: 0;
52
+ display: flex;
53
+ align-items: center;
54
+ justify-content: center;
55
+ }
56
+ }
57
+
38
58
  .loader {
39
59
  display: inline-block;
40
60
  position: relative;
@@ -56,6 +76,10 @@
56
76
  height: 24px;
57
77
  }
58
78
 
79
+ &__hidden-text {
80
+ @include sr-only();
81
+ }
82
+
59
83
  &__dot {
60
84
  position: absolute;
61
85
  width: 8px;
@@ -1,6 +1,8 @@
1
1
  export type Styles = {
2
+ center: string;
2
3
  loader: string;
3
4
  loader__dot: string;
5
+ ' loader__hidden-text': string;
4
6
  'loader__dot--banana': string;
5
7
  'loader__dot--black': string;
6
8
  'loader__dot--cherry': string;
@@ -14,6 +16,7 @@ export type Styles = {
14
16
  'loader--large': string;
15
17
  'loader--medium': string;
16
18
  'loader--small': string;
19
+ overlay: string;
17
20
  scale: string;
18
21
  'scale-regular': string;
19
22
  'scale-reverse': string;
@@ -1,2 +1,2 @@
1
- import{M as s}from"../../Modal-ab87aab2.js";export{M as default}from"../../Modal-ab87aab2.js";import"react";import"../../index-9b84fabc.js";import"../../palette-f206f488.js";import"../../Button-79ff79f4.js";import"../../_rollupPluginBabelHelpers-e1c7fe69.js";import"../../_tslib-51c8a283.js";import"../../color-acb834c6.js";import"../../index-19b48c51.js";import"../../grid-11a70eb7.js";import"../../constants-d1f48e8e.js";import"../../Loader-ad8bcd78.js";import"../Loader/styles.module.scss";import"../../useHover-57ad4df9.js";import"../../useWindowSize-c22d7634.js";import"../Button/styles.module.scss";import"../../AlertSignFill-64bfef57.js";import"./styles.module.scss";import"../../Title-863af332.js";import"../Title/styles.module.scss";import"crypto";
1
+ import{M as s}from"../../Modal-53dee2d3.js";export{M as default}from"../../Modal-53dee2d3.js";import"react";import"../../index-9b84fabc.js";import"../../palette-f206f488.js";import"../../Button-f5b8067b.js";import"../../_rollupPluginBabelHelpers-e1c7fe69.js";import"../../_tslib-51c8a283.js";import"../../color-acb834c6.js";import"../../index-19b48c51.js";import"../../grid-11a70eb7.js";import"../../constants-d1f48e8e.js";import"../../Loader-084dd998.js";import"../Loader/styles.module.scss";import"crypto";import"../../useHover-57ad4df9.js";import"../../useWindowSize-c22d7634.js";import"../Button/styles.module.scss";import"../../AlertSignFill-64bfef57.js";import"./styles.module.scss";import"../../Title-863af332.js";import"../Title/styles.module.scss";
2
2
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@helsenorge/designsystem-react",
3
3
  "sideEffects": false,
4
- "version": "1.0.0-beta76",
4
+ "version": "1.0.0-beta77",
5
5
  "description": "The official design system for Helsenorge built with React.",
6
6
  "repository": {
7
7
  "type": "tfs",
@@ -67,6 +67,8 @@ $plum700: #5b22a6;
67
67
  $plum800: #4c1b8c;
68
68
  $plum900: #3c1471;
69
69
 
70
+ $transparentGrey: rgba(102, 102, 102, 0.75);
71
+
70
72
  $palette-map: (
71
73
  'banana50': $banana50,
72
74
  'banana100': $banana100,
@@ -1 +0,0 @@
1
- {"version":3,"file":"Button-79ff79f4.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- import{a as e}from"./_rollupPluginBabelHelpers-e1c7fe69.js";import a from"react";import{c as l}from"./index-9b84fabc.js";import r from"./components/Loader/styles.module.scss";var o=a.forwardRef((function(o,d){var t,m,s=o.color,i=void 0===s?"neutral":s,c=o.size,_=void 0===c?"small":c,n=o.className,u=void 0===n?"":n,v=o.testId,p=void 0===v?"":v,f="small"===_,b="medium"===_,N="large"===_,w=l(r.loader,(e(t={},r["loader--small"],f),e(t,r["loader--medium"],b),e(t,r["loader--large"],N),t),u),E=l(r.loader__dot,(e(m={},r["loader__dot--small"],f),e(m,r["loader__dot--medium"],b),e(m,r["loader__dot--large"],N),e(m,r["loader__dot--banana"],"banana"===i),e(m,r["loader__dot--cherry"],"cherry"===i),e(m,r["loader__dot--kiwi"],"kiwi"===i),e(m,r["loader__dot--neutral"],"neutral"===i),e(m,r["loader__dot--plum"],"plum"===i),e(m,r["loader__dot--black"],"black"===i),e(m,r["loader__dot--white"],"white"===i),m));return a.createElement("div",{"data-testid":p,className:w},a.createElement("div",{className:E}),a.createElement("div",{className:E}),a.createElement("div",{className:E}),a.createElement("div",{className:E}))}));export{o as L};
2
- //# sourceMappingURL=Loader-ad8bcd78.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Loader-ad8bcd78.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/Modal-ab87aab2.js DELETED
@@ -1,2 +0,0 @@
1
- import e,{useRef as t,useEffect as r}from"react";import{c as n}from"./index-9b84fabc.js";import{p as a}from"./palette-f206f488.js";import{B as o}from"./Button-79ff79f4.js";import{I as l}from"./constants-d1f48e8e.js";import{X as i,A as c,a as s}from"./AlertSignFill-64bfef57.js";import u from"./components/Modal/styles.module.scss";import{T as d}from"./Title-863af332.js";import m from"crypto";var v=new Uint8Array(256),f=v.length;function p(){return f>v.length-16&&(m.randomFillSync(v),f=0),v.slice(f,f+=16)}var y=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var E,b=[],g=0;g<256;++g)b.push((g+256).toString(16).substr(1));function k(e,t){void 0===t&&(t=0);var r=(b[e[t+0]]+b[e[t+1]]+b[e[t+2]]+b[e[t+3]]+"-"+b[e[t+4]]+b[e[t+5]]+"-"+b[e[t+6]]+b[e[t+7]]+"-"+b[e[t+8]]+b[e[t+9]]+"-"+b[e[t+10]]+b[e[t+11]]+b[e[t+12]]+b[e[t+13]]+b[e[t+14]]+b[e[t+15]]).toLowerCase();if(!function(e){return"string"==typeof e&&y.test(e)}(r))throw TypeError("Stringified UUID is invalid");return r}function h(e,t,r){var n=(e=e||{}).random||(e.rng||p)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var a=0;a<16;++a)t[r+a]=n[a];return t}return k(n)}function L(){var e=t(null);function n(t){var r=e.current.querySelectorAll('a[href], button, textarea, input[type="text"], input[type="radio"], input[type="checkbox"], select'),n=r[0],a=1===r.length?n:r[r.length-1];"Tab"===t.key&&(t.shiftKey?document.activeElement===n&&(a.focus(),t.preventDefault()):document.activeElement===a&&(n.focus(),t.preventDefault()))}function a(t){var r=e.current.querySelectorAll('a[href], button, textarea, input[type="text"], input[type="radio"], input[type="checkbox"], select');1===r.length&&(r[0].focus(),t.preventDefault())}return r((function(){var t=e.current;return t.addEventListener("keydown",n),t.addEventListener("click",a),function(){t.removeEventListener("keydown",n),t.removeEventListener("click",a)}}),[]),e}!function(e){e.normal="normal",e.warning="warning",e.error="error"}(E||(E={}));var C={variant:E.normal,primaryButtonText:"OK",large:!1,className:""},x=function(t){return e.createElement("button",{className:u.lukkekryss,"aria-label":t.ariaLabel||"Lukk",onClick:t.onClick,autoFocus:!0,role:"button"},e.createElement(l,{svgIcon:i,color:a.blueberry600,size:42}))},B=e.forwardRef((function(t,i){var m,v,f;function p(e){"Escape"===e.key&&t.onClose&&(e.stopPropagation(),t.onClose())}function y(e){e.target&&C.current===e.target&&t.onClose&&(e.stopPropagation(),t.onClose())}var b,g=null!==(m=t.titleId)&&void 0!==m?m:h(),k=e.useRef(null),C=e.useRef(null),B=t.secondaryButtonText&&(null===(v=t.secondaryButtonText)||void 0===v?void 0:v.length)>0||t.onSuccess,w=t.ariaLabelledBy?void 0:t.ariaLabel,N=t.ariaLabelledBy?t.ariaLabelledBy:t.ariaLabel?void 0:g;return r((function(){var e=k.current,t=C.current;return document.body.style.overflow="hidden",e&&(e.addEventListener("keydown",p),t.addEventListener("click",y)),function(){document.body.style.removeProperty("overflow"),e.removeEventListener("keydown",p),t.removeEventListener("click",y)}})),e.createElement("div",{ref:k,"data-testid":"dialog-container"},e.createElement("div",{ref:C,className:u["modal-overlay"],"data-testid":t.testId},e.createElement("div",{className:u.align,ref:L()},e.createElement("div",{className:n(t.className,u.modal,u[t.variant],t.large?u.large:""),role:"dialog","aria-label":w,"aria-labelledby":N},!t.noCloseButton&&e.createElement("div",{className:u.close},e.createElement(x,{onClick:t.onClose,ariaLabel:t.ariaLabelCloseBtn})),e.createElement("div",{className:u.contentWrapper},e.createElement("div",{className:u.title},t.variant&&((b=t.variant)===E.error?e.createElement("div",null,e.createElement(l,{svgIcon:c,color:a.cherry500,hoverColor:a.cherry500})):b===E.warning?e.createElement("div",null,e.createElement(l,{svgIcon:s,color:a.black,hoverColor:a.black})):null),e.createElement("div",null,e.createElement(d,{id:g,htmlMarkup:"h3",appearance:"title3"},t.title))),e.createElement("div",{className:u.content},t.children&&e.createElement("div",null,t.children),t.description&&!t.children&&e.createElement("p",{className:u.description},t.description)),B&&e.createElement("div",{className:u.actions},t.onSuccess&&e.createElement(o,{onClick:t.onSuccess},t.primaryButtonText),t.secondaryButtonText&&(null===(f=t.secondaryButtonText)||void 0===f?void 0:f.length)>0&&e.createElement(o,{variant:"borderless",onClick:t.onClose},t.secondaryButtonText)))))))}));B.defaultProps=C;export{B as M};
2
- //# sourceMappingURL=Modal-ab87aab2.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Modal-ab87aab2.js","sources":["../node_modules/uuid/dist/esm-node/rng.js","../node_modules/uuid/dist/esm-node/regex.js","../node_modules/uuid/dist/esm-node/stringify.js","../node_modules/uuid/dist/esm-node/validate.js","../node_modules/uuid/dist/esm-node/v4.js"],"sourcesContent":["import crypto from 'crypto';\nconst rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate\n\nlet poolPtr = rnds8Pool.length;\nexport default function rng() {\n if (poolPtr > rnds8Pool.length - 16) {\n crypto.randomFillSync(rnds8Pool);\n poolPtr = 0;\n }\n\n return rnds8Pool.slice(poolPtr, poolPtr += 16);\n}","export default /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;","import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nconst byteToHex = [];\n\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).substr(1));\n}\n\nfunction stringify(arr, offset = 0) {\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n const uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;","import REGEX from './regex.js';\n\nfunction validate(uuid) {\n return typeof uuid === 'string' && REGEX.test(uuid);\n}\n\nexport default validate;","import rng from './rng.js';\nimport stringify from './stringify.js';\n\nfunction v4(options, buf, offset) {\n options = options || {};\n const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return stringify(rnds);\n}\n\nexport default v4;"],"names":["const","rnds8Pool","Uint8Array","poolPtr","length","rng","crypto","randomFillSync","slice","byteToHex","i","push","toString","substr","stringify","arr","offset","uuid","toLowerCase","REGEX","test","validate","TypeError","v4","options","buf","rnds","random","let"],"mappings":"yYACAA,IAAMC,EAAY,IAAIC,WAAW,KAE7BC,EAAUF,EAAUG,OACT,SAASC,IAMtB,OALIF,EAAUF,EAAUG,OAAS,KAC/BE,EAAOC,eAAeN,GACtBE,EAAU,GAGLF,EAAUO,MAAML,EAASA,GAAW,ICV7C,MAAe,sHCQf,IAFAH,MAAMS,EAAY,GAETC,EAAI,EAAGA,EAAI,MAAOA,EACzBD,EAAUE,MAAMD,EAAI,KAAOE,SAAS,IAAIC,OAAO,IAGjD,SAASC,EAAUC,EAAKC,kBAAS,GAG/BhB,IAAMiB,GAAQR,EAAUM,EAAIC,EAAS,IAAMP,EAAUM,EAAIC,EAAS,IAAMP,EAAUM,EAAIC,EAAS,IAAMP,EAAUM,EAAIC,EAAS,IAAM,IAAMP,EAAUM,EAAIC,EAAS,IAAMP,EAAUM,EAAIC,EAAS,IAAM,IAAMP,EAAUM,EAAIC,EAAS,IAAMP,EAAUM,EAAIC,EAAS,IAAM,IAAMP,EAAUM,EAAIC,EAAS,IAAMP,EAAUM,EAAIC,EAAS,IAAM,IAAMP,EAAUM,EAAIC,EAAS,KAAOP,EAAUM,EAAIC,EAAS,KAAOP,EAAUM,EAAIC,EAAS,KAAOP,EAAUM,EAAIC,EAAS,KAAOP,EAAUM,EAAIC,EAAS,KAAOP,EAAUM,EAAIC,EAAS,MAAME,cAM3f,ICnBF,SAAkBD,GAChB,MAAuB,iBAATA,GAAqBE,EAAMC,KAAKH,GDkBzCI,CAASJ,GACZ,MAAMK,UAAU,+BAGlB,OAAOL,EEtBT,SAASM,EAAGC,EAASC,EAAKT,GAExBhB,IAAM0B,GADNF,EAAUA,GAAW,IACAG,SAAWH,EAAQnB,KAAOA,KAK/C,GAHAqB,EAAK,GAAe,GAAVA,EAAK,GAAY,GAC3BA,EAAK,GAAe,GAAVA,EAAK,GAAY,IAEvBD,EAAK,CACPT,EAASA,GAAU,EAEnB,IAAKY,IAAIlB,EAAI,EAAGA,EAAI,KAAMA,EACxBe,EAAIT,EAASN,GAAKgB,EAAKhB,GAGzB,OAAOe,EAGT,OAAOX,EAAUY"}