@acronis-platform/ui-react 0.57.1 → 0.60.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.
Files changed (170) hide show
  1. package/dist/components/ui/area-chart/area-chart.js +177 -0
  2. package/dist/components/ui/area-chart/area-chart.js.map +1 -0
  3. package/dist/components/ui/bar-chart/bar-chart.js +184 -78
  4. package/dist/components/ui/bar-chart/bar-chart.js.map +1 -1
  5. package/dist/components/ui/button-icon-input/button-icon-input.js +36 -0
  6. package/dist/components/ui/button-icon-input/button-icon-input.js.map +1 -0
  7. package/dist/components/ui/button-menu/button-menu.js +1 -1
  8. package/dist/components/ui/button-menu/button-menu.js.map +1 -1
  9. package/dist/components/ui/calendar/calendar.js +17 -15
  10. package/dist/components/ui/calendar/calendar.js.map +1 -1
  11. package/dist/components/ui/card-filter/card-filter.js +40 -27
  12. package/dist/components/ui/card-filter/card-filter.js.map +1 -1
  13. package/dist/components/ui/carousel-dialog/carousel-dialog.js +87 -0
  14. package/dist/components/ui/carousel-dialog/carousel-dialog.js.map +1 -0
  15. package/dist/components/ui/category-bar/category-bar.js +126 -0
  16. package/dist/components/ui/category-bar/category-bar.js.map +1 -0
  17. package/dist/components/ui/chart/chart-format.js +40 -0
  18. package/dist/components/ui/chart/chart-format.js.map +1 -0
  19. package/dist/components/ui/chart/chart.js.map +1 -1
  20. package/dist/components/ui/chart-state/chart-state.js +42 -0
  21. package/dist/components/ui/chart-state/chart-state.js.map +1 -0
  22. package/dist/components/ui/chip/chip.js +13 -13
  23. package/dist/components/ui/chip/chip.js.map +1 -1
  24. package/dist/components/ui/composed-chart/composed-chart.js +135 -0
  25. package/dist/components/ui/composed-chart/composed-chart.js.map +1 -0
  26. package/dist/components/ui/confidence-cone/confidence-cone.js +223 -0
  27. package/dist/components/ui/confidence-cone/confidence-cone.js.map +1 -0
  28. package/dist/components/ui/date-range-picker/date-range-picker.js +21 -21
  29. package/dist/components/ui/date-range-picker/date-range-picker.js.map +1 -1
  30. package/dist/components/ui/dialog/dialog.js +248 -76
  31. package/dist/components/ui/dialog/dialog.js.map +1 -1
  32. package/dist/components/ui/dialog-footer-carousel/dialog-footer-carousel.js +57 -0
  33. package/dist/components/ui/dialog-footer-carousel/dialog-footer-carousel.js.map +1 -0
  34. package/dist/components/ui/dialog-footer-default/dialog-footer-default.js +26 -0
  35. package/dist/components/ui/dialog-footer-default/dialog-footer-default.js.map +1 -0
  36. package/dist/components/ui/dialog-welcome/dialog-welcome.js +272 -0
  37. package/dist/components/ui/dialog-welcome/dialog-welcome.js.map +1 -0
  38. package/dist/components/ui/dropdown-menu/dropdown-menu.js +21 -21
  39. package/dist/components/ui/dropdown-menu/dropdown-menu.js.map +1 -1
  40. package/dist/components/ui/filter-search/filter-search.js +91 -90
  41. package/dist/components/ui/filter-search/filter-search.js.map +1 -1
  42. package/dist/components/ui/funnel-chart/funnel-chart.js +87 -0
  43. package/dist/components/ui/funnel-chart/funnel-chart.js.map +1 -0
  44. package/dist/components/ui/histogram/histogram.js +136 -0
  45. package/dist/components/ui/histogram/histogram.js.map +1 -0
  46. package/dist/components/ui/input/input.js.map +1 -1
  47. package/dist/components/ui/input-otp/input-otp.js +104 -0
  48. package/dist/components/ui/input-otp/input-otp.js.map +1 -0
  49. package/dist/components/ui/input-password/input-password.js +120 -0
  50. package/dist/components/ui/input-password/input-password.js.map +1 -0
  51. package/dist/components/ui/input-text/input-text.js +9 -9
  52. package/dist/components/ui/input-text/input-text.js.map +1 -1
  53. package/dist/components/ui/line-chart/line-chart.js +234 -0
  54. package/dist/components/ui/line-chart/line-chart.js.map +1 -0
  55. package/dist/components/ui/link/link.js +5 -5
  56. package/dist/components/ui/link/link.js.map +1 -1
  57. package/dist/components/ui/loading/loading.js +79 -0
  58. package/dist/components/ui/loading/loading.js.map +1 -0
  59. package/dist/components/ui/meter/meter.js +93 -0
  60. package/dist/components/ui/meter/meter.js.map +1 -0
  61. package/dist/components/ui/metric/metric.js +185 -0
  62. package/dist/components/ui/metric/metric.js.map +1 -0
  63. package/dist/components/ui/pie-chart/pie-chart.js +113 -0
  64. package/dist/components/ui/pie-chart/pie-chart.js.map +1 -0
  65. package/dist/components/ui/popover/popover.js +57 -27
  66. package/dist/components/ui/popover/popover.js.map +1 -1
  67. package/dist/components/ui/radar-chart/radar-chart.js +74 -0
  68. package/dist/components/ui/radar-chart/radar-chart.js.map +1 -0
  69. package/dist/components/ui/radial-bar-chart/radial-bar-chart.js +69 -0
  70. package/dist/components/ui/radial-bar-chart/radial-bar-chart.js.map +1 -0
  71. package/dist/components/ui/sankey-chart/sankey-chart.js +192 -0
  72. package/dist/components/ui/sankey-chart/sankey-chart.js.map +1 -0
  73. package/dist/components/ui/scatter-chart/scatter-chart.js +130 -0
  74. package/dist/components/ui/scatter-chart/scatter-chart.js.map +1 -0
  75. package/dist/components/ui/search/search.js +16 -16
  76. package/dist/components/ui/search/search.js.map +1 -1
  77. package/dist/components/ui/sheet/sheet-details.js +16 -16
  78. package/dist/components/ui/sheet/sheet-details.js.map +1 -1
  79. package/dist/components/ui/spinner/spinner.js.map +1 -1
  80. package/dist/components/ui/timeline/timeline.js +175 -0
  81. package/dist/components/ui/timeline/timeline.js.map +1 -0
  82. package/dist/components/ui/toolbar/toolbar.js +82 -92
  83. package/dist/components/ui/toolbar/toolbar.js.map +1 -1
  84. package/dist/components/ui/treemap/treemap.js +83 -0
  85. package/dist/components/ui/treemap/treemap.js.map +1 -0
  86. package/dist/components/ui/trend-indicator/trend-indicator.js +97 -0
  87. package/dist/components/ui/trend-indicator/trend-indicator.js.map +1 -0
  88. package/dist/index.js +461 -400
  89. package/dist/index.js.map +1 -1
  90. package/dist/lib/breakpoints.js +9 -6
  91. package/dist/lib/breakpoints.js.map +1 -1
  92. 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
  93. 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
  94. 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
  95. 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
  96. package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/embla-carousel.esm.js +1205 -0
  97. package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/embla-carousel.esm.js.map +1 -0
  98. package/dist/react.js +461 -400
  99. package/dist/react.js.map +1 -1
  100. package/dist/src/components/ui/area-chart/area-chart.d.ts +34 -0
  101. package/dist/src/components/ui/area-chart/index.d.ts +1 -0
  102. package/dist/src/components/ui/avatar/avatar.d.ts +1 -1
  103. package/dist/src/components/ui/bar-chart/bar-chart.d.ts +30 -5
  104. package/dist/src/components/ui/bar-chart/index.d.ts +1 -1
  105. package/dist/src/components/ui/button-icon-input/button-icon-input.d.ts +21 -0
  106. package/dist/src/components/ui/button-icon-input/index.d.ts +1 -0
  107. package/dist/src/components/ui/card-filter/card-filter.d.ts +5 -0
  108. package/dist/src/components/ui/carousel-dialog/carousel-dialog.d.ts +28 -0
  109. package/dist/src/components/ui/carousel-dialog/index.d.ts +1 -0
  110. package/dist/src/components/ui/category-bar/category-bar.d.ts +51 -0
  111. package/dist/src/components/ui/category-bar/index.d.ts +1 -0
  112. package/dist/src/components/ui/chart/__tests__/chart-format.test.d.ts +1 -0
  113. package/dist/src/components/ui/chart/chart-format.d.ts +111 -0
  114. package/dist/src/components/ui/chart/chart.d.ts +2 -0
  115. package/dist/src/components/ui/chart/index.d.ts +3 -1
  116. package/dist/src/components/ui/chart-state/chart-state.d.ts +11 -0
  117. package/dist/src/components/ui/chart-state/index.d.ts +1 -0
  118. package/dist/src/components/ui/composed-chart/composed-chart.d.ts +33 -0
  119. package/dist/src/components/ui/composed-chart/index.d.ts +1 -0
  120. package/dist/src/components/ui/confidence-cone/confidence-cone.d.ts +62 -0
  121. package/dist/src/components/ui/confidence-cone/index.d.ts +1 -0
  122. package/dist/src/components/ui/dialog/dialog.d.ts +105 -9
  123. package/dist/src/components/ui/dialog/dialog.docs.d.ts +82 -5
  124. package/dist/src/components/ui/dialog/index.d.ts +1 -1
  125. package/dist/src/components/ui/dialog-footer-carousel/dialog-footer-carousel.d.ts +9 -0
  126. package/dist/src/components/ui/dialog-footer-carousel/index.d.ts +1 -0
  127. package/dist/src/components/ui/dialog-footer-default/dialog-footer-default.d.ts +11 -0
  128. package/dist/src/components/ui/dialog-footer-default/index.d.ts +1 -0
  129. package/dist/src/components/ui/dialog-welcome/dialog-welcome.d.ts +54 -0
  130. package/dist/src/components/ui/dialog-welcome/dialog-welcome.docs.d.ts +55 -0
  131. package/dist/src/components/ui/dialog-welcome/index.d.ts +1 -0
  132. package/dist/src/components/ui/filter-search/filter-search.d.ts +1 -1
  133. package/dist/src/components/ui/funnel-chart/funnel-chart.d.ts +39 -0
  134. package/dist/src/components/ui/funnel-chart/index.d.ts +1 -0
  135. package/dist/src/components/ui/histogram/histogram.d.ts +40 -0
  136. package/dist/src/components/ui/histogram/index.d.ts +1 -0
  137. package/dist/src/components/ui/input-otp/index.d.ts +1 -0
  138. package/dist/src/components/ui/input-otp/input-otp.d.ts +23 -0
  139. package/dist/src/components/ui/input-password/index.d.ts +1 -0
  140. package/dist/src/components/ui/input-password/input-password.d.ts +21 -0
  141. package/dist/src/components/ui/line-chart/index.d.ts +1 -0
  142. package/dist/src/components/ui/line-chart/line-chart.d.ts +68 -0
  143. package/dist/src/components/ui/loading/index.d.ts +1 -0
  144. package/dist/src/components/ui/loading/loading.d.ts +13 -0
  145. package/dist/src/components/ui/meter/index.d.ts +1 -0
  146. package/dist/src/components/ui/meter/meter.d.ts +25 -0
  147. package/dist/src/components/ui/metric/index.d.ts +1 -0
  148. package/dist/src/components/ui/metric/metric.d.ts +37 -0
  149. package/dist/src/components/ui/pie-chart/index.d.ts +1 -0
  150. package/dist/src/components/ui/pie-chart/pie-chart.d.ts +54 -0
  151. package/dist/src/components/ui/popover/index.d.ts +1 -1
  152. package/dist/src/components/ui/popover/popover.d.ts +13 -1
  153. package/dist/src/components/ui/radar-chart/index.d.ts +1 -0
  154. package/dist/src/components/ui/radar-chart/radar-chart.d.ts +40 -0
  155. package/dist/src/components/ui/radial-bar-chart/index.d.ts +1 -0
  156. package/dist/src/components/ui/radial-bar-chart/radial-bar-chart.d.ts +45 -0
  157. package/dist/src/components/ui/sankey-chart/index.d.ts +2 -0
  158. package/dist/src/components/ui/sankey-chart/sankey-chart.d.ts +69 -0
  159. package/dist/src/components/ui/scatter-chart/index.d.ts +1 -0
  160. package/dist/src/components/ui/scatter-chart/scatter-chart.d.ts +35 -0
  161. package/dist/src/components/ui/stack/stack.d.ts +1 -1
  162. package/dist/src/components/ui/timeline/index.d.ts +1 -0
  163. package/dist/src/components/ui/timeline/timeline.d.ts +41 -0
  164. package/dist/src/components/ui/treemap/index.d.ts +1 -0
  165. package/dist/src/components/ui/treemap/treemap.d.ts +44 -0
  166. package/dist/src/components/ui/trend-indicator/index.d.ts +1 -0
  167. package/dist/src/components/ui/trend-indicator/trend-indicator.d.ts +32 -0
  168. package/dist/src/index.d.ts +27 -2
  169. package/dist/ui-react.css +1 -1
  170. package/package.json +5 -4
@@ -1 +1 @@
1
- {"version":3,"file":"button-menu.js","sources":["../../../../src/components/ui/button-menu/button-menu.tsx"],"sourcesContent":["import * as React from 'react';\nimport { mergeProps } from '@base-ui/react/merge-props';\nimport { useRender } from '@base-ui/react/use-render';\nimport {\n ChevronDownIcon,\n ChevronUpIcon,\n} from '@acronis-platform/icons-react/stroke-mono';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@/lib/utils';\n\n// Mirrors the Figma \"ButtonMenu\" component: a Button-like trigger (label +\n// trailing chevron) that opens a menu. `variant` maps to the Figma `variant`\n// property (Primary / Secondary); the Figma `active` state is the **open** state\n// — the chevron flips down→up and the container takes its `*-active` colors. Each\n// interaction state wires the container fill, label, icon, and — for `secondary`\n// — the border to its own dedicated `--ui-button-menu-*` token from\n// @acronis-platform/tokens-pd. Every state is referenced explicitly (runtime\n// `var()` lookups: a brand override is only honored if the matching state token is\n// referenced). `primary` keeps a single label/icon color across states; only\n// `secondary` diverges them per state. Geometry — 32px height, 8px gap, 12px\n// padding-x, 4px radius, 64px min-width, 16px icon — comes from the\n// `--ui-button-menu-global-*` tokens. The open treatment is driven by the\n// `data-open` attribute (set from the `open` prop) and CSS `:active` for press\n// feedback; disabled uses the explicit disabled tokens (not opacity). Focus: the\n// Figma focus state is a 3px `--ui-focus-primary` ring flush to the button edge\n// (no offset) — `ring-[3px]`, no `ring-offset`.\nconst buttonMenuVariants = cva(\n 'inline-flex h-[var(--ui-button-menu-global-container-height)] min-w-[var(--ui-button-menu-global-container-width-min)] items-center justify-center gap-[var(--ui-button-menu-global-container-gap)] whitespace-nowrap rounded-[var(--ui-button-menu-global-container-border-radius)] border border-transparent px-[var(--ui-button-menu-global-container-padding-x)] text-sm font-semibold leading-6 transition-colors focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-[var(--ui-focus-primary)] disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:size-[var(--ui-button-menu-global-icon-size)] [&_svg]:shrink-0',\n {\n variants: {\n variant: {\n primary:\n 'bg-[var(--ui-button-menu-primary-container-color-idle)] text-[var(--ui-button-menu-primary-label-color)] [&_svg]:text-[var(--ui-button-menu-primary-icon-color)] hover:bg-[var(--ui-button-menu-primary-container-color-hover)] active:bg-[var(--ui-button-menu-primary-container-color-active)] data-[open]:bg-[var(--ui-button-menu-primary-container-color-active)] disabled:bg-[var(--ui-button-menu-primary-container-color-disabled)]',\n secondary:\n 'bg-[var(--ui-button-menu-secondary-container-color-idle)] text-[var(--ui-button-menu-secondary-label-color-idle)] border-[var(--ui-button-menu-secondary-container-border-color-idle)] [&_svg]:text-[var(--ui-button-menu-secondary-icon-color-idle)] hover:bg-[var(--ui-button-menu-secondary-container-color-hover)] hover:text-[var(--ui-button-menu-secondary-label-color-hover)] hover:border-[var(--ui-button-menu-secondary-container-border-color-hover)] hover:[&_svg]:text-[var(--ui-button-menu-secondary-icon-color-hover)] active:bg-[var(--ui-button-menu-secondary-container-color-active)] active:text-[var(--ui-button-menu-secondary-label-color-active)] active:border-[var(--ui-button-menu-secondary-container-border-color-active)] active:[&_svg]:text-[var(--ui-button-menu-secondary-icon-color-active)] data-[open]:bg-[var(--ui-button-menu-secondary-container-color-active)] data-[open]:text-[var(--ui-button-menu-secondary-label-color-active)] data-[open]:border-[var(--ui-button-menu-secondary-container-border-color-active)] data-[open]:[&_svg]:text-[var(--ui-button-menu-secondary-icon-color-active)] disabled:bg-[var(--ui-button-menu-secondary-container-color-disabled)] disabled:text-[var(--ui-button-menu-secondary-label-color-disabled)] disabled:border-[var(--ui-button-menu-secondary-container-border-color-disabled)] disabled:[&_svg]:text-[var(--ui-button-menu-secondary-icon-color-disabled)]',\n },\n },\n defaultVariants: {\n variant: 'primary',\n },\n }\n);\n\nexport interface ButtonMenuProps\n extends\n Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'children'>,\n VariantProps<typeof buttonMenuVariants> {\n /**\n * Whether the associated menu is open. Flips the trailing chevron\n * (down → up), applies the open (`*-active`) treatment, and reflects\n * `aria-expanded`. Control this in sync with the menu you trigger.\n */\n open?: boolean;\n /** Label content rendered before the chevron. */\n children?: React.ReactNode;\n /**\n * Replace the rendered `<button>` with another element or component\n * (Base UI composition). Accepts a React element or a render function —\n * the component's props and class names are merged onto it.\n */\n render?: useRender.RenderProp;\n}\n\n/**\n * A button that opens a dropdown menu: a label followed by a chevron that\n * points up while `open`. Pair it with the menu/popover it controls and keep\n * the `open` prop in sync.\n */\nconst ButtonMenu = React.forwardRef<HTMLButtonElement, ButtonMenuProps>(\n ({ className, variant, open, render, children, ...props }, ref) => {\n const Chevron = open ? ChevronUpIcon : ChevronDownIcon;\n return useRender({\n render,\n ref,\n defaultTagName: 'button',\n props: mergeProps<'button'>(\n {\n className: cn(buttonMenuVariants({ variant, className })),\n 'aria-expanded': open,\n // `data-open` drives the open (`*-active`) token switch via attribute\n // selectors; present only while open, and typed loosely because\n // React's button attribute map doesn't include arbitrary data-* keys\n // as literals.\n ...(open ? ({ 'data-open': '' } as Record<string, string>) : {}),\n children: (\n <>\n {children}\n <Chevron />\n </>\n ),\n },\n props\n ),\n });\n }\n);\nButtonMenu.displayName = 'ButtonMenu';\n\nexport { ButtonMenu, buttonMenuVariants };\n"],"names":["buttonMenuVariants","cva","ButtonMenu","React","className","variant","open","render","children","props","ref","Chevron","ChevronUpIcon","ChevronDownIcon","useRender","mergeProps","cn","jsxs","Fragment"],"mappings":";;;;;;;AA2BA,MAAMA,IAAqBC;AAAA,EACzB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SACE;AAAA,QACF,WACE;AAAA,MAAA;AAAA,IACJ;AAAA,IAEF,iBAAiB;AAAA,MACf,SAAS;AAAA,IAAA;AAAA,EACX;AAEJ,GA2BMC,IAAaC,EAAM;AAAA,EACvB,CAAC,EAAE,WAAAC,GAAW,SAAAC,GAAS,MAAAC,GAAM,QAAAC,GAAQ,UAAAC,GAAU,GAAGC,EAAA,GAASC,MAAQ;AACjE,UAAMC,IAAUL,IAAOM,IAAgBC;AACvC,WAAOC,EAAU;AAAA,MACf,QAAAP;AAAA,MACA,KAAAG;AAAA,MACA,gBAAgB;AAAA,MAChB,OAAOK;AAAA,QACL;AAAA,UACE,WAAWC,EAAGhB,EAAmB,EAAE,SAAAK,GAAS,WAAAD,EAAA,CAAW,CAAC;AAAA,UACxD,iBAAiBE;AAAA;AAAA;AAAA;AAAA;AAAA,UAKjB,GAAIA,IAAQ,EAAE,aAAa,GAAA,IAAkC,CAAA;AAAA,UAC7D,UACE,gBAAAW,EAAAC,GAAA,EACG,UAAA;AAAA,YAAAV;AAAA,8BACAG,GAAA,CAAA,CAAQ;AAAA,UAAA,EAAA,CACX;AAAA,QAAA;AAAA,QAGJF;AAAA,MAAA;AAAA,IACF,CACD;AAAA,EACH;AACF;AACAP,EAAW,cAAc;"}
1
+ {"version":3,"file":"button-menu.js","sources":["../../../../src/components/ui/button-menu/button-menu.tsx"],"sourcesContent":["import * as React from 'react';\nimport { mergeProps } from '@base-ui/react/merge-props';\nimport { useRender } from '@base-ui/react/use-render';\nimport {\n ChevronDownIcon,\n ChevronUpIcon,\n} from '@acronis-platform/icons-react/stroke-mono';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@/lib/utils';\n\n// Mirrors the Figma \"ButtonMenu\" component: a Button-like trigger (label +\n// trailing chevron) that opens a menu. `variant` maps to the Figma `variant`\n// property (Primary / Secondary); the Figma `active` state is the **open** state\n// — the chevron flips down→up and the container takes its `*-active` colors. Each\n// interaction state wires the container fill, label, icon, and — for `secondary`\n// — the border to its own dedicated `--ui-button-menu-*` token from\n// @acronis-platform/tokens-pd. Every state is referenced explicitly (runtime\n// `var()` lookups: a brand override is only honored if the matching state token is\n// referenced). `primary` keeps a single label/icon color across states; only\n// `secondary` diverges them per state. Geometry — 32px height, 8px gap, 12px\n// padding-x, 4px radius, 64px min-width, 16px icon — comes from the\n// `--ui-button-menu-global-*` tokens. The open treatment is driven by the\n// `data-open` attribute (set from the `open` prop) and CSS `:active` for press\n// feedback; disabled uses the explicit disabled tokens (not opacity). Focus: the\n// Figma focus state is a 3px `--ui-focus-primary` ring flush to the button edge\n// (no offset) — `ring-[3px]`, no `ring-offset`.\nconst buttonMenuVariants = cva(\n 'inline-flex h-[var(--ui-button-menu-global-container-height)] min-w-[var(--ui-button-menu-global-container-width-min)] cursor-pointer items-center justify-center gap-[var(--ui-button-menu-global-container-gap)] whitespace-nowrap rounded-[var(--ui-button-menu-global-container-border-radius)] border border-transparent px-[var(--ui-button-menu-global-container-padding-x)] text-sm font-semibold leading-6 transition-colors focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-[var(--ui-focus-primary)] disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:size-[var(--ui-button-menu-global-icon-size)] [&_svg]:shrink-0',\n {\n variants: {\n variant: {\n primary:\n 'bg-[var(--ui-button-menu-primary-container-color-idle)] text-[var(--ui-button-menu-primary-label-color)] [&_svg]:text-[var(--ui-button-menu-primary-icon-color)] hover:bg-[var(--ui-button-menu-primary-container-color-hover)] active:bg-[var(--ui-button-menu-primary-container-color-active)] data-[open]:bg-[var(--ui-button-menu-primary-container-color-active)] disabled:bg-[var(--ui-button-menu-primary-container-color-disabled)]',\n secondary:\n 'bg-[var(--ui-button-menu-secondary-container-color-idle)] text-[var(--ui-button-menu-secondary-label-color-idle)] border-[var(--ui-button-menu-secondary-container-border-color-idle)] [&_svg]:text-[var(--ui-button-menu-secondary-icon-color-idle)] hover:bg-[var(--ui-button-menu-secondary-container-color-hover)] hover:text-[var(--ui-button-menu-secondary-label-color-hover)] hover:border-[var(--ui-button-menu-secondary-container-border-color-hover)] hover:[&_svg]:text-[var(--ui-button-menu-secondary-icon-color-hover)] active:bg-[var(--ui-button-menu-secondary-container-color-active)] active:text-[var(--ui-button-menu-secondary-label-color-active)] active:border-[var(--ui-button-menu-secondary-container-border-color-active)] active:[&_svg]:text-[var(--ui-button-menu-secondary-icon-color-active)] data-[open]:bg-[var(--ui-button-menu-secondary-container-color-active)] data-[open]:text-[var(--ui-button-menu-secondary-label-color-active)] data-[open]:border-[var(--ui-button-menu-secondary-container-border-color-active)] data-[open]:[&_svg]:text-[var(--ui-button-menu-secondary-icon-color-active)] disabled:bg-[var(--ui-button-menu-secondary-container-color-disabled)] disabled:text-[var(--ui-button-menu-secondary-label-color-disabled)] disabled:border-[var(--ui-button-menu-secondary-container-border-color-disabled)] disabled:[&_svg]:text-[var(--ui-button-menu-secondary-icon-color-disabled)]',\n },\n },\n defaultVariants: {\n variant: 'primary',\n },\n }\n);\n\nexport interface ButtonMenuProps\n extends\n Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'children'>,\n VariantProps<typeof buttonMenuVariants> {\n /**\n * Whether the associated menu is open. Flips the trailing chevron\n * (down → up), applies the open (`*-active`) treatment, and reflects\n * `aria-expanded`. Control this in sync with the menu you trigger.\n */\n open?: boolean;\n /** Label content rendered before the chevron. */\n children?: React.ReactNode;\n /**\n * Replace the rendered `<button>` with another element or component\n * (Base UI composition). Accepts a React element or a render function —\n * the component's props and class names are merged onto it.\n */\n render?: useRender.RenderProp;\n}\n\n/**\n * A button that opens a dropdown menu: a label followed by a chevron that\n * points up while `open`. Pair it with the menu/popover it controls and keep\n * the `open` prop in sync.\n */\nconst ButtonMenu = React.forwardRef<HTMLButtonElement, ButtonMenuProps>(\n ({ className, variant, open, render, children, ...props }, ref) => {\n const Chevron = open ? ChevronUpIcon : ChevronDownIcon;\n return useRender({\n render,\n ref,\n defaultTagName: 'button',\n props: mergeProps<'button'>(\n {\n className: cn(buttonMenuVariants({ variant, className })),\n 'aria-expanded': open,\n // `data-open` drives the open (`*-active`) token switch via attribute\n // selectors; present only while open, and typed loosely because\n // React's button attribute map doesn't include arbitrary data-* keys\n // as literals.\n ...(open ? ({ 'data-open': '' } as Record<string, string>) : {}),\n children: (\n <>\n {children}\n <Chevron />\n </>\n ),\n },\n props\n ),\n });\n }\n);\nButtonMenu.displayName = 'ButtonMenu';\n\nexport { ButtonMenu, buttonMenuVariants };\n"],"names":["buttonMenuVariants","cva","ButtonMenu","React","className","variant","open","render","children","props","ref","Chevron","ChevronUpIcon","ChevronDownIcon","useRender","mergeProps","cn","jsxs","Fragment"],"mappings":";;;;;;;AA2BA,MAAMA,IAAqBC;AAAA,EACzB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SACE;AAAA,QACF,WACE;AAAA,MAAA;AAAA,IACJ;AAAA,IAEF,iBAAiB;AAAA,MACf,SAAS;AAAA,IAAA;AAAA,EACX;AAEJ,GA2BMC,IAAaC,EAAM;AAAA,EACvB,CAAC,EAAE,WAAAC,GAAW,SAAAC,GAAS,MAAAC,GAAM,QAAAC,GAAQ,UAAAC,GAAU,GAAGC,EAAA,GAASC,MAAQ;AACjE,UAAMC,IAAUL,IAAOM,IAAgBC;AACvC,WAAOC,EAAU;AAAA,MACf,QAAAP;AAAA,MACA,KAAAG;AAAA,MACA,gBAAgB;AAAA,MAChB,OAAOK;AAAA,QACL;AAAA,UACE,WAAWC,EAAGhB,EAAmB,EAAE,SAAAK,GAAS,WAAAD,EAAA,CAAW,CAAC;AAAA,UACxD,iBAAiBE;AAAA;AAAA;AAAA;AAAA;AAAA,UAKjB,GAAIA,IAAQ,EAAE,aAAa,GAAA,IAAkC,CAAA;AAAA,UAC7D,UACE,gBAAAW,EAAAC,GAAA,EACG,UAAA;AAAA,YAAAV;AAAA,8BACAG,GAAA,CAAA,CAAQ;AAAA,UAAA,EAAA,CACX;AAAA,QAAA;AAAA,QAGJF;AAAA,MAAA;AAAA,IACF,CACD;AAAA,EACH;AACF;AACAP,EAAW,cAAc;"}
@@ -1,4 +1,4 @@
1
- import { jsx as o } from "react/jsx-runtime";
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__ */ o(
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
- Chevron: ({ className: n, orientation: e, ...t }) => e === "left" ? /* @__PURE__ */ o(
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
- ...t
113
+ ...o
112
114
  }
113
- ) : e === "right" ? /* @__PURE__ */ o(
115
+ ) : e === "right" ? /* @__PURE__ */ a(
114
116
  m,
115
117
  {
116
118
  size: 16,
117
119
  className: r("rtl:rotate-180", n),
118
- ...t
120
+ ...o
119
121
  }
120
- ) : /* @__PURE__ */ o(f, { size: 16, className: r(n), ...t }),
122
+ ) : /* @__PURE__ */ a(f, { size: 16, className: r(n), ...o }),
121
123
  DayButton: y,
122
- WeekNumber: ({ children: n, ...e }) => /* @__PURE__ */ o("td", { ...e, children: /* @__PURE__ */ o("div", { className: "flex size-[var(--cell-size)] items-center justify-center text-center", children: n }) })
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: a = "label",
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__ */ o(
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: a,
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(a, g),
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
- ...a
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__ */ o(
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
- ...a
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;AAAA,MACAD,EAAkB;AAAA,IAAA;AAAA,IAEpB,OAAOC,EAAG,8BAA8BD,EAAkB,KAAK;AAA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AA,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;AAAA,IAAA;AAAA,IAEpB,WAAWC;AAAA,MACT;AAAA,MACAD,EAAkB;AAAA,IAAA;AAAA,IAEpB,e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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;"}
@@ -1,48 +1,61 @@
1
- import { jsxs as i, Fragment as v, jsx as l } from "react/jsx-runtime";
2
- import * as g from "react";
1
+ import { jsxs as l, Fragment as g, jsx as t } from "react/jsx-runtime";
2
+ import * as p from "react";
3
3
  import { mergeProps as m } from "@base-ui/react/merge-props";
4
- import { useRender as p } from "@base-ui/react/use-render";
5
- import { cva as x } from "../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
6
- import { cn as o } from "../../../lib/utils.js";
7
- const h = x(
4
+ import { useRender as x } from "@base-ui/react/use-render";
5
+ import { cva as h } from "../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
6
+ import { cn as c } from "../../../lib/utils.js";
7
+ const y = h(
8
8
  "inline-flex w-[224px] min-h-[var(--ui-card-filter-global-container-height)] flex-col items-start rounded-[var(--ui-card-filter-global-container-border-radius)] border-[length:var(--ui-card-filter-global-container-border-width)] border-solid border-[color:var(--ui-card-filter-global-border-color-idle)] bg-[var(--ui-card-filter-global-container-color-idle)] px-[var(--ui-card-filter-global-container-padding-x)] py-[var(--ui-card-filter-global-container-padding-y)] transition-colors",
9
9
  {
10
10
  variants: {
11
11
  variant: {
12
12
  static: "",
13
13
  "static-empty": "",
14
- clickable: "cursor-pointer outline-none hover:border-[color:var(--ui-card-filter-global-border-color-hover)] hover:bg-[var(--ui-card-filter-global-container-color-hover)] active:border-[color:var(--ui-card-filter-global-border-color-active)] active:bg-[var(--ui-card-filter-global-container-color-active)] focus-visible:border-[color:var(--ui-card-filter-global-border-color-focused)] focus-visible:ring-[3px] focus-visible:ring-[var(--ui-focus-primary)]"
14
+ clickable: "cursor-pointer outline-none hover:border-[color:var(--ui-card-filter-global-border-color-hover)] hover:bg-[var(--ui-card-filter-global-container-color-hover)] active:border-[color:var(--ui-card-filter-global-border-color-active)] active:bg-[var(--ui-card-filter-global-container-color-active)] focus-visible:border-[color:var(--ui-card-filter-global-border-color-focused)] focus-visible:ring-[3px] focus-visible:ring-[var(--ui-focus-primary)] data-[selected=true]:border-[color:var(--ui-card-filter-global-border-color-active)] data-[selected=true]:bg-[var(--ui-card-filter-global-container-color-active)]"
15
15
  }
16
16
  },
17
17
  defaultVariants: {
18
18
  variant: "static"
19
19
  }
20
20
  }
21
- ), y = {
21
+ ), k = {
22
22
  static: "text-[var(--ui-card-filter-static-value-color-idle)]",
23
23
  "static-empty": "text-[var(--ui-card-filter-static-value-color-disabled)]",
24
24
  clickable: "text-[var(--ui-card-filter-clickable-value-color)]"
25
- }, k = g.forwardRef(
26
- ({ className: t, variant: r = "static", label: c, value: s, icon: d, render: n, ...b }, u) => {
27
- const a = r === "static-empty", e = r === "clickable", f = a ? "–" : s;
28
- return p({
29
- render: n,
30
- ref: u,
25
+ }, N = p.forwardRef(
26
+ ({
27
+ className: d,
28
+ variant: r = "static",
29
+ label: s,
30
+ value: n,
31
+ icon: b,
32
+ selected: a,
33
+ render: o,
34
+ ...u
35
+ }, v) => {
36
+ const i = r === "static-empty", e = r === "clickable", f = i ? "–" : n;
37
+ return x({
38
+ render: o,
39
+ ref: v,
31
40
  defaultTagName: e ? "button" : "div",
32
41
  props: m(
33
42
  {
34
- className: o(h({ variant: r }), t),
35
- ...e ? { type: "button" } : {},
36
- children: /* @__PURE__ */ i(v, { children: [
37
- /* @__PURE__ */ l("span", { className: "text-xs font-normal leading-4 text-[var(--ui-card-filter-global-label-color)]", children: c }),
38
- /* @__PURE__ */ i("span", { className: "flex items-center gap-[var(--ui-card-filter-global-content-gap)] [&_svg]:size-4 [&_svg]:shrink-0", children: [
39
- !a && d,
40
- /* @__PURE__ */ l(
43
+ className: c(y({ variant: r }), d),
44
+ ...e && !o ? {
45
+ type: "button",
46
+ ...a !== void 0 ? { "aria-pressed": a } : {}
47
+ } : {},
48
+ ...e ? { "data-selected": a ? "true" : void 0 } : {},
49
+ children: /* @__PURE__ */ l(g, { children: [
50
+ /* @__PURE__ */ t("span", { className: "text-xs font-normal leading-4 text-[var(--ui-card-filter-global-label-color)]", children: s }),
51
+ /* @__PURE__ */ l("span", { className: "flex items-center gap-[var(--ui-card-filter-global-content-gap)] [&_svg]:size-4 [&_svg]:shrink-0", children: [
52
+ !i && b,
53
+ /* @__PURE__ */ t(
41
54
  "span",
42
55
  {
43
- className: o(
56
+ className: c(
44
57
  "text-2xl font-semibold leading-8",
45
- y[r ?? "static"]
58
+ k[r ?? "static"]
46
59
  ),
47
60
  children: f
48
61
  }
@@ -50,14 +63,14 @@ const h = x(
50
63
  ] })
51
64
  ] })
52
65
  },
53
- b
66
+ u
54
67
  )
55
68
  });
56
69
  }
57
70
  );
58
- k.displayName = "CardFilter";
71
+ N.displayName = "CardFilter";
59
72
  export {
60
- k as CardFilter,
61
- h as cardFilterVariants
73
+ N as CardFilter,
74
+ y as cardFilterVariants
62
75
  };
63
76
  //# sourceMappingURL=card-filter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"card-filter.js","sources":["../../../../src/components/ui/card-filter/card-filter.tsx"],"sourcesContent":["import * as React from 'react';\nimport { mergeProps } from '@base-ui/react/merge-props';\nimport { useRender } from '@base-ui/react/use-render';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@/lib/utils';\n\n// Mirrors the Figma \"CardFilter\" component: a compact stat/filter card — a caption\n// `label` above a content row (optional `icon` + a large `value`). `variant` maps\n// to the Figma `variant` property:\n// • `static` — non-interactive; value in `--ui-card-filter-static-value-color-idle`.\n// • `static-empty` — non-interactive placeholder; no icon, an em-dash value in\n// `--ui-card-filter-static-value-color-disabled`.\n// • `clickable` — interactive (renders a <button>); value in\n// `--ui-card-filter-clickable-value-color`, plus hover / active /\n// focus-visible treatments.\n// Per the Figma constraint (\"if an element is not clickable, it cannot have a state\n// other than Idle\") only `clickable` carries the hover / active / focus state\n// classes — `static` / `static-empty` stay idle. Geometry (224px width, 64px min\n// height, 8px radius, 16/8px padding, 8px content gap, 1px border) and every state\n// color come from the `--ui-card-filter-*` tokens. Focus: a 3px `--ui-focus-primary`\n// ring flush to the edge (no offset), matching the rest of the library.\nconst cardFilterVariants = cva(\n 'inline-flex w-[224px] min-h-[var(--ui-card-filter-global-container-height)] flex-col items-start rounded-[var(--ui-card-filter-global-container-border-radius)] border-[length:var(--ui-card-filter-global-container-border-width)] border-solid border-[color:var(--ui-card-filter-global-border-color-idle)] bg-[var(--ui-card-filter-global-container-color-idle)] px-[var(--ui-card-filter-global-container-padding-x)] py-[var(--ui-card-filter-global-container-padding-y)] transition-colors',\n {\n variants: {\n variant: {\n static: '',\n 'static-empty': '',\n clickable:\n 'cursor-pointer outline-none hover:border-[color:var(--ui-card-filter-global-border-color-hover)] hover:bg-[var(--ui-card-filter-global-container-color-hover)] active:border-[color:var(--ui-card-filter-global-border-color-active)] active:bg-[var(--ui-card-filter-global-container-color-active)] focus-visible:border-[color:var(--ui-card-filter-global-border-color-focused)] focus-visible:ring-[3px] focus-visible:ring-[var(--ui-focus-primary)]',\n },\n },\n defaultVariants: {\n variant: 'static',\n },\n }\n);\n\n// The value color is the one token that varies by variant rather than by state.\nconst valueColorClass: Record<\n NonNullable<VariantProps<typeof cardFilterVariants>['variant']>,\n string\n> = {\n static: 'text-[var(--ui-card-filter-static-value-color-idle)]',\n 'static-empty': 'text-[var(--ui-card-filter-static-value-color-disabled)]',\n clickable: 'text-[var(--ui-card-filter-clickable-value-color)]',\n};\n\nexport interface CardFilterProps\n extends\n Omit<React.HTMLAttributes<HTMLElement>, 'children'>,\n VariantProps<typeof cardFilterVariants> {\n /** Caption shown above the value. */\n label?: React.ReactNode;\n /** The large value. Ignored for `variant=\"static-empty\"` (shows an em-dash). */\n value?: React.ReactNode;\n /** Optional leading icon (16px) rendered before the value. Hidden for `static-empty`. */\n icon?: React.ReactNode;\n /**\n * Replace the rendered element (`<button>` for `clickable`, otherwise `<div>`)\n * with another element or component (Base UI composition) — e.g. a router link\n * for a clickable filter. The component's props and class names are merged onto it.\n */\n render?: useRender.RenderProp;\n}\n\n/**\n * A compact stat/filter card: a label, an optional icon, and a prominent value.\n * Use `variant=\"clickable\"` for a filter the user can activate (renders a button);\n * `static` / `static-empty` are presentational.\n */\nconst CardFilter = React.forwardRef<HTMLElement, CardFilterProps>(\n (\n { className, variant = 'static', label, value, icon, render, ...props },\n ref\n ) => {\n const isEmpty = variant === 'static-empty';\n const isClickable = variant === 'clickable';\n const displayValue = isEmpty ? '–' : value;\n\n return useRender({\n render,\n ref,\n defaultTagName: isClickable ? 'button' : 'div',\n props: mergeProps<'button'>(\n {\n className: cn(cardFilterVariants({ variant }), className),\n ...(isClickable ? { type: 'button' as const } : {}),\n children: (\n <>\n <span className=\"text-xs font-normal leading-4 text-[var(--ui-card-filter-global-label-color)]\">\n {label}\n </span>\n <span className=\"flex items-center gap-[var(--ui-card-filter-global-content-gap)] [&_svg]:size-4 [&_svg]:shrink-0\">\n {!isEmpty && icon}\n <span\n className={cn(\n 'text-2xl font-semibold leading-8',\n valueColorClass[variant ?? 'static']\n )}\n >\n {displayValue}\n </span>\n </span>\n </>\n ),\n },\n props\n ),\n });\n }\n);\nCardFilter.displayName = 'CardFilter';\n\nexport { CardFilter, cardFilterVariants };\n"],"names":["cardFilterVariants","cva","valueColorClass","CardFilter","React","className","variant","label","value","icon","render","props","ref","isEmpty","isClickable","displayValue","useRender","mergeProps","cn","jsxs","Fragment","jsx"],"mappings":";;;;;;AAsBA,MAAMA,IAAqBC;AAAA,EACzB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,QAAQ;AAAA,QACR,gBAAgB;AAAA,QAChB,WACE;AAAA,MAAA;AAAA,IACJ;AAAA,IAEF,iBAAiB;AAAA,MACf,SAAS;AAAA,IAAA;AAAA,EACX;AAEJ,GAGMC,IAGF;AAAA,EACF,QAAQ;AAAA,EACR,gBAAgB;AAAA,EAChB,WAAW;AACb,GAyBMC,IAAaC,EAAM;AAAA,EACvB,CACE,EAAE,WAAAC,GAAW,SAAAC,IAAU,UAAU,OAAAC,GAAO,OAAAC,GAAO,MAAAC,GAAM,QAAAC,GAAQ,GAAGC,EAAA,GAChEC,MACG;AACH,UAAMC,IAAUP,MAAY,gBACtBQ,IAAcR,MAAY,aAC1BS,IAAeF,IAAU,MAAML;AAErC,WAAOQ,EAAU;AAAA,MACf,QAAAN;AAAA,MACA,KAAAE;AAAA,MACA,gBAAgBE,IAAc,WAAW;AAAA,MACzC,OAAOG;AAAA,QACL;AAAA,UACE,WAAWC,EAAGlB,EAAmB,EAAE,SAAAM,EAAA,CAAS,GAAGD,CAAS;AAAA,UACxD,GAAIS,IAAc,EAAE,MAAM,SAAA,IAAsB,CAAA;AAAA,UAChD,UACE,gBAAAK,EAAAC,GAAA,EACE,UAAA;AAAA,YAAA,gBAAAC,EAAC,QAAA,EAAK,WAAU,iFACb,UAAAd,GACH;AAAA,YACA,gBAAAY,EAAC,QAAA,EAAK,WAAU,oGACb,UAAA;AAAA,cAAA,CAACN,KAAWJ;AAAA,cACb,gBAAAY;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACC,WAAWH;AAAA,oBACT;AAAA,oBACAhB,EAAgBI,KAAW,QAAQ;AAAA,kBAAA;AAAA,kBAGpC,UAAAS;AAAA,gBAAA;AAAA,cAAA;AAAA,YACH,EAAA,CACF;AAAA,UAAA,EAAA,CACF;AAAA,QAAA;AAAA,QAGJJ;AAAA,MAAA;AAAA,IACF,CACD;AAAA,EACH;AACF;AACAR,EAAW,cAAc;"}
1
+ {"version":3,"file":"card-filter.js","sources":["../../../../src/components/ui/card-filter/card-filter.tsx"],"sourcesContent":["import * as React from 'react';\nimport { mergeProps } from '@base-ui/react/merge-props';\nimport { useRender } from '@base-ui/react/use-render';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@/lib/utils';\n\n// Mirrors the Figma \"CardFilter\" component: a compact stat/filter card — a caption\n// `label` above a content row (optional `icon` + a large `value`). `variant` maps\n// to the Figma `variant` property:\n// • `static` — non-interactive; value in `--ui-card-filter-static-value-color-idle`.\n// • `static-empty` — non-interactive placeholder; no icon, an em-dash value in\n// `--ui-card-filter-static-value-color-disabled`.\n// • `clickable` — interactive (renders a <button>); value in\n// `--ui-card-filter-clickable-value-color`, plus hover / active /\n// focus-visible treatments.\n// Per the Figma constraint (\"if an element is not clickable, it cannot have a state\n// other than Idle\") only `clickable` carries the hover / active / focus state\n// classes — `static` / `static-empty` stay idle. Geometry (224px width, 64px min\n// height, 8px radius, 16/8px padding, 8px content gap, 1px border) and every state\n// color come from the `--ui-card-filter-*` tokens. Focus: a 3px `--ui-focus-primary`\n// ring flush to the edge (no offset), matching the rest of the library.\nconst cardFilterVariants = cva(\n 'inline-flex w-[224px] min-h-[var(--ui-card-filter-global-container-height)] flex-col items-start rounded-[var(--ui-card-filter-global-container-border-radius)] border-[length:var(--ui-card-filter-global-container-border-width)] border-solid border-[color:var(--ui-card-filter-global-border-color-idle)] bg-[var(--ui-card-filter-global-container-color-idle)] px-[var(--ui-card-filter-global-container-padding-x)] py-[var(--ui-card-filter-global-container-padding-y)] transition-colors',\n {\n variants: {\n variant: {\n static: '',\n 'static-empty': '',\n clickable:\n 'cursor-pointer outline-none hover:border-[color:var(--ui-card-filter-global-border-color-hover)] hover:bg-[var(--ui-card-filter-global-container-color-hover)] active:border-[color:var(--ui-card-filter-global-border-color-active)] active:bg-[var(--ui-card-filter-global-container-color-active)] focus-visible:border-[color:var(--ui-card-filter-global-border-color-focused)] focus-visible:ring-[3px] focus-visible:ring-[var(--ui-focus-primary)] data-[selected=true]:border-[color:var(--ui-card-filter-global-border-color-active)] data-[selected=true]:bg-[var(--ui-card-filter-global-container-color-active)]',\n },\n },\n defaultVariants: {\n variant: 'static',\n },\n }\n);\n\n// The value color is the one token that varies by variant rather than by state.\nconst valueColorClass: Record<\n NonNullable<VariantProps<typeof cardFilterVariants>['variant']>,\n string\n> = {\n static: 'text-[var(--ui-card-filter-static-value-color-idle)]',\n 'static-empty': 'text-[var(--ui-card-filter-static-value-color-disabled)]',\n clickable: 'text-[var(--ui-card-filter-clickable-value-color)]',\n};\n\nexport interface CardFilterProps\n extends\n Omit<React.HTMLAttributes<HTMLElement>, 'children'>,\n VariantProps<typeof cardFilterVariants> {\n /** Caption shown above the value. */\n label?: React.ReactNode;\n /** The large value. Ignored for `variant=\"static-empty\"` (shows an em-dash). */\n value?: React.ReactNode;\n /** Optional leading icon (16px) rendered before the value. Hidden for `static-empty`. */\n icon?: React.ReactNode;\n /**\n * `clickable` only — applies the selected (active) styling and exposes the\n * card as a pressed toggle (`aria-pressed`). Controlled only.\n */\n selected?: boolean;\n /**\n * Replace the rendered element (`<button>` for `clickable`, otherwise `<div>`)\n * with another element or component (Base UI composition) — e.g. a router link\n * for a clickable filter. The component's props and class names are merged onto it.\n */\n render?: useRender.RenderProp;\n}\n\n/**\n * A compact stat/filter card: a label, an optional icon, and a prominent value.\n * Use `variant=\"clickable\"` for a filter the user can activate (renders a button);\n * `static` / `static-empty` are presentational.\n */\nconst CardFilter = React.forwardRef<HTMLElement, CardFilterProps>(\n (\n {\n className,\n variant = 'static',\n label,\n value,\n icon,\n selected,\n render,\n ...props\n },\n ref\n ) => {\n const isEmpty = variant === 'static-empty';\n const isClickable = variant === 'clickable';\n const displayValue = isEmpty ? '–' : value;\n\n return useRender({\n render,\n ref,\n defaultTagName: isClickable ? 'button' : 'div',\n props: mergeProps<'button'>(\n {\n className: cn(cardFilterVariants({ variant }), className),\n ...(isClickable && !render\n ? {\n type: 'button' as const,\n ...(selected !== undefined ? { 'aria-pressed': selected } : {}),\n }\n : {}),\n ...(isClickable ? { 'data-selected': selected ? 'true' : undefined } : {}),\n children: (\n <>\n <span className=\"text-xs font-normal leading-4 text-[var(--ui-card-filter-global-label-color)]\">\n {label}\n </span>\n <span className=\"flex items-center gap-[var(--ui-card-filter-global-content-gap)] [&_svg]:size-4 [&_svg]:shrink-0\">\n {!isEmpty && icon}\n <span\n className={cn(\n 'text-2xl font-semibold leading-8',\n valueColorClass[variant ?? 'static']\n )}\n >\n {displayValue}\n </span>\n </span>\n </>\n ),\n },\n props\n ),\n });\n }\n);\nCardFilter.displayName = 'CardFilter';\n\nexport { CardFilter, cardFilterVariants };\n"],"names":["cardFilterVariants","cva","valueColorClass","CardFilter","React","className","variant","label","value","icon","selected","render","props","ref","isEmpty","isClickable","displayValue","useRender","mergeProps","cn","jsxs","Fragment","jsx"],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A,gBAAA;AAAA,kBACC,WAAWH;AAAA,oBACT;AAAA,oBACAjB,EAAgBI,KAAW,QAAQ;AAAA,kBAAA;AAAA,kBAGpC,UAAAU;AAAA,gBAAA;AAAA,cAAA;AAAA,YACH,EAAA,CACF;AAAA,UAAA,EAAA,CACF;AAAA,QAAA;AAAA,QAGJJ;AAAA,MAAA;AAAA,IACF,CACD;AAAA,EACH;AACF;AACAT,EAAW,cAAc;"}
@@ -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;AAAA,IACA,QAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,WAAAC,IAAY;AAAA,IACZ,cAAAC,IAAe;AAAA,IACf,gBAAAC,IAAiBhB;AAAA,IACjB,GAAGiB;AAAA,EAAA,GAELC,MACG;AACH,UAAMC,IAAUb,MAAY,SACtBc,IAASd,MAAY;AAE3B,WACE,gBAAAe;A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0 +1,126 @@
1
+ import { jsxs as r, jsx as l, Fragment as z } from "react/jsx-runtime";
2
+ import * as b from "react";
3
+ import { cva as I } from "../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
4
+ import { cn as x } from "../../../lib/utils.js";
5
+ import { ChartStyle as y } from "../chart/chart.js";
6
+ import { Tooltip as B, TooltipTrigger as O, TooltipContent as S } from "../tooltip/tooltip.js";
7
+ const q = (c) => c.toLocaleString(), F = I("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
+ }), R = b.forwardRef(
19
+ ({
20
+ className: c,
21
+ data: n,
22
+ config: o,
23
+ size: g,
24
+ showLegend: k = !1,
25
+ showTooltip: v = !0,
26
+ tooltipContent: d,
27
+ valueFormatter: i = q,
28
+ defaultOpenIndex: N,
29
+ "aria-label": w,
30
+ ...C
31
+ }, T) => {
32
+ const s = `chart-${b.useId().replace(/:/g, "")}`, f = n.reduce((e, a) => e + a.value, 0), u = (e) => {
33
+ var a;
34
+ return ((a = o[e]) == null ? void 0 : a.label) ?? e;
35
+ }, $ = (e) => {
36
+ var t;
37
+ const a = (t = o[e]) == null ? void 0 : t.label;
38
+ return typeof a == "string" || typeof a == "number" ? String(a) : e;
39
+ }, p = (e) => `var(--color-${e})`, m = (e) => f > 0 ? Math.round(e / f * 100) : 0, j = w ?? n.map((e) => `${$(e.key)} ${i(e.value)}`).join(", ");
40
+ return /* @__PURE__ */ r(
41
+ "div",
42
+ {
43
+ ref: T,
44
+ "data-chart": s,
45
+ className: x("flex w-full flex-col gap-3", c),
46
+ ...C,
47
+ children: [
48
+ /* @__PURE__ */ l(y, { id: s, config: o }),
49
+ /* @__PURE__ */ l("div", { className: F({ size: g }), role: "img", "aria-label": j, children: n.map((e, a) => {
50
+ const t = p(e.key), h = /* @__PURE__ */ l(
51
+ "div",
52
+ {
53
+ className: "h-full min-w-0",
54
+ style: { flex: `${e.value} 0 0%`, backgroundColor: t }
55
+ },
56
+ e.key
57
+ );
58
+ return v ? /* @__PURE__ */ r(B, { defaultOpen: a === N, children: [
59
+ /* @__PURE__ */ l(O, { render: h }),
60
+ /* @__PURE__ */ r(
61
+ S,
62
+ {
63
+ "data-chart": s,
64
+ className: x(
65
+ "border border-border bg-background text-foreground shadow-md",
66
+ !d && "flex items-center gap-2"
67
+ ),
68
+ children: [
69
+ /* @__PURE__ */ l(y, { id: s, config: o }),
70
+ d ? d({
71
+ key: e.key,
72
+ value: e.value,
73
+ label: u(e.key),
74
+ percent: m(e.value),
75
+ color: t
76
+ }) : /* @__PURE__ */ r(z, { children: [
77
+ /* @__PURE__ */ l(
78
+ "span",
79
+ {
80
+ className: "size-2.5 shrink-0 rounded-full",
81
+ style: { backgroundColor: t }
82
+ }
83
+ ),
84
+ /* @__PURE__ */ l("span", { className: "font-semibold", children: u(e.key) }),
85
+ /* @__PURE__ */ r("span", { className: "text-muted-foreground tabular-nums", children: [
86
+ i(e.value),
87
+ " · ",
88
+ m(e.value),
89
+ "%"
90
+ ] })
91
+ ] })
92
+ ]
93
+ }
94
+ )
95
+ ] }, e.key) : h;
96
+ }) }),
97
+ k && /* @__PURE__ */ l("ul", { className: "flex flex-wrap justify-between gap-x-6 gap-y-3", children: n.map((e) => /* @__PURE__ */ r("li", { className: "flex flex-col gap-1.5", children: [
98
+ /* @__PURE__ */ r("span", { className: "flex items-center gap-1.5 text-sm leading-none text-muted-foreground", children: [
99
+ /* @__PURE__ */ l(
100
+ "span",
101
+ {
102
+ className: "size-2.5 shrink-0 rounded-full",
103
+ style: { backgroundColor: p(e.key) }
104
+ }
105
+ ),
106
+ u(e.key)
107
+ ] }),
108
+ /* @__PURE__ */ r("span", { className: "flex items-baseline gap-1.5 leading-none tabular-nums", children: [
109
+ /* @__PURE__ */ l("span", { className: "text-base font-semibold text-foreground", children: i(e.value) }),
110
+ /* @__PURE__ */ r("span", { className: "text-sm text-muted-foreground", children: [
111
+ m(e.value),
112
+ "%"
113
+ ] })
114
+ ] })
115
+ ] }, e.key)) })
116
+ ]
117
+ }
118
+ );
119
+ }
120
+ );
121
+ R.displayName = "CategoryBar";
122
+ export {
123
+ R as CategoryBar,
124
+ F as categoryBarVariants
125
+ };
126
+ //# sourceMappingURL=category-bar.js.map