@elvia/elvis-spotlight 1.6.2 → 1.6.4

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,32 @@
1
1
  {
2
2
  "$schema": "../../changelogSchema.json",
3
+ "name": "elvis-spotlight",
3
4
  "content": [
5
+ {
6
+ "date": "30.05.24",
7
+ "version": "1.6.4",
8
+ "changelog": [
9
+ {
10
+ "type": "patch",
11
+ "changes": [
12
+ "Now using <code>@emotion</code> for styling instead of <code>styled-components</code>.",
13
+ "Updated internal dependencies."
14
+ ]
15
+ }
16
+ ]
17
+ },
18
+ {
19
+ "date": "11.03.24",
20
+ "version": "1.6.3",
21
+ "changelog": [
22
+ {
23
+ "type": "bug_fix",
24
+ "changes": [
25
+ "Fixed a problem where the spotlight background would not resize when the window was resized."
26
+ ]
27
+ }
28
+ ]
29
+ },
4
30
  {
5
31
  "date": "06.10.23",
6
32
  "version": "1.6.2",
@@ -0,0 +1,96 @@
1
+ // components/elvis-spotlight/src/react/config.ts
2
+ import * as ReactComponent from "../../react.js";
3
+ import { ElvisComponentWrapper } from "@elvia/elvis-component-wrapper";
4
+ var ElviaComponent = class _ElviaComponent extends ElvisComponentWrapper {
5
+ static get observedAttributes() {
6
+ return ["position", "shape", "radius", "rectangleprops", "haslockbodyscroll", "transitionduration", "classname", "inlinestyle"];
7
+ }
8
+ static getComponentData() {
9
+ return { "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" }] };
10
+ }
11
+ set position(newValue) {
12
+ super.setProps({ "position": newValue });
13
+ }
14
+ get position() {
15
+ return super.getProps()["position"];
16
+ }
17
+ set shape(newValue) {
18
+ super.setProps({ "shape": newValue });
19
+ }
20
+ get shape() {
21
+ return super.getProps()["shape"];
22
+ }
23
+ set radius(newValue) {
24
+ super.setProps({ "radius": newValue });
25
+ }
26
+ get radius() {
27
+ return super.getProps()["radius"];
28
+ }
29
+ set rectangleProps(newValue) {
30
+ super.setProps({ "rectangleprops": newValue });
31
+ }
32
+ get rectangleProps() {
33
+ return super.getProps()["rectangleprops"];
34
+ }
35
+ set rectangleprops(newValue) {
36
+ super.setProps({ "rectangleprops": newValue });
37
+ }
38
+ get rectangleprops() {
39
+ return super.getProps()["rectangleprops"];
40
+ }
41
+ set hasLockBodyScroll(newValue) {
42
+ super.setProps({ "haslockbodyscroll": newValue });
43
+ }
44
+ get hasLockBodyScroll() {
45
+ return super.getProps()["haslockbodyscroll"];
46
+ }
47
+ set haslockbodyscroll(newValue) {
48
+ super.setProps({ "haslockbodyscroll": newValue });
49
+ }
50
+ get haslockbodyscroll() {
51
+ return super.getProps()["haslockbodyscroll"];
52
+ }
53
+ set transitionDuration(newValue) {
54
+ super.setProps({ "transitionduration": newValue });
55
+ }
56
+ get transitionDuration() {
57
+ return super.getProps()["transitionduration"];
58
+ }
59
+ set transitionduration(newValue) {
60
+ super.setProps({ "transitionduration": newValue });
61
+ }
62
+ get transitionduration() {
63
+ return super.getProps()["transitionduration"];
64
+ }
65
+ set className(newValue) {
66
+ super.setProps({ "classname": newValue });
67
+ }
68
+ get className() {
69
+ return super.getProps()["classname"];
70
+ }
71
+ set classname(newValue) {
72
+ super.setProps({ "classname": newValue });
73
+ }
74
+ get classname() {
75
+ return super.getProps()["classname"];
76
+ }
77
+ set inlineStyle(newValue) {
78
+ super.setProps({ "inlinestyle": newValue });
79
+ }
80
+ get inlineStyle() {
81
+ return super.getProps()["inlinestyle"];
82
+ }
83
+ set inlinestyle(newValue) {
84
+ super.setProps({ "inlinestyle": newValue });
85
+ }
86
+ get inlinestyle() {
87
+ return super.getProps()["inlinestyle"];
88
+ }
89
+ constructor() {
90
+ super(_ElviaComponent, ReactComponent["Spotlight"]);
91
+ }
92
+ };
93
+ window.customElements.define(`elvia-spotlight`, ElviaComponent);
94
+ export {
95
+ ElviaComponent as default
96
+ };
@@ -1,4 +1,4 @@
1
1
  import { FC } from 'react';
2
2
  import { SpotlightProps } from './elvia-spotlight.types';
3
- declare const Spotlight: FC<SpotlightProps>;
3
+ export declare const Spotlight: FC<SpotlightProps>;
4
4
  export default Spotlight;
@@ -0,0 +1,90 @@
1
+ // components/elvis-spotlight/src/react/elvia-spotlight.tsx
2
+ import React from "react";
3
+
4
+ // components/elvis-spotlight/src/react/styledComponents.tsx
5
+ import _styled from "@emotion/styled/base";
6
+ function _EMOTION_STRINGIFIED_CSS_ERROR__() {
7
+ return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
8
+ }
9
+ var SpotlightArea = /* @__PURE__ */ _styled("svg", {
10
+ target: "e1uexsug3",
11
+ label: "SpotlightArea"
12
+ })(false ? {
13
+ name: "8afq30",
14
+ styles: "position:fixed;top:0;left:0;z-index:99999;width:100vw;height:100vh"
15
+ } : {
16
+ name: "8afq30",
17
+ styles: "position:fixed;top:0;left:0;z-index:99999;width:100vw;height:100vh",
18
+ map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlZENvbXBvbmVudHMudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUV1QyIsImZpbGUiOiJzdHlsZWRDb21wb25lbnRzLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcblxuZXhwb3J0IGNvbnN0IFNwb3RsaWdodEFyZWEgPSBzdHlsZWQuc3ZnYFxuICBwb3NpdGlvbjogZml4ZWQ7XG4gIHRvcDogMDtcbiAgbGVmdDogMDtcbiAgei1pbmRleDogOTk5OTk7XG4gIHdpZHRoOi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20
+ });
21
+ var SpotlightCircle = /* @__PURE__ */ _styled("circle", {
22
+ target: "e1uexsug2",
23
+ label: "SpotlightCircle"
24
+ })("transition:all ", ({
25
+ transitionDuration
26
+ }) => transitionDuration, " ease-in-out;" + (false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlZENvbXBvbmVudHMudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWVrRSIsImZpbGUiOiJzdHlsZWRDb21wb25lbnRzLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcblxuZXhwb3J0IGNvbnN0IFNwb3RsaWdodEFyZWEgPSBzdHlsZWQuc3ZnYFxuICBwb3NpdGlvbjogZml4ZWQ7XG4gIHRvcDogMDtcbiAgbGVmdDogMDtcbiAgei1pbmRleDogOTk5OTk7XG4gIHdpZHRoOiAxMDB2dztcbiAgaGVpZ2h0OiAxMDB2aDtcbmA7XG5cbmludGVyZmFjZSBTcG90bGlnaHRDaXJjbGVQcm9wcyB7XG4gIHRyYW5zaXRpb25EdXJhdGlvbjogc3RyaW5nO1xufVxuXG5leHBvcnQgY29uc3QgU3BvdGxpZ2h0Q2lyY2xlID0gc3R5bGVkLmNpcmNsZTxTcG90bGlnaHRDaXJjbGVQcm9wcz5gXG4gIHRyYW5zaXRpb246IGFsbCAkeyh7IHRyYW5zaXRpb25EdXJhdGlvbiB9KSA9PiB0cmFuc2l0aW9uRHVyYXRpb259IGVhc2UtaW4tb3V0O1xuYDtcbmludGVyZmFjZSBTcG90bGlnaHRSZWN0UHJvcHMge1xuICB0cmFuc2l0aW9uRHVyYXRpb246IHN0cmluZztcbn1cblxuZXhwb3J0IGNvbnN0IFNwb3RsaWdodFJlY3QgPSBzdHlsZWQucmVjdDxTcG90bGlnaHRSZWN0UHJvcHM+YFxuICB0cmFuc2l0aW9uOiBhbGwgJHsoeyB0cmFuc2l0aW9uRHVyYXRpb24gfSkgPT4gdHJhbnNpdGlvbkR1cmF0aW9ufSBlYXNlLWluLW91dDtcbmA7XG5cbmV4cG9ydCBjb25zdCBTcG90bGlnaHRNYXNrID0gc3R5bGVkLnJlY3RgXG4gIC0tZXdjLXNwb3RsaWdodC1tYXNrLWZpbGw6IDAuMjU7XG4gIC5lLWNvbG9yLWJhY2tncm91bmQtMyAmJixcbiAgLmUtdGhlbWUtZGFyayAmJixcbiAgLmUtY29sb3ItYmFja2dyb3VuZC0zICYmIHtcbiAgICAtLWV3Yy1zcG90bGlnaHQtbWFzay1maWxsOiAwLjU7XG4gIH1cblxuICBmaWxsOiByZ2JhKDAsIDAsIDAsIHZhcigtLWV3Yy1zcG90bGlnaHQtbWFzay1maWxsKSk7XG4gIHdpZHRoOiAxMDB2dztcbiAgaGVpZ2h0OiAxMDB2aDtcbmA7XG4iXX0= */"));
27
+ var SpotlightRect = /* @__PURE__ */ _styled("rect", {
28
+ target: "e1uexsug1",
29
+ label: "SpotlightRect"
30
+ })("transition:all ", ({
31
+ transitionDuration
32
+ }) => transitionDuration, " ease-in-out;" + (false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlZENvbXBvbmVudHMudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXNCNEQiLCJmaWxlIjoic3R5bGVkQ29tcG9uZW50cy50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5cbmV4cG9ydCBjb25zdCBTcG90bGlnaHRBcmVhID0gc3R5bGVkLnN2Z2BcbiAgcG9zaXRpb246IGZpeGVkO1xuICB0b3A6IDA7XG4gIGxlZnQ6IDA7XG4gIHotaW5kZXg6IDk5OTk5O1xuICB3aWR0aDogMTAwdnc7XG4gIGhlaWdodDogMTAwdmg7XG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",
35
+ label: "SpotlightMask"
36
+ })(false ? {
37
+ name: "j858q8",
38
+ styles: "--ewc-spotlight-mask-fill:0.25;.e-color-background-3 &&,.e-theme-dark &&,.e-color-background-3 &&{--ewc-spotlight-mask-fill:0.5;}fill:rgba(0, 0, 0, var(--ewc-spotlight-mask-fill));width:100vw;height:100vh"
39
+ } : {
40
+ name: "j858q8",
41
+ styles: "--ewc-spotlight-mask-fill:0.25;.e-color-background-3 &&,.e-theme-dark &&,.e-color-background-3 &&{--ewc-spotlight-mask-fill:0.5;}fill:rgba(0, 0, 0, var(--ewc-spotlight-mask-fill));width:100vw;height:100vh",
42
+ map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlZENvbXBvbmVudHMudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQTBCd0MiLCJmaWxlIjoic3R5bGVkQ29tcG9uZW50cy50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5cbmV4cG9ydCBjb25zdCBTcG90bGlnaHRBcmVhID0gc3R5bGVkLnN2Z2BcbiAgcG9zaXRpb246IGZpeGVkO1xuICB0b3A6IDA7XG4gIGxlZnQ6IDA7XG4gIHotaW5kZXg6IDk5OTk5O1xuICB3aWR0aDogMTAwdnc7XG4gIGhlaWdodDogMTAwdmg7XG5gO1xuXG5pbnRlcmZhY2UgU3BvdGxpZ2h0Q2lyY2xlUHJvcHMge1xuICB0cmFuc2l0aW9uRHVyYXRpb246IHN0cmluZztcbn1cblxuZXhwb3J0IGNvbnN0IFNwb3RsaWdodENpcmNsZSA9IHN0eWxlZC5jaXJjbGU8U3BvdGxpZ2h0Q2lyY2xlUHJvcHM+YFxuICB0cmFuc2l0aW9uOiBhbGwgJHsoeyB0cmFuc2l0aW9uRHVyYXRpb24gfSkgPT4gdHJhbnNpdGlvbkR1cmF0aW9ufSBlYXNlLWluLW91dDtcbmA7XG5pbnRlcmZhY2UgU3BvdGxpZ2h0UmVjdFByb3BzIHtcbiAgdHJhbnNpdGlvbkR1cmF0aW9uOiBzdHJpbmc7XG59XG5cbmV4cG9ydCBjb25zdCBTcG90bGlnaHRSZWN0ID0gc3R5bGVkLnJlY3Q8U3BvdGxpZ2h0UmVjdFByb3BzPmBcbiAgdHJhbnNpdGlvbjogYWxsICR7KHsgdHJhbnNpdGlvbkR1cmF0aW9uIH0pID0+IHRyYW5zaXRpb25EdXJhdGlvbn0gZWFzZS1pbi1vdXQ7XG5gO1xuXG5leHBvcnQgY29uc3QgU3BvdGxpZ2h0TWFzayA9IHN0eWxlZC5yZWN0YFxuICAtLWV3Yy1zcG90bGlnaHQtbWFzay1maWxsOiAwLjI1O1xuICAuZS1jb2xvci1iYWNrZ3JvdW5kLTMgJiYsXG4gIC5lLXRoZW1lLWRhcmsgJiYsXG4gIC5lLWNvbG9yLWJhY2tncm91bmQtMyAmJiB7XG4gICAgLS1ld2Mtc3BvdGxpZ2h0LW1hc2stZmlsbDogMC41O1xuICB9XG5cbiAgZmlsbDogcmdiYSgwLCAwLCAwLCB2YXIoLS1ld2Mtc3BvdGxpZ2h0LW1hc2stZmlsbCkpO1xuICB3aWR0aDogMTAwdnc7XG4gIGhlaWdodDogMTAwdmg7XG5gO1xuIl19 */",
43
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
44
+ });
45
+
46
+ // components/elvis-spotlight/src/react/useLockBodyScroll.tsx
47
+ import { useEffect } from "react";
48
+ function useLockBodyScroll(removeLockBodyScroll) {
49
+ useEffect(() => {
50
+ const originalStyleOverflowBody = window.getComputedStyle(document.body).overflow;
51
+ const originalStyleOverflowHtml = window.getComputedStyle(document.documentElement).overflow;
52
+ if (!removeLockBodyScroll) {
53
+ document.body.style.overflow = originalStyleOverflowBody;
54
+ document.documentElement.style.overflow = originalStyleOverflowHtml;
55
+ return;
56
+ }
57
+ document.body.style.overflow = "hidden";
58
+ document.documentElement.style.overflow = "hidden";
59
+ return () => {
60
+ document.body.style.overflow = originalStyleOverflowBody;
61
+ document.documentElement.style.overflow = originalStyleOverflowHtml;
62
+ };
63
+ }, [removeLockBodyScroll]);
64
+ }
65
+
66
+ // components/elvis-spotlight/src/react/elvia-spotlight.tsx
67
+ var Spotlight = ({
68
+ position,
69
+ shape = "circle",
70
+ radius = 200,
71
+ hasLockBodyScroll = true,
72
+ transitionDuration = "350ms",
73
+ rectangleProps = {
74
+ width: 200,
75
+ height: 200,
76
+ borderRadius: 8
77
+ },
78
+ className,
79
+ inlineStyle,
80
+ ...rest
81
+ }) => {
82
+ const hasPosition = position && position.horizontal !== void 0 && position.vertical !== void 0;
83
+ useLockBodyScroll(hasLockBodyScroll);
84
+ return hasPosition ? /* @__PURE__ */ React.createElement("div", { className, style: inlineStyle, ...rest }, /* @__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" }), shape === "circle" ? /* @__PURE__ */ React.createElement(SpotlightCircle, { transitionDuration, r: radius, cx: position.horizontal, cy: position.vertical, fill: "black" }) : /* @__PURE__ */ React.createElement(SpotlightRect, { transitionDuration, width: rectangleProps.width, height: rectangleProps.height, x: position.horizontal, y: position.vertical, rx: rectangleProps.borderRadius, ry: rectangleProps.borderRadius, fill: "black" }))), /* @__PURE__ */ React.createElement(SpotlightMask, { mask: "url(#hole)" }))) : /* @__PURE__ */ React.createElement("div", null);
85
+ };
86
+ var elvia_spotlight_default = Spotlight;
87
+ export {
88
+ Spotlight,
89
+ elvia_spotlight_default as default
90
+ };
@@ -10,10 +10,12 @@ export interface SpotlightRectangleProps {
10
10
  height?: number;
11
11
  borderRadius?: number;
12
12
  }
13
- export interface SpotlightProps extends ComponentPropsWithoutRef<'div'>, BaseProps, HasTransitionDuration {
13
+ export interface BaseSpotlightProps extends BaseProps, HasTransitionDuration {
14
14
  position?: SpotlightPosition;
15
15
  shape?: SpotlightShape;
16
16
  radius?: number;
17
17
  rectangleProps?: SpotlightRectangleProps;
18
18
  hasLockBodyScroll?: boolean;
19
19
  }
20
+ export interface SpotlightProps extends BaseSpotlightProps, ComponentPropsWithoutRef<'div'> {
21
+ }
File without changes
@@ -0,0 +1,24 @@
1
+ /// <reference types="react" />
2
+ export declare const SpotlightArea: import("@emotion/styled").StyledComponent<{
3
+ theme?: import("@emotion/react").Theme | undefined;
4
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
5
+ }, import("react").SVGProps<SVGSVGElement>, {}>;
6
+ interface SpotlightCircleProps {
7
+ transitionDuration: string;
8
+ }
9
+ export declare const SpotlightCircle: import("@emotion/styled").StyledComponent<{
10
+ theme?: import("@emotion/react").Theme | undefined;
11
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
12
+ } & SpotlightCircleProps, import("react").SVGProps<SVGCircleElement>, {}>;
13
+ interface SpotlightRectProps {
14
+ transitionDuration: string;
15
+ }
16
+ export declare const SpotlightRect: import("@emotion/styled").StyledComponent<{
17
+ theme?: import("@emotion/react").Theme | undefined;
18
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
19
+ } & SpotlightRectProps, import("react").SVGProps<SVGRectElement>, {}>;
20
+ export declare const SpotlightMask: import("@emotion/styled").StyledComponent<{
21
+ theme?: import("@emotion/react").Theme | undefined;
22
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
23
+ }, import("react").SVGProps<SVGRectElement>, {}>;
24
+ export {};
package/package.json CHANGED
@@ -1,21 +1,25 @@
1
1
  {
2
2
  "name": "@elvia/elvis-spotlight",
3
- "version": "1.6.2",
4
- "main": "web_component.js",
3
+ "version": "1.6.4",
5
4
  "license": "MIT",
6
5
  "homepage": "https://design.elvia.io/components/spotlight",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/3lvia/designsystem.git",
9
+ "directory": "packages/components/components/elvis-spotlight"
10
+ },
11
+ "source": "src/react/elvia-spotlight.tsx",
12
+ "main": "dist/main/web-component.js",
7
13
  "files": [
8
- "web_component.js",
9
14
  "react.js",
10
15
  "react.d.ts",
11
- "CHANGELOG.json",
12
- "README.md",
13
- "dist/**/*"
16
+ "dist"
14
17
  ],
15
18
  "dependencies": {
16
- "@elvia/elvis-component-wrapper": "^4.1.3",
17
- "@elvia/elvis-toolbox": "^11.0.0",
18
- "styled-components": "^5.3.3"
19
+ "@elvia/elvis-component-wrapper": "^4.2.0",
20
+ "@elvia/elvis-toolbox": "^12.0.0",
21
+ "@emotion/react": "^11.11.4",
22
+ "@emotion/styled": "^11.11.5"
19
23
  },
20
24
  "peerDependencies": {
21
25
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
package/react.d.ts CHANGED
@@ -1,5 +1,2 @@
1
- declare module '@elvia/elvis-spotlight/react';
2
- export { default as Spotlight } from './dist/react/js/elvia-spotlight';
3
- export type { SpotlightProps } from './dist/react/js/elvia-spotlight.types';
4
- export type * from './dist/react/js/elvia-spotlight';
5
- export type * from './dist/react/js/elvia-spotlight.types';
1
+ export * from './dist/react/elvia-spotlight';
2
+ export * from './dist/react/elvia-spotlight.types';
package/react.js CHANGED
@@ -1 +1 @@
1
- export { default as Spotlight } from './dist/react/js/elvia-spotlight';
1
+ export * from './dist/react/elvia-spotlight.js';
@@ -1,2 +0,0 @@
1
- import { ComponentConfig } from '@elvia/elvis-toolbox';
2
- export declare const config: ComponentConfig;
@@ -1,6 +0,0 @@
1
- /*
2
- * THIS FILE IS AUTOMATICALLY GENERATED AND WILL BE OVERWRITTEN.
3
- * DO NOT MAKE CHANGES TO THIS FILE DIRECTLY
4
- */
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
- //# sourceMappingURL=config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["config.ts"],"names":["config","name","attributes","type"],"mappings":";;;;AAEA,MAAO,IAAM,CAAAA,MAAuB,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"]}
@@ -1,6 +0,0 @@
1
- /*
2
- * THIS FILE IS AUTOMATICALLY GENERATED AND WILL BE OVERWRITTEN.
3
- * DO NOT MAKE CHANGES TO THIS FILE DIRECTLY
4
- */
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 from"react";import{SpotlightArea,SpotlightCircle,SpotlightMask,SpotlightRect}from"./styledComponents";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;return useLockBodyScroll(void 0===g||g),o?/*#__PURE__*/React.createElement("div",_extends({className:l,style:m},n),/*#__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(SpotlightMask,{mask:"url(#hole)"}))):/*#__PURE__*/React.createElement("div",null)};export default Spotlight;
6
- //# sourceMappingURL=elvia-spotlight.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["elvia-spotlight.tsx"],"names":["React","SpotlightArea","SpotlightCircle","SpotlightMask","SpotlightRect","useLockBodyScroll","Spotlight","a","position","c","shape","e","radius","g","hasLockBodyScroll","h","transitionDuration","j","rectangleProps","width","height","borderRadius","className","inlineStyle","rest","_objectWithoutProperties","_excluded","hasPosition","horizontal","vertical","createElement","_extends","style","id","fill","r","cx","cy","x","y","rx","ry","mask"],"mappings":";;;;4zBAAA,MAAO,CAAAA,KAAK,KAAc,OAAO,CACjC,OAASC,aAAa,CAAEC,eAAe,CAAEC,aAAa,CAAEC,aAAa,KAAQ,oBAAoB,CAEjG,OAASC,iBAAiB,KAAQ,qBAAqB,CAGvD,GAAM,CAAAC,SAA6B,CAAG,QAAAA,CAAAC,CAAA,CAUhC,IATJ,CAAAC,CAAQ,CAAAD,CAAA,CAARC,QAAQ,CAAAC,CAAA,CAAAF,CAAA,CACRG,KAAK,CAALA,CAAK,UAAAD,CAAA,CAAG,QAAQ,CAAAA,CAAA,CAAAE,CAAA,CAAAJ,CAAA,CAChBK,MAAM,CAANA,CAAM,UAAAD,CAAA,CAAG,GAAG,CAAAA,CAAA,CAAAE,CAAA,CAAAN,CAAA,CACZO,iBAAiB,CAAAC,CAAA,CAAAR,CAAA,CACjBS,kBAAkB,CAAlBA,CAAkB,UAAAD,CAAA,CAAG,OAAO,CAAAA,CAAA,CAAAE,CAAA,CAAAV,CAAA,CAC5BW,cAAc,CAAdA,CAAc,UAAAD,CAAA,CAAG,CAAEE,KAAK,CAAE,GAAG,CAAEC,MAAM,CAAE,GAAG,CAAEC,YAAY,CAAE,CAAE,CAAC,CAAAJ,CAAA,CAC7DK,CAAS,CAAAf,CAAA,CAATe,SAAS,CACTC,CAAW,CAAAhB,CAAA,CAAXgB,WAAW,CACRC,CAAI,CAAAC,wBAAA,CAAAlB,CAAA,CAAAm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AAC,cAEN1C,KAAA,CAAA8B,aAAA,WAAU,CAEd,CAAC,CAED,cAAe,CAAAxB,SAAS","file":"elvia-spotlight.js","sourcesContent":["import React, { FC } from 'react';\nimport { SpotlightArea, SpotlightCircle, SpotlightMask, SpotlightRect } from './styledComponents';\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 useLockBodyScroll(hasLockBodyScroll);\n\n return hasPosition ? (\n <div className={className} style={inlineStyle} {...rest}>\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 <SpotlightMask mask=\"url(#hole)\" />\n </SpotlightArea>\n </div>\n ) : (\n <div></div>\n );\n};\n\nexport default Spotlight;\n"]}
@@ -1,6 +0,0 @@
1
- /*
2
- * THIS FILE IS AUTOMATICALLY GENERATED AND WILL BE OVERWRITTEN.
3
- * DO NOT MAKE CHANGES TO THIS FILE DIRECTLY
4
- */
5
- export{};
6
- //# sourceMappingURL=elvia-spotlight.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["elvia-spotlight.types.tsx"],"names":[],"mappings":";;;;AAAA","file":"elvia-spotlight.types.js","sourcesContent":["import { BaseProps, HasTransitionDuration } from '@elvia/elvis-toolbox';\nimport { ComponentPropsWithoutRef } from 'react';\n\nexport type SpotlightShape = 'circle' | 'rectangle';\n\nexport interface SpotlightPosition {\n vertical: number;\n horizontal: number;\n}\n\nexport interface SpotlightRectangleProps {\n width?: number;\n height?: number;\n borderRadius?: number;\n}\n\nexport interface SpotlightProps extends ComponentPropsWithoutRef<'div'>, BaseProps, HasTransitionDuration {\n position?: SpotlightPosition;\n shape?: SpotlightShape;\n radius?: number;\n rectangleProps?: SpotlightRectangleProps;\n hasLockBodyScroll?: boolean;\n}\n"]}
@@ -1,11 +0,0 @@
1
- export declare const SpotlightArea: import("styled-components").StyledComponent<"svg", any, {}, never>;
2
- interface SpotlightCircleProps {
3
- transitionDuration: string;
4
- }
5
- export declare const SpotlightCircle: import("styled-components").StyledComponent<"circle", any, SpotlightCircleProps, never>;
6
- interface SpotlightRectProps {
7
- transitionDuration: string;
8
- }
9
- export declare const SpotlightRect: import("styled-components").StyledComponent<"rect", any, SpotlightRectProps, never>;
10
- export declare const SpotlightMask: import("styled-components").StyledComponent<"rect", any, {}, never>;
11
- export {};
@@ -1,6 +0,0 @@
1
- /*
2
- * THIS FILE IS AUTOMATICALLY GENERATED AND WILL BE OVERWRITTEN.
3
- * DO NOT MAKE CHANGES TO THIS FILE DIRECTLY
4
- */
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){var b=a.transitionDuration;return b});export var SpotlightRect=styled.rect.withConfig({displayName:"styledComponents__SpotlightRect",componentId:"sc-env4mw-2"})(["transition:all "," ease-in-out;"],function(a){var b=a.transitionDuration;return b});export var SpotlightMask=styled.rect.withConfig({displayName:"styledComponents__SpotlightMask",componentId:"sc-env4mw-3"})(["--ewc-spotlight-mask-fill:0.25;.e-color-background-3 &&,.e-theme-dark &&,.e-color-background-3 &&{--ewc-spotlight-mask-fill:0.5;}fill:rgba(0,0,0,var(--ewc-spotlight-mask-fill));width:100%;height:100%;"]);
6
- //# sourceMappingURL=styledComponents.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["styledComponents.tsx"],"names":["styled","SpotlightArea","svg","withConfig","displayName","componentId","SpotlightCircle","circle","a","transitionDuration","SpotlightRect","rect","SpotlightMask"],"mappings":";;;;AAAA,MAAO,CAAAA,MAAM,KAAM,mBAAmB,CAEtC,MAAO,IAAM,CAAAC,aAAa,CAAGD,MAAM,CAACE,GAAG,CAAAC,UAAA,EAAAC,WAAA,mCAAAC,WAAA,yFAOtC,CAMD,MAAO,IAAM,CAAAC,eAAe,CAAGN,MAAM,CAACO,MAAM,CAAAJ,UAAA,EAAAC,WAAA,qCAAAC,WAAA,qDACxB,SAAAG,CAAA,KAAG,CAAAC,CAAkB,CAAAD,CAAA,CAAlBC,kBAAkB,OAAO,CAAAA,CAAkB,EACjE,CAKD,MAAO,IAAM,CAAAC,aAAa,CAAGV,MAAM,CAACW,IAAI,CAAAR,UAAA,EAAAC,WAAA,mCAAAC,WAAA,qDACpB,SAAAG,CAAA,KAAG,CAAAC,CAAkB,CAAAD,CAAA,CAAlBC,kBAAkB,OAAO,CAAAA,CAAkB,EACjE,CAED,MAAO,IAAM,CAAAG,aAAa,CAAGZ,MAAM,CAACW,IAAI,CAAAR,UAAA,EAAAC,WAAA,mCAAAC,WAAA,8NAWvC","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 ${({ transitionDuration }) => transitionDuration} ease-in-out;\n`;\ninterface SpotlightRectProps {\n transitionDuration: string;\n}\n\nexport const SpotlightRect = styled.rect<SpotlightRectProps>`\n transition: all ${({ transitionDuration }) => transitionDuration} ease-in-out;\n`;\n\nexport const SpotlightMask = styled.rect`\n --ewc-spotlight-mask-fill: 0.25;\n .e-color-background-3 &&,\n .e-theme-dark &&,\n .e-color-background-3 && {\n --ewc-spotlight-mask-fill: 0.5;\n }\n\n fill: rgba(0, 0, 0, var(--ewc-spotlight-mask-fill));\n width: 100%;\n height: 100%;\n`;\n"]}
@@ -1,7 +0,0 @@
1
- /*
2
- * THIS FILE IS AUTOMATICALLY GENERATED AND WILL BE OVERWRITTEN.
3
- * DO NOT MAKE CHANGES TO THIS FILE DIRECTLY
4
- */
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
- //# sourceMappingURL=useLockBodyScroll.js.map
@@ -1 +0,0 @@
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,SAAS,CAAAC,iBAAiBA,CAACC,CAA6B,CAAE,CAC/DF,SAAS,CAAC,UAAM,IACR,CAAAG,CAAyB,CAAGC,MAAM,CAACC,gBAAgB,CAACC,QAAQ,CAACC,IAAI,CAAC,CAACC,QAAQ,CAC3EC,CAAyB,CAAGL,MAAM,CAACC,gBAAgB,CAACC,QAAQ,CAACI,eAAe,CAAC,CAACF,QAAQ,OACvF,CAAAN,CAAoB,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"]}
@@ -1,149 +0,0 @@
1
- /*
2
- * THIS FILE IS AUTOMATICALLY GENERATED AND WILL BE OVERWRITTEN.
3
- * DO NOT MAKE CHANGES TO THIS FILE DIRECTLY
4
- */
5
- import * as ReactComponent from '../../../react.js';
6
- import { ElvisComponentWrapper } from '@elvia/elvis-component-wrapper';
7
- export default class ElviaComponent extends ElvisComponentWrapper {
8
- static get observedAttributes() {
9
- return ["position", "shape", "radius", "rectangleprops", "haslockbodyscroll", "transitionduration", "classname", "inlinestyle"];
10
- }
11
- static getComponentData() {
12
- return {
13
- "name": "Spotlight",
14
- "attributes": [{
15
- "name": "position",
16
- "type": "object"
17
- }, {
18
- "name": "shape",
19
- "type": "string"
20
- }, {
21
- "name": "radius",
22
- "type": "number"
23
- }, {
24
- "name": "rectangleProps",
25
- "type": "object"
26
- }, {
27
- "name": "hasLockBodyScroll",
28
- "type": "boolean"
29
- }, {
30
- "name": "transitionDuration",
31
- "type": "string"
32
- }, {
33
- "name": "className",
34
- "type": "string"
35
- }, {
36
- "name": "inlineStyle",
37
- "type": "object"
38
- }]
39
- };
40
- }
41
- set position(newValue) {
42
- super.setProps({
43
- 'position': newValue
44
- });
45
- }
46
- get position() {
47
- return super.getProps()['position'];
48
- }
49
- set shape(newValue) {
50
- super.setProps({
51
- 'shape': newValue
52
- });
53
- }
54
- get shape() {
55
- return super.getProps()['shape'];
56
- }
57
- set radius(newValue) {
58
- super.setProps({
59
- 'radius': newValue
60
- });
61
- }
62
- get radius() {
63
- return super.getProps()['radius'];
64
- }
65
- set rectangleProps(newValue) {
66
- super.setProps({
67
- 'rectangleprops': newValue
68
- });
69
- }
70
- get rectangleProps() {
71
- return super.getProps()['rectangleprops'];
72
- }
73
- set rectangleprops(newValue) {
74
- super.setProps({
75
- 'rectangleprops': newValue
76
- });
77
- }
78
- get rectangleprops() {
79
- return super.getProps()['rectangleprops'];
80
- }
81
- set hasLockBodyScroll(newValue) {
82
- super.setProps({
83
- 'haslockbodyscroll': newValue
84
- });
85
- }
86
- get hasLockBodyScroll() {
87
- return super.getProps()['haslockbodyscroll'];
88
- }
89
- set haslockbodyscroll(newValue) {
90
- super.setProps({
91
- 'haslockbodyscroll': newValue
92
- });
93
- }
94
- get haslockbodyscroll() {
95
- return super.getProps()['haslockbodyscroll'];
96
- }
97
- set transitionDuration(newValue) {
98
- super.setProps({
99
- 'transitionduration': newValue
100
- });
101
- }
102
- get transitionDuration() {
103
- return super.getProps()['transitionduration'];
104
- }
105
- set transitionduration(newValue) {
106
- super.setProps({
107
- 'transitionduration': newValue
108
- });
109
- }
110
- get transitionduration() {
111
- return super.getProps()['transitionduration'];
112
- }
113
- set className(newValue) {
114
- super.setProps({
115
- 'classname': newValue
116
- });
117
- }
118
- get className() {
119
- return super.getProps()['classname'];
120
- }
121
- set classname(newValue) {
122
- super.setProps({
123
- 'classname': newValue
124
- });
125
- }
126
- get classname() {
127
- return super.getProps()['classname'];
128
- }
129
- set inlineStyle(newValue) {
130
- super.setProps({
131
- 'inlinestyle': newValue
132
- });
133
- }
134
- get inlineStyle() {
135
- return super.getProps()['inlinestyle'];
136
- }
137
- set inlinestyle(newValue) {
138
- super.setProps({
139
- 'inlinestyle': newValue
140
- });
141
- }
142
- get inlinestyle() {
143
- return super.getProps()['inlinestyle'];
144
- }
145
- constructor() {
146
- super(ElviaComponent, ReactComponent['Spotlight']);
147
- }
148
- }
149
- window.customElements.define(`elvia-spotlight`, ElviaComponent);
package/web_component.js DELETED
@@ -1 +0,0 @@
1
- export { default as Spotlight } from './dist/web_component/js/elvia-spotlight';