@pk-design/react-tailwind 1.4.0 → 1.4.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/react-tailwind.cjs.js +8 -10
- package/dist/react-tailwind.cjs.js.map +1 -1
- package/dist/react-tailwind.es.js +8 -10
- package/dist/react-tailwind.es.js.map +1 -1
- package/dist/types/components/Banner/Banner.types.d.ts +2 -1
- package/dist/types/components/Table/Table.types.d.ts +1 -1
- package/package.json +1 -1
|
@@ -224,7 +224,7 @@ const TypeClassMap = {
|
|
|
224
224
|
const Alert = (props) => {
|
|
225
225
|
const { type = 'info', className = '', message, children, removable = false, onRemove = () => { }, ...restProps } = props;
|
|
226
226
|
const Icon = AlertTypeIconMap[type] || SvgInfo;
|
|
227
|
-
return (jsxs("div", { className: buildClassName(className, 'flex items-center justify-between rounded-md p-3 text-sm ring-1 ring-inset gap-2', TypeClassMap[type]), ...restProps, children: [jsxs("span", { className: "inline-flex items-center gap-2", children: [jsx(Icon, { className: "size-5", "data-testid": `alert-${type}-icon` }), jsx("span", { className: "pr-2 inline-flex items-center", children: message || children })] }), removable && (jsx(Button, { iconOnly: true, "aria-label": "Dismiss alert", size: "xs", variant: "plain", theme: "secondary", className: "hover:bg-black/
|
|
227
|
+
return (jsxs("div", { className: buildClassName(className, 'flex items-center justify-between rounded-md p-3 text-sm ring-1 ring-inset gap-2', TypeClassMap[type]), ...restProps, children: [jsxs("span", { className: "inline-flex items-center gap-2", children: [jsx(Icon, { className: "size-5", "data-testid": `alert-${type}-icon` }), jsx("span", { className: "pr-2 inline-flex items-center", children: message || children })] }), removable && (jsx(Button, { iconOnly: true, "aria-label": "Dismiss alert", size: "xs", variant: "plain", theme: "secondary", className: "hover:bg-black/10 dark:hover:bg-white/10", onClick: () => onRemove(), "data-testid": "alert-remove-btn", children: jsx(SvgX, { className: "size-4.5", "data-testid": "alert-remove-icon" }) }))] }));
|
|
228
228
|
};
|
|
229
229
|
Alert.displayName = 'Alert';
|
|
230
230
|
|
|
@@ -237,7 +237,7 @@ const ThemeClassMap = {
|
|
|
237
237
|
};
|
|
238
238
|
const Badge = forwardRef((props, ref) => {
|
|
239
239
|
const { theme = 'info', className = '', children, removable = false, rounded = false, onRemove = () => { }, ...restProps } = props;
|
|
240
|
-
return (jsxs(TextContent, { ref: ref, className: buildClassName(className, 'inline-flex items-center pl-3 py-1 text-xs font-medium ring-1 ring-inset', ThemeClassMap[theme], rounded ? 'rounded-full' : 'rounded-md'), "data-testid": `badge-${theme}`, ...restProps, children: [jsx(TextContent, { className: "pr-3 inline-flex items-center", children: children }), removable ? (jsx(SvgX, { className: "size-5 px-0.5 mr-1 hover:bg-
|
|
240
|
+
return (jsxs(TextContent, { ref: ref, className: buildClassName(className, 'inline-flex items-center pl-3 py-1 text-xs font-medium ring-1 ring-inset', ThemeClassMap[theme], rounded ? 'rounded-full' : 'rounded-md'), "data-testid": `badge-${theme}`, ...restProps, children: [jsx(TextContent, { className: "pr-3 inline-flex items-center", children: children }), removable ? (jsx(SvgX, { className: "size-5 px-0.5 mr-1 hover:bg-black/10 dark:hover:bg-white/10 rounded-sm cursor-pointer", role: "button", tabIndex: 0, "aria-label": "Remove", onClick: () => onRemove(), onKeyDown: (e) => {
|
|
241
241
|
if (e.key === 'Enter' || e.key === ' ') {
|
|
242
242
|
e.preventDefault();
|
|
243
243
|
onRemove();
|
|
@@ -289,13 +289,11 @@ var SvgCircleCheck = function SvgCircleCheck(props) {
|
|
|
289
289
|
};
|
|
290
290
|
|
|
291
291
|
const sizeMap = {
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
9: `size-9`,
|
|
298
|
-
10: `size-10`,
|
|
292
|
+
xs: 'size-4',
|
|
293
|
+
sm: 'size-5',
|
|
294
|
+
md: 'size-6',
|
|
295
|
+
lg: 'size-8',
|
|
296
|
+
xl: 'size-10',
|
|
299
297
|
};
|
|
300
298
|
const IconMap = {
|
|
301
299
|
info: SvgInfo,
|
|
@@ -304,7 +302,7 @@ const IconMap = {
|
|
|
304
302
|
warning: SvgTriangleAlert,
|
|
305
303
|
};
|
|
306
304
|
const Banner = forwardRef((props, ref) => {
|
|
307
|
-
const { type = 'info', iconSize =
|
|
305
|
+
const { type = 'info', iconSize = 'sm', children, ...restProps } = props;
|
|
308
306
|
const className = buildClassName('text-sm banner rounded-md flex w-full p-3 items-center', type === 'info' ? 'bg-blue-50 text-blue-700' : '', type === 'error' ? 'bg-red-50 text-red-700' : '', type === 'success' ? 'bg-green-50 text-green-700' : '', type === 'warning' ? 'bg-orange-50 text-orange-700' : '');
|
|
309
307
|
const renderIcon = () => {
|
|
310
308
|
const Icon = IconMap[type];
|