@gusto/embedded-react-sdk 0.10.2-rc.3 → 0.10.3-rc.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/dist/components/Company/FederalTaxes/Head.js +11 -11
- package/dist/components/Company/FederalTaxes/Head.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
- package/dist/components/Company/Locations/stateMachine.js +33 -35
- package/dist/components/Company/Locations/stateMachine.js.map +1 -1
- package/dist/components/Contractor/List/index.js +47 -50
- package/dist/components/Contractor/List/index.js.map +1 -1
- package/dist/i18n/en/Company.Locations.json.js +2 -2
- package/dist/types/i18next.d.ts +1 -1
- package/package.json +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.10.3
|
|
4
|
+
|
|
5
|
+
- Expose types for adapter and create a loading indicator provider
|
|
6
|
+
- Remove manual invalidation in favor of automatic invalidation after mutation
|
|
7
|
+
- Invalidate queryCache after running mutation API
|
|
8
|
+
- Produce lockfile for documentation to better organize frontmatter for Github Action
|
|
9
|
+
- Reorganize docs to match readme hierarchy
|
|
10
|
+
|
|
3
11
|
## 0.10.2
|
|
4
12
|
|
|
5
13
|
### Fixes
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useTranslation as
|
|
3
|
-
import { useComponentContext as
|
|
4
|
-
function
|
|
5
|
-
const { t:
|
|
6
|
-
return /* @__PURE__ */
|
|
7
|
-
/* @__PURE__ */ e(n.Heading, { as: "h2", children:
|
|
1
|
+
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation as o, Trans as i } from "react-i18next";
|
|
3
|
+
import { useComponentContext as s } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
4
|
+
function l() {
|
|
5
|
+
const { t: r } = o("Company.FederalTaxes"), n = s();
|
|
6
|
+
return /* @__PURE__ */ t("header", { children: [
|
|
7
|
+
/* @__PURE__ */ e(n.Heading, { as: "h2", children: r("pageTitle") }),
|
|
8
8
|
/* @__PURE__ */ e(n.Text, { children: /* @__PURE__ */ e(
|
|
9
|
-
|
|
9
|
+
i,
|
|
10
10
|
{
|
|
11
|
-
t:
|
|
11
|
+
t: r,
|
|
12
12
|
i18nKey: "entity_type_and_legal_name_intro",
|
|
13
13
|
components: {
|
|
14
14
|
einLink: /* @__PURE__ */ e(
|
|
15
15
|
n.Link,
|
|
16
16
|
{
|
|
17
|
-
href: "https://www.irs.gov/businesses/
|
|
17
|
+
href: "https://www.irs.gov/businesses/employer-identification-number#lost",
|
|
18
18
|
target: "_blank",
|
|
19
19
|
rel: "noopener noreferrer"
|
|
20
20
|
}
|
|
@@ -25,6 +25,6 @@ function p() {
|
|
|
25
25
|
] });
|
|
26
26
|
}
|
|
27
27
|
export {
|
|
28
|
-
|
|
28
|
+
l as Head
|
|
29
29
|
};
|
|
30
30
|
//# sourceMappingURL=Head.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Head.js","sources":["../../../../src/components/Company/FederalTaxes/Head.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Head() {\n const { t } = useTranslation('Company.FederalTaxes')\n const Components = useComponentContext()\n\n return (\n <header>\n <Components.Heading as=\"h2\">{t('pageTitle')}</Components.Heading>\n <Components.Text>\n <Trans\n t={t}\n i18nKey=\"entity_type_and_legal_name_intro\"\n components={{\n einLink: (\n <Components.Link\n href=\"https://www.irs.gov/businesses/
|
|
1
|
+
{"version":3,"file":"Head.js","sources":["../../../../src/components/Company/FederalTaxes/Head.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Head() {\n const { t } = useTranslation('Company.FederalTaxes')\n const Components = useComponentContext()\n\n return (\n <header>\n <Components.Heading as=\"h2\">{t('pageTitle')}</Components.Heading>\n <Components.Text>\n <Trans\n t={t}\n i18nKey=\"entity_type_and_legal_name_intro\"\n components={{\n einLink: (\n <Components.Link\n href=\"https://www.irs.gov/businesses/employer-identification-number#lost\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n </Components.Text>\n </header>\n )\n}\n"],"names":["Head","t","useTranslation","Components","useComponentContext","jsx","Trans"],"mappings":";;;AAGO,SAASA,IAAO;AACrB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,sBAAsB,GAC7CC,IAAaC,EAAoB;AAEvC,2BACG,UACC,EAAA,UAAA;AAAA,IAAA,gBAAAC,EAACF,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAAF,EAAE,WAAW,GAAE;AAAA,IAC5C,gBAAAI,EAACF,EAAW,MAAX,EACC,UAAA,gBAAAE;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,GAAAL;AAAA,QACA,SAAQ;AAAA,QACR,YAAY;AAAA,UACV,SACE,gBAAAI;AAAA,YAACF,EAAW;AAAA,YAAX;AAAA,cACC,MAAK;AAAA,cACL,QAAO;AAAA,cACP,KAAI;AAAA,YAAA;AAAA,UAAA;AAAA,QACN;AAAA,MAEJ;AAAA,IAAA,EAEJ,CAAA;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -72,7 +72,7 @@ const q = () => {
|
|
|
72
72
|
currentPage: d,
|
|
73
73
|
totalPages: l
|
|
74
74
|
},
|
|
75
|
-
emptyState: () => /* @__PURE__ */ t(b, { title: e("emptyTableTitle"), description: e("emptyTableDescription"), children: /* @__PURE__ */ t(a.Button, { variant: "secondary", onClick: h, children: e("
|
|
75
|
+
emptyState: () => /* @__PURE__ */ t(b, { title: e("emptyTableTitle"), description: e("emptyTableDescription"), children: /* @__PURE__ */ t(a.Button, { variant: "secondary", onClick: h, children: e("addFirstLocationCta") }) })
|
|
76
76
|
});
|
|
77
77
|
return /* @__PURE__ */ t(S, { label: e("locationListLabel"), ...f });
|
|
78
78
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List.js","sources":["../../../../../src/components/Company/Locations/LocationsList/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useLocationsList } from './useLocationsList'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport { DataView, EmptyData, useDataView, VisuallyHidden } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport { getCityStateZip, getStreet } from '@/helpers/formattedStrings'\n\n/**List of employees slot for EmployeeList component */\nexport const List = () => {\n const Components = useComponentContext()\n const {\n locationList,\n handleEditLocation,\n currentPage,\n totalPages,\n handleFirstPage,\n handleItemsPerPageChange,\n handleLastPage,\n handleNextPage,\n handlePreviousPage,\n handleAddLocation,\n } = useLocationsList()\n\n const { t } = useTranslation('Company.Locations')\n const { ...dataViewProps } = useDataView({\n data: locationList,\n columns: [\n {\n key: 'name',\n title: t('locationListCol1'),\n render: location => {\n return (\n <>\n <address>\n {getStreet(location)}\n <br />\n <small>{getCityStateZip(location)}</small>\n </address>\n </>\n )\n },\n },\n {\n key: 'status',\n title: <VisuallyHidden>{t('locationListCol2')}</VisuallyHidden>,\n render: location => {\n return (\n <>\n {location.mailingAddress && (\n <Components.Badge status={'info'}>{t('mailingAddress')}</Components.Badge>\n )}\n {location.filingAddress && (\n <>\n {' '}\n <Components.Badge status={'info'}>{t('filingAddress')}</Components.Badge>\n </>\n )}\n </>\n )\n },\n },\n ],\n itemMenu: location => {\n return (\n <HamburgerMenu\n items={[\n {\n label: t('editCta'),\n onClick: () => {\n handleEditLocation(location.uuid)\n },\n icon: <PencilSvg aria-hidden />,\n 'data-testid': 'edit-location',\n },\n ]}\n data-testid=\"location-hamburger\"\n triggerLabel={t('hamburgerTitle')}\n />\n )\n },\n pagination: {\n handleNextPage,\n handleFirstPage,\n handleLastPage,\n handlePreviousPage,\n handleItemsPerPageChange,\n currentPage,\n totalPages,\n },\n emptyState: () => (\n <EmptyData title={t('emptyTableTitle')} description={t('emptyTableDescription')}>\n <Components.Button variant=\"secondary\" onClick={handleAddLocation}>\n {t('
|
|
1
|
+
{"version":3,"file":"List.js","sources":["../../../../../src/components/Company/Locations/LocationsList/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useLocationsList } from './useLocationsList'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport { DataView, EmptyData, useDataView, VisuallyHidden } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport { getCityStateZip, getStreet } from '@/helpers/formattedStrings'\n\n/**List of employees slot for EmployeeList component */\nexport const List = () => {\n const Components = useComponentContext()\n const {\n locationList,\n handleEditLocation,\n currentPage,\n totalPages,\n handleFirstPage,\n handleItemsPerPageChange,\n handleLastPage,\n handleNextPage,\n handlePreviousPage,\n handleAddLocation,\n } = useLocationsList()\n\n const { t } = useTranslation('Company.Locations')\n const { ...dataViewProps } = useDataView({\n data: locationList,\n columns: [\n {\n key: 'name',\n title: t('locationListCol1'),\n render: location => {\n return (\n <>\n <address>\n {getStreet(location)}\n <br />\n <small>{getCityStateZip(location)}</small>\n </address>\n </>\n )\n },\n },\n {\n key: 'status',\n title: <VisuallyHidden>{t('locationListCol2')}</VisuallyHidden>,\n render: location => {\n return (\n <>\n {location.mailingAddress && (\n <Components.Badge status={'info'}>{t('mailingAddress')}</Components.Badge>\n )}\n {location.filingAddress && (\n <>\n {' '}\n <Components.Badge status={'info'}>{t('filingAddress')}</Components.Badge>\n </>\n )}\n </>\n )\n },\n },\n ],\n itemMenu: location => {\n return (\n <HamburgerMenu\n items={[\n {\n label: t('editCta'),\n onClick: () => {\n handleEditLocation(location.uuid)\n },\n icon: <PencilSvg aria-hidden />,\n 'data-testid': 'edit-location',\n },\n ]}\n data-testid=\"location-hamburger\"\n triggerLabel={t('hamburgerTitle')}\n />\n )\n },\n pagination: {\n handleNextPage,\n handleFirstPage,\n handleLastPage,\n handlePreviousPage,\n handleItemsPerPageChange,\n currentPage,\n totalPages,\n },\n emptyState: () => (\n <EmptyData title={t('emptyTableTitle')} description={t('emptyTableDescription')}>\n <Components.Button variant=\"secondary\" onClick={handleAddLocation}>\n {t('addFirstLocationCta')}\n </Components.Button>\n </EmptyData>\n ),\n })\n return <DataView label={t('locationListLabel')} {...dataViewProps} />\n}\n"],"names":["List","Components","useComponentContext","locationList","handleEditLocation","currentPage","totalPages","handleFirstPage","handleItemsPerPageChange","handleLastPage","handleNextPage","handlePreviousPage","handleAddLocation","useLocationsList","t","useTranslation","dataViewProps","useDataView","location","jsx","Fragment","getStreet","getCityStateZip","VisuallyHidden","jsxs","HamburgerMenu","PencilSvg","EmptyData","DataView"],"mappings":";;;;;;;;;;;;AASO,MAAMA,IAAO,MAAM;AACxB,QAAMC,IAAaC,EAAoB,GACjC;AAAA,IACJ,cAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,YAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,0BAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,mBAAAC;AAAA,MACEC,EAAiB,GAEf,EAAE,GAAAC,EAAA,IAAMC,EAAe,mBAAmB,GAC1C,EAAE,GAAGC,EAAc,IAAIC,EAAY;AAAA,IACvC,MAAMd;AAAA,IACN,SAAS;AAAA,MACP;AAAA,QACE,KAAK;AAAA,QACL,OAAOW,EAAE,kBAAkB;AAAA,QAC3B,QAAQ,CAAYI,MAEhB,gBAAAC,EAAAC,GAAA,EACE,4BAAC,WACE,EAAA,UAAA;AAAA,UAAAC,EAAUH,CAAQ;AAAA,4BAClB,MAAG,EAAA;AAAA,UACH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BAAuB,GAC5E,UAAC,gBAAAK,EAAAlB,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASW,GAC7C,UAAAE,EAAE,qBAAqB,EAC1B,CAAA,EACF,CAAA;AAAA,EAAA,CAEH;AACD,2BAAQc,GAAS,EAAA,OAAOd,EAAE,mBAAmB,GAAI,GAAGE,GAAe;AACrE;"}
|
|
@@ -1,63 +1,61 @@
|
|
|
1
|
-
import { state as c, transition as
|
|
2
|
-
import { LocationsListContextual as
|
|
3
|
-
import { companyEvents as
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
}, a = (o, t) => {
|
|
7
|
-
console.log(`[Locations State Machine] Event: ${o}`, t);
|
|
8
|
-
}, E = i(
|
|
9
|
-
d.CANCEL,
|
|
1
|
+
import { state as c, transition as n, reduce as t } from "robot3";
|
|
2
|
+
import { LocationsListContextual as a, LocationFormContextual as e } from "./locationsStateMachine.js";
|
|
3
|
+
import { companyEvents as i, componentEvents as A } from "../../../shared/constants.js";
|
|
4
|
+
const d = n(
|
|
5
|
+
A.CANCEL,
|
|
10
6
|
"index",
|
|
11
|
-
|
|
7
|
+
t((o) => ({
|
|
12
8
|
...o,
|
|
13
|
-
component:
|
|
9
|
+
component: a,
|
|
14
10
|
locationId: void 0
|
|
15
11
|
}))
|
|
16
|
-
),
|
|
12
|
+
), O = {
|
|
17
13
|
index: c(
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
n(
|
|
15
|
+
i.COMPANY_LOCATION_EDIT,
|
|
20
16
|
"locationEdit",
|
|
21
|
-
|
|
22
|
-
(o,
|
|
17
|
+
t(
|
|
18
|
+
(o, m) => ({
|
|
23
19
|
...o,
|
|
24
|
-
component:
|
|
25
|
-
locationId:
|
|
20
|
+
component: e,
|
|
21
|
+
locationId: m.payload.uuid
|
|
26
22
|
})
|
|
27
23
|
)
|
|
28
24
|
),
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
n(
|
|
26
|
+
i.COMPANY_LOCATION_CREATE,
|
|
31
27
|
"locationAdd",
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
28
|
+
t(
|
|
29
|
+
(o) => ({
|
|
30
|
+
...o,
|
|
31
|
+
component: e
|
|
32
|
+
})
|
|
33
|
+
)
|
|
36
34
|
)
|
|
37
35
|
),
|
|
38
36
|
locationAdd: c(
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
n(
|
|
38
|
+
i.COMPANY_LOCATION_CREATED,
|
|
41
39
|
"index",
|
|
42
|
-
|
|
40
|
+
t((o) => ({ ...o, component: a }))
|
|
43
41
|
),
|
|
44
|
-
|
|
42
|
+
d
|
|
45
43
|
),
|
|
46
44
|
locationEdit: c(
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
n(
|
|
46
|
+
i.COMPANY_LOCATION_UPDATED,
|
|
49
47
|
"index",
|
|
50
|
-
|
|
48
|
+
t((o) => ({
|
|
51
49
|
...o,
|
|
52
|
-
component:
|
|
50
|
+
component: a,
|
|
53
51
|
locationId: void 0
|
|
54
52
|
}))
|
|
55
53
|
),
|
|
56
|
-
|
|
54
|
+
d
|
|
57
55
|
)
|
|
58
56
|
};
|
|
59
57
|
export {
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
d as cancelTransition,
|
|
59
|
+
O as locationsStateMachine
|
|
62
60
|
};
|
|
63
61
|
//# sourceMappingURL=stateMachine.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stateMachine.js","sources":["../../../../src/components/Company/Locations/stateMachine.ts"],"sourcesContent":["import { state, transition, reduce } from 'robot3'\nimport type { LocationsContextInterface, EventPayloads } from './locationsStateMachine'\nimport { LocationFormContextual, LocationsListContextual } from './locationsStateMachine'\nimport { companyEvents, componentEvents } from '@/shared/constants'\nimport type { MachineEventType } from '@/types/Helpers'\n\
|
|
1
|
+
{"version":3,"file":"stateMachine.js","sources":["../../../../src/components/Company/Locations/stateMachine.ts"],"sourcesContent":["import { state, transition, reduce } from 'robot3'\nimport type { LocationsContextInterface, EventPayloads } from './locationsStateMachine'\nimport { LocationFormContextual, LocationsListContextual } from './locationsStateMachine'\nimport { companyEvents, componentEvents } from '@/shared/constants'\nimport type { MachineEventType } from '@/types/Helpers'\n\nexport const cancelTransition = transition(\n componentEvents.CANCEL,\n 'index',\n reduce((ctx: LocationsContextInterface) => ({\n ...ctx,\n component: LocationsListContextual,\n locationId: undefined,\n })),\n)\n\nexport const locationsStateMachine = {\n index: state(\n transition(\n companyEvents.COMPANY_LOCATION_EDIT,\n 'locationEdit',\n reduce(\n (\n ctx: LocationsContextInterface,\n ev: MachineEventType<EventPayloads, typeof companyEvents.COMPANY_LOCATION_EDIT>,\n ): LocationsContextInterface => ({\n ...ctx,\n component: LocationFormContextual,\n locationId: ev.payload.uuid,\n }),\n ),\n ),\n transition(\n companyEvents.COMPANY_LOCATION_CREATE,\n 'locationAdd',\n reduce(\n (ctx: LocationsContextInterface): LocationsContextInterface => ({\n ...ctx,\n component: LocationFormContextual,\n }),\n ),\n ),\n ),\n locationAdd: state(\n transition(\n companyEvents.COMPANY_LOCATION_CREATED,\n 'index',\n reduce((ctx: LocationsContextInterface) => ({ ...ctx, component: LocationsListContextual })),\n ),\n cancelTransition,\n ),\n locationEdit: state(\n transition(\n companyEvents.COMPANY_LOCATION_UPDATED,\n 'index',\n reduce((ctx: LocationsContextInterface) => ({\n ...ctx,\n component: LocationsListContextual,\n locationId: undefined,\n })),\n ),\n cancelTransition,\n ),\n}\n"],"names":["cancelTransition","transition","componentEvents","reduce","ctx","LocationsListContextual","locationsStateMachine","state","companyEvents","ev","LocationFormContextual"],"mappings":";;;AAMO,MAAMA,IAAmBC;AAAA,EAC9BC,EAAgB;AAAA,EAChB;AAAA,EACAC,EAAO,CAACC,OAAoC;AAAA,IAC1C,GAAGA;AAAA,IACH,WAAWC;AAAA,IACX,YAAY;AAAA,EAAA,EACZ;AACJ,GAEaC,IAAwB;AAAA,EACnC,OAAOC;AAAA,IACLN;AAAA,MACEO,EAAc;AAAA,MACd;AAAA,MACAL;AAAA,QACE,CACEC,GACAK,OAC+B;AAAA,UAC/B,GAAGL;AAAA,UACH,WAAWM;AAAA,UACX,YAAYD,EAAG,QAAQ;AAAA,QACzB;AAAA,MAAA;AAAA,IAEJ;AAAA,IACAR;AAAA,MACEO,EAAc;AAAA,MACd;AAAA,MACAL;AAAA,QACE,CAACC,OAA+D;AAAA,UAC9D,GAAGA;AAAA,UACH,WAAWM;AAAA,QACb;AAAA,MAAA;AAAA,IACF;AAAA,EAEJ;AAAA,EACA,aAAaH;AAAA,IACXN;AAAA,MACEO,EAAc;AAAA,MACd;AAAA,MACAL,EAAO,CAACC,OAAoC,EAAE,GAAGA,GAAK,WAAWC,IAA0B;AAAA,IAC7F;AAAA,IACAL;AAAA,EACF;AAAA,EACA,cAAcO;AAAA,IACZN;AAAA,MACEO,EAAc;AAAA,MACd;AAAA,MACAL,EAAO,CAACC,OAAoC;AAAA,QAC1C,GAAGA;AAAA,QACH,WAAWC;AAAA,QACX,YAAY;AAAA,MAAA,EACZ;AAAA,IACJ;AAAA,IACAL;AAAA,EAAA;AAEJ;"}
|
|
@@ -1,85 +1,82 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import { useTranslation as
|
|
3
|
-
import { useContractors as
|
|
4
|
-
import { Flex as
|
|
1
|
+
import { jsx as t, jsxs as c } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation as s } from "react-i18next";
|
|
3
|
+
import { useContractors as d } from "./useContractorList.js";
|
|
4
|
+
import { Flex as u } from "../../Common/Flex/Flex.js";
|
|
5
|
+
import { Grid as f } from "../../Common/Grid/Grid.js";
|
|
5
6
|
import "classnames";
|
|
6
|
-
import { EmptyData as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import
|
|
7
|
+
import { EmptyData as C } from "../../Common/EmptyData/EmptyData.js";
|
|
8
|
+
import { ActionsLayout as L } from "../../Common/ActionsLayout/ActionsLayout.js";
|
|
9
|
+
import { firstLastName as g } from "../../../helpers/formattedStrings.js";
|
|
10
|
+
import { HamburgerMenu as h } from "../../Common/HamburgerMenu/HamburgerMenu.js";
|
|
11
|
+
import y from "../../../assets/icons/pencil.svg.js";
|
|
12
|
+
import { useComponentContext as m } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
11
13
|
import { ContractorOnboardingStatusBadge as b } from "../../Common/OnboardingStatusBadge/index.js";
|
|
12
14
|
import { useI18n as T } from "../../../i18n/I18n.js";
|
|
13
|
-
import { useDataView as
|
|
15
|
+
import { useDataView as A } from "../../Common/DataView/useDataView.js";
|
|
14
16
|
import { DataView as x } from "../../Common/DataView/DataView.js";
|
|
15
|
-
function
|
|
16
|
-
const {
|
|
17
|
-
return /* @__PURE__ */
|
|
18
|
-
/* @__PURE__ */ t(
|
|
19
|
-
/* @__PURE__ */ t(r, {
|
|
20
|
-
o !== 0 && /* @__PURE__ */ t(i, { variant: "secondary", onClick: n, children: a("addAnotherCTA") })
|
|
17
|
+
function D({ count: e, handleAdd: o }) {
|
|
18
|
+
const { Button: r, Heading: i } = m(), { t: n } = s("Contractor.ContractorList");
|
|
19
|
+
return /* @__PURE__ */ c(u, { alignItems: "center", justifyContent: "space-between", children: [
|
|
20
|
+
/* @__PURE__ */ t(i, { as: "h2", children: n("title") }),
|
|
21
|
+
e !== 0 && /* @__PURE__ */ t(r, { variant: "secondary", onClick: o, children: n("addAnotherCTA") })
|
|
21
22
|
] });
|
|
22
23
|
}
|
|
23
|
-
function
|
|
24
|
-
const { Button:
|
|
25
|
-
return /* @__PURE__ */
|
|
26
|
-
/* @__PURE__ */ t("h1", { children: r("emptyTableTitle") }),
|
|
27
|
-
r("emptyTableDescription"),
|
|
28
|
-
/* @__PURE__ */ t(n, { onClick: o, children: r("addContractorCTA") })
|
|
29
|
-
] });
|
|
24
|
+
function H({ handleAdd: e }) {
|
|
25
|
+
const { Button: o } = m(), { t: r } = s("Contractor.ContractorList");
|
|
26
|
+
return /* @__PURE__ */ t(C, { title: r("emptyTableTitle"), description: r("emptyTableDescription"), children: /* @__PURE__ */ t(L, { justifyContent: "center", children: /* @__PURE__ */ t(o, { onClick: e, children: r("addContractorCTA") }) }) });
|
|
30
27
|
}
|
|
31
|
-
function
|
|
32
|
-
contractors:
|
|
33
|
-
handleAdd:
|
|
28
|
+
function j({
|
|
29
|
+
contractors: e,
|
|
30
|
+
handleAdd: o,
|
|
34
31
|
handleEdit: r,
|
|
35
32
|
totalCount: i
|
|
36
33
|
}) {
|
|
37
34
|
T("Contractor.ContractorList");
|
|
38
|
-
const { t:
|
|
35
|
+
const { t: n } = s("Contractor.ContractorList"), l = A({
|
|
39
36
|
columns: [
|
|
40
37
|
{
|
|
41
|
-
title:
|
|
42
|
-
render: (
|
|
38
|
+
title: n("listHeaders.name"),
|
|
39
|
+
render: (a) => g({ first_name: a.firstName, last_name: a.lastName })
|
|
43
40
|
},
|
|
44
41
|
{
|
|
45
|
-
title:
|
|
46
|
-
render: ({ onboarded:
|
|
42
|
+
title: n("listHeaders.status"),
|
|
43
|
+
render: ({ onboarded: a, onboardingStatus: p }) => /* @__PURE__ */ t(
|
|
47
44
|
b,
|
|
48
45
|
{
|
|
49
|
-
onboarded:
|
|
50
|
-
onboardingStatus:
|
|
46
|
+
onboarded: a,
|
|
47
|
+
onboardingStatus: p
|
|
51
48
|
}
|
|
52
49
|
)
|
|
53
50
|
}
|
|
54
51
|
],
|
|
55
|
-
data:
|
|
52
|
+
data: e,
|
|
56
53
|
itemMenu: () => /* @__PURE__ */ t(
|
|
57
|
-
|
|
54
|
+
h,
|
|
58
55
|
{
|
|
59
|
-
items: [{ label:
|
|
60
|
-
triggerLabel:
|
|
56
|
+
items: [{ label: n("editCTA"), icon: /* @__PURE__ */ t(y, { "aria-hidden": !0 }), onClick: r }],
|
|
57
|
+
triggerLabel: n("editCTA"),
|
|
61
58
|
isLoading: !1
|
|
62
59
|
}
|
|
63
60
|
),
|
|
64
|
-
emptyState: () => /* @__PURE__ */ t(
|
|
61
|
+
emptyState: () => /* @__PURE__ */ t(H, { handleAdd: o })
|
|
65
62
|
});
|
|
66
|
-
return /* @__PURE__ */
|
|
67
|
-
/* @__PURE__ */ t(
|
|
68
|
-
/* @__PURE__ */ t(x, { label:
|
|
63
|
+
return /* @__PURE__ */ c(f, { gap: 20, children: [
|
|
64
|
+
/* @__PURE__ */ t(D, { count: i, handleAdd: o }),
|
|
65
|
+
/* @__PURE__ */ t(x, { label: n("contractorListLabel"), ...l })
|
|
69
66
|
] });
|
|
70
67
|
}
|
|
71
|
-
function
|
|
72
|
-
companyId:
|
|
73
|
-
handleAdd:
|
|
68
|
+
function W({
|
|
69
|
+
companyId: e,
|
|
70
|
+
handleAdd: o,
|
|
74
71
|
handleEdit: r
|
|
75
72
|
}) {
|
|
76
|
-
const i =
|
|
77
|
-
return /* @__PURE__ */ t(
|
|
73
|
+
const i = d({ companyUuid: e, handleAdd: o });
|
|
74
|
+
return /* @__PURE__ */ t(j, { handleEdit: r, ...i });
|
|
78
75
|
}
|
|
79
76
|
export {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
77
|
+
j as ContractorList,
|
|
78
|
+
W as ContractorListWithApi,
|
|
79
|
+
H as EmptyDataContractorsList,
|
|
80
|
+
D as Head
|
|
84
81
|
};
|
|
85
82
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/Contractor/List/index.tsx"],"sourcesContent":["import { type Contractor } from '@gusto/embedded-api/models/components/contractor'\nimport { useTranslation } from 'react-i18next'\nimport { useContractors } from './useContractorList'\nimport { DataView, EmptyData, Flex, useDataView } from '@/components/Common'\nimport { firstLastName } from '@/helpers/formattedStrings'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu/HamburgerMenu'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { ContractorOnboardingStatusBadge } from '@/components/Common/OnboardingStatusBadge'\nimport { useI18n } from '@/i18n'\n\nexport type ContractorListDisplay = Pick<\n Contractor,\n 'onboardingStatus' | 'firstName' | 'lastName' | 'onboarded'\n>\n\nexport interface HeadProps {\n count: number\n handleAdd: () => void\n}\nexport function Head({ count, handleAdd }: HeadProps) {\n const {
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/Contractor/List/index.tsx"],"sourcesContent":["import { type Contractor } from '@gusto/embedded-api/models/components/contractor'\nimport { useTranslation } from 'react-i18next'\nimport { useContractors } from './useContractorList'\nimport { ActionsLayout, DataView, EmptyData, Flex, Grid, useDataView } from '@/components/Common'\nimport { firstLastName } from '@/helpers/formattedStrings'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu/HamburgerMenu'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { ContractorOnboardingStatusBadge } from '@/components/Common/OnboardingStatusBadge'\nimport { useI18n } from '@/i18n'\n\nexport type ContractorListDisplay = Pick<\n Contractor,\n 'onboardingStatus' | 'firstName' | 'lastName' | 'onboarded'\n>\n\nexport interface HeadProps {\n count: number\n handleAdd: () => void\n}\nexport function Head({ count, handleAdd }: HeadProps) {\n const { Button, Heading } = useComponentContext()\n const { t } = useTranslation('Contractor.ContractorList')\n\n return (\n <Flex alignItems=\"center\" justifyContent=\"space-between\">\n <Heading as=\"h2\">{t('title')}</Heading>\n\n {count !== 0 && (\n <Button variant=\"secondary\" onClick={handleAdd}>\n {t('addAnotherCTA')}\n </Button>\n )}\n </Flex>\n )\n}\n\nexport interface EmptyDataContractorsListProps {\n handleAdd: () => void\n}\nexport function EmptyDataContractorsList({ handleAdd }: EmptyDataContractorsListProps) {\n const { Button } = useComponentContext()\n const { t } = useTranslation('Contractor.ContractorList')\n\n return (\n <EmptyData title={t('emptyTableTitle')} description={t('emptyTableDescription')}>\n <ActionsLayout justifyContent=\"center\">\n <Button onClick={handleAdd}>{t('addContractorCTA')}</Button>\n </ActionsLayout>\n </EmptyData>\n )\n}\n\nexport interface ContractorListProps {\n contractors: ContractorListDisplay[]\n handleAdd: () => void\n handleEdit: () => void\n totalCount: number\n}\n\nexport function ContractorList({\n contractors,\n handleAdd,\n handleEdit,\n totalCount,\n}: ContractorListProps) {\n useI18n('Contractor.ContractorList')\n const { t } = useTranslation('Contractor.ContractorList')\n\n const dataViewProps = useDataView<ContractorListDisplay>({\n columns: [\n {\n title: t('listHeaders.name'),\n render: contractor =>\n firstLastName({ first_name: contractor.firstName, last_name: contractor.lastName }),\n },\n {\n title: t('listHeaders.status'),\n render: ({ onboarded, onboardingStatus }) => (\n <ContractorOnboardingStatusBadge\n onboarded={onboarded}\n onboardingStatus={onboardingStatus}\n />\n ),\n },\n ],\n data: contractors,\n itemMenu: () => (\n <HamburgerMenu\n items={[{ label: t('editCTA'), icon: <PencilSvg aria-hidden />, onClick: handleEdit }]}\n triggerLabel={t('editCTA')}\n isLoading={false}\n />\n ),\n emptyState: () => <EmptyDataContractorsList handleAdd={handleAdd} />,\n })\n\n return (\n <Grid gap={20}>\n <Head count={totalCount} handleAdd={handleAdd} />\n <DataView label={t('contractorListLabel')} {...dataViewProps} />\n </Grid>\n )\n}\n\nexport interface ContractorListWithApiProps {\n companyId: string\n handleAdd: () => void\n handleEdit: () => void\n}\n\nexport function ContractorListWithApi({\n companyId,\n handleAdd,\n handleEdit,\n}: ContractorListWithApiProps) {\n const contractorProps = useContractors({ companyUuid: companyId, handleAdd })\n\n return <ContractorList handleEdit={handleEdit} {...contractorProps} />\n}\n"],"names":["Head","count","handleAdd","Button","Heading","useComponentContext","t","useTranslation","jsxs","Flex","jsx","EmptyDataContractorsList","EmptyData","ActionsLayout","ContractorList","contractors","handleEdit","totalCount","useI18n","dataViewProps","useDataView","contractor","firstLastName","onboarded","onboardingStatus","ContractorOnboardingStatusBadge","HamburgerMenu","PencilSvg","Grid","DataView","ContractorListWithApi","companyId","contractorProps","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E,OAAOf,EAAE,oBAAoB;AAAA,QAC7B,QAAQ,CAAC,EAAE,WAAAiB,GAAW,kBAAAC,EACpB,MAAA,gBAAAd;AAAA,UAACe;AAAA,UAAA;AAAA,YACC,WAAAF;AAAA,YACA,kBAAAC;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAGN;AAAA,IACA,MAAMT;AAAA,IACN,UAAU,MACR,gBAAAL;AAAA,MAACgB;AAAA,MAAA;AAAA,QACC,OAAO,CAAC,EAAE,OAAOpB,EAAE,SAAS,GAAG,MAAM,gBAAAI,EAACiB,KAAU,eAAW,GAAA,CAAC,GAAI,SAASX,GAAY;AAAA,QACrF,cAAcV,EAAE,SAAS;AAAA,QACzB,WAAW;AAAA,MAAA;AAAA,IACb;AAAA,IAEF,YAAY,MAAO,gBAAAI,EAAAC,GAAA,EAAyB,WAAAT,EAAsB,CAAA;AAAA,EAAA,CACnE;AAGC,SAAA,gBAAAM,EAACoB,GAAK,EAAA,KAAK,IACT,UAAA;AAAA,IAAC,gBAAAlB,EAAAV,GAAA,EAAK,OAAOiB,GAAY,WAAAf,EAAsB,CAAA;AAAA,sBAC9C2B,GAAS,EAAA,OAAOvB,EAAE,qBAAqB,GAAI,GAAGa,EAAe,CAAA;AAAA,EAAA,GAChE;AAEJ;AAQO,SAASW,EAAsB;AAAA,EACpC,WAAAC;AAAA,EACA,WAAA7B;AAAA,EACA,YAAAc;AACF,GAA+B;AAC7B,QAAMgB,IAAkBC,EAAe,EAAE,aAAaF,GAAW,WAAA7B,GAAW;AAE5E,SAAQ,gBAAAQ,EAAAI,GAAA,EAAe,YAAAE,GAAyB,GAAGgB,EAAiB,CAAA;AACtE;"}
|
|
@@ -17,7 +17,7 @@ const e = "Company addresses", s = "To automate your payroll filings, we need to
|
|
|
17
17
|
emptyTableTitle: r,
|
|
18
18
|
emptyTableDescription: c,
|
|
19
19
|
addLocationCta: p,
|
|
20
|
-
|
|
20
|
+
addFirstLocationCta: m,
|
|
21
21
|
locationFormTitle: y,
|
|
22
22
|
locationFormDescription: L,
|
|
23
23
|
street1Label: h,
|
|
@@ -38,7 +38,7 @@ const e = "Company addresses", s = "To automate your payroll filings, we need to
|
|
|
38
38
|
validations: z
|
|
39
39
|
};
|
|
40
40
|
export {
|
|
41
|
-
m as
|
|
41
|
+
m as addFirstLocationCta,
|
|
42
42
|
p as addLocationCta,
|
|
43
43
|
T as addressTypeLabel,
|
|
44
44
|
S as cancelCta,
|
package/dist/types/i18next.d.ts
CHANGED
|
@@ -192,7 +192,7 @@ export interface CompanyLocations{
|
|
|
192
192
|
"emptyTableTitle":string;
|
|
193
193
|
"emptyTableDescription":string;
|
|
194
194
|
"addLocationCta":string;
|
|
195
|
-
"
|
|
195
|
+
"addFirstLocationCta":string;
|
|
196
196
|
"locationFormTitle":string;
|
|
197
197
|
"locationFormDescription":string;
|
|
198
198
|
"street1Label":string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gusto/embedded-react-sdk",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.3-rc.1",
|
|
4
4
|
"homepage": "https://github.com/Gusto/embedded-react-sdk",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/Gusto/embedded-react-sdk/issues"
|
|
@@ -39,7 +39,10 @@
|
|
|
39
39
|
"dev": "node ./build/prompt.js && npm run i18n:generate && npm-run-all --parallel watch:vite watch:translations ladle",
|
|
40
40
|
"dev:setup": "npm link ../gws-flows/node_modules/react && (cd ../gws-flows && yarn link -r ../embedded-react-sdk)",
|
|
41
41
|
"docs": "npx tsx ./build/eventTypeDocsEmitter.ts",
|
|
42
|
+
"docs:frontmatter": "npx tsx .docs/src/frontmatter/frontmatterSync.ts",
|
|
42
43
|
"docs:lockfile": "npx tsx .docs/src/lockfile/lockfileGenerator.ts",
|
|
44
|
+
"docs:prepare-publish": "npx tsx .docs/src/publishing/preparePublishDocs.ts",
|
|
45
|
+
"docs:clean-publish": "rm -rf .docs/temp-publish-docs",
|
|
43
46
|
"format": "prettier . --write --log-level error",
|
|
44
47
|
"format:check": "prettier . --check --log-level error",
|
|
45
48
|
"ladle": "ladle serve",
|