payment-kit 1.18.37 → 1.18.39

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 (51) hide show
  1. package/api/src/integrations/stripe/handlers/invoice.ts +22 -0
  2. package/api/src/integrations/stripe/handlers/payment-intent.ts +9 -1
  3. package/api/src/integrations/stripe/handlers/subscription.ts +137 -1
  4. package/api/src/queues/payment.ts +4 -0
  5. package/api/src/routes/subscriptions.ts +24 -17
  6. package/blocklet.yml +1 -1
  7. package/package.json +20 -20
  8. package/src/app.tsx +124 -125
  9. package/src/components/chart.tsx +19 -5
  10. package/src/components/customer/notification-preference.tsx +6 -5
  11. package/src/components/date-range-picker.tsx +1 -16
  12. package/src/components/drawer-form.tsx +4 -3
  13. package/src/components/filter-toolbar.tsx +49 -34
  14. package/src/components/info-card.tsx +9 -7
  15. package/src/components/invoice-pdf/pdf.tsx +1 -1
  16. package/src/components/layout/admin.tsx +2 -2
  17. package/src/components/metadata/form.tsx +3 -2
  18. package/src/components/metadata/list.tsx +1 -1
  19. package/src/components/payment-link/chrome.tsx +0 -1
  20. package/src/components/payment-link/item.tsx +1 -1
  21. package/src/components/payment-link/preview.tsx +3 -1
  22. package/src/components/price/currency-select.tsx +1 -1
  23. package/src/components/pricing-table/payment-settings.tsx +1 -1
  24. package/src/components/pricing-table/preview.tsx +3 -1
  25. package/src/components/pricing-table/product-item.tsx +1 -1
  26. package/src/components/subscription/portal/actions.tsx +134 -24
  27. package/src/components/subscription/portal/list.tsx +3 -2
  28. package/src/components/uploader.tsx +2 -1
  29. package/src/components/webhook/attempts.tsx +1 -1
  30. package/src/global.css +0 -7
  31. package/src/pages/admin/developers/webhooks/detail.tsx +2 -2
  32. package/src/pages/admin/index.tsx +2 -2
  33. package/src/pages/admin/overview.tsx +1 -1
  34. package/src/pages/admin/payments/intents/detail.tsx +5 -2
  35. package/src/pages/admin/payments/payouts/detail.tsx +1 -1
  36. package/src/pages/admin/payments/refunds/detail.tsx +1 -1
  37. package/src/pages/admin/products/prices/list.tsx +7 -2
  38. package/src/pages/admin/products/pricing-tables/create.tsx +2 -2
  39. package/src/pages/admin/settings/payment-methods/index.tsx +7 -4
  40. package/src/pages/admin/settings/vault-config/index.tsx +3 -2
  41. package/src/pages/checkout/pricing-table.tsx +1 -1
  42. package/src/pages/customer/index.tsx +4 -3
  43. package/src/pages/customer/invoice/detail.tsx +1 -1
  44. package/src/pages/customer/payout/detail.tsx +1 -1
  45. package/src/pages/customer/recharge/account.tsx +3 -4
  46. package/src/pages/customer/recharge/subscription.tsx +3 -4
  47. package/src/pages/customer/subscription/detail.tsx +4 -1
  48. package/src/pages/customer/subscription/embed.tsx +2 -2
  49. package/src/pages/integrations/donations/preview.tsx +12 -10
  50. package/src/pages/integrations/index.tsx +1 -1
  51. package/src/pages/integrations/overview.tsx +2 -4
package/src/app.tsx CHANGED
@@ -2,8 +2,7 @@ import './global.css';
2
2
 
3
3
  import Center from '@arcblock/ux/lib/Center';
4
4
  import withTracker from '@arcblock/ux/lib/withTracker';
5
- import { LocaleProvider } from '@arcblock/ux/lib/Locale/context';
6
- // import { createTheme } from '@arcblock/ux/lib/Theme';
5
+ import { ConfigProvider } from '@arcblock/ux/lib/Config';
7
6
  import { ToastProvider } from '@arcblock/ux/lib/Toast';
8
7
  import { CircularProgress } from '@mui/material';
9
8
  import React, { Suspense } from 'react';
@@ -45,118 +44,116 @@ const CustomerBalanceRecharge = React.lazy(() => import('./pages/customer/rechar
45
44
  function App() {
46
45
  return (
47
46
  <TransitionProvider>
48
- <LocaleProvider translations={translations} fallbackLocale="en">
49
- <ErrorBoundary FallbackComponent={ErrorFallback} onReset={window.location.reload}>
50
- <Suspense
51
- fallback={
52
- <Center>
53
- <CircularProgress />
54
- </Center>
55
- }>
56
- <Routes>
57
- <Route path="/" element={<HomePage />} />
58
- <Route path="/checkout/:action/:id" element={<CheckoutPage />} />
59
- <Route key="admin-index" path="/admin" element={<AdminPage />} />,
60
- <Route key="admin-tabs" path="/admin/:group" element={<AdminPage />} />,
61
- <Route key="admin-sub" path="/admin/:group/:page" element={<AdminPage />} />,
62
- <Route key="admin-fallback" path="/admin/*" element={<AdminPage />} />,
63
- <Route key="integrations-index" path="/integrations" element={<IntegrationsPage />} />
64
- <Route key="integrations-tabs" path="/integrations/:group" element={<IntegrationsPage />} />
65
- <Route key="integrations-sub" path="/integrations/:group/:page" element={<IntegrationsPage />} />
66
- <Route key="integrations-fallback" path="/integrations/*" element={<IntegrationsPage />} />
67
- <Route
68
- key="customer-home"
69
- path="/customer"
70
- element={
71
- <UserLayout>
72
- <CustomerHome />
73
- </UserLayout>
74
- }
75
- />
76
- <Route
77
- key="customer-subscription"
78
- path="/customer/subscription/:id"
79
- element={
80
- <UserLayout>
81
- <CustomerSubscriptionDetail />
82
- </UserLayout>
83
- }
84
- />
85
- <Route
86
- key="customer-subscription-change-plan"
87
- path="/customer/subscription/:id/change-plan"
88
- element={
89
- <UserLayout>
90
- <CustomerSubscriptionChangePlan />
91
- </UserLayout>
92
- }
93
- />
94
- <Route
95
- key="customer-subscription-change-payment"
96
- path="/customer/subscription/:id/change-payment"
97
- element={
98
- <UserLayout>
99
- <CustomerSubscriptionChangePayment />
100
- </UserLayout>
101
- }
102
- />
103
- <Route
104
- key="customer-recharge"
105
- path="/customer/subscription/:id/recharge"
106
- element={
107
- <UserLayout>
108
- <CustomerRecharge />
109
- </UserLayout>
110
- }
111
- />
112
- <Route
113
- key="customer-balance-recharge"
114
- path="/customer/recharge/:currencyId"
115
- element={
116
- <UserLayout>
117
- <CustomerBalanceRecharge />
118
- </UserLayout>
119
- }
120
- />
121
- <Route key="customer-embed" path="/customer/embed/subscription" element={<CustomerSubscriptionEmbed />} />
122
- <Route
123
- key="subscription-embed"
124
- path="/embed/customer/subscription"
125
- element={<CustomerSubscriptionEmbed />}
126
- />
127
- <Route
128
- key="customer-due"
129
- path="/customer/invoice/past-due"
130
- element={
131
- <UserLayout>
132
- <CustomerInvoicePastDue />
133
- </UserLayout>
134
- }
135
- />
136
- <Route
137
- key="customer-invoice"
138
- path="/customer/invoice/:id"
139
- element={
140
- <UserLayout>
141
- <CustomerInvoiceDetail />
142
- </UserLayout>
143
- }
144
- />
145
- <Route
146
- key="customer-payout"
147
- path="/customer/payout/:id"
148
- element={
149
- <UserLayout>
150
- <CustomerPayoutDetail />
151
- </UserLayout>
152
- }
153
- />
154
- <Route key="customer-fallback" path="/customer/*" element={<Navigate to="/customer" />} />,
155
- <Route path="*" element={<Navigate to="/" />} />
156
- </Routes>
157
- </Suspense>
158
- </ErrorBoundary>
159
- </LocaleProvider>
47
+ <ErrorBoundary FallbackComponent={ErrorFallback} onReset={window.location.reload}>
48
+ <Suspense
49
+ fallback={
50
+ <Center>
51
+ <CircularProgress />
52
+ </Center>
53
+ }>
54
+ <Routes>
55
+ <Route path="/" element={<HomePage />} />
56
+ <Route path="/checkout/:action/:id" element={<CheckoutPage />} />
57
+ <Route key="admin-index" path="/admin" element={<AdminPage />} />,
58
+ <Route key="admin-tabs" path="/admin/:group" element={<AdminPage />} />,
59
+ <Route key="admin-sub" path="/admin/:group/:page" element={<AdminPage />} />,
60
+ <Route key="admin-fallback" path="/admin/*" element={<AdminPage />} />,
61
+ <Route key="integrations-index" path="/integrations" element={<IntegrationsPage />} />
62
+ <Route key="integrations-tabs" path="/integrations/:group" element={<IntegrationsPage />} />
63
+ <Route key="integrations-sub" path="/integrations/:group/:page" element={<IntegrationsPage />} />
64
+ <Route key="integrations-fallback" path="/integrations/*" element={<IntegrationsPage />} />
65
+ <Route
66
+ key="customer-home"
67
+ path="/customer"
68
+ element={
69
+ <UserLayout>
70
+ <CustomerHome />
71
+ </UserLayout>
72
+ }
73
+ />
74
+ <Route
75
+ key="customer-subscription"
76
+ path="/customer/subscription/:id"
77
+ element={
78
+ <UserLayout>
79
+ <CustomerSubscriptionDetail />
80
+ </UserLayout>
81
+ }
82
+ />
83
+ <Route
84
+ key="customer-subscription-change-plan"
85
+ path="/customer/subscription/:id/change-plan"
86
+ element={
87
+ <UserLayout>
88
+ <CustomerSubscriptionChangePlan />
89
+ </UserLayout>
90
+ }
91
+ />
92
+ <Route
93
+ key="customer-subscription-change-payment"
94
+ path="/customer/subscription/:id/change-payment"
95
+ element={
96
+ <UserLayout>
97
+ <CustomerSubscriptionChangePayment />
98
+ </UserLayout>
99
+ }
100
+ />
101
+ <Route
102
+ key="customer-recharge"
103
+ path="/customer/subscription/:id/recharge"
104
+ element={
105
+ <UserLayout>
106
+ <CustomerRecharge />
107
+ </UserLayout>
108
+ }
109
+ />
110
+ <Route
111
+ key="customer-balance-recharge"
112
+ path="/customer/recharge/:currencyId"
113
+ element={
114
+ <UserLayout>
115
+ <CustomerBalanceRecharge />
116
+ </UserLayout>
117
+ }
118
+ />
119
+ <Route key="customer-embed" path="/customer/embed/subscription" element={<CustomerSubscriptionEmbed />} />
120
+ <Route
121
+ key="subscription-embed"
122
+ path="/embed/customer/subscription"
123
+ element={<CustomerSubscriptionEmbed />}
124
+ />
125
+ <Route
126
+ key="customer-due"
127
+ path="/customer/invoice/past-due"
128
+ element={
129
+ <UserLayout>
130
+ <CustomerInvoicePastDue />
131
+ </UserLayout>
132
+ }
133
+ />
134
+ <Route
135
+ key="customer-invoice"
136
+ path="/customer/invoice/:id"
137
+ element={
138
+ <UserLayout>
139
+ <CustomerInvoiceDetail />
140
+ </UserLayout>
141
+ }
142
+ />
143
+ <Route
144
+ key="customer-payout"
145
+ path="/customer/payout/:id"
146
+ element={
147
+ <UserLayout>
148
+ <CustomerPayoutDetail />
149
+ </UserLayout>
150
+ }
151
+ />
152
+ <Route key="customer-fallback" path="/customer/*" element={<Navigate to="/customer" />} />,
153
+ <Route path="*" element={<Navigate to="/" />} />
154
+ </Routes>
155
+ </Suspense>
156
+ </ErrorBoundary>
160
157
  </TransitionProvider>
161
158
  );
162
159
  }
@@ -170,16 +167,18 @@ export default function WrappedApp() {
170
167
  usePreventWheel();
171
168
 
172
169
  return (
173
- <ToastProvider>
174
- <PaymentThemeProvider>
175
- <SessionProvider
176
- serviceHost={prefix}
177
- protectedRoutes={['/admin/*', '/customer/*', '/integrations/*'].map((item) => joinURL(prefix, item))}>
178
- <Router basename={prefix}>
179
- <AppWithTracker />
180
- </Router>
181
- </SessionProvider>
182
- </PaymentThemeProvider>
183
- </ToastProvider>
170
+ <ConfigProvider translations={translations} fallbackLocale="en">
171
+ <ToastProvider>
172
+ <PaymentThemeProvider>
173
+ <SessionProvider
174
+ serviceHost={prefix}
175
+ protectedRoutes={['/admin/*', '/customer/*', '/integrations/*'].map((item) => joinURL(prefix, item))}>
176
+ <Router basename={prefix}>
177
+ <AppWithTracker />
178
+ </Router>
179
+ </SessionProvider>
180
+ </PaymentThemeProvider>
181
+ </ToastProvider>
182
+ </ConfigProvider>
184
183
  );
185
184
  }
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable react/require-default-props */
2
2
  import type { TPaymentCurrency, TPaymentMethod } from '@blocklet/payment-types';
3
- import { Box, Skeleton } from '@mui/material';
3
+ import { Box, Skeleton, useTheme } from '@mui/material';
4
4
  import { useState } from 'react';
5
5
  import { Area, AreaChart, CartesianGrid, Legend, ResponsiveContainer, Tooltip, XAxis, YAxis } from 'recharts';
6
6
 
@@ -18,6 +18,7 @@ export default function Chart({
18
18
  currencies: TCurrencyMap;
19
19
  height?: number;
20
20
  }) {
21
+ const theme = useTheme();
21
22
  const [series, setSeries] = useState<any>(
22
23
  Object.keys(currencies).reduce(
23
24
  (acc, key) => {
@@ -60,8 +61,10 @@ export default function Chart({
60
61
  left: 0,
61
62
  bottom: 0,
62
63
  }}>
63
- <CartesianGrid strokeDasharray="3 3" />
64
- <Tooltip />
64
+ <CartesianGrid strokeDasharray="3 3" stroke={theme.palette.grey[200]} />
65
+ <Tooltip
66
+ contentStyle={{ backgroundColor: theme.palette.background.paper, borderColor: theme.palette.grey[200] }}
67
+ />
65
68
  {Object.keys(currencies).map((x: string, i) => {
66
69
  const dataKey = currencies[x]?.symbol as string;
67
70
  const color = currencies[x]?.color as string;
@@ -84,8 +87,19 @@ export default function Chart({
84
87
  onMouseOver={onMouseOver}
85
88
  onMouseOut={onMouseOut}
86
89
  />
87
- <XAxis dataKey="timestamp" />
88
- <YAxis orientation="left" mirror tickLine tickMargin={2} />
90
+ <XAxis
91
+ dataKey="timestamp"
92
+ tick={{ fill: theme.palette.text.secondary }}
93
+ stroke={theme.palette.text.secondary}
94
+ />
95
+ <YAxis
96
+ orientation="left"
97
+ mirror
98
+ tickLine
99
+ tickMargin={2}
100
+ tick={{ fill: theme.palette.text.secondary }}
101
+ stroke={theme.palette.text.secondary}
102
+ />
89
103
  </AreaChart>
90
104
  </ResponsiveContainer>
91
105
  </Box>
@@ -79,6 +79,9 @@ function TimeSelector({
79
79
  size="small"
80
80
  sx={{
81
81
  minWidth: 'fit-content',
82
+ '& input::-webkit-calendar-picker-indicator': {
83
+ filter: (theme) => (theme.palette.mode === 'dark' ? 'invert(1) brightness(80%)' : 'none'),
84
+ },
82
85
  }}
83
86
  {...field}
84
87
  error={!!fieldState.error}
@@ -122,18 +125,16 @@ function DaySelector({
122
125
  display: 'flex',
123
126
  alignItems: 'center',
124
127
  justifyContent: 'space-between',
125
- backgroundColor: 'var(--backgrounds-bg-field)',
128
+ backgroundColor: 'grey.50',
126
129
  '&:hover, &:focus': {
127
130
  borderColor: 'primary.main',
128
131
  },
132
+ color: 'text.secondary',
129
133
  }}
130
134
  size="large"
131
135
  startIcon={<DateRangeOutlined fontSize="small" color="action" sx={{ fontSize: '1rem !important' }} />}
132
136
  endIcon={
133
- <Typography
134
- variant="caption"
135
- color="text.secondary"
136
- sx={{ fontSize: '0.75rem !important', lineHeight: 'normal' }}>
137
+ <Typography variant="caption" color="action" sx={{ fontSize: '0.75rem !important', lineHeight: 'normal' }}>
137
138
  {t('notification.preferences.day')}
138
139
  </Typography>
139
140
  }>
@@ -1,21 +1,6 @@
1
1
  import { DateRangePicker as DatePicker } from 'mui-daterange-picker';
2
2
  import type { DateRangePickerWrapperProps } from 'mui-daterange-picker/dist/components/DateRangePickerWrapper';
3
- import { ThemeProvider, useTheme } from '@mui/material/styles';
4
- import { create } from '@arcblock/ux/lib/Theme';
5
3
 
6
4
  export default function DateRangePicker(props: DateRangePickerWrapperProps) {
7
- const theme = useTheme();
8
- const merged = create({
9
- ...theme,
10
- palette: {
11
- primary: {
12
- main: '#0086FF',
13
- },
14
- },
15
- });
16
- return (
17
- <ThemeProvider theme={merged}>
18
- <DatePicker {...props} wrapperClassName="date-range-picker" />
19
- </ThemeProvider>
20
- );
5
+ return <DatePicker {...props} wrapperClassName="date-range-picker" />;
21
6
  }
@@ -68,7 +68,8 @@ export default function DrawerForm(props: Props) {
68
68
  pb: 2,
69
69
  pt: 2,
70
70
  gap: 1,
71
- borderBottom: '1px solid var(--stroke-sep, #EFF1F5)',
71
+ borderBottom: '1px solid',
72
+ borderColor: 'grey.200',
72
73
  '@media (max-width: 600px)': {
73
74
  '& > .addons-wrapper': {
74
75
  width: '100%',
@@ -120,13 +121,13 @@ const Container = styled<any>(Drawer)`
120
121
  }
121
122
  .drawer-form-footer {
122
123
  padding: 0 20px 24px;
123
- background: #fff;
124
+ background: ${({ theme }) => theme.palette.background.paper};
124
125
  }
125
126
  @media (max-width: ${({ theme }) => theme.breakpoints.values.sm}px) {
126
127
  .drawer-form-header-wrapper {
127
128
  position: sticky;
128
129
  top: 0;
129
- background: #fff;
130
+ background: ${({ theme }) => theme.palette.background.paper};
130
131
  z-index: 999;
131
132
  }
132
133
  .drawer-form-footer {
@@ -9,11 +9,12 @@ import {
9
9
  } from '@blocklet/payment-react';
10
10
  import type { TCustomer } from '@blocklet/payment-types';
11
11
  import { Add, Close } from '@mui/icons-material';
12
- import { Button, Menu, MenuItem } from '@mui/material';
12
+ import { Button, Menu, MenuItem, TextField } from '@mui/material';
13
13
  import { Box, styled } from '@mui/system';
14
14
  import { useEffect, useState } from 'react';
15
15
 
16
16
  import { flatten } from 'lodash';
17
+ import { useRequest } from 'ahooks';
17
18
  import { ProductsProvider, useProductsContext } from '../contexts/products';
18
19
  import InfoCard from './info-card';
19
20
  import ProductSelect from './payment-link/product-select';
@@ -236,28 +237,43 @@ function SearchCurrency({ setSearch, search }: Pick<Props, 'setSearch' | 'search
236
237
  function SearchCustomers({ setSearch, search }: Pick<Props, 'setSearch' | 'search'>) {
237
238
  const [customers, setCustomers] = useState<TCustomer[]>([]);
238
239
  const [show, setShow] = useState(null);
239
- const [text, setText] = useState('');
240
+ const [searchText, setSearchText] = useState('');
240
241
  const { t } = useLocaleContext();
241
242
 
242
- useEffect(() => {
243
- fetchUserData({
244
- q: {
245
- 'like-name': text,
246
- 'like-email': text,
247
- 'like-did': text,
248
- 'like-metadata': text,
249
- 'like-phone': text,
243
+ const customerRequest = useRequest(
244
+ (text: string) => {
245
+ return fetchUserData({
246
+ q: {
247
+ 'like-name': text,
248
+ 'like-email': text,
249
+ 'like-did': text,
250
+ 'like-metadata': text,
251
+ 'like-phone': text,
252
+ },
253
+ page: 1,
254
+ pageSize: 10,
255
+ });
256
+ },
257
+ {
258
+ onSuccess: (data) => {
259
+ setCustomers(data.list);
250
260
  },
251
- page: 1,
252
- pageSize: 10,
253
- }).then((data: any) => {
254
- setCustomers(data.list);
255
- });
256
- }, [text]);
261
+ debounceWait: 500,
262
+ }
263
+ );
264
+
265
+ useEffect(() => {
266
+ customerRequest.run(searchText);
267
+ }, [searchText]);
257
268
 
258
269
  return (
259
- <section onClick={(e: any) => setShow(e.currentTarget)}>
260
- <Button className="option-btn" variant="text">
270
+ <section>
271
+ <Button
272
+ className="option-btn"
273
+ variant="text"
274
+ onClick={(e) => {
275
+ setShow(e.currentTarget as any);
276
+ }}>
261
277
  {search!.customer_id ? (
262
278
  <Close
263
279
  sx={{ color: 'text.secondary', cursor: 'pointer', fontSize: '1.05rem' }}
@@ -283,23 +299,21 @@ function SearchCustomers({ setSearch, search }: Pick<Props, 'setSearch' | 'searc
283
299
  e.stopPropagation();
284
300
  setShow(null);
285
301
  }}>
286
- <section style={{ padding: '10px 10px 0 10px' }}>
287
- <input
288
- style={{
302
+ <Box sx={{ p: 1 }}>
303
+ <TextField
304
+ placeholder="Search customer"
305
+ size="small"
306
+ sx={{
289
307
  width: '100%',
290
- boxSizing: 'border-box',
291
- border: '1px solid #eee',
292
- padding: '5px 10px',
293
- borderRadius: '20px',
294
- marginBottom: '10px',
295
308
  }}
296
- type="text"
297
- placeholder="Search customer"
309
+ value={searchText}
298
310
  onChange={(e) => {
299
- setText(e.target.value);
311
+ setSearchText(e.target.value);
312
+ e.stopPropagation();
300
313
  }}
314
+ onClick={(e) => e.stopPropagation()}
301
315
  />
302
- </section>
316
+ </Box>
303
317
  {customers.map((x: any) => (
304
318
  <MenuItem
305
319
  key={x.id}
@@ -484,9 +498,9 @@ const Root = styled(Box)`
484
498
  display: flex;
485
499
  align-items: center;
486
500
  border-radius: 25px;
487
- background: #f6f6f6;
501
+ background: ${({ theme }) => theme.palette.grey[100]};
488
502
  padding: 5px 10px;
489
- color: #555;
503
+ color: ${({ theme }) => theme.palette.text.secondary};
490
504
  font-size: 14px;
491
505
  line-height: 14px;
492
506
  overflow: visible;
@@ -505,8 +519,9 @@ const Root = styled(Box)`
505
519
  0px 8px 10px 1px rgba(0, 0, 0, 0.14),
506
520
  0px 3px 14px 2px rgba(0, 0, 0, 0.12);
507
521
  padding: 0;
508
- background: #fff;
509
- border: 1px solid #eee;
522
+ background: ${({ theme }) => theme.palette.background.paper};
523
+ border: 1px solid;
524
+ border-color: ${({ theme }) => theme.palette.grey[100]};
510
525
  z-index: 999999;
511
526
  top: 15px;
512
527
  display: block;
@@ -61,21 +61,23 @@ export default function InfoCard(props: Props) {
61
61
  componentsProps={{
62
62
  tooltip: {
63
63
  sx: {
64
- bgcolor: (theme) => (theme.palette.mode === 'dark' ? '#2a2e37' : '#ffffff'),
65
- color: (theme) => (theme.palette.mode === 'dark' ? '#ffffff' : theme.palette.text.primary),
66
- boxShadow: '0 2px 10px rgba(0, 0, 0, 0.15)',
64
+ bgcolor: 'background.paper',
65
+ color: 'text.primary',
66
+ boxShadow: 2,
67
67
  borderRadius: 2,
68
68
  padding: '10px 16px',
69
69
  fontSize: 14,
70
70
  maxWidth: 400,
71
71
  minWidth: 240,
72
72
  wordBreak: 'break-word',
73
- border: (theme) => (theme.palette.mode === 'dark' ? '1px solid #3a3f48' : '1px solid #e0e0e0'),
73
+ border: '1px solid',
74
+ borderColor: 'divider',
74
75
  '& .MuiTooltip-arrow': {
75
- color: (theme) => (theme.palette.mode === 'dark' ? '#2a2e37' : '#ffffff'),
76
+ color: 'background.paper',
76
77
  '&::before': {
77
- border: (theme) => (theme.palette.mode === 'dark' ? '1px solid #3a3f48' : '1px solid #e0e0e0'),
78
- backgroundColor: (theme) => (theme.palette.mode === 'dark' ? '#2a2e37' : '#ffffff'),
78
+ border: '1px solid',
79
+ borderColor: 'grey.200',
80
+ backgroundColor: 'background.paper',
79
81
  },
80
82
  },
81
83
  },
@@ -100,7 +100,7 @@ export function Download({ data }: { data: TInvoiceExpanded }) {
100
100
  size="small"
101
101
  onClick={generatePDF}
102
102
  disabled={!isReady || isGenerating}
103
- sx={{ borderColor: 'var(--stroke-border-base, #EFF1F5)' }}>
103
+ sx={{ borderColor: 'grey.100' }}>
104
104
  {isGenerating ? (
105
105
  <Box sx={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
106
106
  <CircularProgress size={16} sx={{ color: 'inherit' }} />
@@ -10,7 +10,7 @@ import { useSessionContext } from '../../contexts/session';
10
10
 
11
11
  const Root = styled(Dashboard)<{ padding: string }>`
12
12
  width: 100%;
13
- background-color: white;
13
+ background-color: ${({ theme }) => theme.palette.background.default};
14
14
 
15
15
  > .dashboard-body > .dashboard-main {
16
16
  > .dashboard-content {
@@ -35,7 +35,7 @@ const Root = styled(Dashboard)<{ padding: string }>`
35
35
  }
36
36
 
37
37
  .MuiTabs-scroller {
38
- border-bottom: 1px solid #eee;
38
+ border-bottom: 1px solid ${({ theme }) => theme.palette.divider};
39
39
  }
40
40
 
41
41
  .page-content {
@@ -110,8 +110,9 @@ export default function MetadataForm({
110
110
  <IconButton
111
111
  onClick={() => metadata.remove(index)}
112
112
  sx={{
113
- border: '1px solid var(--stroke-border-base, #EFF1F5)',
114
- borderRadius: 'var(--radius-m, 8px)',
113
+ border: '1px solid',
114
+ borderColor: 'grey.100',
115
+ borderRadius: 1,
115
116
  padding: '8px',
116
117
  }}>
117
118
  <DeleteOutlineOutlined color="error" sx={{ opacity: 0.75 }} />
@@ -18,7 +18,7 @@ export default function MetadataList({
18
18
  if (isEmpty(data)) {
19
19
  return (
20
20
  <Box sx={{ textAlign: 'center' }}>
21
- <Typography color="primary" fontWeight={500}>
21
+ <Typography color="text.primary" fontWeight={500}>
22
22
  {t('common.metadata.empty')}
23
23
  </Typography>
24
24
  <Typography color="text.lighter">{t('common.metadata.emptyTip')}</Typography>
@@ -6,7 +6,6 @@ export default function Chrome({ children, ...props }: any) {
6
6
  }
7
7
 
8
8
  const Root = styled(Box)`
9
- background-color: #fcfeff;
10
9
  border-radius: 8px;
11
10
  margin-top: 40px;
12
11
  position: relative;
@@ -54,7 +54,7 @@ export default function LineItem({ prefix, product, valid, onUpdate, onRemove }:
54
54
  p: 2,
55
55
  borderWidth: valid ? 1 : 2,
56
56
  borderStyle: 'solid',
57
- borderColor: valid ? '#eee' : 'error.main',
57
+ borderColor: valid ? 'grey.100' : 'error.main',
58
58
  borderRadius: 2,
59
59
  position: 'relative',
60
60
  }}>