@servicetitan/mpa-components 1.1.0 → 1.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 +12 -0
- package/lib/components/campaign-actions/action-button/action-button-archive.d.ts +7 -0
- package/lib/components/campaign-actions/action-button/action-button-archive.d.ts.map +1 -0
- package/lib/components/campaign-actions/action-button/action-button-archive.js +4 -0
- package/lib/components/campaign-actions/action-button/action-button-archive.js.map +1 -0
- package/lib/components/campaign-actions/action-button/action-button-clone.d.ts +6 -0
- package/lib/components/campaign-actions/action-button/action-button-clone.d.ts.map +1 -0
- package/lib/components/campaign-actions/action-button/action-button-clone.js +4 -0
- package/lib/components/campaign-actions/action-button/action-button-clone.js.map +1 -0
- package/lib/components/campaign-actions/action-button/action-button-edit.d.ts +7 -0
- package/lib/components/campaign-actions/action-button/action-button-edit.d.ts.map +1 -0
- package/lib/components/campaign-actions/action-button/action-button-edit.js +4 -0
- package/lib/components/campaign-actions/action-button/action-button-edit.js.map +1 -0
- package/lib/components/campaign-actions/action-button/action-button-unarchive.d.ts +6 -0
- package/lib/components/campaign-actions/action-button/action-button-unarchive.d.ts.map +1 -0
- package/lib/components/campaign-actions/action-button/action-button-unarchive.js +4 -0
- package/lib/components/campaign-actions/action-button/action-button-unarchive.js.map +1 -0
- package/lib/components/campaign-actions/action-button/action-button.d.ts +14 -0
- package/lib/components/campaign-actions/action-button/action-button.d.ts.map +1 -0
- package/lib/components/campaign-actions/action-button/action-button.js +29 -0
- package/lib/components/campaign-actions/action-button/action-button.js.map +1 -0
- package/lib/components/campaign-actions/action-button/action-button.module.less +17 -0
- package/lib/components/campaign-actions/actions-button/actions-button.d.ts +5 -0
- package/lib/components/campaign-actions/actions-button/actions-button.d.ts.map +1 -0
- package/lib/components/campaign-actions/actions-button/actions-button.js +33 -0
- package/lib/components/campaign-actions/actions-button/actions-button.js.map +1 -0
- package/lib/components/campaign-actions/actions-button/actions-button.module.less +10 -0
- package/lib/components/campaign-actions/actions-button/campaign-actions.d.ts +11 -0
- package/lib/components/campaign-actions/actions-button/campaign-actions.d.ts.map +1 -0
- package/lib/components/campaign-actions/actions-button/campaign-actions.js +15 -0
- package/lib/components/campaign-actions/actions-button/campaign-actions.js.map +1 -0
- package/lib/components/campaign-actions/actions-button/campaign-actions.stories.d.ts +9 -0
- package/lib/components/campaign-actions/actions-button/campaign-actions.stories.d.ts.map +1 -0
- package/lib/components/campaign-actions/actions-button/campaign-actions.stories.js +11 -0
- package/lib/components/campaign-actions/actions-button/campaign-actions.stories.js.map +1 -0
- package/lib/components/campaign-actions/index.d.ts +2 -0
- package/lib/components/campaign-actions/index.d.ts.map +1 -0
- package/lib/components/campaign-actions/index.js +2 -0
- package/lib/components/campaign-actions/index.js.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/package.json +2 -2
- package/src/components/campaign-actions/action-button/action-button-archive.tsx +18 -0
- package/src/components/campaign-actions/action-button/action-button-clone.tsx +13 -0
- package/src/components/campaign-actions/action-button/action-button-edit.tsx +18 -0
- package/src/components/campaign-actions/action-button/action-button-unarchive.tsx +13 -0
- package/src/components/campaign-actions/action-button/action-button.module.less +17 -0
- package/src/components/campaign-actions/action-button/action-button.module.less.d.ts +5 -0
- package/src/components/campaign-actions/action-button/action-button.tsx +78 -0
- package/src/components/campaign-actions/actions-button/actions-button.module.less +10 -0
- package/src/components/campaign-actions/actions-button/actions-button.module.less.d.ts +3 -0
- package/src/components/campaign-actions/actions-button/actions-button.tsx +76 -0
- package/src/components/campaign-actions/actions-button/campaign-actions.stories.tsx +19 -0
- package/src/components/campaign-actions/actions-button/campaign-actions.tsx +77 -0
- package/src/components/campaign-actions/index.ts +1 -0
- package/src/index.ts +1 -0
- package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
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
|
+
## [1.1.1](https://github.com/servicetitan/marketing/compare/@servicetitan/mpa-components@1.1.0...@servicetitan/mpa-components@1.1.1) (2022-10-26)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **email-components), feat(components), fix(date-range-select:** extracted email components, marketing campaign actions component, added storybook stories ([cf50700](https://github.com/servicetitan/marketing/commit/cf507004302573b6bbd0e4b4fe1055a787a724f5))
|
|
12
|
+
* **email-components), feat(components), fix(date-range-select:** extracted email components, marketing campaign actions component, added storybook stories ([5941c5c](https://github.com/servicetitan/marketing/commit/5941c5cebb7994d98f5c888f2ed2bdc17967d29b))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
6
18
|
# [1.1.0](https://github.com/servicetitan/marketing/compare/@servicetitan/mpa-components@1.0.0...@servicetitan/mpa-components@1.1.0) (2022-09-07)
|
|
7
19
|
|
|
8
20
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-button-archive.d.ts","sourceRoot":"","sources":["../../../../src/components/campaign-actions/action-button/action-button-archive.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAG3B,eAAO,MAAM,mBAAmB,EAAE,EAAE,CAAC;IACjC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,IAAI,IAAI,CAAC;CACpB,CAUA,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ActionButton } from './action-button';
|
|
3
|
+
export const ActionButtonArchive = props => (_jsx(ActionButton, Object.assign({}, props, { iconName: "archive", hover: "primary", tooltip: props.tooltip, qaPrefix: "qa-action-button-archive" }, { children: "Archive" })));
|
|
4
|
+
//# sourceMappingURL=action-button-archive.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-button-archive.js","sourceRoot":"","sources":["../../../../src/components/campaign-actions/action-button/action-button-archive.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,MAAM,CAAC,MAAM,mBAAmB,GAI3B,KAAK,CAAC,EAAE,CAAC,CACV,KAAC,YAAY,oBACL,KAAK,IACT,QAAQ,EAAC,SAAS,EAClB,KAAK,EAAC,SAAS,EACf,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,QAAQ,EAAC,0BAA0B,6BAGxB,CAClB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-button-clone.d.ts","sourceRoot":"","sources":["../../../../src/components/campaign-actions/action-button/action-button-clone.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAG3B,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,IAAI,IAAI,CAAA;CAAE,CAS1E,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ActionButton } from './action-button';
|
|
3
|
+
export const ActionButtonClone = props => (_jsx(ActionButton, Object.assign({}, props, { iconName: "control_point_duplicate", hover: "primary", qaPrefix: "qa-action-button-clone" }, { children: "Clone" })));
|
|
4
|
+
//# sourceMappingURL=action-button-clone.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-button-clone.js","sourceRoot":"","sources":["../../../../src/components/campaign-actions/action-button/action-button-clone.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,MAAM,CAAC,MAAM,iBAAiB,GAAiD,KAAK,CAAC,EAAE,CAAC,CACpF,KAAC,YAAY,oBACL,KAAK,IACT,QAAQ,EAAC,yBAAyB,EAClC,KAAK,EAAC,SAAS,EACf,QAAQ,EAAC,wBAAwB,2BAGtB,CAClB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-button-edit.d.ts","sourceRoot":"","sources":["../../../../src/components/campaign-actions/action-button/action-button-edit.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAG3B,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,IAAI,IAAI,CAAC;CACpB,CAUA,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ActionButton } from './action-button';
|
|
3
|
+
export const ActionButtonEdit = props => (_jsx(ActionButton, Object.assign({}, props, { iconName: "edit", hover: "primary", qaPrefix: "qa-action-button-edit", tooltip: props.tooltip }, { children: "Edit" })));
|
|
4
|
+
//# sourceMappingURL=action-button-edit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-button-edit.js","sourceRoot":"","sources":["../../../../src/components/campaign-actions/action-button/action-button-edit.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,MAAM,CAAC,MAAM,gBAAgB,GAIxB,KAAK,CAAC,EAAE,CAAC,CACV,KAAC,YAAY,oBACL,KAAK,IACT,QAAQ,EAAC,MAAM,EACf,KAAK,EAAC,SAAS,EACf,QAAQ,EAAC,uBAAuB,EAChC,OAAO,EAAE,KAAK,CAAC,OAAO,0BAGX,CAClB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-button-unarchive.d.ts","sourceRoot":"","sources":["../../../../src/components/campaign-actions/action-button/action-button-unarchive.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAG3B,eAAO,MAAM,qBAAqB,EAAE,EAAE,CAAC;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,IAAI,IAAI,CAAA;CAAE,CAS9E,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ActionButton } from './action-button';
|
|
3
|
+
export const ActionButtonUnarchive = props => (_jsx(ActionButton, Object.assign({}, props, { iconName: "unarchive", hover: "primary", qaPrefix: "qa-action-button-unarchive" }, { children: "Unarchive" })));
|
|
4
|
+
//# sourceMappingURL=action-button-unarchive.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-button-unarchive.js","sourceRoot":"","sources":["../../../../src/components/campaign-actions/action-button/action-button-unarchive.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,MAAM,CAAC,MAAM,qBAAqB,GAAiD,KAAK,CAAC,EAAE,CAAC,CACxF,KAAC,YAAY,oBACL,KAAK,IACT,QAAQ,EAAC,WAAW,EACpB,KAAK,EAAC,SAAS,EACf,QAAQ,EAAC,4BAA4B,+BAG1B,CAClB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IconNameType } from '@servicetitan/design-system';
|
|
2
|
+
import { ReactNode, FC } from 'react';
|
|
3
|
+
export interface ActionButtonProps {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
iconName?: IconNameType;
|
|
6
|
+
hover?: 'primary' | 'negative' | 'none';
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
tooltip?: string;
|
|
9
|
+
qaPrefix?: string;
|
|
10
|
+
active?: boolean;
|
|
11
|
+
onClick?(): void;
|
|
12
|
+
}
|
|
13
|
+
export declare const ActionButton: FC<ActionButtonProps>;
|
|
14
|
+
//# sourceMappingURL=action-button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-button.d.ts","sourceRoot":"","sources":["../../../../src/components/campaign-actions/action-button/action-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGH,YAAY,EAGf,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,SAAS,EAAE,EAAE,EAAU,MAAM,OAAO,CAAC;AAG9C,MAAM,WAAW,iBAAiB;IAC9B,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,KAAK,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,MAAM,CAAC;IACxC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,IAAI,IAAI,CAAC;CACpB;AAED,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CAuD9C,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Icon, BodyText, Tooltip, useFocusVisible, } from '@servicetitan/design-system';
|
|
3
|
+
import classnames from 'classnames';
|
|
4
|
+
import { useRef } from 'react';
|
|
5
|
+
import * as Styles from './action-button.module.less';
|
|
6
|
+
export const ActionButton = ({ active, children, disabled, iconName, onClick, qaPrefix, tooltip, }) => {
|
|
7
|
+
const buttonRef = useRef(null);
|
|
8
|
+
const { blurFunction, focusFunction, isFocusVisible } = useFocusVisible(buttonRef);
|
|
9
|
+
const handleClick = () => {
|
|
10
|
+
if (disabled) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
if (onClick) {
|
|
14
|
+
onClick();
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
const getButton = () => {
|
|
18
|
+
const classes = classnames(Styles.actionButton, qaPrefix, {
|
|
19
|
+
[Styles.primary]: !disabled,
|
|
20
|
+
[Styles.focusVisible]: isFocusVisible,
|
|
21
|
+
});
|
|
22
|
+
return (_jsxs("button", Object.assign({ type: "button", ref: buttonRef, className: classes, onClick: handleClick, disabled: disabled, onFocus: focusFunction, onBlur: blurFunction }, { children: [iconName && _jsx(Icon, { name: iconName, size: "20px", className: "m-r-1" }), _jsx(BodyText, Object.assign({ className: `${qaPrefix}-text ${active ? 'c-blue-500' : 'c-neutral-100'}` }, { children: children }))] })));
|
|
23
|
+
};
|
|
24
|
+
if (!tooltip) {
|
|
25
|
+
return getButton();
|
|
26
|
+
}
|
|
27
|
+
return (_jsx(Tooltip, Object.assign({ text: tooltip, direction: "l", el: "div", className: `${qaPrefix}-tooltip` }, { children: getButton() })));
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=action-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-button.js","sourceRoot":"","sources":["../../../../src/components/campaign-actions/action-button/action-button.tsx"],"names":[],"mappings":";AAAA,OAAO,EACH,IAAI,EACJ,QAAQ,EAER,OAAO,EACP,eAAe,GAClB,MAAM,6BAA6B,CAAC;AACrC,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAiB,MAAM,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AAatD,MAAM,CAAC,MAAM,YAAY,GAA0B,CAAC,EAChD,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,OAAO,GACV,EAAE,EAAE;IACD,MAAM,SAAS,GAAG,MAAM,CAAoB,IAAI,CAAC,CAAC;IAClD,MAAM,EAAE,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,GAAG,eAAe,CAAC,SAAS,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
+
padding: @spacing-1 @spacing-2;
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
border: none;
|
|
7
|
+
background-color: transparent;
|
|
8
|
+
width: 210px;
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
|
|
12
|
+
&.primary:hover,
|
|
13
|
+
&.primary.focus-visible:focus {
|
|
14
|
+
background-color: @color-blue-100;
|
|
15
|
+
border-radius: @border-radius-1;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions-button.d.ts","sourceRoot":"","sources":["../../../../src/components/campaign-actions/actions-button/actions-button.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAA+B,SAAS,EAAE,MAAM,OAAO,CAAC;AAInE,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC;IAC3B,QAAQ,EAAE,SAAS,CAAC;CACvB,CAoEA,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Card, Popover, Icon } from '@servicetitan/design-system';
|
|
3
|
+
import { useState, useRef, useEffect } from 'react';
|
|
4
|
+
import * as Styles from './actions-button.module.less';
|
|
5
|
+
export const ActionsButton = ({ children }) => {
|
|
6
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
7
|
+
const wrapElem = useRef(null);
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
const handleClick = (event) => {
|
|
10
|
+
if (!wrapElem.current) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
const isClickedInside = wrapElem.current.contains(event.target);
|
|
14
|
+
if (!isClickedInside) {
|
|
15
|
+
close();
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
window.addEventListener('click', handleClick);
|
|
19
|
+
return () => {
|
|
20
|
+
window.removeEventListener('click', handleClick);
|
|
21
|
+
};
|
|
22
|
+
}, []);
|
|
23
|
+
const toggle = () => {
|
|
24
|
+
setIsOpen(!isOpen);
|
|
25
|
+
};
|
|
26
|
+
const close = () => {
|
|
27
|
+
setIsOpen(false);
|
|
28
|
+
};
|
|
29
|
+
return (_jsx("div", Object.assign({ ref: wrapElem, className: "qa-actions-button d-ib", onClick: e => {
|
|
30
|
+
e.stopPropagation();
|
|
31
|
+
} }, { children: _jsx(Popover, Object.assign({ className: Styles.popover, width: "xs", open: isOpen, direction: "bl", trigger: _jsx(Card, Object.assign({ raised: true, sharp: true, padding: "none", active: isOpen, onClick: toggle, className: "qa-actions-button-menu-button" }, { children: _jsx(Card.Section, Object.assign({ className: "p-half-i" }, { children: _jsx(Icon, { name: "more_vert", size: "22px", className: isOpen ? 'c-blue-400' : '' }) })) })) }, { children: children })) })));
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=actions-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions-button.js","sourceRoot":"","sources":["../../../../src/components/campaign-actions/actions-button/actions-button.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAM,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAa,MAAM,OAAO,CAAC;AAEnE,OAAO,KAAK,MAAM,MAAM,8BAA8B,CAAC;AAEvD,MAAM,CAAC,MAAM,aAAa,GAErB,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IAClB,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC5C,MAAM,QAAQ,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAE9C,SAAS,CAAC,GAAG,EAAE;QACX,MAAM,WAAW,GAAG,CAAC,KAAiB,EAAE,EAAE;YACtC,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE;gBACnB,OAAO;aACV;YAED,MAAM,eAAe,GAAG,QAAQ,CAAC,OAAO,CAAC,QAAQ,C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from 'react';
|
|
2
|
+
interface CampaignActionsProps {
|
|
3
|
+
onClickEdit?(): void;
|
|
4
|
+
onClickStop?(): void;
|
|
5
|
+
onClickClone?(): void;
|
|
6
|
+
onClickArchive?(): void;
|
|
7
|
+
onClickUnarchive?(): void;
|
|
8
|
+
}
|
|
9
|
+
export declare const CampaignActions: FC<CampaignActionsProps>;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=campaign-actions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"campaign-actions.d.ts","sourceRoot":"","sources":["../../../../src/components/campaign-actions/actions-button/campaign-actions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAS3B,UAAU,oBAAoB;IAC1B,WAAW,CAAC,IAAI,IAAI,CAAC;IACrB,WAAW,CAAC,IAAI,IAAI,CAAC;IACrB,YAAY,CAAC,IAAI,IAAI,CAAC;IACtB,cAAc,CAAC,IAAI,IAAI,CAAC;IACxB,gBAAgB,CAAC,IAAI,IAAI,CAAC;CAC7B;AAED,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CA2DpD,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ButtonGroup, Button } from '@servicetitan/design-system';
|
|
3
|
+
import { Confirm } from '@servicetitan/confirm';
|
|
4
|
+
import { ActionButtonArchive } from '../action-button/action-button-archive';
|
|
5
|
+
import { ActionButtonUnarchive } from '../action-button/action-button-unarchive';
|
|
6
|
+
import { ActionsButton } from './actions-button';
|
|
7
|
+
import { ActionButtonClone } from '../action-button/action-button-clone';
|
|
8
|
+
import { ActionButtonEdit } from '../action-button/action-button-edit';
|
|
9
|
+
export const CampaignActions = ({ onClickEdit, onClickStop, onClickClone, onClickArchive, onClickUnarchive, }) => {
|
|
10
|
+
const stopAction = (handleClick) => (_jsx(Button, Object.assign({ outline: true, onClick: handleClick, small: true, negative: true, className: "qa-campaign-actions-stop" }, { children: "Stop" })));
|
|
11
|
+
const archiveAction = (handleClick) => (_jsx(ActionButtonArchive, { onClick: handleClick }));
|
|
12
|
+
const unarchiveAction = (handleClick) => (_jsx(ActionButtonUnarchive, { onClick: handleClick }));
|
|
13
|
+
return (_jsxs(ButtonGroup, { children: [onClickStop && (_jsx(Confirm, Object.assign({ onConfirm: onClickStop, title: "Confirm stop", message: "Are you sure you want to stop this campaign?", negative: true }, { children: stopAction }))), _jsxs(ActionsButton, { children: [onClickClone && _jsx(ActionButtonClone, { onClick: onClickClone }), onClickArchive && (_jsx(Confirm, Object.assign({ onConfirm: onClickArchive, title: "Confirm archive", message: "Are you sure you want to archive this campaign?", negative: false }, { children: archiveAction }))), onClickUnarchive && (_jsx(Confirm, Object.assign({ onConfirm: onClickUnarchive, title: "Confirm unarchive", message: "Are you sure you want to unarchive this campaign?", negative: false }, { children: unarchiveAction }))), onClickEdit && _jsx(ActionButtonEdit, { onClick: onClickEdit })] })] }));
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=campaign-actions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"campaign-actions.js","sourceRoot":"","sources":["../../../../src/components/campaign-actions/actions-button/campaign-actions.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AAUvE,MAAM,CAAC,MAA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|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare function CampaignActions(): JSX.Element;
|
|
3
|
+
declare const _default: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: typeof CampaignActions;
|
|
6
|
+
parameters: {};
|
|
7
|
+
};
|
|
8
|
+
export default _default;
|
|
9
|
+
//# sourceMappingURL=campaign-actions.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"campaign-actions.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/campaign-actions/actions-button/campaign-actions.stories.tsx"],"names":[],"mappings":";AAEA,wBAAgB,eAAe,gBAU9B;;;;;;AAED,wBAIE"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { CampaignActions as Component } from './campaign-actions';
|
|
3
|
+
export function CampaignActions() {
|
|
4
|
+
return (_jsx(Component, { onClickEdit: () => { }, onClickStop: () => { }, onClickClone: () => { }, onClickArchive: () => { }, onClickUnarchive: () => { } }));
|
|
5
|
+
}
|
|
6
|
+
export default {
|
|
7
|
+
title: 'MRK Components/CampaignActions',
|
|
8
|
+
component: CampaignActions,
|
|
9
|
+
parameters: {},
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=campaign-actions.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"campaign-actions.stories.js","sourceRoot":"","sources":["../../../../src/components/campaign-actions/actions-button/campaign-actions.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,IAAI,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAElE,MAAM,UAAU,eAAe;IAC3B,OAAO,CACH,KAAC,SAAS,IACN,WAAW,EAAE,GAAG,EAAE,GAAE,CAAC,EACrB,WAAW,EAAE,GAAG,EAAE,GAAE,CAAC,EACrB,YAAY,EAAE,GAAG,EAAE,GAAE,CAAC,EACtB,cAAc,EAAE,GAAG,EAAE,GAAE,CAAC,EACxB,gBAAgB,EAAE,GAAG,EAAE,GAAE,CAAC,GAC5B,CACL,CAAC;AACN,CAAC;AAED,eAAe;IACX,KAAK,EAAE,gCAAgC;IACvC,SAAS,EAAE,eAAe;IAC1B,UAAU,EAAE,EAAE;CACjB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/campaign-actions/index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/campaign-actions/index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC"}
|
package/lib/index.d.ts
CHANGED
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;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAE9C,cAAc,iBAAiB,CAAC"}
|
package/lib/index.js
CHANGED
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;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAE9C,cAAc,iBAAiB,CAAC"}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"repository": {
|
|
4
4
|
"url": "https://github.com/servicetitan/marketing"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.1.
|
|
6
|
+
"version": "1.1.1",
|
|
7
7
|
"description": "",
|
|
8
8
|
"main": "./lib/index.js",
|
|
9
9
|
"typings": "./lib/index.d.ts",
|
|
@@ -30,5 +30,5 @@
|
|
|
30
30
|
"cli": {
|
|
31
31
|
"webpack": false
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "2ac514219fc62a114bd05bd5bbc64c211963ceab"
|
|
34
34
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { ActionButton } from './action-button';
|
|
3
|
+
|
|
4
|
+
export const ActionButtonArchive: FC<{
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
tooltip?: string;
|
|
7
|
+
onClick?(): void;
|
|
8
|
+
}> = props => (
|
|
9
|
+
<ActionButton
|
|
10
|
+
{...props}
|
|
11
|
+
iconName="archive"
|
|
12
|
+
hover="primary"
|
|
13
|
+
tooltip={props.tooltip}
|
|
14
|
+
qaPrefix="qa-action-button-archive"
|
|
15
|
+
>
|
|
16
|
+
Archive
|
|
17
|
+
</ActionButton>
|
|
18
|
+
);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { ActionButton } from './action-button';
|
|
3
|
+
|
|
4
|
+
export const ActionButtonClone: FC<{ disabled?: boolean; onClick?(): void }> = props => (
|
|
5
|
+
<ActionButton
|
|
6
|
+
{...props}
|
|
7
|
+
iconName="control_point_duplicate"
|
|
8
|
+
hover="primary"
|
|
9
|
+
qaPrefix="qa-action-button-clone"
|
|
10
|
+
>
|
|
11
|
+
Clone
|
|
12
|
+
</ActionButton>
|
|
13
|
+
);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { ActionButton } from './action-button';
|
|
3
|
+
|
|
4
|
+
export const ActionButtonEdit: FC<{
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
tooltip?: string;
|
|
7
|
+
onClick?(): void;
|
|
8
|
+
}> = props => (
|
|
9
|
+
<ActionButton
|
|
10
|
+
{...props}
|
|
11
|
+
iconName="edit"
|
|
12
|
+
hover="primary"
|
|
13
|
+
qaPrefix="qa-action-button-edit"
|
|
14
|
+
tooltip={props.tooltip}
|
|
15
|
+
>
|
|
16
|
+
Edit
|
|
17
|
+
</ActionButton>
|
|
18
|
+
);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { ActionButton } from './action-button';
|
|
3
|
+
|
|
4
|
+
export const ActionButtonUnarchive: FC<{ disabled?: boolean; onClick?(): void }> = props => (
|
|
5
|
+
<ActionButton
|
|
6
|
+
{...props}
|
|
7
|
+
iconName="unarchive"
|
|
8
|
+
hover="primary"
|
|
9
|
+
qaPrefix="qa-action-button-unarchive"
|
|
10
|
+
>
|
|
11
|
+
Unarchive
|
|
12
|
+
</ActionButton>
|
|
13
|
+
);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
@import (reference) '@servicetitan/tokens/dist/tokens.less';
|
|
2
|
+
|
|
3
|
+
.action-button {
|
|
4
|
+
padding: @spacing-1 @spacing-2;
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
border: none;
|
|
7
|
+
background-color: transparent;
|
|
8
|
+
width: 210px;
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
|
|
12
|
+
&.primary:hover,
|
|
13
|
+
&.primary.focus-visible:focus {
|
|
14
|
+
background-color: @color-blue-100;
|
|
15
|
+
border-radius: @border-radius-1;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Icon,
|
|
3
|
+
BodyText,
|
|
4
|
+
IconNameType,
|
|
5
|
+
Tooltip,
|
|
6
|
+
useFocusVisible,
|
|
7
|
+
} from '@servicetitan/design-system';
|
|
8
|
+
import classnames from 'classnames';
|
|
9
|
+
import { ReactNode, FC, useRef } from 'react';
|
|
10
|
+
import * as Styles from './action-button.module.less';
|
|
11
|
+
|
|
12
|
+
export interface ActionButtonProps {
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
iconName?: IconNameType;
|
|
15
|
+
hover?: 'primary' | 'negative' | 'none';
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
tooltip?: string;
|
|
18
|
+
qaPrefix?: string;
|
|
19
|
+
active?: boolean;
|
|
20
|
+
onClick?(): void;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const ActionButton: FC<ActionButtonProps> = ({
|
|
24
|
+
active,
|
|
25
|
+
children,
|
|
26
|
+
disabled,
|
|
27
|
+
iconName,
|
|
28
|
+
onClick,
|
|
29
|
+
qaPrefix,
|
|
30
|
+
tooltip,
|
|
31
|
+
}) => {
|
|
32
|
+
const buttonRef = useRef<HTMLButtonElement>(null);
|
|
33
|
+
const { blurFunction, focusFunction, isFocusVisible } = useFocusVisible(buttonRef);
|
|
34
|
+
|
|
35
|
+
const handleClick = () => {
|
|
36
|
+
if (disabled) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (onClick) {
|
|
41
|
+
onClick();
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const getButton = () => {
|
|
46
|
+
const classes = classnames(Styles.actionButton, qaPrefix, {
|
|
47
|
+
[Styles.primary]: !disabled,
|
|
48
|
+
[Styles.focusVisible]: isFocusVisible,
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<button
|
|
53
|
+
type="button"
|
|
54
|
+
ref={buttonRef}
|
|
55
|
+
className={classes}
|
|
56
|
+
onClick={handleClick}
|
|
57
|
+
disabled={disabled}
|
|
58
|
+
onFocus={focusFunction}
|
|
59
|
+
onBlur={blurFunction}
|
|
60
|
+
>
|
|
61
|
+
{iconName && <Icon name={iconName} size="20px" className="m-r-1" />}
|
|
62
|
+
<BodyText className={`${qaPrefix}-text ${active ? 'c-blue-500' : 'c-neutral-100'}`}>
|
|
63
|
+
{children}
|
|
64
|
+
</BodyText>
|
|
65
|
+
</button>
|
|
66
|
+
);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
if (!tooltip) {
|
|
70
|
+
return getButton();
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return (
|
|
74
|
+
<Tooltip text={tooltip} direction="l" el="div" className={`${qaPrefix}-tooltip`}>
|
|
75
|
+
{getButton()}
|
|
76
|
+
</Tooltip>
|
|
77
|
+
);
|
|
78
|
+
};
|