@giddaa-housing/ui 0.1.0 → 1.0.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 (334) hide show
  1. package/README.md +18 -6
  2. package/css/base.css +37 -0
  3. package/css/components.css +135 -0
  4. package/css/generated/shared.css +1 -0
  5. package/css/giddaa.css +402 -0
  6. package/css/preset.css +77 -0
  7. package/css/styles.css +2 -0
  8. package/css/theme.css +255 -0
  9. package/dist/accordion.js +5 -35
  10. package/dist/accordion.js.map +1 -1
  11. package/dist/activity-timeline.d.ts +33 -0
  12. package/dist/activity-timeline.js +212 -0
  13. package/dist/activity-timeline.js.map +1 -0
  14. package/dist/alert.js +5 -35
  15. package/dist/alert.js.map +1 -1
  16. package/dist/auth-layout.d.ts +23 -0
  17. package/dist/auth-layout.js +304 -0
  18. package/dist/auth-layout.js.map +1 -0
  19. package/dist/avatar.js +10 -142
  20. package/dist/avatar.js.map +1 -1
  21. package/dist/badge.d.ts +3 -2
  22. package/dist/badge.js +6 -114
  23. package/dist/badge.js.map +1 -1
  24. package/dist/bar-chart.d.ts +101 -77
  25. package/dist/bar-chart.js +142 -220
  26. package/dist/bar-chart.js.map +1 -1
  27. package/dist/breadcrumb.js +5 -35
  28. package/dist/breadcrumb.js.map +1 -1
  29. package/dist/bullet-chart.js +15 -48
  30. package/dist/bullet-chart.js.map +1 -1
  31. package/dist/button-group.js +14 -90
  32. package/dist/button-group.js.map +1 -1
  33. package/dist/button.d.ts +5 -5
  34. package/dist/button.js +7 -140
  35. package/dist/button.js.map +1 -1
  36. package/dist/calendar.js +12 -287
  37. package/dist/calendar.js.map +1 -1
  38. package/dist/card.js +5 -35
  39. package/dist/card.js.map +1 -1
  40. package/dist/carousel.js +12 -386
  41. package/dist/carousel.js.map +1 -1
  42. package/dist/chart.js +16 -480
  43. package/dist/chart.js.map +1 -1
  44. package/dist/checkbox.d.ts +1 -1
  45. package/dist/checkbox.js +13 -48
  46. package/dist/checkbox.js.map +1 -1
  47. package/dist/chunk-322YCNVL.js +278 -0
  48. package/dist/chunk-322YCNVL.js.map +1 -0
  49. package/dist/chunk-3ACQVT7A.js +25 -0
  50. package/dist/chunk-3ACQVT7A.js.map +1 -0
  51. package/dist/chunk-3T65TLJX.js +334 -0
  52. package/dist/chunk-3T65TLJX.js.map +1 -0
  53. package/dist/chunk-6ZSGQHH2.js +192 -0
  54. package/dist/chunk-6ZSGQHH2.js.map +1 -0
  55. package/dist/chunk-7TBMLFGW.js +41 -0
  56. package/dist/chunk-7TBMLFGW.js.map +1 -0
  57. package/dist/chunk-B4H6RNDH.js +135 -0
  58. package/dist/chunk-B4H6RNDH.js.map +1 -0
  59. package/dist/chunk-BUXCGZ6X.js +219 -0
  60. package/dist/chunk-BUXCGZ6X.js.map +1 -0
  61. package/dist/chunk-CHII2QHH.js +58 -0
  62. package/dist/chunk-CHII2QHH.js.map +1 -0
  63. package/dist/chunk-DMNOXRRW.js +147 -0
  64. package/dist/chunk-DMNOXRRW.js.map +1 -0
  65. package/dist/chunk-EFSOSSIC.js +130 -0
  66. package/dist/chunk-EFSOSSIC.js.map +1 -0
  67. package/dist/chunk-FZDSVMKY.js +363 -0
  68. package/dist/chunk-FZDSVMKY.js.map +1 -0
  69. package/dist/chunk-GJOFIJS3.js +246 -0
  70. package/dist/chunk-GJOFIJS3.js.map +1 -0
  71. package/dist/chunk-HL3ZSYES.js +23 -0
  72. package/dist/chunk-HL3ZSYES.js.map +1 -0
  73. package/dist/chunk-JVLUBAPB.js +129 -0
  74. package/dist/chunk-JVLUBAPB.js.map +1 -0
  75. package/dist/chunk-KDPYSOYZ.js +64 -0
  76. package/dist/chunk-KDPYSOYZ.js.map +1 -0
  77. package/dist/chunk-KSMDANKI.js +43 -0
  78. package/dist/chunk-KSMDANKI.js.map +1 -0
  79. package/dist/chunk-MEKCCOP5.js +46 -0
  80. package/dist/chunk-MEKCCOP5.js.map +1 -0
  81. package/dist/chunk-NOFXVRWL.js +451 -0
  82. package/dist/chunk-NOFXVRWL.js.map +1 -0
  83. package/dist/chunk-PC5MHNVA.js +171 -0
  84. package/dist/chunk-PC5MHNVA.js.map +1 -0
  85. package/dist/chunk-QKAQZ2GU.js +122 -0
  86. package/dist/chunk-QKAQZ2GU.js.map +1 -0
  87. package/dist/chunk-QZHSHSVV.js +26 -0
  88. package/dist/chunk-QZHSHSVV.js.map +1 -0
  89. package/dist/chunk-RBMK26XD.js +19 -0
  90. package/dist/chunk-RBMK26XD.js.map +1 -0
  91. package/dist/chunk-SFNJGF6M.js +262 -0
  92. package/dist/chunk-SFNJGF6M.js.map +1 -0
  93. package/dist/chunk-UJJNLGTM.js +112 -0
  94. package/dist/chunk-UJJNLGTM.js.map +1 -0
  95. package/dist/chunk-VGR4ZWJ3.js +418 -0
  96. package/dist/chunk-VGR4ZWJ3.js.map +1 -0
  97. package/dist/chunk-XG47P6D4.js +99 -0
  98. package/dist/chunk-XG47P6D4.js.map +1 -0
  99. package/dist/chunk-XZZAHNVM.js +21 -0
  100. package/dist/chunk-XZZAHNVM.js.map +1 -0
  101. package/dist/chunk-Y4TTYVNE.js +36 -0
  102. package/dist/chunk-Y4TTYVNE.js.map +1 -0
  103. package/dist/chunk-YDWIHW6Q.js +69 -0
  104. package/dist/chunk-YDWIHW6Q.js.map +1 -0
  105. package/dist/collapsible.js +6 -35
  106. package/dist/collapsible.js.map +1 -1
  107. package/dist/combobox.js +26 -694
  108. package/dist/combobox.js.map +1 -1
  109. package/dist/cta.d.ts +66 -0
  110. package/dist/cta.js +358 -0
  111. package/dist/cta.js.map +1 -0
  112. package/dist/currency-selector.d.ts +42 -0
  113. package/dist/currency-selector.js +192 -0
  114. package/dist/currency-selector.js.map +1 -0
  115. package/dist/date-picker.d.ts +18 -10
  116. package/dist/date-picker.js +105 -430
  117. package/dist/date-picker.js.map +1 -1
  118. package/dist/details-card.d.ts +19 -0
  119. package/dist/details-card.js +267 -0
  120. package/dist/details-card.js.map +1 -0
  121. package/dist/dialog.js +36 -146
  122. package/dist/dialog.js.map +1 -1
  123. package/dist/dropdown-menu.d.ts +1 -1
  124. package/dist/dropdown-menu.js +20 -358
  125. package/dist/dropdown-menu.js.map +1 -1
  126. package/dist/dropzone.js +13 -40
  127. package/dist/dropzone.js.map +1 -1
  128. package/dist/editorial-card.d.ts +29 -0
  129. package/dist/editorial-card.js +311 -0
  130. package/dist/editorial-card.js.map +1 -0
  131. package/dist/empty-state.js +5 -35
  132. package/dist/empty-state.js.map +1 -1
  133. package/dist/field.js +30 -135
  134. package/dist/field.js.map +1 -1
  135. package/dist/footer.d.ts +47 -0
  136. package/dist/footer.js +430 -0
  137. package/dist/footer.js.map +1 -0
  138. package/dist/funnel-chart.js +42 -415
  139. package/dist/funnel-chart.js.map +1 -1
  140. package/dist/gallery-indicator.d.ts +18 -0
  141. package/dist/gallery-indicator.js +12 -0
  142. package/dist/gallery-indicator.js.map +1 -0
  143. package/dist/heatmap-chart.d.ts +98 -0
  144. package/dist/heatmap-chart.js +248 -0
  145. package/dist/heatmap-chart.js.map +1 -0
  146. package/dist/infotip.d.ts +11 -0
  147. package/dist/infotip.js +66 -0
  148. package/dist/infotip.js.map +1 -0
  149. package/dist/input-group.d.ts +2 -1
  150. package/dist/input-group.js +15 -371
  151. package/dist/input-group.js.map +1 -1
  152. package/dist/input-size-context.js +5 -19
  153. package/dist/input-size-context.js.map +1 -1
  154. package/dist/input.js +6 -78
  155. package/dist/input.js.map +1 -1
  156. package/dist/item.js +5 -35
  157. package/dist/item.js.map +1 -1
  158. package/dist/kpi-card.js +12 -52
  159. package/dist/kpi-card.js.map +1 -1
  160. package/dist/label.js +5 -64
  161. package/dist/label.js.map +1 -1
  162. package/dist/line-chart.js +9 -166
  163. package/dist/line-chart.js.map +1 -1
  164. package/dist/logo.js +4 -141
  165. package/dist/logo.js.map +1 -1
  166. package/dist/map-indicator.d.ts +13 -0
  167. package/dist/map-indicator.js +109 -0
  168. package/dist/map-indicator.js.map +1 -0
  169. package/dist/match.d.ts +16 -0
  170. package/dist/match.js +113 -0
  171. package/dist/match.js.map +1 -0
  172. package/dist/media-gallery-hero.d.ts +60 -0
  173. package/dist/media-gallery-hero.js +362 -0
  174. package/dist/media-gallery-hero.js.map +1 -0
  175. package/dist/media-player.d.ts +60 -0
  176. package/dist/media-player.js +1394 -0
  177. package/dist/media-player.js.map +1 -0
  178. package/dist/number-input.js +30 -325
  179. package/dist/number-input.js.map +1 -1
  180. package/dist/page-header.js +4 -32
  181. package/dist/page-header.js.map +1 -1
  182. package/dist/pagination.d.ts +1 -0
  183. package/dist/pagination.js +27 -161
  184. package/dist/pagination.js.map +1 -1
  185. package/dist/password-input.d.ts +1 -0
  186. package/dist/password-input.js +21 -319
  187. package/dist/password-input.js.map +1 -1
  188. package/dist/phone-input.d.ts +2 -1
  189. package/dist/phone-input.js +148 -359
  190. package/dist/phone-input.js.map +1 -1
  191. package/dist/photo-gallery.d.ts +1 -1
  192. package/dist/photo-gallery.js +97 -393
  193. package/dist/photo-gallery.js.map +1 -1
  194. package/dist/pie-chart.js +17 -52
  195. package/dist/pie-chart.js.map +1 -1
  196. package/dist/popover.js +13 -158
  197. package/dist/popover.js.map +1 -1
  198. package/dist/price-tag.d.ts +35 -0
  199. package/dist/price-tag.js +178 -0
  200. package/dist/price-tag.js.map +1 -0
  201. package/dist/progress.d.ts +5 -2
  202. package/dist/progress.js +14 -303
  203. package/dist/progress.js.map +1 -1
  204. package/dist/property-listing-card.d.ts +32 -0
  205. package/dist/property-listing-card.js +235 -0
  206. package/dist/property-listing-card.js.map +1 -0
  207. package/dist/radar-chart.d.ts +110 -0
  208. package/dist/radar-chart.js +147 -0
  209. package/dist/radar-chart.js.map +1 -0
  210. package/dist/radio-group.js +15 -50
  211. package/dist/radio-group.js.map +1 -1
  212. package/dist/review-block.d.ts +20 -0
  213. package/dist/review-block.js +10 -0
  214. package/dist/review-block.js.map +1 -0
  215. package/dist/rich-text-editor.js +172 -433
  216. package/dist/rich-text-editor.js.map +1 -1
  217. package/dist/scatter-chart.d.ts +142 -0
  218. package/dist/scatter-chart.js +252 -0
  219. package/dist/scatter-chart.js.map +1 -0
  220. package/dist/search-input.d.ts +1 -0
  221. package/dist/search-input.js +22 -320
  222. package/dist/search-input.js.map +1 -1
  223. package/dist/select.js +15 -292
  224. package/dist/select.js.map +1 -1
  225. package/dist/separator.js +5 -68
  226. package/dist/separator.js.map +1 -1
  227. package/dist/sheet.js +14 -271
  228. package/dist/sheet.js.map +1 -1
  229. package/dist/sidebar.d.ts +1 -1
  230. package/dist/sidebar.js +89 -494
  231. package/dist/sidebar.js.map +1 -1
  232. package/dist/size-context.js +5 -17
  233. package/dist/size-context.js.map +1 -1
  234. package/dist/skeleton.js +4 -44
  235. package/dist/skeleton.js.map +1 -1
  236. package/dist/slider.d.ts +28 -0
  237. package/dist/slider.js +152 -0
  238. package/dist/slider.js.map +1 -0
  239. package/dist/sparkline.js +33 -341
  240. package/dist/sparkline.js.map +1 -1
  241. package/dist/stepper.js +5 -35
  242. package/dist/stepper.js.map +1 -1
  243. package/dist/styles.css +9593 -2
  244. package/dist/switch.js +13 -48
  245. package/dist/switch.js.map +1 -1
  246. package/dist/tab-list.js +35 -306
  247. package/dist/tab-list.js.map +1 -1
  248. package/dist/table.js +5 -32
  249. package/dist/table.js.map +1 -1
  250. package/dist/tabs.js +10 -150
  251. package/dist/tabs.js.map +1 -1
  252. package/dist/tag.d.ts +7 -6
  253. package/dist/tag.js +101 -97
  254. package/dist/tag.js.map +1 -1
  255. package/dist/testimonial-block.d.ts +34 -0
  256. package/dist/testimonial-block.js +377 -0
  257. package/dist/testimonial-block.js.map +1 -0
  258. package/dist/textarea.js +6 -73
  259. package/dist/textarea.js.map +1 -1
  260. package/dist/time-picker.js +119 -279
  261. package/dist/time-picker.js.map +1 -1
  262. package/dist/toast.js +27 -132
  263. package/dist/toast.js.map +1 -1
  264. package/dist/tooltip.d.ts +5 -5
  265. package/dist/tooltip.js +7 -90
  266. package/dist/tooltip.js.map +1 -1
  267. package/dist/tree-map.js +41 -414
  268. package/dist/tree-map.js.map +1 -1
  269. package/dist/waterfall-chart.d.ts +129 -0
  270. package/dist/waterfall-chart.js +577 -0
  271. package/dist/waterfall-chart.js.map +1 -0
  272. package/package.json +98 -28
  273. package/dist/base.css +0 -32
  274. package/dist/files/red-hat-display-latin-300-italic.woff +0 -0
  275. package/dist/files/red-hat-display-latin-300-italic.woff2 +0 -0
  276. package/dist/files/red-hat-display-latin-300-normal.woff +0 -0
  277. package/dist/files/red-hat-display-latin-300-normal.woff2 +0 -0
  278. package/dist/files/red-hat-display-latin-400-italic.woff +0 -0
  279. package/dist/files/red-hat-display-latin-400-italic.woff2 +0 -0
  280. package/dist/files/red-hat-display-latin-400-normal.woff +0 -0
  281. package/dist/files/red-hat-display-latin-400-normal.woff2 +0 -0
  282. package/dist/files/red-hat-display-latin-500-italic.woff +0 -0
  283. package/dist/files/red-hat-display-latin-500-italic.woff2 +0 -0
  284. package/dist/files/red-hat-display-latin-500-normal.woff +0 -0
  285. package/dist/files/red-hat-display-latin-500-normal.woff2 +0 -0
  286. package/dist/files/red-hat-display-latin-600-italic.woff +0 -0
  287. package/dist/files/red-hat-display-latin-600-italic.woff2 +0 -0
  288. package/dist/files/red-hat-display-latin-600-normal.woff +0 -0
  289. package/dist/files/red-hat-display-latin-600-normal.woff2 +0 -0
  290. package/dist/files/red-hat-display-latin-700-italic.woff +0 -0
  291. package/dist/files/red-hat-display-latin-700-italic.woff2 +0 -0
  292. package/dist/files/red-hat-display-latin-700-normal.woff +0 -0
  293. package/dist/files/red-hat-display-latin-700-normal.woff2 +0 -0
  294. package/dist/files/red-hat-display-latin-800-italic.woff +0 -0
  295. package/dist/files/red-hat-display-latin-800-italic.woff2 +0 -0
  296. package/dist/files/red-hat-display-latin-800-normal.woff +0 -0
  297. package/dist/files/red-hat-display-latin-800-normal.woff2 +0 -0
  298. package/dist/files/red-hat-display-latin-900-italic.woff +0 -0
  299. package/dist/files/red-hat-display-latin-900-italic.woff2 +0 -0
  300. package/dist/files/red-hat-display-latin-900-normal.woff +0 -0
  301. package/dist/files/red-hat-display-latin-900-normal.woff2 +0 -0
  302. package/dist/files/red-hat-display-latin-ext-300-italic.woff +0 -0
  303. package/dist/files/red-hat-display-latin-ext-300-italic.woff2 +0 -0
  304. package/dist/files/red-hat-display-latin-ext-300-normal.woff +0 -0
  305. package/dist/files/red-hat-display-latin-ext-300-normal.woff2 +0 -0
  306. package/dist/files/red-hat-display-latin-ext-400-italic.woff +0 -0
  307. package/dist/files/red-hat-display-latin-ext-400-italic.woff2 +0 -0
  308. package/dist/files/red-hat-display-latin-ext-400-normal.woff +0 -0
  309. package/dist/files/red-hat-display-latin-ext-400-normal.woff2 +0 -0
  310. package/dist/files/red-hat-display-latin-ext-500-italic.woff +0 -0
  311. package/dist/files/red-hat-display-latin-ext-500-italic.woff2 +0 -0
  312. package/dist/files/red-hat-display-latin-ext-500-normal.woff +0 -0
  313. package/dist/files/red-hat-display-latin-ext-500-normal.woff2 +0 -0
  314. package/dist/files/red-hat-display-latin-ext-600-italic.woff +0 -0
  315. package/dist/files/red-hat-display-latin-ext-600-italic.woff2 +0 -0
  316. package/dist/files/red-hat-display-latin-ext-600-normal.woff +0 -0
  317. package/dist/files/red-hat-display-latin-ext-600-normal.woff2 +0 -0
  318. package/dist/files/red-hat-display-latin-ext-700-italic.woff +0 -0
  319. package/dist/files/red-hat-display-latin-ext-700-italic.woff2 +0 -0
  320. package/dist/files/red-hat-display-latin-ext-700-normal.woff +0 -0
  321. package/dist/files/red-hat-display-latin-ext-700-normal.woff2 +0 -0
  322. package/dist/files/red-hat-display-latin-ext-800-italic.woff +0 -0
  323. package/dist/files/red-hat-display-latin-ext-800-italic.woff2 +0 -0
  324. package/dist/files/red-hat-display-latin-ext-800-normal.woff +0 -0
  325. package/dist/files/red-hat-display-latin-ext-800-normal.woff2 +0 -0
  326. package/dist/files/red-hat-display-latin-ext-900-italic.woff +0 -0
  327. package/dist/files/red-hat-display-latin-ext-900-italic.woff2 +0 -0
  328. package/dist/files/red-hat-display-latin-ext-900-normal.woff +0 -0
  329. package/dist/files/red-hat-display-latin-ext-900-normal.woff2 +0 -0
  330. package/dist/index.d.ts +0 -87
  331. package/dist/index.js +0 -10448
  332. package/dist/index.js.map +0 -1
  333. package/dist/red-hat-display.css +0 -2
  334. package/dist/theme/giddaa.css +0 -2
package/dist/tree-map.js CHANGED
@@ -1,397 +1,24 @@
1
- // src/components/ui/tree-map.tsx
2
- import { cva as cva2 } from "class-variance-authority";
3
- import { Treemap as RechartsTreemap } from "recharts";
4
-
5
- // src/lib/cn.ts
6
- import { clsx } from "clsx";
7
- import { extendTailwindMerge } from "tailwind-merge";
8
- var twMerge = extendTailwindMerge({
9
- extend: {
10
- classGroups: {
11
- "font-size": [
12
- {
13
- text: [
14
- "gdt-display",
15
- "gdt-h1",
16
- "gdt-h2",
17
- "gdt-h3",
18
- "gdt-h4",
19
- "gdt-h5",
20
- "gdt-xl",
21
- "gdt-lg",
22
- "gdt-md",
23
- "gdt-sm",
24
- "gdt-xs",
25
- "gdt-subtext",
26
- "gdt-capitalized"
27
- ]
28
- }
29
- ]
30
- }
31
- }
32
- });
33
- function cn(...inputs) {
34
- return twMerge(clsx(inputs));
35
- }
1
+ "use client";
2
+ import {
3
+ ChartCard,
4
+ ChartContainer,
5
+ ChartDescription,
6
+ ChartHeader,
7
+ ChartTitle,
8
+ ChartTooltip,
9
+ ChartTooltipContent
10
+ } from "./chunk-NOFXVRWL.js";
11
+ import {
12
+ useComponentSize
13
+ } from "./chunk-HL3ZSYES.js";
14
+ import {
15
+ cn
16
+ } from "./chunk-Y4TTYVNE.js";
36
17
 
37
- // src/components/ui/chart.tsx
18
+ // src/tree-map.tsx
38
19
  import { cva } from "class-variance-authority";
39
- import * as React from "react";
40
- import * as RechartsPrimitive from "recharts";
41
-
42
- // src/components/ui/size-context.tsx
43
- import { createContext, useContext } from "react";
44
- import { Fragment, jsx } from "react/jsx-runtime";
45
- var SizeContext = createContext(void 0);
46
- function SizeProvider({
47
- children,
48
- size
49
- }) {
50
- if (!size) {
51
- return /* @__PURE__ */ jsx(Fragment, { children });
52
- }
53
- return /* @__PURE__ */ jsx(SizeContext.Provider, { value: size, children });
54
- }
55
- function useComponentSize(size, fallback = "md") {
56
- const inheritedSize = useContext(SizeContext);
57
- return size ?? inheritedSize ?? fallback;
58
- }
59
-
60
- // src/components/ui/chart.tsx
61
- import { Fragment as Fragment2, jsx as jsx2, jsxs } from "react/jsx-runtime";
62
- var SERIES_COLOR_PLACEHOLDER = "var(--color-surface-brand)";
63
- function formatChartValue(value, type) {
64
- if (Array.isArray(value)) {
65
- return value.join(", ");
66
- }
67
- if (typeof value !== "number") {
68
- return value == null ? "" : String(value);
69
- }
70
- switch (type) {
71
- case "currency":
72
- return `\u20A6${value.toLocaleString("en-NG")}`;
73
- case "percentage":
74
- return `${value.toLocaleString("en-NG", {
75
- minimumFractionDigits: 1,
76
- maximumFractionDigits: 1
77
- })}%`;
78
- default:
79
- return value.toLocaleString("en-NG");
80
- }
81
- }
82
- var THEMES = { light: "", dark: ".dark" };
83
- var INITIAL_DIMENSION = { width: 320, height: 200 };
84
- var ChartContext = React.createContext(null);
85
- function useChart() {
86
- const context = React.useContext(ChartContext);
87
- if (!context) {
88
- throw new Error("useChart must be used within a <ChartContainer />");
89
- }
90
- return context;
91
- }
92
- var chartCardVariants = cva(
93
- "flex w-full min-w-0 flex-col rounded-2xl border border-line-subtle bg-surface-raised text-fg-primary shadow-1",
94
- {
95
- variants: {
96
- size: {
97
- sm: "gap-3 p-4",
98
- md: "gap-4 p-5",
99
- lg: "gap-5 p-6"
100
- }
101
- },
102
- defaultVariants: { size: "md" }
103
- }
104
- );
105
- function ChartCard({
106
- className,
107
- size,
108
- children,
109
- ...props
110
- }) {
111
- const resolvedSize = useComponentSize(size);
112
- return /* @__PURE__ */ jsx2(SizeProvider, { size: resolvedSize, children: /* @__PURE__ */ jsx2(
113
- "section",
114
- {
115
- "data-slot": "chart-card",
116
- className: cn(chartCardVariants({ size: resolvedSize }), className),
117
- ...props,
118
- children
119
- }
120
- ) });
121
- }
122
- function ChartHeader({ className, ...props }) {
123
- return /* @__PURE__ */ jsx2(
124
- "div",
125
- {
126
- "data-slot": "chart-header",
127
- className: cn("flex min-w-0 flex-col gap-1", className),
128
- ...props
129
- }
130
- );
131
- }
132
- var chartTitleVariants = cva("min-w-0 font-bold text-fg-primary", {
133
- variants: {
134
- size: {
135
- sm: "text-gdt-md",
136
- md: "text-gdt-lg",
137
- lg: "text-gdt-h5"
138
- }
139
- },
140
- defaultVariants: { size: "md" }
141
- });
142
- function ChartTitle({
143
- className,
144
- size,
145
- ...props
146
- }) {
147
- const resolvedSize = useComponentSize(size);
148
- return /* @__PURE__ */ jsx2(
149
- "h3",
150
- {
151
- "data-slot": "chart-title",
152
- className: cn(chartTitleVariants({ size: resolvedSize }), className),
153
- ...props
154
- }
155
- );
156
- }
157
- var chartDescriptionVariants = cva("min-w-0 font-normal text-fg-secondary", {
158
- variants: {
159
- size: {
160
- sm: "text-gdt-xs",
161
- md: "text-gdt-sm",
162
- lg: "text-gdt-sm"
163
- }
164
- },
165
- defaultVariants: { size: "md" }
166
- });
167
- function ChartDescription({
168
- className,
169
- size,
170
- ...props
171
- }) {
172
- const resolvedSize = useComponentSize(size);
173
- return /* @__PURE__ */ jsx2(
174
- "p",
175
- {
176
- "data-slot": "chart-description",
177
- className: cn(
178
- chartDescriptionVariants({ size: resolvedSize }),
179
- className
180
- ),
181
- ...props
182
- }
183
- );
184
- }
185
- function ChartContainer({
186
- id,
187
- className,
188
- children,
189
- config,
190
- initialDimension = INITIAL_DIMENSION,
191
- ...props
192
- }) {
193
- const uniqueId = React.useId();
194
- const chartId = `chart-${id ?? uniqueId.replace(/:/g, "")}`;
195
- return /* @__PURE__ */ jsx2(ChartContext.Provider, { value: { config }, children: /* @__PURE__ */ jsxs(
196
- "div",
197
- {
198
- "data-slot": "chart",
199
- "data-chart": chartId,
200
- className: cn(
201
- "flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden",
202
- className
203
- ),
204
- ...props,
205
- children: [
206
- /* @__PURE__ */ jsx2(ChartStyle, { id: chartId, config }),
207
- /* @__PURE__ */ jsx2(
208
- RechartsPrimitive.ResponsiveContainer,
209
- {
210
- initialDimension,
211
- children
212
- }
213
- )
214
- ]
215
- }
216
- ) });
217
- }
218
- var ChartStyle = ({ id, config }) => {
219
- const colorConfig = Object.entries(config).filter(
220
- ([, config2]) => config2.theme ?? config2.color
221
- );
222
- if (!colorConfig.length) {
223
- return null;
224
- }
225
- const styleContent = Object.entries(THEMES).map(
226
- ([theme, prefix]) => `
227
- ${prefix} [data-chart=${id}] {
228
- ${colorConfig.map(([key, itemConfig]) => {
229
- const color = itemConfig.theme?.[theme] ?? itemConfig.color;
230
- return color ? ` --color-${key}: ${color};` : null;
231
- }).join("\n")}
232
- }
233
- `
234
- ).join("\n");
235
- return /* @__PURE__ */ jsx2("style", { children: styleContent });
236
- };
237
- var ChartTooltip = RechartsPrimitive.Tooltip;
238
- var chartTooltipVariants = cva(
239
- "flex flex-col bg-surface-overlay border border-line-subtle shadow-2",
240
- {
241
- variants: {
242
- size: {
243
- xs: "gap-0.5 rounded-md p-2",
244
- sm: "gap-0.5 rounded-md p-2.5",
245
- md: "gap-1 rounded-lg p-3",
246
- lg: "gap-1 rounded-xl p-3.5"
247
- }
248
- },
249
- defaultVariants: {
250
- size: "md"
251
- }
252
- }
253
- );
254
- var chartTooltipDotVariants = cva("shrink-0 rounded-full", {
255
- variants: {
256
- size: {
257
- xs: "size-1.5",
258
- sm: "size-2",
259
- md: "size-2.5",
260
- lg: "size-2.5"
261
- }
262
- },
263
- defaultVariants: {
264
- size: "md"
265
- }
266
- });
267
- var chartTooltipLabelVariants = cva("font-medium text-fg-secondary", {
268
- variants: {
269
- size: {
270
- xs: "text-gdt-xs",
271
- sm: "text-gdt-xs",
272
- md: "text-gdt-sm",
273
- lg: "text-gdt-sm"
274
- }
275
- },
276
- defaultVariants: { size: "md" }
277
- });
278
- var chartTooltipValueVariants = cva(
279
- "font-extrabold text-fg-primary tabular-nums",
280
- {
281
- variants: {
282
- size: {
283
- xs: "text-gdt-sm",
284
- sm: "text-gdt-md",
285
- md: "text-gdt-lg",
286
- lg: "text-gdt-xl"
287
- }
288
- },
289
- defaultVariants: { size: "md" }
290
- }
291
- );
292
- function ChartTooltipContent({
293
- active,
294
- payload,
295
- className,
296
- hideIndicator = false,
297
- label,
298
- labelFormatter,
299
- formatter,
300
- color,
301
- nameKey,
302
- valueType = "number",
303
- size = "md"
304
- }) {
305
- const { config } = useChart();
306
- if (!active || !payload?.length) {
307
- return null;
308
- }
309
- const [item] = payload.filter((entry) => entry.type !== "none");
310
- if (!item) {
311
- return null;
312
- }
313
- const key = `${nameKey ?? item.name ?? item.dataKey ?? "value"}`;
314
- const itemConfig = getPayloadConfigFromPayload(config, item, key);
315
- const dotColor = color ?? item.payload?.fill ?? item.color ?? SERIES_COLOR_PLACEHOLDER;
316
- const metricLabel = itemConfig?.label ?? item.name;
317
- const heroValue = formatter ? formatter(item.value, item.name ?? "", item, 0, item.payload) : formatChartValue(item.value, valueType);
318
- const periodCaption = labelFormatter ? labelFormatter(label, payload) : (typeof label === "string" ? config[label]?.label : null) ?? label;
319
- return /* @__PURE__ */ jsxs("div", { className: cn(chartTooltipVariants({ size }), className), children: [
320
- metricLabel != null && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 [&>svg]:size-3 [&>svg]:shrink-0", children: [
321
- !hideIndicator && (itemConfig?.icon ? /* @__PURE__ */ jsx2(itemConfig.icon, {}) : /* @__PURE__ */ jsx2(
322
- "span",
323
- {
324
- "aria-hidden": "true",
325
- className: cn(chartTooltipDotVariants({ size })),
326
- style: { backgroundColor: dotColor }
327
- }
328
- )),
329
- /* @__PURE__ */ jsx2("span", { className: cn(chartTooltipLabelVariants({ size })), children: metricLabel })
330
- ] }),
331
- /* @__PURE__ */ jsx2("p", { className: cn(chartTooltipValueVariants({ size })), children: heroValue }),
332
- periodCaption != null && periodCaption !== "" && /* @__PURE__ */ jsx2("p", { className: "text-gdt-xs text-fg-caption-placeholder", children: periodCaption })
333
- ] });
334
- }
335
- var chartLegendItemVariants = cva(
336
- "group/legend-item flex items-center rounded-md leading-none text-fg-primary transition-colors [&>svg]:shrink-0",
337
- {
338
- variants: {
339
- size: {
340
- sm: "gap-1.5 px-2 py-1 text-gdt-xs [&>svg]:size-3",
341
- md: "gap-2 px-2.5 py-1.5 text-gdt-sm [&>svg]:size-3.5"
342
- },
343
- interactive: {
344
- true: "cursor-pointer outline-none hover:bg-surface-raised focus-visible:bg-surface-raised",
345
- false: ""
346
- },
347
- inactive: {
348
- true: "text-fg-caption-placeholder line-through",
349
- false: ""
350
- }
351
- },
352
- defaultVariants: {
353
- size: "md",
354
- interactive: false,
355
- inactive: false
356
- }
357
- }
358
- );
359
- var chartLegendMarkerSizeVariants = cva("shrink-0", {
360
- variants: {
361
- marker: {
362
- dot: "rounded-full",
363
- square: "rounded-[2px]",
364
- line: "rounded-full"
365
- },
366
- size: {
367
- sm: "",
368
- md: ""
369
- }
370
- },
371
- compoundVariants: [
372
- { marker: ["dot", "square"], size: "sm", className: "size-2" },
373
- { marker: ["dot", "square"], size: "md", className: "size-2.5" },
374
- { marker: "line", size: "sm", className: "h-[3px] w-3" },
375
- { marker: "line", size: "md", className: "h-[3px] w-3.5" }
376
- ],
377
- defaultVariants: { marker: "dot", size: "md" }
378
- });
379
- function getPayloadConfigFromPayload(config, payload, key) {
380
- if (typeof payload !== "object" || payload === null) {
381
- return void 0;
382
- }
383
- const payloadPayload = "payload" in payload && typeof payload.payload === "object" && payload.payload !== null ? payload.payload : void 0;
384
- let configLabelKey = key;
385
- if (key in payload && typeof payload[key] === "string") {
386
- configLabelKey = payload[key];
387
- } else if (payloadPayload && key in payloadPayload && typeof payloadPayload[key] === "string") {
388
- configLabelKey = payloadPayload[key];
389
- }
390
- return configLabelKey in config ? config[configLabelKey] : config[key];
391
- }
392
-
393
- // src/components/ui/tree-map.tsx
394
- import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
20
+ import { Treemap as RechartsTreemap } from "recharts";
21
+ import { jsx, jsxs } from "react/jsx-runtime";
395
22
  var TREE_MAP_PALETTE = [
396
23
  { fill: "var(--color-forest-700)", text: "var(--color-forest-100)" },
397
24
  { fill: "var(--color-brass-500)", text: "var(--color-brass-900)" },
@@ -428,7 +55,7 @@ var TREE_MAP_LAYOUT = {
428
55
  labelMinSide: 60
429
56
  }
430
57
  };
431
- var treeMapLegendVariants = cva2("flex min-w-0", {
58
+ var treeMapLegendVariants = cva("flex min-w-0", {
432
59
  variants: {
433
60
  placement: {
434
61
  right: "flex-col",
@@ -448,7 +75,7 @@ var treeMapLegendVariants = cva2("flex min-w-0", {
448
75
  ],
449
76
  defaultVariants: { placement: "right", size: "md" }
450
77
  });
451
- var treeMapLegendDotVariants = cva2("shrink-0 rounded-full", {
78
+ var treeMapLegendDotVariants = cva("shrink-0 rounded-full", {
452
79
  variants: {
453
80
  size: { sm: "size-2", md: "size-2.5", lg: "size-3" }
454
81
  },
@@ -496,10 +123,10 @@ function TreeMap({
496
123
  { label: datum.label, color: datum.fill }
497
124
  ])
498
125
  );
499
- const tooltipNode = tooltip ? /* @__PURE__ */ jsx3(
126
+ const tooltipNode = tooltip ? /* @__PURE__ */ jsx(
500
127
  ChartTooltip,
501
128
  {
502
- content: /* @__PURE__ */ jsx3(
129
+ content: /* @__PURE__ */ jsx(
503
130
  ChartTooltipContent,
504
131
  {
505
132
  nameKey: "label",
@@ -509,18 +136,18 @@ function TreeMap({
509
136
  )
510
137
  }
511
138
  ) : null;
512
- const legendNode = /* @__PURE__ */ jsx3(
139
+ const legendNode = /* @__PURE__ */ jsx(
513
140
  "ul",
514
141
  {
515
142
  className: cn(
516
143
  treeMapLegendVariants({ placement: legend, size: resolvedSize })
517
144
  ),
518
- children: resolved.map((datum) => /* @__PURE__ */ jsxs2(
145
+ children: resolved.map((datum) => /* @__PURE__ */ jsxs(
519
146
  "li",
520
147
  {
521
148
  className: "flex items-center gap-2 text-fg-primary",
522
149
  children: [
523
- /* @__PURE__ */ jsx3(
150
+ /* @__PURE__ */ jsx(
524
151
  "span",
525
152
  {
526
153
  "aria-hidden": "true",
@@ -528,19 +155,19 @@ function TreeMap({
528
155
  style: { backgroundColor: datum.fill }
529
156
  }
530
157
  ),
531
- /* @__PURE__ */ jsx3("span", { className: "min-w-0 truncate", children: datum.label })
158
+ /* @__PURE__ */ jsx("span", { className: "min-w-0 truncate", children: datum.label })
532
159
  ]
533
160
  },
534
161
  datum.label
535
162
  ))
536
163
  }
537
164
  );
538
- return /* @__PURE__ */ jsxs2(ChartCard, { size: resolvedSize, className, ...props, children: [
539
- (title != null || description != null) && /* @__PURE__ */ jsxs2(ChartHeader, { children: [
540
- title != null && /* @__PURE__ */ jsx3(ChartTitle, { children: title }),
541
- description != null && /* @__PURE__ */ jsx3(ChartDescription, { children: description })
165
+ return /* @__PURE__ */ jsxs(ChartCard, { size: resolvedSize, className, ...props, children: [
166
+ (title != null || description != null) && /* @__PURE__ */ jsxs(ChartHeader, { children: [
167
+ title != null && /* @__PURE__ */ jsx(ChartTitle, { children: title }),
168
+ description != null && /* @__PURE__ */ jsx(ChartDescription, { children: description })
542
169
  ] }),
543
- /* @__PURE__ */ jsxs2(
170
+ /* @__PURE__ */ jsxs(
544
171
  "div",
545
172
  {
546
173
  className: cn(
@@ -548,13 +175,13 @@ function TreeMap({
548
175
  legend === "right" ? "flex-row items-stretch" : "flex-col"
549
176
  ),
550
177
  children: [
551
- /* @__PURE__ */ jsx3(
178
+ /* @__PURE__ */ jsx(
552
179
  ChartContainer,
553
180
  {
554
181
  config,
555
182
  className: "aspect-auto min-w-0 flex-1",
556
183
  style: { height: layout.height },
557
- children: /* @__PURE__ */ jsx3(
184
+ children: /* @__PURE__ */ jsx(
558
185
  RechartsTreemap,
559
186
  {
560
187
  data: resolved,
@@ -562,7 +189,7 @@ function TreeMap({
562
189
  nameKey: "label",
563
190
  type: "flat",
564
191
  isAnimationActive: false,
565
- content: /* @__PURE__ */ jsx3(TreeMapTile, { total, layout }),
192
+ content: /* @__PURE__ */ jsx(TreeMapTile, { total, layout }),
566
193
  children: tooltipNode
567
194
  }
568
195
  )
@@ -588,7 +215,7 @@ function TreeMapTile({
588
215
  text
589
216
  }) {
590
217
  if (children != null || x == null || y == null || width == null || height == null) {
591
- return /* @__PURE__ */ jsx3("g", {});
218
+ return /* @__PURE__ */ jsx("g", {});
592
219
  }
593
220
  const tileX = x + layout.gap / 2;
594
221
  const tileY = y + layout.gap / 2;
@@ -596,8 +223,8 @@ function TreeMapTile({
596
223
  const tileH = Math.max(0, height - layout.gap);
597
224
  const showLabel = tileW >= layout.labelMinSide && tileH >= layout.labelMinSide;
598
225
  const share = total > 0 ? Math.round((value ?? 0) / total * 100) : 0;
599
- return /* @__PURE__ */ jsxs2("g", { children: [
600
- /* @__PURE__ */ jsx3(
226
+ return /* @__PURE__ */ jsxs("g", { children: [
227
+ /* @__PURE__ */ jsx(
601
228
  "rect",
602
229
  {
603
230
  x: tileX,
@@ -609,7 +236,7 @@ function TreeMapTile({
609
236
  fill
610
237
  }
611
238
  ),
612
- showLabel && /* @__PURE__ */ jsxs2(
239
+ showLabel && /* @__PURE__ */ jsxs(
613
240
  "text",
614
241
  {
615
242
  x: tileX + layout.labelPadding,
@@ -617,7 +244,7 @@ function TreeMapTile({
617
244
  fill: text,
618
245
  dominantBaseline: "hanging",
619
246
  children: [
620
- /* @__PURE__ */ jsx3(
247
+ /* @__PURE__ */ jsx(
621
248
  "tspan",
622
249
  {
623
250
  x: tileX + layout.labelPadding,
@@ -626,7 +253,7 @@ function TreeMapTile({
626
253
  children: name
627
254
  }
628
255
  ),
629
- /* @__PURE__ */ jsxs2(
256
+ /* @__PURE__ */ jsxs(
630
257
  "tspan",
631
258
  {
632
259
  x: tileX + layout.labelPadding,