@pagamio/frontend-commons-lib 0.8.293 → 0.8.295

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.
@@ -0,0 +1,38 @@
1
+ /**
2
+ * @fileoverview ChartDetailsModal
3
+ *
4
+ * Standardized 3-tab modal shell for chart drill-down views.
5
+ * Provides Visual Chart, Data Table, and Analytics tabs with a consistent
6
+ * layout across all dashboards.
7
+ *
8
+ * @example
9
+ * ```tsx
10
+ * <ChartDetailsModal
11
+ * isOpen={isOpen}
12
+ * onClose={onClose}
13
+ * title="Top Products"
14
+ * chartContent={<BarChartV2 ... />}
15
+ * tableContent={<MyTable data={data} />}
16
+ * analyticsContent={<MyStats data={data} />}
17
+ * />
18
+ * ```
19
+ */
20
+ import * as React from 'react';
21
+ export interface ChartDetailsModalProps {
22
+ /** Whether the modal is open */
23
+ isOpen: boolean;
24
+ /** Callback to close the modal */
25
+ onClose: () => void;
26
+ /** Modal title (shown in header) */
27
+ title: string;
28
+ /** Content for the Visual Chart tab */
29
+ chartContent: React.ReactNode;
30
+ /** Content for the Data Table tab */
31
+ tableContent: React.ReactNode;
32
+ /** Content for the Analytics tab */
33
+ analyticsContent: React.ReactNode;
34
+ /** Modal width size — defaults to 7xl */
35
+ size?: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl' | '7xl';
36
+ }
37
+ declare const ChartDetailsModal: React.FC<ChartDetailsModalProps>;
38
+ export default ChartDetailsModal;
@@ -0,0 +1,27 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Modal } from '../../../components';
3
+ import { PagamioTabs } from '../../../components';
4
+ // =============================================================================
5
+ // COMPONENT
6
+ // =============================================================================
7
+ const ChartDetailsModal = ({ isOpen, onClose, title, chartContent, tableContent, analyticsContent, size = '7xl', }) => {
8
+ const tabs = [
9
+ {
10
+ id: 1,
11
+ title: 'Visual Chart',
12
+ content: _jsx("div", { className: "py-2", children: chartContent }),
13
+ },
14
+ {
15
+ id: 2,
16
+ title: 'Data Table',
17
+ content: _jsx("div", { className: "py-2", children: tableContent }),
18
+ },
19
+ {
20
+ id: 3,
21
+ title: 'Analytics',
22
+ content: _jsx("div", { className: "py-2", children: analyticsContent }),
23
+ },
24
+ ];
25
+ return (_jsx(Modal, { isOpen: isOpen, onClose: onClose, title: `${title} — Detailed Analysis`, size: size, children: _jsx(PagamioTabs, { tabs: tabs, defaultTab: 0, variant: "pills" }) }));
26
+ };
27
+ export default ChartDetailsModal;
@@ -0,0 +1,9 @@
1
+ import * as React from 'react';
2
+ export interface ChartExpandButtonProps {
3
+ /** Handler called when the button is clicked */
4
+ onClick: () => void;
5
+ /** Optional accessible label — defaults to "View Details" */
6
+ label?: string;
7
+ }
8
+ declare const ChartExpandButton: React.FC<ChartExpandButtonProps>;
9
+ export default ChartExpandButton;
@@ -0,0 +1,23 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /**
3
+ * @fileoverview ChartExpandButton
4
+ *
5
+ * Standardized icon button used to open chart detail modals.
6
+ * Renders in the DashboardCard `actions` slot (top-right of chart cards).
7
+ * Replaces all "View All" text links with a consistent icon button.
8
+ *
9
+ * @example
10
+ * ```tsx
11
+ * // Inside a DashboardWrapperV2 ChartConfig:
12
+ * action: <ChartExpandButton onClick={() => setIsOpen(true)} />,
13
+ * ```
14
+ */
15
+ import { HiOutlineExternalLink } from 'react-icons/hi';
16
+ import { IconButton } from '../../../components';
17
+ // =============================================================================
18
+ // COMPONENT
19
+ // =============================================================================
20
+ const ChartExpandButton = ({ onClick, label = 'View Details' }) => {
21
+ return _jsx(IconButton, { icon: HiOutlineExternalLink, label: label, variant: "ghost", size: "sm", onClick: onClick });
22
+ };
23
+ export default ChartExpandButton;
@@ -11,3 +11,7 @@ export { DashboardStatCardRow, DashboardStatCard } from './DashboardStatCardRow'
11
11
  export type { DashboardStatCardRowProps, DashboardStatCardProps } from './DashboardStatCardRow';
12
12
  export { DashboardChartRow, ChartRenderer } from './DashboardChartRow';
13
13
  export type { DashboardChartRowProps, ChartRendererProps } from './DashboardChartRow';
14
+ export { default as ChartDetailsModal } from './ChartDetailsModal';
15
+ export type { ChartDetailsModalProps } from './ChartDetailsModal';
16
+ export { default as ChartExpandButton } from './ChartExpandButton';
17
+ export type { ChartExpandButtonProps } from './ChartExpandButton';
@@ -12,3 +12,7 @@ export { DashboardWrapperV2 } from './DashboardWrapperV2';
12
12
  export { DashboardStatCardRow, DashboardStatCard } from './DashboardStatCardRow';
13
13
  // Chart Row
14
14
  export { DashboardChartRow, ChartRenderer } from './DashboardChartRow';
15
+ // Chart Details Modal — standardized 3-tab drill-down shell
16
+ export { default as ChartDetailsModal } from './ChartDetailsModal';
17
+ // Chart Expand Button — icon button for opening chart detail modals
18
+ export { default as ChartExpandButton } from './ChartExpandButton';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pagamio/frontend-commons-lib",
3
3
  "description": "Pagamio library for Frontend reusable components like the form engine and table container",
4
- "version": "0.8.293",
4
+ "version": "0.8.295",
5
5
  "publishConfig": {
6
6
  "access": "public",
7
7
  "provenance": false