@homefile/components-v2 2.39.18 → 2.39.20

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.
@@ -3,5 +3,5 @@ import { t } from 'i18next';
3
3
  import { Text, Flex, Box, Show, Tooltip } from '@chakra-ui/react';
4
4
  import { BackCircleButton, LeftButton } from '../../components';
5
5
  export const HomeHeader = ({ buttonLabel, onAdd, onBack, homeName, disabled, }) => {
6
- return (_jsxs(Flex, { align: "center", justify: "space-between", children: [_jsxs(Flex, { align: "center", gap: "2", children: [_jsx(Tooltip, { hasArrow: true, isDisabled: false, label: t('homeHeader.backBtn'), placement: "right", children: _jsx(Box, { id: "backToLaunchpad", children: _jsx(BackCircleButton, { onClick: onBack }) }) }), _jsx(Show, { breakpoint: "(min-width: 400px)", children: _jsx(Box, { borderLeft: "solid", borderWidth: "1px", borderColor: "lightGray.2", h: "1.75rem", mx: "2" }) }), _jsx(Text, { variant: "titleBolder", children: homeName })] }), buttonLabel && (_jsx(Flex, { position: "absolute", right: "0", id: "addCatalog", children: _jsx(LeftButton, { onClick: onAdd, height: "2rem", label: buttonLabel, disabled: disabled }) }))] }));
6
+ return (_jsxs(Flex, { align: "center", justify: "space-between", children: [_jsxs(Flex, { align: "center", gap: "2", children: [_jsx(Tooltip, { hasArrow: true, isDisabled: false, label: t('homeHeader.backBtn'), placement: "right", children: _jsx(Box, { id: "backToLaunchpad", children: _jsx(BackCircleButton, { onClick: onBack }) }) }), _jsx(Show, { breakpoint: "(min-width: 400px)", children: _jsx(Box, { borderLeft: "solid", borderWidth: "1px", borderColor: "lightGray.2", h: "1.75rem", mx: "2" }) }), _jsx(Text, { fontSize: "1.25rem", fontWeight: 'medium', children: homeName })] }), buttonLabel && (_jsx(Flex, { position: "absolute", right: "0", id: "addCatalog", children: _jsx(LeftButton, { onClick: onAdd, height: "2rem", label: buttonLabel, disabled: disabled }) }))] }));
7
7
  };
@@ -1,2 +1,2 @@
1
1
  import { ItemNameHeaderI } from '../../interfaces';
2
- export declare const ItemNameHeader: ({ id, value, onSave, onValueChange, padding, required, showSaveButton, }: ItemNameHeaderI) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const ItemNameHeader: ({ id, value, onSave, onValueChange, padding, required, showSaveButton, placeholder }: ItemNameHeaderI) => import("react/jsx-runtime").JSX.Element;
@@ -4,7 +4,7 @@ import { Box, Flex, Button } from '@chakra-ui/react';
4
4
  import { TextInput } from '../../components';
5
5
  import { isEmptyField } from '../../utils';
6
6
  import { useState, useEffect } from 'react';
7
- export const ItemNameHeader = ({ id = '', value = '', onSave, onValueChange, padding = 'base', required = true, showSaveButton = true, }) => {
7
+ export const ItemNameHeader = ({ id = '', value = '', onSave, onValueChange, padding = 'base', required = true, showSaveButton = true, placeholder }) => {
8
8
  const [name, setName] = useState(value);
9
9
  useEffect(() => {
10
10
  setName(value);
@@ -13,5 +13,5 @@ export const ItemNameHeader = ({ id = '', value = '', onSave, onValueChange, pad
13
13
  setName(e.target.value);
14
14
  onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(e.target.value);
15
15
  };
16
- return (_jsx(Box, { bg: "lightBlue.2", p: padding, w: "100%", children: _jsxs(Flex, { gap: "base", align: "center", children: [_jsx(TextInput, { errorMessage: `${t('householdItems.headers.itemName')} ${t('forms.required')}`, hasError: required && isEmptyField(name), id: id, handleChange: handleChange, placeholder: t('householdItems.headers.placeholder'), value: name }), name && showSaveButton && (_jsx(Button, { variant: "secondary", maxW: "fit-content", maxH: "input.md", onClick: () => onSave(name), children: t('createDocument.buttons.save') }))] }) }));
16
+ return (_jsx(Box, { bg: "lightBlue.2", p: padding, w: "100%", children: _jsxs(Flex, { gap: "base", align: "center", children: [_jsx(TextInput, { errorMessage: `${t('householdItems.headers.itemName')} ${t('forms.required')}`, hasError: required && isEmptyField(name), id: id, handleChange: handleChange, placeholder: placeholder || t('householdItems.headers.placeholder'), value: name }), name && showSaveButton && (_jsx(Button, { variant: "secondary", maxW: "fit-content", maxH: "input.md", onClick: () => onSave(name), children: t('createDocument.buttons.save') }))] }) }));
17
17
  };
@@ -6,4 +6,5 @@ export interface ItemNameHeaderI {
6
6
  padding?: string;
7
7
  required?: boolean;
8
8
  showSaveButton?: boolean;
9
+ placeholder?: string;
9
10
  }
@@ -7,5 +7,6 @@ export declare const DocumentNameHeaderWithValue: {
7
7
  (args: ItemNameHeaderI): import("react/jsx-runtime").JSX.Element;
8
8
  args: {
9
9
  value: string;
10
+ placeholder: string;
10
11
  };
11
12
  };
@@ -11,4 +11,5 @@ export const DocumentNameHeaderWithoutValue = (args) => {
11
11
  export const DocumentNameHeaderWithValue = (args) => (_jsx(DocumentNameHeaderWithoutValue, Object.assign({}, args)));
12
12
  DocumentNameHeaderWithValue.args = {
13
13
  value: 'Document name',
14
+ placeholder: 'Name this Receipt'
14
15
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homefile/components-v2",
3
- "version": "2.39.18",
3
+ "version": "2.39.20",
4
4
  "author": "Homefile",
5
5
  "license": "UNLICENSED",
6
6
  "typings": "dist/index.d.ts",