@homefile/components-v2 2.49.1 → 2.49.2

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 { PartnerCustomerCardI } from '../../../interfaces';
2
- export declare const PartnerCustomerCard: ({ addressLines, customerName, display, footerActionLabel, imageAlt, imageSrc, onFooterActionClick, statusColor, statusLabel, }: PartnerCustomerCardI) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const PartnerCustomerCard: ({ addressLines, customerName, display, footerActionLabel, imageAlt, imageSrc, onCardClick, onFooterActionClick, statusColor, statusLabel, }: PartnerCustomerCardI) => import("react/jsx-runtime").JSX.Element;
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Box, Container, Flex, IconButton, Image, Stack, Text, } from '@chakra-ui/react';
3
3
  import { House1 } from '../../../assets/images';
4
4
  import { TicketBookmark } from '../../../components';
5
- export const PartnerCustomerCard = ({ addressLines, customerName, display = 'grid', footerActionLabel, imageAlt, imageSrc, onFooterActionClick, statusColor, statusLabel, }) => {
5
+ export const PartnerCustomerCard = ({ addressLines, customerName, display = 'grid', footerActionLabel, imageAlt, imageSrc, onCardClick, onFooterActionClick, statusColor, statusLabel, }) => {
6
6
  const isListDisplay = display === 'list';
7
7
  const dividerColor = 'lightBlue.2';
8
8
  const cardWidth = isListDisplay ? '100%' : '180px';
@@ -15,7 +15,13 @@ export const PartnerCustomerCard = ({ addressLines, customerName, display = 'gri
15
15
  const renderStatus = () => (_jsxs(Flex, { align: "center", gap: "2", p: "2", children: [_jsx(Box, { boxSize: "10px", borderRadius: "full", bg: customerStatusColor, flexShrink: 0 }), _jsx(Text, { fontSize: "xs", fontWeight: "medium", textTransform: "uppercase", children: customerStatusLabel })] }));
16
16
  const renderAddress = () => (_jsx(Stack, { spacing: "0.5", children: customerAddressLines.map((line) => (_jsx(Text, { fontFamily: "secondary", fontSize: "sm", lineHeight: "1.2", children: line }, line))) }));
17
17
  if (isListDisplay) {
18
- return (_jsx(Container, { variant: "launchpad", w: cardWidth, maxW: "none", mx: "0", overflow: "hidden", bg: "neutral.white", children: _jsxs(Flex, { direction: { base: 'column', md: 'row' }, align: "stretch", children: [_jsx(Box, { minW: { base: '100%', md: '140px' }, borderBottomWidth: { base: '1px', md: '0' }, borderBottomStyle: "solid", borderRightWidth: { base: '0', md: '1px' }, borderRightStyle: "solid", borderBottomColor: dividerColor, borderRightColor: dividerColor, children: renderStatus() }), _jsx(Box, { minW: { base: '100%', md: '140px' }, borderBottomWidth: { base: '1px', md: '0' }, borderBottomStyle: "solid", borderRightWidth: { base: '0', md: '1px' }, borderRightStyle: "solid", borderBottomColor: dividerColor, borderRightColor: dividerColor, children: _jsx(Image, { src: imageSource, alt: imageAlternativeText, h: { base: '160px', md: '88px' }, w: "100%", objectFit: "cover" }) }), _jsxs(Stack, { spacing: "1", p: "base", flex: "1", justify: "center", minW: "0", children: [_jsx(Text, { textTransform: "uppercase", fontWeight: "medium", children: customerTitle }), renderAddress()] }), _jsx(Flex, { p: "base", align: "center", justify: "center", borderTopWidth: { base: '1px', md: '0' }, borderTopStyle: "solid", borderLeftWidth: { base: '0', md: '1px' }, borderLeftStyle: "solid", borderTopColor: dividerColor, borderLeftColor: dividerColor, minW: { base: '100%', md: '64px' }, children: _jsx(IconButton, { "aria-label": footerActionLabel !== null && footerActionLabel !== void 0 ? footerActionLabel : 'Save customer', variant: "icon", width: "fit-content", onClick: onFooterActionClick, children: _jsx(TicketBookmark, { boxSize: "5" }) }) })] }) }));
18
+ return (_jsx(Container, { variant: "launchpad", w: cardWidth, maxW: "none", mx: "0", overflow: "hidden", bg: "neutral.white", cursor: onCardClick ? 'pointer' : 'default', onClick: onCardClick, children: _jsxs(Flex, { direction: { base: 'column', md: 'row' }, align: "stretch", children: [_jsx(Box, { minW: { base: '100%', md: '140px' }, borderBottomWidth: { base: '1px', md: '0' }, borderBottomStyle: "solid", borderRightWidth: { base: '0', md: '1px' }, borderRightStyle: "solid", borderBottomColor: dividerColor, borderRightColor: dividerColor, children: renderStatus() }), _jsx(Box, { minW: { base: '100%', md: '140px' }, borderBottomWidth: { base: '1px', md: '0' }, borderBottomStyle: "solid", borderRightWidth: { base: '0', md: '1px' }, borderRightStyle: "solid", borderBottomColor: dividerColor, borderRightColor: dividerColor, children: _jsx(Image, { src: imageSource, alt: imageAlternativeText, h: { base: '160px', md: '88px' }, w: "100%", objectFit: "cover" }) }), _jsxs(Stack, { spacing: "1", p: "base", flex: "1", justify: "center", minW: "0", children: [_jsx(Text, { textTransform: "uppercase", fontWeight: "medium", children: customerTitle }), renderAddress()] }), _jsx(Flex, { p: "base", align: "center", justify: "center", borderTopWidth: { base: '1px', md: '0' }, borderTopStyle: "solid", borderLeftWidth: { base: '0', md: '1px' }, borderLeftStyle: "solid", borderTopColor: dividerColor, borderLeftColor: dividerColor, minW: { base: '100%', md: '64px' }, children: onFooterActionClick ? (_jsx(IconButton, { "aria-label": footerActionLabel !== null && footerActionLabel !== void 0 ? footerActionLabel : 'Save customer', variant: "icon", width: "fit-content", onClick: (event) => {
19
+ event.stopPropagation();
20
+ onFooterActionClick();
21
+ }, children: _jsx(TicketBookmark, { boxSize: "5" }) })) : null })] }) }));
19
22
  }
20
- return (_jsxs(Container, { variant: "launchpad", w: cardWidth, maxW: "none", mx: "0", overflow: "hidden", bg: "neutral.white", children: [renderStatus(), _jsx(Image, { src: imageSource, alt: imageAlternativeText, h: "90px", w: "100%", objectFit: "cover" }), _jsxs(Stack, { spacing: "1", p: "base", borderBottom: "1px solid", borderColor: dividerColor, children: [_jsx(Text, { textTransform: "uppercase", fontWeight: "medium", children: customerTitle }), renderAddress()] }), _jsx(Flex, { h: "40px", p: "base", align: "center", justify: "space-between", children: _jsx(IconButton, { "aria-label": footerActionLabel !== null && footerActionLabel !== void 0 ? footerActionLabel : 'Save customer', variant: "icon", width: "fit-content", onClick: onFooterActionClick, children: _jsx(TicketBookmark, { boxSize: "5" }) }) })] }));
23
+ return (_jsxs(Container, { variant: "launchpad", w: cardWidth, maxW: "none", mx: "0", overflow: "hidden", bg: "neutral.white", cursor: onCardClick ? 'pointer' : 'default', onClick: onCardClick, children: [renderStatus(), _jsx(Image, { src: imageSource, alt: imageAlternativeText, h: "90px", w: "100%", objectFit: "cover" }), _jsxs(Stack, { spacing: "1", p: "base", borderBottom: "1px solid", borderColor: dividerColor, children: [_jsx(Text, { textTransform: "uppercase", fontWeight: "medium", children: customerTitle }), renderAddress()] }), _jsx(Flex, { h: "40px", p: "base", align: "center", justify: "space-between", children: onFooterActionClick && (_jsx(IconButton, { "aria-label": footerActionLabel !== null && footerActionLabel !== void 0 ? footerActionLabel : 'Save customer', variant: "icon", width: "fit-content", onClick: (event) => {
24
+ event.stopPropagation();
25
+ onFooterActionClick();
26
+ }, children: _jsx(TicketBookmark, { boxSize: "5" }) })) })] }));
21
27
  };
@@ -1,2 +1,2 @@
1
1
  import { PartnerServiceTicketCardI } from '../../../interfaces';
2
- export declare const PartnerServiceTicketCard: ({ customerName, display, description, footerActionLabel, headerLabel, infoBackground, meta, onFooterActionClick, }: PartnerServiceTicketCardI) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const PartnerServiceTicketCard: ({ customerName, display, description, footerActionLabel, headerLabel, infoBackground, meta, onCardClick, onFooterActionClick, }: PartnerServiceTicketCardI) => import("react/jsx-runtime").JSX.Element;
@@ -1,14 +1,20 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Box, Container, Flex, Grid, IconButton, Stack, Text, } from '@chakra-ui/react';
3
3
  import { TicketBookmark } from '../../../components';
4
- export const PartnerServiceTicketCard = ({ customerName, display = 'grid', description, footerActionLabel, headerLabel, infoBackground = '#e6ddf1', meta, onFooterActionClick, }) => {
4
+ export const PartnerServiceTicketCard = ({ customerName, display = 'grid', description, footerActionLabel, headerLabel, infoBackground = '#e6ddf1', meta, onCardClick, onFooterActionClick, }) => {
5
5
  const isListDisplay = display === 'list';
6
6
  const dividerColor = 'lightBlue.2';
7
7
  const cardWidth = isListDisplay ? '100%' : '180px';
8
8
  const renderMeta = () => (_jsx(Box, { bg: infoBackground, p: "base", minW: { base: '100%', md: '220px' }, children: meta.map(({ label, value }) => (_jsxs(Grid, { templateColumns: "40% 60%", gap: "0", children: [_jsx(Text, { fontFamily: "secondary", fontSize: "xxs", textTransform: "uppercase", lineHeight: "1.4", children: label }), _jsx(Text, { fontFamily: "secondary", fontSize: "xxs", fontWeight: "bold", textTransform: "uppercase", lineHeight: "1.4", children: value })] }, label))) }));
9
9
  const renderBody = () => (_jsxs(Stack, { spacing: "1", p: "base", borderBottom: "1px solid", borderColor: dividerColor, flex: "1", justify: "center", children: [_jsx(Text, { textTransform: "uppercase", fontWeight: "medium", children: customerName }), _jsx(Text, { fontFamily: "secondary", fontSize: "sm", lineHeight: "1.2", children: description })] }));
10
10
  if (isListDisplay) {
11
- return (_jsx(Container, { variant: "launchpad", w: cardWidth, maxW: "none", mx: "0", overflow: "hidden", bg: "neutral.white", children: _jsxs(Flex, { direction: { base: 'column', md: 'row' }, align: "stretch", children: [_jsx(Flex, { p: "2", align: "center", minW: { base: '100%', md: '130px' }, borderBottomWidth: { base: '1px', md: '0' }, borderBottomStyle: "solid", borderRightWidth: { base: '0', md: '1px' }, borderRightStyle: "solid", borderBottomColor: dividerColor, borderRightColor: dividerColor, children: _jsx(Text, { fontSize: "xs", fontWeight: "medium", textTransform: "uppercase", children: headerLabel }) }), renderMeta(), _jsxs(Stack, { spacing: "1", p: "base", flex: "1", justify: "center", minW: "0", children: [_jsx(Text, { textTransform: "uppercase", fontWeight: "medium", children: customerName }), _jsx(Text, { fontFamily: "secondary", fontSize: "sm", lineHeight: "1.2", children: description })] }), _jsx(Flex, { p: "base", align: "center", justify: "center", borderTopWidth: { base: '1px', md: '0' }, borderTopStyle: "solid", borderLeftWidth: { base: '0', md: '1px' }, borderLeftStyle: "solid", borderTopColor: dividerColor, borderLeftColor: dividerColor, minW: { base: '100%', md: '64px' }, children: _jsx(IconButton, { "aria-label": footerActionLabel !== null && footerActionLabel !== void 0 ? footerActionLabel : 'Save ticket', variant: "icon", width: "fit-content", onClick: onFooterActionClick, children: _jsx(TicketBookmark, { boxSize: "5" }) }) })] }) }));
11
+ return (_jsx(Container, { variant: "launchpad", w: cardWidth, maxW: "none", mx: "0", overflow: "hidden", bg: "neutral.white", cursor: onCardClick ? 'pointer' : 'default', onClick: onCardClick, children: _jsxs(Flex, { direction: { base: 'column', md: 'row' }, align: "stretch", children: [_jsx(Flex, { p: "2", align: "center", minW: { base: '100%', md: '130px' }, borderBottomWidth: { base: '1px', md: '0' }, borderBottomStyle: "solid", borderRightWidth: { base: '0', md: '1px' }, borderRightStyle: "solid", borderBottomColor: dividerColor, borderRightColor: dividerColor, children: _jsx(Text, { fontSize: "xs", fontWeight: "medium", textTransform: "uppercase", children: headerLabel }) }), renderMeta(), _jsxs(Stack, { spacing: "1", p: "base", flex: "1", justify: "center", minW: "0", children: [_jsx(Text, { textTransform: "uppercase", fontWeight: "medium", children: customerName }), _jsx(Text, { fontFamily: "secondary", fontSize: "sm", lineHeight: "1.2", children: description })] }), _jsx(Flex, { p: "base", align: "center", justify: "center", borderTopWidth: { base: '1px', md: '0' }, borderTopStyle: "solid", borderLeftWidth: { base: '0', md: '1px' }, borderLeftStyle: "solid", borderTopColor: dividerColor, borderLeftColor: dividerColor, minW: { base: '100%', md: '64px' }, children: onFooterActionClick && (_jsx(IconButton, { "aria-label": footerActionLabel !== null && footerActionLabel !== void 0 ? footerActionLabel : 'Save ticket', variant: "icon", width: "fit-content", onClick: (event) => {
12
+ event.stopPropagation();
13
+ onFooterActionClick();
14
+ }, children: _jsx(TicketBookmark, { boxSize: "5" }) })) })] }) }));
12
15
  }
13
- return (_jsxs(Container, { variant: "launchpad", w: cardWidth, maxW: "none", mx: "0", overflow: "hidden", bg: "neutral.white", children: [_jsx(Box, { p: "2", children: _jsx(Text, { fontSize: "xs", fontWeight: "medium", textTransform: "uppercase", children: headerLabel }) }), renderMeta(), renderBody(), _jsx(Flex, { h: "40px", p: "base", align: "center", justify: "space-between", children: _jsx(IconButton, { "aria-label": footerActionLabel !== null && footerActionLabel !== void 0 ? footerActionLabel : 'Save ticket', variant: "icon", width: "fit-content", onClick: onFooterActionClick, children: _jsx(TicketBookmark, { boxSize: "5" }) }) })] }));
16
+ return (_jsxs(Container, { variant: "launchpad", w: cardWidth, maxW: "none", mx: "0", overflow: "hidden", bg: "neutral.white", cursor: onCardClick ? 'pointer' : 'default', onClick: onCardClick, children: [_jsx(Box, { p: "2", children: _jsx(Text, { fontSize: "xs", fontWeight: "medium", textTransform: "uppercase", children: headerLabel }) }), renderMeta(), renderBody(), _jsx(Flex, { h: "40px", p: "base", align: "center", justify: "space-between", children: onFooterActionClick && (_jsx(IconButton, { "aria-label": footerActionLabel !== null && footerActionLabel !== void 0 ? footerActionLabel : 'Save ticket', variant: "icon", width: "fit-content", onClick: (event) => {
17
+ event.stopPropagation();
18
+ onFooterActionClick();
19
+ }, children: _jsx(TicketBookmark, { boxSize: "5" }) })) })] }));
14
20
  };
@@ -6,6 +6,7 @@ export interface PartnerCustomerCardI {
6
6
  footerActionLabel?: string;
7
7
  imageAlt?: string;
8
8
  imageSrc?: string;
9
+ onCardClick?: () => void;
9
10
  onFooterActionClick?: () => void;
10
11
  statusColor?: string;
11
12
  statusLabel?: string;
@@ -12,6 +12,7 @@ export interface PartnerServiceTicketCardI {
12
12
  headerLabel: string;
13
13
  infoBackground?: string;
14
14
  meta: PartnerServiceTicketMetaI[];
15
+ onCardClick?: () => void;
15
16
  onFooterActionClick?: () => void;
16
17
  onStatusChange?: (value: string) => void;
17
18
  statusOptions?: SelectItemI<string>[];
@@ -28,6 +28,7 @@ const customers = [
28
28
  statusLabel: 'Dormant',
29
29
  statusColor: 'lightBlue.8',
30
30
  addressLines: ['3273 S First Street', 'Austin, TX 78742'],
31
+ onCardClick: action('onCardClick'),
31
32
  onFooterActionClick: action('onFooterActionClick'),
32
33
  },
33
34
  {
@@ -35,6 +36,7 @@ const customers = [
35
36
  statusLabel: 'Active',
36
37
  statusColor: 'green.2',
37
38
  addressLines: ['3273 S First Street', 'Austin, TX 78742'],
39
+ onCardClick: action('onCardClick'),
38
40
  onFooterActionClick: action('onFooterActionClick'),
39
41
  },
40
42
  {
@@ -42,6 +44,7 @@ const customers = [
42
44
  statusLabel: 'Cancelled',
43
45
  statusColor: 'orange.2',
44
46
  addressLines: ['3273 S First Street', 'Austin, TX 78742'],
47
+ onCardClick: action('onCardClick'),
45
48
  onFooterActionClick: action('onFooterActionClick'),
46
49
  },
47
50
  {
@@ -49,6 +52,7 @@ const customers = [
49
52
  statusLabel: 'New',
50
53
  statusColor: 'violet.1',
51
54
  addressLines: ['3273 S First Street', 'Austin, TX 78742'],
55
+ onCardClick: action('onCardClick'),
52
56
  onFooterActionClick: action('onFooterActionClick'),
53
57
  },
54
58
  ];
@@ -42,13 +42,13 @@ export const PartnerServiceTicketsWrapperComponent = (args) => {
42
42
  { label: 'Customer', value: 'New Customer' },
43
43
  { label: 'Received', value: '9:30 AM' },
44
44
  { label: 'ID', value: '553HMF 8422324-D' },
45
- ], onFooterActionClick: action('onFooterActionClick') }) }) }), _jsx(WrapItem, { w: isListDisplay ? '100%' : 'auto', children: _jsx(Box, { w: isListDisplay ? '100%' : 'auto', children: _jsx(PartnerServiceTicketCard, { display: displayType, customerName: "Jane Smith", description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do", headerLabel: "Support", infoBackground: "#efdaf6", meta: [
45
+ ], onCardClick: action('onCardClick'), onFooterActionClick: action('onFooterActionClick') }) }) }), _jsx(WrapItem, { w: isListDisplay ? '100%' : 'auto', children: _jsx(Box, { w: isListDisplay ? '100%' : 'auto', children: _jsx(PartnerServiceTicketCard, { display: displayType, customerName: "Jane Smith", description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do", headerLabel: "Support", infoBackground: "#efdaf6", meta: [
46
46
  { label: 'Customer', value: 'Existing' },
47
47
  { label: 'Received', value: '9:30 AM' },
48
48
  { label: 'ID', value: '553HMF 8422324-D' },
49
- ], onFooterActionClick: action('onFooterActionClick') }) }) }), _jsx(WrapItem, { w: isListDisplay ? '100%' : 'auto', children: _jsx(Box, { w: isListDisplay ? '100%' : 'auto', children: _jsx(PartnerServiceTicketCard, { display: displayType, customerName: "Michael Smith", description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do", headerLabel: "Support", infoBackground: "#f5e3d7", meta: [
49
+ ], onCardClick: action('onCardClick'), onFooterActionClick: action('onFooterActionClick') }) }) }), _jsx(WrapItem, { w: isListDisplay ? '100%' : 'auto', children: _jsx(Box, { w: isListDisplay ? '100%' : 'auto', children: _jsx(PartnerServiceTicketCard, { display: displayType, customerName: "Michael Smith", description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do", headerLabel: "Support", infoBackground: "#f5e3d7", meta: [
50
50
  { label: 'Customer', value: 'Existing' },
51
51
  { label: 'Received', value: '9:30 AM' },
52
52
  { label: 'ID', value: '553HMF 8422324-D' },
53
- ], onFooterActionClick: action('onFooterActionClick') }) }) })] })] })) }));
53
+ ], onCardClick: action('onCardClick'), onFooterActionClick: action('onFooterActionClick') }) }) })] })] })) }));
54
54
  };
@@ -16,6 +16,7 @@ export default {
16
16
  { label: 'Received', value: '9:30 AM' },
17
17
  { label: 'ID', value: '553HMF 8422324-D' },
18
18
  ],
19
+ onCardClick: action('onCardClick'),
19
20
  onFooterActionClick: action('onFooterActionClick'),
20
21
  },
21
22
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homefile/components-v2",
3
- "version": "2.49.1",
3
+ "version": "2.49.2",
4
4
  "author": "Homefile",
5
5
  "license": "UNLICENSED",
6
6
  "typings": "dist/index.d.ts",