@pk-design/react-tailwind 1.8.0 → 1.8.1
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/cjs/components/DataTable/DataTable.js +1 -1
- package/dist/cjs/components/DataTable/DataTable.js.map +1 -1
- package/dist/cjs/components/RadioGroup/RadioGroup.js +5 -3
- package/dist/cjs/components/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/es/components/DataTable/DataTable.js +1 -1
- package/dist/es/components/DataTable/DataTable.js.map +1 -1
- package/dist/es/components/RadioGroup/RadioGroup.js +5 -3
- package/dist/es/components/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/react-tailwind.cjs.js +6 -4
- package/dist/react-tailwind.cjs.js.map +1 -1
- package/dist/react-tailwind.es.js +6 -4
- package/dist/react-tailwind.es.js.map +1 -1
- package/dist/types/components/DataTable/DataTable.types.d.ts +2 -2
- package/package.json +1 -1
|
@@ -1506,7 +1506,7 @@ function DataTable({ items, columns, sorting = {}, onSort, loading, pagination,
|
|
|
1506
1506
|
}), isInlineMode && (jsx(TableCell, { align: "right", className: buildClassName(densityCellClass, striped && idx % 2 === 1 && 'bg-gray-50 dark:bg-gray-800/40'), onClick: (e) => e.stopPropagation(), children: jsx("div", { className: buildClassName('opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 transition-opacity duration-150 flex items-center justify-end gap-1.5', rowHoverActionClass), "data-testid": `row-hover-actions-${key}`, children: renderActionsContent(item, idx) }) })), isOverlayMode && (jsx(TableCell, { align: "right", style: { padding: 0, width: 0, minWidth: 0, maxWidth: 0 }, className: "sticky right-0 z-20 !p-0 !pr-0 !pl-0 !py-0 w-0 max-w-0 min-w-0 border-0 overflow-visible text-right", onClick: (e) => e.stopPropagation(), children: jsx("div", { className: buildClassName('absolute right-0 top-0 bottom-0 h-full opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 transition-opacity duration-150 flex items-center justify-end gap-1 px-3 z-30 pointer-events-none group-hover:pointer-events-auto whitespace-nowrap', striped && idx % 2 === 1
|
|
1507
1507
|
? 'bg-gray-100 dark:bg-gray-800'
|
|
1508
1508
|
: 'bg-white group-hover:bg-gray-50 dark:bg-gray-900 dark:group-hover:bg-gray-800', rowHoverActionClass), "data-testid": `row-hover-actions-${key}`, children: renderActionsContent(item, idx) }) }))] }, key));
|
|
1509
|
-
})) }), footerRow && jsx(TableFoot, { children: footerRow })] }) }), pagination && (jsx("div", { className: buildClassName(stickyPagination && 'sticky bottom-0 z-20
|
|
1509
|
+
})) }), footerRow && jsx(TableFoot, { children: footerRow })] }) }), pagination && (jsx("div", { className: buildClassName(stickyPagination && 'sticky bottom-0 z-20', paginationContainerClass), children: renderPagination ? (renderPagination(pagination, setPagination)) : (jsx(Pagination, { ...pagination, ...paginationProps, className: buildClassName('rounded-t-none rounded-b-lg border border-[var(--ui-border)] bg-white dark:bg-gray-800', paginationClass, paginationProps === null || paginationProps === void 0 ? void 0 : paginationProps.className), onChange: setPagination })) }))] }));
|
|
1510
1510
|
}
|
|
1511
1511
|
DataTable.displayName = 'DataTable';
|
|
1512
1512
|
|
|
@@ -2426,6 +2426,7 @@ const COLUMN_GRID_MAP = {
|
|
|
2426
2426
|
const RadioGroup = (props) => {
|
|
2427
2427
|
const { name, variant = 'default', size = 'md', theme = 'primary', label, labelClass, labelWrapperClass, labelHint, containerClass, options, value, columns, disabled = false, row, error, showErrorMessage = true, onChange, required, 'aria-describedby': ariaDescribedBy, } = props;
|
|
2428
2428
|
const groupId = useId();
|
|
2429
|
+
const groupName = name || groupId;
|
|
2429
2430
|
const items = useMemo(() => {
|
|
2430
2431
|
var _a;
|
|
2431
2432
|
return (_a = options === null || options === void 0 ? void 0 : options.map((option) => typeof option === 'string'
|
|
@@ -2450,13 +2451,14 @@ const RadioGroup = (props) => {
|
|
|
2450
2451
|
: 'flex flex-col gap-3'), children: items.map((item) => {
|
|
2451
2452
|
const isSelected = value === item.value;
|
|
2452
2453
|
const isItemDisabled = disabled || Boolean(item.disabled);
|
|
2454
|
+
const radioItemId = `${groupName}-${item.value}`;
|
|
2453
2455
|
if (isCards) {
|
|
2454
|
-
return (jsxs("label", { htmlFor:
|
|
2456
|
+
return (jsxs("label", { htmlFor: radioItemId, className: buildClassName('relative flex items-start gap-3 p-4 rounded-xl border transition-all cursor-pointer select-none min-w-[200px] flex-1', 'focus-within:ring-2 focus-within:ring-[var(--ui-primary-ring)] focus-within:border-[var(--ui-primary)]', isSelected
|
|
2455
2457
|
? 'border-[var(--ui-primary)] bg-blue-50/40 dark:bg-blue-950/30 ring-2 ring-[var(--ui-primary-ring)]/30'
|
|
2456
2458
|
: 'border-[var(--ui-border)] bg-white dark:bg-gray-800 hover:border-gray-300 dark:hover:border-gray-600', isItemDisabled &&
|
|
2457
|
-
'opacity-50 cursor-not-allowed pointer-events-none bg-gray-50 dark:bg-gray-800/50'), children: [jsx(Radio, { name:
|
|
2459
|
+
'opacity-50 cursor-not-allowed pointer-events-none bg-gray-50 dark:bg-gray-800/50'), children: [jsx(Radio, { name: groupName, id: radioItemId, value: item.value, "aria-label": item.label, size: size, theme: theme, checked: isSelected, disabled: isItemDisabled, onChange: onChange, containerClass: "pt-0.5" }), jsxs("div", { className: "flex-1 min-w-0", children: [jsxs("div", { className: "flex items-center gap-2", children: [item.icon && (jsx("span", { className: "shrink-0 text-gray-500 dark:text-gray-400", children: item.icon })), jsx("span", { className: "text-sm font-semibold text-gray-900 dark:text-white truncate", children: item.label })] }), item.description && (jsx("p", { className: "mt-1 text-xs text-gray-500 dark:text-gray-400 font-normal leading-relaxed", children: item.description }))] })] }, item.value));
|
|
2458
2460
|
}
|
|
2459
|
-
return (jsx(Radio, { name:
|
|
2461
|
+
return (jsx(Radio, { name: groupName, id: radioItemId, label: item.label, description: item.description, value: item.value, size: size, theme: theme, checked: isSelected, disabled: isItemDisabled, onChange: onChange }, item.value));
|
|
2460
2462
|
}) }), showErrorMessage && error && (jsx("div", { className: "mt-1.5", children: jsx(TextContent, { error: true, small: true, id: errorId, children: error }) }))] }));
|
|
2461
2463
|
};
|
|
2462
2464
|
RadioGroup.displayName = 'RadioGroup';
|