@powerhousedao/design-system 1.7.2 → 1.9.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.
@@ -1,76 +1,76 @@
1
- import { jsx as t, jsxs as R, Fragment as f } from "react/jsx-runtime";
2
- import { useCallback as $, useMemo as z } from "react";
3
- import { CashBalanceChange as Y } from "../components/table/transactions/cash-balance-change.js";
4
- import { DateTimeLocalInput as _ } from "../../connect/components/date-time-input/date-time-local-input.js";
5
- import { UnitPrice as W } from "../components/table/transactions/unit-price.js";
6
- import { TransactionReference as j } from "../components/table/transactions/transaction-reference.js";
7
- import { FeeTransactionsTable as G } from "../components/table/transactions/fee-transactions-table.js";
8
- import { useEditorContext as H } from "../context/editor-context.js";
9
- import { useModal as Q } from "../components/modal/modal-manager.js";
10
- import { tableNames as y } from "../constants/names.js";
11
- import { feesTransactions as Z, assetGroupTransactions as X, allGroupTransactionTypes as J, groupTransactionTypeLabels as K } from "../constants/transactions.js";
12
- import { makeFixedIncomeOptionLabel as ee } from "../utils/form.js";
13
- import { RWATableSelect as T } from "../components/inputs/select.js";
14
- import { formatDateForDisplay as O } from "../utils/date.js";
15
- import { RWANumberInput as D } from "../components/inputs/number-input.js";
16
- import { RWATableTextInput as p } from "../components/inputs/text-input.js";
17
- import { handleTableDatum as A } from "../utils/table.js";
18
- function fe(L) {
1
+ import { jsxs as F, Fragment as g, jsx as s } from "react/jsx-runtime";
2
+ import { useCallback as D, useMemo as k } from "react";
3
+ import { CashBalanceChange as B } from "../components/table/transactions/cash-balance-change.js";
4
+ import { EntryTimeLabel as $ } from "../components/inputs/entry-time-label.js";
5
+ import { FeeTransactionsTable as z } from "../components/table/transactions/fee-transactions-table.js";
6
+ import { UnitPrice as Y } from "../components/table/transactions/unit-price.js";
7
+ import { TransactionReference as W } from "../components/table/transactions/transaction-reference.js";
8
+ import { useEditorContext as j } from "../context/editor-context.js";
9
+ import { useModal as G } from "../components/modal/modal-manager.js";
10
+ import { tableNames as f } from "../constants/names.js";
11
+ import { feesTransactions as H, assetGroupTransactions as Q, allGroupTransactionTypes as Z, groupTransactionTypeLabels as X } from "../constants/transactions.js";
12
+ import { makeFixedIncomeOptionLabel as J } from "../utils/form.js";
13
+ import { RWATableTextInput as u } from "../components/inputs/text-input.js";
14
+ import { formatDateForDisplay as K } from "../utils/date.js";
15
+ import { RWATableSelect as y } from "../components/inputs/select.js";
16
+ import { RWANumberInput as R } from "../components/inputs/number-input.js";
17
+ import { handleTableDatum as T } from "../utils/table.js";
18
+ function ge(V) {
19
19
  const {
20
- tableName: w,
21
- operation: s,
22
- formState: b,
23
- tableItem: C,
24
- register: v,
25
- watch: P,
26
- control: S
27
- } = L, {
28
- fixedIncomeTypes: M,
29
- spvs: x,
30
- serviceProviderFeeTypes: E,
31
- accounts: q,
32
- fixedIncomes: N
33
- } = H(), { showModal: F } = Q(), g = $(
34
- (e) => () => {
35
- F("createItem", { tableName: e });
20
+ tableName: A,
21
+ operation: i,
22
+ formState: p,
23
+ tableItem: E,
24
+ register: b,
25
+ watch: q,
26
+ control: h
27
+ } = V, {
28
+ fixedIncomeTypes: C,
29
+ spvs: w,
30
+ serviceProviderFeeTypes: S,
31
+ accounts: P,
32
+ fixedIncomes: M
33
+ } = j(), { showModal: x } = G(), I = D(
34
+ (r) => () => {
35
+ x("createItem", { tableName: r });
36
36
  },
37
- [F]
37
+ [x]
38
38
  );
39
- return z(() => {
40
- switch (w) {
41
- case y.ASSET: {
42
- const e = C, u = v, r = P, c = b, { errors: a } = c, o = S, h = s !== "create" && e ? [
39
+ return k(() => {
40
+ switch (A) {
41
+ case f.ASSET: {
42
+ const r = E, c = b, e = p, { errors: t } = e, o = h, d = i !== "create" && r ? [
43
43
  {
44
44
  label: "Notional",
45
- Input: () => /* @__PURE__ */ t(f, { children: A(e.notional) })
45
+ Input: () => /* @__PURE__ */ s(g, { children: T(r.notional) })
46
46
  },
47
47
  {
48
48
  label: "Purchase Date",
49
- Input: () => /* @__PURE__ */ t(f, { children: A(e.purchaseDate) })
49
+ Input: () => /* @__PURE__ */ s(g, { children: T(r.purchaseDate) })
50
50
  },
51
51
  {
52
52
  label: "Purchase Price",
53
- Input: () => /* @__PURE__ */ t(f, { children: A(e.purchasePrice, 6) })
53
+ Input: () => /* @__PURE__ */ s(g, { children: T(r.purchasePrice, 6) })
54
54
  },
55
55
  {
56
56
  label: "Purchase Proceeds",
57
- Input: () => /* @__PURE__ */ t(f, { children: A(e.purchaseProceeds) })
57
+ Input: () => /* @__PURE__ */ s(g, { children: T(r.purchaseProceeds) })
58
58
  }
59
- ] : [], i = s === "view" && e ? e.maturity : r("maturity") || (e == null ? void 0 : e.maturity);
59
+ ] : [];
60
60
  return { inputs: [
61
61
  {
62
62
  label: "Asset Name",
63
63
  Input: () => {
64
- var l;
65
- return /* @__PURE__ */ t(
66
- p,
64
+ var a;
65
+ return /* @__PURE__ */ s(
66
+ u,
67
67
  {
68
- ...u("name", {
69
- disabled: s === "view",
68
+ ...c("name", {
69
+ disabled: i === "view",
70
70
  required: "Asset name is required"
71
71
  }),
72
- "aria-invalid": a.name ? "true" : "false",
73
- errorMessage: (l = a.name) == null ? void 0 : l.message,
72
+ "aria-invalid": t.name ? "true" : "false",
73
+ errorMessage: (a = t.name) == null ? void 0 : a.message,
74
74
  inputClassName: "text-left",
75
75
  placeholder: "E.g. My Asset"
76
76
  }
@@ -80,11 +80,11 @@ function fe(L) {
80
80
  {
81
81
  label: "CUSIP",
82
82
  Input: () => {
83
- var l;
84
- return s === "view" ? (e == null ? void 0 : e.CUSIP) ?? "Not available" : /* @__PURE__ */ t(
85
- p,
83
+ var a;
84
+ return i === "view" ? (r == null ? void 0 : r.CUSIP) ?? "Not available" : /* @__PURE__ */ s(
85
+ u,
86
86
  {
87
- ...u("CUSIP", {
87
+ ...c("CUSIP", {
88
88
  maxLength: {
89
89
  value: 9,
90
90
  message: "CUSIP cannot be longer than 9 characters"
@@ -98,8 +98,8 @@ function fe(L) {
98
98
  message: "CUSIP must be alphanumeric"
99
99
  }
100
100
  }),
101
- "aria-invalid": a.CUSIP ? "true" : "false",
102
- errorMessage: (l = a.CUSIP) == null ? void 0 : l.message,
101
+ "aria-invalid": t.CUSIP ? "true" : "false",
102
+ errorMessage: (a = t.CUSIP) == null ? void 0 : a.message,
103
103
  placeholder: "E.g. A2345B789"
104
104
  }
105
105
  );
@@ -108,11 +108,11 @@ function fe(L) {
108
108
  {
109
109
  label: "ISIN",
110
110
  Input: () => {
111
- var l;
112
- return s === "view" ? (e == null ? void 0 : e.ISIN) ?? "Not available" : /* @__PURE__ */ t(
113
- p,
111
+ var a;
112
+ return i === "view" ? (r == null ? void 0 : r.ISIN) ?? "Not available" : /* @__PURE__ */ s(
113
+ u,
114
114
  {
115
- ...u("ISIN", {
115
+ ...c("ISIN", {
116
116
  maxLength: {
117
117
  value: 12,
118
118
  message: "ISIN cannot be longer than 12 characters"
@@ -126,8 +126,8 @@ function fe(L) {
126
126
  message: "ISIN must be alphanumeric"
127
127
  }
128
128
  }),
129
- "aria-invalid": a.ISIN ? "true" : "false",
130
- errorMessage: (l = a.ISIN) == null ? void 0 : l.message,
129
+ "aria-invalid": t.ISIN ? "true" : "false",
130
+ errorMessage: (a = t.ISIN) == null ? void 0 : a.message,
131
131
  placeholder: "E.g. 123456789ABC"
132
132
  }
133
133
  );
@@ -135,39 +135,39 @@ function fe(L) {
135
135
  },
136
136
  {
137
137
  label: "Maturity",
138
- Input: () => /* @__PURE__ */ t(
139
- _,
138
+ Input: () => /* @__PURE__ */ s(
139
+ "input",
140
140
  {
141
- ...u("maturity", {
142
- disabled: s === "view",
143
- setValueAs: (l) => l === "" ? null : l
144
- }),
145
- inputType: "date",
146
- name: "maturity"
141
+ className: "h-8 w-full rounded-md bg-gray-100 px-3 disabled:bg-transparent disabled:p-0",
142
+ step: 1,
143
+ type: "date",
144
+ ...c("maturity", {
145
+ disabled: i === "view"
146
+ })
147
147
  }
148
148
  ),
149
- inputLabel: i ? O(i, !0) : null
149
+ inputLabel: r != null && r.maturity ? K(r.maturity, !0) : null
150
150
  },
151
151
  {
152
152
  label: "Asset Type",
153
153
  Input: () => {
154
- var l;
155
- return /* @__PURE__ */ t(
156
- T,
154
+ var a;
155
+ return /* @__PURE__ */ s(
156
+ y,
157
157
  {
158
158
  addItemButtonProps: {
159
- onClick: g("ASSET"),
159
+ onClick: I("ASSET"),
160
160
  label: "Create Fixed Income Type"
161
161
  },
162
- "aria-invalid": a.fixedIncomeTypeId ? "true" : "false",
162
+ "aria-invalid": t.fixedIncomeTypeId ? "true" : "false",
163
163
  control: o,
164
- disabled: s === "view",
165
- errorMessage: (l = a.fixedIncomeTypeId) == null ? void 0 : l.message,
164
+ disabled: i === "view",
165
+ errorMessage: (a = t.fixedIncomeTypeId) == null ? void 0 : a.message,
166
166
  name: "fixedIncomeTypeId",
167
- options: M.map((m) => ({
168
- ...m,
169
- value: m.id,
170
- label: m.name
167
+ options: C.map((l) => ({
168
+ ...l,
169
+ value: l.id,
170
+ label: l.name
171
171
  })),
172
172
  rules: { required: "Asset type is required" }
173
173
  }
@@ -177,59 +177,59 @@ function fe(L) {
177
177
  {
178
178
  label: "SPV",
179
179
  Input: () => {
180
- var l;
181
- return /* @__PURE__ */ t(
182
- T,
180
+ var a;
181
+ return /* @__PURE__ */ s(
182
+ y,
183
183
  {
184
184
  addItemButtonProps: {
185
- onClick: g("SPV"),
185
+ onClick: I("SPV"),
186
186
  label: "Create SPV"
187
187
  },
188
- "aria-invalid": a.spvId ? "true" : "false",
188
+ "aria-invalid": t.spvId ? "true" : "false",
189
189
  control: o,
190
- disabled: s === "view",
191
- errorMessage: (l = a.spvId) == null ? void 0 : l.message,
190
+ disabled: i === "view",
191
+ errorMessage: (a = t.spvId) == null ? void 0 : a.message,
192
192
  name: "spvId",
193
- options: x.map((m) => ({
194
- ...m,
195
- value: m.id,
196
- label: m.name
193
+ options: w.map((l) => ({
194
+ ...l,
195
+ value: l.id,
196
+ label: l.name
197
197
  })),
198
198
  rules: { required: "SPV is required" }
199
199
  }
200
200
  );
201
201
  }
202
202
  },
203
- ...h
203
+ ...d
204
204
  ] };
205
205
  }
206
- case y.TRANSACTION: {
207
- const e = v, u = P, { errors: r } = b, c = S, a = u("type"), o = u("entryTime") ?? (/* @__PURE__ */ new Date()).toISOString(), h = !!a && Z.includes(a), i = !!a && X.includes(a), d = !h, l = J.map((n) => ({
208
- label: K[n],
206
+ case f.TRANSACTION: {
207
+ const r = b, c = q, { errors: e } = p, t = h, o = c("type"), d = !!o && H.includes(o), v = !!o && Q.includes(o), a = !d, l = Z.map((n) => ({
208
+ label: X[n],
209
209
  value: n
210
- })), m = N.map((n) => ({
211
- label: ee(n),
210
+ })), _ = M.map((n) => ({
211
+ label: J(n),
212
212
  value: n.id
213
- })), V = E.map(
213
+ })), N = S.map(
214
214
  (n) => {
215
- var I;
215
+ var m;
216
216
  return {
217
- label: `${n.name} — ${n.feeType} — ${(I = q.find((B) => B.id === n.accountId)) == null ? void 0 : I.reference}`,
217
+ label: `${n.name} — ${n.feeType} — ${(m = P.find((U) => U.id === n.accountId)) == null ? void 0 : m.reference}`,
218
218
  value: n.id
219
219
  };
220
220
  }
221
- ), U = [
221
+ ), O = [
222
222
  {
223
223
  label: "Transaction Type",
224
224
  Input: () => {
225
225
  var n;
226
- return /* @__PURE__ */ t(
227
- T,
226
+ return /* @__PURE__ */ s(
227
+ y,
228
228
  {
229
- "aria-invalid": r.type ? "true" : "false",
230
- control: c,
231
- disabled: s === "view",
232
- errorMessage: (n = r.type) == null ? void 0 : n.message,
229
+ "aria-invalid": e.type ? "true" : "false",
230
+ control: t,
231
+ disabled: i === "view",
232
+ errorMessage: (n = e.type) == null ? void 0 : n.message,
233
233
  name: "type",
234
234
  options: l,
235
235
  rules: {
@@ -241,51 +241,53 @@ function fe(L) {
241
241
  },
242
242
  {
243
243
  label: "Entry Time",
244
- Input: () => /* @__PURE__ */ t(
245
- _,
244
+ Input: () => /* @__PURE__ */ s(
245
+ "input",
246
246
  {
247
- ...e("entryTime", {
248
- required: !0,
249
- disabled: s === "view"
250
- }),
251
- name: "entryTime"
247
+ className: "h-8 w-full rounded-md bg-gray-100 px-3 disabled:bg-transparent disabled:p-0",
248
+ step: 1,
249
+ type: "datetime-local",
250
+ ...r("entryTime", {
251
+ disabled: i === "view",
252
+ required: "Entry time is required"
253
+ })
252
254
  }
253
255
  ),
254
- inputLabel: o ? O(new Date(o)) : null
256
+ inputLabel: /* @__PURE__ */ s($, { control: t })
255
257
  },
256
- h ? {
258
+ d ? {
257
259
  label: "Service Provider",
258
- Input: () => /* @__PURE__ */ t(
259
- T,
260
+ Input: () => /* @__PURE__ */ s(
261
+ y,
260
262
  {
261
263
  addItemButtonProps: {
262
- onClick: g("SERVICE_PROVIDER_FEE_TYPE"),
264
+ onClick: I("SERVICE_PROVIDER_FEE_TYPE"),
263
265
  label: "Add Service Provider"
264
266
  },
265
- control: c,
266
- disabled: s === "view",
267
+ control: t,
268
+ disabled: i === "view",
267
269
  name: "serviceProviderFeeTypeId",
268
- options: V
270
+ options: N
269
271
  }
270
272
  )
271
273
  } : null,
272
- i ? {
274
+ v ? {
273
275
  label: "Asset name",
274
276
  Input: () => {
275
277
  var n;
276
- return /* @__PURE__ */ t(
277
- T,
278
+ return /* @__PURE__ */ s(
279
+ y,
278
280
  {
279
281
  addItemButtonProps: {
280
- onClick: g("ASSET"),
282
+ onClick: I("ASSET"),
281
283
  label: "Create Asset"
282
284
  },
283
- "aria-invalid": r.type ? "true" : "false",
284
- control: c,
285
- disabled: s === "view",
286
- errorMessage: (n = r.type) == null ? void 0 : n.message,
285
+ "aria-invalid": e.type ? "true" : "false",
286
+ control: t,
287
+ disabled: i === "view",
288
+ errorMessage: (n = e.type) == null ? void 0 : n.message,
287
289
  name: "fixedIncomeId",
288
- options: m,
290
+ options: _,
289
291
  rules: {
290
292
  required: "Asset name is required"
291
293
  }
@@ -293,23 +295,23 @@ function fe(L) {
293
295
  );
294
296
  }
295
297
  } : void 0,
296
- i ? {
298
+ v ? {
297
299
  label: "Quantity",
298
300
  Input: () => {
299
301
  var n;
300
- return /* @__PURE__ */ t(
301
- D,
302
+ return /* @__PURE__ */ s(
303
+ R,
302
304
  {
303
- "aria-invalid": r.fixedIncomeAmount ? "true" : "false",
304
- control: c,
305
- disabled: s === "view",
306
- errorMessage: (n = r.fixedIncomeAmount) == null ? void 0 : n.message,
305
+ "aria-invalid": e.fixedIncomeAmount ? "true" : "false",
306
+ control: t,
307
+ disabled: i === "view",
308
+ errorMessage: (n = e.fixedIncomeAmount) == null ? void 0 : n.message,
307
309
  name: "fixedIncomeAmount",
308
310
  placeholder: "E.g. 1,000.00",
309
311
  rules: {
310
312
  required: "Quantity is required",
311
313
  validate: {
312
- positive: (I) => !!I && Number(I) > 0 || "Asset proceeds must be greater than zero"
314
+ positive: (m) => !!m && Number(m) > 0 || "Asset proceeds must be greater than zero"
313
315
  }
314
316
  }
315
317
  }
@@ -317,33 +319,33 @@ function fe(L) {
317
319
  }
318
320
  } : void 0,
319
321
  {
320
- label: i ? "Asset Proceeds" : "Cash Amount",
322
+ label: v ? "Asset Proceeds" : "Cash Amount",
321
323
  Input: () => {
322
324
  var n;
323
- return /* @__PURE__ */ R(f, { children: [
324
- /* @__PURE__ */ t(
325
- D,
325
+ return /* @__PURE__ */ F(g, { children: [
326
+ /* @__PURE__ */ s(
327
+ R,
326
328
  {
327
- "aria-invalid": r.cashAmount ? "true" : "false",
328
- control: c,
329
+ "aria-invalid": e.cashAmount ? "true" : "false",
330
+ control: t,
329
331
  currency: "USD",
330
- disabled: s === "view",
331
- errorMessage: (n = r.cashAmount) == null ? void 0 : n.message,
332
+ disabled: i === "view",
333
+ errorMessage: (n = e.cashAmount) == null ? void 0 : n.message,
332
334
  name: "cashAmount",
333
335
  placeholder: "E.g. $1,000.00",
334
336
  rules: {
335
337
  required: "Asset proceeds is required",
336
338
  validate: {
337
- positive: (I) => !!I && Number(I) > 0 || "Asset proceeds must be greater than zero"
339
+ positive: (m) => !!m && Number(m) > 0 || "Asset proceeds must be greater than zero"
338
340
  }
339
341
  }
340
342
  }
341
343
  ),
342
- i ? /* @__PURE__ */ t(
343
- W,
344
+ v ? /* @__PURE__ */ s(
345
+ Y,
344
346
  {
345
- control: c,
346
- isViewOnly: s === "view"
347
+ control: t,
348
+ isViewOnly: i === "view"
347
349
  }
348
350
  ) : null
349
351
  ] });
@@ -353,55 +355,55 @@ function fe(L) {
353
355
  label: "Transaction reference",
354
356
  Input: () => {
355
357
  var n;
356
- return /* @__PURE__ */ t(
357
- j,
358
+ return /* @__PURE__ */ s(
359
+ W,
358
360
  {
359
- ...e("txRef", {
360
- disabled: s === "view"
361
+ ...r("txRef", {
362
+ disabled: i === "view"
361
363
  }),
362
- "aria-invalid": r.txRef ? "true" : "false",
363
- control: c,
364
- errorMessage: (n = r.txRef) == null ? void 0 : n.message,
364
+ "aria-invalid": e.txRef ? "true" : "false",
365
+ control: t,
366
+ errorMessage: (n = e.txRef) == null ? void 0 : n.message,
365
367
  placeholder: "E.g. 0x123..."
366
368
  }
367
369
  );
368
370
  }
369
371
  }
370
- ].filter(Boolean), k = /* @__PURE__ */ R(f, { children: [
371
- /* @__PURE__ */ t(
372
- G,
372
+ ].filter(Boolean), L = /* @__PURE__ */ F(g, { children: [
373
+ /* @__PURE__ */ s(
374
+ z,
373
375
  {
374
- canHaveTransactionFees: d,
375
- control: c,
376
- errors: r,
377
- isViewOnly: s === "view",
378
- serviceProviderFeeTypeOptions: V,
379
- serviceProviderFeeTypes: E,
380
- showCreateServiceProviderFeeTypeModal: g(
376
+ canHaveTransactionFees: a,
377
+ control: t,
378
+ errors: e,
379
+ isViewOnly: i === "view",
380
+ serviceProviderFeeTypeOptions: N,
381
+ serviceProviderFeeTypes: S,
382
+ showCreateServiceProviderFeeTypeModal: I(
381
383
  "SERVICE_PROVIDER_FEE_TYPE"
382
384
  )
383
385
  }
384
386
  ),
385
- /* @__PURE__ */ t(Y, { control: c })
387
+ /* @__PURE__ */ s(B, { control: t })
386
388
  ] });
387
- return { inputs: U, additionalInputs: k };
389
+ return { inputs: O, additionalInputs: L };
388
390
  }
389
- case y.ACCOUNT: {
390
- const e = v, u = b, { errors: r } = u;
391
+ case f.ACCOUNT: {
392
+ const r = b, c = p, { errors: e } = c;
391
393
  return { inputs: [
392
394
  {
393
395
  label: "Account Label",
394
396
  Input: () => {
395
- var a, o;
396
- return /* @__PURE__ */ t(
397
- p,
397
+ var o, d;
398
+ return /* @__PURE__ */ s(
399
+ u,
398
400
  {
399
- ...e("label", {
400
- disabled: s === "view",
401
+ ...r("label", {
402
+ disabled: i === "view",
401
403
  required: "Account label is required"
402
404
  }),
403
- "aria-invalid": ((a = r.label) == null ? void 0 : a.type) === "required" ? "true" : "false",
404
- errorMessage: (o = r.label) == null ? void 0 : o.message,
405
+ "aria-invalid": ((o = e.label) == null ? void 0 : o.type) === "required" ? "true" : "false",
406
+ errorMessage: (d = e.label) == null ? void 0 : d.message,
405
407
  placeholder: "E.g. My Label"
406
408
  }
407
409
  );
@@ -410,16 +412,16 @@ function fe(L) {
410
412
  {
411
413
  label: "Account Reference",
412
414
  Input: () => {
413
- var a, o;
414
- return /* @__PURE__ */ t(
415
- p,
415
+ var o, d;
416
+ return /* @__PURE__ */ s(
417
+ u,
416
418
  {
417
- ...e("reference", {
418
- disabled: s === "view",
419
+ ...r("reference", {
420
+ disabled: i === "view",
419
421
  required: "Account reference is required"
420
422
  }),
421
- "aria-invalid": ((a = r.reference) == null ? void 0 : a.type) === "required" ? "true" : "false",
422
- errorMessage: (o = r.reference) == null ? void 0 : o.message,
423
+ "aria-invalid": ((o = e.reference) == null ? void 0 : o.type) === "required" ? "true" : "false",
424
+ errorMessage: (d = e.reference) == null ? void 0 : d.message,
423
425
  placeholder: "E.g. bank account number or ETH address"
424
426
  }
425
427
  );
@@ -427,22 +429,22 @@ function fe(L) {
427
429
  }
428
430
  ] };
429
431
  }
430
- case y.SPV: {
431
- const e = v, u = b, { errors: r } = u;
432
+ case f.SPV: {
433
+ const r = b, c = p, { errors: e } = c;
432
434
  return { inputs: [
433
435
  {
434
436
  label: "SPV name",
435
437
  Input: () => {
436
- var a, o;
437
- return /* @__PURE__ */ t(
438
- p,
438
+ var o, d;
439
+ return /* @__PURE__ */ s(
440
+ u,
439
441
  {
440
- ...e("name", {
441
- disabled: s === "view",
442
+ ...r("name", {
443
+ disabled: i === "view",
442
444
  required: "SPV name is required"
443
445
  }),
444
- "aria-invalid": ((a = r.name) == null ? void 0 : a.type) === "required" ? "true" : "false",
445
- errorMessage: (o = r.name) == null ? void 0 : o.message,
446
+ "aria-invalid": ((o = e.name) == null ? void 0 : o.type) === "required" ? "true" : "false",
447
+ errorMessage: (d = e.name) == null ? void 0 : d.message,
446
448
  placeholder: "E.g. My SPV name"
447
449
  }
448
450
  );
@@ -450,22 +452,22 @@ function fe(L) {
450
452
  }
451
453
  ] };
452
454
  }
453
- case y.FIXED_INCOME_TYPE: {
454
- const e = v, u = b, { errors: r } = u;
455
+ case f.FIXED_INCOME_TYPE: {
456
+ const r = b, c = p, { errors: e } = c;
455
457
  return { inputs: [
456
458
  {
457
459
  label: "Fixed Income Type Name",
458
460
  Input: () => {
459
- var a, o;
460
- return /* @__PURE__ */ t(
461
- p,
461
+ var o, d;
462
+ return /* @__PURE__ */ s(
463
+ u,
462
464
  {
463
- ...e("name", {
464
- disabled: s === "view",
465
+ ...r("name", {
466
+ disabled: i === "view",
465
467
  required: "Fixed Income Type name is required"
466
468
  }),
467
- "aria-invalid": ((a = r.name) == null ? void 0 : a.type) === "required" ? "true" : "false",
468
- errorMessage: (o = r.name) == null ? void 0 : o.message,
469
+ "aria-invalid": ((o = e.name) == null ? void 0 : o.type) === "required" ? "true" : "false",
470
+ errorMessage: (d = e.name) == null ? void 0 : d.message,
469
471
  placeholder: "E.g. My Fixed Income Type name"
470
472
  }
471
473
  );
@@ -473,26 +475,26 @@ function fe(L) {
473
475
  }
474
476
  ] };
475
477
  }
476
- case y.SERVICE_PROVIDER_FEE_TYPE: {
477
- const e = v, u = b, { errors: r } = u, c = S, a = (i) => `${i.label} (${i.reference})`, o = (i) => i.map((d) => ({
478
- ...d,
479
- value: d.id,
480
- label: a(d)
478
+ case f.SERVICE_PROVIDER_FEE_TYPE: {
479
+ const r = b, c = p, { errors: e } = c, t = h, o = (a) => `${a.label} (${a.reference})`, d = (a) => a.map((l) => ({
480
+ ...l,
481
+ value: l.id,
482
+ label: o(l)
481
483
  }));
482
484
  return { inputs: [
483
485
  {
484
486
  label: "Service Provider Name",
485
487
  Input: () => {
486
- var i, d;
487
- return /* @__PURE__ */ t(
488
- p,
488
+ var a, l;
489
+ return /* @__PURE__ */ s(
490
+ u,
489
491
  {
490
- ...e("name", {
491
- disabled: s === "view",
492
+ ...r("name", {
493
+ disabled: i === "view",
492
494
  required: "Service provider name is required"
493
495
  }),
494
- "aria-invalid": ((i = r.name) == null ? void 0 : i.type) === "required" ? "true" : "false",
495
- errorMessage: (d = r.name) == null ? void 0 : d.message,
496
+ "aria-invalid": ((a = e.name) == null ? void 0 : a.type) === "required" ? "true" : "false",
497
+ errorMessage: (l = e.name) == null ? void 0 : l.message,
496
498
  placeholder: "E.g. My Service Provider"
497
499
  }
498
500
  );
@@ -501,16 +503,16 @@ function fe(L) {
501
503
  {
502
504
  label: "Fee Type",
503
505
  Input: () => {
504
- var i, d;
505
- return /* @__PURE__ */ t(
506
- p,
506
+ var a, l;
507
+ return /* @__PURE__ */ s(
508
+ u,
507
509
  {
508
- ...e("feeType", {
509
- disabled: s === "view",
510
+ ...r("feeType", {
511
+ disabled: i === "view",
510
512
  required: "Fee type is required"
511
513
  }),
512
- "aria-invalid": ((i = r.name) == null ? void 0 : i.type) === "required" ? "true" : "false",
513
- errorMessage: (d = r.name) == null ? void 0 : d.message,
514
+ "aria-invalid": ((a = e.name) == null ? void 0 : a.type) === "required" ? "true" : "false",
515
+ errorMessage: (l = e.name) == null ? void 0 : l.message,
514
516
  placeholder: "E.g. My Fee Type"
515
517
  }
516
518
  );
@@ -519,20 +521,20 @@ function fe(L) {
519
521
  {
520
522
  label: "Account",
521
523
  Input: () => {
522
- var i;
523
- return /* @__PURE__ */ t(
524
- T,
524
+ var a;
525
+ return /* @__PURE__ */ s(
526
+ y,
525
527
  {
526
528
  addItemButtonProps: {
527
- onClick: g("ACCOUNT"),
529
+ onClick: I("ACCOUNT"),
528
530
  label: "Create Account"
529
531
  },
530
- "aria-invalid": r.accountId ? "true" : "false",
531
- control: c,
532
- disabled: s === "view",
533
- errorMessage: (i = r.accountId) == null ? void 0 : i.message,
532
+ "aria-invalid": e.accountId ? "true" : "false",
533
+ control: t,
534
+ disabled: i === "view",
535
+ errorMessage: (a = e.accountId) == null ? void 0 : a.message,
534
536
  name: "accountId",
535
- options: o(q),
537
+ options: d(P),
536
538
  rules: { required: "Account is required" }
537
539
  }
538
540
  );
@@ -542,22 +544,22 @@ function fe(L) {
542
544
  }
543
545
  }
544
546
  }, [
547
+ p,
548
+ h,
545
549
  b,
546
- S,
547
- v,
548
- C,
549
- P,
550
+ E,
550
551
  q,
552
+ P,
553
+ C,
551
554
  M,
552
- N,
553
- s,
554
- E,
555
- g,
556
- x,
557
- w
555
+ i,
556
+ S,
557
+ I,
558
+ w,
559
+ A
558
560
  ]);
559
561
  }
560
562
  export {
561
- fe as useFormInputs
563
+ ge as useFormInputs
562
564
  };
563
565
  //# sourceMappingURL=useFormInputs.js.map