@customafk/lunas-ui 0.2.63 → 0.2.65
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/action-submit-3kZ7JOop.cjs +2 -0
- package/dist/action-submit-3kZ7JOop.cjs.map +1 -0
- package/dist/action-submit-Dg5GvYz5.mjs +2 -0
- package/dist/action-submit-Dg5GvYz5.mjs.map +1 -0
- package/dist/actions-form-BL_B81Vg.mjs +2 -0
- package/dist/actions-form-BL_B81Vg.mjs.map +1 -0
- package/dist/actions-form-CE_enCgE.cjs +2 -0
- package/dist/actions-form-CE_enCgE.cjs.map +1 -0
- package/dist/card-form-BR5kDTzB.cjs +2 -0
- package/dist/card-form-BR5kDTzB.cjs.map +1 -0
- package/dist/card-form-D9fNO-6F.mjs +2 -0
- package/dist/card-form-D9fNO-6F.mjs.map +1 -0
- package/dist/checkbox-field-CRcfuDu1.mjs +2 -0
- package/dist/checkbox-field-CRcfuDu1.mjs.map +1 -0
- package/dist/checkbox-field-DdeohRmi.cjs +2 -0
- package/dist/checkbox-field-DdeohRmi.cjs.map +1 -0
- package/dist/combobox-field-BGChwajc.mjs +2 -0
- package/dist/combobox-field-BGChwajc.mjs.map +1 -0
- package/dist/combobox-field-D9NdSih1.cjs +2 -0
- package/dist/combobox-field-D9NdSih1.cjs.map +1 -0
- package/dist/container-form-BdsEX0NH.mjs +2 -0
- package/dist/container-form-BdsEX0NH.mjs.map +1 -0
- package/dist/container-form-CxxUYctk.cjs +2 -0
- package/dist/container-form-CxxUYctk.cjs.map +1 -0
- package/dist/date-field-BqAX4M_h.cjs +2 -0
- package/dist/date-field-BqAX4M_h.cjs.map +1 -0
- package/dist/date-field-Dm4ki1HS.mjs +2 -0
- package/dist/date-field-Dm4ki1HS.mjs.map +1 -0
- package/dist/dialog-form-ClWBZbUN.mjs +2 -0
- package/dist/dialog-form-ClWBZbUN.mjs.map +1 -0
- package/dist/dialog-form-DN-NlQFO.cjs +2 -0
- package/dist/dialog-form-DN-NlQFO.cjs.map +1 -0
- package/dist/dialogs/confirm-dialog.cjs +1 -1
- package/dist/dialogs/confirm-dialog.cjs.map +1 -1
- package/dist/dialogs/confirm-dialog.mjs +1 -1
- package/dist/dialogs/confirm-dialog.mjs.map +1 -1
- package/dist/email-field-DZNR_JbT.mjs +2 -0
- package/dist/email-field-DZNR_JbT.mjs.map +1 -0
- package/dist/email-field-lDd9ouFN.cjs +2 -0
- package/dist/email-field-lDd9ouFN.cjs.map +1 -0
- package/dist/features/charts/index.cjs +1 -1
- package/dist/features/charts/index.cjs.map +1 -1
- package/dist/features/charts/index.d.cts +556 -1
- package/dist/features/charts/index.d.mts +556 -1
- package/dist/features/charts/index.mjs +1 -1
- package/dist/features/charts/index.mjs.map +1 -1
- package/dist/features/tables/index.d.cts +1 -1
- package/dist/features/tables/index.d.mts +1 -1
- package/dist/features/tanstack-form/index.cjs +1 -1
- package/dist/features/tanstack-form/index.d.cts +1 -1
- package/dist/features/tanstack-form/index.d.mts +1 -1
- package/dist/features/tanstack-form/index.mjs +1 -1
- package/dist/field-BKyUqvzh.mjs +2 -0
- package/dist/field-BKyUqvzh.mjs.map +1 -0
- package/dist/field-BV5twmKA.cjs +2 -0
- package/dist/field-BV5twmKA.cjs.map +1 -0
- package/dist/group-field-0kStiX8n.cjs +2 -0
- package/dist/group-field-0kStiX8n.cjs.map +1 -0
- package/dist/group-field-bviEXmo4.mjs +2 -0
- package/dist/group-field-bviEXmo4.mjs.map +1 -0
- package/dist/{index-CGpGIM1H.d.cts → index-C4isgHWG.d.cts} +2 -2
- package/dist/{index-DueBB0rP.d.mts → index-C8W56XKm.d.mts} +2 -2
- package/dist/{index-C2KjuFXQ.d.cts → index-DDROD2y9.d.cts} +596 -1117
- package/dist/{index-C2KjuFXQ.d.mts → index-DDROD2y9.d.mts} +596 -1117
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +5 -5
- package/dist/index.d.mts +5 -5
- package/dist/index.mjs +1 -1
- package/dist/{input-BJMvABEL.d.cts → input-go3H4EQz.d.cts} +2 -2
- package/dist/{input-BJMvABEL.d.mts → input-go3H4EQz.d.mts} +2 -2
- package/dist/number-field-Baj9Yhiv.mjs +2 -0
- package/dist/number-field-Baj9Yhiv.mjs.map +1 -0
- package/dist/number-field-BqeSbMvE.cjs +2 -0
- package/dist/number-field-BqeSbMvE.cjs.map +1 -0
- package/dist/number-input-CqkegUWs.mjs +2 -0
- package/dist/number-input-CqkegUWs.mjs.map +1 -0
- package/dist/number-input-kTh9zzr7.cjs +2 -0
- package/dist/number-input-kTh9zzr7.cjs.map +1 -0
- package/dist/password-field-Cq0S949S.cjs +2 -0
- package/dist/password-field-Cq0S949S.cjs.map +1 -0
- package/dist/password-field-fzpU42sV.mjs +2 -0
- package/dist/password-field-fzpU42sV.mjs.map +1 -0
- package/dist/popover-form-DNbBGWVF.mjs +2 -0
- package/dist/popover-form-DNbBGWVF.mjs.map +1 -0
- package/dist/popover-form-KLmew1Vd.cjs +2 -0
- package/dist/popover-form-KLmew1Vd.cjs.map +1 -0
- package/dist/radio-group-field-DjzD3i-f.cjs +2 -0
- package/dist/radio-group-field-DjzD3i-f.cjs.map +1 -0
- package/dist/radio-group-field-Ps8yHpnH.mjs +2 -0
- package/dist/radio-group-field-Ps8yHpnH.mjs.map +1 -0
- package/dist/section-form-B9iTs2we.cjs +2 -0
- package/dist/section-form-B9iTs2we.cjs.map +1 -0
- package/dist/section-form-B_AZr7jZ.mjs +2 -0
- package/dist/section-form-B_AZr7jZ.mjs.map +1 -0
- package/dist/select-field-B4eU65OI.cjs +2 -0
- package/dist/select-field-B4eU65OI.cjs.map +1 -0
- package/dist/select-field-D6Dw-Jwg.mjs +2 -0
- package/dist/select-field-D6Dw-Jwg.mjs.map +1 -0
- package/dist/separator-BlNAFSJv.mjs +2 -0
- package/dist/separator-BlNAFSJv.mjs.map +1 -0
- package/dist/separator-sBz__BXC.cjs +2 -0
- package/dist/separator-sBz__BXC.cjs.map +1 -0
- package/dist/simple-array-field-9oZ-Smzp.mjs +2 -0
- package/dist/simple-array-field-9oZ-Smzp.mjs.map +1 -0
- package/dist/simple-array-field-Bcs2pHdp.cjs +2 -0
- package/dist/simple-array-field-Bcs2pHdp.cjs.map +1 -0
- package/dist/simple-boolean-field-C-qq6Vlt.cjs +2 -0
- package/dist/simple-boolean-field-C-qq6Vlt.cjs.map +1 -0
- package/dist/simple-boolean-field-CkJUMxNU.mjs +2 -0
- package/dist/simple-boolean-field-CkJUMxNU.mjs.map +1 -0
- package/dist/simple-combobox-field-5dfMd49B.mjs +2 -0
- package/dist/simple-combobox-field-5dfMd49B.mjs.map +1 -0
- package/dist/simple-combobox-field-BtmQGEo5.cjs +2 -0
- package/dist/simple-combobox-field-BtmQGEo5.cjs.map +1 -0
- package/dist/simple-date-field-BXoLb496.mjs +2 -0
- package/dist/simple-date-field-BXoLb496.mjs.map +1 -0
- package/dist/simple-date-field-LVfNhVJi.cjs +2 -0
- package/dist/simple-date-field-LVfNhVJi.cjs.map +1 -0
- package/dist/simple-email-field-QVUrm8f7.cjs +2 -0
- package/dist/simple-email-field-QVUrm8f7.cjs.map +1 -0
- package/dist/simple-email-field-rZZIXu7S.mjs +2 -0
- package/dist/simple-email-field-rZZIXu7S.mjs.map +1 -0
- package/dist/simple-number-field-P9PTwcs4.cjs +2 -0
- package/dist/simple-number-field-P9PTwcs4.cjs.map +1 -0
- package/dist/simple-number-field-PJAyAOMO.mjs +2 -0
- package/dist/simple-number-field-PJAyAOMO.mjs.map +1 -0
- package/dist/simple-password-field-BEuFXAsk.mjs +2 -0
- package/dist/simple-password-field-BEuFXAsk.mjs.map +1 -0
- package/dist/simple-password-field-BW6YkfSP.cjs +2 -0
- package/dist/simple-password-field-BW6YkfSP.cjs.map +1 -0
- package/dist/simple-radio-group-field-BtQHJpOz.cjs +2 -0
- package/dist/simple-radio-group-field-BtQHJpOz.cjs.map +1 -0
- package/dist/simple-radio-group-field-DiYQfgts.mjs +2 -0
- package/dist/simple-radio-group-field-DiYQfgts.mjs.map +1 -0
- package/dist/simple-select-field--zJMLBUY.cjs +2 -0
- package/dist/simple-select-field--zJMLBUY.cjs.map +1 -0
- package/dist/simple-select-field-Df4DLsbi.mjs +2 -0
- package/dist/simple-select-field-Df4DLsbi.mjs.map +1 -0
- package/dist/simple-text-field-DVkuHrhF.cjs +2 -0
- package/dist/simple-text-field-DVkuHrhF.cjs.map +1 -0
- package/dist/simple-text-field-zAfkmlhc.mjs +2 -0
- package/dist/simple-text-field-zAfkmlhc.mjs.map +1 -0
- package/dist/simple-textarea-field-BaMK0feA.cjs +2 -0
- package/dist/simple-textarea-field-BaMK0feA.cjs.map +1 -0
- package/dist/simple-textarea-field-q9DeFByl.mjs +2 -0
- package/dist/simple-textarea-field-q9DeFByl.mjs.map +1 -0
- package/dist/submit-button-CGBaPzE9.mjs +2 -0
- package/dist/submit-button-CGBaPzE9.mjs.map +1 -0
- package/dist/submit-button-CvINfld5.cjs +2 -0
- package/dist/submit-button-CvINfld5.cjs.map +1 -0
- package/dist/switch-field-B8HVvc2f.mjs +2 -0
- package/dist/switch-field-B8HVvc2f.mjs.map +1 -0
- package/dist/switch-field-C1uNuuku.cjs +2 -0
- package/dist/switch-field-C1uNuuku.cjs.map +1 -0
- package/dist/tanstack-form-CM_Hb3JT.mjs +2 -0
- package/dist/tanstack-form-CM_Hb3JT.mjs.map +1 -0
- package/dist/tanstack-form-DS_ZvRl8.cjs +2 -0
- package/dist/tanstack-form-DS_ZvRl8.cjs.map +1 -0
- package/dist/text-editor-field-BBDgCPuc.cjs +2 -0
- package/dist/text-editor-field-BBDgCPuc.cjs.map +1 -0
- package/dist/text-editor-field-CcsR48Jw.mjs +2 -0
- package/dist/text-editor-field-CcsR48Jw.mjs.map +1 -0
- package/dist/text-field-BhC_ik5w.cjs +2 -0
- package/dist/text-field-BhC_ik5w.cjs.map +1 -0
- package/dist/text-field-qhiYvQKt.mjs +2 -0
- package/dist/text-field-qhiYvQKt.mjs.map +1 -0
- package/dist/textarea-field-C-7ZoUMz.cjs +2 -0
- package/dist/textarea-field-C-7ZoUMz.cjs.map +1 -0
- package/dist/textarea-field-DqDciVSB.mjs +2 -0
- package/dist/textarea-field-DqDciVSB.mjs.map +1 -0
- package/dist/title-field-84EnHPvl.mjs +2 -0
- package/dist/title-field-84EnHPvl.mjs.map +1 -0
- package/dist/title-field-CKxwzMOM.cjs +2 -0
- package/dist/title-field-CKxwzMOM.cjs.map +1 -0
- package/dist/ui/badge.cjs +1 -1
- package/dist/ui/badge.cjs.map +1 -1
- package/dist/ui/badge.mjs +1 -1
- package/dist/ui/badge.mjs.map +1 -1
- package/dist/ui/input.d.cts +1 -1
- package/dist/ui/input.d.mts +1 -1
- package/dist/ui/inputs/search-input.d.cts +1 -1
- package/dist/ui/inputs/search-input.d.mts +1 -1
- package/package.json +1 -5
- package/dist/tanstack-form-BMVn8ai_.cjs +0 -2
- package/dist/tanstack-form-BMVn8ai_.cjs.map +0 -1
- package/dist/tanstack-form-DTCgWGCA.mjs +0 -2
- package/dist/tanstack-form-DTCgWGCA.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email-field-lDd9ouFN.cjs","names":["useTanStackFieldContext","FieldGroup","Field","FieldContent","FieldLabel","FieldTooltip","FieldDescription","FieldContentMain","Input","AtSignIcon","XIcon","FieldError","FieldNote","FieldSeparator"],"sources":["../packages/components/features/tanstack-form/components/fields/email-field.tsx"],"sourcesContent":["'use client';\n\nimport { useCallback } from 'react';\n\nimport { useStore } from '@tanstack/react-form';\n\nimport { AtSignIcon, XIcon } from 'lucide-react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Input } from '@/components/ui/input';\nimport {\n Field,\n FieldContent,\n FieldContentMain,\n FieldDescription,\n FieldError,\n FieldGroup,\n FieldLabel,\n FieldNote,\n FieldSeparator,\n FieldTooltip,\n} from '../ui/field';\nimport { useTanStackFieldContext } from '../form-context';\n\nimport type { EmailFieldProps as Props } from '../../types';\n\n/**\n * A TanStack Form-connected email input field with an at-sign prefix icon,\n * optional clear button, and inline validation error display.\n *\n * @example\n * import { EmailField } from '@customafk/lunas-ui/features/tanstack-form';\n *\n * <form.Field name=\"email\">\n * {() => (\n * <EmailField\n * label=\"Email address\"\n * placeholder=\"you@example.com\"\n * required\n * />\n * )}\n * </form.Field>\n */\nexport const EmailField: React.FC<Props> = ({\n label,\n description,\n placeholder,\n tooltip,\n helperText,\n orientation = 'responsive',\n showErrorMessage = true,\n required = false,\n maxLength,\n}) => {\n const { form, name, state, handleBlur, handleChange } = useTanStackFieldContext<string | null>();\n\n const isSubmitting = useStore(form.store, ({ isSubmitting }) => isSubmitting);\n\n const _invalid = state.meta.isDirty && state.meta.isTouched && !state.meta.isValid;\n const _isEmpty = required && state.value === null;\n const _showClear = !isSubmitting && !!state.value;\n\n const onChange = useCallback<React.ChangeEventHandler<HTMLInputElement>>(\n ({ target: { value } }) => {\n if (isSubmitting) return;\n if (maxLength && value.length > maxLength) return;\n handleChange(value || null);\n },\n [isSubmitting, maxLength, handleChange]\n );\n\n const onClear = useCallback(() => {\n if (isSubmitting) return;\n handleChange(null);\n }, [isSubmitting, handleChange]);\n\n return (\n <FieldGroup className=\"gap-y-4 px-4\">\n <Field data-invalid={_invalid} orientation={orientation}>\n <FieldContent>\n <FieldLabel htmlFor={name} aria-required={_isEmpty}>\n {label}\n {tooltip && <FieldTooltip tooltip={tooltip} />}\n </FieldLabel>\n <FieldDescription>{description}</FieldDescription>\n </FieldContent>\n <FieldContentMain>\n <Input\n id={name}\n name={name}\n value={state.value === null ? '' : state.value}\n aria-invalid={_invalid}\n autoComplete=\"email\"\n placeholder={placeholder}\n className={cn('pl-9', _showClear && 'pr-9', isSubmitting && 'pointer-events-none bg-muted-muted opacity-60')}\n onBlur={handleBlur}\n onChange={onChange}\n />\n <div className=\"absolute top-0 left-0 flex size-9 items-center justify-center text-muted\">\n <AtSignIcon size={14} />\n </div>\n\n {_showClear && (\n <button\n type=\"button\"\n aria-label=\"Xóa\"\n className=\"absolute inset-e-0 inset-y-0 top-3 flex h-fit w-8 cursor-pointer items-center justify-center rounded-e-md text-text-positive-weak outline-none transition-[color,box-shadow] hover:text-text-positive focus:text-text-positive-strong\"\n onClick={onClear}\n >\n <XIcon size={14} aria-hidden=\"true\" />\n </button>\n )}\n\n <div className=\"mt-1 flex w-full items-start justify-start\">\n {showErrorMessage && state.meta.isDirty && <FieldError errors={state.meta.errors} />}\n </div>\n <FieldNote isShow={!!helperText}>{helperText}</FieldNote>\n </FieldContentMain>\n </Field>\n <FieldSeparator />\n </FieldGroup>\n );\n};\n"],"mappings":"4QA4CA,MAAa,GAA+B,CAC1C,QACA,cACA,cACA,UACA,aACA,cAAc,aACd,mBAAmB,GACnB,WAAW,GACX,eACI,CACJ,GAAM,CAAE,OAAM,OAAM,QAAO,aAAY,gBAAiBA,EAAAA,EAAuC,EAEzF,GAAA,EAAA,EAAA,SAAA,CAAwB,EAAK,OAAQ,CAAE,kBAAmB,CAAY,EAEtE,EAAW,EAAM,KAAK,SAAW,EAAM,KAAK,WAAa,CAAC,EAAM,KAAK,QACrE,EAAW,GAAY,EAAM,QAAU,KACvC,EAAa,CAAC,GAAgB,CAAC,CAAC,EAAM,MAEtC,GAAA,EAAA,EAAA,YAAA,EACH,CAAE,OAAQ,CAAE,YAAc,CACrB,GACA,GAAa,EAAM,OAAS,GAChC,EAAa,GAAS,IAAI,CAC5B,EACA,CAAC,EAAc,EAAW,CAAY,CACxC,EAEM,GAAA,EAAA,EAAA,YAAA,KAA4B,CAC5B,GACJ,EAAa,IAAI,CACnB,EAAG,CAAC,EAAc,CAAY,CAAC,EAE/B,OACE,EAAA,EAAA,KAAA,CAACC,EAAAA,WAAD,CAAY,UAAU,wBAAtB,EACE,EAAA,EAAA,KAAA,CAACC,EAAAA,MAAD,CAAO,eAAc,EAAuB,uBAA5C,EACE,EAAA,EAAA,KAAA,CAACC,EAAAA,aAAD,CAAA,SAAA,EACE,EAAA,EAAA,KAAA,CAACC,E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ui/chart.cjs");let t=require("react"),n=require("@customafk/react-toolkit/utils"),r=require("react/jsx-runtime"),i=require("recharts");const a=e=>`var(--chart-${(e%8+8)%8+1})`,o=(e,t=`en-US`)=>new Intl.NumberFormat(t,{notation:`compact`,maximumFractionDigits:1}).format(e),s=(e,t=`USD`,n=`en-US`)=>new Intl.NumberFormat(n,{style:`currency`,currency:t,notation:Math.abs(e)>=1e4?`compact`:`standard`,maximumFractionDigits:+(Math.abs(e)>=1e4)}).format(e),c=(e,t=`en-US`)=>new Intl.NumberFormat(t,{style:`percent`,maximumFractionDigits:1}).format(e),l=(e,t=`en-US`)=>{let n=e instanceof Date?e:new Date(e);return Number.isNaN(n.getTime())?String(e):n.toLocaleDateString(t,{month:`short`,day:`numeric`})},u=({data:s,showConversionRates:l=!0,valueFormatter:u=o,className:d,animate:f=!0,height:p})=>{let{chartData:m,config:h}=(0,t.useMemo)(()=>{let e=s[0]?.value??0,t=s.map((t,n)=>{let r=e===0?0:t.value/e,i=l?`${u(t.value)} (${c(r)})`:u(t.value);return{...t,key:t.key||t.name.toLowerCase().replace(/[^a-z0-9]+/g,`-`),fill:t.color||a(n),valueLabel:i}});return{chartData:t,config:Object.fromEntries(t.map(e=>[e.key,{label:e.name,color:e.fill}]))}},[s,l,u]);return(0,r.jsx)(e.ChartContainer,{"data-slot":`conversion-funnel-chart`,config:h,className:(0,n.cn)(`w-full`,d),style:p===void 0?void 0:{height:p,aspectRatio:`auto`},children:(0,r.jsxs)(i.FunnelChart,{margin:{top:8,right:120,bottom:8,left:120},children:[(0,r.jsx)(e.ChartTooltip,{content:(0,r.jsx)(e.ChartTooltipContent,{nameKey:`key`,hideLabel:!0})}),(0,r.jsxs)(i.Funnel,{dataKey:`value`,data:m,isAnimationActive:f,children:[(0,r.jsx)(i.LabelList,{dataKey:`name`,position:`left`,offset:12,className:`fill-muted-strong`,fontSize:12}),(0,r.jsx)(i.LabelList,{dataKey:`valueLabel`,position:`right`,offset:12,className:`fill-text-positive-strong font-number`,fontSize:12})]})]})})},d=e=>e.key||e.name.toLowerCase().replace(/[^a-z0-9]+/g,`-`),f=({data:s,centerLabel:c,centerValueFormatter:l=o,totalValue:u,showLegend:f=!0,showCenterTotal:p=!0,className:m,animate:h=!0,height:g})=>{let{chartData:_,config:v,total:y}=(0,t.useMemo)(()=>{let e=s.map((e,t)=>({...e,key:d(e),fill:e.color||a(t)}));return{chartData:e,config:Object.fromEntries(e.map(e=>[e.key,{label:e.name,color:e.fill}])),total:u??s.reduce((e,t)=>e+t.value,0)}},[s,u]);return(0,r.jsx)(e.ChartContainer,{"data-slot":`donut-chart`,config:v,className:(0,n.cn)(`mx-auto`,g===void 0&&`aspect-square`,m),style:g===void 0?void 0:{height:g,aspectRatio:`auto`},children:(0,r.jsxs)(i.PieChart,{children:[(0,r.jsx)(e.ChartTooltip,{cursor:!1,content:(0,r.jsx)(e.ChartTooltipContent,{nameKey:`key`,hideLabel:!0})}),(0,r.jsx)(i.Pie,{data:_,dataKey:`value`,nameKey:`key`,innerRadius:`60%`,strokeWidth:5,isAnimationActive:h,children:p&&(0,r.jsx)(i.Label,{content:({viewBox:e})=>!e||!(`cx`in e)||!(`cy`in e)?null:(0,r.jsxs)(`text`,{x:e.cx,y:e.cy,textAnchor:`middle`,dominantBaseline:`middle`,children:[(0,r.jsx)(`tspan`,{x:e.cx,y:e.cy,className:`fill-text-positive-strong font-number text-2xl font-bold`,children:l(y)}),c&&(0,r.jsx)(`tspan`,{x:e.cx,y:(e.cy||0)+22,className:`fill-muted text-xs`,children:c})]})})}),f&&(0,r.jsx)(e.ChartLegend,{content:(0,r.jsx)(e.ChartLegendContent,{nameKey:`key`})})]})})},p=({data:o,dataKey:s=`orders`,label:c=`Orders`,statuses:u,color:d=`var(--chart-1)`,valueFormatter:f=e=>e.toLocaleString(`en-US`),dateFormatter:p=l,showLegend:m=!!u,showGrid:h=!0,className:g,animate:_=!0,height:v})=>(0,r.jsx)(e.ChartContainer,{"data-slot":`orders-bar-chart`,config:(0,t.useMemo)(()=>u?Object.fromEntries(u.map((e,t)=>[e.key,{label:e.label,color:e.color||a(t)}])):{[s]:{label:c,color:d}},[u,s,c,d]),className:(0,n.cn)(`w-full`,g),style:v===void 0?void 0:{height:v,aspectRatio:`auto`},children:(0,r.jsxs)(i.BarChart,{data:o,margin:{top:8,right:12,bottom:0,left:12},children:[h&&(0,r.jsx)(i.CartesianGrid,{vertical:!1}),(0,r.jsx)(i.XAxis,{dataKey:`date`,tickLine:!1,axisLine:!1,tickMargin:8,tickFormatter:p}),(0,r.jsx)(i.YAxis,{tickLine:!1,axisLine:!1,tickMargin:8,width:48,allowDecimals:!1,tickFormatter:f}),(0,r.jsx)(e.ChartTooltip,{content:(0,r.jsx)(e.ChartTooltipContent,{labelFormatter:(e,t)=>{let n=t?.[0]?.payload?.date;return n?p(n):null}})}),u?u.map((e,t)=>(0,r.jsx)(i.Bar,{dataKey:e.key,stackId:`orders`,fill:e.color||a(t),radius:t===u.length-1?[4,4,0,0]:[0,0,0,0],isAnimationActive:_},e.key)):(0,r.jsx)(i.Bar,{dataKey:s,fill:d,radius:[4,4,0,0],isAnimationActive:_}),m&&(0,r.jsx)(e.ChartLegend,{content:(0,r.jsx)(e.ChartLegendContent,{})})]})}),m=({data:a,label:o=`Revenue`,comparisonLabel:c=`Previous period`,showComparison:u=!1,color:d=`var(--chart-1)`,comparisonColor:f=`var(--chart-8)`,valueFormatter:p=e=>s(e),dateFormatter:m=l,showLegend:h=u,showGrid:g=!0,className:_,animate:v=!0,height:y})=>{let b=(0,t.useId)(),x=(0,t.useMemo)(()=>({value:{label:o,color:d},...u?{previousValue:{label:c,color:f}}:{}}),[o,d,u,c,f]);return(0,r.jsx)(e.ChartContainer,{"data-slot":`revenue-area-chart`,config:x,className:(0,n.cn)(`w-full`,_),style:y===void 0?void 0:{height:y,aspectRatio:`auto`},children:(0,r.jsxs)(i.AreaChart,{data:a,margin:{top:8,right:12,bottom:0,left:12},children:[(0,r.jsxs)(`defs`,{children:[(0,r.jsxs)(`linearGradient`,{id:`${b}-value`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,r.jsx)(`stop`,{offset:`5%`,stopColor:d,stopOpacity:.6}),(0,r.jsx)(`stop`,{offset:`95%`,stopColor:d,stopOpacity:.05})]}),(0,r.jsxs)(`linearGradient`,{id:`${b}-previous`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,r.jsx)(`stop`,{offset:`5%`,stopColor:f,stopOpacity:.3}),(0,r.jsx)(`stop`,{offset:`95%`,stopColor:f,stopOpacity:.02})]})]}),g&&(0,r.jsx)(i.CartesianGrid,{vertical:!1}),(0,r.jsx)(i.XAxis,{dataKey:`date`,tickLine:!1,axisLine:!1,tickMargin:8,tickFormatter:m}),(0,r.jsx)(i.YAxis,{tickLine:!1,axisLine:!1,tickMargin:8,width:64,tickFormatter:p}),(0,r.jsx)(e.ChartTooltip,{cursor:!1,content:(0,r.jsx)(e.ChartTooltipContent,{labelFormatter:(e,t)=>{let n=t?.[0]?.payload?.date;return n?m(n):null},formatter:(e,t,n)=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`div`,{className:`size-2.5 shrink-0 rounded-[2px]`,style:{backgroundColor:n.color}}),(0,r.jsx)(`span`,{className:`text-muted`,children:x[String(t)]?.label||t}),(0,r.jsx)(`span`,{className:`text-text-positive-strong font-number ml-auto font-medium tabular-nums`,children:p(Number(e))})]})})}),u&&(0,r.jsx)(i.Area,{type:`natural`,dataKey:`previousValue`,stroke:f,strokeWidth:2,strokeDasharray:`4 4`,fill:`url(#${b}-previous)`,isAnimationActive:v}),(0,r.jsx)(i.Area,{type:`natural`,dataKey:`value`,stroke:d,strokeWidth:2,fill:`url(#${b}-value)`,isAnimationActive:v}),h&&(0,r.jsx)(e.ChartLegend,{content:(0,r.jsx)(e.ChartLegendContent,{})})]})})},h=({data:a,revenueLabel:o=`Revenue`,ordersLabel:c=`Orders`,revenueColor:u=`var(--chart-1)`,ordersColor:d=`var(--chart-4)`,revenueFormatter:f=e=>s(e),ordersFormatter:p=e=>e.toLocaleString(`en-US`),dateFormatter:m=l,showLegend:h=!0,showGrid:g=!0,className:_,animate:v=!0,height:y})=>{let b=(0,t.useMemo)(()=>({revenue:{label:o,color:u},orders:{label:c,color:d}}),[o,u,c,d]);return(0,r.jsx)(e.ChartContainer,{"data-slot":`revenue-orders-composed-chart`,config:b,className:(0,n.cn)(`w-full`,_),style:y===void 0?void 0:{height:y,aspectRatio:`auto`},children:(0,r.jsxs)(i.ComposedChart,{data:a,margin:{top:8,right:12,bottom:0,left:12},children:[g&&(0,r.jsx)(i.CartesianGrid,{vertical:!1}),(0,r.jsx)(i.XAxis,{dataKey:`date`,tickLine:!1,axisLine:!1,tickMargin:8,tickFormatter:m}),(0,r.jsx)(i.YAxis,{yAxisId:`revenue`,tickLine:!1,axisLine:!1,tickMargin:8,width:64,tickFormatter:f}),(0,r.jsx)(i.YAxis,{yAxisId:`orders`,orientation:`right`,tickLine:!1,axisLine:!1,tickMargin:8,width:48,allowDecimals:!1,tickFormatter:p}),(0,r.jsx)(e.ChartTooltip,{content:(0,r.jsx)(e.ChartTooltipContent,{labelFormatter:(e,t)=>{let n=t?.[0]?.payload?.date;return n?m(n):null},formatter:(e,t,n)=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`div`,{className:`size-2.5 shrink-0 rounded-[2px]`,style:{backgroundColor:n.color}}),(0,r.jsx)(`span`,{className:`text-muted`,children:b[String(t)]?.label||t}),(0,r.jsx)(`span`,{className:`text-text-positive-strong font-number ml-auto font-medium tabular-nums`,children:t===`revenue`?f(Number(e)):p(Number(e))})]})})}),(0,r.jsx)(i.Bar,{dataKey:`revenue`,yAxisId:`revenue`,fill:u,radius:[4,4,0,0],isAnimationActive:v}),(0,r.jsx)(i.Line,{type:`natural`,dataKey:`orders`,yAxisId:`orders`,stroke:d,strokeWidth:2,dot:!1,isAnimationActive:v}),h&&(0,r.jsx)(e.ChartLegend,{content:(0,r.jsx)(e.ChartLegendContent,{})})]})})},g=({value:a,target:o,label:s=`Target`,valueFormatter:l=(e,t)=>c(t===0?0:e/t),color:u=`var(--chart-1)`,className:d,animate:f=!0,height:p})=>{let m=(0,t.useMemo)(()=>[{name:`progress`,value:Math.min(Math.max(a,0),o),fill:u}],[a,o,u]);return(0,r.jsx)(e.ChartContainer,{"data-slot":`sales-target-radial-chart`,config:(0,t.useMemo)(()=>({progress:{label:s,color:u}}),[s,u]),className:(0,n.cn)(`mx-auto`,p===void 0&&`aspect-square`,d),style:p===void 0?void 0:{height:p,aspectRatio:`auto`},children:(0,r.jsxs)(i.RadialBarChart,{data:m,startAngle:90,endAngle:-270,innerRadius:`75%`,outerRadius:`100%`,children:[(0,r.jsx)(i.PolarAngleAxis,{type:`number`,domain:[0,o],angleAxisId:0,tick:!1}),(0,r.jsx)(i.RadialBar,{dataKey:`value`,angleAxisId:0,background:!0,cornerRadius:10,isAnimationActive:f}),(0,r.jsx)(i.PolarRadiusAxis,{tick:!1,tickLine:!1,axisLine:!1,children:(0,r.jsx)(i.Label,{content:({viewBox:e})=>!e||!(`cx`in e)||!(`cy`in e)?null:(0,r.jsxs)(`text`,{x:e.cx,y:e.cy,textAnchor:`middle`,dominantBaseline:`middle`,children:[(0,r.jsx)(`tspan`,{x:e.cx,y:e.cy,className:`fill-text-positive-strong font-number text-3xl font-bold`,children:l(a,o)}),(0,r.jsx)(`tspan`,{x:e.cx,y:(e.cy||0)+24,className:`fill-muted text-xs`,children:s})]})})})]})})},_={up:`var(--success)`,down:`var(--danger)`,neutral:`var(--chart-1)`},v=({data:e,type:a=`area`,trend:o=`neutral`,color:s,height:c=40,animate:l=!0,className:u})=>{let d=(0,t.useId)(),f=s||_[o],p=(0,t.useMemo)(()=>e.map(e=>typeof e==`number`?{value:e}:e),[e]),m={top:2,right:0,bottom:2,left:0};return(0,r.jsx)(`div`,{"data-slot":`sparkline-chart`,className:(0,n.cn)(`w-full`,u),style:{height:c},children:(0,r.jsx)(i.ResponsiveContainer,{children:a===`line`?(0,r.jsx)(i.LineChart,{data:p,margin:m,children:(0,r.jsx)(i.Line,{type:`natural`,dataKey:`value`,stroke:f,strokeWidth:2,dot:!1,isAnimationActive:l})}):(0,r.jsxs)(i.AreaChart,{data:p,margin:m,children:[(0,r.jsx)(`defs`,{children:(0,r.jsxs)(`linearGradient`,{id:d,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,r.jsx)(`stop`,{offset:`5%`,stopColor:f,stopOpacity:.4}),(0,r.jsx)(`stop`,{offset:`95%`,stopColor:f,stopOpacity:.05})]})}),(0,r.jsx)(i.Area,{type:`natural`,dataKey:`value`,stroke:f,strokeWidth:2,fill:`url(#${d})`,isAnimationActive:l})]})})})},y=({data:a,label:s=`Sales`,maxItems:c=8,color:l=`var(--chart-1)`,valueFormatter:u=o,showValueLabels:d=!0,className:f,animate:p=!0,height:m})=>{let h=(0,t.useMemo)(()=>[...a].sort((e,t)=>t.value-e.value).slice(0,c),[a,c]);return(0,r.jsx)(e.ChartContainer,{"data-slot":`top-products-bar-chart`,config:(0,t.useMemo)(()=>({value:{label:s,color:l}}),[s,l]),className:(0,n.cn)(`w-full`,f),style:m===void 0?void 0:{height:m,aspectRatio:`auto`},children:(0,r.jsxs)(i.BarChart,{data:h,layout:`vertical`,margin:{top:0,right:d?48:12,bottom:0,left:12},children:[(0,r.jsx)(i.XAxis,{type:`number`,dataKey:`value`,hide:!0}),(0,r.jsx)(i.YAxis,{type:`category`,dataKey:`name`,tickLine:!1,axisLine:!1,tickMargin:8,width:120}),(0,r.jsx)(e.ChartTooltip,{cursor:!1,content:(0,r.jsx)(e.ChartTooltipContent,{hideLabel:!0})}),(0,r.jsx)(i.Bar,{dataKey:`value`,fill:l,radius:4,isAnimationActive:p,children:d&&(0,r.jsx)(i.LabelList,{dataKey:`value`,position:`right`,offset:8,className:`fill-muted-strong`,fontSize:12,formatter:e=>u(Number(e))})})]})})};exports.ConversionFunnelChart=u,exports.DonutChart=f,exports.OrdersBarChart=p,exports.RevenueAreaChart=m,exports.RevenueOrdersComposedChart=h,exports.SalesTargetRadialChart=g,exports.SparklineChart=v,exports.TopProductsBarChart=y,exports.formatCompactNumber=o,exports.formatCurrency=s,exports.formatPercent=c,exports.getChartColor=a,exports.toDateLabel=l;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../ui/chart.cjs");let t=require("react"),n=require("@customafk/react-toolkit/utils"),r=require("react/jsx-runtime"),i=require("recharts");const a=e=>`var(--chart-${(e%8+8)%8+1})`,o=(e,t=`en-US`)=>new Intl.NumberFormat(t,{notation:`compact`,maximumFractionDigits:1}).format(e),s=(e,t=`USD`,n=`en-US`)=>new Intl.NumberFormat(n,{style:`currency`,currency:t,notation:Math.abs(e)>=1e4?`compact`:`standard`,maximumFractionDigits:+(Math.abs(e)>=1e4)}).format(e),c=(e,t=`en-US`)=>new Intl.NumberFormat(t,{style:`percent`,maximumFractionDigits:1}).format(e),l=(e,t=`en-US`)=>{let n=e instanceof Date?e:new Date(e);return Number.isNaN(n.getTime())?String(e):n.toLocaleDateString(t,{month:`short`,day:`numeric`})},u=(e,t,n)=>e>=t?n?.up??`var(--success)`:n?.down??`var(--danger)`,d=(e,t=`en-US`)=>new Intl.NumberFormat(t,{style:`percent`,maximumFractionDigits:1,signDisplay:`exceptZero`}).format(e),f=(e,t,n=100)=>{let r={};for(let n of t)r[n]=e.find(e=>typeof e[n]==`number`)?.[n];return e.map(e=>{let i={};for(let a of t){let t=e[a],o=r[a];i[a]=typeof t==`number`&&o?t/o*n:NaN}return{date:e.date,...i}})},p=[`S`,`M`,`T`,`W`,`T`,`F`,`S`],m=({data:a,label:o=`Activity`,color:s=`var(--chart-1)`,valueFormatter:c=e=>e.toLocaleString(`en-US`),className:u,height:d})=>{let f=(0,t.useMemo)(()=>({value:{label:o,color:s}}),[o,s]),{chartData:m,monthTicks:h,maxWeek:g,maxValue:_}=(0,t.useMemo)(()=>{let e=a.map(e=>({...e,parsedDate:e.date instanceof Date?e.date:new Date(e.date)})).sort((e,t)=>e.parsedDate.getTime()-t.parsedDate.getTime());if(e.length===0)return{chartData:[],monthTicks:new Map,maxWeek:0,maxValue:1};let t=e[0]?.parsedDate,n=new Date(t);n.setDate(n.getDate()-n.getDay());let r=new Map,i=-1,o=e.map(e=>{let t=e.parsedDate.getDay(),a=Math.floor((e.parsedDate.getTime()-n.getTime())/864e5/7),o=e.parsedDate.getMonth();return o!==i&&(r.set(a,e.parsedDate.toLocaleDateString(`en-US`,{month:`short`})),i=o),{x:a,y:t,value:e.value,date:e.date}});return{chartData:o,monthTicks:r,maxWeek:Math.max(...o.map(e=>e.x)),maxValue:Math.max(...o.map(e=>e.value),1)}},[a]);return(0,r.jsx)(e.ChartContainer,{"data-slot":`activity-heatmap-chart`,config:f,className:(0,n.cn)(`w-full`,u),style:d===void 0?void 0:{height:d,aspectRatio:`auto`},children:(0,r.jsxs)(i.ScatterChart,{margin:{top:8,right:12,bottom:0,left:0},children:[(0,r.jsx)(i.XAxis,{type:`number`,dataKey:`x`,domain:[-.5,g+.5],ticks:Array.from(h.keys()),tickFormatter:e=>h.get(e)??``,tickLine:!1,axisLine:!1,tickMargin:8,interval:0}),(0,r.jsx)(i.YAxis,{type:`number`,dataKey:`y`,domain:[-.5,6.5],reversed:!0,ticks:[0,1,2,3,4,5,6],tickFormatter:e=>p[e]??``,tickLine:!1,axisLine:!1,width:20,interval:0}),(0,r.jsx)(e.ChartTooltip,{cursor:!1,content:(0,r.jsx)(e.ChartTooltipContent,{hideLabel:!0,hideIndicator:!0,formatter:(e,t,n)=>{let i=n.payload;return(0,r.jsxs)(`div`,{className:`grid gap-0.5`,children:[(0,r.jsx)(`span`,{className:`font-medium text-muted-strong`,children:l(i.date)}),(0,r.jsxs)(`span`,{className:`text-muted`,children:[c(i.value),` `,f.value?.label]})]})}})}),(0,r.jsx)(i.Scatter,{data:m,shape:e=>{let{cx:t,cy:n,payload:i}=e;if(t===void 0||n===void 0)return(0,r.jsx)(`g`,{});let a=Math.min(.12+.88*(i.value/_),1);return(0,r.jsx)(`rect`,{x:t-13/2,y:n-13/2,width:13,height:13,rx:3,fill:s,fillOpacity:a})}})]})})},h=({data:e,upColor:t,downColor:n})=>{let a=(0,i.useXAxisScale)(),o=(0,i.useYAxisScale)();return!a||!o?null:(0,r.jsx)(`g`,{children:e.map(e=>{let i=a(e.date,{position:`start`}),s=a(e.date,{position:`end`}),c=o(e.high),l=o(e.low),d=o(e.open),f=o(e.close);if(i===void 0||s===void 0||c===void 0||l===void 0||d===void 0||f===void 0)return null;let p=s-i,m=Math.max(p*.6,2),h=i+p/2,g=u(e.close,e.open,{up:t,down:n}),_=Math.min(d,f),v=Math.max(Math.abs(f-d),1);return(0,r.jsxs)(`g`,{children:[(0,r.jsx)(`line`,{x1:h,x2:h,y1:c,y2:l,stroke:g,strokeWidth:1}),(0,r.jsx)(`rect`,{x:h-m/2,y:_,width:m,height:v,fill:g})]},`${e.date}`)})})},g=({data:a,label:o=`Price`,upColor:s=`var(--success)`,downColor:c=`var(--danger)`,valueFormatter:u=e=>e.toLocaleString(`en-US`),dateFormatter:d=l,showGrid:f=!0,className:p,animate:m=!0,height:g})=>{let _=(0,t.useMemo)(()=>({close:{label:o,color:s}}),[o,s]),v=(0,t.useMemo)(()=>{if(a.length===0)return[0,1];let e=Math.min(...a.map(e=>e.low)),t=Math.max(...a.map(e=>e.high)),n=(t-e)*.08||Math.max(t,1)*.08;return[e-n,t+n]},[a]);return(0,r.jsx)(e.ChartContainer,{"data-slot":`candlestick-chart`,config:_,className:(0,n.cn)(`w-full`,p),style:g===void 0?void 0:{height:g,aspectRatio:`auto`},children:(0,r.jsxs)(i.ComposedChart,{data:a,margin:{top:8,right:12,bottom:0,left:12},children:[f&&(0,r.jsx)(i.CartesianGrid,{vertical:!1}),(0,r.jsx)(i.XAxis,{dataKey:`date`,tickLine:!1,axisLine:!1,tickMargin:8,tickFormatter:d}),(0,r.jsx)(i.YAxis,{domain:v,tickLine:!1,axisLine:!1,tickMargin:8,width:64,tickFormatter:u}),(0,r.jsx)(e.ChartTooltip,{cursor:!1,content:(0,r.jsx)(e.ChartTooltipContent,{hideIndicator:!0,labelFormatter:(e,t)=>{let n=t?.[0]?.payload?.date;return n?d(n):null},formatter:(e,t,n)=>{let i=n.payload;return(0,r.jsxs)(`div`,{className:`grid gap-0.5`,children:[(0,r.jsxs)(`span`,{className:`text-muted`,children:[`O `,(0,r.jsx)(`span`,{className:`font-number text-text-positive-strong`,children:u(i.open)}),` H`,` `,(0,r.jsx)(`span`,{className:`font-number text-text-positive-strong`,children:u(i.high)})]}),(0,r.jsxs)(`span`,{className:`text-muted`,children:[`L `,(0,r.jsx)(`span`,{className:`font-number text-text-positive-strong`,children:u(i.low)}),` C`,` `,(0,r.jsx)(`span`,{className:`font-number text-text-positive-strong`,children:u(i.close)})]})]})}})}),(0,r.jsx)(i.Bar,{dataKey:`close`,fill:`transparent`,isAnimationActive:m}),(0,r.jsx)(h,{data:a,upColor:s,downColor:c})]})})},_=({data:s,showConversionRates:l=!0,valueFormatter:u=o,className:d,animate:f=!0,height:p})=>{let{chartData:m,config:h}=(0,t.useMemo)(()=>{let e=s[0]?.value??0,t=s.map((t,n)=>{let r=e===0?0:t.value/e,i=l?`${u(t.value)} (${c(r)})`:u(t.value);return{...t,key:t.key||t.name.toLowerCase().replace(/[^a-z0-9]+/g,`-`),fill:t.color||a(n),valueLabel:i}});return{chartData:t,config:Object.fromEntries(t.map(e=>[e.key,{label:e.name,color:e.fill}]))}},[s,l,u]);return(0,r.jsx)(e.ChartContainer,{"data-slot":`conversion-funnel-chart`,config:h,className:(0,n.cn)(`w-full`,d),style:p===void 0?void 0:{height:p,aspectRatio:`auto`},children:(0,r.jsxs)(i.FunnelChart,{margin:{top:8,right:120,bottom:8,left:120},children:[(0,r.jsx)(e.ChartTooltip,{content:(0,r.jsx)(e.ChartTooltipContent,{nameKey:`key`,hideLabel:!0})}),(0,r.jsxs)(i.Funnel,{dataKey:`value`,data:m,isAnimationActive:f,children:[(0,r.jsx)(i.LabelList,{dataKey:`name`,position:`left`,offset:12,className:`fill-muted-strong`,fontSize:12}),(0,r.jsx)(i.LabelList,{dataKey:`valueLabel`,position:`right`,offset:12,className:`fill-text-positive-strong font-number`,fontSize:12})]})]})})},v=({data:a,label:o=`Points`,color:s=`var(--chart-1)`,xLabel:c,yLabel:l,xFormatter:u=e=>e.toLocaleString(`en-US`),yFormatter:d=e=>e.toLocaleString(`en-US`),showBubbleSize:f=!1,showGrid:p=!0,className:m,animate:h=!0,height:g})=>(0,r.jsx)(e.ChartContainer,{"data-slot":`correlation-scatter-chart`,config:(0,t.useMemo)(()=>({y:{label:o,color:s}}),[o,s]),className:(0,n.cn)(`w-full`,m),style:g===void 0?void 0:{height:g,aspectRatio:`auto`},children:(0,r.jsxs)(i.ScatterChart,{margin:{top:8,right:12,bottom:0,left:12},children:[p&&(0,r.jsx)(i.CartesianGrid,{}),(0,r.jsx)(i.XAxis,{type:`number`,dataKey:`x`,name:c,tickLine:!1,axisLine:!1,tickMargin:8,tickFormatter:u}),(0,r.jsx)(i.YAxis,{type:`number`,dataKey:`y`,name:l,tickLine:!1,axisLine:!1,tickMargin:8,width:64,tickFormatter:d}),f&&(0,r.jsx)(i.ZAxis,{type:`number`,dataKey:`z`,range:[64,400]}),(0,r.jsx)(e.ChartTooltip,{cursor:{strokeDasharray:`3 3`},content:(0,r.jsx)(e.ChartTooltipContent,{hideLabel:!0,formatter:(e,t,n)=>{let i=n.payload;return(0,r.jsxs)(`div`,{className:`grid gap-0.5`,children:[i.name&&(0,r.jsx)(`span`,{className:`font-medium text-muted-strong`,children:i.name}),(0,r.jsxs)(`span`,{className:`text-muted`,children:[c||`x`,`: `,(0,r.jsx)(`span`,{className:`font-medium font-number text-text-positive-strong`,children:u(i.x)})]}),(0,r.jsxs)(`span`,{className:`text-muted`,children:[l||`y`,`: `,(0,r.jsx)(`span`,{className:`font-medium font-number text-text-positive-strong`,children:d(i.y)})]})]})}})}),(0,r.jsx)(i.Scatter,{data:a,fill:s,isAnimationActive:h})]})}),y=e=>e.key||e.name.toLowerCase().replace(/[^a-z0-9]+/g,`-`),b=({data:s,centerLabel:c,centerValueFormatter:l=o,totalValue:u,showLegend:d=!0,showCenterTotal:f=!0,className:p,animate:m=!0,height:h})=>{let{chartData:g,config:_,total:v}=(0,t.useMemo)(()=>{let e=s.map((e,t)=>({...e,key:y(e),fill:e.color||a(t)}));return{chartData:e,config:Object.fromEntries(e.map(e=>[e.key,{label:e.name,color:e.fill}])),total:u??s.reduce((e,t)=>e+t.value,0)}},[s,u]);return(0,r.jsx)(e.ChartContainer,{"data-slot":`donut-chart`,config:_,className:(0,n.cn)(`mx-auto`,h===void 0&&`aspect-square`,p),style:h===void 0?void 0:{height:h,aspectRatio:`auto`},children:(0,r.jsxs)(i.PieChart,{children:[(0,r.jsx)(e.ChartTooltip,{cursor:!1,content:(0,r.jsx)(e.ChartTooltipContent,{nameKey:`key`,hideLabel:!0})}),(0,r.jsx)(i.Pie,{data:g,dataKey:`value`,nameKey:`key`,innerRadius:`60%`,strokeWidth:5,isAnimationActive:m,children:f&&(0,r.jsx)(i.Label,{content:({viewBox:e})=>!e||!(`cx`in e)||!(`cy`in e)?null:(0,r.jsxs)(`text`,{x:e.cx,y:e.cy,textAnchor:`middle`,dominantBaseline:`middle`,children:[(0,r.jsx)(`tspan`,{x:e.cx,y:e.cy,className:`fill-text-positive-strong font-number text-2xl font-bold`,children:l(v)}),c&&(0,r.jsx)(`tspan`,{x:e.cx,y:(e.cy||0)+22,className:`fill-muted text-xs`,children:c})]})})}),d&&(0,r.jsx)(e.ChartLegend,{content:(0,r.jsx)(e.ChartLegendContent,{nameKey:`key`})})]})})},x=({data:a,label:o=`Return`,upColor:s=`var(--success)`,downColor:c=`var(--danger)`,valueFormatter:l=e=>d(e),showGrid:f=!0,className:p,animate:m=!0,height:h})=>(0,r.jsx)(e.ChartContainer,{"data-slot":`gain-loss-bar-chart`,config:(0,t.useMemo)(()=>({value:{label:o,color:s}}),[o,s]),className:(0,n.cn)(`w-full`,p),style:h===void 0?void 0:{height:h,aspectRatio:`auto`},children:(0,r.jsxs)(i.BarChart,{data:a,margin:{top:8,right:12,bottom:0,left:12},children:[f&&(0,r.jsx)(i.CartesianGrid,{vertical:!1}),(0,r.jsx)(i.XAxis,{dataKey:`name`,tickLine:!1,axisLine:!1,tickMargin:8}),(0,r.jsx)(i.YAxis,{tickLine:!1,axisLine:!1,tickMargin:8,width:56,tickFormatter:l}),(0,r.jsx)(i.ReferenceLine,{y:0,stroke:`var(--border)`}),(0,r.jsx)(e.ChartTooltip,{cursor:!1,content:(0,r.jsx)(e.ChartTooltipContent,{hideIndicator:!0,formatter:e=>l(Number(e))})}),(0,r.jsx)(i.Bar,{dataKey:`value`,isAnimationActive:m,shape:e=>(0,r.jsx)(i.Rectangle,{...e,fill:u(Number(e.payload?.value??0),0,{up:s,down:c})})})]})}),S=({data:o,series:s,base:c=100,valueFormatter:u=(e,t)=>d(e/t-1),dateFormatter:p=l,showLegend:m=!0,showGrid:h=!0,className:g,animate:_=!0,height:v})=>{let y=(0,t.useMemo)(()=>s.map(e=>e.key),[s]),b=(0,t.useMemo)(()=>f(o,y,c),[o,y,c]),x=(0,t.useMemo)(()=>Object.fromEntries(s.map((e,t)=>[e.key,{label:e.label,color:e.color||a(t)}])),[s]);return(0,r.jsx)(e.ChartContainer,{"data-slot":`indexed-performance-line-chart`,config:x,className:(0,n.cn)(`w-full`,g),style:v===void 0?void 0:{height:v,aspectRatio:`auto`},children:(0,r.jsxs)(i.LineChart,{data:b,margin:{top:8,right:12,bottom:0,left:12},children:[h&&(0,r.jsx)(i.CartesianGrid,{vertical:!1}),(0,r.jsx)(i.XAxis,{dataKey:`date`,tickLine:!1,axisLine:!1,tickMargin:8,tickFormatter:p}),(0,r.jsx)(i.YAxis,{tickLine:!1,axisLine:!1,tickMargin:8,width:56,domain:[`auto`,`auto`],tickFormatter:e=>u(Number(e),c)}),(0,r.jsx)(e.ChartTooltip,{content:(0,r.jsx)(e.ChartTooltipContent,{labelFormatter:(e,t)=>{let n=t?.[0]?.payload?.date;return n?p(n):null},formatter:(e,t,n)=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`div`,{className:`size-2.5 shrink-0 rounded-[2px]`,style:{backgroundColor:n.color}}),(0,r.jsx)(`span`,{className:`text-muted`,children:x[String(t)]?.label||t}),(0,r.jsx)(`span`,{className:`ml-auto font-medium font-number text-text-positive-strong tabular-nums`,children:u(Number(e),c)})]})})}),s.map((e,t)=>(0,r.jsx)(i.Line,{type:`natural`,dataKey:e.key,stroke:e.color||a(t),strokeWidth:2,dot:!1,isAnimationActive:_},e.key)),m&&(0,r.jsx)(e.ChartLegend,{content:(0,r.jsx)(e.ChartLegendContent,{})})]})})},C=({data:o,series:s,valueFormatter:c=e=>e.toLocaleString(`en-US`),domain:l=[`auto`,`auto`],showLegend:u=!0,className:d,animate:f=!0,height:p})=>(0,r.jsx)(e.ChartContainer,{"data-slot":`metric-radar-chart`,config:(0,t.useMemo)(()=>Object.fromEntries(s.map((e,t)=>[e.key,{label:e.label,color:e.color||a(t)}])),[s]),className:(0,n.cn)(`mx-auto`,p===void 0&&`aspect-square`,d),style:p===void 0?void 0:{height:p,aspectRatio:`auto`},children:(0,r.jsxs)(i.RadarChart,{data:o,children:[(0,r.jsx)(i.PolarGrid,{}),(0,r.jsx)(i.PolarAngleAxis,{dataKey:`metric`,tick:{fontSize:12}}),(0,r.jsx)(i.PolarRadiusAxis,{domain:l,tick:!1,axisLine:!1}),(0,r.jsx)(e.ChartTooltip,{content:(0,r.jsx)(e.ChartTooltipContent,{formatter:e=>c(Number(e))})}),s.map((e,t)=>{let n=e.color||a(t);return(0,r.jsx)(i.Radar,{dataKey:e.key,stroke:n,fill:n,fillOpacity:.25,isAnimationActive:f},e.key)}),u&&(0,r.jsx)(e.ChartLegend,{content:(0,r.jsx)(e.ChartLegendContent,{})})]})}),w=({data:a,leftLabel:o=`Left`,rightLabel:s=`Right`,leftColor:c=`var(--chart-1)`,rightColor:l=`var(--chart-4)`,valueFormatter:u=e=>e.toLocaleString(`en-US`),showLegend:d=!0,showGrid:f=!0,className:p,animate:m=!0,height:h})=>{let g=(0,t.useMemo)(()=>({left:{label:o,color:c},right:{label:s,color:l}}),[o,c,s,l]),_=(0,t.useMemo)(()=>a.map(e=>({category:e.category,left:-e.left,right:e.right,originalLeft:e.left})),[a]);return(0,r.jsx)(e.ChartContainer,{"data-slot":`mirrored-bar-chart`,config:g,className:(0,n.cn)(`w-full`,p),style:h===void 0?void 0:{height:h,aspectRatio:`auto`},children:(0,r.jsxs)(i.BarChart,{data:_,layout:`vertical`,margin:{top:8,right:12,bottom:0,left:12},children:[f&&(0,r.jsx)(i.CartesianGrid,{horizontal:!1}),(0,r.jsx)(i.XAxis,{type:`number`,tickLine:!1,axisLine:!1,tickMargin:8,tickFormatter:e=>u(Math.abs(e))}),(0,r.jsx)(i.YAxis,{type:`category`,dataKey:`category`,tickLine:!1,axisLine:!1,tickMargin:8,width:64}),(0,r.jsx)(i.ReferenceLine,{x:0,stroke:`var(--border)`}),(0,r.jsx)(e.ChartTooltip,{content:(0,r.jsx)(e.ChartTooltipContent,{formatter:(e,t,n)=>{let i=t===`left`,a=i?n.payload.originalLeft:Number(e);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`div`,{className:`size-2.5 shrink-0 rounded-[2px]`,style:{backgroundColor:n.color}}),(0,r.jsx)(`span`,{className:`text-muted`,children:i?o:s}),(0,r.jsx)(`span`,{className:`ml-auto font-medium font-number text-text-positive-strong tabular-nums`,children:u(a)})]})}})}),(0,r.jsx)(i.Bar,{dataKey:`left`,fill:c,radius:[4,0,0,4],isAnimationActive:m}),(0,r.jsx)(i.Bar,{dataKey:`right`,fill:l,radius:[0,4,4,0],isAnimationActive:m}),d&&(0,r.jsx)(e.ChartLegend,{content:(0,r.jsx)(e.ChartLegendContent,{})})]})})},T=({data:o,dataKey:s=`orders`,label:c=`Orders`,statuses:u,color:d=`var(--chart-1)`,valueFormatter:f=e=>e.toLocaleString(`en-US`),dateFormatter:p=l,showLegend:m=!!u,showGrid:h=!0,className:g,animate:_=!0,height:v})=>(0,r.jsx)(e.ChartContainer,{"data-slot":`orders-bar-chart`,config:(0,t.useMemo)(()=>u?Object.fromEntries(u.map((e,t)=>[e.key,{label:e.label,color:e.color||a(t)}])):{[s]:{label:c,color:d}},[u,s,c,d]),className:(0,n.cn)(`w-full`,g),style:v===void 0?void 0:{height:v,aspectRatio:`auto`},children:(0,r.jsxs)(i.BarChart,{data:o,margin:{top:8,right:12,bottom:0,left:12},children:[h&&(0,r.jsx)(i.CartesianGrid,{vertical:!1}),(0,r.jsx)(i.XAxis,{dataKey:`date`,tickLine:!1,axisLine:!1,tickMargin:8,tickFormatter:p}),(0,r.jsx)(i.YAxis,{tickLine:!1,axisLine:!1,tickMargin:8,width:48,allowDecimals:!1,tickFormatter:f}),(0,r.jsx)(e.ChartTooltip,{content:(0,r.jsx)(e.ChartTooltipContent,{labelFormatter:(e,t)=>{let n=t?.[0]?.payload?.date;return n?p(n):null}})}),u?u.map((e,t)=>(0,r.jsx)(i.Bar,{dataKey:e.key,stackId:`orders`,fill:e.color||a(t),radius:t===u.length-1?[4,4,0,0]:[0,0,0,0],isAnimationActive:_},e.key)):(0,r.jsx)(i.Bar,{dataKey:s,fill:d,radius:[4,4,0,0],isAnimationActive:_}),m&&(0,r.jsx)(e.ChartLegend,{content:(0,r.jsx)(e.ChartLegendContent,{})})]})}),E=e=>e.key||e.name.toLowerCase().replace(/[^a-z0-9]+/g,`-`),D=({data:s,valueFormatter:c=o,showLabels:l=!0,className:u,animate:d=!0,height:f})=>{let{chartData:p,config:m}=(0,t.useMemo)(()=>{let e=s.map((e,t)=>({...e,key:E(e),fill:e.color||a(t)}));return{chartData:e,config:Object.fromEntries(e.map(e=>[e.key,{label:e.name,color:e.fill}]))}},[s]);return(0,r.jsx)(e.ChartContainer,{"data-slot":`portfolio-allocation-treemap`,config:m,className:(0,n.cn)(`w-full`,u),style:f===void 0?void 0:{height:f,aspectRatio:`auto`},children:(0,r.jsx)(i.Treemap,{data:p,dataKey:`value`,nameKey:`key`,isAnimationActive:d,content:e=>{if(e.depth!==1)return(0,r.jsx)(`g`,{});let t=p.find(t=>t.key===e.name),n=l&&e.width>=36&&e.height>=24;return(0,r.jsxs)(`g`,{children:[(0,r.jsx)(`rect`,{x:e.x,y:e.y,width:e.width,height:e.height,fill:t?.fill,stroke:`var(--background)`}),n&&(0,r.jsx)(`text`,{x:e.x+6,y:e.y+16,className:`fill-white font-medium text-xs`,children:t?.name}),n&&e.height>40&&(0,r.jsx)(`text`,{x:e.x+6,y:e.y+32,className:`fill-white/80 font-number text-[11px]`,children:c(e.value)})]})},children:(0,r.jsx)(e.ChartTooltip,{content:(0,r.jsx)(e.ChartTooltipContent,{nameKey:`key`,hideLabel:!0,formatter:e=>c(Number(e))})})})})},O=({data:a,label:o=`Close`,rangeLabel:s=`Range`,color:c=`var(--chart-1)`,valueFormatter:u=e=>e.toLocaleString(`en-US`),dateFormatter:d=l,showGrid:f=!0,className:p,animate:m=!0,height:h})=>{let g=(0,t.useMemo)(()=>({close:{label:o,color:c},rangeSpan:{label:s,color:c}}),[o,c,s]),_=(0,t.useMemo)(()=>a.map(e=>({...e,rangeSpan:e.high-e.low})),[a]);return(0,r.jsx)(e.ChartContainer,{"data-slot":`price-range-area-chart`,config:g,className:(0,n.cn)(`w-full`,p),style:h===void 0?void 0:{height:h,aspectRatio:`auto`},children:(0,r.jsxs)(i.ComposedChart,{data:_,margin:{top:8,right:12,bottom:0,left:12},children:[f&&(0,r.jsx)(i.CartesianGrid,{vertical:!1}),(0,r.jsx)(i.XAxis,{dataKey:`date`,tickLine:!1,axisLine:!1,tickMargin:8,tickFormatter:d}),(0,r.jsx)(i.YAxis,{domain:[`auto`,`auto`],tickLine:!1,axisLine:!1,tickMargin:8,width:64,tickFormatter:u}),(0,r.jsx)(e.ChartTooltip,{cursor:!1,content:(0,r.jsx)(e.ChartTooltipContent,{labelFormatter:(e,t)=>{let n=t?.[0]?.payload?.date;return n?d(n):null},formatter:(e,t,n)=>{if(t!==`close`)return null;let i=n.payload;return(0,r.jsxs)(`div`,{className:`grid gap-0.5`,children:[(0,r.jsxs)(`span`,{className:`text-muted`,children:[g.close?.label,` `,(0,r.jsx)(`span`,{className:`font-medium font-number text-text-positive-strong`,children:u(Number(e))})]}),(0,r.jsxs)(`span`,{className:`text-[11px] text-muted`,children:[u(i.low),` – `,u(i.high)]})]})}})}),(0,r.jsx)(i.Area,{dataKey:`low`,stackId:`range`,stroke:`none`,fill:`transparent`,isAnimationActive:m}),(0,r.jsx)(i.Area,{dataKey:`rangeSpan`,stackId:`range`,stroke:`none`,fill:c,fillOpacity:.15,isAnimationActive:m}),(0,r.jsx)(i.Line,{type:`natural`,dataKey:`close`,stroke:c,strokeWidth:2,dot:!1,isAnimationActive:m})]})})},k=({data:a,label:o=`Revenue`,comparisonLabel:c=`Previous period`,showComparison:u=!1,color:d=`var(--chart-1)`,comparisonColor:f=`var(--chart-8)`,valueFormatter:p=e=>s(e),dateFormatter:m=l,showLegend:h=u,showGrid:g=!0,className:_,animate:v=!0,height:y})=>{let b=(0,t.useId)(),x=(0,t.useMemo)(()=>({value:{label:o,color:d},...u?{previousValue:{label:c,color:f}}:{}}),[o,d,u,c,f]);return(0,r.jsx)(e.ChartContainer,{"data-slot":`revenue-area-chart`,config:x,className:(0,n.cn)(`w-full`,_),style:y===void 0?void 0:{height:y,aspectRatio:`auto`},children:(0,r.jsxs)(i.AreaChart,{data:a,margin:{top:8,right:12,bottom:0,left:12},children:[(0,r.jsxs)(`defs`,{children:[(0,r.jsxs)(`linearGradient`,{id:`${b}-value`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,r.jsx)(`stop`,{offset:`5%`,stopColor:d,stopOpacity:.6}),(0,r.jsx)(`stop`,{offset:`95%`,stopColor:d,stopOpacity:.05})]}),(0,r.jsxs)(`linearGradient`,{id:`${b}-previous`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,r.jsx)(`stop`,{offset:`5%`,stopColor:f,stopOpacity:.3}),(0,r.jsx)(`stop`,{offset:`95%`,stopColor:f,stopOpacity:.02})]})]}),g&&(0,r.jsx)(i.CartesianGrid,{vertical:!1}),(0,r.jsx)(i.XAxis,{dataKey:`date`,tickLine:!1,axisLine:!1,tickMargin:8,tickFormatter:m}),(0,r.jsx)(i.YAxis,{tickLine:!1,axisLine:!1,tickMargin:8,width:64,tickFormatter:p}),(0,r.jsx)(e.ChartTooltip,{cursor:!1,content:(0,r.jsx)(e.ChartTooltipContent,{labelFormatter:(e,t)=>{let n=t?.[0]?.payload?.date;return n?m(n):null},formatter:(e,t,n)=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`div`,{className:`size-2.5 shrink-0 rounded-[2px]`,style:{backgroundColor:n.color}}),(0,r.jsx)(`span`,{className:`text-muted`,children:x[String(t)]?.label||t}),(0,r.jsx)(`span`,{className:`text-text-positive-strong font-number ml-auto font-medium tabular-nums`,children:p(Number(e))})]})})}),u&&(0,r.jsx)(i.Area,{type:`natural`,dataKey:`previousValue`,stroke:f,strokeWidth:2,strokeDasharray:`4 4`,fill:`url(#${b}-previous)`,isAnimationActive:v}),(0,r.jsx)(i.Area,{type:`natural`,dataKey:`value`,stroke:d,strokeWidth:2,fill:`url(#${b}-value)`,isAnimationActive:v}),h&&(0,r.jsx)(e.ChartLegend,{content:(0,r.jsx)(e.ChartLegendContent,{})})]})})},A=({data:a,revenueLabel:o=`Revenue`,ordersLabel:c=`Orders`,revenueColor:u=`var(--chart-1)`,ordersColor:d=`var(--chart-4)`,revenueFormatter:f=e=>s(e),ordersFormatter:p=e=>e.toLocaleString(`en-US`),dateFormatter:m=l,showLegend:h=!0,showGrid:g=!0,className:_,animate:v=!0,height:y})=>{let b=(0,t.useMemo)(()=>({revenue:{label:o,color:u},orders:{label:c,color:d}}),[o,u,c,d]);return(0,r.jsx)(e.ChartContainer,{"data-slot":`revenue-orders-composed-chart`,config:b,className:(0,n.cn)(`w-full`,_),style:y===void 0?void 0:{height:y,aspectRatio:`auto`},children:(0,r.jsxs)(i.ComposedChart,{data:a,margin:{top:8,right:12,bottom:0,left:12},children:[g&&(0,r.jsx)(i.CartesianGrid,{vertical:!1}),(0,r.jsx)(i.XAxis,{dataKey:`date`,tickLine:!1,axisLine:!1,tickMargin:8,tickFormatter:m}),(0,r.jsx)(i.YAxis,{yAxisId:`revenue`,tickLine:!1,axisLine:!1,tickMargin:8,width:64,tickFormatter:f}),(0,r.jsx)(i.YAxis,{yAxisId:`orders`,orientation:`right`,tickLine:!1,axisLine:!1,tickMargin:8,width:48,allowDecimals:!1,tickFormatter:p}),(0,r.jsx)(e.ChartTooltip,{content:(0,r.jsx)(e.ChartTooltipContent,{labelFormatter:(e,t)=>{let n=t?.[0]?.payload?.date;return n?m(n):null},formatter:(e,t,n)=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`div`,{className:`size-2.5 shrink-0 rounded-[2px]`,style:{backgroundColor:n.color}}),(0,r.jsx)(`span`,{className:`text-muted`,children:b[String(t)]?.label||t}),(0,r.jsx)(`span`,{className:`text-text-positive-strong font-number ml-auto font-medium tabular-nums`,children:t===`revenue`?f(Number(e)):p(Number(e))})]})})}),(0,r.jsx)(i.Bar,{dataKey:`revenue`,yAxisId:`revenue`,fill:u,radius:[4,4,0,0],isAnimationActive:v}),(0,r.jsx)(i.Line,{type:`natural`,dataKey:`orders`,yAxisId:`orders`,stroke:d,strokeWidth:2,dot:!1,isAnimationActive:v}),h&&(0,r.jsx)(e.ChartLegend,{content:(0,r.jsx)(e.ChartLegendContent,{})})]})})},j=({value:a,target:o,label:s=`Target`,valueFormatter:l=(e,t)=>c(t===0?0:e/t),color:u=`var(--chart-1)`,className:d,animate:f=!0,height:p})=>{let m=(0,t.useMemo)(()=>[{name:`progress`,value:Math.min(Math.max(a,0),o),fill:u}],[a,o,u]);return(0,r.jsx)(e.ChartContainer,{"data-slot":`sales-target-radial-chart`,config:(0,t.useMemo)(()=>({progress:{label:s,color:u}}),[s,u]),className:(0,n.cn)(`mx-auto`,p===void 0&&`aspect-square`,d),style:p===void 0?void 0:{height:p,aspectRatio:`auto`},children:(0,r.jsxs)(i.RadialBarChart,{data:m,startAngle:90,endAngle:-270,innerRadius:`75%`,outerRadius:`100%`,children:[(0,r.jsx)(i.PolarAngleAxis,{type:`number`,domain:[0,o],angleAxisId:0,tick:!1}),(0,r.jsx)(i.RadialBar,{dataKey:`value`,angleAxisId:0,background:!0,cornerRadius:10,isAnimationActive:f}),(0,r.jsx)(i.PolarRadiusAxis,{tick:!1,tickLine:!1,axisLine:!1,children:(0,r.jsx)(i.Label,{content:({viewBox:e})=>!e||!(`cx`in e)||!(`cy`in e)?null:(0,r.jsxs)(`text`,{x:e.cx,y:e.cy,textAnchor:`middle`,dominantBaseline:`middle`,children:[(0,r.jsx)(`tspan`,{x:e.cx,y:e.cy,className:`fill-text-positive-strong font-number text-3xl font-bold`,children:l(a,o)}),(0,r.jsx)(`tspan`,{x:e.cx,y:(e.cy||0)+24,className:`fill-muted text-xs`,children:s})]})})})]})})},M=e=>e.length*5.6+14,N=({nodes:o,links:s,valueFormatter:c=e=>e.toLocaleString(`en-US`),nodeWidth:l=14,nodePadding:u=24,labelWidth:d=170,className:f,animate:p=!0,height:m})=>{let{data:h,colorByName:g,effectiveLabelWidth:_,rootNames:v,leafNames:y}=(0,t.useMemo)(()=>{let e=o.map(e=>typeof e==`string`?{name:e}:e),t=new Map(e.map((e,t)=>[e.name,t])),n=new Map(e.map((e,t)=>[e.name,e.color||a(t)])),r=s.map(e=>({source:t.get(e.source),target:t.get(e.target),value:e.value})).filter(e=>e.source!==void 0&&e.target!==void 0),i=new Set(r.map(e=>e.target)),l=new Set(r.map(e=>e.source)),u=new Set(e.filter((e,t)=>!i.has(t)).map(e=>e.name)),f=new Set(e.filter((e,t)=>!l.has(t)).map(e=>e.name)),p=d;return e.forEach((e,t)=>{if(i.has(t)&&l.has(t))return;let n=r.filter(e=>e.source===t||e.target===t).reduce((e,t)=>e+t.value,0);p=Math.max(p,M(`${e.name}: ${c(n)}`)+16)}),{data:{nodes:e,links:r},colorByName:n,effectiveLabelWidth:p,rootNames:u,leafNames:f}},[o,s,d,c]);return(0,r.jsx)(e.ChartContainer,{"data-slot":`sankey-flow-chart`,config:{},className:(0,n.cn)(`w-full`,f),style:m===void 0?void 0:{height:m,aspectRatio:`auto`},children:(0,r.jsx)(i.Sankey,{data:h,nodeWidth:l,nodePadding:u,linkCurvature:.45,margin:{top:28,right:_,bottom:8,left:_},node:e=>{let{x:t,y:n,width:a,height:o,payload:s}=e,l=g.get(s.name)??`var(--chart-1)`,u=v.has(s.name),d=y.has(s.name),f=`${s.name}: ${c(s.value)}`,m=M(f),h,_,b,x,S;return u||d?(b=u?`end`:`start`,_=n+o/2,S=_-18/2,x=u?t-8-m:t+a+8,h=u?x+m-6:x+6):(b=`middle`,_=s.depth%2==0?n-10:n-30,S=_-18+4,x=t+a/2-m/2,h=t+a/2),(0,r.jsxs)(`g`,{children:[(0,r.jsx)(i.Rectangle,{className:`recharts-sankey-node`,x:t,y:n,width:a,height:o,fill:l,stroke:`var(--background)`,strokeWidth:1.5,isAnimationActive:p}),(0,r.jsx)(`rect`,{x,y:S,width:m,height:18,rx:4,fill:`var(--background)`,fillOpacity:.92}),(0,r.jsx)(`text`,{x:h,y:_,textAnchor:b,dominantBaseline:`middle`,className:`fill-text-positive-strong text-[11px] font-medium`,children:f})]})},link:e=>{let{sourceX:t,sourceY:n,sourceControlX:i,targetX:a,targetY:o,targetControlX:s,linkWidth:c,payload:l}=e,u=g.get(l.source.name)??`var(--chart-1)`,d=`color-mix(in oklch, ${u} 60%, ${g.get(l.target.name)??u} 40%)`;return(0,r.jsx)(`path`,{className:`recharts-sankey-link`,d:`M${t},${n} C${i},${n} ${s},${o} ${a},${o}`,fill:`none`,stroke:d,strokeWidth:c,strokeOpacity:.4})}})})},P={up:`var(--success)`,down:`var(--danger)`,neutral:`var(--chart-1)`},F=({data:e,type:a=`area`,trend:o=`neutral`,color:s,height:c=40,animate:l=!0,className:u})=>{let d=(0,t.useId)(),f=s||P[o],p=(0,t.useMemo)(()=>e.map(e=>typeof e==`number`?{value:e}:e),[e]),m={top:2,right:0,bottom:2,left:0};return(0,r.jsx)(`div`,{"data-slot":`sparkline-chart`,className:(0,n.cn)(`w-full`,u),style:{height:c},children:(0,r.jsx)(i.ResponsiveContainer,{children:a===`line`?(0,r.jsx)(i.LineChart,{data:p,margin:m,children:(0,r.jsx)(i.Line,{type:`natural`,dataKey:`value`,stroke:f,strokeWidth:2,dot:!1,isAnimationActive:l})}):(0,r.jsxs)(i.AreaChart,{data:p,margin:m,children:[(0,r.jsx)(`defs`,{children:(0,r.jsxs)(`linearGradient`,{id:d,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,r.jsx)(`stop`,{offset:`5%`,stopColor:f,stopOpacity:.4}),(0,r.jsx)(`stop`,{offset:`95%`,stopColor:f,stopOpacity:.05})]})}),(0,r.jsx)(i.Area,{type:`natural`,dataKey:`value`,stroke:f,strokeWidth:2,fill:`url(#${d})`,isAnimationActive:l})]})})})},I=({data:o,series:s,valueFormatter:c=e=>e.toLocaleString(`en-US`),dateFormatter:u=l,showLegend:d=!0,showGrid:f=!0,className:p,animate:m=!0,height:h})=>(0,r.jsx)(e.ChartContainer,{"data-slot":`stacked-area-chart`,config:(0,t.useMemo)(()=>Object.fromEntries(s.map((e,t)=>[e.key,{label:e.label,color:e.color||a(t)}])),[s]),className:(0,n.cn)(`w-full`,p),style:h===void 0?void 0:{height:h,aspectRatio:`auto`},children:(0,r.jsxs)(i.AreaChart,{data:o,margin:{top:8,right:12,bottom:0,left:12},children:[f&&(0,r.jsx)(i.CartesianGrid,{vertical:!1}),(0,r.jsx)(i.XAxis,{dataKey:`date`,tickLine:!1,axisLine:!1,tickMargin:8,tickFormatter:u}),(0,r.jsx)(i.YAxis,{tickLine:!1,axisLine:!1,tickMargin:8,width:64,tickFormatter:c}),(0,r.jsx)(e.ChartTooltip,{content:(0,r.jsx)(e.ChartTooltipContent,{labelFormatter:(e,t)=>{let n=t?.[0]?.payload?.date;return n?u(n):null},formatter:e=>c(Number(e))})}),s.map((e,t)=>{let n=e.color||a(t);return(0,r.jsx)(i.Area,{type:`natural`,dataKey:e.key,stackId:`stack`,stroke:n,fill:n,fillOpacity:.35,isAnimationActive:m},e.key)}),d&&(0,r.jsx)(e.ChartLegend,{content:(0,r.jsx)(e.ChartLegendContent,{})})]})}),L=({data:a,label:s=`Sales`,maxItems:c=8,color:l=`var(--chart-1)`,valueFormatter:u=o,showValueLabels:d=!0,className:f,animate:p=!0,height:m})=>{let h=(0,t.useMemo)(()=>[...a].sort((e,t)=>t.value-e.value).slice(0,c),[a,c]);return(0,r.jsx)(e.ChartContainer,{"data-slot":`top-products-bar-chart`,config:(0,t.useMemo)(()=>({value:{label:s,color:l}}),[s,l]),className:(0,n.cn)(`w-full`,f),style:m===void 0?void 0:{height:m,aspectRatio:`auto`},children:(0,r.jsxs)(i.BarChart,{data:h,layout:`vertical`,margin:{top:0,right:d?48:12,bottom:0,left:12},children:[(0,r.jsx)(i.XAxis,{type:`number`,dataKey:`value`,hide:!0}),(0,r.jsx)(i.YAxis,{type:`category`,dataKey:`name`,tickLine:!1,axisLine:!1,tickMargin:8,width:120}),(0,r.jsx)(e.ChartTooltip,{cursor:!1,content:(0,r.jsx)(e.ChartTooltipContent,{hideLabel:!0})}),(0,r.jsx)(i.Bar,{dataKey:`value`,fill:l,radius:4,isAnimationActive:p,children:d&&(0,r.jsx)(i.LabelList,{dataKey:`value`,position:`right`,offset:8,className:`fill-muted-strong`,fontSize:12,formatter:e=>u(Number(e))})})]})})},R=({data:a,label:s=`Volume`,upColor:c=`var(--success)`,downColor:d=`var(--danger)`,valueFormatter:f=o,dateFormatter:p=l,showGrid:m=!0,className:h,animate:g=!0,height:_})=>{let v=(0,t.useMemo)(()=>({volume:{label:s,color:c}}),[s,c]),y=(0,t.useMemo)(()=>a.map((e,t)=>({...e,previousClose:t>0?a[t-1]?.close:e.close})),[a]);return(0,r.jsx)(e.ChartContainer,{"data-slot":`volume-bar-chart`,config:v,className:(0,n.cn)(`w-full`,h),style:_===void 0?void 0:{height:_,aspectRatio:`auto`},children:(0,r.jsxs)(i.BarChart,{data:y,margin:{top:8,right:12,bottom:0,left:12},children:[m&&(0,r.jsx)(i.CartesianGrid,{vertical:!1}),(0,r.jsx)(i.XAxis,{dataKey:`date`,tickLine:!1,axisLine:!1,tickMargin:8,tickFormatter:p}),(0,r.jsx)(i.YAxis,{tickLine:!1,axisLine:!1,tickMargin:8,width:56,tickFormatter:f}),(0,r.jsx)(e.ChartTooltip,{cursor:!1,content:(0,r.jsx)(e.ChartTooltipContent,{hideIndicator:!0,labelFormatter:(e,t)=>{let n=t?.[0]?.payload?.date;return n?p(n):null},formatter:e=>f(Number(e))})}),(0,r.jsx)(i.Bar,{dataKey:`volume`,isAnimationActive:g,shape:e=>{let t=e.payload,n=u(t?.close??0,t?.previousClose??0,{up:c,down:d});return(0,r.jsx)(i.Rectangle,{...e,fill:n})}})]})})},z=({data:a,totalColor:o=`var(--chart-1)`,upColor:s=`var(--success)`,downColor:c=`var(--danger)`,valueFormatter:l=e=>e.toLocaleString(`en-US`),showGrid:d=!0,className:f,animate:p=!0,height:m})=>{let h=(0,t.useMemo)(()=>({size:{label:`Amount`,color:o}}),[o]),g=(0,t.useMemo)(()=>{let e=0;return a.map(t=>{if(t.isTotal)return e=t.value,{...t,base:0,size:t.value,color:o,runningTotal:e};let n=e;e+=t.value;let r=Math.min(n,e);return{...t,base:r,size:Math.abs(t.value),color:u(t.value,0,{up:s,down:c}),runningTotal:e}})},[a,o,s,c]);return(0,r.jsx)(e.ChartContainer,{"data-slot":`waterfall-chart`,config:h,className:(0,n.cn)(`w-full`,f),style:m===void 0?void 0:{height:m,aspectRatio:`auto`},children:(0,r.jsxs)(i.BarChart,{data:g,margin:{top:8,right:12,bottom:0,left:12},children:[d&&(0,r.jsx)(i.CartesianGrid,{vertical:!1}),(0,r.jsx)(i.XAxis,{dataKey:`label`,tickLine:!1,axisLine:!1,tickMargin:8}),(0,r.jsx)(i.YAxis,{tickLine:!1,axisLine:!1,tickMargin:8,width:64,tickFormatter:l}),(0,r.jsx)(e.ChartTooltip,{cursor:!1,content:(0,r.jsx)(e.ChartTooltipContent,{hideIndicator:!0,formatter:(e,t,n)=>{let i=n.payload;return(0,r.jsxs)(`div`,{className:`grid gap-0.5`,children:[(0,r.jsxs)(`span`,{className:`text-muted`,children:[i.isTotal?`Total`:i.value>=0?`Increase`:`Decrease`,` `,(0,r.jsx)(`span`,{className:`font-medium font-number text-text-positive-strong`,children:l(i.value)})]}),(0,r.jsxs)(`span`,{className:`text-[11px] text-muted`,children:[`Running total `,l(i.runningTotal)]})]})}})}),(0,r.jsx)(i.Bar,{dataKey:`base`,stackId:`waterfall`,fill:`transparent`,isAnimationActive:!1}),(0,r.jsx)(i.Bar,{dataKey:`size`,stackId:`waterfall`,isAnimationActive:p,shape:e=>(0,r.jsx)(i.Rectangle,{...e,fill:e.payload.color,radius:2})})]})})};exports.ActivityHeatmapChart=m,exports.CandlestickChart=g,exports.ConversionFunnelChart=_,exports.CorrelationScatterChart=v,exports.DonutChart=b,exports.GainLossBarChart=x,exports.IndexedPerformanceLineChart=S,exports.MetricRadarChart=C,exports.MirroredBarChart=w,exports.OrdersBarChart=T,exports.PortfolioAllocationTreemap=D,exports.PriceRangeAreaChart=O,exports.RevenueAreaChart=k,exports.RevenueOrdersComposedChart=A,exports.SalesTargetRadialChart=j,exports.SankeyFlowChart=N,exports.SparklineChart=F,exports.StackedAreaChart=I,exports.TopProductsBarChart=L,exports.VolumeBarChart=R,exports.WaterfallChart=z,exports.computeIndexedSeries=f,exports.formatCompactNumber=o,exports.formatCurrency=s,exports.formatPercent=c,exports.formatSignedPercent=d,exports.getChartColor=a,exports.getDirectionColor=u,exports.toDateLabel=l;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["ChartContainer","FunnelChart","ChartTooltip","ChartTooltipContent","Funnel","LabelList","ChartContainer","PieChart","ChartTooltip","ChartTooltipContent","Pie","Label","ChartLegend","ChartLegendContent","ChartContainer","BarChart","CartesianGrid","XAxis","YAxis","ChartTooltip","ChartTooltipContent","Bar","ChartLegend","ChartLegendContent","ChartContainer","AreaChart","CartesianGrid","XAxis","YAxis","ChartTooltip","ChartTooltipContent","Area","ChartLegend","ChartLegendContent","ChartContainer","ComposedChart","CartesianGrid","XAxis","YAxis","ChartTooltip","ChartTooltipContent","Bar","Line","ChartLegend","ChartLegendContent","ChartContainer","RadialBarChart","PolarAngleAxis","RadialBar","PolarRadiusAxis","Label","ResponsiveContainer","LineChart","Line","AreaChart","Area","ChartContainer","BarChart","XAxis","YAxis","ChartTooltip","ChartTooltipContent","Bar","LabelList"],"sources":["../../../packages/components/features/charts/utils.ts","../../../packages/components/features/charts/components/conversion-funnel-chart.tsx","../../../packages/components/features/charts/components/donut-chart.tsx","../../../packages/components/features/charts/components/orders-bar-chart.tsx","../../../packages/components/features/charts/components/revenue-area-chart.tsx","../../../packages/components/features/charts/components/revenue-orders-composed-chart.tsx","../../../packages/components/features/charts/components/sales-target-radial-chart.tsx","../../../packages/components/features/charts/components/sparkline-chart.tsx","../../../packages/components/features/charts/components/top-products-bar-chart.tsx"],"sourcesContent":["const CHART_COLOR_COUNT = 8;\n\n/** Cycles through the eight `--chart-N` theme palette variables. */\nexport const getChartColor = (index: number): string => `var(--chart-${(((index % CHART_COLOR_COUNT) + CHART_COLOR_COUNT) % CHART_COLOR_COUNT) + 1})`;\n\nexport const formatCompactNumber = (value: number, locale = 'en-US'): string =>\n new Intl.NumberFormat(locale, { notation: 'compact', maximumFractionDigits: 1 }).format(value);\n\nexport const formatCurrency = (value: number, currency = 'USD', locale = 'en-US'): string =>\n new Intl.NumberFormat(locale, {\n style: 'currency',\n currency,\n notation: Math.abs(value) >= 10_000 ? 'compact' : 'standard',\n maximumFractionDigits: Math.abs(value) >= 10_000 ? 1 : 0,\n }).format(value);\n\nexport const formatPercent = (value: number, locale = 'en-US'): string =>\n new Intl.NumberFormat(locale, { style: 'percent', maximumFractionDigits: 1 }).format(value);\n\nexport const toDateLabel = (date: string | Date, locale = 'en-US'): string => {\n const parsed = date instanceof Date ? date : new Date(date);\n if (Number.isNaN(parsed.getTime())) return String(date);\n return parsed.toLocaleDateString(locale, { month: 'short', day: 'numeric' });\n};\n","'use client';\n\nimport { useMemo } from 'react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { type ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from '@/components/ui/chart';\n\nimport { Funnel, FunnelChart, LabelList } from 'recharts';\nimport type { BaseChartProps, NamedValue } from '../types';\nimport { formatCompactNumber, formatPercent, getChartColor } from '../utils';\n\nexport type FunnelStage = NamedValue & {\n /** Config key; derived from `name` when omitted. */\n key?: string;\n color?: string;\n};\n\nexport type ConversionFunnelChartProps = BaseChartProps & {\n /** Funnel stages ordered top (widest) to bottom. */\n data: FunnelStage[];\n /** Appends each stage's percentage of the first stage. Defaults to `true`. */\n showConversionRates?: boolean;\n valueFormatter?: (value: number) => string;\n};\n\n/**\n * A conversion funnel for the ecommerce purchase journey — sessions, product views, carts,\n * checkouts, purchases — with per-stage conversion rates against the first stage.\n *\n * @example\n * ```tsx\n * import { ConversionFunnelChart } from '@customafk/lunas-ui/features/charts';\n *\n * <ConversionFunnelChart\n * data={[\n * { name: 'Sessions', value: 50000 },\n * { name: 'Product views', value: 32000 },\n * { name: 'Added to cart', value: 8400 },\n * { name: 'Purchased', value: 2900 },\n * ]}\n * />\n * ```\n */\nexport const ConversionFunnelChart = ({\n data,\n showConversionRates = true,\n valueFormatter = formatCompactNumber,\n className,\n animate = true,\n height,\n}: ConversionFunnelChartProps) => {\n const { chartData, config } = useMemo(() => {\n const first = data[0]?.value ?? 0;\n const entries = data.map((stage, index) => {\n const rate = first === 0 ? 0 : stage.value / first;\n const valueLabel = showConversionRates ? `${valueFormatter(stage.value)} (${formatPercent(rate)})` : valueFormatter(stage.value);\n return {\n ...stage,\n key: stage.key || stage.name.toLowerCase().replace(/[^a-z0-9]+/g, '-'),\n fill: stage.color || getChartColor(index),\n valueLabel,\n };\n });\n const chartConfig: ChartConfig = Object.fromEntries(entries.map(entry => [entry.key, { label: entry.name, color: entry.fill }]));\n return { chartData: entries, config: chartConfig };\n }, [data, showConversionRates, valueFormatter]);\n\n return (\n <ChartContainer\n data-slot=\"conversion-funnel-chart\"\n config={config}\n className={cn('w-full', className)}\n style={height !== undefined ? { height, aspectRatio: 'auto' } : undefined}\n >\n <FunnelChart margin={{ top: 8, right: 120, bottom: 8, left: 120 }}>\n <ChartTooltip content={<ChartTooltipContent nameKey=\"key\" hideLabel />} />\n <Funnel dataKey=\"value\" data={chartData} isAnimationActive={animate}>\n <LabelList dataKey=\"name\" position=\"left\" offset={12} className=\"fill-muted-strong\" fontSize={12} />\n <LabelList dataKey=\"valueLabel\" position=\"right\" offset={12} className=\"fill-text-positive-strong font-number\" fontSize={12} />\n </Funnel>\n </FunnelChart>\n </ChartContainer>\n );\n};\n","'use client';\n\nimport { useMemo } from 'react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { type ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartTooltip, ChartTooltipContent } from '@/components/ui/chart';\n\nimport { Label, Pie, PieChart } from 'recharts';\nimport type { BaseChartProps, NamedValue } from '../types';\nimport { formatCompactNumber, getChartColor } from '../utils';\n\nexport type DonutChartSegment = NamedValue & {\n /** Config key; derived from `name` when omitted. */\n key?: string;\n color?: string;\n};\n\nexport type DonutChartProps = BaseChartProps & {\n data: DonutChartSegment[];\n /** Text under the center total, e.g. `'Total sales'`. */\n centerLabel?: string;\n /** Formats the center total. Defaults to compact notation. */\n centerValueFormatter?: (total: number) => string;\n /** Overrides the computed segment sum shown in the center. */\n totalValue?: number;\n showLegend?: boolean;\n showCenterTotal?: boolean;\n};\n\nconst toKey = (segment: DonutChartSegment): string => segment.key || segment.name.toLowerCase().replace(/[^a-z0-9]+/g, '-');\n\n/**\n * A donut breakdown chart with a center total — category sales, traffic sources, payment methods.\n *\n * @example\n * ```tsx\n * import { DonutChart } from '@customafk/lunas-ui/features/charts';\n *\n * <DonutChart\n * data={[\n * { name: 'Fashion', value: 12400 },\n * { name: 'Electronics', value: 8200 },\n * ]}\n * centerLabel=\"Total sales\"\n * />\n * ```\n */\nexport const DonutChart = ({\n data,\n centerLabel,\n centerValueFormatter = formatCompactNumber,\n totalValue,\n showLegend = true,\n showCenterTotal = true,\n className,\n animate = true,\n height,\n}: DonutChartProps) => {\n const { chartData, config, total } = useMemo(() => {\n const entries = data.map((segment, index) => ({\n ...segment,\n key: toKey(segment),\n fill: segment.color || getChartColor(index),\n }));\n const chartConfig: ChartConfig = Object.fromEntries(entries.map(entry => [entry.key, { label: entry.name, color: entry.fill }]));\n return {\n chartData: entries,\n config: chartConfig,\n total: totalValue ?? data.reduce((sum, segment) => sum + segment.value, 0),\n };\n }, [data, totalValue]);\n\n return (\n <ChartContainer\n data-slot=\"donut-chart\"\n config={config}\n className={cn('mx-auto', height === undefined && 'aspect-square', className)}\n style={height !== undefined ? { height, aspectRatio: 'auto' } : undefined}\n >\n <PieChart>\n <ChartTooltip cursor={false} content={<ChartTooltipContent nameKey=\"key\" hideLabel />} />\n <Pie data={chartData} dataKey=\"value\" nameKey=\"key\" innerRadius=\"60%\" strokeWidth={5} isAnimationActive={animate}>\n {showCenterTotal && (\n <Label\n content={({ viewBox }) => {\n if (!viewBox || !('cx' in viewBox) || !('cy' in viewBox)) return null;\n return (\n <text x={viewBox.cx} y={viewBox.cy} textAnchor=\"middle\" dominantBaseline=\"middle\">\n <tspan x={viewBox.cx} y={viewBox.cy} className=\"fill-text-positive-strong font-number text-2xl font-bold\">\n {centerValueFormatter(total)}\n </tspan>\n {centerLabel && (\n <tspan x={viewBox.cx} y={(viewBox.cy || 0) + 22} className=\"fill-muted text-xs\">\n {centerLabel}\n </tspan>\n )}\n </text>\n );\n }}\n />\n )}\n </Pie>\n {showLegend && <ChartLegend content={<ChartLegendContent nameKey=\"key\" />} />}\n </PieChart>\n </ChartContainer>\n );\n};\n","'use client';\n\nimport { useMemo } from 'react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { type ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartTooltip, ChartTooltipContent } from '@/components/ui/chart';\n\nimport { Bar, BarChart, CartesianGrid, XAxis, YAxis } from 'recharts';\nimport type { BaseChartProps, ChartSeries } from '../types';\nimport { getChartColor, toDateLabel } from '../utils';\n\nexport type OrdersBarChartProps = BaseChartProps & {\n data: Array<{ date: string | Date } & Record<string, unknown>>;\n /** Simple mode: the key holding each period's count. Defaults to `'orders'`. */\n dataKey?: string;\n /** Series label in simple mode. Defaults to `'Orders'`. */\n label?: string;\n /** Stacked mode: one series per order status; each `key` indexes into the data rows. */\n statuses?: ChartSeries[];\n color?: string;\n valueFormatter?: (value: number) => string;\n dateFormatter?: (date: string | Date) => string;\n /** Defaults to `true` when `statuses` is provided. */\n showLegend?: boolean;\n showGrid?: boolean;\n};\n\n/**\n * A bar chart for order volume per period — a single series by default, or stacked by order\n * status when `statuses` is provided.\n *\n * @example\n * ```tsx\n * import { OrdersBarChart } from '@customafk/lunas-ui/features/charts';\n *\n * <OrdersBarChart\n * data={[{ date: '2026-06-01', completed: 32, pending: 6, cancelled: 2 }]}\n * statuses={[\n * { key: 'completed', label: 'Completed' },\n * { key: 'pending', label: 'Pending' },\n * { key: 'cancelled', label: 'Cancelled' },\n * ]}\n * />\n * ```\n */\nexport const OrdersBarChart = ({\n data,\n dataKey = 'orders',\n label = 'Orders',\n statuses,\n color = 'var(--chart-1)',\n valueFormatter = value => value.toLocaleString('en-US'),\n dateFormatter = toDateLabel,\n showLegend = !!statuses,\n showGrid = true,\n className,\n animate = true,\n height,\n}: OrdersBarChartProps) => {\n const config = useMemo<ChartConfig>(() => {\n if (!statuses) return { [dataKey]: { label, color } };\n return Object.fromEntries(statuses.map((status, index) => [status.key, { label: status.label, color: status.color || getChartColor(index) }]));\n }, [statuses, dataKey, label, color]);\n\n return (\n <ChartContainer\n data-slot=\"orders-bar-chart\"\n config={config}\n className={cn('w-full', className)}\n style={height !== undefined ? { height, aspectRatio: 'auto' } : undefined}\n >\n <BarChart data={data} margin={{ top: 8, right: 12, bottom: 0, left: 12 }}>\n {showGrid && <CartesianGrid vertical={false} />}\n <XAxis dataKey=\"date\" tickLine={false} axisLine={false} tickMargin={8} tickFormatter={dateFormatter} />\n <YAxis tickLine={false} axisLine={false} tickMargin={8} width={48} allowDecimals={false} tickFormatter={valueFormatter} />\n <ChartTooltip\n content={\n <ChartTooltipContent\n labelFormatter={(_, payload) => {\n const date = payload?.[0]?.payload?.date;\n return date ? dateFormatter(date) : null;\n }}\n />\n }\n />\n {statuses ? (\n statuses.map((status, index) => (\n <Bar\n key={status.key}\n dataKey={status.key}\n stackId=\"orders\"\n fill={status.color || getChartColor(index)}\n radius={index === statuses.length - 1 ? [4, 4, 0, 0] : [0, 0, 0, 0]}\n isAnimationActive={animate}\n />\n ))\n ) : (\n <Bar dataKey={dataKey} fill={color} radius={[4, 4, 0, 0]} isAnimationActive={animate} />\n )}\n {showLegend && <ChartLegend content={<ChartLegendContent />} />}\n </BarChart>\n </ChartContainer>\n );\n};\n","'use client';\n\nimport { useId, useMemo } from 'react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { type ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartTooltip, ChartTooltipContent } from '@/components/ui/chart';\n\nimport { Area, AreaChart, CartesianGrid, XAxis, YAxis } from 'recharts';\nimport type { BaseChartProps, TimeSeriesPoint } from '../types';\nimport { formatCurrency, toDateLabel } from '../utils';\n\nexport type RevenueAreaChartProps = BaseChartProps & {\n data: TimeSeriesPoint[];\n /** Series label. Defaults to `'Revenue'`. */\n label?: string;\n /** Comparison series label. Defaults to `'Previous period'`. */\n comparisonLabel?: string;\n /** Renders `previousValue` as a second, muted area series. */\n showComparison?: boolean;\n color?: string;\n comparisonColor?: string;\n /** Formats tooltip and Y-axis values. Defaults to compact currency. */\n valueFormatter?: (value: number) => string;\n dateFormatter?: (date: string | Date) => string;\n /** Defaults to `showComparison`. */\n showLegend?: boolean;\n showGrid?: boolean;\n};\n\n/**\n * A gradient area chart for revenue (or any currency metric) over time, with an optional\n * previous-period comparison series.\n *\n * @example\n * ```tsx\n * import { RevenueAreaChart } from '@customafk/lunas-ui/features/charts';\n *\n * <RevenueAreaChart\n * data={[\n * { date: '2026-06-01', value: 4200, previousValue: 3800 },\n * { date: '2026-06-02', value: 5100, previousValue: 4300 },\n * ]}\n * showComparison\n * />\n * ```\n */\nexport const RevenueAreaChart = ({\n data,\n label = 'Revenue',\n comparisonLabel = 'Previous period',\n showComparison = false,\n color = 'var(--chart-1)',\n comparisonColor = 'var(--chart-8)',\n valueFormatter = value => formatCurrency(value),\n dateFormatter = toDateLabel,\n showLegend = showComparison,\n showGrid = true,\n className,\n animate = true,\n height,\n}: RevenueAreaChartProps) => {\n const gradientId = useId();\n\n const config = useMemo<ChartConfig>(\n () => ({\n value: { label, color },\n ...(showComparison ? { previousValue: { label: comparisonLabel, color: comparisonColor } } : {}),\n }),\n [label, color, showComparison, comparisonLabel, comparisonColor]\n );\n\n return (\n <ChartContainer\n data-slot=\"revenue-area-chart\"\n config={config}\n className={cn('w-full', className)}\n style={height !== undefined ? { height, aspectRatio: 'auto' } : undefined}\n >\n <AreaChart data={data} margin={{ top: 8, right: 12, bottom: 0, left: 12 }}>\n <defs>\n <linearGradient id={`${gradientId}-value`} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop offset=\"5%\" stopColor={color} stopOpacity={0.6} />\n <stop offset=\"95%\" stopColor={color} stopOpacity={0.05} />\n </linearGradient>\n <linearGradient id={`${gradientId}-previous`} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop offset=\"5%\" stopColor={comparisonColor} stopOpacity={0.3} />\n <stop offset=\"95%\" stopColor={comparisonColor} stopOpacity={0.02} />\n </linearGradient>\n </defs>\n {showGrid && <CartesianGrid vertical={false} />}\n <XAxis dataKey=\"date\" tickLine={false} axisLine={false} tickMargin={8} tickFormatter={dateFormatter} />\n <YAxis tickLine={false} axisLine={false} tickMargin={8} width={64} tickFormatter={valueFormatter} />\n <ChartTooltip\n cursor={false}\n content={\n <ChartTooltipContent\n labelFormatter={(_, payload) => {\n const date = payload?.[0]?.payload?.date;\n return date ? dateFormatter(date) : null;\n }}\n formatter={(value, name, item) => (\n <>\n <div className=\"size-2.5 shrink-0 rounded-[2px]\" style={{ backgroundColor: item.color }} />\n <span className=\"text-muted\">{config[String(name)]?.label || name}</span>\n <span className=\"text-text-positive-strong font-number ml-auto font-medium tabular-nums\">{valueFormatter(Number(value))}</span>\n </>\n )}\n />\n }\n />\n {showComparison && (\n <Area\n type=\"natural\"\n dataKey=\"previousValue\"\n stroke={comparisonColor}\n strokeWidth={2}\n strokeDasharray=\"4 4\"\n fill={`url(#${gradientId}-previous)`}\n isAnimationActive={animate}\n />\n )}\n <Area type=\"natural\" dataKey=\"value\" stroke={color} strokeWidth={2} fill={`url(#${gradientId}-value)`} isAnimationActive={animate} />\n {showLegend && <ChartLegend content={<ChartLegendContent />} />}\n </AreaChart>\n </ChartContainer>\n );\n};\n","'use client';\n\nimport { useMemo } from 'react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { type ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartTooltip, ChartTooltipContent } from '@/components/ui/chart';\n\nimport { Bar, CartesianGrid, ComposedChart, Line, XAxis, YAxis } from 'recharts';\nimport type { BaseChartProps } from '../types';\nimport { formatCurrency, toDateLabel } from '../utils';\n\nexport type RevenueOrdersPoint = {\n date: string | Date;\n revenue: number;\n orders: number;\n};\n\nexport type RevenueOrdersComposedChartProps = BaseChartProps & {\n data: RevenueOrdersPoint[];\n revenueLabel?: string;\n ordersLabel?: string;\n revenueColor?: string;\n ordersColor?: string;\n /** Formats the left (revenue) axis and tooltip values. Defaults to compact currency. */\n revenueFormatter?: (value: number) => string;\n /** Formats the right (orders) axis and tooltip values. */\n ordersFormatter?: (value: number) => string;\n dateFormatter?: (date: string | Date) => string;\n showLegend?: boolean;\n showGrid?: boolean;\n};\n\n/**\n * A dual-axis chart combining revenue bars (left axis, currency) with an orders line\n * (right axis, count) to correlate the two metrics per period.\n *\n * @example\n * ```tsx\n * import { RevenueOrdersComposedChart } from '@customafk/lunas-ui/features/charts';\n *\n * <RevenueOrdersComposedChart\n * data={[{ date: '2026-06-01', revenue: 12400, orders: 87 }]}\n * />\n * ```\n */\nexport const RevenueOrdersComposedChart = ({\n data,\n revenueLabel = 'Revenue',\n ordersLabel = 'Orders',\n revenueColor = 'var(--chart-1)',\n ordersColor = 'var(--chart-4)',\n revenueFormatter = value => formatCurrency(value),\n ordersFormatter = value => value.toLocaleString('en-US'),\n dateFormatter = toDateLabel,\n showLegend = true,\n showGrid = true,\n className,\n animate = true,\n height,\n}: RevenueOrdersComposedChartProps) => {\n const config = useMemo<ChartConfig>(\n () => ({\n revenue: { label: revenueLabel, color: revenueColor },\n orders: { label: ordersLabel, color: ordersColor },\n }),\n [revenueLabel, revenueColor, ordersLabel, ordersColor]\n );\n\n return (\n <ChartContainer\n data-slot=\"revenue-orders-composed-chart\"\n config={config}\n className={cn('w-full', className)}\n style={height !== undefined ? { height, aspectRatio: 'auto' } : undefined}\n >\n <ComposedChart data={data} margin={{ top: 8, right: 12, bottom: 0, left: 12 }}>\n {showGrid && <CartesianGrid vertical={false} />}\n <XAxis dataKey=\"date\" tickLine={false} axisLine={false} tickMargin={8} tickFormatter={dateFormatter} />\n <YAxis yAxisId=\"revenue\" tickLine={false} axisLine={false} tickMargin={8} width={64} tickFormatter={revenueFormatter} />\n <YAxis\n yAxisId=\"orders\"\n orientation=\"right\"\n tickLine={false}\n axisLine={false}\n tickMargin={8}\n width={48}\n allowDecimals={false}\n tickFormatter={ordersFormatter}\n />\n <ChartTooltip\n content={\n <ChartTooltipContent\n labelFormatter={(_, payload) => {\n const date = payload?.[0]?.payload?.date;\n return date ? dateFormatter(date) : null;\n }}\n formatter={(value, name, item) => (\n <>\n <div className=\"size-2.5 shrink-0 rounded-[2px]\" style={{ backgroundColor: item.color }} />\n <span className=\"text-muted\">{config[String(name)]?.label || name}</span>\n <span className=\"text-text-positive-strong font-number ml-auto font-medium tabular-nums\">\n {name === 'revenue' ? revenueFormatter(Number(value)) : ordersFormatter(Number(value))}\n </span>\n </>\n )}\n />\n }\n />\n <Bar dataKey=\"revenue\" yAxisId=\"revenue\" fill={revenueColor} radius={[4, 4, 0, 0]} isAnimationActive={animate} />\n <Line type=\"natural\" dataKey=\"orders\" yAxisId=\"orders\" stroke={ordersColor} strokeWidth={2} dot={false} isAnimationActive={animate} />\n {showLegend && <ChartLegend content={<ChartLegendContent />} />}\n </ComposedChart>\n </ChartContainer>\n );\n};\n","'use client';\n\nimport { useMemo } from 'react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { type ChartConfig, ChartContainer } from '@/components/ui/chart';\n\nimport { Label, PolarAngleAxis, PolarRadiusAxis, RadialBar, RadialBarChart } from 'recharts';\nimport type { BaseChartProps } from '../types';\nimport { formatPercent } from '../utils';\n\nexport type SalesTargetRadialChartProps = BaseChartProps & {\n /** Current progress value, e.g. revenue to date. */\n value: number;\n /** The goal the value is measured against. */\n target: number;\n /** Text under the center figure. Defaults to `'Target'`. */\n label?: string;\n /** Formats the center figure. Defaults to percent-of-target. */\n valueFormatter?: (value: number, target: number) => string;\n color?: string;\n};\n\n/**\n * A radial gauge showing progress toward a sales target with the completion figure in the center.\n *\n * @example\n * ```tsx\n * import { SalesTargetRadialChart } from '@customafk/lunas-ui/features/charts';\n *\n * <SalesTargetRadialChart value={65_000} target={100_000} label=\"Monthly target\" />\n * ```\n */\nexport const SalesTargetRadialChart = ({\n value,\n target,\n label = 'Target',\n valueFormatter = (current, goal) => formatPercent(goal === 0 ? 0 : current / goal),\n color = 'var(--chart-1)',\n className,\n animate = true,\n height,\n}: SalesTargetRadialChartProps) => {\n const chartData = useMemo(() => [{ name: 'progress', value: Math.min(Math.max(value, 0), target), fill: color }], [value, target, color]);\n\n const config = useMemo<ChartConfig>(() => ({ progress: { label, color } }), [label, color]);\n\n return (\n <ChartContainer\n data-slot=\"sales-target-radial-chart\"\n config={config}\n className={cn('mx-auto', height === undefined && 'aspect-square', className)}\n style={height !== undefined ? { height, aspectRatio: 'auto' } : undefined}\n >\n <RadialBarChart data={chartData} startAngle={90} endAngle={-270} innerRadius=\"75%\" outerRadius=\"100%\">\n <PolarAngleAxis type=\"number\" domain={[0, target]} angleAxisId={0} tick={false} />\n <RadialBar dataKey=\"value\" angleAxisId={0} background cornerRadius={10} isAnimationActive={animate} />\n <PolarRadiusAxis tick={false} tickLine={false} axisLine={false}>\n <Label\n content={({ viewBox }) => {\n if (!viewBox || !('cx' in viewBox) || !('cy' in viewBox)) return null;\n return (\n <text x={viewBox.cx} y={viewBox.cy} textAnchor=\"middle\" dominantBaseline=\"middle\">\n <tspan x={viewBox.cx} y={viewBox.cy} className=\"fill-text-positive-strong font-number text-3xl font-bold\">\n {valueFormatter(value, target)}\n </tspan>\n <tspan x={viewBox.cx} y={(viewBox.cy || 0) + 24} className=\"fill-muted text-xs\">\n {label}\n </tspan>\n </text>\n );\n }}\n />\n </PolarRadiusAxis>\n </RadialBarChart>\n </ChartContainer>\n );\n};\n","'use client';\n\nimport { useId, useMemo } from 'react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Area, AreaChart, Line, LineChart, ResponsiveContainer } from 'recharts';\nimport type { ChartTrend } from '../types';\n\nconst TREND_COLORS: Record<ChartTrend, string> = {\n up: 'var(--success)',\n down: 'var(--danger)',\n neutral: 'var(--chart-1)',\n};\n\nexport type SparklineChartProps = {\n data: number[] | Array<{ value: number }>;\n /** Render style. Defaults to `'area'`. */\n type?: 'line' | 'area';\n /** Colors the series like the `Statistic` trend prop. Defaults to `'neutral'`. */\n trend?: ChartTrend;\n /** Explicit series color; overrides `trend`. */\n color?: string;\n /** Fixed height in px. Defaults to `40`. */\n height?: number;\n animate?: boolean;\n className?: string;\n};\n\n/**\n * A tiny, axis-less trend chart for KPI cards; pairs with the `Statistic` display component.\n *\n * @example\n * ```tsx\n * import { SparklineChart } from '@customafk/lunas-ui/features/charts';\n *\n * <SparklineChart data={[12, 18, 14, 26, 22, 31]} trend=\"up\" />\n * ```\n */\nexport const SparklineChart = ({ data, type = 'area', trend = 'neutral', color, height = 40, animate = true, className }: SparklineChartProps) => {\n const gradientId = useId();\n const seriesColor = color || TREND_COLORS[trend];\n\n const chartData = useMemo(() => data.map(point => (typeof point === 'number' ? { value: point } : point)), [data]);\n\n const margin = { top: 2, right: 0, bottom: 2, left: 0 };\n\n return (\n <div data-slot=\"sparkline-chart\" className={cn('w-full', className)} style={{ height }}>\n <ResponsiveContainer>\n {type === 'line' ? (\n <LineChart data={chartData} margin={margin}>\n <Line type=\"natural\" dataKey=\"value\" stroke={seriesColor} strokeWidth={2} dot={false} isAnimationActive={animate} />\n </LineChart>\n ) : (\n <AreaChart data={chartData} margin={margin}>\n <defs>\n <linearGradient id={gradientId} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop offset=\"5%\" stopColor={seriesColor} stopOpacity={0.4} />\n <stop offset=\"95%\" stopColor={seriesColor} stopOpacity={0.05} />\n </linearGradient>\n </defs>\n <Area type=\"natural\" dataKey=\"value\" stroke={seriesColor} strokeWidth={2} fill={`url(#${gradientId})`} isAnimationActive={animate} />\n </AreaChart>\n )}\n </ResponsiveContainer>\n </div>\n );\n};\n","'use client';\n\nimport { useMemo } from 'react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { type ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from '@/components/ui/chart';\n\nimport { Bar, BarChart, LabelList, XAxis, YAxis } from 'recharts';\nimport type { BaseChartProps, NamedValue } from '../types';\nimport { formatCompactNumber } from '../utils';\n\nexport type TopProductsBarChartProps = BaseChartProps & {\n data: NamedValue[];\n /** Series label. Defaults to `'Sales'`. */\n label?: string;\n /** Number of items shown after sorting descending. Defaults to `8`. */\n maxItems?: number;\n color?: string;\n valueFormatter?: (value: number) => string;\n /** Value labels at the end of each bar. Defaults to `true`. */\n showValueLabels?: boolean;\n};\n\n/**\n * A horizontal bar ranking chart — top products, best categories, top customers.\n *\n * @example\n * ```tsx\n * import { TopProductsBarChart } from '@customafk/lunas-ui/features/charts';\n *\n * <TopProductsBarChart\n * data={[\n * { name: 'Wireless Earbuds', value: 1245 },\n * { name: 'Smart Watch', value: 986 },\n * ]}\n * />\n * ```\n */\nexport const TopProductsBarChart = ({\n data,\n label = 'Sales',\n maxItems = 8,\n color = 'var(--chart-1)',\n valueFormatter = formatCompactNumber,\n showValueLabels = true,\n className,\n animate = true,\n height,\n}: TopProductsBarChartProps) => {\n const chartData = useMemo(() => [...data].sort((a, b) => b.value - a.value).slice(0, maxItems), [data, maxItems]);\n\n const config = useMemo<ChartConfig>(() => ({ value: { label, color } }), [label, color]);\n\n return (\n <ChartContainer\n data-slot=\"top-products-bar-chart\"\n config={config}\n className={cn('w-full', className)}\n style={height !== undefined ? { height, aspectRatio: 'auto' } : undefined}\n >\n <BarChart data={chartData} layout=\"vertical\" margin={{ top: 0, right: showValueLabels ? 48 : 12, bottom: 0, left: 12 }}>\n <XAxis type=\"number\" dataKey=\"value\" hide />\n <YAxis type=\"category\" dataKey=\"name\" tickLine={false} axisLine={false} tickMargin={8} width={120} />\n <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />\n <Bar dataKey=\"value\" fill={color} radius={4} isAnimationActive={animate}>\n {showValueLabels && (\n <LabelList\n dataKey=\"value\"\n position=\"right\"\n offset={8}\n className=\"fill-muted-strong\"\n fontSize={12}\n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AM,EAAG,WAArH,EACE,EAAA,EAAA,IAAA,CAACC,EAAAA,MAAD,CAAO,KAAK,SAAS,QAAQ,QAAQ,KAAA,EAAM,CAAA,GAC3C,EAAA,EAAA,IAAA,CAACC,EAAAA,MAAD,CAAO,KAAK,WAAW,QAAQ,OAAO,SAAU,GAAO,SAAU,GAAO,WAAY,EAAG,MAAO,GAAM,CAAA,GACpG,EAAA,EAAA,IAAA,CAACC,EAAAA,aAAD,CAAc,OAAQ,GAAO,SAAS,EAAA,EAAA,IAAA,CAACC,EAAAA,oBAAD,CAAqB,UAAA,EAAW,CAAA,CAAI,CAAA,GAC1E,EAAA,EAAA,IAAA,CAACC,EAAAA,IAAD,CAAK,QAAQ,QAAQ,KAAM,EAAO,OAAQ,EAAG,kBAAmB,WAC7D,IACC,EAAA,EAAA,IAAA,CAACC,EAAAA,UAAD,CACE,QAAQ,QACR,SAAS,QACT,OAAQ,EACR,UAAU,oBACV,SAAU,GACV,UAAY,GAA2B,EAAe,OAAO,CAAK,CAAC,CACpE,CAAA,CAEA,CAAA,CACG,GACI,CAAA,CAEpB"}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["ChartContainer","ScatterChart","XAxis","YAxis","ChartTooltip","ChartTooltipContent","Scatter","point","ChartContainer","ComposedChart","CartesianGrid","XAxis","YAxis","ChartTooltip","ChartTooltipContent","Bar","ChartContainer","FunnelChart","ChartTooltip","ChartTooltipContent","Funnel","LabelList","ChartContainer","ScatterChart","CartesianGrid","XAxis","YAxis","ZAxis","ChartTooltip","ChartTooltipContent","Scatter","toKey","ChartContainer","PieChart","ChartTooltip","ChartTooltipContent","Pie","Label","ChartLegend","ChartLegendContent","ChartContainer","BarChart","CartesianGrid","XAxis","YAxis","ReferenceLine","ChartTooltip","ChartTooltipContent","Bar","Rectangle","ChartContainer","LineChart","CartesianGrid","XAxis","YAxis","ChartTooltip","ChartTooltipContent","Line","ChartLegend","ChartLegendContent","ChartContainer","RadarChart","PolarGrid","PolarAngleAxis","PolarRadiusAxis","ChartTooltip","ChartTooltipContent","Radar","ChartLegend","ChartLegendContent","ChartContainer","BarChart","CartesianGrid","XAxis","YAxis","ReferenceLine","ChartTooltip","ChartTooltipContent","Bar","ChartLegend","ChartLegendContent","ChartContainer","BarChart","CartesianGrid","XAxis","YAxis","ChartTooltip","ChartTooltipContent","Bar","ChartLegend","ChartLegendContent","ChartContainer","Treemap","ChartTooltip","ChartTooltipContent","ChartContainer","ComposedChart","CartesianGrid","XAxis","YAxis","ChartTooltip","ChartTooltipContent","Area","Line","ChartContainer","AreaChart","CartesianGrid","XAxis","YAxis","ChartTooltip","ChartTooltipContent","Area","ChartLegend","ChartLegendContent","ChartContainer","ComposedChart","CartesianGrid","XAxis","YAxis","ChartTooltip","ChartTooltipContent","Bar","Line","ChartLegend","ChartLegendContent","ChartContainer","RadialBarChart","PolarAngleAxis","RadialBar","PolarRadiusAxis","Label","ChartContainer","Sankey","Rectangle","ResponsiveContainer","LineChart","Line","AreaChart","Area","ChartContainer","AreaChart","CartesianGrid","XAxis","YAxis","ChartTooltip","ChartTooltipContent","Area","ChartLegend","ChartLegendContent","ChartContainer","BarChart","XAxis","YAxis","ChartTooltip","ChartTooltipContent","Bar","LabelList","ChartContainer","BarChart","CartesianGrid","XAxis","YAxis","ChartTooltip","ChartTooltipContent","Bar","Rectangle","ChartContainer","BarChart","CartesianGrid","XAxis","YAxis","ChartTooltip","ChartTooltipContent","Bar","Rectangle"],"sources":["../../../packages/components/features/charts/utils.ts","../../../packages/components/features/charts/components/activity-heatmap-chart.tsx","../../../packages/components/features/charts/components/candlestick-chart.tsx","../../../packages/components/features/charts/components/conversion-funnel-chart.tsx","../../../packages/components/features/charts/components/correlation-scatter-chart.tsx","../../../packages/components/features/charts/components/donut-chart.tsx","../../../packages/components/features/charts/components/gain-loss-bar-chart.tsx","../../../packages/components/features/charts/components/indexed-performance-line-chart.tsx","../../../packages/components/features/charts/components/metric-radar-chart.tsx","../../../packages/components/features/charts/components/mirrored-bar-chart.tsx","../../../packages/components/features/charts/components/orders-bar-chart.tsx","../../../packages/components/features/charts/components/portfolio-allocation-treemap.tsx","../../../packages/components/features/charts/components/price-range-area-chart.tsx","../../../packages/components/features/charts/components/revenue-area-chart.tsx","../../../packages/components/features/charts/components/revenue-orders-composed-chart.tsx","../../../packages/components/features/charts/components/sales-target-radial-chart.tsx","../../../packages/components/features/charts/components/sankey-flow-chart.tsx","../../../packages/components/features/charts/components/sparkline-chart.tsx","../../../packages/components/features/charts/components/stacked-area-chart.tsx","../../../packages/components/features/charts/components/top-products-bar-chart.tsx","../../../packages/components/features/charts/components/volume-bar-chart.tsx","../../../packages/components/features/charts/components/waterfall-chart.tsx"],"sourcesContent":["const CHART_COLOR_COUNT = 8;\n\n/** Cycles through the eight `--chart-N` theme palette variables. */\nexport const getChartColor = (index: number): string => `var(--chart-${(((index % CHART_COLOR_COUNT) + CHART_COLOR_COUNT) % CHART_COLOR_COUNT) + 1})`;\n\nexport const formatCompactNumber = (value: number, locale = 'en-US'): string =>\n new Intl.NumberFormat(locale, { notation: 'compact', maximumFractionDigits: 1 }).format(value);\n\nexport const formatCurrency = (value: number, currency = 'USD', locale = 'en-US'): string =>\n new Intl.NumberFormat(locale, {\n style: 'currency',\n currency,\n notation: Math.abs(value) >= 10_000 ? 'compact' : 'standard',\n maximumFractionDigits: Math.abs(value) >= 10_000 ? 1 : 0,\n }).format(value);\n\nexport const formatPercent = (value: number, locale = 'en-US'): string =>\n new Intl.NumberFormat(locale, { style: 'percent', maximumFractionDigits: 1 }).format(value);\n\nexport const toDateLabel = (date: string | Date, locale = 'en-US'): string => {\n const parsed = date instanceof Date ? date : new Date(date);\n if (Number.isNaN(parsed.getTime())) return String(date);\n return parsed.toLocaleDateString(locale, { month: 'short', day: 'numeric' });\n};\n\n/** Picks an up/down color by comparing `current` against `reference` (e.g. close vs. open, or vs. zero). */\nexport const getDirectionColor = (current: number, reference: number, colors?: { up?: string; down?: string }): string =>\n current >= reference ? (colors?.up ?? 'var(--success)') : (colors?.down ?? 'var(--danger)');\n\nexport const formatSignedPercent = (value: number, locale = 'en-US'): string => {\n const formatted = new Intl.NumberFormat(locale, { style: 'percent', maximumFractionDigits: 1, signDisplay: 'exceptZero' }).format(value);\n return formatted;\n};\n\n/**\n * Normalizes each of `seriesKeys` in `data` to a common `base` value at its first defined point,\n * so relative performance across series with different price scales becomes directly comparable.\n */\nexport const computeIndexedSeries = <T extends { date: string | Date } & Record<string, unknown>>(\n data: readonly T[],\n seriesKeys: readonly string[],\n base = 100\n): Array<Record<string, string | Date | number>> => {\n const baseValues: Record<string, number | undefined> = {};\n for (const key of seriesKeys) {\n const first = data.find(point => typeof point[key] === 'number')?.[key] as number | undefined;\n baseValues[key] = first;\n }\n\n return data.map(point => {\n const indexed: Record<string, number> = {};\n for (const key of seriesKeys) {\n const raw = point[key];\n const baseValue = baseValues[key];\n indexed[key] = typeof raw === 'number' && baseValue ? (raw / baseValue) * base : Number.NaN;\n }\n return { date: point.date, ...indexed };\n });\n};\n","'use client';\n\nimport { useMemo } from 'react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { type ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from '@/components/ui/chart';\n\nimport { Scatter, ScatterChart, XAxis, YAxis } from 'recharts';\nimport type { ActivityPoint, BaseChartProps } from '../types';\nimport { toDateLabel } from '../utils';\n\nconst WEEKDAY_LABELS = ['S', 'M', 'T', 'W', 'T', 'F', 'S'];\nconst CELL_SIZE = 13;\nconst MS_PER_DAY = 86_400_000;\n\nexport type ActivityHeatmapChartProps = BaseChartProps & {\n data: ActivityPoint[];\n /** Series label used in the theme config. Defaults to `'Activity'`. */\n label?: string;\n color?: string;\n valueFormatter?: (value: number) => string;\n};\n\n/**\n * A GitHub-style calendar heatmap for daily activity/usage intensity — logins, orders, commits\n * per day — laid out as a week-by-weekday grid with color opacity mapped to value.\n *\n * @example\n * ```tsx\n * import { ActivityHeatmapChart } from '@customafk/lunas-ui/features/charts';\n *\n * <ActivityHeatmapChart\n * data={[\n * { date: '2026-06-01', value: 4 },\n * { date: '2026-06-02', value: 12 },\n * ]}\n * />\n * ```\n */\nexport const ActivityHeatmapChart = ({\n data,\n label = 'Activity',\n color = 'var(--chart-1)',\n valueFormatter = value => value.toLocaleString('en-US'),\n className,\n height,\n}: ActivityHeatmapChartProps) => {\n const config = useMemo<ChartConfig>(() => ({ value: { label, color } }), [label, color]);\n\n const { chartData, monthTicks, maxWeek, maxValue } = useMemo(() => {\n const parsed = data\n .map(point => ({ ...point, parsedDate: point.date instanceof Date ? point.date : new Date(point.date) }))\n .sort((a, b) => a.parsedDate.getTime() - b.parsedDate.getTime());\n\n if (parsed.length === 0) return { chartData: [], monthTicks: new Map<number, string>(), maxWeek: 0, maxValue: 1 };\n\n const firstDate = parsed[0]?.parsedDate;\n const weekStart = new Date(firstDate);\n weekStart.setDate(weekStart.getDate() - weekStart.getDay());\n\n const months = new Map<number, string>();\n let lastMonth = -1;\n\n const points = parsed.map(point => {\n const weekday = point.parsedDate.getDay();\n const weekIndex = Math.floor((point.parsedDate.getTime() - weekStart.getTime()) / MS_PER_DAY / 7);\n const month = point.parsedDate.getMonth();\n if (month !== lastMonth) {\n months.set(weekIndex, point.parsedDate.toLocaleDateString('en-US', { month: 'short' }));\n lastMonth = month;\n }\n return { x: weekIndex, y: weekday, value: point.value, date: point.date };\n });\n\n return {\n chartData: points,\n monthTicks: months,\n maxWeek: Math.max(...points.map(point => point.x)),\n maxValue: Math.max(...points.map(point => point.value), 1),\n };\n }, [data]);\n\n return (\n <ChartContainer\n data-slot=\"activity-heatmap-chart\"\n config={config}\n className={cn('w-full', className)}\n style={height !== undefined ? { height, aspectRatio: 'auto' } : undefined}\n >\n <ScatterChart margin={{ top: 8, right: 12, bottom: 0, left: 0 }}>\n <XAxis\n type=\"number\"\n dataKey=\"x\"\n domain={[-0.5, maxWeek + 0.5]}\n ticks={Array.from(monthTicks.keys())}\n tickFormatter={x => monthTicks.get(x) ?? ''}\n tickLine={false}\n axisLine={false}\n tickMargin={8}\n interval={0}\n />\n <YAxis\n type=\"number\"\n dataKey=\"y\"\n domain={[-0.5, 6.5]}\n reversed\n ticks={[0, 1, 2, 3, 4, 5, 6]}\n tickFormatter={y => WEEKDAY_LABELS[y] ?? ''}\n tickLine={false}\n axisLine={false}\n width={20}\n interval={0}\n />\n <ChartTooltip\n cursor={false}\n content={\n <ChartTooltipContent\n hideLabel\n hideIndicator\n formatter={(_value, _name, item) => {\n const point = item.payload as { date: string | Date; value: number };\n return (\n <div className=\"grid gap-0.5\">\n <span className=\"font-medium text-muted-strong\">{toDateLabel(point.date)}</span>\n <span className=\"text-muted\">\n {valueFormatter(point.value)} {config.value?.label}\n </span>\n </div>\n );\n }}\n />\n }\n />\n <Scatter\n data={chartData}\n shape={props => {\n const { cx, cy, payload } = props;\n if (cx === undefined || cy === undefined) return <g />;\n const point = payload as { value: number };\n const intensity = Math.min(0.12 + 0.88 * (point.value / maxValue), 1);\n return <rect x={cx - CELL_SIZE / 2} y={cy - CELL_SIZE / 2} width={CELL_SIZE} height={CELL_SIZE} rx={3} fill={color} fillOpacity={intensity} />;\n }}\n />\n </ScatterChart>\n </ChartContainer>\n );\n};\n","'use client';\n\nimport { useMemo } from 'react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { type ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from '@/components/ui/chart';\n\nimport { Bar, CartesianGrid, ComposedChart, useXAxisScale, useYAxisScale, XAxis, YAxis } from 'recharts';\nimport type { BaseChartProps, OHLCPoint } from '../types';\nimport { getDirectionColor, toDateLabel } from '../utils';\n\ntype CandlestickSeriesProps = {\n data: OHLCPoint[];\n upColor: string;\n downColor: string;\n};\n\n/** Draws candle wicks + bodies directly against the chart's computed axis scales (recharts v3 pattern). */\nconst CandlestickSeries = ({ data, upColor, downColor }: CandlestickSeriesProps) => {\n const xScale = useXAxisScale();\n const yScale = useYAxisScale();\n\n if (!xScale || !yScale) return null;\n\n return (\n <g>\n {data.map(point => {\n const xStart = xScale(point.date, { position: 'start' });\n const xEnd = xScale(point.date, { position: 'end' });\n const yHigh = yScale(point.high);\n const yLow = yScale(point.low);\n const yOpen = yScale(point.open);\n const yClose = yScale(point.close);\n if (xStart === undefined || xEnd === undefined || yHigh === undefined || yLow === undefined || yOpen === undefined || yClose === undefined) {\n return null;\n }\n\n const bandWidth = xEnd - xStart;\n const bodyWidth = Math.max(bandWidth * 0.6, 2);\n const xCenter = xStart + bandWidth / 2;\n const color = getDirectionColor(point.close, point.open, { up: upColor, down: downColor });\n const bodyTop = Math.min(yOpen, yClose);\n const bodyHeight = Math.max(Math.abs(yClose - yOpen), 1);\n\n return (\n <g key={`${point.date}`}>\n <line x1={xCenter} x2={xCenter} y1={yHigh} y2={yLow} stroke={color} strokeWidth={1} />\n <rect x={xCenter - bodyWidth / 2} y={bodyTop} width={bodyWidth} height={bodyHeight} fill={color} />\n </g>\n );\n })}\n </g>\n );\n};\n\nexport type CandlestickChartProps = BaseChartProps & {\n data: OHLCPoint[];\n /** Series label used in the theme config. Defaults to `'Price'`. */\n label?: string;\n upColor?: string;\n downColor?: string;\n valueFormatter?: (value: number) => string;\n dateFormatter?: (date: string | Date) => string;\n showGrid?: boolean;\n};\n\n/**\n * A stock candlestick chart — open/high/low/close per period, green/red bodies, high-low wicks.\n * Recharts has no native candlestick type, so bodies and wicks are drawn against the chart's\n * computed axis scales via `useXAxisScale`/`useYAxisScale` (recharts v3).\n *\n * @example\n * ```tsx\n * import { CandlestickChart } from '@customafk/lunas-ui/features/charts';\n *\n * <CandlestickChart\n * data={[\n * { date: '2026-06-01', open: 140, high: 146.2, low: 138.5, close: 144.9 },\n * { date: '2026-06-02', open: 144.9, high: 145.6, low: 141.2, close: 142.1 },\n * ]}\n * />\n * ```\n */\nexport const CandlestickChart = ({\n data,\n label = 'Price',\n upColor = 'var(--success)',\n downColor = 'var(--danger)',\n valueFormatter = value => value.toLocaleString('en-US'),\n dateFormatter = toDateLabel,\n showGrid = true,\n className,\n animate = true,\n height,\n}: CandlestickChartProps) => {\n const config = useMemo<ChartConfig>(() => ({ close: { label, color: upColor } }), [label, upColor]);\n\n const yDomain = useMemo<[number, number]>(() => {\n if (data.length === 0) return [0, 1];\n const min = Math.min(...data.map(point => point.low));\n const max = Math.max(...data.map(point => point.high));\n const padding = (max - min) * 0.08 || Math.max(max, 1) * 0.08;\n return [min - padding, max + padding];\n }, [data]);\n\n return (\n <ChartContainer\n data-slot=\"candlestick-chart\"\n config={config}\n className={cn('w-full', className)}\n style={height !== undefined ? { height, aspectRatio: 'auto' } : undefined}\n >\n <ComposedChart data={data} margin={{ top: 8, right: 12, bottom: 0, left: 12 }}>\n {showGrid && <CartesianGrid vertical={false} />}\n <XAxis dataKey=\"date\" tickLine={false} axisLine={false} tickMargin={8} tickFormatter={dateFormatter} />\n <YAxis domain={yDomain} tickLine={false} axisLine={false} tickMargin={8} width={64} tickFormatter={valueFormatter} />\n <ChartTooltip\n cursor={false}\n content={\n <ChartTooltipContent\n hideIndicator\n labelFormatter={(_, payload) => {\n const date = payload?.[0]?.payload?.date;\n return date ? dateFormatter(date) : null;\n }}\n formatter={(_value, _name, item) => {\n const point = item.payload as OHLCPoint;\n return (\n <div className=\"grid gap-0.5\">\n <span className=\"text-muted\">\n O <span className=\"font-number text-text-positive-strong\">{valueFormatter(point.open)}</span> H{' '}\n <span className=\"font-number text-text-positive-strong\">{valueFormatter(point.high)}</span>\n </span>\n <span className=\"text-muted\">\n L <span className=\"font-number text-text-positive-strong\">{valueFormatter(point.low)}</span> C{' '}\n <span className=\"font-number text-text-positive-strong\">{valueFormatter(point.close)}</span>\n </span>\n </div>\n );\n }}\n />\n }\n />\n {/* Invisible series so the Tooltip has a graphical item to attach to; payload still carries the full OHLC row. */}\n <Bar dataKey=\"close\" fill=\"transparent\" isAnimationActive={animate} />\n <CandlestickSeries data={data} upColor={upColor} downColor={downColor} />\n </ComposedChart>\n </ChartContainer>\n );\n};\n","'use client';\n\nimport { useMemo } from 'react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { type ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from '@/components/ui/chart';\n\nimport { Funnel, FunnelChart, LabelList } from 'recharts';\nimport type { BaseChartProps, NamedValue } from '../types';\nimport { formatCompactNumber, formatPercent, getChartColor } from '../utils';\n\nexport type FunnelStage = NamedValue & {\n /** Config key; derived from `name` when omitted. */\n key?: string;\n color?: string;\n};\n\nexport type ConversionFunnelChartProps = BaseChartProps & {\n /** Funnel stages ordered top (widest) to bottom. */\n data: FunnelStage[];\n /** Appends each stage's percentage of the first stage. Defaults to `true`. */\n showConversionRates?: boolean;\n valueFormatter?: (value: number) => string;\n};\n\n/**\n * A conversion funnel for the ecommerce purchase journey — sessions, product views, carts,\n * checkouts, purchases — with per-stage conversion rates against the first stage.\n *\n * @example\n * ```tsx\n * import { ConversionFunnelChart } from '@customafk/lunas-ui/features/charts';\n *\n * <ConversionFunnelChart\n * data={[\n * { name: 'Sessions', value: 50000 },\n * { name: 'Product views', value: 32000 },\n * { name: 'Added to cart', value: 8400 },\n * { name: 'Purchased', value: 2900 },\n * ]}\n * />\n * ```\n */\nexport const ConversionFunnelChart = ({\n data,\n showConversionRates = true,\n valueFormatter = formatCompactNumber,\n className,\n animate = true,\n height,\n}: ConversionFunnelChartProps) => {\n const { chartData, config } = useMemo(() => {\n const first = data[0]?.value ?? 0;\n const entries = data.map((stage, index) => {\n const rate = first === 0 ? 0 : stage.value / first;\n const valueLabel = showConversionRates ? `${valueFormatter(stage.value)} (${formatPercent(rate)})` : valueFormatter(stage.value);\n return {\n ...stage,\n key: stage.key || stage.name.toLowerCase().replace(/[^a-z0-9]+/g, '-'),\n fill: stage.color || getChartColor(index),\n valueLabel,\n };\n });\n const chartConfig: ChartConfig = Object.fromEntries(entries.map(entry => [entry.key, { label: entry.name, color: entry.fill }]));\n return { chartData: entries, config: chartConfig };\n }, [data, showConversionRates, valueFormatter]);\n\n return (\n <ChartContainer\n data-slot=\"conversion-funnel-chart\"\n config={config}\n className={cn('w-full', className)}\n style={height !== undefined ? { height, aspectRatio: 'auto' } : undefined}\n >\n <FunnelChart margin={{ top: 8, right: 120, bottom: 8, left: 120 }}>\n <ChartTooltip content={<ChartTooltipContent nameKey=\"key\" hideLabel />} />\n <Funnel dataKey=\"value\" data={chartData} isAnimationActive={animate}>\n <LabelList dataKey=\"name\" position=\"left\" offset={12} className=\"fill-muted-strong\" fontSize={12} />\n <LabelList dataKey=\"valueLabel\" position=\"right\" offset={12} className=\"fill-text-positive-strong font-number\" fontSize={12} />\n </Funnel>\n </FunnelChart>\n </ChartContainer>\n );\n};\n","'use client';\n\nimport { useMemo } from 'react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { type ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from '@/components/ui/chart';\n\nimport { CartesianGrid, Scatter, ScatterChart, XAxis, YAxis, ZAxis } from 'recharts';\nimport type { BaseChartProps, ScatterPoint } from '../types';\n\nexport type CorrelationScatterChartProps = BaseChartProps & {\n data: ScatterPoint[];\n /** Series label used in the theme config. Defaults to `'Points'`. */\n label?: string;\n color?: string;\n xLabel?: string;\n yLabel?: string;\n xFormatter?: (value: number) => string;\n yFormatter?: (value: number) => string;\n /** Sizes each point from its `z` value. Defaults to `false`. */\n showBubbleSize?: boolean;\n showGrid?: boolean;\n};\n\n/**\n * A scatter (or bubble, with `showBubbleSize`) chart for correlating two metrics, with an\n * optional third dimension mapped to point size.\n *\n * @example\n * ```tsx\n * import { CorrelationScatterChart } from '@customafk/lunas-ui/features/charts';\n *\n * <CorrelationScatterChart\n * data={[\n * { x: 12, y: 4200, z: 40, name: 'Product A' },\n * { x: 18, y: 5100, z: 65, name: 'Product B' },\n * ]}\n * xLabel=\"Price ($)\"\n * yLabel=\"Units sold\"\n * showBubbleSize\n * />\n * ```\n */\nexport const CorrelationScatterChart = ({\n data,\n label = 'Points',\n color = 'var(--chart-1)',\n xLabel,\n yLabel,\n xFormatter = value => value.toLocaleString('en-US'),\n yFormatter = value => value.toLocaleString('en-US'),\n showBubbleSize = false,\n showGrid = true,\n className,\n animate = true,\n height,\n}: CorrelationScatterChartProps) => {\n const config = useMemo<ChartConfig>(() => ({ y: { label, color } }), [label, color]);\n\n return (\n <ChartContainer\n data-slot=\"correlation-scatter-chart\"\n config={config}\n className={cn('w-full', className)}\n style={height !== undefined ? { height, aspectRatio: 'auto' } : undefined}\n >\n <ScatterChart margin={{ top: 8, right: 12, bottom: 0, left: 12 }}>\n {showGrid && <CartesianGrid />}\n <XAxis type=\"number\" dataKey=\"x\" name={xLabel} tickLine={false} axisLine={false} tickMargin={8} tickFormatter={xFormatter} />\n <YAxis type=\"number\" dataKey=\"y\" name={yLabel} tickLine={false} axisLine={false} tickMargin={8} width={64} tickFormatter={yFormatter} />\n {showBubbleSize && <ZAxis type=\"number\" dataKey=\"z\" range={[64, 400]} />}\n <ChartTooltip\n cursor={{ strokeDasharray: '3 3' }}\n content={\n <ChartTooltipContent\n hideLabel\n formatter={(_value, _name, item) => {\n const point = item.payload as ScatterPoint;\n return (\n <div className=\"grid gap-0.5\">\n {point.name && <span className=\"font-medium text-muted-strong\">{point.name}</span>}\n <span className=\"text-muted\">\n {xLabel || 'x'}: <span className=\"font-medium font-number text-text-positive-strong\">{xFormatter(point.x)}</span>\n </span>\n <span className=\"text-muted\">\n {yLabel || 'y'}: <span className=\"font-medium font-number text-text-positive-strong\">{yFormatter(point.y)}</span>\n </span>\n </div>\n );\n }}\n />\n }\n />\n <Scatter data={data} fill={color} isAnimationActive={animate} />\n </ScatterChart>\n </ChartContainer>\n );\n};\n","'use client';\n\nimport { useMemo } from 'react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { type ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartTooltip, ChartTooltipContent } from '@/components/ui/chart';\n\nimport { Label, Pie, PieChart } from 'recharts';\nimport type { BaseChartProps, NamedValue } from '../types';\nimport { formatCompactNumber, getChartColor } from '../utils';\n\nexport type DonutChartSegment = NamedValue & {\n /** Config key; derived from `name` when omitted. */\n key?: string;\n color?: string;\n};\n\nexport type DonutChartProps = BaseChartProps & {\n data: DonutChartSegment[];\n /** Text under the center total, e.g. `'Total sales'`. */\n centerLabel?: string;\n /** Formats the center total. Defaults to compact notation. */\n centerValueFormatter?: (total: number) => string;\n /** Overrides the computed segment sum shown in the center. */\n totalValue?: number;\n showLegend?: boolean;\n showCenterTotal?: boolean;\n};\n\nconst toKey = (segment: DonutChartSegment): string => segment.key || segment.name.toLowerCase().replace(/[^a-z0-9]+/g, '-');\n\n/**\n * A donut breakdown chart with a center total — category sales, traffic sources, payment methods.\n *\n * @example\n * ```tsx\n * import { DonutChart } from '@customafk/lunas-ui/features/charts';\n *\n * <DonutChart\n * data={[\n * { name: 'Fashion', value: 12400 },\n * { name: 'Electronics', value: 8200 },\n * ]}\n * centerLabel=\"Total sales\"\n * />\n * ```\n */\nexport const DonutChart = ({\n data,\n centerLabel,\n centerValueFormatter = formatCompactNumber,\n totalValue,\n showLegend = true,\n showCenterTotal = true,\n className,\n animate = true,\n height,\n}: DonutChartProps) => {\n const { chartData, config, total } = useMemo(() => {\n const entries = data.map((segment, index) => ({\n ...segment,\n key: toKey(segment),\n fill: segment.color || getChartColor(index),\n }));\n const chartConfig: ChartConfig = Object.fromEntries(entries.map(entry => [entry.key, { label: entry.name, color: entry.fill }]));\n return {\n chartData: entries,\n config: chartConfig,\n total: totalValue ?? data.reduce((sum, segment) => sum + segment.value, 0),\n };\n }, [data, totalValue]);\n\n return (\n <ChartContainer\n data-slot=\"donut-chart\"\n config={config}\n className={cn('mx-auto', height === undefined && 'aspect-square', className)}\n style={height !== undefined ? { height, aspectRatio: 'auto' } : undefined}\n >\n <PieChart>\n <ChartTooltip cursor={false} content={<ChartTooltipContent nameKey=\"key\" hideLabel />} />\n <Pie data={chartData} dataKey=\"value\" nameKey=\"key\" innerRadius=\"60%\" strokeWidth={5} isAnimationActive={animate}>\n {showCenterTotal && (\n <Label\n content={({ viewBox }) => {\n if (!viewBox || !('cx' in viewBox) || !('cy' in viewBox)) return null;\n return (\n <text x={viewBox.cx} y={viewBox.cy} textAnchor=\"middle\" dominantBaseline=\"middle\">\n <tspan x={viewBox.cx} y={viewBox.cy} className=\"fill-text-positive-strong font-number text-2xl font-bold\">\n {centerValueFormatter(total)}\n </tspan>\n {centerLabel && (\n <tspan x={viewBox.cx} y={(viewBox.cy || 0) + 22} className=\"fill-muted text-xs\">\n {centerLabel}\n </tspan>\n )}\n </text>\n );\n }}\n />\n )}\n </Pie>\n {showLegend && <ChartLegend content={<ChartLegendContent nameKey=\"key\" />} />}\n </PieChart>\n </ChartContainer>\n );\n};\n","'use client';\n\nimport { useMemo } from 'react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { type ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from '@/components/ui/chart';\n\nimport { Bar, BarChart, CartesianGrid, Rectangle, ReferenceLine, XAxis, YAxis } from 'recharts';\nimport type { BaseChartProps, NamedValue } from '../types';\nimport { formatSignedPercent, getDirectionColor } from '../utils';\n\nexport type GainLossBarChartProps = BaseChartProps & {\n /** `name` is the period label (e.g. a month or quarter); `value` is the signed return. */\n data: NamedValue[];\n /** Series label. Defaults to `'Return'`. */\n label?: string;\n upColor?: string;\n downColor?: string;\n /** Formats tooltip and Y-axis values. Defaults to a signed percentage. */\n valueFormatter?: (value: number) => string;\n showGrid?: boolean;\n};\n\n/**\n * Diverging bars for period returns — bars grow up (gain) or down (loss) from a zero baseline,\n * colored accordingly. Clearer than a plain bar chart for signed data.\n *\n * @example\n * ```tsx\n * import { GainLossBarChart } from '@customafk/lunas-ui/features/charts';\n *\n * <GainLossBarChart\n * data={[\n * { name: 'Jan', value: 0.032 },\n * { name: 'Feb', value: -0.014 },\n * ]}\n * />\n * ```\n */\nexport const GainLossBarChart = ({\n data,\n label = 'Return',\n upColor = 'var(--success)',\n downColor = 'var(--danger)',\n valueFormatter = value => formatSignedPercent(value),\n showGrid = true,\n className,\n animate = true,\n height,\n}: GainLossBarChartProps) => {\n const config = useMemo<ChartConfig>(() => ({ value: { label, color: upColor } }), [label, upColor]);\n\n return (\n <ChartContainer\n data-slot=\"gain-loss-bar-chart\"\n config={config}\n className={cn('w-full', className)}\n style={height !== undefined ? { height, aspectRatio: 'auto' } : undefined}\n >\n <BarChart data={data} margin={{ top: 8, right: 12, bottom: 0, left: 12 }}>\n {showGrid && <CartesianGrid vertical={false} />}\n <XAxis dataKey=\"name\" tickLine={false} axisLine={false} tickMargin={8} />\n <YAxis tickLine={false} axisLine={false} tickMargin={8} width={56} tickFormatter={valueFormatter} />\n <ReferenceLine y={0} stroke=\"var(--border)\" />\n <ChartTooltip cursor={false} content={<ChartTooltipContent hideIndicator formatter={value => valueFormatter(Number(value))} />} />\n <Bar\n dataKey=\"value\"\n isAnimationActive={animate}\n shape={props => <Rectangle {...props} fill={getDirectionColor(Number(props.payload?.value ?? 0), 0, { up: upColor, down: downColor })} />}\n />\n </BarChart>\n </ChartContainer>\n );\n};\n","'use client';\n\nimport { useMemo } from 'react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { type ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartTooltip, ChartTooltipContent } from '@/components/ui/chart';\n\nimport { CartesianGrid, Line, LineChart, XAxis, YAxis } from 'recharts';\nimport type { BaseChartProps, ChartSeries } from '../types';\nimport { computeIndexedSeries, formatSignedPercent, getChartColor, toDateLabel } from '../utils';\n\nexport type IndexedPerformanceLineChartProps = BaseChartProps & {\n data: Array<{ date: string | Date } & Record<string, unknown>>;\n /** One entry per instrument/fund to compare. */\n series: ChartSeries[];\n /** The value every series is normalized to at its first data point. Defaults to `100`. */\n base?: number;\n /** Formats tooltip and Y-axis values. Defaults to signed % change from `base`. */\n valueFormatter?: (indexedValue: number, base: number) => string;\n dateFormatter?: (date: string | Date) => string;\n showLegend?: boolean;\n showGrid?: boolean;\n};\n\n/**\n * A multi-line chart normalizing several instruments to a common base (default 100) at the\n * start of the period, so relative performance is directly comparable regardless of price scale.\n *\n * @example\n * ```tsx\n * import { IndexedPerformanceLineChart } from '@customafk/lunas-ui/features/charts';\n *\n * <IndexedPerformanceLineChart\n * data={[\n * { date: '2026-06-01', aapl: 142.5, spy: 512.1 },\n * { date: '2026-06-02', aapl: 145.1, spy: 515.8 },\n * ]}\n * series={[\n * { key: 'aapl', label: 'AAPL' },\n * { key: 'spy', label: 'S&P 500' },\n * ]}\n * />\n * ```\n */\nexport const IndexedPerformanceLineChart = ({\n data,\n series,\n base = 100,\n valueFormatter = (indexedValue, indexBase) => formatSignedPercent(indexedValue / indexBase - 1),\n dateFormatter = toDateLabel,\n showLegend = true,\n showGrid = true,\n className,\n animate = true,\n height,\n}: IndexedPerformanceLineChartProps) => {\n const seriesKeys = useMemo(() => series.map(item => item.key), [series]);\n\n const chartData = useMemo(() => computeIndexedSeries(data, seriesKeys, base), [data, seriesKeys, base]);\n\n const config = useMemo<ChartConfig>(\n () => Object.fromEntries(series.map((item, index) => [item.key, { label: item.label, color: item.color || getChartColor(index) }])),\n [series]\n );\n\n return (\n <ChartContainer\n data-slot=\"indexed-performance-line-chart\"\n config={config}\n className={cn('w-full', className)}\n style={height !== undefined ? { height, aspectRatio: 'auto' } : undefined}\n >\n <LineChart data={chartData} margin={{ top: 8, right: 12, bottom: 0, left: 12 }}>\n {showGrid && <CartesianGrid vertical={false} />}\n <XAxis dataKey=\"date\" tickLine={false} axisLine={false} tickMargin={8} tickFormatter={dateFormatter} />\n <YAxis\n tickLine={false}\n axisLine={false}\n tickMargin={8}\n width={56}\n domain={['auto', 'auto']}\n tickFormatter={value => valueFormatter(Number(value), base)}\n />\n <ChartTooltip\n content={\n <ChartTooltipContent\n labelFormatter={(_, payload) => {\n const date = payload?.[0]?.payload?.date;\n return date ? dateFormatter(date) : null;\n }}\n formatter={(value, name, item) => (\n <>\n <div className=\"size-2.5 shrink-0 rounded-[2px]\" style={{ backgroundColor: item.color }} />\n <span className=\"text-muted\">{config[String(name)]?.label || name}</span>\n <span className=\"ml-auto font-medium font-number text-text-positive-strong tabular-nums\">{valueFormatter(Number(value), base)}</span>\n </>\n )}\n />\n }\n />\n {series.map((item, index) => (\n <Line\n key={item.key}\n type=\"natural\"\n dataKey={item.key}\n stroke={item.color || getChartColor(index)}\n strokeWidth={2}\n dot={false}\n isAnimationActive={animate}\n />\n ))}\n {showLegend && <ChartLegend content={<ChartLegendContent />} />}\n </LineChart>\n </ChartContainer>\n );\n};\n","'use client';\n\nimport { useMemo } from 'react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { type ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartTooltip, ChartTooltipContent } from '@/components/ui/chart';\n\nimport { PolarAngleAxis, PolarGrid, PolarRadiusAxis, Radar, RadarChart } from 'recharts';\nimport type { BaseChartProps, ChartSeries } from '../types';\nimport { getChartColor } from '../utils';\n\nexport type MetricRadarChartProps = BaseChartProps & {\n data: Array<{ metric: string } & Record<string, unknown>>;\n /** One entry per entity being compared (e.g. a candidate, a product, a team). */\n series: ChartSeries[];\n valueFormatter?: (value: number) => string;\n /** Radius-axis domain. Defaults to `['auto', 'auto']`. */\n domain?: [number | 'auto', number | 'auto'];\n showLegend?: boolean;\n};\n\n/**\n * A radar chart comparing one or more entities across several metrics/dimensions — performance\n * review scores, feature comparisons, skill matrices.\n *\n * @example\n * ```tsx\n * import { MetricRadarChart } from '@customafk/lunas-ui/features/charts';\n *\n * <MetricRadarChart\n * data={[\n * { metric: 'Speed', teamA: 80, teamB: 65 },\n * { metric: 'Quality', teamA: 70, teamB: 90 },\n * { metric: 'Cost', teamA: 60, teamB: 75 },\n * ]}\n * series={[\n * { key: 'teamA', label: 'Team A' },\n * { key: 'teamB', label: 'Team B' },\n * ]}\n * />\n * ```\n */\nexport const MetricRadarChart = ({\n data,\n series,\n valueFormatter = value => value.toLocaleString('en-US'),\n domain = ['auto', 'auto'],\n showLegend = true,\n className,\n animate = true,\n height,\n}: MetricRadarChartProps) => {\n const config = useMemo<ChartConfig>(\n () => Object.fromEntries(series.map((item, index) => [item.key, { label: item.label, color: item.color || getChartColor(index) }])),\n [series]\n );\n\n return (\n <ChartContainer\n data-slot=\"metric-radar-chart\"\n config={config}\n className={cn('mx-auto', height === undefined && 'aspect-square', className)}\n style={height !== undefined ? { height, aspectRatio: 'auto' } : undefined}\n >\n <RadarChart data={data}>\n <PolarGrid />\n <PolarAngleAxis dataKey=\"metric\" tick={{ fontSize: 12 }} />\n <PolarRadiusAxis domain={domain} tick={false} axisLine={false} />\n <ChartTooltip content={<ChartTooltipContent formatter={value => valueFormatter(Number(value))} />} />\n {series.map((item, index) => {\n const color = item.color || getChartColor(index);\n return <Radar key={item.key} dataKey={item.key} stroke={color} fill={color} fillOpacity={0.25} isAnimationActive={animate} />;\n })}\n {showLegend && <ChartLegend content={<ChartLegendContent />} />}\n </RadarChart>\n </ChartContainer>\n );\n};\n","'use client';\n\nimport { useMemo } from 'react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { type ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartTooltip, ChartTooltipContent } from '@/components/ui/chart';\n\nimport { Bar, BarChart, CartesianGrid, ReferenceLine, XAxis, YAxis } from 'recharts';\nimport type { BaseChartProps } from '../types';\n\nexport type MirroredBarRow = {\n category: string;\n left: number;\n right: number;\n};\n\nexport type MirroredBarChartProps = BaseChartProps & {\n data: MirroredBarRow[];\n leftLabel?: string;\n rightLabel?: string;\n leftColor?: string;\n rightColor?: string;\n valueFormatter?: (value: number) => string;\n showLegend?: boolean;\n showGrid?: boolean;\n};\n\n/**\n * A two-sided horizontal bar comparison (population-pyramid style) — this period vs. last\n * period, male vs. female, before vs. after — mirrored around a shared zero baseline.\n *\n * @example\n * ```tsx\n * import { MirroredBarChart } from '@customafk/lunas-ui/features/charts';\n *\n * <MirroredBarChart\n * data={[\n * { category: '18-24', left: 1200, right: 1400 },\n * { category: '25-34', left: 2600, right: 2100 },\n * ]}\n * leftLabel=\"Male\"\n * rightLabel=\"Female\"\n * />\n * ```\n */\nexport const MirroredBarChart = ({\n data,\n leftLabel = 'Left',\n rightLabel = 'Right',\n leftColor = 'var(--chart-1)',\n rightColor = 'var(--chart-4)',\n valueFormatter = value => value.toLocaleString('en-US'),\n showLegend = true,\n showGrid = true,\n className,\n animate = true,\n height,\n}: MirroredBarChartProps) => {\n const config = useMemo<ChartConfig>(\n () => ({ left: { label: leftLabel, color: leftColor }, right: { label: rightLabel, color: rightColor } }),\n [leftLabel, leftColor, rightLabel, rightColor]\n );\n\n const chartData = useMemo(() => data.map(row => ({ category: row.category, left: -row.left, right: row.right, originalLeft: row.left })), [data]);\n\n const axisFormatter = (value: number) => valueFormatter(Math.abs(value));\n\n return (\n <ChartContainer\n data-slot=\"mirrored-bar-chart\"\n config={config}\n className={cn('w-full', className)}\n style={height !== undefined ? { height, aspectRatio: 'auto' } : undefined}\n >\n <BarChart data={chartData} layout=\"vertical\" margin={{ top: 8, right: 12, bottom: 0, left: 12 }}>\n {showGrid && <CartesianGrid horizontal={false} />}\n <XAxis type=\"number\" tickLine={false} axisLine={false} tickMargin={8} tickFormatter={axisFormatter} />\n <YAxis type=\"category\" dataKey=\"category\" tickLine={false} axisLine={false} tickMargin={8} width={64} />\n <ReferenceLine x={0} stroke=\"var(--border)\" />\n <ChartTooltip\n content={\n <ChartTooltipContent\n formatter={(value, name, item) => {\n const isLeft = name === 'left';\n const rawValue = isLeft ? item.payload.originalLeft : Number(value);\n return (\n <>\n <div className=\"size-2.5 shrink-0 rounded-[2px]\" style={{ backgroundColor: item.color }} />\n <span className=\"text-muted\">{isLeft ? leftLabel : rightLabel}</span>\n <span className=\"ml-auto font-medium font-number text-text-positive-strong tabular-nums\">{valueFormatter(rawValue)}</span>\n </>\n );\n }}\n />\n }\n />\n <Bar dataKey=\"left\" fill={leftColor} radius={[4, 0, 0, 4]} isAnimationActive={animate} />\n <Bar dataKey=\"right\" fill={rightColor} radius={[0, 4, 4, 0]} isAnimationActive={animate} />\n {showLegend && <ChartLegend content={<ChartLegendContent />} />}\n </BarChart>\n </ChartContainer>\n );\n};\n","'use client';\n\nimport { useMemo } from 'react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { type ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartTooltip, ChartTooltipContent } from '@/components/ui/chart';\n\nimport { Bar, BarChart, CartesianGrid, XAxis, YAxis } from 'recharts';\nimport type { BaseChartProps, ChartSeries } from '../types';\nimport { getChartColor, toDateLabel } from '../utils';\n\nexport type OrdersBarChartProps = BaseChartProps & {\n data: Array<{ date: string | Date } & Record<string, unknown>>;\n /** Simple mode: the key holding each period's count. Defaults to `'orders'`. */\n dataKey?: string;\n /** Series label in simple mode. Defaults to `'Orders'`. */\n label?: string;\n /** Stacked mode: one series per order status; each `key` indexes into the data rows. */\n statuses?: ChartSeries[];\n color?: string;\n valueFormatter?: (value: number) => string;\n dateFormatter?: (date: string | Date) => string;\n /** Defaults to `true` when `statuses` is provided. */\n showLegend?: boolean;\n showGrid?: boolean;\n};\n\n/**\n * A bar chart for order volume per period — a single series by default, or stacked by order\n * status when `statuses` is provided.\n *\n * @example\n * ```tsx\n * import { OrdersBarChart } from '@customafk/lunas-ui/features/charts';\n *\n * <OrdersBarChart\n * data={[{ date: '2026-06-01', completed: 32, pending: 6, cancelled: 2 }]}\n * statuses={[\n * { key: 'completed', label: 'Completed' },\n * { key: 'pending', label: 'Pending' },\n * { key: 'cancelled', label: 'Cancelled' },\n * ]}\n * />\n * ```\n */\nexport const OrdersBarChart = ({\n data,\n dataKey = 'orders',\n label = 'Orders',\n statuses,\n color = 'var(--chart-1)',\n valueFormatter = value => value.toLocaleString('en-US'),\n dateFormatter = toDateLabel,\n showLegend = !!statuses,\n showGrid = true,\n className,\n animate = true,\n height,\n}: OrdersBarChartProps) => {\n const config = useMemo<ChartConfig>(() => {\n if (!statuses) return { [dataKey]: { label, color } };\n return Object.fromEntries(statuses.map((status, index) => [status.key, { label: status.label, color: status.color || getChartColor(index) }]));\n }, [statuses, dataKey, label, color]);\n\n return (\n <ChartContainer\n data-slot=\"orders-bar-chart\"\n config={config}\n className={cn('w-full', className)}\n style={height !== undefined ? { height, aspectRatio: 'auto' } : undefined}\n >\n <BarChart data={data} margin={{ top: 8, right: 12, bottom: 0, left: 12 }}>\n {showGrid && <CartesianGrid vertical={false} />}\n <XAxis dataKey=\"date\" tickLine={false} axisLine={false} tickMargin={8} tickFormatter={dateFormatter} />\n <YAxis tickLine={false} axisLine={false} tickMargin={8} width={48} allowDecimals={false} tickFormatter={valueFormatter} />\n <ChartTooltip\n content={\n <ChartTooltipContent\n labelFormatter={(_, payload) => {\n const date = payload?.[0]?.payload?.date;\n return date ? dateFormatter(date) : null;\n }}\n />\n }\n />\n {statuses ? (\n statuses.map((status, index) => (\n <Bar\n key={status.key}\n dataKey={status.key}\n stackId=\"orders\"\n fill={status.color || getChartColor(index)}\n radius={index === statuses.length - 1 ? [4, 4, 0, 0] : [0, 0, 0, 0]}\n isAnimationActive={animate}\n />\n ))\n ) : (\n <Bar dataKey={dataKey} fill={color} radius={[4, 4, 0, 0]} isAnimationActive={animate} />\n )}\n {showLegend && <ChartLegend content={<ChartLegendContent />} />}\n </BarChart>\n </ChartContainer>\n );\n};\n","'use client';\n\nimport { useMemo } from 'react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { type ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from '@/components/ui/chart';\n\nimport type { TreemapNode } from 'recharts';\nimport { Treemap } from 'recharts';\nimport type { BaseChartProps, PortfolioHolding } from '../types';\nimport { formatCompactNumber, getChartColor } from '../utils';\n\nexport type PortfolioAllocationTreemapProps = BaseChartProps & {\n data: PortfolioHolding[];\n valueFormatter?: (value: number) => string;\n /** Shows the holding name and formatted value inside each rect when it fits. Defaults to `true`. */\n showLabels?: boolean;\n};\n\nconst toKey = (holding: PortfolioHolding): string => holding.key || holding.name.toLowerCase().replace(/[^a-z0-9]+/g, '-');\n\n/**\n * A treemap for portfolio holdings / asset allocation, sized by weight — clearer than a donut\n * once there are more than a handful of positions.\n *\n * @example\n * ```tsx\n * import { PortfolioAllocationTreemap } from '@customafk/lunas-ui/features/charts';\n *\n * <PortfolioAllocationTreemap\n * data={[\n * { name: 'AAPL', value: 24000 },\n * { name: 'MSFT', value: 18500 },\n * { name: 'Bonds', value: 12000 },\n * ]}\n * />\n * ```\n */\nexport const PortfolioAllocationTreemap = ({\n data,\n valueFormatter = formatCompactNumber,\n showLabels = true,\n className,\n animate = true,\n height,\n}: PortfolioAllocationTreemapProps) => {\n const { chartData, config } = useMemo(() => {\n const entries = data.map((holding, index) => ({\n ...holding,\n key: toKey(holding),\n fill: holding.color || getChartColor(index),\n }));\n const chartConfig: ChartConfig = Object.fromEntries(entries.map(entry => [entry.key, { label: entry.name, color: entry.fill }]));\n return { chartData: entries, config: chartConfig };\n }, [data]);\n\n const renderContent = (node: TreemapNode) => {\n if (node.depth !== 1) return <g />;\n const holding = chartData.find(entry => entry.key === node.name);\n const fitsLabel = showLabels && node.width >= 36 && node.height >= 24;\n\n return (\n <g>\n <rect x={node.x} y={node.y} width={node.width} height={node.height} fill={holding?.fill} stroke=\"var(--background)\" />\n {fitsLabel && (\n <text x={node.x + 6} y={node.y + 16} className=\"fill-white font-medium text-xs\">\n {holding?.name}\n </text>\n )}\n {fitsLabel && node.height > 40 && (\n <text x={node.x + 6} y={node.y + 32} className=\"fill-white/80 font-number text-[11px]\">\n {valueFormatter(node.value)}\n </text>\n )}\n </g>\n );\n };\n\n return (\n <ChartContainer\n data-slot=\"portfolio-allocation-treemap\"\n config={config}\n className={cn('w-full', className)}\n style={height !== undefined ? { height, aspectRatio: 'auto' } : undefined}\n >\n <Treemap data={chartData} dataKey=\"value\" nameKey=\"key\" isAnimationActive={animate} content={renderContent}>\n <ChartTooltip content={<ChartTooltipContent nameKey=\"key\" hideLabel formatter={value => valueFormatter(Number(value))} />} />\n </Treemap>\n </ChartContainer>\n );\n};\n","'use client';\n\nimport { useMemo } from 'react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { type ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from '@/components/ui/chart';\n\nimport { Area, CartesianGrid, ComposedChart, Line, XAxis, YAxis } from 'recharts';\nimport type { BaseChartProps, OHLCPoint } from '../types';\nimport { toDateLabel } from '../utils';\n\nexport type PriceRangeAreaChartProps = BaseChartProps & {\n /** Only `date`, `high`, `low`, and `close` are used; pass the same rows given to `CandlestickChart`. */\n data: Array<Pick<OHLCPoint, 'date' | 'high' | 'low' | 'close'>>;\n /** Close-price series label. Defaults to `'Close'`. */\n label?: string;\n /** High-low band label. Defaults to `'Range'`. */\n rangeLabel?: string;\n color?: string;\n valueFormatter?: (value: number) => string;\n dateFormatter?: (date: string | Date) => string;\n showGrid?: boolean;\n};\n\n/**\n * A shaded high-low trading-range band with the close price drawn on top — the daily range is\n * visible at a glance alongside the closing trend.\n *\n * @example\n * ```tsx\n * import { PriceRangeAreaChart } from '@customafk/lunas-ui/features/charts';\n *\n * <PriceRangeAreaChart\n * data={[{ date: '2026-06-01', high: 146.2, low: 141.8, close: 144.9 }]}\n * />\n * ```\n */\nexport const PriceRangeAreaChart = ({\n data,\n label = 'Close',\n rangeLabel = 'Range',\n color = 'var(--chart-1)',\n valueFormatter = value => value.toLocaleString('en-US'),\n dateFormatter = toDateLabel,\n showGrid = true,\n className,\n animate = true,\n height,\n}: PriceRangeAreaChartProps) => {\n const config = useMemo<ChartConfig>(() => ({ close: { label, color }, rangeSpan: { label: rangeLabel, color } }), [label, color, rangeLabel]);\n\n const chartData = useMemo(() => data.map(point => ({ ...point, rangeSpan: point.high - point.low })), [data]);\n\n return (\n <ChartContainer\n data-slot=\"price-range-area-chart\"\n config={config}\n className={cn('w-full', className)}\n style={height !== undefined ? { height, aspectRatio: 'auto' } : undefined}\n >\n <ComposedChart data={chartData} margin={{ top: 8, right: 12, bottom: 0, left: 12 }}>\n {showGrid && <CartesianGrid vertical={false} />}\n <XAxis dataKey=\"date\" tickLine={false} axisLine={false} tickMargin={8} tickFormatter={dateFormatter} />\n <YAxis domain={['auto', 'auto']} tickLine={false} axisLine={false} tickMargin={8} width={64} tickFormatter={valueFormatter} />\n <ChartTooltip\n cursor={false}\n content={\n <ChartTooltipContent\n labelFormatter={(_, payload) => {\n const date = payload?.[0]?.payload?.date;\n return date ? dateFormatter(date) : null;\n }}\n formatter={(value, name, item) => {\n if (name !== 'close') return null;\n const point = item.payload as { high: number; low: number };\n return (\n <div className=\"grid gap-0.5\">\n <span className=\"text-muted\">\n {config.close?.label} <span className=\"font-medium font-number text-text-positive-strong\">{valueFormatter(Number(value))}</span>\n </span>\n <span className=\"text-[11px] text-muted\">\n {valueFormatter(point.low)} – {valueFormatter(point.high)}\n </span>\n </div>\n );\n }}\n />\n }\n />\n <Area dataKey=\"low\" stackId=\"range\" stroke=\"none\" fill=\"transparent\" isAnimationActive={animate} />\n <Area dataKey=\"rangeSpan\" stackId=\"range\" stroke=\"none\" fill={color} fillOpacity={0.15} isAnimationActive={animate} />\n <Line type=\"natural\" dataKey=\"close\" stroke={color} strokeWidth={2} dot={false} isAnimationActive={animate} />\n </ComposedChart>\n </ChartContainer>\n );\n};\n","'use client';\n\nimport { useId, useMemo } from 'react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { type ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartTooltip, ChartTooltipContent } from '@/components/ui/chart';\n\nimport { Area, AreaChart, CartesianGrid, XAxis, YAxis } from 'recharts';\nimport type { BaseChartProps, TimeSeriesPoint } from '../types';\nimport { formatCurrency, toDateLabel } from '../utils';\n\nexport type RevenueAreaChartProps = BaseChartProps & {\n data: TimeSeriesPoint[];\n /** Series label. Defaults to `'Revenue'`. */\n label?: string;\n /** Comparison series label. Defaults to `'Previous period'`. */\n comparisonLabel?: string;\n /** Renders `previousValue` as a second, muted area series. */\n showComparison?: boolean;\n color?: string;\n comparisonColor?: string;\n /** Formats tooltip and Y-axis values. Defaults to compact currency. */\n valueFormatter?: (value: number) => string;\n dateFormatter?: (date: string | Date) => string;\n /** Defaults to `showComparison`. */\n showLegend?: boolean;\n showGrid?: boolean;\n};\n\n/**\n * A gradient area chart for revenue (or any currency metric) over time, with an optional\n * previous-period comparison series.\n *\n * @example\n * ```tsx\n * import { RevenueAreaChart } from '@customafk/lunas-ui/features/charts';\n *\n * <RevenueAreaChart\n * data={[\n * { date: '2026-06-01', value: 4200, previousValue: 3800 },\n * { date: '2026-06-02', value: 5100, previousValue: 4300 },\n * ]}\n * showComparison\n * />\n * ```\n */\nexport const RevenueAreaChart = ({\n data,\n label = 'Revenue',\n comparisonLabel = 'Previous period',\n showComparison = false,\n color = 'var(--chart-1)',\n comparisonColor = 'var(--chart-8)',\n valueFormatter = value => formatCurrency(value),\n dateFormatter = toDateLabel,\n showLegend = showComparison,\n showGrid = true,\n className,\n animate = true,\n height,\n}: RevenueAreaChartProps) => {\n const gradientId = useId();\n\n const config = useMemo<ChartConfig>(\n () => ({\n value: { label, color },\n ...(showComparison ? { previousValue: { label: comparisonLabel, color: comparisonColor } } : {}),\n }),\n [label, color, showComparison, comparisonLabel, comparisonColor]\n );\n\n return (\n <ChartContainer\n data-slot=\"revenue-area-chart\"\n config={config}\n className={cn('w-full', className)}\n style={height !== undefined ? { height, aspectRatio: 'auto' } : undefined}\n >\n <AreaChart data={data} margin={{ top: 8, right: 12, bottom: 0, left: 12 }}>\n <defs>\n <linearGradient id={`${gradientId}-value`} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop offset=\"5%\" stopColor={color} stopOpacity={0.6} />\n <stop offset=\"95%\" stopColor={color} stopOpacity={0.05} />\n </linearGradient>\n <linearGradient id={`${gradientId}-previous`} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop offset=\"5%\" stopColor={comparisonColor} stopOpacity={0.3} />\n <stop offset=\"95%\" stopColor={comparisonColor} stopOpacity={0.02} />\n </linearGradient>\n </defs>\n {showGrid && <CartesianGrid vertical={false} />}\n <XAxis dataKey=\"date\" tickLine={false} axisLine={false} tickMargin={8} tickFormatter={dateFormatter} />\n <YAxis tickLine={false} axisLine={false} tickMargin={8} width={64} tickFormatter={valueFormatter} />\n <ChartTooltip\n cursor={false}\n content={\n <ChartTooltipContent\n labelFormatter={(_, payload) => {\n const date = payload?.[0]?.payload?.date;\n return date ? dateFormatter(date) : null;\n }}\n formatter={(value, name, item) => (\n <>\n <div className=\"size-2.5 shrink-0 rounded-[2px]\" style={{ backgroundColor: item.color }} />\n <span className=\"text-muted\">{config[String(name)]?.label || name}</span>\n <span className=\"text-text-positive-strong font-number ml-auto font-medium tabular-nums\">{valueFormatter(Number(value))}</span>\n </>\n )}\n />\n }\n />\n {showComparison && (\n <Area\n type=\"natural\"\n dataKey=\"previousValue\"\n stroke={comparisonColor}\n strokeWidth={2}\n strokeDasharray=\"4 4\"\n fill={`url(#${gradientId}-previous)`}\n isAnimationActive={animate}\n />\n )}\n <Area type=\"natural\" dataKey=\"value\" stroke={color} strokeWidth={2} fill={`url(#${gradientId}-value)`} isAnimationActive={animate} />\n {showLegend && <ChartLegend content={<ChartLegendContent />} />}\n </AreaChart>\n </ChartContainer>\n );\n};\n","'use client';\n\nimport { useMemo } from 'react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { type ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartTooltip, ChartTooltipContent } from '@/components/ui/chart';\n\nimport { Bar, CartesianGrid, ComposedChart, Line, XAxis, YAxis } from 'recharts';\nimport type { BaseChartProps } from '../types';\nimport { formatCurrency, toDateLabel } from '../utils';\n\nexport type RevenueOrdersPoint = {\n date: string | Date;\n revenue: number;\n orders: number;\n};\n\nexport type RevenueOrdersComposedChartProps = BaseChartProps & {\n data: RevenueOrdersPoint[];\n revenueLabel?: string;\n ordersLabel?: string;\n revenueColor?: string;\n ordersColor?: string;\n /** Formats the left (revenue) axis and tooltip values. Defaults to compact currency. */\n revenueFormatter?: (value: number) => string;\n /** Formats the right (orders) axis and tooltip values. */\n ordersFormatter?: (value: number) => string;\n dateFormatter?: (date: string | Date) => string;\n showLegend?: boolean;\n showGrid?: boolean;\n};\n\n/**\n * A dual-axis chart combining revenue bars (left axis, currency) with an orders line\n * (right axis, count) to correlate the two metrics per period.\n *\n * @example\n * ```tsx\n * import { RevenueOrdersComposedChart } from '@customafk/lunas-ui/features/charts';\n *\n * <RevenueOrdersComposedChart\n * data={[{ date: '2026-06-01', revenue: 12400, orders: 87 }]}\n * />\n * ```\n */\nexport const RevenueOrdersComposedChart = ({\n data,\n revenueLabel = 'Revenue',\n ordersLabel = 'Orders',\n revenueColor = 'var(--chart-1)',\n ordersColor = 'var(--chart-4)',\n revenueFormatter = value => formatCurrency(value),\n ordersFormatter = value => value.toLocaleString('en-US'),\n dateFormatter = toDateLabel,\n showLegend = true,\n showGrid = true,\n className,\n animate = true,\n height,\n}: RevenueOrdersComposedChartProps) => {\n const config = useMemo<ChartConfig>(\n () => ({\n revenue: { label: revenueLabel, color: revenueColor },\n orders: { label: ordersLabel, color: ordersColor },\n }),\n [revenueLabel, revenueColor, ordersLabel, ordersColor]\n );\n\n return (\n <ChartContainer\n data-slot=\"revenue-orders-composed-chart\"\n config={config}\n className={cn('w-full', className)}\n style={height !== undefined ? { height, aspectRatio: 'auto' } : undefined}\n >\n <ComposedChart data={data} margin={{ top: 8, right: 12, bottom: 0, left: 12 }}>\n {showGrid && <CartesianGrid vertical={false} />}\n <XAxis dataKey=\"date\" tickLine={false} axisLine={false} tickMargin={8} tickFormatter={dateFormatter} />\n <YAxis yAxisId=\"revenue\" tickLine={false} axisLine={false} tickMargin={8} width={64} tickFormatter={revenueFormatter} />\n <YAxis\n yAxisId=\"orders\"\n orientation=\"right\"\n tickLine={false}\n axisLine={false}\n tickMargin={8}\n width={48}\n allowDecimals={false}\n tickFormatter={ordersFormatter}\n />\n <ChartTooltip\n content={\n <ChartTooltipContent\n labelFormatter={(_, payload) => {\n const date = payload?.[0]?.payload?.date;\n return date ? dateFormatter(date) : null;\n }}\n formatter={(value, name, item) => (\n <>\n <div className=\"size-2.5 shrink-0 rounded-[2px]\" style={{ backgroundColor: item.color }} />\n <span className=\"text-muted\">{config[String(name)]?.label || name}</span>\n <span className=\"text-text-positive-strong font-number ml-auto font-medium tabular-nums\">\n {name === 'revenue' ? revenueFormatter(Number(value)) : ordersFormatter(Number(value))}\n </span>\n </>\n )}\n />\n }\n />\n <Bar dataKey=\"revenue\" yAxisId=\"revenue\" fill={revenueColor} radius={[4, 4, 0, 0]} isAnimationActive={animate} />\n <Line type=\"natural\" dataKey=\"orders\" yAxisId=\"orders\" stroke={ordersColor} strokeWidth={2} dot={false} isAnimationActive={animate} />\n {showLegend && <ChartLegend content={<ChartLegendContent />} />}\n </ComposedChart>\n </ChartContainer>\n );\n};\n","'use client';\n\nimport { useMemo } from 'react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { type ChartConfig, ChartContainer } from '@/components/ui/chart';\n\nimport { Label, PolarAngleAxis, PolarRadiusAxis, RadialBar, RadialBarChart } from 'recharts';\nimport type { BaseChartProps } from '../types';\nimport { formatPercent } from '../utils';\n\nexport type SalesTargetRadialChartProps = BaseChartProps & {\n /** Current progress value, e.g. revenue to date. */\n value: number;\n /** The goal the value is measured against. */\n target: number;\n /** Text under the center figure. Defaults to `'Target'`. */\n label?: string;\n /** Formats the center figure. Defaults to percent-of-target. */\n valueFormatter?: (value: number, target: number) => string;\n color?: string;\n};\n\n/**\n * A radial gauge showing progress toward a sales target with the completion figure in the center.\n *\n * @example\n * ```tsx\n * import { SalesTargetRadialChart } from '@customafk/lunas-ui/features/charts';\n *\n * <SalesTargetRadialChart value={65_000} target={100_000} label=\"Monthly target\" />\n * ```\n */\nexport const SalesTargetRadialChart = ({\n value,\n target,\n label = 'Target',\n valueFormatter = (current, goal) => formatPercent(goal === 0 ? 0 : current / goal),\n color = 'var(--chart-1)',\n className,\n animate = true,\n height,\n}: SalesTargetRadialChartProps) => {\n const chartData = useMemo(() => [{ name: 'progress', value: Math.min(Math.max(value, 0), target), fill: color }], [value, target, color]);\n\n const config = useMemo<ChartConfig>(() => ({ progress: { label, color } }), [label, color]);\n\n return (\n <ChartContainer\n data-slot=\"sales-target-radial-chart\"\n config={config}\n className={cn('mx-auto', height === undefined && 'aspect-square', className)}\n style={height !== undefined ? { height, aspectRatio: 'auto' } : undefined}\n >\n <RadialBarChart data={chartData} startAngle={90} endAngle={-270} innerRadius=\"75%\" outerRadius=\"100%\">\n <PolarAngleAxis type=\"number\" domain={[0, target]} angleAxisId={0} tick={false} />\n <RadialBar dataKey=\"value\" angleAxisId={0} background cornerRadius={10} isAnimationActive={animate} />\n <PolarRadiusAxis tick={false} tickLine={false} axisLine={false}>\n <Label\n content={({ viewBox }) => {\n if (!viewBox || !('cx' in viewBox) || !('cy' in viewBox)) return null;\n return (\n <text x={viewBox.cx} y={viewBox.cy} textAnchor=\"middle\" dominantBaseline=\"middle\">\n <tspan x={viewBox.cx} y={viewBox.cy} className=\"fill-text-positive-strong font-number text-3xl font-bold\">\n {valueFormatter(value, target)}\n </tspan>\n <tspan x={viewBox.cx} y={(viewBox.cy || 0) + 24} className=\"fill-muted text-xs\">\n {label}\n </tspan>\n </text>\n );\n }}\n />\n </PolarRadiusAxis>\n </RadialBarChart>\n </ChartContainer>\n );\n};\n","'use client';\n\nimport { useMemo } from 'react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { ChartContainer } from '@/components/ui/chart';\n\nimport type { SankeyLinkProps, SankeyNodeProps } from 'recharts';\nimport { Rectangle, Sankey } from 'recharts';\nimport type { BaseChartProps } from '../types';\nimport { getChartColor } from '../utils';\n\nexport type SankeyFlowNode = {\n name: string;\n color?: string;\n};\n\nexport type SankeyFlowLink = {\n /** Node name, matching an entry in `nodes`. */\n source: string;\n /** Node name, matching an entry in `nodes`. */\n target: string;\n value: number;\n};\n\nexport type SankeyFlowChartProps = BaseChartProps & {\n nodes: Array<SankeyFlowNode | string>;\n links: SankeyFlowLink[];\n valueFormatter?: (value: number) => string;\n nodeWidth?: number;\n nodePadding?: number;\n /** Minimum horizontal space reserved for node labels outside the plot area; grows to fit the longest root/leaf label. Defaults to `170`. */\n labelWidth?: number;\n};\n\n/**\n * A Sankey flow diagram — revenue/cost breakdowns, funnels with branching paths, budget\n * allocation — where band width is proportional to the flow value between named nodes.\n *\n * @example\n * ```tsx\n * import { SankeyFlowChart } from '@customafk/lunas-ui/features/charts';\n *\n * <SankeyFlowChart\n * height={500}\n * nodes={['iPhone', 'Mac', 'Net Sales', 'Cost of Sales', 'Gross Profit']}\n * links={[\n * { source: 'iPhone', target: 'Net Sales', value: 205489 },\n * { source: 'Mac', target: 'Net Sales', value: 40177 },\n * { source: 'Net Sales', target: 'Cost of Sales', value: 223546 },\n * { source: 'Net Sales', target: 'Gross Profit', value: 170782 },\n * ]}\n * />\n * ```\n */\nconst estimateLabelWidth = (label: string): number => label.length * 5.6 + 14;\n\nexport const SankeyFlowChart = ({\n nodes,\n links,\n valueFormatter = value => value.toLocaleString('en-US'),\n nodeWidth = 14,\n nodePadding = 24,\n labelWidth = 170,\n className,\n animate = true,\n height,\n}: SankeyFlowChartProps) => {\n const { data, colorByName, effectiveLabelWidth, rootNames, leafNames } = useMemo(() => {\n const nodeList = nodes.map(node => (typeof node === 'string' ? { name: node } : node));\n const nameToIndex = new Map(nodeList.map((node, index) => [node.name, index]));\n const colors = new Map(nodeList.map((node, index) => [node.name, node.color || getChartColor(index)]));\n\n const sankeyLinks = links\n .map(link => ({ source: nameToIndex.get(link.source), target: nameToIndex.get(link.target), value: link.value }))\n .filter((link): link is { source: number; target: number; value: number } => link.source !== undefined && link.target !== undefined);\n\n // Computed from our own link list rather than trusting recharts' `payload.depth`/`sourceLinks`\n // at render time — the latter don't reliably flag terminal (leaf) nodes as such.\n const hasIncoming = new Set(sankeyLinks.map(link => link.target));\n const hasOutgoing = new Set(sankeyLinks.map(link => link.source));\n const roots = new Set(nodeList.filter((_, index) => !hasIncoming.has(index)).map(node => node.name));\n const leaves = new Set(nodeList.filter((_, index) => !hasOutgoing.has(index)).map(node => node.name));\n\n // Only root/leaf nodes get side labels using this margin; widen it to fit the longest one\n // so long names don't clip past the SVG edge.\n let maxWidth = labelWidth;\n nodeList.forEach((node, index) => {\n if (hasIncoming.has(index) && hasOutgoing.has(index)) return;\n const relatedValue = sankeyLinks.filter(link => link.source === index || link.target === index).reduce((sum, link) => sum + link.value, 0);\n maxWidth = Math.max(maxWidth, estimateLabelWidth(`${node.name}: ${valueFormatter(relatedValue)}`) + 16);\n });\n\n return { data: { nodes: nodeList, links: sankeyLinks }, colorByName: colors, effectiveLabelWidth: maxWidth, rootNames: roots, leafNames: leaves };\n }, [nodes, links, labelWidth, valueFormatter]);\n\n return (\n <ChartContainer\n data-slot=\"sankey-flow-chart\"\n config={{}}\n className={cn('w-full', className)}\n style={height !== undefined ? { height, aspectRatio: 'auto' } : undefined}\n >\n <Sankey\n data={data}\n nodeWidth={nodeWidth}\n nodePadding={nodePadding}\n linkCurvature={0.45}\n margin={{ top: 28, right: effectiveLabelWidth, bottom: 8, left: effectiveLabelWidth }}\n node={(props: SankeyNodeProps) => {\n const { x, y, width, height: nodeHeight, payload } = props;\n const color = colorByName.get(payload.name) ?? 'var(--chart-1)';\n const isRoot = rootNames.has(payload.name);\n const isLeaf = leafNames.has(payload.name);\n const label = `${payload.name}: ${valueFormatter(payload.value)}`;\n const pillWidth = estimateLabelWidth(label);\n const pillHeight = 18;\n\n let textX: number;\n let textY: number;\n let textAnchor: 'start' | 'end' | 'middle';\n let pillX: number;\n let pillY: number;\n\n if (isRoot || isLeaf) {\n textAnchor = isRoot ? 'end' : 'start';\n textY = y + nodeHeight / 2;\n pillY = textY - pillHeight / 2;\n pillX = isRoot ? x - 8 - pillWidth : x + width + 8;\n textX = isRoot ? pillX + pillWidth - 6 : pillX + 6;\n } else {\n // Intermediate nodes label above the bar (not beside it) so chained, closely-spaced\n // depth columns never collide sideways. Consecutive depths are additionally staggered\n // to two alternating heights (zigzag) — when almost all of a node's value passes\n // straight through to the next depth (e.g. Operating Income -> Profit before tax),\n // both nodes land at nearly the same y, so same-height labels would still overlap.\n textAnchor = 'middle';\n textY = payload.depth % 2 === 0 ? y - 10 : y - 30;\n pillY = textY - pillHeight + 4;\n pillX = x + width / 2 - pillWidth / 2;\n textX = x + width / 2;\n }\n\n return (\n <g>\n <Rectangle\n className=\"recharts-sankey-node\"\n x={x}\n y={y}\n width={width}\n height={nodeHeight}\n fill={color}\n stroke=\"var(--background)\"\n strokeWidth={1.5}\n isAnimationActive={animate}\n />\n <rect x={pillX} y={pillY} width={pillWidth} height={pillHeight} rx={4} fill=\"var(--background)\" fillOpacity={0.92} />\n <text x={textX} y={textY} textAnchor={textAnchor} dominantBaseline=\"middle\" className=\"fill-text-positive-strong text-[11px] font-medium\">\n {label}\n </text>\n </g>\n );\n }}\n link={(props: SankeyLinkProps) => {\n const { sourceX, sourceY, sourceControlX, targetX, targetY, targetControlX, linkWidth, payload } = props;\n const sourceColor = colorByName.get(payload.source.name) ?? 'var(--chart-1)';\n const targetColor = colorByName.get(payload.target.name) ?? sourceColor;\n // Blending toward the target's color (rather than a flat source-only fill) keeps sibling\n // flows out of the same source visually distinct from each other wherever they run close\n // together or cross — a flat single hue made e.g. Gross Profit's three outgoing flows\n // (-> R&D, -> SG&A, -> Operating Income) indistinguishable from one another.\n const color = `color-mix(in oklch, ${sourceColor} 60%, ${targetColor} 40%)`;\n return (\n <path\n className=\"recharts-sankey-link\"\n d={`M${sourceX},${sourceY} C${sourceControlX},${sourceY} ${targetControlX},${targetY} ${targetX},${targetY}`}\n fill=\"none\"\n stroke={color}\n strokeWidth={linkWidth}\n strokeOpacity={0.4}\n />\n );\n }}\n />\n </ChartContainer>\n );\n};\n","'use client';\n\nimport { useId, useMemo } from 'react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Area, AreaChart, Line, LineChart, ResponsiveContainer } from 'recharts';\nimport type { ChartTrend } from '../types';\n\nconst TREND_COLORS: Record<ChartTrend, string> = {\n up: 'var(--success)',\n down: 'var(--danger)',\n neutral: 'var(--chart-1)',\n};\n\nexport type SparklineChartProps = {\n data: number[] | Array<{ value: number }>;\n /** Render style. Defaults to `'area'`. */\n type?: 'line' | 'area';\n /** Colors the series like the `Statistic` trend prop. Defaults to `'neutral'`. */\n trend?: ChartTrend;\n /** Explicit series color; overrides `trend`. */\n color?: string;\n /** Fixed height in px. Defaults to `40`. */\n height?: number;\n animate?: boolean;\n className?: string;\n};\n\n/**\n * A tiny, axis-less trend chart for KPI cards; pairs with the `Statistic` display component.\n *\n * @example\n * ```tsx\n * import { SparklineChart } from '@customafk/lunas-ui/features/charts';\n *\n * <SparklineChart data={[12, 18, 14, 26, 22, 31]} trend=\"up\" />\n * ```\n */\nexport const SparklineChart = ({ data, type = 'area', trend = 'neutral', color, height = 40, animate = true, className }: SparklineChartProps) => {\n const gradientId = useId();\n const seriesColor = color || TREND_COLORS[trend];\n\n const chartData = useMemo(() => data.map(point => (typeof point === 'number' ? { value: point } : point)), [data]);\n\n const margin = { top: 2, right: 0, bottom: 2, left: 0 };\n\n return (\n <div data-slot=\"sparkline-chart\" className={cn('w-full', className)} style={{ height }}>\n <ResponsiveContainer>\n {type === 'line' ? (\n <LineChart data={chartData} margin={margin}>\n <Line type=\"natural\" dataKey=\"value\" stroke={seriesColor} strokeWidth={2} dot={false} isAnimationActive={animate} />\n </LineChart>\n ) : (\n <AreaChart data={chartData} margin={margin}>\n <defs>\n <linearGradient id={gradientId} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop offset=\"5%\" stopColor={seriesColor} stopOpacity={0.4} />\n <stop offset=\"95%\" stopColor={seriesColor} stopOpacity={0.05} />\n </linearGradient>\n </defs>\n <Area type=\"natural\" dataKey=\"value\" stroke={seriesColor} strokeWidth={2} fill={`url(#${gradientId})`} isAnimationActive={animate} />\n </AreaChart>\n )}\n </ResponsiveContainer>\n </div>\n );\n};\n","'use client';\n\nimport { useMemo } from 'react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { type ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartTooltip, ChartTooltipContent } from '@/components/ui/chart';\n\nimport { Area, AreaChart, CartesianGrid, XAxis, YAxis } from 'recharts';\nimport type { BaseChartProps, ChartSeries } from '../types';\nimport { getChartColor, toDateLabel } from '../utils';\n\nexport type StackedAreaChartProps = BaseChartProps & {\n data: Array<{ date: string | Date } & Record<string, unknown>>;\n /** One entry per stacked category. */\n series: ChartSeries[];\n valueFormatter?: (value: number) => string;\n dateFormatter?: (date: string | Date) => string;\n showLegend?: boolean;\n showGrid?: boolean;\n};\n\n/**\n * A stacked area chart for cumulative composition over time — e.g. revenue by channel, traffic\n * by source. Unlike `RevenueAreaChart` (a single series plus one comparison overlay), every\n * series here stacks to show the total alongside each category's contribution.\n *\n * @example\n * ```tsx\n * import { StackedAreaChart } from '@customafk/lunas-ui/features/charts';\n *\n * <StackedAreaChart\n * data={[{ date: '2026-06-01', direct: 4200, organic: 3100, paid: 1800 }]}\n * series={[\n * { key: 'direct', label: 'Direct' },\n * { key: 'organic', label: 'Organic' },\n * { key: 'paid', label: 'Paid' },\n * ]}\n * />\n * ```\n */\nexport const StackedAreaChart = ({\n data,\n series,\n valueFormatter = value => value.toLocaleString('en-US'),\n dateFormatter = toDateLabel,\n showLegend = true,\n showGrid = true,\n className,\n animate = true,\n height,\n}: StackedAreaChartProps) => {\n const config = useMemo<ChartConfig>(\n () => Object.fromEntries(series.map((item, index) => [item.key, { label: item.label, color: item.color || getChartColor(index) }])),\n [series]\n );\n\n return (\n <ChartContainer\n data-slot=\"stacked-area-chart\"\n config={config}\n className={cn('w-full', className)}\n style={height !== undefined ? { height, aspectRatio: 'auto' } : undefined}\n >\n <AreaChart data={data} margin={{ top: 8, right: 12, bottom: 0, left: 12 }}>\n {showGrid && <CartesianGrid vertical={false} />}\n <XAxis dataKey=\"date\" tickLine={false} axisLine={false} tickMargin={8} tickFormatter={dateFormatter} />\n <YAxis tickLine={false} axisLine={false} tickMargin={8} width={64} tickFormatter={valueFormatter} />\n <ChartTooltip\n content={\n <ChartTooltipContent\n labelFormatter={(_, payload) => {\n const date = payload?.[0]?.payload?.date;\n return date ? dateFormatter(date) : null;\n }}\n formatter={value => valueFormatter(Number(value))}\n />\n }\n />\n {series.map((item, index) => {\n const color = item.color || getChartColor(index);\n return (\n <Area key={item.key} type=\"natural\" dataKey={item.key} stackId=\"stack\" stroke={color} fill={color} fillOpacity={0.35} isAnimationActive={animate} />\n );\n })}\n {showLegend && <ChartLegend content={<ChartLegendContent />} />}\n </AreaChart>\n </ChartContainer>\n );\n};\n","'use client';\n\nimport { useMemo } from 'react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { type ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from '@/components/ui/chart';\n\nimport { Bar, BarChart, LabelList, XAxis, YAxis } from 'recharts';\nimport type { BaseChartProps, NamedValue } from '../types';\nimport { formatCompactNumber } from '../utils';\n\nexport type TopProductsBarChartProps = BaseChartProps & {\n data: NamedValue[];\n /** Series label. Defaults to `'Sales'`. */\n label?: string;\n /** Number of items shown after sorting descending. Defaults to `8`. */\n maxItems?: number;\n color?: string;\n valueFormatter?: (value: number) => string;\n /** Value labels at the end of each bar. Defaults to `true`. */\n showValueLabels?: boolean;\n};\n\n/**\n * A horizontal bar ranking chart — top products, best categories, top customers.\n *\n * @example\n * ```tsx\n * import { TopProductsBarChart } from '@customafk/lunas-ui/features/charts';\n *\n * <TopProductsBarChart\n * data={[\n * { name: 'Wireless Earbuds', value: 1245 },\n * { name: 'Smart Watch', value: 986 },\n * ]}\n * />\n * ```\n */\nexport const TopProductsBarChart = ({\n data,\n label = 'Sales',\n maxItems = 8,\n color = 'var(--chart-1)',\n valueFormatter = formatCompactNumber,\n showValueLabels = true,\n className,\n animate = true,\n height,\n}: TopProductsBarChartProps) => {\n const chartData = useMemo(() => [...data].sort((a, b) => b.value - a.value).slice(0, maxItems), [data, maxItems]);\n\n const config = useMemo<ChartConfig>(() => ({ value: { label, color } }), [label, color]);\n\n return (\n <ChartContainer\n data-slot=\"top-products-bar-chart\"\n config={config}\n className={cn('w-full', className)}\n style={height !== undefined ? { height, aspectRatio: 'auto' } : undefined}\n >\n <BarChart data={chartData} layout=\"vertical\" margin={{ top: 0, right: showValueLabels ? 48 : 12, bottom: 0, left: 12 }}>\n <XAxis type=\"number\" dataKey=\"value\" hide />\n <YAxis type=\"category\" dataKey=\"name\" tickLine={false} axisLine={false} tickMargin={8} width={120} />\n <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />\n <Bar dataKey=\"value\" fill={color} radius={4} isAnimationActive={animate}>\n {showValueLabels && (\n <LabelList\n dataKey=\"value\"\n position=\"right\"\n offset={8}\n className=\"fill-muted-strong\"\n fontSize={12}\n formatter={(value: React.ReactNode) => valueFormatter(Number(value))}\n />\n )}\n </Bar>\n </BarChart>\n </ChartContainer>\n );\n};\n","'use client';\n\nimport { useMemo } from 'react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { type ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from '@/components/ui/chart';\n\nimport { Bar, BarChart, CartesianGrid, Rectangle, XAxis, YAxis } from 'recharts';\nimport type { BaseChartProps, OHLCPoint } from '../types';\nimport { formatCompactNumber, getDirectionColor, toDateLabel } from '../utils';\n\nexport type VolumeBarChartProps = BaseChartProps & {\n /** Only `date`, `close`, and `volume` are used; pass the same rows given to `CandlestickChart`. */\n data: Array<Pick<OHLCPoint, 'date' | 'close' | 'volume'>>;\n /** Series label. Defaults to `'Volume'`. */\n label?: string;\n upColor?: string;\n downColor?: string;\n valueFormatter?: (value: number) => string;\n dateFormatter?: (date: string | Date) => string;\n showGrid?: boolean;\n};\n\n/**\n * Volume bars colored by day direction (close vs. previous close), meant to sit under a\n * `CandlestickChart` on a shared time axis.\n *\n * @example\n * ```tsx\n * import { VolumeBarChart } from '@customafk/lunas-ui/features/charts';\n *\n * <VolumeBarChart\n * data={[\n * { date: '2026-06-01', close: 142.5, volume: 2_400_000 },\n * { date: '2026-06-02', close: 145.1, volume: 3_100_000 },\n * ]}\n * />\n * ```\n */\nexport const VolumeBarChart = ({\n data,\n label = 'Volume',\n upColor = 'var(--success)',\n downColor = 'var(--danger)',\n valueFormatter = formatCompactNumber,\n dateFormatter = toDateLabel,\n showGrid = true,\n className,\n animate = true,\n height,\n}: VolumeBarChartProps) => {\n const config = useMemo<ChartConfig>(() => ({ volume: { label, color: upColor } }), [label, upColor]);\n\n const chartData = useMemo(() => data.map((point, index) => ({ ...point, previousClose: index > 0 ? data[index - 1]?.close : point.close })), [data]);\n\n return (\n <ChartContainer\n data-slot=\"volume-bar-chart\"\n config={config}\n className={cn('w-full', className)}\n style={height !== undefined ? { height, aspectRatio: 'auto' } : undefined}\n >\n <BarChart data={chartData} margin={{ top: 8, right: 12, bottom: 0, left: 12 }}>\n {showGrid && <CartesianGrid vertical={false} />}\n <XAxis dataKey=\"date\" tickLine={false} axisLine={false} tickMargin={8} tickFormatter={dateFormatter} />\n <YAxis tickLine={false} axisLine={false} tickMargin={8} width={56} tickFormatter={valueFormatter} />\n <ChartTooltip\n cursor={false}\n content={\n <ChartTooltipContent\n hideIndicator\n labelFormatter={(_, payload) => {\n const date = payload?.[0]?.payload?.date;\n return date ? dateFormatter(date) : null;\n }}\n formatter={value => valueFormatter(Number(value))}\n />\n }\n />\n <Bar\n dataKey=\"volume\"\n isAnimationActive={animate}\n shape={props => {\n const point = props.payload as { close?: number; previousClose?: number } | undefined;\n const color = getDirectionColor(point?.close ?? 0, point?.previousClose ?? 0, { up: upColor, down: downColor });\n return <Rectangle {...props} fill={color} />;\n }}\n />\n </BarChart>\n </ChartContainer>\n );\n};\n","'use client';\n\nimport { useMemo } from 'react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { type ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from '@/components/ui/chart';\n\nimport { Bar, BarChart, CartesianGrid, Rectangle, XAxis, YAxis } from 'recharts';\nimport type { BaseChartProps, WaterfallPoint } from '../types';\nimport { getDirectionColor } from '../utils';\n\nexport type WaterfallChartProps = BaseChartProps & {\n data: WaterfallPoint[];\n /** Color for `isTotal` bars. Defaults to `'var(--chart-1)'`. */\n totalColor?: string;\n upColor?: string;\n downColor?: string;\n valueFormatter?: (value: number) => string;\n showGrid?: boolean;\n};\n\n/**\n * A waterfall/bridge chart — an incremental sequence of positive/negative steps between totals\n * (e.g. starting balance → revenue → costs → ending balance). Built as stacked bars: an\n * invisible \"base\" bar positions each floating step at its running total.\n *\n * @example\n * ```tsx\n * import { WaterfallChart } from '@customafk/lunas-ui/features/charts';\n *\n * <WaterfallChart\n * data={[\n * { label: 'Starting cash', value: 50000, isTotal: true },\n * { label: 'Revenue', value: 32000 },\n * { label: 'COGS', value: -18000 },\n * { label: 'Opex', value: -9000 },\n * { label: 'Ending cash', value: 55000, isTotal: true },\n * ]}\n * />\n * ```\n */\nexport const WaterfallChart = ({\n data,\n totalColor = 'var(--chart-1)',\n upColor = 'var(--success)',\n downColor = 'var(--danger)',\n valueFormatter = value => value.toLocaleString('en-US'),\n showGrid = true,\n className,\n animate = true,\n height,\n}: WaterfallChartProps) => {\n const config = useMemo<ChartConfig>(() => ({ size: { label: 'Amount', color: totalColor } }), [totalColor]);\n\n const chartData = useMemo(() => {\n let cumulative = 0;\n return data.map(point => {\n if (point.isTotal) {\n const base = 0;\n cumulative = point.value;\n return { ...point, base, size: point.value, color: totalColor, runningTotal: cumulative };\n }\n const previous = cumulative;\n cumulative += point.value;\n const base = Math.min(previous, cumulative);\n return {\n ...point,\n base,\n size: Math.abs(point.value),\n color: getDirectionColor(point.value, 0, { up: upColor, down: downColor }),\n runningTotal: cumulative,\n };\n });\n }, [data, totalColor, upColor, downColor]);\n\n return (\n <ChartContainer\n data-slot=\"waterfall-chart\"\n config={config}\n className={cn('w-full', className)}\n style={height !== undefined ? { height, aspectRatio: 'auto' } : undefined}\n >\n <BarChart data={chartData} margin={{ top: 8, right: 12, bottom: 0, left: 12 }}>\n {showGrid && <CartesianGrid vertical={false} />}\n <XAxis dataKey=\"label\" tickLine={false} axisLine={false} tickMargin={8} />\n <YAxis tickLine={false} axisLine={false} tickMargin={8} width={64} tickFormatter={valueFormatter} />\n <ChartTooltip\n cursor={false}\n content={\n <ChartTooltipContent\n hideIndicator\n formatter={(_value, _name, item) => {\n const point = item.payload as (typeof chartData)[number];\n return (\n <div className=\"grid gap-0.5\">\n <span className=\"text-muted\">\n {point.isTotal ? 'Total' : point.value >= 0 ? 'Increase' : 'Decrease'}{' '}\n <span className=\"font-medium font-number text-text-positive-strong\">{valueFormatter(point.value)}</span>\n </span>\n <span className=\"text-[11px] text-muted\">Running total {valueFormatter(point.runningTotal)}</span>\n </div>\n );\n }}\n />\n }\n />\n <Bar dataKey=\"base\" stackId=\"waterfall\" fill=\"transparent\" isAnimationActive={false} />\n <Bar\n dataKey=\"size\"\n stackId=\"waterfall\"\n isAnimationActive={animate}\n shape={props => <Rectangle {...props} fill={(props.payload as { color: string }).color} radius={2} />}\n />\n </BarChart>\n </ChartContainer>\n );\n};\n"],"mappings":"iOAAA,MAGa,EAAiB,GAA0B,gBAAkB,EAAQ,EAAqB,GAAqB,EAAqB,EAAE,GAEtI,GAAuB,EAAe,EAAS,UAC1D,IAAI,KAAK,aAAa,EAAQ,CAAE,SAAU,UAAW,sBAAuB,CAAE,CAAC,CAAC,CAAC,OAAO,CAAK,EAElF,GAAkB,EAAe,EAAW,MAAO,EAAS,UACvE,IAAI,KAAK,aAAa,EAAQ,CAC5B,MAAO,WACP,WACA,SAAU,KAAK,IAAI,CAAK,GAAK,IAAS,UAAY,WAClD,sBAAuB,OAAK,IAAI,CAAK,GAAK,IAC5C,CAAC,CAAC,CAAC,OAAO,CAAK,EAEJ,GAAiB,EAAe,EAAS,UACpD,IAAI,KAAK,aAAa,EAAQ,CAAE,MAAO,UA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