rte-utils 1.2.9 → 1.2.10
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/components/ProductionUnit.d.ts +3 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -4,11 +4,13 @@ interface ProductionUnitProps {
|
|
|
4
4
|
onChangeSwitch?: (checked: boolean) => void;
|
|
5
5
|
defaultValue?: number;
|
|
6
6
|
defaultChecked?: boolean;
|
|
7
|
+
value?: number;
|
|
8
|
+
checked?: boolean;
|
|
7
9
|
unitName?: string;
|
|
8
10
|
energyCost?: number;
|
|
9
11
|
checkedImage?: React.ReactNode;
|
|
10
12
|
uncheckedImage?: React.ReactNode;
|
|
11
13
|
readonly?: boolean;
|
|
12
14
|
}
|
|
13
|
-
export declare const ProductionUnit: ({ onChangeInput, onChangeSwitch, defaultValue, defaultChecked, unitName, energyCost, checkedImage, uncheckedImage, readonly, }: ProductionUnitProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare const ProductionUnit: ({ onChangeInput, onChangeSwitch, defaultValue, defaultChecked, value, checked, unitName, energyCost, checkedImage, uncheckedImage, readonly, }: ProductionUnitProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
16
|
export {};
|
package/dist/index.esm.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as t,jsxs as
|
|
1
|
+
import{jsx as t,jsxs as i}from"react/jsx-runtime";import{useState as n,useRef as o,useEffect as e}from"react";var a=function(a){var c=a.label,l=a.value,r=void 0===l?"":l,d=a.onChange,h=a.type,s=void 0===h?"text":h,v=a.disabled,u=void 0!==v&&v,m=a.className,f=void 0===m?"":m,p=a.required,g=void 0!==p&&p,b=a.min,w=void 0===b?{value:0,label:"Pmin"}:b,N=a.max,C=void 0===N?{value:100,label:"Pmax"}:N,L=n(r),x=L[0],R=L[1],k=n(!1),y=k[0],z=k[1],M=o(null);e(function(){R(r)},[r]);var F=["input-container",y?"input-container--focused":"",y||x.length>0?"input-container--floating":"",u?"input-container--disabled":"",f].filter(Boolean).join(" ");return t("div",{className:F,children:i("div",{className:"input-constraints",children:[i("div",{className:"input-min",children:[w.label,t("br",{}),w.value]}),i("div",{className:"input-field",children:[t("input",{ref:M,type:s,value:x,onChange:function(t){var i=t.target.value;R(i),null==d||d(i)},onFocus:function(){z(!0)},onBlur:function(){z(!1)},disabled:u,required:g,className:"input-element","aria-label":c}),i("label",{className:"input-label",children:[c,g&&t("span",{className:"input-required",children:"*"})]})]}),i("div",{className:"input-max",children:[C.label,t("br",{})," ",C.value]})]})})},c=function(i){var n=i.isOff;return t("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("path",{d:"M9.56529 2.85352C9.66365 2.57607 9.96837 2.43116 10.246 2.5293C13.4295 3.65507 15.3392 6.91015 14.7684 10.2383C14.1974 13.5667 11.3114 16 7.93443 16C4.55739 16 1.67151 13.5667 1.10045 10.2383C0.5296 6.91011 2.4393 3.65504 5.62291 2.5293C5.9005 2.43115 6.20523 2.57605 6.30357 2.85352C6.40176 3.13124 6.2561 3.43599 5.97838 3.53418C3.28438 4.48672 1.669 7.2423 2.1522 10.0586C2.63557 12.8747 5.07706 14.9336 7.93443 14.9336C10.7918 14.9336 13.2333 12.8747 13.7167 10.0586C14.1999 7.24233 12.5844 4.48676 9.89049 3.53418C9.61276 3.43599 9.4671 3.13124 9.56529 2.85352ZM7.93443 0C8.22892 3.10447e-05 8.46754 0.238727 8.46763 0.533203V7.4668C8.46763 7.76135 8.22898 8.00095 7.93443 8.00098C7.63986 8.00098 7.40123 7.76137 7.40123 7.4668V0.533203C7.40132 0.238707 7.63991 0 7.93443 0Z",fill:n?"#999FA1":"#009CDF"})})},l=function(i){var n=i.isOff;return t("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("circle",{cx:"16",cy:"16",r:"16",fill:n?"white":"#009cdf"})})},r=function(o){var e=o.checked,a=void 0!==e&&e,r=o.onChange,d=o.disabled,h=void 0!==d&&d,s=o.showIcon,v=void 0===s||s,u=n(a),m=u[0],f=u[1],p=["switch",m?"switch--checked":"",h?"switch--disabled":""].filter(Boolean).join(" ");return t("div",{className:"switch-container",children:i("div",{className:"switch-wrapper",children:[v&&t("div",{className:"switch-icon",children:t(c,{isOff:!m})}),t("button",{type:"button",role:"switch","aria-checked":m,className:p,onClick:function(){if(!h){var t=!m;f(t),null==r||r(t)}},disabled:h,children:t("span",{className:"switch-track",children:t("span",{className:"switch-thumb",children:t(l,{isOff:!m})})})})]})})},d=function(i){var n=i.label,o=i.bgColor,e=i.textColor,a=i.width,c=["chip-container","full-width"===(void 0===a?"fit-content":a)?"chip-container--full-width":"chip-container--fit-content"].join(" ");return t("div",{className:c,style:{backgroundColor:o},children:t("div",{className:"chip-content",children:t("p",{className:"chip-label",style:{color:e},children:n})})})},h=function(o){var e=o.onChangeInput,c=o.onChangeSwitch,l=o.defaultValue,h=o.defaultChecked,s=void 0!==h&&h,v=o.value,u=o.checked,m=o.unitName,f=void 0===m?"Production Unit":m,p=o.energyCost,g=void 0===p?0:p,b=o.checkedImage,w=o.uncheckedImage,N=o.readonly,C=void 0!==N&&N,L=n(s),x=L[0],R=L[1],k=n(l),y=k[0],z=k[1],M=void 0!==u?u:x,F=void 0!==v?v:y;return i("div",{className:"production-unit-container",children:[i("div",{className:"production-unit-content",children:[t("div",{className:"image-preview-container",children:M?b:w}),i("div",{className:"production-unit-chip",children:[t("div",{className:"production-unit-chip-name",children:f}),t(d,{label:"".concat(g," MW"),width:"fit-content",bgColor:"#E1F5FD",textColor:"#005896"})]}),i("div",{className:"production-unit-switch-container",children:[t(a,{label:"PA",type:"number",onChange:function(t){var i=Number(t);void 0===v&&z(i),e&&e(i)},value:void 0!==F?F.toString():void 0,disabled:!M||C})," "]})]}),t(r,{checked:M,onChange:function(t){void 0===u&&R(t),c&&c(t)},disabled:C})]})},s=function(o){var a,c,l,r,d=o.max,h=o.relative,s=o.barHeight,v=void 0===s?103:s,u=o.barWidth,m=void 0===u?32:u,f=o.orientation,p=void 0===f?"vertical":f,g=o.cornerRadius,b=o.children,w=n(0),N=w[0],C=w[1],L=n(0),x=L[0],R=L[1],k=Math.min(h.value/d.value*100,100)/100*v,y=Math.min(h.value/d.value*100,100)/100*m;e(function(){C(0),R(0);var t=Date.now(),i=function(){var n=Date.now()-t,o=Math.min(n/1e3,1),e=1-Math.pow(1-o,4);C(k*e),R(y*e),o<1&&requestAnimationFrame(i)};requestAnimationFrame(i)},[k,y]);var z="horizontal"===p?v:m,M="horizontal"===p?m:v,F="horizontal"===p?v:m,B="horizontal"===p?m:v,q=function(t,i,n,o,e){var a=e.topLeft,c=e.topRight,l=e.bottomLeft,r=e.bottomRight;return"\n M ".concat(t+a," ").concat(i,"\n L ").concat(t+n-c," ").concat(i,"\n Q ").concat(t+n," ").concat(i," ").concat(t+n," ").concat(i+c,"\n L ").concat(t+n," ").concat(i+o-r,"\n Q ").concat(t+n," ").concat(i+o," ").concat(t+n-r," ").concat(i+o,"\n L ").concat(t+l," ").concat(i+o,"\n Q ").concat(t," ").concat(i+o," ").concat(t," ").concat(i+o-l,"\n L ").concat(t," ").concat(i+a,"\n Q ").concat(t," ").concat(i," ").concat(t+a," ").concat(i,"\n Z\n ").trim().replace(/\s+/g," ")},O={topLeft:2,topRight:2,bottomLeft:2,bottomRight:2},j=g?{topLeft:null!==(a=g.topLeft)&&void 0!==a?a:O.topLeft,topRight:null!==(c=g.topRight)&&void 0!==c?c:O.topRight,bottomLeft:null!==(l=g.bottomLeft)&&void 0!==l?l:O.bottomLeft,bottomRight:null!==(r=g.bottomRight)&&void 0!==r?r:O.bottomRight}:O;return t("div",{className:"histogram-container ".concat("horizontal"===p?"histogram-container--horizontal":""),children:i("div",{className:"histogram-content ".concat("horizontal"===p?"histogram-content--horizontal":""),children:[t("div",{className:"histogram-bar",style:{height:"".concat(M,"px"),width:"".concat(z,"px")},children:i("svg",{width:F,height:B,viewBox:"0 0 ".concat(F," ").concat(B),className:"histogram-svg",children:[t("path",{d:q(0,0,F,B,j),fill:d.color,fillOpacity:d.opacity||1}),t("path","vertical"===p?{d:q(0,B-N,F,N,{topLeft:N>=B?j.topLeft:0,topRight:N>=B?j.topRight:0,bottomLeft:j.bottomLeft,bottomRight:j.bottomRight}),fill:h.color}:{d:q(0,0,x,B,{topLeft:j.topLeft,topRight:x>=F?j.topRight:0,bottomLeft:j.bottomLeft,bottomRight:x>=F?j.bottomRight:0}),fill:h.color})]})}),b&&t("div",{className:"histogram-text-container ".concat("horizontal"===p?"histogram-text-container--horizontal":""),children:b})]})})},v=function(i){var n=i.children;return t("div",{className:"avatar-container avatar-container--clickable",children:t("div",{className:"avatar-content",children:n})})};export{v as Avatar,d as Chip,s as Histogram,a as Input,h as ProductionUnit,r as Switch};
|
|
2
2
|
//# sourceMappingURL=index.esm.js.map
|
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../src/components/Input.tsx","../src/components/Switch.tsx","../src/components/Chip.tsx","../src/components/ProductionUnit.tsx","../src/components/Histogram.tsx","../src/components/Avatar.tsx"],"sourcesContent":["import React, { useState, useRef, useEffect } from \"react\";\nimport \"./Input.css\";\n\ninterface InputProps {\n label: string;\n value?: string;\n onChange?: (value: string) => void;\n type?: \"text\" | \"number\";\n disabled?: boolean;\n className?: string;\n required?: boolean;\n min?: { value: number; label?: string };\n max?: { value: number; label?: string };\n}\n\nexport const Input: React.FC<InputProps> = ({\n label,\n value = \"\",\n onChange,\n type = \"text\",\n disabled = false,\n className = \"\",\n required = false,\n min = { value: 0, label: \"Pmin\" },\n max = { value: 100, label: \"Pmax\" },\n}) => {\n const [internalValue, setInternalValue] = useState(value);\n const [isFocused, setIsFocused] = useState(false);\n const inputRef = useRef<HTMLInputElement>(null);\n\n useEffect(() => {\n setInternalValue(value);\n }, [value]);\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const newValue = e.target.value;\n setInternalValue(newValue);\n onChange?.(newValue);\n };\n\n const handleFocus = () => {\n setIsFocused(true);\n };\n\n const handleBlur = () => {\n setIsFocused(false);\n };\n\n const isLabelFloating = isFocused || internalValue.length > 0;\n\n const containerClasses = [\n \"input-container\",\n isFocused ? \"input-container--focused\" : \"\",\n isLabelFloating ? \"input-container--floating\" : \"\",\n disabled ? \"input-container--disabled\" : \"\",\n className,\n ]\n .filter(Boolean)\n .join(\" \");\n\n return (\n <div className={containerClasses}>\n <div className=\"input-constraints\">\n <div className=\"input-min\">\n {min.label}\n <br />\n {min.value}\n </div>\n\n <div className=\"input-field\">\n <input\n ref={inputRef}\n type={type}\n value={internalValue}\n onChange={handleChange}\n onFocus={handleFocus}\n onBlur={handleBlur}\n disabled={disabled}\n required={required}\n className=\"input-element\"\n aria-label={label}\n />\n <label className=\"input-label\">\n {label}\n {required && <span className=\"input-required\">*</span>}\n </label>\n </div>\n <div className=\"input-max\">\n {max.label}\n <br /> {max.value}\n </div>\n </div>\n </div>\n );\n};\n","import React, { useState } from \"react\";\nimport \"./Switch.css\";\n\ninterface OnProps {\n isOff?: boolean;\n}\nconst ImgOn = ({ isOff }: OnProps) => (\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M9.56529 2.85352C9.66365 2.57607 9.96837 2.43116 10.246 2.5293C13.4295 3.65507 15.3392 6.91015 14.7684 10.2383C14.1974 13.5667 11.3114 16 7.93443 16C4.55739 16 1.67151 13.5667 1.10045 10.2383C0.5296 6.91011 2.4393 3.65504 5.62291 2.5293C5.9005 2.43115 6.20523 2.57605 6.30357 2.85352C6.40176 3.13124 6.2561 3.43599 5.97838 3.53418C3.28438 4.48672 1.669 7.2423 2.1522 10.0586C2.63557 12.8747 5.07706 14.9336 7.93443 14.9336C10.7918 14.9336 13.2333 12.8747 13.7167 10.0586C14.1999 7.24233 12.5844 4.48676 9.89049 3.53418C9.61276 3.43599 9.4671 3.13124 9.56529 2.85352ZM7.93443 0C8.22892 3.10447e-05 8.46754 0.238727 8.46763 0.533203V7.4668C8.46763 7.76135 8.22898 8.00095 7.93443 8.00098C7.63986 8.00098 7.40123 7.76137 7.40123 7.4668V0.533203C7.40132 0.238707 7.63991 0 7.93443 0Z\"\n fill={isOff ? \"#999FA1\" : \"#009CDF\"}\n />\n </svg>\n);\nconst SwitchThumb = ({ isOff }: OnProps) => (\n <svg\n width=\"32\"\n height=\"32\"\n viewBox=\"0 0 32 32\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle cx=\"16\" cy=\"16\" r=\"16\" fill={isOff ? \"white\" : \"#009cdf\"} />\n </svg>\n);\n\ninterface SwitchProps {\n checked?: boolean;\n onChange?: (checked: boolean) => void;\n disabled?: boolean;\n showIcon?: boolean;\n}\n\nexport const Switch: React.FC<SwitchProps> = ({\n checked = false,\n onChange,\n disabled = false,\n showIcon = true,\n}) => {\n const [internalChecked, setInternalChecked] = useState(checked);\n\n const handleToggle = () => {\n if (disabled) return;\n\n const newChecked = !internalChecked;\n setInternalChecked(newChecked);\n onChange?.(newChecked);\n };\n\n const switchClasses = [\n \"switch\",\n internalChecked ? \"switch--checked\" : \"\",\n disabled ? \"switch--disabled\" : \"\",\n ]\n .filter(Boolean)\n .join(\" \");\n\n return (\n <div className=\"switch-container\">\n <div className=\"switch-wrapper\">\n {showIcon && (\n <div className=\"switch-icon\">\n <ImgOn isOff={!internalChecked} />\n </div>\n )}\n <button\n type=\"button\"\n role=\"switch\"\n aria-checked={internalChecked}\n className={switchClasses}\n onClick={handleToggle}\n disabled={disabled}\n >\n <span className=\"switch-track\">\n <span className=\"switch-thumb\">\n <SwitchThumb isOff={!internalChecked} />\n </span>\n </span>\n </button>\n </div>\n </div>\n );\n};\n","import React from \"react\";\nimport \"./Chip.css\";\n\ninterface ChipProps {\n // Define any props you want to pass to the Chip component\n label?: string;\n bgColor?: string;\n textColor?: string;\n width?: \"fit-content\" | \"full-width\";\n}\n\nexport const Chip: React.FC<ChipProps> = ({ \n label, \n bgColor, \n textColor, \n width = \"fit-content\" \n}) => {\n const chipClasses = [\n \"chip-container\",\n width === \"full-width\" ? \"chip-container--full-width\" : \"chip-container--fit-content\"\n ].join(\" \");\n\n return (\n <div className={chipClasses} style={{ backgroundColor: bgColor }}>\n <div className=\"chip-content\">\n <p className=\"chip-label\" style={{ color: textColor }}>\n {label}\n </p>\n </div>\n </div>\n );\n};\n","import { useState } from \"react\";\nimport { Input } from \"./Input\";\nimport { Switch } from \"./Switch\";\nimport \"./ProductionUnit.css\";\nimport { Chip } from \"./Chip\";\n\ninterface ProductionUnitProps {\n onChangeInput?: (value: number) => void;\n onChangeSwitch?: (checked: boolean) => void;\n defaultValue?: number;\n defaultChecked?: boolean;\n unitName?: string;\n energyCost?: number;\n checkedImage?: React.ReactNode;\n uncheckedImage?: React.ReactNode;\n readonly?: boolean;\n}\nexport const ProductionUnit = ({\n onChangeInput,\n onChangeSwitch,\n defaultValue,\n defaultChecked = false,\n unitName = \"Production Unit\",\n energyCost = 0,\n checkedImage,\n uncheckedImage,\n readonly = false,\n}: ProductionUnitProps) => {\n // Internal state management\n const [internalChecked, setInternalChecked] = useState(defaultChecked);\n const [internalValue, setInternalValue] = useState(defaultValue);\n\n const handleSwitchChange = (newChecked: boolean) => {\n // Update internal state\n setInternalChecked(newChecked);\n\n // Notify parent component if handler provided\n if (onChangeSwitch) {\n onChangeSwitch(newChecked);\n }\n };\n\n const handleInputChange = (val: string) => {\n const numValue = Number(val);\n // Update internal state\n setInternalValue(numValue);\n\n // Notify parent component if handler provided\n if (onChangeInput) {\n onChangeInput(numValue);\n }\n };\n\n return (\n <div className=\"production-unit-container\">\n <div className=\"production-unit-content\">\n <div className=\"image-preview-container\">\n {internalChecked ? checkedImage : uncheckedImage}\n </div>\n <div className=\"production-unit-chip\">\n <div className=\"production-unit-chip-name\">{unitName}</div>\n\n <Chip\n label={`${energyCost} MW`}\n width=\"fit-content\"\n bgColor=\"#E1F5FD\"\n textColor=\"#005896\"\n />\n </div>\n <div className=\"production-unit-switch-container\">\n <Input\n label=\"PA\"\n type=\"number\"\n onChange={handleInputChange}\n value={\n internalValue !== undefined ? internalValue.toString() : undefined\n }\n disabled={!internalChecked || readonly}\n />{\" \"}\n </div>\n </div>\n\n <Switch\n checked={internalChecked}\n onChange={handleSwitchChange}\n disabled={readonly}\n />\n </div>\n );\n};\n","import React, { useEffect, useState } from \"react\";\nimport \"./Histogram.css\";\n\ninterface HistogramProps {\n /** Maximum value configuration with value and color */\n max: {\n value: number;\n color: string;\n opacity?: number;\n };\n /** Relative/current value configuration with value and color */\n relative: {\n value: number;\n color: string;\n };\n /** Height of the histogram bar in pixels */\n barHeight?: number;\n /** Width of the histogram bar in pixels */\n barWidth?: number;\n /** Orientation of the histogram - 'vertical' or 'horizontal' */\n orientation?: 'vertical' | 'horizontal';\n /** Corner radius configuration for individual corners */\n cornerRadius?: {\n topLeft?: number;\n topRight?: number;\n bottomLeft?: number;\n bottomRight?: number;\n };\n /** Child components (typically text content) */\n children?: React.ReactNode;\n}\n\nexport const Histogram: React.FC<HistogramProps> = ({\n max,\n relative,\n barHeight = 103,\n barWidth = 32,\n orientation = 'vertical',\n cornerRadius,\n children,\n}) => {\n const [animatedHeight, setAnimatedHeight] = useState(0);\n const [animatedWidth, setAnimatedWidth] = useState(0);\n\n // Calculate target dimensions based on orientation\n const targetHeight = (Math.min((relative.value / max.value) * 100, 100) / 100) * barHeight;\n const targetWidth = (Math.min((relative.value / max.value) * 100, 100) / 100) * barWidth;\n\n // Simple Chart.js-like animation: always animate from 0 to target\n useEffect(() => {\n setAnimatedHeight(0);\n setAnimatedWidth(0);\n \n const startTime = Date.now();\n const duration = 1000;\n\n const animate = () => {\n const elapsed = Date.now() - startTime;\n const progress = Math.min(elapsed / duration, 1);\n\n // Chart.js-like easing (easeOutQuart)\n const easeOutQuart = 1 - Math.pow(1 - progress, 4);\n \n setAnimatedHeight(targetHeight * easeOutQuart);\n setAnimatedWidth(targetWidth * easeOutQuart);\n\n if (progress < 1) {\n requestAnimationFrame(animate);\n }\n };\n\n requestAnimationFrame(animate);\n }, [targetHeight, targetWidth]);\n\n const displayWidth = orientation === 'horizontal' ? barHeight : barWidth;\n const displayHeight = orientation === 'horizontal' ? barWidth : barHeight;\n const svgWidth = orientation === 'horizontal' ? barHeight : barWidth;\n const svgHeight = orientation === 'horizontal' ? barWidth : barHeight;\n\n // Helper function to create rounded rectangle path\n const createRoundedRectPath = (\n x: number,\n y: number,\n width: number,\n height: number,\n radii: { topLeft: number; topRight: number; bottomLeft: number; bottomRight: number }\n ) => {\n const { topLeft, topRight, bottomLeft, bottomRight } = radii;\n \n return `\n M ${x + topLeft} ${y}\n L ${x + width - topRight} ${y}\n Q ${x + width} ${y} ${x + width} ${y + topRight}\n L ${x + width} ${y + height - bottomRight}\n Q ${x + width} ${y + height} ${x + width - bottomRight} ${y + height}\n L ${x + bottomLeft} ${y + height}\n Q ${x} ${y + height} ${x} ${y + height - bottomLeft}\n L ${x} ${y + topLeft}\n Q ${x} ${y} ${x + topLeft} ${y}\n Z\n `.trim().replace(/\\s+/g, ' ');\n };\n\n // Default corner radius values\n const defaultCornerRadius = { topLeft: 2, topRight: 2, bottomLeft: 2, bottomRight: 2 };\n const corners = cornerRadius ? {\n topLeft: cornerRadius.topLeft ?? defaultCornerRadius.topLeft,\n topRight: cornerRadius.topRight ?? defaultCornerRadius.topRight,\n bottomLeft: cornerRadius.bottomLeft ?? defaultCornerRadius.bottomLeft,\n bottomRight: cornerRadius.bottomRight ?? defaultCornerRadius.bottomRight,\n } : defaultCornerRadius;\n\n return (\n <div className={`histogram-container ${orientation === 'horizontal' ? 'histogram-container--horizontal' : ''}`}>\n <div className={`histogram-content ${orientation === 'horizontal' ? 'histogram-content--horizontal' : ''}`}>\n <div \n className=\"histogram-bar\"\n style={{\n height: `${displayHeight}px`,\n width: `${displayWidth}px`\n }}\n >\n <svg\n width={svgWidth}\n height={svgHeight}\n viewBox={`0 0 ${svgWidth} ${svgHeight}`}\n className=\"histogram-svg\"\n >\n {/* Background bar (max value) */}\n <path\n d={createRoundedRectPath(0, 0, svgWidth, svgHeight, corners)}\n fill={max.color}\n fillOpacity={max.opacity || 1}\n />\n {/* Foreground bar (relative value) with animation */}\n {orientation === 'vertical' ? (\n <path\n d={createRoundedRectPath(\n 0,\n svgHeight - animatedHeight,\n svgWidth,\n animatedHeight,\n {\n topLeft: animatedHeight >= svgHeight ? corners.topLeft : 0,\n topRight: animatedHeight >= svgHeight ? corners.topRight : 0,\n bottomLeft: corners.bottomLeft,\n bottomRight: corners.bottomRight,\n }\n )}\n fill={relative.color}\n />\n ) : (\n <path\n d={createRoundedRectPath(\n 0,\n 0,\n animatedWidth,\n svgHeight,\n {\n topLeft: corners.topLeft,\n topRight: animatedWidth >= svgWidth ? corners.topRight : 0,\n bottomLeft: corners.bottomLeft,\n bottomRight: animatedWidth >= svgWidth ? corners.bottomRight : 0,\n }\n )}\n fill={relative.color}\n />\n )}\n </svg>\n </div>\n {children && (\n <div className={`histogram-text-container ${orientation === 'horizontal' ? 'histogram-text-container--horizontal' : ''}`}>\n {children}\n </div>\n )}\n </div>\n </div>\n );\n};\n","import React from \"react\";\nimport \"./Avatar.css\";\n\ninterface AvatarProps {\n children: React.ReactNode;\n}\n\nexport const Avatar: React.FC<AvatarProps> = ({ children }) => {\n return (\n <div className=\"avatar-container avatar-container--clickable\">\n <div className=\"avatar-content\">{children}</div>\n </div>\n );\n};\n"],"names":["Input","_a","label","_b","value","onChange","_c","type","_d","disabled","_e","className","_f","required","_g","min","_h","max","_j","useState","internalValue","setInternalValue","_k","isFocused","setIsFocused","inputRef","useRef","useEffect","containerClasses","length","filter","Boolean","join","_jsx","children","_jsxs","ref","e","newValue","target","onFocus","onBlur","ImgOn","isOff","width","height","viewBox","fill","xmlns","d","SwitchThumb","cx","cy","r","Switch","checked","showIcon","internalChecked","setInternalChecked","switchClasses","role","onClick","newChecked","Chip","bgColor","textColor","chipClasses","style","backgroundColor","color","ProductionUnit","onChangeInput","onChangeSwitch","defaultValue","defaultChecked","unitName","energyCost","checkedImage","uncheckedImage","readonly","concat","val","numValue","Number","undefined","toString","Histogram","relative","barHeight","barWidth","orientation","cornerRadius","animatedHeight","setAnimatedHeight","animatedWidth","setAnimatedWidth","targetHeight","Math","targetWidth","startTime","Date","now","animate","elapsed","progress","easeOutQuart","pow","requestAnimationFrame","displayWidth","displayHeight","svgWidth","svgHeight","createRoundedRectPath","x","y","radii","topLeft","topRight","bottomLeft","bottomRight","trim","replace","defaultCornerRadius","corners","fillOpacity","opacity","Avatar"],"mappings":"8GAeO,IAAMA,EAA8B,SAACC,GAC1C,IAAAC,EAAKD,EAAAC,MACLC,EAAUF,EAAAG,MAAVA,OAAQ,IAAAD,EAAA,GAAEA,EACVE,EAAQJ,EAAAI,SACRC,EAAAL,EAAAM,KAAAA,OAAI,IAAAD,EAAG,OAAMA,EACbE,EAAAP,EAAAQ,SAAAA,cAAgBD,EAChBE,EAAAT,EAAAU,UAAAA,OAAY,IAAAD,EAAA,KACZE,EAAAX,EAAAY,SAAAA,OAAW,IAAAD,GAAKA,EAChBE,QAAAC,OAAM,IAAAD,EAAA,CAAEV,MAAO,EAAGF,MAAO,QAAQY,EACjCE,EAAAf,EAAAgB,IAAAA,aAAM,CAAEb,MAAO,IAAKF,MAAO,QAAQc,EAE7BE,EAAoCC,EAASf,GAA5CgB,EAAaF,EAAA,GAAEG,EAAgBH,EAAA,GAChCI,EAA4BH,GAAS,GAApCI,EAASD,EAAA,GAAEE,EAAYF,EAAA,GACxBG,EAAWC,EAAyB,MAE1CC,EAAU,WACRN,EAAiBjB,EACnB,EAAG,CAACA,IAEJ,IAgBMwB,EAAmB,CACvB,kBACAL,EAAY,2BAA6B,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,gCAAkC,cACpGzD,EACE,MAAA,CAAAtB,UAAU,gBACVwD,MAAO,CACLtB,OAAQ,GAAGmC,OAAA6B,EAAiB,MAC5BjE,MAAO,GAAGoC,OAAA4B,EAAgB,OAC3B1E,SAEDC,EACE,MAAA,CAAAS,MAAOkE,EACPjE,OAAQkE,EACRjE,QAAS,OAAAkC,OAAO8B,EAAQ,KAAA9B,OAAI+B,GAC5BpG,UAAU,gBAAeuB,SAAA,CAGzBD,EACE,OAAA,CAAAgB,EAAG+D,EAAsB,EAAG,EAAGF,EAAUC,EAAWY,GACpD5E,KAAM9B,EAAIoD,MACVuD,YAAa3G,EAAI4G,SAAW,IAI5B5F,EAAA,OADe,aAAhByD,EACC,CACEzC,EAAG+D,EACD,EACAD,EAAYnB,EACZkB,EACAlB,EACA,CACEwB,QAASxB,GAAkBmB,EAAYY,EAAQP,QAAU,EACzDC,SAAUzB,GAAkBmB,EAAYY,EAAQN,SAAW,EAC3DC,WAAYK,EAAQL,WACpBC,YAAaI,EAAQJ,cAGzBxE,KAAMwC,EAASlB,QAIfpB,EAAG+D,EACD,EACA,EACAlB,EACAiB,EACA,CACEK,QAASO,EAAQP,QACjBC,SAAUvB,GAAiBgB,EAAWa,EAAQN,SAAW,EACzDC,WAAYK,EAAQL,WACpBC,YAAazB,GAAiBgB,EAAWa,EAAQJ,YAAc,IAGnExE,KAAMwC,EAASlB,aAKtBnC,GACCD,EAAA,MAAA,CAAKtB,UAAW,4BAAAqE,OAA4C,eAAhBU,EAA+B,uCAAyC,aACjHxD,QAMb,EC3Ka4F,EAAgC,SAAC7H,GAAE,IAAAiC,EAAQjC,EAAAiC,SACtD,OACED,EAAA,MAAA,CAAKtB,UAAU,+CACbuB,SAAAD,EAAA,MAAA,CAAKtB,UAAU,iBAAkBuB,SAAAA,KAGvC"}
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../src/components/Input.tsx","../src/components/Switch.tsx","../src/components/Chip.tsx","../src/components/ProductionUnit.tsx","../src/components/Histogram.tsx","../src/components/Avatar.tsx"],"sourcesContent":["import React, { useState, useRef, useEffect } from \"react\";\nimport \"./Input.css\";\n\ninterface InputProps {\n label: string;\n value?: string;\n onChange?: (value: string) => void;\n type?: \"text\" | \"number\";\n disabled?: boolean;\n className?: string;\n required?: boolean;\n min?: { value: number; label?: string };\n max?: { value: number; label?: string };\n}\n\nexport const Input: React.FC<InputProps> = ({\n label,\n value = \"\",\n onChange,\n type = \"text\",\n disabled = false,\n className = \"\",\n required = false,\n min = { value: 0, label: \"Pmin\" },\n max = { value: 100, label: \"Pmax\" },\n}) => {\n const [internalValue, setInternalValue] = useState(value);\n const [isFocused, setIsFocused] = useState(false);\n const inputRef = useRef<HTMLInputElement>(null);\n\n useEffect(() => {\n setInternalValue(value);\n }, [value]);\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const newValue = e.target.value;\n setInternalValue(newValue);\n onChange?.(newValue);\n };\n\n const handleFocus = () => {\n setIsFocused(true);\n };\n\n const handleBlur = () => {\n setIsFocused(false);\n };\n\n const isLabelFloating = isFocused || internalValue.length > 0;\n\n const containerClasses = [\n \"input-container\",\n isFocused ? \"input-container--focused\" : \"\",\n isLabelFloating ? \"input-container--floating\" : \"\",\n disabled ? \"input-container--disabled\" : \"\",\n className,\n ]\n .filter(Boolean)\n .join(\" \");\n\n return (\n <div className={containerClasses}>\n <div className=\"input-constraints\">\n <div className=\"input-min\">\n {min.label}\n <br />\n {min.value}\n </div>\n\n <div className=\"input-field\">\n <input\n ref={inputRef}\n type={type}\n value={internalValue}\n onChange={handleChange}\n onFocus={handleFocus}\n onBlur={handleBlur}\n disabled={disabled}\n required={required}\n className=\"input-element\"\n aria-label={label}\n />\n <label className=\"input-label\">\n {label}\n {required && <span className=\"input-required\">*</span>}\n </label>\n </div>\n <div className=\"input-max\">\n {max.label}\n <br /> {max.value}\n </div>\n </div>\n </div>\n );\n};\n","import React, { useState } from \"react\";\nimport \"./Switch.css\";\n\ninterface OnProps {\n isOff?: boolean;\n}\nconst ImgOn = ({ isOff }: OnProps) => (\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M9.56529 2.85352C9.66365 2.57607 9.96837 2.43116 10.246 2.5293C13.4295 3.65507 15.3392 6.91015 14.7684 10.2383C14.1974 13.5667 11.3114 16 7.93443 16C4.55739 16 1.67151 13.5667 1.10045 10.2383C0.5296 6.91011 2.4393 3.65504 5.62291 2.5293C5.9005 2.43115 6.20523 2.57605 6.30357 2.85352C6.40176 3.13124 6.2561 3.43599 5.97838 3.53418C3.28438 4.48672 1.669 7.2423 2.1522 10.0586C2.63557 12.8747 5.07706 14.9336 7.93443 14.9336C10.7918 14.9336 13.2333 12.8747 13.7167 10.0586C14.1999 7.24233 12.5844 4.48676 9.89049 3.53418C9.61276 3.43599 9.4671 3.13124 9.56529 2.85352ZM7.93443 0C8.22892 3.10447e-05 8.46754 0.238727 8.46763 0.533203V7.4668C8.46763 7.76135 8.22898 8.00095 7.93443 8.00098C7.63986 8.00098 7.40123 7.76137 7.40123 7.4668V0.533203C7.40132 0.238707 7.63991 0 7.93443 0Z\"\n fill={isOff ? \"#999FA1\" : \"#009CDF\"}\n />\n </svg>\n);\nconst SwitchThumb = ({ isOff }: OnProps) => (\n <svg\n width=\"32\"\n height=\"32\"\n viewBox=\"0 0 32 32\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle cx=\"16\" cy=\"16\" r=\"16\" fill={isOff ? \"white\" : \"#009cdf\"} />\n </svg>\n);\n\ninterface SwitchProps {\n checked?: boolean;\n onChange?: (checked: boolean) => void;\n disabled?: boolean;\n showIcon?: boolean;\n}\n\nexport const Switch: React.FC<SwitchProps> = ({\n checked = false,\n onChange,\n disabled = false,\n showIcon = true,\n}) => {\n const [internalChecked, setInternalChecked] = useState(checked);\n\n const handleToggle = () => {\n if (disabled) return;\n\n const newChecked = !internalChecked;\n setInternalChecked(newChecked);\n onChange?.(newChecked);\n };\n\n const switchClasses = [\n \"switch\",\n internalChecked ? \"switch--checked\" : \"\",\n disabled ? \"switch--disabled\" : \"\",\n ]\n .filter(Boolean)\n .join(\" \");\n\n return (\n <div className=\"switch-container\">\n <div className=\"switch-wrapper\">\n {showIcon && (\n <div className=\"switch-icon\">\n <ImgOn isOff={!internalChecked} />\n </div>\n )}\n <button\n type=\"button\"\n role=\"switch\"\n aria-checked={internalChecked}\n className={switchClasses}\n onClick={handleToggle}\n disabled={disabled}\n >\n <span className=\"switch-track\">\n <span className=\"switch-thumb\">\n <SwitchThumb isOff={!internalChecked} />\n </span>\n </span>\n </button>\n </div>\n </div>\n );\n};\n","import React from \"react\";\nimport \"./Chip.css\";\n\ninterface ChipProps {\n // Define any props you want to pass to the Chip component\n label?: string;\n bgColor?: string;\n textColor?: string;\n width?: \"fit-content\" | \"full-width\";\n}\n\nexport const Chip: React.FC<ChipProps> = ({ \n label, \n bgColor, \n textColor, \n width = \"fit-content\" \n}) => {\n const chipClasses = [\n \"chip-container\",\n width === \"full-width\" ? \"chip-container--full-width\" : \"chip-container--fit-content\"\n ].join(\" \");\n\n return (\n <div className={chipClasses} style={{ backgroundColor: bgColor }}>\n <div className=\"chip-content\">\n <p className=\"chip-label\" style={{ color: textColor }}>\n {label}\n </p>\n </div>\n </div>\n );\n};\n","import { useState } from \"react\";\nimport { Input } from \"./Input\";\nimport { Switch } from \"./Switch\";\nimport \"./ProductionUnit.css\";\nimport { Chip } from \"./Chip\";\n\ninterface ProductionUnitProps {\n onChangeInput?: (value: number) => void;\n onChangeSwitch?: (checked: boolean) => void;\n defaultValue?: number;\n defaultChecked?: boolean;\n value?: number;\n checked?: boolean;\n unitName?: string;\n energyCost?: number;\n checkedImage?: React.ReactNode;\n uncheckedImage?: React.ReactNode;\n readonly?: boolean;\n}\nexport const ProductionUnit = ({\n onChangeInput,\n onChangeSwitch,\n defaultValue,\n defaultChecked = false,\n value,\n checked,\n unitName = \"Production Unit\",\n energyCost = 0,\n checkedImage,\n uncheckedImage,\n readonly = false,\n}: ProductionUnitProps) => {\n // Internal state management for uncontrolled mode\n const [internalChecked, setInternalChecked] = useState(defaultChecked);\n const [internalValue, setInternalValue] = useState(defaultValue);\n\n // Use controlled props if provided, otherwise use internal state\n const isChecked = checked !== undefined ? checked : internalChecked;\n const currentValue = value !== undefined ? value : internalValue;\n\n const handleSwitchChange = (newChecked: boolean) => {\n // Update internal state only if uncontrolled\n if (checked === undefined) {\n setInternalChecked(newChecked);\n }\n\n // Notify parent component if handler provided\n if (onChangeSwitch) {\n onChangeSwitch(newChecked);\n }\n };\n\n const handleInputChange = (val: string) => {\n const numValue = Number(val);\n // Update internal state only if uncontrolled\n if (value === undefined) {\n setInternalValue(numValue);\n }\n\n // Notify parent component if handler provided\n if (onChangeInput) {\n onChangeInput(numValue);\n }\n };\n\n return (\n <div className=\"production-unit-container\">\n <div className=\"production-unit-content\">\n <div className=\"image-preview-container\">\n {isChecked ? checkedImage : uncheckedImage}\n </div>\n <div className=\"production-unit-chip\">\n <div className=\"production-unit-chip-name\">{unitName}</div>\n\n <Chip\n label={`${energyCost} MW`}\n width=\"fit-content\"\n bgColor=\"#E1F5FD\"\n textColor=\"#005896\"\n />\n </div>\n <div className=\"production-unit-switch-container\">\n <Input\n label=\"PA\"\n type=\"number\"\n onChange={handleInputChange}\n value={\n currentValue !== undefined ? currentValue.toString() : undefined\n }\n disabled={!isChecked || readonly}\n />{\" \"}\n </div>\n </div>\n\n <Switch\n checked={isChecked}\n onChange={handleSwitchChange}\n disabled={readonly}\n />\n </div>\n );\n};\n","import React, { useEffect, useState } from \"react\";\nimport \"./Histogram.css\";\n\ninterface HistogramProps {\n /** Maximum value configuration with value and color */\n max: {\n value: number;\n color: string;\n opacity?: number;\n };\n /** Relative/current value configuration with value and color */\n relative: {\n value: number;\n color: string;\n };\n /** Height of the histogram bar in pixels */\n barHeight?: number;\n /** Width of the histogram bar in pixels */\n barWidth?: number;\n /** Orientation of the histogram - 'vertical' or 'horizontal' */\n orientation?: 'vertical' | 'horizontal';\n /** Corner radius configuration for individual corners */\n cornerRadius?: {\n topLeft?: number;\n topRight?: number;\n bottomLeft?: number;\n bottomRight?: number;\n };\n /** Child components (typically text content) */\n children?: React.ReactNode;\n}\n\nexport const Histogram: React.FC<HistogramProps> = ({\n max,\n relative,\n barHeight = 103,\n barWidth = 32,\n orientation = 'vertical',\n cornerRadius,\n children,\n}) => {\n const [animatedHeight, setAnimatedHeight] = useState(0);\n const [animatedWidth, setAnimatedWidth] = useState(0);\n\n // Calculate target dimensions based on orientation\n const targetHeight = (Math.min((relative.value / max.value) * 100, 100) / 100) * barHeight;\n const targetWidth = (Math.min((relative.value / max.value) * 100, 100) / 100) * barWidth;\n\n // Simple Chart.js-like animation: always animate from 0 to target\n useEffect(() => {\n setAnimatedHeight(0);\n setAnimatedWidth(0);\n \n const startTime = Date.now();\n const duration = 1000;\n\n const animate = () => {\n const elapsed = Date.now() - startTime;\n const progress = Math.min(elapsed / duration, 1);\n\n // Chart.js-like easing (easeOutQuart)\n const easeOutQuart = 1 - Math.pow(1 - progress, 4);\n \n setAnimatedHeight(targetHeight * easeOutQuart);\n setAnimatedWidth(targetWidth * easeOutQuart);\n\n if (progress < 1) {\n requestAnimationFrame(animate);\n }\n };\n\n requestAnimationFrame(animate);\n }, [targetHeight, targetWidth]);\n\n const displayWidth = orientation === 'horizontal' ? barHeight : barWidth;\n const displayHeight = orientation === 'horizontal' ? barWidth : barHeight;\n const svgWidth = orientation === 'horizontal' ? barHeight : barWidth;\n const svgHeight = orientation === 'horizontal' ? barWidth : barHeight;\n\n // Helper function to create rounded rectangle path\n const createRoundedRectPath = (\n x: number,\n y: number,\n width: number,\n height: number,\n radii: { topLeft: number; topRight: number; bottomLeft: number; bottomRight: number }\n ) => {\n const { topLeft, topRight, bottomLeft, bottomRight } = radii;\n \n return `\n M ${x + topLeft} ${y}\n L ${x + width - topRight} ${y}\n Q ${x + width} ${y} ${x + width} ${y + topRight}\n L ${x + width} ${y + height - bottomRight}\n Q ${x + width} ${y + height} ${x + width - bottomRight} ${y + height}\n L ${x + bottomLeft} ${y + height}\n Q ${x} ${y + height} ${x} ${y + height - bottomLeft}\n L ${x} ${y + topLeft}\n Q ${x} ${y} ${x + topLeft} ${y}\n Z\n `.trim().replace(/\\s+/g, ' ');\n };\n\n // Default corner radius values\n const defaultCornerRadius = { topLeft: 2, topRight: 2, bottomLeft: 2, bottomRight: 2 };\n const corners = cornerRadius ? {\n topLeft: cornerRadius.topLeft ?? defaultCornerRadius.topLeft,\n topRight: cornerRadius.topRight ?? defaultCornerRadius.topRight,\n bottomLeft: cornerRadius.bottomLeft ?? defaultCornerRadius.bottomLeft,\n bottomRight: cornerRadius.bottomRight ?? defaultCornerRadius.bottomRight,\n } : defaultCornerRadius;\n\n return (\n <div className={`histogram-container ${orientation === 'horizontal' ? 'histogram-container--horizontal' : ''}`}>\n <div className={`histogram-content ${orientation === 'horizontal' ? 'histogram-content--horizontal' : ''}`}>\n <div \n className=\"histogram-bar\"\n style={{\n height: `${displayHeight}px`,\n width: `${displayWidth}px`\n }}\n >\n <svg\n width={svgWidth}\n height={svgHeight}\n viewBox={`0 0 ${svgWidth} ${svgHeight}`}\n className=\"histogram-svg\"\n >\n {/* Background bar (max value) */}\n <path\n d={createRoundedRectPath(0, 0, svgWidth, svgHeight, corners)}\n fill={max.color}\n fillOpacity={max.opacity || 1}\n />\n {/* Foreground bar (relative value) with animation */}\n {orientation === 'vertical' ? (\n <path\n d={createRoundedRectPath(\n 0,\n svgHeight - animatedHeight,\n svgWidth,\n animatedHeight,\n {\n topLeft: animatedHeight >= svgHeight ? corners.topLeft : 0,\n topRight: animatedHeight >= svgHeight ? corners.topRight : 0,\n bottomLeft: corners.bottomLeft,\n bottomRight: corners.bottomRight,\n }\n )}\n fill={relative.color}\n />\n ) : (\n <path\n d={createRoundedRectPath(\n 0,\n 0,\n animatedWidth,\n svgHeight,\n {\n topLeft: corners.topLeft,\n topRight: animatedWidth >= svgWidth ? corners.topRight : 0,\n bottomLeft: corners.bottomLeft,\n bottomRight: animatedWidth >= svgWidth ? corners.bottomRight : 0,\n }\n )}\n fill={relative.color}\n />\n )}\n </svg>\n </div>\n {children && (\n <div className={`histogram-text-container ${orientation === 'horizontal' ? 'histogram-text-container--horizontal' : ''}`}>\n {children}\n </div>\n )}\n </div>\n </div>\n );\n};\n","import React from \"react\";\nimport \"./Avatar.css\";\n\ninterface AvatarProps {\n children: React.ReactNode;\n}\n\nexport const Avatar: React.FC<AvatarProps> = ({ children }) => {\n return (\n <div className=\"avatar-container avatar-container--clickable\">\n <div className=\"avatar-content\">{children}</div>\n </div>\n );\n};\n"],"names":["Input","_a","label","_b","value","onChange","_c","type","_d","disabled","_e","className","_f","required","_g","min","_h","max","_j","useState","internalValue","setInternalValue","_k","isFocused","setIsFocused","inputRef","useRef","useEffect","containerClasses","length","filter","Boolean","join","_jsx","children","_jsxs","ref","e","newValue","target","onFocus","onBlur","ImgOn","isOff","width","height","viewBox","fill","xmlns","d","SwitchThumb","cx","cy","r","Switch","checked","showIcon","internalChecked","setInternalChecked","switchClasses","role","onClick","newChecked","Chip","bgColor","textColor","chipClasses","style","backgroundColor","color","ProductionUnit","onChangeInput","onChangeSwitch","defaultValue","defaultChecked","unitName","energyCost","checkedImage","uncheckedImage","readonly","isChecked","undefined","currentValue","concat","val","numValue","Number","toString","Histogram","relative","barHeight","barWidth","orientation","cornerRadius","animatedHeight","setAnimatedHeight","animatedWidth","setAnimatedWidth","targetHeight","Math","targetWidth","startTime","Date","now","animate","elapsed","progress","easeOutQuart","pow","requestAnimationFrame","displayWidth","displayHeight","svgWidth","svgHeight","createRoundedRectPath","x","y","radii","topLeft","topRight","bottomLeft","bottomRight","trim","replace","defaultCornerRadius","corners","fillOpacity","opacity","Avatar"],"mappings":"8GAeO,IAAMA,EAA8B,SAACC,GAC1C,IAAAC,EAAKD,EAAAC,MACLC,EAAUF,EAAAG,MAAVA,OAAQ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AW,IAI5B9F,EAAA,OADe,aAAhB2D,EACC,CACE3C,EAAGiE,EACD,EACAD,EAAYnB,EACZkB,EACAlB,EACA,CACEwB,QAASxB,GAAkBmB,EAAYY,EAAQP,QAAU,EACzDC,SAAUzB,GAAkBmB,EAAYY,EAAQN,SAAW,EAC3DC,WAAYK,EAAQL,WACpBC,YAAaI,EAAQJ,cAGzB1E,KAAM0C,EAASpB,QAIfpB,EAAGiE,EACD,EACA,EACAlB,EACAiB,EACA,CACEK,QAASO,EAAQP,QACjBC,SAAUvB,GAAiBgB,EAAWa,EAAQN,SAAW,EACzDC,WAAYK,EAAQL,WACpBC,YAAazB,GAAiBgB,EAAWa,EAAQJ,YAAc,IAGnE1E,KAAM0C,EAASpB,aAKtBnC,GACCD,EAAA,MAAA,CAAKtB,UAAW,4BAAAwE,OAA4C,eAAhBS,EAA+B,uCAAyC,aACjH1D,QAMb,EC3Ka8F,EAAgC,SAAC/H,GAAE,IAAAiC,EAAQjC,EAAAiC,SACtD,OACED,EAAA,MAAA,CAAKtB,UAAU,+CACbuB,SAAAD,EAAA,MAAA,CAAKtB,UAAU,iBAAkBuB,SAAAA,KAGvC"}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var t=require("react/jsx-runtime"),i=require("react"),
|
|
1
|
+
"use strict";var t=require("react/jsx-runtime"),i=require("react"),e=function(e){var n=e.label,o=e.value,a=void 0===o?"":o,c=e.onChange,s=e.type,l=void 0===s?"text":s,r=e.disabled,d=void 0!==r&&r,h=e.className,u=void 0===h?"":h,v=e.required,m=void 0!==v&&v,p=e.min,f=void 0===p?{value:0,label:"Pmin"}:p,x=e.max,g=void 0===x?{value:100,label:"Pmax"}:x,b=i.useState(a),j=b[0],w=b[1],C=i.useState(!1),N=C[0],L=C[1],R=i.useRef(null);i.useEffect(function(){w(a)},[a]);var k=["input-container",N?"input-container--focused":"",N||j.length>0?"input-container--floating":"",d?"input-container--disabled":"",u].filter(Boolean).join(" ");return t.jsx("div",{className:k,children:t.jsxs("div",{className:"input-constraints",children:[t.jsxs("div",{className:"input-min",children:[f.label,t.jsx("br",{}),f.value]}),t.jsxs("div",{className:"input-field",children:[t.jsx("input",{ref:R,type:l,value:j,onChange:function(t){var i=t.target.value;w(i),null==c||c(i)},onFocus:function(){L(!0)},onBlur:function(){L(!1)},disabled:d,required:m,className:"input-element","aria-label":n}),t.jsxs("label",{className:"input-label",children:[n,m&&t.jsx("span",{className:"input-required",children:"*"})]})]}),t.jsxs("div",{className:"input-max",children:[g.label,t.jsx("br",{})," ",g.value]})]})})},n=function(i){var e=i.isOff;return t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{d:"M9.56529 2.85352C9.66365 2.57607 9.96837 2.43116 10.246 2.5293C13.4295 3.65507 15.3392 6.91015 14.7684 10.2383C14.1974 13.5667 11.3114 16 7.93443 16C4.55739 16 1.67151 13.5667 1.10045 10.2383C0.5296 6.91011 2.4393 3.65504 5.62291 2.5293C5.9005 2.43115 6.20523 2.57605 6.30357 2.85352C6.40176 3.13124 6.2561 3.43599 5.97838 3.53418C3.28438 4.48672 1.669 7.2423 2.1522 10.0586C2.63557 12.8747 5.07706 14.9336 7.93443 14.9336C10.7918 14.9336 13.2333 12.8747 13.7167 10.0586C14.1999 7.24233 12.5844 4.48676 9.89049 3.53418C9.61276 3.43599 9.4671 3.13124 9.56529 2.85352ZM7.93443 0C8.22892 3.10447e-05 8.46754 0.238727 8.46763 0.533203V7.4668C8.46763 7.76135 8.22898 8.00095 7.93443 8.00098C7.63986 8.00098 7.40123 7.76137 7.40123 7.4668V0.533203C7.40132 0.238707 7.63991 0 7.93443 0Z",fill:e?"#999FA1":"#009CDF"})})},o=function(i){var e=i.isOff;return t.jsx("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("circle",{cx:"16",cy:"16",r:"16",fill:e?"white":"#009cdf"})})},a=function(e){var a=e.checked,c=void 0!==a&&a,s=e.onChange,l=e.disabled,r=void 0!==l&&l,d=e.showIcon,h=void 0===d||d,u=i.useState(c),v=u[0],m=u[1],p=["switch",v?"switch--checked":"",r?"switch--disabled":""].filter(Boolean).join(" ");return t.jsx("div",{className:"switch-container",children:t.jsxs("div",{className:"switch-wrapper",children:[h&&t.jsx("div",{className:"switch-icon",children:t.jsx(n,{isOff:!v})}),t.jsx("button",{type:"button",role:"switch","aria-checked":v,className:p,onClick:function(){if(!r){var t=!v;m(t),null==s||s(t)}},disabled:r,children:t.jsx("span",{className:"switch-track",children:t.jsx("span",{className:"switch-thumb",children:t.jsx(o,{isOff:!v})})})})]})})},c=function(i){var e=i.label,n=i.bgColor,o=i.textColor,a=i.width,c=["chip-container","full-width"===(void 0===a?"fit-content":a)?"chip-container--full-width":"chip-container--fit-content"].join(" ");return t.jsx("div",{className:c,style:{backgroundColor:n},children:t.jsx("div",{className:"chip-content",children:t.jsx("p",{className:"chip-label",style:{color:o},children:e})})})};exports.Avatar=function(i){var e=i.children;return t.jsx("div",{className:"avatar-container avatar-container--clickable",children:t.jsx("div",{className:"avatar-content",children:e})})},exports.Chip=c,exports.Histogram=function(e){var n,o,a,c,s=e.max,l=e.relative,r=e.barHeight,d=void 0===r?103:r,h=e.barWidth,u=void 0===h?32:h,v=e.orientation,m=void 0===v?"vertical":v,p=e.cornerRadius,f=e.children,x=i.useState(0),g=x[0],b=x[1],j=i.useState(0),w=j[0],C=j[1],N=Math.min(l.value/s.value*100,100)/100*d,L=Math.min(l.value/s.value*100,100)/100*u;i.useEffect(function(){b(0),C(0);var t=Date.now(),i=function(){var e=Date.now()-t,n=Math.min(e/1e3,1),o=1-Math.pow(1-n,4);b(N*o),C(L*o),n<1&&requestAnimationFrame(i)};requestAnimationFrame(i)},[N,L]);var R="horizontal"===m?d:u,k="horizontal"===m?u:d,y="horizontal"===m?d:u,z="horizontal"===m?u:d,S=function(t,i,e,n,o){var a=o.topLeft,c=o.topRight,s=o.bottomLeft,l=o.bottomRight;return"\n M ".concat(t+a," ").concat(i,"\n L ").concat(t+e-c," ").concat(i,"\n Q ").concat(t+e," ").concat(i," ").concat(t+e," ").concat(i+c,"\n L ").concat(t+e," ").concat(i+n-l,"\n Q ").concat(t+e," ").concat(i+n," ").concat(t+e-l," ").concat(i+n,"\n L ").concat(t+s," ").concat(i+n,"\n Q ").concat(t," ").concat(i+n," ").concat(t," ").concat(i+n-s,"\n L ").concat(t," ").concat(i+a,"\n Q ").concat(t," ").concat(i," ").concat(t+a," ").concat(i,"\n Z\n ").trim().replace(/\s+/g," ")},M={topLeft:2,topRight:2,bottomLeft:2,bottomRight:2},q=p?{topLeft:null!==(n=p.topLeft)&&void 0!==n?n:M.topLeft,topRight:null!==(o=p.topRight)&&void 0!==o?o:M.topRight,bottomLeft:null!==(a=p.bottomLeft)&&void 0!==a?a:M.bottomLeft,bottomRight:null!==(c=p.bottomRight)&&void 0!==c?c:M.bottomRight}:M;return t.jsx("div",{className:"histogram-container ".concat("horizontal"===m?"histogram-container--horizontal":""),children:t.jsxs("div",{className:"histogram-content ".concat("horizontal"===m?"histogram-content--horizontal":""),children:[t.jsx("div",{className:"histogram-bar",style:{height:"".concat(k,"px"),width:"".concat(R,"px")},children:t.jsxs("svg",{width:y,height:z,viewBox:"0 0 ".concat(y," ").concat(z),className:"histogram-svg",children:[t.jsx("path",{d:S(0,0,y,z,q),fill:s.color,fillOpacity:s.opacity||1}),"vertical"===m?t.jsx("path",{d:S(0,z-g,y,g,{topLeft:g>=z?q.topLeft:0,topRight:g>=z?q.topRight:0,bottomLeft:q.bottomLeft,bottomRight:q.bottomRight}),fill:l.color}):t.jsx("path",{d:S(0,0,w,z,{topLeft:q.topLeft,topRight:w>=y?q.topRight:0,bottomLeft:q.bottomLeft,bottomRight:w>=y?q.bottomRight:0}),fill:l.color})]})}),f&&t.jsx("div",{className:"histogram-text-container ".concat("horizontal"===m?"histogram-text-container--horizontal":""),children:f})]})})},exports.Input=e,exports.ProductionUnit=function(n){var o=n.onChangeInput,s=n.onChangeSwitch,l=n.defaultValue,r=n.defaultChecked,d=void 0!==r&&r,h=n.value,u=n.checked,v=n.unitName,m=void 0===v?"Production Unit":v,p=n.energyCost,f=void 0===p?0:p,x=n.checkedImage,g=n.uncheckedImage,b=n.readonly,j=void 0!==b&&b,w=i.useState(d),C=w[0],N=w[1],L=i.useState(l),R=L[0],k=L[1],y=void 0!==u?u:C,z=void 0!==h?h:R;return t.jsxs("div",{className:"production-unit-container",children:[t.jsxs("div",{className:"production-unit-content",children:[t.jsx("div",{className:"image-preview-container",children:y?x:g}),t.jsxs("div",{className:"production-unit-chip",children:[t.jsx("div",{className:"production-unit-chip-name",children:m}),t.jsx(c,{label:"".concat(f," MW"),width:"fit-content",bgColor:"#E1F5FD",textColor:"#005896"})]}),t.jsxs("div",{className:"production-unit-switch-container",children:[t.jsx(e,{label:"PA",type:"number",onChange:function(t){var i=Number(t);void 0===h&&k(i),o&&o(i)},value:void 0!==z?z.toString():void 0,disabled:!y||j})," "]})]}),t.jsx(a,{checked:y,onChange:function(t){void 0===u&&N(t),s&&s(t)},disabled:j})]})},exports.Switch=a;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/components/Input.tsx","../src/components/Switch.tsx","../src/components/Chip.tsx","../src/components/Avatar.tsx","../src/components/Histogram.tsx","../src/components/ProductionUnit.tsx"],"sourcesContent":["import React, { useState, useRef, useEffect } from \"react\";\nimport \"./Input.css\";\n\ninterface InputProps {\n label: string;\n value?: string;\n onChange?: (value: string) => void;\n type?: \"text\" | \"number\";\n disabled?: boolean;\n className?: string;\n required?: boolean;\n min?: { value: number; label?: string };\n max?: { value: number; label?: string };\n}\n\nexport const Input: React.FC<InputProps> = ({\n label,\n value = \"\",\n onChange,\n type = \"text\",\n disabled = false,\n className = \"\",\n required = false,\n min = { value: 0, label: \"Pmin\" },\n max = { value: 100, label: \"Pmax\" },\n}) => {\n const [internalValue, setInternalValue] = useState(value);\n const [isFocused, setIsFocused] = useState(false);\n const inputRef = useRef<HTMLInputElement>(null);\n\n useEffect(() => {\n setInternalValue(value);\n }, [value]);\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const newValue = e.target.value;\n setInternalValue(newValue);\n onChange?.(newValue);\n };\n\n const handleFocus = () => {\n setIsFocused(true);\n };\n\n const handleBlur = () => {\n setIsFocused(false);\n };\n\n const isLabelFloating = isFocused || internalValue.length > 0;\n\n const containerClasses = [\n \"input-container\",\n isFocused ? \"input-container--focused\" : \"\",\n isLabelFloating ? \"input-container--floating\" : \"\",\n disabled ? \"input-container--disabled\" : \"\",\n className,\n ]\n .filter(Boolean)\n .join(\" \");\n\n return (\n <div className={containerClasses}>\n <div className=\"input-constraints\">\n <div className=\"input-min\">\n {min.label}\n <br />\n {min.value}\n </div>\n\n <div className=\"input-field\">\n <input\n ref={inputRef}\n type={type}\n value={internalValue}\n onChange={handleChange}\n onFocus={handleFocus}\n onBlur={handleBlur}\n disabled={disabled}\n required={required}\n className=\"input-element\"\n aria-label={label}\n />\n <label className=\"input-label\">\n {label}\n {required && <span className=\"input-required\">*</span>}\n </label>\n </div>\n <div className=\"input-max\">\n {max.label}\n <br /> {max.value}\n </div>\n </div>\n </div>\n );\n};\n","import React, { useState } from \"react\";\nimport \"./Switch.css\";\n\ninterface OnProps {\n isOff?: boolean;\n}\nconst ImgOn = ({ isOff }: OnProps) => (\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M9.56529 2.85352C9.66365 2.57607 9.96837 2.43116 10.246 2.5293C13.4295 3.65507 15.3392 6.91015 14.7684 10.2383C14.1974 13.5667 11.3114 16 7.93443 16C4.55739 16 1.67151 13.5667 1.10045 10.2383C0.5296 6.91011 2.4393 3.65504 5.62291 2.5293C5.9005 2.43115 6.20523 2.57605 6.30357 2.85352C6.40176 3.13124 6.2561 3.43599 5.97838 3.53418C3.28438 4.48672 1.669 7.2423 2.1522 10.0586C2.63557 12.8747 5.07706 14.9336 7.93443 14.9336C10.7918 14.9336 13.2333 12.8747 13.7167 10.0586C14.1999 7.24233 12.5844 4.48676 9.89049 3.53418C9.61276 3.43599 9.4671 3.13124 9.56529 2.85352ZM7.93443 0C8.22892 3.10447e-05 8.46754 0.238727 8.46763 0.533203V7.4668C8.46763 7.76135 8.22898 8.00095 7.93443 8.00098C7.63986 8.00098 7.40123 7.76137 7.40123 7.4668V0.533203C7.40132 0.238707 7.63991 0 7.93443 0Z\"\n fill={isOff ? \"#999FA1\" : \"#009CDF\"}\n />\n </svg>\n);\nconst SwitchThumb = ({ isOff }: OnProps) => (\n <svg\n width=\"32\"\n height=\"32\"\n viewBox=\"0 0 32 32\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle cx=\"16\" cy=\"16\" r=\"16\" fill={isOff ? \"white\" : \"#009cdf\"} />\n </svg>\n);\n\ninterface SwitchProps {\n checked?: boolean;\n onChange?: (checked: boolean) => void;\n disabled?: boolean;\n showIcon?: boolean;\n}\n\nexport const Switch: React.FC<SwitchProps> = ({\n checked = false,\n onChange,\n disabled = false,\n showIcon = true,\n}) => {\n const [internalChecked, setInternalChecked] = useState(checked);\n\n const handleToggle = () => {\n if (disabled) return;\n\n const newChecked = !internalChecked;\n setInternalChecked(newChecked);\n onChange?.(newChecked);\n };\n\n const switchClasses = [\n \"switch\",\n internalChecked ? \"switch--checked\" : \"\",\n disabled ? \"switch--disabled\" : \"\",\n ]\n .filter(Boolean)\n .join(\" \");\n\n return (\n <div className=\"switch-container\">\n <div className=\"switch-wrapper\">\n {showIcon && (\n <div className=\"switch-icon\">\n <ImgOn isOff={!internalChecked} />\n </div>\n )}\n <button\n type=\"button\"\n role=\"switch\"\n aria-checked={internalChecked}\n className={switchClasses}\n onClick={handleToggle}\n disabled={disabled}\n >\n <span className=\"switch-track\">\n <span className=\"switch-thumb\">\n <SwitchThumb isOff={!internalChecked} />\n </span>\n </span>\n </button>\n </div>\n </div>\n );\n};\n","import React from \"react\";\nimport \"./Chip.css\";\n\ninterface ChipProps {\n // Define any props you want to pass to the Chip component\n label?: string;\n bgColor?: string;\n textColor?: string;\n width?: \"fit-content\" | \"full-width\";\n}\n\nexport const Chip: React.FC<ChipProps> = ({ \n label, \n bgColor, \n textColor, \n width = \"fit-content\" \n}) => {\n const chipClasses = [\n \"chip-container\",\n width === \"full-width\" ? \"chip-container--full-width\" : \"chip-container--fit-content\"\n ].join(\" \");\n\n return (\n <div className={chipClasses} style={{ backgroundColor: bgColor }}>\n <div className=\"chip-content\">\n <p className=\"chip-label\" style={{ color: textColor }}>\n {label}\n </p>\n </div>\n </div>\n );\n};\n","import React from \"react\";\nimport \"./Avatar.css\";\n\ninterface AvatarProps {\n children: React.ReactNode;\n}\n\nexport const Avatar: React.FC<AvatarProps> = ({ children }) => {\n return (\n <div className=\"avatar-container avatar-container--clickable\">\n <div className=\"avatar-content\">{children}</div>\n </div>\n );\n};\n","import React, { useEffect, useState } from \"react\";\nimport \"./Histogram.css\";\n\ninterface HistogramProps {\n /** Maximum value configuration with value and color */\n max: {\n value: number;\n color: string;\n opacity?: number;\n };\n /** Relative/current value configuration with value and color */\n relative: {\n value: number;\n color: string;\n };\n /** Height of the histogram bar in pixels */\n barHeight?: number;\n /** Width of the histogram bar in pixels */\n barWidth?: number;\n /** Orientation of the histogram - 'vertical' or 'horizontal' */\n orientation?: 'vertical' | 'horizontal';\n /** Corner radius configuration for individual corners */\n cornerRadius?: {\n topLeft?: number;\n topRight?: number;\n bottomLeft?: number;\n bottomRight?: number;\n };\n /** Child components (typically text content) */\n children?: React.ReactNode;\n}\n\nexport const Histogram: React.FC<HistogramProps> = ({\n max,\n relative,\n barHeight = 103,\n barWidth = 32,\n orientation = 'vertical',\n cornerRadius,\n children,\n}) => {\n const [animatedHeight, setAnimatedHeight] = useState(0);\n const [animatedWidth, setAnimatedWidth] = useState(0);\n\n // Calculate target dimensions based on orientation\n const targetHeight = (Math.min((relative.value / max.value) * 100, 100) / 100) * barHeight;\n const targetWidth = (Math.min((relative.value / max.value) * 100, 100) / 100) * barWidth;\n\n // Simple Chart.js-like animation: always animate from 0 to target\n useEffect(() => {\n setAnimatedHeight(0);\n setAnimatedWidth(0);\n \n const startTime = Date.now();\n const duration = 1000;\n\n const animate = () => {\n const elapsed = Date.now() - startTime;\n const progress = Math.min(elapsed / duration, 1);\n\n // Chart.js-like easing (easeOutQuart)\n const easeOutQuart = 1 - Math.pow(1 - progress, 4);\n \n setAnimatedHeight(targetHeight * easeOutQuart);\n setAnimatedWidth(targetWidth * easeOutQuart);\n\n if (progress < 1) {\n requestAnimationFrame(animate);\n }\n };\n\n requestAnimationFrame(animate);\n }, [targetHeight, targetWidth]);\n\n const displayWidth = orientation === 'horizontal' ? barHeight : barWidth;\n const displayHeight = orientation === 'horizontal' ? barWidth : barHeight;\n const svgWidth = orientation === 'horizontal' ? barHeight : barWidth;\n const svgHeight = orientation === 'horizontal' ? barWidth : barHeight;\n\n // Helper function to create rounded rectangle path\n const createRoundedRectPath = (\n x: number,\n y: number,\n width: number,\n height: number,\n radii: { topLeft: number; topRight: number; bottomLeft: number; bottomRight: number }\n ) => {\n const { topLeft, topRight, bottomLeft, bottomRight } = radii;\n \n return `\n M ${x + topLeft} ${y}\n L ${x + width - topRight} ${y}\n Q ${x + width} ${y} ${x + width} ${y + topRight}\n L ${x + width} ${y + height - bottomRight}\n Q ${x + width} ${y + height} ${x + width - bottomRight} ${y + height}\n L ${x + bottomLeft} ${y + height}\n Q ${x} ${y + height} ${x} ${y + height - bottomLeft}\n L ${x} ${y + topLeft}\n Q ${x} ${y} ${x + topLeft} ${y}\n Z\n `.trim().replace(/\\s+/g, ' ');\n };\n\n // Default corner radius values\n const defaultCornerRadius = { topLeft: 2, topRight: 2, bottomLeft: 2, bottomRight: 2 };\n const corners = cornerRadius ? {\n topLeft: cornerRadius.topLeft ?? defaultCornerRadius.topLeft,\n topRight: cornerRadius.topRight ?? defaultCornerRadius.topRight,\n bottomLeft: cornerRadius.bottomLeft ?? defaultCornerRadius.bottomLeft,\n bottomRight: cornerRadius.bottomRight ?? defaultCornerRadius.bottomRight,\n } : defaultCornerRadius;\n\n return (\n <div className={`histogram-container ${orientation === 'horizontal' ? 'histogram-container--horizontal' : ''}`}>\n <div className={`histogram-content ${orientation === 'horizontal' ? 'histogram-content--horizontal' : ''}`}>\n <div \n className=\"histogram-bar\"\n style={{\n height: `${displayHeight}px`,\n width: `${displayWidth}px`\n }}\n >\n <svg\n width={svgWidth}\n height={svgHeight}\n viewBox={`0 0 ${svgWidth} ${svgHeight}`}\n className=\"histogram-svg\"\n >\n {/* Background bar (max value) */}\n <path\n d={createRoundedRectPath(0, 0, svgWidth, svgHeight, corners)}\n fill={max.color}\n fillOpacity={max.opacity || 1}\n />\n {/* Foreground bar (relative value) with animation */}\n {orientation === 'vertical' ? (\n <path\n d={createRoundedRectPath(\n 0,\n svgHeight - animatedHeight,\n svgWidth,\n animatedHeight,\n {\n topLeft: animatedHeight >= svgHeight ? corners.topLeft : 0,\n topRight: animatedHeight >= svgHeight ? corners.topRight : 0,\n bottomLeft: corners.bottomLeft,\n bottomRight: corners.bottomRight,\n }\n )}\n fill={relative.color}\n />\n ) : (\n <path\n d={createRoundedRectPath(\n 0,\n 0,\n animatedWidth,\n svgHeight,\n {\n topLeft: corners.topLeft,\n topRight: animatedWidth >= svgWidth ? corners.topRight : 0,\n bottomLeft: corners.bottomLeft,\n bottomRight: animatedWidth >= svgWidth ? corners.bottomRight : 0,\n }\n )}\n fill={relative.color}\n />\n )}\n </svg>\n </div>\n {children && (\n <div className={`histogram-text-container ${orientation === 'horizontal' ? 'histogram-text-container--horizontal' : ''}`}>\n {children}\n </div>\n )}\n </div>\n </div>\n );\n};\n","import { useState } from \"react\";\nimport { Input } from \"./Input\";\nimport { Switch } from \"./Switch\";\nimport \"./ProductionUnit.css\";\nimport { Chip } from \"./Chip\";\n\ninterface ProductionUnitProps {\n onChangeInput?: (value: number) => void;\n onChangeSwitch?: (checked: boolean) => void;\n defaultValue?: number;\n defaultChecked?: boolean;\n unitName?: string;\n energyCost?: number;\n checkedImage?: React.ReactNode;\n uncheckedImage?: React.ReactNode;\n readonly?: boolean;\n}\nexport const ProductionUnit = ({\n onChangeInput,\n onChangeSwitch,\n defaultValue,\n defaultChecked = false,\n unitName = \"Production Unit\",\n energyCost = 0,\n checkedImage,\n uncheckedImage,\n readonly = false,\n}: ProductionUnitProps) => {\n // Internal state management\n const [internalChecked, setInternalChecked] = useState(defaultChecked);\n const [internalValue, setInternalValue] = useState(defaultValue);\n\n const handleSwitchChange = (newChecked: boolean) => {\n // Update internal state\n setInternalChecked(newChecked);\n\n // Notify parent component if handler provided\n if (onChangeSwitch) {\n onChangeSwitch(newChecked);\n }\n };\n\n const handleInputChange = (val: string) => {\n const numValue = Number(val);\n // Update internal state\n setInternalValue(numValue);\n\n // Notify parent component if handler provided\n if (onChangeInput) {\n onChangeInput(numValue);\n }\n };\n\n return (\n <div className=\"production-unit-container\">\n <div className=\"production-unit-content\">\n <div className=\"image-preview-container\">\n {internalChecked ? checkedImage : uncheckedImage}\n </div>\n <div className=\"production-unit-chip\">\n <div className=\"production-unit-chip-name\">{unitName}</div>\n\n <Chip\n label={`${energyCost} MW`}\n width=\"fit-content\"\n bgColor=\"#E1F5FD\"\n textColor=\"#005896\"\n />\n </div>\n <div className=\"production-unit-switch-container\">\n <Input\n label=\"PA\"\n type=\"number\"\n onChange={handleInputChange}\n value={\n internalValue !== undefined ? internalValue.toString() : undefined\n }\n disabled={!internalChecked || readonly}\n />{\" \"}\n </div>\n </div>\n\n <Switch\n checked={internalChecked}\n onChange={handleSwitchChange}\n disabled={readonly}\n />\n </div>\n );\n};\n"],"names":["Input","_a","label","_b","value","onChange","_c","type","_d","disabled","_e","className","_f","required","_g","min","_h","max","_j","useState","internalValue","setInternalValue","_k","isFocused","setIsFocused","inputRef","useRef","useEffect","containerClasses","length","filter","Boolean","join","_jsx","children","_jsxs","jsx","ref","e","newValue","target","onFocus","onBlur","jsxs","ImgOn","isOff","width","height","viewBox","fill","xmlns","d","SwitchThumb","cx","cy","r","Switch","checked","showIcon","internalChecked","setInternalChecked","switchClasses","role","onClick","newChecked","Chip","bgColor","textColor","chipClasses","style","backgroundColor","color","relative","barHeight","barWidth","orientation","cornerRadius","animatedHeight","setAnimatedHeight","animatedWidth","setAnimatedWidth","targetHeight","Math","targetWidth","startTime","Date","now","animate","elapsed","progress","easeOutQuart","pow","requestAnimationFrame","displayWidth","displayHeight","svgWidth","svgHeight","createRoundedRectPath","x","y","radii","topLeft","topRight","bottomLeft","bottomRight","concat","trim","replace","defaultCornerRadius","corners","fillOpacity","opacity","onChangeInput","onChangeSwitch","defaultValue","defaultChecked","unitName","energyCost","checkedImage","uncheckedImage","readonly","val","numValue","Number","undefined","toString"],"mappings":"mEAeaA,EAA8B,SAACC,GAC1C,IAAAC,EAAKD,EAAAC,MACLC,EAAUF,EAAAG,MAAVA,OAAQ,IAAAD,EAAA,GAAEA,EACVE,EAAQJ,EAAAI,SACRC,EAAAL,EAAAM,KAAAA,OAAI,IAAAD,EAAG,OAAMA,EACbE,EAAAP,EAAAQ,SAAAA,cAAgBD,EAChBE,EAAAT,EAAAU,UAAAA,OAAY,IAAAD,EAAA,KACZE,EAAAX,EAAAY,SAAAA,OAAW,IAAAD,GAAKA,EAChBE,QAAAC,OAAM,IAAAD,EAAA,CAAEV,MAAO,EAAGF,MAAO,QAAQY,EACjCE,EAAAf,EAAAgB,IAAAA,aAAM,CAAEb,MAAO,IAAKF,MAAO,QAAQc,EAE7BE,EAAoCC,EAAAA,SAASf,GAA5CgB,EAAaF,EAAA,GAAEG,EAAgBH,EAAA,GAChCI,EAA4BH,EAAAA,UAAS,GAApCI,EAASD,EAAA,GAAEE,EAAYF,EAAA,GACxB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EAuBUtH,WACoBwH,IAAlBxG,EAA8BA,EAAcyG,gBAAaD,EAE3DnH,UAAWkD,GAAmB6D,IAC7B,UAIPvF,EAACG,IAAAoB,EACC,CAAAC,QAASE,EACTtD,SApDqB,SAAC2D,GAE1BJ,EAAmBI,GAGfiD,GACFA,EAAejD,EAEnB,EA6CMvD,SAAU+G,MAIlB"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/components/Input.tsx","../src/components/Switch.tsx","../src/components/Chip.tsx","../src/components/Avatar.tsx","../src/components/Histogram.tsx","../src/components/ProductionUnit.tsx"],"sourcesContent":["import React, { useState, useRef, useEffect } from \"react\";\nimport \"./Input.css\";\n\ninterface InputProps {\n label: string;\n value?: string;\n onChange?: (value: string) => void;\n type?: \"text\" | \"number\";\n disabled?: boolean;\n className?: string;\n required?: boolean;\n min?: { value: number; label?: string };\n max?: { value: number; label?: string };\n}\n\nexport const Input: React.FC<InputProps> = ({\n label,\n value = \"\",\n onChange,\n type = \"text\",\n disabled = false,\n className = \"\",\n required = false,\n min = { value: 0, label: \"Pmin\" },\n max = { value: 100, label: \"Pmax\" },\n}) => {\n const [internalValue, setInternalValue] = useState(value);\n const [isFocused, setIsFocused] = useState(false);\n const inputRef = useRef<HTMLInputElement>(null);\n\n useEffect(() => {\n setInternalValue(value);\n }, [value]);\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const newValue = e.target.value;\n setInternalValue(newValue);\n onChange?.(newValue);\n };\n\n const handleFocus = () => {\n setIsFocused(true);\n };\n\n const handleBlur = () => {\n setIsFocused(false);\n };\n\n const isLabelFloating = isFocused || internalValue.length > 0;\n\n const containerClasses = [\n \"input-container\",\n isFocused ? \"input-container--focused\" : \"\",\n isLabelFloating ? \"input-container--floating\" : \"\",\n disabled ? \"input-container--disabled\" : \"\",\n className,\n ]\n .filter(Boolean)\n .join(\" \");\n\n return (\n <div className={containerClasses}>\n <div className=\"input-constraints\">\n <div className=\"input-min\">\n {min.label}\n <br />\n {min.value}\n </div>\n\n <div className=\"input-field\">\n <input\n ref={inputRef}\n type={type}\n value={internalValue}\n onChange={handleChange}\n onFocus={handleFocus}\n onBlur={handleBlur}\n disabled={disabled}\n required={required}\n className=\"input-element\"\n aria-label={label}\n />\n <label className=\"input-label\">\n {label}\n {required && <span className=\"input-required\">*</span>}\n </label>\n </div>\n <div className=\"input-max\">\n {max.label}\n <br /> {max.value}\n </div>\n </div>\n </div>\n );\n};\n","import React, { useState } from \"react\";\nimport \"./Switch.css\";\n\ninterface OnProps {\n isOff?: boolean;\n}\nconst ImgOn = ({ isOff }: OnProps) => (\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M9.56529 2.85352C9.66365 2.57607 9.96837 2.43116 10.246 2.5293C13.4295 3.65507 15.3392 6.91015 14.7684 10.2383C14.1974 13.5667 11.3114 16 7.93443 16C4.55739 16 1.67151 13.5667 1.10045 10.2383C0.5296 6.91011 2.4393 3.65504 5.62291 2.5293C5.9005 2.43115 6.20523 2.57605 6.30357 2.85352C6.40176 3.13124 6.2561 3.43599 5.97838 3.53418C3.28438 4.48672 1.669 7.2423 2.1522 10.0586C2.63557 12.8747 5.07706 14.9336 7.93443 14.9336C10.7918 14.9336 13.2333 12.8747 13.7167 10.0586C14.1999 7.24233 12.5844 4.48676 9.89049 3.53418C9.61276 3.43599 9.4671 3.13124 9.56529 2.85352ZM7.93443 0C8.22892 3.10447e-05 8.46754 0.238727 8.46763 0.533203V7.4668C8.46763 7.76135 8.22898 8.00095 7.93443 8.00098C7.63986 8.00098 7.40123 7.76137 7.40123 7.4668V0.533203C7.40132 0.238707 7.63991 0 7.93443 0Z\"\n fill={isOff ? \"#999FA1\" : \"#009CDF\"}\n />\n </svg>\n);\nconst SwitchThumb = ({ isOff }: OnProps) => (\n <svg\n width=\"32\"\n height=\"32\"\n viewBox=\"0 0 32 32\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle cx=\"16\" cy=\"16\" r=\"16\" fill={isOff ? \"white\" : \"#009cdf\"} />\n </svg>\n);\n\ninterface SwitchProps {\n checked?: boolean;\n onChange?: (checked: boolean) => void;\n disabled?: boolean;\n showIcon?: boolean;\n}\n\nexport const Switch: React.FC<SwitchProps> = ({\n checked = false,\n onChange,\n disabled = false,\n showIcon = true,\n}) => {\n const [internalChecked, setInternalChecked] = useState(checked);\n\n const handleToggle = () => {\n if (disabled) return;\n\n const newChecked = !internalChecked;\n setInternalChecked(newChecked);\n onChange?.(newChecked);\n };\n\n const switchClasses = [\n \"switch\",\n internalChecked ? \"switch--checked\" : \"\",\n disabled ? \"switch--disabled\" : \"\",\n ]\n .filter(Boolean)\n .join(\" \");\n\n return (\n <div className=\"switch-container\">\n <div className=\"switch-wrapper\">\n {showIcon && (\n <div className=\"switch-icon\">\n <ImgOn isOff={!internalChecked} />\n </div>\n )}\n <button\n type=\"button\"\n role=\"switch\"\n aria-checked={internalChecked}\n className={switchClasses}\n onClick={handleToggle}\n disabled={disabled}\n >\n <span className=\"switch-track\">\n <span className=\"switch-thumb\">\n <SwitchThumb isOff={!internalChecked} />\n </span>\n </span>\n </button>\n </div>\n </div>\n );\n};\n","import React from \"react\";\nimport \"./Chip.css\";\n\ninterface ChipProps {\n // Define any props you want to pass to the Chip component\n label?: string;\n bgColor?: string;\n textColor?: string;\n width?: \"fit-content\" | \"full-width\";\n}\n\nexport const Chip: React.FC<ChipProps> = ({ \n label, \n bgColor, \n textColor, \n width = \"fit-content\" \n}) => {\n const chipClasses = [\n \"chip-container\",\n width === \"full-width\" ? \"chip-container--full-width\" : \"chip-container--fit-content\"\n ].join(\" \");\n\n return (\n <div className={chipClasses} style={{ backgroundColor: bgColor }}>\n <div className=\"chip-content\">\n <p className=\"chip-label\" style={{ color: textColor }}>\n {label}\n </p>\n </div>\n </div>\n );\n};\n","import React from \"react\";\nimport \"./Avatar.css\";\n\ninterface AvatarProps {\n children: React.ReactNode;\n}\n\nexport const Avatar: React.FC<AvatarProps> = ({ children }) => {\n return (\n <div className=\"avatar-container avatar-container--clickable\">\n <div className=\"avatar-content\">{children}</div>\n </div>\n );\n};\n","import React, { useEffect, useState } from \"react\";\nimport \"./Histogram.css\";\n\ninterface HistogramProps {\n /** Maximum value configuration with value and color */\n max: {\n value: number;\n color: string;\n opacity?: number;\n };\n /** Relative/current value configuration with value and color */\n relative: {\n value: number;\n color: string;\n };\n /** Height of the histogram bar in pixels */\n barHeight?: number;\n /** Width of the histogram bar in pixels */\n barWidth?: number;\n /** Orientation of the histogram - 'vertical' or 'horizontal' */\n orientation?: 'vertical' | 'horizontal';\n /** Corner radius configuration for individual corners */\n cornerRadius?: {\n topLeft?: number;\n topRight?: number;\n bottomLeft?: number;\n bottomRight?: number;\n };\n /** Child components (typically text content) */\n children?: React.ReactNode;\n}\n\nexport const Histogram: React.FC<HistogramProps> = ({\n max,\n relative,\n barHeight = 103,\n barWidth = 32,\n orientation = 'vertical',\n cornerRadius,\n children,\n}) => {\n const [animatedHeight, setAnimatedHeight] = useState(0);\n const [animatedWidth, setAnimatedWidth] = useState(0);\n\n // Calculate target dimensions based on orientation\n const targetHeight = (Math.min((relative.value / max.value) * 100, 100) / 100) * barHeight;\n const targetWidth = (Math.min((relative.value / max.value) * 100, 100) / 100) * barWidth;\n\n // Simple Chart.js-like animation: always animate from 0 to target\n useEffect(() => {\n setAnimatedHeight(0);\n setAnimatedWidth(0);\n \n const startTime = Date.now();\n const duration = 1000;\n\n const animate = () => {\n const elapsed = Date.now() - startTime;\n const progress = Math.min(elapsed / duration, 1);\n\n // Chart.js-like easing (easeOutQuart)\n const easeOutQuart = 1 - Math.pow(1 - progress, 4);\n \n setAnimatedHeight(targetHeight * easeOutQuart);\n setAnimatedWidth(targetWidth * easeOutQuart);\n\n if (progress < 1) {\n requestAnimationFrame(animate);\n }\n };\n\n requestAnimationFrame(animate);\n }, [targetHeight, targetWidth]);\n\n const displayWidth = orientation === 'horizontal' ? barHeight : barWidth;\n const displayHeight = orientation === 'horizontal' ? barWidth : barHeight;\n const svgWidth = orientation === 'horizontal' ? barHeight : barWidth;\n const svgHeight = orientation === 'horizontal' ? barWidth : barHeight;\n\n // Helper function to create rounded rectangle path\n const createRoundedRectPath = (\n x: number,\n y: number,\n width: number,\n height: number,\n radii: { topLeft: number; topRight: number; bottomLeft: number; bottomRight: number }\n ) => {\n const { topLeft, topRight, bottomLeft, bottomRight } = radii;\n \n return `\n M ${x + topLeft} ${y}\n L ${x + width - topRight} ${y}\n Q ${x + width} ${y} ${x + width} ${y + topRight}\n L ${x + width} ${y + height - bottomRight}\n Q ${x + width} ${y + height} ${x + width - bottomRight} ${y + height}\n L ${x + bottomLeft} ${y + height}\n Q ${x} ${y + height} ${x} ${y + height - bottomLeft}\n L ${x} ${y + topLeft}\n Q ${x} ${y} ${x + topLeft} ${y}\n Z\n `.trim().replace(/\\s+/g, ' ');\n };\n\n // Default corner radius values\n const defaultCornerRadius = { topLeft: 2, topRight: 2, bottomLeft: 2, bottomRight: 2 };\n const corners = cornerRadius ? {\n topLeft: cornerRadius.topLeft ?? defaultCornerRadius.topLeft,\n topRight: cornerRadius.topRight ?? defaultCornerRadius.topRight,\n bottomLeft: cornerRadius.bottomLeft ?? defaultCornerRadius.bottomLeft,\n bottomRight: cornerRadius.bottomRight ?? defaultCornerRadius.bottomRight,\n } : defaultCornerRadius;\n\n return (\n <div className={`histogram-container ${orientation === 'horizontal' ? 'histogram-container--horizontal' : ''}`}>\n <div className={`histogram-content ${orientation === 'horizontal' ? 'histogram-content--horizontal' : ''}`}>\n <div \n className=\"histogram-bar\"\n style={{\n height: `${displayHeight}px`,\n width: `${displayWidth}px`\n }}\n >\n <svg\n width={svgWidth}\n height={svgHeight}\n viewBox={`0 0 ${svgWidth} ${svgHeight}`}\n className=\"histogram-svg\"\n >\n {/* Background bar (max value) */}\n <path\n d={createRoundedRectPath(0, 0, svgWidth, svgHeight, corners)}\n fill={max.color}\n fillOpacity={max.opacity || 1}\n />\n {/* Foreground bar (relative value) with animation */}\n {orientation === 'vertical' ? (\n <path\n d={createRoundedRectPath(\n 0,\n svgHeight - animatedHeight,\n svgWidth,\n animatedHeight,\n {\n topLeft: animatedHeight >= svgHeight ? corners.topLeft : 0,\n topRight: animatedHeight >= svgHeight ? corners.topRight : 0,\n bottomLeft: corners.bottomLeft,\n bottomRight: corners.bottomRight,\n }\n )}\n fill={relative.color}\n />\n ) : (\n <path\n d={createRoundedRectPath(\n 0,\n 0,\n animatedWidth,\n svgHeight,\n {\n topLeft: corners.topLeft,\n topRight: animatedWidth >= svgWidth ? corners.topRight : 0,\n bottomLeft: corners.bottomLeft,\n bottomRight: animatedWidth >= svgWidth ? corners.bottomRight : 0,\n }\n )}\n fill={relative.color}\n />\n )}\n </svg>\n </div>\n {children && (\n <div className={`histogram-text-container ${orientation === 'horizontal' ? 'histogram-text-container--horizontal' : ''}`}>\n {children}\n </div>\n )}\n </div>\n </div>\n );\n};\n","import { useState } from \"react\";\nimport { Input } from \"./Input\";\nimport { Switch } from \"./Switch\";\nimport \"./ProductionUnit.css\";\nimport { Chip } from \"./Chip\";\n\ninterface ProductionUnitProps {\n onChangeInput?: (value: number) => void;\n onChangeSwitch?: (checked: boolean) => void;\n defaultValue?: number;\n defaultChecked?: boolean;\n value?: number;\n checked?: boolean;\n unitName?: string;\n energyCost?: number;\n checkedImage?: React.ReactNode;\n uncheckedImage?: React.ReactNode;\n readonly?: boolean;\n}\nexport const ProductionUnit = ({\n onChangeInput,\n onChangeSwitch,\n defaultValue,\n defaultChecked = false,\n value,\n checked,\n unitName = \"Production Unit\",\n energyCost = 0,\n checkedImage,\n uncheckedImage,\n readonly = false,\n}: ProductionUnitProps) => {\n // Internal state management for uncontrolled mode\n const [internalChecked, setInternalChecked] = useState(defaultChecked);\n const [internalValue, setInternalValue] = useState(defaultValue);\n\n // Use controlled props if provided, otherwise use internal state\n const isChecked = checked !== undefined ? checked : internalChecked;\n const currentValue = value !== undefined ? value : internalValue;\n\n const handleSwitchChange = (newChecked: boolean) => {\n // Update internal state only if uncontrolled\n if (checked === undefined) {\n setInternalChecked(newChecked);\n }\n\n // Notify parent component if handler provided\n if (onChangeSwitch) {\n onChangeSwitch(newChecked);\n }\n };\n\n const handleInputChange = (val: string) => {\n const numValue = Number(val);\n // Update internal state only if uncontrolled\n if (value === undefined) {\n setInternalValue(numValue);\n }\n\n // Notify parent component if handler provided\n if (onChangeInput) {\n onChangeInput(numValue);\n }\n };\n\n return (\n <div className=\"production-unit-container\">\n <div className=\"production-unit-content\">\n <div className=\"image-preview-container\">\n {isChecked ? checkedImage : uncheckedImage}\n </div>\n <div className=\"production-unit-chip\">\n <div className=\"production-unit-chip-name\">{unitName}</div>\n\n <Chip\n label={`${energyCost} MW`}\n width=\"fit-content\"\n bgColor=\"#E1F5FD\"\n textColor=\"#005896\"\n />\n </div>\n <div className=\"production-unit-switch-container\">\n <Input\n label=\"PA\"\n type=\"number\"\n onChange={handleInputChange}\n value={\n currentValue !== undefined ? currentValue.toString() : undefined\n }\n disabled={!isChecked || readonly}\n />{\" \"}\n </div>\n </div>\n\n <Switch\n checked={isChecked}\n onChange={handleSwitchChange}\n disabled={readonly}\n />\n </div>\n );\n};\n"],"names":["Input","_a","label","_b","value","onChange","_c","type","_d","disabled","_e","className","_f","required","_g","min","_h","max","_j","useState","internalValue","setInternalValue","_k","isFocused","setIsFocused","inputRef","useRef","useEffect","containerClasses","length","filter","Boolean","join","_jsx","children","_jsxs","jsx","ref","e","newValue","target","onFocus","onBlur","jsxs","ImgOn","isOff","width","height","viewBox","fill","xmlns","d","SwitchThumb","cx","cy","r","Switch","checked","showIcon","internalChecked","setInternalChecked","switchClasses","role","onClick","newChecked","Chip","bgColor","textColor","chipClasses","style","backgroundColor","color","relative","barHeight","barWidth","orientation","cornerRadius","animatedHeight","setAnimatedHeight","animatedWidth","setAnimatedWidth","targetHeight","Math","targetWidth","startTime","Date","now","animate","elapsed","progress","easeOutQuart","pow","requestAnimationFrame","displayWidth","displayHeight","svgWidth","svgHeight","createRoundedRectPath","x","y","radii","topLeft","topRight","bottomLeft","bottomRight","concat","trim","replace","defaultCornerRadius","corners","fillOpacity","opacity","onChangeInput","onChangeSwitch","defaultValue","defaultChecked","unitName","energyCost","checkedImage","uncheckedImage","readonly","isChecked","undefined","currentValue","val","numValue","Number","toString"],"mappings":"mEAeaA,EAA8B,SAACC,GAC1C,IAAAC,EAAKD,EAAAC,MACLC,EAAUF,EAAAG,MAAVA,OAAQ,IAAAD,EAAA,GAAEA,EACVE,EAAQJ,EAAAI,SACRC,EAAAL,EAAAM,KAAAA,OAAI,IAAAD,EAAG,OAAMA,EACbE,EAAAP,EAAAQ,SAAAA,cAAgBD,EAChBE,EAAAT,EAAAU,UAAAA,OAAY,IAAAD,EAAA,KACZE,EAAAX,EAAAY,SAAAA,OAAW,IAAAD,GAAKA,EAChBE,QAAAC,OAAM,IAAAD,EAAA,CAAEV,MAAO,EAAGF,MAAO,QAAQY,EACjCE,EAAAf,EAAAgB,IAAAA,aAAM,CAAEb,MAAO,IAAKF,MAAO,QAAQc,EAE7BE,EAAoCC,EAAAA,SAASf,GAA5CgB,EAAaF,EAAA,GAAEG,EAAgBH,EAAA,GAChCI,EAA4BH,EAAAA,UAAS,GAApCI,EAASD,EAAA,GAAEE,EAAYF,EAAA,GACxBG,EAAWC,SAAyB,MAE1CC,EAAAA,UAAU,WACRN,EAAiBjB,EACnB,EAAG,CAACA,IAEJ,IAgBMwB,EAAmB,CACvB,kBACAL,EAAY,2BAA6B,GAJnBA,GAAaH,EAAcS,OAAS,EAKxC,4BAA8B,GAChDpB,EAAW,4BAA8B,GACzCE,GAECmB,OAAOC,SACPC,KAAK,KAER,OACEC,aAAKtB,UAAWiB,EACdM,SAAAC,OAAA,MAAA,CAAKxB,UAAU,oBAAmBuB,SAAA,CAChCC,cAAKxB,UAAU,YAAWuB,SAAA,CACvBnB,EAAIb,MACL+B,EAAAG,IAAA,KAAA,CAAA,GACC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