@pibit.ai/cure-design-system 0.3.17 → 0.3.20
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/applications/schedule-calendar/index.d.ts +4 -0
- package/dist/applications/schedule-calendar/index.d.ts.map +1 -0
- package/dist/applications/schedule-calendar/schedule-calendar.d.ts +3 -0
- package/dist/applications/schedule-calendar/schedule-calendar.d.ts.map +1 -0
- package/dist/applications/schedule-calendar/schedule-calendar.js +202 -0
- package/dist/applications/schedule-calendar/types.d.ts +56 -0
- package/dist/applications/schedule-calendar/types.d.ts.map +1 -0
- package/dist/applications/schedule-calendar/types.js +40 -0
- package/dist/applications/schedule-calendar/utils.d.ts +21 -0
- package/dist/applications/schedule-calendar/utils.d.ts.map +1 -0
- package/dist/applications/schedule-calendar/utils.js +152 -0
- package/dist/applications/schedule-calendar/utils.test.d.ts +2 -0
- package/dist/applications/schedule-calendar/utils.test.d.ts.map +1 -0
- package/dist/assets/icons/group-by.svg.js +4 -0
- package/dist/assets/icons/reorder-dots-new.svg.js +4 -0
- package/dist/assets/icons/reorder-dots.svg.js +4 -0
- package/dist/assets/icons/resize-1.svg.js +4 -0
- package/dist/assets/icons/resize-2.svg.js +4 -0
- package/dist/assets/icons/resize-4.svg.js +4 -0
- package/dist/assets/icons/resize-5.svg.js +4 -0
- package/dist/assets/icons/show-summary.svg.js +4 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +132 -59
- package/dist/node_modules/framer-motion/dist/es/components/Reorder/Group.js +46 -0
- package/dist/node_modules/framer-motion/dist/es/components/Reorder/Item.js +34 -0
- package/dist/node_modules/framer-motion/dist/es/components/Reorder/utils/auto-scroll.js +65 -0
- package/dist/node_modules/framer-motion/dist/es/components/Reorder/utils/check-reorder.js +17 -0
- package/dist/node_modules/framer-motion/dist/es/context/ReorderContext.js +5 -0
- package/dist/node_modules/framer-motion/dist/es/gestures/drag/use-drag-controls.js +70 -0
- package/dist/node_modules/framer-motion/dist/es/value/use-combine-values.js +15 -0
- package/dist/node_modules/framer-motion/dist/es/value/use-computed.js +10 -0
- package/dist/node_modules/framer-motion/dist/es/value/use-motion-value.js +15 -0
- package/dist/node_modules/framer-motion/dist/es/value/use-transform.js +23 -0
- package/dist/node_modules/motion-dom/dist/es/projection/node/create-projection-node.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/utils/transform.js +8 -0
- package/dist/node_modules/motion-dom/dist/es/value/index.js +21 -18
- package/dist/node_modules/motion-utils/dist/es/array.js +15 -6
- package/dist/patterns/table/TablePagination.d.ts +23 -0
- package/dist/patterns/table/TablePagination.d.ts.map +1 -0
- package/dist/patterns/table/TablePagination.js +60 -0
- package/dist/patterns/table/TableWrapper.d.ts +2 -72
- package/dist/patterns/table/TableWrapper.d.ts.map +1 -1
- package/dist/patterns/table/TableWrapper.js +730 -75
- package/dist/patterns/table/index.d.ts +11 -1
- package/dist/patterns/table/index.d.ts.map +1 -1
- package/dist/patterns/table/pagination-base.d.ts +78 -0
- package/dist/patterns/table/pagination-base.d.ts.map +1 -0
- package/dist/patterns/table/pagination-base.js +127 -0
- package/dist/patterns/table/pagination-card.d.ts +9 -0
- package/dist/patterns/table/pagination-card.d.ts.map +1 -0
- package/dist/patterns/table/pagination-card.js +65 -0
- package/dist/patterns/table/row-height-icons.d.ts +9 -0
- package/dist/patterns/table/row-height-icons.d.ts.map +1 -0
- package/dist/patterns/table/row-height-icons.js +13 -0
- package/dist/patterns/table/storyHelpers/mockToolbarSlots.d.ts +7 -0
- package/dist/patterns/table/storyHelpers/mockToolbarSlots.d.ts.map +1 -0
- package/dist/patterns/table/storyHelpers/useMockTableState.d.ts +31 -0
- package/dist/patterns/table/storyHelpers/useMockTableState.d.ts.map +1 -0
- package/dist/patterns/table/storyHelpers/useMockTableToolbar.d.ts +3 -0
- package/dist/patterns/table/storyHelpers/useMockTableToolbar.d.ts.map +1 -0
- package/dist/patterns/table/table.d.ts +10 -13
- package/dist/patterns/table/table.d.ts.map +1 -1
- package/dist/patterns/table/table.js +235 -312
- package/dist/patterns/table/toolbar/AlignDropdown.d.ts +11 -0
- package/dist/patterns/table/toolbar/AlignDropdown.d.ts.map +1 -0
- package/dist/patterns/table/toolbar/AlignDropdown.js +77 -0
- package/dist/patterns/table/toolbar/BasicSortPanel.d.ts +6 -0
- package/dist/patterns/table/toolbar/BasicSortPanel.d.ts.map +1 -0
- package/dist/patterns/table/toolbar/BulkActionBar.d.ts +12 -0
- package/dist/patterns/table/toolbar/BulkActionBar.d.ts.map +1 -0
- package/dist/patterns/table/toolbar/BulkActionBar.js +62 -0
- package/dist/patterns/table/toolbar/ColumnHeaderMenu.d.ts +41 -0
- package/dist/patterns/table/toolbar/ColumnHeaderMenu.d.ts.map +1 -0
- package/dist/patterns/table/toolbar/ColumnHeaderMenu.js +171 -0
- package/dist/patterns/table/toolbar/GroupByDropdown.d.ts +11 -0
- package/dist/patterns/table/toolbar/GroupByDropdown.d.ts.map +1 -0
- package/dist/patterns/table/toolbar/GroupByDropdown.js +80 -0
- package/dist/patterns/table/toolbar/HideFieldsDropdown.d.ts +13 -0
- package/dist/patterns/table/toolbar/HideFieldsDropdown.d.ts.map +1 -0
- package/dist/patterns/table/toolbar/HideFieldsDropdown.js +180 -0
- package/dist/patterns/table/toolbar/LegacySortFilterTools.d.ts +9 -0
- package/dist/patterns/table/toolbar/LegacySortFilterTools.d.ts.map +1 -0
- package/dist/patterns/table/toolbar/RowActionsMenu.d.ts +19 -0
- package/dist/patterns/table/toolbar/RowActionsMenu.d.ts.map +1 -0
- package/dist/patterns/table/toolbar/RowActionsMenu.js +84 -0
- package/dist/patterns/table/toolbar/RowHeightDropdown.d.ts +9 -0
- package/dist/patterns/table/toolbar/RowHeightDropdown.d.ts.map +1 -0
- package/dist/patterns/table/toolbar/RowHeightDropdown.js +60 -0
- package/dist/patterns/table/toolbar/ShowSummaryDropdown.d.ts +8 -0
- package/dist/patterns/table/toolbar/ShowSummaryDropdown.d.ts.map +1 -0
- package/dist/patterns/table/toolbar/ShowSummaryDropdown.js +22 -0
- package/dist/patterns/table/toolbar/SummaryFooter.d.ts +16 -0
- package/dist/patterns/table/toolbar/SummaryFooter.d.ts.map +1 -0
- package/dist/patterns/table/toolbar/SummaryFooter.js +83 -0
- package/dist/patterns/table/toolbar/TableToolbar.d.ts +55 -0
- package/dist/patterns/table/toolbar/TableToolbar.d.ts.map +1 -0
- package/dist/patterns/table/toolbar/TableToolbar.js +234 -0
- package/dist/patterns/table/toolbar/ToolbarRadio.d.ts +18 -0
- package/dist/patterns/table/toolbar/ToolbarRadio.d.ts.map +1 -0
- package/dist/patterns/table/toolbar/ToolbarRadio.js +63 -0
- package/dist/patterns/table/toolbar/index.d.ts +24 -0
- package/dist/patterns/table/toolbar/index.d.ts.map +1 -0
- package/dist/patterns/table/toolbar/legacyToolbarTypes.d.ts +69 -0
- package/dist/patterns/table/toolbar/legacyToolbarTypes.d.ts.map +1 -0
- package/dist/patterns/table/toolbar/tableToolbarHelpers.d.ts +35 -0
- package/dist/patterns/table/toolbar/tableToolbarHelpers.d.ts.map +1 -0
- package/dist/patterns/table/toolbar/tableToolbarHelpers.js +259 -0
- package/dist/patterns/table/toolbar/tableToolbarHelpers.test.d.ts +2 -0
- package/dist/patterns/table/toolbar/tableToolbarHelpers.test.d.ts.map +1 -0
- package/dist/patterns/table/toolbar/toolbarExtensions.d.ts +12 -0
- package/dist/patterns/table/toolbar/toolbarExtensions.d.ts.map +1 -0
- package/dist/patterns/table/toolbar/toolbarExtensions.js +18 -0
- package/dist/patterns/table/toolbar-icons.d.ts +8 -0
- package/dist/patterns/table/toolbar-icons.d.ts.map +1 -0
- package/dist/patterns/table/toolbar-icons.js +13 -0
- package/dist/patterns/table/types.d.ts +141 -0
- package/dist/patterns/table/types.d.ts.map +1 -0
- package/dist/patterns/table/useGridKeyboardNavigation.d.ts +38 -0
- package/dist/patterns/table/useGridKeyboardNavigation.d.ts.map +1 -0
- package/dist/patterns/table/useGridKeyboardNavigation.js +65 -0
- package/dist/primitives/checkbox/checkbox.d.ts +2 -2
- package/dist/primitives/checkbox/checkbox.d.ts.map +1 -1
- package/dist/primitives/dropdown/dropdown.d.ts +32 -0
- package/dist/primitives/dropdown/dropdown.d.ts.map +1 -0
- package/dist/primitives/dropdown/dropdown.js +118 -0
- package/dist/primitives/dropdown/index.d.ts +2 -0
- package/dist/primitives/dropdown/index.d.ts.map +1 -0
- package/dist/primitives/select/ExpandableSearchInput.d.ts +5 -1
- package/dist/primitives/select/ExpandableSearchInput.d.ts.map +1 -1
- package/dist/primitives/select/ExpandableSearchInput.js +80 -77
- package/dist/primitives/shimmer/index.d.ts +2 -0
- package/dist/primitives/shimmer/index.d.ts.map +1 -0
- package/dist/primitives/shimmer/shimmer.d.ts +24 -0
- package/dist/primitives/shimmer/shimmer.d.ts.map +1 -0
- package/dist/primitives/shimmer/shimmer.js +37 -0
- package/dist/primitives/snackbar/index.d.ts +2 -0
- package/dist/primitives/snackbar/index.d.ts.map +1 -0
- package/dist/primitives/snackbar/snackbar.d.ts +27 -0
- package/dist/primitives/snackbar/snackbar.d.ts.map +1 -0
- package/dist/primitives/snackbar/snackbar.js +107 -0
- package/dist/styles/components.css +1 -1
- package/dist/styles/theme.css +1 -1
- package/package.json +4 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type TablePaginationConfig = {
|
|
2
|
+
currentPage: number;
|
|
3
|
+
pageSize: number;
|
|
4
|
+
totalPages: number;
|
|
5
|
+
totalItems: number;
|
|
6
|
+
onPageChange: (page: number) => void;
|
|
7
|
+
onPageSizeChange: (size: number | string) => void;
|
|
8
|
+
/** Whether pagination should actually render. Default: true. */
|
|
9
|
+
showPagination?: boolean;
|
|
10
|
+
};
|
|
11
|
+
export interface TablePaginationProps extends TablePaginationConfig {
|
|
12
|
+
loading?: boolean;
|
|
13
|
+
rootClassName?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Table footer pagination — page-size select, total count, and page controls.
|
|
17
|
+
* Matches the `TableWrapperPaginationConfig` contract used in platform-ui.
|
|
18
|
+
*/
|
|
19
|
+
export declare function TablePagination({ currentPage, pageSize, totalPages, totalItems, onPageChange, onPageSizeChange, showPagination, loading, rootClassName, }: TablePaginationProps): import("react/jsx-runtime").JSX.Element | null;
|
|
20
|
+
export declare namespace TablePagination {
|
|
21
|
+
var displayName: string;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=TablePagination.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TablePagination.d.ts","sourceRoot":"","sources":["../../../src/patterns/table/TablePagination.tsx"],"names":[],"mappings":"AAIA,MAAM,MAAM,qBAAqB,GAAG;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,gBAAgB,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;IAClD,gEAAgE;IAChE,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,MAAM,WAAW,oBAAqB,SAAQ,qBAAqB;IACjE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AASD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,EAC9B,WAAW,EACX,QAAQ,EACR,UAAU,EACV,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,cAAqB,EACrB,OAAe,EACf,aAAa,GACd,EAAE,oBAAoB,kDAwCtB;yBAlDe,eAAe"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { jsxs as a, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { cn as x } from "../../utils/cn.js";
|
|
3
|
+
import { PaginationCardDefault as f } from "./pagination-card.js";
|
|
4
|
+
import { Select as i } from "../../primitives/select/select.js";
|
|
5
|
+
const b = [
|
|
6
|
+
{ label: "10", id: "10" },
|
|
7
|
+
{ label: "20", id: "20" },
|
|
8
|
+
{ label: "50", id: "50" },
|
|
9
|
+
{ label: "100", id: "100" }
|
|
10
|
+
];
|
|
11
|
+
function h({
|
|
12
|
+
currentPage: n,
|
|
13
|
+
pageSize: s,
|
|
14
|
+
totalPages: o,
|
|
15
|
+
totalItems: l,
|
|
16
|
+
onPageChange: m,
|
|
17
|
+
onPageSizeChange: c,
|
|
18
|
+
showPagination: d = !0,
|
|
19
|
+
loading: r = !1,
|
|
20
|
+
rootClassName: p
|
|
21
|
+
}) {
|
|
22
|
+
return !d || l === 0 ? null : /* @__PURE__ */ a("div", { className: x("flex items-center justify-between border-t border-secondary pt-2", p), children: [
|
|
23
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
24
|
+
/* @__PURE__ */ e("p", { className: "text-xs font-normal text-tertiary", children: "Show rows per page" }),
|
|
25
|
+
/* @__PURE__ */ e(
|
|
26
|
+
i,
|
|
27
|
+
{
|
|
28
|
+
isDisabled: r,
|
|
29
|
+
size: "sm",
|
|
30
|
+
value: s.toString(),
|
|
31
|
+
items: b,
|
|
32
|
+
onSelectionChange: (t) => {
|
|
33
|
+
t != null && c(t);
|
|
34
|
+
},
|
|
35
|
+
className: "w-auto min-w-10",
|
|
36
|
+
popoverClassName: "w-20",
|
|
37
|
+
textStyles: "text-xs align-center",
|
|
38
|
+
children: (t) => /* @__PURE__ */ e(i.Item, { id: t.id, textStyles: "text-xs font-normal", children: t.label })
|
|
39
|
+
}
|
|
40
|
+
),
|
|
41
|
+
/* @__PURE__ */ a("p", { className: "ml-4 text-xs", children: [
|
|
42
|
+
/* @__PURE__ */ e("span", { className: "font-normal text-tertiary", children: "Total rows " }),
|
|
43
|
+
/* @__PURE__ */ e("span", { className: "font-medium text-primary", children: l.toLocaleString() })
|
|
44
|
+
] })
|
|
45
|
+
] }),
|
|
46
|
+
/* @__PURE__ */ e("div", { className: "relative", children: /* @__PURE__ */ e(
|
|
47
|
+
f,
|
|
48
|
+
{
|
|
49
|
+
loading: r,
|
|
50
|
+
page: n,
|
|
51
|
+
total: o,
|
|
52
|
+
onPageChange: m
|
|
53
|
+
}
|
|
54
|
+
) })
|
|
55
|
+
] });
|
|
56
|
+
}
|
|
57
|
+
h.displayName = "TablePagination";
|
|
58
|
+
export {
|
|
59
|
+
h as TablePagination
|
|
60
|
+
};
|
|
@@ -1,74 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
* Props for the TableWrapper component
|
|
4
|
-
*/
|
|
5
|
-
export type TableWrapperProps = {
|
|
6
|
-
/** Array of data items to display in the table */
|
|
7
|
-
data: any[];
|
|
8
|
-
/** Column configuration for the table */
|
|
9
|
-
columns: {
|
|
10
|
-
/** Column header label */
|
|
11
|
-
label: string;
|
|
12
|
-
/** Unique key for the column (maps to data property) */
|
|
13
|
-
key: string;
|
|
14
|
-
/** Make column sticky (left or right) */
|
|
15
|
-
sticky?: "left" | "right";
|
|
16
|
-
/** Offset for sticky positioning (in pixels) */
|
|
17
|
-
stickyOffset?: number;
|
|
18
|
-
/** Enable sorting for this column */
|
|
19
|
-
allowsSorting?: boolean;
|
|
20
|
-
/** Maximum width for the column */
|
|
21
|
-
maxWidth?: string;
|
|
22
|
-
}[];
|
|
23
|
-
/** Function to render cell content. Receives (key, value, item) and returns ReactNode */
|
|
24
|
-
renderRowCell: (key: string, val: any, item: any) => ReactNode;
|
|
25
|
-
/** Callback when a row is clicked */
|
|
26
|
-
onRowClick?: (item: any) => void;
|
|
27
|
-
/** Aria label for accessibility */
|
|
28
|
-
arialabel?: string;
|
|
29
|
-
/** Table size variant */
|
|
30
|
-
size?: "sm" | "md" | "xs";
|
|
31
|
-
/** Allow default prose styling on rows */
|
|
32
|
-
allowDefaultRowClass?: boolean;
|
|
33
|
-
/** Array of column keys that should have centered headers */
|
|
34
|
-
centeredHeaders?: string[];
|
|
35
|
-
/** Additional className for the table element */
|
|
36
|
-
tableClassName?: string;
|
|
37
|
-
/** Additional className for the header */
|
|
38
|
-
headerClassName?: string;
|
|
39
|
-
/** Additional className for the root container */
|
|
40
|
-
rootClassName?: string;
|
|
41
|
-
/** Remove borders between rows */
|
|
42
|
-
removeBorders?: boolean;
|
|
43
|
-
/** Function to determine if a row is expandable */
|
|
44
|
-
isRowExpandable?: (item: any) => boolean;
|
|
45
|
-
/** Function to render expanded row content */
|
|
46
|
-
renderExpandedContent?: (item: any) => ReactNode;
|
|
47
|
-
};
|
|
48
|
-
/**
|
|
49
|
-
* TableWrapper - A simplified wrapper around Table component with column-based API
|
|
50
|
-
*
|
|
51
|
-
* Provides an easier way to work with tables using a columns/data structure.
|
|
52
|
-
* Supports sticky columns, expandable rows, and custom cell rendering.
|
|
53
|
-
*
|
|
54
|
-
* @example
|
|
55
|
-
* ```tsx
|
|
56
|
-
* <TableWrapper
|
|
57
|
-
* data={users}
|
|
58
|
-
* columns={[
|
|
59
|
-
* { label: 'Name', key: 'name', allowsSorting: true },
|
|
60
|
-
* { label: 'Email', key: 'email' },
|
|
61
|
-
* { label: 'Actions', key: 'actions' },
|
|
62
|
-
* ]}
|
|
63
|
-
* renderRowCell={(key, val, item) => {
|
|
64
|
-
* if (key === 'name') return <span>{item.name}</span>;
|
|
65
|
-
* if (key === 'actions') return <button>Edit</button>;
|
|
66
|
-
* return val;
|
|
67
|
-
* }}
|
|
68
|
-
* onRowClick={(user) => console.log(user)}
|
|
69
|
-
* size="sm"
|
|
70
|
-
* />
|
|
71
|
-
* ```
|
|
72
|
-
*/
|
|
1
|
+
import { TableWrapperProps } from './types';
|
|
2
|
+
export type { BulkActionContext, ColumnConfig, TableWrapperEditChrome, TableWrapperPaginationConfig, TableWrapperProps, TableWrapperSelectedKeys, TableWrapperSelectionChange, TableWrapperToolbarConfig, } from './types';
|
|
73
3
|
export declare const TableWrapper: import('react').ForwardRefExoticComponent<TableWrapperProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
74
4
|
//# sourceMappingURL=TableWrapper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableWrapper.d.ts","sourceRoot":"","sources":["../../../src/patterns/table/TableWrapper.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TableWrapper.d.ts","sourceRoot":"","sources":["../../../src/patterns/table/TableWrapper.tsx"],"names":[],"mappings":"AAiCA,OAAO,KAAK,EAKR,iBAAiB,EAGpB,MAAM,SAAS,CAAC;AAUjB,YAAY,EACR,iBAAiB,EACjB,YAAY,EACZ,sBAAsB,EACtB,4BAA4B,EAC5B,iBAAiB,EACjB,wBAAwB,EACxB,2BAA2B,EAC3B,yBAAyB,GAC5B,MAAM,SAAS,CAAC;AA4GjB,eAAO,MAAM,YAAY,8GAy7BvB,CAAC"}
|