Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@kartverket/geonorge-web-components

Package Overview
Dependencies
Maintainers
4
Versions
127
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kartverket/geonorge-web-components - npm Package Compare versions

Comparing version 2.4.0 to 2.5.0

1

gb-button.stories.d.ts

@@ -11,1 +11,2 @@ import { Meta } from "@storybook/web-components";

export declare const DisabledButton: any;
export declare const LinkButton: any;

2

gn-button.d.ts

@@ -5,8 +5,6 @@ import { CustomElement, CustomElementOptions } from "super-custom-elements";

export declare class GnButton extends CustomElement {
private static readonly elementSelector;
color: string;
constructor();
setup(options?: GnButtonOptions): void;
static setup(selector: string, options: GnButtonOptions): void;
}
export {};

@@ -1,2 +0,2 @@

!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.geonorge=n():(t.geonorge=t.geonorge||{},t.geonorge.GnButton=n())}(self,(()=>(()=>{"use strict";var t={4594:(t,n,e)=>{e.r(n),e.d(n,{default:()=>a});var o=e(4663),r=e.n(o),i=e(7638),s=e.n(i)()(r());s.push([t.id,'gn-button button{-moz-transition:all .35s linear 0s;-o-transition:all .35s linear 0s;-webkit-transition:all .35s linear 0s;transition:all .35s linear 0s;font-family:"Open Sans",sans-serif;font-weight:400;font-size:12pt;font-style:normal;text-align:center;vertical-align:middle;border:1px solid rgba(0,0,0,0);border-radius:0;cursor:pointer;display:inline-block;height:34px;line-height:16pt;text-decoration:none;background-position:50%}gn-button button:hover{background-color:#fe5000}gn-button button:disabled{background-color:#eee;color:#d8d8d8;border:1px solid #d8d8d8;cursor:not-allowed}gn-button button:disabled:hover,gn-button button:disabled:focus{background-color:#eee}gn-button[color=default] button:not(:disabled){background-color:#eee;color:#2f3940;border-color:#d8d8d8}gn-button[color=default] button:not(:disabled):hover,gn-button[color=default] button:not(:disabled):focus{background-color:#ddd}gn-button[color=primary] button:not(:disabled){background-color:#4c7aa9;color:#fff}gn-button[color=primary] button:not(:disabled):hover,gn-button[color=primary] button:not(:disabled):focus{background-color:#fe5000}gn-button[color=success] button:not(:disabled){background-color:#06a755;color:#fff}gn-button[color=success] button:not(:disabled):hover,gn-button[color=success] button:not(:disabled):focus{background-color:#009745}gn-button[color=warning] button:not(:disabled){background-color:#c38621;color:#fff}gn-button[color=warning] button:not(:disabled):hover,gn-button[color=warning] button:not(:disabled):focus{background-color:#b37611}gn-button[color=danger] button:not(:disabled){background-color:#e00d0d;color:#fff}gn-button[color=danger] button:not(:disabled):hover,gn-button[color=danger] button:not(:disabled):focus{background-color:#d00000}',"",{version:3,sources:["webpack://./stories/gn-button/gn-button.scss","webpack://./style/mixins/_transition.scss","webpack://./style/variables/_typography.scss","webpack://./style/variables/_colors.scss"],names:[],mappings:"AAGI,iBCFA,kCDGI,CCFJ,gCDEI,CCDJ,qCDCI,CAAA,6BAAA,CACA,kCELO,CFMP,eAAA,CACA,cAAA,CACA,iBAAA,CACA,iBAAA,CACA,qBAAA,CACA,8BAAA,CACA,eAAA,CACA,cAAA,CACA,oBAAA,CACA,WAAA,CACA,gBAAA,CACA,oBAAA,CACA,uBAAA,CACA,uBACI,wBGXI,CHaR,0BACI,qBGQU,CHPV,aGQI,CHPJ,wBAAA,CACA,kBAAA,CACA,gEAEI,qBGEM,CHKV,+CACI,qBGhCK,CHiCL,aG/BF,CHgCE,oBGpCC,CHqCD,0GAEI,qBGpCO,CH2Cf,+CACI,wBGtCK,CHuCL,UAAA,CACA,0GAEI,wBGzCO,CHgDf,+CACI,wBG5CK,CH6CL,UAAA,CACA,0GAEI,wBG/CO,CHsDf,+CACI,wBGnDK,CHoDL,UAAA,CACA,0GAEI,wBGtDO,CH6Df,8CACI,wBG3DI,CH4DJ,UAAA,CACA,wGAEI,wBG9DM",sourcesContent:['@import "../../style/all";\n\ngn-button {\n button {\n @include transition(all 0.35s linear 0s);\n font-family: $default-font;\n font-weight: 400;\n font-size: 12pt;\n font-style: normal;\n text-align: center;\n vertical-align: middle;\n border: 1px solid transparent;\n border-radius: 0;\n cursor: pointer;\n display: inline-block;\n height: 34px;\n line-height: 16pt;\n text-decoration: none;\n background-position: 50%;\n &:hover {\n background-color: $primary-brand;\n }\n &:disabled {\n background-color: $disabled-background;\n color: $disabled-text;\n border: 1px solid $disabled-text;\n cursor: not-allowed;\n &:hover,\n &:focus {\n background-color: $disabled-background;\n }\n }\n }\n\n &[color="default"] {\n button {\n &:not(:disabled) {\n background-color: $default-background;\n color: $default-text;\n border-color: $default-border;\n &:hover,\n &:focus {\n background-color: $default-background-hover;\n }\n }\n }\n }\n &[color="primary"] {\n button {\n &:not(:disabled) {\n background-color: $primary-background;\n color: #fff;\n &:hover,\n &:focus {\n background-color: $primary-background-hover;\n }\n }\n }\n }\n &[color="success"] {\n button {\n &:not(:disabled) {\n background-color: $success-background;\n color: #fff;\n &:hover,\n &:focus {\n background-color: $success-background-hover;\n }\n }\n }\n }\n &[color="warning"] {\n button {\n &:not(:disabled) {\n background-color: $warning-background;\n color: #fff;\n &:hover,\n &:focus {\n background-color: $warning-background-hover;\n }\n }\n }\n }\n &[color="danger"] {\n button {\n &:not(:disabled) {\n background-color: $danger-background;\n color: #fff;\n &:hover,\n &:focus {\n background-color: $danger-background-hover;\n }\n }\n }\n }\n}\n',"\ufeff@mixin transition($transition...) {\n -moz-transition: $transition;\n -o-transition: $transition;\n -webkit-transition: $transition;\n transition: $transition;\n}\n\n@mixin transition-property($property...) {\n -moz-transition-property: $property;\n -o-transition-property: $property;\n -webkit-transition-property: $property;\n transition-property: $property;\n}\n\n@mixin transition-duration($duration...) {\n -moz-transition-property: $duration;\n -o-transition-property: $duration;\n -webkit-transition-property: $duration;\n transition-property: $duration;\n}\n\n@mixin transition-timing-function($timing...) {\n -moz-transition-timing-function: $timing;\n -o-transition-timing-function: $timing;\n -webkit-transition-timing-function: $timing;\n transition-timing-function: $timing;\n}\n\n@mixin transition-delay($delay...) {\n -moz-transition-delay: $delay;\n -o-transition-delay: $delay;\n -webkit-transition-delay: $delay;\n transition-delay: $delay;\n}\n",'$default-font: "Open Sans", sans-serif;\n$header-font: "Raleway", sans-serif;',"$body-background: #ffffff;\n$navigation-bar-background: #f7f7f7;\n$hover-background: rgba(0,0,0,.05);\n$default-border: #d8d8d8;\n\n$default-background: #eee;\n$default-background-hover: #ddd;\n$default-text:#2F3940;\n\n$primary-brand: #FE5000;\n$secondary-brand: #4C7AA9;\n\n$primary-background: #4C7AA9;\n$primary-background-hover: #FE5000;\n$primary-text: #3767C7;\n$primary-text-hover:#0056b3;\n\n\n$success-background: #06A755;\n$success-background-hover: #009745;\n$success-text: #06A755;\n\n\n$warning-background: #C38621;\n$warning-background-hover: #B37611;\n$warning-text: #C38621;\n\n$danger-background: #E00d0D;\n$danger-background-hover: #D00000;\n$danger-text: #E00d0D;\n\n$disabled-background: #eee;\n$disabled-text: #d8d8d8;\n"],sourceRoot:""}]);const a=s},8874:(t,n,e)=>{e.r(n),e.d(n,{default:()=>o});const o="<template>\n <slot></slot>\n</template>\n"},7638:t=>{t.exports=function(t){var n=[];return n.toString=function(){return this.map((function(n){var e="",o=void 0!==n[5];return n[4]&&(e+="@supports (".concat(n[4],") {")),n[2]&&(e+="@media ".concat(n[2]," {")),o&&(e+="@layer".concat(n[5].length>0?" ".concat(n[5]):""," {")),e+=t(n),o&&(e+="}"),n[2]&&(e+="}"),n[4]&&(e+="}"),e})).join("")},n.i=function(t,e,o,r,i){"string"==typeof t&&(t=[[null,t,void 0]]);var s={};if(o)for(var a=0;a<this.length;a++){var c=this[a][0];null!=c&&(s[c]=!0)}for(var l=0;l<t.length;l++){var u=[].concat(t[l]);o&&s[u[0]]||(void 0!==i&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=i),e&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=e):u[2]=e),r&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=r):u[4]="".concat(r)),n.push(u))}},n}},4663:t=>{t.exports=function(t){var n=t[1],e=t[3];if(!e)return n;if("function"==typeof btoa){var o=btoa(unescape(encodeURIComponent(JSON.stringify(e)))),r="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(o),i="/*# ".concat(r," */");return[n].concat([i]).join("\n")}return[n].join("\n")}},1397:function(t,n,e){var o=this&&this.__awaiter||function(t,n,e,o){return new(e||(e=Promise))((function(r,i){function s(t){try{c(o.next(t))}catch(t){i(t)}}function a(t){try{c(o.throw(t))}catch(t){i(t)}}function c(t){var n;t.done?r(t.value):(n=t.value,n instanceof e?n:new e((function(t){t(n)}))).then(s,a)}c((o=o.apply(t,n||[])).next())}))};Object.defineProperty(n,"__esModule",{value:!0}),n.Component=void 0;const r=e(5969),i=e(5773),s=e(3804);n.Component=t=>n=>{var e;const a=t.tag||s.toKebabCase(n.prototype.constructor.name),c=((e=class extends n{constructor(){super(),this.props={},this.showShadowRoot=null==t.shadow||t.shadow,!this.shadowRoot&&this.showShadowRoot&&this.attachShadow({mode:"open"})}static get observedAttributes(){return Object.keys(this.propsInit||{}).map((t=>s.toKebabCase(t)))}attributeChangedCallback(t,n,e){this.onAttributeChange(t,n,e)}onAttributeChange(t,n,e,o=!0){if(n!=e){o&&(this[s.toCamelCase(t)]=e);const r=this.constructor.watchAttributes;if(r&&r[t]){const o=r[t];this.__connected&&"function"==typeof this[o]&&this[o]({old:n,new:e})}}}connectedCallback(){const t=Object.create(null,{connectedCallback:{get:()=>super.connectedCallback}});return o(this,void 0,void 0,(function*(){yield this.render(),t.connectedCallback&&t.connectedCallback.call(this),this.__connected=!0,r.addEventListeners(this),i.initializeProps(this)}))}render(){return o(this,void 0,void 0,(function*(){if(this.__connected)return;const n=document.createElement("template");n.innerHTML=yield this.getStyle(),t.template instanceof Promise?n.content.appendChild(yield this.getExternalTemplate()):"string"==typeof t.template&&(n.innerHTML+=t.template),(this.showShadowRoot?this.shadowRoot:this).appendChild(n.content.cloneNode(!0))}))}getExternalTemplate(){return o(this,void 0,void 0,(function*(){const n=(yield t.template).default.toString(),e=document.createRange().createContextualFragment(n);return 1===e.children.length&&"TEMPLATE"===e.children[0].nodeName?e.firstChild.content:e}))}getStyle(){return o(this,void 0,void 0,(function*(){let n;return t.style instanceof Promise?n=(yield t.style).default.toString():"string"==typeof t.style&&(n=t.style),n?`<style>${n}</style>`:""}))}}).__connected=!1,e.ready=new Promise(((t,n)=>t(!0))),e);return customElements.get(a)||customElements.define(a,c),c}},985:(t,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CustomElement=void 0;class e extends HTMLElement{constructor(){super()}connect(t){this.isConnected||document.querySelector(t).appendChild(this)}}n.CustomElement=e},265:(t,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.getShadowRootElement=n.getElement=void 0,n.getElement=t=>document.querySelector(t),n.getShadowRootElement=(t,n)=>t.shadowRoot.querySelector(n)},406:function(t,n,e){var o=this&&this.__createBinding||(Object.create?function(t,n,e,o){void 0===o&&(o=e),Object.defineProperty(t,o,{enumerable:!0,get:function(){return n[e]}})}:function(t,n,e,o){void 0===o&&(o=e),t[o]=n[e]}),r=this&&this.__exportStar||function(t,n){for(var e in t)"default"===e||Object.prototype.hasOwnProperty.call(n,e)||o(n,t,e)};Object.defineProperty(n,"__esModule",{value:!0}),r(e(1397),n),r(e(985),n),r(e(265),n),r(e(5969),n),r(e(5773),n),r(e(4271),n),r(e(9766),n),r(e(4938),n)},5969:(t,n,e)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Dispatch=n.addEventListeners=n.Listen=void 0;const o=e(3804);n.Listen=(t,n)=>(e,o)=>{e.constructor.listeners||(e.constructor.listeners=[]),e.constructor.listeners.push({selector:n,eventName:t,handler:e[o]})},n.addEventListeners=t=>{if(t.constructor.listeners){const n=t.shadowRoot||t;for(const e of t.constructor.listeners){const o=e.selector?n.querySelector(e.selector)?n.querySelector(e.selector):null:t;o&&o.addEventListener(e.eventName,(n=>{e.handler.call(t,n)}))}}},n.Dispatch=t=>(n,e)=>{Object.defineProperty(n,e,{get:function(){const n=this;return{emit(r){const i=t||o.toDotCase(e);n.dispatchEvent(new CustomEvent(i,r))}}}})}},5773:(t,n,e)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.initializeProps=n.Prop=void 0;const o=e(3804);n.Prop=()=>(t,n)=>{const e=o.toKebabCase(n);t.constructor.propsInit||(t.constructor.propsInit={}),t.constructor.propsInit[n]=null,Object.defineProperty(t,n,{get:function(){return this.props[n]?this.props[n]:this.getAttribute(e)},set:function(t){if(this.__connected){const r=this.props[n];this.props[n]=o.tryParseInt(t),"object"!=typeof t?this.setAttribute(e,t):this.onAttributeChange(e,r,t,!1)}else this.hasAttribute(o.toKebabCase(n))||(this.constructor.propsInit[n]=t)}})},n.initializeProps=t=>{const n=t.constructor.watchAttributes;for(let e of(t=>{const n=t.constructor.watchAttributes,e=Object.assign({},n);Object.keys(e).forEach((t=>e[t]=""));const o=Object.assign(Object.assign({},e),t.constructor.propsInit);return Object.keys(o)})(t)){if(n)if(null==n[o.toKebabCase(e)])n[o.toKebabCase(e)]="";else{const r=t.props[e]||t.getAttribute(o.toKebabCase(e));"function"==typeof t[n[e]]&&t[n[e]]({new:r})}t.constructor.propsInit[e]&&(t.hasAttribute(o.toKebabCase(e))||(t[e]=t.constructor.propsInit[e]))}}},4271:(t,n,e)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Toggle=void 0;const o=e(3804);n.Toggle=()=>(t,n)=>{t.constructor.propsInit||(t.constructor.propsInit={}),t.constructor.propsInit[n]=null,Object.defineProperty(t,n,{get:function(){return(t=>{if(this.hasAttribute(t)){const n=this.getAttribute(t);return!!/^(true|false|^$)$/.test(n)&&("true"==n||""==n)}return!1})(n)},set:function(t){const e=t;if(null!=t)switch(typeof t){case"boolean":break;case"string":/^(true|false|^$)$/.test(t)?t="true"==e||""==e:(console.warn(`TypeError: Cannot set boolean toggle property '${n}' to '${t}'`),t=!1);break;default:throw`TypeError: Cannot set boolean toggle property '${n}' to '${t}'`}this.__connected?(this.props[n]=t||!1,""!==e&&null!==e?this.setAttribute(n,t):t?this.setAttribute(n,""):this.removeAttribute(n)):this.hasAttribute(o.toKebabCase(n))||(this.constructor.propsInit[n]=t)}})}},9766:(t,n)=>{Object.defineProperty(n,"__esModule",{value:!0})},3804:(t,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.tryParseInt=n.toDotCase=n.toCamelCase=n.toKebabCase=void 0,n.toKebabCase=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),n.toCamelCase=t=>t.toLowerCase().replace(/(\-\w)/g,(t=>t[1].toUpperCase())),n.toDotCase=t=>t.replace(/(?!^)([A-Z])/g," $1").replace(/[_\s]+(?=[a-zA-Z])/g,".").toLowerCase(),n.tryParseInt=t=>parseInt(t)==t&&NaN!==parseFloat(t)?parseInt(t):t},4938:(t,n,e)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Watch=void 0;const o=e(3804);n.Watch=t=>(n,e)=>{n.constructor.watchAttributes||(n.constructor.watchAttributes={}),n.constructor.watchAttributes[o.toKebabCase(t)]=e,n.constructor.propsInit||(n.constructor.propsInit={}),n.constructor.propsInit[t]=null}},5527:(t,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.addGlobalStylesheet=n.getFocusableElementsInsideElement=void 0,n.getFocusableElementsInsideElement=t=>t.querySelectorAll('button, [href], input, [tabindex="0"]'),n.addGlobalStylesheet=(t,n)=>{const e=document.createElement("style");e.setAttribute("id",t),e.textContent=n,document.getElementById(t)||document.head.appendChild(e)}},4541:function(t,n,e){var o=this&&this.__createBinding||(Object.create?function(t,n,e,o){void 0===o&&(o=e);var r=Object.getOwnPropertyDescriptor(n,e);r&&!("get"in r?!n.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return n[e]}}),Object.defineProperty(t,o,r)}:function(t,n,e,o){void 0===o&&(o=e),t[o]=n[e]}),r=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),i=this&&this.__decorate||function(t,n,e,o){var r,i=arguments.length,s=i<3?n:null===o?o=Object.getOwnPropertyDescriptor(n,e):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,n,e,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(i<3?r(s):i>3?r(n,e,s):r(n,e))||s);return i>3&&s&&Object.defineProperty(n,e,s),s},s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var e in t)"default"!==e&&Object.prototype.hasOwnProperty.call(t,e)&&o(n,t,e);return r(n,t),n},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(n,"__esModule",{value:!0}),n.GnButton=void 0;const c=e(406),l=e(5527),u=a(e(4594));let d=class extends c.CustomElement{constructor(){super(),(0,l.addGlobalStylesheet)("gn-button-styles",u.default)}setup(t){this.connect(t.container),t.id&&(this.id=t.id)}static setup(t,n){(0,c.getElement)(t)}};d.elementSelector="gn-button",i([(0,c.Prop)()],d.prototype,"color",void 0),d=i([(0,c.Component)({tag:"gn-button",template:Promise.resolve().then((()=>s(e(8874))))})],d),n.GnButton=d}},n={};function e(o){var r=n[o];if(void 0!==r)return r.exports;var i=n[o]={id:o,exports:{}};return t[o].call(i.exports,i,i.exports,e),i.exports}return e.n=t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},e.d=(t,n)=>{for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},e.o=(t,n)=>Object.prototype.hasOwnProperty.call(t,n),e.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e(4541)})()));
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.geonorge=n():(t.geonorge=t.geonorge||{},t.geonorge.GnButton=n())}(self,(()=>(()=>{"use strict";var t={4594:(t,n,o)=>{o.r(n),o.d(n,{default:()=>s});var e=o(4663),r=o.n(e),a=o(7638),i=o.n(a)()(r());i.push([t.id,'gn-button button,gn-button a{-moz-transition:all .35s linear 0s;-o-transition:all .35s linear 0s;-webkit-transition:all .35s linear 0s;transition:all .35s linear 0s;font-family:"Open Sans",sans-serif;font-weight:400;font-size:12pt;font-style:normal;text-align:center;vertical-align:middle;border:1px solid rgba(0,0,0,0);border-radius:0;cursor:pointer;display:inline-block;height:34px;line-height:16pt;text-decoration:none;background-position:50%;padding:5px 6px;box-sizing:border-box}gn-button button:hover,gn-button a:hover{background-color:#fe5000}gn-button button:disabled,gn-button a:disabled{background-color:#eee;color:#d8d8d8;border:1px solid #d8d8d8;cursor:not-allowed}gn-button button:disabled:hover,gn-button button:disabled:focus,gn-button a:disabled:hover,gn-button a:disabled:focus{background-color:#eee}gn-button[color=default] button:not(:disabled),gn-button[color=default] a:not(:disabled),gn-button[color=""] button:not(:disabled),gn-button[color=""] a:not(:disabled),gn-button:not([color]) button:not(:disabled),gn-button:not([color]) a:not(:disabled){background-color:#eee;color:#2f3940;border-color:#d8d8d8}gn-button[color=default] button:not(:disabled):hover,gn-button[color=default] button:not(:disabled):focus,gn-button[color=default] a:not(:disabled):hover,gn-button[color=default] a:not(:disabled):focus,gn-button[color=""] button:not(:disabled):hover,gn-button[color=""] button:not(:disabled):focus,gn-button[color=""] a:not(:disabled):hover,gn-button[color=""] a:not(:disabled):focus,gn-button:not([color]) button:not(:disabled):hover,gn-button:not([color]) button:not(:disabled):focus,gn-button:not([color]) a:not(:disabled):hover,gn-button:not([color]) a:not(:disabled):focus{background-color:#ddd}gn-button[color=primary] button:not(:disabled),gn-button[color=primary] a:not(:disabled){background-color:#4c7aa9;color:#fff}gn-button[color=primary] button:not(:disabled):hover,gn-button[color=primary] button:not(:disabled):focus,gn-button[color=primary] a:not(:disabled):hover,gn-button[color=primary] a:not(:disabled):focus{background-color:#fe5000}gn-button[color=success] button:not(:disabled),gn-button[color=success] a:not(:disabled){background-color:#06a755;color:#fff}gn-button[color=success] button:not(:disabled):hover,gn-button[color=success] button:not(:disabled):focus,gn-button[color=success] a:not(:disabled):hover,gn-button[color=success] a:not(:disabled):focus{background-color:#009745}gn-button[color=warning] button:not(:disabled),gn-button[color=warning] a:not(:disabled){background-color:#c38621;color:#fff}gn-button[color=warning] button:not(:disabled):hover,gn-button[color=warning] button:not(:disabled):focus,gn-button[color=warning] a:not(:disabled):hover,gn-button[color=warning] a:not(:disabled):focus{background-color:#b37611}gn-button[color=danger] button:not(:disabled),gn-button[color=danger] a:not(:disabled){background-color:#e00d0d;color:#fff}gn-button[color=danger] button:not(:disabled):hover,gn-button[color=danger] button:not(:disabled):focus,gn-button[color=danger] a:not(:disabled):hover,gn-button[color=danger] a:not(:disabled):focus{background-color:#d00000}',"",{version:3,sources:["webpack://./stories/gn-button/gn-button.scss","webpack://./style/mixins/_transition.scss","webpack://./style/variables/_typography.scss","webpack://./style/variables/_colors.scss"],names:[],mappings:"AAGI,6BCFA,kCDII,CCHJ,gCDGI,CCFJ,qCDEI,CCDJ,6BDCI,CACA,kCENO,CFOP,eAAA,CACA,cAAA,CACA,iBAAA,CACA,iBAAA,CACA,qBAAA,CACA,8BAAA,CACA,eAAA,CACA,cAAA,CACA,oBAAA,CACA,WAAA,CACA,gBAAA,CACA,oBAAA,CACA,uBAAA,CACA,eAAA,CACA,qBAAA,CACA,yCACI,wBGdI,CHgBR,+CACI,qBGKU,CHJV,aGKI,CHJJ,wBAAA,CACA,kBAAA,CACA,sHAEI,qBGDM,CHWV,6PACI,qBGtCK,CHuCL,aGrCF,CHsCE,oBG1CC,CH2CD,kkBAEI,qBG1CO,CHkDf,yFACI,wBG7CK,CH8CL,UAAA,CACA,0MAEI,wBGhDO,CHwDf,yFACI,wBGpDK,CHqDL,UAAA,CACA,0MAEI,wBGvDO,CH+Df,yFACI,wBG5DK,CH6DL,UAAA,CACA,0MAEI,wBG/DO,CHuEf,uFACI,wBGrEI,CHsEJ,UAAA,CACA,sMAEI,wBGxEM",sourcesContent:['@import "../../style/all";\n\ngn-button {\n button,\n a {\n @include transition(all 0.35s linear 0s);\n font-family: $default-font;\n font-weight: 400;\n font-size: 12pt;\n font-style: normal;\n text-align: center;\n vertical-align: middle;\n border: 1px solid transparent;\n border-radius: 0;\n cursor: pointer;\n display: inline-block;\n height: 34px;\n line-height: 16pt;\n text-decoration: none;\n background-position: 50%;\n padding: 5px 6px;\n box-sizing: border-box;\n &:hover {\n background-color: $primary-brand;\n }\n &:disabled {\n background-color: $disabled-background;\n color: $disabled-text;\n border: 1px solid $disabled-text;\n cursor: not-allowed;\n &:hover,\n &:focus {\n background-color: $disabled-background;\n }\n }\n }\n\n &[color="default"],\n &[color=""],\n &:not([color]) {\n button,\n a {\n &:not(:disabled) {\n background-color: $default-background;\n color: $default-text;\n border-color: $default-border;\n &:hover,\n &:focus {\n background-color: $default-background-hover;\n }\n }\n }\n }\n &[color="primary"] {\n button,\n a {\n &:not(:disabled) {\n background-color: $primary-background;\n color: #fff;\n &:hover,\n &:focus {\n background-color: $primary-background-hover;\n }\n }\n }\n }\n &[color="success"] {\n button,\n a {\n &:not(:disabled) {\n background-color: $success-background;\n color: #fff;\n &:hover,\n &:focus {\n background-color: $success-background-hover;\n }\n }\n }\n }\n &[color="warning"] {\n button,\n a {\n &:not(:disabled) {\n background-color: $warning-background;\n color: #fff;\n &:hover,\n &:focus {\n background-color: $warning-background-hover;\n }\n }\n }\n }\n &[color="danger"] {\n button,\n a {\n &:not(:disabled) {\n background-color: $danger-background;\n color: #fff;\n &:hover,\n &:focus {\n background-color: $danger-background-hover;\n }\n }\n }\n }\n}\n',"\ufeff@mixin transition($transition...) {\n -moz-transition: $transition;\n -o-transition: $transition;\n -webkit-transition: $transition;\n transition: $transition;\n}\n\n@mixin transition-property($property...) {\n -moz-transition-property: $property;\n -o-transition-property: $property;\n -webkit-transition-property: $property;\n transition-property: $property;\n}\n\n@mixin transition-duration($duration...) {\n -moz-transition-property: $duration;\n -o-transition-property: $duration;\n -webkit-transition-property: $duration;\n transition-property: $duration;\n}\n\n@mixin transition-timing-function($timing...) {\n -moz-transition-timing-function: $timing;\n -o-transition-timing-function: $timing;\n -webkit-transition-timing-function: $timing;\n transition-timing-function: $timing;\n}\n\n@mixin transition-delay($delay...) {\n -moz-transition-delay: $delay;\n -o-transition-delay: $delay;\n -webkit-transition-delay: $delay;\n transition-delay: $delay;\n}\n",'$default-font: "Open Sans", sans-serif;\n$header-font: "Raleway", sans-serif;',"$body-background: #ffffff;\n$navigation-bar-background: #f7f7f7;\n$hover-background: rgba(0,0,0,.05);\n$default-border: #d8d8d8;\n\n$default-background: #eee;\n$default-background-hover: #ddd;\n$default-text:#2F3940;\n\n$primary-brand: #FE5000;\n$secondary-brand: #4C7AA9;\n\n$primary-background: #4C7AA9;\n$primary-background-hover: #FE5000;\n$primary-text: #3767C7;\n$primary-text-hover:#0056b3;\n\n\n$success-background: #06A755;\n$success-background-hover: #009745;\n$success-text: #06A755;\n\n\n$warning-background: #C38621;\n$warning-background-hover: #B37611;\n$warning-text: #C38621;\n\n$danger-background: #E00d0D;\n$danger-background-hover: #D00000;\n$danger-text: #E00d0D;\n\n$disabled-background: #eee;\n$disabled-text: #d8d8d8;\n"],sourceRoot:""}]);const s=i},8874:(t,n,o)=>{o.r(n),o.d(n,{default:()=>e});const e="<template>\n <slot></slot>\n</template>\n"},7638:t=>{t.exports=function(t){var n=[];return n.toString=function(){return this.map((function(n){var o="",e=void 0!==n[5];return n[4]&&(o+="@supports (".concat(n[4],") {")),n[2]&&(o+="@media ".concat(n[2]," {")),e&&(o+="@layer".concat(n[5].length>0?" ".concat(n[5]):""," {")),o+=t(n),e&&(o+="}"),n[2]&&(o+="}"),n[4]&&(o+="}"),o})).join("")},n.i=function(t,o,e,r,a){"string"==typeof t&&(t=[[null,t,void 0]]);var i={};if(e)for(var s=0;s<this.length;s++){var c=this[s][0];null!=c&&(i[c]=!0)}for(var l=0;l<t.length;l++){var d=[].concat(t[l]);e&&i[d[0]]||(void 0!==a&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=a),o&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=o):d[2]=o),r&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=r):d[4]="".concat(r)),n.push(d))}},n}},4663:t=>{t.exports=function(t){var n=t[1],o=t[3];if(!o)return n;if("function"==typeof btoa){var e=btoa(unescape(encodeURIComponent(JSON.stringify(o)))),r="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(e),a="/*# ".concat(r," */");return[n].concat([a]).join("\n")}return[n].join("\n")}},1397:function(t,n,o){var e=this&&this.__awaiter||function(t,n,o,e){return new(o||(o=Promise))((function(r,a){function i(t){try{c(e.next(t))}catch(t){a(t)}}function s(t){try{c(e.throw(t))}catch(t){a(t)}}function c(t){var n;t.done?r(t.value):(n=t.value,n instanceof o?n:new o((function(t){t(n)}))).then(i,s)}c((e=e.apply(t,n||[])).next())}))};Object.defineProperty(n,"__esModule",{value:!0}),n.Component=void 0;const r=o(5969),a=o(5773),i=o(3804);n.Component=t=>n=>{var o;const s=t.tag||i.toKebabCase(n.prototype.constructor.name),c=((o=class extends n{constructor(){super(),this.props={},this.showShadowRoot=null==t.shadow||t.shadow,!this.shadowRoot&&this.showShadowRoot&&this.attachShadow({mode:"open"})}static get observedAttributes(){return Object.keys(this.propsInit||{}).map((t=>i.toKebabCase(t)))}attributeChangedCallback(t,n,o){this.onAttributeChange(t,n,o)}onAttributeChange(t,n,o,e=!0){if(n!=o){e&&(this[i.toCamelCase(t)]=o);const r=this.constructor.watchAttributes;if(r&&r[t]){const e=r[t];this.__connected&&"function"==typeof this[e]&&this[e]({old:n,new:o})}}}connectedCallback(){const t=Object.create(null,{connectedCallback:{get:()=>super.connectedCallback}});return e(this,void 0,void 0,(function*(){yield this.render(),t.connectedCallback&&t.connectedCallback.call(this),this.__connected=!0,r.addEventListeners(this),a.initializeProps(this)}))}render(){return e(this,void 0,void 0,(function*(){if(this.__connected)return;const n=document.createElement("template");n.innerHTML=yield this.getStyle(),t.template instanceof Promise?n.content.appendChild(yield this.getExternalTemplate()):"string"==typeof t.template&&(n.innerHTML+=t.template),(this.showShadowRoot?this.shadowRoot:this).appendChild(n.content.cloneNode(!0))}))}getExternalTemplate(){return e(this,void 0,void 0,(function*(){const n=(yield t.template).default.toString(),o=document.createRange().createContextualFragment(n);return 1===o.children.length&&"TEMPLATE"===o.children[0].nodeName?o.firstChild.content:o}))}getStyle(){return e(this,void 0,void 0,(function*(){let n;return t.style instanceof Promise?n=(yield t.style).default.toString():"string"==typeof t.style&&(n=t.style),n?`<style>${n}</style>`:""}))}}).__connected=!1,o.ready=new Promise(((t,n)=>t(!0))),o);return customElements.get(s)||customElements.define(s,c),c}},985:(t,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CustomElement=void 0;class o extends HTMLElement{constructor(){super()}connect(t){this.isConnected||document.querySelector(t).appendChild(this)}}n.CustomElement=o},265:(t,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.getShadowRootElement=n.getElement=void 0,n.getElement=t=>document.querySelector(t),n.getShadowRootElement=(t,n)=>t.shadowRoot.querySelector(n)},406:function(t,n,o){var e=this&&this.__createBinding||(Object.create?function(t,n,o,e){void 0===e&&(e=o),Object.defineProperty(t,e,{enumerable:!0,get:function(){return n[o]}})}:function(t,n,o,e){void 0===e&&(e=o),t[e]=n[o]}),r=this&&this.__exportStar||function(t,n){for(var o in t)"default"===o||Object.prototype.hasOwnProperty.call(n,o)||e(n,t,o)};Object.defineProperty(n,"__esModule",{value:!0}),r(o(1397),n),r(o(985),n),r(o(265),n),r(o(5969),n),r(o(5773),n),r(o(4271),n),r(o(9766),n),r(o(4938),n)},5969:(t,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Dispatch=n.addEventListeners=n.Listen=void 0;const e=o(3804);n.Listen=(t,n)=>(o,e)=>{o.constructor.listeners||(o.constructor.listeners=[]),o.constructor.listeners.push({selector:n,eventName:t,handler:o[e]})},n.addEventListeners=t=>{if(t.constructor.listeners){const n=t.shadowRoot||t;for(const o of t.constructor.listeners){const e=o.selector?n.querySelector(o.selector)?n.querySelector(o.selector):null:t;e&&e.addEventListener(o.eventName,(n=>{o.handler.call(t,n)}))}}},n.Dispatch=t=>(n,o)=>{Object.defineProperty(n,o,{get:function(){const n=this;return{emit(r){const a=t||e.toDotCase(o);n.dispatchEvent(new CustomEvent(a,r))}}}})}},5773:(t,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.initializeProps=n.Prop=void 0;const e=o(3804);n.Prop=()=>(t,n)=>{const o=e.toKebabCase(n);t.constructor.propsInit||(t.constructor.propsInit={}),t.constructor.propsInit[n]=null,Object.defineProperty(t,n,{get:function(){return this.props[n]?this.props[n]:this.getAttribute(o)},set:function(t){if(this.__connected){const r=this.props[n];this.props[n]=e.tryParseInt(t),"object"!=typeof t?this.setAttribute(o,t):this.onAttributeChange(o,r,t,!1)}else this.hasAttribute(e.toKebabCase(n))||(this.constructor.propsInit[n]=t)}})},n.initializeProps=t=>{const n=t.constructor.watchAttributes;for(let o of(t=>{const n=t.constructor.watchAttributes,o=Object.assign({},n);Object.keys(o).forEach((t=>o[t]=""));const e=Object.assign(Object.assign({},o),t.constructor.propsInit);return Object.keys(e)})(t)){if(n)if(null==n[e.toKebabCase(o)])n[e.toKebabCase(o)]="";else{const r=t.props[o]||t.getAttribute(e.toKebabCase(o));"function"==typeof t[n[o]]&&t[n[o]]({new:r})}t.constructor.propsInit[o]&&(t.hasAttribute(e.toKebabCase(o))||(t[o]=t.constructor.propsInit[o]))}}},4271:(t,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Toggle=void 0;const e=o(3804);n.Toggle=()=>(t,n)=>{t.constructor.propsInit||(t.constructor.propsInit={}),t.constructor.propsInit[n]=null,Object.defineProperty(t,n,{get:function(){return(t=>{if(this.hasAttribute(t)){const n=this.getAttribute(t);return!!/^(true|false|^$)$/.test(n)&&("true"==n||""==n)}return!1})(n)},set:function(t){const o=t;if(null!=t)switch(typeof t){case"boolean":break;case"string":/^(true|false|^$)$/.test(t)?t="true"==o||""==o:(console.warn(`TypeError: Cannot set boolean toggle property '${n}' to '${t}'`),t=!1);break;default:throw`TypeError: Cannot set boolean toggle property '${n}' to '${t}'`}this.__connected?(this.props[n]=t||!1,""!==o&&null!==o?this.setAttribute(n,t):t?this.setAttribute(n,""):this.removeAttribute(n)):this.hasAttribute(e.toKebabCase(n))||(this.constructor.propsInit[n]=t)}})}},9766:(t,n)=>{Object.defineProperty(n,"__esModule",{value:!0})},3804:(t,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.tryParseInt=n.toDotCase=n.toCamelCase=n.toKebabCase=void 0,n.toKebabCase=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),n.toCamelCase=t=>t.toLowerCase().replace(/(\-\w)/g,(t=>t[1].toUpperCase())),n.toDotCase=t=>t.replace(/(?!^)([A-Z])/g," $1").replace(/[_\s]+(?=[a-zA-Z])/g,".").toLowerCase(),n.tryParseInt=t=>parseInt(t)==t&&NaN!==parseFloat(t)?parseInt(t):t},4938:(t,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Watch=void 0;const e=o(3804);n.Watch=t=>(n,o)=>{n.constructor.watchAttributes||(n.constructor.watchAttributes={}),n.constructor.watchAttributes[e.toKebabCase(t)]=o,n.constructor.propsInit||(n.constructor.propsInit={}),n.constructor.propsInit[t]=null}},5527:(t,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.addGlobalStylesheet=n.getFocusableElementsInsideElement=void 0,n.getFocusableElementsInsideElement=t=>t.querySelectorAll('button, [href], input, [tabindex="0"]'),n.addGlobalStylesheet=(t,n)=>{const o=document.createElement("style");o.setAttribute("id",t),o.textContent=n,document.getElementById(t)||document.head.appendChild(o)}},4541:function(t,n,o){var e=this&&this.__createBinding||(Object.create?function(t,n,o,e){void 0===e&&(e=o);var r=Object.getOwnPropertyDescriptor(n,o);r&&!("get"in r?!n.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return n[o]}}),Object.defineProperty(t,e,r)}:function(t,n,o,e){void 0===e&&(e=o),t[e]=n[o]}),r=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),a=this&&this.__decorate||function(t,n,o,e){var r,a=arguments.length,i=a<3?n:null===e?e=Object.getOwnPropertyDescriptor(n,o):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,n,o,e);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(i=(a<3?r(i):a>3?r(n,o,i):r(n,o))||i);return a>3&&i&&Object.defineProperty(n,o,i),i},i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var o in t)"default"!==o&&Object.prototype.hasOwnProperty.call(t,o)&&e(n,t,o);return r(n,t),n},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(n,"__esModule",{value:!0}),n.GnButton=void 0;const c=o(406),l=o(5527),d=s(o(4594));let u=class extends c.CustomElement{constructor(){super(),(0,l.addGlobalStylesheet)("gn-button-styles",d.default)}setup(t){this.connect(t.container),t.id&&(this.id=t.id)}};a([(0,c.Prop)()],u.prototype,"color",void 0),u=a([(0,c.Component)({tag:"gn-button",template:Promise.resolve().then((()=>i(o(8874))))})],u),n.GnButton=u}},n={};function o(e){var r=n[e];if(void 0!==r)return r.exports;var a=n[e]={id:e,exports:{}};return t[e].call(a.exports,a,a.exports,o),a.exports}return o.n=t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return o.d(n,{a:n}),n},o.d=(t,n)=>{for(var e in n)o.o(n,e)&&!o.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:n[e]})},o.o=(t,n)=>Object.prototype.hasOwnProperty.call(t,n),o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o(4541)})()));
//# sourceMappingURL=GnButton.js.map
{
"name": "@kartverket/geonorge-web-components",
"version": "2.4.0",
"version": "2.5.0",
"description": "Geonorge Web Components",

@@ -5,0 +5,0 @@ "keywords": [

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc