@kanda-libs/ks-component-ts 0.3.103 → 0.3.105

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/library.css CHANGED
@@ -803,6 +803,12 @@ input[type="number"]::-webkit-inner-spin-button,
803
803
  line-height: 20px;
804
804
  }
805
805
 
806
+ .text-16-18-em {
807
+ font-weight: 600;
808
+ font-size: 16px;
809
+ line-height: 18px;
810
+ }
811
+
806
812
  .text-16-18 {
807
813
  font-weight: 400;
808
814
  font-size: 16px;
@@ -3056,6 +3062,12 @@ input[type="number"]::-webkit-inner-spin-button,
3056
3062
  opacity: 0.95;
3057
3063
  }
3058
3064
 
3065
+ .shadow-lg {
3066
+ --tw-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
3067
+ --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);
3068
+ box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
3069
+ }
3070
+
3059
3071
  .shadow-card {
3060
3072
  --tw-shadow: 0px 4px 8px 0px #0C1B3A0D;
3061
3073
  --tw-shadow-colored: 0px 4px 8px 0px var(--tw-shadow-color);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kanda-libs/ks-component-ts",
3
- "version": "0.3.103",
3
+ "version": "0.3.105",
4
4
  "description": "Kanda form component library",
5
5
  "main": "dist/index.esm.js",
6
6
  "module": "dist/index.esm.js",
@@ -366,6 +366,31 @@ const PERCENTAGE_INCREMENT_THEME = {
366
366
  },
367
367
  };
368
368
 
369
+ const CHECKOUT_THEME = {
370
+ fieldWrapper: "Default" as FieldWrapperType,
371
+ baseClasses:
372
+ "rounded-lg flex w-full bg-neutral-000 border-2 border-neutral-300 caret-turquoise-300 shadow-lg",
373
+ inputClasses: "text-16-18-em text-neutral-900 placeholder-neutral-600",
374
+ focusClasses: "border-solid focus:border-turquoise-300",
375
+ focusWithinClasses:
376
+ "border-solid focus-within:outline-none focus-within:border-turquoise-300",
377
+ paddingClasses: "px-3 py-4",
378
+ skeletonClasses: "w-2/6",
379
+ chevronClasses:
380
+ "appearance-none bg-select-chevron focus:bg-select-chevron-active bg-no-repeat bg-right-2 invalid:text-neutral-400 overflow-hidden !pr-7",
381
+ themeIconVariant: "dark",
382
+ makeErrorClasses: (error?: string) =>
383
+ error ? "border-solid border border-red-200" : "",
384
+ wrapperClasses: {
385
+ baseContainer: "flex flex-col mb-5 text-left",
386
+ error: "mt-2 text-12-18 text-red-200",
387
+ warning: "mt-2 text-12-18 text-neutral-700",
388
+ label: "text-12-18-em text-neutral-700",
389
+ helperText: "whitespace-nowrap text-12-18 text-neutral-500",
390
+ },
391
+ buttonClasses: "mt-2 mr-2",
392
+ };
393
+
369
394
  enum Variants {
370
395
  DEFAULT = "default",
371
396
  BORDERED = "bordered",
@@ -385,6 +410,7 @@ enum Variants {
385
410
  STREAMLINE = "streamline",
386
411
  STREAMLINE_INLINE = "streamline-inline",
387
412
  PERCENTAGE_INCREMENT = "percentage-increment",
413
+ CHECKOUT = "checkout",
388
414
  }
389
415
 
390
416
  export const VARIANTS: StringIndexedObject<string> = {
@@ -406,6 +432,7 @@ export const VARIANTS: StringIndexedObject<string> = {
406
432
  STREAMLINE: Variants.STREAMLINE,
407
433
  STREAMLINE_INLINE: Variants.STREAMLINE_INLINE,
408
434
  PERCENTAGE_INCREMENT: Variants.PERCENTAGE_INCREMENT,
435
+ CHECKOUT: Variants.CHECKOUT,
409
436
  };
410
437
 
411
438
  export const FORM_THEME_VARIANTS: StringIndexedObject<Theme> = {
@@ -427,4 +454,5 @@ export const FORM_THEME_VARIANTS: StringIndexedObject<Theme> = {
427
454
  [VARIANTS.STREAMLINE]: STREAMLINE_THEME,
428
455
  [VARIANTS.STREAMLINE_INLINE]: STREAMLINE_INLINE_THEME,
429
456
  [VARIANTS.PERCENTAGE_INCREMENT]: PERCENTAGE_INCREMENT_THEME,
457
+ [VARIANTS.CHECKOUT]: CHECKOUT_THEME,
430
458
  };
@@ -0,0 +1,24 @@
1
+ import * as t from "io-ts";
2
+
3
+ export const CheckoutStep = t.union([
4
+ t.literal("checkout_quote_viewed"),
5
+ t.literal("checkout_quote_accepted"),
6
+ t.literal("checkout_quote_changes_requested"),
7
+ t.literal("checkout_quote_changes_amended"),
8
+ t.literal("checkout_quote_changes_rejected"),
9
+ t.literal("checkout_quote_declined"),
10
+ t.literal("checkout_quote_payment_selected"),
11
+ t.literal("checkout_quote_finalised"),
12
+ t.literal("checkout_quote_completed"),
13
+ ]);
14
+
15
+ export type CheckoutStep =
16
+ | "checkout_quote_viewed"
17
+ | "checkout_quote_accepted"
18
+ | "checkout_quote_changes_requested"
19
+ | "checkout_quote_changes_amended"
20
+ | "checkout_quote_changes_rejected"
21
+ | "checkout_quote_declined"
22
+ | "checkout_quote_payment_selected"
23
+ | "checkout_quote_finalised"
24
+ | "checkout_quote_completed";
@@ -12,6 +12,7 @@ export const CustomerOptions = t.intersection([
12
12
  t.partial({
13
13
  deposit_value: Money,
14
14
  agree_commission_terms: Signature,
15
+ declined_reason: t.string,
15
16
  }),
16
17
  ]);
17
18
 
@@ -20,4 +21,5 @@ export interface CustomerOptions {
20
21
  finance_option: FinanceRate;
21
22
  deposit_value?: Money;
22
23
  agree_commission_terms?: Signature;
24
+ declined_reason?: string;
23
25
  }
@@ -8,6 +8,7 @@ import { FinanceRate } from "./FinanceRate";
8
8
  import { FinanceStatus } from "./FinanceStatus";
9
9
  import { FlowType } from "./FlowType";
10
10
  import { JobItem } from "./JobItem";
11
+ import { JobStep } from "./JobStep";
11
12
  import { Metadata } from "./Metadata";
12
13
  import { Metarefs } from "./Metarefs";
13
14
  import { Money } from "./Money";
@@ -62,6 +63,8 @@ export const Job = t.intersection([
62
63
  quoted_to: t.string,
63
64
  introduced_to: t.string,
64
65
  job_documents: t.array(Document),
66
+ current_step: JobStep,
67
+ steps: t.array(JobStep),
65
68
  xid: t.string,
66
69
  xref: t.string,
67
70
  redirect_urls: RedirectURLs,
@@ -101,6 +104,8 @@ export interface Job {
101
104
  quoted_to?: string;
102
105
  introduced_to?: string;
103
106
  job_documents?: Array<Document>;
107
+ current_step?: JobStep;
108
+ steps?: Array<JobStep>;
104
109
  xid?: string;
105
110
  xref?: string;
106
111
  redirect_urls?: RedirectURLs;
@@ -0,0 +1,19 @@
1
+ import * as t from "io-ts";
2
+ import { DateFromISOString } from "io-ts-types";
3
+ import { CheckoutStep } from "./CheckoutStep";
4
+
5
+ export const JobStep = t.intersection([
6
+ t.type({
7
+ name: CheckoutStep,
8
+ appended_at: DateFromISOString,
9
+ }),
10
+ t.partial({
11
+ text: t.string,
12
+ }),
13
+ ]);
14
+
15
+ export interface JobStep {
16
+ name: CheckoutStep;
17
+ text?: string;
18
+ appended_at: Date;
19
+ }
@@ -21,6 +21,7 @@ export * from "./Campaign";
21
21
  export * from "./CampaignEvent";
22
22
  export * from "./Category";
23
23
  export * from "./CheckoutOption";
24
+ export * from "./CheckoutStep";
24
25
  export * from "./CommContext";
25
26
  export * from "./CommExtras";
26
27
  export * from "./CommPreferences";
@@ -106,6 +107,7 @@ export * from "./JobDetails";
106
107
  export * from "./JobInfo";
107
108
  export * from "./JobItem";
108
109
  export * from "./JobOverride";
110
+ export * from "./JobStep";
109
111
  export * from "./KagentChat";
110
112
  export * from "./KagentChatRequest";
111
113
  export * from "./KagentMessage";
@@ -661,6 +661,10 @@ import {
661
661
  } from "./quoteCredit";
662
662
  import { quoteJobOperation, QuoteJobRequestFunction } from "./quoteJob";
663
663
  import { quoteLeadOperation, QuoteLeadRequestFunction } from "./quoteLead";
664
+ import {
665
+ reactivateCompanyOperation,
666
+ ReactivateCompanyRequestFunction,
667
+ } from "./reactivateCompany";
664
668
  import { reapplyJobOperation, ReapplyJobRequestFunction } from "./reapplyJob";
665
669
  import { referLeadOperation, ReferLeadRequestFunction } from "./referLead";
666
670
  import { resendJobOperation, ResendJobRequestFunction } from "./resendJob";
@@ -675,10 +679,15 @@ import {
675
679
  signJobSatNoteOperation,
676
680
  SignJobSatNoteRequestFunction,
677
681
  } from "./signJobSatNote";
682
+ import { stepJobOperation, StepJobRequestFunction } from "./stepJob";
678
683
  import {
679
684
  submitIntroductionStateOperation,
680
685
  SubmitIntroductionStateRequestFunction,
681
686
  } from "./submitIntroductionState";
687
+ import {
688
+ suspendCompanyOperation,
689
+ SuspendCompanyRequestFunction,
690
+ } from "./suspendCompany";
682
691
  import { tradeLeadOperation, TradeLeadRequestFunction } from "./tradeLead";
683
692
  import {
684
693
  tradeQuoteApprovalLeadOperation,
@@ -792,6 +801,8 @@ export const operations: Operations = {
792
801
  directorCompany: directorCompanyOperation,
793
802
  getCompanyReferrals: getCompanyReferralsOperation,
794
803
  postCompanyReferrals: postCompanyReferralsOperation,
804
+ suspendCompany: suspendCompanyOperation,
805
+ reactivateCompany: reactivateCompanyOperation,
795
806
  approveCompany: approveCompanyOperation,
796
807
  declineCompany: declineCompanyOperation,
797
808
  exportFcaApproved: exportFcaApprovedOperation,
@@ -807,6 +818,7 @@ export const operations: Operations = {
807
818
  completeJob: completeJobOperation,
808
819
  archiveJob: archiveJobOperation,
809
820
  unarchiveJob: unarchiveJobOperation,
821
+ stepJob: stepJobOperation,
810
822
  quoteJob: quoteJobOperation,
811
823
  applyJob: applyJobOperation,
812
824
  reapplyJob: reapplyJobOperation,
@@ -1020,6 +1032,8 @@ export interface OperationRequestFunctionMap {
1020
1032
  directorCompany: DirectorCompanyRequestFunction;
1021
1033
  getCompanyReferrals: GetCompanyReferralsRequestFunction;
1022
1034
  postCompanyReferrals: PostCompanyReferralsRequestFunction;
1035
+ suspendCompany: SuspendCompanyRequestFunction;
1036
+ reactivateCompany: ReactivateCompanyRequestFunction;
1023
1037
  approveCompany: ApproveCompanyRequestFunction;
1024
1038
  declineCompany: DeclineCompanyRequestFunction;
1025
1039
  exportFcaApproved: ExportFcaApprovedRequestFunction;
@@ -1035,6 +1049,7 @@ export interface OperationRequestFunctionMap {
1035
1049
  completeJob: CompleteJobRequestFunction;
1036
1050
  archiveJob: ArchiveJobRequestFunction;
1037
1051
  unarchiveJob: UnarchiveJobRequestFunction;
1052
+ stepJob: StepJobRequestFunction;
1038
1053
  quoteJob: QuoteJobRequestFunction;
1039
1054
  applyJob: ApplyJobRequestFunction;
1040
1055
  reapplyJob: ReapplyJobRequestFunction;
@@ -1436,6 +1451,14 @@ export const requestFunctionsBuilder = (
1436
1451
  operations.postCompanyReferrals,
1437
1452
  requestAdapter
1438
1453
  ),
1454
+ suspendCompany: requestFunctionBuilder(
1455
+ operations.suspendCompany,
1456
+ requestAdapter
1457
+ ),
1458
+ reactivateCompany: requestFunctionBuilder(
1459
+ operations.reactivateCompany,
1460
+ requestAdapter
1461
+ ),
1439
1462
  approveCompany: requestFunctionBuilder(
1440
1463
  operations.approveCompany,
1441
1464
  requestAdapter
@@ -1463,6 +1486,7 @@ export const requestFunctionsBuilder = (
1463
1486
  completeJob: requestFunctionBuilder(operations.completeJob, requestAdapter),
1464
1487
  archiveJob: requestFunctionBuilder(operations.archiveJob, requestAdapter),
1465
1488
  unarchiveJob: requestFunctionBuilder(operations.unarchiveJob, requestAdapter),
1489
+ stepJob: requestFunctionBuilder(operations.stepJob, requestAdapter),
1466
1490
  quoteJob: requestFunctionBuilder(operations.quoteJob, requestAdapter),
1467
1491
  applyJob: requestFunctionBuilder(operations.applyJob, requestAdapter),
1468
1492
  reapplyJob: requestFunctionBuilder(operations.reapplyJob, requestAdapter),
@@ -1815,6 +1839,7 @@ export const jobServiceBuilder = (
1815
1839
  completeJob: requestFunctions.completeJob,
1816
1840
  archiveJob: requestFunctions.archiveJob,
1817
1841
  unarchiveJob: requestFunctions.unarchiveJob,
1842
+ stepJob: requestFunctions.stepJob,
1818
1843
  quoteJob: requestFunctions.quoteJob,
1819
1844
  applyJob: requestFunctions.applyJob,
1820
1845
  reapplyJob: requestFunctions.reapplyJob,
@@ -2054,6 +2079,8 @@ export const companyServiceBuilder = (
2054
2079
  directorCompany: requestFunctions.directorCompany,
2055
2080
  getCompanyReferrals: requestFunctions.getCompanyReferrals,
2056
2081
  postCompanyReferrals: requestFunctions.postCompanyReferrals,
2082
+ suspendCompany: requestFunctions.suspendCompany,
2083
+ reactivateCompany: requestFunctions.reactivateCompany,
2057
2084
  approveCompany: requestFunctions.approveCompany,
2058
2085
  declineCompany: requestFunctions.declineCompany,
2059
2086
  exportFcaApproved: requestFunctions.exportFcaApproved,
@@ -2315,6 +2342,8 @@ export interface Operations {
2315
2342
  directorCompany: typeof directorCompanyOperation;
2316
2343
  getCompanyReferrals: typeof getCompanyReferralsOperation;
2317
2344
  postCompanyReferrals: typeof postCompanyReferralsOperation;
2345
+ suspendCompany: typeof suspendCompanyOperation;
2346
+ reactivateCompany: typeof reactivateCompanyOperation;
2318
2347
  approveCompany: typeof approveCompanyOperation;
2319
2348
  declineCompany: typeof declineCompanyOperation;
2320
2349
  exportFcaApproved: typeof exportFcaApprovedOperation;
@@ -2330,6 +2359,7 @@ export interface Operations {
2330
2359
  completeJob: typeof completeJobOperation;
2331
2360
  archiveJob: typeof archiveJobOperation;
2332
2361
  unarchiveJob: typeof unarchiveJobOperation;
2362
+ stepJob: typeof stepJobOperation;
2333
2363
  quoteJob: typeof quoteJobOperation;
2334
2364
  applyJob: typeof applyJobOperation;
2335
2365
  reapplyJob: typeof reapplyJobOperation;
@@ -0,0 +1,29 @@
1
+ import type { RequestFunction } from "@kanda-libs/openapi-io-ts-runtime";
2
+ import * as schemas from "../components/schemas";
3
+
4
+ export type ReactivateCompanyRequestParameters = {
5
+ id: string;
6
+ };
7
+
8
+ export const reactivateCompanyOperation = {
9
+ path: "/api/company/{id}/reactivate",
10
+ method: "post",
11
+ responses: {
12
+ "200": { _tag: "JsonResponse", decoder: schemas.Company },
13
+ default: { _tag: "JsonResponse", decoder: schemas.Error },
14
+ },
15
+ parameters: [
16
+ {
17
+ _tag: "FormParameter",
18
+ explode: false,
19
+ in: "path",
20
+ name: "id",
21
+ },
22
+ ],
23
+ requestDefaultHeaders: { Accept: "application/json" },
24
+ } as const;
25
+
26
+ export type ReactivateCompanyRequestFunction = RequestFunction<
27
+ { params: ReactivateCompanyRequestParameters },
28
+ schemas.Company
29
+ >;
@@ -0,0 +1,35 @@
1
+ import type { RequestFunction } from "@kanda-libs/openapi-io-ts-runtime";
2
+ import * as schemas from "../components/schemas";
3
+
4
+ export type StepJobRequestParameters = {
5
+ id: string;
6
+ };
7
+
8
+ export const stepJobOperation = {
9
+ path: "/api/job/{id}/step",
10
+ method: "post",
11
+ responses: {
12
+ "200": { _tag: "JsonResponse", decoder: schemas.Job },
13
+ default: { _tag: "JsonResponse", decoder: schemas.Error },
14
+ },
15
+ parameters: [
16
+ {
17
+ _tag: "FormParameter",
18
+ explode: false,
19
+ in: "path",
20
+ name: "id",
21
+ },
22
+ ],
23
+ requestDefaultHeaders: {
24
+ "Content-Type": "application/json",
25
+ Accept: "application/json",
26
+ },
27
+ body: {
28
+ _tag: "JsonBody",
29
+ },
30
+ } as const;
31
+
32
+ export type StepJobRequestFunction = RequestFunction<
33
+ { params: StepJobRequestParameters; body: schemas.JobStep },
34
+ schemas.Job
35
+ >;
@@ -0,0 +1,29 @@
1
+ import type { RequestFunction } from "@kanda-libs/openapi-io-ts-runtime";
2
+ import * as schemas from "../components/schemas";
3
+
4
+ export type SuspendCompanyRequestParameters = {
5
+ id: string;
6
+ };
7
+
8
+ export const suspendCompanyOperation = {
9
+ path: "/api/company/{id}/suspend",
10
+ method: "post",
11
+ responses: {
12
+ "200": { _tag: "JsonResponse", decoder: schemas.Company },
13
+ default: { _tag: "JsonResponse", decoder: schemas.Error },
14
+ },
15
+ parameters: [
16
+ {
17
+ _tag: "FormParameter",
18
+ explode: false,
19
+ in: "path",
20
+ name: "id",
21
+ },
22
+ ],
23
+ requestDefaultHeaders: { Accept: "application/json" },
24
+ } as const;
25
+
26
+ export type SuspendCompanyRequestFunction = RequestFunction<
27
+ { params: SuspendCompanyRequestParameters },
28
+ schemas.Company
29
+ >;