pmg-ui-kit 0.0.35 → 0.0.37

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.
@@ -0,0 +1,8 @@
1
+ type InfoIconProps = {
2
+ onClick?: () => void;
3
+ width?: number;
4
+ height?: number;
5
+ color?: string;
6
+ };
7
+ export declare const InfoIcon: ({ onClick, width, height, color }: InfoIconProps) => import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,2 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ export const InfoIcon = ({ onClick, width = 24, height = 24, color = "currentColor" }) => (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: width, height: height, viewBox: "0 0 24 24", fill: "none", stroke: color, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", onClick: onClick, className: "icon icon-tabler icons-tabler-outline icon-tabler-info-square", children: [_jsx("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }), _jsx("path", { d: "M12 9h.01" }), _jsx("path", { d: "M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14z" }), _jsx("path", { d: "M11 12h1v4h1" })] }));
@@ -1,8 +1,8 @@
1
1
  type TrashIconProps = {
2
2
  onClick?: () => void;
3
- className?: string;
4
- strokeColor?: string;
5
- size?: number;
3
+ width?: number;
4
+ height?: number;
5
+ color?: string;
6
6
  };
7
- export declare const TrashIcon: ({ className, onClick, strokeColor }: TrashIconProps) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const TrashIcon: ({ onClick, width, height, color }: TrashIconProps) => import("react/jsx-runtime").JSX.Element;
8
8
  export {};
@@ -1,2 +1,2 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- export const TrashIcon = ({ className, onClick, strokeColor }) => (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: strokeColor || "currentColor", className: `w-6 h-6 inline ${className}`, onClick: onClick, children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0" }) }));
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ export const TrashIcon = ({ onClick, width = 24, height = 24, color = "currentColor" }) => (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: width, height: height, viewBox: "0 0 24 24", fill: "none", stroke: color, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", onClick: onClick, className: "icon icon-tabler icons-tabler-outline icon-tabler-trash", children: [_jsx("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }), _jsx("path", { d: "M4 7l16 0" }), _jsx("path", { d: "M10 11l0 6" }), _jsx("path", { d: "M14 11l0 6" }), _jsx("path", { d: "M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12" }), _jsx("path", { d: "M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3" })] }));
@@ -19,6 +19,6 @@ export const InputTypeFileWithListing = ({ accept, className, handleChangeFilesL
19
19
  _jsx("button", { onClick: () => {
20
20
  setFilesList(filesList.filter((f) => f !== file));
21
21
  handleChangeFilesList(filesList);
22
- }, children: _jsx(TrashIcon, { strokeColor: "red" }) }, index),
22
+ }, children: _jsx(TrashIcon, { color: "red" }) }, index),
23
23
  ]), globalTableCellsClassNames: "!py-2", tableCellsListClassNames: ["", "text-right"], hideColumnNames: true }))] }));
24
24
  };
@@ -10,7 +10,7 @@ type ModalProps = {
10
10
  cancelBtnLabel?: string;
11
11
  cancelBtnClassname?: string;
12
12
  hideButtons?: boolean;
13
- size?: "xs" | "sm" | "md" | "lg" | "xl";
13
+ size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl";
14
14
  };
15
15
  export declare const Modal: ({ show, handleOnClose, handleOnAccept, header, content, okBtnLabel, okBtnClassname, cancelBtnLabel, cancelBtnClassname, hideButtons, size }: ModalProps) => import("react/jsx-runtime").JSX.Element;
16
16
  export {};
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Modal as FlowbiteModal } from "flowbite-react";
3
3
  import { Button } from "./Button";
4
- export const Modal = ({ show, handleOnClose, handleOnAccept, header, content, okBtnLabel = "Ok", okBtnClassname, cancelBtnLabel = "Cancel", cancelBtnClassname, hideButtons = false, size = "md" }) => {
4
+ export const Modal = ({ show, handleOnClose, handleOnAccept, header, content, okBtnLabel = "Ok", okBtnClassname, cancelBtnLabel = "Cancel", cancelBtnClassname, hideButtons = false, size = "xl" }) => {
5
5
  return (_jsxs(FlowbiteModal, { show: show, onClose: () => handleOnClose(), size: size, children: [_jsx(FlowbiteModal.Header, { children: header }), _jsx(FlowbiteModal.Body, { children: content }), !hideButtons &&
6
6
  _jsxs(FlowbiteModal.Footer, { className: "flex justify-between", children: [_jsx(Button, { type: "b-primary", className: okBtnClassname, onClick: () => handleOnAccept(), text: okBtnLabel }), _jsx(Button, { type: "b-default", className: cancelBtnClassname, onClick: () => handleOnClose(), text: cancelBtnLabel })] })] }));
7
7
  };
@@ -0,0 +1,12 @@
1
+ import { ReactNode } from 'react';
2
+ interface DragAndDropItem {
3
+ id: string;
4
+ content: ReactNode;
5
+ }
6
+ interface DragAndDropListProps {
7
+ items: DragAndDropItem[];
8
+ onItemsChange: (newItems: DragAndDropItem[]) => void;
9
+ className?: string;
10
+ }
11
+ export declare const DragAndDropList: ({ items, onItemsChange, className }: DragAndDropListProps) => import("react/jsx-runtime").JSX.Element;
12
+ export {};
@@ -0,0 +1,42 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from 'react';
3
+ export const DragAndDropList = ({ items, onItemsChange, className = "" }) => {
4
+ const [draggedItem, setDraggedItem] = useState(null);
5
+ const [dragOverIndex, setDragOverIndex] = useState(null);
6
+ const handleDragStart = (e, itemId) => {
7
+ setDraggedItem(itemId);
8
+ e.dataTransfer.effectAllowed = 'move';
9
+ };
10
+ const handleDragEnd = () => {
11
+ setDraggedItem(null);
12
+ setDragOverIndex(null);
13
+ };
14
+ const handleDragOver = (e, index) => {
15
+ e.preventDefault();
16
+ e.dataTransfer.dropEffect = 'move';
17
+ setDragOverIndex(index);
18
+ };
19
+ const handleDragLeave = () => {
20
+ setDragOverIndex(null);
21
+ };
22
+ const handleDrop = (e, dropIndex) => {
23
+ e.preventDefault();
24
+ if (!draggedItem)
25
+ return;
26
+ const draggedIndex = items.findIndex(item => item.id === draggedItem);
27
+ if (draggedIndex === -1 || draggedIndex === dropIndex)
28
+ return;
29
+ const newItems = [...items];
30
+ const [removed] = newItems.splice(draggedIndex, 1);
31
+ newItems.splice(dropIndex, 0, removed);
32
+ onItemsChange(newItems);
33
+ setDragOverIndex(null);
34
+ };
35
+ return (_jsx("div", { className: `space-y-2 ${className}`, children: items.map((item, index) => (_jsx("div", { draggable: true, onDragStart: (e) => handleDragStart(e, item.id), onDragEnd: handleDragEnd, onDragOver: (e) => handleDragOver(e, index), onDragLeave: handleDragLeave, onDrop: (e) => handleDrop(e, index), className: `
36
+ p-4 border-2 border-dashed border-gray-300 rounded-lg cursor-move
37
+ transition-all duration-200 bg-white
38
+ ${draggedItem === item.id ? 'opacity-60 bg-gray-100 border-gray-400 shadow-lg scale-105' : ''}
39
+ ${dragOverIndex === index ? 'border-blue-500 bg-blue-50 scale-102' : ''}
40
+ hover:border-gray-400 hover:shadow-md
41
+ `, children: _jsxs("div", { className: "flex items-center gap-3", children: [_jsx("div", { className: "text-gray-400 cursor-grab active:cursor-grabbing", children: _jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: [_jsx("circle", { cx: "3", cy: "3", r: "1" }), _jsx("circle", { cx: "3", cy: "8", r: "1" }), _jsx("circle", { cx: "3", cy: "13", r: "1" }), _jsx("circle", { cx: "8", cy: "3", r: "1" }), _jsx("circle", { cx: "8", cy: "8", r: "1" }), _jsx("circle", { cx: "8", cy: "13", r: "1" })] }) }), _jsx("div", { className: "flex-1", children: item.content })] }) }, item.id))) }));
42
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmg-ui-kit",
3
- "version": "0.0.35",
3
+ "version": "0.0.37",
4
4
  "description": "Components library for PMG projects",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",