@servicetitan/mpa-components 1.11.0 → 2.0.0
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.
- package/CHANGELOG.md +8 -0
- package/lib/components/brands/brand-card/actions-button-section.d.ts +6 -0
- package/lib/components/brands/brand-card/actions-button-section.d.ts.map +1 -0
- package/lib/components/brands/brand-card/actions-button-section.js +26 -0
- package/lib/components/brands/brand-card/actions-button-section.js.map +1 -0
- package/lib/components/brands/brand-card/brand-card.d.ts +1 -1
- package/lib/components/brands/brand-card/brand-card.d.ts.map +1 -1
- package/lib/components/brands/brand-card/brand-card.js +10 -55
- package/lib/components/brands/brand-card/brand-card.js.map +1 -1
- package/lib/components/brands/brand-card/brand-logo.d.ts +6 -0
- package/lib/components/brands/brand-card/brand-logo.d.ts.map +1 -0
- package/lib/components/brands/brand-card/brand-logo.js +8 -0
- package/lib/components/brands/brand-card/brand-logo.js.map +1 -0
- package/lib/components/brands/brand-card/cart-tags.d.ts +6 -0
- package/lib/components/brands/brand-card/cart-tags.d.ts.map +1 -0
- package/lib/components/brands/brand-card/cart-tags.js +10 -0
- package/lib/components/brands/brand-card/cart-tags.js.map +1 -0
- package/lib/components/brands/brand-card/name-and-mail-section.d.ts +7 -0
- package/lib/components/brands/brand-card/name-and-mail-section.d.ts.map +1 -0
- package/lib/components/brands/brand-card/name-and-mail-section.js +7 -0
- package/lib/components/brands/brand-card/name-and-mail-section.js.map +1 -0
- package/lib/components/brands/brand-card/single-action-button.d.ts +6 -0
- package/lib/components/brands/brand-card/single-action-button.d.ts.map +1 -0
- package/lib/components/brands/brand-card/single-action-button.js +34 -0
- package/lib/components/brands/brand-card/single-action-button.js.map +1 -0
- package/lib/components/brands/cards-grid/cards-grid.d.ts +2 -1
- package/lib/components/brands/cards-grid/cards-grid.d.ts.map +1 -1
- package/lib/components/brands/cards-grid/cards-grid.js +2 -3
- package/lib/components/brands/cards-grid/cards-grid.js.map +1 -1
- package/lib/components/brands/styles.module.less +7 -21
- package/lib/enums/brands.d.ts +4 -19
- package/lib/enums/brands.d.ts.map +1 -1
- package/lib/enums/brands.js +6 -1
- package/lib/enums/brands.js.map +1 -1
- package/lib/index.d.ts +3 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -1
- package/lib/index.js.map +1 -1
- package/lib/utils/interfaces.d.ts +22 -0
- package/lib/utils/interfaces.d.ts.map +1 -0
- package/lib/utils/interfaces.js +2 -0
- package/lib/utils/interfaces.js.map +1 -0
- package/lib/utils/mappers.d.ts +4 -0
- package/lib/utils/mappers.d.ts.map +1 -0
- package/lib/utils/mappers.js +13 -0
- package/lib/utils/mappers.js.map +1 -0
- package/package.json +2 -2
- package/src/components/brands/brand-card/actions-button-section.tsx +62 -0
- package/src/components/brands/brand-card/brand-card.tsx +30 -220
- package/src/components/brands/brand-card/brand-logo.tsx +21 -0
- package/src/components/brands/brand-card/cart-tags.tsx +20 -0
- package/src/components/brands/brand-card/name-and-mail-section.tsx +28 -0
- package/src/components/brands/brand-card/single-action-button.tsx +84 -0
- package/src/components/brands/cards-grid/cards-grid.tsx +10 -6
- package/src/components/brands/styles.module.less +7 -21
- package/src/components/brands/styles.module.less.d.ts +2 -3
- package/src/enums/brands.ts +4 -22
- package/src/index.ts +3 -1
- package/src/utils/interfaces.ts +23 -0
- package/src/utils/mappers.ts +14 -0
- package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [2.0.0](https://github.com/servicetitan/marketing/compare/@servicetitan/mpa-components@1.11.0...@servicetitan/mpa-components@2.0.0) (2025-04-10)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @servicetitan/mpa-components
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
# [1.11.0](https://github.com/servicetitan/marketing/compare/@servicetitan/mpa-components@1.10.0...@servicetitan/mpa-components@1.11.0) (2025-04-02)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @servicetitan/mpa-components
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions-button-section.d.ts","sourceRoot":"","sources":["../../../../src/components/brands/brand-card/actions-button-section.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAY,MAAM,OAAO,CAAC;AAMrC,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,eAAO,MAAM,oBAAoB,EAAE,EAAE,CAAC;IAClC,OAAO,EAAE,WAAW,GAAG,WAAW,EAAE,CAAC;CACxC,CAmDA,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { useHistory } from 'react-router-dom';
|
|
4
|
+
import { ActionMenu, BodyText, Button, Icon } from '@servicetitan/design-system';
|
|
5
|
+
import { SingleActionButtonSection } from './single-action-button';
|
|
6
|
+
export const ActionsButtonSection = ({ actions }) => {
|
|
7
|
+
const [isOpen, setOpen] = useState(false);
|
|
8
|
+
const history = useHistory();
|
|
9
|
+
if (!Array.isArray(actions)) {
|
|
10
|
+
return _jsx(SingleActionButtonSection, { action: actions });
|
|
11
|
+
}
|
|
12
|
+
const trigger = (_jsxs(Button, { outline: true, size: "small", onClick: () => setOpen(true), className: "qa-brand-card-actions-trigger", children: ["Actions ", _jsx(Icon, { name: "keyboard_arrow_down", size: 16 })] }));
|
|
13
|
+
return (_jsx(ActionMenu, { trigger: trigger, open: isOpen, onClickOutside: () => setOpen(false), direction: "bl", className: "qa-brand-card-action-menu", children: actions.map(action => {
|
|
14
|
+
const actionClick = () => {
|
|
15
|
+
setOpen(false);
|
|
16
|
+
if (action.action) {
|
|
17
|
+
action.action();
|
|
18
|
+
}
|
|
19
|
+
if (action.href) {
|
|
20
|
+
history.push(action.href);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
return (_jsx(ActionMenu.Item, { disabled: action.disabled, onClick: actionClick, className: "qa-brand-card-action-menu-item", children: _jsx(BodyText, { subdued: action.disabled, children: action.name }) }, action.name));
|
|
24
|
+
}) }));
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=actions-button-section.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions-button-section.js","sourceRoot":"","sources":["../../../../src/components/brands/brand-card/actions-button-section.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AAEjF,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAGnE,MAAM,CAAC,MAAM,oBAAoB,GAE5B,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE;IACjB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC1C,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAE7B,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QAC1B,OAAO,KAAC,yBAAyB,IAAC,MAAM,EAAE,OAAO,GAAI,CAAC;IAC1D,CAAC;IAED,MAAM,OAAO,GAAG,CACZ,MAAC,MAAM,IACH,OAAO,QACP,IAAI,EAAC,OAAO,EACZ,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,EAC5B,SAAS,EAAC,+BAA+B,yBAEjC,KAAC,IAAI,IAAC,IAAI,EAAC,qBAAqB,EAAC,IAAI,EAAE,EAAE,GAAI,IAChD,CACZ,CAAC;IAEF,OAAO,CACH,KAAC,UAAU,IACP,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,MAAM,EACZ,cAAc,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,EACpC,SAAS,EAAC,IAAI,EACd,SAAS,EAAC,2BAA2B,YAEpC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;YAClB,MAAM,WAAW,GAAG,GAAG,EAAE;gBACrB,OAAO,CAAC,KAAK,CAAC,CAAC;gBACf,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;oBAChB,MAAM,CAAC,MAAM,EAAE,CAAC;gBACpB,CAAC;gBACD,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;oBACd,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;gBAC9B,CAAC;YACL,CAAC,CAAC;YAEF,OAAO,CACH,KAAC,UAAU,CAAC,IAAI,IACZ,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAEzB,OAAO,EAAE,WAAW,EACpB,SAAS,EAAC,gCAAgC,YAE1C,KAAC,QAAQ,IAAC,OAAO,EAAE,MAAM,CAAC,QAAQ,YAAG,MAAM,CAAC,IAAI,GAAY,IAJvD,MAAM,CAAC,IAAI,CAKF,CACrB,CAAC;QACN,CAAC,CAAC,GACO,CAChB,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brand-card.d.ts","sourceRoot":"","sources":["../../../../src/components/brands/brand-card/brand-card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"brand-card.d.ts","sourceRoot":"","sources":["../../../../src/components/brands/brand-card/brand-card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAM3B,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAS3D,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CAuCxC,CAAC"}
|
|
@@ -1,61 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import { Flex, Card } from '@servicetitan/anvil2';
|
|
4
|
+
import { NameAndMailSection } from './name-and-mail-section';
|
|
5
|
+
import { ActionsButtonSection } from './actions-button-section';
|
|
6
|
+
import { CardTags } from './cart-tags';
|
|
7
|
+
import { BrandLogo } from './brand-logo';
|
|
7
8
|
import * as Styles from '../styles.module.less';
|
|
8
9
|
const BRAND_NAME_PLACEHOLDER = 'Assign Brand Name';
|
|
9
|
-
export const BrandCard = ({ actions,
|
|
10
|
-
const [isOpen, setOpen] = useState(false);
|
|
11
|
-
const actionsButtonSection = useMemo(() => {
|
|
12
|
-
if (!Array.isArray(actions)) {
|
|
13
|
-
return (_jsx(SingleActionButtonSection, { action: actions, domainValidationStatus: domainValidationStatus }));
|
|
14
|
-
}
|
|
15
|
-
const trigger = (_jsxs(Button, { outline: true, size: "small", onClick: () => setOpen(true), children: ["Actions ", _jsx(Icon, { name: "keyboard_arrow_down", size: 16 })] }));
|
|
16
|
-
return (_jsx(ActionMenu, { trigger: trigger, open: isOpen, onClickOutside: () => setOpen(false), direction: "bl", children: actions.map(action => {
|
|
17
|
-
if (action.href) {
|
|
18
|
-
return (_jsx(Link, { to: action.href, children: _jsx(ActionMenu.Item, { disabled: action.disabled, children: _jsx(BodyText, { subdued: action.disabled, children: action.name }) }, action.name) }, action.name));
|
|
19
|
-
}
|
|
20
|
-
const actionClick = () => {
|
|
21
|
-
setOpen(false);
|
|
22
|
-
if (action.action) {
|
|
23
|
-
action.action();
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
return (_jsx(ActionMenu.Item, { disabled: action.disabled, onClick: actionClick, children: _jsx(BodyText, { subdued: action.disabled, children: action.name }) }, action.name));
|
|
27
|
-
}) }));
|
|
28
|
-
}, [isOpen, setOpen, actions, domainValidationStatus]);
|
|
10
|
+
export const BrandCard = ({ actions, email, isDefault, isShared, logo, name, hasError, }) => {
|
|
29
11
|
const nameToShow = name || BRAND_NAME_PLACEHOLDER;
|
|
30
|
-
return (_jsx(Card, { className:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
if (!isDefault && !isShared) {
|
|
34
|
-
return null;
|
|
35
|
-
}
|
|
36
|
-
return (_jsxs(Stack, { direction: "column", alignItems: "flex-end", className: Styles.tags, children: [isShared && (_jsx(Tag, { className: Styles.corporateTag, color: "info", subtle: true, compact: true, children: "Corporate HQ" })), isDefault && (_jsx(Tag, { className: Styles.defaultTag, compact: true, children: "Default" }))] }));
|
|
37
|
-
};
|
|
38
|
-
const SingleActionButtonSection = ({ domainValidationStatus, action }) => {
|
|
39
|
-
const validationStatusIcon = useMemo(() => {
|
|
40
|
-
return _jsx(ValidationStatusIcon, { status: domainValidationStatus });
|
|
41
|
-
}, [domainValidationStatus]);
|
|
42
|
-
if (domainValidationStatus === DomainValidationStatus.Pending) {
|
|
43
|
-
return (_jsxs(Stack, { spacing: 1, alignItems: "center", children: [_jsx(BodyText, { size: "small", children: "Validation In Process" }), validationStatusIcon] }));
|
|
44
|
-
}
|
|
45
|
-
return (_jsxs(Stack, { spacing: 2, alignItems: "center", children: [validationStatusIcon, action.isConfigured && (_jsx(Icon, { name: "check_circle", color: tokens.colorGreen500, size: 24 })), action.inProgress ? (_jsx(InProgressButton, { action: action })) : (_jsx(StandardButton, { action: action }))] }));
|
|
46
|
-
};
|
|
47
|
-
const StandardButton = ({ action }) => (_jsx(Tooltip, { text: action.disabled ? action.tooltipMessage : '', children: action.href ? (_jsx(Link, { to: action.href, children: _jsx(Button, { size: "small", primary: true, outline: true, disabled: action.disabled, children: action.name }) })) : (_jsx(Button, { size: "small", primary: true, onClick: action.action, outline: true, disabled: action.disabled, children: action.name })) }));
|
|
48
|
-
const InProgressButton = ({ action }) => (_jsx(Tooltip, { text: action.disabled ? action.tooltipMessage : '', children: action.href ? (_jsx(Link, { to: action.href, children: _jsxs(Button, { size: "small", primary: true, text: true, className: "m-0 p-1", children: [_jsx(BodyText, { size: "small", className: "m-r-half", children: "Registration In Progress" }), _jsx(Icon, { name: "hourglass_full", color: tokens.colorBlue, size: 16 })] }) })) : (_jsxs(Button, { size: "small", primary: true, text: true, className: "m-0 p-1", onClick: action.action, children: [_jsx(BodyText, { size: "small", className: "m-r-1", children: "Registration In Progress" }), _jsx(Icon, { name: "hourglass_full", color: tokens.colorBlue, size: 16 })] })) }));
|
|
49
|
-
const ValidationStatusIcon = ({ status }) => {
|
|
50
|
-
switch (status) {
|
|
51
|
-
case DomainValidationStatus.Error:
|
|
52
|
-
return (_jsx(Tooltip, { direction: "t", text: "Error is detected in processing the Sender Domain validation. Please check and try again.", className: "cursor-pointer", children: _jsx(Icon, { name: "warning", color: tokens.colorRed500, size: 24 }) }));
|
|
53
|
-
case DomainValidationStatus.Validated:
|
|
54
|
-
return _jsx(Icon, { name: "check_circle", color: tokens.colorGreen500, size: 24 });
|
|
55
|
-
case DomainValidationStatus.Pending:
|
|
56
|
-
return _jsx(Icon, { name: "hourglass_full", color: tokens.colorBlue500, size: 24 });
|
|
57
|
-
default:
|
|
58
|
-
return null;
|
|
59
|
-
}
|
|
12
|
+
return (_jsx(Card, { className: classNames({
|
|
13
|
+
[Styles.cardWithError]: hasError,
|
|
14
|
+
}, Styles.brandCard, 'qa-brand-card'), padding: "large", children: _jsxs(Flex, { className: Styles.cardContent, justifyContent: "space-between", direction: "column", children: [_jsxs(Flex, { justifyContent: "space-between", alignItems: "flex-start", className: "qa-brand-card-left-section", children: [_jsx(BrandLogo, { logo: logo, alt: nameToShow }), _jsx(ActionsButtonSection, { actions: actions })] }), _jsxs(Flex, { justifyContent: "space-between", children: [_jsx(NameAndMailSection, { name: name, nameToShow: nameToShow, email: email }), _jsx(CardTags, { isDefault: isDefault, isShared: isShared })] })] }) }));
|
|
60
15
|
};
|
|
61
16
|
//# sourceMappingURL=brand-card.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brand-card.js","sourceRoot":"","sources":["../../../../src/components/brands/brand-card/brand-card.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"brand-card.js","sourceRoot":"","sources":["../../../../src/components/brands/brand-card/brand-card.tsx"],"names":[],"mappings":";AACA,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAElD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAEhD,MAAM,sBAAsB,GAAG,mBAAmB,CAAC;AAEnD,MAAM,CAAC,MAAM,SAAS,GAAuB,CAAC,EAC1C,OAAO,EACP,KAAK,EACL,SAAS,EACT,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,QAAQ,GACX,EAAE,EAAE;IACD,MAAM,UAAU,GAAG,IAAI,IAAI,sBAAsB,CAAC;IAElD,OAAO,CACH,KAAC,IAAI,IACD,SAAS,EAAE,UAAU,CACjB;YACI,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,QAAQ;SACnC,EACD,MAAM,CAAC,SAAS,EAChB,eAAe,CAClB,EACD,OAAO,EAAC,OAAO,YAEf,MAAC,IAAI,IAAC,SAAS,EAAE,MAAM,CAAC,WAAW,EAAE,cAAc,EAAC,eAAe,EAAC,SAAS,EAAC,QAAQ,aAClF,MAAC,IAAI,IACD,cAAc,EAAC,eAAe,EAC9B,UAAU,EAAC,YAAY,EACvB,SAAS,EAAC,4BAA4B,aAEtC,KAAC,SAAS,IAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,GAAI,EAC1C,KAAC,oBAAoB,IAAC,OAAO,EAAE,OAAO,GAAI,IACvC,EAEP,MAAC,IAAI,IAAC,cAAc,EAAC,eAAe,aAChC,KAAC,kBAAkB,IAAC,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,GAAI,EACxE,KAAC,QAAQ,IAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,GAAI,IACnD,IACJ,GACJ,CACV,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brand-logo.d.ts","sourceRoot":"","sources":["../../../../src/components/brands/brand-card/brand-logo.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAS3B,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,CAWrD,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import { Flex, Icon } from '@servicetitan/anvil2';
|
|
4
|
+
import ImageIcon from '@servicetitan/anvil2/assets/icons/material/round/image.svg';
|
|
5
|
+
import { tokens } from '@servicetitan/tokens/core/index';
|
|
6
|
+
import * as Styles from '../styles.module.less';
|
|
7
|
+
export const BrandLogo = ({ logo, alt }) => logo ? (_jsx("img", { className: classNames(Styles.brandImg, 'qa-brand-logo'), src: logo, alt: alt })) : (_jsx(Flex, { className: classNames(Styles.brandImgPlaceholder, 'qa-brand-logo-placeholder'), alignItems: "center", justifyContent: "center", children: _jsx(Icon, { svg: ImageIcon, size: "large", color: tokens.colorNeutral90 }) }));
|
|
8
|
+
//# sourceMappingURL=brand-logo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brand-logo.js","sourceRoot":"","sources":["../../../../src/components/brands/brand-card/brand-logo.tsx"],"names":[],"mappings":";AACA,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,SAAS,MAAM,4DAA4D,CAAC;AACnF,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AAEzD,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAEhD,MAAM,CAAC,MAAM,SAAS,GAAwC,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE,CAC5E,IAAI,CAAC,CAAC,CAAC,CACH,cAAK,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,QAAQ,EAAE,eAAe,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,GAAI,CACxF,CAAC,CAAC,CAAC,CACA,KAAC,IAAI,IACD,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,mBAAmB,EAAE,2BAA2B,CAAC,EAC9E,UAAU,EAAC,QAAQ,EACnB,cAAc,EAAC,QAAQ,YAEvB,KAAC,IAAI,IAAC,GAAG,EAAE,SAAS,EAAE,IAAI,EAAC,OAAO,EAAC,KAAK,EAAE,MAAM,CAAC,cAAc,GAAI,GAChE,CACV,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cart-tags.d.ts","sourceRoot":"","sources":["../../../../src/components/brands/brand-card/cart-tags.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAK3B,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC;IAAE,SAAS,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,CAcpE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Chip, Flex } from '@servicetitan/anvil2';
|
|
3
|
+
import { tokens } from '@servicetitan/tokens/core/index';
|
|
4
|
+
export const CardTags = ({ isDefault, isShared, }) => {
|
|
5
|
+
if (!isDefault && !isShared) {
|
|
6
|
+
return null;
|
|
7
|
+
}
|
|
8
|
+
return (_jsxs(Flex, { direction: "column", alignItems: "flex-end", className: "qa-brand-card-tags", gap: "1", children: [isShared && _jsx(Chip, { color: tokens.colorPurple100, label: "Corporate HQ", size: "small" }), isDefault && _jsx(Chip, { label: "Default", color: tokens.colorNeutral50, size: "small" })] }));
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=cart-tags.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cart-tags.js","sourceRoot":"","sources":["../../../../src/components/brands/brand-card/cart-tags.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AAEzD,MAAM,CAAC,MAAM,QAAQ,GAAoD,CAAC,EACtE,SAAS,EACT,QAAQ,GACX,EAAE,EAAE;IACD,IAAI,CAAC,SAAS,IAAI,CAAC,QAAQ,EAAE,CAAC;QAC1B,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,OAAO,CACH,MAAC,IAAI,IAAC,SAAS,EAAC,QAAQ,EAAC,UAAU,EAAC,UAAU,EAAC,SAAS,EAAC,oBAAoB,EAAC,GAAG,EAAC,GAAG,aAChF,QAAQ,IAAI,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,cAAc,EAAE,KAAK,EAAC,cAAc,EAAC,IAAI,EAAC,OAAO,GAAG,EACpF,SAAS,IAAI,KAAC,IAAI,IAAC,KAAK,EAAC,SAAS,EAAC,KAAK,EAAE,MAAM,CAAC,cAAc,EAAE,IAAI,EAAC,OAAO,GAAG,IAC9E,CACV,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"name-and-mail-section.d.ts","sourceRoot":"","sources":["../../../../src/components/brands/brand-card/name-and-mail-section.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAQ3B,eAAO,MAAM,kBAAkB,EAAE,EAAE,CAAC;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAmBxF,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import { BodyText, Headline } from '@servicetitan/design-system';
|
|
4
|
+
import { Flex } from '@servicetitan/anvil2';
|
|
5
|
+
import * as Styles from '../styles.module.less';
|
|
6
|
+
export const NameAndMailSection = ({ name, email, nameToShow, }) => (_jsxs(Flex, { justifyContent: "space-between", direction: "column", className: classNames(Styles.cardLeftSectionTexts, 'qa-brand-card-name-and-mail'), children: [_jsx(Headline, { el: "p", subdued: !name, className: "t-truncate-i m-0", title: nameToShow, children: nameToShow }), email && (_jsx(BodyText, { subdued: true, title: email, className: "t-truncate-i", children: email }))] }));
|
|
7
|
+
//# sourceMappingURL=name-and-mail-section.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"name-and-mail-section.js","sourceRoot":"","sources":["../../../../src/components/brands/brand-card/name-and-mail-section.tsx"],"names":[],"mappings":";AACA,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAE5C,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAEhD,MAAM,CAAC,MAAM,kBAAkB,GAA8D,CAAC,EAC1F,IAAI,EACJ,KAAK,EACL,UAAU,GACb,EAAE,EAAE,CAAC,CACF,MAAC,IAAI,IACD,cAAc,EAAC,eAAe,EAC9B,SAAS,EAAC,QAAQ,EAClB,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,oBAAoB,EAAE,6BAA6B,CAAC,aAEjF,KAAC,QAAQ,IAAC,EAAE,EAAC,GAAG,EAAC,OAAO,EAAE,CAAC,IAAI,EAAE,SAAS,EAAC,kBAAkB,EAAC,KAAK,EAAE,UAAU,YAC1E,UAAU,GACJ,EACV,KAAK,IAAI,CACN,KAAC,QAAQ,IAAC,OAAO,QAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAC,cAAc,YACnD,KAAK,GACC,CACd,IACE,CACV,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"single-action-button.d.ts","sourceRoot":"","sources":["../../../../src/components/brands/brand-card/single-action-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAqB,MAAM,OAAO,CAAC;AAO9C,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAIxD,eAAO,MAAM,yBAAyB,EAAE,EAAE,CAAC;IACvC,MAAM,EAAE,WAAW,CAAC;CACvB,CAmCA,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useHistory } from 'react-router-dom';
|
|
3
|
+
import HelpIcon from '@servicetitan/anvil2/assets/icons/material/round/help.svg';
|
|
4
|
+
import { Chip, Flex, Tooltip as TooltipA2, Button } from '@servicetitan/anvil2';
|
|
5
|
+
import { BrandActionChipColor, BrandActionChipLabel } from '../../../utils/mappers';
|
|
6
|
+
export const SingleActionButtonSection = ({ action }) => {
|
|
7
|
+
var _a;
|
|
8
|
+
const history = useHistory();
|
|
9
|
+
const handleClick = () => {
|
|
10
|
+
if (action.action) {
|
|
11
|
+
action.action();
|
|
12
|
+
}
|
|
13
|
+
if (action.href) {
|
|
14
|
+
history.push(action.href);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
let buttonAppearance;
|
|
18
|
+
if (action.status === undefined) {
|
|
19
|
+
buttonAppearance = 'primary';
|
|
20
|
+
}
|
|
21
|
+
else if (!action.disabled) {
|
|
22
|
+
buttonAppearance = 'secondary';
|
|
23
|
+
}
|
|
24
|
+
return (_jsxs(Flex, { gap: "2", alignItems: "center", className: "qa-brand-card-single-action", children: [_jsx(ActionChip, { status: action.status, statusTooltip: action.statusTooltip }), _jsx(Button, { size: "small", onClick: handleClick, disabled: action.disabled, appearance: buttonAppearance, children: action.name }), action.disabled && (_jsx(DisabledActionHelper, { children: (_a = action.disableTooltipContent) === null || _a === void 0 ? void 0 : _a.call(action) }))] }));
|
|
25
|
+
};
|
|
26
|
+
const ActionChip = ({ status, statusTooltip, }) => {
|
|
27
|
+
if (status === undefined) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
const chip = (_jsx(Chip, { label: BrandActionChipLabel[status], color: BrandActionChipColor[status], size: "small" }));
|
|
31
|
+
return statusTooltip ? (_jsxs(TooltipA2, { children: [_jsx(TooltipA2.Trigger, { children: chip }), _jsx(TooltipA2.Content, { children: statusTooltip })] })) : (chip);
|
|
32
|
+
};
|
|
33
|
+
const DisabledActionHelper = ({ children }) => (_jsxs(TooltipA2, { children: [_jsx(TooltipA2.Trigger, { children: _jsx(Button, { icon: HelpIcon, size: "small" }) }), _jsx(TooltipA2.Content, { children: children })] }));
|
|
34
|
+
//# sourceMappingURL=single-action-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"single-action-button.js","sourceRoot":"","sources":["../../../../src/components/brands/brand-card/single-action-button.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,QAAQ,MAAM,2DAA2D,CAAC;AACjF,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAIhF,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAGpF,MAAM,CAAC,MAAM,yBAAyB,GAEjC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE;;IAChB,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,WAAW,GAAG,GAAG,EAAE;QACrB,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;YAChB,MAAM,CAAC,MAAM,EAAE,CAAC;QACpB,CAAC;QAED,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;YACd,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAC9B,CAAC;IACL,CAAC,CAAC;IAEF,IAAI,gBAA8C,CAAC;IACnD,IAAI,MAAM,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QAC9B,gBAAgB,GAAG,SAAS,CAAC;IACjC,CAAC;SAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;QAC1B,gBAAgB,GAAG,WAAW,CAAC;IACnC,CAAC;IAED,OAAO,CACH,MAAC,IAAI,IAAC,GAAG,EAAC,GAAG,EAAC,UAAU,EAAC,QAAQ,EAAC,SAAS,EAAC,6BAA6B,aACrE,KAAC,UAAU,IAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,EAAE,MAAM,CAAC,aAAa,GAAI,EAC1E,KAAC,MAAM,IACH,IAAI,EAAC,OAAO,EACZ,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,MAAM,CAAC,QAAQ,EACzB,UAAU,EAAE,gBAAgB,YAE3B,MAAM,CAAC,IAAI,GACP,EACR,MAAM,CAAC,QAAQ,IAAI,CAChB,KAAC,oBAAoB,cAAE,MAAA,MAAM,CAAC,qBAAqB,sDAAI,GAAwB,CAClF,IACE,CACV,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,UAAU,GAA0D,CAAC,EACvE,MAAM,EACN,aAAa,GAChB,EAAE,EAAE;IACD,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACvB,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,MAAM,IAAI,GAAG,CACT,KAAC,IAAI,IACD,KAAK,EAAE,oBAAoB,CAAC,MAAM,CAAC,EACnC,KAAK,EAAE,oBAAoB,CAAC,MAAM,CAAC,EACnC,IAAI,EAAC,OAAO,GACd,CACL,CAAC;IAEF,OAAO,aAAa,CAAC,CAAC,CAAC,CACnB,MAAC,SAAS,eACN,KAAC,SAAS,CAAC,OAAO,cAAE,IAAI,GAAqB,EAC7C,KAAC,SAAS,CAAC,OAAO,cAAE,aAAa,GAAqB,IAC9C,CACf,CAAC,CAAC,CAAC,CACA,IAAI,CACP,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,oBAAoB,GAA0B,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAClE,MAAC,SAAS,eACN,KAAC,SAAS,CAAC,OAAO,cACd,KAAC,MAAM,IAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAC,OAAO,GAAG,GACvB,EACpB,KAAC,SAAS,CAAC,OAAO,cAAE,QAAQ,GAAqB,IACzC,CACf,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import { BrandCardProps } from '../../../
|
|
2
|
+
import { BrandCardProps } from '../../../utils/interfaces';
|
|
3
3
|
export declare const CardsGrid: FC<{
|
|
4
4
|
brands: BrandCardProps[];
|
|
5
|
+
qaIdentifier: string;
|
|
5
6
|
}>;
|
|
6
7
|
//# sourceMappingURL=cards-grid.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cards-grid.d.ts","sourceRoot":"","sources":["../../../../src/components/brands/cards-grid/cards-grid.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"cards-grid.d.ts","sourceRoot":"","sources":["../../../../src/components/brands/cards-grid/cards-grid.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAM3B,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAI3D,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC;IACvB,MAAM,EAAE,cAAc,EAAE,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;CACxB,CAMA,CAAC"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import classNames from 'classnames';
|
|
2
3
|
import { Grid } from '@servicetitan/anvil2';
|
|
3
4
|
import { BrandCard } from '../brand-card/brand-card';
|
|
4
5
|
import * as Styles from '../styles.module.less';
|
|
5
|
-
export const CardsGrid = ({ brands }) => (_jsx(Grid, { className: Styles.grid, gap: "6", children: brands.map(brand => {
|
|
6
|
-
return _jsx(BrandCard, { ...brand }, brand.id);
|
|
7
|
-
}) }));
|
|
6
|
+
export const CardsGrid = ({ brands, qaIdentifier }) => (_jsx(Grid, { className: classNames(Styles.grid, `qa-${qaIdentifier}-cards-grid`), gap: "6", children: brands.map(brand => (_jsx(BrandCard, { ...brand }, brand.id))) }));
|
|
8
7
|
//# sourceMappingURL=cards-grid.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cards-grid.js","sourceRoot":"","sources":["../../../../src/components/brands/cards-grid/cards-grid.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"cards-grid.js","sourceRoot":"","sources":["../../../../src/components/brands/cards-grid/cards-grid.tsx"],"names":[],"mappings":";AACA,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAE5C,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAGrD,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAEhD,MAAM,CAAC,MAAM,SAAS,GAGjB,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,CAC/B,KAAC,IAAI,IAAC,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,YAAY,aAAa,CAAC,EAAE,GAAG,EAAC,GAAG,YAC7E,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CACjB,KAAC,SAAS,OAAoB,KAAK,IAAnB,KAAK,CAAC,EAAE,CAAe,CAC1C,CAAC,GACC,CACV,CAAC"}
|
|
@@ -30,17 +30,14 @@
|
|
|
30
30
|
height: 200px;
|
|
31
31
|
min-width: @card-min-width;
|
|
32
32
|
max-width: @card-max-width;
|
|
33
|
-
box-sizing: border-box;
|
|
34
|
-
background: inherit !important;
|
|
35
|
-
|
|
36
|
-
:global(.CardSection) {
|
|
37
|
-
height: 150px;
|
|
38
|
-
background-color: @color-white;
|
|
39
|
-
}
|
|
40
33
|
}
|
|
41
34
|
|
|
42
35
|
.card-content {
|
|
43
|
-
|
|
36
|
+
width: 100%;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.card-left-section-texts {
|
|
40
|
+
min-width: 0;
|
|
44
41
|
}
|
|
45
42
|
|
|
46
43
|
.brand-img {
|
|
@@ -57,17 +54,6 @@
|
|
|
57
54
|
background-color: @color-neutral-60;
|
|
58
55
|
}
|
|
59
56
|
|
|
60
|
-
.
|
|
61
|
-
|
|
62
|
-
margin-bottom: 2px;
|
|
63
|
-
margin-top: auto;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.default-tag {
|
|
67
|
-
width: 53px;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.corporate-tag {
|
|
71
|
-
min-width: 86px;
|
|
72
|
-
margin-bottom: @spacing-half;
|
|
57
|
+
.card-with-error {
|
|
58
|
+
border-color: @color-red-500;
|
|
73
59
|
}
|
package/lib/enums/brands.d.ts
CHANGED
|
@@ -1,21 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
tooltipMessage?: string;
|
|
6
|
-
inProgress?: boolean;
|
|
7
|
-
isConfigured?: boolean;
|
|
8
|
-
href?: string;
|
|
9
|
-
action?: () => void;
|
|
10
|
-
}
|
|
11
|
-
export interface BrandCardProps {
|
|
12
|
-
id: string;
|
|
13
|
-
actions: BrandAction | BrandAction[];
|
|
14
|
-
logo?: string;
|
|
15
|
-
name?: string;
|
|
16
|
-
isDefault: boolean;
|
|
17
|
-
email?: string;
|
|
18
|
-
domainValidationStatus?: DomainValidationStatus;
|
|
19
|
-
isShared: boolean;
|
|
1
|
+
export declare enum ActionStatus {
|
|
2
|
+
Error = 0,
|
|
3
|
+
Pending = 1,
|
|
4
|
+
Approved = 2
|
|
20
5
|
}
|
|
21
6
|
//# sourceMappingURL=brands.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brands.d.ts","sourceRoot":"","sources":["../../src/enums/brands.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"brands.d.ts","sourceRoot":"","sources":["../../src/enums/brands.ts"],"names":[],"mappings":"AAAA,oBAAY,YAAY;IACpB,KAAK,IAAA;IACL,OAAO,IAAA;IACP,QAAQ,IAAA;CACX"}
|
package/lib/enums/brands.js
CHANGED
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
export
|
|
1
|
+
export var ActionStatus;
|
|
2
|
+
(function (ActionStatus) {
|
|
3
|
+
ActionStatus[ActionStatus["Error"] = 0] = "Error";
|
|
4
|
+
ActionStatus[ActionStatus["Pending"] = 1] = "Pending";
|
|
5
|
+
ActionStatus[ActionStatus["Approved"] = 2] = "Approved";
|
|
6
|
+
})(ActionStatus || (ActionStatus = {}));
|
|
2
7
|
//# sourceMappingURL=brands.js.map
|
package/lib/enums/brands.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brands.js","sourceRoot":"","sources":["../../src/enums/brands.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"brands.js","sourceRoot":"","sources":["../../src/enums/brands.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,YAIX;AAJD,WAAY,YAAY;IACpB,iDAAK,CAAA;IACL,qDAAO,CAAA;IACP,uDAAQ,CAAA;AACZ,CAAC,EAJW,YAAY,KAAZ,YAAY,QAIvB"}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export * from './components/settings';
|
|
2
2
|
export * from './components/campaign-actions';
|
|
3
|
-
export * from './
|
|
3
|
+
export * from './components/settings';
|
|
4
4
|
export * from './utils/helpers';
|
|
5
|
+
export * from './utils/interfaces';
|
|
6
|
+
export * from './enums/brands';
|
|
5
7
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export * from './components/settings';
|
|
2
2
|
export * from './components/campaign-actions';
|
|
3
|
-
export * from './
|
|
3
|
+
export * from './components/settings';
|
|
4
4
|
export * from './utils/helpers';
|
|
5
|
+
export * from './utils/interfaces';
|
|
6
|
+
export * from './enums/brands';
|
|
5
7
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { JSX } from 'react';
|
|
2
|
+
import { ActionStatus } from '../enums/brands';
|
|
3
|
+
export interface BrandAction {
|
|
4
|
+
name: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
disableTooltipContent?: () => JSX.Element | string;
|
|
7
|
+
href?: string;
|
|
8
|
+
status?: ActionStatus;
|
|
9
|
+
statusTooltip?: string;
|
|
10
|
+
action?: () => void;
|
|
11
|
+
}
|
|
12
|
+
export interface BrandCardProps {
|
|
13
|
+
id: string;
|
|
14
|
+
hasError?: boolean;
|
|
15
|
+
actions: BrandAction | BrandAction[];
|
|
16
|
+
logo?: string;
|
|
17
|
+
name?: string;
|
|
18
|
+
isDefault: boolean;
|
|
19
|
+
email?: string;
|
|
20
|
+
isShared?: boolean;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=interfaces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../src/utils/interfaces.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,MAAM,WAAW,WAAW;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qBAAqB,CAAC,EAAE,MAAM,GAAG,CAAC,OAAO,GAAG,MAAM,CAAC;IACnD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,MAAM,WAAW,cAAc;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,WAAW,GAAG,WAAW,EAAE,CAAC;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../src/utils/interfaces.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mappers.d.ts","sourceRoot":"","sources":["../../src/utils/mappers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAG/C,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAI7D,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAI7D,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ActionStatus } from '../enums/brands';
|
|
2
|
+
import { tokens } from '@servicetitan/tokens/core';
|
|
3
|
+
export const BrandActionChipLabel = {
|
|
4
|
+
[ActionStatus.Pending]: 'Pending',
|
|
5
|
+
[ActionStatus.Error]: 'Error',
|
|
6
|
+
[ActionStatus.Approved]: 'Complete',
|
|
7
|
+
};
|
|
8
|
+
export const BrandActionChipColor = {
|
|
9
|
+
[ActionStatus.Pending]: tokens.colorOrange200,
|
|
10
|
+
[ActionStatus.Error]: tokens.colorRed500,
|
|
11
|
+
[ActionStatus.Approved]: tokens.colorGreen200,
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=mappers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mappers.js","sourceRoot":"","sources":["../../src/utils/mappers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAEnD,MAAM,CAAC,MAAM,oBAAoB,GAAiC;IAC9D,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE,SAAS;IACjC,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,OAAO;IAC7B,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,UAAU;CACtC,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAiC;IAC9D,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,cAAc;IAC7C,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,WAAW;IACxC,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,aAAa;CAChD,CAAC"}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"repository": {
|
|
4
4
|
"url": "https://github.com/servicetitan/marketing"
|
|
5
5
|
},
|
|
6
|
-
"version": "
|
|
6
|
+
"version": "2.0.0",
|
|
7
7
|
"description": "",
|
|
8
8
|
"main": "./lib/index.js",
|
|
9
9
|
"typings": "./lib/index.d.ts",
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
"cli": {
|
|
35
35
|
"webpack": false
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "45fb622e2875d33d9db1a15935ec8cb327bb5326"
|
|
38
38
|
}
|