@homefile/components-v2 2.14.8 → 2.14.9

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.
@@ -1,2 +1,2 @@
1
1
  import { SelectFieldI } from '../../../../interfaces';
2
- export declare const SelectField: ({ description, id, label, options, placeholder, value, }: SelectFieldI) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const SelectField: ({ description, id, icon, label, options, placeholder, value, }: SelectFieldI) => import("react/jsx-runtime").JSX.Element;
@@ -1,12 +1,12 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Controller, useFormContext } from 'react-hook-form';
3
3
  import { Box, Flex } from '@chakra-ui/react';
4
- import { SelectInput } from '../../..';
5
- export const SelectField = ({ description, id, label, options, placeholder, value, }) => {
4
+ import { FieldDescription, SelectInput } from '../../..';
5
+ export const SelectField = ({ description, id, icon, label, options, placeholder, value, }) => {
6
6
  var _a;
7
7
  const { control } = useFormContext();
8
8
  const stringOptions = (_a = options === null || options === void 0 ? void 0 : options.map((option) => String(option))) !== null && _a !== void 0 ? _a : [];
9
- return (_jsx(Flex, { align: "start", gap: "base", flex: "auto", w: description ? '100%' : '40%', children: _jsx(Box, { w: description ? '102px' : '100%', children: _jsx(Controller, { control: control, name: id, defaultValue: value, render: ({ field: { value, onChange } }) => {
10
- return (_jsx(SelectInput, { handleClick: onChange, height: "md", initialValue: value !== null && value !== void 0 ? value : stringOptions[0], items: stringOptions, placeholder: !description ? placeholder : '', label: label, width: "100%" }));
11
- } }) }) }));
9
+ return (_jsxs(Flex, { align: "start", gap: "base", flex: "auto", w: description ? '100%' : '40%', children: [_jsx(FieldDescription, { description: description, icon: icon }), _jsx(Box, { w: description ? '102px' : '100%', children: _jsx(Controller, { control: control, name: id, defaultValue: value, render: ({ field: { value, onChange } }) => {
10
+ return (_jsx(SelectInput, { handleClick: onChange, height: "md", initialValue: value !== null && value !== void 0 ? value : stringOptions[0], items: stringOptions, placeholder: !description ? placeholder : '', label: label, width: "100%" }));
11
+ } }) })] }));
12
12
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homefile/components-v2",
3
- "version": "2.14.8",
3
+ "version": "2.14.9",
4
4
  "author": "Homefile",
5
5
  "license": "UNLICENSED",
6
6
  "typings": "dist/index.d.ts",
@@ -1,11 +1,12 @@
1
1
  import { Controller, useFormContext } from 'react-hook-form'
2
2
  import { Box, Flex } from '@chakra-ui/react'
3
- import { SelectInput } from '@/components'
3
+ import { FieldDescription, SelectInput } from '@/components'
4
4
  import { SelectFieldI } from '@/interfaces'
5
5
 
6
6
  export const SelectField = ({
7
7
  description,
8
8
  id,
9
+ icon,
9
10
  label,
10
11
  options,
11
12
  placeholder,
@@ -15,6 +16,7 @@ export const SelectField = ({
15
16
  const stringOptions = options?.map((option) => String(option)) ?? []
16
17
  return (
17
18
  <Flex align="start" gap="base" flex="auto" w={description ? '100%' : '40%'}>
19
+ <FieldDescription description={description} icon={icon} />
18
20
  <Box w={description ? '102px' : '100%'}>
19
21
  <Controller
20
22
  control={control}