@servicetitan/mpa-components 2.1.0 → 2.1.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.
- package/CHANGELOG.md +8 -0
- package/lib/components/brands/brand-card/actions-button-section.d.ts.map +1 -1
- package/lib/components/brands/brand-card/actions-button-section.js +4 -1
- package/lib/components/brands/brand-card/actions-button-section.js.map +1 -1
- package/lib/components/brands/brand-card/info-section.js +1 -1
- package/lib/components/brands/brand-card/info-section.js.map +1 -1
- package/package.json +2 -2
- package/src/components/brands/brand-card/actions-button-section.tsx +8 -1
- package/src/components/brands/brand-card/info-section.tsx +1 -1
- 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.1.1](https://github.com/servicetitan/marketing/compare/@servicetitan/mpa-components@2.1.0...@servicetitan/mpa-components@2.1.1) (2025-04-18)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @servicetitan/mpa-components
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
# [2.1.0](https://github.com/servicetitan/marketing/compare/@servicetitan/mpa-components@2.0.0...@servicetitan/mpa-components@2.1.0) (2025-04-17)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @servicetitan/mpa-components
|
|
@@ -1 +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,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"actions-button-section.d.ts","sourceRoot":"","sources":["../../../../src/components/brands/brand-card/actions-button-section.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAOhC,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,eAAO,MAAM,oBAAoB,EAAE,EAAE,CAAC;IAClC,OAAO,EAAE,WAAW,GAAG,WAAW,EAAE,CAAC;CACxC,CAqCA,CAAC"}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useHistory } from 'react-router-dom';
|
|
3
3
|
import { Menu } from '@servicetitan/anvil2';
|
|
4
|
+
import ExpandMoreIcon from '@servicetitan/anvil2/assets/icons/material/round/expand_more.svg';
|
|
4
5
|
import { SingleActionButtonSection } from './single-action-button';
|
|
5
6
|
export const ActionsButtonSection = ({ actions }) => {
|
|
6
7
|
const history = useHistory();
|
|
7
8
|
if (!Array.isArray(actions)) {
|
|
8
9
|
return _jsx(SingleActionButtonSection, { action: actions });
|
|
9
10
|
}
|
|
10
|
-
return (_jsx(Menu, { label: "Actions", className: "qa-brand-card-action-menu", size: "small",
|
|
11
|
+
return (_jsx(Menu, { label: "Actions", className: "qa-brand-card-action-menu", size: "small",
|
|
12
|
+
// @ts-expect-error Menu icon API expects a raw component, but we're passing an object with 'after' per design, Anvil has ticket to fix it
|
|
13
|
+
icon: { after: ExpandMoreIcon }, children: actions.map(action => {
|
|
11
14
|
const actionClick = () => {
|
|
12
15
|
if (action.action) {
|
|
13
16
|
action.action();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions-button-section.js","sourceRoot":"","sources":["../../../../src/components/brands/brand-card/actions-button-section.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"actions-button-section.js","sourceRoot":"","sources":["../../../../src/components/brands/brand-card/actions-button-section.tsx"],"names":[],"mappings":";AACA,O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sx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Chip, Flex, Text } from '@servicetitan/anvil2';
|
|
3
|
-
export const InfoSection = ({ nameToShow, email, isDefault, isShared }) => (_jsx(Flex, { direction: "column", gap: "4", children: _jsxs(Flex, { direction: "column", gap: "1", children: [_jsxs(Flex, { gap: "2", alignItems: "center", children: [_jsx(Text, { className: "t-truncate-i m-0", title: nameToShow, variant: "headline", el: "h3", children: nameToShow }), _jsxs(Flex, { gap: "1", children: [isDefault && _jsx(Chip, { label: "Default" }), isShared && _jsx(Chip, { color: "#b5deff", label: "Corporate HQ" })] })] }), email && (_jsx(Text, { subdued: true, title: email, className: "t-truncate-i", children: email }))] }) }));
|
|
3
|
+
export const InfoSection = ({ nameToShow, email, isDefault, isShared }) => (_jsx(Flex, { direction: "column", gap: "4", children: _jsxs(Flex, { direction: "column", gap: "1", children: [_jsxs(Flex, { gap: "2", alignItems: "center", children: [_jsx(Text, { className: "t-truncate-i m-0", title: nameToShow, variant: "headline", el: "h3", children: nameToShow }), _jsxs(Flex, { gap: "1", children: [isDefault && _jsx(Chip, { label: "Default" }), isShared && _jsx(Chip, { color: "#b5deff", label: "Corporate HQ" })] })] }), email && (_jsx(Text, { subdued: true, title: email, className: "t-truncate-i", size: "small", children: email }))] }) }));
|
|
4
4
|
//# sourceMappingURL=info-section.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"info-section.js","sourceRoot":"","sources":["../../../../src/components/brands/brand-card/info-section.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAUxD,MAAM,CAAC,MAAM,WAAW,GAAyB,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAC7F,KAAC,IAAI,IAAC,SAAS,EAAC,QAAQ,EAAC,GAAG,EAAC,GAAG,YAC5B,MAAC,I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,KAAC,IAAI,IAAC,KAAK,EAAC,SAAS,GAAG,EACrC,QAAQ,IAAI,KAAC,IAAI,IAAC,KAAK,EAAC,SAAS,EAAC,KAAK,EAAC,cAAc,GAAG,IACvD,IACJ,EACN,KAAK,IAAI,CACN,KAAC,IAAI,IAAC,OAAO,QAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAC,cAAc,EAAC,IAAI,EAAC,OAAO,YAC5D,KAAK,GACH,CACV,IACE,GACJ,CACV,CAAC"}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"repository": {
|
|
4
4
|
"url": "https://github.com/servicetitan/marketing"
|
|
5
5
|
},
|
|
6
|
-
"version": "2.1.
|
|
6
|
+
"version": "2.1.1",
|
|
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": "9e6c56f3f0868c39c727b8d3c3eefb4f68efacd5"
|
|
38
38
|
}
|
|
@@ -2,6 +2,7 @@ import type { FC } from 'react';
|
|
|
2
2
|
import { useHistory } from 'react-router-dom';
|
|
3
3
|
|
|
4
4
|
import { Menu } from '@servicetitan/anvil2';
|
|
5
|
+
import ExpandMoreIcon from '@servicetitan/anvil2/assets/icons/material/round/expand_more.svg';
|
|
5
6
|
|
|
6
7
|
import { SingleActionButtonSection } from './single-action-button';
|
|
7
8
|
import { BrandAction } from '../../../utils/interfaces';
|
|
@@ -16,7 +17,13 @@ export const ActionsButtonSection: FC<{
|
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
return (
|
|
19
|
-
<Menu
|
|
20
|
+
<Menu
|
|
21
|
+
label="Actions"
|
|
22
|
+
className="qa-brand-card-action-menu"
|
|
23
|
+
size="small"
|
|
24
|
+
// @ts-expect-error Menu icon API expects a raw component, but we're passing an object with 'after' per design, Anvil has ticket to fix it
|
|
25
|
+
icon={{ after: ExpandMoreIcon }}
|
|
26
|
+
>
|
|
20
27
|
{actions.map(action => {
|
|
21
28
|
const actionClick = () => {
|
|
22
29
|
if (action.action) {
|
|
@@ -23,7 +23,7 @@ export const InfoSection: FC<InfoSectionProps> = ({ nameToShow, email, isDefault
|
|
|
23
23
|
</Flex>
|
|
24
24
|
</Flex>
|
|
25
25
|
{email && (
|
|
26
|
-
<Text subdued title={email} className="t-truncate-i">
|
|
26
|
+
<Text subdued title={email} className="t-truncate-i" size="small">
|
|
27
27
|
{email}
|
|
28
28
|
</Text>
|
|
29
29
|
)}
|