@elvia/elvis-spotlight 1.5.0 → 1.5.1

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.
package/CHANGELOG.json CHANGED
@@ -1,6 +1,16 @@
1
1
  {
2
2
  "$schema": "../../changelogSchema.json",
3
3
  "content": [
4
+ {
5
+ "date": "09.05.23",
6
+ "version": "1.5.1",
7
+ "changelog": [
8
+ {
9
+ "type": "patch",
10
+ "changes": ["Updated internal dependencies. "]
11
+ }
12
+ ]
13
+ },
4
14
  {
5
15
  "date": "04.04.23",
6
16
  "version": "1.5.0",
@@ -2,5 +2,5 @@
2
2
  * THIS FILE IS AUTOMATICALLY GENERATED AND WILL BE OVERWRITTEN.
3
3
  * DO NOT MAKE CHANGES TO THIS FILE DIRECTLY
4
4
  */
5
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.config=void 0;var config={name:"Spotlight",attributes:[{name:"position",type:"object"},{name:"shape",type:"string"},{name:"radius",type:"number"},{name:"rectangleProps",type:"object"},{name:"hasLockBodyScroll",type:"boolean"},{name:"transitionDuration",type:"string"},{name:"className",type:"string"},{name:"inlineStyle",type:"object"}]};exports.config=config;
5
+ export var config={name:"Spotlight",attributes:[{name:"position",type:"object"},{name:"shape",type:"string"},{name:"radius",type:"number"},{name:"rectangleProps",type:"object"},{name:"hasLockBodyScroll",type:"boolean"},{name:"transitionDuration",type:"string"},{name:"className",type:"string"},{name:"inlineStyle",type:"object"}]};
6
6
  //# sourceMappingURL=config.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["config.ts"],"names":["config","name","attributes","type"],"mappings":";;;;0FAEO,GAAMA,OAAuB,CAAG,CACrCC,IAAI,CAAE,WAAW,CACjBC,UAAU,CAAE,CACV,CAAED,IAAI,CAAE,UAAU,CAAEE,IAAI,CAAE,QAAS,CAAC,CACpC,CAAEF,IAAI,CAAE,OAAO,CAAEE,IAAI,CAAE,QAAS,CAAC,CACjC,CAAEF,IAAI,CAAE,QAAQ,CAAEE,IAAI,CAAE,QAAS,CAAC,CAClC,CAAEF,IAAI,CAAE,gBAAgB,CAAEE,IAAI,CAAE,QAAS,CAAC,CAC1C,CAAEF,IAAI,CAAE,mBAAmB,CAAEE,IAAI,CAAE,SAAU,CAAC,CAC9C,CAAEF,IAAI,CAAE,oBAAoB,CAAEE,IAAI,CAAE,QAAS,CAAC,CAC9C,CAAEF,IAAI,CAAE,WAAW,CAAEE,IAAI,CAAE,QAAS,CAAC,CACrC,CAAEF,IAAI,CAAE,aAAa,CAAEE,IAAI,CAAE,QAAS,CAAC,CAE3C,CAAC,CAAC","file":"config.js","sourcesContent":["import { ComponentConfig } from '@elvia/elvis-toolbox';\n\nexport const config: ComponentConfig = {\n name: 'Spotlight',\n attributes: [\n { name: 'position', type: 'object' },\n { name: 'shape', type: 'string' },\n { name: 'radius', type: 'number' },\n { name: 'rectangleProps', type: 'object' },\n { name: 'hasLockBodyScroll', type: 'boolean' },\n { name: 'transitionDuration', type: 'string' },\n { name: 'className', type: 'string' },\n { name: 'inlineStyle', type: 'object' },\n ],\n};\n"]}
1
+ {"version":3,"sources":["config.ts"],"names":["config","name","attributes","type"],"mappings":";;;;AAEA,MAAO,IAAMA,OAAuB,CAAG,CACrCC,IAAI,CAAE,WAAW,CACjBC,UAAU,CAAE,CACV,CAAED,IAAI,CAAE,UAAU,CAAEE,IAAI,CAAE,QAAS,CAAC,CACpC,CAAEF,IAAI,CAAE,OAAO,CAAEE,IAAI,CAAE,QAAS,CAAC,CACjC,CAAEF,IAAI,CAAE,QAAQ,CAAEE,IAAI,CAAE,QAAS,CAAC,CAClC,CAAEF,IAAI,CAAE,gBAAgB,CAAEE,IAAI,CAAE,QAAS,CAAC,CAC1C,CAAEF,IAAI,CAAE,mBAAmB,CAAEE,IAAI,CAAE,SAAU,CAAC,CAC9C,CAAEF,IAAI,CAAE,oBAAoB,CAAEE,IAAI,CAAE,QAAS,CAAC,CAC9C,CAAEF,IAAI,CAAE,WAAW,CAAEE,IAAI,CAAE,QAAS,CAAC,CACrC,CAAEF,IAAI,CAAE,aAAa,CAAEE,IAAI,CAAE,QAAS,CAAC,CAE3C,CAAC","file":"config.js","sourcesContent":["import { ComponentConfig } from '@elvia/elvis-toolbox';\n\nexport const config: ComponentConfig = {\n name: 'Spotlight',\n attributes: [\n { name: 'position', type: 'object' },\n { name: 'shape', type: 'string' },\n { name: 'radius', type: 'number' },\n { name: 'rectangleProps', type: 'object' },\n { name: 'hasLockBodyScroll', type: 'boolean' },\n { name: 'transitionDuration', type: 'string' },\n { name: 'className', type: 'string' },\n { name: 'inlineStyle', type: 'object' },\n ],\n};\n"]}
@@ -2,5 +2,5 @@
2
2
  * THIS FILE IS AUTOMATICALLY GENERATED AND WILL BE OVERWRITTEN.
3
3
  * DO NOT MAKE CHANGES TO THIS FILE DIRECTLY
4
4
  */
5
- "use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _react=_interopRequireWildcard(require("react")),_styledComponents=require("./styledComponents"),_elvisToolbox=require("@elvia/elvis-toolbox"),_useLockBodyScroll=require("./useLockBodyScroll"),_excluded=["position","shape","radius","hasLockBodyScroll","transitionDuration","rectangleProps","className","inlineStyle"];function _getRequireWildcardCache(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(_getRequireWildcardCache=function(a){return a?c:b})(a)}function _interopRequireWildcard(a,b){if(!b&&a&&a.__esModule)return a;if(null===a||"object"!==_typeof(a)&&"function"!=typeof a)return{default:a};var c=_getRequireWildcardCache(b);if(c&&c.has(a))return c.get(a);var d={},e=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in a)if("default"!=f&&Object.prototype.hasOwnProperty.call(a,f)){var g=e?Object.getOwnPropertyDescriptor(a,f):null;g&&(g.get||g.set)?Object.defineProperty(d,f,g):d[f]=a[f]}return d.default=a,c&&c.set(a,d),d}function _extends(){return _extends=Object.assign?Object.assign.bind():function(a){for(var b,c=1;c<arguments.length;c++)for(var d in b=arguments[c],b)Object.prototype.hasOwnProperty.call(b,d)&&(a[d]=b[d]);return a},_extends.apply(this,arguments)}function _objectWithoutProperties(a,b){if(null==a)return{};var c,d,e=_objectWithoutPropertiesLoose(a,b);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(a);for(d=0;d<f.length;d++)c=f[d],0<=b.indexOf(c)||Object.prototype.propertyIsEnumerable.call(a,c)&&(e[c]=a[c])}return e}function _objectWithoutPropertiesLoose(a,b){if(null==a)return{};var c,d,e={},f=Object.keys(a);for(d=0;d<f.length;d++)c=f[d],0<=b.indexOf(c)||(e[c]=a[c]);return e}var Spotlight=function(a){var b=a.position,c=a.shape,d=void 0===c?"circle":c,e=a.radius,f=void 0===e?200:e,g=a.hasLockBodyScroll,h=a.transitionDuration,i=void 0===h?"350ms":h,j=a.rectangleProps,k=void 0===j?{width:200,height:200,borderRadius:8}:j,l=a.className,m=a.inlineStyle,n=_objectWithoutProperties(a,_excluded),o=b&&void 0!==b.horizontal&&void 0!==b.vertical,p=(0,_react.useRef)(null),q=(0,_elvisToolbox.useCurrentTheme)(p),r=q.currentTheme;return(0,_useLockBodyScroll.useLockBodyScroll)(void 0===g||g),o?/*#__PURE__*/_react.default.createElement("div",_extends({className:"".concat(l?l:""),style:m},n,{ref:p}),/*#__PURE__*/_react.default.createElement(_styledComponents.SpotlightArea,null,/*#__PURE__*/_react.default.createElement("defs",null,/*#__PURE__*/_react.default.createElement("mask",{id:"hole"},/*#__PURE__*/_react.default.createElement("rect",{width:"100%",height:"100%",fill:"white"}),"circle"===d?/*#__PURE__*/_react.default.createElement(_styledComponents.SpotlightCircle,{transitionDuration:i,r:f,cx:b.horizontal,cy:b.vertical,fill:"black"}):/*#__PURE__*/_react.default.createElement(_styledComponents.SpotlightRect,{transitionDuration:i,width:k.width,height:k.height,x:b.horizontal,y:b.vertical,rx:k.borderRadius,ry:k.borderRadius,fill:"black"}))),/*#__PURE__*/_react.default.createElement("rect",{fill:"rgba(0,0,0,".concat("light"===r?.25:.5,")"),width:"100%",height:"100%",mask:"url(#hole)"}))):/*#__PURE__*/_react.default.createElement("div",null)},_default=Spotlight;exports.default=_default;
5
+ var _excluded=["position","shape","radius","hasLockBodyScroll","transitionDuration","rectangleProps","className","inlineStyle"];function _extends(){return _extends=Object.assign?Object.assign.bind():function(a){for(var b,c=1;c<arguments.length;c++)for(var d in b=arguments[c],b)Object.prototype.hasOwnProperty.call(b,d)&&(a[d]=b[d]);return a},_extends.apply(this,arguments)}function _objectWithoutProperties(a,b){if(null==a)return{};var c,d,e=_objectWithoutPropertiesLoose(a,b);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(a);for(d=0;d<f.length;d++)c=f[d],0<=b.indexOf(c)||Object.prototype.propertyIsEnumerable.call(a,c)&&(e[c]=a[c])}return e}function _objectWithoutPropertiesLoose(a,b){if(null==a)return{};var c,d,e={},f=Object.keys(a);for(d=0;d<f.length;d++)c=f[d],0<=b.indexOf(c)||(e[c]=a[c]);return e}import React,{useRef}from"react";import{SpotlightArea,SpotlightCircle,SpotlightRect}from"./styledComponents";import{useCurrentTheme}from"@elvia/elvis-toolbox";import{useLockBodyScroll}from"./useLockBodyScroll";var Spotlight=function(a){var b=a.position,c=a.shape,d=void 0===c?"circle":c,e=a.radius,f=void 0===e?200:e,g=a.hasLockBodyScroll,h=a.transitionDuration,i=void 0===h?"350ms":h,j=a.rectangleProps,k=void 0===j?{width:200,height:200,borderRadius:8}:j,l=a.className,m=a.inlineStyle,n=_objectWithoutProperties(a,_excluded),o=b&&void 0!==b.horizontal&&void 0!==b.vertical,p=useRef(null),q=useCurrentTheme(p),r=q.currentTheme;return useLockBodyScroll(void 0===g||g),o?/*#__PURE__*/React.createElement("div",_extends({className:"".concat(l?l:""),style:m},n,{ref:p}),/*#__PURE__*/React.createElement(SpotlightArea,null,/*#__PURE__*/React.createElement("defs",null,/*#__PURE__*/React.createElement("mask",{id:"hole"},/*#__PURE__*/React.createElement("rect",{width:"100%",height:"100%",fill:"white"}),"circle"===d?/*#__PURE__*/React.createElement(SpotlightCircle,{transitionDuration:i,r:f,cx:b.horizontal,cy:b.vertical,fill:"black"}):/*#__PURE__*/React.createElement(SpotlightRect,{transitionDuration:i,width:k.width,height:k.height,x:b.horizontal,y:b.vertical,rx:k.borderRadius,ry:k.borderRadius,fill:"black"}))),/*#__PURE__*/React.createElement("rect",{fill:"rgba(0,0,0,".concat("light"===r?.25:.5,")"),width:"100%",height:"100%",mask:"url(#hole)"}))):/*#__PURE__*/React.createElement("div",null)};export default Spotlight;
6
6
  //# sourceMappingURL=elvia-spotlight.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["elvia-spotlight.tsx"],"names":["Spotlight","position","shape","radius","hasLockBodyScroll","transitionDuration","rectangleProps","width","height","borderRadius","className","inlineStyle","rest","hasPosition","horizontal","vertical","spotlightDivRef","useRef","useCurrentTheme","currentTheme","useLockBodyScroll"],"mappings":";;;;ugEAOMA,UAA6B,CAAG,WAUhC,IATJC,EAAQ,GAARA,QAAQ,KACRC,KAAK,CAALA,CAAK,YAAG,QAAQ,OAChBC,MAAM,CAANA,CAAM,YAAG,GAAG,OACZC,iBAAiB,KACjBC,kBAAkB,CAAlBA,CAAkB,YAAG,OAAO,OAC5BC,cAAc,CAAdA,CAAc,YAAG,CAAEC,KAAK,CAAE,GAAG,CAAEC,MAAM,CAAE,GAAG,CAAEC,YAAY,CAAE,CAAE,CAAC,GAC7DC,CAAS,GAATA,SAAS,CACTC,CAAW,GAAXA,WAAW,CACRC,CAAI,uCAEDC,CAAW,CAAGZ,CAAQ,EAAI,SAAAA,CAAQ,CAACa,UAAwB,EAAI,SAAAb,CAAQ,CAACc,QAAsB,CAC9FC,CAAe,CAAG,GAAAC,aAAM,EAAiB,IAAI,CAAC,GAC3B,GAAAC,6BAAe,EAACF,CAAe,CAAC,CAAjDG,CAAY,GAAZA,YAAY,CAGpB,MAFA,GAAAC,oCAAiB,gBAAmB,CAE7BP,CAAW,cAChB,6CAAK,SAAS,WAAKH,CAAS,CAAGA,CAAS,CAAG,EAAE,CAAG,CAAC,KAAK,CAAEC,CAAY,EAAKC,CAAI,EAAE,GAAG,CAAEI,CAAgB,gBAClG,6BAAC,+BAAa,mBACZ,sDACE,qCAAM,EAAE,CAAC,MAAM,eACb,qCAAM,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAG,CACrC,QAAQ,GAAlBd,CAAkB,cACjB,6BAAC,iCAAe,EACd,kBAAkB,CAAEG,CAAmB,CACvC,CAAC,CAAEF,CAAO,CACV,EAAE,CAAEF,CAAQ,CAACa,UAAW,CACxB,EAAE,CAAEb,CAAQ,CAACc,QAAS,CACtB,IAAI,CAAC,OAAO,EACZ,cAEF,6BAAC,+BAAa,EACZ,kBAAkB,CAAEV,CAAmB,CACvC,KAAK,CAAEC,CAAc,CAACC,KAAM,CAC5B,MAAM,CAAED,CAAc,CAACE,MAAO,CAC9B,CAAC,CAAEP,CAAQ,CAACa,UAAW,CACvB,CAAC,CAAEb,CAAQ,CAACc,QAAS,CACrB,EAAE,CAAET,CAAc,CAACG,YAAa,CAChC,EAAE,CAAEH,CAAc,CAACG,YAAa,CAChC,IAAI,CAAC,OAAO,EAEf,CACI,CACF,cACP,qCACE,IAAI,sBAAiC,OAAO,GAAxBU,CAAwB,CAAG,GAAI,CAAG,EAAG,KAAI,CAC7D,KAAK,CAAC,MAAM,CACZ,MAAM,CAAC,MAAM,CACb,IAAI,CAAC,YAAY,EACjB,CACY,CACZ,cAEN,wCAEJ,CAAC,UAEcnB,SAAS","file":"elvia-spotlight.js","sourcesContent":["import React, { FC, useRef } from 'react';\nimport { SpotlightArea, SpotlightCircle, SpotlightRect } from './styledComponents';\nimport { useCurrentTheme } from '@elvia/elvis-toolbox';\n\nimport { useLockBodyScroll } from './useLockBodyScroll';\nimport { SpotlightProps } from './elvia-spotlight.types';\n\nconst Spotlight: FC<SpotlightProps> = ({\n position,\n shape = 'circle',\n radius = 200,\n hasLockBodyScroll = true,\n transitionDuration = '350ms',\n rectangleProps = { width: 200, height: 200, borderRadius: 8 },\n className,\n inlineStyle,\n ...rest\n}) => {\n const hasPosition = position && position.horizontal !== undefined && position.vertical !== undefined;\n const spotlightDivRef = useRef<HTMLDivElement>(null);\n const { currentTheme } = useCurrentTheme(spotlightDivRef);\n useLockBodyScroll(hasLockBodyScroll);\n\n return hasPosition ? (\n <div className={`${className ? className : ''}`} style={inlineStyle} {...rest} ref={spotlightDivRef}>\n <SpotlightArea>\n <defs>\n <mask id=\"hole\">\n <rect width=\"100%\" height=\"100%\" fill=\"white\" />\n {shape === 'circle' ? (\n <SpotlightCircle\n transitionDuration={transitionDuration}\n r={radius}\n cx={position.horizontal}\n cy={position.vertical}\n fill=\"black\"\n />\n ) : (\n <SpotlightRect\n transitionDuration={transitionDuration}\n width={rectangleProps.width}\n height={rectangleProps.height}\n x={position.horizontal}\n y={position.vertical}\n rx={rectangleProps.borderRadius}\n ry={rectangleProps.borderRadius}\n fill=\"black\"\n />\n )}\n </mask>\n </defs>\n <rect\n fill={`rgba(0,0,0,${currentTheme === 'light' ? 0.25 : 0.5})`}\n width=\"100%\"\n height=\"100%\"\n mask=\"url(#hole)\"\n />\n </SpotlightArea>\n </div>\n ) : (\n <div></div>\n );\n};\n\nexport default Spotlight;\n"]}
1
+ {"version":3,"sources":["elvia-spotlight.tsx"],"names":["React","useRef","SpotlightArea","SpotlightCircle","SpotlightRect","useCurrentTheme","useLockBodyScroll","Spotlight","position","shape","radius","hasLockBodyScroll","transitionDuration","rectangleProps","width","height","borderRadius","className","inlineStyle","rest","hasPosition","horizontal","vertical","spotlightDivRef","currentTheme"],"mappings":";;;;4zBAAA,MAAOA,MAAK,EAAQC,MAAM,KAAQ,OAAO,CACzC,OAASC,aAAa,CAAEC,eAAe,CAAEC,aAAa,KAAQ,oBAAoB,CAClF,OAASC,eAAe,KAAQ,sBAAsB,CAEtD,OAASC,iBAAiB,KAAQ,qBAAqB,CAGvD,GAAMC,UAA6B,CAAG,WAUhC,IATJC,EAAQ,GAARA,QAAQ,KACRC,KAAK,CAALA,CAAK,YAAG,QAAQ,OAChBC,MAAM,CAANA,CAAM,YAAG,GAAG,OACZC,iBAAiB,KACjBC,kBAAkB,CAAlBA,CAAkB,YAAG,OAAO,OAC5BC,cAAc,CAAdA,CAAc,YAAG,CAAEC,KAAK,CAAE,GAAG,CAAEC,MAAM,CAAE,GAAG,CAAEC,YAAY,CAAE,CAAE,CAAC,GAC7DC,CAAS,GAATA,SAAS,CACTC,CAAW,GAAXA,WAAW,CACRC,CAAI,uCAEDC,CAAW,CAAGZ,CAAQ,EAAI,SAAAA,CAAQ,CAACa,UAAwB,EAAI,SAAAb,CAAQ,CAACc,QAAsB,CAC9FC,CAAe,CAAGtB,MAAM,CAAiB,IAAI,CAAC,GAC3BI,eAAe,CAACkB,CAAe,CAAC,CAAjDC,CAAY,GAAZA,YAAY,CAGpB,MAFAlB,kBAAiB,eAAmB,CAE7Bc,CAAW,cAChB,oCAAK,SAAS,WAAKH,CAAS,CAAGA,CAAS,CAAG,EAAE,CAAG,CAAC,KAAK,CAAEC,CAAY,EAAKC,CAAI,EAAE,GAAG,CAAEI,CAAgB,gBAClG,oBAAC,aAAa,mBACZ,6CACE,4BAAM,EAAE,CAAC,MAAM,eACb,4BAAM,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAG,CACrC,QAAQ,GAAlBd,CAAkB,cACjB,oBAAC,eAAe,EACd,kBAAkB,CAAEG,CAAmB,CACvC,CAAC,CAAEF,CAAO,CACV,EAAE,CAAEF,CAAQ,CAACa,UAAW,CACxB,EAAE,CAAEb,CAAQ,CAACc,QAAS,CACtB,IAAI,CAAC,OAAO,EACZ,cAEF,oBAAC,aAAa,EACZ,kBAAkB,CAAEV,CAAmB,CACvC,KAAK,CAAEC,CAAc,CAACC,KAAM,CAC5B,MAAM,CAAED,CAAc,CAACE,MAAO,CAC9B,CAAC,CAAEP,CAAQ,CAACa,UAAW,CACvB,CAAC,CAAEb,CAAQ,CAACc,QAAS,CACrB,EAAE,CAAET,CAAc,CAACG,YAAa,CAChC,EAAE,CAAEH,CAAc,CAACG,YAAa,CAChC,IAAI,CAAC,OAAO,EAEf,CACI,CACF,cACP,4BACE,IAAI,sBAAiC,OAAO,GAAxBQ,CAAwB,CAAG,GAAI,CAAG,EAAG,KAAI,CAC7D,KAAK,CAAC,MAAM,CACZ,MAAM,CAAC,MAAM,CACb,IAAI,CAAC,YAAY,EACjB,CACY,CACZ,cAEN,+BAEJ,CAAC,CAED,cAAejB,UAAS","file":"elvia-spotlight.js","sourcesContent":["import React, { FC, useRef } from 'react';\nimport { SpotlightArea, SpotlightCircle, SpotlightRect } from './styledComponents';\nimport { useCurrentTheme } from '@elvia/elvis-toolbox';\n\nimport { useLockBodyScroll } from './useLockBodyScroll';\nimport { SpotlightProps } from './elvia-spotlight.types';\n\nconst Spotlight: FC<SpotlightProps> = ({\n position,\n shape = 'circle',\n radius = 200,\n hasLockBodyScroll = true,\n transitionDuration = '350ms',\n rectangleProps = { width: 200, height: 200, borderRadius: 8 },\n className,\n inlineStyle,\n ...rest\n}) => {\n const hasPosition = position && position.horizontal !== undefined && position.vertical !== undefined;\n const spotlightDivRef = useRef<HTMLDivElement>(null);\n const { currentTheme } = useCurrentTheme(spotlightDivRef);\n useLockBodyScroll(hasLockBodyScroll);\n\n return hasPosition ? (\n <div className={`${className ? className : ''}`} style={inlineStyle} {...rest} ref={spotlightDivRef}>\n <SpotlightArea>\n <defs>\n <mask id=\"hole\">\n <rect width=\"100%\" height=\"100%\" fill=\"white\" />\n {shape === 'circle' ? (\n <SpotlightCircle\n transitionDuration={transitionDuration}\n r={radius}\n cx={position.horizontal}\n cy={position.vertical}\n fill=\"black\"\n />\n ) : (\n <SpotlightRect\n transitionDuration={transitionDuration}\n width={rectangleProps.width}\n height={rectangleProps.height}\n x={position.horizontal}\n y={position.vertical}\n rx={rectangleProps.borderRadius}\n ry={rectangleProps.borderRadius}\n fill=\"black\"\n />\n )}\n </mask>\n </defs>\n <rect\n fill={`rgba(0,0,0,${currentTheme === 'light' ? 0.25 : 0.5})`}\n width=\"100%\"\n height=\"100%\"\n mask=\"url(#hole)\"\n />\n </SpotlightArea>\n </div>\n ) : (\n <div></div>\n );\n};\n\nexport default Spotlight;\n"]}
@@ -2,5 +2,5 @@
2
2
  * THIS FILE IS AUTOMATICALLY GENERATED AND WILL BE OVERWRITTEN.
3
3
  * DO NOT MAKE CHANGES TO THIS FILE DIRECTLY
4
4
  */
5
- "use strict";
5
+ export{};
6
6
  //# sourceMappingURL=elvia-spotlight.types.js.map
@@ -2,5 +2,5 @@
2
2
  * THIS FILE IS AUTOMATICALLY GENERATED AND WILL BE OVERWRITTEN.
3
3
  * DO NOT MAKE CHANGES TO THIS FILE DIRECTLY
4
4
  */
5
- "use strict";var _styledComponents=_interopRequireDefault(require("styled-components"));Object.defineProperty(exports,"__esModule",{value:!0}),exports.SpotlightRect=exports.SpotlightCircle=exports.SpotlightArea=void 0;function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}var SpotlightArea=_styledComponents.default.svg.withConfig({displayName:"styledComponents__SpotlightArea",componentId:"sc-env4mw-0"})(["position:fixed;top:0;left:0;z-index:99999;width:100vw;height:100vh;"]);exports.SpotlightArea=SpotlightArea;var SpotlightCircle=_styledComponents.default.circle.withConfig({displayName:"styledComponents__SpotlightCircle",componentId:"sc-env4mw-1"})(["transition:all "," ease-in-out;"],function(a){return a.transitionDuration});exports.SpotlightCircle=SpotlightCircle;var SpotlightRect=_styledComponents.default.rect.withConfig({displayName:"styledComponents__SpotlightRect",componentId:"sc-env4mw-2"})(["transition:all "," ease-in-out;"],function(a){return a.transitionDuration});exports.SpotlightRect=SpotlightRect;
5
+ import styled from"styled-components";export var SpotlightArea=styled.svg.withConfig({displayName:"styledComponents__SpotlightArea",componentId:"sc-env4mw-0"})(["position:fixed;top:0;left:0;z-index:99999;width:100vw;height:100vh;"]);export var SpotlightCircle=styled.circle.withConfig({displayName:"styledComponents__SpotlightCircle",componentId:"sc-env4mw-1"})(["transition:all "," ease-in-out;"],function(a){return a.transitionDuration});export var SpotlightRect=styled.rect.withConfig({displayName:"styledComponents__SpotlightRect",componentId:"sc-env4mw-2"})(["transition:all "," ease-in-out;"],function(a){return a.transitionDuration});
6
6
  //# sourceMappingURL=styledComponents.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["styledComponents.tsx"],"names":["SpotlightArea","styled","svg","SpotlightCircle","circle","props","transitionDuration","SpotlightRect","rect"],"mappings":";;;;aAAA,2EAAuC,0MAEhC,GAAMA,cAAa,CAAGC,yBAAM,CAACC,GAAG,+JAOtC,CAAC,oCAMK,GAAMC,gBAAe,CAAGF,yBAAM,CAACG,MAAM,6HACxB,SAACC,CAAK,QAAKA,EAAK,CAACC,kBAAkB,EACtD,CAAC,wCAKK,GAAMC,cAAa,CAAGN,yBAAM,CAACO,IAAI,2HACpB,SAACH,CAAK,QAAKA,EAAK,CAACC,kBAAkB,EACtD,CAAC","file":"styledComponents.js","sourcesContent":["import styled from 'styled-components';\n\nexport const SpotlightArea = styled.svg`\n position: fixed;\n top: 0;\n left: 0;\n z-index: 99999;\n width: 100vw;\n height: 100vh;\n`;\n\ninterface SpotlightCircleProps {\n transitionDuration: string;\n}\n\nexport const SpotlightCircle = styled.circle<SpotlightCircleProps>`\n transition: all ${(props) => props.transitionDuration} ease-in-out;\n`;\ninterface SpotlightRectProps {\n transitionDuration: string;\n}\n\nexport const SpotlightRect = styled.rect<SpotlightRectProps>`\n transition: all ${(props) => props.transitionDuration} ease-in-out;\n`;\n"]}
1
+ {"version":3,"sources":["styledComponents.tsx"],"names":["styled","SpotlightArea","svg","SpotlightCircle","circle","props","transitionDuration","SpotlightRect","rect"],"mappings":";;;;AAAA,MAAOA,OAAM,KAAM,mBAAmB,CAEtC,MAAO,IAAMC,cAAa,CAAGD,MAAM,CAACE,GAAG,+JAOtC,CAMD,MAAO,IAAMC,gBAAe,CAAGH,MAAM,CAACI,MAAM,6HACxB,SAACC,CAAK,QAAKA,EAAK,CAACC,kBAAkB,EACtD,CAKD,MAAO,IAAMC,cAAa,CAAGP,MAAM,CAACQ,IAAI,2HACpB,SAACH,CAAK,QAAKA,EAAK,CAACC,kBAAkB,EACtD","file":"styledComponents.js","sourcesContent":["import styled from 'styled-components';\n\nexport const SpotlightArea = styled.svg`\n position: fixed;\n top: 0;\n left: 0;\n z-index: 99999;\n width: 100vw;\n height: 100vh;\n`;\n\ninterface SpotlightCircleProps {\n transitionDuration: string;\n}\n\nexport const SpotlightCircle = styled.circle<SpotlightCircleProps>`\n transition: all ${(props) => props.transitionDuration} ease-in-out;\n`;\ninterface SpotlightRectProps {\n transitionDuration: string;\n}\n\nexport const SpotlightRect = styled.rect<SpotlightRectProps>`\n transition: all ${(props) => props.transitionDuration} ease-in-out;\n`;\n"]}
@@ -2,6 +2,6 @@
2
2
  * THIS FILE IS AUTOMATICALLY GENERATED AND WILL BE OVERWRITTEN.
3
3
  * DO NOT MAKE CHANGES TO THIS FILE DIRECTLY
4
4
  */
5
- "use strict";var _react=require("react");Object.defineProperty(exports,"__esModule",{value:!0}),exports.useLockBodyScroll=useLockBodyScroll;// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
6
- function useLockBodyScroll(a){(0,_react.useEffect)(function(){var b=window.getComputedStyle(document.body).overflow,c=window.getComputedStyle(document.documentElement).overflow;return a?(document.body.style.overflow="hidden",document.documentElement.style.overflow="hidden",function(){document.body.style.overflow=b,document.documentElement.style.overflow=c}):(document.body.style.overflow=b,void(document.documentElement.style.overflow=c))},[a])}
5
+ import{useEffect}from"react";// eslint-disable-next-line
6
+ export function useLockBodyScroll(a){useEffect(function(){var b=window.getComputedStyle(document.body).overflow,c=window.getComputedStyle(document.documentElement).overflow;return a?(document.body.style.overflow="hidden",document.documentElement.style.overflow="hidden",function(){document.body.style.overflow=b,document.documentElement.style.overflow=c}):(document.body.style.overflow=b,void(document.documentElement.style.overflow=c))},[a])}
7
7
  //# sourceMappingURL=useLockBodyScroll.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["useLockBodyScroll.tsx"],"names":["useLockBodyScroll","removeLockBodyScroll","useEffect","originalStyleOverflowBody","window","getComputedStyle","document","body","overflow","originalStyleOverflowHtml","documentElement","style"],"mappings":";;;;aAAA,4BAAkC,mGAElC;AACO,QAASA,kBAAiB,CAACC,CAA6B,CAAE,CAC/D,GAAAC,gBAAS,EAAC,UAAM,IACRC,EAAyB,CAAGC,MAAM,CAACC,gBAAgB,CAACC,QAAQ,CAACC,IAAI,CAAC,CAACC,QAAQ,CAC3EC,CAAyB,CAAGL,MAAM,CAACC,gBAAgB,CAACC,QAAQ,CAACI,eAAe,CAAC,CAACF,QAAQ,OACvFP,EAAoB,EAKzBK,QAAQ,CAACC,IAAI,CAACI,KAAK,CAACH,QAAQ,CAAG,QAAQ,CACvCF,QAAQ,CAACI,eAAe,CAACC,KAAK,CAACH,QAAQ,CAAG,QAAQ,CAE3C,UAAM,CACXF,QAAQ,CAACC,IAAI,CAACI,KAAK,CAACH,QAAQ,CAAGL,CAAyB,CACxDG,QAAQ,CAACI,eAAe,CAACC,KAAK,CAACH,QAAQ,CAAGC,CAC5C,CAAC,GAVCH,QAAQ,CAACC,IAAI,CAACI,KAAK,CAACH,QAAQ,CAAGL,CAAyB,MACxDG,QAAQ,CAACI,eAAe,CAACC,KAAK,CAACH,QAAQ,CAAGC,CAAyB,EAUvE,CAAC,CAAE,CAACR,CAAoB,CAAC,CAC3B","file":"useLockBodyScroll.js","sourcesContent":["import { useEffect } from 'react';\n\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function useLockBodyScroll(removeLockBodyScroll: boolean) {\n useEffect(() => {\n const originalStyleOverflowBody = window.getComputedStyle(document.body).overflow;\n const originalStyleOverflowHtml = window.getComputedStyle(document.documentElement).overflow;\n if (!removeLockBodyScroll) {\n document.body.style.overflow = originalStyleOverflowBody;\n document.documentElement.style.overflow = originalStyleOverflowHtml;\n return;\n }\n document.body.style.overflow = 'hidden';\n document.documentElement.style.overflow = 'hidden';\n\n return () => {\n document.body.style.overflow = originalStyleOverflowBody;\n document.documentElement.style.overflow = originalStyleOverflowHtml;\n };\n }, [removeLockBodyScroll]);\n}\n"]}
1
+ {"version":3,"sources":["useLockBodyScroll.tsx"],"names":["useEffect","useLockBodyScroll","removeLockBodyScroll","originalStyleOverflowBody","window","getComputedStyle","document","body","overflow","originalStyleOverflowHtml","documentElement","style"],"mappings":";;;;AAAA,OAASA,SAAS,KAAQ,OAAO,CAEjC;AACA,MAAO,SAASC,kBAAiB,CAACC,CAA6B,CAAE,CAC/DF,SAAS,CAAC,UAAM,IACRG,EAAyB,CAAGC,MAAM,CAACC,gBAAgB,CAACC,QAAQ,CAACC,IAAI,CAAC,CAACC,QAAQ,CAC3EC,CAAyB,CAAGL,MAAM,CAACC,gBAAgB,CAACC,QAAQ,CAACI,eAAe,CAAC,CAACF,QAAQ,OACvFN,EAAoB,EAKzBI,QAAQ,CAACC,IAAI,CAACI,KAAK,CAACH,QAAQ,CAAG,QAAQ,CACvCF,QAAQ,CAACI,eAAe,CAACC,KAAK,CAACH,QAAQ,CAAG,QAAQ,CAE3C,UAAM,CACXF,QAAQ,CAACC,IAAI,CAACI,KAAK,CAACH,QAAQ,CAAGL,CAAyB,CACxDG,QAAQ,CAACI,eAAe,CAACC,KAAK,CAACH,QAAQ,CAAGC,CAC5C,CAAC,GAVCH,QAAQ,CAACC,IAAI,CAACI,KAAK,CAACH,QAAQ,CAAGL,CAAyB,MACxDG,QAAQ,CAACI,eAAe,CAACC,KAAK,CAACH,QAAQ,CAAGC,CAAyB,EAUvE,CAAC,CAAE,CAACP,CAAoB,CAAC,CAC3B","file":"useLockBodyScroll.js","sourcesContent":["import { useEffect } from 'react';\n\n// eslint-disable-next-line\nexport function useLockBodyScroll(removeLockBodyScroll: boolean) {\n useEffect(() => {\n const originalStyleOverflowBody = window.getComputedStyle(document.body).overflow;\n const originalStyleOverflowHtml = window.getComputedStyle(document.documentElement).overflow;\n if (!removeLockBodyScroll) {\n document.body.style.overflow = originalStyleOverflowBody;\n document.documentElement.style.overflow = originalStyleOverflowHtml;\n return;\n }\n document.body.style.overflow = 'hidden';\n document.documentElement.style.overflow = 'hidden';\n\n return () => {\n document.body.style.overflow = originalStyleOverflowBody;\n document.documentElement.style.overflow = originalStyleOverflowHtml;\n };\n }, [removeLockBodyScroll]);\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elvia/elvis-spotlight",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "main": "web_component.js",
5
5
  "license": "MIT",
6
6
  "homepage": "https://design.elvia.io/components/spotlight",
@@ -13,8 +13,8 @@
13
13
  "dist/**/*"
14
14
  ],
15
15
  "dependencies": {
16
- "@elvia/elvis-component-wrapper": "^4.0.0",
17
- "@elvia/elvis-toolbox": "^7.8.0",
16
+ "@elvia/elvis-component-wrapper": "^4.1.2",
17
+ "@elvia/elvis-toolbox": "^8.0.0",
18
18
  "styled-components": "^5.3.3"
19
19
  },
20
20
  "peerDependencies": {