@protonradio/proton-ui 0.11.23-beta.4 → 0.11.23-beta.5
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.
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../../../node_modules/react/jsx-runtime.cjs.js"),d=require("react"),M=require("../../ThemeProvider.cjs.js");;/* empty css */const G=require("../../../utils/copy.cjs.js"),r=require("../../../utils/string.cjs.js"),$=d.forwardRef(({prefix:l,suffix:x,description:p,descriptionPosition:v="top",isDisabled:T,error:o,onChange:y,label:m,name:c,placeholder:q,type:A="text",value:O,autoFocus:z,autoComplete:F,isRequired:b=!1,isReadOnly:C=!1,onSubmit:N,onClear:R,"data-testid":V},B)=>{const W=d.useRef(null),u=d.useRef(null),h=d.useRef(null),n=d.useRef(null),{className:U}=M.useTheme(),K=B||W;d.useEffect(()=>{if(!n.current)return;let s=0,D=Date.now();const a={containerWidth:0,prefixWidth:0,suffixWidth:0};let f=null;const E=w=>{s++;const k=Date.now(),_=k-D;D=k;const L=(w==null?void 0:w.map(I=>I.target.className||"unknown").join(","))||"initial";fetch("http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({location:"Input.tsx:149",message:"ResizeObserver callback invoked",data:{callbackCount:s,timeSinceLastUpdate:_,triggeredBy:L},timestamp:Date.now(),sessionId:"debug-session",runId:"post-fix",hypothesisId:"A"})}).catch(()=>{}),f!==null&&cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var I,J;if(n.current){if(n.current){const t=n.current.offsetWidth||200,e=t!==a.containerWidth;fetch("http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({location:"Input.tsx:152",message:"Reading container width",data:{containerWidth:t,previousValue:a.containerWidth,changed:e},timestamp:Date.now(),sessionId:"debug-session",runId:"post-fix",hypothesisId:"C"})}).catch(()=>{}),e?(n.current.style.setProperty("--container-width",`${t}px`),a.containerWidth=t,fetch("http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({location:"Input.tsx:157",message:"Set container-width CSS property",data:{containerWidth:t,changed:e},timestamp:Date.now(),sessionId:"debug-session",runId:"post-fix",hypothesisId:"A"})}).catch(()=>{})):fetch("http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({location:"Input.tsx:157",message:"Skipped setting container-width (unchanged)",data:{containerWidth:t,changed:e},timestamp:Date.now(),sessionId:"debug-session",runId:"post-fix",hypothesisId:"C"})}).catch(()=>{})}if(u.current){const t=u.current.offsetWidth||32,e=t!==a.prefixWidth;fetch("http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({location:"Input.tsx:163",message:"Reading prefix width",data:{prefixWidth:t,previousValue:a.prefixWidth,changed:e},timestamp:Date.now(),sessionId:"debug-session",runId:"post-fix",hypothesisId:"C"})}).catch(()=>{}),e?((I=n.current)==null||I.style.setProperty("--prefix-width",`${t}px`),a.prefixWidth=t,fetch("http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({location:"Input.tsx:168",message:"Set prefix-width CSS property",data:{prefixWidth:t,changed:e},timestamp:Date.now(),sessionId:"debug-session",runId:"post-fix",hypothesisId:"A"})}).catch(()=>{})):fetch("http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({location:"Input.tsx:168",message:"Skipped setting prefix-width (unchanged)",data:{prefixWidth:t,changed:e},timestamp:Date.now(),sessionId:"debug-session",runId:"post-fix",hypothesisId:"C"})}).catch(()=>{})}if(h.current){const t=h.current.offsetWidth||32,e=t!==a.suffixWidth;fetch("http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({location:"Input.tsx:174",message:"Reading suffix width",data:{suffixWidth:t,previousValue:a.suffixWidth,changed:e},timestamp:Date.now(),sessionId:"debug-session",runId:"post-fix",hypothesisId:"C"})}).catch(()=>{}),e?((J=n.current)==null||J.style.setProperty("--suffix-width",`${t}px`),a.suffixWidth=t,fetch("http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({location:"Input.tsx:179",message:"Set suffix-width CSS property",data:{suffixWidth:t,changed:e},timestamp:Date.now(),sessionId:"debug-session",runId:"post-fix",hypothesisId:"A"})}).catch(()=>{})):fetch("http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({location:"Input.tsx:179",message:"Skipped setting suffix-width (unchanged)",data:{suffixWidth:t,changed:e},timestamp:Date.now(),sessionId:"debug-session",runId:"post-fix",hypothesisId:"C"})}).catch(()=>{})}_<10&&fetch("http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({location:"Input.tsx:185",message:"Rapid callback detected",data:{callbackCount:s,timeSinceLastUpdate:_},timestamp:Date.now(),sessionId:"debug-session",runId:"post-fix",hypothesisId:"E"})}).catch(()=>{})}})};E();const g=new ResizeObserver(E);return n.current&&g.observe(n.current),u.current&&g.observe(u.current),h.current&&g.observe(h.current),()=>{f!==null&&cancelAnimationFrame(f),g.disconnect()}},[l,x]);const P=`${c}-input`,S=`${c}-error`,j=`${c}-description`;return i.jsxRuntimeExports.jsxs("div",{ref:n,className:"proton-Input__container",children:[p&&v==="top"&&i.jsxRuntimeExports.jsx("div",{id:j,className:"proton-Input__text","aria-live":"polite",children:p}),i.jsxRuntimeExports.jsxs("div",{className:r.csx("proton-Input__container-inner",l&&"proton-Input__has-prefix",x&&"proton-Input__has-suffix"),children:[l&&i.jsxRuntimeExports.jsx("div",{ref:u,className:r.csx("proton-Input__descriptor","proton-Input__prefix"),children:l}),i.jsxRuntimeExports.jsx("input",{id:P,name:c,type:A,value:O,onChange:s=>{y==null||y(s.target.value)},onKeyDown:s=>{switch(s.key){case"Enter":N&&(s.preventDefault(),N(s));break;case"Escape":R&&(s.preventDefault(),R());break}},onCopy:async()=>{var s;return await G.copyTextToClipboard((s=W.current)==null?void 0:s.value)},disabled:T,readOnly:C,required:b,autoFocus:z,autoComplete:F?"on":"off",placeholder:m?void 0:q,"aria-label":m||c,"aria-invalid":!!o,"aria-errormessage":typeof o=="string"?o:S,"aria-required":b,"aria-readonly":C,"aria-describedby":o?S:p?j:void 0,"aria-disabled":T,"data-testid":V,ref:K,className:r.csx("proton-Input",o&&"proton-Input--error",m&&"proton-Input__label-top",U)}),i.jsxRuntimeExports.jsxs("label",{htmlFor:P,className:r.csx("proton-Input__label",O&&"proton-Input__label--filled"),children:[m,b&&i.jsxRuntimeExports.jsx("span",{"aria-hidden":"true",children:" *"})]}),x&&i.jsxRuntimeExports.jsx("div",{ref:h,className:r.csx("proton-Input__descriptor","proton-Input__suffix"),children:x})]}),o?i.jsxRuntimeExports.jsx("div",{role:"alert",className:r.csx("proton-Input__error","proton-Input__text"),id:S,children:o}):p&&v==="bottom"?i.jsxRuntimeExports.jsx("div",{id:j,className:"proton-Input__text","aria-live":"polite",children:p}):null]})});$.displayName="ProtonUIInput";exports.Input=$;
|
|
2
2
|
//# sourceMappingURL=Input.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.cjs.js","sources":["../../../../src/components/Input/BaseInput/Input.tsx"],"sourcesContent":["\"use client\";\n\nimport React, { forwardRef, useEffect, useRef } from \"react\";\n\nimport { useTheme } from \"../../ThemeProvider\";\nimport { csx } from \"../../../utils\";\nimport \"./Input.css\";\nimport { copyTextToClipboard } from \"../../../utils/copy\";\n\nexport interface BaseInputProps {\n /**\n * onChange handler for the input\n */\n onChange?: (value: string) => void;\n\n /** Whether the input is disabled. */\n isDisabled?: boolean;\n\n /** Description text shown above the input. */\n description?: React.ReactNode | string;\n\n /**\n * The position of the description text.\n * @default \"top\"\n */\n descriptionPosition?: \"top\" | \"bottom\";\n\n /** Error state that changes the input's visual style and displays an error message. */\n error?: React.ReactNode | string;\n\n /**\n * Label for the input element.\n * @note When a label is provided, the input will have extra padding, and the label will float above the text input when focused or filled.\n */\n label?: string;\n\n /** Test ID for the component. */\n \"data-testid\"?: string;\n\n /** Content to display before the input. Typically used for icons. */\n prefix?: React.ReactNode;\n\n /** Content to display after the input. Typically used for icons. */\n suffix?: React.ReactNode;\n\n /**\n * Should the browser's autocomplete be enabled?\n * @external https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete\n */\n autoComplete?: boolean;\n\n /**\n * Should the input be autofocused?\n * @external https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autofocus\n */\n autoFocus?: boolean;\n\n /**\n * The name attribute of the input element.\n * @external https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/name\n */\n name: string;\n\n /**\n * The placeholder text to display when the input is empty.\n * @note label takes precedence over placeholder, if both are provided.\n * @external https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/placeholder\n */\n placeholder?: string;\n\n /**\n * The type attribute of the input element.\n * @external https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/type\n * @default \"text\"\n */\n type?: string;\n\n /**\n * The value of the input.\n * @external https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#value\n */\n value?: string;\n\n /**\n * Whether the input is required.\n * @default false\n */\n isRequired?: boolean;\n\n /**\n * Whether the input is read-only.\n * @default false\n */\n isReadOnly?: boolean;\n\n /**\n * Called when the input is submitted (e.g. by pressing Enter).\n */\n onSubmit?: React.FormEventHandler<HTMLInputElement>;\n\n /**\n * Called when the input is cleared (e.g. by pressing Escape).\n */\n onClear?: () => void;\n}\n\n/**\n * A controlled and customizable input component with support for labels, prefixes, suffixes, and error states.\n *\n * API:\n * - {@link BaseInputProps}\n */\nexport const Input = forwardRef<HTMLInputElement, BaseInputProps>(\n (\n {\n prefix,\n suffix,\n description,\n descriptionPosition = \"top\",\n isDisabled,\n error,\n onChange,\n label,\n name,\n placeholder,\n type = \"text\",\n value,\n autoFocus,\n autoComplete,\n isRequired = false,\n isReadOnly = false,\n onSubmit,\n onClear,\n \"data-testid\": testId,\n },\n forwardedRef: React.RefObject<HTMLInputElement>\n ) => {\n const inputRef = useRef<HTMLInputElement>(null);\n const prefixRef = useRef<HTMLDivElement>(null);\n const suffixRef = useRef<HTMLDivElement>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n const { className } = useTheme();\n const ref = forwardedRef || inputRef;\n\n // Control dynamic prefix and suffix widths using ResizeObserver\n useEffect(() => {\n if (!containerRef.current) return;\n\n // #region agent log\n let callbackCount = 0;\n let lastUpdateTime = Date.now();\n const previousValues = {\n containerWidth: 0,\n prefixWidth: 0,\n suffixWidth: 0,\n };\n // #endregion\n\n const updateSizes = (entries?: ResizeObserverEntry[]) => {\n // #region agent log\n callbackCount++;\n const now = Date.now();\n const timeSinceLastUpdate = now - lastUpdateTime;\n lastUpdateTime = now;\n const triggeredBy =\n entries?.map((e) => e.target.className || \"unknown\").join(\",\") ||\n \"initial\";\n fetch(\n \"http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324\",\n {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n location: \"Input.tsx:149\",\n message: \"ResizeObserver callback invoked\",\n data: { callbackCount, timeSinceLastUpdate, triggeredBy },\n timestamp: Date.now(),\n sessionId: \"debug-session\",\n runId: \"run1\",\n hypothesisId: \"A\",\n }),\n }\n ).catch(() => {});\n // #endregion\n\n if (containerRef.current) {\n const containerWidth = containerRef.current.offsetWidth || 200;\n // #region agent log\n const containerWidthChanged =\n containerWidth !== previousValues.containerWidth;\n fetch(\n \"http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324\",\n {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n location: \"Input.tsx:152\",\n message: \"Reading container width\",\n data: {\n containerWidth,\n previousValue: previousValues.containerWidth,\n changed: containerWidthChanged,\n },\n timestamp: Date.now(),\n sessionId: \"debug-session\",\n runId: \"run1\",\n hypothesisId: \"C\",\n }),\n }\n ).catch(() => {});\n // #endregion\n containerRef.current.style.setProperty(\n \"--container-width\",\n `${containerWidth}px`\n );\n // #region agent log\n previousValues.containerWidth = containerWidth;\n fetch(\n \"http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324\",\n {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n location: \"Input.tsx:157\",\n message: \"Set container-width CSS property\",\n data: { containerWidth, changed: containerWidthChanged },\n timestamp: Date.now(),\n sessionId: \"debug-session\",\n runId: \"run1\",\n hypothesisId: \"A\",\n }),\n }\n ).catch(() => {});\n // #endregion\n }\n\n if (prefixRef.current) {\n const prefixWidth = prefixRef.current.offsetWidth || 32;\n // #region agent log\n const prefixWidthChanged = prefixWidth !== previousValues.prefixWidth;\n fetch(\n \"http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324\",\n {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n location: \"Input.tsx:163\",\n message: \"Reading prefix width\",\n data: {\n prefixWidth,\n previousValue: previousValues.prefixWidth,\n changed: prefixWidthChanged,\n },\n timestamp: Date.now(),\n sessionId: \"debug-session\",\n runId: \"run1\",\n hypothesisId: \"C\",\n }),\n }\n ).catch(() => {});\n // #endregion\n containerRef.current?.style.setProperty(\n \"--prefix-width\",\n `${prefixWidth}px`\n );\n // #region agent log\n previousValues.prefixWidth = prefixWidth;\n fetch(\n \"http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324\",\n {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n location: \"Input.tsx:168\",\n message: \"Set prefix-width CSS property\",\n data: { prefixWidth, changed: prefixWidthChanged },\n timestamp: Date.now(),\n sessionId: \"debug-session\",\n runId: \"run1\",\n hypothesisId: \"A\",\n }),\n }\n ).catch(() => {});\n // #endregion\n }\n\n if (suffixRef.current) {\n const suffixWidth = suffixRef.current.offsetWidth || 32;\n // #region agent log\n const suffixWidthChanged = suffixWidth !== previousValues.suffixWidth;\n fetch(\n \"http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324\",\n {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n location: \"Input.tsx:174\",\n message: \"Reading suffix width\",\n data: {\n suffixWidth,\n previousValue: previousValues.suffixWidth,\n changed: suffixWidthChanged,\n },\n timestamp: Date.now(),\n sessionId: \"debug-session\",\n runId: \"run1\",\n hypothesisId: \"C\",\n }),\n }\n ).catch(() => {});\n // #endregion\n containerRef.current?.style.setProperty(\n \"--suffix-width\",\n `${suffixWidth}px`\n );\n // #region agent log\n previousValues.suffixWidth = suffixWidth;\n fetch(\n \"http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324\",\n {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n location: \"Input.tsx:179\",\n message: \"Set suffix-width CSS property\",\n data: { suffixWidth, changed: suffixWidthChanged },\n timestamp: Date.now(),\n sessionId: \"debug-session\",\n runId: \"run1\",\n hypothesisId: \"A\",\n }),\n }\n ).catch(() => {});\n // #endregion\n }\n\n // #region agent log\n if (timeSinceLastUpdate < 10) {\n fetch(\n \"http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324\",\n {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n location: \"Input.tsx:185\",\n message: \"Rapid callback detected\",\n data: { callbackCount, timeSinceLastUpdate },\n timestamp: Date.now(),\n sessionId: \"debug-session\",\n runId: \"run1\",\n hypothesisId: \"E\",\n }),\n }\n ).catch(() => {});\n }\n // #endregion\n };\n\n updateSizes();\n\n const resizeObserver = new ResizeObserver(updateSizes);\n\n if (containerRef.current) {\n resizeObserver.observe(containerRef.current);\n }\n if (prefixRef.current) {\n resizeObserver.observe(prefixRef.current);\n }\n if (suffixRef.current) {\n resizeObserver.observe(suffixRef.current);\n }\n\n return () => {\n resizeObserver.disconnect();\n };\n }, [prefix, suffix]);\n\n const inputId = `${name}-input`;\n const errorId = `${name}-error`;\n const descriptionId = `${name}-description`;\n\n return (\n <div ref={containerRef} className=\"proton-Input__container\">\n {description && descriptionPosition === \"top\" && (\n <div\n id={descriptionId}\n className=\"proton-Input__text\"\n aria-live=\"polite\"\n >\n {description}\n </div>\n )}\n <div\n className={csx(\n \"proton-Input__container-inner\",\n prefix && \"proton-Input__has-prefix\",\n suffix && \"proton-Input__has-suffix\"\n )}\n >\n {prefix && (\n <div\n ref={prefixRef}\n className={csx(\n \"proton-Input__descriptor\",\n \"proton-Input__prefix\"\n )}\n >\n {prefix}\n </div>\n )}\n\n <input\n id={inputId}\n name={name}\n type={type}\n value={value}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) => {\n onChange?.(e.target.value);\n }}\n onKeyDown={(e: React.KeyboardEvent<HTMLInputElement>) => {\n switch (e.key) {\n case \"Enter\":\n if (onSubmit) {\n e.preventDefault();\n onSubmit(e);\n }\n break;\n case \"Escape\":\n if (onClear) {\n e.preventDefault();\n onClear();\n }\n break;\n }\n }}\n onCopy={async () =>\n await copyTextToClipboard(inputRef.current?.value)\n }\n disabled={isDisabled}\n readOnly={isReadOnly}\n required={isRequired}\n autoFocus={autoFocus}\n autoComplete={autoComplete ? \"on\" : \"off\"}\n placeholder={label ? undefined : placeholder}\n aria-label={label || name}\n aria-invalid={Boolean(error)}\n aria-errormessage={typeof error === \"string\" ? error : errorId}\n aria-required={isRequired}\n aria-readonly={isReadOnly}\n aria-describedby={\n error ? errorId : description ? descriptionId : undefined\n }\n aria-disabled={isDisabled}\n data-testid={testId}\n ref={ref}\n className={csx(\n \"proton-Input\",\n error && \"proton-Input--error\",\n label && \"proton-Input__label-top\",\n className\n )}\n />\n\n <label\n htmlFor={inputId}\n className={csx(\n \"proton-Input__label\",\n value && \"proton-Input__label--filled\"\n )}\n >\n {label}\n {isRequired && <span aria-hidden=\"true\"> *</span>}\n </label>\n\n {suffix && (\n <div\n ref={suffixRef}\n className={csx(\n \"proton-Input__descriptor\",\n \"proton-Input__suffix\"\n )}\n >\n {suffix}\n </div>\n )}\n </div>\n\n {error ? (\n <div\n role=\"alert\"\n className={csx(\"proton-Input__error\", \"proton-Input__text\")}\n id={errorId}\n >\n {error}\n </div>\n ) : description && descriptionPosition === \"bottom\" ? (\n <div\n id={descriptionId}\n className=\"proton-Input__text\"\n aria-live=\"polite\"\n >\n {description}\n </div>\n ) : null}\n </div>\n );\n }\n);\n\nInput.displayName = \"ProtonUIInput\";\n"],"names":["Input","forwardRef","prefix","suffix","description","descriptionPosition","isDisabled","error","onChange","label","name","placeholder","type","value","autoFocus","autoComplete","isRequired","isReadOnly","onSubmit","onClear","testId","forwardedRef","inputRef","useRef","prefixRef","suffixRef","containerRef","className","useTheme","ref","useEffect","callbackCount","lastUpdateTime","previousValues","updateSizes","entries","now","timeSinceLastUpdate","triggeredBy","e","containerWidth","containerWidthChanged","prefixWidth","prefixWidthChanged","_a","suffixWidth","suffixWidthChanged","_b","resizeObserver","inputId","errorId","descriptionId","jsxs","jsx","csx","copyTextToClipboard"],"mappings":"mUAgHaA,EAAQC,EAAA,WACnB,CACE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mB,OAAOA,GAAU,SAAWA,EAAQ2C,EACvD,gBAAelC,EACf,gBAAeC,EACf,mBACEV,EAAQ2C,EAAU9C,EAAc+C,EAAgB,OAElD,gBAAe7C,EACf,cAAac,EACb,IAAAS,EACA,UAAWyB,EAAA,IACT,eACA/C,GAAS,sBACTE,GAAS,0BACTkB,CACF,CAAA,CACF,EAEAyB,EAAA,kBAAA,KAAC,QAAA,CACC,QAASH,EACT,UAAWK,EAAA,IACT,sBACAzC,GAAS,6BACX,EAEC,SAAA,CAAAJ,EACAO,GAAcqC,EAAA,kBAAA,IAAC,OAAK,CAAA,cAAY,OAAO,SAAE,KAAA,CAAA,CAAA,CAC5C,EAEClD,GACCkD,EAAA,kBAAA,IAAC,MAAA,CACC,IAAK5B,EACL,UAAW6B,EAAA,IACT,2BACA,sBACF,EAEC,SAAAnD,CAAA,CACH,CAAA,CAAA,CAEJ,EAECI,EACC8C,EAAA,kBAAA,IAAC,MAAA,CACC,KAAK,QACL,UAAWC,EAAAA,IAAI,sBAAuB,oBAAoB,EAC1D,GAAIJ,EAEH,SAAA3C,CAAA,CAAA,EAEDH,GAAeC,IAAwB,SACzCgD,EAAA,kBAAA,IAAC,MAAA,CACC,GAAIF,EACJ,UAAU,qBACV,YAAU,SAET,SAAA/C,CAAA,CAAA,EAED,IACN,CAAA,CAAA,CAEJ,CACF,EAEAJ,EAAM,YAAc"}
|
|
1
|
+
{"version":3,"file":"Input.cjs.js","sources":["../../../../src/components/Input/BaseInput/Input.tsx"],"sourcesContent":["\"use client\";\n\nimport React, { forwardRef, useEffect, useRef } from \"react\";\n\nimport { useTheme } from \"../../ThemeProvider\";\nimport { csx } from \"../../../utils\";\nimport \"./Input.css\";\nimport { copyTextToClipboard } from \"../../../utils/copy\";\n\nexport interface BaseInputProps {\n /**\n * onChange handler for the input\n */\n onChange?: (value: string) => void;\n\n /** Whether the input is disabled. */\n isDisabled?: boolean;\n\n /** Description text shown above the input. */\n description?: React.ReactNode | string;\n\n /**\n * The position of the description text.\n * @default \"top\"\n */\n descriptionPosition?: \"top\" | \"bottom\";\n\n /** Error state that changes the input's visual style and displays an error message. */\n error?: React.ReactNode | string;\n\n /**\n * Label for the input element.\n * @note When a label is provided, the input will have extra padding, and the label will float above the text input when focused or filled.\n */\n label?: string;\n\n /** Test ID for the component. */\n \"data-testid\"?: string;\n\n /** Content to display before the input. Typically used for icons. */\n prefix?: React.ReactNode;\n\n /** Content to display after the input. Typically used for icons. */\n suffix?: React.ReactNode;\n\n /**\n * Should the browser's autocomplete be enabled?\n * @external https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete\n */\n autoComplete?: boolean;\n\n /**\n * Should the input be autofocused?\n * @external https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autofocus\n */\n autoFocus?: boolean;\n\n /**\n * The name attribute of the input element.\n * @external https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/name\n */\n name: string;\n\n /**\n * The placeholder text to display when the input is empty.\n * @note label takes precedence over placeholder, if both are provided.\n * @external https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/placeholder\n */\n placeholder?: string;\n\n /**\n * The type attribute of the input element.\n * @external https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/type\n * @default \"text\"\n */\n type?: string;\n\n /**\n * The value of the input.\n * @external https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#value\n */\n value?: string;\n\n /**\n * Whether the input is required.\n * @default false\n */\n isRequired?: boolean;\n\n /**\n * Whether the input is read-only.\n * @default false\n */\n isReadOnly?: boolean;\n\n /**\n * Called when the input is submitted (e.g. by pressing Enter).\n */\n onSubmit?: React.FormEventHandler<HTMLInputElement>;\n\n /**\n * Called when the input is cleared (e.g. by pressing Escape).\n */\n onClear?: () => void;\n}\n\n/**\n * A controlled and customizable input component with support for labels, prefixes, suffixes, and error states.\n *\n * API:\n * - {@link BaseInputProps}\n */\nexport const Input = forwardRef<HTMLInputElement, BaseInputProps>(\n (\n {\n prefix,\n suffix,\n description,\n descriptionPosition = \"top\",\n isDisabled,\n error,\n onChange,\n label,\n name,\n placeholder,\n type = \"text\",\n value,\n autoFocus,\n autoComplete,\n isRequired = false,\n isReadOnly = false,\n onSubmit,\n onClear,\n \"data-testid\": testId,\n },\n forwardedRef: React.RefObject<HTMLInputElement>\n ) => {\n const inputRef = useRef<HTMLInputElement>(null);\n const prefixRef = useRef<HTMLDivElement>(null);\n const suffixRef = useRef<HTMLDivElement>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n const { className } = useTheme();\n const ref = forwardedRef || inputRef;\n\n // Control dynamic prefix and suffix widths using ResizeObserver\n useEffect(() => {\n if (!containerRef.current) return;\n\n // #region agent log\n let callbackCount = 0;\n let lastUpdateTime = Date.now();\n const previousValues = {\n containerWidth: 0,\n prefixWidth: 0,\n suffixWidth: 0,\n };\n // #endregion\n\n let rafId: number | null = null;\n\n const updateSizes = (entries?: ResizeObserverEntry[]) => {\n // #region agent log\n callbackCount++;\n const now = Date.now();\n const timeSinceLastUpdate = now - lastUpdateTime;\n lastUpdateTime = now;\n const triggeredBy =\n entries?.map((e) => e.target.className || \"unknown\").join(\",\") ||\n \"initial\";\n fetch(\n \"http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324\",\n {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n location: \"Input.tsx:149\",\n message: \"ResizeObserver callback invoked\",\n data: { callbackCount, timeSinceLastUpdate, triggeredBy },\n timestamp: Date.now(),\n sessionId: \"debug-session\",\n runId: \"post-fix\",\n hypothesisId: \"A\",\n }),\n }\n ).catch(() => {});\n // #endregion\n\n // Cancel any pending animation frame\n if (rafId !== null) {\n cancelAnimationFrame(rafId);\n }\n\n // Batch DOM updates in requestAnimationFrame to avoid synchronous mutations\n rafId = requestAnimationFrame(() => {\n if (!containerRef.current) return;\n\n if (containerRef.current) {\n const containerWidth = containerRef.current.offsetWidth || 200;\n // #region agent log\n const containerWidthChanged =\n containerWidth !== previousValues.containerWidth;\n fetch(\n \"http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324\",\n {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n location: \"Input.tsx:152\",\n message: \"Reading container width\",\n data: {\n containerWidth,\n previousValue: previousValues.containerWidth,\n changed: containerWidthChanged,\n },\n timestamp: Date.now(),\n sessionId: \"debug-session\",\n runId: \"post-fix\",\n hypothesisId: \"C\",\n }),\n }\n ).catch(() => {});\n // #endregion\n // Only set CSS property if value actually changed\n if (containerWidthChanged) {\n containerRef.current.style.setProperty(\n \"--container-width\",\n `${containerWidth}px`\n );\n // #region agent log\n previousValues.containerWidth = containerWidth;\n fetch(\n \"http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324\",\n {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n location: \"Input.tsx:157\",\n message: \"Set container-width CSS property\",\n data: { containerWidth, changed: containerWidthChanged },\n timestamp: Date.now(),\n sessionId: \"debug-session\",\n runId: \"post-fix\",\n hypothesisId: \"A\",\n }),\n }\n ).catch(() => {});\n // #endregion\n } else {\n // #region agent log\n fetch(\n \"http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324\",\n {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n location: \"Input.tsx:157\",\n message: \"Skipped setting container-width (unchanged)\",\n data: { containerWidth, changed: containerWidthChanged },\n timestamp: Date.now(),\n sessionId: \"debug-session\",\n runId: \"post-fix\",\n hypothesisId: \"C\",\n }),\n }\n ).catch(() => {});\n // #endregion\n }\n }\n\n if (prefixRef.current) {\n const prefixWidth = prefixRef.current.offsetWidth || 32;\n // #region agent log\n const prefixWidthChanged =\n prefixWidth !== previousValues.prefixWidth;\n fetch(\n \"http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324\",\n {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n location: \"Input.tsx:163\",\n message: \"Reading prefix width\",\n data: {\n prefixWidth,\n previousValue: previousValues.prefixWidth,\n changed: prefixWidthChanged,\n },\n timestamp: Date.now(),\n sessionId: \"debug-session\",\n runId: \"post-fix\",\n hypothesisId: \"C\",\n }),\n }\n ).catch(() => {});\n // #endregion\n // Only set CSS property if value actually changed\n if (prefixWidthChanged) {\n containerRef.current?.style.setProperty(\n \"--prefix-width\",\n `${prefixWidth}px`\n );\n // #region agent log\n previousValues.prefixWidth = prefixWidth;\n fetch(\n \"http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324\",\n {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n location: \"Input.tsx:168\",\n message: \"Set prefix-width CSS property\",\n data: { prefixWidth, changed: prefixWidthChanged },\n timestamp: Date.now(),\n sessionId: \"debug-session\",\n runId: \"post-fix\",\n hypothesisId: \"A\",\n }),\n }\n ).catch(() => {});\n // #endregion\n } else {\n // #region agent log\n fetch(\n \"http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324\",\n {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n location: \"Input.tsx:168\",\n message: \"Skipped setting prefix-width (unchanged)\",\n data: { prefixWidth, changed: prefixWidthChanged },\n timestamp: Date.now(),\n sessionId: \"debug-session\",\n runId: \"post-fix\",\n hypothesisId: \"C\",\n }),\n }\n ).catch(() => {});\n // #endregion\n }\n }\n\n if (suffixRef.current) {\n const suffixWidth = suffixRef.current.offsetWidth || 32;\n // #region agent log\n const suffixWidthChanged =\n suffixWidth !== previousValues.suffixWidth;\n fetch(\n \"http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324\",\n {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n location: \"Input.tsx:174\",\n message: \"Reading suffix width\",\n data: {\n suffixWidth,\n previousValue: previousValues.suffixWidth,\n changed: suffixWidthChanged,\n },\n timestamp: Date.now(),\n sessionId: \"debug-session\",\n runId: \"post-fix\",\n hypothesisId: \"C\",\n }),\n }\n ).catch(() => {});\n // #endregion\n // Only set CSS property if value actually changed\n if (suffixWidthChanged) {\n containerRef.current?.style.setProperty(\n \"--suffix-width\",\n `${suffixWidth}px`\n );\n // #region agent log\n previousValues.suffixWidth = suffixWidth;\n fetch(\n \"http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324\",\n {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n location: \"Input.tsx:179\",\n message: \"Set suffix-width CSS property\",\n data: { suffixWidth, changed: suffixWidthChanged },\n timestamp: Date.now(),\n sessionId: \"debug-session\",\n runId: \"post-fix\",\n hypothesisId: \"A\",\n }),\n }\n ).catch(() => {});\n // #endregion\n } else {\n // #region agent log\n fetch(\n \"http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324\",\n {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n location: \"Input.tsx:179\",\n message: \"Skipped setting suffix-width (unchanged)\",\n data: { suffixWidth, changed: suffixWidthChanged },\n timestamp: Date.now(),\n sessionId: \"debug-session\",\n runId: \"post-fix\",\n hypothesisId: \"C\",\n }),\n }\n ).catch(() => {});\n // #endregion\n }\n }\n\n // #region agent log\n if (timeSinceLastUpdate < 10) {\n fetch(\n \"http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324\",\n {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n location: \"Input.tsx:185\",\n message: \"Rapid callback detected\",\n data: { callbackCount, timeSinceLastUpdate },\n timestamp: Date.now(),\n sessionId: \"debug-session\",\n runId: \"post-fix\",\n hypothesisId: \"E\",\n }),\n }\n ).catch(() => {});\n }\n // #endregion\n });\n };\n\n updateSizes();\n\n const resizeObserver = new ResizeObserver(updateSizes);\n\n if (containerRef.current) {\n resizeObserver.observe(containerRef.current);\n }\n if (prefixRef.current) {\n resizeObserver.observe(prefixRef.current);\n }\n if (suffixRef.current) {\n resizeObserver.observe(suffixRef.current);\n }\n\n return () => {\n if (rafId !== null) {\n cancelAnimationFrame(rafId);\n }\n resizeObserver.disconnect();\n };\n }, [prefix, suffix]);\n\n const inputId = `${name}-input`;\n const errorId = `${name}-error`;\n const descriptionId = `${name}-description`;\n\n return (\n <div ref={containerRef} className=\"proton-Input__container\">\n {description && descriptionPosition === \"top\" && (\n <div\n id={descriptionId}\n className=\"proton-Input__text\"\n aria-live=\"polite\"\n >\n {description}\n </div>\n )}\n <div\n className={csx(\n \"proton-Input__container-inner\",\n prefix && \"proton-Input__has-prefix\",\n suffix && \"proton-Input__has-suffix\"\n )}\n >\n {prefix && (\n <div\n ref={prefixRef}\n className={csx(\n \"proton-Input__descriptor\",\n \"proton-Input__prefix\"\n )}\n >\n {prefix}\n </div>\n )}\n\n <input\n id={inputId}\n name={name}\n type={type}\n value={value}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) => {\n onChange?.(e.target.value);\n }}\n onKeyDown={(e: React.KeyboardEvent<HTMLInputElement>) => {\n switch (e.key) {\n case \"Enter\":\n if (onSubmit) {\n e.preventDefault();\n onSubmit(e);\n }\n break;\n case \"Escape\":\n if (onClear) {\n e.preventDefault();\n onClear();\n }\n break;\n }\n }}\n onCopy={async () =>\n await copyTextToClipboard(inputRef.current?.value)\n }\n disabled={isDisabled}\n readOnly={isReadOnly}\n required={isRequired}\n autoFocus={autoFocus}\n autoComplete={autoComplete ? \"on\" : \"off\"}\n placeholder={label ? undefined : placeholder}\n aria-label={label || name}\n aria-invalid={Boolean(error)}\n aria-errormessage={typeof error === \"string\" ? error : errorId}\n aria-required={isRequired}\n aria-readonly={isReadOnly}\n aria-describedby={\n error ? errorId : description ? descriptionId : undefined\n }\n aria-disabled={isDisabled}\n data-testid={testId}\n ref={ref}\n className={csx(\n \"proton-Input\",\n error && \"proton-Input--error\",\n label && \"proton-Input__label-top\",\n className\n )}\n />\n\n <label\n htmlFor={inputId}\n className={csx(\n \"proton-Input__label\",\n value && \"proton-Input__label--filled\"\n )}\n >\n {label}\n {isRequired && <span aria-hidden=\"true\"> *</span>}\n </label>\n\n {suffix && (\n <div\n ref={suffixRef}\n className={csx(\n \"proton-Input__descriptor\",\n \"proton-Input__suffix\"\n )}\n >\n {suffix}\n </div>\n )}\n </div>\n\n {error ? (\n <div\n role=\"alert\"\n className={csx(\"proton-Input__error\", \"proton-Input__text\")}\n id={errorId}\n >\n {error}\n </div>\n ) : description && descriptionPosition === \"bottom\" ? (\n <div\n id={descriptionId}\n className=\"proton-Input__text\"\n aria-live=\"polite\"\n >\n {description}\n </div>\n ) : null}\n </div>\n );\n }\n);\n\nInput.displayName = \"ProtonUIInput\";\n"],"names":["Input","forwardRef","prefix","suffix","description","descriptionPosition","isDisabled","error","onChange","label","name","placeholder","type","value","autoFocus","autoComplete","isRequired","isReadOnly","onSubmit","onClear","testId","forwardedRef","inputRef","useRef","prefixRef","suffixRef","containerRef","className","useTheme","ref","useEffect","callbackCount","lastUpdateTime","previousValues","rafId","updateSizes","entries","now","timeSinceLastUpdate","triggeredBy","e","containerWidth","containerWidthChanged","prefixWidth","prefixWidthChanged","_a","suffixWidth","suffixWidthChanged","_b","resizeObserver","inputId","errorId","descriptionId","jsxs","jsx","csx","copyTextToClipboard"],"mappings":"mUAgHaA,EAAQC,EAAA,WACnB,CACE,CACE,OAAAC,EACA,OAAAC,EACA,YAAAC,EACA,oBAAAC,EAAsB,MACtB,WAAAC,EACA,MAAAC,EACA,SAAAC,EACA,MAAAC,EACA,KAAAC,EACA,YAAAC,EACA,KAAAC,EAAO,OACP,MAAAC,EACA,UAAAC,EACA,aAAAC,EACA,WAAAC,EAAa,GACb,WAAAC,EAAa,GACb,SAAAC,EACA,QAAAC,EACA,cAAeC,GAEjBC,IACG,CACG,MAAAC,EAAW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AEJ,EAECI,EACC+C,EAAA,kBAAA,IAAC,MAAA,CACC,KAAK,QACL,UAAWC,EAAAA,IAAI,sBAAuB,oBAAoB,EAC1D,GAAIJ,EAEH,SAAA5C,CAAA,CAAA,EAEDH,GAAeC,IAAwB,SACzCiD,EAAA,kBAAA,IAAC,MAAA,CACC,GAAIF,EACJ,UAAU,qBACV,YAAU,SAET,SAAAhD,CAAA,CAAA,EAED,IACN,CAAA,CAAA,CAEJ,CACF,EAEAJ,EAAM,YAAc"}
|
|
@@ -1,46 +1,47 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { forwardRef as L, useRef as
|
|
3
|
-
import { useTheme as
|
|
1
|
+
import { j as i } from "../../../node_modules/react/jsx-runtime.es.js";
|
|
2
|
+
import { forwardRef as L, useRef as x, useEffect as G } from "react";
|
|
3
|
+
import { useTheme as H } from "../../ThemeProvider.es.js";
|
|
4
4
|
/* empty css */
|
|
5
|
-
import { copyTextToClipboard as
|
|
6
|
-
import { csx as
|
|
7
|
-
const
|
|
5
|
+
import { copyTextToClipboard as M } from "../../../utils/copy.es.js";
|
|
6
|
+
import { csx as d } from "../../../utils/string.es.js";
|
|
7
|
+
const Q = L(
|
|
8
8
|
({
|
|
9
9
|
prefix: u,
|
|
10
|
-
suffix:
|
|
11
|
-
description:
|
|
12
|
-
descriptionPosition:
|
|
13
|
-
isDisabled:
|
|
10
|
+
suffix: l,
|
|
11
|
+
description: r,
|
|
12
|
+
descriptionPosition: T = "top",
|
|
13
|
+
isDisabled: O,
|
|
14
14
|
error: o,
|
|
15
15
|
onChange: y,
|
|
16
|
-
label:
|
|
16
|
+
label: m,
|
|
17
17
|
name: p,
|
|
18
18
|
placeholder: $,
|
|
19
19
|
type: E = "text",
|
|
20
20
|
value: j,
|
|
21
21
|
autoFocus: z,
|
|
22
|
-
autoComplete:
|
|
22
|
+
autoComplete: F,
|
|
23
23
|
isRequired: b = !1,
|
|
24
|
-
isReadOnly:
|
|
24
|
+
isReadOnly: C = !1,
|
|
25
25
|
onSubmit: N,
|
|
26
|
-
onClear:
|
|
26
|
+
onClear: W,
|
|
27
27
|
"data-testid": V
|
|
28
28
|
}, U) => {
|
|
29
|
-
const
|
|
30
|
-
|
|
29
|
+
const D = x(null), c = x(null), h = x(null), s = x(null), { className: B } = H(), q = U || D;
|
|
30
|
+
G(() => {
|
|
31
31
|
if (!s.current) return;
|
|
32
|
-
let
|
|
32
|
+
let n = 0, k = Date.now();
|
|
33
33
|
const a = {
|
|
34
34
|
containerWidth: 0,
|
|
35
35
|
prefixWidth: 0,
|
|
36
36
|
suffixWidth: 0
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
37
|
+
};
|
|
38
|
+
let f = null;
|
|
39
|
+
const J = (_) => {
|
|
40
|
+
n++;
|
|
41
|
+
const R = Date.now(), v = R - k;
|
|
42
|
+
k = R;
|
|
43
|
+
const K = (_ == null ? void 0 : _.map((I) => I.target.className || "unknown").join(",")) || "initial";
|
|
44
|
+
fetch(
|
|
44
45
|
"http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324",
|
|
45
46
|
{
|
|
46
47
|
method: "POST",
|
|
@@ -48,295 +49,348 @@ const M = L(
|
|
|
48
49
|
body: JSON.stringify({
|
|
49
50
|
location: "Input.tsx:149",
|
|
50
51
|
message: "ResizeObserver callback invoked",
|
|
51
|
-
data: { callbackCount:
|
|
52
|
+
data: { callbackCount: n, timeSinceLastUpdate: v, triggeredBy: K },
|
|
52
53
|
timestamp: Date.now(),
|
|
53
54
|
sessionId: "debug-session",
|
|
54
|
-
runId: "
|
|
55
|
+
runId: "post-fix",
|
|
55
56
|
hypothesisId: "A"
|
|
56
57
|
})
|
|
57
58
|
}
|
|
58
59
|
).catch(() => {
|
|
59
|
-
}),
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
60
|
+
}), f !== null && cancelAnimationFrame(f), f = requestAnimationFrame(() => {
|
|
61
|
+
var I, A;
|
|
62
|
+
if (s.current) {
|
|
63
|
+
if (s.current) {
|
|
64
|
+
const t = s.current.offsetWidth || 200, e = t !== a.containerWidth;
|
|
65
|
+
fetch(
|
|
66
|
+
"http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324",
|
|
67
|
+
{
|
|
68
|
+
method: "POST",
|
|
69
|
+
headers: { "Content-Type": "application/json" },
|
|
70
|
+
body: JSON.stringify({
|
|
71
|
+
location: "Input.tsx:152",
|
|
72
|
+
message: "Reading container width",
|
|
73
|
+
data: {
|
|
74
|
+
containerWidth: t,
|
|
75
|
+
previousValue: a.containerWidth,
|
|
76
|
+
changed: e
|
|
77
|
+
},
|
|
78
|
+
timestamp: Date.now(),
|
|
79
|
+
sessionId: "debug-session",
|
|
80
|
+
runId: "post-fix",
|
|
81
|
+
hypothesisId: "C"
|
|
82
|
+
})
|
|
83
|
+
}
|
|
84
|
+
).catch(() => {
|
|
85
|
+
}), e ? (s.current.style.setProperty(
|
|
86
|
+
"--container-width",
|
|
87
|
+
`${t}px`
|
|
88
|
+
), a.containerWidth = t, fetch(
|
|
89
|
+
"http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324",
|
|
90
|
+
{
|
|
91
|
+
method: "POST",
|
|
92
|
+
headers: { "Content-Type": "application/json" },
|
|
93
|
+
body: JSON.stringify({
|
|
94
|
+
location: "Input.tsx:157",
|
|
95
|
+
message: "Set container-width CSS property",
|
|
96
|
+
data: { containerWidth: t, changed: e },
|
|
97
|
+
timestamp: Date.now(),
|
|
98
|
+
sessionId: "debug-session",
|
|
99
|
+
runId: "post-fix",
|
|
100
|
+
hypothesisId: "A"
|
|
101
|
+
})
|
|
102
|
+
}
|
|
103
|
+
).catch(() => {
|
|
104
|
+
})) : fetch(
|
|
105
|
+
"http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324",
|
|
106
|
+
{
|
|
107
|
+
method: "POST",
|
|
108
|
+
headers: { "Content-Type": "application/json" },
|
|
109
|
+
body: JSON.stringify({
|
|
110
|
+
location: "Input.tsx:157",
|
|
111
|
+
message: "Skipped setting container-width (unchanged)",
|
|
112
|
+
data: { containerWidth: t, changed: e },
|
|
113
|
+
timestamp: Date.now(),
|
|
114
|
+
sessionId: "debug-session",
|
|
115
|
+
runId: "post-fix",
|
|
116
|
+
hypothesisId: "C"
|
|
117
|
+
})
|
|
118
|
+
}
|
|
119
|
+
).catch(() => {
|
|
120
|
+
});
|
|
98
121
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
})
|
|
122
|
+
if (c.current) {
|
|
123
|
+
const t = c.current.offsetWidth || 32, e = t !== a.prefixWidth;
|
|
124
|
+
fetch(
|
|
125
|
+
"http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324",
|
|
126
|
+
{
|
|
127
|
+
method: "POST",
|
|
128
|
+
headers: { "Content-Type": "application/json" },
|
|
129
|
+
body: JSON.stringify({
|
|
130
|
+
location: "Input.tsx:163",
|
|
131
|
+
message: "Reading prefix width",
|
|
132
|
+
data: {
|
|
133
|
+
prefixWidth: t,
|
|
134
|
+
previousValue: a.prefixWidth,
|
|
135
|
+
changed: e
|
|
136
|
+
},
|
|
137
|
+
timestamp: Date.now(),
|
|
138
|
+
sessionId: "debug-session",
|
|
139
|
+
runId: "post-fix",
|
|
140
|
+
hypothesisId: "C"
|
|
141
|
+
})
|
|
142
|
+
}
|
|
143
|
+
).catch(() => {
|
|
144
|
+
}), e ? ((I = s.current) == null || I.style.setProperty(
|
|
145
|
+
"--prefix-width",
|
|
146
|
+
`${t}px`
|
|
147
|
+
), a.prefixWidth = t, fetch(
|
|
148
|
+
"http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324",
|
|
149
|
+
{
|
|
150
|
+
method: "POST",
|
|
151
|
+
headers: { "Content-Type": "application/json" },
|
|
152
|
+
body: JSON.stringify({
|
|
153
|
+
location: "Input.tsx:168",
|
|
154
|
+
message: "Set prefix-width CSS property",
|
|
155
|
+
data: { prefixWidth: t, changed: e },
|
|
156
|
+
timestamp: Date.now(),
|
|
157
|
+
sessionId: "debug-session",
|
|
158
|
+
runId: "post-fix",
|
|
159
|
+
hypothesisId: "A"
|
|
160
|
+
})
|
|
161
|
+
}
|
|
162
|
+
).catch(() => {
|
|
163
|
+
})) : fetch(
|
|
164
|
+
"http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324",
|
|
165
|
+
{
|
|
166
|
+
method: "POST",
|
|
167
|
+
headers: { "Content-Type": "application/json" },
|
|
168
|
+
body: JSON.stringify({
|
|
169
|
+
location: "Input.tsx:168",
|
|
170
|
+
message: "Skipped setting prefix-width (unchanged)",
|
|
171
|
+
data: { prefixWidth: t, changed: e },
|
|
172
|
+
timestamp: Date.now(),
|
|
173
|
+
sessionId: "debug-session",
|
|
174
|
+
runId: "post-fix",
|
|
175
|
+
hypothesisId: "C"
|
|
176
|
+
})
|
|
177
|
+
}
|
|
178
|
+
).catch(() => {
|
|
179
|
+
});
|
|
122
180
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
181
|
+
if (h.current) {
|
|
182
|
+
const t = h.current.offsetWidth || 32, e = t !== a.suffixWidth;
|
|
183
|
+
fetch(
|
|
184
|
+
"http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324",
|
|
185
|
+
{
|
|
186
|
+
method: "POST",
|
|
187
|
+
headers: { "Content-Type": "application/json" },
|
|
188
|
+
body: JSON.stringify({
|
|
189
|
+
location: "Input.tsx:174",
|
|
190
|
+
message: "Reading suffix width",
|
|
191
|
+
data: {
|
|
192
|
+
suffixWidth: t,
|
|
193
|
+
previousValue: a.suffixWidth,
|
|
194
|
+
changed: e
|
|
195
|
+
},
|
|
196
|
+
timestamp: Date.now(),
|
|
197
|
+
sessionId: "debug-session",
|
|
198
|
+
runId: "post-fix",
|
|
199
|
+
hypothesisId: "C"
|
|
200
|
+
})
|
|
201
|
+
}
|
|
202
|
+
).catch(() => {
|
|
203
|
+
}), e ? ((A = s.current) == null || A.style.setProperty(
|
|
204
|
+
"--suffix-width",
|
|
205
|
+
`${t}px`
|
|
206
|
+
), a.suffixWidth = t, fetch(
|
|
207
|
+
"http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324",
|
|
208
|
+
{
|
|
209
|
+
method: "POST",
|
|
210
|
+
headers: { "Content-Type": "application/json" },
|
|
211
|
+
body: JSON.stringify({
|
|
212
|
+
location: "Input.tsx:179",
|
|
213
|
+
message: "Set suffix-width CSS property",
|
|
214
|
+
data: { suffixWidth: t, changed: e },
|
|
215
|
+
timestamp: Date.now(),
|
|
216
|
+
sessionId: "debug-session",
|
|
217
|
+
runId: "post-fix",
|
|
218
|
+
hypothesisId: "A"
|
|
219
|
+
})
|
|
220
|
+
}
|
|
221
|
+
).catch(() => {
|
|
222
|
+
})) : fetch(
|
|
223
|
+
"http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324",
|
|
224
|
+
{
|
|
225
|
+
method: "POST",
|
|
226
|
+
headers: { "Content-Type": "application/json" },
|
|
227
|
+
body: JSON.stringify({
|
|
228
|
+
location: "Input.tsx:179",
|
|
229
|
+
message: "Skipped setting suffix-width (unchanged)",
|
|
230
|
+
data: { suffixWidth: t, changed: e },
|
|
231
|
+
timestamp: Date.now(),
|
|
232
|
+
sessionId: "debug-session",
|
|
233
|
+
runId: "post-fix",
|
|
234
|
+
hypothesisId: "C"
|
|
235
|
+
})
|
|
236
|
+
}
|
|
237
|
+
).catch(() => {
|
|
238
|
+
});
|
|
141
239
|
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
},
|
|
160
|
-
timestamp: Date.now(),
|
|
161
|
-
sessionId: "debug-session",
|
|
162
|
-
runId: "run1",
|
|
163
|
-
hypothesisId: "C"
|
|
164
|
-
})
|
|
165
|
-
}
|
|
166
|
-
).catch(() => {
|
|
167
|
-
}), (J = s.current) == null || J.style.setProperty(
|
|
168
|
-
"--suffix-width",
|
|
169
|
-
`${t}px`
|
|
170
|
-
), a.suffixWidth = t, fetch(
|
|
171
|
-
"http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324",
|
|
172
|
-
{
|
|
173
|
-
method: "POST",
|
|
174
|
-
headers: { "Content-Type": "application/json" },
|
|
175
|
-
body: JSON.stringify({
|
|
176
|
-
location: "Input.tsx:179",
|
|
177
|
-
message: "Set suffix-width CSS property",
|
|
178
|
-
data: { suffixWidth: t, changed: i },
|
|
179
|
-
timestamp: Date.now(),
|
|
180
|
-
sessionId: "debug-session",
|
|
181
|
-
runId: "run1",
|
|
182
|
-
hypothesisId: "A"
|
|
183
|
-
})
|
|
184
|
-
}
|
|
185
|
-
).catch(() => {
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
v < 10 && fetch(
|
|
189
|
-
"http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324",
|
|
190
|
-
{
|
|
191
|
-
method: "POST",
|
|
192
|
-
headers: { "Content-Type": "application/json" },
|
|
193
|
-
body: JSON.stringify({
|
|
194
|
-
location: "Input.tsx:185",
|
|
195
|
-
message: "Rapid callback detected",
|
|
196
|
-
data: { callbackCount: e, timeSinceLastUpdate: v },
|
|
197
|
-
timestamp: Date.now(),
|
|
198
|
-
sessionId: "debug-session",
|
|
199
|
-
runId: "run1",
|
|
200
|
-
hypothesisId: "E"
|
|
201
|
-
})
|
|
240
|
+
v < 10 && fetch(
|
|
241
|
+
"http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324",
|
|
242
|
+
{
|
|
243
|
+
method: "POST",
|
|
244
|
+
headers: { "Content-Type": "application/json" },
|
|
245
|
+
body: JSON.stringify({
|
|
246
|
+
location: "Input.tsx:185",
|
|
247
|
+
message: "Rapid callback detected",
|
|
248
|
+
data: { callbackCount: n, timeSinceLastUpdate: v },
|
|
249
|
+
timestamp: Date.now(),
|
|
250
|
+
sessionId: "debug-session",
|
|
251
|
+
runId: "post-fix",
|
|
252
|
+
hypothesisId: "E"
|
|
253
|
+
})
|
|
254
|
+
}
|
|
255
|
+
).catch(() => {
|
|
256
|
+
});
|
|
202
257
|
}
|
|
203
|
-
).catch(() => {
|
|
204
258
|
});
|
|
205
259
|
};
|
|
206
|
-
|
|
207
|
-
const
|
|
208
|
-
return s.current &&
|
|
209
|
-
|
|
260
|
+
J();
|
|
261
|
+
const g = new ResizeObserver(J);
|
|
262
|
+
return s.current && g.observe(s.current), c.current && g.observe(c.current), h.current && g.observe(h.current), () => {
|
|
263
|
+
f !== null && cancelAnimationFrame(f), g.disconnect();
|
|
210
264
|
};
|
|
211
|
-
}, [u,
|
|
212
|
-
const
|
|
213
|
-
return /* @__PURE__ */
|
|
214
|
-
|
|
265
|
+
}, [u, l]);
|
|
266
|
+
const P = `${p}-input`, S = `${p}-error`, w = `${p}-description`;
|
|
267
|
+
return /* @__PURE__ */ i.jsxs("div", { ref: s, className: "proton-Input__container", children: [
|
|
268
|
+
r && T === "top" && /* @__PURE__ */ i.jsx(
|
|
215
269
|
"div",
|
|
216
270
|
{
|
|
217
|
-
id:
|
|
271
|
+
id: w,
|
|
218
272
|
className: "proton-Input__text",
|
|
219
273
|
"aria-live": "polite",
|
|
220
|
-
children:
|
|
274
|
+
children: r
|
|
221
275
|
}
|
|
222
276
|
),
|
|
223
|
-
/* @__PURE__ */
|
|
277
|
+
/* @__PURE__ */ i.jsxs(
|
|
224
278
|
"div",
|
|
225
279
|
{
|
|
226
|
-
className:
|
|
280
|
+
className: d(
|
|
227
281
|
"proton-Input__container-inner",
|
|
228
282
|
u && "proton-Input__has-prefix",
|
|
229
|
-
|
|
283
|
+
l && "proton-Input__has-suffix"
|
|
230
284
|
),
|
|
231
285
|
children: [
|
|
232
|
-
u && /* @__PURE__ */
|
|
286
|
+
u && /* @__PURE__ */ i.jsx(
|
|
233
287
|
"div",
|
|
234
288
|
{
|
|
235
289
|
ref: c,
|
|
236
|
-
className:
|
|
290
|
+
className: d(
|
|
237
291
|
"proton-Input__descriptor",
|
|
238
292
|
"proton-Input__prefix"
|
|
239
293
|
),
|
|
240
294
|
children: u
|
|
241
295
|
}
|
|
242
296
|
),
|
|
243
|
-
/* @__PURE__ */
|
|
297
|
+
/* @__PURE__ */ i.jsx(
|
|
244
298
|
"input",
|
|
245
299
|
{
|
|
246
|
-
id:
|
|
300
|
+
id: P,
|
|
247
301
|
name: p,
|
|
248
302
|
type: E,
|
|
249
303
|
value: j,
|
|
250
|
-
onChange: (
|
|
251
|
-
y == null || y(
|
|
304
|
+
onChange: (n) => {
|
|
305
|
+
y == null || y(n.target.value);
|
|
252
306
|
},
|
|
253
|
-
onKeyDown: (
|
|
254
|
-
switch (
|
|
307
|
+
onKeyDown: (n) => {
|
|
308
|
+
switch (n.key) {
|
|
255
309
|
case "Enter":
|
|
256
|
-
N && (
|
|
310
|
+
N && (n.preventDefault(), N(n));
|
|
257
311
|
break;
|
|
258
312
|
case "Escape":
|
|
259
|
-
|
|
313
|
+
W && (n.preventDefault(), W());
|
|
260
314
|
break;
|
|
261
315
|
}
|
|
262
316
|
},
|
|
263
317
|
onCopy: async () => {
|
|
264
|
-
var
|
|
265
|
-
return await
|
|
318
|
+
var n;
|
|
319
|
+
return await M((n = D.current) == null ? void 0 : n.value);
|
|
266
320
|
},
|
|
267
|
-
disabled:
|
|
268
|
-
readOnly:
|
|
321
|
+
disabled: O,
|
|
322
|
+
readOnly: C,
|
|
269
323
|
required: b,
|
|
270
324
|
autoFocus: z,
|
|
271
|
-
autoComplete:
|
|
272
|
-
placeholder:
|
|
273
|
-
"aria-label":
|
|
325
|
+
autoComplete: F ? "on" : "off",
|
|
326
|
+
placeholder: m ? void 0 : $,
|
|
327
|
+
"aria-label": m || p,
|
|
274
328
|
"aria-invalid": !!o,
|
|
275
|
-
"aria-errormessage": typeof o == "string" ? o :
|
|
329
|
+
"aria-errormessage": typeof o == "string" ? o : S,
|
|
276
330
|
"aria-required": b,
|
|
277
|
-
"aria-readonly":
|
|
278
|
-
"aria-describedby": o ?
|
|
279
|
-
"aria-disabled":
|
|
331
|
+
"aria-readonly": C,
|
|
332
|
+
"aria-describedby": o ? S : r ? w : void 0,
|
|
333
|
+
"aria-disabled": O,
|
|
280
334
|
"data-testid": V,
|
|
281
|
-
ref:
|
|
282
|
-
className:
|
|
335
|
+
ref: q,
|
|
336
|
+
className: d(
|
|
283
337
|
"proton-Input",
|
|
284
338
|
o && "proton-Input--error",
|
|
285
|
-
|
|
339
|
+
m && "proton-Input__label-top",
|
|
286
340
|
B
|
|
287
341
|
)
|
|
288
342
|
}
|
|
289
343
|
),
|
|
290
|
-
/* @__PURE__ */
|
|
344
|
+
/* @__PURE__ */ i.jsxs(
|
|
291
345
|
"label",
|
|
292
346
|
{
|
|
293
|
-
htmlFor:
|
|
294
|
-
className:
|
|
347
|
+
htmlFor: P,
|
|
348
|
+
className: d(
|
|
295
349
|
"proton-Input__label",
|
|
296
350
|
j && "proton-Input__label--filled"
|
|
297
351
|
),
|
|
298
352
|
children: [
|
|
299
|
-
|
|
300
|
-
b && /* @__PURE__ */
|
|
353
|
+
m,
|
|
354
|
+
b && /* @__PURE__ */ i.jsx("span", { "aria-hidden": "true", children: " *" })
|
|
301
355
|
]
|
|
302
356
|
}
|
|
303
357
|
),
|
|
304
|
-
|
|
358
|
+
l && /* @__PURE__ */ i.jsx(
|
|
305
359
|
"div",
|
|
306
360
|
{
|
|
307
361
|
ref: h,
|
|
308
|
-
className:
|
|
362
|
+
className: d(
|
|
309
363
|
"proton-Input__descriptor",
|
|
310
364
|
"proton-Input__suffix"
|
|
311
365
|
),
|
|
312
|
-
children:
|
|
366
|
+
children: l
|
|
313
367
|
}
|
|
314
368
|
)
|
|
315
369
|
]
|
|
316
370
|
}
|
|
317
371
|
),
|
|
318
|
-
o ? /* @__PURE__ */
|
|
372
|
+
o ? /* @__PURE__ */ i.jsx(
|
|
319
373
|
"div",
|
|
320
374
|
{
|
|
321
375
|
role: "alert",
|
|
322
|
-
className:
|
|
323
|
-
id:
|
|
376
|
+
className: d("proton-Input__error", "proton-Input__text"),
|
|
377
|
+
id: S,
|
|
324
378
|
children: o
|
|
325
379
|
}
|
|
326
|
-
) :
|
|
380
|
+
) : r && T === "bottom" ? /* @__PURE__ */ i.jsx(
|
|
327
381
|
"div",
|
|
328
382
|
{
|
|
329
|
-
id:
|
|
383
|
+
id: w,
|
|
330
384
|
className: "proton-Input__text",
|
|
331
385
|
"aria-live": "polite",
|
|
332
|
-
children:
|
|
386
|
+
children: r
|
|
333
387
|
}
|
|
334
388
|
) : null
|
|
335
389
|
] });
|
|
336
390
|
}
|
|
337
391
|
);
|
|
338
|
-
|
|
392
|
+
Q.displayName = "ProtonUIInput";
|
|
339
393
|
export {
|
|
340
|
-
|
|
394
|
+
Q as Input
|
|
341
395
|
};
|
|
342
396
|
//# sourceMappingURL=Input.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.es.js","sources":["../../../../src/components/Input/BaseInput/Input.tsx"],"sourcesContent":["\"use client\";\n\nimport React, { forwardRef, useEffect, useRef } from \"react\";\n\nimport { useTheme } from \"../../ThemeProvider\";\nimport { csx } from \"../../../utils\";\nimport \"./Input.css\";\nimport { copyTextToClipboard } from \"../../../utils/copy\";\n\nexport interface BaseInputProps {\n /**\n * onChange handler for the input\n */\n onChange?: (value: string) => void;\n\n /** Whether the input is disabled. */\n isDisabled?: boolean;\n\n /** Description text shown above the input. */\n description?: React.ReactNode | string;\n\n /**\n * The position of the description text.\n * @default \"top\"\n */\n descriptionPosition?: \"top\" | \"bottom\";\n\n /** Error state that changes the input's visual style and displays an error message. */\n error?: React.ReactNode | string;\n\n /**\n * Label for the input element.\n * @note When a label is provided, the input will have extra padding, and the label will float above the text input when focused or filled.\n */\n label?: string;\n\n /** Test ID for the component. */\n \"data-testid\"?: string;\n\n /** Content to display before the input. Typically used for icons. */\n prefix?: React.ReactNode;\n\n /** Content to display after the input. Typically used for icons. */\n suffix?: React.ReactNode;\n\n /**\n * Should the browser's autocomplete be enabled?\n * @external https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete\n */\n autoComplete?: boolean;\n\n /**\n * Should the input be autofocused?\n * @external https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autofocus\n */\n autoFocus?: boolean;\n\n /**\n * The name attribute of the input element.\n * @external https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/name\n */\n name: string;\n\n /**\n * The placeholder text to display when the input is empty.\n * @note label takes precedence over placeholder, if both are provided.\n * @external https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/placeholder\n */\n placeholder?: string;\n\n /**\n * The type attribute of the input element.\n * @external https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/type\n * @default \"text\"\n */\n type?: string;\n\n /**\n * The value of the input.\n * @external https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#value\n */\n value?: string;\n\n /**\n * Whether the input is required.\n * @default false\n */\n isRequired?: boolean;\n\n /**\n * Whether the input is read-only.\n * @default false\n */\n isReadOnly?: boolean;\n\n /**\n * Called when the input is submitted (e.g. by pressing Enter).\n */\n onSubmit?: React.FormEventHandler<HTMLInputElement>;\n\n /**\n * Called when the input is cleared (e.g. by pressing Escape).\n */\n onClear?: () => void;\n}\n\n/**\n * A controlled and customizable input component with support for labels, prefixes, suffixes, and error states.\n *\n * API:\n * - {@link BaseInputProps}\n */\nexport const Input = forwardRef<HTMLInputElement, BaseInputProps>(\n (\n {\n prefix,\n suffix,\n description,\n descriptionPosition = \"top\",\n isDisabled,\n error,\n onChange,\n label,\n name,\n placeholder,\n type = \"text\",\n value,\n autoFocus,\n autoComplete,\n isRequired = false,\n isReadOnly = false,\n onSubmit,\n onClear,\n \"data-testid\": testId,\n },\n forwardedRef: React.RefObject<HTMLInputElement>\n ) => {\n const inputRef = useRef<HTMLInputElement>(null);\n const prefixRef = useRef<HTMLDivElement>(null);\n const suffixRef = useRef<HTMLDivElement>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n const { className } = useTheme();\n const ref = forwardedRef || inputRef;\n\n // Control dynamic prefix and suffix widths using ResizeObserver\n useEffect(() => {\n if (!containerRef.current) return;\n\n // #region agent log\n let callbackCount = 0;\n let lastUpdateTime = Date.now();\n const previousValues = {\n containerWidth: 0,\n prefixWidth: 0,\n suffixWidth: 0,\n };\n // #endregion\n\n const updateSizes = (entries?: ResizeObserverEntry[]) => {\n // #region agent log\n callbackCount++;\n const now = Date.now();\n const timeSinceLastUpdate = now - lastUpdateTime;\n lastUpdateTime = now;\n const triggeredBy =\n entries?.map((e) => e.target.className || \"unknown\").join(\",\") ||\n \"initial\";\n fetch(\n \"http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324\",\n {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n location: \"Input.tsx:149\",\n message: \"ResizeObserver callback invoked\",\n data: { callbackCount, timeSinceLastUpdate, triggeredBy },\n timestamp: Date.now(),\n sessionId: \"debug-session\",\n runId: \"run1\",\n hypothesisId: \"A\",\n }),\n }\n ).catch(() => {});\n // #endregion\n\n if (containerRef.current) {\n const containerWidth = containerRef.current.offsetWidth || 200;\n // #region agent log\n const containerWidthChanged =\n containerWidth !== previousValues.containerWidth;\n fetch(\n \"http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324\",\n {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n location: \"Input.tsx:152\",\n message: \"Reading container width\",\n data: {\n containerWidth,\n previousValue: previousValues.containerWidth,\n changed: containerWidthChanged,\n },\n timestamp: Date.now(),\n sessionId: \"debug-session\",\n runId: \"run1\",\n hypothesisId: \"C\",\n }),\n }\n ).catch(() => {});\n // #endregion\n containerRef.current.style.setProperty(\n \"--container-width\",\n `${containerWidth}px`\n );\n // #region agent log\n previousValues.containerWidth = containerWidth;\n fetch(\n \"http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324\",\n {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n location: \"Input.tsx:157\",\n message: \"Set container-width CSS property\",\n data: { containerWidth, changed: containerWidthChanged },\n timestamp: Date.now(),\n sessionId: \"debug-session\",\n runId: \"run1\",\n hypothesisId: \"A\",\n }),\n }\n ).catch(() => {});\n // #endregion\n }\n\n if (prefixRef.current) {\n const prefixWidth = prefixRef.current.offsetWidth || 32;\n // #region agent log\n const prefixWidthChanged = prefixWidth !== previousValues.prefixWidth;\n fetch(\n \"http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324\",\n {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n location: \"Input.tsx:163\",\n message: \"Reading prefix width\",\n data: {\n prefixWidth,\n previousValue: previousValues.prefixWidth,\n changed: prefixWidthChanged,\n },\n timestamp: Date.now(),\n sessionId: \"debug-session\",\n runId: \"run1\",\n hypothesisId: \"C\",\n }),\n }\n ).catch(() => {});\n // #endregion\n containerRef.current?.style.setProperty(\n \"--prefix-width\",\n `${prefixWidth}px`\n );\n // #region agent log\n previousValues.prefixWidth = prefixWidth;\n fetch(\n \"http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324\",\n {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n location: \"Input.tsx:168\",\n message: \"Set prefix-width CSS property\",\n data: { prefixWidth, changed: prefixWidthChanged },\n timestamp: Date.now(),\n sessionId: \"debug-session\",\n runId: \"run1\",\n hypothesisId: \"A\",\n }),\n }\n ).catch(() => {});\n // #endregion\n }\n\n if (suffixRef.current) {\n const suffixWidth = suffixRef.current.offsetWidth || 32;\n // #region agent log\n const suffixWidthChanged = suffixWidth !== previousValues.suffixWidth;\n fetch(\n \"http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324\",\n {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n location: \"Input.tsx:174\",\n message: \"Reading suffix width\",\n data: {\n suffixWidth,\n previousValue: previousValues.suffixWidth,\n changed: suffixWidthChanged,\n },\n timestamp: Date.now(),\n sessionId: \"debug-session\",\n runId: \"run1\",\n hypothesisId: \"C\",\n }),\n }\n ).catch(() => {});\n // #endregion\n containerRef.current?.style.setProperty(\n \"--suffix-width\",\n `${suffixWidth}px`\n );\n // #region agent log\n previousValues.suffixWidth = suffixWidth;\n fetch(\n \"http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324\",\n {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n location: \"Input.tsx:179\",\n message: \"Set suffix-width CSS property\",\n data: { suffixWidth, changed: suffixWidthChanged },\n timestamp: Date.now(),\n sessionId: \"debug-session\",\n runId: \"run1\",\n hypothesisId: \"A\",\n }),\n }\n ).catch(() => {});\n // #endregion\n }\n\n // #region agent log\n if (timeSinceLastUpdate < 10) {\n fetch(\n \"http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324\",\n {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n location: \"Input.tsx:185\",\n message: \"Rapid callback detected\",\n data: { callbackCount, timeSinceLastUpdate },\n timestamp: Date.now(),\n sessionId: \"debug-session\",\n runId: \"run1\",\n hypothesisId: \"E\",\n }),\n }\n ).catch(() => {});\n }\n // #endregion\n };\n\n updateSizes();\n\n const resizeObserver = new ResizeObserver(updateSizes);\n\n if (containerRef.current) {\n resizeObserver.observe(containerRef.current);\n }\n if (prefixRef.current) {\n resizeObserver.observe(prefixRef.current);\n }\n if (suffixRef.current) {\n resizeObserver.observe(suffixRef.current);\n }\n\n return () => {\n resizeObserver.disconnect();\n };\n }, [prefix, suffix]);\n\n const inputId = `${name}-input`;\n const errorId = `${name}-error`;\n const descriptionId = `${name}-description`;\n\n return (\n <div ref={containerRef} className=\"proton-Input__container\">\n {description && descriptionPosition === \"top\" && (\n <div\n id={descriptionId}\n className=\"proton-Input__text\"\n aria-live=\"polite\"\n >\n {description}\n </div>\n )}\n <div\n className={csx(\n \"proton-Input__container-inner\",\n prefix && \"proton-Input__has-prefix\",\n suffix && \"proton-Input__has-suffix\"\n )}\n >\n {prefix && (\n <div\n ref={prefixRef}\n className={csx(\n \"proton-Input__descriptor\",\n \"proton-Input__prefix\"\n )}\n >\n {prefix}\n </div>\n )}\n\n <input\n id={inputId}\n name={name}\n type={type}\n value={value}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) => {\n onChange?.(e.target.value);\n }}\n onKeyDown={(e: React.KeyboardEvent<HTMLInputElement>) => {\n switch (e.key) {\n case \"Enter\":\n if (onSubmit) {\n e.preventDefault();\n onSubmit(e);\n }\n break;\n case \"Escape\":\n if (onClear) {\n e.preventDefault();\n onClear();\n }\n break;\n }\n }}\n onCopy={async () =>\n await copyTextToClipboard(inputRef.current?.value)\n }\n disabled={isDisabled}\n readOnly={isReadOnly}\n required={isRequired}\n autoFocus={autoFocus}\n autoComplete={autoComplete ? \"on\" : \"off\"}\n placeholder={label ? undefined : placeholder}\n aria-label={label || name}\n aria-invalid={Boolean(error)}\n aria-errormessage={typeof error === \"string\" ? error : errorId}\n aria-required={isRequired}\n aria-readonly={isReadOnly}\n aria-describedby={\n error ? errorId : description ? descriptionId : undefined\n }\n aria-disabled={isDisabled}\n data-testid={testId}\n ref={ref}\n className={csx(\n \"proton-Input\",\n error && \"proton-Input--error\",\n label && \"proton-Input__label-top\",\n className\n )}\n />\n\n <label\n htmlFor={inputId}\n className={csx(\n \"proton-Input__label\",\n value && \"proton-Input__label--filled\"\n )}\n >\n {label}\n {isRequired && <span aria-hidden=\"true\"> *</span>}\n </label>\n\n {suffix && (\n <div\n ref={suffixRef}\n className={csx(\n \"proton-Input__descriptor\",\n \"proton-Input__suffix\"\n )}\n >\n {suffix}\n </div>\n )}\n </div>\n\n {error ? (\n <div\n role=\"alert\"\n className={csx(\"proton-Input__error\", \"proton-Input__text\")}\n id={errorId}\n >\n {error}\n </div>\n ) : description && descriptionPosition === \"bottom\" ? (\n <div\n id={descriptionId}\n className=\"proton-Input__text\"\n aria-live=\"polite\"\n >\n {description}\n </div>\n ) : null}\n </div>\n );\n }\n);\n\nInput.displayName = \"ProtonUIInput\";\n"],"names":["Input","forwardRef","prefix","suffix","description","descriptionPosition","isDisabled","error","onChange","label","name","placeholder","type","value","autoFocus","autoComplete","isRequired","isReadOnly","onSubmit","onClear","testId","forwardedRef","inputRef","useRef","prefixRef","suffixRef","containerRef","className","useTheme","ref","useEffect","callbackCount","lastUpdateTime","previousValues","updateSizes","entries","now","timeSinceLastUpdate","triggeredBy","e","containerWidth","containerWidthChanged","prefixWidth","prefixWidthChanged","_a","suffixWidth","suffixWidthChanged","_b","resizeObserver","inputId","errorId","descriptionId","jsxs","jsx","csx","copyTextToClipboard"],"mappings":";;;;;;AAgHO,MAAMA,IAAQC;AAAA,EACnB,CACE;AAAA,IACE,QAAAC;AAAA,IACA,QAAAC;AAAA,IACA,aAAAC;AAAA,IACA,qBAAAC,IAAsB;AAAA,IACtB,YAAAC;AAAA,IACA,OAAAC;AAAA,IACA,UAAAC;AAAA,IACA,OAAAC;AAAA,IACA,MAAAC;AAAA,IACA,aAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,OAAAC;AAAA,IACA,WAAAC;AAAA,IACA,cAAAC;AAAA,IACA,YAAAC,IAAa;AAAA,IACb,YAAAC,IAAa;AAAA,IACb,UAAAC;AAAA,IACA,SAAAC;AAAA,IACA,eAAeC;AAAA,KAEjBC,MACG;AACG,UAAAC,IAAWC,EAAyB,IAAI,GACxCC,IAAYD,EAAuB,IAAI,GACvCE,IAAYF,EAAuB,IAAI,GACvCG,IAAeH,EAAuB,IAAI,GAC1C,EAAE,WAAAI,MAAcC,KAChBC,IAAMR,KAAgBC;AAG5B,IAAAQ,EAAU,MAAM;AACV,UAAA,CAACJ,EAAa,QAAS;AAG3B,UAAIK,IAAgB,GAChBC,IAAiB,KAAK;AAC1B,YAAMC,IAAiB;AAAA,QACrB,gBAAgB;AAAA,QAChB,aAAa;AAAA,QACb,aAAa;AAAA,MAAA,GAITC,IAAc,CAACC,MAAoC;;AAEvD,QAAAJ;AACM,cAA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BAAAA,EAAA,IAAC,QAAK,EAAA,eAAY,QAAO,UAAE,MAAA;AAAA,gBAAA;AAAA,cAAA;AAAA,YAC5C;AAAA,YAEClD,KACCkD,gBAAAA,EAAA;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,KAAK5B;AAAA,gBACL,WAAW6B;AAAA,kBACT;AAAA,kBACA;AAAA,gBACF;AAAA,gBAEC,UAAAnD;AAAA,cAAA;AAAA,YACH;AAAA,UAAA;AAAA,QAAA;AAAA,MAEJ;AAAA,MAECI,IACC8C,gBAAAA,EAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,WAAWC,EAAI,uBAAuB,oBAAoB;AAAA,UAC1D,IAAIJ;AAAA,UAEH,UAAA3C;AAAA,QAAA;AAAA,MAAA,IAEDH,KAAeC,MAAwB,WACzCgD,gBAAAA,EAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,IAAIF;AAAA,UACJ,WAAU;AAAA,UACV,aAAU;AAAA,UAET,UAAA/C;AAAA,QAAA;AAAA,MAAA,IAED;AAAA,IACN,EAAA,CAAA;AAAA,EAEJ;AACF;AAEAJ,EAAM,cAAc;"}
|
|
1
|
+
{"version":3,"file":"Input.es.js","sources":["../../../../src/components/Input/BaseInput/Input.tsx"],"sourcesContent":["\"use client\";\n\nimport React, { forwardRef, useEffect, useRef } from \"react\";\n\nimport { useTheme } from \"../../ThemeProvider\";\nimport { csx } from \"../../../utils\";\nimport \"./Input.css\";\nimport { copyTextToClipboard } from \"../../../utils/copy\";\n\nexport interface BaseInputProps {\n /**\n * onChange handler for the input\n */\n onChange?: (value: string) => void;\n\n /** Whether the input is disabled. */\n isDisabled?: boolean;\n\n /** Description text shown above the input. */\n description?: React.ReactNode | string;\n\n /**\n * The position of the description text.\n * @default \"top\"\n */\n descriptionPosition?: \"top\" | \"bottom\";\n\n /** Error state that changes the input's visual style and displays an error message. */\n error?: React.ReactNode | string;\n\n /**\n * Label for the input element.\n * @note When a label is provided, the input will have extra padding, and the label will float above the text input when focused or filled.\n */\n label?: string;\n\n /** Test ID for the component. */\n \"data-testid\"?: string;\n\n /** Content to display before the input. Typically used for icons. */\n prefix?: React.ReactNode;\n\n /** Content to display after the input. Typically used for icons. */\n suffix?: React.ReactNode;\n\n /**\n * Should the browser's autocomplete be enabled?\n * @external https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete\n */\n autoComplete?: boolean;\n\n /**\n * Should the input be autofocused?\n * @external https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autofocus\n */\n autoFocus?: boolean;\n\n /**\n * The name attribute of the input element.\n * @external https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/name\n */\n name: string;\n\n /**\n * The placeholder text to display when the input is empty.\n * @note label takes precedence over placeholder, if both are provided.\n * @external https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/placeholder\n */\n placeholder?: string;\n\n /**\n * The type attribute of the input element.\n * @external https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/type\n * @default \"text\"\n */\n type?: string;\n\n /**\n * The value of the input.\n * @external https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#value\n */\n value?: string;\n\n /**\n * Whether the input is required.\n * @default false\n */\n isRequired?: boolean;\n\n /**\n * Whether the input is read-only.\n * @default false\n */\n isReadOnly?: boolean;\n\n /**\n * Called when the input is submitted (e.g. by pressing Enter).\n */\n onSubmit?: React.FormEventHandler<HTMLInputElement>;\n\n /**\n * Called when the input is cleared (e.g. by pressing Escape).\n */\n onClear?: () => void;\n}\n\n/**\n * A controlled and customizable input component with support for labels, prefixes, suffixes, and error states.\n *\n * API:\n * - {@link BaseInputProps}\n */\nexport const Input = forwardRef<HTMLInputElement, BaseInputProps>(\n (\n {\n prefix,\n suffix,\n description,\n descriptionPosition = \"top\",\n isDisabled,\n error,\n onChange,\n label,\n name,\n placeholder,\n type = \"text\",\n value,\n autoFocus,\n autoComplete,\n isRequired = false,\n isReadOnly = false,\n onSubmit,\n onClear,\n \"data-testid\": testId,\n },\n forwardedRef: React.RefObject<HTMLInputElement>\n ) => {\n const inputRef = useRef<HTMLInputElement>(null);\n const prefixRef = useRef<HTMLDivElement>(null);\n const suffixRef = useRef<HTMLDivElement>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n const { className } = useTheme();\n const ref = forwardedRef || inputRef;\n\n // Control dynamic prefix and suffix widths using ResizeObserver\n useEffect(() => {\n if (!containerRef.current) return;\n\n // #region agent log\n let callbackCount = 0;\n let lastUpdateTime = Date.now();\n const previousValues = {\n containerWidth: 0,\n prefixWidth: 0,\n suffixWidth: 0,\n };\n // #endregion\n\n let rafId: number | null = null;\n\n const updateSizes = (entries?: ResizeObserverEntry[]) => {\n // #region agent log\n callbackCount++;\n const now = Date.now();\n const timeSinceLastUpdate = now - lastUpdateTime;\n lastUpdateTime = now;\n const triggeredBy =\n entries?.map((e) => e.target.className || \"unknown\").join(\",\") ||\n \"initial\";\n fetch(\n \"http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324\",\n {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n location: \"Input.tsx:149\",\n message: \"ResizeObserver callback invoked\",\n data: { callbackCount, timeSinceLastUpdate, triggeredBy },\n timestamp: Date.now(),\n sessionId: \"debug-session\",\n runId: \"post-fix\",\n hypothesisId: \"A\",\n }),\n }\n ).catch(() => {});\n // #endregion\n\n // Cancel any pending animation frame\n if (rafId !== null) {\n cancelAnimationFrame(rafId);\n }\n\n // Batch DOM updates in requestAnimationFrame to avoid synchronous mutations\n rafId = requestAnimationFrame(() => {\n if (!containerRef.current) return;\n\n if (containerRef.current) {\n const containerWidth = containerRef.current.offsetWidth || 200;\n // #region agent log\n const containerWidthChanged =\n containerWidth !== previousValues.containerWidth;\n fetch(\n \"http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324\",\n {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n location: \"Input.tsx:152\",\n message: \"Reading container width\",\n data: {\n containerWidth,\n previousValue: previousValues.containerWidth,\n changed: containerWidthChanged,\n },\n timestamp: Date.now(),\n sessionId: \"debug-session\",\n runId: \"post-fix\",\n hypothesisId: \"C\",\n }),\n }\n ).catch(() => {});\n // #endregion\n // Only set CSS property if value actually changed\n if (containerWidthChanged) {\n containerRef.current.style.setProperty(\n \"--container-width\",\n `${containerWidth}px`\n );\n // #region agent log\n previousValues.containerWidth = containerWidth;\n fetch(\n \"http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324\",\n {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n location: \"Input.tsx:157\",\n message: \"Set container-width CSS property\",\n data: { containerWidth, changed: containerWidthChanged },\n timestamp: Date.now(),\n sessionId: \"debug-session\",\n runId: \"post-fix\",\n hypothesisId: \"A\",\n }),\n }\n ).catch(() => {});\n // #endregion\n } else {\n // #region agent log\n fetch(\n \"http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324\",\n {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n location: \"Input.tsx:157\",\n message: \"Skipped setting container-width (unchanged)\",\n data: { containerWidth, changed: containerWidthChanged },\n timestamp: Date.now(),\n sessionId: \"debug-session\",\n runId: \"post-fix\",\n hypothesisId: \"C\",\n }),\n }\n ).catch(() => {});\n // #endregion\n }\n }\n\n if (prefixRef.current) {\n const prefixWidth = prefixRef.current.offsetWidth || 32;\n // #region agent log\n const prefixWidthChanged =\n prefixWidth !== previousValues.prefixWidth;\n fetch(\n \"http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324\",\n {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n location: \"Input.tsx:163\",\n message: \"Reading prefix width\",\n data: {\n prefixWidth,\n previousValue: previousValues.prefixWidth,\n changed: prefixWidthChanged,\n },\n timestamp: Date.now(),\n sessionId: \"debug-session\",\n runId: \"post-fix\",\n hypothesisId: \"C\",\n }),\n }\n ).catch(() => {});\n // #endregion\n // Only set CSS property if value actually changed\n if (prefixWidthChanged) {\n containerRef.current?.style.setProperty(\n \"--prefix-width\",\n `${prefixWidth}px`\n );\n // #region agent log\n previousValues.prefixWidth = prefixWidth;\n fetch(\n \"http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324\",\n {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n location: \"Input.tsx:168\",\n message: \"Set prefix-width CSS property\",\n data: { prefixWidth, changed: prefixWidthChanged },\n timestamp: Date.now(),\n sessionId: \"debug-session\",\n runId: \"post-fix\",\n hypothesisId: \"A\",\n }),\n }\n ).catch(() => {});\n // #endregion\n } else {\n // #region agent log\n fetch(\n \"http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324\",\n {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n location: \"Input.tsx:168\",\n message: \"Skipped setting prefix-width (unchanged)\",\n data: { prefixWidth, changed: prefixWidthChanged },\n timestamp: Date.now(),\n sessionId: \"debug-session\",\n runId: \"post-fix\",\n hypothesisId: \"C\",\n }),\n }\n ).catch(() => {});\n // #endregion\n }\n }\n\n if (suffixRef.current) {\n const suffixWidth = suffixRef.current.offsetWidth || 32;\n // #region agent log\n const suffixWidthChanged =\n suffixWidth !== previousValues.suffixWidth;\n fetch(\n \"http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324\",\n {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n location: \"Input.tsx:174\",\n message: \"Reading suffix width\",\n data: {\n suffixWidth,\n previousValue: previousValues.suffixWidth,\n changed: suffixWidthChanged,\n },\n timestamp: Date.now(),\n sessionId: \"debug-session\",\n runId: \"post-fix\",\n hypothesisId: \"C\",\n }),\n }\n ).catch(() => {});\n // #endregion\n // Only set CSS property if value actually changed\n if (suffixWidthChanged) {\n containerRef.current?.style.setProperty(\n \"--suffix-width\",\n `${suffixWidth}px`\n );\n // #region agent log\n previousValues.suffixWidth = suffixWidth;\n fetch(\n \"http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324\",\n {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n location: \"Input.tsx:179\",\n message: \"Set suffix-width CSS property\",\n data: { suffixWidth, changed: suffixWidthChanged },\n timestamp: Date.now(),\n sessionId: \"debug-session\",\n runId: \"post-fix\",\n hypothesisId: \"A\",\n }),\n }\n ).catch(() => {});\n // #endregion\n } else {\n // #region agent log\n fetch(\n \"http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324\",\n {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n location: \"Input.tsx:179\",\n message: \"Skipped setting suffix-width (unchanged)\",\n data: { suffixWidth, changed: suffixWidthChanged },\n timestamp: Date.now(),\n sessionId: \"debug-session\",\n runId: \"post-fix\",\n hypothesisId: \"C\",\n }),\n }\n ).catch(() => {});\n // #endregion\n }\n }\n\n // #region agent log\n if (timeSinceLastUpdate < 10) {\n fetch(\n \"http://127.0.0.1:7243/ingest/f16ad2de-908b-4cb9-a792-256436a5e324\",\n {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n location: \"Input.tsx:185\",\n message: \"Rapid callback detected\",\n data: { callbackCount, timeSinceLastUpdate },\n timestamp: Date.now(),\n sessionId: \"debug-session\",\n runId: \"post-fix\",\n hypothesisId: \"E\",\n }),\n }\n ).catch(() => {});\n }\n // #endregion\n });\n };\n\n updateSizes();\n\n const resizeObserver = new ResizeObserver(updateSizes);\n\n if (containerRef.current) {\n resizeObserver.observe(containerRef.current);\n }\n if (prefixRef.current) {\n resizeObserver.observe(prefixRef.current);\n }\n if (suffixRef.current) {\n resizeObserver.observe(suffixRef.current);\n }\n\n return () => {\n if (rafId !== null) {\n cancelAnimationFrame(rafId);\n }\n resizeObserver.disconnect();\n };\n }, [prefix, suffix]);\n\n const inputId = `${name}-input`;\n const errorId = `${name}-error`;\n const descriptionId = `${name}-description`;\n\n return (\n <div ref={containerRef} className=\"proton-Input__container\">\n {description && descriptionPosition === \"top\" && (\n <div\n id={descriptionId}\n className=\"proton-Input__text\"\n aria-live=\"polite\"\n >\n {description}\n </div>\n )}\n <div\n className={csx(\n \"proton-Input__container-inner\",\n prefix && \"proton-Input__has-prefix\",\n suffix && \"proton-Input__has-suffix\"\n )}\n >\n {prefix && (\n <div\n ref={prefixRef}\n className={csx(\n \"proton-Input__descriptor\",\n \"proton-Input__prefix\"\n )}\n >\n {prefix}\n </div>\n )}\n\n <input\n id={inputId}\n name={name}\n type={type}\n value={value}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) => {\n onChange?.(e.target.value);\n }}\n onKeyDown={(e: React.KeyboardEvent<HTMLInputElement>) => {\n switch (e.key) {\n case \"Enter\":\n if (onSubmit) {\n e.preventDefault();\n onSubmit(e);\n }\n break;\n case \"Escape\":\n if (onClear) {\n e.preventDefault();\n onClear();\n }\n break;\n }\n }}\n onCopy={async () =>\n await copyTextToClipboard(inputRef.current?.value)\n }\n disabled={isDisabled}\n readOnly={isReadOnly}\n required={isRequired}\n autoFocus={autoFocus}\n autoComplete={autoComplete ? \"on\" : \"off\"}\n placeholder={label ? undefined : placeholder}\n aria-label={label || name}\n aria-invalid={Boolean(error)}\n aria-errormessage={typeof error === \"string\" ? error : errorId}\n aria-required={isRequired}\n aria-readonly={isReadOnly}\n aria-describedby={\n error ? errorId : description ? descriptionId : undefined\n }\n aria-disabled={isDisabled}\n data-testid={testId}\n ref={ref}\n className={csx(\n \"proton-Input\",\n error && \"proton-Input--error\",\n label && \"proton-Input__label-top\",\n className\n )}\n />\n\n <label\n htmlFor={inputId}\n className={csx(\n \"proton-Input__label\",\n value && \"proton-Input__label--filled\"\n )}\n >\n {label}\n {isRequired && <span aria-hidden=\"true\"> *</span>}\n </label>\n\n {suffix && (\n <div\n ref={suffixRef}\n className={csx(\n \"proton-Input__descriptor\",\n \"proton-Input__suffix\"\n )}\n >\n {suffix}\n </div>\n )}\n </div>\n\n {error ? (\n <div\n role=\"alert\"\n className={csx(\"proton-Input__error\", \"proton-Input__text\")}\n id={errorId}\n >\n {error}\n </div>\n ) : description && descriptionPosition === \"bottom\" ? (\n <div\n id={descriptionId}\n className=\"proton-Input__text\"\n aria-live=\"polite\"\n >\n {description}\n </div>\n ) : null}\n </div>\n );\n }\n);\n\nInput.displayName = \"ProtonUIInput\";\n"],"names":["Input","forwardRef","prefix","suffix","description","descriptionPosition","isDisabled","error","onChange","label","name","placeholder","type","value","autoFocus","autoComplete","isRequired","isReadOnly","onSubmit","onClear","testId","forwardedRef","inputRef","useRef","prefixRef","suffixRef","containerRef","className","useTheme","ref","useEffect","callbackCount","lastUpdateTime","previousValues","rafId","updateSizes","entries","now","timeSinceLastUpdate","triggeredBy","e","containerWidth","containerWidthChanged","prefixWidth","prefixWidthChanged","_a","suffixWidth","suffixWidthChanged","_b","resizeObserver","inputId","errorId","descriptionId","jsxs","jsx","csx","copyTextToClipboard"],"mappings":";;;;;;AAgHO,MAAMA,IAAQC;AAAA,EACnB,CACE;AAAA,IACE,QAAAC;AAAA,IACA,QAAAC;AAAA,IACA,aAAAC;AAAA,IACA,qBAAAC,IAAsB;AAAA,IACtB,YAAAC;AAAA,IACA,OAAAC;AAAA,IACA,UAAAC;AAAA,IACA,OAAAC;AAAA,IACA,MAAAC;AAAA,IACA,aAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,OAAAC;AAAA,IACA,WAAAC;AAAA,IACA,cAAAC;AAAA,IACA,YAAAC,IAAa;AAAA,IACb,YAAAC,IAAa;AAAA,IACb,UAAAC;AAAA,IACA,SAAAC;AAAA,IACA,eAAeC;AAAA,KAEjBC,MACG;AACG,UAAAC,IAAWC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