@servicetitan/mpa-components 0.1.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/lib/components/settings/company-details/company-details-form.stories.d.ts +9 -0
- package/lib/components/settings/company-details/company-details-form.stories.d.ts.map +1 -0
- package/lib/components/settings/company-details/company-details-form.stories.js +45 -0
- package/lib/components/settings/company-details/company-details-form.stories.js.map +1 -0
- package/lib/components/settings/company-details/index.d.ts +20 -0
- package/lib/components/settings/company-details/index.d.ts.map +1 -0
- package/lib/components/settings/company-details/index.js +11 -0
- package/lib/components/settings/company-details/index.js.map +1 -0
- package/lib/components/settings/company-email-footer/company-email-footer.stories.d.ts +9 -0
- package/lib/components/settings/company-email-footer/company-email-footer.stories.d.ts.map +1 -0
- package/lib/components/settings/company-email-footer/company-email-footer.stories.js +38 -0
- package/lib/components/settings/company-email-footer/company-email-footer.stories.js.map +1 -0
- package/lib/components/settings/company-email-footer/index.d.ts +11 -0
- package/lib/components/settings/company-email-footer/index.d.ts.map +1 -0
- package/lib/components/settings/company-email-footer/index.js +10 -0
- package/lib/components/settings/company-email-footer/index.js.map +1 -0
- package/lib/components/settings/company-email-reply-to/company-email-reply-to.stories.d.ts +9 -0
- package/lib/components/settings/company-email-reply-to/company-email-reply-to.stories.d.ts.map +1 -0
- package/lib/components/settings/company-email-reply-to/company-email-reply-to.stories.js +36 -0
- package/lib/components/settings/company-email-reply-to/company-email-reply-to.stories.js.map +1 -0
- package/lib/components/settings/company-email-reply-to/index.d.ts +7 -0
- package/lib/components/settings/company-email-reply-to/index.d.ts.map +1 -0
- package/lib/components/settings/company-email-reply-to/index.js +12 -0
- package/lib/components/settings/company-email-reply-to/index.js.map +1 -0
- package/lib/components/settings/company-email-sender/company-email-sender.module.less +7 -0
- package/lib/components/settings/company-email-sender/company-email-sender.stories.d.ts +9 -0
- package/lib/components/settings/company-email-sender/company-email-sender.stories.d.ts.map +1 -0
- package/lib/components/settings/company-email-sender/company-email-sender.stories.js +38 -0
- package/lib/components/settings/company-email-sender/company-email-sender.stories.js.map +1 -0
- package/lib/components/settings/company-email-sender/index.d.ts +12 -0
- package/lib/components/settings/company-email-sender/index.d.ts.map +1 -0
- package/lib/components/settings/company-email-sender/index.js +29 -0
- package/lib/components/settings/company-email-sender/index.js.map +1 -0
- package/lib/components/settings/company-trade-checkbox/company-trade-checkbox.module.less +13 -0
- package/lib/components/settings/company-trade-checkbox/index.d.ts +10 -0
- package/lib/components/settings/company-trade-checkbox/index.d.ts.map +1 -0
- package/lib/components/settings/company-trade-checkbox/index.js +14 -0
- package/lib/components/settings/company-trade-checkbox/index.js.map +1 -0
- package/lib/components/settings/company-trades-picker/company-trades-picker.stories.d.ts +10 -0
- package/lib/components/settings/company-trades-picker/company-trades-picker.stories.d.ts.map +1 -0
- package/lib/components/settings/company-trades-picker/company-trades-picker.stories.js +68 -0
- package/lib/components/settings/company-trades-picker/company-trades-picker.stories.js.map +1 -0
- package/lib/components/settings/company-trades-picker/index.d.ts +19 -0
- package/lib/components/settings/company-trades-picker/index.d.ts.map +1 -0
- package/lib/components/settings/company-trades-picker/index.js +16 -0
- package/lib/components/settings/company-trades-picker/index.js.map +1 -0
- package/lib/components/settings/double-opt-in/double-opt-in.module.less +3 -0
- package/lib/components/settings/double-opt-in/double-opt-in.stories.d.ts +9 -0
- package/lib/components/settings/double-opt-in/double-opt-in.stories.d.ts.map +1 -0
- package/lib/components/settings/double-opt-in/double-opt-in.stories.js +42 -0
- package/lib/components/settings/double-opt-in/double-opt-in.stories.js.map +1 -0
- package/lib/components/settings/double-opt-in/index.d.ts +16 -0
- package/lib/components/settings/double-opt-in/index.d.ts.map +1 -0
- package/lib/components/settings/double-opt-in/index.js +23 -0
- package/lib/components/settings/double-opt-in/index.js.map +1 -0
- package/lib/components/settings/email-preview/email-preview.d.ts +13 -0
- package/lib/components/settings/email-preview/email-preview.d.ts.map +1 -0
- package/lib/components/settings/email-preview/email-preview.js +9 -0
- package/lib/components/settings/email-preview/email-preview.js.map +1 -0
- package/lib/components/settings/email-preview/email-preview.module.less +62 -0
- package/lib/components/settings/email-preview/opt-in-email-preview.d.ts +10 -0
- package/lib/components/settings/email-preview/opt-in-email-preview.d.ts.map +1 -0
- package/lib/components/settings/email-preview/opt-in-email-preview.js +10 -0
- package/lib/components/settings/email-preview/opt-in-email-preview.js.map +1 -0
- package/lib/components/settings/email-preview/opt-out-email-preview.d.ts +9 -0
- package/lib/components/settings/email-preview/opt-out-email-preview.d.ts.map +1 -0
- package/lib/components/settings/email-preview/opt-out-email-preview.js +9 -0
- package/lib/components/settings/email-preview/opt-out-email-preview.js.map +1 -0
- package/lib/components/settings/index.d.ts +10 -0
- package/lib/components/settings/index.d.ts.map +1 -0
- package/lib/components/settings/index.js +10 -0
- package/lib/components/settings/index.js.map +1 -0
- package/lib/components/settings/logo-picker/index.d.ts +32 -0
- package/lib/components/settings/logo-picker/index.d.ts.map +1 -0
- package/lib/components/settings/logo-picker/index.js +88 -0
- package/lib/components/settings/logo-picker/index.js.map +1 -0
- package/lib/components/settings/logo-picker/logo-picker.module.less +21 -0
- package/lib/components/settings/logo-picker/logo-picker.stories.d.ts +9 -0
- package/lib/components/settings/logo-picker/logo-picker.stories.d.ts.map +1 -0
- package/lib/components/settings/logo-picker/logo-picker.stories.js +13 -0
- package/lib/components/settings/logo-picker/logo-picker.stories.js.map +1 -0
- package/lib/components/settings/opt-out-message/index.d.ts +17 -0
- package/lib/components/settings/opt-out-message/index.d.ts.map +1 -0
- package/lib/components/settings/opt-out-message/index.js +22 -0
- package/lib/components/settings/opt-out-message/index.js.map +1 -0
- package/lib/components/settings/opt-out-message/opt-out-message.module.less +20 -0
- package/lib/components/settings/opt-out-message/opt-out-message.stories.d.ts +9 -0
- package/lib/components/settings/opt-out-message/opt-out-message.stories.d.ts.map +1 -0
- package/lib/components/settings/opt-out-message/opt-out-message.stories.js +44 -0
- package/lib/components/settings/opt-out-message/opt-out-message.stories.js.map +1 -0
- package/lib/components/settings/settings-section/index.d.ts +11 -0
- package/lib/components/settings/settings-section/index.d.ts.map +1 -0
- package/lib/components/settings/settings-section/index.js +6 -0
- package/lib/components/settings/settings-section/index.js.map +1 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +3 -0
- package/lib/index.js.map +1 -0
- package/lib/utils/helpers.d.ts +7 -0
- package/lib/utils/helpers.d.ts.map +1 -0
- package/lib/utils/helpers.js +24 -0
- package/lib/utils/helpers.js.map +1 -0
- package/package.json +36 -0
- package/src/components/settings/company-details/company-details-form.stories.tsx +39 -0
- package/src/components/settings/company-details/index.tsx +157 -0
- package/src/components/settings/company-email-footer/company-email-footer.stories.tsx +26 -0
- package/src/components/settings/company-email-footer/index.tsx +79 -0
- package/src/components/settings/company-email-reply-to/company-email-reply-to.stories.tsx +23 -0
- package/src/components/settings/company-email-reply-to/index.tsx +38 -0
- package/src/components/settings/company-email-sender/company-email-sender.module.less +7 -0
- package/src/components/settings/company-email-sender/company-email-sender.module.less.d.ts +3 -0
- package/src/components/settings/company-email-sender/company-email-sender.stories.tsx +26 -0
- package/src/components/settings/company-email-sender/index.tsx +129 -0
- package/src/components/settings/company-trade-checkbox/company-trade-checkbox.module.less +13 -0
- package/src/components/settings/company-trade-checkbox/company-trade-checkbox.module.less.d.ts +4 -0
- package/src/components/settings/company-trade-checkbox/index.tsx +43 -0
- package/src/components/settings/company-trades-picker/company-trades-picker.stories.tsx +78 -0
- package/src/components/settings/company-trades-picker/index.tsx +78 -0
- package/src/components/settings/double-opt-in/double-opt-in.module.less +3 -0
- package/src/components/settings/double-opt-in/double-opt-in.module.less.d.ts +3 -0
- package/src/components/settings/double-opt-in/double-opt-in.stories.tsx +28 -0
- package/src/components/settings/double-opt-in/index.tsx +143 -0
- package/src/components/settings/email-preview/email-preview.module.less +62 -0
- package/src/components/settings/email-preview/email-preview.module.less.d.ts +8 -0
- package/src/components/settings/email-preview/email-preview.tsx +69 -0
- package/src/components/settings/email-preview/opt-in-email-preview.tsx +30 -0
- package/src/components/settings/email-preview/opt-out-email-preview.tsx +31 -0
- package/src/components/settings/index.ts +9 -0
- package/src/components/settings/logo-picker/index.tsx +256 -0
- package/src/components/settings/logo-picker/logo-picker.module.less +21 -0
- package/src/components/settings/logo-picker/logo-picker.module.less.d.ts +4 -0
- package/src/components/settings/logo-picker/logo-picker.stories.tsx +21 -0
- package/src/components/settings/opt-out-message/index.tsx +154 -0
- package/src/components/settings/opt-out-message/opt-out-message.module.less +20 -0
- package/src/components/settings/opt-out-message/opt-out-message.module.less.d.ts +5 -0
- package/src/components/settings/opt-out-message/opt-out-message.stories.tsx +31 -0
- package/src/components/settings/settings-section/index.tsx +35 -0
- package/src/index.ts +3 -0
- package/src/utils/helpers.ts +31 -0
- package/tsconfig.json +11 -0
- package/tsconfig.tsbuildinfo +1 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const CompanyDetails: (() => JSX.Element) & import("@servicetitan/react-ioc/dist/provide").WrappedComponent<() => JSX.Element>;
|
|
3
|
+
declare const _default: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: (() => JSX.Element) & import("@servicetitan/react-ioc/dist/provide").WrappedComponent<() => JSX.Element>;
|
|
6
|
+
parameters: {};
|
|
7
|
+
};
|
|
8
|
+
export default _default;
|
|
9
|
+
//# sourceMappingURL=company-details-form.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"company-details-form.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/settings/company-details/company-details-form.stories.tsx"],"names":[],"mappings":";AAsBA,eAAO,MAAM,cAAc,0GAUzB,CAAC;;;;;;AAEH,wBAIE"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
import { InputFieldState } from '@servicetitan/form';
|
|
9
|
+
import { injectable, provide, useDependencies } from '@servicetitan/react-ioc';
|
|
10
|
+
import { FormState } from 'formstate';
|
|
11
|
+
import { CompanyDetails as Component } from '.';
|
|
12
|
+
import { LogoPicker } from '../logo-picker/logo-picker.stories';
|
|
13
|
+
let DetailsStore = class DetailsStore {
|
|
14
|
+
constructor() {
|
|
15
|
+
Object.defineProperty(this, "form", {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
configurable: true,
|
|
18
|
+
writable: true,
|
|
19
|
+
value: new FormState({
|
|
20
|
+
companyName: new InputFieldState('Acme Inc'),
|
|
21
|
+
tagline: new InputFieldState('Ayo! The Acme rules'),
|
|
22
|
+
street: new InputFieldState('Backed st.'),
|
|
23
|
+
unit: new InputFieldState('123'),
|
|
24
|
+
city: new InputFieldState('Glendale'),
|
|
25
|
+
state: new InputFieldState('CA'),
|
|
26
|
+
zipCode: new InputFieldState('91203'),
|
|
27
|
+
companyEmail: new InputFieldState('info@acme.com'),
|
|
28
|
+
yearEstablished: new InputFieldState(1999),
|
|
29
|
+
})
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
DetailsStore = __decorate([
|
|
34
|
+
injectable()
|
|
35
|
+
], DetailsStore);
|
|
36
|
+
export const CompanyDetails = provide({ singletons: [DetailsStore] })(() => {
|
|
37
|
+
const [store] = useDependencies(DetailsStore);
|
|
38
|
+
return (_jsx(Component, { formState: store.form.$, logoPicker: _jsx(LogoPicker, {}, void 0), handleCompanyEmailBlur: () => alert('company email blurred') }, void 0));
|
|
39
|
+
});
|
|
40
|
+
export default {
|
|
41
|
+
title: 'MPA Components/settings/CompanyDetails',
|
|
42
|
+
component: CompanyDetails,
|
|
43
|
+
parameters: {},
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=company-details-form.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"company-details-form.stories.js","sourceRoot":"","sources":["../../../../src/components/settings/company-details/company-details-form.stories.tsx"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EAAE,cAAc,IAAI,SAAS,EAAE,MAAM,GAAG,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAGhE,IAAM,YAAY,GAAlB,MAAM,YAAY;IAAlB;QACI;;;;mBAAO,IAAI,SAAS,CAAC;gBACjB,WAAW,EAAE,IAAI,eAAe,CAAC,UAAU,CAAC;gBAC5C,OAAO,EAAE,IAAI,eAAe,CAAC,qBAAqB,CAAC;gBACnD,MAAM,EAAE,IAAI,eAAe,CAAC,YAAY,CAAC;gBACzC,IAAI,EAAE,IAAI,eAAe,CAAC,KAAK,CAAC;gBAChC,IAAI,EAAE,IAAI,eAAe,CAAC,UAAU,CAAC;gBACrC,KAAK,EAAE,IAAI,eAAe,CAAC,IAAI,CAAC;gBAChC,OAAO,EAAE,IAAI,eAAe,CAAC,OAAO,CAAC;gBACrC,YAAY,EAAE,IAAI,eAAe,CAAC,eAAe,CAAC;gBAClD,eAAe,EAAE,IAAI,eAAe,CAAC,IAAI,CAAC;aAC7C,CAAC;WAAC;IACP,CAAC;CAAA,CAAA;AAZK,YAAY;IADjB,UAAU,EAAE;GACP,YAAY,CAYjB;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE;IACvE,MAAM,CAAC,KAAK,CAAC,GAAG,eAAe,CAAC,YAAY,CAAC,CAAC;IAE9C,OAAO,CACH,KAAC,SAAS,IACN,SAAS,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,EACvB,UAAU,EAAE,KAAC,UAAU,aAAG,EAC1B,sBAAsB,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,uBAAuB,CAAC,WAC9D,CACL,CAAC;AACN,CAAC,CAAC,CAAC;AAEH,eAAe;IACX,KAAK,EAAE,wCAAwC;IAC/C,SAAS,EAAE,cAAc;IACzB,UAAU,EAAE,EAAE;CACjB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { InputFieldState } from '@servicetitan/form';
|
|
3
|
+
export interface CompanyDetailsProps {
|
|
4
|
+
formState: {
|
|
5
|
+
city: InputFieldState<string>;
|
|
6
|
+
companyEmail: InputFieldState<string>;
|
|
7
|
+
companyName: InputFieldState<string>;
|
|
8
|
+
state: InputFieldState<string>;
|
|
9
|
+
street: InputFieldState<string>;
|
|
10
|
+
tagline: InputFieldState<string>;
|
|
11
|
+
unit: InputFieldState<string>;
|
|
12
|
+
yearEstablished: InputFieldState<number>;
|
|
13
|
+
zipCode: InputFieldState<string>;
|
|
14
|
+
};
|
|
15
|
+
logoPicker?: ReactNode;
|
|
16
|
+
sectionDescription?: string | JSX.Element;
|
|
17
|
+
handleCompanyEmailBlur?: () => void;
|
|
18
|
+
}
|
|
19
|
+
export declare const CompanyDetails: FC<CompanyDetailsProps>;
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/settings/company-details/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAY,SAAS,EAAE,MAAM,OAAO,CAAC;AAIhD,OAAO,EAAe,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAGlE,MAAM,WAAW,mBAAmB;IAChC,SAAS,EAAE;QACP,IAAI,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;QAC9B,YAAY,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;QACtC,WAAW,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;QACrC,KAAK,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;QAC/B,MAAM,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;QAChC,OAAO,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;QACjC,IAAI,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;QAC9B,eAAe,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;QACzC,OAAO,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;KACpC,CAAC;IACF,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,kBAAkB,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC;IAC1C,sBAAsB,CAAC,EAAE,MAAM,IAAI,CAAC;CACvC;AAkBD,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAoHlD,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment } from 'react';
|
|
3
|
+
import { observer } from 'mobx-react';
|
|
4
|
+
import { Form, Link } from '@servicetitan/design-system';
|
|
5
|
+
import { NumberInput } from '@servicetitan/form';
|
|
6
|
+
import { SettingsSection } from '../settings-section';
|
|
7
|
+
const DEFAULT_SECTION_DESCRIPTION = (_jsxs(Fragment, { children: ["Enter these details as you would like them to appear in your campaign. Much of this info can be utilized as\u00A0", _jsx(Link, Object.assign({ href: "https://help.servicetitan.com/Content/Marketing/merge-tags.htm", target: "_blank", primary: true, className: "qa-settings-company-details-merge-tags" }, { children: "merge tags" }), void 0), "."] }, void 0));
|
|
8
|
+
export const CompanyDetails = observer(({ formState, logoPicker, sectionDescription = DEFAULT_SECTION_DESCRIPTION, handleCompanyEmailBlur = () => { }, }) => {
|
|
9
|
+
return (_jsx(SettingsSection, Object.assign({ qaPrefix: "qa-settings-company-details", title: "Company Details", text: sectionDescription }, { children: _jsxs(Form, Object.assign({ className: "m-b-0-i" }, { children: [_jsx(Form.Input, { className: "m-b-2-i qa-settings-company-details-company-name", value: formState.companyName.value, onChange: formState.companyName.onChangeHandler, error: formState.companyName.hasError, label: "Company Name", placeholder: "Enter company name", fluid: true }, void 0), _jsx(Form.Input, { className: "m-b-2-i qa-settings-company-details-tagline", value: formState.tagline.value, onChange: formState.tagline.onChangeHandler, error: formState.tagline.hasError, label: "Tagline / Slogan", placeholder: "ex: Trusted since 1956", fluid: true }, void 0), _jsxs(Form.Group, Object.assign({ className: "m-b-2-i" }, { children: [_jsx(Form.Input, { width: 8, className: "m-b-0-i qa-settings-company-details-address", value: formState.street.value, onChange: formState.street.onChangeHandler, error: formState.street.hasError, label: "Street Address", placeholder: "801 N Brand Blvd" }, void 0), _jsx(Form.Input, { width: 4, className: "m-b-0-i qa-settings-company-details-address", value: formState.unit.value, onChange: formState.unit.onChangeHandler, error: formState.unit.hasError, label: "Suite, Unit, etc" }, void 0)] }), void 0), _jsxs(Form.Group, Object.assign({ widths: "equal", className: "m-b-2-i" }, { children: [_jsx(Form.Input, { className: "m-b-0-i qa-settings-company-details-city", value: formState.city.value, onChange: formState.city.onChangeHandler, error: formState.city.hasError, label: "City", placeholder: "Glendale", fluid: true }, void 0), _jsx(Form.Input, { className: "m-b-0-i qa-settings-company-details-state", value: formState.state.value, onChange: formState.state.onChangeHandler, error: formState.state.hasError, label: "State", placeholder: "CA", fluid: true }, void 0), _jsx(Form.Input, { className: "m-b-0-i qa-settings-company-details-zip-code", value: formState.zipCode.value, onChange: formState.zipCode.onChangeHandler, error: formState.zipCode.hasError, label: "Zip Code", placeholder: "91203", fluid: true, maxLength: 7 }, void 0)] }), void 0), _jsxs(Form.Group, Object.assign({ className: "m-b-2-i" }, { children: [_jsx(Form.Input, { width: 8, className: "m-b-0-i qa-settings-company-details-company-email", value: formState.companyEmail.value, onChange: formState.companyEmail.onChangeHandler, error: formState.companyEmail.hasError, onBlur: handleCompanyEmailBlur, label: "Company Email", placeholder: "hello@yourcompany.com", fluid: true }, void 0), _jsx(Form.Field, Object.assign({ label: "Year Established", className: "qa-settings-company-details-company-email", width: 4, error: formState.yearEstablished.hasError }, { children: _jsx(NumberInput, { value: formState.yearEstablished.value, onChange: formState.yearEstablished.onChange, emptyValue: undefined, min: 1, max: 2099, useEmptyThousandsSeparator: true, placeholder: "1950", fluid: true }, void 0) }), void 0)] }), void 0), logoPicker] }), void 0) }), void 0));
|
|
10
|
+
});
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/settings/company-details/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,QAAQ,EAAa,MAAM,OAAO,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAmB,MAAM,oBAAoB,CAAC;AAElE,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAkBtD,MAAM,2BAA2B,GAAG,CAChC,MAAC,QAAQ,oIAGL,KAAC,IAAI,kBACD,IAAI,EAAC,gEAAgE,EACrE,MAAM,EAAC,QAAQ,EACf,OAAO,QACP,SAAS,EAAC,wCAAwC,wCAG/C,iBAEA,CACd,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAA4B,QAAQ,CAC3D,CAAC,EACG,SAAS,EACT,UAAU,EACV,kBAAkB,GAA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,YAAY,CAAC,KAAK,EACnC,QAAQ,EAAE,SAAS,CAAC,YAAY,CAAC,eAAe,EAChD,KAAK,EAAE,SAAS,CAAC,YAAY,CAAC,QAAQ,EACtC,MAAM,EAAE,sBAAsB,EAC9B,KAAK,EAAC,eAAe,EACrB,WAAW,EAAC,uBAAuB,EACnC,KAAK,iBACP,EACF,KAAC,IAAI,CAAC,KAAK,kBACP,KAAK,EAAC,kBAAkB,EACxB,SAAS,EAAC,2CAA2C,EACrD,KAAK,EAAE,CAAC,EACR,KAAK,EAAE,SAAS,CAAC,eAAe,CAAC,QAAQ,gBAEzC,KAAC,WAAW,IACR,KAAK,EAAE,SAAS,CAAC,eAAe,CAAC,KAAK,EACtC,QAAQ,EAAE,SAAS,CAAC,eAAe,CAAC,QAAQ,EAC5C,UAAU,EAAE,SAAS,EACrB,GAAG,EAAE,CAAC,EACN,GAAG,EAAE,IAAI,EACT,0BAA0B,QAC1B,WAAW,EAAC,MAAM,EAClB,KAAK,iBACP,YACO,aACJ,EACZ,UAAU,aACR,YACO,CACrB,CAAC;AACN,CAAC,CACJ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: import("react").FC<import(".").CompanyEmailFooterProps>;
|
|
5
|
+
parameters: {};
|
|
6
|
+
};
|
|
7
|
+
export default _default;
|
|
8
|
+
export declare const CompanyEmailFooter: (() => JSX.Element) & import("@servicetitan/react-ioc/dist/provide").WrappedComponent<() => JSX.Element>;
|
|
9
|
+
//# sourceMappingURL=company-email-footer.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"company-email-footer.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/settings/company-email-footer/company-email-footer.stories.tsx"],"names":[],"mappings":";;;;;;AAMA,wBAIE;AAWF,eAAO,MAAM,kBAAkB,0GAI7B,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
import { InputFieldState } from '@servicetitan/form';
|
|
9
|
+
import { injectable, provide, useDependencies } from '@servicetitan/react-ioc';
|
|
10
|
+
import { FormState } from 'formstate';
|
|
11
|
+
import { CompanyEmailFooter as Component } from '.';
|
|
12
|
+
export default {
|
|
13
|
+
title: 'MPA Components/settings/CompanyEmailFooter',
|
|
14
|
+
component: Component,
|
|
15
|
+
parameters: {},
|
|
16
|
+
};
|
|
17
|
+
let CompanyEmailStore = class CompanyEmailStore {
|
|
18
|
+
constructor() {
|
|
19
|
+
Object.defineProperty(this, "form", {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
configurable: true,
|
|
22
|
+
writable: true,
|
|
23
|
+
value: new FormState({
|
|
24
|
+
legalCopy: new InputFieldState('Legal copy example'),
|
|
25
|
+
license: new InputFieldState('License'),
|
|
26
|
+
copyrightText: new InputFieldState('Copyritght 2022'),
|
|
27
|
+
})
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
CompanyEmailStore = __decorate([
|
|
32
|
+
injectable()
|
|
33
|
+
], CompanyEmailStore);
|
|
34
|
+
export const CompanyEmailFooter = provide({ singletons: [CompanyEmailStore] })(() => {
|
|
35
|
+
const [store] = useDependencies(CompanyEmailStore);
|
|
36
|
+
return _jsx(Component, { formState: store.form.$ }, void 0);
|
|
37
|
+
});
|
|
38
|
+
//# sourceMappingURL=company-email-footer.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"company-email-footer.stories.js","sourceRoot":"","sources":["../../../../src/components/settings/company-email-footer/company-email-footer.stories.tsx"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EAAE,kBAAkB,IAAI,SAAS,EAAE,MAAM,GAAG,CAAC;AAEpD,eAAe;IACX,KAAK,EAAE,4CAA4C;IACnD,SAAS,EAAE,SAAS;IACpB,UAAU,EAAE,EAAE;CACjB,CAAC;AAGF,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAAvB;QACI;;;;mBAAO,IAAI,SAAS,CAAC;gBACjB,SAAS,EAAE,IAAI,eAAe,CAAC,oBAAoB,CAAC;gBACpD,OAAO,EAAE,IAAI,eAAe,CAAC,SAAS,CAAC;gBACvC,aAAa,EAAE,IAAI,eAAe,CAAC,iBAAiB,CAAC;aACxD,CAAC;WAAC;IACP,CAAC;CAAA,CAAA;AANK,iBAAiB;IADtB,UAAU,EAAE;GACP,iBAAiB,CAMtB;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE;IAChF,MAAM,CAAC,KAAK,CAAC,GAAG,eAAe,CAAC,iBAAiB,CAAC,CAAC;IAEnD,OAAO,KAAC,SAAS,IAAC,SAAS,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,WAAI,CAAC;AAClD,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { InputFieldState } from '@servicetitan/form';
|
|
3
|
+
export interface CompanyEmailFooterProps {
|
|
4
|
+
formState: {
|
|
5
|
+
legalCopy: InputFieldState<string>;
|
|
6
|
+
license: InputFieldState<string>;
|
|
7
|
+
copyrightText: InputFieldState<string>;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export declare const CompanyEmailFooter: FC<CompanyEmailFooterProps>;
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/settings/company-email-footer/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAY,MAAM,OAAO,CAAC;AAIrC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAIrD,MAAM,WAAW,uBAAuB;IACpC,SAAS,EAAE;QACP,SAAS,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;QACnC,OAAO,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;QACjC,aAAa,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;KAC1C,CAAC;CACL;AAED,eAAO,MAAM,kBAAkB,EAAE,EAAE,CAAC,uBAAuB,CA8D1D,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment } from 'react';
|
|
3
|
+
import { observer } from 'mobx-react';
|
|
4
|
+
import { Form, Text } from '@servicetitan/design-system';
|
|
5
|
+
import { SettingsSection } from '../settings-section';
|
|
6
|
+
export const CompanyEmailFooter = observer(({ formState: { legalCopy, license, copyrightText } }) => {
|
|
7
|
+
return (_jsx(SettingsSection, Object.assign({ title: "Footer", text: `Your footer will be partially generated from the Company Details section above.
|
|
8
|
+
Please enter the additional info so that it is CAN-SPAM compliant.`, qaPrefix: "qa-settings-footer" }, { children: _jsxs(Form, Object.assign({ className: "m-b-0-i" }, { children: [_jsx(Form.TextArea, { className: "m-b-2-i qa-settings-footer-legal-copy", label: _jsxs(Fragment, { children: ["Legal Copy\u00A0", _jsx(Text, Object.assign({ inline: true, size: 2, subdued: true }, { children: "(optional)" }), void 0)] }, void 0), placeholder: "Enter legal copy here", value: legalCopy.value, onChange: legalCopy.onChangeHandler }, void 0), _jsxs(Form.Group, Object.assign({ className: "m-b-0-i" }, { children: [_jsx(Form.Input, { width: 6, className: "m-b-0-i qa-settings-footer-lic", value: license.value, onChange: license.onChangeHandler, label: _jsxs(Fragment, { children: ["LIC #\u00A0", _jsx(Text, Object.assign({ inline: true, size: 2, subdued: true }, { children: "(optional)" }), void 0)] }, void 0), placeholder: "XYZ12345", fluid: true }, void 0), _jsx(Form.Input, { width: 6, className: "m-b-0-i qa-settings-footer-copyright-text", value: copyrightText.value, onChange: copyrightText.onChangeHandler, label: _jsxs(Fragment, { children: ["Copyright Text\u00A0", _jsx(Text, Object.assign({ inline: true, size: 2, subdued: true }, { children: "(optional)" }), void 0)] }, void 0), placeholder: "\u00A9 2022, all right reserved", fluid: true }, void 0)] }), void 0)] }), void 0) }), void 0));
|
|
9
|
+
});
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/settings/company-email-footer/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AAGzD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAUtD,MAAM,CAAC,MAAM,kBAAkB,GAAgC,QAAQ,CACnE,CAAC,EAAE,SAAS,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,aAAa,EAAE,EAAE,EAAE,EAAE;IACrD,OAAO,CACH,KAAC,eAAe,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").FC<import(".").CompanyEmailReplyToProps>;
|
|
5
|
+
parameters: {};
|
|
6
|
+
};
|
|
7
|
+
export default _default;
|
|
8
|
+
export declare const CompanyEmailReplyTo: (() => JSX.Element) & import("@servicetitan/react-ioc/dist/provide").WrappedComponent<() => JSX.Element>;
|
|
9
|
+
//# sourceMappingURL=company-email-reply-to.stories.d.ts.map
|
package/lib/components/settings/company-email-reply-to/company-email-reply-to.stories.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"company-email-reply-to.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/settings/company-email-reply-to/company-email-reply-to.stories.tsx"],"names":[],"mappings":";;;;;;AAMA,wBAIE;AASF,eAAO,MAAM,mBAAmB,0GAG9B,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
import { InputFieldState } from '@servicetitan/form';
|
|
9
|
+
import { injectable, provide, useDependencies } from '@servicetitan/react-ioc';
|
|
10
|
+
import { FormState } from 'formstate';
|
|
11
|
+
import { CompanyEmailReplyTo as Component } from '.';
|
|
12
|
+
export default {
|
|
13
|
+
title: 'MPA Components/settings/CompanyEmailReplyTo',
|
|
14
|
+
component: Component,
|
|
15
|
+
parameters: {},
|
|
16
|
+
};
|
|
17
|
+
let CompanyEmailReplyToStore = class CompanyEmailReplyToStore {
|
|
18
|
+
constructor() {
|
|
19
|
+
Object.defineProperty(this, "form", {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
configurable: true,
|
|
22
|
+
writable: true,
|
|
23
|
+
value: new FormState({
|
|
24
|
+
replyToEmail: new InputFieldState('info@acme.com'),
|
|
25
|
+
})
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
CompanyEmailReplyToStore = __decorate([
|
|
30
|
+
injectable()
|
|
31
|
+
], CompanyEmailReplyToStore);
|
|
32
|
+
export const CompanyEmailReplyTo = provide({ singletons: [CompanyEmailReplyToStore] })(() => {
|
|
33
|
+
const [store] = useDependencies(CompanyEmailReplyToStore);
|
|
34
|
+
return _jsx(Component, { replyToEmail: store.form.$.replyToEmail }, void 0);
|
|
35
|
+
});
|
|
36
|
+
//# sourceMappingURL=company-email-reply-to.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"company-email-reply-to.stories.js","sourceRoot":"","sources":["../../../../src/components/settings/company-email-reply-to/company-email-reply-to.stories.tsx"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EAAE,mBAAmB,IAAI,SAAS,EAAE,MAAM,GAAG,CAAC;AAErD,eAAe;IACX,KAAK,EAAE,6CAA6C;IACpD,SAAS,EAAE,SAAS;IACpB,UAAU,EAAE,EAAE;CACjB,CAAC;AAGF,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IAA9B;QACI;;;;mBAAO,IAAI,SAAS,CAAC;gBACjB,YAAY,EAAE,IAAI,eAAe,CAAC,eAAe,CAAC;aACrD,CAAC;WAAC;IACP,CAAC;CAAA,CAAA;AAJK,wBAAwB;IAD7B,UAAU,EAAE;GACP,wBAAwB,CAI7B;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC,wBAAwB,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE;IACxF,MAAM,CAAC,KAAK,CAAC,GAAG,eAAe,CAAC,wBAAwB,CAAC,CAAC;IAC1D,OAAO,KAAC,SAAS,IAAC,YAAY,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,WAAI,CAAC;AAClE,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { InputFieldState } from '@servicetitan/form';
|
|
3
|
+
export interface CompanyEmailReplyToProps {
|
|
4
|
+
replyToEmail: InputFieldState<string>;
|
|
5
|
+
}
|
|
6
|
+
export declare const CompanyEmailReplyTo: FC<CompanyEmailReplyToProps>;
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/settings/company-email-reply-to/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAe,MAAM,OAAO,CAAC;AAGxC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAKrD,MAAM,WAAW,wBAAwB;IACrC,YAAY,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;CACzC;AAED,eAAO,MAAM,mBAAmB,EAAE,EAAE,CAAC,wBAAwB,CAyB3D,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback } from 'react';
|
|
3
|
+
import { observer } from 'mobx-react';
|
|
4
|
+
import { Form } from '@servicetitan/design-system';
|
|
5
|
+
import { SettingsSection } from '../settings-section';
|
|
6
|
+
export const CompanyEmailReplyTo = observer(({ replyToEmail }) => {
|
|
7
|
+
const handleReplyToBlur = useCallback(() => {
|
|
8
|
+
replyToEmail.validate();
|
|
9
|
+
}, [replyToEmail]);
|
|
10
|
+
return (_jsx(SettingsSection, Object.assign({ title: "Reply-To", text: "This is where emails will be sent if someone replies to one of your emails.", qaPrefix: "qa-settings-reply-to" }, { children: _jsx(Form, Object.assign({ className: "m-b-0-i" }, { children: _jsx(Form.Input, { className: "m-b-0-i qa-settings-reply-to-email-address", value: replyToEmail.value, onChange: replyToEmail.onChangeHandler, error: replyToEmail.hasError, onBlur: handleReplyToBlur, label: "Reply-to Email Address", placeholder: "info@yourcompany.com", fluid: true }, void 0) }), void 0) }), void 0));
|
|
11
|
+
});
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/settings/company-email-reply-to/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,WAAW,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AAEnD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAMtD,MAAM,CAAC,MAAM,mBAAmB,GAAiC,QAAQ,CAAC,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE;IAC3F,MAAM,iBAAiB,GAAG,WAAW,CAAC,GAAG,EAAE;QACvC,YAAY,CAAC,QAAQ,EAAE,CAAC;IAC5B,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IAEnB,OAAO,CACH,KAAC,eAAe,kBACZ,KAAK,EAAC,UAAU,EAChB,IAAI,EAAC,6EAA6E,EAClF,QAAQ,EAAC,sBAAsB,gBAE/B,KAAC,IAAI,kBAAC,SAAS,EAAC,SAAS,gBACrB,KAAC,IAAI,CAAC,KAAK,IACP,SAAS,EAAC,4CAA4C,EACtD,KAAK,EAAE,YAAY,CAAC,KAAK,EACzB,QAAQ,EAAE,YAAY,CAAC,eAAe,EACtC,KAAK,EAAE,YAAY,CAAC,QAAQ,EAC5B,MAAM,EAAE,iBAAiB,EACzB,KAAK,EAAC,wBAAwB,EAC9B,WAAW,EAAC,sBAAsB,EAClC,KAAK,iBACP,YACC,YACO,CACrB,CAAC;AACN,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: import("react").FC<import(".").CompanyEmailSenderProps>;
|
|
5
|
+
parameters: {};
|
|
6
|
+
};
|
|
7
|
+
export default _default;
|
|
8
|
+
export declare const CompanyEmailSender: (() => JSX.Element) & import("@servicetitan/react-ioc/dist/provide").WrappedComponent<() => JSX.Element>;
|
|
9
|
+
//# sourceMappingURL=company-email-sender.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"company-email-sender.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/settings/company-email-sender/company-email-sender.stories.tsx"],"names":[],"mappings":";;;;;;AAMA,wBAIE;AAWF,eAAO,MAAM,kBAAkB,0GAI7B,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
import { InputFieldState } from '@servicetitan/form';
|
|
9
|
+
import { injectable, provide, useDependencies } from '@servicetitan/react-ioc';
|
|
10
|
+
import { FormState } from 'formstate';
|
|
11
|
+
import { CompanyEmailSender as Component } from '.';
|
|
12
|
+
export default {
|
|
13
|
+
title: 'MPA Components/settings/CompanyEmailSender',
|
|
14
|
+
component: Component,
|
|
15
|
+
parameters: {},
|
|
16
|
+
};
|
|
17
|
+
let CompanyEmailSenderStore = class CompanyEmailSenderStore {
|
|
18
|
+
constructor() {
|
|
19
|
+
Object.defineProperty(this, "form", {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
configurable: true,
|
|
22
|
+
writable: true,
|
|
23
|
+
value: new FormState({
|
|
24
|
+
senderEmail: new InputFieldState('email@acme.com'),
|
|
25
|
+
senderName: new InputFieldState('Pinky & Brain'),
|
|
26
|
+
senderDomain: new InputFieldState('acme'),
|
|
27
|
+
})
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
CompanyEmailSenderStore = __decorate([
|
|
32
|
+
injectable()
|
|
33
|
+
], CompanyEmailSenderStore);
|
|
34
|
+
export const CompanyEmailSender = provide({ singletons: [CompanyEmailSenderStore] })(() => {
|
|
35
|
+
const [store] = useDependencies(CompanyEmailSenderStore);
|
|
36
|
+
return _jsx(Component, { formState: store.form.$, senderTld: "com" }, void 0);
|
|
37
|
+
});
|
|
38
|
+
//# sourceMappingURL=company-email-sender.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"company-email-sender.stories.js","sourceRoot":"","sources":["../../../../src/components/settings/company-email-sender/company-email-sender.stories.tsx"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EAAE,kBAAkB,IAAI,SAAS,EAAE,MAAM,GAAG,CAAC;AAEpD,eAAe;IACX,KAAK,EAAE,4CAA4C;IACnD,SAAS,EAAE,SAAS;IACpB,UAAU,EAAE,EAAE;CACjB,CAAC;AAGF,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAA7B;QACI;;;;mBAAO,IAAI,SAAS,CAAC;gBACjB,WAAW,EAAE,IAAI,eAAe,CAAC,gBAAgB,CAAC;gBAClD,UAAU,EAAE,IAAI,eAAe,CAAC,eAAe,CAAC;gBAChD,YAAY,EAAE,IAAI,eAAe,CAAC,MAAM,CAAC;aAC5C,CAAC;WAAC;IACP,CAAC;CAAA,CAAA;AANK,uBAAuB;IAD5B,UAAU,EAAE;GACP,uBAAuB,CAM5B;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC,uBAAuB,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE;IACtF,MAAM,CAAC,KAAK,CAAC,GAAG,eAAe,CAAC,uBAAuB,CAAC,CAAC;IAEzD,OAAO,KAAC,SAAS,IAAC,SAAS,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE,SAAS,EAAC,KAAK,WAAG,CAAC;AAClE,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { InputFieldState } from '@servicetitan/form';
|
|
3
|
+
export interface CompanyEmailSenderProps {
|
|
4
|
+
formState: {
|
|
5
|
+
senderName: InputFieldState<string>;
|
|
6
|
+
senderDomain: InputFieldState<string>;
|
|
7
|
+
senderEmail: InputFieldState<string>;
|
|
8
|
+
};
|
|
9
|
+
senderTld: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const CompanyEmailSender: FC<CompanyEmailSenderProps>;
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/settings/company-email-sender/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAyC,EAAE,EAAE,MAAM,OAAO,CAAC;AAIlE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAOrD,MAAM,WAAW,uBAAuB;IACpC,SAAS,EAAE;QACP,UAAU,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;QACpC,YAAY,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;QACtC,WAAW,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;KACxC,CAAC;IAEF,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,kBAAkB,EAAE,EAAE,CAAC,uBAAuB,CA2G1D,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment, useCallback } from 'react';
|
|
3
|
+
import { observer } from 'mobx-react';
|
|
4
|
+
import { Form, Text } from '@servicetitan/design-system';
|
|
5
|
+
import { SettingsSection } from '../settings-section';
|
|
6
|
+
import { convertDomainName } from '../../../utils/helpers';
|
|
7
|
+
import * as Styles from './company-email-sender.module.less';
|
|
8
|
+
export const CompanyEmailSender = observer(({ formState: { senderDomain, senderName, senderEmail }, senderTld }) => {
|
|
9
|
+
const handleSenderNameChange = useCallback((_0, data) => {
|
|
10
|
+
if (data.value.length > 80) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
senderName.onChange(data.value);
|
|
14
|
+
}, [senderName]);
|
|
15
|
+
const handleSenderDomainChange = useCallback((_0, data) => {
|
|
16
|
+
if (data.value.length > 30) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
senderDomain.onChange(data.value);
|
|
20
|
+
}, [senderDomain]);
|
|
21
|
+
const handleSenderEmailChange = useCallback((_0, data) => {
|
|
22
|
+
if (data.value.length > 50) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
senderEmail.onChange(data.value);
|
|
26
|
+
}, [senderEmail]);
|
|
27
|
+
return (_jsx(SettingsSection, Object.assign({ title: "Sender", text: "Configure sender name and email.", qaPrefix: "qa-settings-sender" }, { children: _jsxs(Form, Object.assign({ className: "m-b-0-i" }, { children: [_jsxs(Form.Group, Object.assign({ widths: "equal", className: "m-b-2-i" }, { children: [_jsx(Form.Input, { width: 6, className: "m-b-0-i qa-settings-sender-name", value: senderName.value, onChange: handleSenderNameChange, error: senderName.hasError, label: _jsxs(Fragment, { children: ["Sender Name \u00A0\u00A0", _jsx(Text, Object.assign({ inline: true, size: 2, subdued: true }, { children: "max 80 characters" }), void 0)] }, void 0), placeholder: "John Doe", fluid: true }, void 0), _jsx(Form.Input, { width: 6, className: "m-b-0-i qa-settings-sender-domain", value: senderDomain.value, onChange: handleSenderDomainChange, error: senderDomain.hasError, label: "Sender Domain", placeholder: "Your Company", fluid: true }, void 0)] }), void 0), _jsxs(Form.Group, Object.assign({ className: "m-b-0-i" }, { children: [_jsx(Form.Input, { width: 6, className: "m-b-0-i qa-settings-sender-email", value: senderEmail.value, onChange: handleSenderEmailChange, error: senderEmail.hasError, label: _jsxs(Fragment, { children: ["Sender Email\u00A0", _jsx(Text, Object.assign({ inline: true, size: 2, subdued: true }, { children: "(domain added automatically)" }), void 0)] }, void 0), placeholder: "john.doe", fluid: true }, void 0), _jsx(Form.Field, Object.assign({ label: '\u00A0' }, { children: _jsx("div", Object.assign({ className: Styles.domain }, { children: _jsxs(Text, Object.assign({ size: 3, bold: true, subdued: true, className: "qa-settings-sender-generated-domain" }, { children: ["@", senderDomain.$ ? convertDomainName(senderDomain.$) : 'domain', ".", senderTld] }), void 0) }), void 0) }), void 0)] }), void 0)] }), void 0) }), void 0));
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/settings/company-email-sender/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAkB,QAAQ,EAAE,WAAW,EA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AK,kBAAC,KAAK,EAAE,QAAQ,gBACvB,4BAAK,SAAS,EAAE,MAAM,CAAC,MAAM,gBACzB,MAAC,IAAI,kBACD,IAAI,EAAE,CAAC,EACP,IAAI,QACJ,OAAO,QACP,SAAS,EAAC,qCAAqC,sBAE7C,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,OAC7D,SAAS,aACR,YACL,YACG,aACJ,aACV,YACO,CACrB,CAAC;AACN,CAAC,CACJ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface CompanyTradeCheckboxProps<TradesType extends string = string> {
|
|
3
|
+
label?: JSX.Element | string;
|
|
4
|
+
value?: TradesType;
|
|
5
|
+
className?: string;
|
|
6
|
+
active?: boolean;
|
|
7
|
+
onClick?(item?: TradesType): void;
|
|
8
|
+
}
|
|
9
|
+
export declare function CompanyTradeCheckbox({ label, value, className, active, onClick, }: CompanyTradeCheckboxProps): JSX.Element;
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/settings/company-trade-checkbox/index.tsx"],"names":[],"mappings":";AAOA,MAAM,WAAW,yBAAyB,CAAC,UAAU,SAAS,MAAM,GAAG,MAAM;IACzE,KAAK,CAAC,EAAE,GAAG,CAAC,OAAO,GAAG,MAAM,CAAC;IAC7B,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,CAAC,IAAI,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;CACrC;AAED,wBAAgB,oBAAoB,CAAC,EACjC,KAAK,EACL,KAAK,EACL,SAAS,EACT,MAAM,EACN,OAAO,GACV,EAAE,yBAAyB,eAqB3B"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback } from 'react';
|
|
3
|
+
import classnames from 'classnames';
|
|
4
|
+
import { Card, Icon } from '@servicetitan/design-system';
|
|
5
|
+
import * as Styles from './company-trade-checkbox.module.less';
|
|
6
|
+
export function CompanyTradeCheckbox({ label, value, className, active, onClick, }) {
|
|
7
|
+
const handleClick = useCallback(() => {
|
|
8
|
+
if (onClick) {
|
|
9
|
+
onClick(value);
|
|
10
|
+
}
|
|
11
|
+
}, [onClick, value]);
|
|
12
|
+
return (_jsx(Card, Object.assign({ onClick: handleClick, active: active, className: classnames(Styles.card, className), sharp: true, thin: true }, { children: _jsxs(Card.Section, { children: [active && _jsx(Icon, { name: "check_circle", className: Styles.checkbox, size: 24 }, void 0), label] }, void 0) }), void 0));
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/settings/company-trade-checkbox/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AAEzD,OAAO,KAAK,MAAM,MAAM,sCAAsC,CAAC;AAU/D,MAAM,UAAU,oBAAoB,CAAC,EACjC,KAAK,EACL,KAAK,EACL,SAAS,EACT,MAAM,EACN,OAAO,GACiB;IACxB,MAAM,WAAW,GAAG,WAAW,CAAC,GAAG,EAAE;QACjC,IAAI,OAAO,EAAE;YACT,OAAO,CAAC,KAAK,CAAC,CAAC;SAClB;IACL,CAAC,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;IAErB,OAAO,CACH,KAAC,IAAI,kBACD,OAAO,EAAE,WAAW,EACpB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,EAC7C,KAAK,QACL,IAAI,sBAEJ,MAAC,IAAI,CAAC,OAAO,eACR,MAAM,IAAI,KAAC,IAAI,IAAC,IAAI,EAAC,cAAc,EAAC,SAAS,EAAE,MAAM,CAAC,QAAQ,EAAE,IAAI,EAAE,EAAE,WAAI,EAC5E,KAAK,YACK,YACZ,CACV,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { CompanyTradesPicker as Component } from '.';
|
|
3
|
+
declare const _default: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: typeof Component;
|
|
6
|
+
parameters: {};
|
|
7
|
+
};
|
|
8
|
+
export default _default;
|
|
9
|
+
export declare function CompanyTradesPicker(): JSX.Element;
|
|
10
|
+
//# sourceMappingURL=company-trades-picker.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"company-trades-picker.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/settings/company-trades-picker/company-trades-picker.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,mBAAmB,IAAI,SAAS,EAAS,MAAM,GAAG,CAAC;;;;;;AAE5D,wBAIE;AASF,wBAAgB,mBAAmB,gBA6DlC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useState } from 'react';
|
|
3
|
+
import { CompanyTradesPicker as Component } from '.';
|
|
4
|
+
export default {
|
|
5
|
+
title: 'MPA Components/settings/CompanyTradesPicker',
|
|
6
|
+
component: Component,
|
|
7
|
+
parameters: {},
|
|
8
|
+
};
|
|
9
|
+
var TradeType;
|
|
10
|
+
(function (TradeType) {
|
|
11
|
+
TradeType["first"] = "FIRST";
|
|
12
|
+
TradeType["second"] = "SECOND";
|
|
13
|
+
TradeType["third"] = "THIRD";
|
|
14
|
+
TradeType["fourth"] = "FOURTH";
|
|
15
|
+
})(TradeType || (TradeType = {}));
|
|
16
|
+
export function CompanyTradesPicker() {
|
|
17
|
+
const [trades, setTrades] = useState([
|
|
18
|
+
{
|
|
19
|
+
qaKey: 'first',
|
|
20
|
+
name: 'first',
|
|
21
|
+
value: TradeType.first,
|
|
22
|
+
active: true,
|
|
23
|
+
asset: {
|
|
24
|
+
main: 'https://place-hold.it/64x64',
|
|
25
|
+
x2: 'https://place-hold.it/128x128',
|
|
26
|
+
x3: 'https://place-hold.it/192x192',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
qaKey: 'second',
|
|
31
|
+
name: 'second',
|
|
32
|
+
value: TradeType.second,
|
|
33
|
+
active: false,
|
|
34
|
+
asset: {
|
|
35
|
+
main: 'https://place-hold.it/64x64',
|
|
36
|
+
x2: 'https://place-hold.it/128x128',
|
|
37
|
+
x3: 'https://place-hold.it/192x192',
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
qaKey: 'third',
|
|
42
|
+
name: 'third',
|
|
43
|
+
value: TradeType.third,
|
|
44
|
+
active: false,
|
|
45
|
+
asset: {
|
|
46
|
+
main: 'https://place-hold.it/64x64',
|
|
47
|
+
x2: 'https://place-hold.it/128x128',
|
|
48
|
+
x3: 'https://place-hold.it/192x192',
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
qaKey: 'fourth',
|
|
53
|
+
name: 'fourth',
|
|
54
|
+
value: TradeType.fourth,
|
|
55
|
+
active: false,
|
|
56
|
+
asset: {
|
|
57
|
+
main: 'https://place-hold.it/64x64',
|
|
58
|
+
x2: 'https://place-hold.it/128x128',
|
|
59
|
+
x3: 'https://place-hold.it/192x192',
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
]);
|
|
63
|
+
const selectTrade = useCallback((t) => {
|
|
64
|
+
setTrades(trades.map(trade => (Object.assign(Object.assign({}, trade), { active: trade.value === t ? !trade.active : trade.active }))));
|
|
65
|
+
}, [trades]);
|
|
66
|
+
return _jsx(Component, { trades: trades, onTradeChange: selectTrade }, void 0);
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=company-trades-picker.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"company-trades-picker.stories.js","sourceRoot":"","sources":["../../../../src/components/settings/company-trades-picker/company-trades-picker.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,mBAAmB,IAAI,SAAS,EAAS,MAAM,GAAG,CAAC;AAE5D,eAAe;IACX,KAAK,EAAE,6CAA6C;IACpD,SAAS,EAAE,SAAS;IACpB,UAAU,EAAE,EAAE;CACjB,CAAC;AAEF,IAAK,SAKJ;AALD,WAAK,SAAS;IACV,4BAAe,CAAA;IACf,8BAAiB,CAAA;IACjB,4BAAe,CAAA;IACf,8BAAiB,CAAA;AACrB,CAAC,EALI,SAAS,KAAT,SAAS,QAKb;AAED,MAAM,UAAU,mBAAmB;IAC/B,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAqB;QACrD;YACI,KAAK,EAAE,OAAO;YACd,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,SAAS,CAAC,KAAK;YACtB,MAAM,EAAE,IAAI;YACZ,KAAK,EAAE;gBACH,IAAI,EAAE,6BAA6B;gBACnC,EAAE,EAAE,+BAA+B;gBACnC,EAAE,EAAE,+BAA+B;aACtC;SACJ;QACD;YACI,KAAK,EAAE,QAAQ;YACf,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,SAAS,CAAC,MAAM;YACvB,MAAM,EAAE,KAAK;YACb,KAAK,EAAE;gBACH,IAAI,EAAE,6BAA6B;gBACnC,EAAE,EAAE,+BAA+B;gBACnC,EAAE,EAAE,+BAA+B;aACtC;SACJ;QACD;YACI,KAAK,EAAE,OAAO;YACd,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,SAAS,CAAC,KAAK;YACtB,MAAM,EAAE,KAAK;YACb,KAAK,EAAE;gBACH,IAAI,EAAE,6BAA6B;gBACnC,EAAE,EAAE,+BAA+B;gBACnC,EAAE,EAAE,+BAA+B;aACtC;SACJ;QACD;YACI,KAAK,EAAE,QAAQ;YACf,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,SAAS,CAAC,MAAM;YACvB,MAAM,EAAE,KAAK;YACb,KAAK,EAAE;gBACH,IAAI,EAAE,6BAA6B;gBACnC,EAAE,EAAE,+BAA+B;gBACnC,EAAE,EAAE,+BAA+B;aACtC;SACJ;KACJ,CAAC,CAAC;IAEH,MAAM,WAAW,GAAG,WAAW,CAC3B,CAAC,CAAY,EAAE,EAAE;QACb,SAAS,CACL,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,iCACb,KAAK,KACR,MAAM,EAAE,KAAK,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,IAC1D,CAAC,CACN,CAAC;IACN,CAAC,EACD,CAAC,MAAM,CAAC,CACX,CAAC;IAEF,OAAO,KAAC,SAAS,IAAY,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,WAAW,WAAI,CAAC;AAChF,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface Trade<TradeType extends string> {
|
|
3
|
+
qaKey?: string;
|
|
4
|
+
name: string;
|
|
5
|
+
value: TradeType;
|
|
6
|
+
active: boolean;
|
|
7
|
+
asset: {
|
|
8
|
+
main: string;
|
|
9
|
+
x2: string;
|
|
10
|
+
x3: string;
|
|
11
|
+
alt?: string;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export interface CompanyTradesPickerProps<TradeType extends string = string> {
|
|
15
|
+
trades: Trade<TradeType>[];
|
|
16
|
+
onTradeChange(t?: TradeType): void;
|
|
17
|
+
}
|
|
18
|
+
export declare function CompanyTradesPicker<T extends string = string>({ trades, onTradeChange, }: CompanyTradesPickerProps<T>): JSX.Element;
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/settings/company-trades-picker/index.tsx"],"names":[],"mappings":";AAQA,MAAM,WAAW,KAAK,CAAC,SAAS,SAAS,MAAM;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,SAAS,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE;QACH,IAAI,EAAE,MAAM,CAAC;QACb,EAAE,EAAE,MAAM,CAAC;QACX,EAAE,EAAE,MAAM,CAAC;QACX,GAAG,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;CACL;AAED,MAAM,WAAW,wBAAwB,CAAC,SAAS,SAAS,MAAM,GAAG,MAAM;IACvE,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,EAAE,CAAC;IAC3B,aAAa,CAAC,CAAC,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;CACtC;AAED,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,EAC3D,MAAM,EACN,aAAa,GAChB,EAAE,wBAAwB,CAAC,CAAC,CAAC,eAgD7B"}
|