@dmsi/wedgekit-react 0.0.120 → 0.0.121

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,6 +1,6 @@
1
1
  import {
2
2
  SelectPaymentMethod
3
- } from "./chunk-KYMBBPEW.js";
3
+ } from "./chunk-FWRT5E5M.js";
4
4
  import {
5
5
  Modal
6
6
  } from "./chunk-QIHDPSOM.js";
@@ -15,7 +15,7 @@ import {
15
15
  } from "./chunk-EO3JJWFW.js";
16
16
  import {
17
17
  Card
18
- } from "./chunk-JOMM4KBH.js";
18
+ } from "./chunk-4OS6APPF.js";
19
19
  import {
20
20
  Paragraph
21
21
  } from "./chunk-VG4EPHJA.js";
@@ -8,12 +8,13 @@ import {
8
8
  import clsx from "clsx";
9
9
  import { jsx } from "react/jsx-runtime";
10
10
  function Card(props) {
11
- const _a = props, { children } = _a, rest = __objRest(_a, ["children"]);
11
+ const _a = props, { children, selected } = _a, rest = __objRest(_a, ["children", "selected"]);
12
12
  return /* @__PURE__ */ jsx(
13
13
  "div",
14
14
  __spreadProps(__spreadValues({}, rest), {
15
15
  className: clsx(
16
- "border rounded-sm border-border-primary-normal p-desktop-layout-padding",
16
+ "rounded-sm p-desktop-layout-padding",
17
+ selected ? "border-2 border-border-primary-focus" : "border border-border-primary-normal",
17
18
  rest.className
18
19
  ),
19
20
  children
@@ -15,27 +15,20 @@ import {
15
15
  } from "./chunk-O4M2GISS.js";
16
16
  import {
17
17
  Accordion
18
- } from "./chunk-QDFQ3B4N.js";
18
+ } from "./chunk-XEUPUTYP.js";
19
19
  import {
20
20
  Stack
21
21
  } from "./chunk-EO3JJWFW.js";
22
22
  import {
23
23
  Card
24
- } from "./chunk-JOMM4KBH.js";
25
- import {
26
- Paragraph
27
- } from "./chunk-VG4EPHJA.js";
24
+ } from "./chunk-4OS6APPF.js";
28
25
  import {
29
26
  Button
30
27
  } from "./chunk-L364HTYC.js";
31
- import {
32
- Icon
33
- } from "./chunk-IGQVA7SC.js";
34
28
 
35
29
  // src/components/SelectPaymentMethod.tsx
36
- import { useEffect, useState } from "react";
37
- import clsx from "clsx";
38
- import { jsx, jsxs } from "react/jsx-runtime";
30
+ import { useState } from "react";
31
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
39
32
  function SelectPaymentMethod(props) {
40
33
  const {
41
34
  selectedMethod,
@@ -80,10 +73,10 @@ function SelectPaymentMethod(props) {
80
73
  Accordion,
81
74
  {
82
75
  isOpen: selectedMethod === "CCPayment",
83
- title: "Pay by Credit/Debit Card",
84
- before: /* @__PURE__ */ jsx(
76
+ title: /* @__PURE__ */ jsx(
85
77
  Radio,
86
78
  {
79
+ label: "Pay by Credit/Debit Card",
87
80
  checked: selectedMethod === "CCPayment",
88
81
  onClick: (e) => e.preventDefault()
89
82
  }
@@ -91,82 +84,38 @@ function SelectPaymentMethod(props) {
91
84
  onClick: () => handleToggle(selectedMethod === "CCPayment" ? null : "CCPayment"),
92
85
  children: /* @__PURE__ */ jsx(Button, { className: "w-full", onClick: onPay, disabled: isPayLoading, children: isPayLoading ? "Processing..." : "Proceed to Payment" })
93
86
  }
94
- )
87
+ ),
88
+ selectedMethod === "ACHPayment" && /* @__PURE__ */ jsx(Button, { block: true, onClick: onPay, disabled: isPayLoading, children: isPayLoading ? "Processing..." : "Submit Payment" })
95
89
  ] });
96
90
  }
97
91
  function ACHSelector(props) {
98
- var _a;
99
92
  const {
100
93
  selectedMethod,
101
94
  handleToggle,
102
95
  selectedBankGuid,
103
96
  setSelectedBankGuid,
104
- customerBanks,
105
- onPay,
106
- isPayLoading
97
+ customerBanks
107
98
  } = props;
108
- const [isOpen, setIsOpen] = useState(false);
109
- useEffect(() => {
110
- if (selectedMethod === "CCPayment") return setIsOpen(false);
111
- }, [selectedMethod]);
112
- useEffect(() => {
113
- if (isOpen) {
114
- if (!selectedBankGuid) {
115
- setSelectedBankGuid(customerBanks[0].CustBankGUID);
116
- }
117
- handleToggle("ACHPayment");
118
- return;
119
- }
120
- }, [isOpen]);
121
99
  function handleBankSelect(e, bankGuid) {
122
100
  e.stopPropagation();
123
101
  setSelectedBankGuid(bankGuid);
124
102
  handleToggle("ACHPayment");
125
103
  }
126
- return /* @__PURE__ */ jsx(
127
- Accordion,
104
+ return /* @__PURE__ */ jsx(Fragment, { children: customerBanks.map((bank) => /* @__PURE__ */ jsx(
105
+ Card,
128
106
  {
129
- isOpen,
130
- title: selectedBankGuid ? (_a = customerBanks.find((bank) => bank.CustBankGUID === selectedBankGuid)) == null ? void 0 : _a.AccountDisplayString : "Select a Bank",
131
- before: /* @__PURE__ */ jsx(
107
+ onClick: (e) => handleBankSelect(e, bank.CustBankGUID),
108
+ selected: selectedMethod === "ACHPayment" && selectedBankGuid === bank.CustBankGUID,
109
+ children: /* @__PURE__ */ jsx(
132
110
  Radio,
133
111
  {
134
- checked: !!selectedBankGuid && selectedMethod === "ACHPayment"
112
+ label: `Pay by ${bank.AccountDisplayString}`,
113
+ checked: selectedMethod === "ACHPayment" && selectedBankGuid === bank.CustBankGUID
135
114
  }
136
- ),
137
- onClick: () => setIsOpen((prev) => !prev),
138
- children: /* @__PURE__ */ jsxs(Stack, { sizing: "layout-group", width: "full", children: [
139
- /* @__PURE__ */ jsx(
140
- Stack,
141
- {
142
- sizing: "layout-group",
143
- width: "full",
144
- overflowY: "auto",
145
- maxHeight: 200,
146
- children: customerBanks.map((bank) => /* @__PURE__ */ jsx(
147
- Card,
148
- {
149
- className: clsx(
150
- "transition-colors duration-300 py-desktop-compact-layout-padding cursor-pointer hover:bg-background-secondary-normal/30",
151
- selectedBankGuid === bank.CustBankGUID && "bg-background-secondary-normal/20"
152
- ),
153
- onClick: (e) => handleBankSelect(e, bank.CustBankGUID),
154
- children: /* @__PURE__ */ jsxs(Stack, { horizontal: true, items: "center", justify: "between", children: [
155
- /* @__PURE__ */ jsxs(Stack, { sizing: "layout-group", horizontal: true, items: "center", children: [
156
- /* @__PURE__ */ jsx(Icon, { name: "question_mark" }),
157
- /* @__PURE__ */ jsx(Paragraph, { children: bank.AccountDisplayString })
158
- ] }),
159
- selectedBankGuid === bank.CustBankGUID && /* @__PURE__ */ jsx(Icon, { name: "check" })
160
- ] })
161
- },
162
- bank.CustBankGUID
163
- ))
164
- }
165
- ),
166
- /* @__PURE__ */ jsx(Button, { className: "w-full", onClick: onPay, disabled: isPayLoading, children: isPayLoading ? "Processing..." : "Submit Payment" })
167
- ] })
168
- }
169
- );
115
+ )
116
+ },
117
+ bank.CustBankGUID
118
+ )) });
170
119
  }
171
120
  function CreditsSelector(props) {
172
121
  const { selectedCredits, allCredits, setSelectedCredits } = props;
@@ -201,24 +150,21 @@ function CreditsSelector(props) {
201
150
  items: "center",
202
151
  sizing: "layout-group",
203
152
  children: [
204
- /* @__PURE__ */ jsxs(
153
+ /* @__PURE__ */ jsx(
205
154
  Stack,
206
155
  {
207
- horizontal: true,
208
- items: "center",
209
156
  sizing: "layout-group",
210
157
  onClick: () => handleCreditSelect(credits),
211
158
  paddingY: true,
212
- children: [
213
- /* @__PURE__ */ jsx(
214
- Checkbox,
215
- {
216
- checked: selectedCredits == null ? void 0 : selectedCredits.includes(credits),
217
- onChange: () => handleCreditSelect(credits)
218
- }
219
- ),
220
- /* @__PURE__ */ jsx(Paragraph, { children: credits.InvoiceNumber })
221
- ]
159
+ flexGrow: 1,
160
+ children: /* @__PURE__ */ jsx(
161
+ Checkbox,
162
+ {
163
+ label: credits.InvoiceNumber,
164
+ checked: selectedCredits == null ? void 0 : selectedCredits.includes(credits),
165
+ onChange: () => handleCreditSelect(credits)
166
+ }
167
+ )
222
168
  }
223
169
  ),
224
170
  /* @__PURE__ */ jsxs(Subheader, { className: " pr-desktop-component-padding", children: [
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-EO3JJWFW.js";
4
4
  import {
5
5
  Card
6
- } from "./chunk-JOMM4KBH.js";
6
+ } from "./chunk-4OS6APPF.js";
7
7
  import {
8
8
  Paragraph
9
9
  } from "./chunk-VG4EPHJA.js";
@@ -44,9 +44,9 @@ function Accordion(props) {
44
44
  {
45
45
  className: clsx(
46
46
  "overflow-hidden select-none cursor-pointer",
47
- className,
48
- isOpen && "border-2 !border-border-primary-focus"
47
+ className
49
48
  ),
49
+ selected: isOpen,
50
50
  onClick: handleClick,
51
51
  children: [
52
52
  /* @__PURE__ */ jsxs(Stack, { sizing: "component", horizontal: true, justify: "between", items: "center", children: [
@@ -195,12 +195,13 @@ var gapUsingContainerPadding = (0, import_clsx.default)(
195
195
  var import_clsx2 = __toESM(require("clsx"), 1);
196
196
  var import_jsx_runtime = require("react/jsx-runtime");
197
197
  function Card(props) {
198
- const _a = props, { children } = _a, rest = __objRest(_a, ["children"]);
198
+ const _a = props, { children, selected } = _a, rest = __objRest(_a, ["children", "selected"]);
199
199
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
200
200
  "div",
201
201
  __spreadProps(__spreadValues({}, rest), {
202
202
  className: (0, import_clsx2.default)(
203
- "border rounded-sm border-border-primary-normal p-desktop-layout-padding",
203
+ "rounded-sm p-desktop-layout-padding",
204
+ selected ? "border-2 border-border-primary-focus" : "border border-border-primary-normal",
204
205
  rest.className
205
206
  ),
206
207
  children
@@ -486,9 +487,9 @@ function Accordion(props) {
486
487
  {
487
488
  className: (0, import_clsx6.default)(
488
489
  "overflow-hidden select-none cursor-pointer",
489
- className,
490
- isOpen && "border-2 !border-border-primary-focus"
490
+ className
491
491
  ),
492
+ selected: isOpen,
492
493
  onClick: handleClick,
493
494
  children: [
494
495
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Stack, { sizing: "component", horizontal: true, justify: "between", items: "center", children: [
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import {
3
3
  Accordion
4
- } from "../chunk-QDFQ3B4N.js";
4
+ } from "../chunk-XEUPUTYP.js";
5
5
  import "../chunk-EO3JJWFW.js";
6
- import "../chunk-JOMM4KBH.js";
6
+ import "../chunk-4OS6APPF.js";
7
7
  import "../chunk-VG4EPHJA.js";
8
8
  import "../chunk-IGQVA7SC.js";
9
9
  import "../chunk-RDLEIAQU.js";
@@ -65,12 +65,13 @@ module.exports = __toCommonJS(Card_exports);
65
65
  var import_clsx = __toESM(require("clsx"), 1);
66
66
  var import_jsx_runtime = require("react/jsx-runtime");
67
67
  function Card(props) {
68
- const _a = props, { children } = _a, rest = __objRest(_a, ["children"]);
68
+ const _a = props, { children, selected } = _a, rest = __objRest(_a, ["children", "selected"]);
69
69
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
70
70
  "div",
71
71
  __spreadProps(__spreadValues({}, rest), {
72
72
  className: (0, import_clsx.default)(
73
- "border rounded-sm border-border-primary-normal p-desktop-layout-padding",
73
+ "rounded-sm p-desktop-layout-padding",
74
+ selected ? "border-2 border-border-primary-focus" : "border border-border-primary-normal",
74
75
  rest.className
75
76
  ),
76
77
  children
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Card
3
- } from "../chunk-JOMM4KBH.js";
3
+ } from "../chunk-4OS6APPF.js";
4
4
  import "../chunk-ORMEWXMH.js";
5
5
  export {
6
6
  Card
@@ -1522,12 +1522,13 @@ Percentage.displayName = "Percentage";
1522
1522
  var import_clsx14 = __toESM(require("clsx"), 1);
1523
1523
  var import_jsx_runtime13 = require("react/jsx-runtime");
1524
1524
  function Card(props) {
1525
- const _a = props, { children } = _a, rest = __objRest(_a, ["children"]);
1525
+ const _a = props, { children, selected } = _a, rest = __objRest(_a, ["children", "selected"]);
1526
1526
  return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1527
1527
  "div",
1528
1528
  __spreadProps(__spreadValues({}, rest), {
1529
1529
  className: (0, import_clsx14.default)(
1530
- "border rounded-sm border-border-primary-normal p-desktop-layout-padding",
1530
+ "rounded-sm p-desktop-layout-padding",
1531
+ selected ? "border-2 border-border-primary-focus" : "border border-border-primary-normal",
1531
1532
  rest.className
1532
1533
  ),
1533
1534
  children
@@ -1571,9 +1572,9 @@ function Accordion(props) {
1571
1572
  {
1572
1573
  className: (0, import_clsx15.default)(
1573
1574
  "overflow-hidden select-none cursor-pointer",
1574
- className,
1575
- isOpen && "border-2 !border-border-primary-focus"
1575
+ className
1576
1576
  ),
1577
+ selected: isOpen,
1577
1578
  onClick: handleClick,
1578
1579
  children: [
1579
1580
  /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Stack, { sizing: "component", horizontal: true, justify: "between", items: "center", children: [
@@ -1729,9 +1730,6 @@ var RadioIcon = ({ className }) => {
1729
1730
  };
1730
1731
  RadioIcon.displayName = "RadioIcon";
1731
1732
 
1732
- // src/components/SelectPaymentMethod.tsx
1733
- var import_clsx20 = __toESM(require("clsx"), 1);
1734
-
1735
1733
  // src/components/Checkbox.tsx
1736
1734
  var import_clsx17 = __toESM(require("clsx"), 1);
1737
1735
  var import_jsx_runtime16 = require("react/jsx-runtime");
@@ -1949,10 +1947,10 @@ function SelectPaymentMethod(props) {
1949
1947
  Accordion,
1950
1948
  {
1951
1949
  isOpen: selectedMethod === "CCPayment",
1952
- title: "Pay by Credit/Debit Card",
1953
- before: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1950
+ title: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1954
1951
  Radio,
1955
1952
  {
1953
+ label: "Pay by Credit/Debit Card",
1956
1954
  checked: selectedMethod === "CCPayment",
1957
1955
  onClick: (e) => e.preventDefault()
1958
1956
  }
@@ -1960,82 +1958,38 @@ function SelectPaymentMethod(props) {
1960
1958
  onClick: () => handleToggle(selectedMethod === "CCPayment" ? null : "CCPayment"),
1961
1959
  children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Button, { className: "w-full", onClick: onPay, disabled: isPayLoading, children: isPayLoading ? "Processing..." : "Proceed to Payment" })
1962
1960
  }
1963
- )
1961
+ ),
1962
+ selectedMethod === "ACHPayment" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Button, { block: true, onClick: onPay, disabled: isPayLoading, children: isPayLoading ? "Processing..." : "Submit Payment" })
1964
1963
  ] });
1965
1964
  }
1966
1965
  function ACHSelector(props) {
1967
- var _a;
1968
1966
  const {
1969
1967
  selectedMethod,
1970
1968
  handleToggle,
1971
1969
  selectedBankGuid,
1972
1970
  setSelectedBankGuid,
1973
- customerBanks,
1974
- onPay,
1975
- isPayLoading
1971
+ customerBanks
1976
1972
  } = props;
1977
- const [isOpen, setIsOpen] = (0, import_react7.useState)(false);
1978
- (0, import_react7.useEffect)(() => {
1979
- if (selectedMethod === "CCPayment") return setIsOpen(false);
1980
- }, [selectedMethod]);
1981
- (0, import_react7.useEffect)(() => {
1982
- if (isOpen) {
1983
- if (!selectedBankGuid) {
1984
- setSelectedBankGuid(customerBanks[0].CustBankGUID);
1985
- }
1986
- handleToggle("ACHPayment");
1987
- return;
1988
- }
1989
- }, [isOpen]);
1990
1973
  function handleBankSelect(e, bankGuid) {
1991
1974
  e.stopPropagation();
1992
1975
  setSelectedBankGuid(bankGuid);
1993
1976
  handleToggle("ACHPayment");
1994
1977
  }
1995
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1996
- Accordion,
1978
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_jsx_runtime19.Fragment, { children: customerBanks.map((bank) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1979
+ Card,
1997
1980
  {
1998
- isOpen,
1999
- title: selectedBankGuid ? (_a = customerBanks.find((bank) => bank.CustBankGUID === selectedBankGuid)) == null ? void 0 : _a.AccountDisplayString : "Select a Bank",
2000
- before: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1981
+ onClick: (e) => handleBankSelect(e, bank.CustBankGUID),
1982
+ selected: selectedMethod === "ACHPayment" && selectedBankGuid === bank.CustBankGUID,
1983
+ children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2001
1984
  Radio,
2002
1985
  {
2003
- checked: !!selectedBankGuid && selectedMethod === "ACHPayment"
1986
+ label: `Pay by ${bank.AccountDisplayString}`,
1987
+ checked: selectedMethod === "ACHPayment" && selectedBankGuid === bank.CustBankGUID
2004
1988
  }
2005
- ),
2006
- onClick: () => setIsOpen((prev) => !prev),
2007
- children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Stack, { sizing: "layout-group", width: "full", children: [
2008
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2009
- Stack,
2010
- {
2011
- sizing: "layout-group",
2012
- width: "full",
2013
- overflowY: "auto",
2014
- maxHeight: 200,
2015
- children: customerBanks.map((bank) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2016
- Card,
2017
- {
2018
- className: (0, import_clsx20.default)(
2019
- "transition-colors duration-300 py-desktop-compact-layout-padding cursor-pointer hover:bg-background-secondary-normal/30",
2020
- selectedBankGuid === bank.CustBankGUID && "bg-background-secondary-normal/20"
2021
- ),
2022
- onClick: (e) => handleBankSelect(e, bank.CustBankGUID),
2023
- children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Stack, { horizontal: true, items: "center", justify: "between", children: [
2024
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Stack, { sizing: "layout-group", horizontal: true, items: "center", children: [
2025
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Icon, { name: "question_mark" }),
2026
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Paragraph, { children: bank.AccountDisplayString })
2027
- ] }),
2028
- selectedBankGuid === bank.CustBankGUID && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Icon, { name: "check" })
2029
- ] })
2030
- },
2031
- bank.CustBankGUID
2032
- ))
2033
- }
2034
- ),
2035
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Button, { className: "w-full", onClick: onPay, disabled: isPayLoading, children: isPayLoading ? "Processing..." : "Submit Payment" })
2036
- ] })
2037
- }
2038
- );
1989
+ )
1990
+ },
1991
+ bank.CustBankGUID
1992
+ )) });
2039
1993
  }
2040
1994
  function CreditsSelector(props) {
2041
1995
  const { selectedCredits, allCredits, setSelectedCredits } = props;
@@ -2070,24 +2024,21 @@ function CreditsSelector(props) {
2070
2024
  items: "center",
2071
2025
  sizing: "layout-group",
2072
2026
  children: [
2073
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
2027
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2074
2028
  Stack,
2075
2029
  {
2076
- horizontal: true,
2077
- items: "center",
2078
2030
  sizing: "layout-group",
2079
2031
  onClick: () => handleCreditSelect(credits),
2080
2032
  paddingY: true,
2081
- children: [
2082
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2083
- Checkbox,
2084
- {
2085
- checked: selectedCredits == null ? void 0 : selectedCredits.includes(credits),
2086
- onChange: () => handleCreditSelect(credits)
2087
- }
2088
- ),
2089
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Paragraph, { children: credits.InvoiceNumber })
2090
- ]
2033
+ flexGrow: 1,
2034
+ children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2035
+ Checkbox,
2036
+ {
2037
+ label: credits.InvoiceNumber,
2038
+ checked: selectedCredits == null ? void 0 : selectedCredits.includes(credits),
2039
+ onChange: () => handleCreditSelect(credits)
2040
+ }
2041
+ )
2091
2042
  }
2092
2043
  ),
2093
2044
  /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Subheader, { className: " pr-desktop-component-padding", children: [
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  PaymentOnAccountModal,
3
3
  calculateSurcharge
4
- } from "../chunk-OX3HKFIH.js";
5
- import "../chunk-KYMBBPEW.js";
4
+ } from "../chunk-22CQ3BSY.js";
5
+ import "../chunk-FWRT5E5M.js";
6
6
  import "../chunk-TTO4PL7Y.js";
7
7
  import "../chunk-QIHDPSOM.js";
8
8
  import "../chunk-4RJKB7LC.js";
@@ -19,9 +19,9 @@ import "../chunk-R5TLUWDD.js";
19
19
  import "../chunk-5UH6QUFB.js";
20
20
  import "../chunk-S5K22XTH.js";
21
21
  import "../chunk-O4M2GISS.js";
22
- import "../chunk-QDFQ3B4N.js";
22
+ import "../chunk-XEUPUTYP.js";
23
23
  import "../chunk-EO3JJWFW.js";
24
- import "../chunk-JOMM4KBH.js";
24
+ import "../chunk-4OS6APPF.js";
25
25
  import "../chunk-VG4EPHJA.js";
26
26
  import "../chunk-L364HTYC.js";
27
27
  import "../chunk-IGQVA7SC.js";
@@ -198,12 +198,13 @@ var gapUsingContainerPadding = (0, import_clsx.default)(
198
198
  var import_clsx2 = __toESM(require("clsx"), 1);
199
199
  var import_jsx_runtime = require("react/jsx-runtime");
200
200
  function Card(props) {
201
- const _a = props, { children } = _a, rest = __objRest(_a, ["children"]);
201
+ const _a = props, { children, selected } = _a, rest = __objRest(_a, ["children", "selected"]);
202
202
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
203
203
  "div",
204
204
  __spreadProps(__spreadValues({}, rest), {
205
205
  className: (0, import_clsx2.default)(
206
- "border rounded-sm border-border-primary-normal p-desktop-layout-padding",
206
+ "rounded-sm p-desktop-layout-padding",
207
+ selected ? "border-2 border-border-primary-focus" : "border border-border-primary-normal",
207
208
  rest.className
208
209
  ),
209
210
  children
@@ -489,9 +490,9 @@ function Accordion(props) {
489
490
  {
490
491
  className: (0, import_clsx6.default)(
491
492
  "overflow-hidden select-none cursor-pointer",
492
- className,
493
- isOpen && "border-2 !border-border-primary-focus"
493
+ className
494
494
  ),
495
+ selected: isOpen,
495
496
  onClick: handleClick,
496
497
  children: [
497
498
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Stack, { sizing: "component", horizontal: true, justify: "between", items: "center", children: [
@@ -785,9 +786,6 @@ var RadioIcon = ({ className }) => {
785
786
  };
786
787
  RadioIcon.displayName = "RadioIcon";
787
788
 
788
- // src/components/SelectPaymentMethod.tsx
789
- var import_clsx12 = __toESM(require("clsx"), 1);
790
-
791
789
  // src/components/Checkbox.tsx
792
790
  var import_clsx9 = __toESM(require("clsx"), 1);
793
791
  var import_jsx_runtime8 = require("react/jsx-runtime");
@@ -1017,10 +1015,10 @@ function SelectPaymentMethod(props) {
1017
1015
  Accordion,
1018
1016
  {
1019
1017
  isOpen: selectedMethod === "CCPayment",
1020
- title: "Pay by Credit/Debit Card",
1021
- before: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1018
+ title: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1022
1019
  Radio,
1023
1020
  {
1021
+ label: "Pay by Credit/Debit Card",
1024
1022
  checked: selectedMethod === "CCPayment",
1025
1023
  onClick: (e) => e.preventDefault()
1026
1024
  }
@@ -1028,82 +1026,38 @@ function SelectPaymentMethod(props) {
1028
1026
  onClick: () => handleToggle(selectedMethod === "CCPayment" ? null : "CCPayment"),
1029
1027
  children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Button, { className: "w-full", onClick: onPay, disabled: isPayLoading, children: isPayLoading ? "Processing..." : "Proceed to Payment" })
1030
1028
  }
1031
- )
1029
+ ),
1030
+ selectedMethod === "ACHPayment" && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Button, { block: true, onClick: onPay, disabled: isPayLoading, children: isPayLoading ? "Processing..." : "Submit Payment" })
1032
1031
  ] });
1033
1032
  }
1034
1033
  function ACHSelector(props) {
1035
- var _a;
1036
1034
  const {
1037
1035
  selectedMethod,
1038
1036
  handleToggle,
1039
1037
  selectedBankGuid,
1040
1038
  setSelectedBankGuid,
1041
- customerBanks,
1042
- onPay,
1043
- isPayLoading
1039
+ customerBanks
1044
1040
  } = props;
1045
- const [isOpen, setIsOpen] = (0, import_react.useState)(false);
1046
- (0, import_react.useEffect)(() => {
1047
- if (selectedMethod === "CCPayment") return setIsOpen(false);
1048
- }, [selectedMethod]);
1049
- (0, import_react.useEffect)(() => {
1050
- if (isOpen) {
1051
- if (!selectedBankGuid) {
1052
- setSelectedBankGuid(customerBanks[0].CustBankGUID);
1053
- }
1054
- handleToggle("ACHPayment");
1055
- return;
1056
- }
1057
- }, [isOpen]);
1058
1041
  function handleBankSelect(e, bankGuid) {
1059
1042
  e.stopPropagation();
1060
1043
  setSelectedBankGuid(bankGuid);
1061
1044
  handleToggle("ACHPayment");
1062
1045
  }
1063
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1064
- Accordion,
1046
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_jsx_runtime11.Fragment, { children: customerBanks.map((bank) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1047
+ Card,
1065
1048
  {
1066
- isOpen,
1067
- title: selectedBankGuid ? (_a = customerBanks.find((bank) => bank.CustBankGUID === selectedBankGuid)) == null ? void 0 : _a.AccountDisplayString : "Select a Bank",
1068
- before: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1049
+ onClick: (e) => handleBankSelect(e, bank.CustBankGUID),
1050
+ selected: selectedMethod === "ACHPayment" && selectedBankGuid === bank.CustBankGUID,
1051
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1069
1052
  Radio,
1070
1053
  {
1071
- checked: !!selectedBankGuid && selectedMethod === "ACHPayment"
1054
+ label: `Pay by ${bank.AccountDisplayString}`,
1055
+ checked: selectedMethod === "ACHPayment" && selectedBankGuid === bank.CustBankGUID
1072
1056
  }
1073
- ),
1074
- onClick: () => setIsOpen((prev) => !prev),
1075
- children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Stack, { sizing: "layout-group", width: "full", children: [
1076
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1077
- Stack,
1078
- {
1079
- sizing: "layout-group",
1080
- width: "full",
1081
- overflowY: "auto",
1082
- maxHeight: 200,
1083
- children: customerBanks.map((bank) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1084
- Card,
1085
- {
1086
- className: (0, import_clsx12.default)(
1087
- "transition-colors duration-300 py-desktop-compact-layout-padding cursor-pointer hover:bg-background-secondary-normal/30",
1088
- selectedBankGuid === bank.CustBankGUID && "bg-background-secondary-normal/20"
1089
- ),
1090
- onClick: (e) => handleBankSelect(e, bank.CustBankGUID),
1091
- children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Stack, { horizontal: true, items: "center", justify: "between", children: [
1092
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Stack, { sizing: "layout-group", horizontal: true, items: "center", children: [
1093
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Icon, { name: "question_mark" }),
1094
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Paragraph, { children: bank.AccountDisplayString })
1095
- ] }),
1096
- selectedBankGuid === bank.CustBankGUID && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Icon, { name: "check" })
1097
- ] })
1098
- },
1099
- bank.CustBankGUID
1100
- ))
1101
- }
1102
- ),
1103
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Button, { className: "w-full", onClick: onPay, disabled: isPayLoading, children: isPayLoading ? "Processing..." : "Submit Payment" })
1104
- ] })
1105
- }
1106
- );
1057
+ )
1058
+ },
1059
+ bank.CustBankGUID
1060
+ )) });
1107
1061
  }
1108
1062
  function CreditsSelector(props) {
1109
1063
  const { selectedCredits, allCredits, setSelectedCredits } = props;
@@ -1138,24 +1092,21 @@ function CreditsSelector(props) {
1138
1092
  items: "center",
1139
1093
  sizing: "layout-group",
1140
1094
  children: [
1141
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
1095
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1142
1096
  Stack,
1143
1097
  {
1144
- horizontal: true,
1145
- items: "center",
1146
1098
  sizing: "layout-group",
1147
1099
  onClick: () => handleCreditSelect(credits),
1148
1100
  paddingY: true,
1149
- children: [
1150
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1151
- Checkbox,
1152
- {
1153
- checked: selectedCredits == null ? void 0 : selectedCredits.includes(credits),
1154
- onChange: () => handleCreditSelect(credits)
1155
- }
1156
- ),
1157
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Paragraph, { children: credits.InvoiceNumber })
1158
- ]
1101
+ flexGrow: 1,
1102
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1103
+ Checkbox,
1104
+ {
1105
+ label: credits.InvoiceNumber,
1106
+ checked: selectedCredits == null ? void 0 : selectedCredits.includes(credits),
1107
+ onChange: () => handleCreditSelect(credits)
1108
+ }
1109
+ )
1159
1110
  }
1160
1111
  ),
1161
1112
  /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Subheader, { className: " pr-desktop-component-padding", children: [
@@ -1,15 +1,15 @@
1
1
  "use client";
2
2
  import {
3
3
  SelectPaymentMethod
4
- } from "../chunk-KYMBBPEW.js";
4
+ } from "../chunk-FWRT5E5M.js";
5
5
  import "../chunk-TTO4PL7Y.js";
6
6
  import "../chunk-3ZUSYRI7.js";
7
7
  import "../chunk-WT5XXW6G.js";
8
8
  import "../chunk-5UH6QUFB.js";
9
9
  import "../chunk-O4M2GISS.js";
10
- import "../chunk-QDFQ3B4N.js";
10
+ import "../chunk-XEUPUTYP.js";
11
11
  import "../chunk-EO3JJWFW.js";
12
- import "../chunk-JOMM4KBH.js";
12
+ import "../chunk-4OS6APPF.js";
13
13
  import "../chunk-VG4EPHJA.js";
14
14
  import "../chunk-L364HTYC.js";
15
15
  import "../chunk-IGQVA7SC.js";
@@ -4206,12 +4206,13 @@ var Stack = (_a) => {
4206
4206
  var import_clsx26 = __toESM(require("clsx"), 1);
4207
4207
  var import_jsx_runtime29 = require("react/jsx-runtime");
4208
4208
  function Card(props) {
4209
- const _a = props, { children } = _a, rest = __objRest(_a, ["children"]);
4209
+ const _a = props, { children, selected } = _a, rest = __objRest(_a, ["children", "selected"]);
4210
4210
  return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4211
4211
  "div",
4212
4212
  __spreadProps(__spreadValues({}, rest), {
4213
4213
  className: (0, import_clsx26.default)(
4214
- "border rounded-sm border-border-primary-normal p-desktop-layout-padding",
4214
+ "rounded-sm p-desktop-layout-padding",
4215
+ selected ? "border-2 border-border-primary-focus" : "border border-border-primary-normal",
4215
4216
  rest.className
4216
4217
  ),
4217
4218
  children
@@ -4255,9 +4256,9 @@ function Accordion(props) {
4255
4256
  {
4256
4257
  className: (0, import_clsx27.default)(
4257
4258
  "overflow-hidden select-none cursor-pointer",
4258
- className,
4259
- isOpen && "border-2 !border-border-primary-focus"
4259
+ className
4260
4260
  ),
4261
+ selected: isOpen,
4261
4262
  onClick: handleClick,
4262
4263
  children: [
4263
4264
  /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Stack, { sizing: "component", horizontal: true, justify: "between", items: "center", children: [
@@ -4413,9 +4414,6 @@ var RadioIcon = ({ className }) => {
4413
4414
  };
4414
4415
  RadioIcon.displayName = "RadioIcon";
4415
4416
 
4416
- // src/components/SelectPaymentMethod.tsx
4417
- var import_clsx30 = __toESM(require("clsx"), 1);
4418
-
4419
4417
  // src/components/HorizontalDivider.tsx
4420
4418
  var import_clsx29 = __toESM(require("clsx"), 1);
4421
4419
  var import_jsx_runtime32 = require("react/jsx-runtime");
@@ -4470,10 +4468,10 @@ function SelectPaymentMethod(props) {
4470
4468
  Accordion,
4471
4469
  {
4472
4470
  isOpen: selectedMethod === "CCPayment",
4473
- title: "Pay by Credit/Debit Card",
4474
- before: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4471
+ title: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4475
4472
  Radio,
4476
4473
  {
4474
+ label: "Pay by Credit/Debit Card",
4477
4475
  checked: selectedMethod === "CCPayment",
4478
4476
  onClick: (e) => e.preventDefault()
4479
4477
  }
@@ -4481,82 +4479,38 @@ function SelectPaymentMethod(props) {
4481
4479
  onClick: () => handleToggle(selectedMethod === "CCPayment" ? null : "CCPayment"),
4482
4480
  children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Button, { className: "w-full", onClick: onPay, disabled: isPayLoading, children: isPayLoading ? "Processing..." : "Proceed to Payment" })
4483
4481
  }
4484
- )
4482
+ ),
4483
+ selectedMethod === "ACHPayment" && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Button, { block: true, onClick: onPay, disabled: isPayLoading, children: isPayLoading ? "Processing..." : "Submit Payment" })
4485
4484
  ] });
4486
4485
  }
4487
4486
  function ACHSelector(props) {
4488
- var _a;
4489
4487
  const {
4490
4488
  selectedMethod,
4491
4489
  handleToggle,
4492
4490
  selectedBankGuid,
4493
4491
  setSelectedBankGuid,
4494
- customerBanks,
4495
- onPay,
4496
- isPayLoading
4492
+ customerBanks
4497
4493
  } = props;
4498
- const [isOpen, setIsOpen] = (0, import_react20.useState)(false);
4499
- (0, import_react20.useEffect)(() => {
4500
- if (selectedMethod === "CCPayment") return setIsOpen(false);
4501
- }, [selectedMethod]);
4502
- (0, import_react20.useEffect)(() => {
4503
- if (isOpen) {
4504
- if (!selectedBankGuid) {
4505
- setSelectedBankGuid(customerBanks[0].CustBankGUID);
4506
- }
4507
- handleToggle("ACHPayment");
4508
- return;
4509
- }
4510
- }, [isOpen]);
4511
4494
  function handleBankSelect(e, bankGuid) {
4512
4495
  e.stopPropagation();
4513
4496
  setSelectedBankGuid(bankGuid);
4514
4497
  handleToggle("ACHPayment");
4515
4498
  }
4516
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4517
- Accordion,
4499
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_jsx_runtime33.Fragment, { children: customerBanks.map((bank) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4500
+ Card,
4518
4501
  {
4519
- isOpen,
4520
- title: selectedBankGuid ? (_a = customerBanks.find((bank) => bank.CustBankGUID === selectedBankGuid)) == null ? void 0 : _a.AccountDisplayString : "Select a Bank",
4521
- before: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4502
+ onClick: (e) => handleBankSelect(e, bank.CustBankGUID),
4503
+ selected: selectedMethod === "ACHPayment" && selectedBankGuid === bank.CustBankGUID,
4504
+ children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4522
4505
  Radio,
4523
4506
  {
4524
- checked: !!selectedBankGuid && selectedMethod === "ACHPayment"
4507
+ label: `Pay by ${bank.AccountDisplayString}`,
4508
+ checked: selectedMethod === "ACHPayment" && selectedBankGuid === bank.CustBankGUID
4525
4509
  }
4526
- ),
4527
- onClick: () => setIsOpen((prev) => !prev),
4528
- children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Stack, { sizing: "layout-group", width: "full", children: [
4529
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4530
- Stack,
4531
- {
4532
- sizing: "layout-group",
4533
- width: "full",
4534
- overflowY: "auto",
4535
- maxHeight: 200,
4536
- children: customerBanks.map((bank) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4537
- Card,
4538
- {
4539
- className: (0, import_clsx30.default)(
4540
- "transition-colors duration-300 py-desktop-compact-layout-padding cursor-pointer hover:bg-background-secondary-normal/30",
4541
- selectedBankGuid === bank.CustBankGUID && "bg-background-secondary-normal/20"
4542
- ),
4543
- onClick: (e) => handleBankSelect(e, bank.CustBankGUID),
4544
- children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Stack, { horizontal: true, items: "center", justify: "between", children: [
4545
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Stack, { sizing: "layout-group", horizontal: true, items: "center", children: [
4546
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Icon, { name: "question_mark" }),
4547
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Paragraph, { children: bank.AccountDisplayString })
4548
- ] }),
4549
- selectedBankGuid === bank.CustBankGUID && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Icon, { name: "check" })
4550
- ] })
4551
- },
4552
- bank.CustBankGUID
4553
- ))
4554
- }
4555
- ),
4556
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Button, { className: "w-full", onClick: onPay, disabled: isPayLoading, children: isPayLoading ? "Processing..." : "Submit Payment" })
4557
- ] })
4558
- }
4559
- );
4510
+ )
4511
+ },
4512
+ bank.CustBankGUID
4513
+ )) });
4560
4514
  }
4561
4515
  function CreditsSelector(props) {
4562
4516
  const { selectedCredits, allCredits, setSelectedCredits } = props;
@@ -4591,24 +4545,21 @@ function CreditsSelector(props) {
4591
4545
  items: "center",
4592
4546
  sizing: "layout-group",
4593
4547
  children: [
4594
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
4548
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4595
4549
  Stack,
4596
4550
  {
4597
- horizontal: true,
4598
- items: "center",
4599
4551
  sizing: "layout-group",
4600
4552
  onClick: () => handleCreditSelect(credits),
4601
4553
  paddingY: true,
4602
- children: [
4603
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4604
- Checkbox,
4605
- {
4606
- checked: selectedCredits == null ? void 0 : selectedCredits.includes(credits),
4607
- onChange: () => handleCreditSelect(credits)
4608
- }
4609
- ),
4610
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Paragraph, { children: credits.InvoiceNumber })
4611
- ]
4554
+ flexGrow: 1,
4555
+ children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4556
+ Checkbox,
4557
+ {
4558
+ label: credits.InvoiceNumber,
4559
+ checked: selectedCredits == null ? void 0 : selectedCredits.includes(credits),
4560
+ onChange: () => handleCreditSelect(credits)
4561
+ }
4562
+ )
4612
4563
  }
4613
4564
  ),
4614
4565
  /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Subheader, { className: " pr-desktop-component-padding", children: [
@@ -6,8 +6,8 @@ import {
6
6
  } from "../chunk-Y4HUYAI5.js";
7
7
  import {
8
8
  PaymentOnAccountModal
9
- } from "../chunk-OX3HKFIH.js";
10
- import "../chunk-KYMBBPEW.js";
9
+ } from "../chunk-22CQ3BSY.js";
10
+ import "../chunk-FWRT5E5M.js";
11
11
  import "../chunk-TTO4PL7Y.js";
12
12
  import "../chunk-QIHDPSOM.js";
13
13
  import "../chunk-4RJKB7LC.js";
@@ -53,11 +53,11 @@ import {
53
53
  } from "../chunk-O4M2GISS.js";
54
54
  import {
55
55
  Accordion
56
- } from "../chunk-QDFQ3B4N.js";
56
+ } from "../chunk-XEUPUTYP.js";
57
57
  import "../chunk-EO3JJWFW.js";
58
58
  import {
59
59
  Card
60
- } from "../chunk-JOMM4KBH.js";
60
+ } from "../chunk-4OS6APPF.js";
61
61
  import {
62
62
  Paragraph
63
63
  } from "../chunk-VG4EPHJA.js";
package/dist/index.css CHANGED
@@ -1233,9 +1233,6 @@
1233
1233
  --tw-border-style: solid;
1234
1234
  border-style: solid;
1235
1235
  }
1236
- .\!border-border-primary-focus {
1237
- border-color: var(--color-border-primary-focus) !important;
1238
- }
1239
1236
  .border-action-400 {
1240
1237
  border-color: var(--color-action-400);
1241
1238
  }
@@ -1260,6 +1257,9 @@
1260
1257
  .border-border-primary-error {
1261
1258
  border-color: var(--color-border-primary-error);
1262
1259
  }
1260
+ .border-border-primary-focus {
1261
+ border-color: var(--color-border-primary-focus);
1262
+ }
1263
1263
  .border-border-primary-normal {
1264
1264
  border-color: var(--color-border-primary-normal);
1265
1265
  }
@@ -1383,12 +1383,6 @@
1383
1383
  .bg-background-secondary-normal {
1384
1384
  background-color: var(--color-background-secondary-normal);
1385
1385
  }
1386
- .bg-background-secondary-normal\/20 {
1387
- background-color: color-mix(in srgb, #c1c1c1 20%, transparent);
1388
- @supports (color: color-mix(in lab, red, red)) {
1389
- background-color: color-mix(in oklab, var(--color-background-secondary-normal) 20%, transparent);
1390
- }
1391
- }
1392
1386
  .bg-background-success-normal {
1393
1387
  background-color: var(--color-background-success-normal);
1394
1388
  }
@@ -1878,9 +1872,6 @@
1878
1872
  .py-\[calc\(var\(--spacing-mobile-component-padding\)_\+_3px\)\] {
1879
1873
  padding-block: calc(var(--spacing-mobile-component-padding) + 3px);
1880
1874
  }
1881
- .py-desktop-compact-layout-padding {
1882
- padding-block: var(--spacing-desktop-compact-layout-padding);
1883
- }
1884
1875
  .py-desktop-component-padding {
1885
1876
  padding-block: var(--spacing-desktop-component-padding);
1886
1877
  }
@@ -2879,16 +2870,6 @@
2879
2870
  }
2880
2871
  }
2881
2872
  }
2882
- .hover\:bg-background-secondary-normal\/30 {
2883
- &:hover {
2884
- @media (hover: hover) {
2885
- background-color: color-mix(in srgb, #c1c1c1 30%, transparent);
2886
- @supports (color: color-mix(in lab, red, red)) {
2887
- background-color: color-mix(in oklab, var(--color-background-secondary-normal) 30%, transparent);
2888
- }
2889
- }
2890
- }
2891
- }
2892
2873
  .hover\:bg-border-action-hover {
2893
2874
  &:hover {
2894
2875
  @media (hover: hover) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dmsi/wedgekit-react",
3
3
  "private": false,
4
- "version": "0.0.120",
4
+ "version": "0.0.121",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "build": "tsup",
@@ -45,8 +45,8 @@ export function Accordion(props: AccordionProps) {
45
45
  className={clsx(
46
46
  "overflow-hidden select-none cursor-pointer",
47
47
  className,
48
- isOpen && "border-2 !border-border-primary-focus",
49
48
  )}
49
+ selected={isOpen}
50
50
  onClick={handleClick}
51
51
  >
52
52
  <Stack sizing="component" horizontal justify="between" items="center">
@@ -1,13 +1,14 @@
1
1
  import clsx from "clsx";
2
2
  import { HTMLProps } from "react";
3
3
 
4
- export function Card(props: HTMLProps<HTMLDivElement>) {
5
- const { children, ...rest } = props;
4
+ export function Card(props: HTMLProps<HTMLDivElement> & { selected?: boolean; }) {
5
+ const { children, selected, ...rest } = props;
6
6
  return (
7
7
  <div
8
8
  {...rest}
9
9
  className={clsx(
10
- "border rounded-sm border-border-primary-normal p-desktop-layout-padding",
10
+ "rounded-sm p-desktop-layout-padding",
11
+ selected ? "border-2 border-border-primary-focus" : "border border-border-primary-normal",
11
12
  rest.className,
12
13
  )}
13
14
  >
@@ -1,14 +1,12 @@
1
1
  "use client";
2
2
 
3
- import { useEffect, useState } from "react";
3
+ import { useState } from "react";
4
4
  import { Accordion } from "./Accordion";
5
5
  import { Button } from "./Button";
6
6
  import { Card } from "./Card";
7
- import { Icon } from "./Icon";
8
7
  import { Paragraph } from "./Paragraph";
9
8
  import { Radio } from "./Radio";
10
9
  import { Stack } from "./Stack";
11
- import clsx from "clsx";
12
10
  import { Checkbox } from "./Checkbox";
13
11
  import { Subheader } from "./Subheader";
14
12
  import { formatCurrencyDisplay } from "../utils/formatting";
@@ -82,9 +80,9 @@ export function SelectPaymentMethod(props: SelectPaymentMethodProps) {
82
80
  {allowedMethods?.includes("CCPayment") && (
83
81
  <Accordion
84
82
  isOpen={selectedMethod === "CCPayment"}
85
- title="Pay by Credit/Debit Card"
86
- before={
83
+ title={
87
84
  <Radio
85
+ label="Pay by Credit/Debit Card"
88
86
  checked={selectedMethod === "CCPayment"}
89
87
  onClick={(e) => e.preventDefault()}
90
88
  />
@@ -98,6 +96,12 @@ export function SelectPaymentMethod(props: SelectPaymentMethodProps) {
98
96
  </Button>
99
97
  </Accordion>
100
98
  )}
99
+
100
+ {selectedMethod === "ACHPayment" && (
101
+ <Button block onClick={onPay} disabled={isPayLoading}>
102
+ {isPayLoading ? "Processing..." : "Submit Payment"}
103
+ </Button>
104
+ )}
101
105
  </Stack>
102
106
  );
103
107
  }
@@ -118,24 +122,7 @@ function ACHSelector(props: ACHSelectorProps) {
118
122
  selectedBankGuid,
119
123
  setSelectedBankGuid,
120
124
  customerBanks,
121
- onPay,
122
- isPayLoading,
123
125
  } = props;
124
- const [isOpen, setIsOpen] = useState<boolean>(false);
125
-
126
- useEffect(() => {
127
- if (selectedMethod === "CCPayment") return setIsOpen(false);
128
- }, [selectedMethod]);
129
-
130
- useEffect(() => {
131
- if (isOpen) {
132
- if (!selectedBankGuid) {
133
- setSelectedBankGuid(customerBanks[0]!.CustBankGUID);
134
- }
135
- handleToggle("ACHPayment");
136
- return;
137
- }
138
- }, [isOpen]);
139
126
 
140
127
  function handleBankSelect(
141
128
  e: React.MouseEvent<HTMLDivElement>,
@@ -146,57 +133,20 @@ function ACHSelector(props: ACHSelectorProps) {
146
133
  handleToggle("ACHPayment");
147
134
  }
148
135
 
149
- return (
150
- <Accordion
151
- isOpen={isOpen}
152
- title={
153
- selectedBankGuid
154
- ? customerBanks.find((bank) => bank.CustBankGUID === selectedBankGuid)
155
- ?.AccountDisplayString
156
- : "Select a Bank"
157
- }
158
- before={
136
+ return <>
137
+ {customerBanks.map((bank) => (
138
+ <Card
139
+ key={bank.CustBankGUID}
140
+ onClick={(e) => handleBankSelect(e, bank.CustBankGUID)}
141
+ selected={selectedMethod === "ACHPayment" && selectedBankGuid === bank.CustBankGUID}
142
+ >
159
143
  <Radio
160
- checked={!!selectedBankGuid && selectedMethod === "ACHPayment"}
144
+ label={`Pay by ${bank.AccountDisplayString}`}
145
+ checked={selectedMethod === "ACHPayment" && selectedBankGuid === bank.CustBankGUID}
161
146
  />
162
- }
163
- onClick={() => setIsOpen((prev) => !prev)}
164
- >
165
- <Stack sizing="layout-group" width="full">
166
- <Stack
167
- sizing="layout-group"
168
- width="full"
169
- overflowY="auto"
170
- maxHeight={200}
171
- >
172
- {customerBanks.map((bank) => (
173
- <Card
174
- className={clsx(
175
- "transition-colors duration-300 py-desktop-compact-layout-padding cursor-pointer hover:bg-background-secondary-normal/30",
176
- selectedBankGuid === bank.CustBankGUID &&
177
- "bg-background-secondary-normal/20",
178
- )}
179
- key={bank.CustBankGUID}
180
- onClick={(e) => handleBankSelect(e, bank.CustBankGUID)}
181
- >
182
- <Stack horizontal items="center" justify="between">
183
- <Stack sizing="layout-group" horizontal items="center">
184
- <Icon name="question_mark" />
185
- <Paragraph>{bank.AccountDisplayString}</Paragraph>
186
- </Stack>
187
- {selectedBankGuid === bank.CustBankGUID && (
188
- <Icon name="check" />
189
- )}
190
- </Stack>
191
- </Card>
192
- ))}
193
- </Stack>
194
- <Button className="w-full" onClick={onPay} disabled={isPayLoading}>
195
- {isPayLoading ? "Processing..." : "Submit Payment"}
196
- </Button>
197
- </Stack>
198
- </Accordion>
199
- );
147
+ </Card>
148
+ ))}
149
+ </>;
200
150
  }
201
151
  type CreditsSelectorProps = {
202
152
  selectedCredits: unknown[];
@@ -246,18 +196,18 @@ function CreditsSelector(props: CreditsSelectorProps) {
246
196
  sizing="layout-group"
247
197
  >
248
198
  <Stack
249
- horizontal
250
- items="center"
251
199
  sizing="layout-group"
252
200
  onClick={() => handleCreditSelect(credits)}
253
201
  paddingY
202
+ flexGrow={1}
254
203
  >
255
204
  <Checkbox
205
+ label={credits.InvoiceNumber}
256
206
  checked={selectedCredits?.includes(credits)}
257
207
  onChange={() => handleCreditSelect(credits)}
258
208
  />
259
- <Paragraph>{credits.InvoiceNumber}</Paragraph>
260
209
  </Stack>
210
+
261
211
  <Subheader className=" pr-desktop-component-padding">
262
212
  ${formatCurrencyDisplay(`${Math.abs(credits.InvoiceBalance)}`)}
263
213
  </Subheader>