@invoice-sdk/widget 0.0.0 → 1.0.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 (79) hide show
  1. package/dist/App.d.ts +4 -0
  2. package/dist/App.d.ts.map +1 -0
  3. package/dist/components/button.d.ts +10 -0
  4. package/dist/components/button.d.ts.map +1 -0
  5. package/dist/components/layout.d.ts +4 -0
  6. package/dist/components/layout.d.ts.map +1 -0
  7. package/dist/components/payment/checkout.d.ts +3 -0
  8. package/dist/components/payment/checkout.d.ts.map +1 -0
  9. package/dist/components/payment/order-info.d.ts +3 -0
  10. package/dist/components/payment/order-info.d.ts.map +1 -0
  11. package/dist/components/payment/qr-payment.d.ts +19 -0
  12. package/dist/components/payment/qr-payment.d.ts.map +1 -0
  13. package/dist/components/register-form/custom-checkbox.d.ts +7 -0
  14. package/dist/components/register-form/custom-checkbox.d.ts.map +1 -0
  15. package/dist/components/register-form/file-upload.d.ts +10 -0
  16. package/dist/components/register-form/file-upload.d.ts.map +1 -0
  17. package/dist/components/register-form/index.d.ts +63 -0
  18. package/dist/components/register-form/index.d.ts.map +1 -0
  19. package/dist/components/register-form/input-field.d.ts +7 -0
  20. package/dist/components/register-form/input-field.d.ts.map +1 -0
  21. package/dist/components/register-form/select-filed.d.ts +14 -0
  22. package/dist/components/register-form/select-filed.d.ts.map +1 -0
  23. package/dist/components/register-form/select-option.d.ts +13 -0
  24. package/dist/components/register-form/select-option.d.ts.map +1 -0
  25. package/dist/components/register-form/select-provider.d.ts +3 -0
  26. package/dist/components/register-form/select-provider.d.ts.map +1 -0
  27. package/dist/components/select-plan/package-selector.d.ts +9 -0
  28. package/dist/components/select-plan/package-selector.d.ts.map +1 -0
  29. package/dist/components/select-plan/search-field.d.ts +7 -0
  30. package/dist/components/select-plan/search-field.d.ts.map +1 -0
  31. package/dist/components/wizard-progress.d.ts +10 -0
  32. package/dist/components/wizard-progress.d.ts.map +1 -0
  33. package/dist/index.cjs.js +124 -0
  34. package/dist/index.d.ts +3 -0
  35. package/dist/index.d.ts.map +1 -0
  36. package/dist/index.es.js +5694 -0
  37. package/dist/lib/constants/index.d.ts +9 -0
  38. package/dist/lib/constants/index.d.ts.map +1 -0
  39. package/dist/main.d.ts +2 -0
  40. package/dist/main.d.ts.map +1 -0
  41. package/dist/pages/payment.d.ts +3 -0
  42. package/dist/pages/payment.d.ts.map +1 -0
  43. package/dist/pages/plan.d.ts +3 -0
  44. package/dist/pages/plan.d.ts.map +1 -0
  45. package/dist/pages/register.d.ts +3 -0
  46. package/dist/pages/register.d.ts.map +1 -0
  47. package/dist/store/process.d.ts +10 -0
  48. package/dist/store/process.d.ts.map +1 -0
  49. package/dist/store/register.d.ts +41 -0
  50. package/dist/store/register.d.ts.map +1 -0
  51. package/dist/tsconfig.tsbuildinfo +1 -0
  52. package/dist/widget.css +1 -0
  53. package/package.json +30 -13
  54. package/eslint.config.js +0 -28
  55. package/index.html +0 -13
  56. package/src/App.css +0 -1
  57. package/src/App.tsx +0 -40
  58. package/src/assets/react.svg +0 -1
  59. package/src/components/button.tsx +0 -23
  60. package/src/components/form/custom-checkbox.tsx +0 -20
  61. package/src/components/form/file-upload.tsx +0 -141
  62. package/src/components/form/input-field.tsx +0 -35
  63. package/src/components/form/select-option.tsx +0 -74
  64. package/src/components/layout.tsx +0 -14
  65. package/src/components/process.tsx +0 -21
  66. package/src/index.css +0 -2
  67. package/src/index.ts +0 -2
  68. package/src/main.tsx +0 -10
  69. package/src/pages/register.tsx +0 -222
  70. package/src/pages/select-plan.tsx +0 -39
  71. package/src/pages/select-provider.tsx +0 -74
  72. package/src/pages/status.tsx +0 -9
  73. package/src/store/process.ts +0 -18
  74. package/src/store/register.ts +0 -60
  75. package/src/vite-env.d.ts +0 -1
  76. package/tsconfig.json +0 -19
  77. package/tsconfig.tsbuildinfo +0 -1
  78. package/vite.config.ts +0 -46
  79. /package/{public → dist}/vite.svg +0 -0
package/dist/App.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ import './App.css';
2
+ declare function InvoiceRegisterWidget(): import("react/jsx-runtime").JSX.Element;
3
+ export default InvoiceRegisterWidget;
4
+ //# sourceMappingURL=App.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../src/App.tsx"],"names":[],"mappings":"AAAA,OAAO,WAAW,CAAC;AAOnB,iBAAS,qBAAqB,4CAiB7B;AAED,eAAe,qBAAqB,CAAA"}
@@ -0,0 +1,10 @@
1
+ type Props = {
2
+ title: string;
3
+ isDisabled?: boolean;
4
+ handleClick?: () => void;
5
+ type?: 'submit' | 'button';
6
+ className?: string;
7
+ };
8
+ declare const Button: (props: Props) => import("react/jsx-runtime").JSX.Element;
9
+ export default Button;
10
+ //# sourceMappingURL=button.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/components/button.tsx"],"names":[],"mappings":"AACA,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,WAAW,CAAC,EAAE,MAAM,IAAI,CAAA;IACxB,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAA;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,QAAA,MAAM,MAAM,GAAI,OAAO,KAAK,4CAW3B,CAAA;AAED,eAAe,MAAM,CAAA"}
@@ -0,0 +1,4 @@
1
+ import { PropsWithChildren } from "react";
2
+ declare const MainLayout: ({ children }: PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
3
+ export default MainLayout;
4
+ //# sourceMappingURL=layout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../src/components/layout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAK1C,QAAA,MAAM,UAAU,GAAI,cAAa,iBAAiB,4CAmBjD,CAAA;AAED,eAAe,UAAU,CAAA"}
@@ -0,0 +1,3 @@
1
+ declare const Checkout: () => import("react/jsx-runtime").JSX.Element;
2
+ export default Checkout;
3
+ //# sourceMappingURL=checkout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkout.d.ts","sourceRoot":"","sources":["../../../src/components/payment/checkout.tsx"],"names":[],"mappings":"AA6BA,QAAA,MAAM,QAAQ,+CAYb,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,3 @@
1
+ declare const OrderInfo: () => import("react/jsx-runtime").JSX.Element;
2
+ export default OrderInfo;
3
+ //# sourceMappingURL=order-info.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"order-info.d.ts","sourceRoot":"","sources":["../../../src/components/payment/order-info.tsx"],"names":[],"mappings":"AAGA,QAAA,MAAM,SAAS,+CAmEd,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -0,0 +1,19 @@
1
+ interface QRPaymentProps {
2
+ /** URL or import path to the QR code image */
3
+ qrSrc: string;
4
+ /** Array of URLs/paths for the bank/e‐wallet logos (displayed in a row) */
5
+ logos: string[];
6
+ /** Displayed under the QR code—for example “ATOM SOLUTION” */
7
+ accountName: string;
8
+ /** The account number (e.g. “0973886570”) */
9
+ accountNumber: string;
10
+ /** The beneficiary bank name (e.g. “Techcombank”) */
11
+ bankName: string;
12
+ /** Array of instruction steps (strings). Exactly 3 items in your screenshot. */
13
+ instructions: string[];
14
+ /** URL or import path to the illustration image on the right */
15
+ illustrationSrc: string;
16
+ }
17
+ declare const QRPayment: ({ qrSrc, logos, accountName, accountNumber, bankName, instructions, illustrationSrc, }: QRPaymentProps) => import("react/jsx-runtime").JSX.Element;
18
+ export default QRPayment;
19
+ //# sourceMappingURL=qr-payment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qr-payment.d.ts","sourceRoot":"","sources":["../../../src/components/payment/qr-payment.tsx"],"names":[],"mappings":"AAEA,UAAU,cAAc;IACtB,8CAA8C;IAC9C,KAAK,EAAE,MAAM,CAAC;IACd,2EAA2E;IAC3E,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,8DAA8D;IAC9D,WAAW,EAAE,MAAM,CAAC;IACpB,6CAA6C;IAC7C,aAAa,EAAE,MAAM,CAAC;IACtB,qDAAqD;IACrD,QAAQ,EAAE,MAAM,CAAC;IACjB,gFAAgF;IAChF,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,gEAAgE;IAChE,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,QAAA,MAAM,SAAS,GAAI,wFAQhB,cAAc,4CAgFhB,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -0,0 +1,7 @@
1
+ type Props = {
2
+ checked: boolean;
3
+ setChecked: (checked: boolean) => void;
4
+ };
5
+ declare const CustomCheckbox: ({ checked, setChecked }: Props) => import("react/jsx-runtime").JSX.Element;
6
+ export default CustomCheckbox;
7
+ //# sourceMappingURL=custom-checkbox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"custom-checkbox.d.ts","sourceRoot":"","sources":["../../../src/components/register-form/custom-checkbox.tsx"],"names":[],"mappings":"AAAA,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;CACxC,CAAC;AACF,QAAA,MAAM,cAAc,GAAI,yBAAyB,KAAK,4CAarD,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -0,0 +1,10 @@
1
+ type FileUploadProps = {
2
+ label: string;
3
+ required?: boolean;
4
+ file: File | null;
5
+ onFileChange: (file: File) => void;
6
+ error?: string;
7
+ };
8
+ declare const FileUpload: React.FC<FileUploadProps>;
9
+ export default FileUpload;
10
+ //# sourceMappingURL=file-upload.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-upload.d.ts","sourceRoot":"","sources":["../../../src/components/register-form/file-upload.tsx"],"names":[],"mappings":"AASA,KAAK,eAAe,GAAG;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,YAAY,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAcF,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAsNzC,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,63 @@
1
+ import z from "zod";
2
+ declare const formSchema: z.ZodObject<{
3
+ taxCode: z.ZodString;
4
+ representative: z.ZodString;
5
+ email: z.ZodString;
6
+ address: z.ZodObject<{
7
+ country: z.ZodOptional<z.ZodString>;
8
+ province: z.ZodOptional<z.ZodString>;
9
+ district: z.ZodOptional<z.ZodString>;
10
+ ward: z.ZodOptional<z.ZodString>;
11
+ detail: z.ZodOptional<z.ZodString>;
12
+ }, "strip", z.ZodTypeAny, {
13
+ country?: string | undefined;
14
+ province?: string | undefined;
15
+ district?: string | undefined;
16
+ ward?: string | undefined;
17
+ detail?: string | undefined;
18
+ }, {
19
+ country?: string | undefined;
20
+ province?: string | undefined;
21
+ district?: string | undefined;
22
+ ward?: string | undefined;
23
+ detail?: string | undefined;
24
+ }>;
25
+ companyName: z.ZodOptional<z.ZodString>;
26
+ position: z.ZodOptional<z.ZodString>;
27
+ phone: z.ZodString;
28
+ license: z.ZodType<File, z.ZodTypeDef, File>;
29
+ }, "strip", z.ZodTypeAny, {
30
+ taxCode: string;
31
+ representative: string;
32
+ email: string;
33
+ address: {
34
+ country?: string | undefined;
35
+ province?: string | undefined;
36
+ district?: string | undefined;
37
+ ward?: string | undefined;
38
+ detail?: string | undefined;
39
+ };
40
+ license: File;
41
+ phone: string;
42
+ companyName?: string | undefined;
43
+ position?: string | undefined;
44
+ }, {
45
+ taxCode: string;
46
+ representative: string;
47
+ email: string;
48
+ address: {
49
+ country?: string | undefined;
50
+ province?: string | undefined;
51
+ district?: string | undefined;
52
+ ward?: string | undefined;
53
+ detail?: string | undefined;
54
+ };
55
+ license: File;
56
+ phone: string;
57
+ companyName?: string | undefined;
58
+ position?: string | undefined;
59
+ }>;
60
+ export type FormValues = z.infer<typeof formSchema>;
61
+ declare const RegistrationForm: () => import("react/jsx-runtime").JSX.Element;
62
+ export default RegistrationForm;
63
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/register-form/index.tsx"],"names":[],"mappings":"AAIA,OAAO,CAAC,MAAM,KAAK,CAAC;AAepB,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqBd,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAEpD,QAAA,MAAM,gBAAgB,+CA4RrB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,7 @@
1
+ declare const InputField: import("react").ForwardRefExoticComponent<{
2
+ label: string;
3
+ required?: boolean;
4
+ error?: string;
5
+ } & import("react").InputHTMLAttributes<HTMLInputElement> & import("react").RefAttributes<HTMLInputElement>>;
6
+ export default InputField;
7
+ //# sourceMappingURL=input-field.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input-field.d.ts","sourceRoot":"","sources":["../../../src/components/register-form/input-field.tsx"],"names":[],"mappings":"AAQA,QAAA,MAAM,UAAU;WALP,MAAM;eACF,OAAO;YACV,MAAM;4GA0Bf,CAAC;AAGF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { Option } from "@/lib/constants/index";
2
+ import React from "react";
3
+ export interface SelectFieldProps extends React.SelectHTMLAttributes<HTMLSelectElement> {
4
+ /** Label that appears above the select */
5
+ label: string;
6
+ /** If true, show a red asterisk next to label */
7
+ /** Validation error message (displayed below select) */
8
+ error?: string;
9
+ /** The list of options to render inside <select> */
10
+ options: Option[];
11
+ }
12
+ declare const SelectField: React.ForwardRefExoticComponent<SelectFieldProps & React.RefAttributes<HTMLSelectElement>>;
13
+ export default SelectField;
14
+ //# sourceMappingURL=select-filed.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"select-filed.d.ts","sourceRoot":"","sources":["../../../src/components/register-form/select-filed.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,KAAqB,MAAM,OAAO,CAAC;AAE1C,MAAM,WAAW,gBACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC;IACrD,0CAA0C;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,iDAAiD;IAEjD,wDAAwD;IACxD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oDAAoD;IACpD,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,QAAA,MAAM,WAAW,4FA8ChB,CAAC;AAGF,eAAe,WAAW,CAAC"}
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ type Option = {
3
+ value: string;
4
+ label: string;
5
+ };
6
+ type SubscriptionSelectorProps = {
7
+ options: Option[];
8
+ value: string;
9
+ onChange: (value: string) => void;
10
+ };
11
+ declare const SubscriptionSelector: React.FC<SubscriptionSelectorProps>;
12
+ export default SubscriptionSelector;
13
+ //# sourceMappingURL=select-option.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"select-option.d.ts","sourceRoot":"","sources":["../../../src/components/register-form/select-option.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,KAAK,MAAM,GAAG;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,yBAAyB,GAAG;IAC/B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC,CAAC;AAEF,QAAA,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CA0D7D,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
@@ -0,0 +1,3 @@
1
+ declare const SelectProvider: () => import("react/jsx-runtime").JSX.Element;
2
+ export default SelectProvider;
3
+ //# sourceMappingURL=select-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"select-provider.d.ts","sourceRoot":"","sources":["../../../src/components/register-form/select-provider.tsx"],"names":[],"mappings":"AA4CA,QAAA,MAAM,cAAc,+CAuBnB,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { PackageOption } from "@/store/register";
2
+ type Props = {
3
+ packageOptions: PackageOption[];
4
+ selectedPackageId: string;
5
+ handlePackageSelect: (value: string) => void;
6
+ };
7
+ declare const PackageSelector: (props: Props) => import("react/jsx-runtime").JSX.Element;
8
+ export default PackageSelector;
9
+ //# sourceMappingURL=package-selector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"package-selector.d.ts","sourceRoot":"","sources":["../../../src/components/select-plan/package-selector.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAOjD,KAAK,KAAK,GAAG;IACX,cAAc,EAAE,aAAa,EAAE,CAAC;IAChC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mBAAmB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9C,CAAC;AAEF,QAAA,MAAM,eAAe,GAAI,OAAO,KAAK,4CA0FpC,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -0,0 +1,7 @@
1
+ type Props = {
2
+ value: string;
3
+ handleInputChange: React.ChangeEventHandler<HTMLInputElement> | undefined;
4
+ };
5
+ declare const SearchField: (props: Props) => import("react/jsx-runtime").JSX.Element;
6
+ export default SearchField;
7
+ //# sourceMappingURL=search-field.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search-field.d.ts","sourceRoot":"","sources":["../../../src/components/select-plan/search-field.tsx"],"names":[],"mappings":"AACA,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,MAAM,CAAA;IACb,iBAAiB,EAAE,KAAK,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,GAAG,SAAS,CAAA;CAC1E,CAAA;AAED,QAAA,MAAM,WAAW,GAAI,OAAO,KAAK,4CAqChC,CAAA;AAED,eAAe,WAAW,CAAA"}
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ export interface WizardStep {
3
+ label: string;
4
+ }
5
+ export interface WizardProgressProps {
6
+ steps: WizardStep[];
7
+ currentStep: number;
8
+ }
9
+ export declare const WizardProgress: React.FC<WizardProgressProps>;
10
+ //# sourceMappingURL=wizard-progress.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wizard-progress.d.ts","sourceRoot":"","sources":["../../src/components/wizard-progress.tsx"],"names":[],"mappings":"AACA,OAAO,KAMN,MAAM,OAAO,CAAC;AAEf,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACrB;AACD,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAsJxD,CAAC"}