pmg-ui-kit 0.1.0 → 0.1.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.
@@ -12,7 +12,8 @@ type SelectProps = {
12
12
  useEmptyOption?: boolean;
13
13
  disabled?: boolean;
14
14
  bottomHint?: string;
15
+ className?: string;
15
16
  };
16
17
  export declare const emptyOption: SelectOption;
17
- export declare const Select: ({ options, value, defaultValue, handleOnChange, name, required, useEmptyOption, disabled, bottomHint }: SelectProps) => import("react/jsx-runtime").JSX.Element;
18
+ export declare const Select: ({ options, value, defaultValue, handleOnChange, name, required, useEmptyOption, disabled, bottomHint, className }: SelectProps) => import("react/jsx-runtime").JSX.Element;
18
19
  export {};
@@ -1,10 +1,11 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import classNames from "classnames";
2
3
  import { Text } from "./Text";
3
4
  export const emptyOption = {
4
5
  label: "---",
5
6
  value: "",
6
7
  };
7
- export const Select = ({ options, value, defaultValue, handleOnChange, name, required, useEmptyOption = false, disabled = false, bottomHint }) => {
8
+ export const Select = ({ options, value, defaultValue, handleOnChange, name, required, useEmptyOption = false, disabled = false, bottomHint, className }) => {
8
9
  const selectOptions = [...options];
9
10
  if (useEmptyOption && !disabled) {
10
11
  selectOptions.unshift(emptyOption);
@@ -12,5 +13,5 @@ export const Select = ({ options, value, defaultValue, handleOnChange, name, req
12
13
  return (_jsxs(_Fragment, { children: [_jsx("select", { name: name, required: required, disabled: disabled, value: value, ...(defaultValue !== undefined && { defaultValue }), onClick: (e) => e.currentTarget.classList.remove("border-red-500"), onChange: (e) => {
13
14
  const selectedOption = selectOptions.find((option) => option.value === e.target.value);
14
15
  handleOnChange && selectedOption && handleOnChange(selectedOption);
15
- }, 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))) }), bottomHint && (_jsx(Text, { size: "sm", className: "mt-1 text-gray-600", children: bottomHint }))] }));
16
+ }, className: classNames("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", className), children: selectOptions.map((option) => (_jsx("option", { value: option.value, children: option.label }, option.value))) }), bottomHint && (_jsx(Text, { size: "sm", className: "mt-1 text-gray-600", children: bottomHint }))] }));
16
17
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmg-ui-kit",
3
- "version": "0.1.00",
3
+ "version": "0.1.01",
4
4
  "description": "Components library for PMG projects",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",