@homefile/components-v2 2.47.5 → 2.48.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.
Files changed (39) hide show
  1. package/dist/components/buttons/DisplayOptionsButtons.d.ts +1 -1
  2. package/dist/components/buttons/DisplayOptionsButtons.js +2 -2
  3. package/dist/components/icons/DisplayGrid.d.ts +5 -1
  4. package/dist/components/icons/DisplayGrid.js +14 -2
  5. package/dist/components/icons/DisplayItem.d.ts +5 -1
  6. package/dist/components/icons/DisplayItem.js +14 -2
  7. package/dist/components/icons/DisplayList.d.ts +5 -1
  8. package/dist/components/icons/DisplayList.js +14 -2
  9. package/dist/components/icons/TicketBookmark.d.ts +4 -0
  10. package/dist/components/icons/TicketBookmark.js +18 -0
  11. package/dist/components/icons/index.d.ts +1 -0
  12. package/dist/components/icons/index.js +1 -0
  13. package/dist/components/partner/index.d.ts +1 -0
  14. package/dist/components/partner/index.js +1 -0
  15. package/dist/components/partner/serviceTickets/PartnerServiceTicketCard.d.ts +2 -0
  16. package/dist/components/partner/serviceTickets/PartnerServiceTicketCard.js +14 -0
  17. package/dist/components/partner/serviceTickets/PartnerServiceTicketsToolbar.d.ts +2 -0
  18. package/dist/components/partner/serviceTickets/PartnerServiceTicketsToolbar.js +14 -0
  19. package/dist/components/partner/serviceTickets/PartnerServiceTicketsWrapper.d.ts +2 -0
  20. package/dist/components/partner/serviceTickets/PartnerServiceTicketsWrapper.js +7 -0
  21. package/dist/components/partner/serviceTickets/index.d.ts +3 -0
  22. package/dist/components/partner/serviceTickets/index.js +3 -0
  23. package/dist/interfaces/buttons/DisplayOptionsButtons.interface.d.ts +1 -0
  24. package/dist/interfaces/inputs/Select.interface.d.ts +1 -1
  25. package/dist/interfaces/partner/PartnerServiceTicketsToolbar.interface.d.ts +17 -0
  26. package/dist/interfaces/partner/PartnerServiceTicketsToolbar.interface.js +1 -0
  27. package/dist/interfaces/partner/PartnerServiceTicketsWrapper.interface.d.ts +11 -0
  28. package/dist/interfaces/partner/PartnerServiceTicketsWrapper.interface.js +1 -0
  29. package/dist/interfaces/partner/index.d.ts +3 -0
  30. package/dist/interfaces/partner/index.js +3 -0
  31. package/dist/interfaces/partner/serviceTickets/PartnerServiceTicketCard.interface.d.ts +19 -0
  32. package/dist/interfaces/partner/serviceTickets/PartnerServiceTicketCard.interface.js +1 -0
  33. package/dist/interfaces/partner/serviceTickets/index.d.ts +1 -0
  34. package/dist/interfaces/partner/serviceTickets/index.js +1 -0
  35. package/dist/stories/partner/PartnerServiceTicketsWrapper.stories.d.ts +5 -0
  36. package/dist/stories/partner/PartnerServiceTicketsWrapper.stories.js +54 -0
  37. package/dist/stories/partner/serviceTickets/PartnerServiceTicketCard.stories.d.ts +6 -0
  38. package/dist/stories/partner/serviceTickets/PartnerServiceTicketCard.stories.js +27 -0
  39. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
1
  import { DisplayOptionsButtonsI } from '../../interfaces';
2
- export declare const DisplayOptionsButtons: ({ displays, initialDisplay, onDisplayClick, }: DisplayOptionsButtonsI) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const DisplayOptionsButtons: ({ displays, iconSize, initialDisplay, onDisplayClick, }: DisplayOptionsButtonsI) => import("react/jsx-runtime").JSX.Element;
@@ -3,7 +3,7 @@ import { useState } from 'react';
3
3
  import { Flex, Button } from '@chakra-ui/react';
4
4
  import { colors } from '../../theme/colors';
5
5
  import { DisplayItem, DisplayList, DisplayGrid } from '../../components';
6
- export const DisplayOptionsButtons = ({ displays = [], initialDisplay, onDisplayClick, }) => {
6
+ export const DisplayOptionsButtons = ({ displays = [], iconSize = 5, initialDisplay, onDisplayClick, }) => {
7
7
  const types = displays;
8
8
  const [display, setDisplay] = useState(initialDisplay);
9
9
  const handleDisplayClick = (type) => {
@@ -13,5 +13,5 @@ export const DisplayOptionsButtons = ({ displays = [], initialDisplay, onDisplay
13
13
  const getCurrentDisplayColor = (type) => {
14
14
  return display === type ? colors.blue[3] : colors.blue[1];
15
15
  };
16
- return (_jsx(Flex, { gap: "base", children: types.map((type) => (_jsxs(Button, { variant: "displayIcon", onClick: () => handleDisplayClick(type), children: [type === 'list' && (_jsx(DisplayList, { stroke: getCurrentDisplayColor(type) })), type === 'item' && (_jsx(DisplayItem, { stroke: getCurrentDisplayColor(type) })), type === 'grid' && (_jsx(DisplayGrid, { stroke: getCurrentDisplayColor(type) }))] }, type))) }));
16
+ return (_jsx(Flex, { gap: "base", children: types.map((type) => (_jsxs(Button, { variant: "displayIcon", onClick: () => handleDisplayClick(type), minW: "fit-content", h: "fit-content", p: "0", children: [type === 'list' && (_jsx(DisplayList, { boxSize: iconSize, stroke: getCurrentDisplayColor(type) })), type === 'item' && (_jsx(DisplayItem, { boxSize: iconSize, stroke: getCurrentDisplayColor(type) })), type === 'grid' && (_jsx(DisplayGrid, { boxSize: iconSize, stroke: getCurrentDisplayColor(type) }))] }, type))) }));
17
17
  };
@@ -1 +1,5 @@
1
- export declare const DisplayGrid: ({ stroke, }: React.SVGProps<SVGGElement>) => import("react/jsx-runtime").JSX.Element;
1
+ type DisplayIconProps = React.SVGProps<SVGGElement> & {
2
+ boxSize?: number | string;
3
+ };
4
+ export declare const DisplayGrid: ({ boxSize, stroke, ...props }: DisplayIconProps) => import("react/jsx-runtime").JSX.Element;
5
+ export {};
@@ -1,6 +1,18 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
1
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
13
  import { Icon } from '@chakra-ui/react';
3
14
  import { colors } from '../../theme/colors';
4
- export const DisplayGrid = ({ stroke = colors.blue[3], }) => {
5
- return (_jsx(Icon, { children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 19.5 19.5", children: _jsxs("g", { fill: "none", stroke: stroke, strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "1.5", "data-name": "Group 14495", children: [_jsx("path", { d: "M.75.75h7.321v7.321H.75Z", "data-name": "Path 10064" }), _jsx("path", { d: "M11.429.75h7.321v7.321h-7.321Z", "data-name": "Path 10065" }), _jsx("path", { d: "M11.429 11.428h7.321v7.321h-7.321Z", "data-name": "Path 10066" }), _jsx("path", { d: "M.75 11.428h7.321v7.321H.75Z", "data-name": "Path 10067" })] }) }) }));
15
+ export const DisplayGrid = (_a) => {
16
+ var { boxSize, stroke = colors.blue[3] } = _a, props = __rest(_a, ["boxSize", "stroke"]);
17
+ return (_jsx(Icon, { viewBox: "0 0 19.5 19.5", boxSize: boxSize, children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 19.5 19.5", children: _jsxs("g", Object.assign({ fill: "none", stroke: stroke, strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "1.5", "data-name": "Group 14495" }, props, { children: [_jsx("path", { d: "M.75.75h7.321v7.321H.75Z", "data-name": "Path 10064" }), _jsx("path", { d: "M11.429.75h7.321v7.321h-7.321Z", "data-name": "Path 10065" }), _jsx("path", { d: "M11.429 11.428h7.321v7.321h-7.321Z", "data-name": "Path 10066" }), _jsx("path", { d: "M.75 11.428h7.321v7.321H.75Z", "data-name": "Path 10067" })] })) }) }));
6
18
  };
@@ -1 +1,5 @@
1
- export declare const DisplayItem: ({ stroke, }: React.SVGProps<SVGGElement>) => import("react/jsx-runtime").JSX.Element;
1
+ type DisplayIconProps = React.SVGProps<SVGGElement> & {
2
+ boxSize?: number | string;
3
+ };
4
+ export declare const DisplayItem: ({ boxSize, stroke, ...props }: DisplayIconProps) => import("react/jsx-runtime").JSX.Element;
5
+ export {};
@@ -1,6 +1,18 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
1
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
13
  import { Icon } from '@chakra-ui/react';
3
14
  import { colors } from '../../theme/colors';
4
- export const DisplayItem = ({ stroke = colors.blue[3], }) => {
5
- return (_jsx(Icon, { viewBox: "0 0 200 200", color: "red.500", children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 19.79 17.374", children: _jsxs("g", { stroke: stroke, "data-name": "Group 14548", children: [_jsx("path", { fill: "none", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "1.5", d: "M.75.75h18.29v11.438H.75Z", "data-name": "Path 10082" }), _jsxs("g", { fill: stroke, "data-name": "Rectangle 16845", children: [_jsx("path", { stroke: "none", d: "M.833 14.374h3v3h-3z" }), _jsx("path", { fill: "none", d: "M1.333 14.874h2v2h-2z" })] }), _jsxs("g", { fill: stroke, "data-name": "Rectangle 16846", children: [_jsx("path", { stroke: "none", d: "M5.833 14.374h3v3h-3z" }), _jsx("path", { fill: "none", d: "M6.333 14.874h2v2h-2z" })] }), _jsxs("g", { fill: stroke, "data-name": "Rectangle 16847", children: [_jsx("path", { stroke: "none", d: "M10.833 14.374h3v3h-3z" }), _jsx("path", { fill: "none", d: "M11.333 14.874h2v2h-2z" })] }), _jsxs("g", { fill: stroke, "data-name": "Rectangle 16848", children: [_jsx("path", { stroke: "none", d: "M15.833 14.374h3v3h-3z" }), _jsx("path", { fill: "none", d: "M16.333 14.874h2v2h-2z" })] })] }) }) }));
15
+ export const DisplayItem = (_a) => {
16
+ var { boxSize, stroke = colors.blue[3] } = _a, props = __rest(_a, ["boxSize", "stroke"]);
17
+ return (_jsx(Icon, { viewBox: "0 0 19.79 17.374", boxSize: boxSize, children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 19.79 17.374", children: _jsxs("g", Object.assign({ stroke: stroke, "data-name": "Group 14548" }, props, { children: [_jsx("path", { fill: "none", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "1.5", d: "M.75.75h18.29v11.438H.75Z", "data-name": "Path 10082" }), _jsxs("g", { fill: stroke, "data-name": "Rectangle 16845", children: [_jsx("path", { stroke: "none", d: "M.833 14.374h3v3h-3z" }), _jsx("path", { fill: "none", d: "M1.333 14.874h2v2h-2z" })] }), _jsxs("g", { fill: stroke, "data-name": "Rectangle 16846", children: [_jsx("path", { stroke: "none", d: "M5.833 14.374h3v3h-3z" }), _jsx("path", { fill: "none", d: "M6.333 14.874h2v2h-2z" })] }), _jsxs("g", { fill: stroke, "data-name": "Rectangle 16847", children: [_jsx("path", { stroke: "none", d: "M10.833 14.374h3v3h-3z" }), _jsx("path", { fill: "none", d: "M11.333 14.874h2v2h-2z" })] }), _jsxs("g", { fill: stroke, "data-name": "Rectangle 16848", children: [_jsx("path", { stroke: "none", d: "M15.833 14.374h3v3h-3z" }), _jsx("path", { fill: "none", d: "M16.333 14.874h2v2h-2z" })] })] })) }) }));
6
18
  };
@@ -1 +1,5 @@
1
- export declare const DisplayList: ({ stroke, }: React.SVGProps<SVGGElement>) => import("react/jsx-runtime").JSX.Element;
1
+ type DisplayIconProps = React.SVGProps<SVGGElement> & {
2
+ boxSize?: number | string;
3
+ };
4
+ export declare const DisplayList: ({ boxSize, stroke, ...props }: DisplayIconProps) => import("react/jsx-runtime").JSX.Element;
5
+ export {};
@@ -1,6 +1,18 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
1
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
13
  import { Icon } from '@chakra-ui/react';
3
14
  import { colors } from '../../theme/colors';
4
- export const DisplayList = ({ stroke = colors.blue[3], }) => {
5
- return (_jsx(Icon, { viewBox: "0 0 200 200", color: "red.500", children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 18 14", children: _jsxs("g", { fill: stroke, "data-name": "Group 14455", children: [_jsx("path", { d: "M5 0h13v2H5z", "data-name": "Rectangle 14122" }), _jsx("path", { d: "M5 6h13v2H5z", "data-name": "Rectangle 14123" }), _jsx("path", { d: "M5 12h13v2H5z", "data-name": "Rectangle 14124" }), _jsx("path", { d: "M0 0h3v2H0z", "data-name": "Rectangle 14122" }), _jsx("path", { d: "M0 6h3v2H0z", "data-name": "Rectangle 14123" }), _jsx("path", { d: "M0 12h3v2H0z", "data-name": "Rectangle 14124" })] }) }) }));
15
+ export const DisplayList = (_a) => {
16
+ var { boxSize, stroke = colors.blue[3] } = _a, props = __rest(_a, ["boxSize", "stroke"]);
17
+ return (_jsx(Icon, { viewBox: "0 0 18 14", boxSize: boxSize, children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 18 14", children: _jsxs("g", Object.assign({ fill: stroke, "data-name": "Group 14455" }, props, { children: [_jsx("path", { d: "M5 0h13v2H5z", "data-name": "Rectangle 14122" }), _jsx("path", { d: "M5 6h13v2H5z", "data-name": "Rectangle 14123" }), _jsx("path", { d: "M5 12h13v2H5z", "data-name": "Rectangle 14124" }), _jsx("path", { d: "M0 0h3v2H0z", "data-name": "Rectangle 14122" }), _jsx("path", { d: "M0 6h3v2H0z", "data-name": "Rectangle 14123" }), _jsx("path", { d: "M0 12h3v2H0z", "data-name": "Rectangle 14124" })] })) }) }));
6
18
  };
@@ -0,0 +1,4 @@
1
+ import { IconProps } from '@chakra-ui/react';
2
+ export declare const TicketBookmark: ({ stroke, ...props }: IconProps & {
3
+ stroke?: string;
4
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,18 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ import { Icon } from '@chakra-ui/react';
14
+ import { colors } from '../../theme/colors';
15
+ export const TicketBookmark = (_a) => {
16
+ var { stroke = colors.blue[2] } = _a, props = __rest(_a, ["stroke"]);
17
+ return (_jsx(Icon, Object.assign({ viewBox: "0 0 24 32" }, props, { children: _jsx("path", { d: "M6 3.5h12A1.5 1.5 0 0 1 19.5 5v22L12 22.385 4.5 27V5A1.5 1.5 0 0 1 6 3.5Z", fill: "none", stroke: stroke, strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2.5" }) })));
18
+ };
@@ -28,6 +28,7 @@ export * from './Plus';
28
28
  export * from './SearchIcon';
29
29
  export * from './ShareIcon';
30
30
  export * from './Star';
31
+ export * from './TicketBookmark';
31
32
  export * from './TikTok';
32
33
  export * from './Trash';
33
34
  export * from './Twitter';
@@ -28,6 +28,7 @@ export * from './Plus';
28
28
  export * from './SearchIcon';
29
29
  export * from './ShareIcon';
30
30
  export * from './Star';
31
+ export * from './TicketBookmark';
31
32
  export * from './TikTok';
32
33
  export * from './Trash';
33
34
  export * from './Twitter';
@@ -5,6 +5,7 @@ export * from './catalog';
5
5
  export * from './formTile';
6
6
  export * from './panel';
7
7
  export * from './popup';
8
+ export * from './serviceTickets';
8
9
  export * from './Fader';
9
10
  export * from './HeaderPartnerLogo';
10
11
  export * from './PartnerAddButton';
@@ -5,6 +5,7 @@ export * from './catalog';
5
5
  export * from './formTile';
6
6
  export * from './panel';
7
7
  export * from './popup';
8
+ export * from './serviceTickets';
8
9
  export * from './Fader';
9
10
  export * from './HeaderPartnerLogo';
10
11
  export * from './PartnerAddButton';
@@ -0,0 +1,2 @@
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;
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box, Container, Flex, Grid, IconButton, Stack, Text, } from '@chakra-ui/react';
3
+ import { TicketBookmark } from '../../../components';
4
+ export const PartnerServiceTicketCard = ({ customerName, display = 'grid', description, footerActionLabel, headerLabel, infoBackground = '#e6ddf1', meta, onFooterActionClick, }) => {
5
+ const isListDisplay = display === 'list';
6
+ const dividerColor = 'lightBlue.2';
7
+ const cardWidth = isListDisplay ? '100%' : '180px';
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
+ 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
+ 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" }) }) })] }) }));
12
+ }
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" }) }) })] }));
14
+ };
@@ -0,0 +1,2 @@
1
+ import { PartnerServiceTicketsToolbarI } from '../../../interfaces';
2
+ export declare const PartnerServiceTicketsToolbar: ({ ageItems, initialAge, initialDisplay, initialPriority, initialStatus, newTicketLabel, onAgeChange, onDisplayChange, onNewTicketClick, onPriorityChange, onStatusChange, priorityItems, showNewTicketButton, statusItems, }: PartnerServiceTicketsToolbarI) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box, Button, Flex } from '@chakra-ui/react';
3
+ import { DisplayOptionsButtons, Plus, SelectInput } from '../../../components';
4
+ export const PartnerServiceTicketsToolbar = ({ ageItems, initialAge, initialDisplay = 'grid', initialPriority, initialStatus, newTicketLabel = 'TICKET', onAgeChange, onDisplayChange, onNewTicketClick, onPriorityChange, onStatusChange, priorityItems, showNewTicketButton = false, statusItems, }) => {
5
+ const getValue = (item) => typeof item === 'string' ? item : String(item._id);
6
+ const getButtonAriaLabel = () => {
7
+ const sanitizedLabel = newTicketLabel.trim();
8
+ if (!sanitizedLabel.length) {
9
+ return 'Create service ticket';
10
+ }
11
+ return `Create ${sanitizedLabel.toLowerCase()}`;
12
+ };
13
+ return (_jsx(Box, { p: "base", as: "section", "aria-label": "Service tickets toolbar", children: _jsxs(Flex, { align: { base: 'stretch', md: 'center' }, justify: "space-between", gap: "base", direction: { base: 'column', md: 'row' }, children: [_jsxs(Flex, { gap: { base: 'base', lg: '12' }, align: { base: 'stretch', lg: 'center' }, direction: { base: 'column', lg: 'row' }, flex: "1", children: [showNewTicketButton && (_jsx(Box, { ml: { base: '0', lg: '-base' }, children: _jsx(Button, { id: "addServiceTicketButton", size: "md", onClick: onNewTicketClick, leftIcon: _jsx(Plus, {}), variant: "rightRounded", w: { base: '100%', sm: 'auto' }, "aria-label": getButtonAriaLabel(), children: newTicketLabel }) })), _jsxs(Flex, { gap: "base", wrap: "wrap", flex: "1", children: [_jsx(Box, { w: { base: '100%', sm: '140px' }, children: _jsx(SelectInput, { height: "md", width: "100%", handleClick: (item) => onAgeChange(getValue(item)), items: ageItems, initialValue: initialAge }) }), _jsx(Box, { w: { base: '100%', sm: '140px' }, children: _jsx(SelectInput, { height: "md", width: "100%", handleClick: (item) => onPriorityChange(getValue(item)), items: priorityItems, initialValue: initialPriority }) }), _jsx(Box, { w: { base: '100%', sm: '200px' }, children: _jsx(SelectInput, { height: "md", width: "100%", handleClick: (item) => onStatusChange(getValue(item)), items: statusItems, initialValue: initialStatus }) })] })] }), _jsx(Box, { alignSelf: { base: 'flex-end', md: 'center' }, children: _jsx(DisplayOptionsButtons, { displays: ['list', 'grid'], initialDisplay: initialDisplay, onDisplayClick: onDisplayChange, iconSize: 6 }) })] }) }));
14
+ };
@@ -0,0 +1,2 @@
1
+ import { PartnerServiceTicketsWrapperI } from '../../../interfaces';
2
+ export declare const PartnerServiceTicketsWrapper: ({ children, menuItems, onHelpClick, showHelp, title, titleIcon, tooltipLabel, }: PartnerServiceTicketsWrapperI) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box, Container } from '@chakra-ui/react';
3
+ import { Manager } from '../../../assets/images';
4
+ import { ContainerHeader, MoreHorizontal, TileTooltip } from '../../../components';
5
+ export const PartnerServiceTicketsWrapper = ({ children, menuItems = [], onHelpClick, showHelp = false, title = 'Service Tickets', titleIcon = Manager, tooltipLabel = 'Service Tickets', }) => {
6
+ return (_jsx(TileTooltip, { label: tooltipLabel, children: _jsxs(Container, { variant: "launchpad", h: "full", maxW: "none", p: "0", position: "relative", overflow: "hidden", bg: "lightBlue.1", children: [_jsx(ContainerHeader, { title: title, titleIcon: titleIcon, icon: _jsx(MoreHorizontal, { size: 38 }), menuItems: menuItems, onHelpClick: onHelpClick, showHelp: showHelp, fontWeight: "normal" }), _jsx(Box, { minH: "420px", bg: "lightBlue.1", children: children })] }) }));
7
+ };
@@ -0,0 +1,3 @@
1
+ export * from './PartnerServiceTicketCard';
2
+ export * from './PartnerServiceTicketsToolbar';
3
+ export * from './PartnerServiceTicketsWrapper';
@@ -0,0 +1,3 @@
1
+ export * from './PartnerServiceTicketCard';
2
+ export * from './PartnerServiceTicketsToolbar';
3
+ export * from './PartnerServiceTicketsWrapper';
@@ -1,6 +1,7 @@
1
1
  import { DisplayOptionsType } from '../../interfaces';
2
2
  export interface DisplayOptionsButtonsI {
3
3
  displays?: DisplayOptionsType[];
4
+ iconSize?: number | string;
4
5
  initialDisplay?: DisplayOptionsType;
5
6
  onDisplayClick: (type: DisplayOptionsType) => void;
6
7
  }
@@ -14,7 +14,7 @@ export interface SelectI {
14
14
  label?: string;
15
15
  placeholder?: string;
16
16
  width?: string;
17
- variant?: 'primary' | 'secondary' | 'tertiary' | 'accountType';
17
+ variant?: 'primary' | 'secondary' | 'tertiary' | 'accountType' | 'serviceTicket';
18
18
  displaySelectedValue?: boolean;
19
19
  emptyValues?: string[];
20
20
  }
@@ -0,0 +1,17 @@
1
+ import { DisplayOptionsType, SelectItemI } from '../../interfaces';
2
+ export interface PartnerServiceTicketsToolbarI {
3
+ ageItems: SelectItemI<string>[];
4
+ initialAge?: string;
5
+ initialDisplay?: DisplayOptionsType;
6
+ initialPriority?: string;
7
+ initialStatus?: string;
8
+ newTicketLabel?: string;
9
+ onAgeChange: (value: string) => void;
10
+ onDisplayChange: (display: DisplayOptionsType) => void;
11
+ onNewTicketClick?: () => void;
12
+ onPriorityChange: (value: string) => void;
13
+ onStatusChange: (value: string) => void;
14
+ priorityItems: SelectItemI<string>[];
15
+ showNewTicketButton?: boolean;
16
+ statusItems: SelectItemI<string>[];
17
+ }
@@ -0,0 +1,11 @@
1
+ import { ReactNode } from 'react';
2
+ import { MenuItemI } from '../../interfaces';
3
+ export interface PartnerServiceTicketsWrapperI {
4
+ children?: ReactNode;
5
+ menuItems?: MenuItemI[];
6
+ onHelpClick?: () => void;
7
+ showHelp?: boolean;
8
+ title?: string;
9
+ titleIcon?: string;
10
+ tooltipLabel?: string;
11
+ }
@@ -4,6 +4,7 @@ export * from './charts';
4
4
  export * from './formTile';
5
5
  export * from './panel';
6
6
  export * from './popup';
7
+ export * from './serviceTickets';
7
8
  export * from './PartnerSidebarMenu.interface';
8
9
  export * from './HeaderPartnerLogo.interface';
9
10
  export * from './PartnerCallToAction.interface';
@@ -11,4 +12,6 @@ export * from './PartnerFooter.interface';
11
12
  export * from './PartnerHomeHeader.interface';
12
13
  export * from './PartnerHeader.interface';
13
14
  export * from './PartnerImage.interface';
15
+ export * from './PartnerServiceTicketsWrapper.interface';
16
+ export * from './PartnerServiceTicketsToolbar.interface';
14
17
  export * from './ShortPartnerTile.interface';
@@ -4,6 +4,7 @@ export * from './charts';
4
4
  export * from './formTile';
5
5
  export * from './panel';
6
6
  export * from './popup';
7
+ export * from './serviceTickets';
7
8
  export * from './PartnerSidebarMenu.interface';
8
9
  export * from './HeaderPartnerLogo.interface';
9
10
  export * from './PartnerCallToAction.interface';
@@ -11,4 +12,6 @@ export * from './PartnerFooter.interface';
11
12
  export * from './PartnerHomeHeader.interface';
12
13
  export * from './PartnerHeader.interface';
13
14
  export * from './PartnerImage.interface';
15
+ export * from './PartnerServiceTicketsWrapper.interface';
16
+ export * from './PartnerServiceTicketsToolbar.interface';
14
17
  export * from './ShortPartnerTile.interface';
@@ -0,0 +1,19 @@
1
+ import { ReactNode } from 'react';
2
+ import { SelectItemI } from '../../../interfaces';
3
+ export interface PartnerServiceTicketMetaI {
4
+ label: string;
5
+ value: ReactNode;
6
+ }
7
+ export interface PartnerServiceTicketCardI {
8
+ customerName: string;
9
+ display?: 'grid' | 'list';
10
+ description: string;
11
+ footerActionLabel?: string;
12
+ headerLabel: string;
13
+ infoBackground?: string;
14
+ meta: PartnerServiceTicketMetaI[];
15
+ onFooterActionClick?: () => void;
16
+ onStatusChange?: (value: string) => void;
17
+ statusOptions?: SelectItemI<string>[];
18
+ statusValue?: string;
19
+ }
@@ -0,0 +1 @@
1
+ export * from './PartnerServiceTicketCard.interface';
@@ -0,0 +1 @@
1
+ export * from './PartnerServiceTicketCard.interface';
@@ -0,0 +1,5 @@
1
+ import { Meta } from '@storybook/react';
2
+ import { PartnerServiceTicketsWrapperI } from '../../interfaces';
3
+ declare const _default: Meta<PartnerServiceTicketsWrapperI>;
4
+ export default _default;
5
+ export declare const PartnerServiceTicketsWrapperComponent: (args: PartnerServiceTicketsWrapperI) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,54 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from 'react';
3
+ import { Box, Wrap, WrapItem } from '@chakra-ui/react';
4
+ import { action } from '@storybook/addon-actions';
5
+ import { PartnerServiceTicketCard, PartnerServiceTicketsToolbar, PartnerServiceTicketsWrapper, } from '../../components';
6
+ import { menuMock } from '../../mocks';
7
+ const ageItems = [
8
+ { _id: 'age', name: 'Age' },
9
+ { _id: 'newest', name: 'Newest' },
10
+ { _id: 'oldest', name: 'Oldest' },
11
+ ];
12
+ const priorityItems = [
13
+ { _id: 'priority', name: 'Priority' },
14
+ { _id: 'high', name: 'High' },
15
+ { _id: 'medium', name: 'Medium' },
16
+ { _id: 'low', name: 'Low' },
17
+ ];
18
+ const statusItems = [
19
+ { _id: 'show-all', name: 'Show All' },
20
+ { _id: 'new', name: 'New Service' },
21
+ { _id: 'support', name: 'Support' },
22
+ ];
23
+ export default {
24
+ title: 'Components/Partner/Service Tickets',
25
+ component: PartnerServiceTicketsWrapper,
26
+ args: {
27
+ menuItems: menuMock,
28
+ showHelp: true,
29
+ onHelpClick: action('onHelpClick'),
30
+ },
31
+ };
32
+ export const PartnerServiceTicketsWrapperComponent = (args) => {
33
+ const [displayType, setDisplayType] = useState('grid');
34
+ const handleDisplayChange = (display) => {
35
+ if (display === 'grid' || display === 'list') {
36
+ setDisplayType(display);
37
+ }
38
+ action('onDisplayChange')(display);
39
+ };
40
+ const isListDisplay = displayType === 'list';
41
+ return (_jsx(Box, { p: ['0', 'base'], children: _jsxs(PartnerServiceTicketsWrapper, Object.assign({}, args, { children: [_jsx(PartnerServiceTicketsToolbar, { ageItems: ageItems, priorityItems: priorityItems, statusItems: statusItems, initialAge: "Age", initialPriority: "Priority", initialStatus: "Show All", initialDisplay: displayType, showNewTicketButton: true, onAgeChange: action('onAgeChange'), onDisplayChange: handleDisplayChange, onNewTicketClick: action('onNewTicketClick'), onPriorityChange: action('onPriorityChange'), onStatusChange: action('onStatusChange') }), _jsxs(Wrap, { spacing: "base", p: "base", align: "start", direction: isListDisplay ? 'column' : 'row', w: "100%", children: [_jsx(WrapItem, { w: isListDisplay ? '100%' : 'auto', children: _jsx(Box, { w: isListDisplay ? '100%' : 'auto', children: _jsx(PartnerServiceTicketCard, { display: displayType, customerName: "Gerry Jones", description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do", headerLabel: "New Service", infoBackground: "#d9d5e9", meta: [
42
+ { label: 'Customer', value: 'New Customer' },
43
+ { label: 'Received', value: '9:30 AM' },
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: [
46
+ { label: 'Customer', value: 'Existing' },
47
+ { label: 'Received', value: '9:30 AM' },
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: [
50
+ { label: 'Customer', value: 'Existing' },
51
+ { label: 'Received', value: '9:30 AM' },
52
+ { label: 'ID', value: '553HMF 8422324-D' },
53
+ ], onFooterActionClick: action('onFooterActionClick') }) }) })] })] })) }));
54
+ };
@@ -0,0 +1,6 @@
1
+ import { Meta } from '@storybook/react';
2
+ import { PartnerServiceTicketCardI } from '../../../interfaces';
3
+ declare const _default: Meta<PartnerServiceTicketCardI>;
4
+ export default _default;
5
+ export declare const PartnerServiceTicketCardComponent: (args: PartnerServiceTicketCardI) => import("react/jsx-runtime").JSX.Element;
6
+ export declare const PartnerServiceTicketCardListComponent: (args: PartnerServiceTicketCardI) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,27 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Box } from '@chakra-ui/react';
3
+ import { action } from '@storybook/addon-actions';
4
+ import { PartnerServiceTicketCard } from '../../../components';
5
+ export default {
6
+ title: 'Components/Partner/Service Tickets/Card',
7
+ component: PartnerServiceTicketCard,
8
+ args: {
9
+ customerName: 'Jane Smith',
10
+ description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do',
11
+ headerLabel: 'Support',
12
+ typeLabel: 'Support',
13
+ infoBackground: '#efdaf6',
14
+ meta: [
15
+ { label: 'Customer', value: 'Existing' },
16
+ { label: 'Received', value: '9:30 AM' },
17
+ { label: 'ID', value: '553HMF 8422324-D' },
18
+ ],
19
+ onFooterActionClick: action('onFooterActionClick'),
20
+ },
21
+ };
22
+ export const PartnerServiceTicketCardComponent = (args) => {
23
+ return (_jsx(Box, { w: "180px", children: _jsx(PartnerServiceTicketCard, Object.assign({}, args)) }));
24
+ };
25
+ export const PartnerServiceTicketCardListComponent = (args) => {
26
+ return (_jsx(Box, { w: "full", children: _jsx(PartnerServiceTicketCard, Object.assign({}, args, { display: "list" })) }));
27
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homefile/components-v2",
3
- "version": "2.47.5",
3
+ "version": "2.48.1",
4
4
  "author": "Homefile",
5
5
  "license": "UNLICENSED",
6
6
  "typings": "dist/index.d.ts",