@hyddenlabs/hydn-ui 0.3.0-alpha.182 → 0.3.0-alpha.184
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/index.cjs +14 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -2
- package/dist/index.d.ts +8 -2
- package/dist/index.js +14 -5
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -2568,6 +2568,8 @@ type ColumnDef<T> = {
|
|
|
2568
2568
|
width?: string;
|
|
2569
2569
|
/** Text alignment for cells in this column */
|
|
2570
2570
|
align?: 'left' | 'center' | 'right';
|
|
2571
|
+
/** Whether text should wrap instead of truncating (useful for long strings) */
|
|
2572
|
+
wrapText?: boolean;
|
|
2571
2573
|
/** Custom render function for cell content (use as escape hatch when config options don't cover your use case) */
|
|
2572
2574
|
render?: (value: T[keyof T], row: T, index: number) => ReactNode;
|
|
2573
2575
|
/** Pre-built formatter for common data types */
|
|
@@ -2925,6 +2927,8 @@ type TableHeadCellProps = {
|
|
|
2925
2927
|
align?: 'left' | 'center' | 'right';
|
|
2926
2928
|
/** Scope attribute for accessibility (col for column headers, row for row headers) */
|
|
2927
2929
|
scope?: 'col' | 'row';
|
|
2930
|
+
/** Whether text should wrap instead of truncating */
|
|
2931
|
+
wrapText?: boolean;
|
|
2928
2932
|
} & HTMLAttributes<HTMLTableCellElement>;
|
|
2929
2933
|
type TableCellProps = {
|
|
2930
2934
|
/** Content of the cell */
|
|
@@ -2933,6 +2937,8 @@ type TableCellProps = {
|
|
|
2933
2937
|
className?: string;
|
|
2934
2938
|
/** Text alignment within the cell */
|
|
2935
2939
|
align?: 'left' | 'center' | 'right';
|
|
2940
|
+
/** Whether text should wrap instead of truncating */
|
|
2941
|
+
wrapText?: boolean;
|
|
2936
2942
|
} & HTMLAttributes<HTMLTableCellElement>;
|
|
2937
2943
|
/**
|
|
2938
2944
|
* Table - Semantic HTML table with consistent styling
|
|
@@ -2963,11 +2969,11 @@ declare function TableRow({ children, className, selected, ...props }: Readonly<
|
|
|
2963
2969
|
* - Includes proper scope attribute for accessibility
|
|
2964
2970
|
* - Default scope is 'col' for column headers
|
|
2965
2971
|
*/
|
|
2966
|
-
declare function TableHeadCell({ children, className, align, scope, ...props }: Readonly<TableHeadCellProps>): react_jsx_runtime.JSX.Element;
|
|
2972
|
+
declare function TableHeadCell({ children, className, align, scope, wrapText, ...props }: Readonly<TableHeadCellProps>): react_jsx_runtime.JSX.Element;
|
|
2967
2973
|
/**
|
|
2968
2974
|
* TableCell - Table data cell (td)
|
|
2969
2975
|
*/
|
|
2970
|
-
declare function TableCell({ children, className, align, ...props }: Readonly<TableCellProps>): react_jsx_runtime.JSX.Element;
|
|
2976
|
+
declare function TableCell({ children, className, align, wrapText, ...props }: Readonly<TableCellProps>): react_jsx_runtime.JSX.Element;
|
|
2971
2977
|
|
|
2972
2978
|
type AlertProps = {
|
|
2973
2979
|
/** The content to display inside the alert message */
|
package/dist/index.d.ts
CHANGED
|
@@ -2568,6 +2568,8 @@ type ColumnDef<T> = {
|
|
|
2568
2568
|
width?: string;
|
|
2569
2569
|
/** Text alignment for cells in this column */
|
|
2570
2570
|
align?: 'left' | 'center' | 'right';
|
|
2571
|
+
/** Whether text should wrap instead of truncating (useful for long strings) */
|
|
2572
|
+
wrapText?: boolean;
|
|
2571
2573
|
/** Custom render function for cell content (use as escape hatch when config options don't cover your use case) */
|
|
2572
2574
|
render?: (value: T[keyof T], row: T, index: number) => ReactNode;
|
|
2573
2575
|
/** Pre-built formatter for common data types */
|
|
@@ -2925,6 +2927,8 @@ type TableHeadCellProps = {
|
|
|
2925
2927
|
align?: 'left' | 'center' | 'right';
|
|
2926
2928
|
/** Scope attribute for accessibility (col for column headers, row for row headers) */
|
|
2927
2929
|
scope?: 'col' | 'row';
|
|
2930
|
+
/** Whether text should wrap instead of truncating */
|
|
2931
|
+
wrapText?: boolean;
|
|
2928
2932
|
} & HTMLAttributes<HTMLTableCellElement>;
|
|
2929
2933
|
type TableCellProps = {
|
|
2930
2934
|
/** Content of the cell */
|
|
@@ -2933,6 +2937,8 @@ type TableCellProps = {
|
|
|
2933
2937
|
className?: string;
|
|
2934
2938
|
/** Text alignment within the cell */
|
|
2935
2939
|
align?: 'left' | 'center' | 'right';
|
|
2940
|
+
/** Whether text should wrap instead of truncating */
|
|
2941
|
+
wrapText?: boolean;
|
|
2936
2942
|
} & HTMLAttributes<HTMLTableCellElement>;
|
|
2937
2943
|
/**
|
|
2938
2944
|
* Table - Semantic HTML table with consistent styling
|
|
@@ -2963,11 +2969,11 @@ declare function TableRow({ children, className, selected, ...props }: Readonly<
|
|
|
2963
2969
|
* - Includes proper scope attribute for accessibility
|
|
2964
2970
|
* - Default scope is 'col' for column headers
|
|
2965
2971
|
*/
|
|
2966
|
-
declare function TableHeadCell({ children, className, align, scope, ...props }: Readonly<TableHeadCellProps>): react_jsx_runtime.JSX.Element;
|
|
2972
|
+
declare function TableHeadCell({ children, className, align, scope, wrapText, ...props }: Readonly<TableHeadCellProps>): react_jsx_runtime.JSX.Element;
|
|
2967
2973
|
/**
|
|
2968
2974
|
* TableCell - Table data cell (td)
|
|
2969
2975
|
*/
|
|
2970
|
-
declare function TableCell({ children, className, align, ...props }: Readonly<TableCellProps>): react_jsx_runtime.JSX.Element;
|
|
2976
|
+
declare function TableCell({ children, className, align, wrapText, ...props }: Readonly<TableCellProps>): react_jsx_runtime.JSX.Element;
|
|
2971
2977
|
|
|
2972
2978
|
type AlertProps = {
|
|
2973
2979
|
/** The content to display inside the alert message */
|
package/dist/index.js
CHANGED
|
@@ -3898,7 +3898,7 @@ function Table({
|
|
|
3898
3898
|
}
|
|
3899
3899
|
${hoverable ? `
|
|
3900
3900
|
table tbody tr:hover {
|
|
3901
|
-
background-color: hsl(var(--muted) / 0.
|
|
3901
|
+
background-color: hsl(var(--muted) / 0.6) !important;
|
|
3902
3902
|
}
|
|
3903
3903
|
` : ""}
|
|
3904
3904
|
.table-compact td,
|
|
@@ -3926,6 +3926,7 @@ function TableHeadCell({
|
|
|
3926
3926
|
className = "",
|
|
3927
3927
|
align = "left",
|
|
3928
3928
|
scope = "col",
|
|
3929
|
+
wrapText = false,
|
|
3929
3930
|
...props
|
|
3930
3931
|
}) {
|
|
3931
3932
|
const alignClasses4 = {
|
|
@@ -3933,15 +3934,23 @@ function TableHeadCell({
|
|
|
3933
3934
|
center: "text-center",
|
|
3934
3935
|
right: "text-right"
|
|
3935
3936
|
};
|
|
3936
|
-
|
|
3937
|
+
const wrapClasses = wrapText ? "whitespace-normal break-words" : "whitespace-nowrap";
|
|
3938
|
+
return /* @__PURE__ */ jsx("th", { scope, className: `px-6 py-3 font-medium ${alignClasses4[align]} ${wrapClasses} ${className}`, ...props, children });
|
|
3937
3939
|
}
|
|
3938
|
-
function TableCell({
|
|
3940
|
+
function TableCell({
|
|
3941
|
+
children,
|
|
3942
|
+
className = "",
|
|
3943
|
+
align = "left",
|
|
3944
|
+
wrapText = false,
|
|
3945
|
+
...props
|
|
3946
|
+
}) {
|
|
3939
3947
|
const alignClasses4 = {
|
|
3940
3948
|
left: "text-left",
|
|
3941
3949
|
center: "text-center",
|
|
3942
3950
|
right: "text-right"
|
|
3943
3951
|
};
|
|
3944
|
-
|
|
3952
|
+
const wrapClasses = wrapText ? "whitespace-normal break-words" : "whitespace-nowrap";
|
|
3953
|
+
return /* @__PURE__ */ jsx("td", { className: `px-6 py-4 ${wrapClasses} ${alignClasses4[align]} ${className}`, ...props, children });
|
|
3945
3954
|
}
|
|
3946
3955
|
var table_default = Table;
|
|
3947
3956
|
function Checkbox({
|
|
@@ -4268,7 +4277,7 @@ function DataTable({
|
|
|
4268
4277
|
columns.map((column) => {
|
|
4269
4278
|
const value = row[column.key];
|
|
4270
4279
|
const content = renderCellContent(value, column, row, actualIndex);
|
|
4271
|
-
return /* @__PURE__ */ jsx(TableCell, { align: column.align, children: content }, String(column.key));
|
|
4280
|
+
return /* @__PURE__ */ jsx(TableCell, { align: column.align, wrapText: column.wrapText, children: content }, String(column.key));
|
|
4272
4281
|
}),
|
|
4273
4282
|
actions && /* @__PURE__ */ jsx(TableCell, { align: "center", onClick: (e) => e.stopPropagation(), children: (() => {
|
|
4274
4283
|
let rowActions;
|