@rubin-epo/epo-widget-lib 0.7.0-rc.2 → 0.8.0
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/dist/Atomic.cjs +1 -1
- package/dist/Atomic.js +6 -4
- package/dist/SupernovaThreeVector.cjs +1 -0
- package/dist/SupernovaThreeVector.d.ts +3 -0
- package/dist/SupernovaThreeVector.js +100 -0
- package/dist/atomic/Blinker/Blinker.cjs +1 -1
- package/dist/atomic/Blinker/Blinker.js +18 -18
- package/dist/atomic/Blinker/styles.cjs +1 -1
- package/dist/atomic/Blinker/styles.js +7 -7
- package/dist/atomic/Button/index.d.ts +1 -0
- package/dist/atomic/Button/patterns/Reset.cjs +1 -0
- package/dist/atomic/Button/patterns/Reset.d.ts +8 -0
- package/dist/atomic/Button/patterns/Reset.js +29 -0
- package/dist/atomic/ImageStack/index.cjs +1 -0
- package/dist/atomic/ImageStack/index.d.ts +16 -0
- package/dist/atomic/ImageStack/index.js +68 -0
- package/dist/atomic/ImageStack/styles.cjs +31 -0
- package/dist/atomic/ImageStack/styles.js +39 -0
- package/dist/atomic/index.d.ts +1 -0
- package/dist/charts/Bars/index.cjs +1 -1
- package/dist/charts/Bars/index.d.ts +2 -2
- package/dist/charts/Bars/index.js +31 -37
- package/dist/charts/Base/index.cjs +1 -1
- package/dist/charts/Base/index.d.ts +4 -0
- package/dist/charts/Base/index.js +33 -25
- package/dist/charts/Base/styles.cjs +22 -2
- package/dist/charts/Base/styles.d.ts +816 -0
- package/dist/charts/Base/styles.js +26 -3
- package/dist/charts/Guidelines/index.cjs +1 -1
- package/dist/charts/Guidelines/index.d.ts +2 -2
- package/dist/charts/Guidelines/index.js +19 -18
- package/dist/charts/Points/index.cjs +1 -1
- package/dist/charts/Points/index.js +15 -15
- package/dist/charts/Tooltip/index.cjs +1 -1
- package/dist/charts/Tooltip/index.d.ts +5 -4
- package/dist/charts/Tooltip/index.js +38 -40
- package/dist/charts/Tooltip/styles.cjs +19 -13
- package/dist/charts/Tooltip/styles.d.ts +417 -1801
- package/dist/charts/Tooltip/styles.js +21 -17
- package/dist/charts/XAxis/index.cjs +1 -1
- package/dist/charts/XAxis/index.js +31 -36
- package/dist/charts/YAxis/index.cjs +1 -1
- package/dist/charts/YAxis/index.d.ts +5 -0
- package/dist/charts/YAxis/index.js +28 -35
- package/dist/images/lunar_phase/first-quarter.webp +0 -0
- package/dist/images/lunar_phase/full.webp +0 -0
- package/dist/images/lunar_phase/new-moon.webp +0 -0
- package/dist/images/lunar_phase/third-quarter.webp +0 -0
- package/dist/images/lunar_phase/waning-crescent.webp +0 -0
- package/dist/images/lunar_phase/waning-gibbous.webp +0 -0
- package/dist/images/lunar_phase/waxing-crescent.webp +0 -0
- package/dist/images/lunar_phase/waxing-gibbous.webp +0 -0
- package/dist/images/supernovae_skymap/range0_500.png +0 -0
- package/dist/images/supernovae_skymap/range1000_2500.png +0 -0
- package/dist/images/supernovae_skymap/range500_1000.png +0 -0
- package/dist/localeStrings/en/epo-widget-lib.json +19 -0
- package/dist/widgets/ColorTool/Actions/index.cjs +1 -1
- package/dist/widgets/ColorTool/Actions/index.js +37 -27
- package/dist/widgets/ColorTool/FilterControls/FilterControls.cjs +1 -1
- package/dist/widgets/ColorTool/FilterControls/FilterControls.js +11 -11
- package/dist/widgets/SupernovaThreeVector/Histogram/index.cjs +1 -0
- package/dist/widgets/SupernovaThreeVector/Histogram/index.d.ts +19 -0
- package/dist/widgets/SupernovaThreeVector/Histogram/index.js +106 -0
- package/dist/widgets/SupernovaThreeVector/Histogram/styles.cjs +5 -0
- package/dist/widgets/SupernovaThreeVector/Histogram/styles.d.ts +482 -0
- package/dist/widgets/SupernovaThreeVector/Histogram/styles.js +10 -0
- package/dist/widgets/SupernovaThreeVector/LiveLabel/index.cjs +1 -0
- package/dist/widgets/SupernovaThreeVector/LiveLabel/index.d.ts +11 -0
- package/dist/widgets/SupernovaThreeVector/LiveLabel/index.js +36 -0
- package/dist/widgets/SupernovaThreeVector/LiveLabel/styles.cjs +10 -0
- package/dist/widgets/SupernovaThreeVector/LiveLabel/styles.d.ts +272 -0
- package/dist/widgets/SupernovaThreeVector/LiveLabel/styles.js +15 -0
- package/dist/widgets/SupernovaThreeVector/Skymap/index.cjs +1 -0
- package/dist/widgets/SupernovaThreeVector/Skymap/index.d.ts +18 -0
- package/dist/widgets/SupernovaThreeVector/Skymap/index.js +122 -0
- package/dist/widgets/SupernovaThreeVector/Skymap/styles.cjs +24 -0
- package/dist/widgets/SupernovaThreeVector/Skymap/styles.d.ts +3374 -0
- package/dist/widgets/SupernovaThreeVector/Skymap/styles.js +35 -0
- package/dist/widgets/SupernovaThreeVector/index.d.ts +12 -0
- package/dist/widgets/SupernovaThreeVector/styles.cjs +78 -0
- package/dist/widgets/SupernovaThreeVector/styles.js +94 -0
- package/package.json +5 -2
- package/dist/atomic/Blinker/Image/Image.cjs +0 -1
- package/dist/atomic/Blinker/Image/Image.d.ts +0 -9
- package/dist/atomic/Blinker/Image/Image.js +0 -23
- package/dist/atomic/Blinker/Image/styles.cjs +0 -17
- package/dist/atomic/Blinker/Image/styles.d.ts +0 -283
- package/dist/atomic/Blinker/Image/styles.js +0 -22
- package/dist/atomic/Blinker/Images/Images.cjs +0 -1
- package/dist/atomic/Blinker/Images/Images.d.ts +0 -8
- package/dist/atomic/Blinker/Images/Images.js +0 -45
- package/dist/atomic/Blinker/Images/styles.cjs +0 -10
- package/dist/atomic/Blinker/Images/styles.d.ts +0 -544
- package/dist/atomic/Blinker/Images/styles.js +0 -16
- package/dist/widgets/ColorTool/Actions/Reset/index.cjs +0 -1
- package/dist/widgets/ColorTool/Actions/Reset/index.d.ts +0 -9
- package/dist/widgets/ColorTool/Actions/Reset/index.js +0 -39
- package/dist/widgets/ColorTool/FilterControls/styles.d.ts +0 -1232
package/dist/Atomic.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./atomic/Blinker/Blinker.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./atomic/ImageStack/index.cjs"),t=require("./atomic/Blinker/Blinker.cjs"),r=require("./atomic/ElapsedTime/ElapsedTime.cjs"),l=require("./atomic/PlaybackControl/PlaybackControl.cjs");exports.ImageStack=e.default;exports.Blinker=t.default;exports.ElapsedTime=r.default;exports.PlaybackControl=l.default;
|
package/dist/Atomic.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { default as o } from "./atomic/
|
|
1
|
+
import { default as o } from "./atomic/ImageStack/index.js";
|
|
2
|
+
import { default as t } from "./atomic/Blinker/Blinker.js";
|
|
2
3
|
import { default as l } from "./atomic/ElapsedTime/ElapsedTime.js";
|
|
3
|
-
import { default as
|
|
4
|
+
import { default as d } from "./atomic/PlaybackControl/PlaybackControl.js";
|
|
4
5
|
export {
|
|
5
|
-
|
|
6
|
+
t as Blinker,
|
|
6
7
|
l as ElapsedTime,
|
|
7
|
-
|
|
8
|
+
o as ImageStack,
|
|
9
|
+
d as PlaybackControl
|
|
8
10
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react/jsx-runtime"),B=require("react"),O=require("react-i18next"),l=require("d3-array"),z=require("@rubin-epo/epo-react-lib/HorizontalSlider"),d=require("./lib/utils.cjs"),E=require("./widgets/SupernovaThreeVector/LiveLabel/index.cjs"),i=require("./widgets/SupernovaThreeVector/styles.cjs"),N=t=>t&&t.__esModule?t:{default:t},P=N(z),k=({histogramData:t,userData:q,binnedImages:_,step:u=100})=>{const{t:C}=O.useTranslation(),r={top:30,bottom:30,left:50,right:0},x="skyMapDescription",o=600,m=o/1.6,R=[r.left,o-r.right],T=[m-r.bottom,r.top],b=6,p=7,y=0,L=l.max(t,e=>e.value)||Math.max(...t.map(({value:e})=>e)),a=l.min(t,e=>e.bin)||0,c=l.max(t,e=>e.bin)||Math.max(...t.map(({bin:e})=>e)),g=l.nice(a,c,b),S=l.nice(y,L||y,p),f=d.getLinearScale(g,R),I=d.getLinearScale(S,T),[s,j]=B.useState([a,c]),v=15,$=`calc(${r.left/o*100}% - ${v}px)`,V=`calc(${(1-f(c)/o)*100}% - ${v}px)`,h=t.map(({bin:e})=>d.between(e,s[0],s[1])),M=q.filter(({distance:e})=>d.between(e,s[0],s[1]+u)),A=t.reduce((e,{value:H},w)=>h[w]?e+H:e,0);return n.jsxs(i.ThreeVectorContainer,{children:[n.jsxs(i.ThreeVectorLayout,{children:[n.jsx(i.HistogramContainer,{children:n.jsx(i.Histogram,{data:t,activeRange:s,xDomain:g,yDomain:S,xScale:f,yScale:I,yTicks:p,xTicks:b,step:u,margin:r,width:o,height:m})}),n.jsx(i.SliderContainer,{style:{paddingInlineStart:$,paddingInlineEnd:V},children:n.jsx(P.default,{min:a,max:c,step:u,value:s,ariaValuetext:({valueNow:e})=>C("supernova_three_vector.slider.valueLabel",{value:e}),label:"distanceSlider",color:"var(--turquoise85,#12726D)",minLabel:`${a} kpc`,maxLabel:`${c} kpc`,onChangeCallback:e=>Array.isArray(e)&&j(e)})}),n.jsx(i.SkymapContainer,{children:n.jsx(i.Skymap,{objects:M,images:_,describedById:x,visibleImages:h})}),n.jsx(i.ResetButton,{onResetCallback:()=>j([a,c])})]}),n.jsx(E.default,{id:x,objects:M,min:s[0],max:s[1]+u,supernovaCount:A})]})};k.displayName="Widgets.SupernovaThreeVector";exports.default=k;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as S, jsx as o } from "react/jsx-runtime";
|
|
3
|
+
import { useState as q } from "react";
|
|
4
|
+
import { useTranslation as z } from "react-i18next";
|
|
5
|
+
import { max as k, min as E, nice as M } from "d3-array";
|
|
6
|
+
import N from "@rubin-epo/epo-react-lib/HorizontalSlider";
|
|
7
|
+
import { between as C, getLinearScale as L } from "./lib/utils.js";
|
|
8
|
+
import U from "./widgets/SupernovaThreeVector/LiveLabel/index.js";
|
|
9
|
+
import { ThreeVectorContainer as W, ThreeVectorLayout as F, HistogramContainer as G, Histogram as J, SliderContainer as K, SkymapContainer as P, Skymap as Q, ResetButton as X } from "./widgets/SupernovaThreeVector/styles.js";
|
|
10
|
+
const Y = ({
|
|
11
|
+
histogramData: n,
|
|
12
|
+
userData: R,
|
|
13
|
+
binnedImages: T,
|
|
14
|
+
step: s = 100
|
|
15
|
+
}) => {
|
|
16
|
+
const { t: $ } = z(), i = {
|
|
17
|
+
top: 30,
|
|
18
|
+
bottom: 30,
|
|
19
|
+
left: 50,
|
|
20
|
+
right: 0
|
|
21
|
+
}, l = "skyMapDescription", c = 600, m = c / 1.6, j = [i.left, c - i.right], I = [m - i.bottom, i.top], d = 6, p = 7, u = 0, V = k(n, (e) => e.value) || Math.max(...n.map(({ value: e }) => e)), a = E(n, (e) => e.bin) || 0, r = k(n, (e) => e.bin) || Math.max(...n.map(({ bin: e }) => e)), x = M(a, r, d), b = M(u, V || u, p), f = L(x, j), A = L(b, I), [t, y] = q([a, r]), v = 15, B = `calc(${i.left / c * 100}% - ${v}px)`, H = `calc(${(1 - f(r) / c) * 100}% - ${v}px)`, g = n.map(
|
|
22
|
+
({ bin: e }) => C(e, t[0], t[1])
|
|
23
|
+
), h = R.filter(
|
|
24
|
+
({ distance: e }) => C(e, t[0], t[1] + s)
|
|
25
|
+
), w = n.reduce((e, { value: O }, _) => g[_] ? e + O : e, 0);
|
|
26
|
+
return /* @__PURE__ */ S(W, { children: [
|
|
27
|
+
/* @__PURE__ */ S(F, { children: [
|
|
28
|
+
/* @__PURE__ */ o(G, { children: /* @__PURE__ */ o(
|
|
29
|
+
J,
|
|
30
|
+
{
|
|
31
|
+
data: n,
|
|
32
|
+
activeRange: t,
|
|
33
|
+
xDomain: x,
|
|
34
|
+
yDomain: b,
|
|
35
|
+
xScale: f,
|
|
36
|
+
yScale: A,
|
|
37
|
+
yTicks: p,
|
|
38
|
+
xTicks: d,
|
|
39
|
+
step: s,
|
|
40
|
+
margin: i,
|
|
41
|
+
width: c,
|
|
42
|
+
height: m
|
|
43
|
+
}
|
|
44
|
+
) }),
|
|
45
|
+
/* @__PURE__ */ o(
|
|
46
|
+
K,
|
|
47
|
+
{
|
|
48
|
+
style: {
|
|
49
|
+
paddingInlineStart: B,
|
|
50
|
+
paddingInlineEnd: H
|
|
51
|
+
},
|
|
52
|
+
children: /* @__PURE__ */ o(
|
|
53
|
+
N,
|
|
54
|
+
{
|
|
55
|
+
min: a,
|
|
56
|
+
max: r,
|
|
57
|
+
step: s,
|
|
58
|
+
value: t,
|
|
59
|
+
ariaValuetext: ({ valueNow: e }) => $("supernova_three_vector.slider.valueLabel", { value: e }),
|
|
60
|
+
label: "distanceSlider",
|
|
61
|
+
color: "var(--turquoise85,#12726D)",
|
|
62
|
+
minLabel: `${a} kpc`,
|
|
63
|
+
maxLabel: `${r} kpc`,
|
|
64
|
+
onChangeCallback: (e) => Array.isArray(e) && y(e)
|
|
65
|
+
}
|
|
66
|
+
)
|
|
67
|
+
}
|
|
68
|
+
),
|
|
69
|
+
/* @__PURE__ */ o(P, { children: /* @__PURE__ */ o(
|
|
70
|
+
Q,
|
|
71
|
+
{
|
|
72
|
+
objects: h,
|
|
73
|
+
images: T,
|
|
74
|
+
describedById: l,
|
|
75
|
+
visibleImages: g
|
|
76
|
+
}
|
|
77
|
+
) }),
|
|
78
|
+
/* @__PURE__ */ o(
|
|
79
|
+
X,
|
|
80
|
+
{
|
|
81
|
+
onResetCallback: () => y([a, r])
|
|
82
|
+
}
|
|
83
|
+
)
|
|
84
|
+
] }),
|
|
85
|
+
/* @__PURE__ */ o(
|
|
86
|
+
U,
|
|
87
|
+
{
|
|
88
|
+
id: l,
|
|
89
|
+
objects: h,
|
|
90
|
+
min: t[0],
|
|
91
|
+
max: t[1] + s,
|
|
92
|
+
supernovaCount: w
|
|
93
|
+
}
|
|
94
|
+
)
|
|
95
|
+
] });
|
|
96
|
+
};
|
|
97
|
+
Y.displayName = "Widgets.SupernovaThreeVector";
|
|
98
|
+
export {
|
|
99
|
+
Y as default
|
|
100
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("react/jsx-runtime"),f=require("react"),A=require("../../
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("react/jsx-runtime"),f=require("react"),A=require("../../lib/utils.cjs"),M=require("../../hooks/useInterval.cjs"),o=require("./styles.cjs"),g=({images:t=[],activeIndex:i=0,autoplay:h=!0,loop:p=!0,interval:y=200,blinkCallback:n,loadedCallback:u,className:S,showControls:j=!0,children:q})=>{const[c,a]=f.useState(h),[d,k]=f.useState(!1),s=t.length>1,B=(e=0)=>{const P=t.length-1;return A.getClampedArrayIndex(i+e,P)},x=()=>{if(s){const e=B(1);p===!1&&e===t.length-1&&r(),n&&n(e)}},r=()=>{a(!1)},v=()=>{a(e=>!e)},I=()=>{r(),x()},m=()=>{r(),n&&n(B(-1))};return M.default(x,s&&d&&c?y:null),l.jsxs(o.BlinkerContainer,{className:S,children:[l.jsx(o.BlinkerImages,{loadCallback:()=>{k(!0),u&&u()},visible:i,images:t}),q,s&&j&&l.jsx(o.BlinkerControls,{isDisabled:!d,playing:c,handleStartStop:v,handleNext:I,handlePrevious:m})]})};g.displayName="Atomic.Blinker";const N=g;exports.default=N;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
2
|
+
import { jsxs as N, jsx as f } from "react/jsx-runtime";
|
|
3
3
|
import { useState as m } from "react";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
4
|
+
import { getClampedArrayIndex as P } from "../../lib/utils.js";
|
|
5
|
+
import D from "../../hooks/useInterval.js";
|
|
6
|
+
import { BlinkerContainer as L, BlinkerImages as $, BlinkerControls as q } from "./styles.js";
|
|
7
7
|
const p = ({
|
|
8
8
|
images: e = [],
|
|
9
9
|
activeIndex: s = 0,
|
|
@@ -16,12 +16,12 @@ const p = ({
|
|
|
16
16
|
showControls: k = !0,
|
|
17
17
|
children: y
|
|
18
18
|
}) => {
|
|
19
|
-
const [i, a] = m(B), [
|
|
20
|
-
const
|
|
21
|
-
return
|
|
19
|
+
const [i, a] = m(B), [c, I] = m(!1), o = e.length > 1, d = (t = 0) => {
|
|
20
|
+
const A = e.length - 1;
|
|
21
|
+
return P(s + t, A);
|
|
22
22
|
}, u = () => {
|
|
23
23
|
if (o) {
|
|
24
|
-
const t =
|
|
24
|
+
const t = d(1);
|
|
25
25
|
x === !1 && t === e.length - 1 && r(), n && n(t);
|
|
26
26
|
}
|
|
27
27
|
}, r = () => {
|
|
@@ -30,29 +30,29 @@ const p = ({
|
|
|
30
30
|
a((t) => !t);
|
|
31
31
|
}, j = () => {
|
|
32
32
|
r(), u();
|
|
33
|
-
},
|
|
34
|
-
r(), n && n(
|
|
33
|
+
}, v = () => {
|
|
34
|
+
r(), n && n(d(-1));
|
|
35
35
|
};
|
|
36
|
-
return
|
|
36
|
+
return D(u, o && c && i ? h : null), /* @__PURE__ */ N(L, { className: g, children: [
|
|
37
37
|
/* @__PURE__ */ f(
|
|
38
|
-
|
|
38
|
+
$,
|
|
39
39
|
{
|
|
40
|
-
|
|
40
|
+
loadCallback: () => {
|
|
41
41
|
I(!0), l && l();
|
|
42
42
|
},
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
visible: s,
|
|
44
|
+
images: e
|
|
45
45
|
}
|
|
46
46
|
),
|
|
47
47
|
y,
|
|
48
48
|
o && k && /* @__PURE__ */ f(
|
|
49
|
-
|
|
49
|
+
q,
|
|
50
50
|
{
|
|
51
|
-
isDisabled: !
|
|
51
|
+
isDisabled: !c,
|
|
52
52
|
playing: i,
|
|
53
53
|
handleStartStop: S,
|
|
54
54
|
handleNext: j,
|
|
55
|
-
handlePrevious:
|
|
55
|
+
handlePrevious: v
|
|
56
56
|
}
|
|
57
57
|
)
|
|
58
58
|
] });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("styled-components"),i=require("./Controls/Controls.cjs"),n=require("
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("styled-components"),i=require("./Controls/Controls.cjs"),n=require("../ImageStack/index.cjs"),o=e=>e&&e.__esModule?e:{default:e},t=o(r),l=t.default.div`
|
|
2
2
|
display: grid;
|
|
3
3
|
grid-template-columns: 1fr;
|
|
4
4
|
grid-template-rows: 1fr min-content;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import i from "
|
|
5
|
-
const s =
|
|
2
|
+
import t from "styled-components";
|
|
3
|
+
import r from "./Controls/Controls.js";
|
|
4
|
+
import i from "../ImageStack/index.js";
|
|
5
|
+
const s = t.div`
|
|
6
6
|
display: grid;
|
|
7
7
|
grid-template-columns: 1fr;
|
|
8
8
|
grid-template-rows: 1fr min-content;
|
|
9
9
|
justify-items: center;
|
|
10
10
|
position: relative;
|
|
11
11
|
height: 100%;
|
|
12
|
-
`, m = r
|
|
12
|
+
`, m = t(r)`
|
|
13
13
|
grid-row: 2;
|
|
14
14
|
margin-block-start: var(--PADDING_SMALL, 20px);
|
|
15
|
-
`,
|
|
15
|
+
`, a = t(i)`
|
|
16
16
|
aspect-ratio: 1;
|
|
17
17
|
grid-row: 1;
|
|
18
18
|
width: 100%;
|
|
@@ -20,5 +20,5 @@ const s = r.div`
|
|
|
20
20
|
export {
|
|
21
21
|
s as BlinkerContainer,
|
|
22
22
|
m as BlinkerControls,
|
|
23
|
-
|
|
23
|
+
a as BlinkerImages
|
|
24
24
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Reset } from "./patterns/Reset";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("react/jsx-runtime"),i=require("react-i18next"),l=require("@rubin-epo/epo-react-lib/Button"),r=t=>t&&t.__esModule?t:{default:t},c=r(l),o=({isDisabled:t,onResetCallback:e,className:n})=>{const{t:s}=i.useTranslation();return u.jsx(c.default,{style:{"--button-text-align":"left"},disabled:t,icon:"RotateLeftWithCenter",iconSize:"2em",onClick:()=>e&&e(),className:n,isBlock:!0,children:s("colorTool.actions.reset")})};o.displayName="Atomic.Button.Reset";const a=o;exports.default=a;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
3
|
+
import { useTranslation as r } from "react-i18next";
|
|
4
|
+
import c from "@rubin-epo/epo-react-lib/Button";
|
|
5
|
+
const o = ({
|
|
6
|
+
isDisabled: e,
|
|
7
|
+
onResetCallback: t,
|
|
8
|
+
className: n
|
|
9
|
+
}) => {
|
|
10
|
+
const { t: i } = r();
|
|
11
|
+
return /* @__PURE__ */ s(
|
|
12
|
+
c,
|
|
13
|
+
{
|
|
14
|
+
style: { "--button-text-align": "left" },
|
|
15
|
+
disabled: e,
|
|
16
|
+
icon: "RotateLeftWithCenter",
|
|
17
|
+
iconSize: "2em",
|
|
18
|
+
onClick: () => t && t(),
|
|
19
|
+
className: n,
|
|
20
|
+
isBlock: !0,
|
|
21
|
+
children: i("colorTool.actions.reset")
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
};
|
|
25
|
+
o.displayName = "Atomic.Button.Reset";
|
|
26
|
+
const a = o;
|
|
27
|
+
export {
|
|
28
|
+
a as default
|
|
29
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("react/jsx-runtime"),r=require("react"),E=require("lodash/after"),u=require("./styles.cjs"),q=e=>e&&e.__esModule?e:{default:e},x=q(E),g=({images:e,visible:a,describedById:h,mixBlendMode:y,loadCallback:i,className:p,width:S,height:k,showBackdrop:_=!0,showLoader:b=!0})=>{const n=r.useRef(null),[t,l]=r.useState(!0);r.useEffect(()=>{t||i&&i()},[t]);const d=r.useCallback(x.default(e.length,()=>{l(!1)}),[]);return!e||e.length===0?null:(t&&n.current&&Array.from(n.current.getElementsByTagName("img")).every(({complete:s})=>!!s)&&l(!1),c.jsxs(u.StackContainer,{ref:n,role:"img","aria-describedby":h,className:p,style:{"--image-stack-background":_&&"var(--neutral95, #1f2121)",aspectRatio:`${S||e[0].width} / ${k||e[0].height}`},children:[b&&t&&c.jsx(u.StackLoader,{isVisible:!0}),e.map(({url:f,width:m,height:s},o)=>{const j=Array.isArray(a)?a[o]:a===o;return c.jsx(u.StackedImage,{role:"presentation",src:f,width:m,height:s,onLoad:d,onError:d,style:{mixBlendMode:y},hidden:!j},o)})]}))};g.displayName="Atomic.ImageStack";const A=g;exports.default=A;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CSSProperties, FunctionComponent } from "react";
|
|
2
|
+
import { ImageShape } from "@rubin-epo/epo-react-lib/Image";
|
|
3
|
+
export interface ImageStackProps {
|
|
4
|
+
images: Array<ImageShape>;
|
|
5
|
+
visible?: number | Array<boolean>;
|
|
6
|
+
describedById?: string;
|
|
7
|
+
loadCallback?: () => void;
|
|
8
|
+
mixBlendMode?: CSSProperties["mixBlendMode"];
|
|
9
|
+
className?: string;
|
|
10
|
+
width?: number;
|
|
11
|
+
height?: number;
|
|
12
|
+
showBackdrop?: boolean;
|
|
13
|
+
showLoader?: boolean;
|
|
14
|
+
}
|
|
15
|
+
declare const ImageStack: FunctionComponent<ImageStackProps>;
|
|
16
|
+
export default ImageStack;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as A, jsx as f } from "react/jsx-runtime";
|
|
3
|
+
import { useRef as C, useState as I, useEffect as b, useCallback as w } from "react";
|
|
4
|
+
import x from "lodash/after";
|
|
5
|
+
import { StackContainer as L, StackLoader as R, StackedImage as $ } from "./styles.js";
|
|
6
|
+
const u = ({
|
|
7
|
+
images: e,
|
|
8
|
+
visible: r,
|
|
9
|
+
describedById: d,
|
|
10
|
+
mixBlendMode: h,
|
|
11
|
+
loadCallback: s,
|
|
12
|
+
className: g,
|
|
13
|
+
width: p,
|
|
14
|
+
height: y,
|
|
15
|
+
showBackdrop: k = !0,
|
|
16
|
+
showLoader: S = !0
|
|
17
|
+
}) => {
|
|
18
|
+
const a = C(null), [t, i] = I(!0);
|
|
19
|
+
b(() => {
|
|
20
|
+
t || s && s();
|
|
21
|
+
}, [t]);
|
|
22
|
+
const c = w(
|
|
23
|
+
x(e.length, () => {
|
|
24
|
+
i(!1);
|
|
25
|
+
}),
|
|
26
|
+
[]
|
|
27
|
+
);
|
|
28
|
+
return !e || e.length === 0 ? null : (t && a.current && Array.from(
|
|
29
|
+
a.current.getElementsByTagName("img")
|
|
30
|
+
).every(({ complete: n }) => !!n) && i(!1), /* @__PURE__ */ A(
|
|
31
|
+
L,
|
|
32
|
+
{
|
|
33
|
+
ref: a,
|
|
34
|
+
role: "img",
|
|
35
|
+
"aria-describedby": d,
|
|
36
|
+
className: g,
|
|
37
|
+
style: {
|
|
38
|
+
"--image-stack-background": k && "var(--neutral95, #1f2121)",
|
|
39
|
+
aspectRatio: `${p || e[0].width} / ${y || e[0].height}`
|
|
40
|
+
},
|
|
41
|
+
children: [
|
|
42
|
+
S && t && /* @__PURE__ */ f(R, { isVisible: !0 }),
|
|
43
|
+
e.map(({ url: l, width: m, height: n }, o) => {
|
|
44
|
+
const E = Array.isArray(r) ? r[o] : r === o;
|
|
45
|
+
return /* @__PURE__ */ f(
|
|
46
|
+
$,
|
|
47
|
+
{
|
|
48
|
+
role: "presentation",
|
|
49
|
+
src: l,
|
|
50
|
+
width: m,
|
|
51
|
+
height: n,
|
|
52
|
+
onLoad: c,
|
|
53
|
+
onError: c,
|
|
54
|
+
style: { mixBlendMode: h },
|
|
55
|
+
hidden: !E
|
|
56
|
+
},
|
|
57
|
+
o
|
|
58
|
+
);
|
|
59
|
+
})
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
));
|
|
63
|
+
};
|
|
64
|
+
u.displayName = "Atomic.ImageStack";
|
|
65
|
+
const T = u;
|
|
66
|
+
export {
|
|
67
|
+
T as default
|
|
68
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("styled-components"),n=require("@rubin-epo/epo-react-lib/CircularLoader"),a=e=>e&&e.__esModule?e:{default:e},t=a(r),d=a(n),o=t.default.div`
|
|
2
|
+
background-color: var(--image-stack-background, transparent);
|
|
3
|
+
display: grid;
|
|
4
|
+
grid-template-rows: 1fr;
|
|
5
|
+
grid-template-columns: 1fr;
|
|
6
|
+
grid-template-areas: "stack";
|
|
7
|
+
|
|
8
|
+
justify-items: center;
|
|
9
|
+
align-items: center;
|
|
10
|
+
|
|
11
|
+
width: 100%;
|
|
12
|
+
height: auto;
|
|
13
|
+
`,s=t.default.img`
|
|
14
|
+
grid-area: stack;
|
|
15
|
+
height: auto;
|
|
16
|
+
width: 100%;
|
|
17
|
+
|
|
18
|
+
user-select: none;
|
|
19
|
+
-webkit-user-drag: none;
|
|
20
|
+
-khtml-user-drag: none;
|
|
21
|
+
-moz-user-drag: none;
|
|
22
|
+
-o-user-drag: none;
|
|
23
|
+
-ms-user-drag: none;
|
|
24
|
+
user-drag: none;
|
|
25
|
+
|
|
26
|
+
&[hidden] {
|
|
27
|
+
display: none;
|
|
28
|
+
}
|
|
29
|
+
`,i=t.default(d.default)`
|
|
30
|
+
grid-area: stack;
|
|
31
|
+
`;exports.StackContainer=o;exports.StackLoader=i;exports.StackedImage=s;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import e from "styled-components";
|
|
3
|
+
import r from "@rubin-epo/epo-react-lib/CircularLoader";
|
|
4
|
+
const n = e.div`
|
|
5
|
+
background-color: var(--image-stack-background, transparent);
|
|
6
|
+
display: grid;
|
|
7
|
+
grid-template-rows: 1fr;
|
|
8
|
+
grid-template-columns: 1fr;
|
|
9
|
+
grid-template-areas: "stack";
|
|
10
|
+
|
|
11
|
+
justify-items: center;
|
|
12
|
+
align-items: center;
|
|
13
|
+
|
|
14
|
+
width: 100%;
|
|
15
|
+
height: auto;
|
|
16
|
+
`, o = e.img`
|
|
17
|
+
grid-area: stack;
|
|
18
|
+
height: auto;
|
|
19
|
+
width: 100%;
|
|
20
|
+
|
|
21
|
+
user-select: none;
|
|
22
|
+
-webkit-user-drag: none;
|
|
23
|
+
-khtml-user-drag: none;
|
|
24
|
+
-moz-user-drag: none;
|
|
25
|
+
-o-user-drag: none;
|
|
26
|
+
-ms-user-drag: none;
|
|
27
|
+
user-drag: none;
|
|
28
|
+
|
|
29
|
+
&[hidden] {
|
|
30
|
+
display: none;
|
|
31
|
+
}
|
|
32
|
+
`, s = e(r)`
|
|
33
|
+
grid-area: stack;
|
|
34
|
+
`;
|
|
35
|
+
export {
|
|
36
|
+
n as StackContainer,
|
|
37
|
+
s as StackLoader,
|
|
38
|
+
o as StackedImage
|
|
39
|
+
};
|
package/dist/atomic/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const b=require("react/jsx-runtime"),d=require("react"),h=require("../styles.cjs"),a=({data:e,yDomain:i,xScale:o,yScale:r,y:t=r(i[0])})=>e.length===0?null:b.jsx("g",{role:"list",children:e.map(({stroke:u,fill:c,width:s=8,x:f,value:l,props:m},g)=>{if(l===0)return null;const n=t-r(l);return d.createElement(h.Bar,{role:"listitem",height:n,y:t,width:s,x:o(f),fill:c||"var(--bar-fill, #12726D)",stroke:u||"var(--bar-stroke, transparent)",key:g,transform:`translate(-${s/2} -${n})`,...m})})});a.displayName="Charts.Bars";const p=a;exports.default=p;
|
|
@@ -5,15 +5,15 @@ export interface Bar {
|
|
|
5
5
|
fill?: string;
|
|
6
6
|
width?: number;
|
|
7
7
|
value: number;
|
|
8
|
+
x: number;
|
|
8
9
|
props?: HTMLProps<SVGRectElement>;
|
|
9
10
|
}
|
|
10
11
|
export interface BarsProps {
|
|
11
12
|
data: Array<Bar>;
|
|
12
|
-
xDomain: Domain;
|
|
13
13
|
yDomain: Domain;
|
|
14
14
|
xScale: ScaleFunction;
|
|
15
15
|
yScale: ScaleFunction;
|
|
16
|
-
|
|
16
|
+
y?: number;
|
|
17
17
|
}
|
|
18
18
|
declare const Bars: FunctionComponent<BarsProps>;
|
|
19
19
|
export default Bars;
|
|
@@ -1,40 +1,34 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createElement as
|
|
3
|
-
import { Bar as
|
|
4
|
-
const
|
|
5
|
-
data:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
if (t.length === 0)
|
|
1
|
+
import { jsx as h } from "react/jsx-runtime";
|
|
2
|
+
import { createElement as B } from "react";
|
|
3
|
+
import { Bar as g } from "../styles.js";
|
|
4
|
+
const n = ({
|
|
5
|
+
data: r,
|
|
6
|
+
yDomain: o,
|
|
7
|
+
xScale: i,
|
|
8
|
+
yScale: t,
|
|
9
|
+
y: e = t(o[0])
|
|
10
|
+
}) => r.length === 0 ? null : /* @__PURE__ */ h("g", { role: "list", children: r.map(({ stroke: m, fill: f, width: s = 8, x: p, value: a, props: u }, c) => {
|
|
11
|
+
if (a === 0)
|
|
13
12
|
return null;
|
|
14
|
-
const
|
|
15
|
-
return /* @__PURE__ */
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
);
|
|
34
|
-
}) });
|
|
35
|
-
};
|
|
36
|
-
o.displayName = "Charts.Bars";
|
|
37
|
-
const j = o;
|
|
13
|
+
const l = e - t(a);
|
|
14
|
+
return /* @__PURE__ */ B(
|
|
15
|
+
g,
|
|
16
|
+
{
|
|
17
|
+
role: "listitem",
|
|
18
|
+
height: l,
|
|
19
|
+
y: e,
|
|
20
|
+
width: s,
|
|
21
|
+
x: i(p),
|
|
22
|
+
fill: f || "var(--bar-fill, #12726D)",
|
|
23
|
+
stroke: m || "var(--bar-stroke, transparent)",
|
|
24
|
+
key: c,
|
|
25
|
+
transform: `translate(-${s / 2} -${l})`,
|
|
26
|
+
...u
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
}) });
|
|
30
|
+
n.displayName = "Charts.Bars";
|
|
31
|
+
const b = n;
|
|
38
32
|
export {
|
|
39
|
-
|
|
33
|
+
b as default
|
|
40
34
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),s=require("./styles.cjs"),o=({width:r=900,height:t=300,minX:n=0,minY:l=0,verticalLabel:i,verticalLabelId:u,horizontalLabel:a,horizontalLabelId:c,children:d,className:x})=>e.jsxs(s.ChartContainer,{children:[i&&e.jsx(s.VerticalLabel,{id:u,children:i}),e.jsx(s.SVG,{preserveAspectRatio:"xMidYMid meet",viewBox:`${n} ${l} ${r} ${t}`,className:x,style:{"--aspect-ratio":`${r} / ${t}`,"--min-width":`${r}px`},role:"group",children:d}),a&&e.jsx(s.HorizontalLabel,{id:c,children:a})]});o.displayName="Charts.Base";const p=o;exports.default=p;
|
|
@@ -5,6 +5,10 @@ export interface BaseChartProps {
|
|
|
5
5
|
minX?: number;
|
|
6
6
|
minY?: number;
|
|
7
7
|
className?: string;
|
|
8
|
+
verticalLabel?: string;
|
|
9
|
+
verticalLabelId?: string;
|
|
10
|
+
horizontalLabel?: string;
|
|
11
|
+
horizontalLabelId?: string;
|
|
8
12
|
}
|
|
9
13
|
declare const BaseChart: FunctionComponent<PropsWithChildren<BaseChartProps>>;
|
|
10
14
|
export default BaseChart;
|
|
@@ -1,28 +1,36 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { SVG as
|
|
3
|
-
const
|
|
1
|
+
import { jsxs as m, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { ChartContainer as $, VerticalLabel as x, SVG as B, HorizontalLabel as C } from "./styles.js";
|
|
3
|
+
const i = ({
|
|
4
4
|
width: e = 900,
|
|
5
|
-
height:
|
|
6
|
-
minX:
|
|
7
|
-
minY:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
5
|
+
height: s = 300,
|
|
6
|
+
minX: o = 0,
|
|
7
|
+
minY: n = 0,
|
|
8
|
+
verticalLabel: t,
|
|
9
|
+
verticalLabelId: p,
|
|
10
|
+
horizontalLabel: a,
|
|
11
|
+
horizontalLabelId: d,
|
|
12
|
+
children: c,
|
|
13
|
+
className: l
|
|
14
|
+
}) => /* @__PURE__ */ m($, { children: [
|
|
15
|
+
t && /* @__PURE__ */ r(x, { id: p, children: t }),
|
|
16
|
+
/* @__PURE__ */ r(
|
|
17
|
+
B,
|
|
18
|
+
{
|
|
19
|
+
preserveAspectRatio: "xMidYMid meet",
|
|
20
|
+
viewBox: `${o} ${n} ${e} ${s}`,
|
|
21
|
+
className: l,
|
|
22
|
+
style: {
|
|
23
|
+
"--aspect-ratio": `${e} / ${s}`,
|
|
24
|
+
"--min-width": `${e}px`
|
|
25
|
+
},
|
|
26
|
+
role: "group",
|
|
27
|
+
children: c
|
|
28
|
+
}
|
|
29
|
+
),
|
|
30
|
+
a && /* @__PURE__ */ r(C, { id: d, children: a })
|
|
31
|
+
] });
|
|
32
|
+
i.displayName = "Charts.Base";
|
|
33
|
+
const h = i;
|
|
26
34
|
export {
|
|
27
|
-
|
|
35
|
+
h as default
|
|
28
36
|
};
|