pmg-ui-kit 0.0.38 → 0.0.40
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/icons/SaveIcon.d.ts +8 -0
- package/dist/icons/SaveIcon.js +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/ui/atoms/Select.d.ts +2 -1
- package/dist/ui/atoms/Select.js +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
export const SaveIcon = ({ 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-device-floppy", children: [_jsx("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }), _jsx("path", { d: "M6 4h10l4 4v10a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2" }), _jsx("path", { d: "M12 14m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" }), _jsx("path", { d: "M14 4l0 4l-6 0l0 -4" })] }));
|
package/dist/index.d.ts
CHANGED
|
@@ -56,5 +56,6 @@ export * from './icons/PercentageIcon';
|
|
|
56
56
|
export * from './icons/PlusIcon';
|
|
57
57
|
export * from './icons/RefreshIcon';
|
|
58
58
|
export * from './icons/SaveDiscIcon';
|
|
59
|
+
export * from './icons/SaveIcon';
|
|
59
60
|
export * from './icons/TrashIcon';
|
|
60
61
|
export * from './icons/UserPlusIcon';
|
package/dist/index.js
CHANGED
|
@@ -56,5 +56,6 @@ export * from './icons/PercentageIcon';
|
|
|
56
56
|
export * from './icons/PlusIcon';
|
|
57
57
|
export * from './icons/RefreshIcon';
|
|
58
58
|
export * from './icons/SaveDiscIcon';
|
|
59
|
+
export * from './icons/SaveIcon';
|
|
59
60
|
export * from './icons/TrashIcon';
|
|
60
61
|
export * from './icons/UserPlusIcon';
|
|
@@ -5,6 +5,7 @@ export type SelectOption = {
|
|
|
5
5
|
type SelectProps = {
|
|
6
6
|
options: SelectOption[];
|
|
7
7
|
value?: string;
|
|
8
|
+
defaultValue?: string;
|
|
8
9
|
handleOnChange?: (value: SelectOption) => void;
|
|
9
10
|
name?: string;
|
|
10
11
|
required?: boolean;
|
|
@@ -12,5 +13,5 @@ type SelectProps = {
|
|
|
12
13
|
disabled?: boolean;
|
|
13
14
|
};
|
|
14
15
|
export declare const emptyOption: SelectOption;
|
|
15
|
-
export declare const Select: ({ options, value, handleOnChange, name, required, useEmptyOption, disabled, }: SelectProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare const Select: ({ options, value, defaultValue, handleOnChange, name, required, useEmptyOption, disabled, }: SelectProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
17
|
export {};
|
package/dist/ui/atoms/Select.js
CHANGED
|
@@ -3,12 +3,12 @@ export const emptyOption = {
|
|
|
3
3
|
label: "---",
|
|
4
4
|
value: "",
|
|
5
5
|
};
|
|
6
|
-
export const Select = ({ options, value, handleOnChange, name, required, useEmptyOption = false, disabled = false, }) => {
|
|
6
|
+
export const Select = ({ options, value, defaultValue, handleOnChange, name, required, useEmptyOption = false, disabled = false, }) => {
|
|
7
7
|
const selectOptions = [...options];
|
|
8
8
|
if (useEmptyOption && !disabled) {
|
|
9
9
|
selectOptions.unshift(emptyOption);
|
|
10
10
|
}
|
|
11
|
-
return (_jsx("select", { name: name, required: required, disabled: disabled, value: value, onClick: (e) => e.currentTarget.classList.remove("border-red-500"), onChange: (e) => {
|
|
11
|
+
return (_jsx("select", { name: name, required: required, disabled: disabled, value: value, ...(defaultValue !== undefined && { defaultValue }), onClick: (e) => e.currentTarget.classList.remove("border-red-500"), onChange: (e) => {
|
|
12
12
|
const selectedOption = selectOptions.find((option) => option.value === e.target.value);
|
|
13
13
|
handleOnChange && selectedOption && handleOnChange(selectedOption);
|
|
14
14
|
}, className: "bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500", children: selectOptions.map((option) => (_jsx("option", { value: option.value, children: option.label }, option.value))) }));
|