@yuno-payments/dashboard-design-system 2.8.6 → 2.8.8
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/components/molecules/data-table-cells/data-table-cell-wrapper.d.ts +32 -0
- package/dist/components/molecules/data-table-cells/data-table-cell-wrapper.js +7 -0
- package/dist/components/molecules/data-table-cells/index.d.ts +1 -0
- package/dist/index.esm.min.js +706 -703
- package/dist/index.js +189 -187
- package/dist/index.umd.min.js +12 -12
- package/package.json +1 -1
- package/registry/components-registry.json +43 -2
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Props for the DataTableCellWrapper component
|
|
4
|
+
*/
|
|
5
|
+
export interface DataTableCellWrapperProps {
|
|
6
|
+
/** The value to check for emptiness. Renders emptyState when null/undefined/'' or an empty array. */
|
|
7
|
+
value: unknown;
|
|
8
|
+
/** Content to render when value is non-empty */
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
/** Content to render when value is empty @default "-" */
|
|
11
|
+
emptyState?: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Wraps a custom table cell to enforce the standard empty-state ("-")
|
|
15
|
+
* across the design system. Use this for cells that render custom JSX
|
|
16
|
+
* (Badges, icon+text combos, switches, etc.) that don't fit one of the
|
|
17
|
+
* specialized DataTable*Cell components.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* <DataTableCellWrapper value={method}>
|
|
22
|
+
* <MethodTag method={method} />
|
|
23
|
+
* </DataTableCellWrapper>
|
|
24
|
+
*
|
|
25
|
+
* // Custom empty state
|
|
26
|
+
* <DataTableCellWrapper value={amount} emptyState="N/A">
|
|
27
|
+
* <CustomAmount value={amount} />
|
|
28
|
+
* </DataTableCellWrapper>
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
declare const DataTableCellWrapper: import('react').ForwardRefExoticComponent<DataTableCellWrapperProps & import('react').RefAttributes<HTMLSpanElement>>;
|
|
32
|
+
export { DataTableCellWrapper };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { j as t } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import { forwardRef as i } from "react";
|
|
3
|
+
const s = (r) => !!(r == null || typeof r == "string" && r.trim() === "" || Array.isArray(r) && r.length === 0), p = i(({ value: r, children: e, emptyState: n = "-" }, a) => s(r) ? /* @__PURE__ */ t.jsx("span", { ref: a, children: n }) : /* @__PURE__ */ t.jsx(t.Fragment, { children: e }));
|
|
4
|
+
p.displayName = "DataTableCellWrapper";
|
|
5
|
+
export {
|
|
6
|
+
p as DataTableCellWrapper
|
|
7
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { DataTableCellWrapper, type DataTableCellWrapperProps, } from './data-table-cell-wrapper';
|
|
1
2
|
export { DataTableTextCell, type DataTableTextCellProps, } from './data-table-text-cell';
|
|
2
3
|
export { DataTableCopyCell, type DataTableCopyCellProps, } from './data-table-copy-cell';
|
|
3
4
|
export { DataTableStatusCell, type DataTableStatusCellProps, type StatusMapEntry, } from './data-table-status-cell';
|