@rubin-epo/epo-widget-lib 1.1.2 → 1.1.3
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/CameraFilter.cjs +1 -0
- package/dist/CameraFilter.d.ts +3 -0
- package/dist/CameraFilter.js +4 -0
- package/dist/lib/utils.cjs +1 -1
- package/dist/lib/utils.js +15 -11
- package/dist/widgets/CameraFilter/CameraFilter.cjs +1 -0
- package/dist/widgets/CameraFilter/CameraFilter.js +103 -0
- package/dist/widgets/CameraFilter/CondensedFilterRanges/CondensedFilterRanges.cjs +1 -0
- package/dist/widgets/CameraFilter/CondensedFilterRanges/CondensedFilterRanges.js +61 -0
- package/dist/widgets/CameraFilter/SpectrumDisplay/ColorLabels/ColorLabels.cjs +1 -0
- package/dist/widgets/CameraFilter/SpectrumDisplay/ColorLabels/ColorLabels.js +99 -0
- package/dist/widgets/CameraFilter/SpectrumDisplay/SpectrumDisplay.cjs +1 -0
- package/dist/widgets/CameraFilter/SpectrumDisplay/SpectrumDisplay.js +97 -0
- package/dist/widgets/CameraFilter/SpectrumDisplay/SpectrumLabels/SpectrumLabels.cjs +1 -0
- package/dist/widgets/CameraFilter/SpectrumDisplay/SpectrumLabels/SpectrumLabels.js +58 -0
- package/dist/widgets/CameraFilter/data.cjs +1 -0
- package/dist/widgets/CameraFilter/data.js +84 -0
- package/dist/widgets/CameraFilter/styles.cjs +105 -0
- package/dist/widgets/CameraFilter/styles.js +128 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./widgets/CameraFilter/CameraFilter.cjs");exports.default=e.default;
|
package/dist/lib/utils.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("lodash/mergeWith"),g=require("lodash/isNil"),o=t=>t&&t.__esModule?t:{default:t},m=o(d),c=o(g),h=(t,e)=>{switch(!0){case t>e:return 0;case t<0:return e;default:return t}},M=(t,e,r)=>t>=e&&t<=r,p=t=>t[Math.round((t.length-1)/2)],
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("lodash/mergeWith"),g=require("lodash/isNil"),o=t=>t&&t.__esModule?t:{default:t},m=o(d),c=o(g),h=(t,e)=>{switch(!0){case t>e:return 0;case t<0:return e;default:return t}},M=(t,e,r)=>t>=e&&t<=r,p=(t=[],e=[])=>{const r=t[0]<e[0]?t:e,n=r===t?e:t;return r[1]<n[0]?null:[n[0],r[1]<n[1]?r[1]:n[1]]},A=t=>t[Math.round((t.length-1)/2)],S=(t=[0,1],e=[0,1],r)=>{const n={clamp:!1,fractionDigits:2},{clamp:i,fractionDigits:s}={...n,...r};return l=>{const a=t[1]-t[0];if(a===0)return(e[0]+e[1])/2;let u=(l-t[0])/a;return i&&(u=Math.min(Math.max(u,0),1)),Number((u*(e[1]-e[0])+e[0]).toFixed(s))}},_=()=>{const t=navigator.userAgent.indexOf("Chrome")>-1;return navigator.userAgent.indexOf("Safari")>-1&&!t},f=(t,e)=>c.default(e)&&t?c.default(t)?e:t:e,D=(t,e)=>m.default({},e,t,f),b=(t,e=[0,0])=>t.reduce((r,{x:n,y:i},s)=>r+=`${s===0?"M":" L"}${n+e[0]},${i+e[1]}`,"");exports.between=M;exports.buildPath=b;exports.defaultsMerger=f;exports.getClampedArrayIndex=h;exports.getLinearScale=S;exports.intersection=p;exports.isSafari=_;exports.mergeWithDefaults=D;exports.middle=A;
|
package/dist/lib/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
const
|
|
1
|
+
import a from "lodash/mergeWith";
|
|
2
|
+
import u from "lodash/isNil";
|
|
3
|
+
const l = (t, e) => {
|
|
4
4
|
switch (!0) {
|
|
5
5
|
case t > e:
|
|
6
6
|
return 0;
|
|
@@ -9,7 +9,10 @@ const d = (t, e) => {
|
|
|
9
9
|
default:
|
|
10
10
|
return t;
|
|
11
11
|
}
|
|
12
|
-
},
|
|
12
|
+
}, d = (t, e, r) => t >= e && t <= r, p = (t = [], e = []) => {
|
|
13
|
+
const r = t[0] < e[0] ? t : e, n = r === t ? e : t;
|
|
14
|
+
return r[1] < n[0] ? null : [n[0], r[1] < n[1] ? r[1] : n[1]];
|
|
15
|
+
}, A = (t) => t[Math.round((t.length - 1) / 2)], M = (t = [0, 1], e = [0, 1], r) => {
|
|
13
16
|
const n = { clamp: !1, fractionDigits: 2 }, { clamp: i, fractionDigits: s } = { ...n, ...r };
|
|
14
17
|
return (f) => {
|
|
15
18
|
const c = t[1] - t[0];
|
|
@@ -20,17 +23,18 @@ const d = (t, e) => {
|
|
|
20
23
|
(o * (e[1] - e[0]) + e[0]).toFixed(s)
|
|
21
24
|
);
|
|
22
25
|
};
|
|
23
|
-
},
|
|
26
|
+
}, x = () => {
|
|
24
27
|
const t = navigator.userAgent.indexOf("Chrome") > -1;
|
|
25
28
|
return navigator.userAgent.indexOf("Safari") > -1 && !t;
|
|
26
|
-
}, m = (t, e) =>
|
|
29
|
+
}, m = (t, e) => u(e) && t ? u(t) ? e : t : e, D = (t, e) => a({}, e, t, m), I = (t, e = [0, 0]) => t.reduce((r, { x: n, y: i }, s) => r += `${s === 0 ? "M" : " L"}${n + e[0]},${i + e[1]}`, "");
|
|
27
30
|
export {
|
|
28
|
-
|
|
31
|
+
d as between,
|
|
29
32
|
I as buildPath,
|
|
30
33
|
m as defaultsMerger,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
+
l as getClampedArrayIndex,
|
|
35
|
+
M as getLinearScale,
|
|
36
|
+
p as intersection,
|
|
37
|
+
x as isSafari,
|
|
34
38
|
D as mergeWithDefaults,
|
|
35
|
-
|
|
39
|
+
A as middle
|
|
36
40
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),v=require("react"),q=require("@rubin-epo/epo-react-lib/SelectListbox"),y=require("@rubin-epo/epo-react-lib/styles"),C=require("react-i18next"),S=require("use-resize-observer"),r=require("./data.cjs"),l=require("./styles.cjs"),R=require("./CondensedFilterRanges/CondensedFilterRanges.cjs"),L=require("./SpectrumDisplay/SpectrumDisplay.cjs"),x=i=>i&&i.__esModule?i:{default:i},M=x(q),O=x(S),m=()=>{const{t:i}=C.useTranslation(),{ref:h,width:j=1}=O.default(),[c,p]=v.useState(null),{BREAK_TABLET:b}=y.tokens,s=j<parseInt(b),{[s?"condensed":"default"]:{min:o,max:F,range:n}}=r.rangeConfig,d=r.filters[0].range[0],u=r.filters[r.filters.length-1].range[1]-d,f=r.filters.filter(({band:t})=>t),g=[{value:"none",label:i("camera_filter.labels.option",{context:"none"})}].concat(f.map(({band:t})=>({value:t,label:i("camera_filter.labels.option",{band:t})}))),_=r.filters.find(({band:t})=>t===c);return e.jsx(l.FilterWrapper,{ratio:5/4,children:e.jsxs(l.FilterContainer,{ref:h,children:[e.jsx(l.FilterTitle,{children:i("camera_filter.title")}),s&&e.jsx(R.default,{filters:f,min:o,spectrumRange:n}),e.jsxs(l.FilterTable,{style:{"--filter-table-margin-inline-start":`${((d-o)/n*100).toFixed(2)}%`,"--filter-table-width":`${(u/n*100).toFixed(2)}%`},"data-testid":"expanded-filters",children:[e.jsx("colgroup",{children:r.filters.map(({range:t})=>e.jsx("col",{style:{width:`${(t[1]-t[0])/u*100}%`}},t.join("")))}),e.jsx(l.FilterNames,{children:e.jsx("tr",{children:r.filters.map(({band:t},a)=>e.jsx(l.FilterName,{id:`${t}-name`,style:{"--filter-name-border":t?"solid #b2b2b2":"none"},scope:"col","aria-hidden":!t,children:t},a))})}),!s&&e.jsx(l.FilterRanges,{children:e.jsx("tr",{children:r.filters.map(({band:t,range:a})=>e.jsx(l.FilterRange,{"aria-hidden":!t,children:t&&e.jsxs(e.Fragment,{children:[a.join("–"),e.jsx("br",{}),e.jsx(l.Wavelength,{children:"nm"})]})},a.join()))})})]}),e.jsx(L.default,{min:o,max:F,range:n,isCondensed:s,activeFilter:_}),e.jsxs(l.SelectContainer,{children:[e.jsx(l.SelectLabel,{id:"filterSelectLabel",children:i("camera_filter.labels.select")}),e.jsx(M.default,{options:g,value:c,onChangeCallback:t=>p(t),width:"100%",maxWidth:"100%",labelledById:"filterSelectLabel"})]})]})})};m.displayName="Widgets.CameraFilter";const T=m;exports.default=T;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as t, jsxs as o, Fragment as v } from "react/jsx-runtime";
|
|
3
|
+
import { useState as y } from "react";
|
|
4
|
+
import R from "@rubin-epo/epo-react-lib/SelectListbox";
|
|
5
|
+
import { tokens as S } from "@rubin-epo/epo-react-lib/styles";
|
|
6
|
+
import { useTranslation as j } from "react-i18next";
|
|
7
|
+
import B from "use-resize-observer";
|
|
8
|
+
import { filters as i, rangeConfig as L } from "./data.js";
|
|
9
|
+
import { FilterWrapper as T, FilterContainer as _, FilterTitle as $, FilterTable as w, FilterNames as O, FilterName as W, FilterRanges as A, FilterRange as M, Wavelength as N, SelectContainer as k, SelectLabel as E } from "./styles.js";
|
|
10
|
+
import I from "./CondensedFilterRanges/CondensedFilterRanges.js";
|
|
11
|
+
import z from "./SpectrumDisplay/SpectrumDisplay.js";
|
|
12
|
+
const p = () => {
|
|
13
|
+
const { t: r } = j(), { ref: h, width: F = 1 } = B(), [c, b] = y(null), { BREAK_TABLET: g } = S, l = F < parseInt(g), {
|
|
14
|
+
[l ? "condensed" : "default"]: { min: s, max: u, range: n }
|
|
15
|
+
} = L, d = i[0].range[0], m = i[i.length - 1].range[1] - d, f = i.filter(({ band: e }) => e), x = [{
|
|
16
|
+
value: "none",
|
|
17
|
+
label: r("camera_filter.labels.option", { context: "none" })
|
|
18
|
+
}].concat(
|
|
19
|
+
f.map(({ band: e }) => ({
|
|
20
|
+
value: e,
|
|
21
|
+
label: r("camera_filter.labels.option", { band: e })
|
|
22
|
+
}))
|
|
23
|
+
), C = i.find(({ band: e }) => e === c);
|
|
24
|
+
return /* @__PURE__ */ t(T, { ratio: 5 / 4, children: /* @__PURE__ */ o(_, { ref: h, children: [
|
|
25
|
+
/* @__PURE__ */ t($, { children: r("camera_filter.title") }),
|
|
26
|
+
l && /* @__PURE__ */ t(
|
|
27
|
+
I,
|
|
28
|
+
{
|
|
29
|
+
filters: f,
|
|
30
|
+
min: s,
|
|
31
|
+
spectrumRange: n
|
|
32
|
+
}
|
|
33
|
+
),
|
|
34
|
+
/* @__PURE__ */ o(
|
|
35
|
+
w,
|
|
36
|
+
{
|
|
37
|
+
style: {
|
|
38
|
+
"--filter-table-margin-inline-start": `${((d - s) / n * 100).toFixed(2)}%`,
|
|
39
|
+
"--filter-table-width": `${(m / n * 100).toFixed(2)}%`
|
|
40
|
+
},
|
|
41
|
+
"data-testid": "expanded-filters",
|
|
42
|
+
children: [
|
|
43
|
+
/* @__PURE__ */ t("colgroup", { children: i.map(({ range: e }) => /* @__PURE__ */ t(
|
|
44
|
+
"col",
|
|
45
|
+
{
|
|
46
|
+
style: {
|
|
47
|
+
width: `${(e[1] - e[0]) / m * 100}%`
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
e.join("")
|
|
51
|
+
)) }),
|
|
52
|
+
/* @__PURE__ */ t(O, { children: /* @__PURE__ */ t("tr", { children: i.map(({ band: e }, a) => /* @__PURE__ */ t(
|
|
53
|
+
W,
|
|
54
|
+
{
|
|
55
|
+
id: `${e}-name`,
|
|
56
|
+
style: {
|
|
57
|
+
"--filter-name-border": e ? "solid #b2b2b2" : "none"
|
|
58
|
+
},
|
|
59
|
+
scope: "col",
|
|
60
|
+
"aria-hidden": !e,
|
|
61
|
+
children: e
|
|
62
|
+
},
|
|
63
|
+
a
|
|
64
|
+
)) }) }),
|
|
65
|
+
!l && /* @__PURE__ */ t(A, { children: /* @__PURE__ */ t("tr", { children: i.map(({ band: e, range: a }) => /* @__PURE__ */ t(M, { "aria-hidden": !e, children: e && /* @__PURE__ */ o(v, { children: [
|
|
66
|
+
a.join("–"),
|
|
67
|
+
/* @__PURE__ */ t("br", {}),
|
|
68
|
+
/* @__PURE__ */ t(N, { children: "nm" })
|
|
69
|
+
] }) }, a.join())) }) })
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
),
|
|
73
|
+
/* @__PURE__ */ t(
|
|
74
|
+
z,
|
|
75
|
+
{
|
|
76
|
+
min: s,
|
|
77
|
+
max: u,
|
|
78
|
+
range: n,
|
|
79
|
+
isCondensed: l,
|
|
80
|
+
activeFilter: C
|
|
81
|
+
}
|
|
82
|
+
),
|
|
83
|
+
/* @__PURE__ */ o(k, { children: [
|
|
84
|
+
/* @__PURE__ */ t(E, { id: "filterSelectLabel", children: r("camera_filter.labels.select") }),
|
|
85
|
+
/* @__PURE__ */ t(
|
|
86
|
+
R,
|
|
87
|
+
{
|
|
88
|
+
options: x,
|
|
89
|
+
value: c,
|
|
90
|
+
onChangeCallback: (e) => b(e),
|
|
91
|
+
width: "100%",
|
|
92
|
+
maxWidth: "100%",
|
|
93
|
+
labelledById: "filterSelectLabel"
|
|
94
|
+
}
|
|
95
|
+
)
|
|
96
|
+
] })
|
|
97
|
+
] }) });
|
|
98
|
+
};
|
|
99
|
+
p.displayName = "Widgets.CameraFilter";
|
|
100
|
+
const Z = p;
|
|
101
|
+
export {
|
|
102
|
+
Z as default
|
|
103
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),m=require("react"),d=require("../styles.cjs"),c=({filters:o,min:i,spectrumRange:l})=>{const n=m.useRef(null),a=n.current?Array.from(n.current.children):null;return e.jsxs(e.Fragment,{children:[e.jsx(d.CondensedRangeRow,{ref:n,"data-testid":"condensed-filters",children:o.map(({range:t,band:s})=>e.jsxs(d.CondensedRange,{"aria-labelledby":`${s}-name`,children:[t.join("–"),e.jsx("br",{}),"nm"]},s))}),a&&e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",preserveAspectRatio:"xMinYMin meet",viewBox:`${i} 0 ${l} 50`,role:"presentation","aria-hidden":"true",children:e.jsx("g",{role:"presentation",children:o.map(({range:t,band:s},u)=>{const x=a[u],{offsetLeft:f,offsetWidth:h,offsetParent:b}=x,{offsetWidth:j}=b,p=l/j,r=(t[0]+t[1])/2,g=(f+h/2)*p;return e.jsxs("g",{children:[e.jsx("line",{strokeWidth:1,stroke:"#b2b2b2",x1:r,x2:r,y1:"100%",y2:"75%",role:"presentation"}),e.jsx("line",{strokeWidth:1,stroke:"#b2b2b2",x1:r,x2:g+i,y1:"75%",y2:"0%",role:"presentation"})]},s)})})})]})};c.displayName="Widgets.CameraFilter.CondensedFilterRanges";exports.default=c;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as s, Fragment as u, jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import { useRef as y } from "react";
|
|
4
|
+
import { CondensedRangeRow as w, CondensedRange as R } from "../styles.js";
|
|
5
|
+
const W = ({
|
|
6
|
+
filters: i,
|
|
7
|
+
min: l,
|
|
8
|
+
spectrumRange: a
|
|
9
|
+
}) => {
|
|
10
|
+
const r = y(null), d = r.current ? Array.from(r.current.children) : null;
|
|
11
|
+
return /* @__PURE__ */ s(u, { children: [
|
|
12
|
+
/* @__PURE__ */ e(w, { ref: r, "data-testid": "condensed-filters", children: i.map(({ range: t, band: n }) => /* @__PURE__ */ s(R, { "aria-labelledby": `${n}-name`, children: [
|
|
13
|
+
t.join("–"),
|
|
14
|
+
/* @__PURE__ */ e("br", {}),
|
|
15
|
+
"nm"
|
|
16
|
+
] }, n)) }),
|
|
17
|
+
d && /* @__PURE__ */ e(
|
|
18
|
+
"svg",
|
|
19
|
+
{
|
|
20
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
21
|
+
preserveAspectRatio: "xMinYMin meet",
|
|
22
|
+
viewBox: `${l} 0 ${a} 50`,
|
|
23
|
+
role: "presentation",
|
|
24
|
+
"aria-hidden": "true",
|
|
25
|
+
children: /* @__PURE__ */ e("g", { role: "presentation", children: i.map(({ range: t, band: n }, c) => {
|
|
26
|
+
const f = d[c], { offsetLeft: m, offsetWidth: p, offsetParent: h } = f, { offsetWidth: b } = h, x = a / b, o = (t[0] + t[1]) / 2, g = (m + p / 2) * x;
|
|
27
|
+
return /* @__PURE__ */ s("g", { children: [
|
|
28
|
+
/* @__PURE__ */ e(
|
|
29
|
+
"line",
|
|
30
|
+
{
|
|
31
|
+
strokeWidth: 1,
|
|
32
|
+
stroke: "#b2b2b2",
|
|
33
|
+
x1: o,
|
|
34
|
+
x2: o,
|
|
35
|
+
y1: "100%",
|
|
36
|
+
y2: "75%",
|
|
37
|
+
role: "presentation"
|
|
38
|
+
}
|
|
39
|
+
),
|
|
40
|
+
/* @__PURE__ */ e(
|
|
41
|
+
"line",
|
|
42
|
+
{
|
|
43
|
+
strokeWidth: 1,
|
|
44
|
+
stroke: "#b2b2b2",
|
|
45
|
+
x1: o,
|
|
46
|
+
x2: g + l,
|
|
47
|
+
y1: "75%",
|
|
48
|
+
y2: "0%",
|
|
49
|
+
role: "presentation"
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
] }, n);
|
|
53
|
+
}) })
|
|
54
|
+
}
|
|
55
|
+
)
|
|
56
|
+
] });
|
|
57
|
+
};
|
|
58
|
+
W.displayName = "Widgets.CameraFilter.CondensedFilterRanges";
|
|
59
|
+
export {
|
|
60
|
+
W as default
|
|
61
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),g=require("react-i18next"),M=require("../../../../lib/utils.cjs"),s=require("../../styles.cjs"),a=({colors:r,activeRange:x,isBandSelected:d,isCondensed:t})=>{const{t:u,i18n:{language:m}}=g.useTranslation(),n=t?350:r[0].range[0],h=(t?1e3:820)-n,b=Math.floor(h/(r.length-1));return e.jsx("g",{role:"list","data-testid":"color-labels",children:r.map(({name:c,range:o,color:j},y)=>{const l=n+b*y,p=d&&M.intersection(o,x)===null,i=(o[0]+o[1])/2;return e.jsxs("g",{children:[e.jsx("line",{strokeWidth:1,stroke:"#b2b2b2",x1:i,x2:i,y1:"100",y2:t?"105":"110",role:"presentation"}),e.jsx("line",{strokeWidth:1,stroke:"#b2b2b2",x1:i,x2:l,y1:t?"105":"110",y2:t?"145":"140",role:"presentation"}),e.jsx("circle",{cx:l,cy:t?"145":"140",r:t?15:10,fill:j,role:"presentation"}),e.jsxs("text",{x:l,dominantBaseline:"middle",textAnchor:"middle",y:"150",role:"listitem","aria-hidden":p,children:[e.jsx(s.ColorName,{x:l,dy:"1.25em",textAnchor:"middle",children:u(`filterTool.colors.${c}`).toLocaleLowerCase(m)}),e.jsx(s.ColorSpectrum,{x:l,dy:"1.25em",textAnchor:"middle",children:o.join("–")}),e.jsx(s.ColorSpectrumUnit,{x:l,dy:"1.25em",textAnchor:"middle",children:"nm"})]})]},c)})})};a.displayName="Widgets.CameraFilter.ColorLabels";exports.default=a;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as o, jsxs as a } from "react/jsx-runtime";
|
|
3
|
+
import { useTranslation as f } from "react-i18next";
|
|
4
|
+
import { intersection as g } from "../../../../lib/utils.js";
|
|
5
|
+
import { ColorName as k, ColorSpectrum as A, ColorSpectrumUnit as L } from "../../styles.js";
|
|
6
|
+
const M = ({
|
|
7
|
+
colors: l,
|
|
8
|
+
activeRange: s,
|
|
9
|
+
isBandSelected: m,
|
|
10
|
+
isCondensed: t
|
|
11
|
+
}) => {
|
|
12
|
+
const {
|
|
13
|
+
t: d,
|
|
14
|
+
i18n: { language: x }
|
|
15
|
+
} = f(), n = t ? 350 : l[0].range[0], h = (t ? 1e3 : 820) - n, p = Math.floor(h / (l.length - 1));
|
|
16
|
+
return /* @__PURE__ */ o("g", { role: "list", "data-testid": "color-labels", children: l.map(({ name: c, range: r, color: b }, y) => {
|
|
17
|
+
const e = n + p * y, u = m && g(r, s) === null, i = (r[0] + r[1]) / 2;
|
|
18
|
+
return /* @__PURE__ */ a("g", { children: [
|
|
19
|
+
/* @__PURE__ */ o(
|
|
20
|
+
"line",
|
|
21
|
+
{
|
|
22
|
+
strokeWidth: 1,
|
|
23
|
+
stroke: "#b2b2b2",
|
|
24
|
+
x1: i,
|
|
25
|
+
x2: i,
|
|
26
|
+
y1: "100",
|
|
27
|
+
y2: t ? "105" : "110",
|
|
28
|
+
role: "presentation"
|
|
29
|
+
}
|
|
30
|
+
),
|
|
31
|
+
/* @__PURE__ */ o(
|
|
32
|
+
"line",
|
|
33
|
+
{
|
|
34
|
+
strokeWidth: 1,
|
|
35
|
+
stroke: "#b2b2b2",
|
|
36
|
+
x1: i,
|
|
37
|
+
x2: e,
|
|
38
|
+
y1: t ? "105" : "110",
|
|
39
|
+
y2: t ? "145" : "140",
|
|
40
|
+
role: "presentation"
|
|
41
|
+
}
|
|
42
|
+
),
|
|
43
|
+
/* @__PURE__ */ o(
|
|
44
|
+
"circle",
|
|
45
|
+
{
|
|
46
|
+
cx: e,
|
|
47
|
+
cy: t ? "145" : "140",
|
|
48
|
+
r: t ? 15 : 10,
|
|
49
|
+
fill: b,
|
|
50
|
+
role: "presentation"
|
|
51
|
+
}
|
|
52
|
+
),
|
|
53
|
+
/* @__PURE__ */ a(
|
|
54
|
+
"text",
|
|
55
|
+
{
|
|
56
|
+
x: e,
|
|
57
|
+
dominantBaseline: "middle",
|
|
58
|
+
textAnchor: "middle",
|
|
59
|
+
y: "150",
|
|
60
|
+
role: "listitem",
|
|
61
|
+
"aria-hidden": u,
|
|
62
|
+
children: [
|
|
63
|
+
/* @__PURE__ */ o(
|
|
64
|
+
k,
|
|
65
|
+
{
|
|
66
|
+
x: e,
|
|
67
|
+
dy: "1.25em",
|
|
68
|
+
textAnchor: "middle",
|
|
69
|
+
children: d(`filterTool.colors.${c}`).toLocaleLowerCase(x)
|
|
70
|
+
}
|
|
71
|
+
),
|
|
72
|
+
/* @__PURE__ */ o(
|
|
73
|
+
A,
|
|
74
|
+
{
|
|
75
|
+
x: e,
|
|
76
|
+
dy: "1.25em",
|
|
77
|
+
textAnchor: "middle",
|
|
78
|
+
children: r.join("–")
|
|
79
|
+
}
|
|
80
|
+
),
|
|
81
|
+
/* @__PURE__ */ o(
|
|
82
|
+
L,
|
|
83
|
+
{
|
|
84
|
+
x: e,
|
|
85
|
+
dy: "1.25em",
|
|
86
|
+
textAnchor: "middle",
|
|
87
|
+
children: "nm"
|
|
88
|
+
}
|
|
89
|
+
)
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
)
|
|
93
|
+
] }, c);
|
|
94
|
+
}) });
|
|
95
|
+
};
|
|
96
|
+
M.displayName = "Widgets.CameraFilter.ColorLabels";
|
|
97
|
+
export {
|
|
98
|
+
M as default
|
|
99
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),o=require("../../../lib/utils.cjs"),t=require("../data.cjs"),l=require("./SpectrumLabels/SpectrumLabels.cjs"),x=({min:n,max:u,range:g,isCondensed:p,activeFilter:s})=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",preserveAspectRatio:"xMinYMin meet",viewBox:`${n} 0 ${g} 260`,"data-testid":"spectrum-display",children:[e.jsxs("defs",{children:[t.spectrums.map(({name:d,stops:r})=>e.jsx("linearGradient",{id:`${d}-gradient`,children:r.map(({offset:a,stopColor:h,id:j})=>e.jsx("stop",{offset:a,stopColor:h,id:j},`${a}-${h}`))},d)),e.jsxs("mask",{id:"spectrumMask",children:[e.jsx("rect",{width:"100%",height:"100",fill:"white",x:n}),s&&e.jsxs(e.Fragment,{children:[e.jsx("rect",{x:n,width:s.range[0]-n,height:"100%",fill:"black"}),e.jsx("rect",{x:s.range[1],width:u-s.range[1],height:"100%",fill:"black"})]})]})]}),e.jsx("g",{mask:"url(#spectrumMask)",role:"presentation",children:t.spectrums.map(({name:d,upper:r,lower:a})=>e.jsx("rect",{width:(r||u)-(a||n),height:"50%",fill:`url(#${d}-gradient)`,x:a||n,role:"presentation"},d))}),e.jsx("g",{children:t.spectrums.map(({name:d,upper:r})=>r&&e.jsx("line",{strokeWidth:2,strokeDasharray:"8 8",stroke:s&&!o.between(r,s.range[0],s.range[1])?"#000":"#fff",x1:r,x2:r,y1:0,y2:"50%"},d))}),e.jsx(l.default,{spectrums:t.spectrums,activeBand:s==null?void 0:s.band,min:n,max:u,activeMin:s==null?void 0:s.range[0],activeMax:s==null?void 0:s.range[1],isCondensed:p})]});x.displayName="Widgets.CameraFilter.SpectrumDisplay";exports.default=x;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { jsxs as g, jsx as r, Fragment as x } from "react/jsx-runtime";
|
|
2
|
+
import { between as w } from "../../../lib/utils.js";
|
|
3
|
+
import { spectrums as e } from "../data.js";
|
|
4
|
+
import k from "./SpectrumLabels/SpectrumLabels.js";
|
|
5
|
+
const l = ({
|
|
6
|
+
min: n,
|
|
7
|
+
max: p,
|
|
8
|
+
range: o,
|
|
9
|
+
isCondensed: f,
|
|
10
|
+
activeFilter: s
|
|
11
|
+
}) => /* @__PURE__ */ g(
|
|
12
|
+
"svg",
|
|
13
|
+
{
|
|
14
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
15
|
+
preserveAspectRatio: "xMinYMin meet",
|
|
16
|
+
viewBox: `${n} 0 ${o} 260`,
|
|
17
|
+
"data-testid": "spectrum-display",
|
|
18
|
+
children: [
|
|
19
|
+
/* @__PURE__ */ g("defs", { children: [
|
|
20
|
+
e.map(({ name: h, stops: d }) => /* @__PURE__ */ r("linearGradient", { id: `${h}-gradient`, children: d.map(({ offset: a, stopColor: m, id: t }) => /* @__PURE__ */ r(
|
|
21
|
+
"stop",
|
|
22
|
+
{
|
|
23
|
+
offset: a,
|
|
24
|
+
stopColor: m,
|
|
25
|
+
id: t
|
|
26
|
+
},
|
|
27
|
+
`${a}-${m}`
|
|
28
|
+
)) }, h)),
|
|
29
|
+
/* @__PURE__ */ g("mask", { id: "spectrumMask", children: [
|
|
30
|
+
/* @__PURE__ */ r("rect", { width: "100%", height: "100", fill: "white", x: n }),
|
|
31
|
+
s && /* @__PURE__ */ g(x, { children: [
|
|
32
|
+
/* @__PURE__ */ r(
|
|
33
|
+
"rect",
|
|
34
|
+
{
|
|
35
|
+
x: n,
|
|
36
|
+
width: s.range[0] - n,
|
|
37
|
+
height: "100%",
|
|
38
|
+
fill: "black"
|
|
39
|
+
}
|
|
40
|
+
),
|
|
41
|
+
/* @__PURE__ */ r(
|
|
42
|
+
"rect",
|
|
43
|
+
{
|
|
44
|
+
x: s.range[1],
|
|
45
|
+
width: p - s.range[1],
|
|
46
|
+
height: "100%",
|
|
47
|
+
fill: "black"
|
|
48
|
+
}
|
|
49
|
+
)
|
|
50
|
+
] })
|
|
51
|
+
] })
|
|
52
|
+
] }),
|
|
53
|
+
/* @__PURE__ */ r("g", { mask: "url(#spectrumMask)", role: "presentation", children: e.map(({ name: h, upper: d, lower: a }) => /* @__PURE__ */ r(
|
|
54
|
+
"rect",
|
|
55
|
+
{
|
|
56
|
+
width: (d || p) - (a || n),
|
|
57
|
+
height: "50%",
|
|
58
|
+
fill: `url(#${h}-gradient)`,
|
|
59
|
+
x: a || n,
|
|
60
|
+
role: "presentation"
|
|
61
|
+
},
|
|
62
|
+
h
|
|
63
|
+
)) }),
|
|
64
|
+
/* @__PURE__ */ r("g", { children: e.map(
|
|
65
|
+
({ name: h, upper: d }) => d && /* @__PURE__ */ r(
|
|
66
|
+
"line",
|
|
67
|
+
{
|
|
68
|
+
strokeWidth: 2,
|
|
69
|
+
strokeDasharray: "8 8",
|
|
70
|
+
stroke: s && !w(d, s.range[0], s.range[1]) ? "#000" : "#fff",
|
|
71
|
+
x1: d,
|
|
72
|
+
x2: d,
|
|
73
|
+
y1: 0,
|
|
74
|
+
y2: "50%"
|
|
75
|
+
},
|
|
76
|
+
h
|
|
77
|
+
)
|
|
78
|
+
) }),
|
|
79
|
+
/* @__PURE__ */ r(
|
|
80
|
+
k,
|
|
81
|
+
{
|
|
82
|
+
spectrums: e,
|
|
83
|
+
activeBand: s == null ? void 0 : s.band,
|
|
84
|
+
min: n,
|
|
85
|
+
max: p,
|
|
86
|
+
activeMin: s == null ? void 0 : s.range[0],
|
|
87
|
+
activeMax: s == null ? void 0 : s.range[1],
|
|
88
|
+
isCondensed: f
|
|
89
|
+
}
|
|
90
|
+
)
|
|
91
|
+
]
|
|
92
|
+
}
|
|
93
|
+
);
|
|
94
|
+
l.displayName = "Widgets.CameraFilter.SpectrumDisplay";
|
|
95
|
+
export {
|
|
96
|
+
l as default
|
|
97
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react/jsx-runtime"),L=require("react-i18next"),S=require("../../styles.cjs"),_=require("../../../../lib/utils.cjs"),h=require("../ColorLabels/ColorLabels.cjs"),d=({spectrums:m,activeBand:e,min:p,max:b,activeMin:i=0,activeMax:a=0,isCondensed:l})=>{const{t:n}=L.useTranslation(),f=n("camera_filter.labels.captured_range",{context:e?"":"no_filter",filter:e});return r.jsx("g",{role:"list","aria-label":f,"aria-live":"polite","data-testid":"spectrum-labels",children:m.map(({name:s,upper:x,lower:g,colors:u},c)=>{const o=x||b,t=g||p,j=e&&_.intersection([t,o],[i,a])===null;return r.jsxs("g",{role:"listitem","aria-hidden":j,children:[r.jsx(S.SpectrumLabel,{x:l&&c===0?t:(o-t)/2+t,y:"50",dominantBaseline:"middle",textAnchor:l&&c===0?"start":"middle",children:n(`camera_filter.labels.${s}`)},s),u&&r.jsx(h.default,{colors:u,isBandSelected:!!e,activeRange:[i,a],isCondensed:l})]},s)})})};d.displayName="Widgets.CameraFilter.SpectrumLabels";exports.default=d;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as a, jsxs as h } from "react/jsx-runtime";
|
|
3
|
+
import { useTranslation as x } from "react-i18next";
|
|
4
|
+
import { SpectrumLabel as S } from "../../styles.js";
|
|
5
|
+
import { intersection as _ } from "../../../../lib/utils.js";
|
|
6
|
+
import j from "../ColorLabels/ColorLabels.js";
|
|
7
|
+
const y = ({
|
|
8
|
+
spectrums: p,
|
|
9
|
+
activeBand: e,
|
|
10
|
+
min: d,
|
|
11
|
+
max: f,
|
|
12
|
+
activeMin: i = 0,
|
|
13
|
+
activeMax: s = 0,
|
|
14
|
+
isCondensed: t
|
|
15
|
+
}) => {
|
|
16
|
+
const { t: o } = x(), u = o("camera_filter.labels.captured_range", {
|
|
17
|
+
context: e ? "" : "no_filter",
|
|
18
|
+
filter: e
|
|
19
|
+
});
|
|
20
|
+
return /* @__PURE__ */ a(
|
|
21
|
+
"g",
|
|
22
|
+
{
|
|
23
|
+
role: "list",
|
|
24
|
+
"aria-label": u,
|
|
25
|
+
"aria-live": "polite",
|
|
26
|
+
"data-testid": "spectrum-labels",
|
|
27
|
+
children: p.map(({ name: l, upper: b, lower: L, colors: m }, n) => {
|
|
28
|
+
const c = b || f, r = L || d, g = e && _([r, c], [i, s]) === null;
|
|
29
|
+
return /* @__PURE__ */ h("g", { role: "listitem", "aria-hidden": g, children: [
|
|
30
|
+
/* @__PURE__ */ a(
|
|
31
|
+
S,
|
|
32
|
+
{
|
|
33
|
+
x: t && n === 0 ? r : (c - r) / 2 + r,
|
|
34
|
+
y: "50",
|
|
35
|
+
dominantBaseline: "middle",
|
|
36
|
+
textAnchor: t && n === 0 ? "start" : "middle",
|
|
37
|
+
children: o(`camera_filter.labels.${l}`)
|
|
38
|
+
},
|
|
39
|
+
l
|
|
40
|
+
),
|
|
41
|
+
m && /* @__PURE__ */ a(
|
|
42
|
+
j,
|
|
43
|
+
{
|
|
44
|
+
colors: m,
|
|
45
|
+
isBandSelected: !!e,
|
|
46
|
+
activeRange: [i, s],
|
|
47
|
+
isCondensed: t
|
|
48
|
+
}
|
|
49
|
+
)
|
|
50
|
+
] }, l);
|
|
51
|
+
})
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
};
|
|
55
|
+
y.displayName = "Widgets.CameraFilter.SpectrumLabels";
|
|
56
|
+
export {
|
|
57
|
+
y as default
|
|
58
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=[{band:"u",range:[338,395]},{range:[396,404]},{band:"g",range:[405,552]},{band:"r",range:[553,690]},{band:"i",range:[690,817]},{band:"z",range:[818,920]},{band:"y",range:[920,1010]}],r=[{offset:0,stopColor:"#e0e0e0"},{offset:.262,stopColor:"#dedde0"},{offset:.41,stopColor:"#dbd5e1"},{offset:.53,stopColor:"#d4c7e3"},{offset:.635,stopColor:"#cbb3e6"},{offset:.73,stopColor:"#bf9aeb"},{offset:.818,stopColor:"#b17af0"},{offset:.9,stopColor:"#a055f5"},{offset:.976,stopColor:"#8c2afc"},{offset:1,stopColor:"#861cff"}],l=[{offset:.11,stopColor:"#861cff"},{offset:.25,stopColor:"blue"},{offset:.27,stopColor:"#001ee0"},{offset:.3,stopColor:"#006d91"},{offset:.33,stopColor:"#00ab53"},{offset:.36,stopColor:"#00d826"},{offset:.38,stopColor:"#00f40a"},{offset:.39,stopColor:"lime"},{offset:.41,stopColor:"#05fe00"},{offset:.43,stopColor:"#14fc01"},{offset:.45,stopColor:"#2df803"},{offset:.47,stopColor:"#50f406"},{offset:.49,stopColor:"#7cee0a"},{offset:.51,stopColor:"#b3e70e"},{offset:.54,stopColor:"#f2de14"},{offset:.54,stopColor:"#ffdd15"},{offset:.56,stopColor:"#fccb17"},{offset:.6,stopColor:"#f49f1e"},{offset:.62,stopColor:"#f18922"},{offset:.63,stopColor:"#f08220"},{offset:.66,stopColor:"#f0711c"},{offset:.69,stopColor:"#ef5415"},{offset:.72,stopColor:"#ed2d0b"},{offset:.75,stopColor:"#ec0000"},{offset:.79,stopColor:"#eb0303"},{offset:.82,stopColor:"#e90f0f"},{offset:.86,stopColor:"#e62323"},{offset:.89,stopColor:"#e23e3e"},{offset:.93,stopColor:"#dc6262"},{offset:.96,stopColor:"#d58e8e"},{offset:.99,stopColor:"#cdc0c0"},{offset:1,stopColor:"#ccc"}],n=[{offset:0,stopColor:"#ccc"},{offset:1,stopColor:"#f2f2f2"}],t=[{name:"violet",color:"#861CFF",range:[380,450]},{name:"blue",color:"#0000FF",range:[450,495]},{name:"green",color:"#00FF00",range:[495,570]},{name:"yellow",color:"#FFDD15",range:[570,590]},{name:"orange",color:"#F18922",range:[590,620]},{name:"red",color:"#EC0000",range:[620,750]}],p=[{name:"ultraviolet",upper:400,stops:r},{name:"visible",upper:750,lower:400,stops:l,colors:t},{name:"infrared",lower:750,stops:n}],e=255,f=322,o=1084,a={condensed:{min:f,max:o,range:o-f},default:{min:e,max:o,range:o-e}};exports.colors=t;exports.filters=s;exports.rangeConfig=a;exports.spectrums=p;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
const n = [
|
|
2
|
+
{ band: "u", range: [338, 395] },
|
|
3
|
+
{ range: [396, 404] },
|
|
4
|
+
{ band: "g", range: [405, 552] },
|
|
5
|
+
{ band: "r", range: [553, 690] },
|
|
6
|
+
{ band: "i", range: [690, 817] },
|
|
7
|
+
{ band: "z", range: [818, 920] },
|
|
8
|
+
{ band: "y", range: [920, 1010] }
|
|
9
|
+
], s = [
|
|
10
|
+
{ offset: 0, stopColor: "#e0e0e0" },
|
|
11
|
+
{ offset: 0.262, stopColor: "#dedde0" },
|
|
12
|
+
{ offset: 0.41, stopColor: "#dbd5e1" },
|
|
13
|
+
{ offset: 0.53, stopColor: "#d4c7e3" },
|
|
14
|
+
{ offset: 0.635, stopColor: "#cbb3e6" },
|
|
15
|
+
{ offset: 0.73, stopColor: "#bf9aeb" },
|
|
16
|
+
{ offset: 0.818, stopColor: "#b17af0" },
|
|
17
|
+
{ offset: 0.9, stopColor: "#a055f5" },
|
|
18
|
+
{ offset: 0.976, stopColor: "#8c2afc" },
|
|
19
|
+
{ offset: 1, stopColor: "#861cff" }
|
|
20
|
+
], t = [
|
|
21
|
+
{ offset: 0.11, stopColor: "#861cff" },
|
|
22
|
+
{ offset: 0.25, stopColor: "blue" },
|
|
23
|
+
{ offset: 0.27, stopColor: "#001ee0" },
|
|
24
|
+
{ offset: 0.3, stopColor: "#006d91" },
|
|
25
|
+
{ offset: 0.33, stopColor: "#00ab53" },
|
|
26
|
+
{ offset: 0.36, stopColor: "#00d826" },
|
|
27
|
+
{ offset: 0.38, stopColor: "#00f40a" },
|
|
28
|
+
{ offset: 0.39, stopColor: "lime" },
|
|
29
|
+
{ offset: 0.41, stopColor: "#05fe00" },
|
|
30
|
+
{ offset: 0.43, stopColor: "#14fc01" },
|
|
31
|
+
{ offset: 0.45, stopColor: "#2df803" },
|
|
32
|
+
{ offset: 0.47, stopColor: "#50f406" },
|
|
33
|
+
{ offset: 0.49, stopColor: "#7cee0a" },
|
|
34
|
+
{ offset: 0.51, stopColor: "#b3e70e" },
|
|
35
|
+
{ offset: 0.54, stopColor: "#f2de14" },
|
|
36
|
+
{ offset: 0.54, stopColor: "#ffdd15" },
|
|
37
|
+
{ offset: 0.56, stopColor: "#fccb17" },
|
|
38
|
+
{ offset: 0.6, stopColor: "#f49f1e" },
|
|
39
|
+
{ offset: 0.62, stopColor: "#f18922" },
|
|
40
|
+
{ offset: 0.63, stopColor: "#f08220" },
|
|
41
|
+
{ offset: 0.66, stopColor: "#f0711c" },
|
|
42
|
+
{ offset: 0.69, stopColor: "#ef5415" },
|
|
43
|
+
{ offset: 0.72, stopColor: "#ed2d0b" },
|
|
44
|
+
{ offset: 0.75, stopColor: "#ec0000" },
|
|
45
|
+
{ offset: 0.79, stopColor: "#eb0303" },
|
|
46
|
+
{ offset: 0.82, stopColor: "#e90f0f" },
|
|
47
|
+
{ offset: 0.86, stopColor: "#e62323" },
|
|
48
|
+
{ offset: 0.89, stopColor: "#e23e3e" },
|
|
49
|
+
{ offset: 0.93, stopColor: "#dc6262" },
|
|
50
|
+
{ offset: 0.96, stopColor: "#d58e8e" },
|
|
51
|
+
{ offset: 0.99, stopColor: "#cdc0c0" },
|
|
52
|
+
{ offset: 1, stopColor: "#ccc" }
|
|
53
|
+
], r = [
|
|
54
|
+
{ offset: 0, stopColor: "#ccc" },
|
|
55
|
+
{ offset: 1, stopColor: "#f2f2f2" }
|
|
56
|
+
], l = [
|
|
57
|
+
{ name: "violet", color: "#861CFF", range: [380, 450] },
|
|
58
|
+
{ name: "blue", color: "#0000FF", range: [450, 495] },
|
|
59
|
+
{ name: "green", color: "#00FF00", range: [495, 570] },
|
|
60
|
+
{ name: "yellow", color: "#FFDD15", range: [570, 590] },
|
|
61
|
+
{ name: "orange", color: "#F18922", range: [590, 620] },
|
|
62
|
+
{ name: "red", color: "#EC0000", range: [620, 750] }
|
|
63
|
+
], p = [
|
|
64
|
+
{ name: "ultraviolet", upper: 400, stops: s },
|
|
65
|
+
{ name: "visible", upper: 750, lower: 400, stops: t, colors: l },
|
|
66
|
+
{ name: "infrared", lower: 750, stops: r }
|
|
67
|
+
], e = 255, f = 322, o = 1084, a = {
|
|
68
|
+
condensed: {
|
|
69
|
+
min: f,
|
|
70
|
+
max: o,
|
|
71
|
+
range: o - f
|
|
72
|
+
},
|
|
73
|
+
default: {
|
|
74
|
+
min: e,
|
|
75
|
+
max: o,
|
|
76
|
+
range: o - e
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
export {
|
|
80
|
+
l as colors,
|
|
81
|
+
n as filters,
|
|
82
|
+
a as rangeConfig,
|
|
83
|
+
p as spectrums
|
|
84
|
+
};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("styled-components"),t=require("@rubin-epo/epo-react-lib/styles"),o=require("../../layout/AspectRatio/index.cjs"),a=n=>n&&n.__esModule?n:{default:n},e=a(i),l=e.default(o.default)`
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
`,r=e.default.div`
|
|
5
|
+
container-type: inline-size;
|
|
6
|
+
|
|
7
|
+
display: grid;
|
|
8
|
+
grid-template-columns: 1fr;
|
|
9
|
+
grid-auto-rows: min-content;
|
|
10
|
+
text-align: center;
|
|
11
|
+
width: 100%;
|
|
12
|
+
`,s=e.default.h3`
|
|
13
|
+
margin: 0;
|
|
14
|
+
`,d=e.default.table`
|
|
15
|
+
border-collapse: collapse;
|
|
16
|
+
text-align: center;
|
|
17
|
+
margin-inline-start: var(--filter-table-margin-inline-start);
|
|
18
|
+
width: var(--filter-table-width);
|
|
19
|
+
|
|
20
|
+
@container (min-width: ${t.token("BREAK_TABLET")}) {
|
|
21
|
+
margin-block-start: var(--PADDING_SMALL, 20px);
|
|
22
|
+
}
|
|
23
|
+
`,c=e.default.tbody`
|
|
24
|
+
display: table-header-group;
|
|
25
|
+
`,f=e.default.thead`
|
|
26
|
+
display: table-row-group;
|
|
27
|
+
`,m=e.default.td`
|
|
28
|
+
line-height: 1.2;
|
|
29
|
+
font-size: 80%;
|
|
30
|
+
`,u=e.default.span`
|
|
31
|
+
font-size: 80%;
|
|
32
|
+
`,p=e.default.th`
|
|
33
|
+
font-size: 120%;
|
|
34
|
+
font-weight: var(--FONT_WEIGHT_NORMAL, 400);
|
|
35
|
+
border: var(--filter-name-border);
|
|
36
|
+
border-width: 1px;
|
|
37
|
+
|
|
38
|
+
@container (min-width: ${t.token("BREAK_TABLET")}) {
|
|
39
|
+
border-width: 3px;
|
|
40
|
+
}
|
|
41
|
+
`,g=e.default.div`
|
|
42
|
+
min-width: 20ch;
|
|
43
|
+
width: 50%;
|
|
44
|
+
max-width: 30ch;
|
|
45
|
+
justify-self: center;
|
|
46
|
+
text-align: left;
|
|
47
|
+
`,h=e.default.label`
|
|
48
|
+
font-size: 0.75em;
|
|
49
|
+
`,w=e.default.text`
|
|
50
|
+
font-size: 2em;
|
|
51
|
+
|
|
52
|
+
@container (min-width: ${t.token("BREAK_MOBILE")}) {
|
|
53
|
+
font-size: 1.25em;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
@container (min-width: ${t.token("BREAK_PHABLET_MIN")}) {
|
|
57
|
+
font-size: 0.75em;
|
|
58
|
+
}
|
|
59
|
+
`,b=e.default.tspan`
|
|
60
|
+
font-size: 2em;
|
|
61
|
+
|
|
62
|
+
@container (min-width: ${t.token("BREAK_MOBILE")}) {
|
|
63
|
+
font-size: 1.25em;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
@container (min-width: ${t.token("BREAK_PHABLET_MIN")}) {
|
|
67
|
+
font-size: 0.75em;
|
|
68
|
+
}
|
|
69
|
+
`,_=e.default.tspan`
|
|
70
|
+
font-size: 1.5em;
|
|
71
|
+
|
|
72
|
+
@container (min-width: ${t.token("BREAK_MOBILE")}) {
|
|
73
|
+
font-size: 1em;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
@container (min-width: ${t.token("BREAK_PHABLET_MIN")}) {
|
|
77
|
+
font-size: 0.5em;
|
|
78
|
+
}
|
|
79
|
+
`,A=e.default.tspan`
|
|
80
|
+
font-size: 1.3em;
|
|
81
|
+
|
|
82
|
+
@container (min-width: ${t.token("BREAK_MOBILE")}) {
|
|
83
|
+
font-size: 0.8em;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
@container (min-width: ${t.token("BREAK_PHABLET_MIN")}) {
|
|
87
|
+
font-size: 0.4em;
|
|
88
|
+
}
|
|
89
|
+
`,B=e.default.ul`
|
|
90
|
+
display: flex;
|
|
91
|
+
justify-content: space-between;
|
|
92
|
+
line-height: 1.2;
|
|
93
|
+
font-size: 80%;
|
|
94
|
+
margin: var(--PADDING_SMALL, 20px) 0 0;
|
|
95
|
+
padding: 0;
|
|
96
|
+
list-style-type: none;
|
|
97
|
+
`,E=e.default.li`
|
|
98
|
+
list-style-type: none;
|
|
99
|
+
margin: 0;
|
|
100
|
+
padding: 0;
|
|
101
|
+
|
|
102
|
+
&:before {
|
|
103
|
+
content: "\\200B";
|
|
104
|
+
}
|
|
105
|
+
`;exports.ColorName=b;exports.ColorSpectrum=_;exports.ColorSpectrumUnit=A;exports.CondensedRange=E;exports.CondensedRangeRow=B;exports.FilterContainer=r;exports.FilterName=p;exports.FilterNames=f;exports.FilterRange=m;exports.FilterRanges=c;exports.FilterTable=d;exports.FilterTitle=s;exports.FilterWrapper=l;exports.SelectContainer=g;exports.SelectLabel=h;exports.SpectrumLabel=w;exports.Wavelength=u;
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import t from "styled-components";
|
|
3
|
+
import { token as e } from "@rubin-epo/epo-react-lib/styles";
|
|
4
|
+
import n from "../../layout/AspectRatio/index.js";
|
|
5
|
+
const a = t(n)`
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
`, s = t.div`
|
|
9
|
+
container-type: inline-size;
|
|
10
|
+
|
|
11
|
+
display: grid;
|
|
12
|
+
grid-template-columns: 1fr;
|
|
13
|
+
grid-auto-rows: min-content;
|
|
14
|
+
text-align: center;
|
|
15
|
+
width: 100%;
|
|
16
|
+
`, l = t.h3`
|
|
17
|
+
margin: 0;
|
|
18
|
+
`, c = t.table`
|
|
19
|
+
border-collapse: collapse;
|
|
20
|
+
text-align: center;
|
|
21
|
+
margin-inline-start: var(--filter-table-margin-inline-start);
|
|
22
|
+
width: var(--filter-table-width);
|
|
23
|
+
|
|
24
|
+
@container (min-width: ${e("BREAK_TABLET")}) {
|
|
25
|
+
margin-block-start: var(--PADDING_SMALL, 20px);
|
|
26
|
+
}
|
|
27
|
+
`, m = t.tbody`
|
|
28
|
+
display: table-header-group;
|
|
29
|
+
`, d = t.thead`
|
|
30
|
+
display: table-row-group;
|
|
31
|
+
`, p = t.td`
|
|
32
|
+
line-height: 1.2;
|
|
33
|
+
font-size: 80%;
|
|
34
|
+
`, f = t.span`
|
|
35
|
+
font-size: 80%;
|
|
36
|
+
`, h = t.th`
|
|
37
|
+
font-size: 120%;
|
|
38
|
+
font-weight: var(--FONT_WEIGHT_NORMAL, 400);
|
|
39
|
+
border: var(--filter-name-border);
|
|
40
|
+
border-width: 1px;
|
|
41
|
+
|
|
42
|
+
@container (min-width: ${e("BREAK_TABLET")}) {
|
|
43
|
+
border-width: 3px;
|
|
44
|
+
}
|
|
45
|
+
`, g = t.div`
|
|
46
|
+
min-width: 20ch;
|
|
47
|
+
width: 50%;
|
|
48
|
+
max-width: 30ch;
|
|
49
|
+
justify-self: center;
|
|
50
|
+
text-align: left;
|
|
51
|
+
`, w = t.label`
|
|
52
|
+
font-size: 0.75em;
|
|
53
|
+
`, A = t.text`
|
|
54
|
+
font-size: 2em;
|
|
55
|
+
|
|
56
|
+
@container (min-width: ${e("BREAK_MOBILE")}) {
|
|
57
|
+
font-size: 1.25em;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@container (min-width: ${e("BREAK_PHABLET_MIN")}) {
|
|
61
|
+
font-size: 0.75em;
|
|
62
|
+
}
|
|
63
|
+
`, B = t.tspan`
|
|
64
|
+
font-size: 2em;
|
|
65
|
+
|
|
66
|
+
@container (min-width: ${e("BREAK_MOBILE")}) {
|
|
67
|
+
font-size: 1.25em;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
@container (min-width: ${e("BREAK_PHABLET_MIN")}) {
|
|
71
|
+
font-size: 0.75em;
|
|
72
|
+
}
|
|
73
|
+
`, E = t.tspan`
|
|
74
|
+
font-size: 1.5em;
|
|
75
|
+
|
|
76
|
+
@container (min-width: ${e("BREAK_MOBILE")}) {
|
|
77
|
+
font-size: 1em;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
@container (min-width: ${e("BREAK_PHABLET_MIN")}) {
|
|
81
|
+
font-size: 0.5em;
|
|
82
|
+
}
|
|
83
|
+
`, b = t.tspan`
|
|
84
|
+
font-size: 1.3em;
|
|
85
|
+
|
|
86
|
+
@container (min-width: ${e("BREAK_MOBILE")}) {
|
|
87
|
+
font-size: 0.8em;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
@container (min-width: ${e("BREAK_PHABLET_MIN")}) {
|
|
91
|
+
font-size: 0.4em;
|
|
92
|
+
}
|
|
93
|
+
`, z = t.ul`
|
|
94
|
+
display: flex;
|
|
95
|
+
justify-content: space-between;
|
|
96
|
+
line-height: 1.2;
|
|
97
|
+
font-size: 80%;
|
|
98
|
+
margin: var(--PADDING_SMALL, 20px) 0 0;
|
|
99
|
+
padding: 0;
|
|
100
|
+
list-style-type: none;
|
|
101
|
+
`, _ = t.li`
|
|
102
|
+
list-style-type: none;
|
|
103
|
+
margin: 0;
|
|
104
|
+
padding: 0;
|
|
105
|
+
|
|
106
|
+
&:before {
|
|
107
|
+
content: "\\200B";
|
|
108
|
+
}
|
|
109
|
+
`;
|
|
110
|
+
export {
|
|
111
|
+
B as ColorName,
|
|
112
|
+
E as ColorSpectrum,
|
|
113
|
+
b as ColorSpectrumUnit,
|
|
114
|
+
_ as CondensedRange,
|
|
115
|
+
z as CondensedRangeRow,
|
|
116
|
+
s as FilterContainer,
|
|
117
|
+
h as FilterName,
|
|
118
|
+
d as FilterNames,
|
|
119
|
+
p as FilterRange,
|
|
120
|
+
m as FilterRanges,
|
|
121
|
+
c as FilterTable,
|
|
122
|
+
l as FilterTitle,
|
|
123
|
+
a as FilterWrapper,
|
|
124
|
+
g as SelectContainer,
|
|
125
|
+
w as SelectLabel,
|
|
126
|
+
A as SpectrumLabel,
|
|
127
|
+
f as Wavelength
|
|
128
|
+
};
|
package/package.json
CHANGED