@jiwambe/components 0.3.5 → 0.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.d.ts +8 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +10 -0
- package/dist/client.js.map +1 -1
- package/dist/components/Accordion/Accordion.test.d.ts +2 -0
- package/dist/components/Accordion/Accordion.test.d.ts.map +1 -0
- package/dist/components/BarGraph/BarGraph.d.ts +66 -0
- package/dist/components/BarGraph/BarGraph.d.ts.map +1 -0
- package/dist/components/BarGraph/BarGraph.js +151 -0
- package/dist/components/BarGraph/BarGraph.js.map +1 -0
- package/dist/components/BarGraph/BarGraph.test.d.ts +1 -0
- package/dist/components/BarGraph/BarGraph.test.d.ts.map +1 -0
- package/dist/components/BarGraph/BarGraphSkeleton.d.ts +12 -0
- package/dist/components/BarGraph/BarGraphSkeleton.d.ts.map +1 -0
- package/dist/components/BarGraph/BarGraphSkeleton.js +36 -0
- package/dist/components/BarGraph/BarGraphSkeleton.js.map +1 -0
- package/dist/components/Box/Box.test.d.ts +15 -0
- package/dist/components/Box/Box.test.d.ts.map +1 -0
- package/dist/components/Breadcrumb/Breadcrumb.d.ts.map +1 -1
- package/dist/components/Breadcrumb/Breadcrumb.js +89 -0
- package/dist/components/Breadcrumb/Breadcrumb.js.map +1 -0
- package/dist/components/Button/Button.test.d.ts +2 -0
- package/dist/components/Button/Button.test.d.ts.map +1 -0
- package/dist/components/Card/Card.d.ts +57 -43
- package/dist/components/Card/Card.d.ts.map +1 -1
- package/dist/components/Card/Card.js +51 -89
- package/dist/components/Card/Card.js.map +1 -1
- package/dist/components/Card/Card.test.d.ts +2 -0
- package/dist/components/Card/Card.test.d.ts.map +1 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.test.d.ts +2 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.test.d.ts.map +1 -0
- package/dist/components/Container/Container.test.d.ts +2 -0
- package/dist/components/Container/Container.test.d.ts.map +1 -0
- package/dist/components/DataTable/DataTable.d.ts +74 -0
- package/dist/components/DataTable/DataTable.d.ts.map +1 -0
- package/dist/components/DataTable/DataTable.js +183 -0
- package/dist/components/DataTable/DataTable.js.map +1 -0
- package/dist/components/DataTable/DataTable.test.d.ts +2 -0
- package/dist/components/DataTable/DataTable.test.d.ts.map +1 -0
- package/dist/components/DataTable/DataTableCell.d.ts +15 -0
- package/dist/components/DataTable/DataTableCell.d.ts.map +1 -0
- package/dist/components/DataTable/DataTableCell.js +24 -0
- package/dist/components/DataTable/DataTableCell.js.map +1 -0
- package/dist/components/DataTable/DataTableHeader.d.ts +31 -0
- package/dist/components/DataTable/DataTableHeader.d.ts.map +1 -0
- package/dist/components/DataTable/DataTableHeader.js +83 -0
- package/dist/components/DataTable/DataTableHeader.js.map +1 -0
- package/dist/components/DataTable/DataTablePagination.d.ts +26 -0
- package/dist/components/DataTable/DataTablePagination.d.ts.map +1 -0
- package/dist/components/DataTable/DataTablePagination.js +115 -0
- package/dist/components/DataTable/DataTablePagination.js.map +1 -0
- package/dist/components/DataTable/DataTableReviewerCell.d.ts +18 -0
- package/dist/components/DataTable/DataTableReviewerCell.d.ts.map +1 -0
- package/dist/components/DataTable/DataTableReviewerCell.js +31 -0
- package/dist/components/DataTable/DataTableReviewerCell.js.map +1 -0
- package/dist/components/DataTable/DataTableRow.d.ts +35 -0
- package/dist/components/DataTable/DataTableRow.d.ts.map +1 -0
- package/dist/components/DataTable/DataTableRow.js +77 -0
- package/dist/components/DataTable/DataTableRow.js.map +1 -0
- package/dist/components/DataTable/DataTableRowMenu.d.ts +25 -0
- package/dist/components/DataTable/DataTableRowMenu.d.ts.map +1 -0
- package/dist/components/DataTable/DataTableRowMenu.js +60 -0
- package/dist/components/DataTable/DataTableRowMenu.js.map +1 -0
- package/dist/components/DataTable/DataTableStatusBadge.d.ts +16 -0
- package/dist/components/DataTable/DataTableStatusBadge.d.ts.map +1 -0
- package/dist/components/DataTable/DataTableStatusBadge.js +37 -0
- package/dist/components/DataTable/DataTableStatusBadge.js.map +1 -0
- package/dist/components/DataTable/DataTableToolbar.d.ts +32 -0
- package/dist/components/DataTable/DataTableToolbar.d.ts.map +1 -0
- package/dist/components/DataTable/DataTableToolbar.js +37 -0
- package/dist/components/DataTable/DataTableToolbar.js.map +1 -0
- package/dist/components/DateInput/DateInput.test.d.ts +2 -0
- package/dist/components/DateInput/DateInput.test.d.ts.map +1 -0
- package/dist/components/Dialog/Dialog.d.ts +28 -0
- package/dist/components/Dialog/Dialog.d.ts.map +1 -0
- package/dist/components/Dialog/Dialog.js +34 -0
- package/dist/components/Dialog/Dialog.js.map +1 -0
- package/dist/components/Dialog/Dialog.test.d.ts +2 -0
- package/dist/components/Dialog/Dialog.test.d.ts.map +1 -0
- package/dist/components/Divider/Divider.test.d.ts +2 -0
- package/dist/components/Divider/Divider.test.d.ts.map +1 -0
- package/dist/components/Drawer/Drawer.test.d.ts +2 -0
- package/dist/components/Drawer/Drawer.test.d.ts.map +1 -0
- package/dist/components/FAQ/FAQ.test.d.ts +2 -0
- package/dist/components/FAQ/FAQ.test.d.ts.map +1 -0
- package/dist/components/Grid/Grid.d.ts +6 -6
- package/dist/components/Grid/Grid.js.map +1 -1
- package/dist/components/Grid/Grid.test.d.ts +2 -0
- package/dist/components/Grid/Grid.test.d.ts.map +1 -0
- package/dist/components/Icon/Icon.d.ts +17 -13
- package/dist/components/Icon/Icon.d.ts.map +1 -1
- package/dist/components/Icon/Icon.js +12 -162
- package/dist/components/Icon/Icon.js.map +1 -1
- package/dist/components/Icon/Icon.test.d.ts +2 -0
- package/dist/components/Icon/Icon.test.d.ts.map +1 -0
- package/dist/components/JiwambeCard/JiwambeCard.d.ts +54 -0
- package/dist/components/JiwambeCard/JiwambeCard.d.ts.map +1 -0
- package/dist/components/JiwambeCard/JiwambeCard.js +101 -0
- package/dist/components/JiwambeCard/JiwambeCard.js.map +1 -0
- package/dist/components/JiwambeCard/JiwambeCard.test.d.ts +2 -0
- package/dist/components/JiwambeCard/JiwambeCard.test.d.ts.map +1 -0
- package/dist/components/LineGraph/LineGraph.d.ts +40 -0
- package/dist/components/LineGraph/LineGraph.d.ts.map +1 -0
- package/dist/components/LineGraph/LineGraph.js +176 -0
- package/dist/components/LineGraph/LineGraph.js.map +1 -0
- package/dist/components/LineGraph/LineGraph.test.d.ts +1 -0
- package/dist/components/LineGraph/LineGraph.test.d.ts.map +1 -0
- package/dist/components/LineGraph/LineGraphLegend.d.ts +17 -0
- package/dist/components/LineGraph/LineGraphLegend.d.ts.map +1 -0
- package/dist/components/LineGraph/LineGraphLegend.js +56 -0
- package/dist/components/LineGraph/LineGraphLegend.js.map +1 -0
- package/dist/components/LineGraph/LineGraphSkeleton.d.ts +12 -0
- package/dist/components/LineGraph/LineGraphSkeleton.d.ts.map +1 -0
- package/dist/components/LineGraph/LineGraphSkeleton.js +21 -0
- package/dist/components/LineGraph/LineGraphSkeleton.js.map +1 -0
- package/dist/components/LineGraph/LineGraphTooltip.d.ts +12 -0
- package/dist/components/LineGraph/LineGraphTooltip.d.ts.map +1 -0
- package/dist/components/LineGraph/LineGraphTooltip.js +41 -0
- package/dist/components/LineGraph/LineGraphTooltip.js.map +1 -0
- package/dist/components/LineGraph/lineGraphUtils.d.ts +33 -0
- package/dist/components/LineGraph/lineGraphUtils.d.ts.map +1 -0
- package/dist/components/LineGraph/lineGraphUtils.js +62 -0
- package/dist/components/LineGraph/lineGraphUtils.js.map +1 -0
- package/dist/components/LineGraph/types.d.ts +21 -0
- package/dist/components/LineGraph/types.d.ts.map +1 -0
- package/dist/components/Link/Link.test.d.ts +2 -0
- package/dist/components/Link/Link.test.d.ts.map +1 -0
- package/dist/components/List/List.d.ts +5 -3
- package/dist/components/List/List.d.ts.map +1 -1
- package/dist/components/List/List.js +35 -6
- package/dist/components/List/List.js.map +1 -1
- package/dist/components/List/List.test.d.ts +2 -0
- package/dist/components/List/List.test.d.ts.map +1 -0
- package/dist/components/Overlay/Overlay.test.d.ts +2 -0
- package/dist/components/Overlay/Overlay.test.d.ts.map +1 -0
- package/dist/components/PhoneInput/PhoneInput.test.d.ts +2 -0
- package/dist/components/PhoneInput/PhoneInput.test.d.ts.map +1 -0
- package/dist/components/Popover/Popover.test.d.ts +2 -0
- package/dist/components/Popover/Popover.test.d.ts.map +1 -0
- package/dist/components/ProductCard/ProductCard.d.ts.map +1 -1
- package/dist/components/ProductCard/ProductCard.js +6 -3
- package/dist/components/ProductCard/ProductCard.js.map +1 -1
- package/dist/components/ProductCard/ProductCard.test.d.ts +2 -0
- package/dist/components/ProductCard/ProductCard.test.d.ts.map +1 -0
- package/dist/components/ProductImage/ProductImage.test.d.ts +2 -0
- package/dist/components/ProductImage/ProductImage.test.d.ts.map +1 -0
- package/dist/components/RadioGroup/RadioGroup.test.d.ts +2 -0
- package/dist/components/RadioGroup/RadioGroup.test.d.ts.map +1 -0
- package/dist/components/Section/Section.test.d.ts +2 -0
- package/dist/components/Section/Section.test.d.ts.map +1 -0
- package/dist/components/Select/Select.test.d.ts +2 -0
- package/dist/components/Select/Select.test.d.ts.map +1 -0
- package/dist/components/SelectTab/SelectTab.test.d.ts +2 -0
- package/dist/components/SelectTab/SelectTab.test.d.ts.map +1 -0
- package/dist/components/Skeleton/Skeleton.d.ts +4 -4
- package/dist/components/Skeleton/Skeleton.d.ts.map +1 -1
- package/dist/components/Skeleton/Skeleton.js +1 -1
- package/dist/components/Skeleton/Skeleton.js.map +1 -1
- package/dist/components/Skeleton/Skeleton.test.d.ts +2 -0
- package/dist/components/Skeleton/Skeleton.test.d.ts.map +1 -0
- package/dist/components/Slider/Slider.test.d.ts +2 -0
- package/dist/components/Slider/Slider.test.d.ts.map +1 -0
- package/dist/components/Stack/Stack.test.d.ts +2 -0
- package/dist/components/Stack/Stack.test.d.ts.map +1 -0
- package/dist/components/Tab/Tab.test.d.ts +2 -0
- package/dist/components/Tab/Tab.test.d.ts.map +1 -0
- package/dist/components/TextArea/TextArea.test.d.ts +2 -0
- package/dist/components/TextArea/TextArea.test.d.ts.map +1 -0
- package/dist/components/TextInput/TextInput.test.d.ts +2 -0
- package/dist/components/TextInput/TextInput.test.d.ts.map +1 -0
- package/dist/components/Toggle/Toggle.test.d.ts +2 -0
- package/dist/components/Toggle/Toggle.test.d.ts.map +1 -0
- package/dist/components/Typography/Typography.test.d.ts +15 -0
- package/dist/components/Typography/Typography.test.d.ts.map +1 -0
- package/dist/components/UploadInput/UploadInput.test.d.ts +2 -0
- package/dist/components/UploadInput/UploadInput.test.d.ts.map +1 -0
- package/dist/components/index.d.ts +18 -3
- package/dist/components/index.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -1
- package/dist/node_modules/.pnpm/@jiwambe_icons@0.3.1_react@19.2.4/node_modules/@jiwambe/icons/dist/icons/Check.js +10 -0
- package/dist/node_modules/.pnpm/@jiwambe_icons@0.3.1_react@19.2.4/node_modules/@jiwambe/icons/dist/icons/Check.js.map +1 -0
- package/dist/node_modules/.pnpm/@jiwambe_icons@0.3.1_react@19.2.4/node_modules/@jiwambe/icons/dist/icons/ChevronLeft.js +10 -0
- package/dist/node_modules/.pnpm/@jiwambe_icons@0.3.1_react@19.2.4/node_modules/@jiwambe/icons/dist/icons/ChevronLeft.js.map +1 -0
- package/dist/node_modules/.pnpm/@jiwambe_icons@0.3.1_react@19.2.4/node_modules/@jiwambe/icons/dist/icons/ChevronRight.js +10 -0
- package/dist/node_modules/.pnpm/@jiwambe_icons@0.3.1_react@19.2.4/node_modules/@jiwambe/icons/dist/icons/ChevronRight.js.map +1 -0
- package/dist/plugin/jiwambe-plugin.d.ts.map +1 -1
- package/dist/plugin/jiwambe-plugin.js +5 -0
- package/dist/plugin/jiwambe-plugin.js.map +1 -1
- package/dist/server.d.ts +3 -3
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +2 -2
- package/dist/types/list.d.ts +4 -3
- package/dist/types/list.d.ts.map +1 -1
- package/dist/types/list.js.map +1 -1
- package/dist/utils/layoutClasses.test.d.ts +2 -0
- package/dist/utils/layoutClasses.test.d.ts.map +1 -0
- package/dist/utils/spacing.test.d.ts +2 -0
- package/dist/utils/spacing.test.d.ts.map +1 -0
- package/package.json +5 -3
package/dist/client.d.ts
CHANGED
|
@@ -36,5 +36,13 @@ export { Toggle, ToggleButton } from './components/Toggle/Toggle';
|
|
|
36
36
|
export type { ToggleProps, ToggleButtonProps, ToggleOption, ToggleSize } from './components/Toggle/Toggle';
|
|
37
37
|
export { ProductImage, ProductImageGallery } from './components/ProductImage/ProductImage';
|
|
38
38
|
export type { ProductImageProps, ProductImageGalleryProps, GalleryImage } from './components/ProductImage/ProductImage';
|
|
39
|
+
export { Dialog } from './components/Dialog/Dialog';
|
|
40
|
+
export type { DialogProps } from './components/Dialog/Dialog';
|
|
41
|
+
export { DataTable } from './components/DataTable/DataTable';
|
|
42
|
+
export type { DataTableProps } from './components/DataTable/DataTable';
|
|
43
|
+
export { LineGraph } from './components/LineGraph/LineGraph';
|
|
44
|
+
export { BarGraph } from './components/BarGraph/BarGraph';
|
|
45
|
+
export { Card } from './components/Card/Card';
|
|
39
46
|
export type { ButtonVariant, ButtonSize, AccordionItem, AccordionVariant, AccordionSpecItem, FAQItem, TabItem, } from './types';
|
|
47
|
+
export type { CardProps } from './components/Card/Card';
|
|
40
48
|
//# sourceMappingURL=client.d.ts.map
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,YAAY,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAC7E,YAAY,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAE5F,OAAO,EAAE,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.js";
|
|
|
18
18
|
import { Slider } from "./components/Slider/Slider.js";
|
|
19
19
|
import { Toggle, ToggleButton } from "./components/Toggle/Toggle.js";
|
|
20
20
|
import { ProductImage, ProductImageGallery } from "./components/ProductImage/ProductImage.js";
|
|
21
|
+
import { Dialog } from "./components/Dialog/Dialog.js";
|
|
22
|
+
import { DataTable } from "./components/DataTable/DataTable.js";
|
|
23
|
+
import { LineGraph } from "./components/LineGraph/LineGraph.js";
|
|
24
|
+
import { BarGraph } from "./components/BarGraph/BarGraph.js";
|
|
25
|
+
import { Card } from "./components/Card/Card.js";
|
|
21
26
|
export {
|
|
22
27
|
Accordion,
|
|
23
28
|
AccordionSpecs,
|
|
29
|
+
BarGraph,
|
|
24
30
|
Button,
|
|
31
|
+
Card,
|
|
25
32
|
CheckboxGroup,
|
|
33
|
+
DataTable,
|
|
26
34
|
DateInput,
|
|
35
|
+
Dialog,
|
|
27
36
|
Drawer,
|
|
28
37
|
EAST_AFRICA_COUNTRIES,
|
|
29
38
|
FAQ,
|
|
39
|
+
LineGraph,
|
|
30
40
|
Overlay,
|
|
31
41
|
PhoneInput,
|
|
32
42
|
Popover,
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Accordion.test.d.ts","sourceRoot":"","sources":["../../../src/components/Accordion/Accordion.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export interface BarGraphDataPoint {
|
|
2
|
+
/** Category label rendered on the X axis */
|
|
3
|
+
x: string | number;
|
|
4
|
+
/** Numeric value rendered as bar height */
|
|
5
|
+
y: number;
|
|
6
|
+
}
|
|
7
|
+
export interface BarGraphSeries {
|
|
8
|
+
/** Unique identifier for this series */
|
|
9
|
+
id: string;
|
|
10
|
+
/** Display label shown in legend and tooltip */
|
|
11
|
+
label: string;
|
|
12
|
+
/** Data points — x is the category label, y is the numeric value */
|
|
13
|
+
data: BarGraphDataPoint[];
|
|
14
|
+
/**
|
|
15
|
+
* Optional color override. Must be a CSS color or Jiwambe CSS variable
|
|
16
|
+
* e.g. 'var(--color-green-500)'. Falls back to SERIES_COLORS palette.
|
|
17
|
+
*/
|
|
18
|
+
color?: string;
|
|
19
|
+
/** Hide this series from the chart but keep it in the legend */
|
|
20
|
+
hidden?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface BarGraphProps {
|
|
23
|
+
/** Array of data series to display */
|
|
24
|
+
series: BarGraphSeries[];
|
|
25
|
+
/** Optional title displayed above the chart */
|
|
26
|
+
title?: string;
|
|
27
|
+
/** Optional description displayed below the title */
|
|
28
|
+
description?: string;
|
|
29
|
+
/** Label for the X-axis */
|
|
30
|
+
xAxisLabel?: string;
|
|
31
|
+
/** Label for the Y-axis */
|
|
32
|
+
yAxisLabel?: string;
|
|
33
|
+
/** Custom formatter for X-axis ticks */
|
|
34
|
+
xTickFormatter?: (value: string | number) => string;
|
|
35
|
+
/** Custom formatter for Y-axis ticks */
|
|
36
|
+
yTickFormatter?: (value: number) => string;
|
|
37
|
+
/** Custom formatter for tooltip values and labels */
|
|
38
|
+
tooltipValueFormatter?: (value: number, seriesLabel: string) => string;
|
|
39
|
+
/** height of the chart in px. @default 320 */
|
|
40
|
+
height?: number;
|
|
41
|
+
/** Whether the chart is in a loading state */
|
|
42
|
+
loading?: boolean;
|
|
43
|
+
/** Whether to show the background grid. @default true */
|
|
44
|
+
showGrid?: boolean;
|
|
45
|
+
/** Position of the legend. @default 'bottom' */
|
|
46
|
+
legendPosition?: 'top' | 'bottom' | 'none';
|
|
47
|
+
/** Whether to allow toggling series visibility via the legend. @default true */
|
|
48
|
+
interactiveLegend?: boolean;
|
|
49
|
+
/** Callback fired when a bar is clicked */
|
|
50
|
+
onBarClick?: (point: BarGraphDataPoint, series: BarGraphSeries) => void;
|
|
51
|
+
/** Width of each bar in px. @default 24 */
|
|
52
|
+
barSize?: number;
|
|
53
|
+
/** Corner radius applied to the top of each bar. @default 4 */
|
|
54
|
+
barRadius?: number;
|
|
55
|
+
/** Gap between bar groups as a fraction or number. @default '20%' */
|
|
56
|
+
barCategoryGap?: string | number;
|
|
57
|
+
/** Additional CSS classes */
|
|
58
|
+
className?: string;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* A themed Bar Graph component for Jiwambe.
|
|
62
|
+
* Renders grouped or single series data using SVG-based Recharts.
|
|
63
|
+
* Integrates with design tokens for colors, spacing, and typography.
|
|
64
|
+
*/
|
|
65
|
+
export declare function BarGraph({ series, title, description, xAxisLabel, yAxisLabel, xTickFormatter, yTickFormatter, tooltipValueFormatter, height, loading, showGrid, legendPosition, interactiveLegend, onBarClick, barSize, barRadius, barCategoryGap, className, }: BarGraphProps): import("react/jsx-runtime").JSX.Element;
|
|
66
|
+
//# sourceMappingURL=BarGraph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BarGraph.d.ts","sourceRoot":"","sources":["../../../src/components/BarGraph/BarGraph.tsx"],"names":[],"mappings":"AAwBA,MAAM,WAAW,iBAAiB;IAChC,4CAA4C;IAC5C,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACnB,2CAA2C;IAC3C,CAAC,EAAE,MAAM,CAAC;CACX;AAED,MAAM,WAAW,cAAc;IAC7B,wCAAwC;IACxC,EAAE,EAAE,MAAM,CAAC;IACX,gDAAgD;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,oEAAoE;IACpE,IAAI,EAAE,iBAAiB,EAAE,CAAC;IAC1B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gEAAgE;IAChE,MAAM,CAAC,EAAE,OAAO,CAAC;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MAAM,EACN,KAAK,EACL,WAAW,EACX,UAAU,EACV,UAAU,EACV,cAAc,EACd,cAAc,EACd,qBAAqB,EACrB,MAAY,EACZ,OAAe,EACf,QAAe,EACf,cAAyB,EACzB,iBAAwB,EACxB,UAAU,EACV,OAAY,EACZ,SAAa,EACb,cAAsB,EACtB,SAAc,GACf,EAAE,aAAa,2CA+Hf"}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useState, useEffect, useMemo } from "react";
|
|
4
|
+
import { ResponsiveContainer, BarChart, CartesianGrid, XAxis, YAxis, Tooltip, Bar } from "recharts";
|
|
5
|
+
import { Typography } from "../Typography/Typography.js";
|
|
6
|
+
import { Stack } from "../Stack/Stack.js";
|
|
7
|
+
import { LineGraphTooltip } from "../LineGraph/LineGraphTooltip.js";
|
|
8
|
+
import { LineGraphLegend } from "../LineGraph/LineGraphLegend.js";
|
|
9
|
+
import { validateSeries, transformToBarChartData, formatAxisTick, getSeriesColor } from "../LineGraph/lineGraphUtils.js";
|
|
10
|
+
import { BarGraphSkeleton } from "./BarGraphSkeleton.js";
|
|
11
|
+
function BarGraph({
|
|
12
|
+
series,
|
|
13
|
+
title,
|
|
14
|
+
description,
|
|
15
|
+
xAxisLabel,
|
|
16
|
+
yAxisLabel,
|
|
17
|
+
xTickFormatter,
|
|
18
|
+
yTickFormatter,
|
|
19
|
+
tooltipValueFormatter,
|
|
20
|
+
height = 320,
|
|
21
|
+
loading = false,
|
|
22
|
+
showGrid = true,
|
|
23
|
+
legendPosition = "bottom",
|
|
24
|
+
interactiveLegend = true,
|
|
25
|
+
onBarClick,
|
|
26
|
+
barSize = 24,
|
|
27
|
+
barRadius = 4,
|
|
28
|
+
barCategoryGap = "20%",
|
|
29
|
+
className = ""
|
|
30
|
+
}) {
|
|
31
|
+
const [mounted, setMounted] = useState(false);
|
|
32
|
+
const [hiddenIds, setHiddenIds] = useState([]);
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
setMounted(true);
|
|
35
|
+
}, []);
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
validateSeries(series);
|
|
38
|
+
}, [series]);
|
|
39
|
+
const chartData = useMemo(() => transformToBarChartData(series), [series]);
|
|
40
|
+
const handleToggle = (id) => {
|
|
41
|
+
setHiddenIds(
|
|
42
|
+
(prev) => prev.includes(id) ? prev.filter((item) => item !== id) : [...prev, id]
|
|
43
|
+
);
|
|
44
|
+
};
|
|
45
|
+
if (loading) {
|
|
46
|
+
return /* @__PURE__ */ jsx(BarGraphSkeleton, { height, showTitle: !!(title || description) });
|
|
47
|
+
}
|
|
48
|
+
const renderLegend = () => /* @__PURE__ */ jsx(
|
|
49
|
+
LineGraphLegend,
|
|
50
|
+
{
|
|
51
|
+
series,
|
|
52
|
+
hiddenIds,
|
|
53
|
+
onToggle: handleToggle,
|
|
54
|
+
interactive: interactiveLegend
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
return /* @__PURE__ */ jsxs(
|
|
58
|
+
"figure",
|
|
59
|
+
{
|
|
60
|
+
role: "figure",
|
|
61
|
+
"aria-label": title ?? "Bar graph",
|
|
62
|
+
className: ["flex flex-col w-full jiwambe-bar-graph", className].filter(Boolean).join(" "),
|
|
63
|
+
children: [
|
|
64
|
+
(title || description) && /* @__PURE__ */ jsxs(Stack, { spacing: "space-1", className: "mb-space-4", children: [
|
|
65
|
+
title && /* @__PURE__ */ jsx(Typography, { variant: "title-md", className: "font-bold text-text-primary", children: title }),
|
|
66
|
+
description && /* @__PURE__ */ jsx(Typography, { variant: "text-xs", className: "text-text-secondary", children: description })
|
|
67
|
+
] }),
|
|
68
|
+
legendPosition === "top" && renderLegend(),
|
|
69
|
+
/* @__PURE__ */ jsx(
|
|
70
|
+
"div",
|
|
71
|
+
{
|
|
72
|
+
style: { height: `${height}px`, width: "100%", minWidth: 0, minHeight: 0 },
|
|
73
|
+
className: "relative",
|
|
74
|
+
children: mounted && /* @__PURE__ */ jsx(ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxs(
|
|
75
|
+
BarChart,
|
|
76
|
+
{
|
|
77
|
+
data: chartData,
|
|
78
|
+
margin: { top: 10, right: 10, left: 0, bottom: 0 },
|
|
79
|
+
barCategoryGap,
|
|
80
|
+
children: [
|
|
81
|
+
showGrid && /* @__PURE__ */ jsx(
|
|
82
|
+
CartesianGrid,
|
|
83
|
+
{
|
|
84
|
+
strokeDasharray: "3 3",
|
|
85
|
+
vertical: false,
|
|
86
|
+
stroke: "var(--color-neutral-200, #E5E5E5)"
|
|
87
|
+
}
|
|
88
|
+
),
|
|
89
|
+
/* @__PURE__ */ jsx(
|
|
90
|
+
XAxis,
|
|
91
|
+
{
|
|
92
|
+
dataKey: "x",
|
|
93
|
+
axisLine: false,
|
|
94
|
+
tickLine: false,
|
|
95
|
+
tick: { fill: "var(--color-neutral-600, #4B5563)", fontSize: 12 },
|
|
96
|
+
tickFormatter: xTickFormatter || formatAxisTick,
|
|
97
|
+
label: xAxisLabel ? { value: xAxisLabel, position: "insideBottom", offset: -5 } : void 0,
|
|
98
|
+
dy: 10
|
|
99
|
+
}
|
|
100
|
+
),
|
|
101
|
+
/* @__PURE__ */ jsx(
|
|
102
|
+
YAxis,
|
|
103
|
+
{
|
|
104
|
+
axisLine: false,
|
|
105
|
+
tickLine: false,
|
|
106
|
+
tick: { fill: "var(--color-neutral-600, #4B5563)", fontSize: 12 },
|
|
107
|
+
tickFormatter: yTickFormatter,
|
|
108
|
+
label: yAxisLabel ? { value: yAxisLabel, angle: -90, position: "insideLeft" } : void 0
|
|
109
|
+
}
|
|
110
|
+
),
|
|
111
|
+
/* @__PURE__ */ jsx(
|
|
112
|
+
Tooltip,
|
|
113
|
+
{
|
|
114
|
+
content: /* @__PURE__ */ jsx(LineGraphTooltip, { tooltipValueFormatter }),
|
|
115
|
+
cursor: { fill: "var(--color-neutral-100, #F3F4F6)", opacity: 0.4 }
|
|
116
|
+
}
|
|
117
|
+
),
|
|
118
|
+
series.map((s, index) => {
|
|
119
|
+
if (hiddenIds.includes(s.id) || s.hidden) return null;
|
|
120
|
+
return /* @__PURE__ */ jsx(
|
|
121
|
+
Bar,
|
|
122
|
+
{
|
|
123
|
+
dataKey: s.id,
|
|
124
|
+
name: s.label,
|
|
125
|
+
fill: getSeriesColor(s, index),
|
|
126
|
+
barSize,
|
|
127
|
+
radius: [barRadius, barRadius, 0, 0],
|
|
128
|
+
onClick: (data) => {
|
|
129
|
+
if (onBarClick) {
|
|
130
|
+
const point = s.data.find((p) => p.x === data.x);
|
|
131
|
+
if (point) onBarClick(point, s);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
s.id
|
|
136
|
+
);
|
|
137
|
+
})
|
|
138
|
+
]
|
|
139
|
+
}
|
|
140
|
+
) })
|
|
141
|
+
}
|
|
142
|
+
),
|
|
143
|
+
legendPosition === "bottom" && renderLegend()
|
|
144
|
+
]
|
|
145
|
+
}
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
export {
|
|
149
|
+
BarGraph
|
|
150
|
+
};
|
|
151
|
+
//# sourceMappingURL=BarGraph.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BarGraph.js","sources":["../../../src/components/BarGraph/BarGraph.tsx"],"sourcesContent":["'use client';\n\nimport { useMemo, useState, useEffect } from 'react';\nimport {\n ResponsiveContainer,\n BarChart,\n Bar,\n XAxis,\n YAxis,\n CartesianGrid,\n Tooltip,\n} from 'recharts';\nimport { Typography } from '../Typography/Typography';\nimport { Stack } from '../Stack/Stack';\nimport { LineGraphTooltip } from '../LineGraph/LineGraphTooltip';\nimport { LineGraphLegend } from '../LineGraph/LineGraphLegend';\nimport {\n getSeriesColor,\n formatAxisTick,\n validateSeries,\n transformToBarChartData,\n} from '../LineGraph/lineGraphUtils';\nimport { BarGraphSkeleton } from './BarGraphSkeleton';\n\nexport interface BarGraphDataPoint {\n /** Category label rendered on the X axis */\n x: string | number;\n /** Numeric value rendered as bar height */\n y: number;\n}\n\nexport interface BarGraphSeries {\n /** Unique identifier for this series */\n id: string;\n /** Display label shown in legend and tooltip */\n label: string;\n /** Data points — x is the category label, y is the numeric value */\n data: BarGraphDataPoint[];\n /**\n * Optional color override. Must be a CSS color or Jiwambe CSS variable\n * e.g. 'var(--color-green-500)'. Falls back to SERIES_COLORS palette.\n */\n color?: string;\n /** Hide this series from the chart but keep it in the legend */\n hidden?: boolean;\n}\n\nexport interface BarGraphProps {\n /** Array of data series to display */\n series: BarGraphSeries[];\n /** Optional title displayed above the chart */\n title?: string;\n /** Optional description displayed below the title */\n description?: string;\n /** Label for the X-axis */\n xAxisLabel?: string;\n /** Label for the Y-axis */\n yAxisLabel?: string;\n /** Custom formatter for X-axis ticks */\n xTickFormatter?: (value: string | number) => string;\n /** Custom formatter for Y-axis ticks */\n yTickFormatter?: (value: number) => string;\n /** Custom formatter for tooltip values and labels */\n tooltipValueFormatter?: (value: number, seriesLabel: string) => string;\n /** height of the chart in px. @default 320 */\n height?: number;\n /** Whether the chart is in a loading state */\n loading?: boolean;\n /** Whether to show the background grid. @default true */\n showGrid?: boolean;\n /** Position of the legend. @default 'bottom' */\n legendPosition?: 'top' | 'bottom' | 'none';\n /** Whether to allow toggling series visibility via the legend. @default true */\n interactiveLegend?: boolean;\n /** Callback fired when a bar is clicked */\n onBarClick?: (point: BarGraphDataPoint, series: BarGraphSeries) => void;\n /** Width of each bar in px. @default 24 */\n barSize?: number;\n /** Corner radius applied to the top of each bar. @default 4 */\n barRadius?: number;\n /** Gap between bar groups as a fraction or number. @default '20%' */\n barCategoryGap?: string | number;\n /** Additional CSS classes */\n className?: string;\n}\n\n/**\n * A themed Bar Graph component for Jiwambe.\n * Renders grouped or single series data using SVG-based Recharts.\n * Integrates with design tokens for colors, spacing, and typography.\n */\nexport function BarGraph({\n series,\n title,\n description,\n xAxisLabel,\n yAxisLabel,\n xTickFormatter,\n yTickFormatter,\n tooltipValueFormatter,\n height = 320,\n loading = false,\n showGrid = true,\n legendPosition = 'bottom',\n interactiveLegend = true,\n onBarClick,\n barSize = 24,\n barRadius = 4,\n barCategoryGap = '20%',\n className = '',\n}: BarGraphProps) {\n const [mounted, setMounted] = useState(false);\n const [hiddenIds, setHiddenIds] = useState<string[]>([]);\n\n // Hydration safety\n useEffect(() => {\n setMounted(true);\n }, []);\n\n // Validation\n useEffect(() => {\n validateSeries(series as any);\n }, [series]);\n\n // Data transformation for Recharts\n const chartData = useMemo(() => transformToBarChartData(series), [series]);\n\n const handleToggle = (id: string) => {\n setHiddenIds((prev) =>\n prev.includes(id) ? prev.filter((item) => item !== id) : [...prev, id]\n );\n };\n\n if (loading) {\n return (\n <BarGraphSkeleton height={height} showTitle={!!(title || description)} />\n );\n }\n\n const renderLegend = () => (\n <LineGraphLegend\n series={series as any}\n hiddenIds={hiddenIds}\n onToggle={handleToggle}\n interactive={interactiveLegend}\n />\n );\n\n return (\n <figure\n role=\"figure\"\n aria-label={title ?? 'Bar graph'}\n className={['flex flex-col w-full jiwambe-bar-graph', className]\n .filter(Boolean)\n .join(' ')}\n >\n {(title || description) && (\n <Stack spacing=\"space-1\" className=\"mb-space-4\">\n {title && <Typography variant=\"title-md\" className=\"font-bold text-text-primary\">{title}</Typography>}\n {description && <Typography variant=\"text-xs\" className=\"text-text-secondary\">{description}</Typography>}\n </Stack>\n )}\n\n {legendPosition === 'top' && renderLegend()}\n\n <div \n style={{ height: `${height}px`, width: '100%', minWidth: 0, minHeight: 0 }} \n className=\"relative\"\n >\n {mounted && (\n <ResponsiveContainer width=\"100%\" height=\"100%\">\n <BarChart\n data={chartData}\n margin={{ top: 10, right: 10, left: 0, bottom: 0 }}\n barCategoryGap={barCategoryGap}\n >\n {showGrid && (\n <CartesianGrid\n strokeDasharray=\"3 3\"\n vertical={false}\n stroke=\"var(--color-neutral-200, #E5E5E5)\"\n />\n )}\n \n <XAxis\n dataKey=\"x\"\n axisLine={false}\n tickLine={false}\n tick={{ fill: 'var(--color-neutral-600, #4B5563)', fontSize: 12 }}\n tickFormatter={xTickFormatter || formatAxisTick}\n label={xAxisLabel ? { value: xAxisLabel, position: 'insideBottom', offset: -5 } : undefined}\n dy={10}\n />\n \n <YAxis\n axisLine={false}\n tickLine={false}\n tick={{ fill: 'var(--color-neutral-600, #4B5563)', fontSize: 12 }}\n tickFormatter={yTickFormatter}\n label={yAxisLabel ? { value: yAxisLabel, angle: -90, position: 'insideLeft' } : undefined}\n />\n\n <Tooltip\n content={\n <LineGraphTooltip tooltipValueFormatter={tooltipValueFormatter} />\n }\n cursor={{ fill: 'var(--color-neutral-100, #F3F4F6)', opacity: 0.4 }}\n />\n\n {series.map((s, index) => {\n if (hiddenIds.includes(s.id) || s.hidden) return null;\n \n return (\n <Bar\n key={s.id}\n dataKey={s.id}\n name={s.label}\n fill={getSeriesColor(s as any, index)}\n barSize={barSize}\n radius={[barRadius, barRadius, 0, 0]}\n onClick={(data) => {\n if (onBarClick) {\n const point = s.data.find(p => p.x === data.x);\n if (point) onBarClick(point, s);\n }\n }}\n />\n );\n })}\n </BarChart>\n </ResponsiveContainer>\n )}\n </div>\n\n {legendPosition === 'bottom' && renderLegend()}\n </figure>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;AA2FO;AAAkB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACS;AACC;AACC;AACM;AACG;AACpB;AACU;AACE;AACK;AAEnB;AACE;AACA;AAGA;AACE;AAAe;AAIjB;AACE;AAA4B;AAI9B;AAEA;AACE;AAAA;AACuE;AAAA;AAIzE;AACE;AACyE;AAI3E;AACE;AAAC;AAAA;AACC;AACA;AACU;AACG;AAAA;AAIjB;AACE;AAAC;AAAA;AACM;AACgB;AAGV;AAET;AAEG;AAAuF;AACG;AAC7F;AAG2B;AAE7B;AAAC;AAAA;AACwE;AAC7D;AAIN;AAAC;AAAA;AACO;AACyC;AAC/C;AAEC;AACC;AAAC;AAAA;AACiB;AACN;AACH;AAAA;AAAA;AAIX;AAAC;AAAA;AACS;AACE;AACA;AACmD;AAC5B;AACiD;AAC9E;AAAA;AAAA;AAGN;AAAC;AAAA;AACW;AACA;AACmD;AAC9C;AACiE;AAAA;AAAA;AAGlF;AAAC;AAAA;AAEmE;AAEJ;AAAI;AAAA;AAIlE;AAEA;AACE;AAAC;AAAA;AAEY;AACH;AAC4B;AACpC;AACmC;AAEjC;AACE;AACA;AAA8B;AAChC;AACF;AAAA;AAXO;AAAA;AAcZ;AAAA;AAAA;AAEL;AAAA;AAAA;AAI4B;AAAa;AAAA;AAGnD;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=BarGraph.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BarGraph.test.d.ts","sourceRoot":"","sources":["../../../src/components/BarGraph/BarGraph.test.tsx"],"names":[],"mappings":"AAKA,OAAO,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface BarGraphSkeletonProps {
|
|
2
|
+
/** Chart height in px. @default 320 */
|
|
3
|
+
height?: number;
|
|
4
|
+
/** Whether to show the title block. @default true */
|
|
5
|
+
showTitle?: boolean;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Loading skeleton for the BarGraph component.
|
|
9
|
+
* Mirrors the structure of a rendered column chart.
|
|
10
|
+
*/
|
|
11
|
+
export declare function BarGraphSkeleton({ height, showTitle }: BarGraphSkeletonProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
//# sourceMappingURL=BarGraphSkeleton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BarGraphSkeleton.d.ts","sourceRoot":"","sources":["../../../src/components/BarGraph/BarGraphSkeleton.tsx"],"names":[],"mappings":"AAKA,MAAM,WAAW,qBAAqB;IACpC,uCAAuC;IACvC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qDAAqD;IACrD,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,MAAY,EAAE,SAAgB,EAAE,EAAE,qBAAqB,2CAgCzF"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Skeleton } from "../Skeleton/Skeleton.js";
|
|
4
|
+
import { Stack } from "../Stack/Stack.js";
|
|
5
|
+
function BarGraphSkeleton({ height = 320, showTitle = true }) {
|
|
6
|
+
return /* @__PURE__ */ jsxs(Stack, { spacing: "space-4", className: "w-full", children: [
|
|
7
|
+
showTitle && /* @__PURE__ */ jsxs(Stack, { spacing: "space-1", children: [
|
|
8
|
+
/* @__PURE__ */ jsx(Skeleton, { width: "40%", height: "1.5rem", radius: "xs" }),
|
|
9
|
+
/* @__PURE__ */ jsx(Skeleton, { width: "60%", height: "1rem", radius: "xs" })
|
|
10
|
+
] }),
|
|
11
|
+
/* @__PURE__ */ jsx(
|
|
12
|
+
"div",
|
|
13
|
+
{
|
|
14
|
+
className: "flex items-end gap-space-3 px-space-4 border-b border-border-light",
|
|
15
|
+
style: { height: `${height}px` },
|
|
16
|
+
children: [60, 85, 45, 90, 70, 55].map((h, i) => /* @__PURE__ */ jsx(
|
|
17
|
+
Skeleton,
|
|
18
|
+
{
|
|
19
|
+
style: { height: `${h}%` },
|
|
20
|
+
className: "flex-1 rounded-t-rad-sm"
|
|
21
|
+
},
|
|
22
|
+
i
|
|
23
|
+
))
|
|
24
|
+
}
|
|
25
|
+
),
|
|
26
|
+
/* @__PURE__ */ jsxs(Stack, { direction: "row", spacing: "space-4", justifyContent: "center", children: [
|
|
27
|
+
/* @__PURE__ */ jsx(Skeleton, { width: "5rem", height: "1.25rem", radius: "rounded" }),
|
|
28
|
+
/* @__PURE__ */ jsx(Skeleton, { width: "6rem", height: "1.25rem", radius: "rounded" }),
|
|
29
|
+
/* @__PURE__ */ jsx(Skeleton, { width: "5rem", height: "1.25rem", radius: "rounded" })
|
|
30
|
+
] })
|
|
31
|
+
] });
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
BarGraphSkeleton
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=BarGraphSkeleton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BarGraphSkeleton.js","sources":["../../../src/components/BarGraph/BarGraphSkeleton.tsx"],"sourcesContent":["'use client';\n\nimport { Skeleton } from '../Skeleton/Skeleton';\nimport { Stack } from '../Stack/Stack';\n\nexport interface BarGraphSkeletonProps {\n /** Chart height in px. @default 320 */\n height?: number;\n /** Whether to show the title block. @default true */\n showTitle?: boolean;\n}\n\n/**\n * Loading skeleton for the BarGraph component.\n * Mirrors the structure of a rendered column chart.\n */\nexport function BarGraphSkeleton({ height = 320, showTitle = true }: BarGraphSkeletonProps) {\n return (\n <Stack spacing=\"space-4\" className=\"w-full\">\n {showTitle && (\n <Stack spacing=\"space-1\">\n <Skeleton width=\"40%\" height=\"1.5rem\" radius=\"xs\" />\n <Skeleton width=\"60%\" height=\"1rem\" radius=\"xs\" />\n </Stack>\n )}\n\n {/* Main chart area placeholder: array of varying-height columns */}\n <div \n className=\"flex items-end gap-space-3 px-space-4 border-b border-border-light\" \n style={{ height: `${height}px` }}\n >\n {[60, 85, 45, 90, 70, 55].map((h, i) => (\n <Skeleton \n key={i} \n style={{ height: `${h}%` }} \n className=\"flex-1 rounded-t-rad-sm\" \n />\n ))}\n </div>\n\n {/* Legend placeholder */}\n <Stack direction=\"row\" spacing=\"space-4\" justifyContent=\"center\">\n <Skeleton width=\"5rem\" height=\"1.25rem\" radius=\"rounded\" />\n <Skeleton width=\"6rem\" height=\"1.25rem\" radius=\"rounded\" />\n <Skeleton width=\"5rem\" height=\"1.25rem\" radius=\"rounded\" />\n </Stack>\n </Stack>\n );\n}\n"],"names":[],"mappings":";;;;AAgBO;AACL;AAEK;AAEG;AAAkD;AACF;AAClD;AAIF;AAAC;AAAA;AACW;AACgB;AAGxB;AAAC;AAAA;AAEsB;AACX;AAAA;AAFL;AAIR;AAAA;AAAA;AAKD;AAAyD;AACA;AACA;AAC3D;AAGN;;;;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Register Vitest matchers.
|
|
3
|
+
*/
|
|
4
|
+
declare module 'vitest' {
|
|
5
|
+
interface Assertion<T = any> {
|
|
6
|
+
toHaveNoViolations(): Promise<T>;
|
|
7
|
+
toBeInTheDocument(): T;
|
|
8
|
+
toHaveTextContent(text: string | RegExp): T;
|
|
9
|
+
toBeVisible(): T;
|
|
10
|
+
toHaveClass(...classNames: string[]): T;
|
|
11
|
+
toHaveAttribute(attr: string, value?: string): T;
|
|
12
|
+
toBeInstanceOf(cls: any): T;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=Box.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Box.test.d.ts","sourceRoot":"","sources":["../../../src/components/Box/Box.test.tsx"],"names":[],"mappings":"AAUA,OAAO,2BAA2B,CAAC;AAEnC;;GAEG;AACH,OAAO,QAAQ,QAAQ,CAAC;IACtB,UAAU,SAAS,CAAC,CAAC,GAAG,GAAG;QACzB,kBAAkB,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC;QACjC,iBAAiB,IAAI,CAAC,CAAC;QACvB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,CAAC,CAAC;QAC5C,WAAW,IAAI,CAAC,CAAC;QACjB,WAAW,CAAC,GAAG,UAAU,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC;QACxC,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC;QACjD,cAAc,CAAC,GAAG,EAAE,GAAG,GAAG,CAAC,CAAC;KAC7B;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Breadcrumb.d.ts","sourceRoot":"","sources":["../../../src/components/Breadcrumb/Breadcrumb.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Breadcrumb.d.ts","sourceRoot":"","sources":["../../../src/components/Breadcrumb/Breadcrumb.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,qCAAqC;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,yEAAyE;IACzE,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,OAAO,GAAG,SAAS,CAAC;AAEtD;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,wFAAwF;IACxF,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B;;;OAGG;IACH,SAAS,CAAC,EAAE,mBAAmB,CAAC;IAChC,yEAAyE;IACzE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kCAAkC;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qBAAqB;IACrB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAUD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,QAAgB,EAChB,WAAwB,EACxB,SAAmB,EACnB,YAAY,EAAE,SAAwB,EACtC,SAAc,EACd,KAAK,GACN,EAAE,eAAe,kDAwFjB"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import n from "../../node_modules/.pnpm/@jiwambe_icons@0.3.1_react@19.2.4/node_modules/@jiwambe/icons/dist/icons/ChevronRight.js";
|
|
3
|
+
import { Link } from "../Link/Link.js";
|
|
4
|
+
import { Icon } from "../Icon/Icon.js";
|
|
5
|
+
const separatorSymbol = {
|
|
6
|
+
slash: "/",
|
|
7
|
+
chevron: ""
|
|
8
|
+
};
|
|
9
|
+
const gapClass = "gap-x-1.5 gap-y-1";
|
|
10
|
+
function Breadcrumb({
|
|
11
|
+
items,
|
|
12
|
+
truncate = false,
|
|
13
|
+
linkVariant = "tertiary",
|
|
14
|
+
separator = "slash",
|
|
15
|
+
"aria-label": ariaLabel = "Breadcrumb",
|
|
16
|
+
className = "",
|
|
17
|
+
style
|
|
18
|
+
}) {
|
|
19
|
+
if (items.length === 0) return null;
|
|
20
|
+
const showTruncated = truncate && items.length > 3;
|
|
21
|
+
const displayItems = showTruncated ? [items[0], items[items.length - 2], items[items.length - 1]] : items;
|
|
22
|
+
const baseClasses = [
|
|
23
|
+
"flex flex-wrap items-center font-normal leading-[1.4] tracking-[0.16px] whitespace-nowrap",
|
|
24
|
+
gapClass,
|
|
25
|
+
className
|
|
26
|
+
].filter(Boolean).join(" ");
|
|
27
|
+
const renderSeparator = () => /* @__PURE__ */ jsx(
|
|
28
|
+
"span",
|
|
29
|
+
{
|
|
30
|
+
className: "shrink-0 text-text-sm text-text-disabled select-none",
|
|
31
|
+
"aria-hidden": true,
|
|
32
|
+
children: separator === "chevron" ? /* @__PURE__ */ jsx(
|
|
33
|
+
Icon,
|
|
34
|
+
{
|
|
35
|
+
icon: /* @__PURE__ */ jsx(n, {}),
|
|
36
|
+
size: 16,
|
|
37
|
+
className: "text-text-disabled",
|
|
38
|
+
"aria-hidden": true
|
|
39
|
+
}
|
|
40
|
+
) : separatorSymbol[separator]
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
const renderItem = (item, index, isLast) => {
|
|
44
|
+
const isCurrent = isLast && item.href == null;
|
|
45
|
+
return /* @__PURE__ */ jsxs(
|
|
46
|
+
"li",
|
|
47
|
+
{
|
|
48
|
+
className: `flex items-center ${gapClass}`,
|
|
49
|
+
"aria-current": isCurrent ? "page" : void 0,
|
|
50
|
+
children: [
|
|
51
|
+
index > 0 && renderSeparator(),
|
|
52
|
+
item.href != null ? /* @__PURE__ */ jsx(
|
|
53
|
+
Link,
|
|
54
|
+
{
|
|
55
|
+
href: item.href,
|
|
56
|
+
variant: linkVariant,
|
|
57
|
+
size: "xs",
|
|
58
|
+
className: "underline decoration-solid",
|
|
59
|
+
children: item.label
|
|
60
|
+
}
|
|
61
|
+
) : /* @__PURE__ */ jsx("span", { className: "text-text-sm text-text-primary shrink-0", children: item.label })
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
`breadcrumb-${index}`
|
|
65
|
+
);
|
|
66
|
+
};
|
|
67
|
+
return /* @__PURE__ */ jsx("nav", { "aria-label": ariaLabel, className: baseClasses, style, children: /* @__PURE__ */ jsx("ol", { className: `flex flex-wrap items-center list-none p-0 m-0 ${gapClass}`, children: showTruncated ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
68
|
+
renderItem(displayItems[0], 0, false),
|
|
69
|
+
/* @__PURE__ */ jsxs("li", { className: `flex items-center ${gapClass}`, children: [
|
|
70
|
+
renderSeparator(),
|
|
71
|
+
/* @__PURE__ */ jsx(
|
|
72
|
+
"span",
|
|
73
|
+
{
|
|
74
|
+
className: "shrink-0 text-text-sm text-text-disabled",
|
|
75
|
+
"aria-hidden": true,
|
|
76
|
+
children: "..."
|
|
77
|
+
}
|
|
78
|
+
)
|
|
79
|
+
] }, "ellipsis"),
|
|
80
|
+
renderItem(displayItems[1], 1, false),
|
|
81
|
+
renderItem(displayItems[2], 2, true)
|
|
82
|
+
] }) : displayItems.map(
|
|
83
|
+
(item, index) => renderItem(item, index, index === displayItems.length - 1)
|
|
84
|
+
) }) });
|
|
85
|
+
}
|
|
86
|
+
export {
|
|
87
|
+
Breadcrumb
|
|
88
|
+
};
|
|
89
|
+
//# sourceMappingURL=Breadcrumb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Breadcrumb.js","sources":["../../../src/components/Breadcrumb/Breadcrumb.tsx"],"sourcesContent":["import React from 'react';\nimport { ChevronRight } from '@jiwambe/icons';\nimport { Link } from '../Link/Link';\nimport { Icon } from '../Icon/Icon';\nimport type { LinkVariant } from '../../types';\n\n/**\n * A single breadcrumb item. If `href` is provided, the item is rendered as a link;\n * otherwise it is the current page (last segment) and rendered as text with aria-current=\"page\".\n */\nexport interface BreadcrumbItem {\n /** Display label for the segment. */\n label: string;\n /** Optional URL. Omit for the current page (typically the last item). */\n href?: string;\n}\n\n/**\n * Visual style for the separator between breadcrumb items.\n * - 'slash' Forward slash (/) — matches design system default.\n * - 'chevron' Right-pointing chevron.\n */\nexport type BreadcrumbSeparator = 'slash' | 'chevron';\n\n/**\n * Props for the Breadcrumb component. Renders a WAI-ARIA compliant breadcrumb navigation.\n * Matches design: slash separators, optional truncation with ellipsis for long paths.\n */\nexport interface BreadcrumbProps {\n /** List of breadcrumb segments. Last item without `href` is treated as current page. */\n items: BreadcrumbItem[];\n /**\n * When true and there are more than 3 items, collapse the middle to \"...\" (e.g. Root ... Level-04 / Level-05).\n * @default false\n */\n truncate?: boolean;\n /**\n * Link variant for non-current segments. Use tertiary or secondary for muted breadcrumb links.\n * @default 'tertiary'\n */\n linkVariant?: LinkVariant;\n /**\n * Separator between items.\n * @default 'slash'\n */\n separator?: BreadcrumbSeparator;\n /** Accessible name for the navigation landmark. @default 'Breadcrumb' */\n 'aria-label'?: string;\n /** Additional CSS class names. */\n className?: string;\n /** Inline styles. */\n style?: React.CSSProperties;\n}\n\nconst separatorSymbol: Record<BreadcrumbSeparator, string> = {\n slash: '/',\n chevron: '',\n};\n\n/** Gap between items matches design spacing-04 (6px). */\nconst gapClass = 'gap-x-1.5 gap-y-1';\n\n/**\n * Renders a breadcrumb navigation with accessible structure (nav + list), slash or\n * chevron separators, and optional truncation (first ... second-to-last / current).\n * Matches design: links underlined, current page not underlined, separators in disabled color.\n *\n * @example\n * ```tsx\n * <Breadcrumb\n * items={[\n * { label: 'Root', href: '/' },\n * { label: 'Level-01', href: '/l1' },\n * { label: 'Level-02' },\n * ]}\n * />\n * <Breadcrumb items={manyItems} truncate />\n * ```\n */\nexport function Breadcrumb({\n items,\n truncate = false,\n linkVariant = 'tertiary',\n separator = 'slash',\n 'aria-label': ariaLabel = 'Breadcrumb',\n className = '',\n style,\n}: BreadcrumbProps) {\n if (items.length === 0) return null;\n\n const showTruncated =\n truncate && items.length > 3;\n const displayItems: BreadcrumbItem[] = showTruncated\n ? [items[0], items[items.length - 2], items[items.length - 1]]\n : items;\n\n const baseClasses = [\n 'flex flex-wrap items-center font-normal leading-[1.4] tracking-[0.16px] whitespace-nowrap',\n gapClass,\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n const renderSeparator = () => (\n <span\n className=\"shrink-0 text-text-sm text-text-disabled select-none\"\n aria-hidden\n >\n {separator === 'chevron' ? (\n <Icon\n icon={<ChevronRight />}\n size={16}\n className=\"text-text-disabled\"\n aria-hidden\n />\n ) : (\n separatorSymbol[separator]\n )}\n </span>\n );\n\n const renderItem = (item: BreadcrumbItem, index: number, isLast: boolean) => {\n const isCurrent = isLast && item.href == null;\n return (\n <li\n key={`breadcrumb-${index}`}\n className={`flex items-center ${gapClass}`}\n aria-current={isCurrent ? 'page' : undefined}\n >\n {index > 0 && renderSeparator()}\n {item.href != null ? (\n <Link\n href={item.href}\n variant={linkVariant}\n size=\"xs\"\n className=\"underline decoration-solid\"\n >\n {item.label}\n </Link>\n ) : (\n <span className=\"text-text-sm text-text-primary shrink-0\">\n {item.label}\n </span>\n )}\n </li>\n );\n };\n\n return (\n <nav aria-label={ariaLabel} className={baseClasses} style={style}>\n <ol className={`flex flex-wrap items-center list-none p-0 m-0 ${gapClass}`}>\n {showTruncated ? (\n <>\n {renderItem(displayItems[0], 0, false)}\n <li key=\"ellipsis\" className={`flex items-center ${gapClass}`}>\n {renderSeparator()}\n <span\n className=\"shrink-0 text-text-sm text-text-disabled\"\n aria-hidden\n >\n ...\n </span>\n </li>\n {renderItem(displayItems[1], 1, false)}\n {renderItem(displayItems[2], 2, true)}\n </>\n ) : (\n displayItems.map((item, index) =>\n renderItem(item, index, index === displayItems.length - 1),\n )\n )}\n </ol>\n </nav>\n );\n}\n"],"names":["ChevronRight"],"mappings":";;;;AAsDA,MAAM,kBAAuD;AAAA,EAC3D,OAAO;AAAA,EACP,SAAS;AACX;AAGA,MAAM,WAAW;AAmBV,SAAS,WAAW;AAAA,EACzB;AAAA,EACA,WAAW;AAAA,EACX,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,cAAc,YAAY;AAAA,EAC1B,YAAY;AAAA,EACZ;AACF,GAAoB;AAClB,MAAI,MAAM,WAAW,EAAG,QAAO;AAE/B,QAAM,gBACJ,YAAY,MAAM,SAAS;AAC7B,QAAM,eAAiC,gBACnC,CAAC,MAAM,CAAC,GAAG,MAAM,MAAM,SAAS,CAAC,GAAG,MAAM,MAAM,SAAS,CAAC,CAAC,IAC3D;AAEJ,QAAM,cAAc;AAAA,IAClB;AAAA,IACA;AAAA,IACA;AAAA,EAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG;AAEX,QAAM,kBAAkB,MACtB;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAU;AAAA,MACV,eAAW;AAAA,MAEV,wBAAc,YACb;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,0BAAOA,GAAA,EAAa;AAAA,UACpB,MAAM;AAAA,UACN,WAAU;AAAA,UACV,eAAW;AAAA,QAAA;AAAA,MAAA,IAGb,gBAAgB,SAAS;AAAA,IAAA;AAAA,EAAA;AAK/B,QAAM,aAAa,CAAC,MAAsB,OAAe,WAAoB;AAC3E,UAAM,YAAY,UAAU,KAAK,QAAQ;AACzC,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QAEC,WAAW,qBAAqB,QAAQ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