@giddaa-housing/ui 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -0
- package/dist/accordion.d.ts +11 -0
- package/dist/accordion.js +124 -0
- package/dist/accordion.js.map +1 -0
- package/dist/alert.d.ts +18 -0
- package/dist/alert.js +152 -0
- package/dist/alert.js.map +1 -0
- package/dist/avatar.d.ts +14 -0
- package/dist/avatar.js +152 -0
- package/dist/avatar.js.map +1 -0
- package/dist/badge.d.ts +14 -0
- package/dist/badge.js +119 -0
- package/dist/badge.js.map +1 -0
- package/dist/bar-chart.d.ts +136 -0
- package/dist/bar-chart.js +302 -0
- package/dist/bar-chart.js.map +1 -0
- package/dist/base.css +32 -0
- package/dist/breadcrumb.d.ts +12 -0
- package/dist/breadcrumb.js +161 -0
- package/dist/breadcrumb.js.map +1 -0
- package/dist/bullet-chart.d.ts +98 -0
- package/dist/bullet-chart.js +189 -0
- package/dist/bullet-chart.js.map +1 -0
- package/dist/button-group.d.ts +18 -0
- package/dist/button-group.js +170 -0
- package/dist/button-group.js.map +1 -0
- package/dist/button.d.ts +19 -0
- package/dist/button.js +146 -0
- package/dist/button.js.map +1 -0
- package/dist/calendar.d.ts +9 -0
- package/dist/calendar.js +293 -0
- package/dist/calendar.js.map +1 -0
- package/dist/card.d.ts +18 -0
- package/dist/card.js +186 -0
- package/dist/card.js.map +1 -0
- package/dist/carousel.d.ts +53 -0
- package/dist/carousel.js +396 -0
- package/dist/carousel.js.map +1 -0
- package/dist/chart.d.ts +122 -0
- package/dist/chart.js +494 -0
- package/dist/chart.js.map +1 -0
- package/dist/checkbox.d.ts +73 -0
- package/dist/checkbox.js +87 -0
- package/dist/checkbox.js.map +1 -0
- package/dist/collapsible.d.ts +8 -0
- package/dist/collapsible.js +82 -0
- package/dist/collapsible.js.map +1 -0
- package/dist/combobox.d.ts +30 -0
- package/dist/combobox.js +713 -0
- package/dist/combobox.js.map +1 -0
- package/dist/date-picker.d.ts +22 -0
- package/dist/date-picker.js +528 -0
- package/dist/date-picker.js.map +1 -0
- package/dist/dialog.d.ts +30 -0
- package/dist/dialog.js +339 -0
- package/dist/dialog.js.map +1 -0
- package/dist/dropdown-menu.d.ts +35 -0
- package/dist/dropdown-menu.js +376 -0
- package/dist/dropdown-menu.js.map +1 -0
- package/dist/dropzone.d.ts +128 -0
- package/dist/dropzone.js +490 -0
- package/dist/dropzone.js.map +1 -0
- package/dist/empty-state.d.ts +17 -0
- package/dist/empty-state.js +146 -0
- package/dist/empty-state.js.map +1 -0
- package/dist/field.d.ts +29 -0
- package/dist/field.js +345 -0
- package/dist/field.js.map +1 -0
- package/dist/files/red-hat-display-latin-300-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-300-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-300-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-300-normal.woff2 +0 -0
- package/dist/files/red-hat-display-latin-400-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-400-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-400-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-400-normal.woff2 +0 -0
- package/dist/files/red-hat-display-latin-500-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-500-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-500-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-500-normal.woff2 +0 -0
- package/dist/files/red-hat-display-latin-600-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-600-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-600-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-600-normal.woff2 +0 -0
- package/dist/files/red-hat-display-latin-700-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-700-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-700-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-700-normal.woff2 +0 -0
- package/dist/files/red-hat-display-latin-800-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-800-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-800-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-800-normal.woff2 +0 -0
- package/dist/files/red-hat-display-latin-900-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-900-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-900-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-900-normal.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-300-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-300-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-300-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-300-normal.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-400-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-400-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-400-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-400-normal.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-500-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-500-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-500-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-500-normal.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-600-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-600-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-600-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-600-normal.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-700-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-700-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-700-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-700-normal.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-800-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-800-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-800-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-800-normal.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-900-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-900-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-900-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-900-normal.woff2 +0 -0
- package/dist/funnel-chart.d.ts +84 -0
- package/dist/funnel-chart.js +569 -0
- package/dist/funnel-chart.js.map +1 -0
- package/dist/index.d.ts +87 -0
- package/dist/index.js +10448 -0
- package/dist/index.js.map +1 -0
- package/dist/input-group.d.ts +31 -0
- package/dist/input-group.js +380 -0
- package/dist/input-group.js.map +1 -0
- package/dist/input-size-context.d.ts +11 -0
- package/dist/input-size-context.js +24 -0
- package/dist/input-size-context.js.map +1 -0
- package/dist/input.d.ts +13 -0
- package/dist/input.js +83 -0
- package/dist/input.js.map +1 -0
- package/dist/item.d.ts +8 -0
- package/dist/item.js +93 -0
- package/dist/item.js.map +1 -0
- package/dist/kpi-card.d.ts +24 -0
- package/dist/kpi-card.js +243 -0
- package/dist/kpi-card.js.map +1 -0
- package/dist/label.d.ts +8 -0
- package/dist/label.js +68 -0
- package/dist/label.js.map +1 -0
- package/dist/line-chart.d.ts +155 -0
- package/dist/line-chart.js +269 -0
- package/dist/line-chart.js.map +1 -0
- package/dist/logo.d.ts +6 -0
- package/dist/logo.js +146 -0
- package/dist/logo.js.map +1 -0
- package/dist/number-input.d.ts +41 -0
- package/dist/number-input.js +418 -0
- package/dist/number-input.js.map +1 -0
- package/dist/page-header.d.ts +13 -0
- package/dist/page-header.js +113 -0
- package/dist/page-header.js.map +1 -0
- package/dist/pagination.d.ts +35 -0
- package/dist/pagination.js +352 -0
- package/dist/pagination.js.map +1 -0
- package/dist/password-input.d.ts +13 -0
- package/dist/password-input.js +356 -0
- package/dist/password-input.js.map +1 -0
- package/dist/phone-input.d.ts +21 -0
- package/dist/phone-input.js +573 -0
- package/dist/phone-input.js.map +1 -0
- package/dist/photo-gallery.d.ts +42 -0
- package/dist/photo-gallery.js +756 -0
- package/dist/photo-gallery.js.map +1 -0
- package/dist/pie-chart.d.ts +125 -0
- package/dist/pie-chart.js +192 -0
- package/dist/pie-chart.js.map +1 -0
- package/dist/popover.d.ts +20 -0
- package/dist/popover.js +169 -0
- package/dist/popover.js.map +1 -0
- package/dist/progress.d.ts +28 -0
- package/dist/progress.js +315 -0
- package/dist/progress.js.map +1 -0
- package/dist/radio-group.d.ts +32 -0
- package/dist/radio-group.js +100 -0
- package/dist/radio-group.js.map +1 -0
- package/dist/red-hat-display.css +2 -0
- package/dist/rich-text-editor.d.ts +16 -0
- package/dist/rich-text-editor.js +1000 -0
- package/dist/rich-text-editor.js.map +1 -0
- package/dist/search-input.d.ts +19 -0
- package/dist/search-input.js +411 -0
- package/dist/search-input.js.map +1 -0
- package/dist/select.d.ts +21 -0
- package/dist/select.js +305 -0
- package/dist/select.js.map +1 -0
- package/dist/separator.d.ts +10 -0
- package/dist/separator.js +72 -0
- package/dist/separator.js.map +1 -0
- package/dist/sheet.d.ts +24 -0
- package/dist/sheet.js +282 -0
- package/dist/sheet.js.map +1 -0
- package/dist/sidebar.d.ts +70 -0
- package/dist/sidebar.js +1078 -0
- package/dist/sidebar.js.map +1 -0
- package/dist/size-context.d.ts +11 -0
- package/dist/size-context.js +22 -0
- package/dist/size-context.js.map +1 -0
- package/dist/skeleton.d.ts +5 -0
- package/dist/skeleton.js +48 -0
- package/dist/skeleton.js.map +1 -0
- package/dist/sparkline.d.ts +94 -0
- package/dist/sparkline.js +568 -0
- package/dist/sparkline.js.map +1 -0
- package/dist/stepper.d.ts +43 -0
- package/dist/stepper.js +296 -0
- package/dist/stepper.js.map +1 -0
- package/dist/styles.css +2 -0
- package/dist/switch.d.ts +29 -0
- package/dist/switch.js +108 -0
- package/dist/switch.js.map +1 -0
- package/dist/tab-list.d.ts +38 -0
- package/dist/tab-list.js +394 -0
- package/dist/tab-list.js.map +1 -0
- package/dist/table.d.ts +69 -0
- package/dist/table.js +197 -0
- package/dist/table.js.map +1 -0
- package/dist/tabs.d.ts +18 -0
- package/dist/tabs.js +159 -0
- package/dist/tabs.js.map +1 -0
- package/dist/tag.d.ts +25 -0
- package/dist/tag.js +160 -0
- package/dist/tag.js.map +1 -0
- package/dist/textarea.d.ts +12 -0
- package/dist/textarea.js +78 -0
- package/dist/textarea.js.map +1 -0
- package/dist/theme/giddaa.css +2 -0
- package/dist/time-picker.d.ts +13 -0
- package/dist/time-picker.js +472 -0
- package/dist/time-picker.js.map +1 -0
- package/dist/toast.d.ts +23 -0
- package/dist/toast.js +330 -0
- package/dist/toast.js.map +1 -0
- package/dist/tooltip.d.ts +11 -0
- package/dist/tooltip.js +96 -0
- package/dist/tooltip.js.map +1 -0
- package/dist/tree-map.d.ts +127 -0
- package/dist/tree-map.js +652 -0
- package/dist/tree-map.js.map +1 -0
- package/package.json +328 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ChartCard, ChartValueType } from './chart.js';
|
|
3
|
+
import { ComponentSize } from './size-context.js';
|
|
4
|
+
import 'class-variance-authority/types';
|
|
5
|
+
import 'class-variance-authority';
|
|
6
|
+
import 'recharts';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* A treemap — part-to-whole composition drawn as proportionally sized, nested
|
|
10
|
+
* rectangles. Reach for one to compare category shares at a glance (portfolio
|
|
11
|
+
* mix, holdings by type, regional distribution).
|
|
12
|
+
*
|
|
13
|
+
* Two shapes share one component: `flat` lays out a single level of categories;
|
|
14
|
+
* `nested` groups subcategories beneath a shared group colour (each leaf inherits
|
|
15
|
+
* its group's colour unless it sets its own `fill`). Both reuse the same palette,
|
|
16
|
+
* in-tile labels, legend, frame, and tooltip — only the data depth differs.
|
|
17
|
+
*
|
|
18
|
+
* Per the chart architecture the recharts `Treemap` primitive is rendered
|
|
19
|
+
* directly here; only the giddaa frame, palette, tile content, and legend are
|
|
20
|
+
* supplied around it. Tiles are sized by `value`; the in-tile label (name + share
|
|
21
|
+
* of the whole) is hidden on tiles too small to fit it.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* <TreeMap
|
|
25
|
+
* data={[
|
|
26
|
+
* { label: "Lekki", value: 40 },
|
|
27
|
+
* { label: "Ikoyi", value: 30 },
|
|
28
|
+
* { label: "V.I.", value: 18 },
|
|
29
|
+
* { label: "Yaba", value: 12 },
|
|
30
|
+
* ]}
|
|
31
|
+
* title="Portfolio mix"
|
|
32
|
+
* description="Share of holdings by location"
|
|
33
|
+
* tooltip
|
|
34
|
+
* />
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* // Nested — subcategories grouped under a shared group colour
|
|
38
|
+
* <TreeMap
|
|
39
|
+
* data={[
|
|
40
|
+
* { label: "Residential", children: [
|
|
41
|
+
* { label: "Apartments", value: 27 },
|
|
42
|
+
* { label: "Duplexes", value: 21 },
|
|
43
|
+
* ] },
|
|
44
|
+
* { label: "Commercial", children: [
|
|
45
|
+
* { label: "Offices", value: 17 },
|
|
46
|
+
* { label: "Retail", value: 13 },
|
|
47
|
+
* ] },
|
|
48
|
+
* { label: "Land", children: [{ label: "Plots", value: 14 }] },
|
|
49
|
+
* ]}
|
|
50
|
+
* title="Portfolio mix"
|
|
51
|
+
* description="Holdings by category & type"
|
|
52
|
+
* />
|
|
53
|
+
*/
|
|
54
|
+
/** Treemap sizes line up with the three shared `ComponentSize` values. */
|
|
55
|
+
type TreeMapSize = ComponentSize;
|
|
56
|
+
/** Where the colour-key legend sits relative to the plot. */
|
|
57
|
+
type TreeMapLegendPlacement = "right" | "bottom";
|
|
58
|
+
type TreeMapDatum = {
|
|
59
|
+
/** Category name, shown in the tile label, legend, and tooltip. */
|
|
60
|
+
label: string;
|
|
61
|
+
/** Tile value — drives the tile's area. Omit on a group with `children`. */
|
|
62
|
+
value?: number;
|
|
63
|
+
/** Tile/group colour; defaults to the palette in order. Leaves inherit it. */
|
|
64
|
+
fill?: string;
|
|
65
|
+
/** Subcategories for a `nested` treemap. */
|
|
66
|
+
children?: TreeMapDatum[];
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Tile palette, ordered by share: forest → brass → moss → clay → stone. Each
|
|
70
|
+
* entry pairs a tile `fill` with the `text` colour that reads on it (a tonal
|
|
71
|
+
* tint of the same scale). Giddaa has no `chart-1`…`chart-N` tokens yet, so these
|
|
72
|
+
* map to the brand scales; assign by order, or override per datum with `fill`.
|
|
73
|
+
*/
|
|
74
|
+
declare const TREE_MAP_PALETTE: readonly [{
|
|
75
|
+
readonly fill: "var(--color-forest-700)";
|
|
76
|
+
readonly text: "var(--color-forest-100)";
|
|
77
|
+
}, {
|
|
78
|
+
readonly fill: "var(--color-brass-500)";
|
|
79
|
+
readonly text: "var(--color-brass-900)";
|
|
80
|
+
}, {
|
|
81
|
+
readonly fill: "var(--color-moss-600)";
|
|
82
|
+
readonly text: "var(--color-moss-100)";
|
|
83
|
+
}, {
|
|
84
|
+
readonly fill: "var(--color-clay-500)";
|
|
85
|
+
readonly text: "var(--color-clay-50)";
|
|
86
|
+
}, {
|
|
87
|
+
readonly fill: "var(--color-stone-500)";
|
|
88
|
+
readonly text: "var(--color-stone-50)";
|
|
89
|
+
}];
|
|
90
|
+
type TreeMapLayout = {
|
|
91
|
+
/** Plot box height in px. Width stays fluid via the ResponsiveContainer. */
|
|
92
|
+
height: number;
|
|
93
|
+
/** Inset around every tile in px — straddles edges to read as a gap. */
|
|
94
|
+
gap: number;
|
|
95
|
+
/** Tile corner radius in px. */
|
|
96
|
+
radius: number;
|
|
97
|
+
/** Tile label padding from the top-left corner in px. */
|
|
98
|
+
labelPadding: number;
|
|
99
|
+
/** Tile label (name) font size in px. */
|
|
100
|
+
nameFontSize: number;
|
|
101
|
+
/** Tile label (share) font size in px. */
|
|
102
|
+
shareFontSize: number;
|
|
103
|
+
/** Smallest tile width/height in px that still shows its label. */
|
|
104
|
+
labelMinSide: number;
|
|
105
|
+
};
|
|
106
|
+
declare const TREE_MAP_LAYOUT: Record<TreeMapSize, TreeMapLayout>;
|
|
107
|
+
type TreeMapProps = Omit<React.ComponentProps<typeof ChartCard>, "size" | "children"> & {
|
|
108
|
+
/** Categories — flat leaves, or groups carrying `children` (nested). */
|
|
109
|
+
data: TreeMapDatum[];
|
|
110
|
+
/** Explicit size; otherwise inherited from the nearest `SizeProvider`. */
|
|
111
|
+
size?: TreeMapSize;
|
|
112
|
+
/** Chart heading. Omit to hide the title. */
|
|
113
|
+
title?: React.ReactNode;
|
|
114
|
+
/** Supporting metadata (period, source). Omit to hide the description. */
|
|
115
|
+
description?: React.ReactNode;
|
|
116
|
+
/** Enable the hover value tooltip. Default false. */
|
|
117
|
+
tooltip?: boolean;
|
|
118
|
+
/** Legend placement — a right column or a wrapped bottom row. Default right. */
|
|
119
|
+
legend?: TreeMapLegendPlacement;
|
|
120
|
+
/** Format the tile value in the tooltip. Defaults to a localised number. */
|
|
121
|
+
valueFormatter?: (value: number) => string;
|
|
122
|
+
/** Value formatting for the tooltip. Defaults to `number`. */
|
|
123
|
+
valueType?: ChartValueType;
|
|
124
|
+
};
|
|
125
|
+
declare function TreeMap({ data, size, title, description, tooltip, legend, valueFormatter, valueType, className, ...props }: TreeMapProps): React.JSX.Element;
|
|
126
|
+
|
|
127
|
+
export { TREE_MAP_LAYOUT, TREE_MAP_PALETTE, TreeMap, type TreeMapDatum, type TreeMapLayout, type TreeMapLegendPlacement, type TreeMapProps, type TreeMapSize };
|