@gusto/embedded-react-sdk 0.11.2 → 0.11.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.
Files changed (153) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/components/Common/DataView/DataCards/DataCards.module.scss.js +1 -1
  3. package/dist/components/Common/DocumentList/DocumentList.module.scss.js +1 -1
  4. package/dist/components/Common/DocumentViewer/DocumentViewer.module.scss.js +1 -1
  5. package/dist/components/Common/EmptyData/EmptyData.module.scss.js +1 -1
  6. package/dist/components/Common/FieldErrorMessage/FieldErrorMessage.module.scss.js +1 -1
  7. package/dist/components/Common/FieldLayout/FieldLayout.module.scss.js +6 -6
  8. package/dist/components/Common/Flex/Flex.d.ts +2 -2
  9. package/dist/components/Common/Flex/Flex.js +5 -5
  10. package/dist/components/Common/Flex/Flex.js.map +1 -1
  11. package/dist/components/Common/Form/Form.module.scss.js +2 -2
  12. package/dist/components/Common/Grid/Grid.d.ts +2 -2
  13. package/dist/components/Common/Grid/Grid.js +13 -13
  14. package/dist/components/Common/Grid/Grid.js.map +1 -1
  15. package/dist/components/Common/HorizontalFieldLayout/HorizontalFieldLayout.module.scss.js +12 -12
  16. package/dist/components/Common/InternalError/InternalError.module.scss.js +1 -1
  17. package/dist/components/Common/Loading/Loading.module.scss.js +1 -1
  18. package/dist/components/Common/PaginationControl/PaginationControl.module.scss.js +1 -1
  19. package/dist/components/Common/ReorderableList/ReorderableList.module.scss.js +15 -15
  20. package/dist/components/Common/RequirementsList/RequirementsList.module.scss.js +1 -1
  21. package/dist/components/Common/SignatureForm/SignatureForm.module.scss.js +6 -6
  22. package/dist/components/Common/UI/Alert/Alert.module.scss.js +1 -1
  23. package/dist/components/Common/UI/Badge/Badge.module.scss.js +1 -1
  24. package/dist/components/Common/UI/Button/Button.module.scss.js +1 -1
  25. package/dist/components/Common/UI/Button/ButtonIcon.module.scss.js +1 -1
  26. package/dist/components/Common/UI/CalendarPreview/CalendarPreview.module.scss.js +5 -5
  27. package/dist/components/Common/UI/Card/Card.module.scss.js +1 -1
  28. package/dist/components/Common/UI/Checkbox/Checkbox.module.scss.js +8 -8
  29. package/dist/components/Common/UI/CheckboxGroup/CheckboxGroup.module.scss.js +1 -1
  30. package/dist/components/Common/UI/ComboBox/ComboBox.module.scss.js +1 -1
  31. package/dist/components/Common/UI/DatePicker/DatePicker.module.scss.js +5 -5
  32. package/dist/components/Common/UI/Input/Input.module.scss.js +7 -7
  33. package/dist/components/Common/UI/Link/Link.module.scss.js +1 -1
  34. package/dist/components/Common/UI/List/List.module.scss.js +1 -1
  35. package/dist/components/Common/UI/Menu/Menu.module.scss.js +5 -5
  36. package/dist/components/Common/UI/NumberInput/NumberInput.js +36 -38
  37. package/dist/components/Common/UI/NumberInput/NumberInput.js.map +1 -1
  38. package/dist/components/Common/UI/ProgressBar/ProgressBar.module.scss.js +1 -1
  39. package/dist/components/Common/UI/Radio/Radio.module.scss.js +1 -1
  40. package/dist/components/Common/UI/RadioGroup/RadioGroup.module.scss.js +1 -1
  41. package/dist/components/Common/UI/Select/Select.module.scss.js +1 -1
  42. package/dist/components/Common/UI/Switch/Switch.module.scss.js +4 -4
  43. package/dist/components/Common/UI/Table/Table.module.scss.js +1 -1
  44. package/dist/components/Common/UI/Text/Text.module.scss.js +14 -14
  45. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +4 -3
  46. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  47. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +4 -3
  48. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  49. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +6 -5
  50. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  51. package/dist/components/Company/BankAccount/BankAccountForm/context.js +4 -3
  52. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  53. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +4 -3
  54. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  55. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +4 -3
  56. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  57. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +6 -5
  58. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  59. package/dist/components/Company/Industry/Context.js +7 -6
  60. package/dist/components/Company/Industry/Context.js.map +1 -1
  61. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +4 -3
  62. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  63. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +4 -3
  64. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  65. package/dist/components/Company/OnboardingOverview/context.js +4 -3
  66. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  67. package/dist/components/Company/PaySchedule/_parts/Edit.module.scss.js +1 -1
  68. package/dist/components/Company/PaySchedule/usePaySchedule.js +6 -5
  69. package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
  70. package/dist/components/Company/StateTaxes/StateTaxesForm/Form.js +8 -8
  71. package/dist/components/Company/StateTaxes/StateTaxesForm/Form.js.map +1 -1
  72. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +4 -3
  73. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  74. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +4 -3
  75. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  76. package/dist/components/Contractor/Address/useAddress.js +6 -5
  77. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  78. package/dist/components/Contractor/Profile/useContractorProfile.js +3 -2
  79. package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
  80. package/dist/components/Contractor/Submit/index.module.scss.js +2 -2
  81. package/dist/components/Employee/Deductions/Deductions.d.ts +8 -14
  82. package/dist/components/Employee/Deductions/Deductions.js +47 -140
  83. package/dist/components/Employee/Deductions/Deductions.js.map +1 -1
  84. package/dist/components/Employee/Deductions/DeductionsComponents.d.ts +23 -0
  85. package/dist/components/Employee/Deductions/DeductionsComponents.js +31 -0
  86. package/dist/components/Employee/Deductions/DeductionsComponents.js.map +1 -0
  87. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.d.ts +41 -0
  88. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js +135 -0
  89. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js.map +1 -0
  90. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.d.ts +6 -0
  91. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +99 -0
  92. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -0
  93. package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.d.ts +15 -0
  94. package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.js +49 -0
  95. package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.js.map +1 -0
  96. package/dist/components/Employee/Deductions/stateMachine.d.ts +7 -0
  97. package/dist/components/Employee/Deductions/stateMachine.js +107 -0
  98. package/dist/components/Employee/Deductions/stateMachine.js.map +1 -0
  99. package/dist/components/Employee/Deductions/useDeductions.d.ts +2 -2
  100. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +4 -3
  101. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  102. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +4 -3
  103. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  104. package/dist/components/Employee/EmployeeList/useEmployeeList.js +4 -3
  105. package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
  106. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.module.scss.js +6 -6
  107. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +6 -5
  108. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  109. package/dist/components/Employee/Profile/useProfile.js +4 -3
  110. package/dist/components/Employee/Profile/useProfile.js.map +1 -1
  111. package/dist/components/Employee/Taxes/useTaxes.js +4 -3
  112. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  113. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.d.ts +3 -3
  114. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  115. package/dist/contexts/ThemeProvider/ThemeProvider.d.ts +1 -5
  116. package/dist/contexts/ThemeProvider/ThemeProvider.js +18 -60
  117. package/dist/contexts/ThemeProvider/ThemeProvider.js.map +1 -1
  118. package/dist/contexts/ThemeProvider/theme.d.ts +42 -11
  119. package/dist/contexts/ThemeProvider/theme.js +31 -15
  120. package/dist/contexts/ThemeProvider/theme.js.map +1 -1
  121. package/dist/helpers/responsive.d.ts +0 -3
  122. package/dist/helpers/responsive.js +20 -34
  123. package/dist/helpers/responsive.js.map +1 -1
  124. package/dist/i18n/en/Employee.Deductions.json.js +49 -51
  125. package/dist/i18n/en/Employee.Deductions.json.js.map +1 -1
  126. package/dist/shared/constants.d.ts +8 -0
  127. package/dist/shared/constants.js +9 -5
  128. package/dist/shared/constants.js.map +1 -1
  129. package/dist/style.css +1 -1
  130. package/dist/types/i18next.d.ts +0 -1
  131. package/package.json +1 -1
  132. package/dist/components/Common/UI/NumberInput/NumberInput.module.scss.js +0 -8
  133. package/dist/components/Common/UI/NumberInput/NumberInput.module.scss.js.map +0 -1
  134. package/dist/components/Employee/Deductions/Actions.js +0 -27
  135. package/dist/components/Employee/Deductions/Actions.js.map +0 -1
  136. package/dist/components/Employee/Deductions/DeductionForm.d.ts +0 -1
  137. package/dist/components/Employee/Deductions/DeductionForm.js +0 -78
  138. package/dist/components/Employee/Deductions/DeductionForm.js.map +0 -1
  139. package/dist/components/Employee/Deductions/DeductionsList.d.ts +0 -2
  140. package/dist/components/Employee/Deductions/DeductionsList.js +0 -60
  141. package/dist/components/Employee/Deductions/DeductionsList.js.map +0 -1
  142. package/dist/components/Employee/Deductions/Head.js +0 -13
  143. package/dist/components/Employee/Deductions/Head.js.map +0 -1
  144. package/dist/components/Employee/Deductions/IncludeDeductionsForm.d.ts +0 -1
  145. package/dist/components/Employee/Deductions/IncludeDeductionsForm.js +0 -27
  146. package/dist/components/Employee/Deductions/IncludeDeductionsForm.js.map +0 -1
  147. package/dist/components/Employee/Deductions/useDeductions.js +0 -33
  148. package/dist/components/Employee/Deductions/useDeductions.js.map +0 -1
  149. package/dist/contexts/ThemeProvider/createTheme.d.ts +0 -21
  150. package/dist/contexts/ThemeProvider/createTheme.js +0 -269
  151. package/dist/contexts/ThemeProvider/createTheme.js.map +0 -1
  152. package/dist/types/GTheme.d.ts +0 -254
  153. /package/dist/contexts/ThemeProvider/{createTheme.test.d.ts → theme.test.d.ts} +0 -0
@@ -591,7 +591,6 @@ export interface EmployeeDeductions{
591
591
  "continueCta":string;
592
592
  "addDeductionTitle":string;
593
593
  "editDeductionTitle":string;
594
- "addDeuctionDescription":string;
595
594
  "descriptionLabel":string;
596
595
  "frequencyLabel":string;
597
596
  "frequencyRecurringOption":string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gusto/embedded-react-sdk",
3
- "version": "0.11.2",
3
+ "version": "0.11.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"
@@ -1,8 +0,0 @@
1
- const o = "_root_5yyd4_1", t = {
2
- root: o
3
- };
4
- export {
5
- t as default,
6
- o as root
7
- };
8
- //# sourceMappingURL=NumberInput.module.scss.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NumberInput.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
@@ -1,27 +0,0 @@
1
- import { jsxs as a, jsx as i } from "react/jsx-runtime";
2
- import { useTranslation as d } from "react-i18next";
3
- import { useDeductions as m } from "./useDeductions.js";
4
- import "classnames";
5
- import "../../../shared/constants.js";
6
- import { ActionsLayout as u } from "../../Common/ActionsLayout/ActionsLayout.js";
7
- import { useComponentContext as l } from "../../../contexts/ComponentAdapter/useComponentContext.js";
8
- const T = () => {
9
- const { mode: o, handleAdd: e, handleCancel: r, handlePassthrough: s, isPending: c } = m(), { t: n } = d("Employee.Deductions"), t = l();
10
- return /* @__PURE__ */ a(u, { children: [
11
- (o === "ADD" || o === "EDIT") && /* @__PURE__ */ i(t.Button, { variant: "secondary", onClick: r, children: n("cancelCta") }),
12
- o === "LIST" && /* @__PURE__ */ i(t.Button, { variant: "secondary", onClick: e, children: n("addDeductionCta") }),
13
- /* @__PURE__ */ i(
14
- t.Button,
15
- {
16
- type: o === "LIST" ? "button" : "submit",
17
- isLoading: c,
18
- onClick: o === "LIST" ? s : void 0,
19
- children: n("continueCta")
20
- }
21
- )
22
- ] });
23
- };
24
- export {
25
- T as Actions
26
- };
27
- //# sourceMappingURL=Actions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Actions.js","sources":["../../../../src/components/Employee/Deductions/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useDeductions } from './useDeductions'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { mode, handleAdd, handleCancel, handlePassthrough, isPending } = useDeductions()\n const { t } = useTranslation('Employee.Deductions')\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n {(mode === 'ADD' || mode === 'EDIT') && (\n <Components.Button variant=\"secondary\" onClick={handleCancel}>\n {t('cancelCta')}\n </Components.Button>\n )}\n {mode === 'LIST' && (\n <Components.Button variant=\"secondary\" onClick={handleAdd}>\n {t('addDeductionCta')}\n </Components.Button>\n )}\n <Components.Button\n type={mode === 'LIST' ? 'button' : 'submit'}\n isLoading={isPending}\n onClick={mode === 'LIST' ? handlePassthrough : undefined}\n >\n {t('continueCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","mode","handleAdd","handleCancel","handlePassthrough","isPending","useDeductions","t","useTranslation","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;;;AAKO,MAAMA,IAAU,MAAM;AAC3B,QAAM,EAAE,MAAAC,GAAM,WAAAC,GAAW,cAAAC,GAAc,mBAAAC,GAAmB,WAAAC,EAAA,IAAcC,EAAA,GAClE,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5CC,IAAaC,EAAA;AAEnB,2BACGC,GAAA,EACG,UAAA;AAAA,KAAAV,MAAS,SAASA,MAAS,WAC3B,gBAAAW,EAACH,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASN,GAC7C,UAAAI,EAAE,WAAW,GAChB;AAAA,IAEDN,MAAS,UACR,gBAAAW,EAACH,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASP,GAC7C,UAAAK,EAAE,iBAAiB,EAAA,CACtB;AAAA,IAEF,gBAAAK;AAAA,MAACH,EAAW;AAAA,MAAX;AAAA,QACC,MAAMR,MAAS,SAAS,WAAW;AAAA,QACnC,WAAWI;AAAA,QACX,SAASJ,MAAS,SAASG,IAAoB;AAAA,QAE9C,YAAE,aAAa;AAAA,MAAA;AAAA,IAAA;AAAA,EAClB,GACF;AAEJ;"}
@@ -1 +0,0 @@
1
- export declare const DeductionForm: () => import("react/jsx-runtime").JSX.Element | undefined;
@@ -1,78 +0,0 @@
1
- import { jsxs as m, Fragment as l, jsx as t } from "react/jsx-runtime";
2
- import { useFormContext as s, useWatch as i } from "react-hook-form";
3
- import { useTranslation as p } from "react-i18next";
4
- import { useDeductions as b } from "./useDeductions.js";
5
- import "classnames";
6
- import "../../../shared/constants.js";
7
- import { RadioGroupField as a } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
8
- import { TextInputField as f } from "../../Common/Fields/TextInputField/TextInputField.js";
9
- import { NumberInputField as u } from "../../Common/Fields/NumberInputField/NumberInputField.js";
10
- import { useI18n as D } from "../../../i18n/I18n.js";
11
- import { useComponentContext as g } from "../../../contexts/ComponentAdapter/useComponentContext.js";
12
- import { CheckboxField as x } from "../../Common/Fields/CheckboxField/CheckboxField.js";
13
- const E = () => {
14
- const { mode: n } = b(), { control: r } = s();
15
- D("Employee.Deductions");
16
- const { t: e } = p("Employee.Deductions"), o = g(), c = i({ control: r, name: "recurring" }), d = i({ control: r, name: "deductAsPercentage" });
17
- if (!(n !== "ADD" && n !== "EDIT"))
18
- return /* @__PURE__ */ m(l, { children: [
19
- /* @__PURE__ */ t(o.Heading, { as: "h2", children: e(n === "EDIT" ? "editDeductionTitle" : "addDeductionTitle") }),
20
- /* @__PURE__ */ t(o.Text, { children: e("addDeuctionDescription") }),
21
- /* @__PURE__ */ t(
22
- f,
23
- {
24
- name: "description",
25
- label: e("descriptionLabel"),
26
- isRequired: !0,
27
- errorMessage: e("validations.description")
28
- }
29
- ),
30
- /* @__PURE__ */ t(
31
- a,
32
- {
33
- name: "recurring",
34
- label: e("frequencyLabel"),
35
- options: [
36
- { value: "true", label: e("frequencyRecurringOption") },
37
- { value: "false", label: e("frequencyOneTimeOption") }
38
- ]
39
- }
40
- ),
41
- /* @__PURE__ */ t(
42
- a,
43
- {
44
- name: "deductAsPercentage",
45
- label: e("deductionTypeLabel"),
46
- options: [
47
- { value: "true", label: e("deductionTypePercentageOption") },
48
- { value: "false", label: e("deductionTypeFixedAmountOption") }
49
- ]
50
- }
51
- ),
52
- /* @__PURE__ */ t("div", { className: "deduction-amount-section", children: /* @__PURE__ */ t(
53
- u,
54
- {
55
- name: "amount",
56
- isRequired: !0,
57
- label: e("deductionAmountLabel"),
58
- format: d === "true" ? "percent" : "currency",
59
- min: 0,
60
- errorMessage: e("validations.amount")
61
- }
62
- ) }),
63
- c === "true" && /* @__PURE__ */ t(
64
- u,
65
- {
66
- name: "annualMaximum",
67
- label: e("annualMaxLabel"),
68
- format: "currency",
69
- min: 0
70
- }
71
- ),
72
- /* @__PURE__ */ t(x, { name: "courtOrdered", label: e("courtOrderedLabel") })
73
- ] });
74
- };
75
- export {
76
- E as DeductionForm
77
- };
78
- //# sourceMappingURL=DeductionForm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DeductionForm.js","sources":["../../../../src/components/Employee/Deductions/DeductionForm.tsx"],"sourcesContent":["import { useFormContext, useWatch } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport { useDeductions, type DeductionInputs } from './useDeductions'\nimport {\n CheckboxField,\n NumberInputField,\n RadioGroupField,\n TextInputField,\n} from '@/components/Common'\nimport { useI18n } from '@/i18n'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const DeductionForm = () => {\n const { mode } = useDeductions()\n const { control } = useFormContext<DeductionInputs>()\n useI18n('Employee.Deductions')\n const { t } = useTranslation('Employee.Deductions')\n const Components = useComponentContext()\n\n const watchedRecurring = useWatch({ control, name: 'recurring' })\n const watchedDeductAsPercentage = useWatch({ control, name: 'deductAsPercentage' })\n\n if (mode !== 'ADD' && mode !== 'EDIT') return\n\n return (\n <>\n <Components.Heading as=\"h2\">\n {mode === 'EDIT' ? t('editDeductionTitle') : t('addDeductionTitle')}\n </Components.Heading>\n <Components.Text>{t('addDeuctionDescription')}</Components.Text>\n <TextInputField\n name=\"description\"\n label={t('descriptionLabel')}\n isRequired\n errorMessage={t('validations.description')}\n />\n <RadioGroupField\n name=\"recurring\"\n label={t('frequencyLabel')}\n options={[\n { value: 'true', label: t('frequencyRecurringOption') },\n { value: 'false', label: t('frequencyOneTimeOption') },\n ]}\n />\n <RadioGroupField\n name=\"deductAsPercentage\"\n label={t('deductionTypeLabel')}\n options={[\n { value: 'true', label: t('deductionTypePercentageOption') },\n { value: 'false', label: t('deductionTypeFixedAmountOption') },\n ]}\n />\n <div className=\"deduction-amount-section\">\n <NumberInputField\n name=\"amount\"\n isRequired\n label={t('deductionAmountLabel')}\n format={watchedDeductAsPercentage === 'true' ? 'percent' : 'currency'}\n min={0}\n errorMessage={t('validations.amount')}\n />\n </div>\n {watchedRecurring === 'true' && (\n <NumberInputField\n name=\"annualMaximum\"\n label={t('annualMaxLabel')}\n format=\"currency\"\n min={0}\n />\n )}\n <CheckboxField name=\"courtOrdered\" label={t('courtOrderedLabel')} />\n </>\n )\n}\n"],"names":["DeductionForm","mode","useDeductions","control","useFormContext","useI18n","t","useTranslation","Components","useComponentContext","watchedRecurring","useWatch","watchedDeductAsPercentage","jsxs","Fragment","jsx","TextInputField","RadioGroupField","NumberInputField","CheckboxField"],"mappings":";;;;;;;;;;;;AAYO,MAAMA,IAAgB,MAAM;AACjC,QAAM,EAAE,MAAAC,EAAA,IAASC,EAAA,GACX,EAAE,SAAAC,EAAA,IAAYC,EAAA;AACpB,EAAAC,EAAQ,qBAAqB;AAC7B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5CC,IAAaC,EAAA,GAEbC,IAAmBC,EAAS,EAAE,SAAAR,GAAS,MAAM,aAAa,GAC1DS,IAA4BD,EAAS,EAAE,SAAAR,GAAS,MAAM,sBAAsB;AAElF,MAAI,EAAAF,MAAS,SAASA,MAAS;AAE/B,WACE,gBAAAY,EAAAC,GAAA,EACE,UAAA;AAAA,MAAA,gBAAAC,EAACP,EAAW,SAAX,EAAmB,IAAG,MACpB,UAAkBF,EAAlBL,MAAS,SAAW,uBAA0B,mBAAN,EAAyB,CACpE;AAAA,wBACCO,EAAW,MAAX,EAAiB,UAAAF,EAAE,wBAAwB,GAAE;AAAA,MAC9C,gBAAAS;AAAA,QAACC;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,OAAOV,EAAE,kBAAkB;AAAA,UAC3B,YAAU;AAAA,UACV,cAAcA,EAAE,yBAAyB;AAAA,QAAA;AAAA,MAAA;AAAA,MAE3C,gBAAAS;AAAA,QAACE;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,OAAOX,EAAE,gBAAgB;AAAA,UACzB,SAAS;AAAA,YACP,EAAE,OAAO,QAAQ,OAAOA,EAAE,0BAA0B,EAAA;AAAA,YACpD,EAAE,OAAO,SAAS,OAAOA,EAAE,wBAAwB,EAAA;AAAA,UAAE;AAAA,QACvD;AAAA,MAAA;AAAA,MAEF,gBAAAS;AAAA,QAACE;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,OAAOX,EAAE,oBAAoB;AAAA,UAC7B,SAAS;AAAA,YACP,EAAE,OAAO,QAAQ,OAAOA,EAAE,+BAA+B,EAAA;AAAA,YACzD,EAAE,OAAO,SAAS,OAAOA,EAAE,gCAAgC,EAAA;AAAA,UAAE;AAAA,QAC/D;AAAA,MAAA;AAAA,MAEF,gBAAAS,EAAC,OAAA,EAAI,WAAU,4BACb,UAAA,gBAAAA;AAAA,QAACG;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,YAAU;AAAA,UACV,OAAOZ,EAAE,sBAAsB;AAAA,UAC/B,QAAQM,MAA8B,SAAS,YAAY;AAAA,UAC3D,KAAK;AAAA,UACL,cAAcN,EAAE,oBAAoB;AAAA,QAAA;AAAA,MAAA,GAExC;AAAA,MACCI,MAAqB,UACpB,gBAAAK;AAAA,QAACG;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,OAAOZ,EAAE,gBAAgB;AAAA,UACzB,QAAO;AAAA,UACP,KAAK;AAAA,QAAA;AAAA,MAAA;AAAA,wBAGRa,GAAA,EAAc,MAAK,gBAAe,OAAOb,EAAE,mBAAmB,EAAA,CAAG;AAAA,IAAA,GACpE;AAEJ;"}
@@ -1,2 +0,0 @@
1
- import { default as React } from 'react';
2
- export declare const DeductionsList: React.FC;
@@ -1,60 +0,0 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import { useTranslation as f } from "react-i18next";
3
- import { useDeductions as g } from "./useDeductions.js";
4
- import "classnames";
5
- import "../../../shared/constants.js";
6
- import o from "../../Common/hooks/useNumberFormatter.js";
7
- import b from "../../../assets/icons/pencil.svg.js";
8
- import C from "../../../assets/icons/trashcan.svg.js";
9
- import { HamburgerMenu as h } from "../../Common/HamburgerMenu/HamburgerMenu.js";
10
- import { useDataView as y } from "../../Common/DataView/useDataView.js";
11
- import { DataView as D } from "../../Common/DataView/DataView.js";
12
- const E = () => {
13
- const { mode: i, deductions: m, handleDelete: a, handleEdit: u, isPending: c } = g(), { t: r } = f("Employee.Deductions"), s = o("currency"), l = o("percent"), d = m.filter((e) => e.active), { ...p } = y({
14
- data: d,
15
- columns: [
16
- { key: "description", title: r("nameColumn") },
17
- {
18
- key: "recurring",
19
- title: r("frequencyColumn"),
20
- render: (e) => e.recurring ? r("recurringText") : r("nonRecurringText")
21
- },
22
- {
23
- key: "amount",
24
- title: r("withheldColumn"),
25
- render: (e) => {
26
- const n = e.deductAsPercentage ? l(Number(e.amount)) : s(Number(e.amount));
27
- return e.recurring ? r("recurringAmount", { value: n }) : n;
28
- }
29
- }
30
- ],
31
- itemMenu: (e) => /* @__PURE__ */ t(
32
- h,
33
- {
34
- isLoading: c,
35
- items: [
36
- {
37
- label: r("editCta"),
38
- onClick: () => {
39
- u(e);
40
- },
41
- icon: /* @__PURE__ */ t(b, { "aria-hidden": !0 })
42
- },
43
- {
44
- label: r("deleteCta"),
45
- onClick: () => {
46
- a(e);
47
- },
48
- icon: /* @__PURE__ */ t(C, { "aria-hidden": !0 })
49
- }
50
- ]
51
- }
52
- )
53
- });
54
- if (i === "LIST")
55
- return /* @__PURE__ */ t(D, { label: r("deductionsTableLabel"), ...p });
56
- };
57
- export {
58
- E as DeductionsList
59
- };
60
- //# sourceMappingURL=DeductionsList.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DeductionsList.js","sources":["../../../../src/components/Employee/Deductions/DeductionsList.tsx"],"sourcesContent":["import type React from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { useDeductions } from './useDeductions'\nimport { useDataView, DataView } from '@/components/Common'\nimport useNumberFormatter from '@/components/Common/hooks/useNumberFormatter'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport TrashCanSvg from '@/assets/icons/trashcan.svg?react'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\n\nexport const DeductionsList: React.FC = () => {\n const { mode, deductions, handleDelete, handleEdit, isPending } = useDeductions()\n const { t } = useTranslation('Employee.Deductions')\n const formatCurrency = useNumberFormatter('currency')\n const formatPercent = useNumberFormatter('percent')\n\n const activeDeductions = deductions.filter(deduction => deduction.active)\n\n const { ...dataViewProps } = useDataView({\n data: activeDeductions,\n columns: [\n { key: 'description', title: t('nameColumn') },\n {\n key: 'recurring',\n title: t('frequencyColumn'),\n render: deduction => {\n return deduction.recurring ? t('recurringText') : t('nonRecurringText')\n },\n },\n {\n key: 'amount',\n title: t('withheldColumn'),\n render: deduction => {\n const formattedAmount = deduction.deductAsPercentage\n ? formatPercent(Number(deduction.amount))\n : formatCurrency(Number(deduction.amount))\n return deduction.recurring\n ? t('recurringAmount', { value: formattedAmount })\n : formattedAmount\n },\n },\n ],\n itemMenu: deduction => {\n return (\n <HamburgerMenu\n isLoading={isPending}\n items={[\n {\n label: t('editCta'),\n onClick: () => {\n handleEdit(deduction)\n },\n icon: <PencilSvg aria-hidden />,\n },\n {\n label: t('deleteCta'),\n onClick: () => {\n handleDelete(deduction)\n },\n icon: <TrashCanSvg aria-hidden />,\n },\n ]}\n />\n )\n },\n })\n\n if (mode !== 'LIST') return\n return <DataView label={t('deductionsTableLabel')} {...dataViewProps} />\n}\n"],"names":["DeductionsList","mode","deductions","handleDelete","handleEdit","isPending","useDeductions","t","useTranslation","formatCurrency","useNumberFormatter","formatPercent","activeDeductions","deduction","dataViewProps","useDataView","formattedAmount","jsx","HamburgerMenu","PencilSvg","TrashCanSvg","DataView"],"mappings":";;;;;;;;;;;AASO,MAAMA,IAA2B,MAAM;AAC5C,QAAM,EAAE,MAAAC,GAAM,YAAAC,GAAY,cAAAC,GAAc,YAAAC,GAAY,WAAAC,EAAA,IAAcC,EAAA,GAC5D,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5CC,IAAiBC,EAAmB,UAAU,GAC9CC,IAAgBD,EAAmB,SAAS,GAE5CE,IAAmBV,EAAW,OAAO,CAAAW,MAAaA,EAAU,MAAM,GAElE,EAAE,GAAGC,EAAA,IAAkBC,EAAY;AAAA,IACvC,MAAMH;AAAA,IACN,SAAS;AAAA,MACP,EAAE,KAAK,eAAe,OAAOL,EAAE,YAAY,EAAA;AAAA,MAC3C;AAAA,QACE,KAAK;AAAA,QACL,OAAOA,EAAE,iBAAiB;AAAA,QAC1B,QAAQ,CAAAM,MACCA,EAAU,YAAYN,EAAE,eAAe,IAAIA,EAAE,kBAAkB;AAAA,MACxE;AAAA,MAEF;AAAA,QACE,KAAK;AAAA,QACL,OAAOA,EAAE,gBAAgB;AAAA,QACzB,QAAQ,CAAAM,MAAa;AACnB,gBAAMG,IAAkBH,EAAU,qBAC9BF,EAAc,OAAOE,EAAU,MAAM,CAAC,IACtCJ,EAAe,OAAOI,EAAU,MAAM,CAAC;AAC3C,iBAAOA,EAAU,YACbN,EAAE,mBAAmB,EAAE,OAAOS,EAAA,CAAiB,IAC/CA;AAAA,QACN;AAAA,MAAA;AAAA,IACF;AAAA,IAEF,UAAU,CAAAH,MAEN,gBAAAI;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,WAAWb;AAAA,QACX,OAAO;AAAA,UACL;AAAA,YACE,OAAOE,EAAE,SAAS;AAAA,YAClB,SAAS,MAAM;AACb,cAAAH,EAAWS,CAAS;AAAA,YACtB;AAAA,YACA,MAAM,gBAAAI,EAACE,GAAA,EAAU,eAAW,GAAA,CAAC;AAAA,UAAA;AAAA,UAE/B;AAAA,YACE,OAAOZ,EAAE,WAAW;AAAA,YACpB,SAAS,MAAM;AACb,cAAAJ,EAAaU,CAAS;AAAA,YACxB;AAAA,YACA,MAAM,gBAAAI,EAACG,GAAA,EAAY,eAAW,GAAA,CAAC;AAAA,UAAA;AAAA,QACjC;AAAA,MACF;AAAA,IAAA;AAAA,EAGN,CACD;AAED,MAAInB,MAAS;AACb,6BAAQoB,GAAA,EAAS,OAAOd,EAAE,sBAAsB,GAAI,GAAGO,GAAe;AACxE;"}
@@ -1,13 +0,0 @@
1
- import { jsx as e, Fragment as r } from "react/jsx-runtime";
2
- import { useTranslation as i } from "react-i18next";
3
- import { useDeductions as m } from "./useDeductions.js";
4
- import { useComponentContext as s } from "../../../contexts/ComponentAdapter/useComponentContext.js";
5
- function d() {
6
- const { t } = i("Employee.Deductions"), { mode: o } = m(), n = s();
7
- if (!(o !== "INITIAL" && o !== "LIST"))
8
- return /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e(n.Heading, { as: "h2", children: t("pageTitle") }) });
9
- }
10
- export {
11
- d as Head
12
- };
13
- //# sourceMappingURL=Head.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Head.js","sources":["../../../../src/components/Employee/Deductions/Head.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useDeductions } from './useDeductions'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Head() {\n const { t } = useTranslation('Employee.Deductions')\n const { mode } = useDeductions()\n const Components = useComponentContext()\n\n if (mode !== 'INITIAL' && mode !== 'LIST') return\n return (\n <>\n <Components.Heading as=\"h2\">{t('pageTitle')}</Components.Heading>\n </>\n )\n}\n"],"names":["Head","useTranslation","mode","useDeductions","Components","useComponentContext","jsx","Fragment"],"mappings":";;;;AAIO,SAASA,IAAO;AACrB,QAAM,EAAE,EAAA,IAAMC,EAAe,qBAAqB,GAC5C,EAAE,MAAAC,EAAA,IAASC,EAAA,GACXC,IAAaC,EAAA;AAEnB,MAAI,EAAAH,MAAS,aAAaA,MAAS;AACnC,WACE,gBAAAI,EAAAC,GAAA,EACE,UAAA,gBAAAD,EAACF,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAA,EAAE,WAAW,EAAA,CAAE,EAAA,CAC9C;AAEJ;"}
@@ -1 +0,0 @@
1
- export declare const IncludeDeductionsForm: () => import("react/jsx-runtime").JSX.Element | undefined;
@@ -1,27 +0,0 @@
1
- import { jsx as i } from "react/jsx-runtime";
2
- import { useTranslation as t } from "react-i18next";
3
- import { useDeductions as n } from "./useDeductions.js";
4
- import "classnames";
5
- import "../../../shared/constants.js";
6
- import { RadioGroupField as r } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
7
- const p = () => {
8
- const { mode: o } = n(), { t: e } = t("Employee.Deductions");
9
- if (o === "INITIAL")
10
- return /* @__PURE__ */ i(
11
- r,
12
- {
13
- name: "includeDeductions",
14
- isRequired: !0,
15
- label: e("includeDeductionsFormLabel"),
16
- description: e("includeDeductionsDescription"),
17
- options: [
18
- { value: "Yes", label: e("includeDeductionsYes") },
19
- { value: "No", label: e("includeDeductionsNo") }
20
- ]
21
- }
22
- );
23
- };
24
- export {
25
- p as IncludeDeductionsForm
26
- };
27
- //# sourceMappingURL=IncludeDeductionsForm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IncludeDeductionsForm.js","sources":["../../../../src/components/Employee/Deductions/IncludeDeductionsForm.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useDeductions } from './useDeductions'\nimport { RadioGroupField } from '@/components/Common'\n\nexport const IncludeDeductionsForm = () => {\n const { mode } = useDeductions()\n const { t } = useTranslation('Employee.Deductions')\n if (mode !== 'INITIAL') return\n return (\n <RadioGroupField\n name=\"includeDeductions\"\n isRequired\n label={t('includeDeductionsFormLabel')}\n description={t('includeDeductionsDescription')}\n options={[\n { value: 'Yes', label: t('includeDeductionsYes') },\n { value: 'No', label: t('includeDeductionsNo') },\n ]}\n />\n )\n}\n"],"names":["IncludeDeductionsForm","mode","useDeductions","t","useTranslation","jsx","RadioGroupField"],"mappings":";;;;;;AAIO,MAAMA,IAAwB,MAAM;AACzC,QAAM,EAAE,MAAAC,EAAA,IAASC,EAAA,GACX,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB;AAClD,MAAIH,MAAS;AACb,WACE,gBAAAI;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,YAAU;AAAA,QACV,OAAOH,EAAE,4BAA4B;AAAA,QACrC,aAAaA,EAAE,8BAA8B;AAAA,QAC7C,SAAS;AAAA,UACP,EAAE,OAAO,OAAO,OAAOA,EAAE,sBAAsB,EAAA;AAAA,UAC/C,EAAE,OAAO,MAAM,OAAOA,EAAE,qBAAqB,EAAA;AAAA,QAAE;AAAA,MACjD;AAAA,IAAA;AAGN;"}
@@ -1,33 +0,0 @@
1
- import { z as r } from "zod";
2
- import "react/jsx-runtime";
3
- import "react";
4
- import "react-error-boundary";
5
- import "react-i18next";
6
- import "@gusto/embedded-api/models/errors/apierror";
7
- import "@gusto/embedded-api/models/errors/sdkvalidationerror";
8
- import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
9
- import "@tanstack/react-query";
10
- import "../../Base/useBase.js";
11
- import "../../../shared/constants.js";
12
- import "classnames";
13
- import "dompurify";
14
- import "../../../contexts/ComponentAdapter/useComponentContext.js";
15
- import { createCompoundContext as o } from "../../Base/createCompoundContext.js";
16
- const D = r.object({
17
- active: r.boolean(),
18
- amount: r.number().min(0).transform(String),
19
- description: r.string().min(1),
20
- courtOrdered: r.boolean(),
21
- times: r.number().nullable(),
22
- //The number of times to apply the garnishment. Ignored if recurring is true.
23
- recurring: r.string().transform((t) => t === "true"),
24
- annualMaximum: r.number().min(0).transform((t) => t > 0 ? t.toString() : null).nullable(),
25
- payPeriodMaximum: r.number().min(0).transform((t) => t > 0 ? t.toString() : null).nullable(),
26
- deductAsPercentage: r.string().transform((t) => t === "true")
27
- }), [S, C] = o("DeductionsContext");
28
- export {
29
- D as DeductionSchema,
30
- C as DeductionsProvider,
31
- S as useDeductions
32
- };
33
- //# sourceMappingURL=useDeductions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useDeductions.js","sources":["../../../../src/components/Employee/Deductions/useDeductions.ts"],"sourcesContent":["import type { Garnishment } from '@gusto/embedded-api/models/components/garnishment'\nimport { z } from 'zod'\nimport { createCompoundContext } from '@/components/Base'\n\nexport type MODE = 'ADD' | 'LIST' | 'INITIAL' | 'EDIT'\n\nexport const DeductionSchema = z.object({\n active: z.boolean(),\n amount: z.number().min(0).transform(String),\n description: z.string().min(1),\n courtOrdered: z.boolean(),\n times: z.number().nullable(), //The number of times to apply the garnishment. Ignored if recurring is true.\n recurring: z.string().transform(val => val === 'true'),\n annualMaximum: z\n .number()\n .min(0)\n .transform(val => (val > 0 ? val.toString() : null))\n .nullable(),\n payPeriodMaximum: z\n .number()\n .min(0)\n .transform(val => (val > 0 ? val.toString() : null))\n .nullable(),\n deductAsPercentage: z.string().transform(val => val === 'true'),\n})\n\nexport type DeductionInputs = z.input<typeof DeductionSchema>\nexport type DeductionPayload = z.output<typeof DeductionSchema>\n\ntype DeductionsContextType = {\n isPending: boolean\n deductions: Garnishment[]\n employeeId: string\n mode: MODE\n handleAdd: () => void\n handleCancel: () => void\n handleEdit: (deduction: Garnishment) => void\n handleDelete: (deduction: Garnishment) => void\n handlePassthrough: () => void\n}\nconst [useDeductions, DeductionsProvider] =\n createCompoundContext<DeductionsContextType>('DeductionsContext')\nexport { useDeductions, DeductionsProvider }\n"],"names":["DeductionSchema","z","val","useDeductions","DeductionsProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;AAMO,MAAMA,IAAkBC,EAAE,OAAO;AAAA,EACtC,QAAQA,EAAE,QAAA;AAAA,EACV,QAAQA,EAAE,OAAA,EAAS,IAAI,CAAC,EAAE,UAAU,MAAM;AAAA,EAC1C,aAAaA,EAAE,SAAS,IAAI,CAAC;AAAA,EAC7B,cAAcA,EAAE,QAAA;AAAA,EAChB,OAAOA,EAAE,OAAA,EAAS,SAAA;AAAA;AAAA,EAClB,WAAWA,EAAE,OAAA,EAAS,UAAU,CAAAC,MAAOA,MAAQ,MAAM;AAAA,EACrD,eAAeD,EACZ,OAAA,EACA,IAAI,CAAC,EACL,UAAU,CAAAC,MAAQA,IAAM,IAAIA,EAAI,SAAA,IAAa,IAAK,EAClD,SAAA;AAAA,EACH,kBAAkBD,EACf,OAAA,EACA,IAAI,CAAC,EACL,UAAU,CAAAC,MAAQA,IAAM,IAAIA,EAAI,SAAA,IAAa,IAAK,EAClD,SAAA;AAAA,EACH,oBAAoBD,EAAE,OAAA,EAAS,UAAU,CAAAC,MAAOA,MAAQ,MAAM;AAChE,CAAC,GAgBK,CAACC,GAAeC,CAAkB,IACtCC,EAA6C,mBAAmB;"}
@@ -1,21 +0,0 @@
1
- import { GTheme, GThemeColors, GThemeSpacing, GThemeTypography } from '../../types/GTheme';
2
- import { DeepPartial } from '../../types/Helpers';
3
- export declare const createTheme: (overrides?: DeepPartial<GTheme>) => {
4
- link: import('../../types/GTheme').GThemeLink & DeepPartial<import('../../types/GTheme').GThemeLink>;
5
- focus: import('../../types/GTheme').GThemeFocus & DeepPartial<import('../../types/GTheme').GThemeFocus>;
6
- button: import('../../types/GTheme').GThemeButton & DeepPartial<import('../../types/GTheme').GThemeButton>;
7
- checkbox: import('../../types/GTheme').GThemeCheckbox & DeepPartial<import('../../types/GTheme').GThemeCheckbox>;
8
- radio: import('../../types/GTheme').GThemeRadio & DeepPartial<import('../../types/GTheme').GThemeRadio>;
9
- table: import('../../types/GTheme').GThemeTable & DeepPartial<import('../../types/GTheme').GThemeTable>;
10
- card: import('../../types/GTheme').GThemeCard & DeepPartial<import('../../types/GTheme').GThemeCard>;
11
- input: import('../../types/GTheme').GThemeInput & DeepPartial<import('../../types/GTheme').GThemeInput>;
12
- shadow: import('../../types/GTheme').GThemeShadow & DeepPartial<import('../../types/GTheme').GThemeShadow>;
13
- calendarPreview: import('../../types/GTheme').GThemeCalendarPreview & DeepPartial<import('../../types/GTheme').GThemeCalendarPreview>;
14
- badge: import('../../types/GTheme').GThemeBadge & DeepPartial<import('../../types/GTheme').GThemeBadge>;
15
- spacing: GThemeSpacing & DeepPartial<GThemeSpacing>;
16
- typography: GThemeTypography & DeepPartial<GThemeTypography>;
17
- colors: GThemeColors & DeepPartial<GThemeColors>;
18
- radius: string;
19
- rootFS: string;
20
- transitionDuration: string;
21
- };
@@ -1,269 +0,0 @@
1
- import t from "deepmerge";
2
- import { toRem as e, getRootFontSize as k } from "../../helpers/rem.js";
3
- const n = {
4
- gray: {
5
- 100: "#FFFFFF",
6
- 200: "#FBFAFA",
7
- 300: "#F4F4F3",
8
- 400: "#EAEAEA",
9
- 500: "#DCDCDC",
10
- 600: "#BABABC",
11
- 700: "#919197",
12
- 800: "#6C6C72",
13
- 900: "#525257",
14
- 1e3: "#1C1C1C"
15
- },
16
- error: {
17
- 100: "#FFF7F5",
18
- 500: "#D5351F",
19
- 800: "#B41D08"
20
- },
21
- warning: {
22
- 100: "#FFFAF2",
23
- 500: "#E9B550",
24
- 700: "#B88023",
25
- 800: "#B88023"
26
- },
27
- success: {
28
- 100: "#F3FAFB",
29
- 400: "#2BABAD",
30
- 500: "#0A8080",
31
- 800: "#005961"
32
- },
33
- orange: {
34
- 800: "#CA464A"
35
- }
36
- }, p = {
37
- 4: e(4),
38
- 8: e(8),
39
- 12: e(12),
40
- 16: e(16),
41
- 20: e(20),
42
- 24: e(24),
43
- 28: e(28),
44
- 32: e(32),
45
- 36: e(36),
46
- 40: e(40)
47
- }, u = "6px", l = "200ms", m = ({
48
- colors: r = n
49
- }) => ({
50
- font: "Geist",
51
- fontSize: {
52
- small: e(14),
53
- regular: e(16),
54
- medium: e(18)
55
- },
56
- fontWeight: {
57
- regular: 400,
58
- medium: 500,
59
- semibold: 600,
60
- bold: 700
61
- },
62
- textColor: r.gray[1e3],
63
- disabledTextColor: r.gray[600],
64
- datePickerErrorTextColor: r.gray[100],
65
- defaultLineHeight: "1.5rem",
66
- headings: {
67
- 1: e(32),
68
- 2: e(24),
69
- 3: e(20),
70
- 4: e(18),
71
- 5: e(16),
72
- 6: e(14)
73
- }
74
- }), T = ({
75
- colors: r = n,
76
- typography: a = m({ colors: r }),
77
- spacing: i = p,
78
- radius: g = u,
79
- transitionDuration: d = l
80
- }) => ({
81
- focus: {
82
- color: r.gray[1e3],
83
- borderWidth: "2px"
84
- },
85
- shadow: {
86
- 100: "0px 1px 2px 0px rgba(10, 13, 18, 0.05)",
87
- 200: "0px 4px 6px 0px rgba(28, 28, 28, 0.05), 0px 10px 15px 0px rgba(28, 28, 28, 0.10)"
88
- },
89
- badge: {
90
- fontSize: e(12),
91
- fontWeight: a.fontWeight.medium,
92
- borderWidth: "1px",
93
- borderRadius: e(16),
94
- paddingX: e(10),
95
- paddingY: e(2),
96
- success: {
97
- color: r.success[800],
98
- backgroundColor: r.success[100],
99
- borderColor: r.success[400]
100
- }
101
- },
102
- button: {
103
- fontSize: e(14),
104
- fontWeight: a.fontWeight.medium,
105
- borderWidth: "1px",
106
- borderRadius: g,
107
- textStyle: "none",
108
- paddingX: e(16),
109
- paddingY: e(8),
110
- primary: {
111
- color: r.gray[100],
112
- bg: r.gray[1e3],
113
- borderColor: r.gray[1e3],
114
- hoverBg: r.gray[900],
115
- hoverColor: r.gray[100],
116
- disabledBg: r.gray[700],
117
- focusColor: r.gray[1e3]
118
- },
119
- secondary: {
120
- color: r.gray[1e3],
121
- bg: r.gray[100],
122
- borderColor: r.gray[500],
123
- hoverBg: r.gray[300],
124
- hoverColor: r.gray[1e3],
125
- disabledBg: r.gray[100],
126
- focusColor: r.gray[900]
127
- },
128
- tertiary: {
129
- color: r.gray[1e3],
130
- bg: "transparent",
131
- borderColor: "transparent",
132
- hoverBg: r.gray[200],
133
- hoverColor: r.gray[900],
134
- disabledBg: r.gray[100],
135
- focusColor: r.gray[900]
136
- },
137
- shadow: "0px 1px 2px rgba(0, 0, 0, 0.1)"
138
- },
139
- calendarPreview: {
140
- primaryHighlight: r.gray[1e3],
141
- secondaryHighlight: r.orange[800],
142
- lightFont: r.gray[100],
143
- darkFont: r.gray[1e3],
144
- borderColor: r.gray[600]
145
- },
146
- card: {
147
- borderColor: r.gray[400],
148
- dividerColor: r.gray[400],
149
- headerTextColor: r.gray[1e3],
150
- contentTextColor: r.gray[900],
151
- columnTitleColor: r.gray[900],
152
- columnTitleFontSize: e(14)
153
- },
154
- input: {
155
- fontSize: e(14),
156
- radius: e(8),
157
- textColor: r.gray[1e3],
158
- borderWidth: "1px",
159
- borderColor: r.gray[500],
160
- background: r.gray[100],
161
- disabled: {
162
- color: r.gray[700],
163
- border: r.gray[500],
164
- bg: r.gray[200]
165
- },
166
- hovered: {
167
- borderColor: r.gray[1e3]
168
- },
169
- error: {
170
- borderColor: r.error[500]
171
- },
172
- placeholderColor: r.gray[800],
173
- height: e(40),
174
- paddingX: e(12),
175
- paddingY: e(8),
176
- descriptionColor: r.gray[900],
177
- disabledColor: r.gray[600],
178
- labelFontSize: e(15),
179
- labelColor: r.gray[1e3],
180
- labelFontWeight: a.fontWeight.medium,
181
- adornmentFontSize: e(16),
182
- adornmentColor: r.gray[800]
183
- },
184
- link: {
185
- color: r.gray[1e3],
186
- decoration: "underline",
187
- hoverColor: r.gray[900],
188
- hoverDecoration: "underline",
189
- pressedColor: r.gray[1e3],
190
- currentColor: r.gray[800]
191
- },
192
- checkbox: {
193
- borderColor: r.gray[700],
194
- borderWidth: "1px",
195
- selectedColor: r.gray[1e3],
196
- checkmarkColor: r.gray[100],
197
- radius: g,
198
- transitionDuration: d,
199
- hover: {
200
- uncheckedBackground: r.gray[300],
201
- uncheckedBorderColor: r.gray[900],
202
- checkedBackground: r.gray[900],
203
- checkedBorderColor: r.gray[900]
204
- },
205
- disabled: {
206
- borderColor: r.gray[500],
207
- background: r.gray[300],
208
- checkmarkColor: a.disabledTextColor
209
- }
210
- },
211
- radio: {
212
- borderColor: r.gray[700],
213
- hoveredBorderColor: r.gray[800],
214
- pressedBorderColor: r.gray[1e3],
215
- selectedBorderColor: r.gray[1e3],
216
- disabledBorderColor: r.gray[500],
217
- disabledBackground: r.gray[300],
218
- disabledDotColor: a.disabledTextColor,
219
- disabledLabelColor: r.gray[600],
220
- labelColor: r.gray[1e3],
221
- focusRingColor: r.gray[1e3],
222
- errorBorderColor: r.error[500],
223
- errorLabelColor: r.error[800],
224
- borderWidth: "1px",
225
- transitionDuration: d
226
- },
227
- table: {
228
- paddingX: e(16),
229
- paddingY: e(20),
230
- fontSize: e(14),
231
- textColor: r.gray[1e3],
232
- borderColor: r.gray[500],
233
- background: r.gray[100],
234
- headerColor: r.gray[800],
235
- headerBg: r.gray[200],
236
- highlightBg: r.gray[200],
237
- highlightFg: r.gray[800],
238
- columnWeight: a.fontWeight.regular
239
- }
240
- }), A = (r = {}) => {
241
- const {
242
- colors: a = {},
243
- spacing: i = {},
244
- typography: g = {},
245
- radius: d,
246
- transitionDuration: F,
247
- rootFS: x,
248
- ...B
249
- } = r, o = t(n, a), y = t(p, i), C = t(
250
- m({ colors: o }),
251
- g
252
- ), b = d ?? u, h = F ?? l, f = t(
253
- T({ colors: o, typography: C, spacing: y, radius: b, transitionDuration: h }),
254
- B
255
- );
256
- return {
257
- spacing: y,
258
- typography: C,
259
- colors: o,
260
- radius: b,
261
- rootFS: x ?? k(),
262
- transitionDuration: h,
263
- ...f
264
- };
265
- };
266
- export {
267
- A as createTheme
268
- };
269
- //# sourceMappingURL=createTheme.js.map