tekivex-ui 2.3.0 → 2.5.1
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/TkxForm-BWK4LqY3.js +1461 -0
- package/dist/TkxForm-ljQjX7KD.cjs +15 -0
- package/dist/charts.cjs +1 -0
- package/dist/charts.js +480 -0
- package/dist/headless.cjs +1 -0
- package/dist/headless.js +258 -0
- package/dist/index-BINBzXuY.cjs +2 -0
- package/dist/index-eT_U4qB2.js +512 -0
- package/dist/index.cjs +20 -32
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7942 -8903
- package/dist/src/charts/TkxAreaChart.d.ts +29 -0
- package/dist/src/charts/TkxAreaChart.d.ts.map +1 -0
- package/dist/src/charts/TkxBarChart.d.ts +28 -0
- package/dist/src/charts/TkxBarChart.d.ts.map +1 -0
- package/dist/src/charts/TkxDonutChart.d.ts +23 -0
- package/dist/src/charts/TkxDonutChart.d.ts.map +1 -0
- package/dist/src/charts/TkxLineChart.d.ts +35 -0
- package/dist/src/charts/TkxLineChart.d.ts.map +1 -0
- package/dist/src/charts/TkxPieChart.d.ts +19 -0
- package/dist/src/charts/TkxPieChart.d.ts.map +1 -0
- package/dist/src/charts/TkxRadarChart.d.ts +20 -0
- package/dist/src/charts/TkxRadarChart.d.ts.map +1 -0
- package/dist/src/charts/TkxScatterChart.d.ts +28 -0
- package/dist/src/charts/TkxScatterChart.d.ts.map +1 -0
- package/dist/src/charts/index.d.ts +15 -0
- package/dist/src/charts/index.d.ts.map +1 -0
- package/dist/src/charts/shared.d.ts +33 -0
- package/dist/src/charts/shared.d.ts.map +1 -0
- package/dist/src/components/TkxDataGrid.d.ts +16 -2
- package/dist/src/components/TkxDataGrid.d.ts.map +1 -1
- package/dist/src/components/TkxForm.d.ts +33 -3
- package/dist/src/components/TkxForm.d.ts.map +1 -1
- package/dist/src/components/TkxImage.d.ts.map +1 -1
- package/dist/src/components/TkxTypography.d.ts +1 -1
- package/dist/src/components/TkxTypography.d.ts.map +1 -1
- package/dist/src/engine/tkx.d.ts.map +1 -1
- package/dist/src/headless/index.d.ts +18 -0
- package/dist/src/headless/index.d.ts.map +1 -0
- package/dist/src/headless/useControllable.d.ts +20 -0
- package/dist/src/headless/useControllable.d.ts.map +1 -0
- package/dist/src/headless/useDebounce.d.ts +14 -0
- package/dist/src/headless/useDebounce.d.ts.map +1 -0
- package/dist/src/headless/useDisclosure.d.ts +20 -0
- package/dist/src/headless/useDisclosure.d.ts.map +1 -0
- package/dist/src/headless/useFormState.d.ts +44 -0
- package/dist/src/headless/useFormState.d.ts.map +1 -0
- package/dist/src/headless/useIntersectionObserver.d.ts +23 -0
- package/dist/src/headless/useIntersectionObserver.d.ts.map +1 -0
- package/dist/src/headless/useListSelection.d.ts +29 -0
- package/dist/src/headless/useListSelection.d.ts.map +1 -0
- package/dist/src/headless/useLocalStorage.d.ts +9 -0
- package/dist/src/headless/useLocalStorage.d.ts.map +1 -0
- package/dist/src/headless/useMediaQuery.d.ts +21 -0
- package/dist/src/headless/useMediaQuery.d.ts.map +1 -0
- package/dist/src/headless/useRovingTabIndex.d.ts +33 -0
- package/dist/src/headless/useRovingTabIndex.d.ts.map +1 -0
- package/dist/src/headless/useThrottle.d.ts +9 -0
- package/dist/src/headless/useThrottle.d.ts.map +1 -0
- package/dist/src/i18n/index.d.ts +47 -2
- package/dist/src/i18n/index.d.ts.map +1 -1
- package/dist/src/themes/index.d.ts.map +1 -1
- package/package.json +61 -7
- package/src/charts/TkxAreaChart.tsx +119 -0
- package/src/charts/TkxBarChart.tsx +115 -0
- package/src/charts/TkxDonutChart.tsx +145 -0
- package/src/charts/TkxLineChart.tsx +135 -0
- package/src/charts/TkxPieChart.tsx +82 -0
- package/src/charts/TkxRadarChart.tsx +90 -0
- package/src/charts/TkxScatterChart.tsx +102 -0
- package/src/charts/index.ts +20 -0
- package/src/charts/shared.ts +45 -0
- package/src/components/TkxDataGrid.tsx +532 -268
- package/src/components/TkxForm.tsx +67 -15
- package/src/components/TkxImage.tsx +1 -1
- package/src/components/TkxTypography.tsx +4 -2
- package/src/engine/tkx.ts +60 -3
- package/src/headless/index.ts +44 -0
- package/src/headless/useControllable.ts +40 -0
- package/src/headless/useDebounce.ts +35 -0
- package/src/headless/useDisclosure.ts +28 -0
- package/src/headless/useFormState.ts +111 -0
- package/src/headless/useIntersectionObserver.ts +51 -0
- package/src/headless/useListSelection.ts +101 -0
- package/src/headless/useLocalStorage.ts +46 -0
- package/src/headless/useMediaQuery.ts +37 -0
- package/src/headless/useRovingTabIndex.ts +84 -0
- package/src/headless/useThrottle.ts +46 -0
- package/src/i18n/I18nProvider.tsx +1 -1
- package/src/i18n/index.ts +678 -38
- package/src/themes/index.ts +31 -4
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";const l=require("react"),R=require("./index-BINBzXuY.cjs"),y=require("react/jsx-runtime"),we={"<":"<",">":">","&":"&","'":"'",'"':"""};function U(e){return String(e).replace(/[<>&'"]/g,i=>we[i]??i)}function Q(e){const i={};for(const o of Object.keys(e))i[o]=ae(e[o]);return i}function ae(e){return typeof e=="string"?U(e):Array.isArray(e)?e.map(ae):e!==null&&typeof e=="object"&&!ye(e)?Q(e):e}function ye(e){return typeof e=="object"&&e!==null&&"$$typeof"in e}function ce(e,i){const o=[];for(const[s,a]of Object.entries(i)){const f=e[s],b=f==null;if(a.required&&b){o.push(`prop '${s}' is required`);continue}if(!b){if(typeof f!==a.type){o.push(`prop '${s}' must be of type ${a.type}, got ${typeof f}`);continue}a.type==="number"&&typeof f=="number"&&(a.min!==void 0&&f<a.min&&o.push(`prop '${s}' must be >= ${a.min}`),a.max!==void 0&&f>a.max&&o.push(`prop '${s}' must be <= ${a.max}`)),a.type==="string"&&typeof f=="string"&&a.pattern&&!a.pattern.test(f)&&o.push(`prop '${s}' does not match pattern ${a.pattern}`),a.enum&&!a.enum.includes(f)&&o.push(`prop '${s}' must be one of: ${a.enum.join(", ")}`)}}return{valid:o.length===0,errors:o}}const le=new Map;function $e(e,i){const o={"default-src":["'self'"],"style-src":i.allowInlineStyles?["'self'","'unsafe-inline'"]:["'self'"],"img-src":i.allowDataUrls?["'self'","data:"]:i.allowExternalSrc?["'self'","*"]:["'self'"],"script-src":i.allowScripts?["'self'"]:["'none'"]},s={componentId:e,permissions:i,directives:o};return le.set(e,s),s}function ke(e,i){const o=le.get(e);return(o==null?void 0:o.permissions[i])===!0}let D=[];function fe(e,i,o){const s=R.fnv1aHash(JSON.stringify(o??{})),a=D.length>0?D[D.length-1].chainHash:"00000000",f=R.fnv1aHash(a+s+i+e),b=Object.freeze({timestamp:Date.now(),component:i,action:e,propsHash:s,chainHash:f});return D=Object.freeze([...D,b]),b}function de(e){let i=D;return e!=null&&e.component&&(i=i.filter(o=>o.component===e.component)),e!=null&&e.action&&(i=i.filter(o=>o.action===e.action)),e!=null&&e.limit&&(i=i.slice(-e.limit)),i}function ue(){let e="00000000";for(const i of D){if(R.fnv1aHash(e+i.propsHash+i.component+i.action)!==i.chainHash)return!1;e=i.chainHash}return!0}const Se={sanitize:U,sanitizeProps:Q,validateProps:ce,createCSP:$e,hasPermission:ke,audit:fe,getAuditLog:de,verifyAuditIntegrity:ue};function je(){const[e,i]=l.useState(()=>typeof window>"u"?!1:R.prefersReducedMotion());return l.useEffect(()=>{if(typeof window>"u")return;const o=window.matchMedia("(prefers-reduced-motion: reduce)"),s=a=>i(a.matches);return o.addEventListener("change",s),()=>o.removeEventListener("change",s)},[]),e}function Fe(){const[e,i]=l.useState(()=>typeof window>"u"?!1:R.prefersHighContrast());return l.useEffect(()=>{if(typeof window>"u")return;const o=window.matchMedia("(forced-colors: active)"),s=a=>i(a.matches);return o.addEventListener("change",s),()=>o.removeEventListener("change",s)},[]),e}function Me(e){const i=l.useRef(null);return l.useEffect(()=>{if(!e||!i.current)return;const o=R.createFocusTrap(i.current);return o.activate(),()=>o.deactivate()},[e]),i}function Ee(){const e=l.useRef(null);return l.useEffect(()=>{if(!(typeof document>"u"))return e.current=R.createAnnouncer(),()=>{var i;(i=e.current)==null||i.destroy()}},[]),l.useCallback((i,o="polite")=>{var s;(s=e.current)==null||s.announce(i,o)},[])}function Re(e,i=!0){const o=l.useRef(e);o.current=e,l.useEffect(()=>{if(!i||typeof document>"u")return;const s=a=>{a.key==="Escape"&&o.current()};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[i])}function Ce(e,i){const o=l.useRef(i);o.current=i,l.useEffect(()=>{const s=a=>{!e.current||e.current.contains(a.target)||o.current()};return document.addEventListener("pointerdown",s),()=>document.removeEventListener("pointerdown",s)},[e])}const u={0:"0",px:"1px","0.5":"2px",1:"4px","1.5":"6px",2:"8px","2.5":"10px",3:"12px","3.5":"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px",auto:"auto",full:"100%",screen:"100vw",svh:"100svh",dvh:"100dvh",fit:"fit-content",max:"max-content",min:"min-content"},te={...u,screen:"100vh"},A={"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","5/6":"83.333333%","1/12":"8.333333%","5/12":"41.666667%","7/12":"58.333333%","11/12":"91.666667%"},G={none:"0",sm:"2px","":"4px",md:"6px",lg:"8px",xl:"12px","2xl":"16px","3xl":"24px",full:"9999px"},re={sm:"0 1px 2px 0 rgba(0,0,0,.05)","":"0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1)",md:"0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1)",lg:"0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1)",xl:"0 20px 25px -5px rgba(0,0,0,.1),0 8px 10px -6px rgba(0,0,0,.1)","2xl":"0 25px 50px -12px rgba(0,0,0,.25)",inner:"inset 0 2px 4px 0 rgba(0,0,0,.05)",none:"none"},ze={xs:["0.75rem","1rem"],sm:["0.875rem","1.25rem"],base:["1rem","1.5rem"],lg:["1.125rem","1.75rem"],xl:["1.25rem","1.75rem"],"2xl":["1.5rem","2rem"],"3xl":["1.875rem","2.25rem"],"4xl":["2.25rem","2.5rem"],"5xl":["3rem","1"],"6xl":["3.75rem","1"],"7xl":["4.5rem","1"],"8xl":["6rem","1"],"9xl":["8rem","1"]},Te={thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},Ae={none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2",3:"0.75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},He={tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},X={none:"0",sm:"4px","":"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},Ie=Object.fromEntries([0,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100].map(e=>[String(e),String(e/100)])),pe=new Set(["bg","surface","surfaceAlt","border","text","textMuted","primary","secondary","danger","warning","success","info"]),Pe={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"};function c(e){const i=e.match(/^\[(.+)]$/);return i?i[1]:null}function E(e){if(pe.has(e))return`var(--tkx-${e})`;if(e==="transparent")return"transparent";if(e==="current")return"currentColor";if(e==="white")return"#ffffff";if(e==="black")return"#000000";if(e==="inherit")return"inherit";const i=c(e);return i||e}function We(e){const i=e.match(/^\[([a-zA-Z-]+):(.+)]$/);if(i)return{[i[1]]:i[2]};const o={flex:"flex","inline-flex":"inline-flex",grid:"grid","inline-grid":"inline-grid",block:"block","inline-block":"inline-block",inline:"inline",hidden:"none",contents:"contents","flow-root":"flow-root",table:"table","table-row":"table-row","table-cell":"table-cell","table-caption":"table-caption","list-item":"list-item"};if(o[e])return{display:o[e]};const s={"flex-row":"row","flex-col":"column","flex-row-reverse":"row-reverse","flex-col-reverse":"column-reverse"};if(s[e])return{"flex-direction":s[e]};const a={"flex-wrap":"wrap","flex-nowrap":"nowrap","flex-wrap-reverse":"wrap-reverse"};if(a[e])return{"flex-wrap":a[e]};const f={"flex-1":"1 1 0%","flex-auto":"1 1 auto","flex-none":"none","flex-initial":"0 1 auto"};if(f[e])return{flex:f[e]};if(e==="grow"||e==="flex-grow")return{"flex-grow":"1"};if(e==="grow-0")return{"flex-grow":"0"};if(e==="shrink"||e==="flex-shrink")return{"flex-shrink":"1"};if(e==="shrink-0"||e==="flex-shrink-0")return{"flex-shrink":"0"};const b={"items-start":"flex-start","items-end":"flex-end","items-center":"center","items-stretch":"stretch","items-baseline":"baseline"};if(b[e])return{"align-items":b[e]};const x={"justify-start":"flex-start","justify-end":"flex-end","justify-center":"center","justify-between":"space-between","justify-around":"space-around","justify-evenly":"space-evenly","justify-stretch":"stretch","justify-normal":"normal"};if(x[e])return{"justify-content":x[e]};const p={"self-auto":"auto","self-start":"flex-start","self-end":"flex-end","self-center":"center","self-stretch":"stretch","self-baseline":"baseline"};if(p[e])return{"align-self":p[e]};const h={"content-start":"flex-start","content-end":"flex-end","content-center":"center","content-between":"space-between","content-around":"space-around","content-evenly":"space-evenly","content-stretch":"stretch"};if(h[e])return{"align-content":h[e]};let t;if(t=e.match(/^grid-cols-(\d+|none|subgrid)$/))return{"grid-template-columns":t[1]==="none"?"none":t[1]==="subgrid"?"subgrid":`repeat(${t[1]},minmax(0,1fr))`};if(t=e.match(/^grid-rows-(\d+|none|subgrid)$/))return{"grid-template-rows":t[1]==="none"?"none":t[1]==="subgrid"?"subgrid":`repeat(${t[1]},minmax(0,1fr))`};if(t=e.match(/^col-span-(full|\d+)$/))return{"grid-column":t[1]==="full"?"1 / -1":`span ${t[1]} / span ${t[1]}`};if(t=e.match(/^col-start-(\d+|auto)$/))return{"grid-column-start":t[1]};if(t=e.match(/^col-end-(\d+|auto)$/))return{"grid-column-end":t[1]};if(t=e.match(/^row-span-(full|\d+)$/))return{"grid-row":t[1]==="full"?"1 / -1":`span ${t[1]} / span ${t[1]}`};if(t=e.match(/^row-start-(\d+|auto)$/))return{"grid-row-start":t[1]};if(t=e.match(/^row-end-(\d+|auto)$/))return{"grid-row-end":t[1]};if(e==="grid-flow-row")return{"grid-auto-flow":"row"};if(e==="grid-flow-col")return{"grid-auto-flow":"column"};if(e==="grid-flow-dense")return{"grid-auto-flow":"dense"};if(e==="grid-flow-row-dense")return{"grid-auto-flow":"row dense"};if(e==="grid-flow-col-dense")return{"grid-auto-flow":"column dense"};if(t=e.match(/^p-(.+)$/)){const r=u[t[1]]??c(t[1]);if(r)return{padding:r}}if(t=e.match(/^px-(.+)$/)){const r=u[t[1]]??c(t[1]);if(r)return{"padding-left":r,"padding-right":r}}if(t=e.match(/^py-(.+)$/)){const r=u[t[1]]??c(t[1]);if(r)return{"padding-top":r,"padding-bottom":r}}if(t=e.match(/^pt-(.+)$/)){const r=u[t[1]]??c(t[1]);if(r)return{"padding-top":r}}if(t=e.match(/^pr-(.+)$/)){const r=u[t[1]]??c(t[1]);if(r)return{"padding-right":r}}if(t=e.match(/^pb-(.+)$/)){const r=u[t[1]]??c(t[1]);if(r)return{"padding-bottom":r}}if(t=e.match(/^pl-(.+)$/)){const r=u[t[1]]??c(t[1]);if(r)return{"padding-left":r}}if(t=e.match(/^-?m-(.+)$/)){const r=e.startsWith("-"),n=u[t[1]]??c(t[1]);if(n)return{margin:r&&n!=="0"?`-${n}`:n}}if(t=e.match(/^-?mx-(.+)$/)){const r=e.startsWith("-"),n=u[t[1]]??c(t[1]);if(n){const m=r&&n!=="0"?`-${n}`:n;return{"margin-left":m,"margin-right":m}}}if(t=e.match(/^-?my-(.+)$/)){const r=e.startsWith("-"),n=u[t[1]]??c(t[1]);if(n){const m=r&&n!=="0"?`-${n}`:n;return{"margin-top":m,"margin-bottom":m}}}if(t=e.match(/^-?mt-(.+)$/)){const r=e.startsWith("-"),n=u[t[1]]??c(t[1]);if(n)return{"margin-top":r&&n!=="0"?`-${n}`:n}}if(t=e.match(/^-?mr-(.+)$/)){const r=e.startsWith("-"),n=u[t[1]]??c(t[1]);if(n)return{"margin-right":r&&n!=="0"?`-${n}`:n}}if(t=e.match(/^-?mb-(.+)$/)){const r=e.startsWith("-"),n=u[t[1]]??c(t[1]);if(n)return{"margin-bottom":r&&n!=="0"?`-${n}`:n}}if(t=e.match(/^-?ml-(.+)$/)){const r=e.startsWith("-"),n=u[t[1]]??c(t[1]);if(n)return{"margin-left":r&&n!=="0"?`-${n}`:n}}if(e==="mx-auto")return{"margin-left":"auto","margin-right":"auto"};if(e==="my-auto")return{"margin-top":"auto","margin-bottom":"auto"};if(t=e.match(/^gap-(.+)$/)){const r=u[t[1]]??c(t[1]);if(r)return{gap:r}}if(t=e.match(/^gap-x-(.+)$/)){const r=u[t[1]]??c(t[1]);if(r)return{"column-gap":r}}if(t=e.match(/^gap-y-(.+)$/)){const r=u[t[1]]??c(t[1]);if(r)return{"row-gap":r}}if(t=e.match(/^w-(.+)$/)){const r=t[1],n=u[r]??A[r]??c(r);if(n)return{width:n}}if(t=e.match(/^min-w-(.+)$/)){const r=u[t[1]]??c(t[1]);if(r)return{"min-width":r}}if(t=e.match(/^max-w-(.+)$/)){const n={none:"none",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",full:"100%",screen:"100vw",min:"min-content",max:"max-content",fit:"fit-content"}[t[1]]??u[t[1]]??c(t[1]);if(n)return{"max-width":n}}if(t=e.match(/^h-(.+)$/)){const r=t[1],n=te[r]??A[r]??c(r);if(n)return{height:n}}if(t=e.match(/^min-h-(.+)$/)){const n={0:"0",full:"100%",screen:"100vh",svh:"100svh",dvh:"100dvh"}[t[1]]??u[t[1]]??c(t[1]);if(n)return{"min-height":n}}if(t=e.match(/^max-h-(.+)$/)){const r=te[t[1]]??c(t[1]);if(r)return{"max-height":r}}if(t=e.match(/^size-(.+)$/)){const r=u[t[1]]??A[t[1]]??c(t[1]);if(r)return{width:r,height:r}}if(t=e.match(/^text-(xs|sm|base|lg|[2-9]xl|\d+xl)$/)){const[r,n]=ze[t[1]]??["1rem","1.5rem"];return{"font-size":r,"line-height":n}}if(t=e.match(/^font-(thin|extralight|light|normal|medium|semibold|bold|extrabold|black|\d+)$/))return{"font-weight":Te[t[1]]??t[1]};if(t=e.match(/^leading-(.+)$/)){const r=Ae[t[1]]??c(t[1]);if(r)return{"line-height":r}}if(t=e.match(/^tracking-(.+)$/)){const r=He[t[1]]??c(t[1]);if(r)return{"letter-spacing":r}}const g={"text-left":"left","text-center":"center","text-right":"right","text-justify":"justify","text-start":"start","text-end":"end"};if(g[e])return{"text-align":g[e]};if(e==="italic")return{"font-style":"italic"};if(e==="not-italic")return{"font-style":"normal"};if(e==="uppercase")return{"text-transform":"uppercase"};if(e==="lowercase")return{"text-transform":"lowercase"};if(e==="capitalize")return{"text-transform":"capitalize"};if(e==="normal-case")return{"text-transform":"none"};if(e==="underline")return{"text-decoration-line":"underline"};if(e==="overline")return{"text-decoration-line":"overline"};if(e==="line-through")return{"text-decoration-line":"line-through"};if(e==="no-underline")return{"text-decoration-line":"none"};if(e==="truncate")return{overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"};if(e==="text-ellipsis")return{"text-overflow":"ellipsis"};if(e==="text-clip")return{"text-overflow":"clip"};if(e==="whitespace-normal")return{"white-space":"normal"};if(e==="whitespace-nowrap")return{"white-space":"nowrap"};if(e==="whitespace-pre")return{"white-space":"pre"};if(e==="whitespace-pre-wrap")return{"white-space":"pre-wrap"};if(e==="whitespace-pre-line")return{"white-space":"pre-line"};if(e==="break-words")return{"overflow-wrap":"break-word"};if(e==="break-all")return{"word-break":"break-all"};if(e==="break-keep")return{"word-break":"keep-all"};if(e==="font-mono")return{"font-family":"var(--tkx-font-mono,monospace)"};if(e==="font-sans")return{"font-family":"var(--tkx-font-family,system-ui,sans-serif)"};if(e==="font-serif")return{"font-family":"ui-serif,Georgia,serif"};if(e==="antialiased")return{"-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale"};if(t=e.match(/^indent-(.+)$/)){const r=u[t[1]]??c(t[1]);if(r)return{"text-indent":r}}if(t=e.match(/^line-clamp-(\d+)$/))return{overflow:"hidden",display:"-webkit-box","-webkit-line-clamp":t[1],"-webkit-box-orient":"vertical"};if(t=e.match(/^text-(.+)$/)){const[r,n]=t[1].split("/"),m=E(r);if(!["left","center","right","justify","start","end","xs","sm","base","lg","xl","2xl","3xl","4xl","5xl","6xl","7xl","8xl","9xl"].includes(r)){if(n){const k=parseInt(n)/100;return{color:m,opacity:String(k)}}return{color:m}}}if(t=e.match(/^bg-(.+)$/)){const[r,n]=t[1].split("/"),m=E(r);return n?{"background-color":m,opacity:String(parseInt(n)/100)}:r==="none"?{background:"none"}:{"background-color":m}}if(t=e.match(/^border-color-(.+)$/))return{"border-color":E(t[1])};if(t=e.match(/^fill-(.+)$/))return{fill:E(t[1])};if(t=e.match(/^stroke-(.+)$/))return{stroke:E(t[1])};if(t=e.match(/^shadow-color-(.+)$/))return{"--tkx-shadow-color":E(t[1])};if(t=e.match(/^ring-color-(.+)$/))return{"--tkx-ring-color":E(t[1])};if(t=e.match(/^accent-(.+)$/))return{"accent-color":E(t[1])};if(t=e.match(/^caret-(.+)$/))return{"caret-color":E(t[1])};if(t=e.match(/^outline-color-(.+)$/))return{"outline-color":E(t[1])};if(e==="border")return{"border-width":"1px"};if(t=e.match(/^border-(\d+)$/))return{"border-width":`${t[1]}px`};if(e==="border-t")return{"border-top-width":"1px"};if(t=e.match(/^border-t-(\d+)$/))return{"border-top-width":`${t[1]}px`};if(e==="border-r")return{"border-right-width":"1px"};if(t=e.match(/^border-r-(\d+)$/))return{"border-right-width":`${t[1]}px`};if(e==="border-b")return{"border-bottom-width":"1px"};if(t=e.match(/^border-b-(\d+)$/))return{"border-bottom-width":`${t[1]}px`};if(e==="border-l")return{"border-left-width":"1px"};if(t=e.match(/^border-l-(\d+)$/))return{"border-left-width":`${t[1]}px`};if(e==="border-x")return{"border-left-width":"1px","border-right-width":"1px"};if(e==="border-y")return{"border-top-width":"1px","border-bottom-width":"1px"};if(e==="border-none")return{"border-style":"none"};if(e==="border-solid")return{"border-style":"solid"};if(e==="border-dashed")return{"border-style":"dashed"};if(e==="border-dotted")return{"border-style":"dotted"};if(e==="border-double")return{"border-style":"double"};if((t=e.match(/^border-([a-zA-Z].*)$/))&&pe.has(t[1]))return{"border-color":`var(--tkx-${t[1]})`};if(t=e.match(/^border-\[(.+)]$/))return{"border-color":t[1]};if(e==="border-0")return{"border-width":"0"};if(e==="rounded")return{"border-radius":G[""]};if(t=e.match(/^rounded-(none|sm|md|lg|xl|2xl|3xl|full|\[.+])$/))return{"border-radius":G[t[1]]??c(t[1])??t[1]};if(t=e.match(/^rounded-(t|r|b|l|tl|tr|br|bl)(?:-(none|sm|md|lg|xl|2xl|3xl|full))?$/)){const r=t[1],n=G[t[2]??""]??G[""];return{t:{"border-top-left-radius":n,"border-top-right-radius":n},r:{"border-top-right-radius":n,"border-bottom-right-radius":n},b:{"border-bottom-left-radius":n,"border-bottom-right-radius":n},l:{"border-top-left-radius":n,"border-bottom-left-radius":n},tl:{"border-top-left-radius":n},tr:{"border-top-right-radius":n},br:{"border-bottom-right-radius":n},bl:{"border-bottom-left-radius":n}}[r]??{}}const $={0:"0",1:"1px",2:"2px",ring:"3px",4:"4px",8:"8px"};if(e==="ring")return{"box-shadow":"0 0 0 3px var(--tkx-ring-color,var(--tkx-primary))"};if((t=e.match(/^ring-(\d+)$/))&&$[t[1]])return{"box-shadow":`0 0 0 ${$[t[1]]} var(--tkx-ring-color,var(--tkx-primary))`};if(e==="ring-inset")return{"--tkx-ring-offset":"inset"};if(t=e.match(/^ring-offset-(\d+)$/))return{"--tkx-ring-offset-width":`${t[1]}px`,"box-shadow":`0 0 0 ${t[1]}px var(--tkx-bg)`};if(e==="shadow")return{"box-shadow":re[""]};if(t=e.match(/^shadow-(sm|md|lg|xl|2xl|inner|none)$/))return{"box-shadow":re[t[1]]};if(t=e.match(/^opacity-(\d+)$/)){const r=Ie[t[1]];if(r!==void 0)return{opacity:r}}if(e==="bg-none")return{background:"none"};const v={"bg-auto":"auto","bg-cover":"cover","bg-contain":"contain"};if(v[e])return{"background-size":v[e]};const w={"bg-center":"center","bg-top":"top","bg-bottom":"bottom","bg-left":"left","bg-right":"right"};if(w[e])return{"background-position":w[e]};const C={"bg-repeat":"repeat","bg-no-repeat":"no-repeat","bg-repeat-x":"repeat-x","bg-repeat-y":"repeat-y"};if(C[e])return{"background-repeat":C[e]};if(e==="backdrop-blur")return{"backdrop-filter":`blur(${X[""]})`};if(t=e.match(/^backdrop-blur-(none|sm|md|lg|xl|2xl|3xl)$/))return{"backdrop-filter":`blur(${X[t[1]]})`};if(e==="blur")return{filter:`blur(${X[""]})`};if(t=e.match(/^blur-(none|sm|md|lg|xl|2xl|3xl)$/))return{filter:`blur(${X[t[1]]})`};if(e==="grayscale")return{filter:"grayscale(100%)"};if(e==="grayscale-0")return{filter:"grayscale(0)"};if(e==="invert")return{filter:"invert(100%)"};if(e==="invert-0")return{filter:"invert(0)"};const I={static:"static",relative:"relative",absolute:"absolute",fixed:"fixed",sticky:"sticky"};if(I[e])return{position:I[e]};if(e==="inset-0")return{top:"0",right:"0",bottom:"0",left:"0"};if(e==="inset-auto")return{top:"auto",right:"auto",bottom:"auto",left:"auto"};if(e==="inset-full")return{top:"100%",right:"100%",bottom:"100%",left:"100%"};if(e==="inset-x-0")return{left:"0",right:"0"};if(e==="inset-y-0")return{top:"0",bottom:"0"};if(t=e.match(/^-?top-(.+)$/)){const r=e.startsWith("-"),n=u[t[1]]??A[t[1]]??c(t[1]);if(n)return{top:r&&n!=="0"?`-${n}`:n}}if(t=e.match(/^-?right-(.+)$/)){const r=e.startsWith("-"),n=u[t[1]]??A[t[1]]??c(t[1]);if(n)return{right:r&&n!=="0"?`-${n}`:n}}if(t=e.match(/^-?bottom-(.+)$/)){const r=e.startsWith("-"),n=u[t[1]]??A[t[1]]??c(t[1]);if(n)return{bottom:r&&n!=="0"?`-${n}`:n}}if(t=e.match(/^-?left-(.+)$/)){const r=e.startsWith("-"),n=u[t[1]]??A[t[1]]??c(t[1]);if(n)return{left:r&&n!=="0"?`-${n}`:n}}const P={0:"0",10:"10",20:"20",30:"30",40:"40",50:"50",100:"100",1e3:"1000",9e3:"9000",auto:"auto"};if(t=e.match(/^z-(.+)$/)){const r=P[t[1]]??c(t[1]);if(r)return{"z-index":r}}const W={"overflow-auto":"auto","overflow-hidden":"hidden","overflow-visible":"visible","overflow-scroll":"scroll","overflow-clip":"clip"};if(W[e])return{overflow:W[e]};if(t=e.match(/^overflow-(x|y)-(auto|hidden|visible|scroll|clip)$/))return{[`overflow-${t[1]}`]:t[2]};if(e==="scrollbar-hide")return{"-ms-overflow-style":"none","scrollbar-width":"none"};if(e==="visible")return{visibility:"visible"};if(e==="invisible")return{visibility:"hidden"};if(e==="collapse")return{visibility:"collapse"};const F={"cursor-auto":"auto","cursor-default":"default","cursor-pointer":"pointer","cursor-wait":"wait","cursor-text":"text","cursor-move":"move","cursor-help":"help","cursor-not-allowed":"not-allowed","cursor-none":"none","cursor-grab":"grab","cursor-grabbing":"grabbing","cursor-zoom-in":"zoom-in","cursor-zoom-out":"zoom-out","cursor-crosshair":"crosshair"};if(F[e])return{cursor:F[e]};if(e==="select-none")return{"user-select":"none"};if(e==="select-text")return{"user-select":"text"};if(e==="select-all")return{"user-select":"all"};if(e==="select-auto")return{"user-select":"auto"};if(e==="pointer-events-none")return{"pointer-events":"none"};if(e==="pointer-events-auto")return{"pointer-events":"auto"};const M={0:"0",50:".5",75:".75",90:".9",95:".95",100:"1",105:"1.05",110:"1.1",125:"1.25",150:"1.5"};if(t=e.match(/^scale-(.+)$/)){const r=M[t[1]]??c(t[1]);if(r)return{transform:`scale(${r})`}}if(t=e.match(/^scale-x-(.+)$/)){const r=M[t[1]]??c(t[1]);if(r)return{transform:`scaleX(${r})`}}if(t=e.match(/^scale-y-(.+)$/)){const r=M[t[1]]??c(t[1]);if(r)return{transform:`scaleY(${r})`}}const z={0:"0deg",1:"1deg",2:"2deg",3:"3deg",6:"6deg",12:"12deg",45:"45deg",90:"90deg",180:"180deg"};if(t=e.match(/^-?rotate-(.+)$/)){const r=e.startsWith("-"),n=z[t[1]]??c(t[1]);if(n)return{transform:r?`rotate(-${n})`:`rotate(${n})`}}if(t=e.match(/^-?translate-x-(.+)$/)){const r=e.startsWith("-"),n=u[t[1]]??A[t[1]]??c(t[1]);if(n)return{transform:`translateX(${r&&n!=="0"?`-${n}`:n})`}}if(t=e.match(/^-?translate-y-(.+)$/)){const r=e.startsWith("-"),n=u[t[1]]??A[t[1]]??c(t[1]);if(n)return{transform:`translateY(${r&&n!=="0"?`-${n}`:n})`}}if(t=e.match(/^-?skew-x-(.+)$/)){const r=e.startsWith("-"),n=c(t[1])??`${t[1]}deg`;return{transform:r?`skewX(-${n})`:`skewX(${n})`}}if(t=e.match(/^-?skew-y-(.+)$/)){const r=e.startsWith("-"),n=c(t[1])??`${t[1]}deg`;return{transform:r?`skewY(-${n})`:`skewY(${n})`}}const q={"origin-center":"center","origin-top":"top","origin-top-right":"top right","origin-right":"right","origin-bottom-right":"bottom right","origin-bottom":"bottom","origin-bottom-left":"bottom left","origin-left":"left","origin-top-left":"top left"};if(q[e])return{"transform-origin":q[e]};const B={transition:"color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter","transition-all":"all","transition-colors":"color,background-color,border-color,text-decoration-color,fill,stroke","transition-opacity":"opacity","transition-shadow":"box-shadow","transition-transform":"transform","transition-none":"none"};if(B[e])return{"transition-property":B[e],"transition-timing-function":"cubic-bezier(0.4,0,0.2,1)","transition-duration":"150ms"};const O={75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"};if(t=e.match(/^duration-(.+)$/)){const r=O[t[1]]??c(t[1]);if(r)return{"transition-duration":r}}if(t=e.match(/^delay-(.+)$/)){const r=O[t[1]]??c(t[1]);if(r)return{"transition-delay":r}}const N={"ease-linear":"linear","ease-in":"cubic-bezier(0.4,0,1,1)","ease-out":"cubic-bezier(0,0,0.2,1)","ease-in-out":"cubic-bezier(0.4,0,0.2,1)"};if(N[e])return{"transition-timing-function":N[e]};const L={"animate-none":"none","animate-spin":"tkx-spin 1s linear infinite","animate-ping":"tkx-ping 1s cubic-bezier(0,0,0.2,1) infinite","animate-pulse":"tkx-pulse 2s cubic-bezier(0.4,0,0.6,1) infinite","animate-bounce":"tkx-bounce 1s infinite","animate-fade-in":"tkx-fade-in 200ms ease both","animate-slide-up":"tkx-slide-up 200ms ease both","animate-shimmer":"tkx-shimmer 1.5s infinite"};if(L[e])return{animation:L[e]};const Y={"object-contain":"contain","object-cover":"cover","object-fill":"fill","object-none":"none","object-scale-down":"scale-down"};if(Y[e])return{"object-fit":Y[e]};if(e==="aspect-square")return{"aspect-ratio":"1 / 1"};if(e==="aspect-video")return{"aspect-ratio":"16 / 9"};if(e==="aspect-auto")return{"aspect-ratio":"auto"};if(t=e.match(/^aspect-\[(.+)]$/))return{"aspect-ratio":t[1]};if(e==="list-none")return{"list-style-type":"none"};if(e==="list-disc")return{"list-style-type":"disc"};if(e==="list-decimal")return{"list-style-type":"decimal"};if(e==="list-inside")return{"list-style-position":"inside"};if(e==="list-outside")return{"list-style-position":"outside"};if(t=e.match(/^columns-(\d+)$/))return{columns:t[1]};if(e==="resize")return{resize:"both"};if(e==="resize-none")return{resize:"none"};if(e==="resize-x")return{resize:"horizontal"};if(e==="resize-y")return{resize:"vertical"};if(e==="sr-only")return{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0,0,0,0)","white-space":"nowrap",border:"0"};if(e==="not-sr-only")return{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",clip:"auto","white-space":"normal"};if(e==="focus-ring")return{outline:"2px solid var(--tkx-primary)","outline-offset":"2px","border-radius":"2px"};if(e==="appearance-none")return{appearance:"none"};if(e==="outline-none")return{outline:"none"};if(e==="outline")return{outline:"2px solid currentColor","outline-offset":"2px"};if(e==="float-left")return{float:"left"};if(e==="float-right")return{float:"right"};if(e==="float-none")return{float:"none"};if(e==="clear-both")return{clear:"both"};if(e==="isolate")return{isolation:"isolate"};if(e==="isolation-auto")return{isolation:"auto"};if(t=e.match(/^will-change-(.+)$/))return{"will-change":t[1]};if(e==="touch-manipulation")return{"touch-action":"manipulation"};if(e==="touch-none")return{"touch-action":"none"};if(e==="touch-pan-x")return{"touch-action":"pan-x"};if(e==="touch-pan-y")return{"touch-action":"pan-y"};if(e==="scroll-smooth")return{"scroll-behavior":"smooth"};if(e==="scroll-auto")return{"scroll-behavior":"auto"};if(t=e.match(/^\[(--[a-zA-Z0-9-]+):(.+)]$/))return{[t[1]]:t[2]};const d=he(e);return d||null}function Oe(e){let i=0,o=-1;for(let s=0;s<e.length;s++)if(e[s]==="[")i++;else if(e[s]==="]")i--;else if(e[s]===":"&&i===0){o=s;break}return o===-1?{variant:null,utility:e}:{variant:e.slice(0,o),utility:e.slice(o+1)}}function ne(e,i){for(const[o,s]of Object.entries(i))e[o]=s}function V(e){return Object.entries(e).map(([i,o])=>`${i}:${o}`).join(";")}const Z=new Map;let H=null,_=null;function ie(){return(!H||!H.isConnected)&&(H=document.getElementById("tkx-atomic"),H||(H=document.createElement("style"),H.id="tkx-atomic",document.head.appendChild(H))),H}function qe(){if(_)return _;try{const e=new CSSStyleSheet;return document.adoptedStyleSheets=[...document.adoptedStyleSheets,e],_=e,e}catch{return null}}function Ne(e,i){if(Z.has(e)||(Z.set(e,i),typeof document>"u"))return;const o=qe();if(o){const s=Le(i);for(const a of s)try{o.insertRule(a,o.cssRules.length)}catch{ie().textContent+=a+`
|
|
2
|
+
`}}else ie().textContent+=i+`
|
|
3
|
+
`}function Le(e){const i=[];let o=0,s=0;for(let a=0;a<e.length;a++)if(e[a]==="{")o++;else if(e[a]==="}"&&(o--,o===0)){const f=e.slice(s,a+1).trim();f&&i.push(f),s=a+1}return i}function me(e){const i=[];for(const o of e)if(o){if(typeof o=="string")i.push(...o.split(/\s+/).filter(Boolean));else if(Array.isArray(o))i.push(...me(o));else if(typeof o=="object")for(const[s,a]of Object.entries(o))a&&i.push(s)}return i}function j(...e){const i=me(e);if(i.length===0)return"";const o={base:{},variants:{}};for(const p of i){const{variant:h,utility:t}=Oe(p),g=We(t);g&&(h?(o.variants[h]||(o.variants[h]={}),ne(o.variants[h],g)):ne(o.base,g))}const s=[],a=V(o.base),f=[a,...Object.entries(o.variants).map(([p,h])=>`${p}{${V(h)}}`)].join("|"),b=R.fnv1aHash(f),x=`tkx-${b}`;a&&s.push(`.${x}{${a}}`);for(const[p,h]of Object.entries(o.variants)){const t=V(h);if(t)if(p.startsWith("@")){const g=p.slice(1),$=Pe[g];$&&s.push(`@media(min-width:${$}){.${x}{${t}}}`)}else if(p==="motion-safe")s.push(`@media(prefers-reduced-motion:no-preference){.${x}{${t}}}`);else if(p==="motion-reduce")s.push(`@media(prefers-reduced-motion:reduce){.${x}{${t}}}`);else if(p==="contrast-more")s.push(`@media(prefers-contrast:more){.${x}{${t}}}`);else if(p==="forced-colors")s.push(`@media(forced-colors:active){.${x}{${t}}}`);else if(p==="dark")s.push(`@media(prefers-color-scheme:dark){.${x}{${t}}}`);else if(p==="print")s.push(`@media print{.${x}{${t}}}`);else if(p==="group-hover")s.push(`.group:hover .${x}{${t}}`);else if(p==="group-focus")s.push(`.group:focus-within .${x}{${t}}`);else if(p==="peer-hover")s.push(`.peer:hover~.${x}{${t}}`);else{const $={hover:":hover",focus:":focus","focus-visible":":focus-visible","focus-within":":focus-within",active:":active",disabled:":disabled",checked:":checked",required:":required",valid:":valid",invalid:":invalid",first:":first-child",last:":last-child",odd:":nth-child(odd)",even:":nth-child(even)","first-of-type":":first-of-type","last-of-type":":last-of-type","only-child":":only-child","only-of-type":":only-of-type",empty:":empty",visited:":visited",target:":target","placeholder-shown":":placeholder-shown","read-only":":read-only",before:"::before",after:"::after",placeholder:"::placeholder",selection:"::selection","file-selector":"::file-selector-button",marker:"::marker"}[p]??`:${p}`;s.push(`.${x}${$}{${t}}`)}}return s.length>0&&Ne(b,s.join("")),x}const De=j;function Be(){return Array.from(Z.values()).join(`
|
|
4
|
+
`)}function Ye(){Z.clear(),H=null,_&&typeof document<"u"&&(document.adoptedStyleSheets=document.adoptedStyleSheets.filter(e=>e!==_),_=null)}function K(...e){return e.filter(Boolean).join(" ")}const J=new Map;function Ue(e){J.set(e.name,e.utilities)}function _e(e){J.delete(e)}function Ke(){return Array.from(J.keys())}function he(e){for(const i of J.values())if(i[e])return i[e];return null}const ee=l.createContext(null);function Ge(){const e=l.useContext(ee);if(!e)throw new Error("TkxFormField must be used inside a <TkxForm>. Wrap your fields in a TkxForm component.");return e}async function oe(e,i){for(const o of i){if(o.required&&(e==null||e===""||Array.isArray(e)&&e.length===0))return o.message??"This field is required";if(!(e==null||e==="")){if(o.min!==void 0){if(typeof e=="string"&&e.length<o.min)return o.message??`Must be at least ${o.min} characters`;if(typeof e=="number"&&e<o.min)return o.message??`Must be at least ${o.min}`}if(o.max!==void 0){if(typeof e=="string"&&e.length>o.max)return o.message??`Must be no more than ${o.max} characters`;if(typeof e=="number"&&e>o.max)return o.message??`Must be no more than ${o.max}`}if(o.pattern&&typeof e=="string"&&!o.pattern.test(e))return o.message??"Invalid format";if(o.validator){const s=await o.validator(e);if(s)return s}}}return null}function Xe(e,i){const o=e?[...e]:[];return i&&!o.some(s=>s.required)&&o.unshift({required:!0,message:"This field is required"}),o}function Ze(e){return e.some(i=>i.required)}function Je(){const e=l.useContext(ee),i=l.useRef({}),o=l.useRef({}),s=l.useRef({}),a=l.useMemo(()=>({getFieldValue:f=>i.current[f],setFieldValue:(f,b)=>{i.current[f]=b},getFieldsValue:()=>({...i.current}),setFieldsValue:f=>{Object.assign(i.current,f)},validateFields:()=>Promise.resolve({...i.current}),validateField:f=>Promise.resolve(!0),resetFields:()=>{i.current={},o.current={},s.current={}},getFieldError:f=>o.current[f]??null,isFieldTouched:f=>s.current[f]??!1}),[]);return e?e.instance:a}function xe({onSubmit:e,onValuesChange:i,initialValues:o={},layout:s="vertical",disabled:a=!1,children:f,className:b,style:x,form:p}){const h=R.useTheme(),[t,g]=l.useState({values:{...o},errors:{},touched:{}}),$=l.useRef(o),v=l.useRef({}),w=l.useRef(t);w.current=t;const C=l.useCallback((d,r)=>{v.current[d]=r},[]),I=l.useCallback(d=>{delete v.current[d]},[]),P=l.useCallback((d,r)=>{g(n=>{const m={...n,values:{...n.values,[d]:r}};return i==null||i({[d]:r},m.values),m})},[i]),W=l.useCallback((d,r)=>{g(n=>({...n,errors:{...n.errors,[d]:r}}))},[]),F=l.useCallback(d=>{g(r=>({...r,touched:{...r.touched,[d]:!0}}))},[]),M=l.useCallback(async d=>{const r=v.current[d];if(!r)return!0;const n=w.current.values[d],m=await oe(n,r.rules);return g(k=>({...k,errors:{...k.errors,[d]:m},touched:{...k.touched,[d]:!0}})),m===null},[]),z=l.useCallback(async()=>{const d=Object.keys(v.current),r=await Promise.all(d.map(async S=>{const T=v.current[S],be=w.current.values[S],ve=await oe(be,T.rules);return{name:S,error:ve}})),n={},m={};let k=!1;for(const{name:S,error:T}of r)n[S]=T,m[S]=!0,T&&(k=!0);if(g(S=>({...S,errors:{...S.errors,...n},touched:{...S.touched,...m}})),k){const S=Object.fromEntries(r.filter(T=>T.error).map(T=>[T.name,T.error]));return Promise.reject(S)}return{...w.current.values}},[]),q=l.useCallback(()=>{g({values:{...$.current},errors:{},touched:{}})},[]),B=l.useMemo(()=>({getFieldValue:d=>w.current.values[d],setFieldValue:P,getFieldsValue:()=>({...w.current.values}),setFieldsValue:d=>{g(r=>{const n={...r.values,...d};return i==null||i(d,n),{...r,values:n}})},validateFields:z,validateField:M,resetFields:q,getFieldError:d=>w.current.errors[d]??null,isFieldTouched:d=>!!w.current.touched[d]}),[P,z,M,q,i]),O=l.useCallback(async d=>{d.preventDefault();try{const r=await z();await(e==null?void 0:e(r))}catch{}},[z,e]),N=j(s==="inline"?"flex flex-row flex-wrap items-end gap-4":"flex flex-col gap-5"),L=p??B,Y=l.useMemo(()=>({state:t,initialValues:$.current,layout:s,disabled:a,fieldMeta:v,setFieldValue:P,setFieldError:W,setFieldTouched:F,registerField:C,unregisterField:I,validateField:M,instance:L}),[t,s,a,P,W,F,C,I,M,L]);return y.jsx(ee.Provider,{value:Y,children:y.jsx("form",{noValidate:!0,role:"form","aria-label":"Form",onSubmit:O,className:K(N,b),style:{color:h.text,...x},children:f})})}xe.displayName="TkxForm";function ge({name:e,label:i,rules:o,help:s,required:a,children:f,className:b,style:x}){const p=R.useTheme(),h=Ge(),{state:t,layout:g,disabled:$}=h,v=l.useMemo(()=>Xe(o,a),[o,a]),w=Ze(v),C=l.useRef({rules:v});C.current.rules=v;const I=l.useRef(!1);I.current||(h.registerField(e,C.current),I.current=!0),l.useMemo(()=>{h.registerField(e,C.current)},[v,e,h]);const P=t.values[e],W=t.touched[e]?t.errors[e]??null:null,F=W?U(W):null,M=i?U(i):void 0,z=s?U(s):void 0,q=l.useCallback(n=>{let m;if(n!==null&&typeof n=="object"&&"target"in n){const k=n.target;m=k.type==="checkbox"?k.checked:k.value}else m=n;h.setFieldValue(e,m)},[h,e]),B=l.useCallback(()=>{h.setFieldTouched(e),h.validateField(e)},[h,e]),O=l.cloneElement(f,{value:P??"",onChange:q,onBlur:B,error:F??void 0,isInvalid:!!F,isRequired:w,disabled:$||f.props.disabled,name:e}),N=g==="horizontal",L=g==="inline",Y=y.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:y.jsx("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),d=M?y.jsxs("label",{className:j("text-sm font-medium font-sans",N?"min-w-[140px] pt-2.5":""),style:{color:p.text},children:[M,w&&y.jsx("span",{"aria-hidden":"true",className:j("ml-1"),style:{color:p.danger},children:"*"})]}):null,r=y.jsxs(y.Fragment,{children:[z&&!F&&y.jsx("span",{className:j("text-xs mt-0.5"),style:{color:p.textMuted},children:z}),F&&y.jsxs("span",{role:"alert",className:j("text-xs flex items-center gap-1 mt-0.5"),style:{color:p.danger,animation:"tkxFormErrorReveal 200ms ease-out"},children:[Y,F]})]});return L?y.jsxs("div",{className:K(j("flex flex-col gap-1"),b),style:x,children:[d,O,r]}):N?y.jsxs("div",{className:K(j("flex flex-row gap-4 items-start"),b),style:x,children:[d,y.jsxs("div",{className:j("flex flex-col gap-1 flex-1 min-w-0"),children:[O,r]})]}):y.jsxs("div",{className:K(j("flex flex-col gap-1"),b),style:x,children:[d,O,r]})}ge.displayName="TkxFormField";let se=!1;function Ve(){if(se||typeof document>"u")return;se=!0;const e=document.createElement("style");e.setAttribute("data-tkx-form",""),e.textContent=`
|
|
5
|
+
@keyframes tkxFormErrorReveal {
|
|
6
|
+
from {
|
|
7
|
+
opacity: 0;
|
|
8
|
+
transform: translateY(-4px);
|
|
9
|
+
}
|
|
10
|
+
to {
|
|
11
|
+
opacity: 1;
|
|
12
|
+
transform: translateY(0);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
`,document.head.appendChild(e)}Ve();exports.Shield=Se;exports.TkxForm=xe;exports.TkxFormField=ge;exports.audit=fe;exports.cx=K;exports.extractAtomicCSS=Be;exports.getAuditLog=de;exports.resetAtomicCSS=Ye;exports.resolvePluginUtility=he;exports.sanitizeProps=Q;exports.sanitizeString=U;exports.tkx=j;exports.tkxListPlugins=Ke;exports.tkxPlugin=Ue;exports.tkxRemovePlugin=_e;exports.tx=De;exports.useAnnounce=Ee;exports.useClickOutside=Ce;exports.useEscapeKey=Re;exports.useFocusTrap=Me;exports.useHighContrast=Fe;exports.useReducedMotion=je;exports.useTkxForm=Je;exports.validateProps=ce;exports.verifyAuditIntegrity=ue;
|
package/dist/charts.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("recharts"),b=require("./index-BINBzXuY.cjs");function C(r){return[r.primary,r.secondary,r.info,r.success,r.warning,r.danger,"#a855f7","#f97316","#14b8a6","#e879f9"]}const v={top:10,right:30,bottom:10,left:0};function T(r){return{contentStyle:{backgroundColor:r.surface,border:`1px solid ${r.border}`,borderRadius:8,boxShadow:"0 4px 12px rgba(0,0,0,0.15)",color:r.text,fontSize:13},labelStyle:{color:r.textMuted,fontWeight:600,marginBottom:4},itemStyle:{color:r.text},cursor:{fill:`${r.primary}15`}}}function A({data:r,series:S,xKey:h,height:m=300,margin:d=v,showGrid:x=!0,showLegend:u=!0,showTooltip:j=!0,smooth:a=!0,xTickFormatter:y,yTickFormatter:i,yDomain:o,ariaLabel:c="Area chart"}){const l=b.useTheme(),f=C(l),n=T(l),g={fill:l.textMuted,fontSize:12};return e.jsx("div",{role:"img","aria-label":c,style:{width:"100%",height:m},children:e.jsx(t.ResponsiveContainer,{width:"100%",height:"100%",children:e.jsxs(t.AreaChart,{data:r,margin:d,children:[x&&e.jsx(t.CartesianGrid,{strokeDasharray:"3 3",stroke:l.border,vertical:!1}),e.jsx(t.XAxis,{dataKey:h,tick:g,axisLine:{stroke:l.border},tickLine:!1,tickFormatter:y}),e.jsx(t.YAxis,{tick:g,axisLine:!1,tickLine:!1,tickFormatter:i,domain:o}),j&&e.jsx(t.Tooltip,{contentStyle:n.contentStyle,labelStyle:n.labelStyle,itemStyle:n.itemStyle,cursor:n.cursor}),u&&e.jsx(t.Legend,{wrapperStyle:{fontSize:13,color:l.textMuted,paddingTop:8}}),S.map((k,p)=>{const s=k.color??f[p%f.length];return e.jsx(t.Area,{type:a?"monotone":"linear",dataKey:k.key,name:k.label??k.key,stroke:s,strokeWidth:2,fill:s,fillOpacity:k.fillOpacity??.2,stackId:k.stacked?"stack":void 0,dot:!1,activeDot:{r:5,strokeWidth:0}},k.key)})]})})})}function z({data:r,series:S,xKey:h,height:m=300,margin:d=v,showGrid:x=!0,showLegend:u=!0,showTooltip:j=!0,layout:a="horizontal",barSize:y,xTickFormatter:i,yTickFormatter:o,ariaLabel:c="Bar chart"}){const l=b.useTheme(),f=C(l),n=T(l),g={fill:l.textMuted,fontSize:12},k=a==="vertical";return e.jsx("div",{role:"img","aria-label":c,style:{width:"100%",height:m},children:e.jsx(t.ResponsiveContainer,{width:"100%",height:"100%",children:e.jsxs(t.BarChart,{data:r,margin:d,layout:a,children:[x&&e.jsx(t.CartesianGrid,{strokeDasharray:"3 3",stroke:l.border,vertical:k,horizontal:!k}),k?e.jsxs(e.Fragment,{children:[e.jsx(t.YAxis,{dataKey:h,type:"category",tick:g,axisLine:!1,tickLine:!1,tickFormatter:i,width:100}),e.jsx(t.XAxis,{type:"number",tick:g,axisLine:{stroke:l.border},tickLine:!1,tickFormatter:o})]}):e.jsxs(e.Fragment,{children:[e.jsx(t.XAxis,{dataKey:h,tick:g,axisLine:{stroke:l.border},tickLine:!1,tickFormatter:i}),e.jsx(t.YAxis,{tick:g,axisLine:!1,tickLine:!1,tickFormatter:o})]}),j&&e.jsx(t.Tooltip,{contentStyle:n.contentStyle,labelStyle:n.labelStyle,itemStyle:n.itemStyle,cursor:{fill:`${l.surfaceAlt}`}}),u&&e.jsx(t.Legend,{wrapperStyle:{fontSize:13,color:l.textMuted,paddingTop:8}}),S.map((p,s)=>{const L=p.color??f[s%f.length];return e.jsx(t.Bar,{dataKey:p.key,name:p.label??p.key,fill:L,stackId:p.stackId,maxBarSize:y??40,radius:p.radius??[4,4,0,0]},p.key)})]})})})}function M({data:r,series:S,xKey:h,height:m=300,margin:d=v,showGrid:x=!0,showLegend:u=!0,showTooltip:j=!0,smooth:a=!0,referenceLines:y=[],xTickFormatter:i,yTickFormatter:o,yDomain:c,connectNulls:l=!1,ariaLabel:f="Line chart"}){const n=b.useTheme(),g=C(n),k=T(n),p={fill:n.textMuted,fontSize:12};return e.jsx("div",{role:"img","aria-label":f,style:{width:"100%",height:m},children:e.jsx(t.ResponsiveContainer,{width:"100%",height:"100%",children:e.jsxs(t.LineChart,{data:r,margin:d,children:[x&&e.jsx(t.CartesianGrid,{strokeDasharray:"3 3",stroke:n.border,vertical:!1}),e.jsx(t.XAxis,{dataKey:h,tick:p,axisLine:{stroke:n.border},tickLine:!1,tickFormatter:i}),e.jsx(t.YAxis,{tick:p,axisLine:!1,tickLine:!1,tickFormatter:o,domain:c}),j&&e.jsx(t.Tooltip,{contentStyle:k.contentStyle,labelStyle:k.labelStyle,itemStyle:k.itemStyle,cursor:{stroke:n.border,strokeWidth:1}}),u&&e.jsx(t.Legend,{wrapperStyle:{fontSize:13,color:n.textMuted,paddingTop:8}}),y.map((s,L)=>e.jsx(t.ReferenceLine,{y:s.y,x:s.x,label:s.label?{value:s.label,fill:n.textMuted,fontSize:11}:void 0,stroke:s.color??n.border,strokeDasharray:s.dashed?"4 4":void 0},L)),S.map((s,L)=>{const w=s.color??g[L%g.length];return e.jsx(t.Line,{type:a?"monotone":"linear",dataKey:s.key,name:s.label??s.key,stroke:w,strokeWidth:s.strokeWidth??2,strokeDasharray:s.dashed?"6 3":void 0,dot:s.dot??!1,activeDot:{r:5,strokeWidth:0,fill:w},connectNulls:l},s.key)})]})})})}function R({data:r,height:S=300,showLegend:h=!0,showTooltip:m=!0,showLabels:d=!1,outerRadius:x="70%",startAngle:u=90,ariaLabel:j="Pie chart"}){const a=b.useTheme(),y=C(a),i=T(a);return e.jsx("div",{role:"img","aria-label":j,style:{width:"100%",height:S},children:e.jsx(t.ResponsiveContainer,{width:"100%",height:"100%",children:e.jsxs(t.PieChart,{children:[m&&e.jsx(t.Tooltip,{contentStyle:i.contentStyle,labelStyle:i.labelStyle,itemStyle:i.itemStyle}),h&&e.jsx(t.Legend,{wrapperStyle:{fontSize:13,color:a.textMuted}}),e.jsx(t.Pie,{data:r,dataKey:"value",nameKey:"name",outerRadius:x,startAngle:u,endAngle:u-360,label:d?({name:o,percent:c})=>`${o} (${(c*100).toFixed(0)}%)`:void 0,labelLine:d,strokeWidth:2,stroke:a.bg,children:r.map((o,c)=>e.jsx(t.Cell,{fill:o.color??y[c%y.length]},o.name))})]})})})}function D({data:r,height:S=300,showLegend:h=!0,showTooltip:m=!0,centerLabel:d,centerSublabel:x,innerRadius:u="55%",outerRadius:j="75%",startAngle:a=90,ariaLabel:y="Donut chart"}){const i=b.useTheme(),o=C(i),c=T(i);return e.jsxs("div",{role:"img","aria-label":y,style:{width:"100%",height:S},children:[e.jsx(t.ResponsiveContainer,{width:"100%",height:"100%",children:e.jsxs(t.PieChart,{children:[m&&e.jsx(t.Tooltip,{contentStyle:c.contentStyle,labelStyle:c.labelStyle,itemStyle:c.itemStyle}),h&&e.jsx(t.Legend,{wrapperStyle:{fontSize:13,color:i.textMuted}}),e.jsx(t.Pie,{data:r,dataKey:"value",nameKey:"name",innerRadius:u,outerRadius:j,startAngle:a,endAngle:a-360,strokeWidth:3,stroke:i.bg,label:!1,labelLine:!1,children:r.map((l,f)=>e.jsx(t.Cell,{fill:l.color??o[f%o.length]},l.name))}),(d||x)&&e.jsx("text",{})]})}),(d||x)&&e.jsxs("div",{style:{position:"absolute",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",pointerEvents:"none",marginTop:h?-24:0},children:[d&&e.jsx("span",{style:{fontSize:22,fontWeight:700,color:i.text,lineHeight:1},children:d}),x&&e.jsx("span",{style:{fontSize:13,color:i.textMuted,marginTop:4},children:x})]})]})}function K({series:r,height:S=300,margin:h=v,showGrid:m=!0,showLegend:d=!0,showTooltip:x=!0,xTickFormatter:u,yTickFormatter:j,zRange:a=[20,400],ariaLabel:y="Scatter chart"}){const i=b.useTheme(),o=C(i),c=T(i),l={fill:i.textMuted,fontSize:12};return e.jsx("div",{role:"img","aria-label":y,style:{width:"100%",height:S},children:e.jsx(t.ResponsiveContainer,{width:"100%",height:"100%",children:e.jsxs(t.ScatterChart,{margin:h,children:[m&&e.jsx(t.CartesianGrid,{strokeDasharray:"3 3",stroke:i.border}),e.jsx(t.XAxis,{type:"number",dataKey:"x",tick:l,axisLine:{stroke:i.border},tickLine:!1,tickFormatter:u}),e.jsx(t.YAxis,{type:"number",dataKey:"y",tick:l,axisLine:!1,tickLine:!1,tickFormatter:j}),e.jsx(t.ZAxis,{type:"number",dataKey:"z",range:a}),x&&e.jsx(t.Tooltip,{contentStyle:c.contentStyle,labelStyle:c.labelStyle,itemStyle:c.itemStyle,cursor:{strokeDasharray:"3 3"}}),d&&e.jsx(t.Legend,{wrapperStyle:{fontSize:13,color:i.textMuted,paddingTop:8}}),r.map((f,n)=>e.jsx(t.Scatter,{name:f.name,data:f.data,fill:f.color??o[n%o.length],fillOpacity:.8},f.name??n))]})})})}function F({data:r,series:S,angleKey:h,height:m=300,showLegend:d=!0,showTooltip:x=!0,outerRadius:u="70%",ariaLabel:j="Radar chart"}){const a=b.useTheme(),y=C(a),i=T(a);return e.jsx("div",{role:"img","aria-label":j,style:{width:"100%",height:m},children:e.jsx(t.ResponsiveContainer,{width:"100%",height:"100%",children:e.jsxs(t.RadarChart,{data:r,outerRadius:u,children:[e.jsx(t.PolarGrid,{stroke:a.border}),e.jsx(t.PolarAngleAxis,{dataKey:h,tick:{fill:a.textMuted,fontSize:12}}),e.jsx(t.PolarRadiusAxis,{tick:{fill:a.textMuted,fontSize:10},axisLine:!1,tickLine:!1}),x&&e.jsx(t.Tooltip,{contentStyle:i.contentStyle,labelStyle:i.labelStyle,itemStyle:i.itemStyle}),d&&e.jsx(t.Legend,{wrapperStyle:{fontSize:13,color:a.textMuted}}),S.map((o,c)=>{const l=o.color??y[c%y.length];return e.jsx(t.Radar,{name:o.label??o.key,dataKey:o.key,stroke:l,fill:l,fillOpacity:o.fillOpacity??.2,strokeWidth:2},o.key)})]})})})}exports.TkxAreaChart=A;exports.TkxBarChart=z;exports.TkxDonutChart=D;exports.TkxLineChart=M;exports.TkxPieChart=R;exports.TkxRadarChart=F;exports.TkxScatterChart=K;
|
package/dist/charts.js
ADDED
|
@@ -0,0 +1,480 @@
|
|
|
1
|
+
import { jsx as t, jsxs as b, Fragment as R } from "react/jsx-runtime";
|
|
2
|
+
import { ResponsiveContainer as L, AreaChart as O, CartesianGrid as A, XAxis as D, YAxis as T, Tooltip as v, Legend as w, Area as $, BarChart as j, Bar as G, LineChart as E, ReferenceLine as H, Line as N, PieChart as P, Pie as B, Cell as I, ScatterChart as U, ZAxis as V, Scatter as X, RadarChart as Y, PolarGrid as Z, PolarAngleAxis as _, PolarRadiusAxis as q, Radar as J } from "recharts";
|
|
3
|
+
import { u as z } from "./index-eT_U4qB2.js";
|
|
4
|
+
function C(e) {
|
|
5
|
+
return [
|
|
6
|
+
e.primary,
|
|
7
|
+
e.secondary,
|
|
8
|
+
e.info,
|
|
9
|
+
e.success,
|
|
10
|
+
e.warning,
|
|
11
|
+
e.danger,
|
|
12
|
+
"#a855f7",
|
|
13
|
+
"#f97316",
|
|
14
|
+
"#14b8a6",
|
|
15
|
+
"#e879f9"
|
|
16
|
+
];
|
|
17
|
+
}
|
|
18
|
+
const F = { top: 10, right: 30, bottom: 10, left: 0 };
|
|
19
|
+
function M(e) {
|
|
20
|
+
return {
|
|
21
|
+
contentStyle: {
|
|
22
|
+
backgroundColor: e.surface,
|
|
23
|
+
border: `1px solid ${e.border}`,
|
|
24
|
+
borderRadius: 8,
|
|
25
|
+
boxShadow: "0 4px 12px rgba(0,0,0,0.15)",
|
|
26
|
+
color: e.text,
|
|
27
|
+
fontSize: 13
|
|
28
|
+
},
|
|
29
|
+
labelStyle: { color: e.textMuted, fontWeight: 600, marginBottom: 4 },
|
|
30
|
+
itemStyle: { color: e.text },
|
|
31
|
+
cursor: { fill: `${e.primary}15` }
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function rt({
|
|
35
|
+
data: e,
|
|
36
|
+
series: S,
|
|
37
|
+
xKey: y,
|
|
38
|
+
height: m = 300,
|
|
39
|
+
margin: d = F,
|
|
40
|
+
showGrid: s = !0,
|
|
41
|
+
showLegend: f = !0,
|
|
42
|
+
showTooltip: p = !0,
|
|
43
|
+
smooth: o = !0,
|
|
44
|
+
xTickFormatter: h,
|
|
45
|
+
yTickFormatter: r,
|
|
46
|
+
yDomain: l,
|
|
47
|
+
ariaLabel: c = "Area chart"
|
|
48
|
+
}) {
|
|
49
|
+
const i = z(), u = C(i), a = M(i), g = { fill: i.textMuted, fontSize: 12 };
|
|
50
|
+
return /* @__PURE__ */ t("div", { role: "img", "aria-label": c, style: { width: "100%", height: m }, children: /* @__PURE__ */ t(L, { width: "100%", height: "100%", children: /* @__PURE__ */ b(O, { data: e, margin: d, children: [
|
|
51
|
+
s && /* @__PURE__ */ t(A, { strokeDasharray: "3 3", stroke: i.border, vertical: !1 }),
|
|
52
|
+
/* @__PURE__ */ t(
|
|
53
|
+
D,
|
|
54
|
+
{
|
|
55
|
+
dataKey: y,
|
|
56
|
+
tick: g,
|
|
57
|
+
axisLine: { stroke: i.border },
|
|
58
|
+
tickLine: !1,
|
|
59
|
+
tickFormatter: h
|
|
60
|
+
}
|
|
61
|
+
),
|
|
62
|
+
/* @__PURE__ */ t(
|
|
63
|
+
T,
|
|
64
|
+
{
|
|
65
|
+
tick: g,
|
|
66
|
+
axisLine: !1,
|
|
67
|
+
tickLine: !1,
|
|
68
|
+
tickFormatter: r,
|
|
69
|
+
domain: l
|
|
70
|
+
}
|
|
71
|
+
),
|
|
72
|
+
p && /* @__PURE__ */ t(
|
|
73
|
+
v,
|
|
74
|
+
{
|
|
75
|
+
contentStyle: a.contentStyle,
|
|
76
|
+
labelStyle: a.labelStyle,
|
|
77
|
+
itemStyle: a.itemStyle,
|
|
78
|
+
cursor: a.cursor
|
|
79
|
+
}
|
|
80
|
+
),
|
|
81
|
+
f && /* @__PURE__ */ t(
|
|
82
|
+
w,
|
|
83
|
+
{
|
|
84
|
+
wrapperStyle: { fontSize: 13, color: i.textMuted, paddingTop: 8 }
|
|
85
|
+
}
|
|
86
|
+
),
|
|
87
|
+
S.map((k, x) => {
|
|
88
|
+
const n = k.color ?? u[x % u.length];
|
|
89
|
+
return /* @__PURE__ */ t(
|
|
90
|
+
$,
|
|
91
|
+
{
|
|
92
|
+
type: o ? "monotone" : "linear",
|
|
93
|
+
dataKey: k.key,
|
|
94
|
+
name: k.label ?? k.key,
|
|
95
|
+
stroke: n,
|
|
96
|
+
strokeWidth: 2,
|
|
97
|
+
fill: n,
|
|
98
|
+
fillOpacity: k.fillOpacity ?? 0.2,
|
|
99
|
+
stackId: k.stacked ? "stack" : void 0,
|
|
100
|
+
dot: !1,
|
|
101
|
+
activeDot: { r: 5, strokeWidth: 0 }
|
|
102
|
+
},
|
|
103
|
+
k.key
|
|
104
|
+
);
|
|
105
|
+
})
|
|
106
|
+
] }) }) });
|
|
107
|
+
}
|
|
108
|
+
function it({
|
|
109
|
+
data: e,
|
|
110
|
+
series: S,
|
|
111
|
+
xKey: y,
|
|
112
|
+
height: m = 300,
|
|
113
|
+
margin: d = F,
|
|
114
|
+
showGrid: s = !0,
|
|
115
|
+
showLegend: f = !0,
|
|
116
|
+
showTooltip: p = !0,
|
|
117
|
+
layout: o = "horizontal",
|
|
118
|
+
barSize: h,
|
|
119
|
+
xTickFormatter: r,
|
|
120
|
+
yTickFormatter: l,
|
|
121
|
+
ariaLabel: c = "Bar chart"
|
|
122
|
+
}) {
|
|
123
|
+
const i = z(), u = C(i), a = M(i), g = { fill: i.textMuted, fontSize: 12 }, k = o === "vertical";
|
|
124
|
+
return /* @__PURE__ */ t("div", { role: "img", "aria-label": c, style: { width: "100%", height: m }, children: /* @__PURE__ */ t(L, { width: "100%", height: "100%", children: /* @__PURE__ */ b(j, { data: e, margin: d, layout: o, children: [
|
|
125
|
+
s && /* @__PURE__ */ t(
|
|
126
|
+
A,
|
|
127
|
+
{
|
|
128
|
+
strokeDasharray: "3 3",
|
|
129
|
+
stroke: i.border,
|
|
130
|
+
vertical: k,
|
|
131
|
+
horizontal: !k
|
|
132
|
+
}
|
|
133
|
+
),
|
|
134
|
+
k ? /* @__PURE__ */ b(R, { children: [
|
|
135
|
+
/* @__PURE__ */ t(T, { dataKey: y, type: "category", tick: g, axisLine: !1, tickLine: !1, tickFormatter: r, width: 100 }),
|
|
136
|
+
/* @__PURE__ */ t(D, { type: "number", tick: g, axisLine: { stroke: i.border }, tickLine: !1, tickFormatter: l })
|
|
137
|
+
] }) : /* @__PURE__ */ b(R, { children: [
|
|
138
|
+
/* @__PURE__ */ t(D, { dataKey: y, tick: g, axisLine: { stroke: i.border }, tickLine: !1, tickFormatter: r }),
|
|
139
|
+
/* @__PURE__ */ t(T, { tick: g, axisLine: !1, tickLine: !1, tickFormatter: l })
|
|
140
|
+
] }),
|
|
141
|
+
p && /* @__PURE__ */ t(
|
|
142
|
+
v,
|
|
143
|
+
{
|
|
144
|
+
contentStyle: a.contentStyle,
|
|
145
|
+
labelStyle: a.labelStyle,
|
|
146
|
+
itemStyle: a.itemStyle,
|
|
147
|
+
cursor: { fill: `${i.surfaceAlt}` }
|
|
148
|
+
}
|
|
149
|
+
),
|
|
150
|
+
f && /* @__PURE__ */ t(w, { wrapperStyle: { fontSize: 13, color: i.textMuted, paddingTop: 8 } }),
|
|
151
|
+
S.map((x, n) => {
|
|
152
|
+
const K = x.color ?? u[n % u.length];
|
|
153
|
+
return /* @__PURE__ */ t(
|
|
154
|
+
G,
|
|
155
|
+
{
|
|
156
|
+
dataKey: x.key,
|
|
157
|
+
name: x.label ?? x.key,
|
|
158
|
+
fill: K,
|
|
159
|
+
stackId: x.stackId,
|
|
160
|
+
maxBarSize: h ?? 40,
|
|
161
|
+
radius: x.radius ?? [4, 4, 0, 0]
|
|
162
|
+
},
|
|
163
|
+
x.key
|
|
164
|
+
);
|
|
165
|
+
})
|
|
166
|
+
] }) }) });
|
|
167
|
+
}
|
|
168
|
+
function lt({
|
|
169
|
+
data: e,
|
|
170
|
+
series: S,
|
|
171
|
+
xKey: y,
|
|
172
|
+
height: m = 300,
|
|
173
|
+
margin: d = F,
|
|
174
|
+
showGrid: s = !0,
|
|
175
|
+
showLegend: f = !0,
|
|
176
|
+
showTooltip: p = !0,
|
|
177
|
+
smooth: o = !0,
|
|
178
|
+
referenceLines: h = [],
|
|
179
|
+
xTickFormatter: r,
|
|
180
|
+
yTickFormatter: l,
|
|
181
|
+
yDomain: c,
|
|
182
|
+
connectNulls: i = !1,
|
|
183
|
+
ariaLabel: u = "Line chart"
|
|
184
|
+
}) {
|
|
185
|
+
const a = z(), g = C(a), k = M(a), x = { fill: a.textMuted, fontSize: 12 };
|
|
186
|
+
return /* @__PURE__ */ t("div", { role: "img", "aria-label": u, style: { width: "100%", height: m }, children: /* @__PURE__ */ t(L, { width: "100%", height: "100%", children: /* @__PURE__ */ b(E, { data: e, margin: d, children: [
|
|
187
|
+
s && /* @__PURE__ */ t(A, { strokeDasharray: "3 3", stroke: a.border, vertical: !1 }),
|
|
188
|
+
/* @__PURE__ */ t(
|
|
189
|
+
D,
|
|
190
|
+
{
|
|
191
|
+
dataKey: y,
|
|
192
|
+
tick: x,
|
|
193
|
+
axisLine: { stroke: a.border },
|
|
194
|
+
tickLine: !1,
|
|
195
|
+
tickFormatter: r
|
|
196
|
+
}
|
|
197
|
+
),
|
|
198
|
+
/* @__PURE__ */ t(
|
|
199
|
+
T,
|
|
200
|
+
{
|
|
201
|
+
tick: x,
|
|
202
|
+
axisLine: !1,
|
|
203
|
+
tickLine: !1,
|
|
204
|
+
tickFormatter: l,
|
|
205
|
+
domain: c
|
|
206
|
+
}
|
|
207
|
+
),
|
|
208
|
+
p && /* @__PURE__ */ t(
|
|
209
|
+
v,
|
|
210
|
+
{
|
|
211
|
+
contentStyle: k.contentStyle,
|
|
212
|
+
labelStyle: k.labelStyle,
|
|
213
|
+
itemStyle: k.itemStyle,
|
|
214
|
+
cursor: { stroke: a.border, strokeWidth: 1 }
|
|
215
|
+
}
|
|
216
|
+
),
|
|
217
|
+
f && /* @__PURE__ */ t(w, { wrapperStyle: { fontSize: 13, color: a.textMuted, paddingTop: 8 } }),
|
|
218
|
+
h.map((n, K) => /* @__PURE__ */ t(
|
|
219
|
+
H,
|
|
220
|
+
{
|
|
221
|
+
y: n.y,
|
|
222
|
+
x: n.x,
|
|
223
|
+
label: n.label ? { value: n.label, fill: a.textMuted, fontSize: 11 } : void 0,
|
|
224
|
+
stroke: n.color ?? a.border,
|
|
225
|
+
strokeDasharray: n.dashed ? "4 4" : void 0
|
|
226
|
+
},
|
|
227
|
+
K
|
|
228
|
+
)),
|
|
229
|
+
S.map((n, K) => {
|
|
230
|
+
const W = n.color ?? g[K % g.length];
|
|
231
|
+
return /* @__PURE__ */ t(
|
|
232
|
+
N,
|
|
233
|
+
{
|
|
234
|
+
type: o ? "monotone" : "linear",
|
|
235
|
+
dataKey: n.key,
|
|
236
|
+
name: n.label ?? n.key,
|
|
237
|
+
stroke: W,
|
|
238
|
+
strokeWidth: n.strokeWidth ?? 2,
|
|
239
|
+
strokeDasharray: n.dashed ? "6 3" : void 0,
|
|
240
|
+
dot: n.dot ?? !1,
|
|
241
|
+
activeDot: { r: 5, strokeWidth: 0, fill: W },
|
|
242
|
+
connectNulls: i
|
|
243
|
+
},
|
|
244
|
+
n.key
|
|
245
|
+
);
|
|
246
|
+
})
|
|
247
|
+
] }) }) });
|
|
248
|
+
}
|
|
249
|
+
function ot({
|
|
250
|
+
data: e,
|
|
251
|
+
height: S = 300,
|
|
252
|
+
showLegend: y = !0,
|
|
253
|
+
showTooltip: m = !0,
|
|
254
|
+
showLabels: d = !1,
|
|
255
|
+
outerRadius: s = "70%",
|
|
256
|
+
startAngle: f = 90,
|
|
257
|
+
ariaLabel: p = "Pie chart"
|
|
258
|
+
}) {
|
|
259
|
+
const o = z(), h = C(o), r = M(o);
|
|
260
|
+
return /* @__PURE__ */ t("div", { role: "img", "aria-label": p, style: { width: "100%", height: S }, children: /* @__PURE__ */ t(L, { width: "100%", height: "100%", children: /* @__PURE__ */ b(P, { children: [
|
|
261
|
+
m && /* @__PURE__ */ t(
|
|
262
|
+
v,
|
|
263
|
+
{
|
|
264
|
+
contentStyle: r.contentStyle,
|
|
265
|
+
labelStyle: r.labelStyle,
|
|
266
|
+
itemStyle: r.itemStyle
|
|
267
|
+
}
|
|
268
|
+
),
|
|
269
|
+
y && /* @__PURE__ */ t(w, { wrapperStyle: { fontSize: 13, color: o.textMuted } }),
|
|
270
|
+
/* @__PURE__ */ t(
|
|
271
|
+
B,
|
|
272
|
+
{
|
|
273
|
+
data: e,
|
|
274
|
+
dataKey: "value",
|
|
275
|
+
nameKey: "name",
|
|
276
|
+
outerRadius: s,
|
|
277
|
+
startAngle: f,
|
|
278
|
+
endAngle: f - 360,
|
|
279
|
+
label: d ? ({ name: l, percent: c }) => `${l} (${(c * 100).toFixed(0)}%)` : void 0,
|
|
280
|
+
labelLine: d,
|
|
281
|
+
strokeWidth: 2,
|
|
282
|
+
stroke: o.bg,
|
|
283
|
+
children: e.map((l, c) => /* @__PURE__ */ t(
|
|
284
|
+
I,
|
|
285
|
+
{
|
|
286
|
+
fill: l.color ?? h[c % h.length]
|
|
287
|
+
},
|
|
288
|
+
l.name
|
|
289
|
+
))
|
|
290
|
+
}
|
|
291
|
+
)
|
|
292
|
+
] }) }) });
|
|
293
|
+
}
|
|
294
|
+
function at({
|
|
295
|
+
data: e,
|
|
296
|
+
height: S = 300,
|
|
297
|
+
showLegend: y = !0,
|
|
298
|
+
showTooltip: m = !0,
|
|
299
|
+
centerLabel: d,
|
|
300
|
+
centerSublabel: s,
|
|
301
|
+
innerRadius: f = "55%",
|
|
302
|
+
outerRadius: p = "75%",
|
|
303
|
+
startAngle: o = 90,
|
|
304
|
+
ariaLabel: h = "Donut chart"
|
|
305
|
+
}) {
|
|
306
|
+
const r = z(), l = C(r), c = M(r);
|
|
307
|
+
return /* @__PURE__ */ b("div", { role: "img", "aria-label": h, style: { width: "100%", height: S }, children: [
|
|
308
|
+
/* @__PURE__ */ t(L, { width: "100%", height: "100%", children: /* @__PURE__ */ b(P, { children: [
|
|
309
|
+
m && /* @__PURE__ */ t(
|
|
310
|
+
v,
|
|
311
|
+
{
|
|
312
|
+
contentStyle: c.contentStyle,
|
|
313
|
+
labelStyle: c.labelStyle,
|
|
314
|
+
itemStyle: c.itemStyle
|
|
315
|
+
}
|
|
316
|
+
),
|
|
317
|
+
y && /* @__PURE__ */ t(w, { wrapperStyle: { fontSize: 13, color: r.textMuted } }),
|
|
318
|
+
/* @__PURE__ */ t(
|
|
319
|
+
B,
|
|
320
|
+
{
|
|
321
|
+
data: e,
|
|
322
|
+
dataKey: "value",
|
|
323
|
+
nameKey: "name",
|
|
324
|
+
innerRadius: f,
|
|
325
|
+
outerRadius: p,
|
|
326
|
+
startAngle: o,
|
|
327
|
+
endAngle: o - 360,
|
|
328
|
+
strokeWidth: 3,
|
|
329
|
+
stroke: r.bg,
|
|
330
|
+
label: !1,
|
|
331
|
+
labelLine: !1,
|
|
332
|
+
children: e.map((i, u) => /* @__PURE__ */ t(I, { fill: i.color ?? l[u % l.length] }, i.name))
|
|
333
|
+
}
|
|
334
|
+
),
|
|
335
|
+
(d || s) && /* @__PURE__ */ t("text", {})
|
|
336
|
+
] }) }),
|
|
337
|
+
(d || s) && /* @__PURE__ */ b(
|
|
338
|
+
"div",
|
|
339
|
+
{
|
|
340
|
+
style: {
|
|
341
|
+
position: "absolute",
|
|
342
|
+
inset: 0,
|
|
343
|
+
display: "flex",
|
|
344
|
+
flexDirection: "column",
|
|
345
|
+
alignItems: "center",
|
|
346
|
+
justifyContent: "center",
|
|
347
|
+
pointerEvents: "none",
|
|
348
|
+
marginTop: y ? -24 : 0
|
|
349
|
+
},
|
|
350
|
+
children: [
|
|
351
|
+
d && /* @__PURE__ */ t("span", { style: { fontSize: 22, fontWeight: 700, color: r.text, lineHeight: 1 }, children: d }),
|
|
352
|
+
s && /* @__PURE__ */ t("span", { style: { fontSize: 13, color: r.textMuted, marginTop: 4 }, children: s })
|
|
353
|
+
]
|
|
354
|
+
}
|
|
355
|
+
)
|
|
356
|
+
] });
|
|
357
|
+
}
|
|
358
|
+
function nt({
|
|
359
|
+
series: e,
|
|
360
|
+
height: S = 300,
|
|
361
|
+
margin: y = F,
|
|
362
|
+
showGrid: m = !0,
|
|
363
|
+
showLegend: d = !0,
|
|
364
|
+
showTooltip: s = !0,
|
|
365
|
+
xTickFormatter: f,
|
|
366
|
+
yTickFormatter: p,
|
|
367
|
+
zRange: o = [20, 400],
|
|
368
|
+
ariaLabel: h = "Scatter chart"
|
|
369
|
+
}) {
|
|
370
|
+
const r = z(), l = C(r), c = M(r), i = { fill: r.textMuted, fontSize: 12 };
|
|
371
|
+
return /* @__PURE__ */ t("div", { role: "img", "aria-label": h, style: { width: "100%", height: S }, children: /* @__PURE__ */ t(L, { width: "100%", height: "100%", children: /* @__PURE__ */ b(U, { margin: y, children: [
|
|
372
|
+
m && /* @__PURE__ */ t(A, { strokeDasharray: "3 3", stroke: r.border }),
|
|
373
|
+
/* @__PURE__ */ t(
|
|
374
|
+
D,
|
|
375
|
+
{
|
|
376
|
+
type: "number",
|
|
377
|
+
dataKey: "x",
|
|
378
|
+
tick: i,
|
|
379
|
+
axisLine: { stroke: r.border },
|
|
380
|
+
tickLine: !1,
|
|
381
|
+
tickFormatter: f
|
|
382
|
+
}
|
|
383
|
+
),
|
|
384
|
+
/* @__PURE__ */ t(
|
|
385
|
+
T,
|
|
386
|
+
{
|
|
387
|
+
type: "number",
|
|
388
|
+
dataKey: "y",
|
|
389
|
+
tick: i,
|
|
390
|
+
axisLine: !1,
|
|
391
|
+
tickLine: !1,
|
|
392
|
+
tickFormatter: p
|
|
393
|
+
}
|
|
394
|
+
),
|
|
395
|
+
/* @__PURE__ */ t(V, { type: "number", dataKey: "z", range: o }),
|
|
396
|
+
s && /* @__PURE__ */ t(
|
|
397
|
+
v,
|
|
398
|
+
{
|
|
399
|
+
contentStyle: c.contentStyle,
|
|
400
|
+
labelStyle: c.labelStyle,
|
|
401
|
+
itemStyle: c.itemStyle,
|
|
402
|
+
cursor: { strokeDasharray: "3 3" }
|
|
403
|
+
}
|
|
404
|
+
),
|
|
405
|
+
d && /* @__PURE__ */ t(w, { wrapperStyle: { fontSize: 13, color: r.textMuted, paddingTop: 8 } }),
|
|
406
|
+
e.map((u, a) => /* @__PURE__ */ t(
|
|
407
|
+
X,
|
|
408
|
+
{
|
|
409
|
+
name: u.name,
|
|
410
|
+
data: u.data,
|
|
411
|
+
fill: u.color ?? l[a % l.length],
|
|
412
|
+
fillOpacity: 0.8
|
|
413
|
+
},
|
|
414
|
+
u.name ?? a
|
|
415
|
+
))
|
|
416
|
+
] }) }) });
|
|
417
|
+
}
|
|
418
|
+
function ct({
|
|
419
|
+
data: e,
|
|
420
|
+
series: S,
|
|
421
|
+
angleKey: y,
|
|
422
|
+
height: m = 300,
|
|
423
|
+
showLegend: d = !0,
|
|
424
|
+
showTooltip: s = !0,
|
|
425
|
+
outerRadius: f = "70%",
|
|
426
|
+
ariaLabel: p = "Radar chart"
|
|
427
|
+
}) {
|
|
428
|
+
const o = z(), h = C(o), r = M(o);
|
|
429
|
+
return /* @__PURE__ */ t("div", { role: "img", "aria-label": p, style: { width: "100%", height: m }, children: /* @__PURE__ */ t(L, { width: "100%", height: "100%", children: /* @__PURE__ */ b(Y, { data: e, outerRadius: f, children: [
|
|
430
|
+
/* @__PURE__ */ t(Z, { stroke: o.border }),
|
|
431
|
+
/* @__PURE__ */ t(
|
|
432
|
+
_,
|
|
433
|
+
{
|
|
434
|
+
dataKey: y,
|
|
435
|
+
tick: { fill: o.textMuted, fontSize: 12 }
|
|
436
|
+
}
|
|
437
|
+
),
|
|
438
|
+
/* @__PURE__ */ t(
|
|
439
|
+
q,
|
|
440
|
+
{
|
|
441
|
+
tick: { fill: o.textMuted, fontSize: 10 },
|
|
442
|
+
axisLine: !1,
|
|
443
|
+
tickLine: !1
|
|
444
|
+
}
|
|
445
|
+
),
|
|
446
|
+
s && /* @__PURE__ */ t(
|
|
447
|
+
v,
|
|
448
|
+
{
|
|
449
|
+
contentStyle: r.contentStyle,
|
|
450
|
+
labelStyle: r.labelStyle,
|
|
451
|
+
itemStyle: r.itemStyle
|
|
452
|
+
}
|
|
453
|
+
),
|
|
454
|
+
d && /* @__PURE__ */ t(w, { wrapperStyle: { fontSize: 13, color: o.textMuted } }),
|
|
455
|
+
S.map((l, c) => {
|
|
456
|
+
const i = l.color ?? h[c % h.length];
|
|
457
|
+
return /* @__PURE__ */ t(
|
|
458
|
+
J,
|
|
459
|
+
{
|
|
460
|
+
name: l.label ?? l.key,
|
|
461
|
+
dataKey: l.key,
|
|
462
|
+
stroke: i,
|
|
463
|
+
fill: i,
|
|
464
|
+
fillOpacity: l.fillOpacity ?? 0.2,
|
|
465
|
+
strokeWidth: 2
|
|
466
|
+
},
|
|
467
|
+
l.key
|
|
468
|
+
);
|
|
469
|
+
})
|
|
470
|
+
] }) }) });
|
|
471
|
+
}
|
|
472
|
+
export {
|
|
473
|
+
rt as TkxAreaChart,
|
|
474
|
+
it as TkxBarChart,
|
|
475
|
+
at as TkxDonutChart,
|
|
476
|
+
lt as TkxLineChart,
|
|
477
|
+
ot as TkxPieChart,
|
|
478
|
+
ct as TkxRadarChart,
|
|
479
|
+
nt as TkxScatterChart
|
|
480
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./TkxForm-ljQjX7KD.cjs"),y=require("./index-BINBzXuY.cjs"),t=require("react");function v(e=!1){const[c,s]=t.useState(e),n=t.useCallback(()=>s(!0),[]),r=t.useCallback(()=>s(!1),[]),u=t.useCallback(()=>s(o=>!o),[]);return{isOpen:c,open:n,close:r,toggle:u}}function p({count:e,initialIndex:c=0,orientation:s="horizontal",loop:n=!0}){const[r,u]=t.useState(c),o=t.useRef([]),a=t.useCallback(i=>{u(l=>{let b=l+i;return n?b=(b%e+e)%e:b=Math.max(0,Math.min(e-1,b)),requestAnimationFrame(()=>{var k;(k=o.current[b])==null||k.focus()}),b})},[e,n]),S=t.useCallback(i=>({tabIndex:i===r?0:-1,"data-focused":i===r,onFocus:()=>u(i),onKeyDown:l=>{const b=s==="horizontal"||s==="both",k=s==="vertical"||s==="both";b&&l.key==="ArrowRight"&&(l.preventDefault(),a(1)),b&&l.key==="ArrowLeft"&&(l.preventDefault(),a(-1)),k&&l.key==="ArrowDown"&&(l.preventDefault(),a(1)),k&&l.key==="ArrowUp"&&(l.preventDefault(),a(-1)),l.key==="Home"&&(l.preventDefault(),u(0),requestAnimationFrame(()=>{var C;return(C=o.current[0])==null?void 0:C.focus()})),l.key==="End"&&(l.preventDefault(),u(e-1),requestAnimationFrame(()=>{var C;return(C=o.current[e-1])==null?void 0:C.focus()}))}}),[r,a,s,e]);return{focusedIndex:r,setFocusedIndex:u,getItemProps:S}}function I({initialValues:e,validate:c}){const[s,n]=t.useState({...e}),[r,u]=t.useState({}),[o,a]=t.useState({}),S=t.useRef(e),i=t.useCallback((d,h)=>{n(A=>({...A,[d]:h}))},[]),l=t.useCallback(d=>{n(h=>({...h,...d}))},[]),b=t.useCallback(d=>{a(h=>({...h,[d]:!0}))},[]),k=t.useCallback(()=>{if(!c)return!0;const d=c(s),h=Object.fromEntries(Object.entries(d).filter(([,x])=>x!=null));u(h);const A=Object.fromEntries(Object.keys(s).map(x=>[x,!0]));return a(A),Object.keys(h).length===0},[s,c]),C=t.useCallback(()=>{n({...S.current}),u({}),a({})},[]),f=Object.keys(s).some(d=>s[d]!==S.current[d]),m=Object.keys(r).length===0,w=t.useCallback(d=>({value:s[d],onChange:h=>{i(d,h.target.value)},onBlur:()=>b(d),"aria-invalid":o[d]&&r[d]?!0:void 0,"aria-describedby":r[d]?`${String(d)}-error`:void 0}),[s,r,o,i,b]);return{values:s,errors:r,touched:o,dirty:f,isValid:m,setValue:i,setValues:l,touchField:b,validate:k,reset:C,getFieldProps:w}}function O({items:e,initialSelected:c=[],multiple:s=!0}){const[n,r]=t.useState(()=>new Set(c)),u=t.useCallback(f=>{r(m=>{const w=new Set(m);return w.has(f)?w.delete(f):(s||w.clear(),w.add(f)),w})},[s]),o=t.useCallback(f=>{r(m=>{if(m.has(f))return m;const w=s?new Set(m):new Set;return w.add(f),w})},[s]),a=t.useCallback(f=>{r(m=>{if(!m.has(f))return m;const w=new Set(m);return w.delete(f),w})},[]),S=t.useCallback(()=>{s&&r(new Set(e))},[e,s]),i=t.useCallback(()=>r(new Set),[]),l=t.useCallback(()=>{r(f=>e.every(w=>f.has(w))?new Set:new Set(e))},[e]),b=e.length>0&&e.every(f=>n.has(f)),k=e.some(f=>n.has(f)),C=t.useMemo(()=>Array.from(n),[n]);return{selected:n,isSelected:t.useCallback(f=>n.has(f),[n]),toggle:u,select:o,deselect:a,selectAll:S,deselectAll:i,toggleAll:l,allSelected:b,someSelected:k,selectedCount:n.size,selectedArray:C}}function R(e,c){const[s,n]=t.useState(e);return t.useEffect(()=>{const r=setTimeout(()=>n(e),c);return()=>clearTimeout(r)},[e,c]),s}function T(e,c){const[s,n]=t.useState(e),r=t.useRef(Date.now());return t.useEffect(()=>{const u=Date.now(),o=c-(u-r.current);if(o<=0)r.current=u,n(e);else{const a=setTimeout(()=>{r.current=Date.now(),n(e)},o);return()=>clearTimeout(a)}},[e,c]),s}function D({value:e,onChange:c,defaultValue:s}){const n=e!==void 0,[r,u]=t.useState(s),o=t.useRef(c);o.current=c;const a=t.useCallback(S=>{var i;n||u(S),(i=o.current)==null||i.call(o,S)},[n]);return[n?e:r,a]}function E(e){const[c,s]=t.useState(()=>typeof window>"u"?!1:window.matchMedia(e).matches);return t.useEffect(()=>{if(typeof window>"u")return;const n=window.matchMedia(e);s(n.matches);const r=u=>s(u.matches);return n.addEventListener("change",r),()=>n.removeEventListener("change",r)},[e]),c}function F(e,c){const[s,n]=t.useState(()=>{if(typeof window>"u")return c;try{const o=window.localStorage.getItem(e);return o!==null?JSON.parse(o):c}catch{return c}}),r=t.useCallback(o=>{n(a=>{const S=typeof o=="function"?o(a):o;if(typeof window<"u")try{window.localStorage.setItem(e,JSON.stringify(S))}catch{}return S})},[e]),u=t.useCallback(()=>{if(n(c),typeof window<"u")try{window.localStorage.removeItem(e)}catch{}},[e,c]);return[s,r,u]}function V({threshold:e=0,rootMargin:c="0px",root:s=null,once:n=!1}={}){const r=t.useRef(null),[u,o]=t.useState(null),a=t.useRef(null);return t.useEffect(()=>{const S=r.current;if(!(!S||typeof IntersectionObserver>"u"))return a.current=new IntersectionObserver(([i])=>{var l;o(i),n&&i.isIntersecting&&((l=a.current)==null||l.unobserve(S))},{threshold:e,rootMargin:c,root:s}),a.current.observe(S),()=>{var i;return(i=a.current)==null?void 0:i.disconnect()}},[e,c,s,n]),{ref:r,isIntersecting:(u==null?void 0:u.isIntersecting)??!1,entry:u}}exports.cx=g.cx;exports.extractAtomicCSS=g.extractAtomicCSS;exports.resetAtomicCSS=g.resetAtomicCSS;exports.sanitizeProps=g.sanitizeProps;exports.sanitizeString=g.sanitizeString;exports.tkxListPlugins=g.tkxListPlugins;exports.tkxPlugin=g.tkxPlugin;exports.tkxRemovePlugin=g.tkxRemovePlugin;exports.useAnnounce=g.useAnnounce;exports.useClickOutside=g.useClickOutside;exports.useEscapeKey=g.useEscapeKey;exports.useFocusTrap=g.useFocusTrap;exports.useHighContrast=g.useHighContrast;exports.useReducedMotion=g.useReducedMotion;exports.useTkxForm=g.useTkxForm;exports.contrastRatio=y.contrastRatio;exports.cssVar=y.cssVar;exports.extractCSS=y.extractCSS;exports.injectStyles=y.injectStyles;exports.meetsAA=y.meetsAA;exports.meetsAAA=y.meetsAAA;exports.resetStyles=y.resetStyles;exports.useControllable=D;exports.useDebounce=R;exports.useDisclosure=v;exports.useFormState=I;exports.useIntersectionObserver=V;exports.useListSelection=O;exports.useLocalStorage=F;exports.useMediaQuery=E;exports.useRovingTabIndex=p;exports.useThrottle=T;
|