@acronis-platform/ui-react 0.58.0 → 0.61.0
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/README.md +5 -5
- package/dist/components/ui/app-shell/app-shell.js.map +1 -1
- package/dist/components/ui/area-chart/area-chart.js +210 -119
- package/dist/components/ui/area-chart/area-chart.js.map +1 -1
- package/dist/components/ui/avatar/avatar.js +26 -23
- package/dist/components/ui/avatar/avatar.js.map +1 -1
- package/dist/components/ui/bar-chart/bar-chart.js +595 -149
- package/dist/components/ui/bar-chart/bar-chart.js.map +1 -1
- package/dist/components/ui/calendar/calendar.js +17 -15
- package/dist/components/ui/calendar/calendar.js.map +1 -1
- package/dist/components/ui/carousel-dialog/carousel-dialog.js +87 -0
- package/dist/components/ui/carousel-dialog/carousel-dialog.js.map +1 -0
- package/dist/components/ui/category-bar/category-bar.js +147 -0
- package/dist/components/ui/category-bar/category-bar.js.map +1 -0
- package/dist/components/ui/chart/chart-format.js +170 -0
- package/dist/components/ui/chart/chart-format.js.map +1 -0
- package/dist/components/ui/chart/chart.js +204 -150
- package/dist/components/ui/chart/chart.js.map +1 -1
- package/dist/components/ui/composed-chart/composed-chart.js +423 -98
- package/dist/components/ui/composed-chart/composed-chart.js.map +1 -1
- package/dist/components/ui/confidence-cone/confidence-cone.js +306 -172
- package/dist/components/ui/confidence-cone/confidence-cone.js.map +1 -1
- package/dist/components/ui/dialog/dialog.js +29 -29
- package/dist/components/ui/dialog/dialog.js.map +1 -1
- package/dist/components/ui/dialog-footer-carousel/dialog-footer-carousel.js +57 -0
- package/dist/components/ui/dialog-footer-carousel/dialog-footer-carousel.js.map +1 -0
- package/dist/components/ui/dialog-footer-default/dialog-footer-default.js +1 -1
- package/dist/components/ui/dialog-footer-default/dialog-footer-default.js.map +1 -1
- package/dist/components/ui/dialog-welcome/dialog-welcome.js +272 -0
- package/dist/components/ui/dialog-welcome/dialog-welcome.js.map +1 -0
- package/dist/components/ui/funnel-chart/funnel-chart.js +245 -51
- package/dist/components/ui/funnel-chart/funnel-chart.js.map +1 -1
- package/dist/components/ui/histogram/histogram.js +96 -64
- package/dist/components/ui/histogram/histogram.js.map +1 -1
- package/dist/components/ui/input/input.js.map +1 -1
- package/dist/components/ui/line-chart/line-chart.js +230 -159
- package/dist/components/ui/line-chart/line-chart.js.map +1 -1
- package/dist/components/ui/metric/metric.js +88 -70
- package/dist/components/ui/metric/metric.js.map +1 -1
- package/dist/components/ui/pie-chart/pie-chart.js +234 -80
- package/dist/components/ui/pie-chart/pie-chart.js.map +1 -1
- package/dist/components/ui/radar-chart/radar-chart.js +210 -57
- package/dist/components/ui/radar-chart/radar-chart.js.map +1 -1
- package/dist/components/ui/radial-bar-chart/radial-bar-chart.js +358 -50
- package/dist/components/ui/radial-bar-chart/radial-bar-chart.js.map +1 -1
- package/dist/components/ui/sankey-chart/sankey-chart.js +199 -0
- package/dist/components/ui/sankey-chart/sankey-chart.js.map +1 -0
- package/dist/components/ui/scatter-chart/scatter-chart.js +86 -50
- package/dist/components/ui/scatter-chart/scatter-chart.js.map +1 -1
- package/dist/components/ui/timeline/timeline.js +206 -142
- package/dist/components/ui/timeline/timeline.js.map +1 -1
- package/dist/components/ui/toolbar/toolbar.js +82 -92
- package/dist/components/ui/toolbar/toolbar.js.map +1 -1
- package/dist/components/ui/treemap/treemap.js +183 -59
- package/dist/components/ui/treemap/treemap.js.map +1 -1
- package/dist/index.js +481 -439
- package/dist/index.js.map +1 -1
- package/dist/lib/breakpoints.js +9 -6
- package/dist/lib/breakpoints.js.map +1 -1
- package/dist/node_modules/.pnpm/embla-carousel-react@8.6.0_react@19.2.6/node_modules/embla-carousel-react/esm/embla-carousel-react.esm.js +25 -0
- package/dist/node_modules/.pnpm/embla-carousel-react@8.6.0_react@19.2.6/node_modules/embla-carousel-react/esm/embla-carousel-react.esm.js.map +1 -0
- package/dist/node_modules/.pnpm/embla-carousel-reactive-utils@8.6.0_embla-carousel@8.6.0/node_modules/embla-carousel-reactive-utils/esm/embla-carousel-reactive-utils.esm.js +36 -0
- package/dist/node_modules/.pnpm/embla-carousel-reactive-utils@8.6.0_embla-carousel@8.6.0/node_modules/embla-carousel-reactive-utils/esm/embla-carousel-reactive-utils.esm.js.map +1 -0
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/embla-carousel.esm.js +1205 -0
- package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/embla-carousel.esm.js.map +1 -0
- package/dist/react.js +481 -439
- package/dist/react.js.map +1 -1
- package/dist/src/components/ui/area-chart/area-chart.d.ts +52 -17
- package/dist/src/components/ui/area-chart/index.d.ts +1 -1
- package/dist/src/components/ui/avatar/avatar.d.ts +1 -1
- package/dist/src/components/ui/bar-chart/bar-chart.d.ts +152 -29
- package/dist/src/components/ui/bar-chart/index.d.ts +1 -1
- package/dist/src/components/ui/button/button.d.ts +1 -1
- package/dist/src/components/ui/button-menu/button-menu.d.ts +1 -1
- package/dist/src/components/ui/carousel-dialog/carousel-dialog.d.ts +28 -0
- package/dist/src/components/ui/carousel-dialog/index.d.ts +1 -0
- package/dist/src/components/ui/category-bar/category-bar.d.ts +51 -0
- package/dist/src/components/ui/category-bar/index.d.ts +1 -0
- package/dist/src/components/ui/chart/__tests__/chart-format.test.d.ts +1 -0
- package/dist/src/components/ui/chart/__tests__/chart-layout.d.ts +63 -0
- package/dist/src/components/ui/chart/__tests__/chart-layout.test.d.ts +1 -0
- package/dist/src/components/ui/chart/chart-format.d.ts +526 -0
- package/dist/src/components/ui/chart/chart.d.ts +11 -3
- package/dist/src/components/ui/chart/index.d.ts +3 -1
- package/dist/src/components/ui/composed-chart/composed-chart.d.ts +154 -20
- package/dist/src/components/ui/composed-chart/index.d.ts +1 -1
- package/dist/src/components/ui/confidence-cone/confidence-cone.d.ts +138 -37
- package/dist/src/components/ui/confidence-cone/index.d.ts +1 -1
- package/dist/src/components/ui/dialog-footer-carousel/dialog-footer-carousel.d.ts +9 -0
- package/dist/src/components/ui/dialog-footer-carousel/index.d.ts +1 -0
- package/dist/src/components/ui/dialog-welcome/dialog-welcome.d.ts +54 -0
- package/dist/src/components/ui/dialog-welcome/dialog-welcome.docs.d.ts +55 -0
- package/dist/src/components/ui/dialog-welcome/index.d.ts +1 -0
- package/dist/src/components/ui/funnel-chart/funnel-chart.d.ts +201 -3
- package/dist/src/components/ui/funnel-chart/index.d.ts +1 -1
- package/dist/src/components/ui/histogram/histogram.d.ts +2 -17
- package/dist/src/components/ui/line-chart/index.d.ts +1 -1
- package/dist/src/components/ui/line-chart/line-chart.d.ts +50 -17
- package/dist/src/components/ui/pie-chart/index.d.ts +1 -1
- package/dist/src/components/ui/pie-chart/pie-chart.d.ts +145 -4
- package/dist/src/components/ui/radar-chart/index.d.ts +1 -1
- package/dist/src/components/ui/radar-chart/radar-chart.d.ts +219 -6
- package/dist/src/components/ui/radial-bar-chart/index.d.ts +1 -1
- package/dist/src/components/ui/radial-bar-chart/radial-bar-chart.d.ts +215 -9
- package/dist/src/components/ui/sankey-chart/index.d.ts +2 -0
- package/dist/src/components/ui/sankey-chart/sankey-chart.d.ts +69 -0
- package/dist/src/components/ui/scatter-chart/scatter-chart.d.ts +2 -17
- package/dist/src/components/ui/timeline/index.d.ts +1 -1
- package/dist/src/components/ui/timeline/timeline.d.ts +79 -20
- package/dist/src/components/ui/treemap/index.d.ts +1 -1
- package/dist/src/components/ui/treemap/treemap.d.ts +68 -8
- package/dist/src/index.d.ts +5 -1
- package/dist/ui-react.css +1 -1
- package/package.json +5 -4
- package/dist/components/ui/search-global/search-global.js +0 -60
- package/dist/components/ui/search-global/search-global.js.map +0 -1
- package/dist/src/components/ui/search-global/index.d.ts +0 -1
- package/dist/src/components/ui/search-global/search-global.d.ts +0 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bar-chart.js","sources":["../../../../src/components/ui/bar-chart/bar-chart.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport {\n Bar,\n BarChart as RechartsBarChart,\n CartesianGrid,\n ReferenceLine,\n XAxis,\n YAxis,\n} from 'recharts';\n\nimport { cn } from '@/lib/utils';\nimport {\n ChartContainer,\n ChartLegend,\n ChartLegendContent,\n ChartTooltip,\n ChartTooltipContent,\n type ChartConfig,\n} from '../chart';\n\n// A typed recharts composition over the shared `Chart` primitives. The two CVA\n// axes are the design's Bar-chart variant set (B2): `orientation` (which way the\n// bars grow) and `layout` (grouped side-by-side vs stacked). The classes stay\n// empty because the recharts SVG — not CSS — draws the bars: the same two props\n// drive recharts' `layout` prop, the axis roles, the `stackId`, and the corner\n// radius below. CVA is kept so the variant set is a first-class, spec-conformant\n// part of the API (matched against ui-spec's api.yaml enums) and exposed via\n// `VariantProps`; the resolved values are also mirrored onto `data-orientation`\n// / `data-layout` for styling hooks and tests.\nconst barChartVariants = cva('', {\n variants: {\n orientation: {\n vertical: '',\n horizontal: '',\n },\n layout: {\n grouped: '',\n stacked: '',\n },\n },\n defaultVariants: {\n orientation: 'vertical',\n layout: 'grouped',\n },\n});\n\nexport interface BarChartReferenceLine {\n /** Fixed position on the value axis. Takes precedence over `average`. */\n value?: number;\n /**\n * Draw the line at the mean of one series (a `dataKeys` entry) or, when\n * `true`, of every plotted series' values.\n */\n average?: boolean | string;\n /** Optional caption rendered alongside the line. */\n label?: string;\n}\n\n/**\n * Resolve a `referenceLine` config to a position on the value axis: a fixed\n * `value` wins; otherwise the mean of the requested series (a single `dataKeys`\n * entry, or all of them when `average` is `true`). Returns `undefined` when\n * there is nothing to draw (no config, or no numeric values to average).\n * Exported for unit tests; not part of the package's public API.\n */\nexport function barChartReferenceValue(\n referenceLine: BarChartReferenceLine | undefined,\n data: ReadonlyArray<Record<string, string | number>>,\n dataKeys: string[]\n): number | undefined {\n if (!referenceLine) return undefined;\n if (typeof referenceLine.value === 'number') return referenceLine.value;\n if (!referenceLine.average) return undefined;\n\n const keys =\n typeof referenceLine.average === 'string'\n ? [referenceLine.average]\n : dataKeys;\n const nums = data.flatMap((row) =>\n keys\n .map((key) => row[key])\n .filter((value): value is number => typeof value === 'number')\n );\n if (nums.length === 0) return undefined;\n return nums.reduce((sum, n) => sum + n, 0) / nums.length;\n}\n\nexport interface BarChartProps\n extends Omit<React.ComponentProps<'div'>, 'children'>,\n VariantProps<typeof barChartVariants> {\n /** Row-per-category data. Each object holds the category key + one numeric field per series. */\n data: ReadonlyArray<Record<string, string | number>>;\n /**\n * Per-series map of `label` / `color` (imported from the shared `Chart`\n * primitives). Series colors are caller-supplied — reference an existing\n * semantic `--ui-*` token; there is no chart palette tier yet.\n */\n config: ChartConfig;\n /** Series to plot — one `<Bar>` per key. Each must exist in `config` and in every data row. */\n dataKeys: string[];\n /** Category axis key (the shared dimension across rows, e.g. `\"month\"`). */\n xKey: string;\n /**\n * One or more dashed reference/average lines on the value axis (Y for vertical\n * bars, X for horizontal). Each is driven by a fixed `value` or a computed\n * series `average`. Pass a single object or an array to draw several at once.\n */\n referenceLine?: BarChartReferenceLine | BarChartReferenceLine[];\n /** Title rendered beneath the horizontal (X) axis. */\n xAxisLabel?: string;\n /** Title rendered beside the vertical (Y) axis (rotated). */\n yAxisLabel?: string;\n /** Unit suffix on X-axis tick values (recharts `unit`) — applies when the X axis is numeric (`orientation=\"horizontal\"`). */\n xUnit?: string;\n /** Unit suffix on Y-axis tick values (recharts `unit`) — applies when the Y axis is numeric (`orientation=\"vertical\"`). */\n yUnit?: string;\n /** Corner radius applied to the growing end of each bar. */\n barRadius?: number;\n showGrid?: boolean;\n showTooltip?: boolean;\n showLegend?: boolean;\n /**\n * Replace the default tooltip. Pass a configured `ChartTooltipContent`\n * (imported from this library) — e.g. with a `formatter` / `labelFormatter` /\n * `indicator` — to customize formatting, per-series rows, or extra fields\n * without composing recharts yourself. Ignored when `showTooltip` is false.\n */\n tooltipContent?: React.ComponentProps<typeof ChartTooltip>['content'];\n}\n\nconst BarChart = React.forwardRef<HTMLDivElement, BarChartProps>(\n (\n {\n className,\n config,\n data,\n dataKeys,\n xKey,\n referenceLine,\n xAxisLabel,\n yAxisLabel,\n xUnit,\n yUnit,\n orientation = 'vertical',\n layout = 'grouped',\n barRadius = 4,\n showGrid = true,\n showTooltip = true,\n showLegend = true,\n tooltipContent,\n ...props\n },\n ref\n ) => {\n // Our `orientation` is bar-direction; recharts' `layout` is the opposite axis.\n const rechartsLayout = orientation === 'horizontal' ? 'vertical' : 'horizontal';\n const isStacked = layout === 'stacked';\n\n const referenceLines = referenceLine\n ? Array.isArray(referenceLine)\n ? referenceLine\n : [referenceLine]\n : [];\n\n // Axis titles: the X title sits below the ticks; the Y title is rotated in\n // the left gutter. Passed to recharts' native `label` (themed via the\n // `.recharts-label` fill selector on the container).\n const xAxisTitle = xAxisLabel\n ? { value: xAxisLabel, position: 'insideBottom' as const, offset: 0 }\n : undefined;\n const yAxisTitle = yAxisLabel\n ? {\n value: yAxisLabel,\n angle: -90,\n position: 'insideLeft' as const,\n style: { textAnchor: 'middle' as const },\n }\n : undefined;\n\n // Round only the growing end: top for vertical bars, right for horizontal.\n const endRadius: [number, number, number, number] =\n orientation === 'horizontal'\n ? [0, barRadius, barRadius, 0]\n : [barRadius, barRadius, 0, 0];\n\n return (\n <div\n ref={ref}\n data-orientation={orientation}\n data-layout={layout}\n className={cn(barChartVariants({ orientation, layout }), className)}\n {...props}\n >\n <ChartContainer\n config={config}\n className=\"size-full [&_.recharts-label]:fill-foreground\"\n >\n <RechartsBarChart data={data as readonly unknown[]} layout={rechartsLayout}>\n {showGrid && (\n <CartesianGrid\n horizontal={orientation === 'vertical'}\n vertical={orientation === 'horizontal'}\n />\n )}\n {orientation === 'horizontal' ? (\n <>\n <XAxis\n type=\"number\"\n tickLine={false}\n axisLine={false}\n unit={xUnit}\n height={xAxisLabel ? 48 : undefined}\n label={xAxisTitle}\n />\n <YAxis\n dataKey={xKey}\n type=\"category\"\n tickLine={false}\n axisLine={false}\n width={yAxisLabel ? 96 : 80}\n label={yAxisTitle}\n />\n </>\n ) : (\n <>\n <XAxis\n dataKey={xKey}\n type=\"category\"\n tickLine={false}\n axisLine={false}\n height={xAxisLabel ? 48 : undefined}\n label={xAxisTitle}\n />\n <YAxis\n type=\"number\"\n tickLine={false}\n axisLine={false}\n unit={yUnit}\n width={yAxisLabel ? 72 : undefined}\n label={yAxisTitle}\n />\n </>\n )}\n {showTooltip && (\n <ChartTooltip content={tooltipContent ?? <ChartTooltipContent />} />\n )}\n {showLegend && <ChartLegend content={<ChartLegendContent />} />}\n {dataKeys.map((key, index) => {\n // In a stack only the last segment's end is rounded; grouped bars\n // each round their own end.\n const rounded = isStacked ? index === dataKeys.length - 1 : true;\n return (\n <Bar\n key={key}\n dataKey={key}\n fill={`var(--color-${key})`}\n stackId={isStacked ? 'a' : undefined}\n radius={barRadius > 0 && rounded ? endRadius : undefined}\n isAnimationActive={false}\n />\n );\n })}\n {referenceLines.map((ref, index) => {\n const value = barChartReferenceValue(ref, data, dataKeys);\n if (value === undefined) return null;\n return (\n <ReferenceLine\n key={`${ref.label ?? 'ref'}-${index}`}\n // Draw on the value axis: Y for vertical bars, X for horizontal.\n {...(orientation === 'horizontal' ? { x: value } : { y: value })}\n stroke=\"var(--ui-text-on-surface-secondary)\"\n strokeDasharray=\"4 4\"\n // extendDomain so a target beyond the data max stays visible.\n ifOverflow=\"extendDomain\"\n label={\n ref.label\n ? {\n value: ref.label,\n // Sit the caption at the top of the line: above the\n // right end of a horizontal line (vertical bars), or\n // above the top of a vertical line (horizontal bars).\n position:\n orientation === 'horizontal'\n ? 'top'\n : 'insideTopRight',\n fill: 'var(--ui-text-on-surface-secondary)',\n fontSize: 12,\n }\n : undefined\n }\n />\n );\n })}\n </RechartsBarChart>\n </ChartContainer>\n </div>\n );\n }\n);\nBarChart.displayName = 'BarChart';\n\nexport { BarChart, barChartVariants };\n"],"names":["barChartVariants","cva","barChartReferenceValue","referenceLine","data","dataKeys","keys","nums","row","key","value","sum","n","BarChart","React","className","config","xKey","xAxisLabel","yAxisLabel","xUnit","yUnit","orientation","layout","barRadius","showGrid","showTooltip","showLegend","tooltipContent","props","ref","rechartsLayout","isStacked","referenceLines","xAxisTitle","yAxisTitle","endRadius","jsx","cn","ChartContainer","jsxs","RechartsBarChart","CartesianGrid","Fragment","XAxis","YAxis","ChartTooltip","ChartTooltipContent","ChartLegend","ChartLegendContent","index","rounded","Bar","ReferenceLine"],"mappings":";;;;;;AAgCA,MAAMA,IAAmBC,EAAI,IAAI;AAAA,EAC/B,UAAU;AAAA,IACR,aAAa;AAAA,MACX,UAAU;AAAA,MACV,YAAY;AAAA,IAAA;AAAA,IAEd,QAAQ;AAAA,MACN,SAAS;AAAA,MACT,SAAS;AAAA,IAAA;AAAA,EACX;AAAA,EAEF,iBAAiB;AAAA,IACf,aAAa;AAAA,IACb,QAAQ;AAAA,EAAA;AAEZ,CAAC;AAqBM,SAASC,EACdC,GACAC,GACAC,GACoB;AACpB,MAAI,CAACF,EAAe;AACpB,MAAI,OAAOA,EAAc,SAAU,iBAAiBA,EAAc;AAClE,MAAI,CAACA,EAAc,QAAS;AAE5B,QAAMG,IACJ,OAAOH,EAAc,WAAY,WAC7B,CAACA,EAAc,OAAO,IACtBE,GACAE,IAAOH,EAAK;AAAA,IAAQ,CAACI,MACzBF,EACG,IAAI,CAACG,MAAQD,EAAIC,CAAG,CAAC,EACrB,OAAO,CAACC,MAA2B,OAAOA,KAAU,QAAQ;AAAA,EAAA;AAEjE,MAAIH,EAAK,WAAW;AACpB,WAAOA,EAAK,OAAO,CAACI,GAAKC,MAAMD,IAAMC,GAAG,CAAC,IAAIL,EAAK;AACpD;AA6CA,MAAMM,IAAWC,EAAM;AAAA,EACrB,CACE;AAAA,IACE,WAAAC;AAAA,IACA,QAAAC;AAAA,IACA,MAAAZ;AAAA,IACA,UAAAC;AAAA,IACA,MAAAY;AAAA,IACA,eAAAd;AAAA,IACA,YAAAe;AAAA,IACA,YAAAC;AAAA,IACA,OAAAC;AAAA,IACA,OAAAC;A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T,MAAM,eAAeA,CAAG;AAAA,oBACxB,SAASuB,IAAY,MAAM;AAAA,oBAC3B,QAAQR,IAAY,KAAK2B,IAAUf,IAAY;AAAA,oBAC/C,mBAAmB;AAAA,kBAAA;AAAA,kBALd3B;AAAA,gBAAA;AAAA,cAQX,CAAC;AAAA,cACAwB,EAAe,IAAI,CAACH,GAAKoB,MAAU;AAClC,sBAAMxC,IAAQR,EAAuB4B,GAAK1B,GAAMC,CAAQ;AACxD,uBAAIK,MAAU,SAAkB,OAE9B,gBAAA2B;AAAA,kBAACgB;AAAA,kBAAA;AAAA,oBAGE,GAAI/B,MAAgB,eAAe,EAAE,GAAGZ,MAAU,EAAE,GAAGA,EAAA;AAAA,oBACxD,QAAO;AAAA,oBACP,iBAAgB;AAAA,oBAEhB,YAAW;AAAA,oBACX,OACEoB,EAAI,QACA;AAAA,sBACE,OAAOA,EAAI;AAAA;AAAA;AAAA;AAAA,sBAIX,UACER,MAAgB,eACZ,QACA;AAAA,sBACN,MAAM;AAAA,sBACN,UAAU;AAAA,oBAAA,IAEZ;AAAA,kBAAA;AAAA,kBArBD,GAAGQ,EAAI,SAAS,KAAK,IAAIoB,CAAK;AAAA,gBAAA;AAAA,cAyBzC,CAAC;AAAA,YAAA,EAAA,CACH;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAGN;AACF;AACArC,EAAS,cAAc;"}
|
|
1
|
+
{"version":3,"file":"bar-chart.js","sources":["../../../../src/components/ui/bar-chart/bar-chart.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport {\n Bar,\n BarChart as RechartsBarChart,\n Brush,\n CartesianGrid,\n Cell,\n LabelList,\n ReferenceArea,\n ReferenceLine,\n Rectangle,\n Text,\n XAxis,\n YAxis,\n} from 'recharts';\n\nimport type { BarShapeProps } from 'recharts/types/cartesian/Bar';\n\nimport { cn } from '@/lib/utils';\nimport {\n CHART_LABEL_FONT_SIZE,\n ChartContainer,\n ChartLegend,\n ChartLegendContent,\n ChartTooltip,\n ChartTooltipContent,\n resolveAnimation,\n resolveAxisDomain,\n resolveBrushProps,\n resolveCartesianLabelPosition,\n resolveCategoryRange,\n resolveChartReferenceValue,\n resolveLabelFillClass,\n resolveReferenceLineProps,\n resolveRotatedTickAnchor,\n resolveXAxisHeight,\n resolveXAxisTitle,\n resolveYAxisTitle,\n toLabelFormatter,\n toReferenceLineList,\n type ChartConfig,\n type ChartReferenceLine,\n type ChartLegendContentProps,\n type ChartTooltipContentProps,\n type CartesianChartProps,\n type ChartAnimationProps,\n type ChartBrushProps,\n type ChartCategoryRange,\n type ChartDataLabelProps,\n type CartesianLabelPosition,\n} from '../chart';\n\n// A typed recharts composition over the shared `Chart` primitives. The two CVA\n// axes are the design's Bar-chart variant set (B2): `orientation` (which way the\n// bars grow) and `layout` (grouped side-by-side vs stacked). The classes stay\n// empty because the recharts SVG — not CSS — draws the bars: the same two props\n// drive recharts' `layout` prop, the axis roles, the `stackId`, and the corner\n// radius below. CVA is kept so the variant set is a first-class, spec-conformant\n// part of the API (matched against ui-spec's api.yaml enums) and exposed via\n// `VariantProps`; the resolved values are also mirrored onto `data-orientation`\n// / `data-layout` for styling hooks and tests.\nconst barChartVariants = cva('', {\n variants: {\n orientation: {\n vertical: '',\n horizontal: '',\n },\n layout: {\n grouped: '',\n stacked: '',\n },\n },\n defaultVariants: {\n orientation: 'vertical',\n layout: 'grouped',\n },\n});\n\n/**\n * How a bar is painted. `rounded` rounds the growing end by `barRadius`; `pill`\n * rounds every corner to a capsule; `gradient` fades the series color down the\n * bar; `pattern` fills it with diagonal hatching in the series color (a\n * colorblind-safe way to set a subset of bars apart).\n */\nexport type BarChartBarShape = 'rounded' | 'pill' | 'gradient' | 'pattern';\n\n/**\n * Style override for one series over a range of categories — e.g. \"the forecast\n * tail from September onward reads translucent and dashed\". Anything left unset\n * keeps the series' normal painting.\n */\nexport interface BarChartBarSettings extends ChartCategoryRange {\n /** Fill for the matched bars. Defaults to the series color. */\n fill?: string;\n /** Fill opacity for the matched bars. */\n opacity?: number;\n /** Outline the matched bars with a dashed stroke in the series color. */\n dashed?: boolean;\n /** Shape for the matched bars, overriding the chart's `barShape`. */\n shape?: BarChartBarShape;\n /**\n * Track behind the matched bars: `true` fills the plot height, while a data\n * field name caps it at that row's value — the headroom between a projection\n * and its upper bound. A capped track stacks on its bar, so it needs the\n * default `layout=\"grouped\"`; under `layout=\"stacked\"` it is ignored.\n */\n background?: boolean | string;\n}\n\n/** A shaded band behind a range of categories. */\nexport interface BarChartReferenceArea extends ChartCategoryRange {\n /** Caption above the band. */\n label?: string;\n /**\n * Mark the category ticks under the band — accent color, italic — so the\n * highlighted range reads on the axis too. On by default.\n */\n highlightTicks?: boolean;\n /**\n * Draw a dashed rule at the band's leading edge — the hand-off into a\n * forecast. Off by default.\n */\n divider?: boolean;\n}\n\n// Reserved field prefix for the synthetic headroom series a capped track\n// stacks onto its bar. It must never surface in the tooltip or the legend.\nconst HEADROOM_FIELD_PREFIX = '__headroom_';\n\n/**\n * Drop the synthetic headroom series from a recharts tooltip/legend payload,\n * keeping the real series (and their order). `legendType`/`tooltipType=\"none\"`\n * are set on those bars too, but recharts still lists them, so this filter is\n * what actually keeps them out — hence it's unit-tested.\n */\nexport function dropHeadroomSeries<T extends { dataKey?: unknown }>(\n payload: readonly T[] | undefined,\n dataKeys?: string[]\n): T[] | undefined {\n const real = payload?.filter(\n (item) => !String(item.dataKey).startsWith(HEADROOM_FIELD_PREFIX)\n );\n // recharts sorts the legend payload alphabetically by series name by default\n // (its `itemSorter: 'value'`), so passing `dataKeys` puts the entries back in\n // the order the caller declared them.\n return dataKeys\n ? real?.slice().sort(\n (a, b) =>\n dataKeys.indexOf(String(a.dataKey)) -\n dataKeys.indexOf(String(b.dataKey))\n )\n : real;\n}\n\n/**\n * Swap a paint-server fill back to the series color for the chrome. A\n * `gradient` / `pattern` bar fills from `url(#…)`, which paints SVG but means\n * nothing as a CSS background — the legend swatch and the tooltip dot would\n * render blank — so they fall back to the series' own `--color-<key>`.\n */\nexport function withSeriesColor<T extends { dataKey?: unknown; color?: string }>(\n payload: readonly T[] | undefined\n): T[] | undefined {\n return payload?.map((item) =>\n item.color?.startsWith('url(')\n ? { ...item, color: `var(--color-${String(item.dataKey)})` }\n : item\n );\n}\n\ntype TooltipContentType = NonNullable<\n React.ComponentProps<typeof ChartTooltip>['content']\n>;\ntype TooltipContentFn = Extract<\n TooltipContentType,\n (...args: never[]) => unknown\n>;\ntype TooltipRenderProps = Parameters<TooltipContentFn>[0];\n\ntype LegendContentType = NonNullable<\n React.ComponentProps<typeof ChartLegend>['content']\n>;\ntype LegendContentFn = Extract<LegendContentType, (...args: never[]) => unknown>;\ntype LegendRenderProps = Parameters<LegendContentFn>[0];\n\n/**\n * Tooltip content that normalizes recharts' payload before anything renders it:\n * the synthetic headroom series stripped, the rows put back in `dataKeys` order,\n * and paint-server fills swapped back to the series color. Falls through to a\n * caller-supplied `content`, preserving recharts' own mount semantics — a\n * function via `createElement` (its own component identity + hook state), an\n * element via `cloneElement`.\n *\n * This is a component rather than a per-render wrapper factory on purpose:\n * recharts renders `content` by cloning the element it is given\n * (`Tooltip.js:27-28`), so a stable module-level type here means the subtree is\n * never remounted, whatever the caller passes.\n */\nexport function NormalizedTooltipContent({\n content,\n dataKeys,\n ...props\n}: Partial<TooltipRenderProps> & {\n content?: TooltipContentType;\n dataKeys?: string[];\n}) {\n const merged = {\n ...props,\n payload: withSeriesColor(dropHeadroomSeries(props.payload, dataKeys)),\n } as TooltipRenderProps;\n\n if (!content) {\n return <ChartTooltipContent {...(merged as ChartTooltipContentProps)} />;\n }\n return typeof content === 'function'\n ? React.createElement(\n content as React.FunctionComponent<TooltipRenderProps>,\n merged\n )\n : React.cloneElement(content, merged);\n}\n\n/**\n * Legend content over the same normalization. Ordering is the reason this\n * applies unconditionally: recharts sorts legend entries alphabetically by\n * series name by default (`itemSorter: 'value'`), so without putting them back\n * in `dataKeys` order the legend would silently reorder itself depending on\n * which bar-styling props happen to be set.\n */\nexport function NormalizedLegendContent({\n dataKeys,\n ...props\n}: Partial<LegendRenderProps> & { dataKeys: string[] }) {\n return (\n <ChartLegendContent\n verticalAlign={props.verticalAlign}\n payload={\n withSeriesColor(\n dropHeadroomSeries(props.payload, dataKeys)\n ) as ChartLegendContentProps['payload']\n }\n />\n );\n}\n\n/** Paint overrides recharts spreads over a bar to mark it as the active one. */\ninterface BarPaintOverride {\n fill?: string;\n fillOpacity?: number;\n}\n\n/**\n * Draw a bar, optionally over its full-height track (recharts hands a custom\n * `<Bar shape>` the track geometry alongside the bar's). Only geometry and\n * paint props are forwarded — recharts also passes the whole data entry, and\n * spreading that onto an SVG node would leak data fields into the DOM.\n *\n * `paint` is how the active bar keeps its track: recharts swaps a custom\n * `shape` out for the `activeBar` option while a bar is hovered\n * (`Bar.js` `BarRectangleWithActiveState`), so the active option has to be a\n * shape of its own that redraws the track and applies the highlight itself.\n */\nfunction renderBarWithTrack({\n bar,\n track,\n trackFill,\n paint,\n}: {\n bar: Omit<BarShapeProps, 'background' | 'index'>;\n track?: BarShapeProps['background'];\n trackFill: string;\n paint?: BarPaintOverride;\n}) {\n return (\n <>\n {track && (\n <Rectangle\n className=\"recharts-bar-background-rectangle\"\n x={track.x ?? undefined}\n y={track.y ?? undefined}\n width={track.width ?? undefined}\n height={track.height ?? undefined}\n fill={trackFill}\n />\n )}\n <Rectangle\n x={bar.x ?? undefined}\n y={bar.y ?? undefined}\n width={bar.width ?? undefined}\n height={bar.height ?? undefined}\n radius={bar.radius}\n fill={paint?.fill ?? bar.fill}\n fillOpacity={paint?.fillOpacity ?? bar.fillOpacity}\n stroke={bar.stroke}\n strokeWidth={bar.strokeWidth}\n strokeDasharray={bar.strokeDasharray}\n />\n </>\n );\n}\n\n/**\n * Build the `<Bar shape>` that draws a range-scoped track. recharts' own\n * `background` is all-or-nothing per series, so the track is drawn per row and\n * hidden where the range doesn't apply.\n */\nexport function createTrackShape({\n inRange,\n trackFill,\n paint,\n}: {\n inRange: (row: number) => boolean;\n trackFill: string;\n paint?: BarPaintOverride;\n}) {\n return ({ background: track, index: row, ...bar }: BarShapeProps) =>\n renderBarWithTrack({\n bar,\n track: inRange(row) ? track : undefined,\n trackFill,\n paint,\n });\n}\n\n/**\n * The `shape` / `activeBar` pair one series' `<Bar>` is given.\n *\n * They resolve together because recharts swaps a custom `shape` out for the\n * `activeBar` option while a bar is hovered: a range-scoped track has to be\n * redrawn by the active option too, or the track blinks out under the cursor.\n */\nfunction resolveBarShapes({\n rangeBackground,\n inRange,\n trackFill,\n activeBarOption,\n}: {\n /**\n * recharts takes one `background` per series, so a range-scoped one is drawn\n * per row by a custom shape instead: hidden where it doesn't apply.\n */\n rangeBackground: boolean;\n inRange: (row: number) => boolean;\n trackFill: string;\n activeBarOption: BarPaintOverride | false;\n}) {\n if (!rangeBackground) {\n return { shape: undefined, activeBar: activeBarOption };\n }\n return {\n shape: createTrackShape({ inRange, trackFill }),\n activeBar: activeBarOption\n ? createTrackShape({ inRange, trackFill, paint: activeBarOption })\n : activeBarOption,\n };\n}\n\n/**\n * Draw a highlight band plus a dashed rule on its leading edge: the left edge\n * for vertical bars (the category axis runs along X), the top edge otherwise.\n *\n * The band's own paint comes from the props recharts hands the shape — a\n * `<ReferenceArea shape>` still receives the element's `fill`/`fillOpacity`\n * (`ReferenceArea.js` `renderRect`), so hardcoding them here would quietly\n * ignore whatever the caller set.\n */\nfunction renderBandWithDivider({\n band,\n vertical,\n}: {\n band: {\n x?: number;\n y?: number;\n width?: number;\n height?: number;\n fill?: string;\n fillOpacity?: number;\n };\n vertical: boolean;\n}) {\n const { x = 0, y = 0, width = 0, height = 0, fill, fillOpacity } = band;\n return (\n <>\n <Rectangle\n className=\"recharts-reference-area-rect\"\n x={x}\n y={y}\n width={width}\n height={height}\n fill={fill}\n fillOpacity={fillOpacity}\n />\n <line\n x1={x}\n y1={y}\n x2={vertical ? x : x + width}\n y2={vertical ? y + height : y}\n stroke=\"var(--ui-border-on-surface-border)\"\n strokeDasharray=\"4 4\"\n />\n </>\n );\n}\n\n/**\n * The `<ReferenceArea shape>` for a band, or `undefined` so recharts draws its\n * own rect. A custom shape is only needed for the leading-edge rule: a\n * `ReferenceLine` would sit on the tick's centre, and only the band knows where\n * its own edge is.\n */\nfunction resolveBandShape({\n divider,\n vertical,\n}: {\n divider: boolean | undefined;\n vertical: boolean;\n}) {\n if (!divider) return undefined;\n return (band: { x?: number; y?: number; width?: number; height?: number }) =>\n renderBandWithDivider({ band, vertical });\n}\n\n/**\n * A band's caption as recharts' native `label`. `'insideTop'` is asserted\n * because, read outside the JSX attribute, it would widen to `string` and stop\n * matching recharts' `Position` union.\n */\nfunction resolveBandLabel(label: string | undefined) {\n return label\n ? {\n value: label,\n position: 'insideTop' as const,\n fill: 'var(--ui-text-on-surface-secondary)',\n fontSize: 12,\n }\n : undefined;\n}\n\n/**\n * The `<defs>` a `gradient` / `pattern` bar fills from — one paint server per\n * series, since each is painted in that series' own color. Ids are namespaced\n * by the chart instance so two charts on a page can't collide.\n *\n * Safe to render as a component: unlike `Bar`'s cells, the chart renders its\n * children straight through rather than looking them up by type.\n */\nfunction BarPaintServers({\n id,\n dataKeys,\n shapes,\n horizontal,\n}: {\n id: string;\n dataKeys: string[];\n shapes: ReadonlySet<BarChartBarShape>;\n /** Bars grow along X, so a gradient runs left-to-right instead of top-down. */\n horizontal: boolean;\n}) {\n const hasGradient = shapes.has('gradient');\n const hasPattern = shapes.has('pattern');\n if (!hasGradient && !hasPattern) return null;\n\n return (\n <defs>\n {dataKeys.map((key) => (\n <React.Fragment key={key}>\n {hasGradient && (\n <linearGradient\n id={`${id}-gradient-${key}`}\n x1=\"0\"\n y1=\"0\"\n x2={horizontal ? '1' : '0'}\n y2={horizontal ? '0' : '1'}\n >\n <stop\n offset=\"0%\"\n stopColor={`var(--color-${key})`}\n stopOpacity={1}\n />\n <stop\n offset=\"100%\"\n stopColor={`var(--color-${key})`}\n stopOpacity={0.35}\n />\n </linearGradient>\n )}\n {hasPattern && (\n <pattern\n id={`${id}-pattern-${key}`}\n patternUnits=\"userSpaceOnUse\"\n width={6}\n height={6}\n patternTransform=\"rotate(45)\"\n >\n <rect\n width={6}\n height={6}\n fill={`var(--color-${key})`}\n fillOpacity={0.25}\n />\n <line\n x1={0}\n y1={0}\n x2={0}\n y2={6}\n stroke={`var(--color-${key})`}\n strokeWidth={3}\n />\n </pattern>\n )}\n </React.Fragment>\n ))}\n </defs>\n );\n}\n\n/** Corner radius as recharts' `Rectangle` takes it: one value or a 4-tuple. */\ntype BarRadius = number | [number, number, number, number] | undefined;\n\ninterface RangeCellsOptions {\n data: ReadonlyArray<Record<string, string | number>>;\n /** `data` plus the synthetic headroom fields, if any were added. */\n chartData: ReadonlyArray<Record<string, string | number>>;\n xKey: string;\n seriesKey: string;\n settings: BarChartBarSettings;\n /** Inclusive row bounds the settings apply to. */\n range: [number, number];\n headroomKey: string | undefined;\n barShape: BarChartBarShape;\n rounded: boolean;\n fillOf: (key: string, shape: BarChartBarShape) => string;\n radiusFor: (shape: BarChartBarShape, rounded: boolean) => BarRadius;\n}\n\n/**\n * The `<Cell>` list that applies a series' `barSettings` over its range: the\n * matched rows take the override fill/opacity/dash/shape, the rest keep the\n * series' normal painting.\n *\n * A plain function returning the elements, deliberately not a component:\n * `Bar` discovers its cells with `findAllByType(props.children, Cell)`\n * (recharts `Bar.js`), which matches each direct child on its own display\n * name. Wrapping these in a component would make that lookup find nothing and\n * silently drop every per-range style — no error, just unstyled bars.\n * Returning an array keeps them direct children, since recharts' `toArray`\n * flattens arrays and unwraps fragments.\n */\nfunction rangeCells({\n data,\n chartData,\n xKey,\n seriesKey,\n settings,\n range,\n headroomKey,\n barShape,\n rounded,\n fillOf,\n radiusFor,\n}: RangeCellsOptions) {\n const { fill, opacity, dashed } = settings;\n\n return data.map((row, rowIndex) => {\n const on = rowIndex >= range[0] && rowIndex <= range[1];\n const shape = (on && settings.shape) || barShape;\n // Only a row that actually carries headroom gives up its rounded end — a\n // row in range whose upper bound is missing, or no higher than its value,\n // keeps it.\n const stacksHeadroom =\n headroomKey !== undefined &&\n Number(\n (chartData[rowIndex] as Record<string, unknown>)?.[\n `${HEADROOM_FIELD_PREFIX}${seriesKey}`\n ]\n ) > 0;\n\n return (\n <Cell\n key={`${seriesKey}-${String(row[xKey])}-${rowIndex}`}\n fill={\n on ? (fill ?? fillOf(seriesKey, shape)) : fillOf(seriesKey, barShape)\n }\n fillOpacity={on ? opacity : undefined}\n stroke={on && dashed ? `var(--color-${seriesKey})` : undefined}\n strokeWidth={on && dashed ? 1 : undefined}\n strokeDasharray={on && dashed ? '4 3' : undefined}\n // Cell types `radius` as the SVG attribute, but it feeds recharts'\n // Rectangle, which takes the 4-tuple. A bar with headroom stacked on it\n // hands the rounded end to that segment instead.\n radius={\n (stacksHeadroom ? undefined : radiusFor(shape, rounded)) as\n | number\n | undefined\n }\n />\n );\n });\n}\n\nexport interface BarChartProps\n extends Omit<React.ComponentProps<'div'>, 'children'>,\n VariantProps<typeof barChartVariants>,\n CartesianChartProps,\n ChartAnimationProps,\n ChartBrushProps,\n ChartDataLabelProps {\n /** Row-per-category data. Each object holds the category key + one numeric field per series. */\n data: ReadonlyArray<Record<string, string | number>>;\n /**\n * Per-series map of `label` / `color` (imported from the shared `Chart`\n * primitives). Series colors are caller-supplied — reference an existing\n * semantic `--ui-*` token; there is no chart palette tier yet.\n */\n config: ChartConfig;\n /** Series to plot — one `<Bar>` per key. Each must exist in `config` and in every data row. */\n dataKeys: string[];\n /** Category axis key (the shared dimension across rows, e.g. `\"month\"`). */\n xKey: string;\n /**\n * One or more dashed reference/average lines on the value axis (Y for vertical\n * bars, X for horizontal). Each is driven by a fixed `value` or a computed\n * series `average`. Pass a single object or an array to draw several at once.\n */\n referenceLine?: ChartReferenceLine | ChartReferenceLine[];\n /**\n * One or more shaded bands behind a range of categories — e.g. a forecast\n * period. Pass a single object or an array to draw several.\n */\n referenceArea?: BarChartReferenceArea | BarChartReferenceArea[];\n /**\n * Per-series style override for a range of categories, keyed by `dataKeys`\n * entry. Bars outside a series' range — and series with no entry — render\n * normally.\n */\n barSettings?: Record<string, BarChartBarSettings>;\n /** Unit suffix on X-axis tick values (recharts `unit`) — applies when the X axis is numeric (`orientation=\"horizontal\"`). */\n xUnit?: string;\n /** Corner radius applied to the growing end of each bar. */\n barRadius?: number;\n /** How every bar is painted. Per-range overrides come from `barSettings`. */\n barShape?: BarChartBarShape;\n /** Fixed bar thickness, in px. Unset, recharts sizes bars from the available width. */\n barSize?: number;\n /** Upper bound on the computed bar thickness, in px. */\n maxBarSize?: number;\n /** Gap between bars of the same category, in px or a percentage string. */\n barGap?: number | string;\n /** Gap between category groups, in px or a percentage string. */\n barCategoryGap?: number | string;\n /**\n * Minimum rendered length for a bar, in px, so a tiny value stays visible. A\n * value of exactly `0` still renders nothing — a floor on it would read as a\n * small positive.\n */\n minPointSize?: number;\n /** Draw a full-height track behind every bar. */\n showBackground?: boolean;\n /** Fill for the track background. Defaults to the secondary surface. */\n backgroundFill?: string;\n /** Highlight the hovered bar. */\n showActiveBar?: boolean;\n /** Painting of the hovered bar when `showActiveBar` is on. */\n activeBar?: {\n /** Fill for the hovered bar. Defaults to the series color. */\n fill?: string;\n /** Fill opacity for the hovered bar. */\n opacity?: number;\n };\n showLegend?: boolean;\n /**\n * Position of the value labels when `showLabels` is on. Defaults to the growing\n * end — `top` for vertical bars, `right` for horizontal.\n */\n labelPosition?: CartesianLabelPosition;\n}\n\nconst BarChart = React.forwardRef<HTMLDivElement, BarChartProps>(\n (\n {\n className,\n config,\n data,\n dataKeys,\n xKey,\n referenceLine,\n referenceArea,\n barSettings,\n xAxisLabel,\n yAxisLabel,\n xUnit,\n yUnit,\n orientation = 'vertical',\n layout = 'grouped',\n barRadius = 4,\n barShape = 'rounded',\n barSize,\n maxBarSize,\n barGap,\n barCategoryGap,\n minPointSize,\n showBackground = false,\n backgroundFill = 'var(--ui-background-surface-secondary)',\n showActiveBar = false,\n activeBar,\n showGrid = true,\n showTooltip = true,\n showLegend = true,\n showXAxis = true,\n showYAxis = true,\n xTickFormatter,\n yTickFormatter,\n xAxisAngle,\n xAxisInterval,\n yAxisTickCount,\n yAxisDomain,\n gridDashed,\n gridHorizontal,\n gridVertical,\n tooltipContent,\n animate,\n animationDuration,\n animationBegin,\n animationEasing,\n showLabels = false,\n labelPosition,\n labelFormatter,\n showBrush = false,\n brushHeight,\n brushAriaLabel,\n ...props\n },\n ref\n ) => {\n const animation = resolveAnimation({\n animate,\n animationDuration,\n animationBegin,\n animationEasing,\n });\n // Our `orientation` is bar-direction; recharts' `layout` is the opposite axis.\n const rechartsLayout = orientation === 'horizontal' ? 'vertical' : 'horizontal';\n const isStacked = layout === 'stacked';\n // Labels sit at the growing end of the bar: above vertical bars, to the\n // right of horizontal ones — or centred in the segment when stacked.\n const barLabelPosition = resolveCartesianLabelPosition({\n labelPosition,\n isStacked,\n growingEnd: orientation === 'horizontal' ? 'right' : 'top',\n });\n\n const referenceLines = toReferenceLineList(referenceLine);\n\n // Bands + the per-series overrides resolved to inclusive row indices once,\n // so the Cells below are a lookup rather than a search per bar.\n const referenceAreas = (\n referenceArea\n ? Array.isArray(referenceArea)\n ? referenceArea\n : [referenceArea]\n : []\n )\n .map((area) => ({ area, range: resolveCategoryRange(area, data, xKey) }))\n .filter(\n (entry): entry is { area: BarChartReferenceArea; range: [number, number] } =>\n entry.range !== undefined\n );\n\n const settingsByKey = new Map(\n dataKeys.flatMap((key) => {\n const settings = barSettings?.[key];\n const range = settings\n ? resolveCategoryRange(settings, data, xKey)\n : undefined;\n return settings && range ? [[key, { settings, range }] as const] : [];\n })\n );\n\n // A capped track is drawn as a synthetic remainder (upper bound minus the\n // bar's own value) stacked on the bar, so recharts scales and animates it\n // rather than us guessing the axis scale from a mid-animation geometry.\n const headroomKeys = new Map(\n isStacked\n ? []\n : Array.from(settingsByKey, ([key, entry]) =>\n typeof entry.settings.background === 'string'\n ? ([key, entry.settings.background] as const)\n : undefined\n ).filter((pair): pair is readonly [string, string] => pair !== undefined)\n );\n\n const chartData = headroomKeys.size\n ? data.map((row, rowIndex) => {\n const extra: Record<string, number> = {};\n headroomKeys.forEach((upperKey, key) => {\n const entry = settingsByKey.get(key);\n if (!entry) return;\n const [start, end] = entry.range;\n if (rowIndex < start || rowIndex > end) return;\n const value = row[key];\n const upper = row[upperKey];\n if (typeof value !== 'number' || typeof upper !== 'number') return;\n extra[`${HEADROOM_FIELD_PREFIX}${key}`] = Math.max(0, upper - value);\n });\n return { ...row, ...extra };\n })\n : data;\n\n // The ticks under a band pick up the accent styling unless the band opts\n // out. Resolved to the categories' own values rather than kept as row\n // indices, because neither index a tick carries can be trusted here: the\n // `index` prop is a position in the list recharts actually renders, which\n // a numeric `interval` (and the default `preserveEnd`, dropping labels that\n // don't fit) has already filtered, and `payload.index` is relative to the\n // slice a `showBrush` selection leaves. The value survives both.\n const highlightedValues = new Set(\n referenceAreas\n .filter(({ area }) => area.highlightTicks !== false)\n .flatMap(({ range }) =>\n data.slice(range[0], range[1] + 1).map((row) => row[xKey])\n )\n );\n\n // recharts places the tick and hands the element its final geometry; we\n // reuse its own <Text> so angle/anchor behavior is unchanged and only add\n // the accent styling for the highlighted range. The formatter still takes\n // the rendered position, since that is what recharts passes its own\n // `tickFormatter`.\n const categoryTick = highlightedValues.size\n ? ({\n payload,\n index,\n ...tickProps\n }: {\n payload: { value: string | number };\n index: number;\n }) => {\n const formatter =\n orientation === 'horizontal' ? yTickFormatter : xTickFormatter;\n const value = formatter\n ? formatter(payload.value as never, index)\n : payload.value;\n return (\n <Text\n {...tickProps}\n className={cn(\n 'fill-muted-foreground',\n highlightedValues.has(payload.value) && 'fill-primary italic'\n )}\n fontSize={12}\n >\n {value}\n </Text>\n );\n }\n : undefined;\n\n // recharts spreads this over the bar's own props, so an explicitly\n // `undefined` fill would wipe the series color (an unfilled path paints\n // black). Only set what the caller asked for, and dim by default so\n // `showActiveBar` alone is visible.\n const activeBarOption = showActiveBar\n ? {\n ...(activeBar?.fill !== undefined ? { fill: activeBar.fill } : {}),\n fillOpacity: activeBar?.opacity ?? 0.85,\n }\n : false;\n\n // `gradient` and `pattern` paint from an SVG def, so the ids have to be\n // unique per chart instance — same guard the shared container applies.\n const defsId = `bar-${React.useId().replace(/:/g, '')}`;\n const usedShapes = new Set<BarChartBarShape>([barShape]);\n settingsByKey.forEach(({ settings }) => {\n if (settings.shape) usedShapes.add(settings.shape);\n });\n // recharts applies a flat minPointSize to zeroes too, which would draw a\n // sliver where there is nothing to show. For a grouped bar it hands the\n // callback the row's own value, but inside a stack it hands the running\n // total, so a zero segment riding on a non-zero stack would slip through —\n // there the value is read back off the row instead. That read uses the\n // index recharts counts from the *displayed* slice, so a stacked chart\n // whose brush has been dragged off its full range falls back to flooring\n // the zero; the plain (unbrushed) stack, which is what the prop is for, is\n // exact.\n const minPointSizeFor = (key: string) =>\n minPointSize === undefined\n ? undefined\n : (top: number | undefined | null, row: number) => {\n const own = isStacked ? chartData[row]?.[key] : top;\n return typeof own === 'number' && own !== 0 ? minPointSize : 0;\n };\n\n const fillOf = (key: string, shape: BarChartBarShape) =>\n shape === 'gradient'\n ? `url(#${defsId}-gradient-${key})`\n : shape === 'pattern'\n ? `url(#${defsId}-pattern-${key})`\n : `var(--color-${key})`;\n\n // Axis titles: the X title sits below the ticks; the Y title is rotated in\n // the left gutter. Passed to recharts' native `label` (themed via the\n // `.recharts-label` fill selector on the container).\n const xAxisTitle = resolveXAxisTitle(xAxisLabel);\n const yAxisTitle = resolveYAxisTitle(yAxisLabel);\n\n const yDomain = resolveAxisDomain(yAxisDomain);\n\n const xAxisHeight = resolveXAxisHeight(xAxisLabel, xAxisAngle);\n\n // Round only the growing end: top for vertical bars, right for horizontal.\n const endRadius: [number, number, number, number] =\n orientation === 'horizontal'\n ? [0, barRadius, barRadius, 0]\n : [barRadius, barRadius, 0, 0];\n // A pill rounds every corner; recharts clamps the radius to half the bar's\n // shorter side, so an oversized number gives a true capsule at any width.\n const radiusFor = (shape: BarChartBarShape, rounded: boolean) =>\n shape === 'pill'\n ? 9999\n : barRadius > 0 && rounded\n ? endRadius\n : undefined;\n\n // Both take the normalization unconditionally: gating it on \"is a\n // headroom/paint-server series in play\" is what let the legend's ordering\n // drift between otherwise identical charts. The helpers are no-ops when\n // there is nothing to strip or recolor.\n const tooltipElement = (\n <NormalizedTooltipContent content={tooltipContent} dataKeys={dataKeys} />\n );\n const legendElement = <NormalizedLegendContent dataKeys={dataKeys} />;\n\n // The long chart children are lifted into these renderers so the returned\n // tree reads as a flat list. They are plain functions, not components:\n // recharts looks some of its children up by element type (see `rangeCells`\n // above), so what they return has to stay a *direct* child — an array or a\n // fragment is flattened, a component wrapper would not be.\n\n // `orientation` decides which axis is numeric, and with it which axis the\n // value props (unit/tickCount/domain) and the category props (dataKey/tick)\n // belong to — recharts ignores each set on the other axis. Both branches\n // stay spelled out because what differs is the prop *set*, not a couple of\n // values: folding them into one shared props object would trade a readable\n // fork for a merge whose per-axis prop list has to be re-derived by eye.\n const renderAxes = () =>\n orientation === 'horizontal' ? (\n <>\n {/* Horizontal bars put the values on X, so the value-axis props\n (tickCount/domain) belong here — recharts ignores both on the\n category axis. */}\n <XAxis\n type=\"number\"\n hide={!showXAxis}\n tickLine={false}\n axisLine={false}\n unit={xUnit}\n tickFormatter={xTickFormatter}\n angle={xAxisAngle}\n interval={xAxisInterval}\n textAnchor={resolveRotatedTickAnchor(xAxisAngle)}\n tickCount={yAxisTickCount}\n domain={yDomain}\n height={xAxisHeight}\n label={xAxisTitle}\n />\n <YAxis\n dataKey={xKey}\n type=\"category\"\n hide={!showYAxis}\n tickLine={false}\n axisLine={false}\n tick={categoryTick}\n tickFormatter={yTickFormatter}\n width={yAxisLabel ? 96 : 80}\n label={yAxisTitle}\n />\n </>\n ) : (\n <>\n <XAxis\n dataKey={xKey}\n type=\"category\"\n hide={!showXAxis}\n tickLine={false}\n axisLine={false}\n tick={categoryTick}\n tickFormatter={xTickFormatter}\n angle={xAxisAngle}\n interval={xAxisInterval}\n textAnchor={resolveRotatedTickAnchor(xAxisAngle)}\n height={xAxisHeight}\n label={xAxisTitle}\n />\n <YAxis\n type=\"number\"\n hide={!showYAxis}\n tickLine={false}\n axisLine={false}\n unit={yUnit}\n tickFormatter={yTickFormatter}\n tickCount={yAxisTickCount}\n domain={yDomain}\n width={yAxisLabel ? 72 : undefined}\n label={yAxisTitle}\n />\n </>\n );\n\n const renderSeries = () =>\n dataKeys.map((key, index) => {\n // In a stack only the last segment's end is rounded; grouped bars\n // each round their own end.\n const rounded = isStacked ? index === dataKeys.length - 1 : true;\n const entry = settingsByKey.get(key);\n const inRange = (row: number) =>\n entry !== undefined && row >= entry.range[0] && row <= entry.range[1];\n const headroomKey = headroomKeys.get(key);\n const { shape, activeBar: activeBarShape } = resolveBarShapes({\n rangeBackground: entry?.settings.background === true,\n inRange,\n trackFill: backgroundFill,\n activeBarOption,\n });\n const cells =\n entry &&\n rangeCells({\n data,\n chartData,\n xKey,\n seriesKey: key,\n settings: entry.settings,\n range: entry.range,\n headroomKey,\n barShape,\n rounded,\n fillOf,\n radiusFor,\n });\n const labels = showLabels && (\n <LabelList\n dataKey={key}\n position={barLabelPosition}\n formatter={toLabelFormatter(labelFormatter)}\n className={resolveLabelFillClass(barLabelPosition)}\n fontSize={CHART_LABEL_FONT_SIZE}\n />\n );\n return (\n <React.Fragment key={key}>\n <Bar\n dataKey={key}\n fill={fillOf(key, barShape)}\n // Its own stack, so the headroom sits on this series' bar\n // while the series stay side by side.\n stackId={isStacked ? 'a' : headroomKey ? key : undefined}\n radius={radiusFor(barShape, rounded)}\n minPointSize={minPointSizeFor(key)}\n background={showBackground ? { fill: backgroundFill } : undefined}\n shape={shape}\n activeBar={activeBarShape}\n {...animation}\n >\n {cells}\n {labels}\n </Bar>\n {headroomKey && (\n <Bar\n dataKey={`${HEADROOM_FIELD_PREFIX}${key}`}\n stackId={key}\n fill={`var(--color-${key})`}\n fillOpacity={0.25}\n radius={radiusFor(barShape, true)}\n // Decoration for the bar below it — never its own row in the\n // tooltip or entry in the legend.\n legendType=\"none\"\n tooltipType=\"none\"\n {...animation}\n />\n )}\n </React.Fragment>\n );\n });\n\n const renderReferenceAreas = () =>\n referenceAreas.map(({ area, range }, index) => {\n const [start, end] = range;\n // Bands run along the category axis: X for vertical bars, Y for\n // horizontal ones.\n const bounds =\n orientation === 'horizontal'\n ? { y1: data[start]?.[xKey], y2: data[end]?.[xKey] }\n : { x1: data[start]?.[xKey], x2: data[end]?.[xKey] };\n return (\n <ReferenceArea\n key={`${area.label ?? 'area'}-${index}`}\n {...bounds}\n fill=\"var(--ui-background-surface-secondary)\"\n fillOpacity={0.6}\n ifOverflow=\"extendDomain\"\n shape={resolveBandShape({\n divider: area.divider,\n vertical: orientation !== 'horizontal',\n })}\n label={resolveBandLabel(area.label)}\n />\n );\n });\n\n const renderReferenceLines = () =>\n referenceLines.map((ref, index) => {\n const value = resolveChartReferenceValue(ref, data, dataKeys);\n if (value === undefined) return null;\n return (\n <ReferenceLine\n key={`${ref.label ?? 'ref'}-${index}`}\n // Draw on the value axis: Y for vertical bars, X for horizontal.\n {...(orientation === 'horizontal' ? { x: value } : { y: value })}\n // By default the caption sits at the top of the line: above the\n // right end of a horizontal line (vertical bars), or above the\n // top of a vertical line (horizontal bars).\n {...resolveReferenceLineProps(\n ref.label,\n ref.labelPosition ??\n (orientation === 'horizontal' ? 'top' : 'insideTopRight')\n )}\n />\n );\n });\n\n return (\n <div\n ref={ref}\n data-orientation={orientation}\n data-layout={layout}\n className={cn(barChartVariants({ orientation, layout }), className)}\n {...props}\n >\n <ChartContainer\n config={config}\n className=\"size-full [&_.recharts-label]:fill-foreground\"\n >\n <RechartsBarChart\n data={chartData as readonly unknown[]}\n layout={rechartsLayout}\n barSize={barSize}\n maxBarSize={maxBarSize}\n barGap={barGap}\n barCategoryGap={barCategoryGap}\n >\n <BarPaintServers\n id={defsId}\n dataKeys={dataKeys}\n shapes={usedShapes}\n horizontal={orientation === 'horizontal'}\n />\n {showGrid && (\n <CartesianGrid\n horizontal={gridHorizontal ?? orientation === 'vertical'}\n vertical={gridVertical ?? orientation === 'horizontal'}\n strokeDasharray={gridDashed ? '3 3' : undefined}\n />\n )}\n {renderAxes()}\n {showTooltip && <ChartTooltip content={tooltipElement} />}\n {showLegend && <ChartLegend content={legendElement} />}\n {renderSeries()}\n {renderReferenceAreas()}\n {renderReferenceLines()}\n {showBrush && (\n <Brush\n dataKey={xKey}\n // The brush slices rows by index, so its captions come from\n // whichever axis holds the categories — Y for horizontal bars.\n tickFormatter={\n orientation === 'horizontal' ? yTickFormatter : xTickFormatter\n }\n {...resolveBrushProps({ brushHeight, brushAriaLabel })}\n />\n )}\n </RechartsBarChart>\n </ChartContainer>\n </div>\n );\n }\n);\nBarChart.displayName = 'BarChart';\n\nexport { BarChart, barChartVariants };\n"],"names":["barChartVariants","cva","HEADROOM_FIELD_PREFIX","dropHeadroomSeries","payload","dataKeys","real","item","a","b","withSeriesColor","_a","NormalizedTooltipContent","content","props","merged","React","jsx","ChartTooltipContent","NormalizedLegendContent","ChartLegendContent","renderBarWithTrack","bar","track","trackFill","paint","jsxs","Fragment","Rectangle","createTrackShape","inRange","row","resolveBarShapes","rangeBackground","activeBarOption","renderBandWithDivider","band","vertical","x","y","width","height","fill","fillOpacity","resolveBandShape","divider","resolveBandLabel","label","BarPaintServers","id","shapes","horizontal","hasGradient","hasPattern","key","rangeCells","data","chartData","xKey","seriesKey","settings","range","headroomKey","barShape","rounded","fillOf","radiusFor","opacity","dashed","rowIndex","on","shape","stacksHeadroom","Cell","BarChart","className","config","referenceLine","referenceArea","barSettings","xAxisLabel","yAxisLabel","xUnit","yUnit","orientation","layout","barRadius","barSize","maxBarSize","barGap","barCategoryGap","minPointSize","showBackground","backgroundFill","showActiveBar","activeBar","showGrid","showTooltip","showLegend","showXAxis","showYAxis","xTickFormatter","yTickFormatter","xAxisAngle","xAxisInterval","yAxisTickCount","yAxisDomain","gridDashed","gridHorizontal","gridVertical","tooltipContent","animate","animationDuration","animationBegin","animationEasing","showLabels","labelPosition","labelFormatter","showBrush","brushHeight","brushAriaLabel","ref","animation","resolveAnimation","rechartsLayout","isStacked","barLabelPosition","resolveCartesianLabelPosition","referenceLines","toReferenceLineList","referenceAreas","area","resolveCategoryRange","entry","settingsByKey","headroomKeys","pair","extra","upperKey","start","end","value","upper","highlightedValues","categoryTick","index","tickProps","formatter","Text","cn","defsId","usedShapes","minPointSizeFor","top","own","xAxisTitle","resolveXAxisTitle","yAxisTitle","resolveYAxisTitle","yDomain","resolveAxisDomain","xAxisHeight","resolveXAxisHeight","endRadius","tooltipElement","legendElement","renderAxes","XAxis","resolveRotatedTickAnchor","YAxis","renderSeries","activeBarShape","cells","labels","LabelList","toLabelFormatter","resolveLabelFillClass","CHART_LABEL_FONT_SIZE","Bar","renderReferenceAreas","bounds","_b","_c","_d","ReferenceArea","renderReferenceLines","resolveChartReferenceValue","ReferenceLine","resolveReferenceLineProps","ChartContainer","RechartsBarChart","CartesianGrid","ChartTooltip","ChartLegend","Brush","resolveBrushProps"],"mappings":";;;;;;;AAgEA,MAAMA,KAAmBC,GAAI,IAAI;AAAA,EAC/B,UAAU;AAAA,IACR,aAAa;AAAA,MACX,UAAU;AAAA,MACV,YAAY;AAAA,IAAA;AAAA,IAEd,QAAQ;AAAA,MACN,SAAS;AAAA,MACT,SAAS;AAAA,IAAA;AAAA,EACX;AAAA,EAEF,iBAAiB;AAAA,IACf,aAAa;AAAA,IACb,QAAQ;AAAA,EAAA;AAEZ,CAAC,GAmDKC,IAAwB;AAQvB,SAASC,GACdC,GACAC,GACiB;AACjB,QAAMC,IAAOF,KAAA,gBAAAA,EAAS;AAAA,IACpB,CAACG,MAAS,CAAC,OAAOA,EAAK,OAAO,EAAE,WAAWL,CAAqB;AAAA;AAKlE,SAAOG,IACHC,KAAA,gBAAAA,EAAM,QAAQ;AAAA,IACZ,CAACE,GAAGC,MACFJ,EAAS,QAAQ,OAAOG,EAAE,OAAO,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BACAnE,MACC,gBAAArG;AAAA,oBAACiL;AAAA,oBAAA;AAAA,sBACC,SAASxI;AAAA,sBAGT,eACE0B,MAAgB,eAAekB,IAAiBD;AAAA,sBAEjD,GAAG8F,GAAkB,EAAE,aAAA5E,IAAa,gBAAAC,IAAgB;AAAA,oBAAA;AAAA,kBAAA;AAAA,gBACvD;AAAA,cAAA;AAAA,YAAA;AAAA,UAEJ;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAGN;AACF;AACA9C,GAAS,cAAc;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import * as c from "react";
|
|
3
3
|
import { ChevronLeftIcon as p, ChevronRightIcon as m, ChevronDownIcon as f } from "@acronis-platform/icons-react/stroke-mono";
|
|
4
4
|
import { cn as r } from "../../../lib/utils.js";
|
|
@@ -94,7 +94,7 @@ function x(n, e) {
|
|
|
94
94
|
};
|
|
95
95
|
}
|
|
96
96
|
const h = {
|
|
97
|
-
Root: ({ className: n, rootRef: e, ...t }) => /* @__PURE__ */
|
|
97
|
+
Root: ({ className: n, rootRef: e, ...t }) => /* @__PURE__ */ a(
|
|
98
98
|
"div",
|
|
99
99
|
{
|
|
100
100
|
"data-slot": "calendar",
|
|
@@ -103,29 +103,31 @@ const h = {
|
|
|
103
103
|
...t
|
|
104
104
|
}
|
|
105
105
|
),
|
|
106
|
-
|
|
106
|
+
// Drop react-day-picker's numeric `size` — these chevrons render at the
|
|
107
|
+
// fixed design size (16); icons-react's `size` is the 16|24 design axis.
|
|
108
|
+
Chevron: ({ className: n, orientation: e, size: t, ...o }) => e === "left" ? /* @__PURE__ */ a(
|
|
107
109
|
p,
|
|
108
110
|
{
|
|
109
111
|
size: 16,
|
|
110
112
|
className: r("rtl:rotate-180", n),
|
|
111
|
-
...
|
|
113
|
+
...o
|
|
112
114
|
}
|
|
113
|
-
) : e === "right" ? /* @__PURE__ */
|
|
115
|
+
) : e === "right" ? /* @__PURE__ */ a(
|
|
114
116
|
m,
|
|
115
117
|
{
|
|
116
118
|
size: 16,
|
|
117
119
|
className: r("rtl:rotate-180", n),
|
|
118
|
-
...
|
|
120
|
+
...o
|
|
119
121
|
}
|
|
120
|
-
) : /* @__PURE__ */
|
|
122
|
+
) : /* @__PURE__ */ a(f, { size: 16, className: r(n), ...o }),
|
|
121
123
|
DayButton: y,
|
|
122
|
-
WeekNumber: ({ children: n, ...e }) => /* @__PURE__ */
|
|
124
|
+
WeekNumber: ({ children: n, ...e }) => /* @__PURE__ */ a("td", { ...e, children: /* @__PURE__ */ a("div", { className: "flex size-[var(--cell-size)] items-center justify-center text-center", children: n }) })
|
|
123
125
|
};
|
|
124
126
|
function D({
|
|
125
127
|
className: n,
|
|
126
128
|
classNames: e,
|
|
127
129
|
showOutsideDays: t = !0,
|
|
128
|
-
captionLayout:
|
|
130
|
+
captionLayout: o = "label",
|
|
129
131
|
// Default the grid to a Monday week start (0=Sun..6=Sat); consumers can still
|
|
130
132
|
// override per instance.
|
|
131
133
|
weekStartsOn: u = 1,
|
|
@@ -134,7 +136,7 @@ function D({
|
|
|
134
136
|
...s
|
|
135
137
|
}) {
|
|
136
138
|
const g = l();
|
|
137
|
-
return /* @__PURE__ */
|
|
139
|
+
return /* @__PURE__ */ a(
|
|
138
140
|
v,
|
|
139
141
|
{
|
|
140
142
|
showOutsideDays: t,
|
|
@@ -143,13 +145,13 @@ function D({
|
|
|
143
145
|
"group/calendar bg-background p-3 [--cell-size:2rem] [[data-slot=popover-content]_&]:bg-transparent",
|
|
144
146
|
n
|
|
145
147
|
),
|
|
146
|
-
captionLayout:
|
|
148
|
+
captionLayout: o,
|
|
147
149
|
formatters: {
|
|
148
150
|
formatMonthDropdown: (b) => b.toLocaleString("default", { month: "short" }),
|
|
149
151
|
...d
|
|
150
152
|
},
|
|
151
153
|
classNames: {
|
|
152
|
-
...x(
|
|
154
|
+
...x(o, g),
|
|
153
155
|
...e
|
|
154
156
|
},
|
|
155
157
|
components: {
|
|
@@ -164,13 +166,13 @@ function y({
|
|
|
164
166
|
className: n,
|
|
165
167
|
day: e,
|
|
166
168
|
modifiers: t,
|
|
167
|
-
...
|
|
169
|
+
...o
|
|
168
170
|
}) {
|
|
169
171
|
const u = l(), d = c.useRef(null);
|
|
170
172
|
return c.useEffect(() => {
|
|
171
173
|
var i;
|
|
172
174
|
t.focused && ((i = d.current) == null || i.focus());
|
|
173
|
-
}, [t.focused]), /* @__PURE__ */
|
|
175
|
+
}, [t.focused]), /* @__PURE__ */ a(
|
|
174
176
|
"button",
|
|
175
177
|
{
|
|
176
178
|
ref: d,
|
|
@@ -193,7 +195,7 @@ function y({
|
|
|
193
195
|
u.day,
|
|
194
196
|
n
|
|
195
197
|
),
|
|
196
|
-
...
|
|
198
|
+
...o
|
|
197
199
|
}
|
|
198
200
|
);
|
|
199
201
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar.js","sources":["../../../../src/components/ui/calendar/calendar.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n ChevronDownIcon,\n ChevronLeftIcon,\n ChevronRightIcon,\n} from '@acronis-platform/icons-react/stroke-mono';\nimport {\n DayButton,\n DayPicker,\n getDefaultClassNames,\n type ClassNames,\n type CustomComponents,\n} from 'react-day-picker';\n\nimport { cn } from '@/lib/utils';\n\n// Ported from `@acronis-platform/shadcn-uikit`'s `calendar`\n// (packages/ui-legacy/src/components/ui/calendar.tsx). A pure day-grid built on\n// `react-day-picker`'s `DayPicker` — single / range / multiple selection and one\n// or more months side by side (`numberOfMonths`), with the prev/next chevrons at\n// the outer edges of the month row. No `--ui-calendar-*` token tier exists yet, so\n// this design-pending v1 themes off the shared semantic vocabulary:\n// • surface / text -> bg-background / text-foreground\n// • selected day + range endpoints -> --ui-background-brand-primary + --ui-glyph-on-brand-primary\n// • range-middle highlight -> --ui-background-surface-hover (`bg-accent`)\n// • hover -> bg-accent / text-accent-foreground\n// • today -> font-weight + underline (no color dependency)\n// • outside-month / muted -> text-muted-foreground (--ui-text-on-surface-secondary)\n// • disabled days -> --ui-text-on-surface-disabled\n// • focus ring -> --ui-focus-primary\n// Reconcile (and a possible `--ui-calendar-*` tier) with\n// `/figma-component Calendar <url> --update` once mockups land.\n//\n// Why plain `<button>` for day cells AND nav chevrons (not `Button` / `ButtonIcon`):\n// • Day cells are a dense text grid, not icon buttons. `Button` is a fixed\n// 32px-tall pill with a 64px min-width, per-variant px, and (for `ghost`) a\n// hover underline — none of which suit a square, borderless day cell. There\n// is no `size`/`square` key on `buttonVariants` to opt out of that geometry,\n// and adding one purely for the calendar would contort Button's API for a\n// one-off. `ButtonIcon` is icon-only and force-sizes its glyph to 24px\n// (`--ui-button-icon-global-icon-size`), so it cannot host day-number text.\n// • Nav chevrons look closest to `ButtonIcon` (ghost, 32px square) but adopting\n// it here is a net contortion: (1) `react-day-picker`'s Nav marks the edge\n// buttons with `aria-disabled`, while `ButtonIcon`'s disabled treatment +\n// `pointer-events-none` key off the `disabled` attribute — the disabled state\n// would never paint; (2) `ButtonIcon` force-sizes the glyph to 24px, but the\n// nav chevrons are 16px. Both would require overriding ButtonIcon internals,\n// so plain `<button>` with `aria-disabled:` variants is the honest fit until a\n// tokened `--ui-calendar-*` tier defines these controls.\n\nexport type CalendarProps = React.ComponentProps<typeof DayPicker>;\n\n// The full `classNames` map, static aside from the one `captionLayout`-dependent\n// branch (the boxed vs. dropdown caption treatment) and the per-key merge with\n// `react-day-picker`'s own `getDefaultClassNames()`. Built once per render and\n// merged with any caller `classNames` override at the call site.\nfunction buildCalendarClassNames(\n captionLayout: CalendarProps['captionLayout'],\n defaultClassNames: ClassNames\n): Partial<ClassNames> {\n return {\n root: cn('w-fit', defaultClassNames.root),\n months: cn(\n 'relative flex flex-col gap-4 md:flex-row',\n defaultClassNames.months\n ),\n month: cn('flex w-full flex-col gap-4', defaultClassNames.month),\n nav: cn(\n 'absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1',\n defaultClassNames.nav\n ),\n button_previous: cn(\n 'inline-flex size-[var(--cell-size)] cursor-pointer select-none items-center justify-center rounded-md p-0 text-foreground outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:ring-[3px] focus-visible:ring-[var(--ui-focus-primary)] aria-disabled:pointer-events-none aria-disabled:text-[var(--ui-text-on-surface-disabled)]',\n defaultClassNames.button_previous\n ),\n button_next: cn(\n 'inline-flex size-[var(--cell-size)] cursor-pointer select-none items-center justify-center rounded-md p-0 text-foreground outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:ring-[3px] focus-visible:ring-[var(--ui-focus-primary)] aria-disabled:pointer-events-none aria-disabled:text-[var(--ui-text-on-surface-disabled)]',\n defaultClassNames.button_next\n ),\n month_caption: cn(\n 'flex h-[var(--cell-size)] w-full items-center justify-center px-[var(--cell-size)]',\n defaultClassNames.month_caption\n ),\n dropdowns: cn(\n 'flex h-[var(--cell-size)] w-full items-center justify-center gap-1.5 text-sm font-medium',\n defaultClassNames.dropdowns\n ),\n dropdown_root: cn(\n 'relative rounded-md border border-border has-focus:border-[var(--ui-border-on-surface-border-active)] has-focus:ring-[3px] has-focus:ring-[var(--ui-focus-primary)]',\n defaultClassNames.dropdown_root\n ),\n dropdown: cn(\n // The invisible native <select> overlays the whole `dropdown_root`\n // box, so its cursor drives the caption box's hover cursor — pointer,\n // to read as the interactive dropdown trigger it is (vs the plain,\n // non-clickable `caption_label` box in `captionLayout=\"label\"`).\n 'absolute inset-0 cursor-pointer bg-background opacity-0',\n defaultClassNames.dropdown\n ),\n caption_label: cn(\n 'select-none font-medium',\n captionLayout === 'label'\n ? // Boxed caption (`[ July 2026 ]`) — reuses `dropdown_root`'s\n // border/rounded box treatment so the label and dropdown layouts\n // read as the same control.\n 'rounded-md border border-border px-3 py-1 text-sm'\n : 'flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground',\n defaultClassNames.caption_label\n ),\n month_grid: cn('w-full border-collapse', defaultClassNames.month_grid),\n weekdays: cn('flex', defaultClassNames.weekdays),\n weekday: cn(\n 'flex-1 select-none rounded-md text-[0.8rem] font-normal text-muted-foreground',\n defaultClassNames.weekday\n ),\n week: cn('mt-2 flex w-full', defaultClassNames.week),\n week_number_header: cn(\n 'w-[var(--cell-size)] select-none',\n defaultClassNames.week_number_header\n ),\n week_number: cn(\n 'select-none text-[0.8rem] text-muted-foreground',\n defaultClassNames.week_number\n ),\n day: cn(\n // Logical (`-s-`/`-e-`) corner rounding so the range band's outer\n // corners flip sides under RTL along with the CSS-reversed grid.\n 'group/day relative aspect-square h-full w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-s-md [&:last-child[data-selected=true]_button]:rounded-e-md',\n defaultClassNames.day\n ),\n range_start: cn('rounded-s-md', defaultClassNames.range_start),\n range_middle: cn('rounded-none bg-accent', defaultClassNames.range_middle),\n range_end: cn('rounded-e-md', defaultClassNames.range_end),\n today: cn(\n 'rounded-md font-semibold underline data-[selected=true]:rounded-none data-[selected=true]:no-underline',\n defaultClassNames.today\n ),\n outside: cn(\n 'text-muted-foreground aria-selected:text-muted-foreground',\n defaultClassNames.outside\n ),\n disabled: cn(\n 'text-[var(--ui-text-on-surface-disabled)]',\n defaultClassNames.disabled\n ),\n hidden: cn('invisible', defaultClassNames.hidden),\n };\n}\n\n// The component-override map. Fully static (no prop/state dependency), so it lives\n// at module scope and is merged with any caller `components` override at the call\n// site. `Chevron`'s RTL flip keys off the `rtl:` variant, so it needs no props.\nconst calendarComponents: Partial<CustomComponents> = {\n Root: ({ className, rootRef, ...props }) => (\n <div\n data-slot=\"calendar\"\n ref={rootRef}\n className={cn(className)}\n {...props}\n />\n ),\n Chevron: ({ className, orientation, ...props }) => {\n // Mirror the horizontal nav chevrons under RTL — `react-day-picker`\n // hardcodes orientation \"left\"/\"right\" for previous/next regardless of\n // direction, so we flip them ourselves. Applied on the icon we own via\n // the `rtl:` variant ([dir=rtl] ancestor), so it's robust to rdp's\n // internal class names. The vertical (dropdown) chevron never flips.\n if (orientation === 'left') {\n return (\n <ChevronLeftIcon\n size={16}\n className={cn('rtl:rotate-180', className)}\n {...props}\n />\n );\n }\n if (orientation === 'right') {\n return (\n <ChevronRightIcon\n size={16}\n className={cn('rtl:rotate-180', className)}\n {...props}\n />\n );\n }\n return <ChevronDownIcon size={16} className={cn(className)} {...props} />;\n },\n DayButton: CalendarDayButton,\n WeekNumber: ({ children, ...props }) => (\n <td {...props}>\n <div className=\"flex size-[var(--cell-size)] items-center justify-center text-center\">\n {children}\n </div>\n </td>\n ),\n};\n\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n captionLayout = 'label',\n // Default the grid to a Monday week start (0=Sun..6=Sat); consumers can still\n // override per instance.\n weekStartsOn = 1,\n formatters,\n components,\n ...props\n}: CalendarProps) {\n const defaultClassNames = getDefaultClassNames();\n\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n weekStartsOn={weekStartsOn}\n className={cn(\n 'group/calendar bg-background p-3 [--cell-size:2rem] [[data-slot=popover-content]_&]:bg-transparent',\n className\n )}\n captionLayout={captionLayout}\n formatters={{\n formatMonthDropdown: (date) =>\n date.toLocaleString('default', { month: 'short' }),\n ...formatters,\n }}\n classNames={{\n ...buildCalendarClassNames(captionLayout, defaultClassNames),\n ...classNames,\n }}\n components={{\n ...calendarComponents,\n ...components,\n }}\n {...props}\n />\n );\n}\n\nfunction CalendarDayButton({\n className,\n day,\n modifiers,\n ...props\n}: React.ComponentProps<typeof DayButton>) {\n const defaultClassNames = getDefaultClassNames();\n\n const ref = React.useRef<HTMLButtonElement>(null);\n React.useEffect(() => {\n if (modifiers.focused) ref.current?.focus();\n }, [modifiers.focused]);\n\n return (\n <button\n ref={ref}\n type=\"button\"\n data-day={day.date.toLocaleDateString()}\n data-selected-single={\n modifiers.selected &&\n !modifiers.range_start &&\n !modifiers.range_end &&\n !modifiers.range_middle\n }\n data-range-start={modifiers.range_start}\n data-range-end={modifiers.range_end}\n data-range-middle={modifiers.range_middle}\n className={cn(\n 'flex aspect-square size-[var(--cell-size)] w-full min-w-[var(--cell-size)] cursor-pointer flex-col items-center justify-center gap-1 rounded-md p-0 font-normal leading-none text-foreground outline-none transition-colors',\n 'hover:bg-accent hover:text-accent-foreground',\n 'data-[selected-single=true]:bg-[var(--ui-background-brand-primary)] data-[selected-single=true]:text-[var(--ui-glyph-on-brand-primary)] data-[selected-single=true]:hover:bg-[var(--ui-background-brand-primary-hover)]',\n 'data-[range-start=true]:rounded-md data-[range-start=true]:bg-[var(--ui-background-brand-primary)] data-[range-start=true]:text-[var(--ui-glyph-on-brand-primary)] data-[range-start=true]:hover:bg-[var(--ui-background-brand-primary-hover)]',\n 'data-[range-end=true]:rounded-md data-[range-end=true]:bg-[var(--ui-background-brand-primary)] data-[range-end=true]:text-[var(--ui-glyph-on-brand-primary)] data-[range-end=true]:hover:bg-[var(--ui-background-brand-primary-hover)]',\n 'data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground',\n 'group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-[var(--ui-focus-primary)]',\n 'disabled:pointer-events-none disabled:text-[var(--ui-text-on-surface-disabled)]',\n '[&>span]:text-xs [&>span]:opacity-70',\n defaultClassNames.day,\n className\n )}\n {...props}\n />\n );\n}\n\nexport { Calendar, CalendarDayButton };\n"],"names":["buildCalendarClassNames","captionLayout","defaultClassNames","cn","calendarComponents","className","rootRef","props","jsx","orientation","ChevronLeftIcon","ChevronRightIcon","ChevronDownIcon","CalendarDayButton","children","Calendar","classNames","showOutsideDays","weekStartsOn","formatters","components","getDefaultClassNames","DayPicker","date","day","modifiers","ref","React","_a"],"mappings":";;;;;;AAwDA,SAASA,EACPC,GACAC,GACqB;AACrB,SAAO;AAAA,IACL,MAAMC,EAAG,SAASD,EAAkB,IAAI;AAAA,IACxC,QAAQC;AAAA,MACN;A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QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACAD,EAAkB;AAAA,QAClBG;AAAA,MAAA;AAAA,MAED,GAAGE;AAAA,IAAA;AAAA,EAAA;AAGV;"}
|
|
1
|
+
{"version":3,"file":"calendar.js","sources":["../../../../src/components/ui/calendar/calendar.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n ChevronDownIcon,\n ChevronLeftIcon,\n ChevronRightIcon,\n} from '@acronis-platform/icons-react/stroke-mono';\nimport {\n DayButton,\n DayPicker,\n getDefaultClassNames,\n type ClassNames,\n type CustomComponents,\n} from 'react-day-picker';\n\nimport { cn } from '@/lib/utils';\n\n// Ported from `@acronis-platform/shadcn-uikit`'s `calendar`\n// (packages/ui-legacy/src/components/ui/calendar.tsx). A pure day-grid built on\n// `react-day-picker`'s `DayPicker` — single / range / multiple selection and one\n// or more months side by side (`numberOfMonths`), with the prev/next chevrons at\n// the outer edges of the month row. No `--ui-calendar-*` token tier exists yet, so\n// this design-pending v1 themes off the shared semantic vocabulary:\n// • surface / text -> bg-background / text-foreground\n// • selected day + range endpoints -> --ui-background-brand-primary + --ui-glyph-on-brand-primary\n// • range-middle highlight -> --ui-background-surface-hover (`bg-accent`)\n// • hover -> bg-accent / text-accent-foreground\n// • today -> font-weight + underline (no color dependency)\n// • outside-month / muted -> text-muted-foreground (--ui-text-on-surface-secondary)\n// • disabled days -> --ui-text-on-surface-disabled\n// • focus ring -> --ui-focus-primary\n// Reconcile (and a possible `--ui-calendar-*` tier) with\n// `/figma-component Calendar <url> --update` once mockups land.\n//\n// Why plain `<button>` for day cells AND nav chevrons (not `Button` / `ButtonIcon`):\n// • Day cells are a dense text grid, not icon buttons. `Button` is a fixed\n// 32px-tall pill with a 64px min-width, per-variant px, and (for `ghost`) a\n// hover underline — none of which suit a square, borderless day cell. There\n// is no `size`/`square` key on `buttonVariants` to opt out of that geometry,\n// and adding one purely for the calendar would contort Button's API for a\n// one-off. `ButtonIcon` is icon-only and force-sizes its glyph to 24px\n// (`--ui-button-icon-global-icon-size`), so it cannot host day-number text.\n// • Nav chevrons look closest to `ButtonIcon` (ghost, 32px square) but adopting\n// it here is a net contortion: (1) `react-day-picker`'s Nav marks the edge\n// buttons with `aria-disabled`, while `ButtonIcon`'s disabled treatment +\n// `pointer-events-none` key off the `disabled` attribute — the disabled state\n// would never paint; (2) `ButtonIcon` force-sizes the glyph to 24px, but the\n// nav chevrons are 16px. Both would require overriding ButtonIcon internals,\n// so plain `<button>` with `aria-disabled:` variants is the honest fit until a\n// tokened `--ui-calendar-*` tier defines these controls.\n\nexport type CalendarProps = React.ComponentProps<typeof DayPicker>;\n\n// The full `classNames` map, static aside from the one `captionLayout`-dependent\n// branch (the boxed vs. dropdown caption treatment) and the per-key merge with\n// `react-day-picker`'s own `getDefaultClassNames()`. Built once per render and\n// merged with any caller `classNames` override at the call site.\nfunction buildCalendarClassNames(\n captionLayout: CalendarProps['captionLayout'],\n defaultClassNames: ClassNames\n): Partial<ClassNames> {\n return {\n root: cn('w-fit', defaultClassNames.root),\n months: cn(\n 'relative flex flex-col gap-4 md:flex-row',\n defaultClassNames.months\n ),\n month: cn('flex w-full flex-col gap-4', defaultClassNames.month),\n nav: cn(\n 'absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1',\n defaultClassNames.nav\n ),\n button_previous: cn(\n 'inline-flex size-[var(--cell-size)] cursor-pointer select-none items-center justify-center rounded-md p-0 text-foreground outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:ring-[3px] focus-visible:ring-[var(--ui-focus-primary)] aria-disabled:pointer-events-none aria-disabled:text-[var(--ui-text-on-surface-disabled)]',\n defaultClassNames.button_previous\n ),\n button_next: cn(\n 'inline-flex size-[var(--cell-size)] cursor-pointer select-none items-center justify-center rounded-md p-0 text-foreground outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:ring-[3px] focus-visible:ring-[var(--ui-focus-primary)] aria-disabled:pointer-events-none aria-disabled:text-[var(--ui-text-on-surface-disabled)]',\n defaultClassNames.button_next\n ),\n month_caption: cn(\n 'flex h-[var(--cell-size)] w-full items-center justify-center px-[var(--cell-size)]',\n defaultClassNames.month_caption\n ),\n dropdowns: cn(\n 'flex h-[var(--cell-size)] w-full items-center justify-center gap-1.5 text-sm font-medium',\n defaultClassNames.dropdowns\n ),\n dropdown_root: cn(\n 'relative rounded-md border border-border has-focus:border-[var(--ui-border-on-surface-border-active)] has-focus:ring-[3px] has-focus:ring-[var(--ui-focus-primary)]',\n defaultClassNames.dropdown_root\n ),\n dropdown: cn(\n // The invisible native <select> overlays the whole `dropdown_root`\n // box, so its cursor drives the caption box's hover cursor — pointer,\n // to read as the interactive dropdown trigger it is (vs the plain,\n // non-clickable `caption_label` box in `captionLayout=\"label\"`).\n 'absolute inset-0 cursor-pointer bg-background opacity-0',\n defaultClassNames.dropdown\n ),\n caption_label: cn(\n 'select-none font-medium',\n captionLayout === 'label'\n ? // Boxed caption (`[ July 2026 ]`) — reuses `dropdown_root`'s\n // border/rounded box treatment so the label and dropdown layouts\n // read as the same control.\n 'rounded-md border border-border px-3 py-1 text-sm'\n : 'flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground',\n defaultClassNames.caption_label\n ),\n month_grid: cn('w-full border-collapse', defaultClassNames.month_grid),\n weekdays: cn('flex', defaultClassNames.weekdays),\n weekday: cn(\n 'flex-1 select-none rounded-md text-[0.8rem] font-normal text-muted-foreground',\n defaultClassNames.weekday\n ),\n week: cn('mt-2 flex w-full', defaultClassNames.week),\n week_number_header: cn(\n 'w-[var(--cell-size)] select-none',\n defaultClassNames.week_number_header\n ),\n week_number: cn(\n 'select-none text-[0.8rem] text-muted-foreground',\n defaultClassNames.week_number\n ),\n day: cn(\n // Logical (`-s-`/`-e-`) corner rounding so the range band's outer\n // corners flip sides under RTL along with the CSS-reversed grid.\n 'group/day relative aspect-square h-full w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-s-md [&:last-child[data-selected=true]_button]:rounded-e-md',\n defaultClassNames.day\n ),\n range_start: cn('rounded-s-md', defaultClassNames.range_start),\n range_middle: cn('rounded-none bg-accent', defaultClassNames.range_middle),\n range_end: cn('rounded-e-md', defaultClassNames.range_end),\n today: cn(\n 'rounded-md font-semibold underline data-[selected=true]:rounded-none data-[selected=true]:no-underline',\n defaultClassNames.today\n ),\n outside: cn(\n 'text-muted-foreground aria-selected:text-muted-foreground',\n defaultClassNames.outside\n ),\n disabled: cn(\n 'text-[var(--ui-text-on-surface-disabled)]',\n defaultClassNames.disabled\n ),\n hidden: cn('invisible', defaultClassNames.hidden),\n };\n}\n\n// The component-override map. Fully static (no prop/state dependency), so it lives\n// at module scope and is merged with any caller `components` override at the call\n// site. `Chevron`'s RTL flip keys off the `rtl:` variant, so it needs no props.\nconst calendarComponents: Partial<CustomComponents> = {\n Root: ({ className, rootRef, ...props }) => (\n <div\n data-slot=\"calendar\"\n ref={rootRef}\n className={cn(className)}\n {...props}\n />\n ),\n // Drop react-day-picker's numeric `size` — these chevrons render at the\n // fixed design size (16); icons-react's `size` is the 16|24 design axis.\n Chevron: ({ className, orientation, size: _size, ...props }) => {\n // Mirror the horizontal nav chevrons under RTL — `react-day-picker`\n // hardcodes orientation \"left\"/\"right\" for previous/next regardless of\n // direction, so we flip them ourselves. Applied on the icon we own via\n // the `rtl:` variant ([dir=rtl] ancestor), so it's robust to rdp's\n // internal class names. The vertical (dropdown) chevron never flips.\n if (orientation === 'left') {\n return (\n <ChevronLeftIcon\n size={16}\n className={cn('rtl:rotate-180', className)}\n {...props}\n />\n );\n }\n if (orientation === 'right') {\n return (\n <ChevronRightIcon\n size={16}\n className={cn('rtl:rotate-180', className)}\n {...props}\n />\n );\n }\n return <ChevronDownIcon size={16} className={cn(className)} {...props} />;\n },\n DayButton: CalendarDayButton,\n WeekNumber: ({ children, ...props }) => (\n <td {...props}>\n <div className=\"flex size-[var(--cell-size)] items-center justify-center text-center\">\n {children}\n </div>\n </td>\n ),\n};\n\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n captionLayout = 'label',\n // Default the grid to a Monday week start (0=Sun..6=Sat); consumers can still\n // override per instance.\n weekStartsOn = 1,\n formatters,\n components,\n ...props\n}: CalendarProps) {\n const defaultClassNames = getDefaultClassNames();\n\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n weekStartsOn={weekStartsOn}\n className={cn(\n 'group/calendar bg-background p-3 [--cell-size:2rem] [[data-slot=popover-content]_&]:bg-transparent',\n className\n )}\n captionLayout={captionLayout}\n formatters={{\n formatMonthDropdown: (date) =>\n date.toLocaleString('default', { month: 'short' }),\n ...formatters,\n }}\n classNames={{\n ...buildCalendarClassNames(captionLayout, defaultClassNames),\n ...classNames,\n }}\n components={{\n ...calendarComponents,\n ...components,\n }}\n {...props}\n />\n );\n}\n\nfunction CalendarDayButton({\n className,\n day,\n modifiers,\n ...props\n}: React.ComponentProps<typeof DayButton>) {\n const defaultClassNames = getDefaultClassNames();\n\n const ref = React.useRef<HTMLButtonElement>(null);\n React.useEffect(() => {\n if (modifiers.focused) ref.current?.focus();\n }, [modifiers.focused]);\n\n return (\n <button\n ref={ref}\n type=\"button\"\n data-day={day.date.toLocaleDateString()}\n data-selected-single={\n modifiers.selected &&\n !modifiers.range_start &&\n !modifiers.range_end &&\n !modifiers.range_middle\n }\n data-range-start={modifiers.range_start}\n data-range-end={modifiers.range_end}\n data-range-middle={modifiers.range_middle}\n className={cn(\n 'flex aspect-square size-[var(--cell-size)] w-full min-w-[var(--cell-size)] cursor-pointer flex-col items-center justify-center gap-1 rounded-md p-0 font-normal leading-none text-foreground outline-none transition-colors',\n 'hover:bg-accent hover:text-accent-foreground',\n 'data-[selected-single=true]:bg-[var(--ui-background-brand-primary)] data-[selected-single=true]:text-[var(--ui-glyph-on-brand-primary)] data-[selected-single=true]:hover:bg-[var(--ui-background-brand-primary-hover)]',\n 'data-[range-start=true]:rounded-md data-[range-start=true]:bg-[var(--ui-background-brand-primary)] data-[range-start=true]:text-[var(--ui-glyph-on-brand-primary)] data-[range-start=true]:hover:bg-[var(--ui-background-brand-primary-hover)]',\n 'data-[range-end=true]:rounded-md data-[range-end=true]:bg-[var(--ui-background-brand-primary)] data-[range-end=true]:text-[var(--ui-glyph-on-brand-primary)] data-[range-end=true]:hover:bg-[var(--ui-background-brand-primary-hover)]',\n 'data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground',\n 'group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-[var(--ui-focus-primary)]',\n 'disabled:pointer-events-none disabled:text-[var(--ui-text-on-surface-disabled)]',\n '[&>span]:text-xs [&>span]:opacity-70',\n defaultClassNames.day,\n className\n )}\n {...props}\n />\n );\n}\n\nexport { Calendar, CalendarDayButton };\n"],"names":["buildCalendarClassNames","captionLayout","defaultClassNames","cn","calendarComponents","className","rootRef","props","jsx","orientation","_size","ChevronLeftIcon","ChevronRightIcon","ChevronDownIcon","CalendarDayButton","children","Calendar","classNames","showOutsideDays","weekStartsOn","formatters","components","getDefaultClassNames","DayPicker","date","day","modifiers","ref","React","_a"],"mappings":";;;;;;AAwDA,SAASA,EACPC,GACAC,GACqB;AACrB,SAAO;AAAA,IACL,MAAMC,EAAG,SAASD,EAAkB,IAAI;AAAA,IACxC,QAAQC;AAAA,MACN;AAAA,MACAD,EAAkB;AAAA,IAAA;AAAA,IAEpB,OAAOC,EAAG,8BAA8BD,EAAkB,KAAK;AAAA,IAC/D,KAAKC;AAAA,MACH;AAAA,MACAD,EAAkB;AAAA,IAAA;AAAA,IAEpB,iBAAiBC;AAAA,MACf;AAAA,MACAD,EAAkB;AAAA,IAAA;AAAA,IAEpB,aAAaC;AAAA,MACX;AAAA,MACAD,EAAkB;AAAA,IAAA;AAAA,IAEpB,eAAeC;AAAA,MACb;AAAA,MACAD,EAAkB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A,YAAY;AAAA,QACV,qBAAqB,CAACuB,MACpBA,EAAK,eAAe,WAAW,EAAE,OAAO,SAAS;AAAA,QACnD,GAAGJ;AAAA,MAAA;AAAA,MAEL,YAAY;AAAA,QACV,GAAGpB,EAAwBC,GAAeC,CAAiB;AAAA,QAC3D,GAAGe;AAAA,MAAA;AAAA,MAEL,YAAY;AAAA,QACV,GAAGb;AAAA,QACH,GAAGiB;AAAA,MAAA;AAAA,MAEJ,GAAGd;AAAA,IAAA;AAAA,EAAA;AAGV;AAEA,SAASO,EAAkB;AAAA,EACzB,WAAAT;AAAA,EACA,KAAAoB;AAAA,EACA,WAAAC;AAAA,EACA,GAAGnB;AACL,GAA2C;AACzC,QAAML,IAAoBoB,EAAA,GAEpBK,IAAMC,EAAM,OAA0B,IAAI;AAChD,SAAAA,EAAM,UAAU,MAAM;;AACpB,IAAIF,EAAU,aAASG,IAAAF,EAAI,YAAJ,QAAAE,EAAa;AAAA,EACtC,GAAG,CAACH,EAAU,OAAO,CAAC,GAGpB,gBAAAlB;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAmB;AAAA,MACA,MAAK;AAAA,MACL,YAAUF,EAAI,KAAK,mBAAA;AAAA,MACnB,wBACEC,EAAU,YACV,CAACA,EAAU,eACX,CAACA,EAAU,aACX,CAACA,EAAU;AAAA,MAEb,oBAAkBA,EAAU;AAAA,MAC5B,kBAAgBA,EAAU;AAAA,MAC1B,qBAAmBA,EAAU;AAAA,MAC7B,WAAWvB;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACAD,EAAkB;AAAA,QAClBG;AAAA,MAAA;AAAA,MAED,GAAGE;AAAA,IAAA;AAAA,EAAA;AAGV;"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { jsxs as k, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import * as x from "react";
|
|
3
|
+
import { cn as a } from "../../../lib/utils.js";
|
|
4
|
+
import { Button as f } from "../button/button.js";
|
|
5
|
+
const j = (e, r) => `Go to slide ${e + 1} of ${r}`, w = x.forwardRef(
|
|
6
|
+
({
|
|
7
|
+
className: e,
|
|
8
|
+
variant: r = "first",
|
|
9
|
+
slideCount: t = 1,
|
|
10
|
+
selectedIndex: u = 0,
|
|
11
|
+
onSelectIndex: l,
|
|
12
|
+
onBack: m,
|
|
13
|
+
onNext: d,
|
|
14
|
+
onPrimaryAction: p,
|
|
15
|
+
backLabel: h = "Back",
|
|
16
|
+
nextLabel: v = "Next",
|
|
17
|
+
primaryLabel: b = "Call to action",
|
|
18
|
+
goToSlideLabel: g = j,
|
|
19
|
+
...y
|
|
20
|
+
}, N) => {
|
|
21
|
+
const o = r === "first", c = r === "last";
|
|
22
|
+
return /* @__PURE__ */ k(
|
|
23
|
+
"div",
|
|
24
|
+
{
|
|
25
|
+
ref: N,
|
|
26
|
+
className: a(
|
|
27
|
+
"flex h-8 w-full items-center justify-between",
|
|
28
|
+
e
|
|
29
|
+
),
|
|
30
|
+
...y,
|
|
31
|
+
children: [
|
|
32
|
+
/* @__PURE__ */ i(
|
|
33
|
+
"div",
|
|
34
|
+
{
|
|
35
|
+
className: a(
|
|
36
|
+
"flex min-w-0 flex-1 flex-col items-start justify-center",
|
|
37
|
+
o && "h-8"
|
|
38
|
+
),
|
|
39
|
+
children: !o && /* @__PURE__ */ i(f, { variant: "secondary", onClick: m, children: h })
|
|
40
|
+
}
|
|
41
|
+
),
|
|
42
|
+
/* @__PURE__ */ i(
|
|
43
|
+
"div",
|
|
44
|
+
{
|
|
45
|
+
className: "flex shrink-0 items-center gap-[var(--ui-carousel-dialog-list-indicator-gap)]",
|
|
46
|
+
children: Array.from({ length: t }, (C, s) => {
|
|
47
|
+
const n = s === u;
|
|
48
|
+
return /* @__PURE__ */ i(
|
|
49
|
+
"button",
|
|
50
|
+
{
|
|
51
|
+
type: "button",
|
|
52
|
+
"aria-current": n || void 0,
|
|
53
|
+
"aria-label": g(s, t),
|
|
54
|
+
onClick: () => l == null ? void 0 : l(s),
|
|
55
|
+
className: "relative block size-4 shrink-0 cursor-pointer rounded-full outline-none focus-visible:ring-2 focus-visible:ring-[var(--ui-focus-primary)]",
|
|
56
|
+
children: /* @__PURE__ */ i(
|
|
57
|
+
"span",
|
|
58
|
+
{
|
|
59
|
+
className: a(
|
|
60
|
+
"absolute inset-[3.2px] rounded-full",
|
|
61
|
+
n ? "bg-[var(--ui-glyph-on-surface-primary)]" : "bg-[var(--ui-glyph-on-surface-disabled)]"
|
|
62
|
+
)
|
|
63
|
+
}
|
|
64
|
+
)
|
|
65
|
+
},
|
|
66
|
+
s
|
|
67
|
+
);
|
|
68
|
+
})
|
|
69
|
+
}
|
|
70
|
+
),
|
|
71
|
+
/* @__PURE__ */ i(
|
|
72
|
+
"div",
|
|
73
|
+
{
|
|
74
|
+
className: "flex min-w-0 flex-1 flex-col items-end justify-center",
|
|
75
|
+
children: /* @__PURE__ */ i(f, { onClick: c ? p : d, children: c ? b : v })
|
|
76
|
+
}
|
|
77
|
+
)
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
);
|
|
83
|
+
w.displayName = "CarouselDialog";
|
|
84
|
+
export {
|
|
85
|
+
w as CarouselDialog
|
|
86
|
+
};
|
|
87
|
+
//# sourceMappingURL=carousel-dialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"carousel-dialog.js","sources":["../../../../src/components/ui/carousel-dialog/carousel-dialog.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { cn } from '@/lib/utils';\n\nimport { Button } from '../button';\n\n// Ports Figma's \"CarouselDialog\" component (node 6353:5864's descendant,\n// isolated at 6353:4718 / 6353:4891 / 6353:4922 for the first/middle/last\n// variants): the row of controls inside a `DialogFooterCarousel` — a `Back`\n// button (`boxLeft`, hidden on the first slide), the dot `ListIndicator`, and\n// a `Next`/call-to-action button (`boxRight`). Pure controls — no Embla import\n// here; the slide count/index/callbacks are threaded down from\n// `DialogWelcome`, which owns the carousel engine.\n//\n// Internal only — not exported from the package's public entry point. Apps\n// building a welcome/onboarding carousel dialog should use `DialogWelcome`.\n\nexport type CarouselDialogVariant = 'first' | 'middle' | 'last';\n\nexport interface CarouselDialogProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {\n /** Which slide position this renders for. Defaults to `'first'`. */\n variant?: CarouselDialogVariant;\n /** Total number of slides, used to render the dot `ListIndicator`. Defaults to `1`. */\n slideCount?: number;\n /** The currently active slide index (0-based). Defaults to `0`. */\n selectedIndex?: number;\n /** Fires when a dot is activated, with the dot's slide index. */\n onSelectIndex?: (index: number) => void;\n /** Fires when `Back` (hidden on `variant=\"first\"`) is activated. */\n onBack?: () => void;\n /** Fires when `Next` (`variant=\"first\" | \"middle\"`) is activated. */\n onNext?: () => void;\n /** Fires when the call-to-action button (`variant=\"last\"`) is activated. */\n onPrimaryAction?: () => void;\n /** `Back` button label. Defaults to `'Back'`. */\n backLabel?: string;\n /** `Next` button label (`variant=\"first\" | \"middle\"`). Defaults to `'Next'`. */\n nextLabel?: string;\n /** Call-to-action button label (`variant=\"last\"`). Defaults to `'Call to action'`. */\n primaryLabel?: string;\n /** Builds each dot's accessible name from its 0-based index and the slide count. */\n goToSlideLabel?: (index: number, count: number) => string;\n}\n\nconst defaultGoToSlideLabel = (index: number, count: number) =>\n `Go to slide ${index + 1} of ${count}`;\n\nconst CarouselDialog = React.forwardRef<HTMLDivElement, CarouselDialogProps>(\n (\n {\n className,\n variant = 'first',\n slideCount = 1,\n selectedIndex = 0,\n onSelectIndex,\n onBack,\n onNext,\n onPrimaryAction,\n backLabel = 'Back',\n nextLabel = 'Next',\n primaryLabel = 'Call to action',\n goToSlideLabel = defaultGoToSlideLabel,\n ...props\n },\n ref\n ) => {\n const isFirst = variant === 'first';\n const isLast = variant === 'last';\n\n return (\n <div\n ref={ref}\n className={cn(\n 'flex h-8 w-full items-center justify-between',\n className\n )}\n {...props}\n >\n <div\n className={cn(\n 'flex min-w-0 flex-1 flex-col items-start justify-center',\n isFirst && 'h-8'\n )}\n >\n {!isFirst && (\n <Button variant=\"secondary\" onClick={onBack}>\n {backLabel}\n </Button>\n )}\n </div>\n\n <div\n className=\"flex shrink-0 items-center gap-[var(--ui-carousel-dialog-list-indicator-gap)]\"\n >\n {Array.from({ length: slideCount }, (_, index) => {\n const isActive = index === selectedIndex;\n return (\n <button\n key={index}\n type=\"button\"\n aria-current={isActive || undefined}\n aria-label={goToSlideLabel(index, slideCount)}\n onClick={() => onSelectIndex?.(index)}\n className=\"relative block size-4 shrink-0 cursor-pointer rounded-full outline-none focus-visible:ring-2 focus-visible:ring-[var(--ui-focus-primary)]\"\n >\n <span\n className={cn(\n 'absolute inset-[3.2px] rounded-full',\n isActive\n ? 'bg-[var(--ui-glyph-on-surface-primary)]'\n : 'bg-[var(--ui-glyph-on-surface-disabled)]'\n )}\n />\n </button>\n );\n })}\n </div>\n\n <div\n className=\"flex min-w-0 flex-1 flex-col items-end justify-center\"\n >\n <Button onClick={isLast ? onPrimaryAction : onNext}>\n {isLast ? primaryLabel : nextLabel}\n </Button>\n </div>\n </div>\n );\n }\n);\nCarouselDialog.displayName = 'CarouselDialog';\n\nexport { CarouselDialog };\n"],"names":["defaultGoToSlideLabel","index","count","CarouselDialog","React","className","variant","slideCount","selectedIndex","onSelectIndex","onBack","onNext","onPrimaryAction","backLabel","nextLabel","primaryLabel","goToSlideLabel","props","ref","isFirst","isLast","jsxs","cn","jsx","Button","_","isActive"],"mappings":";;;;AA6CA,MAAMA,IAAwB,CAACC,GAAeC,MAC5C,eAAeD,IAAQ,CAAC,OAAOC,CAAK,IAEhCC,IAAiBC,EAAM;AAAA,EAC3B,CACE;AAAA,IACE,WAAAC;AAAA,IACA,SAAAC,IAAU;AAAA,IACV,YAAAC,IAAa;AAAA,IACb,eAAAC,IAAgB;AAAA,IAChB,eAAAC;AAAA,IACA,QAAAC;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AsB;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAU;AAAA,cAEV,UAAA,gBAAAA,EAACC,KAAO,SAASJ,IAASR,IAAkBD,GACzC,UAAAS,IAASL,IAAeD,EAAA,CAC3B;AAAA,YAAA;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AACAX,EAAe,cAAc;"}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { jsxs as l, jsx as a, Fragment as z } from "react/jsx-runtime";
|
|
2
|
+
import * as N from "react";
|
|
3
|
+
import { cva as B } from "../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
|
|
4
|
+
import { cn as k } from "../../../lib/utils.js";
|
|
5
|
+
import { ChartStyle as v } from "../chart/chart.js";
|
|
6
|
+
import { Tooltip as S, TooltipTrigger as I, TooltipContent as O } from "../tooltip/tooltip.js";
|
|
7
|
+
const q = (o) => o.toLocaleString(), F = B("flex w-full overflow-hidden rounded-full bg-input", {
|
|
8
|
+
variants: {
|
|
9
|
+
size: {
|
|
10
|
+
sm: "h-1.5",
|
|
11
|
+
md: "h-2.5",
|
|
12
|
+
lg: "h-4"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
defaultVariants: {
|
|
16
|
+
size: "md"
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
function R({
|
|
20
|
+
chartId: o,
|
|
21
|
+
config: n,
|
|
22
|
+
color: t,
|
|
23
|
+
label: d,
|
|
24
|
+
percent: m,
|
|
25
|
+
segmentKey: f,
|
|
26
|
+
value: u,
|
|
27
|
+
valueFormatter: s,
|
|
28
|
+
renderContent: c
|
|
29
|
+
}) {
|
|
30
|
+
return /* @__PURE__ */ l(
|
|
31
|
+
O,
|
|
32
|
+
{
|
|
33
|
+
"data-chart": o,
|
|
34
|
+
className: k(
|
|
35
|
+
"border border-border bg-background text-foreground shadow-md",
|
|
36
|
+
!c && "flex items-center gap-2"
|
|
37
|
+
),
|
|
38
|
+
children: [
|
|
39
|
+
/* @__PURE__ */ a(v, { id: o, config: n }),
|
|
40
|
+
c ? c({ key: f, value: u, label: d, percent: m, color: t }) : /* @__PURE__ */ l(z, { children: [
|
|
41
|
+
/* @__PURE__ */ a(
|
|
42
|
+
"span",
|
|
43
|
+
{
|
|
44
|
+
className: "size-2.5 shrink-0 rounded-full",
|
|
45
|
+
style: { backgroundColor: t }
|
|
46
|
+
}
|
|
47
|
+
),
|
|
48
|
+
/* @__PURE__ */ a("span", { className: "font-semibold", children: d }),
|
|
49
|
+
/* @__PURE__ */ l("span", { className: "text-muted-foreground tabular-nums", children: [
|
|
50
|
+
s(u),
|
|
51
|
+
" · ",
|
|
52
|
+
m,
|
|
53
|
+
"%"
|
|
54
|
+
] })
|
|
55
|
+
] })
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
const V = N.forwardRef(
|
|
61
|
+
({
|
|
62
|
+
className: o,
|
|
63
|
+
data: n,
|
|
64
|
+
config: t,
|
|
65
|
+
size: d,
|
|
66
|
+
showLegend: m = !1,
|
|
67
|
+
showTooltip: f = !0,
|
|
68
|
+
tooltipContent: u,
|
|
69
|
+
valueFormatter: s = q,
|
|
70
|
+
defaultOpenIndex: c,
|
|
71
|
+
"aria-label": w,
|
|
72
|
+
...C
|
|
73
|
+
}, T) => {
|
|
74
|
+
const p = `chart-${N.useId().replace(/:/g, "")}`, h = n.reduce((e, r) => e + r.value, 0), b = (e) => {
|
|
75
|
+
var r;
|
|
76
|
+
return ((r = t[e]) == null ? void 0 : r.label) ?? e;
|
|
77
|
+
}, $ = (e) => {
|
|
78
|
+
var i;
|
|
79
|
+
const r = (i = t[e]) == null ? void 0 : i.label;
|
|
80
|
+
return typeof r == "string" || typeof r == "number" ? String(r) : e;
|
|
81
|
+
}, x = (e) => `var(--color-${e})`, y = (e) => h > 0 ? Math.round(e / h * 100) : 0, j = w ?? n.map((e) => `${$(e.key)} ${s(e.value)}`).join(", ");
|
|
82
|
+
return /* @__PURE__ */ l(
|
|
83
|
+
"div",
|
|
84
|
+
{
|
|
85
|
+
ref: T,
|
|
86
|
+
"data-chart": p,
|
|
87
|
+
className: k("flex w-full flex-col gap-3", o),
|
|
88
|
+
...C,
|
|
89
|
+
children: [
|
|
90
|
+
/* @__PURE__ */ a(v, { id: p, config: t }),
|
|
91
|
+
/* @__PURE__ */ a("div", { className: F({ size: d }), role: "img", "aria-label": j, children: n.map((e, r) => {
|
|
92
|
+
const i = x(e.key), g = /* @__PURE__ */ a(
|
|
93
|
+
"div",
|
|
94
|
+
{
|
|
95
|
+
className: "h-full min-w-0",
|
|
96
|
+
style: { flex: `${e.value} 0 0%`, backgroundColor: i }
|
|
97
|
+
},
|
|
98
|
+
e.key
|
|
99
|
+
);
|
|
100
|
+
return f ? /* @__PURE__ */ l(S, { defaultOpen: r === c, children: [
|
|
101
|
+
/* @__PURE__ */ a(I, { render: g }),
|
|
102
|
+
/* @__PURE__ */ a(
|
|
103
|
+
R,
|
|
104
|
+
{
|
|
105
|
+
chartId: p,
|
|
106
|
+
config: t,
|
|
107
|
+
color: i,
|
|
108
|
+
label: b(e.key),
|
|
109
|
+
percent: y(e.value),
|
|
110
|
+
segmentKey: e.key,
|
|
111
|
+
value: e.value,
|
|
112
|
+
valueFormatter: s,
|
|
113
|
+
renderContent: u
|
|
114
|
+
}
|
|
115
|
+
)
|
|
116
|
+
] }, e.key) : g;
|
|
117
|
+
}) }),
|
|
118
|
+
m && /* @__PURE__ */ a("ul", { className: "flex flex-wrap justify-between gap-x-6 gap-y-3", children: n.map((e) => /* @__PURE__ */ l("li", { className: "flex flex-col gap-1.5", children: [
|
|
119
|
+
/* @__PURE__ */ l("span", { className: "flex items-center gap-1.5 text-sm leading-none text-muted-foreground", children: [
|
|
120
|
+
/* @__PURE__ */ a(
|
|
121
|
+
"span",
|
|
122
|
+
{
|
|
123
|
+
className: "size-2.5 shrink-0 rounded-sm",
|
|
124
|
+
style: { backgroundColor: x(e.key) }
|
|
125
|
+
}
|
|
126
|
+
),
|
|
127
|
+
b(e.key)
|
|
128
|
+
] }),
|
|
129
|
+
/* @__PURE__ */ l("span", { className: "flex items-baseline gap-1.5 leading-none tabular-nums", children: [
|
|
130
|
+
/* @__PURE__ */ a("span", { className: "text-base font-semibold text-foreground", children: s(e.value) }),
|
|
131
|
+
/* @__PURE__ */ l("span", { className: "text-sm text-muted-foreground", children: [
|
|
132
|
+
y(e.value),
|
|
133
|
+
"%"
|
|
134
|
+
] })
|
|
135
|
+
] })
|
|
136
|
+
] }, e.key)) })
|
|
137
|
+
]
|
|
138
|
+
}
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
);
|
|
142
|
+
V.displayName = "CategoryBar";
|
|
143
|
+
export {
|
|
144
|
+
V as CategoryBar,
|
|
145
|
+
F as categoryBarVariants
|
|
146
|
+
};
|
|
147
|
+
//# sourceMappingURL=category-bar.js.map
|