@gusto/embedded-react-sdk 0.32.0 → 0.34.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.
Files changed (155) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/dist/components/Common/Fields/MultiSelectComboBoxField/MultiSelectComboBoxField.d.ts +5 -0
  3. package/dist/components/Common/Fields/MultiSelectComboBoxField/MultiSelectComboBoxField.js +34 -0
  4. package/dist/components/Common/Fields/MultiSelectComboBoxField/MultiSelectComboBoxField.js.map +1 -0
  5. package/dist/components/Common/Fields/MultiSelectComboBoxField/index.d.ts +2 -0
  6. package/dist/components/Common/SignatureForm/SignatureForm.d.ts +1 -7
  7. package/dist/components/Common/UI/Badge/Badge.js +39 -8
  8. package/dist/components/Common/UI/Badge/Badge.js.map +1 -1
  9. package/dist/components/Common/UI/Badge/Badge.module.scss.js +8 -4
  10. package/dist/components/Common/UI/Badge/Badge.module.scss.js.map +1 -1
  11. package/dist/components/Common/UI/Badge/BadgeTypes.d.ts +12 -0
  12. package/dist/components/Common/UI/Badge/BadgeTypes.js.map +1 -1
  13. package/dist/components/Common/UI/Menu/Menu.js +2 -3
  14. package/dist/components/Common/UI/Menu/Menu.js.map +1 -1
  15. package/dist/components/Common/UI/MultiSelectComboBox/MultiSelectComboBox.d.ts +2 -0
  16. package/dist/components/Common/UI/MultiSelectComboBox/MultiSelectComboBox.js +127 -0
  17. package/dist/components/Common/UI/MultiSelectComboBox/MultiSelectComboBox.js.map +1 -0
  18. package/dist/components/Common/UI/MultiSelectComboBox/MultiSelectComboBox.module.scss.js +16 -0
  19. package/dist/components/Common/UI/MultiSelectComboBox/MultiSelectComboBox.module.scss.js.map +1 -0
  20. package/dist/components/Common/UI/MultiSelectComboBox/MultiSelectComboBoxTypes.d.ts +17 -0
  21. package/dist/components/Common/UI/MultiSelectComboBox/index.d.ts +3 -0
  22. package/dist/components/Common/index.d.ts +1 -0
  23. package/dist/components/Company/AssignSignatory/CreateSignatory/Schema.d.ts +4 -30
  24. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.d.ts +2 -26
  25. package/dist/components/Company/BankAccount/BankAccountForm/Form.d.ts +1 -7
  26. package/dist/components/Company/BankAccount/BankAccountVerify/Form.d.ts +1 -7
  27. package/dist/components/Company/FederalTaxes/useFederalTaxes.d.ts +7 -13
  28. package/dist/components/Company/Locations/LocationForm/Form.d.ts +7 -20
  29. package/dist/components/Company/PaySchedule/usePaySchedule.d.ts +7 -18
  30. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +40 -46
  31. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js.map +1 -1
  32. package/dist/components/Contractor/Address/useAddress.d.ts +1 -13
  33. package/dist/components/Contractor/ContractorList/useContractorList.js +4 -4
  34. package/dist/components/Contractor/ContractorList/useContractorList.js.map +1 -1
  35. package/dist/components/Contractor/NewHireReport/NewHireReport.d.ts +5 -15
  36. package/dist/components/Contractor/NewHireReport/NewHireReport.js +28 -28
  37. package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
  38. package/dist/components/Contractor/PaymentMethod/PaymentMethod.d.ts +7 -20
  39. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.d.ts +5 -6
  40. package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js +108 -100
  41. package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js.map +1 -1
  42. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.d.ts +4 -1
  43. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +54 -50
  44. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
  45. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentFormSchema.d.ts +19 -67
  46. package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js +27 -26
  47. package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js.map +1 -1
  48. package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js +76 -44
  49. package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js.map +1 -1
  50. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistory.js +1 -1
  51. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistory.js.map +1 -1
  52. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.js +1 -1
  53. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.js.map +1 -1
  54. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummary.d.ts +3 -1
  55. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummary.js +28 -22
  56. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummary.js.map +1 -1
  57. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.d.ts +3 -1
  58. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js +63 -52
  59. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js.map +1 -1
  60. package/dist/components/Contractor/Profile/useContractorProfile.d.ts +54 -120
  61. package/dist/components/Contractor/Profile/useContractorProfile.js +47 -47
  62. package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
  63. package/dist/components/Employee/Compensation/useCompensation.d.ts +17 -44
  64. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.d.ts +4 -22
  65. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +59 -59
  66. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
  67. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.d.ts +4 -22
  68. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +33 -33
  69. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
  70. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.d.ts +5 -27
  71. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +46 -46
  72. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
  73. package/dist/components/Employee/Deductions/useDeductions.d.ts +7 -26
  74. package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.d.ts +5 -29
  75. package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.js +8 -8
  76. package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.js.map +1 -1
  77. package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.d.ts +9 -76
  78. package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.d.ts +1 -5
  79. package/dist/components/Employee/FederalTaxes/FederalForm.d.ts +7 -33
  80. package/dist/components/Employee/PaymentMethod/BankAccount.d.ts +5 -14
  81. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.d.ts +5 -6
  82. package/dist/components/Employee/PaymentMethod/usePaymentMethod.d.ts +12 -68
  83. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +15 -14
  84. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  85. package/dist/components/Employee/Profile/AdminPersonalDetails.d.ts +17 -82
  86. package/dist/components/Employee/Profile/AdminPersonalDetails.js +38 -33
  87. package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
  88. package/dist/components/Employee/Profile/HomeAddress.d.ts +11 -66
  89. package/dist/components/Employee/Profile/PersonalDetailsInputs.d.ts +15 -64
  90. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +23 -19
  91. package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
  92. package/dist/components/Employee/Profile/Profile.js +2 -5
  93. package/dist/components/Employee/Profile/Profile.js.map +1 -1
  94. package/dist/components/Employee/Profile/SelfPersonalDetails.d.ts +8 -37
  95. package/dist/components/Employee/Profile/SelfPersonalDetails.js +22 -19
  96. package/dist/components/Employee/Profile/SelfPersonalDetails.js.map +1 -1
  97. package/dist/components/Employee/StateTaxes/StateForm.d.ts +1 -5
  98. package/dist/components/Employee/Taxes/FederalForm.d.ts +7 -33
  99. package/dist/components/Employee/Taxes/StateForm.d.ts +1 -5
  100. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.d.ts +1 -11
  101. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +1 -1
  102. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -1
  103. package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js +6 -9
  104. package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js.map +1 -1
  105. package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js +84 -56
  106. package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js.map +1 -1
  107. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.d.ts +1 -1
  108. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js +56 -22
  109. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js.map +1 -1
  110. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationTypes.d.ts +5 -0
  111. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.d.ts +2 -22
  112. package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js +22 -18
  113. package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js.map +1 -1
  114. package/dist/components/Payroll/PayrollBlocker/payrollHelpers.test.d.ts +1 -0
  115. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +12 -8
  116. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
  117. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +5 -5
  118. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
  119. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.d.ts +2 -12
  120. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +34 -34
  121. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
  122. package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js +38 -35
  123. package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js.map +1 -1
  124. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +1 -0
  125. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -1
  126. package/dist/components/Payroll/usePreparedPayrollData.js +26 -26
  127. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  128. package/dist/contexts/ApiProvider/ApiProvider.js +26 -25
  129. package/dist/contexts/ApiProvider/ApiProvider.js.map +1 -1
  130. package/dist/contexts/ApiProvider/apiVersionHook.d.ts +2 -0
  131. package/dist/contexts/ApiProvider/apiVersionHook.js +7 -0
  132. package/dist/contexts/ApiProvider/apiVersionHook.js.map +1 -0
  133. package/dist/contexts/ApiProvider/apiVersionHook.test.d.ts +1 -0
  134. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js +60 -58
  135. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js.map +1 -1
  136. package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +2 -0
  137. package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
  138. package/dist/contexts/ThemeProvider/ThemeProvider.js +23 -23
  139. package/dist/contexts/ThemeProvider/ThemeProvider.js.map +1 -1
  140. package/dist/helpers/validations.d.ts +2 -2
  141. package/dist/i18n/I18n.js +15 -15
  142. package/dist/i18n/I18n.js.map +1 -1
  143. package/dist/i18n/en/Contractor.Payments.PaymentSummary.json.js +42 -40
  144. package/dist/i18n/en/Contractor.Payments.PaymentSummary.json.js.map +1 -1
  145. package/dist/i18n/en/Contractor.Payments.PaymentsList.json.js +9 -9
  146. package/dist/i18n/en/Payroll.EmployeeSelection.json.js +10 -0
  147. package/dist/i18n/en/Payroll.EmployeeSelection.json.js.map +1 -0
  148. package/dist/i18n/en/Payroll.OffCycleCreation.json.js +10 -8
  149. package/dist/i18n/en/Payroll.OffCycleCreation.json.js.map +1 -1
  150. package/dist/i18n/en/common.json.d.ts +4 -1
  151. package/dist/i18n/en/common.json.js +5 -5
  152. package/dist/style.css +1 -1
  153. package/dist/types/i18next.d.ts +14 -1
  154. package/docs/reference/endpoint-inventory.json +4 -0
  155. package/package.json +13 -12
package/CHANGELOG.md CHANGED
@@ -1,5 +1,57 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.34.0
4
+
5
+ ### Features & Enhancements
6
+
7
+ - Integrate employee selection into OffCycleCreation
8
+ - Add wire-in confirmation alert and API version header
9
+ - Optimize ThemeProvider style tag injection and CSS generation
10
+
11
+ ### Fixes
12
+
13
+ - Resolve double prepare API call in Off Cycle payroll flow
14
+
15
+ ### Chores & Maintenance
16
+
17
+ - Architecture overview documentation
18
+ - Add stylelint rule to prevent manual SCSS helpers imports
19
+ - Upgrade zod from v3 to v4
20
+ - Bump @gusto/embedded-api from 0.12.0 to 0.12.2
21
+ - Bump @internationalized/date from 3.10.1 to 3.12.0
22
+ - Bump dompurify from 3.3.1 to 3.3.2
23
+ - Bump @storybook/addon-a11y from 10.2.14 to 10.2.15
24
+ - Bump @storybook/addon-onboarding from 10.2.14 to 10.2.15
25
+ - Bump @storybook/react-vite from 10.2.14 to 10.2.15
26
+ - Bump eslint-plugin-storybook from 10.2.14 to 10.2.15
27
+
28
+ ## 0.33.0
29
+
30
+ ### Features & Enhancements
31
+
32
+ - Add MultiSelectComboBox composed component
33
+ - Remove form validation for state taxes until API is fixed
34
+
35
+ ### Fixes
36
+
37
+ - Add support for payroll blockers in contractor flow
38
+ - Fix duplicate payroll progress saved alerts
39
+
40
+ ### Chores & Maintenance
41
+
42
+ - Update EmployeeDocuments with corrected copy
43
+ - Create cursor command to seed data
44
+ - Remove unnecessary MSW init from e2e-demo CI job
45
+ - Bump immutable from 5.1.4 to 5.1.5
46
+ - Bump @commitlint/cli from 20.4.2 to 20.4.3
47
+ - Bump @commitlint/config-conventional from 20.4.2 to 20.4.3
48
+ - Bump lint-staged from 16.3.1 to 16.3.2
49
+ - Bump @storybook/addon-onboarding from 10.2.13 to 10.2.14
50
+ - Bump @storybook/addon-a11y from 10.2.13 to 10.2.14
51
+ - Bump @storybook/addon-docs from 10.2.13 to 10.2.14
52
+ - Bump @storybook/react-vite from 10.2.13 to 10.2.14
53
+ - Bump eslint-plugin-storybook from 10.2.13 to 10.2.14
54
+
3
55
  ## 0.32.0
4
56
 
5
57
  ### Features & Enhancements
@@ -0,0 +1,5 @@
1
+ import { UseFieldProps } from '../hooks/useField';
2
+ import { MultiSelectComboBoxProps } from '../../UI/MultiSelectComboBox/MultiSelectComboBoxTypes';
3
+ export interface MultiSelectComboBoxFieldProps extends Omit<MultiSelectComboBoxProps, 'name' | 'value' | 'onChange' | 'isInvalid'>, UseFieldProps<string[]> {
4
+ }
5
+ export declare const MultiSelectComboBoxField: React.FC<MultiSelectComboBoxFieldProps>;
@@ -0,0 +1,34 @@
1
+ import { jsx as x } from "react/jsx-runtime";
2
+ import { useField as f } from "../hooks/useField.js";
3
+ import { useComponentContext as d } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
4
+ const h = ({
5
+ rules: o,
6
+ defaultValue: e,
7
+ name: t,
8
+ errorMessage: n,
9
+ isRequired: m,
10
+ onChange: r,
11
+ transform: i,
12
+ description: s,
13
+ onBlur: l,
14
+ inputRef: p,
15
+ ...C
16
+ }) => {
17
+ const c = d(), u = f({
18
+ name: t,
19
+ rules: o,
20
+ defaultValue: e,
21
+ errorMessage: n,
22
+ isRequired: m,
23
+ onChange: r,
24
+ transform: i,
25
+ description: s,
26
+ onBlur: l,
27
+ inputRef: p
28
+ });
29
+ return /* @__PURE__ */ x(c.MultiSelectComboBox, { ...C, ...u });
30
+ };
31
+ export {
32
+ h as MultiSelectComboBoxField
33
+ };
34
+ //# sourceMappingURL=MultiSelectComboBoxField.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MultiSelectComboBoxField.js","sources":["../../../../../src/components/Common/Fields/MultiSelectComboBoxField/MultiSelectComboBoxField.tsx"],"sourcesContent":["import { useField, type UseFieldProps } from '@/components/Common/Fields/hooks/useField'\nimport type { MultiSelectComboBoxProps } from '@/components/Common/UI/MultiSelectComboBox/MultiSelectComboBoxTypes'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport interface MultiSelectComboBoxFieldProps\n extends\n Omit<MultiSelectComboBoxProps, 'name' | 'value' | 'onChange' | 'isInvalid'>,\n UseFieldProps<string[]> {}\n\nexport const MultiSelectComboBoxField: React.FC<MultiSelectComboBoxFieldProps> = ({\n rules,\n defaultValue,\n name,\n errorMessage,\n isRequired,\n onChange: onChangeFromProps,\n transform,\n description,\n onBlur,\n inputRef,\n ...multiSelectProps\n}: MultiSelectComboBoxFieldProps) => {\n const Components = useComponentContext()\n const fieldProps = useField<string[]>({\n name,\n rules,\n defaultValue,\n errorMessage,\n isRequired,\n onChange: onChangeFromProps,\n transform,\n description,\n onBlur,\n inputRef,\n })\n\n return <Components.MultiSelectComboBox {...multiSelectProps} {...fieldProps} />\n}\n"],"names":["MultiSelectComboBoxField","rules","defaultValue","name","errorMessage","isRequired","onChangeFromProps","transform","description","onBlur","inputRef","multiSelectProps","Components","useComponentContext","fieldProps","useField"],"mappings":";;;AASO,MAAMA,IAAoE,CAAC;AAAA,EAChF,OAAAC;AAAA,EACA,cAAAC;AAAA,EACA,MAAAC;AAAA,EACA,cAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAUC;AAAA,EACV,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,QAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,MAAqC;AACnC,QAAMC,IAAaC,EAAA,GACbC,IAAaC,EAAmB;AAAA,IACpC,MAAAZ;AAAA,IACA,OAAAF;AAAA,IACA,cAAAC;AAAA,IACA,cAAAE;AAAA,IACA,YAAAC;AAAA,IACA,UAAUC;AAAA,IACV,WAAAC;AAAA,IACA,aAAAC;AAAA,IACA,QAAAC;AAAA,IACA,UAAAC;AAAA,EAAA,CACD;AAED,2BAAQE,EAAW,qBAAX,EAAgC,GAAGD,GAAmB,GAAGG,GAAY;AAC/E;"}
@@ -0,0 +1,2 @@
1
+ import "./types/i18next.d.ts"
2
+ export { MultiSelectComboBoxField, type MultiSelectComboBoxFieldProps, } from './MultiSelectComboBoxField';
@@ -3,13 +3,7 @@ import { UseFormProps } from 'react-hook-form';
3
3
  export declare const SignatureFormSchema: z.ZodObject<{
4
4
  signature: z.ZodString;
5
5
  confirmSignature: z.ZodLiteral<true>;
6
- }, "strip", z.ZodTypeAny, {
7
- signature: string;
8
- confirmSignature: true;
9
- }, {
10
- signature: string;
11
- confirmSignature: true;
12
- }>;
6
+ }, z.core.$strip>;
13
7
  export type SignatureFormInputs = z.infer<typeof SignatureFormSchema>;
14
8
  interface SignatureFormProps {
15
9
  onSubmit: (data: SignatureFormInputs) => void | Promise<void>;
@@ -1,13 +1,44 @@
1
- import { jsx as m } from "react/jsx-runtime";
2
- import p from "classnames";
1
+ import { jsxs as p, jsx as t } from "react/jsx-runtime";
2
+ import c from "classnames";
3
3
  import i from "./Badge.module.scss.js";
4
- import { BadgeDefaults as l } from "./BadgeTypes.js";
5
- import { applyMissingDefaults as n } from "../../../../helpers/applyMissingDefaults.js";
6
- const v = (s) => {
7
- const a = n(s, l), { className: r, children: t, status: o, ...e } = a;
8
- return /* @__PURE__ */ m("span", { ...e, className: p(i.badge, r), "data-variant": o, children: t });
4
+ import { BadgeDefaults as b } from "./BadgeTypes.js";
5
+ import { applyMissingDefaults as f } from "../../../../helpers/applyMissingDefaults.js";
6
+ import h from "../../../../assets/icons/close.svg.js";
7
+ const y = (e) => {
8
+ const r = f(e, b), {
9
+ className: o,
10
+ children: l,
11
+ status: m,
12
+ onDismiss: s,
13
+ dismissAriaLabel: d = "Dismiss",
14
+ isDisabled: a,
15
+ ...n
16
+ } = r;
17
+ return /* @__PURE__ */ p(
18
+ "span",
19
+ {
20
+ ...n,
21
+ className: c(i.badge, s && i.dismissable, o),
22
+ "data-variant": m,
23
+ "aria-disabled": a || void 0,
24
+ children: [
25
+ l,
26
+ s && /* @__PURE__ */ t(
27
+ "button",
28
+ {
29
+ type: "button",
30
+ className: i.dismissButton,
31
+ onClick: s,
32
+ disabled: a,
33
+ "aria-label": d,
34
+ children: /* @__PURE__ */ t(h, { "aria-hidden": !0, width: 12, height: 12 })
35
+ }
36
+ )
37
+ ]
38
+ }
39
+ );
9
40
  };
10
41
  export {
11
- v as Badge
42
+ y as Badge
12
43
  };
13
44
  //# sourceMappingURL=Badge.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Badge.js","sources":["../../../../../src/components/Common/UI/Badge/Badge.tsx"],"sourcesContent":["import type React from 'react'\nimport classnames from 'classnames'\nimport styles from './Badge.module.scss'\nimport type { BadgeProps } from './BadgeTypes'\nimport { BadgeDefaults } from './BadgeTypes'\nimport { applyMissingDefaults } from '@/helpers/applyMissingDefaults'\n\nexport const Badge: React.FC<BadgeProps> = rawProps => {\n const resolvedProps = applyMissingDefaults(rawProps, BadgeDefaults)\n const { className, children, status: variant, ...otherProps } = resolvedProps\n return (\n <span {...otherProps} className={classnames(styles.badge, className)} data-variant={variant}>\n {children}\n </span>\n )\n}\n"],"names":["Badge","rawProps","resolvedProps","applyMissingDefaults","BadgeDefaults","className","children","variant","otherProps","jsx","classnames","styles"],"mappings":";;;;;AAOO,MAAMA,IAA8B,CAAAC,MAAY;AACrD,QAAMC,IAAgBC,EAAqBF,GAAUG,CAAa,GAC5D,EAAE,WAAAC,GAAW,UAAAC,GAAU,QAAQC,GAAS,GAAGC,MAAeN;AAChE,SACE,gBAAAO,EAAC,QAAA,EAAM,GAAGD,GAAY,WAAWE,EAAWC,EAAO,OAAON,CAAS,GAAG,gBAAcE,GACjF,UAAAD,EAAA,CACH;AAEJ;"}
1
+ {"version":3,"file":"Badge.js","sources":["../../../../../src/components/Common/UI/Badge/Badge.tsx"],"sourcesContent":["import type React from 'react'\nimport classnames from 'classnames'\nimport styles from './Badge.module.scss'\nimport type { BadgeProps } from './BadgeTypes'\nimport { BadgeDefaults } from './BadgeTypes'\nimport { applyMissingDefaults } from '@/helpers/applyMissingDefaults'\nimport CloseIcon from '@/assets/icons/close.svg?react'\n\nexport const Badge: React.FC<BadgeProps> = rawProps => {\n const resolvedProps = applyMissingDefaults(rawProps, BadgeDefaults)\n const {\n className,\n children,\n status: variant,\n onDismiss,\n dismissAriaLabel = 'Dismiss',\n isDisabled,\n ...otherProps\n } = resolvedProps\n return (\n <span\n {...otherProps}\n className={classnames(styles.badge, onDismiss && styles.dismissable, className)}\n data-variant={variant}\n aria-disabled={isDisabled || undefined}\n >\n {children}\n {onDismiss && (\n <button\n type=\"button\"\n className={styles.dismissButton}\n onClick={onDismiss}\n disabled={isDisabled}\n aria-label={dismissAriaLabel}\n >\n <CloseIcon aria-hidden width={12} height={12} />\n </button>\n )}\n </span>\n )\n}\n"],"names":["Badge","rawProps","resolvedProps","applyMissingDefaults","BadgeDefaults","className","children","variant","onDismiss","dismissAriaLabel","isDisabled","otherProps","jsxs","classnames","styles","jsx","CloseIcon"],"mappings":";;;;;;AAQO,MAAMA,IAA8B,CAAAC,MAAY;AACrD,QAAMC,IAAgBC,EAAqBF,GAAUG,CAAa,GAC5D;AAAA,IACJ,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,QAAQC;AAAA,IACR,WAAAC;AAAA,IACA,kBAAAC,IAAmB;AAAA,IACnB,YAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACDT;AACJ,SACE,gBAAAU;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAGD;AAAA,MACJ,WAAWE,EAAWC,EAAO,OAAON,KAAaM,EAAO,aAAaT,CAAS;AAAA,MAC9E,gBAAcE;AAAA,MACd,iBAAeG,KAAc;AAAA,MAE5B,UAAA;AAAA,QAAAJ;AAAA,QACAE,KACC,gBAAAO;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,WAAWD,EAAO;AAAA,YAClB,SAASN;AAAA,YACT,UAAUE;AAAA,YACV,cAAYD;AAAA,YAEZ,4BAACO,GAAA,EAAU,eAAW,IAAC,OAAO,IAAI,QAAQ,GAAA,CAAI;AAAA,UAAA;AAAA,QAAA;AAAA,MAChD;AAAA,IAAA;AAAA,EAAA;AAIR;"}
@@ -1,8 +1,12 @@
1
- const e = "_badge_6p7jj_1", a = {
2
- badge: e
1
+ const s = "_badge_1jiis_1", i = "_dismissable_1jiis_38", t = "_dismissButton_1jiis_45", d = {
2
+ badge: s,
3
+ dismissable: i,
4
+ dismissButton: t
3
5
  };
4
6
  export {
5
- e as badge,
6
- a as default
7
+ s as badge,
8
+ d as default,
9
+ t as dismissButton,
10
+ i as dismissable
7
11
  };
8
12
  //# sourceMappingURL=Badge.module.scss.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Badge.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
1
+ {"version":3,"file":"Badge.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
@@ -8,6 +8,18 @@ export interface BadgeProps extends Pick<HTMLAttributes<HTMLSpanElement>, 'class
8
8
  * Visual style variant of the badge
9
9
  */
10
10
  status?: 'success' | 'warning' | 'error' | 'info';
11
+ /**
12
+ * Optional callback when the dismiss button is clicked. When provided, a dismiss button is rendered inside the badge.
13
+ */
14
+ onDismiss?: () => void;
15
+ /**
16
+ * Accessible label for the dismiss button
17
+ */
18
+ dismissAriaLabel?: string;
19
+ /**
20
+ * Whether the badge interaction is disabled
21
+ */
22
+ isDisabled?: boolean;
11
23
  }
12
24
  /**
13
25
  * Default prop values for Badge component.
@@ -1 +1 @@
1
- {"version":3,"file":"BadgeTypes.js","sources":["../../../../../src/components/Common/UI/Badge/BadgeTypes.ts"],"sourcesContent":["import type { HTMLAttributes, ReactNode } from 'react'\n\nexport interface BadgeProps extends Pick<\n HTMLAttributes<HTMLSpanElement>,\n 'className' | 'id' | 'aria-label'\n> {\n /**\n * Content to be displayed inside the badge\n */\n children: ReactNode\n /**\n * Visual style variant of the badge\n */\n status?: 'success' | 'warning' | 'error' | 'info'\n}\n\n/**\n * Default prop values for Badge component.\n */\nexport const BadgeDefaults = {\n status: 'info',\n} as const satisfies Partial<BadgeProps>\n"],"names":["BadgeDefaults"],"mappings":"AAmBO,MAAMA,IAAgB;AAAA,EAC3B,QAAQ;AACV;"}
1
+ {"version":3,"file":"BadgeTypes.js","sources":["../../../../../src/components/Common/UI/Badge/BadgeTypes.ts"],"sourcesContent":["import type { HTMLAttributes, ReactNode } from 'react'\n\nexport interface BadgeProps extends Pick<\n HTMLAttributes<HTMLSpanElement>,\n 'className' | 'id' | 'aria-label'\n> {\n /**\n * Content to be displayed inside the badge\n */\n children: ReactNode\n /**\n * Visual style variant of the badge\n */\n status?: 'success' | 'warning' | 'error' | 'info'\n /**\n * Optional callback when the dismiss button is clicked. When provided, a dismiss button is rendered inside the badge.\n */\n onDismiss?: () => void\n /**\n * Accessible label for the dismiss button\n */\n dismissAriaLabel?: string\n /**\n * Whether the badge interaction is disabled\n */\n isDisabled?: boolean\n}\n\n/**\n * Default prop values for Badge component.\n */\nexport const BadgeDefaults = {\n status: 'info',\n} as const satisfies Partial<BadgeProps>\n"],"names":["BadgeDefaults"],"mappings":"AA+BO,MAAMA,IAAgB;AAAA,EAC3B,QAAQ;AACV;"}
@@ -4,10 +4,9 @@ import r from "./Menu.module.scss.js";
4
4
  import { MenuDefaults as x } from "./MenuTypes.js";
5
5
  import { applyMissingDefaults as I } from "../../../../helpers/applyMissingDefaults.js";
6
6
  import "react";
7
- import "react-i18next";
8
7
  import { useTheme as O } from "../../../../contexts/ThemeProvider/useTheme.js";
9
8
  /* empty css */
10
- function R(s) {
9
+ function E(s) {
11
10
  const a = I(s, x), {
12
11
  triggerRef: i,
13
12
  items: m,
@@ -49,6 +48,6 @@ function R(s) {
49
48
  );
50
49
  }
51
50
  export {
52
- R as Menu
51
+ E as Menu
53
52
  };
54
53
  //# sourceMappingURL=Menu.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Menu.js","sources":["../../../../../src/components/Common/UI/Menu/Menu.tsx"],"sourcesContent":["import { Menu as AriaMenu, MenuItem as AriaMenuItem, Popover } from 'react-aria-components'\nimport styles from './Menu.module.scss'\nimport { type MenuProps, MenuDefaults } from './MenuTypes'\nimport { applyMissingDefaults } from '@/helpers/applyMissingDefaults'\nimport { useTheme } from '@/contexts/ThemeProvider'\n\nexport function Menu(rawProps: MenuProps) {\n const resolvedProps = applyMissingDefaults(rawProps, MenuDefaults)\n const {\n triggerRef,\n items,\n isOpen,\n onClose,\n 'aria-label': ariaLabel,\n ...otherProps\n } = resolvedProps\n const { container } = useTheme()\n\n const handleOpenChange = (isOpen: boolean) => {\n if (!isOpen) {\n onClose?.()\n }\n }\n\n return (\n <Popover\n UNSTABLE_portalContainer={container.current}\n onOpenChange={handleOpenChange}\n isOpen={isOpen}\n triggerRef={triggerRef}\n placement=\"bottom start\"\n offset={8}\n shouldUpdatePosition={true}\n >\n <AriaMenu onClose={onClose} aria-label={ariaLabel} className={styles.root} {...otherProps}>\n {items?.map(({ onClick, isDisabled, href, icon, label, ...itemProps }, index) => (\n <AriaMenuItem\n key={index}\n onAction={() => {\n onClick()\n }}\n isDisabled={isDisabled}\n href={href}\n className={styles.menuItem}\n {...itemProps}\n >\n {icon && <div className={styles.menuIcon}>{icon}</div>}\n {label}\n </AriaMenuItem>\n ))}\n </AriaMenu>\n </Popover>\n )\n}\n"],"names":["Menu","rawProps","resolvedProps","applyMissingDefaults","MenuDefaults","triggerRef","items","isOpen","onClose","ariaLabel","otherProps","container","useTheme","handleOpenChange","jsx","Popover","AriaMenu","styles","onClick","isDisabled","href","icon","label","itemProps","index","jsxs","AriaMenuItem"],"mappings":";;;;;;;;;AAMO,SAASA,EAAKC,GAAqB;AACxC,QAAMC,IAAgBC,EAAqBF,GAAUG,CAAY,GAC3D;AAAA,IACJ,YAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,SAAAC;AAAA,IACA,cAAcC;AAAA,IACd,GAAGC;AAAA,EAAA,IACDR,GACE,EAAE,WAAAS,EAAA,IAAcC,EAAA,GAEhBC,IAAmB,CAACN,MAAoB;AAC5C,IAAKA,KACHC,IAAA;AAAA,EAEJ;AAEA,SACE,gBAAAM;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,0BAA0BJ,EAAU;AAAA,MACpC,cAAcE;AAAA,MACd,QAAAN;AAAA,MACA,YAAAF;AAAA,MACA,WAAU;AAAA,MACV,QAAQ;AAAA,MACR,sBAAsB;AAAA,MAEtB,UAAA,gBAAAS,EAACE,KAAS,SAAAR,GAAkB,cAAYC,GAAW,WAAWQ,EAAO,MAAO,GAAGP,GAC5E,UAAAJ,GAAO,IAAI,CAAC,EAAE,SAAAY,GAAS,YAAAC,GAAY,MAAAC,GAAM,MAAAC,GAAM,OAAAC,GAAO,GAAGC,EAAA,GAAaC,MACrE,gBAAAC;AAAA,QAACC;AAAAA,QAAA;AAAA,UAEC,UAAU,MAAM;AACd,YAAAR,EAAA;AAAA,UACF;AAAA,UACA,YAAAC;AAAA,UACA,MAAAC;AAAA,UACA,WAAWH,EAAO;AAAA,UACjB,GAAGM;AAAA,UAEH,UAAA;AAAA,YAAAF,KAAQ,gBAAAP,EAAC,OAAA,EAAI,WAAWG,EAAO,UAAW,UAAAI,GAAK;AAAA,YAC/CC;AAAA,UAAA;AAAA,QAAA;AAAA,QAVIE;AAAA,MAAA,CAYR,EAAA,CACH;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"Menu.js","sources":["../../../../../src/components/Common/UI/Menu/Menu.tsx"],"sourcesContent":["import { Menu as AriaMenu, MenuItem as AriaMenuItem, Popover } from 'react-aria-components'\nimport styles from './Menu.module.scss'\nimport { type MenuProps, MenuDefaults } from './MenuTypes'\nimport { applyMissingDefaults } from '@/helpers/applyMissingDefaults'\nimport { useTheme } from '@/contexts/ThemeProvider'\n\nexport function Menu(rawProps: MenuProps) {\n const resolvedProps = applyMissingDefaults(rawProps, MenuDefaults)\n const {\n triggerRef,\n items,\n isOpen,\n onClose,\n 'aria-label': ariaLabel,\n ...otherProps\n } = resolvedProps\n const { container } = useTheme()\n\n const handleOpenChange = (isOpen: boolean) => {\n if (!isOpen) {\n onClose?.()\n }\n }\n\n return (\n <Popover\n UNSTABLE_portalContainer={container.current}\n onOpenChange={handleOpenChange}\n isOpen={isOpen}\n triggerRef={triggerRef}\n placement=\"bottom start\"\n offset={8}\n shouldUpdatePosition={true}\n >\n <AriaMenu onClose={onClose} aria-label={ariaLabel} className={styles.root} {...otherProps}>\n {items?.map(({ onClick, isDisabled, href, icon, label, ...itemProps }, index) => (\n <AriaMenuItem\n key={index}\n onAction={() => {\n onClick()\n }}\n isDisabled={isDisabled}\n href={href}\n className={styles.menuItem}\n {...itemProps}\n >\n {icon && <div className={styles.menuIcon}>{icon}</div>}\n {label}\n </AriaMenuItem>\n ))}\n </AriaMenu>\n </Popover>\n )\n}\n"],"names":["Menu","rawProps","resolvedProps","applyMissingDefaults","MenuDefaults","triggerRef","items","isOpen","onClose","ariaLabel","otherProps","container","useTheme","handleOpenChange","jsx","Popover","AriaMenu","styles","onClick","isDisabled","href","icon","label","itemProps","index","jsxs","AriaMenuItem"],"mappings":";;;;;;;;AAMO,SAASA,EAAKC,GAAqB;AACxC,QAAMC,IAAgBC,EAAqBF,GAAUG,CAAY,GAC3D;AAAA,IACJ,YAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,SAAAC;AAAA,IACA,cAAcC;AAAA,IACd,GAAGC;AAAA,EAAA,IACDR,GACE,EAAE,WAAAS,EAAA,IAAcC,EAAA,GAEhBC,IAAmB,CAACN,MAAoB;AAC5C,IAAKA,KACHC,IAAA;AAAA,EAEJ;AAEA,SACE,gBAAAM;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,0BAA0BJ,EAAU;AAAA,MACpC,cAAcE;AAAA,MACd,QAAAN;AAAA,MACA,YAAAF;AAAA,MACA,WAAU;AAAA,MACV,QAAQ;AAAA,MACR,sBAAsB;AAAA,MAEtB,UAAA,gBAAAS,EAACE,KAAS,SAAAR,GAAkB,cAAYC,GAAW,WAAWQ,EAAO,MAAO,GAAGP,GAC5E,UAAAJ,GAAO,IAAI,CAAC,EAAE,SAAAY,GAAS,YAAAC,GAAY,MAAAC,GAAM,MAAAC,GAAM,OAAAC,GAAO,GAAGC,EAAA,GAAaC,MACrE,gBAAAC;AAAA,QAACC;AAAAA,QAAA;AAAA,UAEC,UAAU,MAAM;AACd,YAAAR,EAAA;AAAA,UACF;AAAA,UACA,YAAAC;AAAA,UACA,MAAAC;AAAA,UACA,WAAWH,EAAO;AAAA,UACjB,GAAGM;AAAA,UAEH,UAAA;AAAA,YAAAF,KAAQ,gBAAAP,EAAC,OAAA,EAAI,WAAWG,EAAO,UAAW,UAAAI,GAAK;AAAA,YAC/CC;AAAA,UAAA;AAAA,QAAA;AAAA,QAVIE;AAAA,MAAA,CAYR,EAAA,CACH;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -0,0 +1,2 @@
1
+ import { MultiSelectComboBoxProps } from './MultiSelectComboBoxTypes';
2
+ export declare function MultiSelectComboBox({ className, description, errorMessage, id, inputRef: inputRefFromProps, isDisabled, isInvalid, isLoading, isRequired, label, name, onBlur, onChange, options, placeholder, value: selectedValues, shouldVisuallyHideLabel, }: MultiSelectComboBoxProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,127 @@
1
+ import { jsxs as m, jsx as t } from "react/jsx-runtime";
2
+ import { useState as _, useRef as q, useMemo as s, useCallback as x } from "react";
3
+ import { ComboBox as G, Input as J, Button as Q, Popover as W, Virtualizer as X, ListLayout as Y, ListBox as Z, ListBoxItem as $ } from "react-aria-components";
4
+ import S from "classnames";
5
+ import { useTranslation as V } from "react-i18next";
6
+ import { useFieldIds as ee } from "../hooks/useFieldIds.js";
7
+ import o from "./MultiSelectComboBox.module.scss.js";
8
+ import { FieldLayout as te } from "../../FieldLayout/FieldLayout.js";
9
+ import { useComponentContext as re } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
10
+ import { useTheme as oe } from "../../../../contexts/ThemeProvider/useTheme.js";
11
+ /* empty css */
12
+ import { useForkRef as ie } from "../../../../hooks/useForkRef/useForkRef.js";
13
+ import le from "../../../../assets/icons/alert-circle.svg.js";
14
+ import ne from "../../../../assets/icons/caret-down.svg.js";
15
+ function Be({
16
+ className: B,
17
+ description: C,
18
+ errorMessage: u,
19
+ id: N,
20
+ inputRef: y,
21
+ isDisabled: d,
22
+ isInvalid: p,
23
+ isLoading: L,
24
+ isRequired: D,
25
+ label: c,
26
+ name: F,
27
+ onBlur: R,
28
+ onChange: i,
29
+ options: l,
30
+ placeholder: w,
31
+ value: r = [],
32
+ shouldVisuallyHideLabel: A
33
+ }) {
34
+ const T = re(), { t: n } = V("common"), { container: O } = oe(), [j, f] = _(""), h = q(null), z = ie(y, h), a = s(() => new Set(r), [r]), b = s(
35
+ () => l.filter((e) => !a.has(e.value)).map((e) => ({
36
+ label: e.label,
37
+ value: e.value
38
+ })),
39
+ [l, a]
40
+ ), v = s(
41
+ () => l.filter((e) => a.has(e.value)),
42
+ [l, a]
43
+ ), E = s(
44
+ () => b.map((e) => ({ name: e.label, id: e.value })),
45
+ [b]
46
+ ), M = x(
47
+ (e) => {
48
+ e && (i?.([...r, e.toString()]), f(""), h.current?.blur());
49
+ },
50
+ [r, i]
51
+ ), P = x(
52
+ (e) => {
53
+ i?.(r.filter((U) => U !== e));
54
+ },
55
+ [r, i]
56
+ ), I = (L ? n("status.loadingOptions") : void 0) ?? C, { inputId: g, errorMessageId: k, descriptionId: H, ariaDescribedBy: K } = ee({
57
+ inputId: N,
58
+ errorMessage: u,
59
+ description: I
60
+ });
61
+ return /* @__PURE__ */ m("div", { className: S(o.root, B), children: [
62
+ /* @__PURE__ */ t(
63
+ te,
64
+ {
65
+ label: c,
66
+ htmlFor: g,
67
+ errorMessage: u,
68
+ errorMessageId: k,
69
+ descriptionId: H,
70
+ isRequired: D,
71
+ description: I,
72
+ shouldVisuallyHideLabel: A,
73
+ className: o.comboBoxField,
74
+ withErrorIcon: !1,
75
+ children: /* @__PURE__ */ m(
76
+ G,
77
+ {
78
+ "aria-label": c,
79
+ "aria-describedby": K,
80
+ className: "react-aria-ComboBox-root",
81
+ isDisabled: d,
82
+ isInvalid: p,
83
+ menuTrigger: "focus",
84
+ inputValue: j,
85
+ onInputChange: f,
86
+ selectedKey: null,
87
+ onSelectionChange: M,
88
+ id: g,
89
+ name: F,
90
+ children: [
91
+ /* @__PURE__ */ t(J, { ref: z, placeholder: w, onBlur: R }),
92
+ /* @__PURE__ */ t(Q, { children: /* @__PURE__ */ m("div", { "aria-hidden": "true", className: o.icons, children: [
93
+ p && /* @__PURE__ */ t(le, { fontSize: 16 }),
94
+ /* @__PURE__ */ t(ne, { title: n("icons.selectArrow") })
95
+ ] }) }),
96
+ /* @__PURE__ */ t(
97
+ W,
98
+ {
99
+ className: S(o.popover, "react-aria-Popover"),
100
+ UNSTABLE_portalContainer: O.current,
101
+ maxHeight: 320,
102
+ children: /* @__PURE__ */ t(X, { layout: Y, children: /* @__PURE__ */ t(Z, { items: E, children: (e) => /* @__PURE__ */ t($, { children: e.name }, e.id) }) })
103
+ }
104
+ )
105
+ ]
106
+ }
107
+ )
108
+ }
109
+ ),
110
+ v.length > 0 && /* @__PURE__ */ t("div", { className: o.chips, role: "list", "aria-label": n("labels.selectedItems", { label: c }), children: v.map((e) => /* @__PURE__ */ t("span", { role: "listitem", children: /* @__PURE__ */ t(
111
+ T.Badge,
112
+ {
113
+ status: "info",
114
+ onDismiss: () => {
115
+ P(e.value);
116
+ },
117
+ dismissAriaLabel: n("labels.removeItem", { label: e.label }),
118
+ isDisabled: d,
119
+ children: e.label
120
+ }
121
+ ) }, e.value)) })
122
+ ] });
123
+ }
124
+ export {
125
+ Be as MultiSelectComboBox
126
+ };
127
+ //# sourceMappingURL=MultiSelectComboBox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MultiSelectComboBox.js","sources":["../../../../../src/components/Common/UI/MultiSelectComboBox/MultiSelectComboBox.tsx"],"sourcesContent":["import { useCallback, useMemo, useRef, useState } from 'react'\nimport type { Key } from 'react-aria-components'\nimport {\n ComboBox as AriaComboBox,\n Button,\n Input,\n ListBox,\n ListBoxItem,\n ListLayout,\n Popover,\n Virtualizer,\n} from 'react-aria-components'\nimport classNames from 'classnames'\nimport { useTranslation } from 'react-i18next'\nimport { useFieldIds } from '../hooks/useFieldIds'\nimport styles from './MultiSelectComboBox.module.scss'\nimport type { MultiSelectComboBoxProps } from './MultiSelectComboBoxTypes'\nimport { FieldLayout } from '@/components/Common/FieldLayout'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useTheme } from '@/contexts/ThemeProvider'\nimport { useForkRef } from '@/hooks/useForkRef/useForkRef'\nimport AlertCircle from '@/assets/icons/alert-circle.svg?react'\nimport CaretDown from '@/assets/icons/caret-down.svg?react'\n\nexport function MultiSelectComboBox({\n className,\n description,\n errorMessage,\n id,\n inputRef: inputRefFromProps,\n isDisabled,\n isInvalid,\n isLoading,\n isRequired,\n label,\n name,\n onBlur,\n onChange,\n options,\n placeholder,\n value: selectedValues = [],\n shouldVisuallyHideLabel,\n}: MultiSelectComboBoxProps) {\n const Components = useComponentContext()\n const { t } = useTranslation('common')\n const { container } = useTheme()\n const [inputValue, setInputValue] = useState('')\n const internalInputRef = useRef<HTMLInputElement>(null)\n const inputRef = useForkRef(inputRefFromProps, internalInputRef)\n\n const selectedSet = useMemo(() => new Set(selectedValues), [selectedValues])\n\n const availableOptions = useMemo(\n () =>\n options\n .filter(option => !selectedSet.has(option.value))\n .map(option => ({\n label: option.label,\n value: option.value,\n })),\n [options, selectedSet],\n )\n\n const selectedOptions = useMemo(\n () => options.filter(option => selectedSet.has(option.value)),\n [options, selectedSet],\n )\n\n const items = useMemo(\n () => availableOptions.map(option => ({ name: option.label, id: option.value })),\n [availableOptions],\n )\n\n const handleSelectionChange = useCallback(\n (key: Key | null) => {\n if (!key) return\n onChange?.([...selectedValues, key.toString()])\n setInputValue('')\n internalInputRef.current?.blur()\n },\n [selectedValues, onChange],\n )\n\n const handleDismiss = useCallback(\n (value: string) => {\n onChange?.(selectedValues.filter(v => v !== value))\n },\n [selectedValues, onChange],\n )\n\n const loadingDescription = isLoading ? t('status.loadingOptions') : undefined\n const displayDescription = loadingDescription ?? description\n\n const { inputId, errorMessageId, descriptionId, ariaDescribedBy } = useFieldIds({\n inputId: id,\n errorMessage,\n description: displayDescription,\n })\n\n return (\n <div className={classNames(styles.root, className)}>\n <FieldLayout\n label={label}\n htmlFor={inputId}\n errorMessage={errorMessage}\n errorMessageId={errorMessageId}\n descriptionId={descriptionId}\n isRequired={isRequired}\n description={displayDescription}\n shouldVisuallyHideLabel={shouldVisuallyHideLabel}\n className={styles.comboBoxField}\n withErrorIcon={false}\n >\n <AriaComboBox\n aria-label={label}\n aria-describedby={ariaDescribedBy}\n className={'react-aria-ComboBox-root'}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n menuTrigger=\"focus\"\n inputValue={inputValue}\n onInputChange={setInputValue}\n selectedKey={null}\n onSelectionChange={handleSelectionChange}\n id={inputId}\n name={name}\n >\n <Input ref={inputRef} placeholder={placeholder} onBlur={onBlur} />\n <Button>\n <div aria-hidden=\"true\" className={styles.icons}>\n {isInvalid && <AlertCircle fontSize={16} />}\n <CaretDown title={t('icons.selectArrow')} />\n </div>\n </Button>\n\n <Popover\n className={classNames(styles.popover, 'react-aria-Popover')}\n UNSTABLE_portalContainer={container.current}\n maxHeight={320}\n >\n <Virtualizer layout={ListLayout}>\n <ListBox items={items}>\n {item => <ListBoxItem key={item.id}>{item.name}</ListBoxItem>}\n </ListBox>\n </Virtualizer>\n </Popover>\n </AriaComboBox>\n </FieldLayout>\n\n {selectedOptions.length > 0 && (\n <div className={styles.chips} role=\"list\" aria-label={t('labels.selectedItems', { label })}>\n {selectedOptions.map(option => (\n <span key={option.value} role=\"listitem\">\n <Components.Badge\n status=\"info\"\n onDismiss={() => {\n handleDismiss(option.value)\n }}\n dismissAriaLabel={t('labels.removeItem', { label: option.label })}\n isDisabled={isDisabled}\n >\n {option.label}\n </Components.Badge>\n </span>\n ))}\n </div>\n )}\n </div>\n )\n}\n"],"names":["MultiSelectComboBox","className","description","errorMessage","id","inputRefFromProps","isDisabled","isInvalid","isLoading","isRequired","label","name","onBlur","onChange","options","placeholder","selectedValues","shouldVisuallyHideLabel","Components","useComponentContext","t","useTranslation","container","useTheme","inputValue","setInputValue","useState","internalInputRef","useRef","inputRef","useForkRef","selectedSet","useMemo","availableOptions","option","selectedOptions","items","handleSelectionChange","useCallback","key","handleDismiss","value","v","displayDescription","inputId","errorMessageId","descriptionId","ariaDescribedBy","useFieldIds","classNames","styles","jsx","FieldLayout","jsxs","AriaComboBox","Input","Button","AlertCircle","CaretDown","Popover","Virtualizer","ListLayout","ListBox","item","ListBoxItem"],"mappings":"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"}
@@ -0,0 +1,16 @@
1
+ const o = "_root_kyxn6_1", c = "_comboBoxField_kyxn6_5", s = "_icons_kyxn6_71", _ = "_popover_kyxn6_81", n = "_chips_kyxn6_130", t = {
2
+ root: o,
3
+ comboBoxField: c,
4
+ icons: s,
5
+ popover: _,
6
+ chips: n
7
+ };
8
+ export {
9
+ n as chips,
10
+ c as comboBoxField,
11
+ t as default,
12
+ s as icons,
13
+ _ as popover,
14
+ o as root
15
+ };
16
+ //# sourceMappingURL=MultiSelectComboBox.module.scss.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MultiSelectComboBox.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1,17 @@
1
+ import { InputHTMLAttributes, Ref } from 'react';
2
+ import { SharedFieldLayoutProps } from '../../FieldLayout/FieldLayoutTypes';
3
+ export interface MultiSelectComboBoxOption {
4
+ label: string;
5
+ value: string;
6
+ }
7
+ export interface MultiSelectComboBoxProps extends SharedFieldLayoutProps, Pick<InputHTMLAttributes<HTMLInputElement>, 'className' | 'id' | 'name' | 'placeholder'> {
8
+ inputRef?: Ref<HTMLInputElement>;
9
+ isDisabled?: boolean;
10
+ isInvalid?: boolean;
11
+ isLoading?: boolean;
12
+ label: string;
13
+ options: MultiSelectComboBoxOption[];
14
+ value?: string[];
15
+ onChange?: (values: string[]) => void;
16
+ onBlur?: () => void;
17
+ }
@@ -0,0 +1,3 @@
1
+ import "./types/i18next.d.ts"
2
+ export { MultiSelectComboBox } from './MultiSelectComboBox';
3
+ export type { MultiSelectComboBoxProps, MultiSelectComboBoxOption, } from './MultiSelectComboBoxTypes';
@@ -22,5 +22,6 @@ export { DocumentViewer } from './DocumentViewer';
22
22
  export { DatePickerField } from './Fields/DatePickerField';
23
23
  export { NumberInputField } from './Fields/NumberInputField';
24
24
  export { SwitchField } from './Fields/SwitchField';
25
+ export { MultiSelectComboBoxField } from './Fields/MultiSelectComboBoxField';
25
26
  export { VisuallyHidden } from './VisuallyHidden';
26
27
  export { HamburgerMenu } from './HamburgerMenu';
@@ -4,38 +4,12 @@ export declare const generateCreateSignatorySchema: (hasSsn?: boolean) => z.ZodO
4
4
  lastName: z.ZodString;
5
5
  email: z.ZodString;
6
6
  title: z.ZodString;
7
- phone: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
8
- ssn: z.ZodEffects<z.ZodString, string, string>;
7
+ phone: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
8
+ ssn: z.ZodString;
9
9
  birthday: z.ZodDate;
10
10
  street1: z.ZodString;
11
11
  street2: z.ZodOptional<z.ZodString>;
12
12
  city: z.ZodString;
13
13
  state: z.ZodString;
14
- zip: z.ZodEffects<z.ZodString, string, string>;
15
- }, "strip", z.ZodTypeAny, {
16
- ssn: string;
17
- title: string;
18
- email: string;
19
- firstName: string;
20
- lastName: string;
21
- phone: string;
22
- street1: string;
23
- city: string;
24
- state: string;
25
- zip: string;
26
- birthday: Date;
27
- street2?: string | undefined;
28
- }, {
29
- ssn: string;
30
- title: string;
31
- email: string;
32
- firstName: string;
33
- lastName: string;
34
- phone: string;
35
- street1: string;
36
- city: string;
37
- state: string;
38
- zip: string;
39
- birthday: Date;
40
- street2?: string | undefined;
41
- }>;
14
+ zip: z.ZodString;
15
+ }, z.core.$strip>;
@@ -1,34 +1,10 @@
1
1
  import { z } from 'zod';
2
- export declare const InviteSignatorySchema: z.ZodEffects<z.ZodObject<{
2
+ export declare const InviteSignatorySchema: z.ZodObject<{
3
3
  firstName: z.ZodString;
4
4
  lastName: z.ZodString;
5
5
  email: z.ZodString;
6
6
  confirmEmail: z.ZodString;
7
7
  title: z.ZodString;
8
- }, "strip", z.ZodTypeAny, {
9
- title: string;
10
- email: string;
11
- firstName: string;
12
- lastName: string;
13
- confirmEmail: string;
14
- }, {
15
- title: string;
16
- email: string;
17
- firstName: string;
18
- lastName: string;
19
- confirmEmail: string;
20
- }>, {
21
- title: string;
22
- email: string;
23
- firstName: string;
24
- lastName: string;
25
- confirmEmail: string;
26
- }, {
27
- title: string;
28
- email: string;
29
- firstName: string;
30
- lastName: string;
31
- confirmEmail: string;
32
- }>;
8
+ }, z.core.$strip>;
33
9
  export type InviteSignatoryInputs = z.infer<typeof InviteSignatorySchema>;
34
10
  export declare const InviteSignatoryForm: () => import("react/jsx-runtime").JSX.Element;
@@ -2,12 +2,6 @@ import { z } from 'zod';
2
2
  export declare const BankAccountFormSchema: z.ZodObject<{
3
3
  routingNumber: z.ZodString;
4
4
  accountNumber: z.ZodString;
5
- }, "strip", z.ZodTypeAny, {
6
- routingNumber: string;
7
- accountNumber: string;
8
- }, {
9
- routingNumber: string;
10
- accountNumber: string;
11
- }>;
5
+ }, z.core.$strip>;
12
6
  export type BankAccountFormInputs = z.infer<typeof BankAccountFormSchema>;
13
7
  export declare function Form(): import("react/jsx-runtime").JSX.Element;
@@ -2,12 +2,6 @@ import { z } from 'zod';
2
2
  export declare const BankAccountVerifySchema: z.ZodObject<{
3
3
  deposit1: z.ZodNumber;
4
4
  deposit2: z.ZodNumber;
5
- }, "strip", z.ZodTypeAny, {
6
- deposit1: number;
7
- deposit2: number;
8
- }, {
9
- deposit1: number;
10
- deposit2: number;
11
- }>;
5
+ }, z.core.$strip>;
12
6
  export type BankAccountVerifyInputs = z.infer<typeof BankAccountVerifySchema>;
13
7
  export declare function Form(): import("react/jsx-runtime").JSX.Element;
@@ -3,20 +3,14 @@ import { FederalTaxDetails } from '@gusto/embedded-api/models/components/federal
3
3
  import { RequireAtLeastOne } from '../../../types/Helpers';
4
4
  export declare const FederalTaxFormSchema: z.ZodObject<{
5
5
  federalEin: z.ZodOptional<z.ZodString>;
6
- taxPayerType: z.ZodOptional<z.ZodEnum<[string, ...string[]]>>;
7
- filingForm: z.ZodOptional<z.ZodEnum<[string, ...string[]]>>;
6
+ taxPayerType: z.ZodOptional<z.ZodEnum<{
7
+ [x: string]: string;
8
+ }>>;
9
+ filingForm: z.ZodOptional<z.ZodEnum<{
10
+ [x: string]: string;
11
+ }>>;
8
12
  legalName: z.ZodString;
9
- }, "strip", z.ZodTypeAny, {
10
- legalName: string;
11
- taxPayerType?: string | undefined;
12
- filingForm?: string | undefined;
13
- federalEin?: string | undefined;
14
- }, {
15
- legalName: string;
16
- taxPayerType?: string | undefined;
17
- filingForm?: string | undefined;
18
- federalEin?: string | undefined;
19
- }>;
13
+ }, z.core.$strip>;
20
14
  export type FederalTaxFormInputs = z.input<typeof FederalTaxFormSchema>;
21
15
  export type FederalTaxesDefaultValues = RequireAtLeastOne<{
22
16
  taxPayerType?: FederalTaxFormInputs['taxPayerType'];